content
stringlengths 7
1.05M
| fixed_cases
stringlengths 1
1.28M
|
---|---|
# -*- coding: utf-8 -*-
"""
Created on Thu Nov 12 10:39:07 2020
@author: BK
"""
| """
Created on Thu Nov 12 10:39:07 2020
@author: BK
""" |
#
## https://leetcode.com/problems/longest-substring-without-repeating-characters/
#
class Solution(object):
def lengthOfLongestSubstring(self, s):
"""
:type s: str
:rtype: int
"""
if s is None:
raise ValueError('Parameter should be a String.')
if len(s) < 2:
return len(s)
start = last_max_len = 0
for idx in range(len(s) - 1):
if s[idx + 1] in s[start : idx + 1]:
if idx - start + 1 > last_max_len:
last_max_len = idx - start + 1
start = start + s[start : idx + 1].index(s[idx + 1]) + 1
final_seq_len = len(s) - start
return final_seq_len if final_seq_len > last_max_len else last_max_len
s = Solution();
s.lengthOfLongestSubstring('dvdf')
| class Solution(object):
def length_of_longest_substring(self, s):
"""
:type s: str
:rtype: int
"""
if s is None:
raise value_error('Parameter should be a String.')
if len(s) < 2:
return len(s)
start = last_max_len = 0
for idx in range(len(s) - 1):
if s[idx + 1] in s[start:idx + 1]:
if idx - start + 1 > last_max_len:
last_max_len = idx - start + 1
start = start + s[start:idx + 1].index(s[idx + 1]) + 1
final_seq_len = len(s) - start
return final_seq_len if final_seq_len > last_max_len else last_max_len
s = solution()
s.lengthOfLongestSubstring('dvdf') |
def findDecision(obj): #obj[0]: Passanger, obj[1]: Weather, obj[2]: Time, obj[3]: Coupon, obj[4]: Coupon_validity, obj[5]: Gender, obj[6]: Age, obj[7]: Maritalstatus, obj[8]: Children, obj[9]: Education, obj[10]: Occupation, obj[11]: Income, obj[12]: Bar, obj[13]: Coffeehouse, obj[14]: Restaurant20to50, obj[15]: Direction_same, obj[16]: Distance
# {"feature": "Occupation", "instances": 85, "metric_value": 0.9879, "depth": 1}
if obj[10]<=19:
# {"feature": "Education", "instances": 80, "metric_value": 0.971, "depth": 2}
if obj[9]<=2:
# {"feature": "Restaurant20to50", "instances": 60, "metric_value": 0.9183, "depth": 3}
if obj[14]<=2.0:
# {"feature": "Maritalstatus", "instances": 56, "metric_value": 0.9403, "depth": 4}
if obj[7]>0:
# {"feature": "Age", "instances": 37, "metric_value": 0.9868, "depth": 5}
if obj[6]<=4:
# {"feature": "Time", "instances": 33, "metric_value": 0.9993, "depth": 6}
if obj[2]<=3:
# {"feature": "Bar", "instances": 25, "metric_value": 0.9896, "depth": 7}
if obj[12]>0.0:
# {"feature": "Coupon", "instances": 14, "metric_value": 0.8631, "depth": 8}
if obj[3]>0:
# {"feature": "Income", "instances": 13, "metric_value": 0.7793, "depth": 9}
if obj[11]<=3:
# {"feature": "Distance", "instances": 10, "metric_value": 0.8813, "depth": 10}
if obj[16]<=2:
# {"feature": "Coffeehouse", "instances": 8, "metric_value": 0.9544, "depth": 11}
if obj[13]>1.0:
# {"feature": "Coupon_validity", "instances": 5, "metric_value": 0.7219, "depth": 12}
if obj[4]>0:
return 'False'
elif obj[4]<=0:
# {"feature": "Passanger", "instances": 2, "metric_value": 1.0, "depth": 13}
if obj[0]<=1:
# {"feature": "Weather", "instances": 2, "metric_value": 1.0, "depth": 14}
if obj[1]<=0:
# {"feature": "Gender", "instances": 2, "metric_value": 1.0, "depth": 15}
if obj[5]<=0:
# {"feature": "Children", "instances": 2, "metric_value": 1.0, "depth": 16}
if obj[8]<=0:
# {"feature": "Direction_same", "instances": 2, "metric_value": 1.0, "depth": 17}
if obj[15]<=0:
return 'True'
else: return 'True'
else: return 'True'
else: return 'True'
else: return 'True'
else: return 'True'
else: return 'True'
elif obj[13]<=1.0:
# {"feature": "Gender", "instances": 3, "metric_value": 0.9183, "depth": 12}
if obj[5]<=0:
return 'True'
elif obj[5]>0:
return 'False'
else: return 'False'
else: return 'True'
elif obj[16]>2:
return 'False'
else: return 'False'
elif obj[11]>3:
return 'False'
else: return 'False'
elif obj[3]<=0:
return 'True'
else: return 'True'
elif obj[12]<=0.0:
# {"feature": "Income", "instances": 11, "metric_value": 0.9457, "depth": 8}
if obj[11]<=6:
# {"feature": "Distance", "instances": 6, "metric_value": 0.9183, "depth": 9}
if obj[16]<=1:
return 'False'
elif obj[16]>1:
# {"feature": "Coupon", "instances": 3, "metric_value": 0.9183, "depth": 10}
if obj[3]>0:
return 'True'
elif obj[3]<=0:
return 'False'
else: return 'False'
else: return 'True'
elif obj[11]>6:
return 'True'
else: return 'True'
else: return 'True'
elif obj[2]>3:
# {"feature": "Coffeehouse", "instances": 8, "metric_value": 0.8113, "depth": 7}
if obj[13]>0.0:
return 'True'
elif obj[13]<=0.0:
# {"feature": "Passanger", "instances": 3, "metric_value": 0.9183, "depth": 8}
if obj[0]<=1:
return 'False'
elif obj[0]>1:
return 'True'
else: return 'True'
else: return 'False'
else: return 'True'
elif obj[6]>4:
return 'True'
else: return 'True'
elif obj[7]<=0:
# {"feature": "Gender", "instances": 19, "metric_value": 0.7425, "depth": 5}
if obj[5]>0:
# {"feature": "Coffeehouse", "instances": 11, "metric_value": 0.9457, "depth": 6}
if obj[13]<=1.0:
# {"feature": "Distance", "instances": 6, "metric_value": 0.9183, "depth": 7}
if obj[16]<=2:
# {"feature": "Passanger", "instances": 5, "metric_value": 0.7219, "depth": 8}
if obj[0]<=1:
return 'False'
elif obj[0]>1:
# {"feature": "Time", "instances": 2, "metric_value": 1.0, "depth": 9}
if obj[2]>2:
return 'False'
elif obj[2]<=2:
return 'True'
else: return 'True'
else: return 'False'
elif obj[16]>2:
return 'True'
else: return 'True'
elif obj[13]>1.0:
return 'True'
else: return 'True'
elif obj[5]<=0:
return 'True'
else: return 'True'
else: return 'True'
elif obj[14]>2.0:
return 'True'
else: return 'True'
elif obj[9]>2:
# {"feature": "Coffeehouse", "instances": 20, "metric_value": 0.971, "depth": 3}
if obj[13]>1.0:
# {"feature": "Gender", "instances": 15, "metric_value": 0.9968, "depth": 4}
if obj[5]>0:
# {"feature": "Income", "instances": 11, "metric_value": 0.9457, "depth": 5}
if obj[11]<=5:
# {"feature": "Direction_same", "instances": 9, "metric_value": 0.7642, "depth": 6}
if obj[15]<=0:
# {"feature": "Distance", "instances": 8, "metric_value": 0.5436, "depth": 7}
if obj[16]>1:
return 'False'
elif obj[16]<=1:
return 'True'
else: return 'True'
elif obj[15]>0:
return 'True'
else: return 'True'
elif obj[11]>5:
return 'True'
else: return 'True'
elif obj[5]<=0:
return 'True'
else: return 'True'
elif obj[13]<=1.0:
return 'False'
else: return 'False'
else: return 'False'
elif obj[10]>19:
return 'False'
else: return 'False'
| def find_decision(obj):
if obj[10] <= 19:
if obj[9] <= 2:
if obj[14] <= 2.0:
if obj[7] > 0:
if obj[6] <= 4:
if obj[2] <= 3:
if obj[12] > 0.0:
if obj[3] > 0:
if obj[11] <= 3:
if obj[16] <= 2:
if obj[13] > 1.0:
if obj[4] > 0:
return 'False'
elif obj[4] <= 0:
if obj[0] <= 1:
if obj[1] <= 0:
if obj[5] <= 0:
if obj[8] <= 0:
if obj[15] <= 0:
return 'True'
else:
return 'True'
else:
return 'True'
else:
return 'True'
else:
return 'True'
else:
return 'True'
else:
return 'True'
elif obj[13] <= 1.0:
if obj[5] <= 0:
return 'True'
elif obj[5] > 0:
return 'False'
else:
return 'False'
else:
return 'True'
elif obj[16] > 2:
return 'False'
else:
return 'False'
elif obj[11] > 3:
return 'False'
else:
return 'False'
elif obj[3] <= 0:
return 'True'
else:
return 'True'
elif obj[12] <= 0.0:
if obj[11] <= 6:
if obj[16] <= 1:
return 'False'
elif obj[16] > 1:
if obj[3] > 0:
return 'True'
elif obj[3] <= 0:
return 'False'
else:
return 'False'
else:
return 'True'
elif obj[11] > 6:
return 'True'
else:
return 'True'
else:
return 'True'
elif obj[2] > 3:
if obj[13] > 0.0:
return 'True'
elif obj[13] <= 0.0:
if obj[0] <= 1:
return 'False'
elif obj[0] > 1:
return 'True'
else:
return 'True'
else:
return 'False'
else:
return 'True'
elif obj[6] > 4:
return 'True'
else:
return 'True'
elif obj[7] <= 0:
if obj[5] > 0:
if obj[13] <= 1.0:
if obj[16] <= 2:
if obj[0] <= 1:
return 'False'
elif obj[0] > 1:
if obj[2] > 2:
return 'False'
elif obj[2] <= 2:
return 'True'
else:
return 'True'
else:
return 'False'
elif obj[16] > 2:
return 'True'
else:
return 'True'
elif obj[13] > 1.0:
return 'True'
else:
return 'True'
elif obj[5] <= 0:
return 'True'
else:
return 'True'
else:
return 'True'
elif obj[14] > 2.0:
return 'True'
else:
return 'True'
elif obj[9] > 2:
if obj[13] > 1.0:
if obj[5] > 0:
if obj[11] <= 5:
if obj[15] <= 0:
if obj[16] > 1:
return 'False'
elif obj[16] <= 1:
return 'True'
else:
return 'True'
elif obj[15] > 0:
return 'True'
else:
return 'True'
elif obj[11] > 5:
return 'True'
else:
return 'True'
elif obj[5] <= 0:
return 'True'
else:
return 'True'
elif obj[13] <= 1.0:
return 'False'
else:
return 'False'
else:
return 'False'
elif obj[10] > 19:
return 'False'
else:
return 'False' |
###Database
#database typy Option:(mongodb, mysql, redis)
DB_TYPE = 'mongdb'
#database ip
DB_HOST = 'localhost'
#database port
DB_PORT = '1'
#username
#USERNAME = None
#passward
#PASSWARD = None
#database name
DB_DBNAME = 'quickspy'
###
| db_type = 'mongdb'
db_host = 'localhost'
db_port = '1'
db_dbname = 'quickspy' |
x = 1
while True:
x = input("Number:\n> ")
if int(x) == 0:
break
| x = 1
while True:
x = input('Number:\n> ')
if int(x) == 0:
break |
#!/usr/bin/env python
# coding: utf-8
# # *section 4: Strings*
#
# ### writer : Faranak Alikhah 1954128
# ### 12.Check Subset:
#
#
# In[ ]:
num_testCase=int(input())
for i in range(num_testCase):
num_testCase1=int(input())
a=set(input().split())
num_testCase2=int(input())
b=set(input().split())
print(a.issubset(b))
#
| num_test_case = int(input())
for i in range(num_testCase):
num_test_case1 = int(input())
a = set(input().split())
num_test_case2 = int(input())
b = set(input().split())
print(a.issubset(b)) |
# Exercise 105 - Parsing and Generating Dictionaries
'''Write a program that has a grades() function that can receive multiple grades
from students and will return a dictionary with the following information:
- Number of notes
- The highest grade
- The lowest grade
- The class average
- The situation (optional)
Also add the docstrings of this function for query by the developer.'''
| """Write a program that has a grades() function that can receive multiple grades
from students and will return a dictionary with the following information:
- Number of notes
- The highest grade
- The lowest grade
- The class average
- The situation (optional)
Also add the docstrings of this function for query by the developer.""" |
# Test case for PR#183; print of a recursive PyStringMap causes a JVM stack
# overflow.
g = globals()
print(g)
| g = globals()
print(g) |
###########################################################################
#
# Copyright 2019 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://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.
#
###########################################################################
CUSTOM_DIMENSION_SCHEMA = [{
'name': 'accountName',
'type': 'STRING'
}, {
'name': 'accountId',
'type': 'STRING'
}, {
'name': 'propertyName',
'type': 'STRING'
}, {
'name': 'propertyId',
'type': 'STRING'
}, {
'name': 'id',
'type': 'STRING'
}, {
'name': 'name',
'type': 'STRING'
}, {
'name': 'index',
'type': 'STRING'
}, {
'name': 'scope',
'type': 'STRING'
}, {
'name': 'active',
'type': 'STRING'
}, {
'name': 'created',
'type': 'TIMESTAMP'
}, {
'name': 'updated',
'type': 'TIMESTAMP'
}, {
'name': 'date',
'type': 'DATE'
}, {
'name': 'selfLink',
'type': 'STRING'
}]
CUSTOM_METRIC_SCHEMA = [{
'name': 'accountName',
'type': 'STRING'
}, {
'name': 'accountId',
'type': 'STRING'
}, {
'name': 'propertyName',
'type': 'STRING'
}, {
'name': 'propertyId',
'type': 'STRING'
}, {
'name': 'id',
'type': 'STRING'
}, {
'name': 'name',
'type': 'STRING'
}, {
'name': 'index',
'type': 'STRING'
}, {
'name': 'scope',
'type': 'STRING'
}, {
'name': 'active',
'type': 'STRING'
}, {
'name': 'created',
'type': 'TIMESTAMP'
}, {
'name': 'updated',
'type': 'TIMESTAMP'
}, {
'name': 'date',
'type': 'DATE'
}, {
'name': 'selfLink',
'type': 'STRING'
}, {
'name': 'type',
'type': 'STRING'
}, {
'name': 'min_value',
'type': 'INTEGER'
}, {
'name': 'max_value',
'type': 'INTEGER'
}]
VIEW_SCHEMA = [{
'name': 'date',
'type': 'DATE'
}, {
'name': 'id',
'type': 'STRING'
}, {
'name': 'selfLink',
'type': 'STRING'
}, {
'name': 'accountId',
'type': 'STRING'
}, {
'name': 'webPropertyId',
'type': 'STRING'
}, {
'name': 'accountName',
'type': 'STRING'
}, {
'name': 'webPropertyName',
'type': 'STRING'
}, {
'name': 'name',
'type': 'STRING'
}, {
'name': 'currency',
'type': 'STRING'
}, {
'name': 'timezone',
'type': 'STRING'
}, {
'name': 'websiteUrl',
'type': 'STRING'
}, {
'name': 'defaultPage',
'type': 'STRING'
}, {
'name': 'excludeQueryParameters',
'type': 'STRING'
}, {
'name': 'siteSearchQueryParameters',
'type': 'STRING'
}, {
'name': 'stripSiteSearchQueryParameters',
'type': 'BOOLEAN'
}, {
'name': 'siteSearchCategoryParameters',
'type': 'STRING'
}, {
'name': 'stripSiteSearchCategoryParameters',
'type': 'BOOLEAN'
}, {
'name': 'type',
'type': 'STRING'
}, {
'name': 'created',
'type': 'TIMESTAMP'
}, {
'name': 'updated',
'type': 'TIMESTAMP'
}, {
'name': 'eCommerceTracking',
'type': 'BOOLEAN'
}, {
'name': 'enhancedECommerceTracking',
'type': 'BOOLEAN'
}, {
'name': 'botFilteringEnabled',
'type': 'BOOLEAN'
}, {
'name': 'starred',
'type': 'BOOLEAN'
}]
GOAL_SCHEMA = [{
'name': 'date',
'type': 'DATE'
}, {
'name': 'id',
'type': 'STRING'
}, {
'name': 'accountId',
'type': 'STRING'
}, {
'name': 'webPropertyId',
'type': 'STRING'
}, {
'name': 'internalWebPropertyId',
'type': 'STRING'
}, {
'name': 'profileId',
'type': 'STRING'
}, {
'name': 'name',
'type': 'STRING'
}, {
'name': 'accountName',
'type': 'STRING'
}, {
'name': 'webPropertyName',
'type': 'STRING'
}, {
'name': 'profileName',
'type': 'STRING'
}, {
'name': 'value',
'type': 'FLOAT'
}, {
'name': 'active',
'type': 'BOOLEAN'
}, {
'name': 'type',
'type': 'STRING'
}, {
'name': 'created',
'type': 'TIMESTAMP'
}, {
'name': 'updated',
'type': 'TIMESTAMP'
}, {
'name':
'urlDestinationDetails',
'type':
'RECORD',
'fields': [{
'name': 'url',
'type': 'STRING'
}, {
'name': 'caseSensitive',
'type': 'BOOLEAN'
}, {
'name': 'matchType',
'type': 'STRING'
}, {
'name': 'firstStepRequired',
'type': 'BOOLEAN'
}, {
'name':
'steps',
'type':
'RECORD',
'mode':
'REPEATED',
'fields': [{
'name': 'number',
'type': 'INTEGER'
}, {
'name': 'name',
'type': 'STRING'
}, {
'name': 'url',
'type': 'STRING'
}]
}]
}, {
'name':
'visitTimeOnSiteDetails',
'type':
'RECORD',
'fields': [{
'name': 'comparisonType',
'type': 'STRING'
}, {
'name': 'comparisonValue',
'type': 'STRING'
}]
}, {
'name':
'visitNumPagesDetails',
'type':
'RECORD',
'fields': [{
'name': 'comparisonType',
'type': 'STRING'
}, {
'name': 'comparisonValue',
'type': 'STRING'
}]
}, {
'name':
'eventDetails',
'type':
'RECORD',
'fields': [{
'name': 'useEventValue',
'type': 'BOOLEAN'
}, {
'name':
'eventConditions',
'mode':
'REPEATED',
'type':
'RECORD',
'fields': [{
'name': 'type',
'type': 'STRING'
}, {
'name': 'matchType',
'type': 'STRING'
}, {
'name': 'expression',
'type': 'STRING'
}, {
'name': 'comparisonType',
'type': 'STRING'
}, {
'name': 'comparisonValue',
'type': 'STRING'
}]
}]
}]
GOOGLE_ADS_LINK_SCHEMA = [{
'name': 'date',
'type': 'DATE'
}, {
'name': 'id',
'type': 'STRING'
}, {
'name': 'kind',
'type': 'STRING'
}, {
'name': 'selfLink',
'type': 'STRING'
}, {
'name':
'entity',
'type':
'RECORD',
'fields': [{
'name':
'webPropertyRef',
'type':
'RECORD',
'fields': [{
'name': 'id',
'type': 'STRING'
}, {
'name': 'kind',
'type': 'STRING'
}, {
'name': 'href',
'type': 'STRING'
}, {
'name': 'accountId',
'type': 'STRING'
}, {
'name': 'internalWebPropertyId',
'type': 'STRING'
}, {
'name': 'name',
'type': 'STRING'
}]
}]
}, {
'name':
'adWordsAccounts',
'type':
'RECORD',
'mode':
'REPEATED',
'fields': [{
'name': 'kind',
'type': 'STRING'
}, {
'name': 'customerId',
'type': 'STRING'
}, {
'name': 'autoTaggingEnabled',
'type': 'BOOLEAN'
}]
}, {
'name': 'name',
'type': 'STRING'
}, {
'name': 'profileIds',
'type': 'RECORD',
'mode': 'REPEATED',
'fields': [{
'name': 'id',
'type': 'STRING'
}]
}]
REMARKETING_AUDIENCE_SCHEMA = [{
'name': 'date',
'type': 'DATE'
}, {
'name': 'kind',
'type': 'STRING'
}, {
'name': 'id',
'type': 'STRING'
}, {
'name': 'accountId',
'type': 'STRING'
}, {
'name': 'webPropertyId',
'type': 'STRING'
}, {
'name': 'webPropertyName',
'type': 'STRING'
}, {
'name': 'accountName',
'type': 'STRING'
}, {
'name': 'internalWebPropertyId',
'type': 'STRING'
}, {
'name': 'created',
'type': 'TIMESTAMP'
}, {
'name': 'updated',
'type': 'TIMESTAMP'
}, {
'name': 'name',
'type': 'STRING'
}, {
'name': 'description',
'type': 'STRING'
}, {
'name':
'linkedAdAccounts',
'mode':
'REPEATED',
'type':
'RECORD',
'fields': [{
'name': 'kind',
'type': 'STRING'
}, {
'name': 'id',
'type': 'STRING'
}, {
'name': 'accountId',
'type': 'STRING'
}, {
'name': 'webPropertyId',
'type': 'STRING'
}, {
'name': 'internalWebPropertyId',
'type': 'STRING'
}, {
'name': 'remarketingAudienceId',
'type': 'STRING'
}, {
'name': 'linkedAccountId',
'type': 'STRING'
}, {
'name': 'type',
'type': 'STRING'
}, {
'name': 'status',
'type': 'STRING'
}, {
'name': 'eligibleForSearch',
'type': 'BOOLEAN'
}]
}, {
'name': 'linkedViews',
'type': 'RECORD',
'mode': 'REPEATED',
'fields': [{
'name': 'id',
'type': 'STRING'
}]
}, {
'name': 'audienceType',
'type': 'STRING'
}, {
'name':
'audienceDefinition',
'type':
'RECORD',
'fields': [{
'name':
'includeConditions',
'type':
'RECORD',
'fields': [{
'name': 'kind',
'type': 'STRING'
}, {
'name': 'isSmartList',
'type': 'BOOLEAN'
}, {
'name': 'segment',
'type': 'STRING'
}, {
'name': 'membershipDurationDays',
'type': 'INTEGER'
}, {
'name': 'daysToLookBack',
'type': 'INTEGER'
}]
}]
}, {
'name':
'stateBasedAudienceDefinition',
'type':
'RECORD',
'fields': [{
'name':
'includeConditions',
'type':
'RECORD',
'fields': [{
'name': 'kind',
'type': 'STRING'
}, {
'name': 'isSmartList',
'type': 'BOOLEAN'
}, {
'name': 'segment',
'type': 'STRING'
}, {
'name': 'membershipDurationDays',
'type': 'INTEGER'
}, {
'name': 'daysToLookBack',
'type': 'INTEGER'
}]
}, {
'name':
'excludeConditions',
'type':
'RECORD',
'fields': [{
'name': 'segment',
'type': 'STRING'
}, {
'name': 'exclusionDuration',
'type': 'STRING'
}]
}]
}]
ACCOUNT_SUMMARIES_SCHEMA = [{
'name': 'date',
'type': 'DATE'
}, {
'name': 'id',
'type': 'STRING'
}, {
'name': 'kind',
'type': 'STRING'
}, {
'name': 'name',
'type': 'STRING'
}, {
'name': 'starred',
'type': 'BOOLEAN'
}, {
'name':
'webProperties',
'type':
'RECORD',
'mode':
'REPEATED',
'fields': [{
'name': 'kind',
'type': 'STRING'
}, {
'name': 'id',
'type': 'STRING'
}, {
'name': 'name',
'type': 'STRING'
}, {
'name': 'internalWebPropertyId',
'type': 'STRING'
}, {
'name': 'level',
'type': 'STRING'
}, {
'name': 'websiteUrl',
'type': 'STRING'
}, {
'name': 'starred',
'type': 'BOOLEAN'
}, {
'name':
'profiles',
'type':
'RECORD',
'mode':
'REPEATED',
'fields': [
{
'name': 'kind',
'type': 'STRING'
},
{
'name': 'id',
'type': 'STRING'
},
{
'name': 'name',
'type': 'STRING'
},
{
'name': 'type',
'type': 'STRING'
},
{
'name': 'starred',
'type': 'BOOLEAN'
},
]
}]
}]
| custom_dimension_schema = [{'name': 'accountName', 'type': 'STRING'}, {'name': 'accountId', 'type': 'STRING'}, {'name': 'propertyName', 'type': 'STRING'}, {'name': 'propertyId', 'type': 'STRING'}, {'name': 'id', 'type': 'STRING'}, {'name': 'name', 'type': 'STRING'}, {'name': 'index', 'type': 'STRING'}, {'name': 'scope', 'type': 'STRING'}, {'name': 'active', 'type': 'STRING'}, {'name': 'created', 'type': 'TIMESTAMP'}, {'name': 'updated', 'type': 'TIMESTAMP'}, {'name': 'date', 'type': 'DATE'}, {'name': 'selfLink', 'type': 'STRING'}]
custom_metric_schema = [{'name': 'accountName', 'type': 'STRING'}, {'name': 'accountId', 'type': 'STRING'}, {'name': 'propertyName', 'type': 'STRING'}, {'name': 'propertyId', 'type': 'STRING'}, {'name': 'id', 'type': 'STRING'}, {'name': 'name', 'type': 'STRING'}, {'name': 'index', 'type': 'STRING'}, {'name': 'scope', 'type': 'STRING'}, {'name': 'active', 'type': 'STRING'}, {'name': 'created', 'type': 'TIMESTAMP'}, {'name': 'updated', 'type': 'TIMESTAMP'}, {'name': 'date', 'type': 'DATE'}, {'name': 'selfLink', 'type': 'STRING'}, {'name': 'type', 'type': 'STRING'}, {'name': 'min_value', 'type': 'INTEGER'}, {'name': 'max_value', 'type': 'INTEGER'}]
view_schema = [{'name': 'date', 'type': 'DATE'}, {'name': 'id', 'type': 'STRING'}, {'name': 'selfLink', 'type': 'STRING'}, {'name': 'accountId', 'type': 'STRING'}, {'name': 'webPropertyId', 'type': 'STRING'}, {'name': 'accountName', 'type': 'STRING'}, {'name': 'webPropertyName', 'type': 'STRING'}, {'name': 'name', 'type': 'STRING'}, {'name': 'currency', 'type': 'STRING'}, {'name': 'timezone', 'type': 'STRING'}, {'name': 'websiteUrl', 'type': 'STRING'}, {'name': 'defaultPage', 'type': 'STRING'}, {'name': 'excludeQueryParameters', 'type': 'STRING'}, {'name': 'siteSearchQueryParameters', 'type': 'STRING'}, {'name': 'stripSiteSearchQueryParameters', 'type': 'BOOLEAN'}, {'name': 'siteSearchCategoryParameters', 'type': 'STRING'}, {'name': 'stripSiteSearchCategoryParameters', 'type': 'BOOLEAN'}, {'name': 'type', 'type': 'STRING'}, {'name': 'created', 'type': 'TIMESTAMP'}, {'name': 'updated', 'type': 'TIMESTAMP'}, {'name': 'eCommerceTracking', 'type': 'BOOLEAN'}, {'name': 'enhancedECommerceTracking', 'type': 'BOOLEAN'}, {'name': 'botFilteringEnabled', 'type': 'BOOLEAN'}, {'name': 'starred', 'type': 'BOOLEAN'}]
goal_schema = [{'name': 'date', 'type': 'DATE'}, {'name': 'id', 'type': 'STRING'}, {'name': 'accountId', 'type': 'STRING'}, {'name': 'webPropertyId', 'type': 'STRING'}, {'name': 'internalWebPropertyId', 'type': 'STRING'}, {'name': 'profileId', 'type': 'STRING'}, {'name': 'name', 'type': 'STRING'}, {'name': 'accountName', 'type': 'STRING'}, {'name': 'webPropertyName', 'type': 'STRING'}, {'name': 'profileName', 'type': 'STRING'}, {'name': 'value', 'type': 'FLOAT'}, {'name': 'active', 'type': 'BOOLEAN'}, {'name': 'type', 'type': 'STRING'}, {'name': 'created', 'type': 'TIMESTAMP'}, {'name': 'updated', 'type': 'TIMESTAMP'}, {'name': 'urlDestinationDetails', 'type': 'RECORD', 'fields': [{'name': 'url', 'type': 'STRING'}, {'name': 'caseSensitive', 'type': 'BOOLEAN'}, {'name': 'matchType', 'type': 'STRING'}, {'name': 'firstStepRequired', 'type': 'BOOLEAN'}, {'name': 'steps', 'type': 'RECORD', 'mode': 'REPEATED', 'fields': [{'name': 'number', 'type': 'INTEGER'}, {'name': 'name', 'type': 'STRING'}, {'name': 'url', 'type': 'STRING'}]}]}, {'name': 'visitTimeOnSiteDetails', 'type': 'RECORD', 'fields': [{'name': 'comparisonType', 'type': 'STRING'}, {'name': 'comparisonValue', 'type': 'STRING'}]}, {'name': 'visitNumPagesDetails', 'type': 'RECORD', 'fields': [{'name': 'comparisonType', 'type': 'STRING'}, {'name': 'comparisonValue', 'type': 'STRING'}]}, {'name': 'eventDetails', 'type': 'RECORD', 'fields': [{'name': 'useEventValue', 'type': 'BOOLEAN'}, {'name': 'eventConditions', 'mode': 'REPEATED', 'type': 'RECORD', 'fields': [{'name': 'type', 'type': 'STRING'}, {'name': 'matchType', 'type': 'STRING'}, {'name': 'expression', 'type': 'STRING'}, {'name': 'comparisonType', 'type': 'STRING'}, {'name': 'comparisonValue', 'type': 'STRING'}]}]}]
google_ads_link_schema = [{'name': 'date', 'type': 'DATE'}, {'name': 'id', 'type': 'STRING'}, {'name': 'kind', 'type': 'STRING'}, {'name': 'selfLink', 'type': 'STRING'}, {'name': 'entity', 'type': 'RECORD', 'fields': [{'name': 'webPropertyRef', 'type': 'RECORD', 'fields': [{'name': 'id', 'type': 'STRING'}, {'name': 'kind', 'type': 'STRING'}, {'name': 'href', 'type': 'STRING'}, {'name': 'accountId', 'type': 'STRING'}, {'name': 'internalWebPropertyId', 'type': 'STRING'}, {'name': 'name', 'type': 'STRING'}]}]}, {'name': 'adWordsAccounts', 'type': 'RECORD', 'mode': 'REPEATED', 'fields': [{'name': 'kind', 'type': 'STRING'}, {'name': 'customerId', 'type': 'STRING'}, {'name': 'autoTaggingEnabled', 'type': 'BOOLEAN'}]}, {'name': 'name', 'type': 'STRING'}, {'name': 'profileIds', 'type': 'RECORD', 'mode': 'REPEATED', 'fields': [{'name': 'id', 'type': 'STRING'}]}]
remarketing_audience_schema = [{'name': 'date', 'type': 'DATE'}, {'name': 'kind', 'type': 'STRING'}, {'name': 'id', 'type': 'STRING'}, {'name': 'accountId', 'type': 'STRING'}, {'name': 'webPropertyId', 'type': 'STRING'}, {'name': 'webPropertyName', 'type': 'STRING'}, {'name': 'accountName', 'type': 'STRING'}, {'name': 'internalWebPropertyId', 'type': 'STRING'}, {'name': 'created', 'type': 'TIMESTAMP'}, {'name': 'updated', 'type': 'TIMESTAMP'}, {'name': 'name', 'type': 'STRING'}, {'name': 'description', 'type': 'STRING'}, {'name': 'linkedAdAccounts', 'mode': 'REPEATED', 'type': 'RECORD', 'fields': [{'name': 'kind', 'type': 'STRING'}, {'name': 'id', 'type': 'STRING'}, {'name': 'accountId', 'type': 'STRING'}, {'name': 'webPropertyId', 'type': 'STRING'}, {'name': 'internalWebPropertyId', 'type': 'STRING'}, {'name': 'remarketingAudienceId', 'type': 'STRING'}, {'name': 'linkedAccountId', 'type': 'STRING'}, {'name': 'type', 'type': 'STRING'}, {'name': 'status', 'type': 'STRING'}, {'name': 'eligibleForSearch', 'type': 'BOOLEAN'}]}, {'name': 'linkedViews', 'type': 'RECORD', 'mode': 'REPEATED', 'fields': [{'name': 'id', 'type': 'STRING'}]}, {'name': 'audienceType', 'type': 'STRING'}, {'name': 'audienceDefinition', 'type': 'RECORD', 'fields': [{'name': 'includeConditions', 'type': 'RECORD', 'fields': [{'name': 'kind', 'type': 'STRING'}, {'name': 'isSmartList', 'type': 'BOOLEAN'}, {'name': 'segment', 'type': 'STRING'}, {'name': 'membershipDurationDays', 'type': 'INTEGER'}, {'name': 'daysToLookBack', 'type': 'INTEGER'}]}]}, {'name': 'stateBasedAudienceDefinition', 'type': 'RECORD', 'fields': [{'name': 'includeConditions', 'type': 'RECORD', 'fields': [{'name': 'kind', 'type': 'STRING'}, {'name': 'isSmartList', 'type': 'BOOLEAN'}, {'name': 'segment', 'type': 'STRING'}, {'name': 'membershipDurationDays', 'type': 'INTEGER'}, {'name': 'daysToLookBack', 'type': 'INTEGER'}]}, {'name': 'excludeConditions', 'type': 'RECORD', 'fields': [{'name': 'segment', 'type': 'STRING'}, {'name': 'exclusionDuration', 'type': 'STRING'}]}]}]
account_summaries_schema = [{'name': 'date', 'type': 'DATE'}, {'name': 'id', 'type': 'STRING'}, {'name': 'kind', 'type': 'STRING'}, {'name': 'name', 'type': 'STRING'}, {'name': 'starred', 'type': 'BOOLEAN'}, {'name': 'webProperties', 'type': 'RECORD', 'mode': 'REPEATED', 'fields': [{'name': 'kind', 'type': 'STRING'}, {'name': 'id', 'type': 'STRING'}, {'name': 'name', 'type': 'STRING'}, {'name': 'internalWebPropertyId', 'type': 'STRING'}, {'name': 'level', 'type': 'STRING'}, {'name': 'websiteUrl', 'type': 'STRING'}, {'name': 'starred', 'type': 'BOOLEAN'}, {'name': 'profiles', 'type': 'RECORD', 'mode': 'REPEATED', 'fields': [{'name': 'kind', 'type': 'STRING'}, {'name': 'id', 'type': 'STRING'}, {'name': 'name', 'type': 'STRING'}, {'name': 'type', 'type': 'STRING'}, {'name': 'starred', 'type': 'BOOLEAN'}]}]}] |
def score_hand(player_one: list, player_two: list):
if len(player_one) != 7 or len(player_two) != 7:
raise RuntimeError('invalid hands')
# pairs
player_one_pairs = player_one[1]
player_two_pairs = player_two[1]
player_one_has_pairs = len(player_one_pairs)
player_two_has_pairs = len(player_two_pairs)
if player_one_has_pairs and not player_two_has_pairs:
return 1
elif not player_one_has_pairs and player_two_has_pairs:
return -1
elif player_one_has_pairs and player_two_has_pairs:
make_list_same_size(player_one_pairs, player_two_pairs)
player_one_pairs, player_two_pairs = get_high_values(player_one_pairs, player_two_pairs)
player_one_pairs = player_one_pairs if len(player_one_pairs) < 3 else player_one_pairs[:2]
player_two_pairs = player_two_pairs if len(player_two_pairs) < 3 else player_two_pairs[:2]
# get highest two pairs
if len(player_one_pairs) != len(player_two_pairs):
return 1 if len(player_one_pairs) > len(player_two_pairs) else -1
for player_one_pair_value, player_two_pair_value in zip(player_one_pairs, player_two_pairs):
if player_one_pair_value > player_two_pair_value:
return 1
elif player_one_pair_value < player_two_pair_value:
return -1
# high cards
player_one_high_cards = player_one[0]
player_two_high_cards = player_two[0]
for player_one_card, player_two_card in zip(player_one_high_cards, player_two_high_cards):
player_one_card_value = get_card_value(player_one_card)
player_two_card_value = get_card_value(player_two_card)
if player_one_card_value == player_two_card_value:
continue
elif player_one_card_value > player_two_card_value:
return 1
else:
return -1
return 0
def get_high_values(player_one_pairs, player_two_pairs):
player_one_values = []
player_two_values = []
for player_one_pair, player_two_pair in zip(player_one_pairs, player_two_pairs):
player_one_has_pairs = len(player_one_pair)
player_two_has_pairs = len(player_two_pair)
player_one_current_value = get_card_value(player_one_pair[0]) if player_one_has_pairs else 0
player_two_current_value = get_card_value(player_two_pair[0]) if player_two_has_pairs else 0
if player_one_current_value:
player_one_values.append(player_one_current_value)
if player_two_current_value:
player_two_values.append(player_two_current_value)
player_one_values.sort(reverse=True)
player_two_values.sort(reverse=True)
return player_one_values, player_two_values
def make_list_same_size(list_one: list, list_two: list) -> None:
length_list_one = len(list_one)
length_list_two = len(list_two)
while length_list_one != length_list_two:
if length_list_one > length_list_two:
list_two.append([])
length_list_two += 1
else:
list_one.append([])
length_list_one += 1
def get_card_value(card):
return int(card[1:])
| def score_hand(player_one: list, player_two: list):
if len(player_one) != 7 or len(player_two) != 7:
raise runtime_error('invalid hands')
player_one_pairs = player_one[1]
player_two_pairs = player_two[1]
player_one_has_pairs = len(player_one_pairs)
player_two_has_pairs = len(player_two_pairs)
if player_one_has_pairs and (not player_two_has_pairs):
return 1
elif not player_one_has_pairs and player_two_has_pairs:
return -1
elif player_one_has_pairs and player_two_has_pairs:
make_list_same_size(player_one_pairs, player_two_pairs)
(player_one_pairs, player_two_pairs) = get_high_values(player_one_pairs, player_two_pairs)
player_one_pairs = player_one_pairs if len(player_one_pairs) < 3 else player_one_pairs[:2]
player_two_pairs = player_two_pairs if len(player_two_pairs) < 3 else player_two_pairs[:2]
if len(player_one_pairs) != len(player_two_pairs):
return 1 if len(player_one_pairs) > len(player_two_pairs) else -1
for (player_one_pair_value, player_two_pair_value) in zip(player_one_pairs, player_two_pairs):
if player_one_pair_value > player_two_pair_value:
return 1
elif player_one_pair_value < player_two_pair_value:
return -1
player_one_high_cards = player_one[0]
player_two_high_cards = player_two[0]
for (player_one_card, player_two_card) in zip(player_one_high_cards, player_two_high_cards):
player_one_card_value = get_card_value(player_one_card)
player_two_card_value = get_card_value(player_two_card)
if player_one_card_value == player_two_card_value:
continue
elif player_one_card_value > player_two_card_value:
return 1
else:
return -1
return 0
def get_high_values(player_one_pairs, player_two_pairs):
player_one_values = []
player_two_values = []
for (player_one_pair, player_two_pair) in zip(player_one_pairs, player_two_pairs):
player_one_has_pairs = len(player_one_pair)
player_two_has_pairs = len(player_two_pair)
player_one_current_value = get_card_value(player_one_pair[0]) if player_one_has_pairs else 0
player_two_current_value = get_card_value(player_two_pair[0]) if player_two_has_pairs else 0
if player_one_current_value:
player_one_values.append(player_one_current_value)
if player_two_current_value:
player_two_values.append(player_two_current_value)
player_one_values.sort(reverse=True)
player_two_values.sort(reverse=True)
return (player_one_values, player_two_values)
def make_list_same_size(list_one: list, list_two: list) -> None:
length_list_one = len(list_one)
length_list_two = len(list_two)
while length_list_one != length_list_two:
if length_list_one > length_list_two:
list_two.append([])
length_list_two += 1
else:
list_one.append([])
length_list_one += 1
def get_card_value(card):
return int(card[1:]) |
'''
Title : Zipped!
Subdomain : Built-Ins
Domain : Python
Author : codeperfectplus
Created : 17 January 2020
'''
# Enter your code here. Read input from STDIN. Print output to STDOUT
n, x = map(int, input().split())
sheet = []
for _ in range(x):
sheet.append(map(float, input().split()) )
for i in zip(*sheet):
print( sum(i)/len(i) )
| """
Title : Zipped!
Subdomain : Built-Ins
Domain : Python
Author : codeperfectplus
Created : 17 January 2020
"""
(n, x) = map(int, input().split())
sheet = []
for _ in range(x):
sheet.append(map(float, input().split()))
for i in zip(*sheet):
print(sum(i) / len(i)) |
class Solution:
def minIncrementForUnique(self, A: List[int]) -> int:
ans = 0
minAvailable = 0
A.sort()
for a in A:
ans += max(minAvailable - a, 0)
minAvailable = max(minAvailable, a) + 1
return ans
| class Solution:
def min_increment_for_unique(self, A: List[int]) -> int:
ans = 0
min_available = 0
A.sort()
for a in A:
ans += max(minAvailable - a, 0)
min_available = max(minAvailable, a) + 1
return ans |
#
# PySNMP MIB module HPN-ICF-ARP-RATELIMIT-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/HPN-ICF-ARP-RATELIMIT-MIB
# Produced by pysmi-0.3.4 at Wed May 1 13:37:29 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15)
#
Integer, ObjectIdentifier, OctetString = mibBuilder.importSymbols("ASN1", "Integer", "ObjectIdentifier", "OctetString")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
ValueRangeConstraint, ValueSizeConstraint, ConstraintsIntersection, SingleValueConstraint, ConstraintsUnion = mibBuilder.importSymbols("ASN1-REFINEMENT", "ValueRangeConstraint", "ValueSizeConstraint", "ConstraintsIntersection", "SingleValueConstraint", "ConstraintsUnion")
hpnicfCommon, = mibBuilder.importSymbols("HPN-ICF-OID-MIB", "hpnicfCommon")
ifIndex, = mibBuilder.importSymbols("IF-MIB", "ifIndex")
NotificationGroup, ModuleCompliance = mibBuilder.importSymbols("SNMPv2-CONF", "NotificationGroup", "ModuleCompliance")
iso, Gauge32, NotificationType, ObjectIdentity, Integer32, Unsigned32, ModuleIdentity, TimeTicks, Counter64, MibIdentifier, MibScalar, MibTable, MibTableRow, MibTableColumn, IpAddress, Bits, Counter32 = mibBuilder.importSymbols("SNMPv2-SMI", "iso", "Gauge32", "NotificationType", "ObjectIdentity", "Integer32", "Unsigned32", "ModuleIdentity", "TimeTicks", "Counter64", "MibIdentifier", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "IpAddress", "Bits", "Counter32")
TextualConvention, DisplayString = mibBuilder.importSymbols("SNMPv2-TC", "TextualConvention", "DisplayString")
hpnicfARPRatelimit = ModuleIdentity((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 110))
hpnicfARPRatelimit.setRevisions(('2013-10-14 18:00', '2009-12-08 19:12',))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
if mibBuilder.loadTexts: hpnicfARPRatelimit.setRevisionsDescriptions(('Add hpnicfARPRatelimitConfigTable.', 'The initial version of this MIB file.',))
if mibBuilder.loadTexts: hpnicfARPRatelimit.setLastUpdated('201310141800Z')
if mibBuilder.loadTexts: hpnicfARPRatelimit.setOrganization('')
if mibBuilder.loadTexts: hpnicfARPRatelimit.setContactInfo('')
if mibBuilder.loadTexts: hpnicfARPRatelimit.setDescription('This MIB file defines the ARP packet rate limit configuration. The ARP packet rate limit feature monitors and controls the rate of ARP packets delivered to the CPU on a device. The current version supports the monitoring feature only.')
hpnicfARPRatelimitObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 110, 1))
hpnicfARPRatelimitTrap = MibIdentifier((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 110, 1, 1))
hpnicfARPRatelimitConfig = MibIdentifier((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 110, 1, 2))
hpnicfARPRatelimitTraps = MibIdentifier((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 110, 1, 1, 0))
hpnicfARPRatelimitOverspeedTrap = NotificationType((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 110, 1, 1, 0, 1)).setObjects(("HPN-ICF-ARP-RATELIMIT-MIB", "hpnicfARPRatelimitTrapVer"), ("HPN-ICF-ARP-RATELIMIT-MIB", "hpnicfARPRatelimitTrapCount"), ("HPN-ICF-ARP-RATELIMIT-MIB", "hpnicfARPRatelimitTrapMsg"))
if mibBuilder.loadTexts: hpnicfARPRatelimitOverspeedTrap.setStatus('current')
if mibBuilder.loadTexts: hpnicfARPRatelimitOverspeedTrap.setDescription('If the rate of ARP packets delivered to the CPU on a device exceeds the threshold, a trap message is generated and sent to the remote monitoring device.')
hpnicfARPRatelimitTrapObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 110, 1, 1, 1))
hpnicfARPRatelimitTrapVer = MibScalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 110, 1, 1, 1, 1), Unsigned32()).setMaxAccess("accessiblefornotify")
if mibBuilder.loadTexts: hpnicfARPRatelimitTrapVer.setStatus('current')
if mibBuilder.loadTexts: hpnicfARPRatelimitTrapVer.setDescription('The version of trap information.')
hpnicfARPRatelimitTrapCount = MibScalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 110, 1, 1, 1, 2), Unsigned32()).setMaxAccess("accessiblefornotify")
if mibBuilder.loadTexts: hpnicfARPRatelimitTrapCount.setStatus('current')
if mibBuilder.loadTexts: hpnicfARPRatelimitTrapCount.setDescription('Number of cells in the trap message. A trap message may contain multiple cells, each of which indicates that the rate information of ARP packets exceeds the threshold.')
hpnicfARPRatelimitTrapMsg = MibScalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 110, 1, 1, 1, 3), OctetString().subtype(subtypeSpec=ValueSizeConstraint(1, 254))).setMaxAccess("accessiblefornotify")
if mibBuilder.loadTexts: hpnicfARPRatelimitTrapMsg.setStatus('current')
if mibBuilder.loadTexts: hpnicfARPRatelimitTrapMsg.setDescription("This object is the cell section in a trap message sent from a monitored device. This object can contain multiple cells. This object is in the format of '<cell1><cell2>...'. Each cell consists of 17 octets in the format of '<TrapOrigin><IfIndex><OverSpeedValue><Threshold><Interval>'. <TrapOrigin> indicates the source of the trap message and has size of 1 octet. It only supports the following values. 1 - Global. 2 - Interface. <IfIndex> is the index of the interface where the rate of ARP packet exceeds the threshold and has size of 4 octets. It is 0xFFFFFFFF when <TrapOrigin> is 1(Global). <OverSpeedValue> indicates the rate that ARP packets are actually delivered and has size of 4 octets. <Threshold> indicates the threshold that ARP packets can be delivered to CPU and has size of 4 octets. <Interval> indicates the interval that a trap message is sent out and has size of 4 octets.")
hpnicfARPRatelimitConfigTable = MibTable((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 110, 1, 2, 1), )
if mibBuilder.loadTexts: hpnicfARPRatelimitConfigTable.setStatus('current')
if mibBuilder.loadTexts: hpnicfARPRatelimitConfigTable.setDescription('The table is used to configure ARP packet rate limit on interfaces.')
hpnicfARPRatelimitConfigEntry = MibTableRow((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 110, 1, 2, 1, 1), ).setIndexNames((0, "IF-MIB", "ifIndex"))
if mibBuilder.loadTexts: hpnicfARPRatelimitConfigEntry.setStatus('current')
if mibBuilder.loadTexts: hpnicfARPRatelimitConfigEntry.setDescription('The entry of hpnicfARPRatelimitConfigTable.')
hpnicfARPRatelimitValue = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 110, 1, 2, 1, 1, 1), Unsigned32()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: hpnicfARPRatelimitValue.setStatus('current')
if mibBuilder.loadTexts: hpnicfARPRatelimitValue.setDescription('Configure ARP packet rate limit. Support for the value range depends on the device model. If the object is set to 0, the ARP packet rate limit will be disabled.')
mibBuilder.exportSymbols("HPN-ICF-ARP-RATELIMIT-MIB", hpnicfARPRatelimitTrap=hpnicfARPRatelimitTrap, hpnicfARPRatelimitTrapObjects=hpnicfARPRatelimitTrapObjects, hpnicfARPRatelimitValue=hpnicfARPRatelimitValue, hpnicfARPRatelimitConfig=hpnicfARPRatelimitConfig, hpnicfARPRatelimitConfigTable=hpnicfARPRatelimitConfigTable, hpnicfARPRatelimitTrapMsg=hpnicfARPRatelimitTrapMsg, hpnicfARPRatelimitTrapVer=hpnicfARPRatelimitTrapVer, PYSNMP_MODULE_ID=hpnicfARPRatelimit, hpnicfARPRatelimitConfigEntry=hpnicfARPRatelimitConfigEntry, hpnicfARPRatelimit=hpnicfARPRatelimit, hpnicfARPRatelimitOverspeedTrap=hpnicfARPRatelimitOverspeedTrap, hpnicfARPRatelimitObjects=hpnicfARPRatelimitObjects, hpnicfARPRatelimitTraps=hpnicfARPRatelimitTraps, hpnicfARPRatelimitTrapCount=hpnicfARPRatelimitTrapCount)
| (integer, object_identifier, octet_string) = mibBuilder.importSymbols('ASN1', 'Integer', 'ObjectIdentifier', 'OctetString')
(named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues')
(value_range_constraint, value_size_constraint, constraints_intersection, single_value_constraint, constraints_union) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'ValueRangeConstraint', 'ValueSizeConstraint', 'ConstraintsIntersection', 'SingleValueConstraint', 'ConstraintsUnion')
(hpnicf_common,) = mibBuilder.importSymbols('HPN-ICF-OID-MIB', 'hpnicfCommon')
(if_index,) = mibBuilder.importSymbols('IF-MIB', 'ifIndex')
(notification_group, module_compliance) = mibBuilder.importSymbols('SNMPv2-CONF', 'NotificationGroup', 'ModuleCompliance')
(iso, gauge32, notification_type, object_identity, integer32, unsigned32, module_identity, time_ticks, counter64, mib_identifier, mib_scalar, mib_table, mib_table_row, mib_table_column, ip_address, bits, counter32) = mibBuilder.importSymbols('SNMPv2-SMI', 'iso', 'Gauge32', 'NotificationType', 'ObjectIdentity', 'Integer32', 'Unsigned32', 'ModuleIdentity', 'TimeTicks', 'Counter64', 'MibIdentifier', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'IpAddress', 'Bits', 'Counter32')
(textual_convention, display_string) = mibBuilder.importSymbols('SNMPv2-TC', 'TextualConvention', 'DisplayString')
hpnicf_arp_ratelimit = module_identity((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 110))
hpnicfARPRatelimit.setRevisions(('2013-10-14 18:00', '2009-12-08 19:12'))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
if mibBuilder.loadTexts:
hpnicfARPRatelimit.setRevisionsDescriptions(('Add hpnicfARPRatelimitConfigTable.', 'The initial version of this MIB file.'))
if mibBuilder.loadTexts:
hpnicfARPRatelimit.setLastUpdated('201310141800Z')
if mibBuilder.loadTexts:
hpnicfARPRatelimit.setOrganization('')
if mibBuilder.loadTexts:
hpnicfARPRatelimit.setContactInfo('')
if mibBuilder.loadTexts:
hpnicfARPRatelimit.setDescription('This MIB file defines the ARP packet rate limit configuration. The ARP packet rate limit feature monitors and controls the rate of ARP packets delivered to the CPU on a device. The current version supports the monitoring feature only.')
hpnicf_arp_ratelimit_objects = mib_identifier((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 110, 1))
hpnicf_arp_ratelimit_trap = mib_identifier((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 110, 1, 1))
hpnicf_arp_ratelimit_config = mib_identifier((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 110, 1, 2))
hpnicf_arp_ratelimit_traps = mib_identifier((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 110, 1, 1, 0))
hpnicf_arp_ratelimit_overspeed_trap = notification_type((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 110, 1, 1, 0, 1)).setObjects(('HPN-ICF-ARP-RATELIMIT-MIB', 'hpnicfARPRatelimitTrapVer'), ('HPN-ICF-ARP-RATELIMIT-MIB', 'hpnicfARPRatelimitTrapCount'), ('HPN-ICF-ARP-RATELIMIT-MIB', 'hpnicfARPRatelimitTrapMsg'))
if mibBuilder.loadTexts:
hpnicfARPRatelimitOverspeedTrap.setStatus('current')
if mibBuilder.loadTexts:
hpnicfARPRatelimitOverspeedTrap.setDescription('If the rate of ARP packets delivered to the CPU on a device exceeds the threshold, a trap message is generated and sent to the remote monitoring device.')
hpnicf_arp_ratelimit_trap_objects = mib_identifier((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 110, 1, 1, 1))
hpnicf_arp_ratelimit_trap_ver = mib_scalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 110, 1, 1, 1, 1), unsigned32()).setMaxAccess('accessiblefornotify')
if mibBuilder.loadTexts:
hpnicfARPRatelimitTrapVer.setStatus('current')
if mibBuilder.loadTexts:
hpnicfARPRatelimitTrapVer.setDescription('The version of trap information.')
hpnicf_arp_ratelimit_trap_count = mib_scalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 110, 1, 1, 1, 2), unsigned32()).setMaxAccess('accessiblefornotify')
if mibBuilder.loadTexts:
hpnicfARPRatelimitTrapCount.setStatus('current')
if mibBuilder.loadTexts:
hpnicfARPRatelimitTrapCount.setDescription('Number of cells in the trap message. A trap message may contain multiple cells, each of which indicates that the rate information of ARP packets exceeds the threshold.')
hpnicf_arp_ratelimit_trap_msg = mib_scalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 110, 1, 1, 1, 3), octet_string().subtype(subtypeSpec=value_size_constraint(1, 254))).setMaxAccess('accessiblefornotify')
if mibBuilder.loadTexts:
hpnicfARPRatelimitTrapMsg.setStatus('current')
if mibBuilder.loadTexts:
hpnicfARPRatelimitTrapMsg.setDescription("This object is the cell section in a trap message sent from a monitored device. This object can contain multiple cells. This object is in the format of '<cell1><cell2>...'. Each cell consists of 17 octets in the format of '<TrapOrigin><IfIndex><OverSpeedValue><Threshold><Interval>'. <TrapOrigin> indicates the source of the trap message and has size of 1 octet. It only supports the following values. 1 - Global. 2 - Interface. <IfIndex> is the index of the interface where the rate of ARP packet exceeds the threshold and has size of 4 octets. It is 0xFFFFFFFF when <TrapOrigin> is 1(Global). <OverSpeedValue> indicates the rate that ARP packets are actually delivered and has size of 4 octets. <Threshold> indicates the threshold that ARP packets can be delivered to CPU and has size of 4 octets. <Interval> indicates the interval that a trap message is sent out and has size of 4 octets.")
hpnicf_arp_ratelimit_config_table = mib_table((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 110, 1, 2, 1))
if mibBuilder.loadTexts:
hpnicfARPRatelimitConfigTable.setStatus('current')
if mibBuilder.loadTexts:
hpnicfARPRatelimitConfigTable.setDescription('The table is used to configure ARP packet rate limit on interfaces.')
hpnicf_arp_ratelimit_config_entry = mib_table_row((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 110, 1, 2, 1, 1)).setIndexNames((0, 'IF-MIB', 'ifIndex'))
if mibBuilder.loadTexts:
hpnicfARPRatelimitConfigEntry.setStatus('current')
if mibBuilder.loadTexts:
hpnicfARPRatelimitConfigEntry.setDescription('The entry of hpnicfARPRatelimitConfigTable.')
hpnicf_arp_ratelimit_value = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 110, 1, 2, 1, 1, 1), unsigned32()).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
hpnicfARPRatelimitValue.setStatus('current')
if mibBuilder.loadTexts:
hpnicfARPRatelimitValue.setDescription('Configure ARP packet rate limit. Support for the value range depends on the device model. If the object is set to 0, the ARP packet rate limit will be disabled.')
mibBuilder.exportSymbols('HPN-ICF-ARP-RATELIMIT-MIB', hpnicfARPRatelimitTrap=hpnicfARPRatelimitTrap, hpnicfARPRatelimitTrapObjects=hpnicfARPRatelimitTrapObjects, hpnicfARPRatelimitValue=hpnicfARPRatelimitValue, hpnicfARPRatelimitConfig=hpnicfARPRatelimitConfig, hpnicfARPRatelimitConfigTable=hpnicfARPRatelimitConfigTable, hpnicfARPRatelimitTrapMsg=hpnicfARPRatelimitTrapMsg, hpnicfARPRatelimitTrapVer=hpnicfARPRatelimitTrapVer, PYSNMP_MODULE_ID=hpnicfARPRatelimit, hpnicfARPRatelimitConfigEntry=hpnicfARPRatelimitConfigEntry, hpnicfARPRatelimit=hpnicfARPRatelimit, hpnicfARPRatelimitOverspeedTrap=hpnicfARPRatelimitOverspeedTrap, hpnicfARPRatelimitObjects=hpnicfARPRatelimitObjects, hpnicfARPRatelimitTraps=hpnicfARPRatelimitTraps, hpnicfARPRatelimitTrapCount=hpnicfARPRatelimitTrapCount) |
expected_output = {'current-eta-records': 0,
'excess-packets-received': 60,
'excess-syn-received': 0,
'total-eta-fnf': 2,
'total-eta-idp': 2,
'total-eta-records': 4,
'total-eta-splt': 2,
'total-packets-out-of-order': 0,
'total-packets-received': 80,
'total-packets-retransmitted': 0}
| expected_output = {'current-eta-records': 0, 'excess-packets-received': 60, 'excess-syn-received': 0, 'total-eta-fnf': 2, 'total-eta-idp': 2, 'total-eta-records': 4, 'total-eta-splt': 2, 'total-packets-out-of-order': 0, 'total-packets-received': 80, 'total-packets-retransmitted': 0} |
class SomeSingleton(object):
__instance__ = None
def __new__(cls, *args,**kwargs):
if SomeSingleton.__instance__ is None:
SomeSingleton.__instance__ = object.__new__(cls)
return SomeSingleton.__instance__
def __init__(self,f=0,y=0):
self.f = f
self.y= y
def some_func(self,arg):
pass
if __name__== "__main__":
s = SomeSingleton("343","43443")
| class Somesingleton(object):
__instance__ = None
def __new__(cls, *args, **kwargs):
if SomeSingleton.__instance__ is None:
SomeSingleton.__instance__ = object.__new__(cls)
return SomeSingleton.__instance__
def __init__(self, f=0, y=0):
self.f = f
self.y = y
def some_func(self, arg):
pass
if __name__ == '__main__':
s = some_singleton('343', '43443') |
class Solution(object):
def hammingWeight(self, n):
"""
:type n: int
:rtype: int
"""
if n == 1:
return 1
hw = 0
while n != 0:
if n % 2 == 1:
hw += 1
n //= 2
return hw
| class Solution(object):
def hamming_weight(self, n):
"""
:type n: int
:rtype: int
"""
if n == 1:
return 1
hw = 0
while n != 0:
if n % 2 == 1:
hw += 1
n //= 2
return hw |
# -*- coding: utf-8 -*-
"""
Created on Fri Jul 5 03:41:18 2019
@author: srishti
"""
print("Hello")
| """
Created on Fri Jul 5 03:41:18 2019
@author: srishti
"""
print('Hello') |
# import os
# BANK_URL = os.environ['BANK_URL']
# TRANSACTION_URL = os.environ['TRANSACTION_URL']
# UNDERWRITER_URL = os.environ['UNDERWRITER_URL']
# USER_URL = os.environ['USER_URL']
# applications_url = f"http://{UNDERWRITER_URL}/applications"
# registration_url = f"http://{USER_URL}/users/registration"
# login_url = f"http://{USER_URL}/login"
# # Requires bearer token
# bank_url = f"http://{BANK_URL}/banks"
# branch_url = f"http://{BANK_URL}/branches"
# transaction_url = f"http://{TRANSACTION_URL}/transactions"
# Kubernetes ingress
applications_url = "http://localhost/applications"
registration_url = "http://localhost/users/registration"
login_url = "http://localhost/login"
# Requires bearer token
bank_url = "http://localhost/banks"
branch_url = "http://localhost/branches"
transaction_url = "http://localhost/transactions" | applications_url = 'http://localhost/applications'
registration_url = 'http://localhost/users/registration'
login_url = 'http://localhost/login'
bank_url = 'http://localhost/banks'
branch_url = 'http://localhost/branches'
transaction_url = 'http://localhost/transactions' |
# noinspection PyShadowingBuiltins,PyUnusedLocal
def compute(x, y):
"""The problem sets the parameters as integers in the range 0-100.
We'll raise an exception if we receive a type other than int, or if the value
of that int is not in the right range"""
if type(x) != int or type(y) != int:
raise TypeError('The types of both arguments must be ints')
if x < 0 or x > 100 or y < 0 or y > 100:
raise ValueError('The value of each argument must be in the range 0-100')
return x+y
| def compute(x, y):
"""The problem sets the parameters as integers in the range 0-100.
We'll raise an exception if we receive a type other than int, or if the value
of that int is not in the right range"""
if type(x) != int or type(y) != int:
raise type_error('The types of both arguments must be ints')
if x < 0 or x > 100 or y < 0 or (y > 100):
raise value_error('The value of each argument must be in the range 0-100')
return x + y |
for _ in range(int(input())):
a=input()
b=input()
s={}
ans=0
for i in range(26):
s[a[i]]=i+1
temp=[]
for j in b:
temp.append(s[j])
for k in range(len(temp)-1):
ans+=abs(temp[k]-temp[k+1])
print(ans) | for _ in range(int(input())):
a = input()
b = input()
s = {}
ans = 0
for i in range(26):
s[a[i]] = i + 1
temp = []
for j in b:
temp.append(s[j])
for k in range(len(temp) - 1):
ans += abs(temp[k] - temp[k + 1])
print(ans) |
def isPalindrome(str):
result = False
if str == str[::-1]:
result = True
return result
print("Please enter a string: ")
x = input()
flag = isPalindrome(x)
if flag:
print(x, "is a Palindrome")
else:
print(x, "is NOT a Palindrome")
| def is_palindrome(str):
result = False
if str == str[::-1]:
result = True
return result
print('Please enter a string: ')
x = input()
flag = is_palindrome(x)
if flag:
print(x, 'is a Palindrome')
else:
print(x, 'is NOT a Palindrome') |
"""
File: similarity.py
Name: Calvin Chen
----------------------------
This program compares short dna sequence, s2,
with sub sequences of a long dna sequence, s1
The way of approaching this task is the same as
what people are doing in the bio industry.
"""
def main():
"""
First, enter a long DNA sequence and a short DNA sequence.
Second, print out the best match.
"""
long_seq = input('Please give me a DNA sequence to search: ')
long_seq = long_seq.upper()
short_seq = input('What DNA sequence would you like to match? ')
short_seq = short_seq.upper()
print('The best match is ' + best_match(long_seq, short_seq))
def best_match(long_seq, short_seq):
"""
First, know the len of long_seq and short_seq, and know how many times the long_seq
string can loop in order to find out the best match string.
Second, for each loop we count how many characters that look the same in each sub string(sub the long_seq)
and assigns the counts to the max_same.
Third, we return the sub string that includes the most same alphabet to the ans.
:param long_seq: string, the DNA string that you will find which part is similar to short_seq.
:param short_seq: string, the DNA string that you want to match.
:return: ans: string, the best match string in the long_seq DNA string.
"""
l = len(long_seq)
s = len(short_seq)
same = 0
max_same = 0
ans = ''
for i in range(l - s + 1):
sub_l = long_seq[i:i+s]
same = 0
for j in range(s):
if sub_l[j] == short_seq[j]:
same += 1
if same > max_same:
max_same = same
ans = sub_l
return ans
###### DO NOT EDIT CODE BELOW THIS LINE ######
if __name__ == '__main__':
main()
| """
File: similarity.py
Name: Calvin Chen
----------------------------
This program compares short dna sequence, s2,
with sub sequences of a long dna sequence, s1
The way of approaching this task is the same as
what people are doing in the bio industry.
"""
def main():
"""
First, enter a long DNA sequence and a short DNA sequence.
Second, print out the best match.
"""
long_seq = input('Please give me a DNA sequence to search: ')
long_seq = long_seq.upper()
short_seq = input('What DNA sequence would you like to match? ')
short_seq = short_seq.upper()
print('The best match is ' + best_match(long_seq, short_seq))
def best_match(long_seq, short_seq):
"""
First, know the len of long_seq and short_seq, and know how many times the long_seq
string can loop in order to find out the best match string.
Second, for each loop we count how many characters that look the same in each sub string(sub the long_seq)
and assigns the counts to the max_same.
Third, we return the sub string that includes the most same alphabet to the ans.
:param long_seq: string, the DNA string that you will find which part is similar to short_seq.
:param short_seq: string, the DNA string that you want to match.
:return: ans: string, the best match string in the long_seq DNA string.
"""
l = len(long_seq)
s = len(short_seq)
same = 0
max_same = 0
ans = ''
for i in range(l - s + 1):
sub_l = long_seq[i:i + s]
same = 0
for j in range(s):
if sub_l[j] == short_seq[j]:
same += 1
if same > max_same:
max_same = same
ans = sub_l
return ans
if __name__ == '__main__':
main() |
class Node:
def __init__(self, val):
self.val = val
self.next = None
def add(self, val):
if not self.next:
self.next = Node(val)
else:
self.next.add(val)
def remove(self, val):
if self.next.val == val:
self.next = self.next.next
else:
self.next.remove(val)
def __str__(self):
return str(self.val)
class LinkedList:
def __init__(self):
self.head = None
self.length = 0
def push(self, val):
if not self.head:
self.head = Node(val)
else:
self.head.add(val)
self.length += 1
def add_first(self, val):
if not self.head:
self.head = Node(val)
else:
aux = Node(val)
aux.next = self.head
self.head = aux
self.length += 1
def get_length(self):
return self.length
def remove(self, val):
if self.head:
if self.head.val == val:
self.head = self.head.next
elif self.head.next.val == val:
self.head.next = self.head.next.next
else:
self.head.remove(val)
self.length -= 1
def remove_by_index(self, index):
if self.head:
aux = self.head
if index == 0:
self.head = self.head.next
else:
while index > 1 and aux:
aux = aux.next
index -= 1
if index <= 1 and aux.next:
aux.next = aux.next.next
self.length -= 1
def sort(self, criteria, asc=True):
self.head = criteria.sort(self, asc)
def count_elements(self):
aux = self.head
result = {}
while aux:
if aux.val in result.keys():
result[aux.val] += 1
else:
result[aux.val] = 1
aux = aux.next
return result
def __str__(self):
aux = self.head
result = ''
if aux:
result = aux.__str__()
while aux.next:
aux = aux.next
result += ', ' + aux.__str__()
return result
| class Node:
def __init__(self, val):
self.val = val
self.next = None
def add(self, val):
if not self.next:
self.next = node(val)
else:
self.next.add(val)
def remove(self, val):
if self.next.val == val:
self.next = self.next.next
else:
self.next.remove(val)
def __str__(self):
return str(self.val)
class Linkedlist:
def __init__(self):
self.head = None
self.length = 0
def push(self, val):
if not self.head:
self.head = node(val)
else:
self.head.add(val)
self.length += 1
def add_first(self, val):
if not self.head:
self.head = node(val)
else:
aux = node(val)
aux.next = self.head
self.head = aux
self.length += 1
def get_length(self):
return self.length
def remove(self, val):
if self.head:
if self.head.val == val:
self.head = self.head.next
elif self.head.next.val == val:
self.head.next = self.head.next.next
else:
self.head.remove(val)
self.length -= 1
def remove_by_index(self, index):
if self.head:
aux = self.head
if index == 0:
self.head = self.head.next
else:
while index > 1 and aux:
aux = aux.next
index -= 1
if index <= 1 and aux.next:
aux.next = aux.next.next
self.length -= 1
def sort(self, criteria, asc=True):
self.head = criteria.sort(self, asc)
def count_elements(self):
aux = self.head
result = {}
while aux:
if aux.val in result.keys():
result[aux.val] += 1
else:
result[aux.val] = 1
aux = aux.next
return result
def __str__(self):
aux = self.head
result = ''
if aux:
result = aux.__str__()
while aux.next:
aux = aux.next
result += ', ' + aux.__str__()
return result |
"""
@author: magician
@file: getattr_demo.py
@date: 2020/1/14
"""
class LazyDB(object):
"""
LazyDB
"""
def __init__(self):
self.exists = 5
def __getattr__(self, name):
value = 'Value for %s' % name
setattr(self, name, value)
return value
class LoggingLazyDB(LazyDB):
"""
LoggingLazyDB
"""
def __getattr__(self, name):
print('Called __getattr__(%s)' % name)
return super().__getattr__(name)
class ValidateDB(object):
"""
ValidateDB
"""
def __init__(self):
self.exists = 5
def __getattribute__(self, name):
print('Called __getattribute__(%s)' % name)
try:
return super().__getattribute__(name)
except AttributeError:
value = 'Value for %s' % name
setattr(self, name, value)
return value
class MissingPropertyDB(object):
"""
MissingPropertyDB
"""
def __getattr__(self, name):
if name == 'bad_name':
raise AttributeError('%s is missing' % name)
class SavingDB(object):
"""
SavingDB
"""
def __setattr__(self, name, value):
"""
Save some data to the DB log
@param name:
@param value:
@return:
"""
super().__setattr__(name, value)
class LoggingSavingDB(SavingDB):
"""
LoggingSavingDB
"""
def __setattr__(self, name, value):
print('Called __setattr__(%s, %r)' % (name, value))
super().__setattr__(name, value)
class BrokenDictionaryDB(object):
"""
BrokenDictionaryDB
"""
def __init__(self, data):
self._data = data
def __getattribute__(self, name):
print('Called __getattribute__(%s)' % name)
return self._data[name]
class DictionaryDB(object):
"""
DictionaryDB
"""
def __init__(self, data):
self._data = data
def __getattribute__(self, name):
data_dict = super().__getattribute__('_data')
return data_dict[name]
if __name__ == '__main__':
data = LazyDB()
print('Before: ', data.__dict__)
print('foo: ', data.foo)
print('After: ', data.__dict__)
data = LoggingLazyDB()
print('exists: ', data.exists)
print('foo: ', data.foo)
print('foo: ', data.foo)
data = ValidateDB()
print('exists: ', data.exists)
print('foo: ', data.foo)
print('foo: ', data.foo)
data = MissingPropertyDB()
try:
data.bad_name
except Exception as e:
print(e)
data = LoggingLazyDB()
print('Before: ', data.__dict__)
print('foo exists: ', hasattr(data, 'foo'))
print('After: ', data.__dict__)
print('foo exists: ', hasattr(data, 'foo'))
data = ValidateDB()
print('foo exists: ', hasattr(data, 'foo'))
print('foo exists: ', hasattr(data, 'foo'))
data = LoggingSavingDB()
print('Before: ', data.__dict__)
data.foo = 5
print('After: ', data.__dict__)
data.foo = 7
print('Finally: ', data.__dict__)
data = BrokenDictionaryDB({'foo': 3})
try:
data.foo
except Exception as e:
print(e)
data = DictionaryDB({'foo': 3})
print(data.foo)
| """
@author: magician
@file: getattr_demo.py
@date: 2020/1/14
"""
class Lazydb(object):
"""
LazyDB
"""
def __init__(self):
self.exists = 5
def __getattr__(self, name):
value = 'Value for %s' % name
setattr(self, name, value)
return value
class Logginglazydb(LazyDB):
"""
LoggingLazyDB
"""
def __getattr__(self, name):
print('Called __getattr__(%s)' % name)
return super().__getattr__(name)
class Validatedb(object):
"""
ValidateDB
"""
def __init__(self):
self.exists = 5
def __getattribute__(self, name):
print('Called __getattribute__(%s)' % name)
try:
return super().__getattribute__(name)
except AttributeError:
value = 'Value for %s' % name
setattr(self, name, value)
return value
class Missingpropertydb(object):
"""
MissingPropertyDB
"""
def __getattr__(self, name):
if name == 'bad_name':
raise attribute_error('%s is missing' % name)
class Savingdb(object):
"""
SavingDB
"""
def __setattr__(self, name, value):
"""
Save some data to the DB log
@param name:
@param value:
@return:
"""
super().__setattr__(name, value)
class Loggingsavingdb(SavingDB):
"""
LoggingSavingDB
"""
def __setattr__(self, name, value):
print('Called __setattr__(%s, %r)' % (name, value))
super().__setattr__(name, value)
class Brokendictionarydb(object):
"""
BrokenDictionaryDB
"""
def __init__(self, data):
self._data = data
def __getattribute__(self, name):
print('Called __getattribute__(%s)' % name)
return self._data[name]
class Dictionarydb(object):
"""
DictionaryDB
"""
def __init__(self, data):
self._data = data
def __getattribute__(self, name):
data_dict = super().__getattribute__('_data')
return data_dict[name]
if __name__ == '__main__':
data = lazy_db()
print('Before: ', data.__dict__)
print('foo: ', data.foo)
print('After: ', data.__dict__)
data = logging_lazy_db()
print('exists: ', data.exists)
print('foo: ', data.foo)
print('foo: ', data.foo)
data = validate_db()
print('exists: ', data.exists)
print('foo: ', data.foo)
print('foo: ', data.foo)
data = missing_property_db()
try:
data.bad_name
except Exception as e:
print(e)
data = logging_lazy_db()
print('Before: ', data.__dict__)
print('foo exists: ', hasattr(data, 'foo'))
print('After: ', data.__dict__)
print('foo exists: ', hasattr(data, 'foo'))
data = validate_db()
print('foo exists: ', hasattr(data, 'foo'))
print('foo exists: ', hasattr(data, 'foo'))
data = logging_saving_db()
print('Before: ', data.__dict__)
data.foo = 5
print('After: ', data.__dict__)
data.foo = 7
print('Finally: ', data.__dict__)
data = broken_dictionary_db({'foo': 3})
try:
data.foo
except Exception as e:
print(e)
data = dictionary_db({'foo': 3})
print(data.foo) |
# File: factorial_recursion.py
# Purpose: Example: FActorial using recursion
# Programmer: Amal Shehu
# Course: Practice
# Date: Sunday 28th August 2016, 11:10 PM
num = int(input("Enter a number")) # Convert to an int
def factorial(num):
if (num == 0):
return
else:
return num*factorial(num-1) # Factorial using recursion
result = factorial(num)
print(result)
| num = int(input('Enter a number'))
def factorial(num):
if num == 0:
return
else:
return num * factorial(num - 1)
result = factorial(num)
print(result) |
UNKNOWN_WORD = "<unk>"
embedding_dimension = 50
min_count = 5
window_size = 3
sample = 1e-3
negative = 5
vocab_size = None
train_words = None
# Special parameters
MIN_SENTENCE_LENGTH = 3 | unknown_word = '<unk>'
embedding_dimension = 50
min_count = 5
window_size = 3
sample = 0.001
negative = 5
vocab_size = None
train_words = None
min_sentence_length = 3 |
#!/usr/bin/python
DNB_YEARLY_PERCENTAGE = 2.10 / 100
DNB_MONTHLY_PERCENTAGE = DNB_YEARLY_PERCENTAGE / 12
DNB_FEE = 50
DNB_INITIAL_PAYMENT = 10000
NORDEA_YEARLY_PERCENTAGE = 2.15 / 100
NORDEA_MONTHLY_PERCENTAGE = NORDEA_YEARLY_PERCENTAGE / 12
NORDEA_FEE = 65
NORDEA_INITIAL_PAYMENT = 0
def months_until_paid_out(credit_sum, monthly_payment, initial_payment, monthly_percentage, monthly_fee):
MAX_YEARS = 30
MAX_MONTHS = MAX_YEARS * 12
for month in range(1, MAX_MONTHS):
if month == 1:
credit_sum = credit_sum * (1 + monthly_percentage) - (monthly_payment - monthly_fee - initial_payment)
else:
credit_sum = credit_sum * (1 + monthly_percentage) - (monthly_payment - monthly_fee)
if credit_sum < 0:
print("You will pay out credit in approximately {} months. Sum left {}".format(month, credit_sum))
return
print("You have to pay way much bigger monthly payment than {}".format(monthly_payment))
return
if __name__ == "__main__":
credit_sum = 3000000
monthly_payment = 12500
print("DNB: ")
months_until_paid_out(credit_sum, monthly_payment, DNB_INITIAL_PAYMENT, DNB_MONTHLY_PERCENTAGE, DNB_FEE)
print("NORDEA: ")
months_until_paid_out(credit_sum, monthly_payment, NORDEA_INITIAL_PAYMENT, NORDEA_MONTHLY_PERCENTAGE, NORDEA_FEE)
| dnb_yearly_percentage = 2.1 / 100
dnb_monthly_percentage = DNB_YEARLY_PERCENTAGE / 12
dnb_fee = 50
dnb_initial_payment = 10000
nordea_yearly_percentage = 2.15 / 100
nordea_monthly_percentage = NORDEA_YEARLY_PERCENTAGE / 12
nordea_fee = 65
nordea_initial_payment = 0
def months_until_paid_out(credit_sum, monthly_payment, initial_payment, monthly_percentage, monthly_fee):
max_years = 30
max_months = MAX_YEARS * 12
for month in range(1, MAX_MONTHS):
if month == 1:
credit_sum = credit_sum * (1 + monthly_percentage) - (monthly_payment - monthly_fee - initial_payment)
else:
credit_sum = credit_sum * (1 + monthly_percentage) - (monthly_payment - monthly_fee)
if credit_sum < 0:
print('You will pay out credit in approximately {} months. Sum left {}'.format(month, credit_sum))
return
print('You have to pay way much bigger monthly payment than {}'.format(monthly_payment))
return
if __name__ == '__main__':
credit_sum = 3000000
monthly_payment = 12500
print('DNB: ')
months_until_paid_out(credit_sum, monthly_payment, DNB_INITIAL_PAYMENT, DNB_MONTHLY_PERCENTAGE, DNB_FEE)
print('NORDEA: ')
months_until_paid_out(credit_sum, monthly_payment, NORDEA_INITIAL_PAYMENT, NORDEA_MONTHLY_PERCENTAGE, NORDEA_FEE) |
text="ANCHE TU BRUTO FIGLIO MIO?";
s=4;
result="";
text=text.upper();
for i in range(len(text)):
c = text[i];
if(c.isupper()):
result+=chr((ord(c)+s-65)%26+65);
else:
result+=chr((ord(c)+s-97)%26+97);
print(result);
| text = 'ANCHE TU BRUTO FIGLIO MIO?'
s = 4
result = ''
text = text.upper()
for i in range(len(text)):
c = text[i]
if c.isupper():
result += chr((ord(c) + s - 65) % 26 + 65)
else:
result += chr((ord(c) + s - 97) % 26 + 97)
print(result) |
# -*- encoding: utf-8 -*-
'''
@project : LeetCode
@File : diameterOfBinaryTree.py
@Contact : 9824373@qq.com
@Desc :
@Modify Time @Author @Version @Desciption
------------ ------- -------- -----------
2020-03-10 zhan 1.0 None
'''
# Definition for a binary tree node.
class TreeNode:
def __init__(self, x):
self.val = x
self.left = None
self.right = None
class Solution:
def diameterOfBinaryTree(self, root: TreeNode) -> int:
if root == None: return 0
ans = self.divideConquer(root)
return ans[0]
def divideConquer(self,root):
if root.left == None and root.right == None: return 0,1
if root.left:
leftDiameter, leftDepth = self.divideConquer(root.left)
else:
leftDiameter, leftDepth = -1, 0
if root.right:
rightDiameter, rightDepth = self.divideConquer(root.right)
else:
rightDiameter, rightDepth = -1, 0
diameter = max(leftDiameter,rightDiameter,leftDepth+rightDepth)
return diameter, max(leftDepth,rightDepth) + 1
if __name__ == '__main__':
[1, 2, 3, 4, 5]
leftChild = TreeNode(2)
leftChild.left = TreeNode(4)
leftChild.right = TreeNode(5)
root = TreeNode(1)
root.left = leftChild
root.right = TreeNode(3)
ans = Solution().diameterOfBinaryTree(root)
print(ans)
| """
@project : LeetCode
@File : diameterOfBinaryTree.py
@Contact : 9824373@qq.com
@Desc :
@Modify Time @Author @Version @Desciption
------------ ------- -------- -----------
2020-03-10 zhan 1.0 None
"""
class Treenode:
def __init__(self, x):
self.val = x
self.left = None
self.right = None
class Solution:
def diameter_of_binary_tree(self, root: TreeNode) -> int:
if root == None:
return 0
ans = self.divideConquer(root)
return ans[0]
def divide_conquer(self, root):
if root.left == None and root.right == None:
return (0, 1)
if root.left:
(left_diameter, left_depth) = self.divideConquer(root.left)
else:
(left_diameter, left_depth) = (-1, 0)
if root.right:
(right_diameter, right_depth) = self.divideConquer(root.right)
else:
(right_diameter, right_depth) = (-1, 0)
diameter = max(leftDiameter, rightDiameter, leftDepth + rightDepth)
return (diameter, max(leftDepth, rightDepth) + 1)
if __name__ == '__main__':
[1, 2, 3, 4, 5]
left_child = tree_node(2)
leftChild.left = tree_node(4)
leftChild.right = tree_node(5)
root = tree_node(1)
root.left = leftChild
root.right = tree_node(3)
ans = solution().diameterOfBinaryTree(root)
print(ans) |
#!/usr/bin/env python
# -- coding: utf-8 --
"""
Copyright (c) 2019. All rights reserved.
Created by C. L. Wang on 2020/1/9
"""
dlatents_dir = 'latent_representations'
generated_dir = 'generated_images'
result_dir = 'results'
| """
Copyright (c) 2019. All rights reserved.
Created by C. L. Wang on 2020/1/9
"""
dlatents_dir = 'latent_representations'
generated_dir = 'generated_images'
result_dir = 'results' |
render = ez.Node()
aspect2D = ez.Node()
camera = ez.Camera(parent=render)
camera.y = -20
# Create collision shapes:
# Collision Sphere:
sphere = ez.collision.shapes.Sphere(0.25, parent=render)
sphere.parent = None
sphere.parent = render
# Collide from mask 2:
ez.collision.set_mask(sphere, ez.mask[2])
# Set what sphere will collide to:
ez.collision.set_from_mask(sphere, ez.mask[1])
sphere.pos = 0, 0 , 0
# Show the shape so we can see what it is doing, for dubugging:
sphere.show()
sphere.name = "Sphere"
# Collision Capsule:
capsule = ez.collision.shapes.Capsule((0,0,0), (0,0,1), 0.25, parent=render)
ez.collision.set_mask(capsule, ez.mask[1])
capsule.pos = -4, 0, 0
capsule.show()
capsule.name = "Capsule"
# Collision Box:
box = ez.collision.shapes.Box((0.5, 0.25, 1), origin=(0, 0, 0.5), parent=render)
ez.collision.set_mask(box, ez.mask[1])
box.pos = 4, 0, 0
box.show()
box.name = "Box"
# Rays, they are only used for hitting other objects:
pos = -2, 0 , -1
to_pos = 0, 0, 2
segment = ez.collision.rays.Segment( pos, to_pos, parent=render)
ez.collision.set_from_mask(segment, ez.mask[2])
segment.show()
segment.name = "Segment"
from_pos = 1, 0, 1
towards = 0, 0, -1
ray = ez.collision.rays.Ray( from_pos, towards, parent=render )
ez.collision.set_from_mask(ray, ez.mask[2])
ray.show()
ray.name = "Ray"
pos = 2, 0, 0
direction = 0, 0, 1
line = ez.collision.rays.Line( pos, direction, parent=render)
ez.collision.set_from_mask(line, ez.mask[2])
line.show()
line.name = "line"
# Create a collision handler and add colliders:
handler = ez.collision.Handler()
handler.add_collider(sphere)
handler.add_collider(segment)
handler.add_collider(ray)
handler.add_collider(line)
def input(event):
device, name, state = event
if name == 'escape' and state == 0:
ez.set_scene(ez['menu'])
def logic(dt):
hits = handler.get_collisions(render)
if hits:
for hit in hits:
from_name = hit['FROM'].name
into_name = hit['INTO'].name
text = ez['text']
text.text = "W - move left"
text.text += "\nD - move right\n"
text.text += from_name+" HIT "+into_name+" AT "+str(hit['POS'])
if ez.is_button_down('a'):
if sphere.x > -5:
sphere.x -= 2*dt
if ez.is_button_down('d'):
if sphere.x < 5:
sphere.x += 2*dt
def enter():
ez.window.background_color = 0, 0, 0
L, R, T, B = ez.window.get_aspect2D_edges()
text = ez['text']
text.text = "A - move left"
text.text += "\nD - move right"
text.x = L+0.01
text.y = T-0.08
text.parent = aspect2D
def exit():
pass
| render = ez.Node()
aspect2_d = ez.Node()
camera = ez.Camera(parent=render)
camera.y = -20
sphere = ez.collision.shapes.Sphere(0.25, parent=render)
sphere.parent = None
sphere.parent = render
ez.collision.set_mask(sphere, ez.mask[2])
ez.collision.set_from_mask(sphere, ez.mask[1])
sphere.pos = (0, 0, 0)
sphere.show()
sphere.name = 'Sphere'
capsule = ez.collision.shapes.Capsule((0, 0, 0), (0, 0, 1), 0.25, parent=render)
ez.collision.set_mask(capsule, ez.mask[1])
capsule.pos = (-4, 0, 0)
capsule.show()
capsule.name = 'Capsule'
box = ez.collision.shapes.Box((0.5, 0.25, 1), origin=(0, 0, 0.5), parent=render)
ez.collision.set_mask(box, ez.mask[1])
box.pos = (4, 0, 0)
box.show()
box.name = 'Box'
pos = (-2, 0, -1)
to_pos = (0, 0, 2)
segment = ez.collision.rays.Segment(pos, to_pos, parent=render)
ez.collision.set_from_mask(segment, ez.mask[2])
segment.show()
segment.name = 'Segment'
from_pos = (1, 0, 1)
towards = (0, 0, -1)
ray = ez.collision.rays.Ray(from_pos, towards, parent=render)
ez.collision.set_from_mask(ray, ez.mask[2])
ray.show()
ray.name = 'Ray'
pos = (2, 0, 0)
direction = (0, 0, 1)
line = ez.collision.rays.Line(pos, direction, parent=render)
ez.collision.set_from_mask(line, ez.mask[2])
line.show()
line.name = 'line'
handler = ez.collision.Handler()
handler.add_collider(sphere)
handler.add_collider(segment)
handler.add_collider(ray)
handler.add_collider(line)
def input(event):
(device, name, state) = event
if name == 'escape' and state == 0:
ez.set_scene(ez['menu'])
def logic(dt):
hits = handler.get_collisions(render)
if hits:
for hit in hits:
from_name = hit['FROM'].name
into_name = hit['INTO'].name
text = ez['text']
text.text = 'W - move left'
text.text += '\nD - move right\n'
text.text += from_name + ' HIT ' + into_name + ' AT ' + str(hit['POS'])
if ez.is_button_down('a'):
if sphere.x > -5:
sphere.x -= 2 * dt
if ez.is_button_down('d'):
if sphere.x < 5:
sphere.x += 2 * dt
def enter():
ez.window.background_color = (0, 0, 0)
(l, r, t, b) = ez.window.get_aspect2D_edges()
text = ez['text']
text.text = 'A - move left'
text.text += '\nD - move right'
text.x = L + 0.01
text.y = T - 0.08
text.parent = aspect2D
def exit():
pass |
while True:
senha=int(input('digite sua senha : '))
if senha==2:
print('acesso permitido')
break
else:
print('senha invalida, tente novamente') | while True:
senha = int(input('digite sua senha : '))
if senha == 2:
print('acesso permitido')
break
else:
print('senha invalida, tente novamente') |
#!/usr/bin/env python3
def myFunc(x, y):
if not isinstance(x, (int, float)):
raise TypeError('x has wrong type')
if not isinstance(y, (int, float)):
raise TypeError('y has wrong type')
else:
print(x + y)
myFunc(1, 3)
| def my_func(x, y):
if not isinstance(x, (int, float)):
raise type_error('x has wrong type')
if not isinstance(y, (int, float)):
raise type_error('y has wrong type')
else:
print(x + y)
my_func(1, 3) |
phonetic_alphabet = {"alpha": "A", "adam": "A", "boy": "B", "bravo": "B", "charlie": "C",
"delta": "D", "david": "D", "echo": "E", "edward": "E", "foxtrot": "F", "frank": "F",
"golf": "G", "george": "G", "hotel": "H", "henry": "H", "india": "I", "ida": "I",
"aida": "I", "juliette": "J", "john": "J", "kilo": "K", "king": "K", "lima": "L",
"lincoln": "L", "mike": "M", "mary": "M", "marry": "M", "november": "N", "norah": "N",
"nora": "N", "oscar": "O", "ocean": "O", "papa": "P", "paul": "P", "quebec": "Q",
"queen": "Q", "romeo": "R", "robert": "R", "sierra": "S", "sam": "S", "tango": "T",
"tom": "T", "uniform": "U", "union": "U", "victor": "V", "vector": "V", "whiskey": "W",
"william": "W", "x-ray": "X","yankee": "Y", "young": "Y", "zulu": "Z", "zebra": "Z",
"neiner": "9", "niner": "9", "neither": "9", "alfa": "A"
}
states = {
'alaska': 'AK', 'alabama': 'AL', 'arkansas': 'AR', 'american samoa': 'AS',
'arizona': 'AZ', 'california': 'CA', 'colorado': 'CO', 'connecticut': 'CT',
'district of columbia': 'DC', 'delaware': 'DE', 'florida': 'FL', 'georgia': 'GA',
'guam': 'GU', 'hawaii': 'HI', 'iowa': 'IA', 'idaho': 'ID', 'illinois': 'IL',
'indiana': 'IN', 'kansas': 'KS', 'kentucky': 'KY', 'louisiana': 'LA',
'massachusetts': 'MA', 'maryland': 'MD', 'maine': 'ME', 'main': 'ME', 'michigan': 'MI',
'minnesota': 'MN', 'missouri': 'MO', 'northern mariana islands': 'MP',
'mississippi': 'MS', 'montana': 'MT', 'national': 'NA', 'north carolina': 'NC',
'north dakota': 'ND', 'nebraska': 'NE', 'new hampshire': 'NH', 'new jersey': 'NJ',
'new mexico': 'NM', 'nevada': 'NV', 'new york': 'NY', 'ohio': 'OH', 'oklahoma': 'OK',
'oregon': 'OR', 'pennsylvania': 'PA', 'puerto rico': 'PR', 'rhode island': 'RI',
'south carolina': 'SC', 'south dakota': 'SD', 'tennessee': 'TN', 'texas': 'TX',
'utah': 'UT', 'virginia': 'VA', 'virgin islands': 'VI', 'vermont': 'VT',
'washington': 'WA', 'wisconsin': 'WI', 'west virginia': 'WV', 'wyoming': 'WY'
}
| phonetic_alphabet = {'alpha': 'A', 'adam': 'A', 'boy': 'B', 'bravo': 'B', 'charlie': 'C', 'delta': 'D', 'david': 'D', 'echo': 'E', 'edward': 'E', 'foxtrot': 'F', 'frank': 'F', 'golf': 'G', 'george': 'G', 'hotel': 'H', 'henry': 'H', 'india': 'I', 'ida': 'I', 'aida': 'I', 'juliette': 'J', 'john': 'J', 'kilo': 'K', 'king': 'K', 'lima': 'L', 'lincoln': 'L', 'mike': 'M', 'mary': 'M', 'marry': 'M', 'november': 'N', 'norah': 'N', 'nora': 'N', 'oscar': 'O', 'ocean': 'O', 'papa': 'P', 'paul': 'P', 'quebec': 'Q', 'queen': 'Q', 'romeo': 'R', 'robert': 'R', 'sierra': 'S', 'sam': 'S', 'tango': 'T', 'tom': 'T', 'uniform': 'U', 'union': 'U', 'victor': 'V', 'vector': 'V', 'whiskey': 'W', 'william': 'W', 'x-ray': 'X', 'yankee': 'Y', 'young': 'Y', 'zulu': 'Z', 'zebra': 'Z', 'neiner': '9', 'niner': '9', 'neither': '9', 'alfa': 'A'}
states = {'alaska': 'AK', 'alabama': 'AL', 'arkansas': 'AR', 'american samoa': 'AS', 'arizona': 'AZ', 'california': 'CA', 'colorado': 'CO', 'connecticut': 'CT', 'district of columbia': 'DC', 'delaware': 'DE', 'florida': 'FL', 'georgia': 'GA', 'guam': 'GU', 'hawaii': 'HI', 'iowa': 'IA', 'idaho': 'ID', 'illinois': 'IL', 'indiana': 'IN', 'kansas': 'KS', 'kentucky': 'KY', 'louisiana': 'LA', 'massachusetts': 'MA', 'maryland': 'MD', 'maine': 'ME', 'main': 'ME', 'michigan': 'MI', 'minnesota': 'MN', 'missouri': 'MO', 'northern mariana islands': 'MP', 'mississippi': 'MS', 'montana': 'MT', 'national': 'NA', 'north carolina': 'NC', 'north dakota': 'ND', 'nebraska': 'NE', 'new hampshire': 'NH', 'new jersey': 'NJ', 'new mexico': 'NM', 'nevada': 'NV', 'new york': 'NY', 'ohio': 'OH', 'oklahoma': 'OK', 'oregon': 'OR', 'pennsylvania': 'PA', 'puerto rico': 'PR', 'rhode island': 'RI', 'south carolina': 'SC', 'south dakota': 'SD', 'tennessee': 'TN', 'texas': 'TX', 'utah': 'UT', 'virginia': 'VA', 'virgin islands': 'VI', 'vermont': 'VT', 'washington': 'WA', 'wisconsin': 'WI', 'west virginia': 'WV', 'wyoming': 'WY'} |
def decrypt(ciphertext, s):
pltext = ""
for i in range(len(ciphertext)):
char = ciphertext[i]
if (char.isupper()):
pltext += chr((ord(char) - s-65) % 26 + 65)
else:
pltext += chr((ord(char) - s - 97) % 26 + 97)
return pltext
ciphertext = "EXXEGOEXSRGI"
s = 4
print("Cipher : " + ciphertext)
print("Shift : " + str(s))
print("Plain text: " + decrypt(ciphertext,s)) | def decrypt(ciphertext, s):
pltext = ''
for i in range(len(ciphertext)):
char = ciphertext[i]
if char.isupper():
pltext += chr((ord(char) - s - 65) % 26 + 65)
else:
pltext += chr((ord(char) - s - 97) % 26 + 97)
return pltext
ciphertext = 'EXXEGOEXSRGI'
s = 4
print('Cipher : ' + ciphertext)
print('Shift : ' + str(s))
print('Plain text: ' + decrypt(ciphertext, s)) |
###############################################################################
# Copyright (c) 2017, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory
# Written by Francesco Di Natale, dinatale3@llnl.gov.
#
# LLNL-CODE-734340
# All rights reserved.
# This file is part of MaestroWF, Version: 1.0.0.
#
# For details, see https://github.com/LLNL/maestrowf.
#
# 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.
###############################################################################
"""Module that defines containers for storing various types of information."""
class Record(object):
"""A container class for holding general information."""
def __init__(self):
"""Initialize an empty Record."""
self._info = {}
def get(self, key, default=None):
"""
Get information by key in a record.
:param key: The key to look up in a Record's stored information.
:param default: The default value to return if the key is not found
(Default: None).
:returns: The information labeled by parameter key. Default if key does
not exist.
"""
return self._info.get(key, default)
| """Module that defines containers for storing various types of information."""
class Record(object):
"""A container class for holding general information."""
def __init__(self):
"""Initialize an empty Record."""
self._info = {}
def get(self, key, default=None):
"""
Get information by key in a record.
:param key: The key to look up in a Record's stored information.
:param default: The default value to return if the key is not found
(Default: None).
:returns: The information labeled by parameter key. Default if key does
not exist.
"""
return self._info.get(key, default) |
# A non-empty array A consisting of N integers is given.
# A permutation is a sequence containing each element from 1 to N once, and only once.
# For example, array A such that:
# A[0] = 4
# A[1] = 1
# A[2] = 3
# A[3] = 2
# is a permutation, but array A such that:
# A[0] = 4
# A[1] = 1
# A[2] = 3
# is not a permutation, because value 2 is missing.
# The goal is to check whether array A is a permutation.
# Write a function that, given an array A, returns 1 if array A is a permutation and 0 if it is not.
# Write an efficient algorithm for the following assumptions:
# N is an integer within the range [1..100,000];
# each element of array A is an integer within the range [1..1,000,000,000].
# O(n)t | O(n)s
def permCheck(A):
memo = {}
limit = len(A)
for element in A:
if not 1 <= element <= limit: return 0
else:
if element in memo: return 0
else:
memo[element] = True
return 1
| def perm_check(A):
memo = {}
limit = len(A)
for element in A:
if not 1 <= element <= limit:
return 0
elif element in memo:
return 0
else:
memo[element] = True
return 1 |
ITCH_BASE = "itch.io"
ITCH_URL = f"https://{ITCH_BASE}"
ITCH_API = f"https://api.{ITCH_BASE}"
# Extracts https://user.itch.io/name to {'author': 'user', 'game': 'name'}
ITCH_GAME_URL_REGEX = r"^https:\/\/(?P<author>[\w\d\-_]+).itch.io\/(?P<game>[\w\d\-_]+)$"
ITCH_BROWSER_TYPES = [
"games",
"tools",
"game-assets",
"comics",
"books",
"physical-games",
"soundtracks",
"game-mods",
"misc",
]
| itch_base = 'itch.io'
itch_url = f'https://{ITCH_BASE}'
itch_api = f'https://api.{ITCH_BASE}'
itch_game_url_regex = '^https:\\/\\/(?P<author>[\\w\\d\\-_]+).itch.io\\/(?P<game>[\\w\\d\\-_]+)$'
itch_browser_types = ['games', 'tools', 'game-assets', 'comics', 'books', 'physical-games', 'soundtracks', 'game-mods', 'misc'] |
"""
Tile providers.
This file is autogenerated! It is a python representation of the leaflet
providers defined by the leaflet-providers.js extension to Leaflet
(https://github.com/leaflet-extras/leaflet-providers).
Credit to the leaflet-providers.js project (BSD 2-Clause "Simplified" License)
and the Leaflet Providers contributors.
Generated by parse_leaflet_providers.py at 2019-08-01 from leaflet-providers
at commit 9eb968f8442ea492626c9c8f0dac8ede484e6905 (Bumped version to 1.8.0).
"""
class Bunch(dict):
"""A dict with attribute-access"""
def __getattr__(self, key):
try:
return self.__getitem__(key)
except KeyError:
raise AttributeError(key)
def __dir__(self):
return self.keys()
class TileProvider(Bunch):
"""
A dict with attribute-access and that
can be called to update keys
"""
def __call__(self, **kwargs):
new = TileProvider(self) # takes a copy preserving the class
new.update(kwargs)
return new
providers = Bunch(
OpenStreetMap = Bunch(
Mapnik = TileProvider(
url = 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
max_zoom = 19,
attribution = '(C) OpenStreetMap contributors',
name = 'OpenStreetMap.Mapnik'
),
DE = TileProvider(
url = 'https://{s}.tile.openstreetmap.de/tiles/osmde/{z}/{x}/{y}.png',
max_zoom = 18,
attribution = '(C) OpenStreetMap contributors',
name = 'OpenStreetMap.DE'
),
CH = TileProvider(
url = 'https://tile.osm.ch/switzerland/{z}/{x}/{y}.png',
max_zoom = 18,
attribution = '(C) OpenStreetMap contributors',
bounds = [[45, 5], [48, 11]],
name = 'OpenStreetMap.CH'
),
France = TileProvider(
url = 'https://{s}.tile.openstreetmap.fr/osmfr/{z}/{x}/{y}.png',
max_zoom = 20,
attribution = '(C) Openstreetmap France | (C) OpenStreetMap contributors',
name = 'OpenStreetMap.France'
),
HOT = TileProvider(
url = 'https://{s}.tile.openstreetmap.fr/hot/{z}/{x}/{y}.png',
max_zoom = 19,
attribution = '(C) OpenStreetMap contributors, Tiles style by Humanitarian OpenStreetMap Team hosted by OpenStreetMap France',
name = 'OpenStreetMap.HOT'
),
BZH = TileProvider(
url = 'https://tile.openstreetmap.bzh/br/{z}/{x}/{y}.png',
max_zoom = 19,
attribution = '(C) OpenStreetMap contributors, Tiles courtesy of Breton OpenStreetMap Team',
bounds = [[46.2, -5.5], [50, 0.7]],
name = 'OpenStreetMap.BZH'
)
),
OpenSeaMap = TileProvider(
url = 'https://tiles.openseamap.org/seamark/{z}/{x}/{y}.png',
attribution = 'Map data: (C) OpenSeaMap contributors',
name = 'OpenSeaMap'
),
OpenPtMap = TileProvider(
url = 'http://openptmap.org/tiles/{z}/{x}/{y}.png',
max_zoom = 17,
attribution = 'Map data: (C) OpenPtMap contributors',
name = 'OpenPtMap'
),
OpenTopoMap = TileProvider(
url = 'https://{s}.tile.opentopomap.org/{z}/{x}/{y}.png',
max_zoom = 17,
attribution = 'Map data: (C) OpenStreetMap contributors, SRTM | Map style: (C) OpenTopoMap (CC-BY-SA)',
name = 'OpenTopoMap'
),
OpenRailwayMap = TileProvider(
url = 'https://{s}.tiles.openrailwaymap.org/standard/{z}/{x}/{y}.png',
max_zoom = 19,
attribution = 'Map data: (C) OpenStreetMap contributors | Map style: (C) OpenRailwayMap (CC-BY-SA)',
name = 'OpenRailwayMap'
),
OpenFireMap = TileProvider(
url = 'http://openfiremap.org/hytiles/{z}/{x}/{y}.png',
max_zoom = 19,
attribution = 'Map data: (C) OpenStreetMap contributors | Map style: (C) OpenFireMap (CC-BY-SA)',
name = 'OpenFireMap'
),
SafeCast = TileProvider(
url = 'https://s3.amazonaws.com/te512.safecast.org/{z}/{x}/{y}.png',
max_zoom = 16,
attribution = 'Map data: (C) OpenStreetMap contributors | Map style: (C) SafeCast (CC-BY-SA)',
name = 'SafeCast'
),
Thunderforest = Bunch(
OpenCycleMap = TileProvider(
url = 'https://{s}.tile.thunderforest.com/{variant}/{z}/{x}/{y}.png?apikey={apikey}',
attribution = '(C) Thunderforest, (C) OpenStreetMap contributors',
variant = 'cycle',
apikey = '<insert your api key here>',
max_zoom = 22,
name = 'Thunderforest.OpenCycleMap'
),
Transport = TileProvider(
url = 'https://{s}.tile.thunderforest.com/{variant}/{z}/{x}/{y}.png?apikey={apikey}',
attribution = '(C) Thunderforest, (C) OpenStreetMap contributors',
variant = 'transport',
apikey = '<insert your api key here>',
max_zoom = 22,
name = 'Thunderforest.Transport'
),
TransportDark = TileProvider(
url = 'https://{s}.tile.thunderforest.com/{variant}/{z}/{x}/{y}.png?apikey={apikey}',
attribution = '(C) Thunderforest, (C) OpenStreetMap contributors',
variant = 'transport-dark',
apikey = '<insert your api key here>',
max_zoom = 22,
name = 'Thunderforest.TransportDark'
),
SpinalMap = TileProvider(
url = 'https://{s}.tile.thunderforest.com/{variant}/{z}/{x}/{y}.png?apikey={apikey}',
attribution = '(C) Thunderforest, (C) OpenStreetMap contributors',
variant = 'spinal-map',
apikey = '<insert your api key here>',
max_zoom = 22,
name = 'Thunderforest.SpinalMap'
),
Landscape = TileProvider(
url = 'https://{s}.tile.thunderforest.com/{variant}/{z}/{x}/{y}.png?apikey={apikey}',
attribution = '(C) Thunderforest, (C) OpenStreetMap contributors',
variant = 'landscape',
apikey = '<insert your api key here>',
max_zoom = 22,
name = 'Thunderforest.Landscape'
),
Outdoors = TileProvider(
url = 'https://{s}.tile.thunderforest.com/{variant}/{z}/{x}/{y}.png?apikey={apikey}',
attribution = '(C) Thunderforest, (C) OpenStreetMap contributors',
variant = 'outdoors',
apikey = '<insert your api key here>',
max_zoom = 22,
name = 'Thunderforest.Outdoors'
),
Pioneer = TileProvider(
url = 'https://{s}.tile.thunderforest.com/{variant}/{z}/{x}/{y}.png?apikey={apikey}',
attribution = '(C) Thunderforest, (C) OpenStreetMap contributors',
variant = 'pioneer',
apikey = '<insert your api key here>',
max_zoom = 22,
name = 'Thunderforest.Pioneer'
),
MobileAtlas = TileProvider(
url = 'https://{s}.tile.thunderforest.com/{variant}/{z}/{x}/{y}.png?apikey={apikey}',
attribution = '(C) Thunderforest, (C) OpenStreetMap contributors',
variant = 'mobile-atlas',
apikey = '<insert your api key here>',
max_zoom = 22,
name = 'Thunderforest.MobileAtlas'
),
Neighbourhood = TileProvider(
url = 'https://{s}.tile.thunderforest.com/{variant}/{z}/{x}/{y}.png?apikey={apikey}',
attribution = '(C) Thunderforest, (C) OpenStreetMap contributors',
variant = 'neighbourhood',
apikey = '<insert your api key here>',
max_zoom = 22,
name = 'Thunderforest.Neighbourhood'
)
),
OpenMapSurfer = Bunch(
Roads = TileProvider(
url = 'https://maps.heigit.org/openmapsurfer/tiles/{variant}/webmercator/{z}/{x}/{y}.png',
max_zoom = 19,
variant = 'roads',
attribution = 'Imagery from GIScience Research Group @ University of Heidelberg | Map data (C) OpenStreetMap contributors',
name = 'OpenMapSurfer.Roads'
),
Hybrid = TileProvider(
url = 'https://maps.heigit.org/openmapsurfer/tiles/{variant}/webmercator/{z}/{x}/{y}.png',
max_zoom = 19,
variant = 'hybrid',
attribution = 'Imagery from GIScience Research Group @ University of Heidelberg | Map data (C) OpenStreetMap contributors',
name = 'OpenMapSurfer.Hybrid'
),
AdminBounds = TileProvider(
url = 'https://maps.heigit.org/openmapsurfer/tiles/{variant}/webmercator/{z}/{x}/{y}.png',
max_zoom = 18,
variant = 'adminb',
attribution = 'Imagery from GIScience Research Group @ University of Heidelberg | Map data (C) OpenStreetMap contributors',
name = 'OpenMapSurfer.AdminBounds'
),
ContourLines = TileProvider(
url = 'https://maps.heigit.org/openmapsurfer/tiles/{variant}/webmercator/{z}/{x}/{y}.png',
max_zoom = 18,
variant = 'asterc',
attribution = 'Imagery from GIScience Research Group @ University of Heidelberg | Map data ASTER GDEM',
min_zoom = 13,
name = 'OpenMapSurfer.ContourLines'
),
Hillshade = TileProvider(
url = 'https://maps.heigit.org/openmapsurfer/tiles/{variant}/webmercator/{z}/{x}/{y}.png',
max_zoom = 18,
variant = 'asterh',
attribution = 'Imagery from GIScience Research Group @ University of Heidelberg | Map data ASTER GDEM, SRTM',
name = 'OpenMapSurfer.Hillshade'
),
ElementsAtRisk = TileProvider(
url = 'https://maps.heigit.org/openmapsurfer/tiles/{variant}/webmercator/{z}/{x}/{y}.png',
max_zoom = 19,
variant = 'elements_at_risk',
attribution = 'Imagery from GIScience Research Group @ University of Heidelberg | Map data (C) OpenStreetMap contributors',
name = 'OpenMapSurfer.ElementsAtRisk'
)
),
Hydda = Bunch(
Full = TileProvider(
url = 'https://{s}.tile.openstreetmap.se/hydda/{variant}/{z}/{x}/{y}.png',
max_zoom = 18,
variant = 'full',
attribution = 'Tiles courtesy of OpenStreetMap Sweden -- Map data (C) OpenStreetMap contributors',
name = 'Hydda.Full'
),
Base = TileProvider(
url = 'https://{s}.tile.openstreetmap.se/hydda/{variant}/{z}/{x}/{y}.png',
max_zoom = 18,
variant = 'base',
attribution = 'Tiles courtesy of OpenStreetMap Sweden -- Map data (C) OpenStreetMap contributors',
name = 'Hydda.Base'
),
RoadsAndLabels = TileProvider(
url = 'https://{s}.tile.openstreetmap.se/hydda/{variant}/{z}/{x}/{y}.png',
max_zoom = 18,
variant = 'roads_and_labels',
attribution = 'Tiles courtesy of OpenStreetMap Sweden -- Map data (C) OpenStreetMap contributors',
name = 'Hydda.RoadsAndLabels'
)
),
MapBox = TileProvider(
url = 'https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}{r}.png?access_token={accessToken}',
attribution = '(C) Mapbox (C) OpenStreetMap contributors Improve this map',
subdomains = 'abcd',
id = 'mapbox.streets',
accessToken = '<insert your access token here>',
name = 'MapBox'
),
Stamen = Bunch(
Toner = TileProvider(
url = 'https://stamen-tiles-{s}.a.ssl.fastly.net/{variant}/{z}/{x}/{y}{r}.{ext}',
attribution = 'Map tiles by Stamen Design, CC BY 3.0 -- Map data (C) OpenStreetMap contributors',
subdomains = 'abcd',
min_zoom = 0,
max_zoom = 20,
variant = 'toner',
ext = 'png',
name = 'Stamen.Toner'
),
TonerBackground = TileProvider(
url = 'https://stamen-tiles-{s}.a.ssl.fastly.net/{variant}/{z}/{x}/{y}{r}.{ext}',
attribution = 'Map tiles by Stamen Design, CC BY 3.0 -- Map data (C) OpenStreetMap contributors',
subdomains = 'abcd',
min_zoom = 0,
max_zoom = 20,
variant = 'toner-background',
ext = 'png',
name = 'Stamen.TonerBackground'
),
TonerHybrid = TileProvider(
url = 'https://stamen-tiles-{s}.a.ssl.fastly.net/{variant}/{z}/{x}/{y}{r}.{ext}',
attribution = 'Map tiles by Stamen Design, CC BY 3.0 -- Map data (C) OpenStreetMap contributors',
subdomains = 'abcd',
min_zoom = 0,
max_zoom = 20,
variant = 'toner-hybrid',
ext = 'png',
name = 'Stamen.TonerHybrid'
),
TonerLines = TileProvider(
url = 'https://stamen-tiles-{s}.a.ssl.fastly.net/{variant}/{z}/{x}/{y}{r}.{ext}',
attribution = 'Map tiles by Stamen Design, CC BY 3.0 -- Map data (C) OpenStreetMap contributors',
subdomains = 'abcd',
min_zoom = 0,
max_zoom = 20,
variant = 'toner-lines',
ext = 'png',
name = 'Stamen.TonerLines'
),
TonerLabels = TileProvider(
url = 'https://stamen-tiles-{s}.a.ssl.fastly.net/{variant}/{z}/{x}/{y}{r}.{ext}',
attribution = 'Map tiles by Stamen Design, CC BY 3.0 -- Map data (C) OpenStreetMap contributors',
subdomains = 'abcd',
min_zoom = 0,
max_zoom = 20,
variant = 'toner-labels',
ext = 'png',
name = 'Stamen.TonerLabels'
),
TonerLite = TileProvider(
url = 'https://stamen-tiles-{s}.a.ssl.fastly.net/{variant}/{z}/{x}/{y}{r}.{ext}',
attribution = 'Map tiles by Stamen Design, CC BY 3.0 -- Map data (C) OpenStreetMap contributors',
subdomains = 'abcd',
min_zoom = 0,
max_zoom = 20,
variant = 'toner-lite',
ext = 'png',
name = 'Stamen.TonerLite'
),
Watercolor = TileProvider(
url = 'https://stamen-tiles-{s}.a.ssl.fastly.net/{variant}/{z}/{x}/{y}.{ext}',
attribution = 'Map tiles by Stamen Design, CC BY 3.0 -- Map data (C) OpenStreetMap contributors',
subdomains = 'abcd',
min_zoom = 1,
max_zoom = 16,
variant = 'watercolor',
ext = 'jpg',
name = 'Stamen.Watercolor'
),
Terrain = TileProvider(
url = 'https://stamen-tiles-{s}.a.ssl.fastly.net/{variant}/{z}/{x}/{y}{r}.{ext}',
attribution = 'Map tiles by Stamen Design, CC BY 3.0 -- Map data (C) OpenStreetMap contributors',
subdomains = 'abcd',
min_zoom = 0,
max_zoom = 18,
variant = 'terrain',
ext = 'png',
name = 'Stamen.Terrain'
),
TerrainBackground = TileProvider(
url = 'https://stamen-tiles-{s}.a.ssl.fastly.net/{variant}/{z}/{x}/{y}{r}.{ext}',
attribution = 'Map tiles by Stamen Design, CC BY 3.0 -- Map data (C) OpenStreetMap contributors',
subdomains = 'abcd',
min_zoom = 0,
max_zoom = 18,
variant = 'terrain-background',
ext = 'png',
name = 'Stamen.TerrainBackground'
),
TopOSMRelief = TileProvider(
url = 'https://stamen-tiles-{s}.a.ssl.fastly.net/{variant}/{z}/{x}/{y}.{ext}',
attribution = 'Map tiles by Stamen Design, CC BY 3.0 -- Map data (C) OpenStreetMap contributors',
subdomains = 'abcd',
min_zoom = 0,
max_zoom = 20,
variant = 'toposm-color-relief',
ext = 'jpg',
bounds = [[22, -132], [51, -56]],
name = 'Stamen.TopOSMRelief'
),
TopOSMFeatures = TileProvider(
url = 'https://stamen-tiles-{s}.a.ssl.fastly.net/{variant}/{z}/{x}/{y}{r}.{ext}',
attribution = 'Map tiles by Stamen Design, CC BY 3.0 -- Map data (C) OpenStreetMap contributors',
subdomains = 'abcd',
min_zoom = 0,
max_zoom = 20,
variant = 'toposm-features',
ext = 'png',
bounds = [[22, -132], [51, -56]],
opacity = 0.9,
name = 'Stamen.TopOSMFeatures'
)
),
Esri = Bunch(
WorldStreetMap = TileProvider(
url = 'https://server.arcgisonline.com/ArcGIS/rest/services/{variant}/MapServer/tile/{z}/{y}/{x}',
variant = 'World_Street_Map',
attribution = 'Tiles (C) Esri -- Source: Esri, DeLorme, NAVTEQ, USGS, Intermap, iPC, NRCAN, Esri Japan, METI, Esri China (Hong Kong), Esri (Thailand), TomTom, 2012',
name = 'Esri.WorldStreetMap'
),
DeLorme = TileProvider(
url = 'https://server.arcgisonline.com/ArcGIS/rest/services/{variant}/MapServer/tile/{z}/{y}/{x}',
variant = 'Specialty/DeLorme_World_Base_Map',
attribution = 'Tiles (C) Esri -- Copyright: (C)2012 DeLorme',
min_zoom = 1,
max_zoom = 11,
name = 'Esri.DeLorme'
),
WorldTopoMap = TileProvider(
url = 'https://server.arcgisonline.com/ArcGIS/rest/services/{variant}/MapServer/tile/{z}/{y}/{x}',
variant = 'World_Topo_Map',
attribution = 'Tiles (C) Esri -- Esri, DeLorme, NAVTEQ, TomTom, Intermap, iPC, USGS, FAO, NPS, NRCAN, GeoBase, Kadaster NL, Ordnance Survey, Esri Japan, METI, Esri China (Hong Kong), and the GIS User Community',
name = 'Esri.WorldTopoMap'
),
WorldImagery = TileProvider(
url = 'https://server.arcgisonline.com/ArcGIS/rest/services/{variant}/MapServer/tile/{z}/{y}/{x}',
variant = 'World_Imagery',
attribution = 'Tiles (C) Esri -- Source: Esri, i-cubed, USDA, USGS, AEX, GeoEye, Getmapping, Aerogrid, IGN, IGP, UPR-EGP, and the GIS User Community',
name = 'Esri.WorldImagery'
),
WorldTerrain = TileProvider(
url = 'https://server.arcgisonline.com/ArcGIS/rest/services/{variant}/MapServer/tile/{z}/{y}/{x}',
variant = 'World_Terrain_Base',
attribution = 'Tiles (C) Esri -- Source: USGS, Esri, TANA, DeLorme, and NPS',
max_zoom = 13,
name = 'Esri.WorldTerrain'
),
WorldShadedRelief = TileProvider(
url = 'https://server.arcgisonline.com/ArcGIS/rest/services/{variant}/MapServer/tile/{z}/{y}/{x}',
variant = 'World_Shaded_Relief',
attribution = 'Tiles (C) Esri -- Source: Esri',
max_zoom = 13,
name = 'Esri.WorldShadedRelief'
),
WorldPhysical = TileProvider(
url = 'https://server.arcgisonline.com/ArcGIS/rest/services/{variant}/MapServer/tile/{z}/{y}/{x}',
variant = 'World_Physical_Map',
attribution = 'Tiles (C) Esri -- Source: US National Park Service',
max_zoom = 8,
name = 'Esri.WorldPhysical'
),
OceanBasemap = TileProvider(
url = 'https://server.arcgisonline.com/ArcGIS/rest/services/{variant}/MapServer/tile/{z}/{y}/{x}',
variant = 'Ocean_Basemap',
attribution = 'Tiles (C) Esri -- Sources: GEBCO, NOAA, CHS, OSU, UNH, CSUMB, National Geographic, DeLorme, NAVTEQ, and Esri',
max_zoom = 13,
name = 'Esri.OceanBasemap'
),
NatGeoWorldMap = TileProvider(
url = 'https://server.arcgisonline.com/ArcGIS/rest/services/{variant}/MapServer/tile/{z}/{y}/{x}',
variant = 'NatGeo_World_Map',
attribution = 'Tiles (C) Esri -- National Geographic, Esri, DeLorme, NAVTEQ, UNEP-WCMC, USGS, NASA, ESA, METI, NRCAN, GEBCO, NOAA, iPC',
max_zoom = 16,
name = 'Esri.NatGeoWorldMap'
),
WorldGrayCanvas = TileProvider(
url = 'https://server.arcgisonline.com/ArcGIS/rest/services/{variant}/MapServer/tile/{z}/{y}/{x}',
variant = 'Canvas/World_Light_Gray_Base',
attribution = 'Tiles (C) Esri -- Esri, DeLorme, NAVTEQ',
max_zoom = 16,
name = 'Esri.WorldGrayCanvas'
)
),
OpenWeatherMap = Bunch(
Clouds = TileProvider(
url = 'http://{s}.tile.openweathermap.org/map/{variant}/{z}/{x}/{y}.png?appid={apiKey}',
max_zoom = 19,
attribution = 'Map data (C) OpenWeatherMap',
apiKey = '<insert your api key here>',
opacity = 0.5,
variant = 'clouds',
name = 'OpenWeatherMap.Clouds'
),
CloudsClassic = TileProvider(
url = 'http://{s}.tile.openweathermap.org/map/{variant}/{z}/{x}/{y}.png?appid={apiKey}',
max_zoom = 19,
attribution = 'Map data (C) OpenWeatherMap',
apiKey = '<insert your api key here>',
opacity = 0.5,
variant = 'clouds_cls',
name = 'OpenWeatherMap.CloudsClassic'
),
Precipitation = TileProvider(
url = 'http://{s}.tile.openweathermap.org/map/{variant}/{z}/{x}/{y}.png?appid={apiKey}',
max_zoom = 19,
attribution = 'Map data (C) OpenWeatherMap',
apiKey = '<insert your api key here>',
opacity = 0.5,
variant = 'precipitation',
name = 'OpenWeatherMap.Precipitation'
),
PrecipitationClassic = TileProvider(
url = 'http://{s}.tile.openweathermap.org/map/{variant}/{z}/{x}/{y}.png?appid={apiKey}',
max_zoom = 19,
attribution = 'Map data (C) OpenWeatherMap',
apiKey = '<insert your api key here>',
opacity = 0.5,
variant = 'precipitation_cls',
name = 'OpenWeatherMap.PrecipitationClassic'
),
Rain = TileProvider(
url = 'http://{s}.tile.openweathermap.org/map/{variant}/{z}/{x}/{y}.png?appid={apiKey}',
max_zoom = 19,
attribution = 'Map data (C) OpenWeatherMap',
apiKey = '<insert your api key here>',
opacity = 0.5,
variant = 'rain',
name = 'OpenWeatherMap.Rain'
),
RainClassic = TileProvider(
url = 'http://{s}.tile.openweathermap.org/map/{variant}/{z}/{x}/{y}.png?appid={apiKey}',
max_zoom = 19,
attribution = 'Map data (C) OpenWeatherMap',
apiKey = '<insert your api key here>',
opacity = 0.5,
variant = 'rain_cls',
name = 'OpenWeatherMap.RainClassic'
),
Pressure = TileProvider(
url = 'http://{s}.tile.openweathermap.org/map/{variant}/{z}/{x}/{y}.png?appid={apiKey}',
max_zoom = 19,
attribution = 'Map data (C) OpenWeatherMap',
apiKey = '<insert your api key here>',
opacity = 0.5,
variant = 'pressure',
name = 'OpenWeatherMap.Pressure'
),
PressureContour = TileProvider(
url = 'http://{s}.tile.openweathermap.org/map/{variant}/{z}/{x}/{y}.png?appid={apiKey}',
max_zoom = 19,
attribution = 'Map data (C) OpenWeatherMap',
apiKey = '<insert your api key here>',
opacity = 0.5,
variant = 'pressure_cntr',
name = 'OpenWeatherMap.PressureContour'
),
Wind = TileProvider(
url = 'http://{s}.tile.openweathermap.org/map/{variant}/{z}/{x}/{y}.png?appid={apiKey}',
max_zoom = 19,
attribution = 'Map data (C) OpenWeatherMap',
apiKey = '<insert your api key here>',
opacity = 0.5,
variant = 'wind',
name = 'OpenWeatherMap.Wind'
),
Temperature = TileProvider(
url = 'http://{s}.tile.openweathermap.org/map/{variant}/{z}/{x}/{y}.png?appid={apiKey}',
max_zoom = 19,
attribution = 'Map data (C) OpenWeatherMap',
apiKey = '<insert your api key here>',
opacity = 0.5,
variant = 'temp',
name = 'OpenWeatherMap.Temperature'
),
Snow = TileProvider(
url = 'http://{s}.tile.openweathermap.org/map/{variant}/{z}/{x}/{y}.png?appid={apiKey}',
max_zoom = 19,
attribution = 'Map data (C) OpenWeatherMap',
apiKey = '<insert your api key here>',
opacity = 0.5,
variant = 'snow',
name = 'OpenWeatherMap.Snow'
)
),
HERE = Bunch(
normalDay = TileProvider(
url = 'https://{s}.{base}.maps.api.here.com/maptile/2.1/{type}/{mapID}/{variant}/{z}/{x}/{y}/{size}/{format}?app_id={app_id}&app_code={app_code}&lg={language}',
attribution = 'Map (C) 1987-2019 HERE',
subdomains = '1234',
mapID = 'newest',
app_id = '<insert your app_id here>',
app_code = '<insert your app_code here>',
base = 'base',
variant = 'normal.day',
max_zoom = 20,
type = 'maptile',
language = 'eng',
format = 'png8',
size = '256',
name = 'HERE.normalDay'
),
normalDayCustom = TileProvider(
url = 'https://{s}.{base}.maps.api.here.com/maptile/2.1/{type}/{mapID}/{variant}/{z}/{x}/{y}/{size}/{format}?app_id={app_id}&app_code={app_code}&lg={language}',
attribution = 'Map (C) 1987-2019 HERE',
subdomains = '1234',
mapID = 'newest',
app_id = '<insert your app_id here>',
app_code = '<insert your app_code here>',
base = 'base',
variant = 'normal.day.custom',
max_zoom = 20,
type = 'maptile',
language = 'eng',
format = 'png8',
size = '256',
name = 'HERE.normalDayCustom'
),
normalDayGrey = TileProvider(
url = 'https://{s}.{base}.maps.api.here.com/maptile/2.1/{type}/{mapID}/{variant}/{z}/{x}/{y}/{size}/{format}?app_id={app_id}&app_code={app_code}&lg={language}',
attribution = 'Map (C) 1987-2019 HERE',
subdomains = '1234',
mapID = 'newest',
app_id = '<insert your app_id here>',
app_code = '<insert your app_code here>',
base = 'base',
variant = 'normal.day.grey',
max_zoom = 20,
type = 'maptile',
language = 'eng',
format = 'png8',
size = '256',
name = 'HERE.normalDayGrey'
),
normalDayMobile = TileProvider(
url = 'https://{s}.{base}.maps.api.here.com/maptile/2.1/{type}/{mapID}/{variant}/{z}/{x}/{y}/{size}/{format}?app_id={app_id}&app_code={app_code}&lg={language}',
attribution = 'Map (C) 1987-2019 HERE',
subdomains = '1234',
mapID = 'newest',
app_id = '<insert your app_id here>',
app_code = '<insert your app_code here>',
base = 'base',
variant = 'normal.day.mobile',
max_zoom = 20,
type = 'maptile',
language = 'eng',
format = 'png8',
size = '256',
name = 'HERE.normalDayMobile'
),
normalDayGreyMobile = TileProvider(
url = 'https://{s}.{base}.maps.api.here.com/maptile/2.1/{type}/{mapID}/{variant}/{z}/{x}/{y}/{size}/{format}?app_id={app_id}&app_code={app_code}&lg={language}',
attribution = 'Map (C) 1987-2019 HERE',
subdomains = '1234',
mapID = 'newest',
app_id = '<insert your app_id here>',
app_code = '<insert your app_code here>',
base = 'base',
variant = 'normal.day.grey.mobile',
max_zoom = 20,
type = 'maptile',
language = 'eng',
format = 'png8',
size = '256',
name = 'HERE.normalDayGreyMobile'
),
normalDayTransit = TileProvider(
url = 'https://{s}.{base}.maps.api.here.com/maptile/2.1/{type}/{mapID}/{variant}/{z}/{x}/{y}/{size}/{format}?app_id={app_id}&app_code={app_code}&lg={language}',
attribution = 'Map (C) 1987-2019 HERE',
subdomains = '1234',
mapID = 'newest',
app_id = '<insert your app_id here>',
app_code = '<insert your app_code here>',
base = 'base',
variant = 'normal.day.transit',
max_zoom = 20,
type = 'maptile',
language = 'eng',
format = 'png8',
size = '256',
name = 'HERE.normalDayTransit'
),
normalDayTransitMobile = TileProvider(
url = 'https://{s}.{base}.maps.api.here.com/maptile/2.1/{type}/{mapID}/{variant}/{z}/{x}/{y}/{size}/{format}?app_id={app_id}&app_code={app_code}&lg={language}',
attribution = 'Map (C) 1987-2019 HERE',
subdomains = '1234',
mapID = 'newest',
app_id = '<insert your app_id here>',
app_code = '<insert your app_code here>',
base = 'base',
variant = 'normal.day.transit.mobile',
max_zoom = 20,
type = 'maptile',
language = 'eng',
format = 'png8',
size = '256',
name = 'HERE.normalDayTransitMobile'
),
normalNight = TileProvider(
url = 'https://{s}.{base}.maps.api.here.com/maptile/2.1/{type}/{mapID}/{variant}/{z}/{x}/{y}/{size}/{format}?app_id={app_id}&app_code={app_code}&lg={language}',
attribution = 'Map (C) 1987-2019 HERE',
subdomains = '1234',
mapID = 'newest',
app_id = '<insert your app_id here>',
app_code = '<insert your app_code here>',
base = 'base',
variant = 'normal.night',
max_zoom = 20,
type = 'maptile',
language = 'eng',
format = 'png8',
size = '256',
name = 'HERE.normalNight'
),
normalNightMobile = TileProvider(
url = 'https://{s}.{base}.maps.api.here.com/maptile/2.1/{type}/{mapID}/{variant}/{z}/{x}/{y}/{size}/{format}?app_id={app_id}&app_code={app_code}&lg={language}',
attribution = 'Map (C) 1987-2019 HERE',
subdomains = '1234',
mapID = 'newest',
app_id = '<insert your app_id here>',
app_code = '<insert your app_code here>',
base = 'base',
variant = 'normal.night.mobile',
max_zoom = 20,
type = 'maptile',
language = 'eng',
format = 'png8',
size = '256',
name = 'HERE.normalNightMobile'
),
normalNightGrey = TileProvider(
url = 'https://{s}.{base}.maps.api.here.com/maptile/2.1/{type}/{mapID}/{variant}/{z}/{x}/{y}/{size}/{format}?app_id={app_id}&app_code={app_code}&lg={language}',
attribution = 'Map (C) 1987-2019 HERE',
subdomains = '1234',
mapID = 'newest',
app_id = '<insert your app_id here>',
app_code = '<insert your app_code here>',
base = 'base',
variant = 'normal.night.grey',
max_zoom = 20,
type = 'maptile',
language = 'eng',
format = 'png8',
size = '256',
name = 'HERE.normalNightGrey'
),
normalNightGreyMobile = TileProvider(
url = 'https://{s}.{base}.maps.api.here.com/maptile/2.1/{type}/{mapID}/{variant}/{z}/{x}/{y}/{size}/{format}?app_id={app_id}&app_code={app_code}&lg={language}',
attribution = 'Map (C) 1987-2019 HERE',
subdomains = '1234',
mapID = 'newest',
app_id = '<insert your app_id here>',
app_code = '<insert your app_code here>',
base = 'base',
variant = 'normal.night.grey.mobile',
max_zoom = 20,
type = 'maptile',
language = 'eng',
format = 'png8',
size = '256',
name = 'HERE.normalNightGreyMobile'
),
normalNightTransit = TileProvider(
url = 'https://{s}.{base}.maps.api.here.com/maptile/2.1/{type}/{mapID}/{variant}/{z}/{x}/{y}/{size}/{format}?app_id={app_id}&app_code={app_code}&lg={language}',
attribution = 'Map (C) 1987-2019 HERE',
subdomains = '1234',
mapID = 'newest',
app_id = '<insert your app_id here>',
app_code = '<insert your app_code here>',
base = 'base',
variant = 'normal.night.transit',
max_zoom = 20,
type = 'maptile',
language = 'eng',
format = 'png8',
size = '256',
name = 'HERE.normalNightTransit'
),
normalNightTransitMobile = TileProvider(
url = 'https://{s}.{base}.maps.api.here.com/maptile/2.1/{type}/{mapID}/{variant}/{z}/{x}/{y}/{size}/{format}?app_id={app_id}&app_code={app_code}&lg={language}',
attribution = 'Map (C) 1987-2019 HERE',
subdomains = '1234',
mapID = 'newest',
app_id = '<insert your app_id here>',
app_code = '<insert your app_code here>',
base = 'base',
variant = 'normal.night.transit.mobile',
max_zoom = 20,
type = 'maptile',
language = 'eng',
format = 'png8',
size = '256',
name = 'HERE.normalNightTransitMobile'
),
reducedDay = TileProvider(
url = 'https://{s}.{base}.maps.api.here.com/maptile/2.1/{type}/{mapID}/{variant}/{z}/{x}/{y}/{size}/{format}?app_id={app_id}&app_code={app_code}&lg={language}',
attribution = 'Map (C) 1987-2019 HERE',
subdomains = '1234',
mapID = 'newest',
app_id = '<insert your app_id here>',
app_code = '<insert your app_code here>',
base = 'base',
variant = 'reduced.day',
max_zoom = 20,
type = 'maptile',
language = 'eng',
format = 'png8',
size = '256',
name = 'HERE.reducedDay'
),
reducedNight = TileProvider(
url = 'https://{s}.{base}.maps.api.here.com/maptile/2.1/{type}/{mapID}/{variant}/{z}/{x}/{y}/{size}/{format}?app_id={app_id}&app_code={app_code}&lg={language}',
attribution = 'Map (C) 1987-2019 HERE',
subdomains = '1234',
mapID = 'newest',
app_id = '<insert your app_id here>',
app_code = '<insert your app_code here>',
base = 'base',
variant = 'reduced.night',
max_zoom = 20,
type = 'maptile',
language = 'eng',
format = 'png8',
size = '256',
name = 'HERE.reducedNight'
),
basicMap = TileProvider(
url = 'https://{s}.{base}.maps.api.here.com/maptile/2.1/{type}/{mapID}/{variant}/{z}/{x}/{y}/{size}/{format}?app_id={app_id}&app_code={app_code}&lg={language}',
attribution = 'Map (C) 1987-2019 HERE',
subdomains = '1234',
mapID = 'newest',
app_id = '<insert your app_id here>',
app_code = '<insert your app_code here>',
base = 'base',
variant = 'normal.day',
max_zoom = 20,
type = 'basetile',
language = 'eng',
format = 'png8',
size = '256',
name = 'HERE.basicMap'
),
mapLabels = TileProvider(
url = 'https://{s}.{base}.maps.api.here.com/maptile/2.1/{type}/{mapID}/{variant}/{z}/{x}/{y}/{size}/{format}?app_id={app_id}&app_code={app_code}&lg={language}',
attribution = 'Map (C) 1987-2019 HERE',
subdomains = '1234',
mapID = 'newest',
app_id = '<insert your app_id here>',
app_code = '<insert your app_code here>',
base = 'base',
variant = 'normal.day',
max_zoom = 20,
type = 'labeltile',
language = 'eng',
format = 'png',
size = '256',
name = 'HERE.mapLabels'
),
trafficFlow = TileProvider(
url = 'https://{s}.{base}.maps.api.here.com/maptile/2.1/{type}/{mapID}/{variant}/{z}/{x}/{y}/{size}/{format}?app_id={app_id}&app_code={app_code}&lg={language}',
attribution = 'Map (C) 1987-2019 HERE',
subdomains = '1234',
mapID = 'newest',
app_id = '<insert your app_id here>',
app_code = '<insert your app_code here>',
base = 'traffic',
variant = 'normal.day',
max_zoom = 20,
type = 'flowtile',
language = 'eng',
format = 'png8',
size = '256',
name = 'HERE.trafficFlow'
),
carnavDayGrey = TileProvider(
url = 'https://{s}.{base}.maps.api.here.com/maptile/2.1/{type}/{mapID}/{variant}/{z}/{x}/{y}/{size}/{format}?app_id={app_id}&app_code={app_code}&lg={language}',
attribution = 'Map (C) 1987-2019 HERE',
subdomains = '1234',
mapID = 'newest',
app_id = '<insert your app_id here>',
app_code = '<insert your app_code here>',
base = 'base',
variant = 'carnav.day.grey',
max_zoom = 20,
type = 'maptile',
language = 'eng',
format = 'png8',
size = '256',
name = 'HERE.carnavDayGrey'
),
hybridDay = TileProvider(
url = 'https://{s}.{base}.maps.api.here.com/maptile/2.1/{type}/{mapID}/{variant}/{z}/{x}/{y}/{size}/{format}?app_id={app_id}&app_code={app_code}&lg={language}',
attribution = 'Map (C) 1987-2019 HERE',
subdomains = '1234',
mapID = 'newest',
app_id = '<insert your app_id here>',
app_code = '<insert your app_code here>',
base = 'aerial',
variant = 'hybrid.day',
max_zoom = 20,
type = 'maptile',
language = 'eng',
format = 'png8',
size = '256',
name = 'HERE.hybridDay'
),
hybridDayMobile = TileProvider(
url = 'https://{s}.{base}.maps.api.here.com/maptile/2.1/{type}/{mapID}/{variant}/{z}/{x}/{y}/{size}/{format}?app_id={app_id}&app_code={app_code}&lg={language}',
attribution = 'Map (C) 1987-2019 HERE',
subdomains = '1234',
mapID = 'newest',
app_id = '<insert your app_id here>',
app_code = '<insert your app_code here>',
base = 'aerial',
variant = 'hybrid.day.mobile',
max_zoom = 20,
type = 'maptile',
language = 'eng',
format = 'png8',
size = '256',
name = 'HERE.hybridDayMobile'
),
hybridDayTransit = TileProvider(
url = 'https://{s}.{base}.maps.api.here.com/maptile/2.1/{type}/{mapID}/{variant}/{z}/{x}/{y}/{size}/{format}?app_id={app_id}&app_code={app_code}&lg={language}',
attribution = 'Map (C) 1987-2019 HERE',
subdomains = '1234',
mapID = 'newest',
app_id = '<insert your app_id here>',
app_code = '<insert your app_code here>',
base = 'aerial',
variant = 'hybrid.day.transit',
max_zoom = 20,
type = 'maptile',
language = 'eng',
format = 'png8',
size = '256',
name = 'HERE.hybridDayTransit'
),
hybridDayGrey = TileProvider(
url = 'https://{s}.{base}.maps.api.here.com/maptile/2.1/{type}/{mapID}/{variant}/{z}/{x}/{y}/{size}/{format}?app_id={app_id}&app_code={app_code}&lg={language}',
attribution = 'Map (C) 1987-2019 HERE',
subdomains = '1234',
mapID = 'newest',
app_id = '<insert your app_id here>',
app_code = '<insert your app_code here>',
base = 'aerial',
variant = 'hybrid.grey.day',
max_zoom = 20,
type = 'maptile',
language = 'eng',
format = 'png8',
size = '256',
name = 'HERE.hybridDayGrey'
),
pedestrianDay = TileProvider(
url = 'https://{s}.{base}.maps.api.here.com/maptile/2.1/{type}/{mapID}/{variant}/{z}/{x}/{y}/{size}/{format}?app_id={app_id}&app_code={app_code}&lg={language}',
attribution = 'Map (C) 1987-2019 HERE',
subdomains = '1234',
mapID = 'newest',
app_id = '<insert your app_id here>',
app_code = '<insert your app_code here>',
base = 'base',
variant = 'pedestrian.day',
max_zoom = 20,
type = 'maptile',
language = 'eng',
format = 'png8',
size = '256',
name = 'HERE.pedestrianDay'
),
pedestrianNight = TileProvider(
url = 'https://{s}.{base}.maps.api.here.com/maptile/2.1/{type}/{mapID}/{variant}/{z}/{x}/{y}/{size}/{format}?app_id={app_id}&app_code={app_code}&lg={language}',
attribution = 'Map (C) 1987-2019 HERE',
subdomains = '1234',
mapID = 'newest',
app_id = '<insert your app_id here>',
app_code = '<insert your app_code here>',
base = 'base',
variant = 'pedestrian.night',
max_zoom = 20,
type = 'maptile',
language = 'eng',
format = 'png8',
size = '256',
name = 'HERE.pedestrianNight'
),
satelliteDay = TileProvider(
url = 'https://{s}.{base}.maps.api.here.com/maptile/2.1/{type}/{mapID}/{variant}/{z}/{x}/{y}/{size}/{format}?app_id={app_id}&app_code={app_code}&lg={language}',
attribution = 'Map (C) 1987-2019 HERE',
subdomains = '1234',
mapID = 'newest',
app_id = '<insert your app_id here>',
app_code = '<insert your app_code here>',
base = 'aerial',
variant = 'satellite.day',
max_zoom = 20,
type = 'maptile',
language = 'eng',
format = 'png8',
size = '256',
name = 'HERE.satelliteDay'
),
terrainDay = TileProvider(
url = 'https://{s}.{base}.maps.api.here.com/maptile/2.1/{type}/{mapID}/{variant}/{z}/{x}/{y}/{size}/{format}?app_id={app_id}&app_code={app_code}&lg={language}',
attribution = 'Map (C) 1987-2019 HERE',
subdomains = '1234',
mapID = 'newest',
app_id = '<insert your app_id here>',
app_code = '<insert your app_code here>',
base = 'aerial',
variant = 'terrain.day',
max_zoom = 20,
type = 'maptile',
language = 'eng',
format = 'png8',
size = '256',
name = 'HERE.terrainDay'
),
terrainDayMobile = TileProvider(
url = 'https://{s}.{base}.maps.api.here.com/maptile/2.1/{type}/{mapID}/{variant}/{z}/{x}/{y}/{size}/{format}?app_id={app_id}&app_code={app_code}&lg={language}',
attribution = 'Map (C) 1987-2019 HERE',
subdomains = '1234',
mapID = 'newest',
app_id = '<insert your app_id here>',
app_code = '<insert your app_code here>',
base = 'aerial',
variant = 'terrain.day.mobile',
max_zoom = 20,
type = 'maptile',
language = 'eng',
format = 'png8',
size = '256',
name = 'HERE.terrainDayMobile'
)
),
FreeMapSK = TileProvider(
url = 'http://t{s}.freemap.sk/T/{z}/{x}/{y}.jpeg',
min_zoom = 8,
max_zoom = 16,
subdomains = '1234',
bounds = [[47.204642, 15.996093], [49.830896, 22.576904]],
attribution = '(C) OpenStreetMap contributors, vizualization CC-By-SA 2.0 Freemap.sk',
name = 'FreeMapSK'
),
MtbMap = TileProvider(
url = 'http://tile.mtbmap.cz/mtbmap_tiles/{z}/{x}/{y}.png',
attribution = '(C) OpenStreetMap contributors & USGS',
name = 'MtbMap'
),
CartoDB = Bunch(
Positron = TileProvider(
url = 'https://{s}.basemaps.cartocdn.com/{variant}/{z}/{x}/{y}{r}.png',
attribution = '(C) OpenStreetMap contributors (C) CARTO',
subdomains = 'abcd',
max_zoom = 19,
variant = 'light_all',
name = 'CartoDB.Positron'
),
PositronNoLabels = TileProvider(
url = 'https://{s}.basemaps.cartocdn.com/{variant}/{z}/{x}/{y}{r}.png',
attribution = '(C) OpenStreetMap contributors (C) CARTO',
subdomains = 'abcd',
max_zoom = 19,
variant = 'light_nolabels',
name = 'CartoDB.PositronNoLabels'
),
PositronOnlyLabels = TileProvider(
url = 'https://{s}.basemaps.cartocdn.com/{variant}/{z}/{x}/{y}{r}.png',
attribution = '(C) OpenStreetMap contributors (C) CARTO',
subdomains = 'abcd',
max_zoom = 19,
variant = 'light_only_labels',
name = 'CartoDB.PositronOnlyLabels'
),
DarkMatter = TileProvider(
url = 'https://{s}.basemaps.cartocdn.com/{variant}/{z}/{x}/{y}{r}.png',
attribution = '(C) OpenStreetMap contributors (C) CARTO',
subdomains = 'abcd',
max_zoom = 19,
variant = 'dark_all',
name = 'CartoDB.DarkMatter'
),
DarkMatterNoLabels = TileProvider(
url = 'https://{s}.basemaps.cartocdn.com/{variant}/{z}/{x}/{y}{r}.png',
attribution = '(C) OpenStreetMap contributors (C) CARTO',
subdomains = 'abcd',
max_zoom = 19,
variant = 'dark_nolabels',
name = 'CartoDB.DarkMatterNoLabels'
),
DarkMatterOnlyLabels = TileProvider(
url = 'https://{s}.basemaps.cartocdn.com/{variant}/{z}/{x}/{y}{r}.png',
attribution = '(C) OpenStreetMap contributors (C) CARTO',
subdomains = 'abcd',
max_zoom = 19,
variant = 'dark_only_labels',
name = 'CartoDB.DarkMatterOnlyLabels'
),
Voyager = TileProvider(
url = 'https://{s}.basemaps.cartocdn.com/{variant}/{z}/{x}/{y}{r}.png',
attribution = '(C) OpenStreetMap contributors (C) CARTO',
subdomains = 'abcd',
max_zoom = 19,
variant = 'rastertiles/voyager',
name = 'CartoDB.Voyager'
),
VoyagerNoLabels = TileProvider(
url = 'https://{s}.basemaps.cartocdn.com/{variant}/{z}/{x}/{y}{r}.png',
attribution = '(C) OpenStreetMap contributors (C) CARTO',
subdomains = 'abcd',
max_zoom = 19,
variant = 'rastertiles/voyager_nolabels',
name = 'CartoDB.VoyagerNoLabels'
),
VoyagerOnlyLabels = TileProvider(
url = 'https://{s}.basemaps.cartocdn.com/{variant}/{z}/{x}/{y}{r}.png',
attribution = '(C) OpenStreetMap contributors (C) CARTO',
subdomains = 'abcd',
max_zoom = 19,
variant = 'rastertiles/voyager_only_labels',
name = 'CartoDB.VoyagerOnlyLabels'
),
VoyagerLabelsUnder = TileProvider(
url = 'https://{s}.basemaps.cartocdn.com/{variant}/{z}/{x}/{y}{r}.png',
attribution = '(C) OpenStreetMap contributors (C) CARTO',
subdomains = 'abcd',
max_zoom = 19,
variant = 'rastertiles/voyager_labels_under',
name = 'CartoDB.VoyagerLabelsUnder'
)
),
HikeBike = Bunch(
HikeBike = TileProvider(
url = 'https://tiles.wmflabs.org/{variant}/{z}/{x}/{y}.png',
max_zoom = 19,
attribution = '(C) OpenStreetMap contributors',
variant = 'hikebike',
name = 'HikeBike.HikeBike'
),
HillShading = TileProvider(
url = 'https://tiles.wmflabs.org/{variant}/{z}/{x}/{y}.png',
max_zoom = 15,
attribution = '(C) OpenStreetMap contributors',
variant = 'hillshading',
name = 'HikeBike.HillShading'
)
),
BasemapAT = Bunch(
basemap = TileProvider(
url = 'https://maps{s}.wien.gv.at/basemap/{variant}/normal/google3857/{z}/{y}/{x}.{format}',
max_zoom = 20,
attribution = 'Datenquelle: basemap.at',
subdomains = ['', '1', '2', '3', '4'],
format = 'png',
bounds = [[46.35877, 8.782379], [49.037872, 17.189532]],
variant = 'geolandbasemap',
name = 'BasemapAT.basemap'
),
grau = TileProvider(
url = 'https://maps{s}.wien.gv.at/basemap/{variant}/normal/google3857/{z}/{y}/{x}.{format}',
max_zoom = 19,
attribution = 'Datenquelle: basemap.at',
subdomains = ['', '1', '2', '3', '4'],
format = 'png',
bounds = [[46.35877, 8.782379], [49.037872, 17.189532]],
variant = 'bmapgrau',
name = 'BasemapAT.grau'
),
overlay = TileProvider(
url = 'https://maps{s}.wien.gv.at/basemap/{variant}/normal/google3857/{z}/{y}/{x}.{format}',
max_zoom = 19,
attribution = 'Datenquelle: basemap.at',
subdomains = ['', '1', '2', '3', '4'],
format = 'png',
bounds = [[46.35877, 8.782379], [49.037872, 17.189532]],
variant = 'bmapoverlay',
name = 'BasemapAT.overlay'
),
highdpi = TileProvider(
url = 'https://maps{s}.wien.gv.at/basemap/{variant}/normal/google3857/{z}/{y}/{x}.{format}',
max_zoom = 19,
attribution = 'Datenquelle: basemap.at',
subdomains = ['', '1', '2', '3', '4'],
format = 'jpeg',
bounds = [[46.35877, 8.782379], [49.037872, 17.189532]],
variant = 'bmaphidpi',
name = 'BasemapAT.highdpi'
),
orthofoto = TileProvider(
url = 'https://maps{s}.wien.gv.at/basemap/{variant}/normal/google3857/{z}/{y}/{x}.{format}',
max_zoom = 20,
attribution = 'Datenquelle: basemap.at',
subdomains = ['', '1', '2', '3', '4'],
format = 'jpeg',
bounds = [[46.35877, 8.782379], [49.037872, 17.189532]],
variant = 'bmaporthofoto30cm',
name = 'BasemapAT.orthofoto'
)
),
nlmaps = Bunch(
standaard = TileProvider(
url = 'https://geodata.nationaalgeoregister.nl/tiles/service/wmts/{variant}/EPSG:3857/{z}/{x}/{y}.png',
min_zoom = 6,
max_zoom = 19,
bounds = [[50.5, 3.25], [54, 7.6]],
attribution = 'Kaartgegevens (C) Kadaster',
variant = 'brtachtergrondkaart',
name = 'nlmaps.standaard'
),
pastel = TileProvider(
url = 'https://geodata.nationaalgeoregister.nl/tiles/service/wmts/{variant}/EPSG:3857/{z}/{x}/{y}.png',
min_zoom = 6,
max_zoom = 19,
bounds = [[50.5, 3.25], [54, 7.6]],
attribution = 'Kaartgegevens (C) Kadaster',
variant = 'brtachtergrondkaartpastel',
name = 'nlmaps.pastel'
),
grijs = TileProvider(
url = 'https://geodata.nationaalgeoregister.nl/tiles/service/wmts/{variant}/EPSG:3857/{z}/{x}/{y}.png',
min_zoom = 6,
max_zoom = 19,
bounds = [[50.5, 3.25], [54, 7.6]],
attribution = 'Kaartgegevens (C) Kadaster',
variant = 'brtachtergrondkaartgrijs',
name = 'nlmaps.grijs'
),
luchtfoto = TileProvider(
url = 'https://geodata.nationaalgeoregister.nl/luchtfoto/rgb/wmts/1.0.0/2016_ortho25/EPSG:3857/{z}/{x}/{y}.png',
min_zoom = 6,
max_zoom = 19,
bounds = [[50.5, 3.25], [54, 7.6]],
attribution = 'Kaartgegevens (C) Kadaster',
name = 'nlmaps.luchtfoto'
)
),
NASAGIBS = Bunch(
ModisTerraTrueColorCR = TileProvider(
url = 'https://map1.vis.earthdata.nasa.gov/wmts-webmerc/{variant}/default/{time}/{tilematrixset}{max_zoom}/{z}/{y}/{x}.{format}',
attribution = 'Imagery provided by services from the Global Imagery Browse Services (GIBS), operated by the NASA/GSFC/Earth Science Data and Information System (ESDIS) with funding provided by NASA/HQ.',
bounds = [[-85.0511287776, -179.999999975], [85.0511287776, 179.999999975]],
min_zoom = 1,
max_zoom = 9,
format = 'jpg',
time = '',
tilematrixset = 'GoogleMapsCompatible_Level',
variant = 'MODIS_Terra_CorrectedReflectance_TrueColor',
name = 'NASAGIBS.ModisTerraTrueColorCR'
),
ModisTerraBands367CR = TileProvider(
url = 'https://map1.vis.earthdata.nasa.gov/wmts-webmerc/{variant}/default/{time}/{tilematrixset}{max_zoom}/{z}/{y}/{x}.{format}',
attribution = 'Imagery provided by services from the Global Imagery Browse Services (GIBS), operated by the NASA/GSFC/Earth Science Data and Information System (ESDIS) with funding provided by NASA/HQ.',
bounds = [[-85.0511287776, -179.999999975], [85.0511287776, 179.999999975]],
min_zoom = 1,
max_zoom = 9,
format = 'jpg',
time = '',
tilematrixset = 'GoogleMapsCompatible_Level',
variant = 'MODIS_Terra_CorrectedReflectance_Bands367',
name = 'NASAGIBS.ModisTerraBands367CR'
),
ViirsEarthAtNight2012 = TileProvider(
url = 'https://map1.vis.earthdata.nasa.gov/wmts-webmerc/{variant}/default/{time}/{tilematrixset}{max_zoom}/{z}/{y}/{x}.{format}',
attribution = 'Imagery provided by services from the Global Imagery Browse Services (GIBS), operated by the NASA/GSFC/Earth Science Data and Information System (ESDIS) with funding provided by NASA/HQ.',
bounds = [[-85.0511287776, -179.999999975], [85.0511287776, 179.999999975]],
min_zoom = 1,
max_zoom = 8,
format = 'jpg',
time = '',
tilematrixset = 'GoogleMapsCompatible_Level',
variant = 'VIIRS_CityLights_2012',
name = 'NASAGIBS.ViirsEarthAtNight2012'
),
ModisTerraLSTDay = TileProvider(
url = 'https://map1.vis.earthdata.nasa.gov/wmts-webmerc/{variant}/default/{time}/{tilematrixset}{max_zoom}/{z}/{y}/{x}.{format}',
attribution = 'Imagery provided by services from the Global Imagery Browse Services (GIBS), operated by the NASA/GSFC/Earth Science Data and Information System (ESDIS) with funding provided by NASA/HQ.',
bounds = [[-85.0511287776, -179.999999975], [85.0511287776, 179.999999975]],
min_zoom = 1,
max_zoom = 7,
format = 'png',
time = '',
tilematrixset = 'GoogleMapsCompatible_Level',
variant = 'MODIS_Terra_Land_Surface_Temp_Day',
opacity = 0.75,
name = 'NASAGIBS.ModisTerraLSTDay'
),
ModisTerraSnowCover = TileProvider(
url = 'https://map1.vis.earthdata.nasa.gov/wmts-webmerc/{variant}/default/{time}/{tilematrixset}{max_zoom}/{z}/{y}/{x}.{format}',
attribution = 'Imagery provided by services from the Global Imagery Browse Services (GIBS), operated by the NASA/GSFC/Earth Science Data and Information System (ESDIS) with funding provided by NASA/HQ.',
bounds = [[-85.0511287776, -179.999999975], [85.0511287776, 179.999999975]],
min_zoom = 1,
max_zoom = 8,
format = 'png',
time = '',
tilematrixset = 'GoogleMapsCompatible_Level',
variant = 'MODIS_Terra_Snow_Cover',
opacity = 0.75,
name = 'NASAGIBS.ModisTerraSnowCover'
),
ModisTerraAOD = TileProvider(
url = 'https://map1.vis.earthdata.nasa.gov/wmts-webmerc/{variant}/default/{time}/{tilematrixset}{max_zoom}/{z}/{y}/{x}.{format}',
attribution = 'Imagery provided by services from the Global Imagery Browse Services (GIBS), operated by the NASA/GSFC/Earth Science Data and Information System (ESDIS) with funding provided by NASA/HQ.',
bounds = [[-85.0511287776, -179.999999975], [85.0511287776, 179.999999975]],
min_zoom = 1,
max_zoom = 6,
format = 'png',
time = '',
tilematrixset = 'GoogleMapsCompatible_Level',
variant = 'MODIS_Terra_Aerosol',
opacity = 0.75,
name = 'NASAGIBS.ModisTerraAOD'
),
ModisTerraChlorophyll = TileProvider(
url = 'https://map1.vis.earthdata.nasa.gov/wmts-webmerc/{variant}/default/{time}/{tilematrixset}{max_zoom}/{z}/{y}/{x}.{format}',
attribution = 'Imagery provided by services from the Global Imagery Browse Services (GIBS), operated by the NASA/GSFC/Earth Science Data and Information System (ESDIS) with funding provided by NASA/HQ.',
bounds = [[-85.0511287776, -179.999999975], [85.0511287776, 179.999999975]],
min_zoom = 1,
max_zoom = 7,
format = 'png',
time = '',
tilematrixset = 'GoogleMapsCompatible_Level',
variant = 'MODIS_Terra_Chlorophyll_A',
opacity = 0.75,
name = 'NASAGIBS.ModisTerraChlorophyll'
)
),
NLS = TileProvider(
url = 'https://nls-{s}.tileserver.com/nls/{z}/{x}/{y}.jpg',
attribution = 'National Library of Scotland Historic Maps',
bounds = [[49.6, -12], [61.7, 3]],
min_zoom = 1,
max_zoom = 18,
subdomains = '0123',
name = 'NLS'
),
JusticeMap = Bunch(
income = TileProvider(
url = 'http://www.justicemap.org/tile/{size}/{variant}/{z}/{x}/{y}.png',
attribution = 'Justice Map',
size = 'county',
bounds = [[14, -180], [72, -56]],
variant = 'income',
name = 'JusticeMap.income'
),
americanIndian = TileProvider(
url = 'http://www.justicemap.org/tile/{size}/{variant}/{z}/{x}/{y}.png',
attribution = 'Justice Map',
size = 'county',
bounds = [[14, -180], [72, -56]],
variant = 'indian',
name = 'JusticeMap.americanIndian'
),
asian = TileProvider(
url = 'http://www.justicemap.org/tile/{size}/{variant}/{z}/{x}/{y}.png',
attribution = 'Justice Map',
size = 'county',
bounds = [[14, -180], [72, -56]],
variant = 'asian',
name = 'JusticeMap.asian'
),
black = TileProvider(
url = 'http://www.justicemap.org/tile/{size}/{variant}/{z}/{x}/{y}.png',
attribution = 'Justice Map',
size = 'county',
bounds = [[14, -180], [72, -56]],
variant = 'black',
name = 'JusticeMap.black'
),
hispanic = TileProvider(
url = 'http://www.justicemap.org/tile/{size}/{variant}/{z}/{x}/{y}.png',
attribution = 'Justice Map',
size = 'county',
bounds = [[14, -180], [72, -56]],
variant = 'hispanic',
name = 'JusticeMap.hispanic'
),
multi = TileProvider(
url = 'http://www.justicemap.org/tile/{size}/{variant}/{z}/{x}/{y}.png',
attribution = 'Justice Map',
size = 'county',
bounds = [[14, -180], [72, -56]],
variant = 'multi',
name = 'JusticeMap.multi'
),
nonWhite = TileProvider(
url = 'http://www.justicemap.org/tile/{size}/{variant}/{z}/{x}/{y}.png',
attribution = 'Justice Map',
size = 'county',
bounds = [[14, -180], [72, -56]],
variant = 'nonwhite',
name = 'JusticeMap.nonWhite'
),
white = TileProvider(
url = 'http://www.justicemap.org/tile/{size}/{variant}/{z}/{x}/{y}.png',
attribution = 'Justice Map',
size = 'county',
bounds = [[14, -180], [72, -56]],
variant = 'white',
name = 'JusticeMap.white'
),
plurality = TileProvider(
url = 'http://www.justicemap.org/tile/{size}/{variant}/{z}/{x}/{y}.png',
attribution = 'Justice Map',
size = 'county',
bounds = [[14, -180], [72, -56]],
variant = 'plural',
name = 'JusticeMap.plurality'
)
),
Wikimedia = TileProvider(
url = 'https://maps.wikimedia.org/osm-intl/{z}/{x}/{y}{r}.png',
attribution = 'Wikimedia',
min_zoom = 1,
max_zoom = 19,
name = 'Wikimedia'
),
GeoportailFrance = Bunch(
parcels = TileProvider(
url = 'https://wxs.ign.fr/{apikey}/geoportail/wmts?REQUEST=GetTile&SERVICE=WMTS&VERSION=1.0.0&STYLE={style}&TILEMATRIXSET=PM&FORMAT={format}&LAYER={variant}&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}',
attribution = 'Geoportail France',
bounds = [[-75, -180], [81, 180]],
min_zoom = 2,
max_zoom = 20,
apikey = 'choisirgeoportail',
format = 'image/png',
style = 'bdparcellaire',
variant = 'CADASTRALPARCELS.PARCELS',
name = 'GeoportailFrance.parcels'
),
ignMaps = TileProvider(
url = 'https://wxs.ign.fr/{apikey}/geoportail/wmts?REQUEST=GetTile&SERVICE=WMTS&VERSION=1.0.0&STYLE={style}&TILEMATRIXSET=PM&FORMAT={format}&LAYER={variant}&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}',
attribution = 'Geoportail France',
bounds = [[-75, -180], [81, 180]],
min_zoom = 2,
max_zoom = 18,
apikey = 'choisirgeoportail',
format = 'image/jpeg',
style = 'normal',
variant = 'GEOGRAPHICALGRIDSYSTEMS.MAPS',
name = 'GeoportailFrance.ignMaps'
),
maps = TileProvider(
url = 'https://wxs.ign.fr/{apikey}/geoportail/wmts?REQUEST=GetTile&SERVICE=WMTS&VERSION=1.0.0&STYLE={style}&TILEMATRIXSET=PM&FORMAT={format}&LAYER={variant}&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}',
attribution = 'Geoportail France',
bounds = [[-75, -180], [81, 180]],
min_zoom = 2,
max_zoom = 18,
apikey = 'choisirgeoportail',
format = 'image/jpeg',
style = 'normal',
variant = 'GEOGRAPHICALGRIDSYSTEMS.MAPS.SCAN-EXPRESS.STANDARD',
name = 'GeoportailFrance.maps'
),
orthos = TileProvider(
url = 'https://wxs.ign.fr/{apikey}/geoportail/wmts?REQUEST=GetTile&SERVICE=WMTS&VERSION=1.0.0&STYLE={style}&TILEMATRIXSET=PM&FORMAT={format}&LAYER={variant}&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}',
attribution = 'Geoportail France',
bounds = [[-75, -180], [81, 180]],
min_zoom = 2,
max_zoom = 19,
apikey = 'choisirgeoportail',
format = 'image/jpeg',
style = 'normal',
variant = 'ORTHOIMAGERY.ORTHOPHOTOS',
name = 'GeoportailFrance.orthos'
)
),
OneMapSG = Bunch(
Default = TileProvider(
url = 'https://maps-{s}.onemap.sg/v3/{variant}/{z}/{x}/{y}.png',
variant = 'Default',
min_zoom = 11,
max_zoom = 18,
bounds = [[1.56073, 104.11475], [1.16, 103.502]],
attribution = '![](https://docs.onemap.sg/maps/images/oneMap64-01.png) New OneMap | Map data (C) contributors, Singapore Land Authority',
name = 'OneMapSG.Default'
),
Night = TileProvider(
url = 'https://maps-{s}.onemap.sg/v3/{variant}/{z}/{x}/{y}.png',
variant = 'Night',
min_zoom = 11,
max_zoom = 18,
bounds = [[1.56073, 104.11475], [1.16, 103.502]],
attribution = '![](https://docs.onemap.sg/maps/images/oneMap64-01.png) New OneMap | Map data (C) contributors, Singapore Land Authority',
name = 'OneMapSG.Night'
),
Original = TileProvider(
url = 'https://maps-{s}.onemap.sg/v3/{variant}/{z}/{x}/{y}.png',
variant = 'Original',
min_zoom = 11,
max_zoom = 18,
bounds = [[1.56073, 104.11475], [1.16, 103.502]],
attribution = '![](https://docs.onemap.sg/maps/images/oneMap64-01.png) New OneMap | Map data (C) contributors, Singapore Land Authority',
name = 'OneMapSG.Original'
),
Grey = TileProvider(
url = 'https://maps-{s}.onemap.sg/v3/{variant}/{z}/{x}/{y}.png',
variant = 'Grey',
min_zoom = 11,
max_zoom = 18,
bounds = [[1.56073, 104.11475], [1.16, 103.502]],
attribution = '![](https://docs.onemap.sg/maps/images/oneMap64-01.png) New OneMap | Map data (C) contributors, Singapore Land Authority',
name = 'OneMapSG.Grey'
),
LandLot = TileProvider(
url = 'https://maps-{s}.onemap.sg/v3/{variant}/{z}/{x}/{y}.png',
variant = 'LandLot',
min_zoom = 11,
max_zoom = 18,
bounds = [[1.56073, 104.11475], [1.16, 103.502]],
attribution = '![](https://docs.onemap.sg/maps/images/oneMap64-01.png) New OneMap | Map data (C) contributors, Singapore Land Authority',
name = 'OneMapSG.LandLot'
)
)
)
| """
Tile providers.
This file is autogenerated! It is a python representation of the leaflet
providers defined by the leaflet-providers.js extension to Leaflet
(https://github.com/leaflet-extras/leaflet-providers).
Credit to the leaflet-providers.js project (BSD 2-Clause "Simplified" License)
and the Leaflet Providers contributors.
Generated by parse_leaflet_providers.py at 2019-08-01 from leaflet-providers
at commit 9eb968f8442ea492626c9c8f0dac8ede484e6905 (Bumped version to 1.8.0).
"""
class Bunch(dict):
"""A dict with attribute-access"""
def __getattr__(self, key):
try:
return self.__getitem__(key)
except KeyError:
raise attribute_error(key)
def __dir__(self):
return self.keys()
class Tileprovider(Bunch):
"""
A dict with attribute-access and that
can be called to update keys
"""
def __call__(self, **kwargs):
new = tile_provider(self)
new.update(kwargs)
return new
providers = bunch(OpenStreetMap=bunch(Mapnik=tile_provider(url='https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', max_zoom=19, attribution='(C) OpenStreetMap contributors', name='OpenStreetMap.Mapnik'), DE=tile_provider(url='https://{s}.tile.openstreetmap.de/tiles/osmde/{z}/{x}/{y}.png', max_zoom=18, attribution='(C) OpenStreetMap contributors', name='OpenStreetMap.DE'), CH=tile_provider(url='https://tile.osm.ch/switzerland/{z}/{x}/{y}.png', max_zoom=18, attribution='(C) OpenStreetMap contributors', bounds=[[45, 5], [48, 11]], name='OpenStreetMap.CH'), France=tile_provider(url='https://{s}.tile.openstreetmap.fr/osmfr/{z}/{x}/{y}.png', max_zoom=20, attribution='(C) Openstreetmap France | (C) OpenStreetMap contributors', name='OpenStreetMap.France'), HOT=tile_provider(url='https://{s}.tile.openstreetmap.fr/hot/{z}/{x}/{y}.png', max_zoom=19, attribution='(C) OpenStreetMap contributors, Tiles style by Humanitarian OpenStreetMap Team hosted by OpenStreetMap France', name='OpenStreetMap.HOT'), BZH=tile_provider(url='https://tile.openstreetmap.bzh/br/{z}/{x}/{y}.png', max_zoom=19, attribution='(C) OpenStreetMap contributors, Tiles courtesy of Breton OpenStreetMap Team', bounds=[[46.2, -5.5], [50, 0.7]], name='OpenStreetMap.BZH')), OpenSeaMap=tile_provider(url='https://tiles.openseamap.org/seamark/{z}/{x}/{y}.png', attribution='Map data: (C) OpenSeaMap contributors', name='OpenSeaMap'), OpenPtMap=tile_provider(url='http://openptmap.org/tiles/{z}/{x}/{y}.png', max_zoom=17, attribution='Map data: (C) OpenPtMap contributors', name='OpenPtMap'), OpenTopoMap=tile_provider(url='https://{s}.tile.opentopomap.org/{z}/{x}/{y}.png', max_zoom=17, attribution='Map data: (C) OpenStreetMap contributors, SRTM | Map style: (C) OpenTopoMap (CC-BY-SA)', name='OpenTopoMap'), OpenRailwayMap=tile_provider(url='https://{s}.tiles.openrailwaymap.org/standard/{z}/{x}/{y}.png', max_zoom=19, attribution='Map data: (C) OpenStreetMap contributors | Map style: (C) OpenRailwayMap (CC-BY-SA)', name='OpenRailwayMap'), OpenFireMap=tile_provider(url='http://openfiremap.org/hytiles/{z}/{x}/{y}.png', max_zoom=19, attribution='Map data: (C) OpenStreetMap contributors | Map style: (C) OpenFireMap (CC-BY-SA)', name='OpenFireMap'), SafeCast=tile_provider(url='https://s3.amazonaws.com/te512.safecast.org/{z}/{x}/{y}.png', max_zoom=16, attribution='Map data: (C) OpenStreetMap contributors | Map style: (C) SafeCast (CC-BY-SA)', name='SafeCast'), Thunderforest=bunch(OpenCycleMap=tile_provider(url='https://{s}.tile.thunderforest.com/{variant}/{z}/{x}/{y}.png?apikey={apikey}', attribution='(C) Thunderforest, (C) OpenStreetMap contributors', variant='cycle', apikey='<insert your api key here>', max_zoom=22, name='Thunderforest.OpenCycleMap'), Transport=tile_provider(url='https://{s}.tile.thunderforest.com/{variant}/{z}/{x}/{y}.png?apikey={apikey}', attribution='(C) Thunderforest, (C) OpenStreetMap contributors', variant='transport', apikey='<insert your api key here>', max_zoom=22, name='Thunderforest.Transport'), TransportDark=tile_provider(url='https://{s}.tile.thunderforest.com/{variant}/{z}/{x}/{y}.png?apikey={apikey}', attribution='(C) Thunderforest, (C) OpenStreetMap contributors', variant='transport-dark', apikey='<insert your api key here>', max_zoom=22, name='Thunderforest.TransportDark'), SpinalMap=tile_provider(url='https://{s}.tile.thunderforest.com/{variant}/{z}/{x}/{y}.png?apikey={apikey}', attribution='(C) Thunderforest, (C) OpenStreetMap contributors', variant='spinal-map', apikey='<insert your api key here>', max_zoom=22, name='Thunderforest.SpinalMap'), Landscape=tile_provider(url='https://{s}.tile.thunderforest.com/{variant}/{z}/{x}/{y}.png?apikey={apikey}', attribution='(C) Thunderforest, (C) OpenStreetMap contributors', variant='landscape', apikey='<insert your api key here>', max_zoom=22, name='Thunderforest.Landscape'), Outdoors=tile_provider(url='https://{s}.tile.thunderforest.com/{variant}/{z}/{x}/{y}.png?apikey={apikey}', attribution='(C) Thunderforest, (C) OpenStreetMap contributors', variant='outdoors', apikey='<insert your api key here>', max_zoom=22, name='Thunderforest.Outdoors'), Pioneer=tile_provider(url='https://{s}.tile.thunderforest.com/{variant}/{z}/{x}/{y}.png?apikey={apikey}', attribution='(C) Thunderforest, (C) OpenStreetMap contributors', variant='pioneer', apikey='<insert your api key here>', max_zoom=22, name='Thunderforest.Pioneer'), MobileAtlas=tile_provider(url='https://{s}.tile.thunderforest.com/{variant}/{z}/{x}/{y}.png?apikey={apikey}', attribution='(C) Thunderforest, (C) OpenStreetMap contributors', variant='mobile-atlas', apikey='<insert your api key here>', max_zoom=22, name='Thunderforest.MobileAtlas'), Neighbourhood=tile_provider(url='https://{s}.tile.thunderforest.com/{variant}/{z}/{x}/{y}.png?apikey={apikey}', attribution='(C) Thunderforest, (C) OpenStreetMap contributors', variant='neighbourhood', apikey='<insert your api key here>', max_zoom=22, name='Thunderforest.Neighbourhood')), OpenMapSurfer=bunch(Roads=tile_provider(url='https://maps.heigit.org/openmapsurfer/tiles/{variant}/webmercator/{z}/{x}/{y}.png', max_zoom=19, variant='roads', attribution='Imagery from GIScience Research Group @ University of Heidelberg | Map data (C) OpenStreetMap contributors', name='OpenMapSurfer.Roads'), Hybrid=tile_provider(url='https://maps.heigit.org/openmapsurfer/tiles/{variant}/webmercator/{z}/{x}/{y}.png', max_zoom=19, variant='hybrid', attribution='Imagery from GIScience Research Group @ University of Heidelberg | Map data (C) OpenStreetMap contributors', name='OpenMapSurfer.Hybrid'), AdminBounds=tile_provider(url='https://maps.heigit.org/openmapsurfer/tiles/{variant}/webmercator/{z}/{x}/{y}.png', max_zoom=18, variant='adminb', attribution='Imagery from GIScience Research Group @ University of Heidelberg | Map data (C) OpenStreetMap contributors', name='OpenMapSurfer.AdminBounds'), ContourLines=tile_provider(url='https://maps.heigit.org/openmapsurfer/tiles/{variant}/webmercator/{z}/{x}/{y}.png', max_zoom=18, variant='asterc', attribution='Imagery from GIScience Research Group @ University of Heidelberg | Map data ASTER GDEM', min_zoom=13, name='OpenMapSurfer.ContourLines'), Hillshade=tile_provider(url='https://maps.heigit.org/openmapsurfer/tiles/{variant}/webmercator/{z}/{x}/{y}.png', max_zoom=18, variant='asterh', attribution='Imagery from GIScience Research Group @ University of Heidelberg | Map data ASTER GDEM, SRTM', name='OpenMapSurfer.Hillshade'), ElementsAtRisk=tile_provider(url='https://maps.heigit.org/openmapsurfer/tiles/{variant}/webmercator/{z}/{x}/{y}.png', max_zoom=19, variant='elements_at_risk', attribution='Imagery from GIScience Research Group @ University of Heidelberg | Map data (C) OpenStreetMap contributors', name='OpenMapSurfer.ElementsAtRisk')), Hydda=bunch(Full=tile_provider(url='https://{s}.tile.openstreetmap.se/hydda/{variant}/{z}/{x}/{y}.png', max_zoom=18, variant='full', attribution='Tiles courtesy of OpenStreetMap Sweden -- Map data (C) OpenStreetMap contributors', name='Hydda.Full'), Base=tile_provider(url='https://{s}.tile.openstreetmap.se/hydda/{variant}/{z}/{x}/{y}.png', max_zoom=18, variant='base', attribution='Tiles courtesy of OpenStreetMap Sweden -- Map data (C) OpenStreetMap contributors', name='Hydda.Base'), RoadsAndLabels=tile_provider(url='https://{s}.tile.openstreetmap.se/hydda/{variant}/{z}/{x}/{y}.png', max_zoom=18, variant='roads_and_labels', attribution='Tiles courtesy of OpenStreetMap Sweden -- Map data (C) OpenStreetMap contributors', name='Hydda.RoadsAndLabels')), MapBox=tile_provider(url='https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}{r}.png?access_token={accessToken}', attribution='(C) Mapbox (C) OpenStreetMap contributors Improve this map', subdomains='abcd', id='mapbox.streets', accessToken='<insert your access token here>', name='MapBox'), Stamen=bunch(Toner=tile_provider(url='https://stamen-tiles-{s}.a.ssl.fastly.net/{variant}/{z}/{x}/{y}{r}.{ext}', attribution='Map tiles by Stamen Design, CC BY 3.0 -- Map data (C) OpenStreetMap contributors', subdomains='abcd', min_zoom=0, max_zoom=20, variant='toner', ext='png', name='Stamen.Toner'), TonerBackground=tile_provider(url='https://stamen-tiles-{s}.a.ssl.fastly.net/{variant}/{z}/{x}/{y}{r}.{ext}', attribution='Map tiles by Stamen Design, CC BY 3.0 -- Map data (C) OpenStreetMap contributors', subdomains='abcd', min_zoom=0, max_zoom=20, variant='toner-background', ext='png', name='Stamen.TonerBackground'), TonerHybrid=tile_provider(url='https://stamen-tiles-{s}.a.ssl.fastly.net/{variant}/{z}/{x}/{y}{r}.{ext}', attribution='Map tiles by Stamen Design, CC BY 3.0 -- Map data (C) OpenStreetMap contributors', subdomains='abcd', min_zoom=0, max_zoom=20, variant='toner-hybrid', ext='png', name='Stamen.TonerHybrid'), TonerLines=tile_provider(url='https://stamen-tiles-{s}.a.ssl.fastly.net/{variant}/{z}/{x}/{y}{r}.{ext}', attribution='Map tiles by Stamen Design, CC BY 3.0 -- Map data (C) OpenStreetMap contributors', subdomains='abcd', min_zoom=0, max_zoom=20, variant='toner-lines', ext='png', name='Stamen.TonerLines'), TonerLabels=tile_provider(url='https://stamen-tiles-{s}.a.ssl.fastly.net/{variant}/{z}/{x}/{y}{r}.{ext}', attribution='Map tiles by Stamen Design, CC BY 3.0 -- Map data (C) OpenStreetMap contributors', subdomains='abcd', min_zoom=0, max_zoom=20, variant='toner-labels', ext='png', name='Stamen.TonerLabels'), TonerLite=tile_provider(url='https://stamen-tiles-{s}.a.ssl.fastly.net/{variant}/{z}/{x}/{y}{r}.{ext}', attribution='Map tiles by Stamen Design, CC BY 3.0 -- Map data (C) OpenStreetMap contributors', subdomains='abcd', min_zoom=0, max_zoom=20, variant='toner-lite', ext='png', name='Stamen.TonerLite'), Watercolor=tile_provider(url='https://stamen-tiles-{s}.a.ssl.fastly.net/{variant}/{z}/{x}/{y}.{ext}', attribution='Map tiles by Stamen Design, CC BY 3.0 -- Map data (C) OpenStreetMap contributors', subdomains='abcd', min_zoom=1, max_zoom=16, variant='watercolor', ext='jpg', name='Stamen.Watercolor'), Terrain=tile_provider(url='https://stamen-tiles-{s}.a.ssl.fastly.net/{variant}/{z}/{x}/{y}{r}.{ext}', attribution='Map tiles by Stamen Design, CC BY 3.0 -- Map data (C) OpenStreetMap contributors', subdomains='abcd', min_zoom=0, max_zoom=18, variant='terrain', ext='png', name='Stamen.Terrain'), TerrainBackground=tile_provider(url='https://stamen-tiles-{s}.a.ssl.fastly.net/{variant}/{z}/{x}/{y}{r}.{ext}', attribution='Map tiles by Stamen Design, CC BY 3.0 -- Map data (C) OpenStreetMap contributors', subdomains='abcd', min_zoom=0, max_zoom=18, variant='terrain-background', ext='png', name='Stamen.TerrainBackground'), TopOSMRelief=tile_provider(url='https://stamen-tiles-{s}.a.ssl.fastly.net/{variant}/{z}/{x}/{y}.{ext}', attribution='Map tiles by Stamen Design, CC BY 3.0 -- Map data (C) OpenStreetMap contributors', subdomains='abcd', min_zoom=0, max_zoom=20, variant='toposm-color-relief', ext='jpg', bounds=[[22, -132], [51, -56]], name='Stamen.TopOSMRelief'), TopOSMFeatures=tile_provider(url='https://stamen-tiles-{s}.a.ssl.fastly.net/{variant}/{z}/{x}/{y}{r}.{ext}', attribution='Map tiles by Stamen Design, CC BY 3.0 -- Map data (C) OpenStreetMap contributors', subdomains='abcd', min_zoom=0, max_zoom=20, variant='toposm-features', ext='png', bounds=[[22, -132], [51, -56]], opacity=0.9, name='Stamen.TopOSMFeatures')), Esri=bunch(WorldStreetMap=tile_provider(url='https://server.arcgisonline.com/ArcGIS/rest/services/{variant}/MapServer/tile/{z}/{y}/{x}', variant='World_Street_Map', attribution='Tiles (C) Esri -- Source: Esri, DeLorme, NAVTEQ, USGS, Intermap, iPC, NRCAN, Esri Japan, METI, Esri China (Hong Kong), Esri (Thailand), TomTom, 2012', name='Esri.WorldStreetMap'), DeLorme=tile_provider(url='https://server.arcgisonline.com/ArcGIS/rest/services/{variant}/MapServer/tile/{z}/{y}/{x}', variant='Specialty/DeLorme_World_Base_Map', attribution='Tiles (C) Esri -- Copyright: (C)2012 DeLorme', min_zoom=1, max_zoom=11, name='Esri.DeLorme'), WorldTopoMap=tile_provider(url='https://server.arcgisonline.com/ArcGIS/rest/services/{variant}/MapServer/tile/{z}/{y}/{x}', variant='World_Topo_Map', attribution='Tiles (C) Esri -- Esri, DeLorme, NAVTEQ, TomTom, Intermap, iPC, USGS, FAO, NPS, NRCAN, GeoBase, Kadaster NL, Ordnance Survey, Esri Japan, METI, Esri China (Hong Kong), and the GIS User Community', name='Esri.WorldTopoMap'), WorldImagery=tile_provider(url='https://server.arcgisonline.com/ArcGIS/rest/services/{variant}/MapServer/tile/{z}/{y}/{x}', variant='World_Imagery', attribution='Tiles (C) Esri -- Source: Esri, i-cubed, USDA, USGS, AEX, GeoEye, Getmapping, Aerogrid, IGN, IGP, UPR-EGP, and the GIS User Community', name='Esri.WorldImagery'), WorldTerrain=tile_provider(url='https://server.arcgisonline.com/ArcGIS/rest/services/{variant}/MapServer/tile/{z}/{y}/{x}', variant='World_Terrain_Base', attribution='Tiles (C) Esri -- Source: USGS, Esri, TANA, DeLorme, and NPS', max_zoom=13, name='Esri.WorldTerrain'), WorldShadedRelief=tile_provider(url='https://server.arcgisonline.com/ArcGIS/rest/services/{variant}/MapServer/tile/{z}/{y}/{x}', variant='World_Shaded_Relief', attribution='Tiles (C) Esri -- Source: Esri', max_zoom=13, name='Esri.WorldShadedRelief'), WorldPhysical=tile_provider(url='https://server.arcgisonline.com/ArcGIS/rest/services/{variant}/MapServer/tile/{z}/{y}/{x}', variant='World_Physical_Map', attribution='Tiles (C) Esri -- Source: US National Park Service', max_zoom=8, name='Esri.WorldPhysical'), OceanBasemap=tile_provider(url='https://server.arcgisonline.com/ArcGIS/rest/services/{variant}/MapServer/tile/{z}/{y}/{x}', variant='Ocean_Basemap', attribution='Tiles (C) Esri -- Sources: GEBCO, NOAA, CHS, OSU, UNH, CSUMB, National Geographic, DeLorme, NAVTEQ, and Esri', max_zoom=13, name='Esri.OceanBasemap'), NatGeoWorldMap=tile_provider(url='https://server.arcgisonline.com/ArcGIS/rest/services/{variant}/MapServer/tile/{z}/{y}/{x}', variant='NatGeo_World_Map', attribution='Tiles (C) Esri -- National Geographic, Esri, DeLorme, NAVTEQ, UNEP-WCMC, USGS, NASA, ESA, METI, NRCAN, GEBCO, NOAA, iPC', max_zoom=16, name='Esri.NatGeoWorldMap'), WorldGrayCanvas=tile_provider(url='https://server.arcgisonline.com/ArcGIS/rest/services/{variant}/MapServer/tile/{z}/{y}/{x}', variant='Canvas/World_Light_Gray_Base', attribution='Tiles (C) Esri -- Esri, DeLorme, NAVTEQ', max_zoom=16, name='Esri.WorldGrayCanvas')), OpenWeatherMap=bunch(Clouds=tile_provider(url='http://{s}.tile.openweathermap.org/map/{variant}/{z}/{x}/{y}.png?appid={apiKey}', max_zoom=19, attribution='Map data (C) OpenWeatherMap', apiKey='<insert your api key here>', opacity=0.5, variant='clouds', name='OpenWeatherMap.Clouds'), CloudsClassic=tile_provider(url='http://{s}.tile.openweathermap.org/map/{variant}/{z}/{x}/{y}.png?appid={apiKey}', max_zoom=19, attribution='Map data (C) OpenWeatherMap', apiKey='<insert your api key here>', opacity=0.5, variant='clouds_cls', name='OpenWeatherMap.CloudsClassic'), Precipitation=tile_provider(url='http://{s}.tile.openweathermap.org/map/{variant}/{z}/{x}/{y}.png?appid={apiKey}', max_zoom=19, attribution='Map data (C) OpenWeatherMap', apiKey='<insert your api key here>', opacity=0.5, variant='precipitation', name='OpenWeatherMap.Precipitation'), PrecipitationClassic=tile_provider(url='http://{s}.tile.openweathermap.org/map/{variant}/{z}/{x}/{y}.png?appid={apiKey}', max_zoom=19, attribution='Map data (C) OpenWeatherMap', apiKey='<insert your api key here>', opacity=0.5, variant='precipitation_cls', name='OpenWeatherMap.PrecipitationClassic'), Rain=tile_provider(url='http://{s}.tile.openweathermap.org/map/{variant}/{z}/{x}/{y}.png?appid={apiKey}', max_zoom=19, attribution='Map data (C) OpenWeatherMap', apiKey='<insert your api key here>', opacity=0.5, variant='rain', name='OpenWeatherMap.Rain'), RainClassic=tile_provider(url='http://{s}.tile.openweathermap.org/map/{variant}/{z}/{x}/{y}.png?appid={apiKey}', max_zoom=19, attribution='Map data (C) OpenWeatherMap', apiKey='<insert your api key here>', opacity=0.5, variant='rain_cls', name='OpenWeatherMap.RainClassic'), Pressure=tile_provider(url='http://{s}.tile.openweathermap.org/map/{variant}/{z}/{x}/{y}.png?appid={apiKey}', max_zoom=19, attribution='Map data (C) OpenWeatherMap', apiKey='<insert your api key here>', opacity=0.5, variant='pressure', name='OpenWeatherMap.Pressure'), PressureContour=tile_provider(url='http://{s}.tile.openweathermap.org/map/{variant}/{z}/{x}/{y}.png?appid={apiKey}', max_zoom=19, attribution='Map data (C) OpenWeatherMap', apiKey='<insert your api key here>', opacity=0.5, variant='pressure_cntr', name='OpenWeatherMap.PressureContour'), Wind=tile_provider(url='http://{s}.tile.openweathermap.org/map/{variant}/{z}/{x}/{y}.png?appid={apiKey}', max_zoom=19, attribution='Map data (C) OpenWeatherMap', apiKey='<insert your api key here>', opacity=0.5, variant='wind', name='OpenWeatherMap.Wind'), Temperature=tile_provider(url='http://{s}.tile.openweathermap.org/map/{variant}/{z}/{x}/{y}.png?appid={apiKey}', max_zoom=19, attribution='Map data (C) OpenWeatherMap', apiKey='<insert your api key here>', opacity=0.5, variant='temp', name='OpenWeatherMap.Temperature'), Snow=tile_provider(url='http://{s}.tile.openweathermap.org/map/{variant}/{z}/{x}/{y}.png?appid={apiKey}', max_zoom=19, attribution='Map data (C) OpenWeatherMap', apiKey='<insert your api key here>', opacity=0.5, variant='snow', name='OpenWeatherMap.Snow')), HERE=bunch(normalDay=tile_provider(url='https://{s}.{base}.maps.api.here.com/maptile/2.1/{type}/{mapID}/{variant}/{z}/{x}/{y}/{size}/{format}?app_id={app_id}&app_code={app_code}&lg={language}', attribution='Map (C) 1987-2019 HERE', subdomains='1234', mapID='newest', app_id='<insert your app_id here>', app_code='<insert your app_code here>', base='base', variant='normal.day', max_zoom=20, type='maptile', language='eng', format='png8', size='256', name='HERE.normalDay'), normalDayCustom=tile_provider(url='https://{s}.{base}.maps.api.here.com/maptile/2.1/{type}/{mapID}/{variant}/{z}/{x}/{y}/{size}/{format}?app_id={app_id}&app_code={app_code}&lg={language}', attribution='Map (C) 1987-2019 HERE', subdomains='1234', mapID='newest', app_id='<insert your app_id here>', app_code='<insert your app_code here>', base='base', variant='normal.day.custom', max_zoom=20, type='maptile', language='eng', format='png8', size='256', name='HERE.normalDayCustom'), normalDayGrey=tile_provider(url='https://{s}.{base}.maps.api.here.com/maptile/2.1/{type}/{mapID}/{variant}/{z}/{x}/{y}/{size}/{format}?app_id={app_id}&app_code={app_code}&lg={language}', attribution='Map (C) 1987-2019 HERE', subdomains='1234', mapID='newest', app_id='<insert your app_id here>', app_code='<insert your app_code here>', base='base', variant='normal.day.grey', max_zoom=20, type='maptile', language='eng', format='png8', size='256', name='HERE.normalDayGrey'), normalDayMobile=tile_provider(url='https://{s}.{base}.maps.api.here.com/maptile/2.1/{type}/{mapID}/{variant}/{z}/{x}/{y}/{size}/{format}?app_id={app_id}&app_code={app_code}&lg={language}', attribution='Map (C) 1987-2019 HERE', subdomains='1234', mapID='newest', app_id='<insert your app_id here>', app_code='<insert your app_code here>', base='base', variant='normal.day.mobile', max_zoom=20, type='maptile', language='eng', format='png8', size='256', name='HERE.normalDayMobile'), normalDayGreyMobile=tile_provider(url='https://{s}.{base}.maps.api.here.com/maptile/2.1/{type}/{mapID}/{variant}/{z}/{x}/{y}/{size}/{format}?app_id={app_id}&app_code={app_code}&lg={language}', attribution='Map (C) 1987-2019 HERE', subdomains='1234', mapID='newest', app_id='<insert your app_id here>', app_code='<insert your app_code here>', base='base', variant='normal.day.grey.mobile', max_zoom=20, type='maptile', language='eng', format='png8', size='256', name='HERE.normalDayGreyMobile'), normalDayTransit=tile_provider(url='https://{s}.{base}.maps.api.here.com/maptile/2.1/{type}/{mapID}/{variant}/{z}/{x}/{y}/{size}/{format}?app_id={app_id}&app_code={app_code}&lg={language}', attribution='Map (C) 1987-2019 HERE', subdomains='1234', mapID='newest', app_id='<insert your app_id here>', app_code='<insert your app_code here>', base='base', variant='normal.day.transit', max_zoom=20, type='maptile', language='eng', format='png8', size='256', name='HERE.normalDayTransit'), normalDayTransitMobile=tile_provider(url='https://{s}.{base}.maps.api.here.com/maptile/2.1/{type}/{mapID}/{variant}/{z}/{x}/{y}/{size}/{format}?app_id={app_id}&app_code={app_code}&lg={language}', attribution='Map (C) 1987-2019 HERE', subdomains='1234', mapID='newest', app_id='<insert your app_id here>', app_code='<insert your app_code here>', base='base', variant='normal.day.transit.mobile', max_zoom=20, type='maptile', language='eng', format='png8', size='256', name='HERE.normalDayTransitMobile'), normalNight=tile_provider(url='https://{s}.{base}.maps.api.here.com/maptile/2.1/{type}/{mapID}/{variant}/{z}/{x}/{y}/{size}/{format}?app_id={app_id}&app_code={app_code}&lg={language}', attribution='Map (C) 1987-2019 HERE', subdomains='1234', mapID='newest', app_id='<insert your app_id here>', app_code='<insert your app_code here>', base='base', variant='normal.night', max_zoom=20, type='maptile', language='eng', format='png8', size='256', name='HERE.normalNight'), normalNightMobile=tile_provider(url='https://{s}.{base}.maps.api.here.com/maptile/2.1/{type}/{mapID}/{variant}/{z}/{x}/{y}/{size}/{format}?app_id={app_id}&app_code={app_code}&lg={language}', attribution='Map (C) 1987-2019 HERE', subdomains='1234', mapID='newest', app_id='<insert your app_id here>', app_code='<insert your app_code here>', base='base', variant='normal.night.mobile', max_zoom=20, type='maptile', language='eng', format='png8', size='256', name='HERE.normalNightMobile'), normalNightGrey=tile_provider(url='https://{s}.{base}.maps.api.here.com/maptile/2.1/{type}/{mapID}/{variant}/{z}/{x}/{y}/{size}/{format}?app_id={app_id}&app_code={app_code}&lg={language}', attribution='Map (C) 1987-2019 HERE', subdomains='1234', mapID='newest', app_id='<insert your app_id here>', app_code='<insert your app_code here>', base='base', variant='normal.night.grey', max_zoom=20, type='maptile', language='eng', format='png8', size='256', name='HERE.normalNightGrey'), normalNightGreyMobile=tile_provider(url='https://{s}.{base}.maps.api.here.com/maptile/2.1/{type}/{mapID}/{variant}/{z}/{x}/{y}/{size}/{format}?app_id={app_id}&app_code={app_code}&lg={language}', attribution='Map (C) 1987-2019 HERE', subdomains='1234', mapID='newest', app_id='<insert your app_id here>', app_code='<insert your app_code here>', base='base', variant='normal.night.grey.mobile', max_zoom=20, type='maptile', language='eng', format='png8', size='256', name='HERE.normalNightGreyMobile'), normalNightTransit=tile_provider(url='https://{s}.{base}.maps.api.here.com/maptile/2.1/{type}/{mapID}/{variant}/{z}/{x}/{y}/{size}/{format}?app_id={app_id}&app_code={app_code}&lg={language}', attribution='Map (C) 1987-2019 HERE', subdomains='1234', mapID='newest', app_id='<insert your app_id here>', app_code='<insert your app_code here>', base='base', variant='normal.night.transit', max_zoom=20, type='maptile', language='eng', format='png8', size='256', name='HERE.normalNightTransit'), normalNightTransitMobile=tile_provider(url='https://{s}.{base}.maps.api.here.com/maptile/2.1/{type}/{mapID}/{variant}/{z}/{x}/{y}/{size}/{format}?app_id={app_id}&app_code={app_code}&lg={language}', attribution='Map (C) 1987-2019 HERE', subdomains='1234', mapID='newest', app_id='<insert your app_id here>', app_code='<insert your app_code here>', base='base', variant='normal.night.transit.mobile', max_zoom=20, type='maptile', language='eng', format='png8', size='256', name='HERE.normalNightTransitMobile'), reducedDay=tile_provider(url='https://{s}.{base}.maps.api.here.com/maptile/2.1/{type}/{mapID}/{variant}/{z}/{x}/{y}/{size}/{format}?app_id={app_id}&app_code={app_code}&lg={language}', attribution='Map (C) 1987-2019 HERE', subdomains='1234', mapID='newest', app_id='<insert your app_id here>', app_code='<insert your app_code here>', base='base', variant='reduced.day', max_zoom=20, type='maptile', language='eng', format='png8', size='256', name='HERE.reducedDay'), reducedNight=tile_provider(url='https://{s}.{base}.maps.api.here.com/maptile/2.1/{type}/{mapID}/{variant}/{z}/{x}/{y}/{size}/{format}?app_id={app_id}&app_code={app_code}&lg={language}', attribution='Map (C) 1987-2019 HERE', subdomains='1234', mapID='newest', app_id='<insert your app_id here>', app_code='<insert your app_code here>', base='base', variant='reduced.night', max_zoom=20, type='maptile', language='eng', format='png8', size='256', name='HERE.reducedNight'), basicMap=tile_provider(url='https://{s}.{base}.maps.api.here.com/maptile/2.1/{type}/{mapID}/{variant}/{z}/{x}/{y}/{size}/{format}?app_id={app_id}&app_code={app_code}&lg={language}', attribution='Map (C) 1987-2019 HERE', subdomains='1234', mapID='newest', app_id='<insert your app_id here>', app_code='<insert your app_code here>', base='base', variant='normal.day', max_zoom=20, type='basetile', language='eng', format='png8', size='256', name='HERE.basicMap'), mapLabels=tile_provider(url='https://{s}.{base}.maps.api.here.com/maptile/2.1/{type}/{mapID}/{variant}/{z}/{x}/{y}/{size}/{format}?app_id={app_id}&app_code={app_code}&lg={language}', attribution='Map (C) 1987-2019 HERE', subdomains='1234', mapID='newest', app_id='<insert your app_id here>', app_code='<insert your app_code here>', base='base', variant='normal.day', max_zoom=20, type='labeltile', language='eng', format='png', size='256', name='HERE.mapLabels'), trafficFlow=tile_provider(url='https://{s}.{base}.maps.api.here.com/maptile/2.1/{type}/{mapID}/{variant}/{z}/{x}/{y}/{size}/{format}?app_id={app_id}&app_code={app_code}&lg={language}', attribution='Map (C) 1987-2019 HERE', subdomains='1234', mapID='newest', app_id='<insert your app_id here>', app_code='<insert your app_code here>', base='traffic', variant='normal.day', max_zoom=20, type='flowtile', language='eng', format='png8', size='256', name='HERE.trafficFlow'), carnavDayGrey=tile_provider(url='https://{s}.{base}.maps.api.here.com/maptile/2.1/{type}/{mapID}/{variant}/{z}/{x}/{y}/{size}/{format}?app_id={app_id}&app_code={app_code}&lg={language}', attribution='Map (C) 1987-2019 HERE', subdomains='1234', mapID='newest', app_id='<insert your app_id here>', app_code='<insert your app_code here>', base='base', variant='carnav.day.grey', max_zoom=20, type='maptile', language='eng', format='png8', size='256', name='HERE.carnavDayGrey'), hybridDay=tile_provider(url='https://{s}.{base}.maps.api.here.com/maptile/2.1/{type}/{mapID}/{variant}/{z}/{x}/{y}/{size}/{format}?app_id={app_id}&app_code={app_code}&lg={language}', attribution='Map (C) 1987-2019 HERE', subdomains='1234', mapID='newest', app_id='<insert your app_id here>', app_code='<insert your app_code here>', base='aerial', variant='hybrid.day', max_zoom=20, type='maptile', language='eng', format='png8', size='256', name='HERE.hybridDay'), hybridDayMobile=tile_provider(url='https://{s}.{base}.maps.api.here.com/maptile/2.1/{type}/{mapID}/{variant}/{z}/{x}/{y}/{size}/{format}?app_id={app_id}&app_code={app_code}&lg={language}', attribution='Map (C) 1987-2019 HERE', subdomains='1234', mapID='newest', app_id='<insert your app_id here>', app_code='<insert your app_code here>', base='aerial', variant='hybrid.day.mobile', max_zoom=20, type='maptile', language='eng', format='png8', size='256', name='HERE.hybridDayMobile'), hybridDayTransit=tile_provider(url='https://{s}.{base}.maps.api.here.com/maptile/2.1/{type}/{mapID}/{variant}/{z}/{x}/{y}/{size}/{format}?app_id={app_id}&app_code={app_code}&lg={language}', attribution='Map (C) 1987-2019 HERE', subdomains='1234', mapID='newest', app_id='<insert your app_id here>', app_code='<insert your app_code here>', base='aerial', variant='hybrid.day.transit', max_zoom=20, type='maptile', language='eng', format='png8', size='256', name='HERE.hybridDayTransit'), hybridDayGrey=tile_provider(url='https://{s}.{base}.maps.api.here.com/maptile/2.1/{type}/{mapID}/{variant}/{z}/{x}/{y}/{size}/{format}?app_id={app_id}&app_code={app_code}&lg={language}', attribution='Map (C) 1987-2019 HERE', subdomains='1234', mapID='newest', app_id='<insert your app_id here>', app_code='<insert your app_code here>', base='aerial', variant='hybrid.grey.day', max_zoom=20, type='maptile', language='eng', format='png8', size='256', name='HERE.hybridDayGrey'), pedestrianDay=tile_provider(url='https://{s}.{base}.maps.api.here.com/maptile/2.1/{type}/{mapID}/{variant}/{z}/{x}/{y}/{size}/{format}?app_id={app_id}&app_code={app_code}&lg={language}', attribution='Map (C) 1987-2019 HERE', subdomains='1234', mapID='newest', app_id='<insert your app_id here>', app_code='<insert your app_code here>', base='base', variant='pedestrian.day', max_zoom=20, type='maptile', language='eng', format='png8', size='256', name='HERE.pedestrianDay'), pedestrianNight=tile_provider(url='https://{s}.{base}.maps.api.here.com/maptile/2.1/{type}/{mapID}/{variant}/{z}/{x}/{y}/{size}/{format}?app_id={app_id}&app_code={app_code}&lg={language}', attribution='Map (C) 1987-2019 HERE', subdomains='1234', mapID='newest', app_id='<insert your app_id here>', app_code='<insert your app_code here>', base='base', variant='pedestrian.night', max_zoom=20, type='maptile', language='eng', format='png8', size='256', name='HERE.pedestrianNight'), satelliteDay=tile_provider(url='https://{s}.{base}.maps.api.here.com/maptile/2.1/{type}/{mapID}/{variant}/{z}/{x}/{y}/{size}/{format}?app_id={app_id}&app_code={app_code}&lg={language}', attribution='Map (C) 1987-2019 HERE', subdomains='1234', mapID='newest', app_id='<insert your app_id here>', app_code='<insert your app_code here>', base='aerial', variant='satellite.day', max_zoom=20, type='maptile', language='eng', format='png8', size='256', name='HERE.satelliteDay'), terrainDay=tile_provider(url='https://{s}.{base}.maps.api.here.com/maptile/2.1/{type}/{mapID}/{variant}/{z}/{x}/{y}/{size}/{format}?app_id={app_id}&app_code={app_code}&lg={language}', attribution='Map (C) 1987-2019 HERE', subdomains='1234', mapID='newest', app_id='<insert your app_id here>', app_code='<insert your app_code here>', base='aerial', variant='terrain.day', max_zoom=20, type='maptile', language='eng', format='png8', size='256', name='HERE.terrainDay'), terrainDayMobile=tile_provider(url='https://{s}.{base}.maps.api.here.com/maptile/2.1/{type}/{mapID}/{variant}/{z}/{x}/{y}/{size}/{format}?app_id={app_id}&app_code={app_code}&lg={language}', attribution='Map (C) 1987-2019 HERE', subdomains='1234', mapID='newest', app_id='<insert your app_id here>', app_code='<insert your app_code here>', base='aerial', variant='terrain.day.mobile', max_zoom=20, type='maptile', language='eng', format='png8', size='256', name='HERE.terrainDayMobile')), FreeMapSK=tile_provider(url='http://t{s}.freemap.sk/T/{z}/{x}/{y}.jpeg', min_zoom=8, max_zoom=16, subdomains='1234', bounds=[[47.204642, 15.996093], [49.830896, 22.576904]], attribution='(C) OpenStreetMap contributors, vizualization CC-By-SA 2.0 Freemap.sk', name='FreeMapSK'), MtbMap=tile_provider(url='http://tile.mtbmap.cz/mtbmap_tiles/{z}/{x}/{y}.png', attribution='(C) OpenStreetMap contributors & USGS', name='MtbMap'), CartoDB=bunch(Positron=tile_provider(url='https://{s}.basemaps.cartocdn.com/{variant}/{z}/{x}/{y}{r}.png', attribution='(C) OpenStreetMap contributors (C) CARTO', subdomains='abcd', max_zoom=19, variant='light_all', name='CartoDB.Positron'), PositronNoLabels=tile_provider(url='https://{s}.basemaps.cartocdn.com/{variant}/{z}/{x}/{y}{r}.png', attribution='(C) OpenStreetMap contributors (C) CARTO', subdomains='abcd', max_zoom=19, variant='light_nolabels', name='CartoDB.PositronNoLabels'), PositronOnlyLabels=tile_provider(url='https://{s}.basemaps.cartocdn.com/{variant}/{z}/{x}/{y}{r}.png', attribution='(C) OpenStreetMap contributors (C) CARTO', subdomains='abcd', max_zoom=19, variant='light_only_labels', name='CartoDB.PositronOnlyLabels'), DarkMatter=tile_provider(url='https://{s}.basemaps.cartocdn.com/{variant}/{z}/{x}/{y}{r}.png', attribution='(C) OpenStreetMap contributors (C) CARTO', subdomains='abcd', max_zoom=19, variant='dark_all', name='CartoDB.DarkMatter'), DarkMatterNoLabels=tile_provider(url='https://{s}.basemaps.cartocdn.com/{variant}/{z}/{x}/{y}{r}.png', attribution='(C) OpenStreetMap contributors (C) CARTO', subdomains='abcd', max_zoom=19, variant='dark_nolabels', name='CartoDB.DarkMatterNoLabels'), DarkMatterOnlyLabels=tile_provider(url='https://{s}.basemaps.cartocdn.com/{variant}/{z}/{x}/{y}{r}.png', attribution='(C) OpenStreetMap contributors (C) CARTO', subdomains='abcd', max_zoom=19, variant='dark_only_labels', name='CartoDB.DarkMatterOnlyLabels'), Voyager=tile_provider(url='https://{s}.basemaps.cartocdn.com/{variant}/{z}/{x}/{y}{r}.png', attribution='(C) OpenStreetMap contributors (C) CARTO', subdomains='abcd', max_zoom=19, variant='rastertiles/voyager', name='CartoDB.Voyager'), VoyagerNoLabels=tile_provider(url='https://{s}.basemaps.cartocdn.com/{variant}/{z}/{x}/{y}{r}.png', attribution='(C) OpenStreetMap contributors (C) CARTO', subdomains='abcd', max_zoom=19, variant='rastertiles/voyager_nolabels', name='CartoDB.VoyagerNoLabels'), VoyagerOnlyLabels=tile_provider(url='https://{s}.basemaps.cartocdn.com/{variant}/{z}/{x}/{y}{r}.png', attribution='(C) OpenStreetMap contributors (C) CARTO', subdomains='abcd', max_zoom=19, variant='rastertiles/voyager_only_labels', name='CartoDB.VoyagerOnlyLabels'), VoyagerLabelsUnder=tile_provider(url='https://{s}.basemaps.cartocdn.com/{variant}/{z}/{x}/{y}{r}.png', attribution='(C) OpenStreetMap contributors (C) CARTO', subdomains='abcd', max_zoom=19, variant='rastertiles/voyager_labels_under', name='CartoDB.VoyagerLabelsUnder')), HikeBike=bunch(HikeBike=tile_provider(url='https://tiles.wmflabs.org/{variant}/{z}/{x}/{y}.png', max_zoom=19, attribution='(C) OpenStreetMap contributors', variant='hikebike', name='HikeBike.HikeBike'), HillShading=tile_provider(url='https://tiles.wmflabs.org/{variant}/{z}/{x}/{y}.png', max_zoom=15, attribution='(C) OpenStreetMap contributors', variant='hillshading', name='HikeBike.HillShading')), BasemapAT=bunch(basemap=tile_provider(url='https://maps{s}.wien.gv.at/basemap/{variant}/normal/google3857/{z}/{y}/{x}.{format}', max_zoom=20, attribution='Datenquelle: basemap.at', subdomains=['', '1', '2', '3', '4'], format='png', bounds=[[46.35877, 8.782379], [49.037872, 17.189532]], variant='geolandbasemap', name='BasemapAT.basemap'), grau=tile_provider(url='https://maps{s}.wien.gv.at/basemap/{variant}/normal/google3857/{z}/{y}/{x}.{format}', max_zoom=19, attribution='Datenquelle: basemap.at', subdomains=['', '1', '2', '3', '4'], format='png', bounds=[[46.35877, 8.782379], [49.037872, 17.189532]], variant='bmapgrau', name='BasemapAT.grau'), overlay=tile_provider(url='https://maps{s}.wien.gv.at/basemap/{variant}/normal/google3857/{z}/{y}/{x}.{format}', max_zoom=19, attribution='Datenquelle: basemap.at', subdomains=['', '1', '2', '3', '4'], format='png', bounds=[[46.35877, 8.782379], [49.037872, 17.189532]], variant='bmapoverlay', name='BasemapAT.overlay'), highdpi=tile_provider(url='https://maps{s}.wien.gv.at/basemap/{variant}/normal/google3857/{z}/{y}/{x}.{format}', max_zoom=19, attribution='Datenquelle: basemap.at', subdomains=['', '1', '2', '3', '4'], format='jpeg', bounds=[[46.35877, 8.782379], [49.037872, 17.189532]], variant='bmaphidpi', name='BasemapAT.highdpi'), orthofoto=tile_provider(url='https://maps{s}.wien.gv.at/basemap/{variant}/normal/google3857/{z}/{y}/{x}.{format}', max_zoom=20, attribution='Datenquelle: basemap.at', subdomains=['', '1', '2', '3', '4'], format='jpeg', bounds=[[46.35877, 8.782379], [49.037872, 17.189532]], variant='bmaporthofoto30cm', name='BasemapAT.orthofoto')), nlmaps=bunch(standaard=tile_provider(url='https://geodata.nationaalgeoregister.nl/tiles/service/wmts/{variant}/EPSG:3857/{z}/{x}/{y}.png', min_zoom=6, max_zoom=19, bounds=[[50.5, 3.25], [54, 7.6]], attribution='Kaartgegevens (C) Kadaster', variant='brtachtergrondkaart', name='nlmaps.standaard'), pastel=tile_provider(url='https://geodata.nationaalgeoregister.nl/tiles/service/wmts/{variant}/EPSG:3857/{z}/{x}/{y}.png', min_zoom=6, max_zoom=19, bounds=[[50.5, 3.25], [54, 7.6]], attribution='Kaartgegevens (C) Kadaster', variant='brtachtergrondkaartpastel', name='nlmaps.pastel'), grijs=tile_provider(url='https://geodata.nationaalgeoregister.nl/tiles/service/wmts/{variant}/EPSG:3857/{z}/{x}/{y}.png', min_zoom=6, max_zoom=19, bounds=[[50.5, 3.25], [54, 7.6]], attribution='Kaartgegevens (C) Kadaster', variant='brtachtergrondkaartgrijs', name='nlmaps.grijs'), luchtfoto=tile_provider(url='https://geodata.nationaalgeoregister.nl/luchtfoto/rgb/wmts/1.0.0/2016_ortho25/EPSG:3857/{z}/{x}/{y}.png', min_zoom=6, max_zoom=19, bounds=[[50.5, 3.25], [54, 7.6]], attribution='Kaartgegevens (C) Kadaster', name='nlmaps.luchtfoto')), NASAGIBS=bunch(ModisTerraTrueColorCR=tile_provider(url='https://map1.vis.earthdata.nasa.gov/wmts-webmerc/{variant}/default/{time}/{tilematrixset}{max_zoom}/{z}/{y}/{x}.{format}', attribution='Imagery provided by services from the Global Imagery Browse Services (GIBS), operated by the NASA/GSFC/Earth Science Data and Information System (ESDIS) with funding provided by NASA/HQ.', bounds=[[-85.0511287776, -179.999999975], [85.0511287776, 179.999999975]], min_zoom=1, max_zoom=9, format='jpg', time='', tilematrixset='GoogleMapsCompatible_Level', variant='MODIS_Terra_CorrectedReflectance_TrueColor', name='NASAGIBS.ModisTerraTrueColorCR'), ModisTerraBands367CR=tile_provider(url='https://map1.vis.earthdata.nasa.gov/wmts-webmerc/{variant}/default/{time}/{tilematrixset}{max_zoom}/{z}/{y}/{x}.{format}', attribution='Imagery provided by services from the Global Imagery Browse Services (GIBS), operated by the NASA/GSFC/Earth Science Data and Information System (ESDIS) with funding provided by NASA/HQ.', bounds=[[-85.0511287776, -179.999999975], [85.0511287776, 179.999999975]], min_zoom=1, max_zoom=9, format='jpg', time='', tilematrixset='GoogleMapsCompatible_Level', variant='MODIS_Terra_CorrectedReflectance_Bands367', name='NASAGIBS.ModisTerraBands367CR'), ViirsEarthAtNight2012=tile_provider(url='https://map1.vis.earthdata.nasa.gov/wmts-webmerc/{variant}/default/{time}/{tilematrixset}{max_zoom}/{z}/{y}/{x}.{format}', attribution='Imagery provided by services from the Global Imagery Browse Services (GIBS), operated by the NASA/GSFC/Earth Science Data and Information System (ESDIS) with funding provided by NASA/HQ.', bounds=[[-85.0511287776, -179.999999975], [85.0511287776, 179.999999975]], min_zoom=1, max_zoom=8, format='jpg', time='', tilematrixset='GoogleMapsCompatible_Level', variant='VIIRS_CityLights_2012', name='NASAGIBS.ViirsEarthAtNight2012'), ModisTerraLSTDay=tile_provider(url='https://map1.vis.earthdata.nasa.gov/wmts-webmerc/{variant}/default/{time}/{tilematrixset}{max_zoom}/{z}/{y}/{x}.{format}', attribution='Imagery provided by services from the Global Imagery Browse Services (GIBS), operated by the NASA/GSFC/Earth Science Data and Information System (ESDIS) with funding provided by NASA/HQ.', bounds=[[-85.0511287776, -179.999999975], [85.0511287776, 179.999999975]], min_zoom=1, max_zoom=7, format='png', time='', tilematrixset='GoogleMapsCompatible_Level', variant='MODIS_Terra_Land_Surface_Temp_Day', opacity=0.75, name='NASAGIBS.ModisTerraLSTDay'), ModisTerraSnowCover=tile_provider(url='https://map1.vis.earthdata.nasa.gov/wmts-webmerc/{variant}/default/{time}/{tilematrixset}{max_zoom}/{z}/{y}/{x}.{format}', attribution='Imagery provided by services from the Global Imagery Browse Services (GIBS), operated by the NASA/GSFC/Earth Science Data and Information System (ESDIS) with funding provided by NASA/HQ.', bounds=[[-85.0511287776, -179.999999975], [85.0511287776, 179.999999975]], min_zoom=1, max_zoom=8, format='png', time='', tilematrixset='GoogleMapsCompatible_Level', variant='MODIS_Terra_Snow_Cover', opacity=0.75, name='NASAGIBS.ModisTerraSnowCover'), ModisTerraAOD=tile_provider(url='https://map1.vis.earthdata.nasa.gov/wmts-webmerc/{variant}/default/{time}/{tilematrixset}{max_zoom}/{z}/{y}/{x}.{format}', attribution='Imagery provided by services from the Global Imagery Browse Services (GIBS), operated by the NASA/GSFC/Earth Science Data and Information System (ESDIS) with funding provided by NASA/HQ.', bounds=[[-85.0511287776, -179.999999975], [85.0511287776, 179.999999975]], min_zoom=1, max_zoom=6, format='png', time='', tilematrixset='GoogleMapsCompatible_Level', variant='MODIS_Terra_Aerosol', opacity=0.75, name='NASAGIBS.ModisTerraAOD'), ModisTerraChlorophyll=tile_provider(url='https://map1.vis.earthdata.nasa.gov/wmts-webmerc/{variant}/default/{time}/{tilematrixset}{max_zoom}/{z}/{y}/{x}.{format}', attribution='Imagery provided by services from the Global Imagery Browse Services (GIBS), operated by the NASA/GSFC/Earth Science Data and Information System (ESDIS) with funding provided by NASA/HQ.', bounds=[[-85.0511287776, -179.999999975], [85.0511287776, 179.999999975]], min_zoom=1, max_zoom=7, format='png', time='', tilematrixset='GoogleMapsCompatible_Level', variant='MODIS_Terra_Chlorophyll_A', opacity=0.75, name='NASAGIBS.ModisTerraChlorophyll')), NLS=tile_provider(url='https://nls-{s}.tileserver.com/nls/{z}/{x}/{y}.jpg', attribution='National Library of Scotland Historic Maps', bounds=[[49.6, -12], [61.7, 3]], min_zoom=1, max_zoom=18, subdomains='0123', name='NLS'), JusticeMap=bunch(income=tile_provider(url='http://www.justicemap.org/tile/{size}/{variant}/{z}/{x}/{y}.png', attribution='Justice Map', size='county', bounds=[[14, -180], [72, -56]], variant='income', name='JusticeMap.income'), americanIndian=tile_provider(url='http://www.justicemap.org/tile/{size}/{variant}/{z}/{x}/{y}.png', attribution='Justice Map', size='county', bounds=[[14, -180], [72, -56]], variant='indian', name='JusticeMap.americanIndian'), asian=tile_provider(url='http://www.justicemap.org/tile/{size}/{variant}/{z}/{x}/{y}.png', attribution='Justice Map', size='county', bounds=[[14, -180], [72, -56]], variant='asian', name='JusticeMap.asian'), black=tile_provider(url='http://www.justicemap.org/tile/{size}/{variant}/{z}/{x}/{y}.png', attribution='Justice Map', size='county', bounds=[[14, -180], [72, -56]], variant='black', name='JusticeMap.black'), hispanic=tile_provider(url='http://www.justicemap.org/tile/{size}/{variant}/{z}/{x}/{y}.png', attribution='Justice Map', size='county', bounds=[[14, -180], [72, -56]], variant='hispanic', name='JusticeMap.hispanic'), multi=tile_provider(url='http://www.justicemap.org/tile/{size}/{variant}/{z}/{x}/{y}.png', attribution='Justice Map', size='county', bounds=[[14, -180], [72, -56]], variant='multi', name='JusticeMap.multi'), nonWhite=tile_provider(url='http://www.justicemap.org/tile/{size}/{variant}/{z}/{x}/{y}.png', attribution='Justice Map', size='county', bounds=[[14, -180], [72, -56]], variant='nonwhite', name='JusticeMap.nonWhite'), white=tile_provider(url='http://www.justicemap.org/tile/{size}/{variant}/{z}/{x}/{y}.png', attribution='Justice Map', size='county', bounds=[[14, -180], [72, -56]], variant='white', name='JusticeMap.white'), plurality=tile_provider(url='http://www.justicemap.org/tile/{size}/{variant}/{z}/{x}/{y}.png', attribution='Justice Map', size='county', bounds=[[14, -180], [72, -56]], variant='plural', name='JusticeMap.plurality')), Wikimedia=tile_provider(url='https://maps.wikimedia.org/osm-intl/{z}/{x}/{y}{r}.png', attribution='Wikimedia', min_zoom=1, max_zoom=19, name='Wikimedia'), GeoportailFrance=bunch(parcels=tile_provider(url='https://wxs.ign.fr/{apikey}/geoportail/wmts?REQUEST=GetTile&SERVICE=WMTS&VERSION=1.0.0&STYLE={style}&TILEMATRIXSET=PM&FORMAT={format}&LAYER={variant}&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}', attribution='Geoportail France', bounds=[[-75, -180], [81, 180]], min_zoom=2, max_zoom=20, apikey='choisirgeoportail', format='image/png', style='bdparcellaire', variant='CADASTRALPARCELS.PARCELS', name='GeoportailFrance.parcels'), ignMaps=tile_provider(url='https://wxs.ign.fr/{apikey}/geoportail/wmts?REQUEST=GetTile&SERVICE=WMTS&VERSION=1.0.0&STYLE={style}&TILEMATRIXSET=PM&FORMAT={format}&LAYER={variant}&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}', attribution='Geoportail France', bounds=[[-75, -180], [81, 180]], min_zoom=2, max_zoom=18, apikey='choisirgeoportail', format='image/jpeg', style='normal', variant='GEOGRAPHICALGRIDSYSTEMS.MAPS', name='GeoportailFrance.ignMaps'), maps=tile_provider(url='https://wxs.ign.fr/{apikey}/geoportail/wmts?REQUEST=GetTile&SERVICE=WMTS&VERSION=1.0.0&STYLE={style}&TILEMATRIXSET=PM&FORMAT={format}&LAYER={variant}&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}', attribution='Geoportail France', bounds=[[-75, -180], [81, 180]], min_zoom=2, max_zoom=18, apikey='choisirgeoportail', format='image/jpeg', style='normal', variant='GEOGRAPHICALGRIDSYSTEMS.MAPS.SCAN-EXPRESS.STANDARD', name='GeoportailFrance.maps'), orthos=tile_provider(url='https://wxs.ign.fr/{apikey}/geoportail/wmts?REQUEST=GetTile&SERVICE=WMTS&VERSION=1.0.0&STYLE={style}&TILEMATRIXSET=PM&FORMAT={format}&LAYER={variant}&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}', attribution='Geoportail France', bounds=[[-75, -180], [81, 180]], min_zoom=2, max_zoom=19, apikey='choisirgeoportail', format='image/jpeg', style='normal', variant='ORTHOIMAGERY.ORTHOPHOTOS', name='GeoportailFrance.orthos')), OneMapSG=bunch(Default=tile_provider(url='https://maps-{s}.onemap.sg/v3/{variant}/{z}/{x}/{y}.png', variant='Default', min_zoom=11, max_zoom=18, bounds=[[1.56073, 104.11475], [1.16, 103.502]], attribution='![](https://docs.onemap.sg/maps/images/oneMap64-01.png) New OneMap | Map data (C) contributors, Singapore Land Authority', name='OneMapSG.Default'), Night=tile_provider(url='https://maps-{s}.onemap.sg/v3/{variant}/{z}/{x}/{y}.png', variant='Night', min_zoom=11, max_zoom=18, bounds=[[1.56073, 104.11475], [1.16, 103.502]], attribution='![](https://docs.onemap.sg/maps/images/oneMap64-01.png) New OneMap | Map data (C) contributors, Singapore Land Authority', name='OneMapSG.Night'), Original=tile_provider(url='https://maps-{s}.onemap.sg/v3/{variant}/{z}/{x}/{y}.png', variant='Original', min_zoom=11, max_zoom=18, bounds=[[1.56073, 104.11475], [1.16, 103.502]], attribution='![](https://docs.onemap.sg/maps/images/oneMap64-01.png) New OneMap | Map data (C) contributors, Singapore Land Authority', name='OneMapSG.Original'), Grey=tile_provider(url='https://maps-{s}.onemap.sg/v3/{variant}/{z}/{x}/{y}.png', variant='Grey', min_zoom=11, max_zoom=18, bounds=[[1.56073, 104.11475], [1.16, 103.502]], attribution='![](https://docs.onemap.sg/maps/images/oneMap64-01.png) New OneMap | Map data (C) contributors, Singapore Land Authority', name='OneMapSG.Grey'), LandLot=tile_provider(url='https://maps-{s}.onemap.sg/v3/{variant}/{z}/{x}/{y}.png', variant='LandLot', min_zoom=11, max_zoom=18, bounds=[[1.56073, 104.11475], [1.16, 103.502]], attribution='![](https://docs.onemap.sg/maps/images/oneMap64-01.png) New OneMap | Map data (C) contributors, Singapore Land Authority', name='OneMapSG.LandLot'))) |
class Solution:
"""
@param words: the n strings
@param target: the target string
@return: The ans
"""
def the_longest_common_prefix(self, words, target):
# write your code here
ans = 0
for word in words:
same = 0
for j in range(0, len(target)):
if j > len(word) - 1 or target[j] != word[j]:
break
same += 1
ans = max(ans, same)
return ans | class Solution:
"""
@param words: the n strings
@param target: the target string
@return: The ans
"""
def the_longest_common_prefix(self, words, target):
ans = 0
for word in words:
same = 0
for j in range(0, len(target)):
if j > len(word) - 1 or target[j] != word[j]:
break
same += 1
ans = max(ans, same)
return ans |
class DogeyError(Exception):
""" The base Dogey Exception, expect this as the main type of Dogey-specific errors such as InvalidCredentialsError. """
pass
class DogeyCommandError(Exception):
def __init__(self, command_name: str, message: str, *args):
""" The basic Dogey exception for commands, expect this in on_command_error.
Args:
command_name (str): The name of the command.
message (str): The message of the exception.
"""
assert isinstance(command_name, str)
assert isinstance(message, str)
self.command_name = command_name
self.message = message
super().__init__(command_name, message, *args)
class InvalidCredentialsError(Exception):
"""An invalid token/refresh token has been passed to the Dogey client. """
pass
class InstanceAlreadyCreated(DogeyError):
"""A Dogey instance has already been created, multiple calls to .start will cause this. """
pass
class MissingRequiredArgument(DogeyCommandError):
def __init__(self, command_name: str, argument: str):
"""A required argument is missing.
Args:
command_name (str): The command name.
argument (str): The required argument.
"""
assert isinstance(argument, str)
self.command_name = command_name
self.argument = argument
super().__init__(command_name, f'"{argument}" is a required argument that is missing.')
class CommandNotFound(DogeyCommandError):
def __init__(self, command_name: str):
"""A command can not be found.
Args:
command_name (str): The command name.
"""
assert isinstance(command_name, str)
self.command_name = command_name
super().__init__(command_name, f'The command could not be found.')
class TooManyArguments(DogeyCommandError):
def __init__(self, command_name: str):
"""Too many arguments have been passed to a command.
Args:
command_name (str): The command name.
"""
assert isinstance(command_name, str)
self.command_name = command_name
super().__init__(command_name, f'Too many arguments have been passed.')
| class Dogeyerror(Exception):
""" The base Dogey Exception, expect this as the main type of Dogey-specific errors such as InvalidCredentialsError. """
pass
class Dogeycommanderror(Exception):
def __init__(self, command_name: str, message: str, *args):
""" The basic Dogey exception for commands, expect this in on_command_error.
Args:
command_name (str): The name of the command.
message (str): The message of the exception.
"""
assert isinstance(command_name, str)
assert isinstance(message, str)
self.command_name = command_name
self.message = message
super().__init__(command_name, message, *args)
class Invalidcredentialserror(Exception):
"""An invalid token/refresh token has been passed to the Dogey client. """
pass
class Instancealreadycreated(DogeyError):
"""A Dogey instance has already been created, multiple calls to .start will cause this. """
pass
class Missingrequiredargument(DogeyCommandError):
def __init__(self, command_name: str, argument: str):
"""A required argument is missing.
Args:
command_name (str): The command name.
argument (str): The required argument.
"""
assert isinstance(argument, str)
self.command_name = command_name
self.argument = argument
super().__init__(command_name, f'"{argument}" is a required argument that is missing.')
class Commandnotfound(DogeyCommandError):
def __init__(self, command_name: str):
"""A command can not be found.
Args:
command_name (str): The command name.
"""
assert isinstance(command_name, str)
self.command_name = command_name
super().__init__(command_name, f'The command could not be found.')
class Toomanyarguments(DogeyCommandError):
def __init__(self, command_name: str):
"""Too many arguments have been passed to a command.
Args:
command_name (str): The command name.
"""
assert isinstance(command_name, str)
self.command_name = command_name
super().__init__(command_name, f'Too many arguments have been passed.') |
"""
*
* Author: Juarez Paulino(coderemite)
* Email: juarez.paulino@gmail.com
*
"""
n=int(input())
o=dict(zip('tminp',[0,1,1,2,3]))
a=sorted(enumerate([input().split()for _ in[0]*n]),key=lambda x:(o[x[1][1][2]],x[0]))
for x in a:print(x[1][0])
| """
*
* Author: Juarez Paulino(coderemite)
* Email: juarez.paulino@gmail.com
*
"""
n = int(input())
o = dict(zip('tminp', [0, 1, 1, 2, 3]))
a = sorted(enumerate([input().split() for _ in [0] * n]), key=lambda x: (o[x[1][1][2]], x[0]))
for x in a:
print(x[1][0]) |
sys_name = "XSS'OR"
sys_copyright = "@evilcos.me"
def sys(req):
return {
'sys_name': sys_name,
'sys_copyright': sys_copyright,
}
| sys_name = "XSS'OR"
sys_copyright = '@evilcos.me'
def sys(req):
return {'sys_name': sys_name, 'sys_copyright': sys_copyright} |
instrument_familes = {
'Strings': ['Guitar', 'Banjo', 'Sitar'],
'Percussion': ['Conga', 'Cymbal', 'Cajon'],
'woodwinds': ['Flute', 'Oboe', 'Clarinet']
}
class KeyError(Exception):
def __init__(self, key):
self.key = key
def __str__(self) -> str:
return f"Key {self.key} does not exist"
def print_instrument_families() -> None:
# print out instrument families
for family in ['Strings', 'Percussion', 'woodwinds']:
try:
print('Some instruments in the ' + family + 'family are: ' + ', '.join(instrument_familes[family]))
except:
raise KeyError(family)
print_instrument_families()
| instrument_familes = {'Strings': ['Guitar', 'Banjo', 'Sitar'], 'Percussion': ['Conga', 'Cymbal', 'Cajon'], 'woodwinds': ['Flute', 'Oboe', 'Clarinet']}
class Keyerror(Exception):
def __init__(self, key):
self.key = key
def __str__(self) -> str:
return f'Key {self.key} does not exist'
def print_instrument_families() -> None:
for family in ['Strings', 'Percussion', 'woodwinds']:
try:
print('Some instruments in the ' + family + 'family are: ' + ', '.join(instrument_familes[family]))
except:
raise key_error(family)
print_instrument_families() |
def intersection(l1, l2):
res = [v for v in l1 if v in l2]
return res
def divide_into_primes(num, base=2, seq=None):
if seq is None:
seq = []
if num == 1:
return seq
for i in range(base, num+1):
if not num % i:
seq.append(i)
return divide_into_primes(int(num/i), i, seq)
x = divide_into_primes(2340)
print(x)
y = divide_into_primes(11230)
print(y)
common = intersection(x, y)
print(common)
# TODO there are issues with repeated elements | def intersection(l1, l2):
res = [v for v in l1 if v in l2]
return res
def divide_into_primes(num, base=2, seq=None):
if seq is None:
seq = []
if num == 1:
return seq
for i in range(base, num + 1):
if not num % i:
seq.append(i)
return divide_into_primes(int(num / i), i, seq)
x = divide_into_primes(2340)
print(x)
y = divide_into_primes(11230)
print(y)
common = intersection(x, y)
print(common) |
#!/usr/bin/env python
# Copyright 2016-2021 Biomedical Imaging Group Rotterdam, Departments of
# Medical Informatics and Radiology, Erasmus MC, Rotterdam, The Netherlands
#
# 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.
"""
This module contains all WORC-related Exceptions
"""
# pylint: disable=too-many-ancestors
# Because fo inheriting from FastrError and a common exception causes this
# exception, even though this behaviour is desired
class WORCError(Exception):
"""
This is the base class for all WORC related exceptions. Catching this
class of exceptions should ensure a proper execution of WORC.
"""
pass
class WORCNotImplementedError(WORCError, NotImplementedError):
"""
This function/method has not been implemented on purpose (e.g. should be
overwritten in a sub-class)
"""
pass
class WORCIOError(WORCError, IOError):
"""
IOError in WORC
"""
pass
class WORCTypeError(WORCError, TypeError):
"""
TypeError in the WORC system
"""
pass
class WORCValueError(WORCError, ValueError):
"""
ValueError in the WORC system
"""
pass
class WORCKeyError(WORCError, KeyError):
"""
KeyError in the WORC system
"""
pass
class WORCAssertionError(WORCError, AssertionError):
"""
AssertionError in the WORC system
"""
pass
class WORCIndexError(WORCError, IndexError):
"""
IndexError in the WORC system
"""
pass
| """
This module contains all WORC-related Exceptions
"""
class Worcerror(Exception):
"""
This is the base class for all WORC related exceptions. Catching this
class of exceptions should ensure a proper execution of WORC.
"""
pass
class Worcnotimplementederror(WORCError, NotImplementedError):
"""
This function/method has not been implemented on purpose (e.g. should be
overwritten in a sub-class)
"""
pass
class Worcioerror(WORCError, IOError):
"""
IOError in WORC
"""
pass
class Worctypeerror(WORCError, TypeError):
"""
TypeError in the WORC system
"""
pass
class Worcvalueerror(WORCError, ValueError):
"""
ValueError in the WORC system
"""
pass
class Worckeyerror(WORCError, KeyError):
"""
KeyError in the WORC system
"""
pass
class Worcassertionerror(WORCError, AssertionError):
"""
AssertionError in the WORC system
"""
pass
class Worcindexerror(WORCError, IndexError):
"""
IndexError in the WORC system
"""
pass |
def check(cmd, mf):
m = mf.findNode('uuid')
if m:
return dict(expected_missing_imports=set(['netbios', 'win32wnet']))
| def check(cmd, mf):
m = mf.findNode('uuid')
if m:
return dict(expected_missing_imports=set(['netbios', 'win32wnet'])) |
s = set()
for _ in range(int(input())):
s.add(input())
print (len(s))
# one line solution
print ( len(set([str(input()) for _ in range(int(input()))])) )
# https://www.hackerrank.com/challenges/py-set-add/problem | s = set()
for _ in range(int(input())):
s.add(input())
print(len(s))
print(len(set([str(input()) for _ in range(int(input()))]))) |
params = input().split(" ")
params = [int(param) for param in params]
if params[0] == params[1]:
for i in range(1, params[0] + 1):
print(input())
exit(0)
else:
all_gnomes = set(range(1, params[0] + 1))
remaining_gnomes = []
sorted = True
prev_gnome = -1
for _ in range(params[1]):
current_gnome = int(input())
remaining_gnomes.append(current_gnome)
all_gnomes.remove(current_gnome)
if sorted and prev_gnome > current_gnome:
sorted = False
elif sorted:
prev_gnome = current_gnome
if sorted:
print('\n'.join([str(i) for i in range(1, params[0] + 1)]))
exit(0)
else:
missing = False
for missing_gnome in all_gnomes:
for remaining_gnome in remaining_gnomes:
if missing_gnome < remaining_gnome:
print(missing_gnome)
missing = True
break
else:
print(remaining_gnome)
remaining_gnomes = remaining_gnomes[1:]
if missing:
missing = False
continue
else:
print(missing_gnome)
remaining_gnomes = [str(gnome) for gnome in remaining_gnomes]
print('\n'.join(remaining_gnomes))
| params = input().split(' ')
params = [int(param) for param in params]
if params[0] == params[1]:
for i in range(1, params[0] + 1):
print(input())
exit(0)
else:
all_gnomes = set(range(1, params[0] + 1))
remaining_gnomes = []
sorted = True
prev_gnome = -1
for _ in range(params[1]):
current_gnome = int(input())
remaining_gnomes.append(current_gnome)
all_gnomes.remove(current_gnome)
if sorted and prev_gnome > current_gnome:
sorted = False
elif sorted:
prev_gnome = current_gnome
if sorted:
print('\n'.join([str(i) for i in range(1, params[0] + 1)]))
exit(0)
else:
missing = False
for missing_gnome in all_gnomes:
for remaining_gnome in remaining_gnomes:
if missing_gnome < remaining_gnome:
print(missing_gnome)
missing = True
break
else:
print(remaining_gnome)
remaining_gnomes = remaining_gnomes[1:]
if missing:
missing = False
continue
else:
print(missing_gnome)
remaining_gnomes = [str(gnome) for gnome in remaining_gnomes]
print('\n'.join(remaining_gnomes)) |
"""
Write a program that, given an ASCII binary matrix of 0's and 1's like this:
0000000000000000
0000000000000000
0000011001110000
0000001111010000
0000011001110000
0000011011100000
0000000000110000
0000101000010000
0000000000000000
0000000000000000
0000000000000000
Outputs the smallest cropped sub-matrix that still contains all 1's (that is, remove all borders of 0's):
01100111
00111101
01100111
01101110
00000011
10100001
"""
def main():
matrix = ("0000000000000000\n"
"0000000000000000\n"
"0000011001110000\n"
"0000001111010000\n"
"0000011001110000\n"
"0000011011100000\n"
"0000000000110000\n"
"0000101000010000\n"
"0000000000000000\n"
"0000000000000000\n"
"0000000000000000")
matrix = matrix.split('\n')
top = -1
bottom = 0
right = 0
left = len(matrix[0])
for n, m in enumerate(matrix):
if '1' in m:
if top == -1:
top = n
bottom = n
left_find = m.find('1')
right_find = m.rfind('1')
if left_find < left:
left = left_find
if right_find > right:
right = right_find
for m in matrix[top:bottom+1]:
print(m[left:right+1])
if __name__ == "__main__":
main()
| """
Write a program that, given an ASCII binary matrix of 0's and 1's like this:
0000000000000000
0000000000000000
0000011001110000
0000001111010000
0000011001110000
0000011011100000
0000000000110000
0000101000010000
0000000000000000
0000000000000000
0000000000000000
Outputs the smallest cropped sub-matrix that still contains all 1's (that is, remove all borders of 0's):
01100111
00111101
01100111
01101110
00000011
10100001
"""
def main():
matrix = '0000000000000000\n0000000000000000\n0000011001110000\n0000001111010000\n0000011001110000\n0000011011100000\n0000000000110000\n0000101000010000\n0000000000000000\n0000000000000000\n0000000000000000'
matrix = matrix.split('\n')
top = -1
bottom = 0
right = 0
left = len(matrix[0])
for (n, m) in enumerate(matrix):
if '1' in m:
if top == -1:
top = n
bottom = n
left_find = m.find('1')
right_find = m.rfind('1')
if left_find < left:
left = left_find
if right_find > right:
right = right_find
for m in matrix[top:bottom + 1]:
print(m[left:right + 1])
if __name__ == '__main__':
main() |
pointer=-1
lock=0
def setSeq(data) :
if lock == 1:
exit(2)
globals()['pointer']=-1
globals()['data']=data.split(',')
globals()['lock']=1
def raw_input() :
globals()['pointer']+=1
try:
return data[pointer]
except IndexError:
exit(0)
def open(path,mode) :
exit(3)
| pointer = -1
lock = 0
def set_seq(data):
if lock == 1:
exit(2)
globals()['pointer'] = -1
globals()['data'] = data.split(',')
globals()['lock'] = 1
def raw_input():
globals()['pointer'] += 1
try:
return data[pointer]
except IndexError:
exit(0)
def open(path, mode):
exit(3) |
result = 0
for i in range(1000):
if i%3==0 or i%5==0:
result += i
print(result) | result = 0
for i in range(1000):
if i % 3 == 0 or i % 5 == 0:
result += i
print(result) |
"""
Get input from user via console or command line
-----------------------------------------------
Output: (string)
"""
name = input('What is your name? ')
print('Hello {}!'.format(name)) | """
Get input from user via console or command line
-----------------------------------------------
Output: (string)
"""
name = input('What is your name? ')
print('Hello {}!'.format(name)) |
text = input()
sum = 0
for symbol in text:
if symbol == "a":
sum += 1
elif symbol == "e":
sum += 2
elif symbol == "i":
sum += 3
elif symbol == "o":
sum += 4
elif symbol == "u":
sum += 5
print(sum) | text = input()
sum = 0
for symbol in text:
if symbol == 'a':
sum += 1
elif symbol == 'e':
sum += 2
elif symbol == 'i':
sum += 3
elif symbol == 'o':
sum += 4
elif symbol == 'u':
sum += 5
print(sum) |
"""
Remove Item
There are several methods to remove items from a list:
"""
thislist = ["apple", "banana", "cherry"]
thislist.remove("banana")
print(thislist)
| """
Remove Item
There are several methods to remove items from a list:
"""
thislist = ['apple', 'banana', 'cherry']
thislist.remove('banana')
print(thislist) |
debt = 95000
interest_percent = .059
yearly_salary = None
hourly_salary = 20
debt_repayment_percent = .2
debt_repayment_length = 0
work_days = 261
work_hours = 8
interest = 0
if yearly_salary and hourly_salary is not None:
if yearly_salary != hourly_salary * work_days * work_hours:
raise ValueError('only yearly or hourly salary can be defined')
if yearly_salary is None:
yearly_salary = hourly_salary * (work_days * work_hours)
else:
hourly_salary = yearly_salary / (work_days * work_hours)
while debt > 0:
debt_repayment_length += 1
debt *= 1 + interest_percent * (1 / 12)
interest += debt * (1 + interest_percent * (1 / 12)) - debt
debt -= yearly_salary / 12 * debt_repayment_percent
print(f'{debt_repayment_length} months, paying ${round(interest)} in interest')
| debt = 95000
interest_percent = 0.059
yearly_salary = None
hourly_salary = 20
debt_repayment_percent = 0.2
debt_repayment_length = 0
work_days = 261
work_hours = 8
interest = 0
if yearly_salary and hourly_salary is not None:
if yearly_salary != hourly_salary * work_days * work_hours:
raise value_error('only yearly or hourly salary can be defined')
if yearly_salary is None:
yearly_salary = hourly_salary * (work_days * work_hours)
else:
hourly_salary = yearly_salary / (work_days * work_hours)
while debt > 0:
debt_repayment_length += 1
debt *= 1 + interest_percent * (1 / 12)
interest += debt * (1 + interest_percent * (1 / 12)) - debt
debt -= yearly_salary / 12 * debt_repayment_percent
print(f'{debt_repayment_length} months, paying ${round(interest)} in interest') |
max_len = 79
str_plier = 2
foo = "Oh oh oh oh you don't know, Joe."*str_plier
curr_len = len(foo)
if curr_len > max_len:
print("Danger, Will Robinson!!!")
print("Your sentiment is {} ".format(curr_len-max_len)+"characters too long!")
else:
print("What a lovely sentiment!\n"+ foo+"\nIn only {} characters!".format(curr_len))
| max_len = 79
str_plier = 2
foo = "Oh oh oh oh you don't know, Joe." * str_plier
curr_len = len(foo)
if curr_len > max_len:
print('Danger, Will Robinson!!!')
print('Your sentiment is {} '.format(curr_len - max_len) + 'characters too long!')
else:
print('What a lovely sentiment!\n' + foo + '\nIn only {} characters!'.format(curr_len)) |
#!/usr/bin/env python3
# compute nim values using negamax and a dictionary
# that holds values already computed RBH 2019
# version 2.0 December 2020 new features
# - verbose option, showing win/loss value once it is known
# - move initialization of the start position outside the main loop
# - tidying, e.g. pad variable instead of ' '
def get_piles():
while True:
raw = input('nim game pile sizes (eg. 3 5 7) ')
try:
dim = tuple( int(x) for x in raw.split() )
if len(dim) > 0 and all(d >= 0 for d in dim): return dim
except ValueError: pass
print('invalid, try again')
def win_loss(b): return 'win' if b else 'loss'
"""
sd dictionary(state: boolean), true if player-to-move wins
"""
def winning(nim_psn, sd, depth, verbose):
# tuple, dictionary, recursion depth, verbose mode (True/False)
pad = ' '
if nim_psn in sd:
if depth==0: print('solved before search')
if verbose: print(pad*depth, nim_psn, win_loss(sd[nim_psn]), 'dict')
return sd[nim_psn]
# nim_psn not in dictionary, so update before we return
if verbose: print(pad*depth, nim_psn)
psn = tuple(sorted(nim_psn))
for j in range(len(psn)): # each pile
for k in range(psn[j]): # number of stones that will remain in that pile
child = tuple(sorted(psn[:j] + (k,) + psn[j+1:]))
if not winning(child, sd, depth+1, verbose):
if verbose: print(pad*depth, nim_psn, win_loss(True), 'losing child')
sd.update({ nim_psn: True }) # update before return
if depth == 0: print('\nwin: move to ',child, len(sd), 'states') # show a winning move
return True
if verbose: print(pad*depth, nim_psn, win_loss(False), 'no win')
sd.update({ nim_psn: False }) # update before return
if depth == 0: print('\nloss,', len(sd), 'states')
return False
v = get_piles()
S = dict()
empty = tuple([0]*len(v))# position (0 0 ... )
S.update({empty: False}) # position (0 0 ... ) loses
w = winning(v, S, 0, True)
| def get_piles():
while True:
raw = input('nim game pile sizes (eg. 3 5 7) ')
try:
dim = tuple((int(x) for x in raw.split()))
if len(dim) > 0 and all((d >= 0 for d in dim)):
return dim
except ValueError:
pass
print('invalid, try again')
def win_loss(b):
return 'win' if b else 'loss'
'\nsd dictionary(state: boolean), true if player-to-move wins\n'
def winning(nim_psn, sd, depth, verbose):
pad = ' '
if nim_psn in sd:
if depth == 0:
print('solved before search')
if verbose:
print(pad * depth, nim_psn, win_loss(sd[nim_psn]), 'dict')
return sd[nim_psn]
if verbose:
print(pad * depth, nim_psn)
psn = tuple(sorted(nim_psn))
for j in range(len(psn)):
for k in range(psn[j]):
child = tuple(sorted(psn[:j] + (k,) + psn[j + 1:]))
if not winning(child, sd, depth + 1, verbose):
if verbose:
print(pad * depth, nim_psn, win_loss(True), 'losing child')
sd.update({nim_psn: True})
if depth == 0:
print('\nwin: move to ', child, len(sd), 'states')
return True
if verbose:
print(pad * depth, nim_psn, win_loss(False), 'no win')
sd.update({nim_psn: False})
if depth == 0:
print('\nloss,', len(sd), 'states')
return False
v = get_piles()
s = dict()
empty = tuple([0] * len(v))
S.update({empty: False})
w = winning(v, S, 0, True) |
TEMPERATURE = 0x01
GAS = 0x02
VOLTAGE = 0x04
DELAY = 0x10
TEST_SUCCESS = 0x3F
ERROR_RELAY_OPEN = 0x04
ERROR_RELAY_CLOSED = 0x08
MODE_CONFIG = 0x80
MODE_RUN = 0x40
MODE_ERROR = 0xC0
MODE_TIMEOUT = 0x00
WRITE = 0x20
def print_status(state):
if(state&MODE_ERROR == MODE_ERROR):
print("ERROR MODE")
elif(state&MODE_ERROR == MODE_TIMEOUT):
print("TIMEOUT")
elif(state&MODE_ERROR == MODE_CONFIG):
print("CONFIG MODE")
elif(state&MODE_ERROR == MODE_RUN):
print("RUN MODE")
if(state&TEST_SUCCESS == 0x00):
print("OK")
if(state&WRITE):
print("WRITE OPERATION:")
if(state&TEMPERATURE):
print("TEMPERATURE")
if(state&GAS):
print("GAS LEVEL")
if(state&ERROR_RELAY_OPEN):
print("VOLTAGE LEVEL")
if(state&ERROR_RELAY_CLOSED):
print("VOLTAGE LEVEL")
if(state&DELAY):
print("DELAY")
else:
if(state&TEMPERATURE):
print("TEMPERATURE EXCEEDED")
if(state&GAS):
print("GAS LEVEL EXCEEDED")
if(state&ERROR_RELAY_OPEN):
print("RELAY STUCK OPEN")
if(state&ERROR_RELAY_CLOSED):
print("RELAY STUCK CLOSED")
def mode_is_run(state):
return (state&MODE_ERROR == MODE_RUN)
def mode_is_config(state):
return (state&MODE_ERROR == MODE_CONFIG)
def mode_is_timeout(state):
return (state&MODE_ERROR == MODE_TIMEOUT) | temperature = 1
gas = 2
voltage = 4
delay = 16
test_success = 63
error_relay_open = 4
error_relay_closed = 8
mode_config = 128
mode_run = 64
mode_error = 192
mode_timeout = 0
write = 32
def print_status(state):
if state & MODE_ERROR == MODE_ERROR:
print('ERROR MODE')
elif state & MODE_ERROR == MODE_TIMEOUT:
print('TIMEOUT')
elif state & MODE_ERROR == MODE_CONFIG:
print('CONFIG MODE')
elif state & MODE_ERROR == MODE_RUN:
print('RUN MODE')
if state & TEST_SUCCESS == 0:
print('OK')
if state & WRITE:
print('WRITE OPERATION:')
if state & TEMPERATURE:
print('TEMPERATURE')
if state & GAS:
print('GAS LEVEL')
if state & ERROR_RELAY_OPEN:
print('VOLTAGE LEVEL')
if state & ERROR_RELAY_CLOSED:
print('VOLTAGE LEVEL')
if state & DELAY:
print('DELAY')
else:
if state & TEMPERATURE:
print('TEMPERATURE EXCEEDED')
if state & GAS:
print('GAS LEVEL EXCEEDED')
if state & ERROR_RELAY_OPEN:
print('RELAY STUCK OPEN')
if state & ERROR_RELAY_CLOSED:
print('RELAY STUCK CLOSED')
def mode_is_run(state):
return state & MODE_ERROR == MODE_RUN
def mode_is_config(state):
return state & MODE_ERROR == MODE_CONFIG
def mode_is_timeout(state):
return state & MODE_ERROR == MODE_TIMEOUT |
# TODO write docs
class SceneDrawer(object):
def __init__(self, device, register):
self.device = device
self.background_color = "black"
self.entity_register = register
def draw(self, scene):
for entity in scene.entities:
if entity.drawer is not None:
entity.drawer.draw(entity)
else:
self.entity_register.add_drawer_support(entity)
entity.drawer.draw(entity)
| class Scenedrawer(object):
def __init__(self, device, register):
self.device = device
self.background_color = 'black'
self.entity_register = register
def draw(self, scene):
for entity in scene.entities:
if entity.drawer is not None:
entity.drawer.draw(entity)
else:
self.entity_register.add_drawer_support(entity)
entity.drawer.draw(entity) |
# -*- coding: utf-8 -*-
"""
Solution to Project Euler problem 16
Author: Jaime Liew
https://github.com/jaimeliew1/Project_Euler_Solutions
"""
def run():
n = pow(2,1000)
digitSum = sum(int(i) for i in str(n))
return digitSum
if __name__ == "__main__":
print(run())
| """
Solution to Project Euler problem 16
Author: Jaime Liew
https://github.com/jaimeliew1/Project_Euler_Solutions
"""
def run():
n = pow(2, 1000)
digit_sum = sum((int(i) for i in str(n)))
return digitSum
if __name__ == '__main__':
print(run()) |
"""
Loop.
The loop() function causes draw() to execute
repeatedly. If noLoop is called in setup()
the draw() is only executed once. In this example
click the mouse to execute loop(), which will
cause the draw() to execute repeatedly.
"""
y = 100
def setup():
"""
The statements in the setup() function
run once when the program begins.
"""
size(640, 360) # Size should be the first statement
stroke(255) # Set stroke color to white
noLoop()
y = height * 0.5
def draw():
"""
The statements in draw() are run until the
program is stopped. Each statement is run in
sequence and after the last line is read, the first
line is run again.
"""
global y
background(0) # Set the background to black
line(0, y, width, y)
y = y - 1
if y < 0:
y = height
def mousePressed():
loop()
| """
Loop.
The loop() function causes draw() to execute
repeatedly. If noLoop is called in setup()
the draw() is only executed once. In this example
click the mouse to execute loop(), which will
cause the draw() to execute repeatedly.
"""
y = 100
def setup():
"""
The statements in the setup() function
run once when the program begins.
"""
size(640, 360)
stroke(255)
no_loop()
y = height * 0.5
def draw():
"""
The statements in draw() are run until the
program is stopped. Each statement is run in
sequence and after the last line is read, the first
line is run again.
"""
global y
background(0)
line(0, y, width, y)
y = y - 1
if y < 0:
y = height
def mouse_pressed():
loop() |
"""align.py
Aligning two sequences. The elements of the sequences are stings or string like
elements, it is not clear to me what interface for the class is expected in the
latter case.
Originally written by Alex Plotnick.
"""
def align(a, b, d=-5, s=lambda x,y: x==y, key=lambda x: x, gap=None):
"""Find the globally optimal alignment between the two sequences a and b
using gap penalty d and similarity function s, and return the aligned
sequences. The similarity function is applied to the result of key(x)
and key(y) for each x in a and y in b, and should return an integer;
key defaults to the identity function.
This implementation uses the Needleman-Wunsch algorithm."""
m = len(a) + 1
n = len(b) + 1
# Rather than keeping a separate traceback matrix, we'll store (score, fun)
# tuples in the alignment matrix, where fun is one of the following three
# traceback functions.
trace = [m-1, n-1] # decoding starts in the lower right-hand corner
def diag(): trace[0] -= 1; trace[1] -= 1; return a[trace[0]], b[trace[1]]
def up(): trace[0] -= 1; return a[trace[0]], gap
def left(): trace[1] -= 1; return gap, b[trace[1]]
# Initialize the alignment matrix.
f = [[None]*n for _ in range(m)]
f[0][0] = (0, lambda: None)
for i in range(1, m): f[i][0] = (d*i, up)
for j in range(1, n): f[0][j] = (d*j, left)
# Compute the optimal alignment.
for i in range(1, m):
for j in range(1, n):
f[i][j] = max((f[i-1][j-1][0] + s(key(a[i-1]), key(b[j-1])), diag),
(f[i-1][j][0] + d, up), # a[i] -> gap
(f[i][j-1][0] + d, left), # b[j] -> gap
key=lambda x: x[0])
# Decoding is now just a matter of running the stored traceback functions
# until we get back to the upper left-hand corner.
aligned_a = []; aligned_b = []
while trace != [0, 0]:
next_a, next_b = f[trace[0]][trace[1]][1]()
aligned_a.append(next_a)
aligned_b.append(next_b)
aligned_a.reverse(); aligned_b.reverse()
if isinstance(a, str) and isinstance(b, str):
# Be nice and coerce the results back to strings.
def default_gap(x): return x if x is not None else "-"
return ("".join(map(default_gap, aligned_a)),
"".join(map(default_gap, aligned_b)))
return aligned_a, aligned_b
def levenshtein_distance(a, b):
"""Compute the Levenshtein edit distance between the sequences a and b."""
m = len(a) + 1
n = len(b) + 1
d = [[0]*n for _ in range(m)]
for i in range(m): d[i][0] = i # deletion
for j in range(n): d[0][j] = j # insertion
for i in range(1, m):
for j in range(1, n):
if a[i-1] == b[j-1]:
d[i][j] = d[i-1][j-1]
else:
d[i][j] = min(d[i-1][j] + 1, # deletion
d[i][j-1] + 1, # insertion
d[i-1][j-1] + 1) # substitution
return d[m-1][n-1]
class Word(object):
def __init__(self, string):
self.text = string
def x__str__(self):
return self.text
def x__getitem__(self, i):
return self.text[i]
def x__len__(self):
return len(self.text)
if __name__ == '__main__':
s0 = ['door', 'knob']
s1 = ['door', 'knobs', 'are', 'out']
s2 = ['doors', 'knobs', 'are', 'in']
s3 = ['door', 's', 'knobs', 'were', 'in']
s4 = ['door\'s', 'knobs', 'are', 'in']
for x, y in [(s0, s1), (s1, s2), (s2, s3), (s2, s4), (s3, s4)]:
print("\nAligning")
print(' ', x)
print(' ', y)
result = align(x, y)
print(' ==>')
print(' ', ''.join(["%-20s" % e for e in result[0]]))
print(' ', ''.join(["%-20s" % e for e in result[1]]))
s1 = "hello this is jim lehrer with the newshour on pbs we have news about the tomato it has been observed recently that they dont taste good anymore".split()
s2 = 'Hello, this is Jim Lehrer, with the newshour on BBC: "We have news about the tomato it has been observed recently that they don\'t taste good anymore.'.split()
s1 = [Word(w) for w in s1]
s2 = [Word(w) for w in s2]
for x in align(s1, s2):
print('>>>', ' '.join([str(w) for w in x]))
first, second = align(s1, s2)
#print(' ', ''.join(["%-10s" % str(e) for e in first]))
#print(' ', ''.join(["%-10s" % e for e in second]))
for x in zip(first, second):
print(str(x[0].text), str(x[1].text))
| """align.py
Aligning two sequences. The elements of the sequences are stings or string like
elements, it is not clear to me what interface for the class is expected in the
latter case.
Originally written by Alex Plotnick.
"""
def align(a, b, d=-5, s=lambda x, y: x == y, key=lambda x: x, gap=None):
"""Find the globally optimal alignment between the two sequences a and b
using gap penalty d and similarity function s, and return the aligned
sequences. The similarity function is applied to the result of key(x)
and key(y) for each x in a and y in b, and should return an integer;
key defaults to the identity function.
This implementation uses the Needleman-Wunsch algorithm."""
m = len(a) + 1
n = len(b) + 1
trace = [m - 1, n - 1]
def diag():
trace[0] -= 1
trace[1] -= 1
return (a[trace[0]], b[trace[1]])
def up():
trace[0] -= 1
return (a[trace[0]], gap)
def left():
trace[1] -= 1
return (gap, b[trace[1]])
f = [[None] * n for _ in range(m)]
f[0][0] = (0, lambda : None)
for i in range(1, m):
f[i][0] = (d * i, up)
for j in range(1, n):
f[0][j] = (d * j, left)
for i in range(1, m):
for j in range(1, n):
f[i][j] = max((f[i - 1][j - 1][0] + s(key(a[i - 1]), key(b[j - 1])), diag), (f[i - 1][j][0] + d, up), (f[i][j - 1][0] + d, left), key=lambda x: x[0])
aligned_a = []
aligned_b = []
while trace != [0, 0]:
(next_a, next_b) = f[trace[0]][trace[1]][1]()
aligned_a.append(next_a)
aligned_b.append(next_b)
aligned_a.reverse()
aligned_b.reverse()
if isinstance(a, str) and isinstance(b, str):
def default_gap(x):
return x if x is not None else '-'
return (''.join(map(default_gap, aligned_a)), ''.join(map(default_gap, aligned_b)))
return (aligned_a, aligned_b)
def levenshtein_distance(a, b):
"""Compute the Levenshtein edit distance between the sequences a and b."""
m = len(a) + 1
n = len(b) + 1
d = [[0] * n for _ in range(m)]
for i in range(m):
d[i][0] = i
for j in range(n):
d[0][j] = j
for i in range(1, m):
for j in range(1, n):
if a[i - 1] == b[j - 1]:
d[i][j] = d[i - 1][j - 1]
else:
d[i][j] = min(d[i - 1][j] + 1, d[i][j - 1] + 1, d[i - 1][j - 1] + 1)
return d[m - 1][n - 1]
class Word(object):
def __init__(self, string):
self.text = string
def x__str__(self):
return self.text
def x__getitem__(self, i):
return self.text[i]
def x__len__(self):
return len(self.text)
if __name__ == '__main__':
s0 = ['door', 'knob']
s1 = ['door', 'knobs', 'are', 'out']
s2 = ['doors', 'knobs', 'are', 'in']
s3 = ['door', 's', 'knobs', 'were', 'in']
s4 = ["door's", 'knobs', 'are', 'in']
for (x, y) in [(s0, s1), (s1, s2), (s2, s3), (s2, s4), (s3, s4)]:
print('\nAligning')
print(' ', x)
print(' ', y)
result = align(x, y)
print(' ==>')
print(' ', ''.join(['%-20s' % e for e in result[0]]))
print(' ', ''.join(['%-20s' % e for e in result[1]]))
s1 = 'hello this is jim lehrer with the newshour on pbs we have news about the tomato it has been observed recently that they dont taste good anymore'.split()
s2 = 'Hello, this is Jim Lehrer, with the newshour on BBC: "We have news about the tomato it has been observed recently that they don\'t taste good anymore.'.split()
s1 = [word(w) for w in s1]
s2 = [word(w) for w in s2]
for x in align(s1, s2):
print('>>>', ' '.join([str(w) for w in x]))
(first, second) = align(s1, s2)
for x in zip(first, second):
print(str(x[0].text), str(x[1].text)) |
content = '''package main
import (
"context"
"github.com/qsock/qim/lib/proto/ret"
)
type Server struct{}
func (*Server) Ping(ctx context.Context, req *ret.NoArgs) (*ret.NoArgs, error) {
return new(ret.NoArgs), nil
}'''
def gen(name, srv_dir) :
with open(srv_dir+"/handle.go", "w") as f:
f.write(content) | content = 'package main\n\nimport (\n\t"context"\n\t"github.com/qsock/qim/lib/proto/ret"\n)\n\ntype Server struct{}\n\nfunc (*Server) Ping(ctx context.Context, req *ret.NoArgs) (*ret.NoArgs, error) {\n\treturn new(ret.NoArgs), nil\n}'
def gen(name, srv_dir):
with open(srv_dir + '/handle.go', 'w') as f:
f.write(content) |
# Source : https://leetcode.com/problems/symmetric-tree/
# Author : penpenps
# Time : 2019-07-09
# Revert right node firstly, then compare with left node
# Time Complexity: O(n)
# Space Complexity: O(n)
# Definition for a binary tree node.
class TreeNode:
def __init__(self, x):
self.val = x
self.left = None
self.right = None
class Solution:
def isSymmetric(self, root: TreeNode) -> bool:
# Revert TreeNode
def revert(node):
if not node: return
node.left, node.right = node.right, node.left
revert(node.left)
revert(node.right)
def isEqual(left, right):
if not left and not right: return True
if not left or not right: return False
if left.val != right.val:
return False
return isEqual(left.left, right.left) and isEqual(left.right, right.right)
if not root:
return True
revert(root.right)
return isEqual(root.left, root.right)
| class Treenode:
def __init__(self, x):
self.val = x
self.left = None
self.right = None
class Solution:
def is_symmetric(self, root: TreeNode) -> bool:
def revert(node):
if not node:
return
(node.left, node.right) = (node.right, node.left)
revert(node.left)
revert(node.right)
def is_equal(left, right):
if not left and (not right):
return True
if not left or not right:
return False
if left.val != right.val:
return False
return is_equal(left.left, right.left) and is_equal(left.right, right.right)
if not root:
return True
revert(root.right)
return is_equal(root.left, root.right) |
#!/usr/bin/python3
class MyList(list):
"""extended version of list
"""
def print_sorted(self):
"""prints the list in ascending order
"""
copy = self[:]
copy.sort()
print(copy)
| class Mylist(list):
"""extended version of list
"""
def print_sorted(self):
"""prints the list in ascending order
"""
copy = self[:]
copy.sort()
print(copy) |
"""
"""
# Definition for a binary tree node.
# class TreeNode:
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
class Solution:
def lowestCommonAncestor(self, root: 'TreeNode', p: 'TreeNode', q: 'TreeNode') -> 'TreeNode':
self.ans = None
def recurse(node):
if not node:
return False
left = recurse(node.left)
right = recurse(node.right)
mid = node == p or node == q
print(node.val, mid+left+right)
if mid+left+right >= 2:
self.ans = node
return mid or left or right
recurse(root)
return self.ans
def lowestCommonAncestor(self, root, p, q):
if root == None or root == p or root == q:
return root
# Find p/q in left subtree
l = self.lowestCommonAncestor(root.left, p, q)
# Find p/q in right subtree
r = self.lowestCommonAncestor(root.right, p, q)
# If p and q found in left and right subtree of this node, then this node is LCA
if l and r:
return root
# Else return the node which returned a node from it's subtree such that one of it's ancestor will be LCA
return l if l else r | """
"""
class Solution:
def lowest_common_ancestor(self, root: 'TreeNode', p: 'TreeNode', q: 'TreeNode') -> 'TreeNode':
self.ans = None
def recurse(node):
if not node:
return False
left = recurse(node.left)
right = recurse(node.right)
mid = node == p or node == q
print(node.val, mid + left + right)
if mid + left + right >= 2:
self.ans = node
return mid or left or right
recurse(root)
return self.ans
def lowest_common_ancestor(self, root, p, q):
if root == None or root == p or root == q:
return root
l = self.lowestCommonAncestor(root.left, p, q)
r = self.lowestCommonAncestor(root.right, p, q)
if l and r:
return root
return l if l else r |
result = [
{0: 0, 1: 'var 1'},
{0: 0, 1: 'var 2'}
]
| result = [{0: 0, 1: 'var 1'}, {0: 0, 1: 'var 2'}] |
result = 0
"""
i = 0
while i < 4:
nr = int(input("Please give me the number: "))
result += nr
i += 1
print("The result of adding numbers is: ", result)
"""
for i in range(1000):
if (i%2 == 0):
print(i, " is even number")
print("The result of adding numbers is: ", result)
| result = 0
'\ni = 0\nwhile i < 4:\n nr = int(input("Please give me the number: "))\n result += nr\n i += 1\n \nprint("The result of adding numbers is: ", result)\n'
for i in range(1000):
if i % 2 == 0:
print(i, ' is even number')
print('The result of adding numbers is: ', result) |
# https://github.com/lord63-forks/python-patterns/blob/patch-3/lazy_evaluation.py
def lazy_property(fn):
"""Decorator that makes a property lazy-evaluated."""
attr_name = '_lazy_' + fn.__name__
@property
def _lazy_property(self):
if not hasattr(self, attr_name):
setattr(self, attr_name, fn(self))
return getattr(self, attr_name)
return _lazy_property
class Person(object):
def __init__(self, name, occupation):
self.name = name
self.occupation = occupation
@lazy_property
def relatives(self):
# Get all relatives, let's assume that it costs much time.
relatives = "Many relatives."
return relatives
def main():
Jhon = Person('Jhon', 'Coder')
print("Name: {0} Occupation: {1}".format(Jhon.name, Jhon.occupation))
print("Before we access `relatives`:")
print(Jhon.__dict__)
print("Jhon's relatives: {0}".format(Jhon.relatives))
print("After we've accessed `relatives`:")
print(Jhon.__dict__)
if __name__ == '__main__':
main() | def lazy_property(fn):
"""Decorator that makes a property lazy-evaluated."""
attr_name = '_lazy_' + fn.__name__
@property
def _lazy_property(self):
if not hasattr(self, attr_name):
setattr(self, attr_name, fn(self))
return getattr(self, attr_name)
return _lazy_property
class Person(object):
def __init__(self, name, occupation):
self.name = name
self.occupation = occupation
@lazy_property
def relatives(self):
relatives = 'Many relatives.'
return relatives
def main():
jhon = person('Jhon', 'Coder')
print('Name: {0} Occupation: {1}'.format(Jhon.name, Jhon.occupation))
print('Before we access `relatives`:')
print(Jhon.__dict__)
print("Jhon's relatives: {0}".format(Jhon.relatives))
print("After we've accessed `relatives`:")
print(Jhon.__dict__)
if __name__ == '__main__':
main() |
description = 'memograph readout'
group = 'optional'
devices = dict(
t_in_fak40 = device('nicos_mlz.devices.memograph.MemographValue',
hostname = 'memograph02.care.frm2',
group = 1,
valuename = 'T_in MIRA',
description = 'inlet temperature memograph',
fmtstr = '%.2F',
warnlimits = (-1, 17.5), #-1 no lower value
unit = 'degC',
),
t_out_fak40 = device('nicos_mlz.devices.memograph.MemographValue',
hostname = 'memograph02.care.frm2',
group = 1,
valuename = 'T_out MIRA',
description = 'outlet temperature memograph',
pollinterval = 30,
maxage = 60,
fmtstr = '%.2F',
unit = 'degC',
),
p_in_fak40 = device('nicos_mlz.devices.memograph.MemographValue',
hostname = 'memograph02.care.frm2',
group = 1,
valuename = 'P_in MIRA',
description = 'inlet pressure memograph',
pollinterval = 30,
maxage = 60,
fmtstr = '%.2F',
unit = 'bar',
),
p_out_fak40 = device('nicos_mlz.devices.memograph.MemographValue',
hostname = 'memograph02.care.frm2',
group = 1,
valuename = 'P_out MIRA',
description = 'outlet pressure memograph',
pollinterval = 30,
maxage = 60,
fmtstr = '%.2F',
unit = 'bar',
),
flow_in_fak40 = device('nicos_mlz.devices.memograph.MemographValue',
hostname = 'memograph02.care.frm2',
group = 1,
valuename = 'FLOW_in MIRA',
description = 'inlet flow memograph',
pollinterval = 30,
maxage = 60,
fmtstr = '%.2F',
warnlimits = (0.2, 100), #100 no upper value
unit = 'l/min',
),
flow_out_fak40 = device('nicos_mlz.devices.memograph.MemographValue',
hostname = 'memograph02.care.frm2',
group = 1,
valuename = 'FLOW_out MIRA',
description = 'outlet flow memograph',
pollinterval = 30,
maxage = 60,
fmtstr = '%.2F',
unit = 'l/min',
),
leak_fak40 = device('nicos_mlz.devices.memograph.MemographValue',
hostname = 'memograph02.care.frm2',
group = 1,
valuename = 'Leak MIRA',
description = 'leakage memograph',
pollinterval = 30,
maxage = 60,
fmtstr = '%.2F',
warnlimits = (-1, 1), #-1 no lower value
unit = 'l/min',
),
cooling_fak40 = device('nicos_mlz.devices.memograph.MemographValue',
hostname = 'memograph02.care.frm2',
group = 1,
valuename = 'Cooling MIRA',
description = 'cooling memograph',
pollinterval = 30,
maxage = 60,
fmtstr = '%.2F',
unit = 'kW',
),
)
| description = 'memograph readout'
group = 'optional'
devices = dict(t_in_fak40=device('nicos_mlz.devices.memograph.MemographValue', hostname='memograph02.care.frm2', group=1, valuename='T_in MIRA', description='inlet temperature memograph', fmtstr='%.2F', warnlimits=(-1, 17.5), unit='degC'), t_out_fak40=device('nicos_mlz.devices.memograph.MemographValue', hostname='memograph02.care.frm2', group=1, valuename='T_out MIRA', description='outlet temperature memograph', pollinterval=30, maxage=60, fmtstr='%.2F', unit='degC'), p_in_fak40=device('nicos_mlz.devices.memograph.MemographValue', hostname='memograph02.care.frm2', group=1, valuename='P_in MIRA', description='inlet pressure memograph', pollinterval=30, maxage=60, fmtstr='%.2F', unit='bar'), p_out_fak40=device('nicos_mlz.devices.memograph.MemographValue', hostname='memograph02.care.frm2', group=1, valuename='P_out MIRA', description='outlet pressure memograph', pollinterval=30, maxage=60, fmtstr='%.2F', unit='bar'), flow_in_fak40=device('nicos_mlz.devices.memograph.MemographValue', hostname='memograph02.care.frm2', group=1, valuename='FLOW_in MIRA', description='inlet flow memograph', pollinterval=30, maxage=60, fmtstr='%.2F', warnlimits=(0.2, 100), unit='l/min'), flow_out_fak40=device('nicos_mlz.devices.memograph.MemographValue', hostname='memograph02.care.frm2', group=1, valuename='FLOW_out MIRA', description='outlet flow memograph', pollinterval=30, maxage=60, fmtstr='%.2F', unit='l/min'), leak_fak40=device('nicos_mlz.devices.memograph.MemographValue', hostname='memograph02.care.frm2', group=1, valuename='Leak MIRA', description='leakage memograph', pollinterval=30, maxage=60, fmtstr='%.2F', warnlimits=(-1, 1), unit='l/min'), cooling_fak40=device('nicos_mlz.devices.memograph.MemographValue', hostname='memograph02.care.frm2', group=1, valuename='Cooling MIRA', description='cooling memograph', pollinterval=30, maxage=60, fmtstr='%.2F', unit='kW')) |
class Solution:
def backspaceCompare(self, S: str, T: str) -> bool:
print(S[0])
stack = []
for i in S:
if i=="#":
if len(stack)==0:
continue
stack.pop()
else:
stack.append(i)
S=""
while len(stack)!=0:
c = stack.pop(0)
S+=str(c)
print(S)
for i in T:
if i=="#":
if len(stack)==0:
continue
stack.pop()
else:
stack.append(i)
T=""
while len(stack)!=0:
c = stack.pop(0)
T+=str(c)
print(T)
return T==S
| class Solution:
def backspace_compare(self, S: str, T: str) -> bool:
print(S[0])
stack = []
for i in S:
if i == '#':
if len(stack) == 0:
continue
stack.pop()
else:
stack.append(i)
s = ''
while len(stack) != 0:
c = stack.pop(0)
s += str(c)
print(S)
for i in T:
if i == '#':
if len(stack) == 0:
continue
stack.pop()
else:
stack.append(i)
t = ''
while len(stack) != 0:
c = stack.pop(0)
t += str(c)
print(T)
return T == S |
# Tram, Minh
# mqt0029
# 1001540029
# 2019-05-13
#---------#---------#---------#---------#---------#--------#
class InternalError( Exception ) : pass
class LexicalError( Exception ) : pass
class SemanticError( Exception ) : pass
class SyntacticError( Exception ) : pass
#---------#---------#---------#---------#---------#--------#
| class Internalerror(Exception):
pass
class Lexicalerror(Exception):
pass
class Semanticerror(Exception):
pass
class Syntacticerror(Exception):
pass |
def coord(x,y):
if x > 0 and y > 0:
i = "I"
elif x > 0 and y < 0:
i = "IV"
elif x < 0 and y < 0:
i = "III"
elif x < 0 and y > 0:
i = "II"
print(f"O ponto ({x:.0f}, {y:.0f}) pertence ao quadrante: {i}")
print(" ")
def main():
a = float(input("Digite um valor para x: "))
b = float(input("Digite um valor para y: "))
print("")
coord(a,b)
main()
#--------------
#~~phelipes2000 | def coord(x, y):
if x > 0 and y > 0:
i = 'I'
elif x > 0 and y < 0:
i = 'IV'
elif x < 0 and y < 0:
i = 'III'
elif x < 0 and y > 0:
i = 'II'
print(f'O ponto ({x:.0f}, {y:.0f}) pertence ao quadrante: {i}')
print(' ')
def main():
a = float(input('Digite um valor para x: '))
b = float(input('Digite um valor para y: '))
print('')
coord(a, b)
main() |
# -*- coding: utf-8 -*-
"""
Created on 31 Dec 2020 12:18:55
@author: jiahuei
"""
__version__ = "0.4.0"
| """
Created on 31 Dec 2020 12:18:55
@author: jiahuei
"""
__version__ = '0.4.0' |
#!/usr/bin/env python3
m = int(input())
if m < 100:
print("00")
elif m <= 5000:
print(str(m//100).zfill(2))
elif m <= 30000:
print(m//1000 + 50)
elif m <= 70000:
print((m//1000 - 30)//5 + 80)
else:
print(89) | m = int(input())
if m < 100:
print('00')
elif m <= 5000:
print(str(m // 100).zfill(2))
elif m <= 30000:
print(m // 1000 + 50)
elif m <= 70000:
print((m // 1000 - 30) // 5 + 80)
else:
print(89) |
# to compute modular power
# Iterative Function to calculate
# (x^y)%p in O(log y)
def power(x, y, p) :
res = 1 # Initialize result
# Update x if it is more
# than or equal to p
x = x % p
while (y > 0) :
# If y is odd, multiply
# x with result
if ((y & 1) == 1) :
res = (res * x) % p
# y must be even now
y = y >> 1 # y = y/2
x = (x * x) % p
return res | def power(x, y, p):
res = 1
x = x % p
while y > 0:
if y & 1 == 1:
res = res * x % p
y = y >> 1
x = x * x % p
return res |
"""Utility class for formatting Slack Messages."""
def wrap_slack_code(str):
"""Format code."""
return f"`{str}`"
def wrap_code_block(str):
"""Format code block."""
return f"```\n{str}\n```"
def wrap_quote(str):
"""Format quote."""
return f"> {str}\n"
def wrap_emph(str):
"""Format emph."""
return f"*{str}*"
| """Utility class for formatting Slack Messages."""
def wrap_slack_code(str):
"""Format code."""
return f'`{str}`'
def wrap_code_block(str):
"""Format code block."""
return f'```\n{str}\n```'
def wrap_quote(str):
"""Format quote."""
return f'> {str}\n'
def wrap_emph(str):
"""Format emph."""
return f'*{str}*' |
#print excepation information as a msg in program
try:
print(10/0)
except ZeroDivisionError as msg:
print("the type of error:",msg.__class__)
| try:
print(10 / 0)
except ZeroDivisionError as msg:
print('the type of error:', msg.__class__) |
'''Defines the `checkstyle_aspect`.
'''
load("//java:providers/JavaCompilationInfo.bzl", "JavaCompilationInfo")
load(
"//java:common/extract/toolchain_info.bzl",
"extract_java_runtime_toolchain_class_path_separator",
"extract_checkstyle_toolchain_info",
)
_JAVA_RUNTIME_TOOLCHAIN_TYPE = "@dwtj_rules_java//java/toolchains/java_runtime_toolchain:toolchain_type"
CheckstyleAspectInfo = provider(
fields = {
'output_file': "The output file generated by `checkstyle_aspect`. This will be `None` if the target doesn't include any Java sources to be checked.",
}
)
def _extract_java_executable(aspect_ctx):
return aspect_ctx.toolchains[_JAVA_RUNTIME_TOOLCHAIN_TYPE] \
.java_runtime_toolchain_info \
.java_executable
def _extract_class_path_separator(aspect_ctx):
return aspect_ctx.toolchains[_JAVA_RUNTIME_TOOLCHAIN_TYPE] \
.java_runtime_toolchain_info \
.class_path_separator
def _file_name(target, suffix):
return "{}.checkstyle.{}".format(target.label.name, suffix)
def _checkstyle_aspect_impl(target, aspect_ctx):
# Skip a target if it doesn't provide a `JavaCompilationInfo`.
if JavaCompilationInfo not in target:
return [CheckstyleAspectInfo()]
# Extract some information from the environment for brevity.
actions = aspect_ctx.actions
srcs = target[JavaCompilationInfo].srcs
srcs_args_file = target[JavaCompilationInfo].srcs_args_file
class_path_separator = _extract_class_path_separator(aspect_ctx)
java_executable = _extract_java_executable(aspect_ctx)
checkstyle_toolchain_info = extract_checkstyle_toolchain_info(aspect_ctx)
checkstyle_java_info = checkstyle_toolchain_info.checkstyle_java_info
# Declare an output log file for Checkstyle to write to.
log_file = actions.declare_file(_file_name(target, "log"))
# Create an args file containing Checkstyle's run-time class path.
# TODO(dwtj): Move this into the toolchain so that it isn't re-created in
# every instantiation/application of the `checkstyle_aspect`.
class_path_args = actions.args()
class_path_args.add_joined(
checkstyle_java_info.transitive_runtime_jars,
join_with = class_path_separator,
omit_if_empty = False,
)
class_path_args_file = actions.declare_file(_file_name(target, "class_path.args"))
actions.write(
class_path_args_file,
content = class_path_args,
is_executable = False,
)
# Instantiate a script which will run Checkstyle from a template.
run_checkstyle_script = actions.declare_file(_file_name(target, "sh"))
actions.expand_template(
template = aspect_ctx.file._run_checkstyle_script_template,
output = run_checkstyle_script,
substitutions = {
"{JAVA_EXECUTABLE}": java_executable.path,
"{JAVA_SOURCES_ARGS_FILE}": srcs_args_file.path,
"{CHECKSTYLE_CLASS_PATH_ARGS_FILE}": class_path_args_file.path,
"{CHECKSTYLE_LOG_FILE}": log_file.path,
},
is_executable = True,
)
# Lastly, run our Checkstyle script on the target's srcs:
actions.run(
executable = run_checkstyle_script,
inputs = depset(
direct = [
java_executable,
srcs_args_file,
class_path_args_file,
],
transitive = [
srcs,
checkstyle_java_info.transitive_runtime_jars,
]
),
outputs = [log_file],
mnemonic = "Checkstyle",
progress_message = "Using Checkstyle to check Java sources of Java target `{}`".format(target.label),
use_default_shell_env = False,
)
return [
OutputGroupInfo(default = [log_file]),
CheckstyleAspectInfo(output_file = log_file)
]
checkstyle_aspect = aspect(
implementation = _checkstyle_aspect_impl,
provides = [CheckstyleAspectInfo],
attrs = {
"_run_checkstyle_script_template": attr.label(
default = "@dwtj_rules_java//java:aspects/checkstyle_aspect/TEMPLATE.run_checkstyle.sh",
allow_single_file = True,
),
},
toolchains = [
'@dwtj_rules_java//java/toolchains/checkstyle_toolchain:toolchain_type',
'@dwtj_rules_java//java/toolchains/java_runtime_toolchain:toolchain_type',
],
)
| """Defines the `checkstyle_aspect`.
"""
load('//java:providers/JavaCompilationInfo.bzl', 'JavaCompilationInfo')
load('//java:common/extract/toolchain_info.bzl', 'extract_java_runtime_toolchain_class_path_separator', 'extract_checkstyle_toolchain_info')
_java_runtime_toolchain_type = '@dwtj_rules_java//java/toolchains/java_runtime_toolchain:toolchain_type'
checkstyle_aspect_info = provider(fields={'output_file': "The output file generated by `checkstyle_aspect`. This will be `None` if the target doesn't include any Java sources to be checked."})
def _extract_java_executable(aspect_ctx):
return aspect_ctx.toolchains[_JAVA_RUNTIME_TOOLCHAIN_TYPE].java_runtime_toolchain_info.java_executable
def _extract_class_path_separator(aspect_ctx):
return aspect_ctx.toolchains[_JAVA_RUNTIME_TOOLCHAIN_TYPE].java_runtime_toolchain_info.class_path_separator
def _file_name(target, suffix):
return '{}.checkstyle.{}'.format(target.label.name, suffix)
def _checkstyle_aspect_impl(target, aspect_ctx):
if JavaCompilationInfo not in target:
return [checkstyle_aspect_info()]
actions = aspect_ctx.actions
srcs = target[JavaCompilationInfo].srcs
srcs_args_file = target[JavaCompilationInfo].srcs_args_file
class_path_separator = _extract_class_path_separator(aspect_ctx)
java_executable = _extract_java_executable(aspect_ctx)
checkstyle_toolchain_info = extract_checkstyle_toolchain_info(aspect_ctx)
checkstyle_java_info = checkstyle_toolchain_info.checkstyle_java_info
log_file = actions.declare_file(_file_name(target, 'log'))
class_path_args = actions.args()
class_path_args.add_joined(checkstyle_java_info.transitive_runtime_jars, join_with=class_path_separator, omit_if_empty=False)
class_path_args_file = actions.declare_file(_file_name(target, 'class_path.args'))
actions.write(class_path_args_file, content=class_path_args, is_executable=False)
run_checkstyle_script = actions.declare_file(_file_name(target, 'sh'))
actions.expand_template(template=aspect_ctx.file._run_checkstyle_script_template, output=run_checkstyle_script, substitutions={'{JAVA_EXECUTABLE}': java_executable.path, '{JAVA_SOURCES_ARGS_FILE}': srcs_args_file.path, '{CHECKSTYLE_CLASS_PATH_ARGS_FILE}': class_path_args_file.path, '{CHECKSTYLE_LOG_FILE}': log_file.path}, is_executable=True)
actions.run(executable=run_checkstyle_script, inputs=depset(direct=[java_executable, srcs_args_file, class_path_args_file], transitive=[srcs, checkstyle_java_info.transitive_runtime_jars]), outputs=[log_file], mnemonic='Checkstyle', progress_message='Using Checkstyle to check Java sources of Java target `{}`'.format(target.label), use_default_shell_env=False)
return [output_group_info(default=[log_file]), checkstyle_aspect_info(output_file=log_file)]
checkstyle_aspect = aspect(implementation=_checkstyle_aspect_impl, provides=[CheckstyleAspectInfo], attrs={'_run_checkstyle_script_template': attr.label(default='@dwtj_rules_java//java:aspects/checkstyle_aspect/TEMPLATE.run_checkstyle.sh', allow_single_file=True)}, toolchains=['@dwtj_rules_java//java/toolchains/checkstyle_toolchain:toolchain_type', '@dwtj_rules_java//java/toolchains/java_runtime_toolchain:toolchain_type']) |
"""Common constants used across image quality modules."""
VALID_MASK_FORMAT = 'valid_mask_%s'
CERTAINTY_MASK_FORMAT = 'certainty_mask_%s'
PREDICTIONS_MASK_FORMAT = 'predictions_mask_%s'
ORIG_IMAGE_FORMAT = 'orig_name=%s'
PATCH_SIDE_LENGTH = 84
REMOTE_MODEL_CHECKPOINT_PATH = "https://storage.googleapis.com/microscope-image-quality/static/model/model.ckpt-1000042"
| """Common constants used across image quality modules."""
valid_mask_format = 'valid_mask_%s'
certainty_mask_format = 'certainty_mask_%s'
predictions_mask_format = 'predictions_mask_%s'
orig_image_format = 'orig_name=%s'
patch_side_length = 84
remote_model_checkpoint_path = 'https://storage.googleapis.com/microscope-image-quality/static/model/model.ckpt-1000042' |
expected_output = {
"interface_name": "Gi1/0/1",
"if_id": "75",
"phy_registers": {
"0": {
"register_number": "0000",
"hex_bit_value": "1140",
"register_name": "Control Register",
"bits": "0001000101000000",
},
"1": {
"register_number": "0001",
"hex_bit_value": "796d",
"register_name": "Control STATUS",
"bits": "0111100101101101",
},
"2": {
"register_number": "0002",
"hex_bit_value": "ae02",
"register_name": "Phy(B:D3A6) ID 1",
"bits": "1010111000000010",
},
"3": {
"register_number": "0003",
"hex_bit_value": "5011",
"register_name": "Phy(B:D3A6) ID 2",
"bits": "0101000000010001",
},
"4": {
"register_number": "0004",
"hex_bit_value": "01e1",
"register_name": "Auto-Negotiation Advertisement",
"bits": "0000000111100001",
},
"5": {
"register_number": "0005",
"hex_bit_value": "c1e1",
"register_name": "Auto-Negotiation Link Partner",
"bits": "1100000111100001",
},
"6": {
"register_number": "0006",
"hex_bit_value": "006d",
"register_name": "Auto-Negotiation Expansion Reg",
"bits": "0000000001101101",
},
"7": {
"register_number": "0007",
"hex_bit_value": "2001",
"register_name": "Next Page Transmit Register",
"bits": "0010000000000001",
},
"8": {
"register_number": "0008",
"hex_bit_value": "4e92",
"register_name": "Link Partner Next page Register ",
"bits": "0100111010010010",
},
"9": {
"register_number": "0009",
"hex_bit_value": "0e00",
"register_name": "1000T Base Control",
"bits": "0000111000000000",
},
"10": {
"register_number": "0010",
"hex_bit_value": "0001",
"register_name": "PHY Specific Control",
"bits": "0000000000000001",
},
"11": {
"register_number": "0011",
"hex_bit_value": "1303",
"register_name": "PHY Specific Status",
"bits": "0001001100000011",
},
"12": {
"register_number": "0012",
"hex_bit_value": "0000",
"register_name": "PHY Specific Interrupt Enable",
"bits": "0000000000000000",
},
"13": {
"register_number": "0013",
"hex_bit_value": "0000",
"register_name": "PHY Specific Interrupt Status",
"bits": "0000000000000000",
},
"14": {
"register_number": "003d",
"hex_bit_value": "c000",
"register_name": "EEE Test Ctrl(0x803D)",
"bits": "1100000000000000",
},
"15": {
"register_number": "0001",
"hex_bit_value": "0046",
"register_name": "EEE PCS Status1(0x1)",
"bits": "0000000001000110",
},
"16": {
"register_number": "0014",
"hex_bit_value": "0006",
"register_name": "EEE Capability Reg(0x14)",
"bits": "0000000000000110",
},
"17": {
"register_number": "003c",
"hex_bit_value": "0000",
"register_name": "EEE Advertisement Ctrl(0x3C)",
"bits": "0000000000000000",
},
"18": {
"register_number": "003d",
"hex_bit_value": "0000",
"register_name": "EEE Link Partnet Advrt(0x3D)",
"bits": "0000000000000000",
},
"19": {
"register_number": "003e",
"hex_bit_value": "0000",
"register_name": "EEE Resolution Status(0x803E)",
"bits": "0000000000000000",
},
"20": {
"register_number": "001a",
"hex_bit_value": "247e",
"register_name": "Cu Interrupt Status(0x1A)",
"bits": "0010010001111110",
},
"21": {
"register_number": "001b",
"hex_bit_value": "0f7e",
"register_name": "Cu Interrupt Mask(0x1B)",
"bits": "0000111101111110",
},
"22": {
"register_number": "001e",
"hex_bit_value": "0000",
"register_name": "Test 1 Reg(0x1E)",
"bits": "0000000000000000",
},
"23": {
"register_number": "002a",
"hex_bit_value": "06c2",
"register_name": "Cu Power MII Ctrl RDB(0x02A)",
"bits": "0000011011000010",
},
"24": {
"register_number": "002c",
"hex_bit_value": "4004",
"register_name": "Cu Misc Test RDB(0x02C)",
"bits": "0100000000000100",
},
"25": {
"register_number": "0003",
"hex_bit_value": "82f3",
"register_name": "DTE MII Control(0x03)",
"bits": "1000001011110011",
},
"26": {
"register_number": "0007",
"hex_bit_value": "7277",
"register_name": "Cu Misc Cntrl Reg(0x07)",
"bits": "0111001001110111",
},
"27": {
"register_number": "00e4",
"hex_bit_value": "0000",
"register_name": "10Base-T Radiation RDB Reg(0x01e4)",
"bits": "0000000000000000",
},
"28": {
"register_number": "00ea",
"hex_bit_value": "0100",
"register_name": "10Base-T Radiation RDB Reg(0x01ea)",
"bits": "0000000100000000",
},
"29": {
"register_number": "0021",
"hex_bit_value": "7ea8",
"register_name": "RDB Reg(0x21)",
"bits": "0111111010101000",
},
"30": {
"register_number": "002b",
"hex_bit_value": "82f3",
"register_name": "RDB Reg(0x2B)",
"bits": "1000001011110011",
},
"31": {
"register_number": "002f",
"hex_bit_value": "7277",
"register_name": "RDB Reg(0x2F)",
"bits": "0111001001110111",
},
"32": {
"register_number": "0009",
"hex_bit_value": "871c",
"register_name": "RDB Reg(0x09)",
"bits": "1000011100011100",
},
"33": {
"register_number": "000c",
"hex_bit_value": "8800",
"register_name": "RDB Reg(0x0C)",
"bits": "1000100000000000",
},
"34": {
"register_number": "0019",
"hex_bit_value": "871c",
"register_name": "Cu Aux Status Summary(0x19)",
"bits": "1000011100011100",
},
},
}
| expected_output = {'interface_name': 'Gi1/0/1', 'if_id': '75', 'phy_registers': {'0': {'register_number': '0000', 'hex_bit_value': '1140', 'register_name': 'Control Register', 'bits': '0001000101000000'}, '1': {'register_number': '0001', 'hex_bit_value': '796d', 'register_name': 'Control STATUS', 'bits': '0111100101101101'}, '2': {'register_number': '0002', 'hex_bit_value': 'ae02', 'register_name': 'Phy(B:D3A6) ID 1', 'bits': '1010111000000010'}, '3': {'register_number': '0003', 'hex_bit_value': '5011', 'register_name': 'Phy(B:D3A6) ID 2', 'bits': '0101000000010001'}, '4': {'register_number': '0004', 'hex_bit_value': '01e1', 'register_name': 'Auto-Negotiation Advertisement', 'bits': '0000000111100001'}, '5': {'register_number': '0005', 'hex_bit_value': 'c1e1', 'register_name': 'Auto-Negotiation Link Partner', 'bits': '1100000111100001'}, '6': {'register_number': '0006', 'hex_bit_value': '006d', 'register_name': 'Auto-Negotiation Expansion Reg', 'bits': '0000000001101101'}, '7': {'register_number': '0007', 'hex_bit_value': '2001', 'register_name': 'Next Page Transmit Register', 'bits': '0010000000000001'}, '8': {'register_number': '0008', 'hex_bit_value': '4e92', 'register_name': 'Link Partner Next page Register ', 'bits': '0100111010010010'}, '9': {'register_number': '0009', 'hex_bit_value': '0e00', 'register_name': '1000T Base Control', 'bits': '0000111000000000'}, '10': {'register_number': '0010', 'hex_bit_value': '0001', 'register_name': 'PHY Specific Control', 'bits': '0000000000000001'}, '11': {'register_number': '0011', 'hex_bit_value': '1303', 'register_name': 'PHY Specific Status', 'bits': '0001001100000011'}, '12': {'register_number': '0012', 'hex_bit_value': '0000', 'register_name': 'PHY Specific Interrupt Enable', 'bits': '0000000000000000'}, '13': {'register_number': '0013', 'hex_bit_value': '0000', 'register_name': 'PHY Specific Interrupt Status', 'bits': '0000000000000000'}, '14': {'register_number': '003d', 'hex_bit_value': 'c000', 'register_name': 'EEE Test Ctrl(0x803D)', 'bits': '1100000000000000'}, '15': {'register_number': '0001', 'hex_bit_value': '0046', 'register_name': 'EEE PCS Status1(0x1)', 'bits': '0000000001000110'}, '16': {'register_number': '0014', 'hex_bit_value': '0006', 'register_name': 'EEE Capability Reg(0x14)', 'bits': '0000000000000110'}, '17': {'register_number': '003c', 'hex_bit_value': '0000', 'register_name': 'EEE Advertisement Ctrl(0x3C)', 'bits': '0000000000000000'}, '18': {'register_number': '003d', 'hex_bit_value': '0000', 'register_name': 'EEE Link Partnet Advrt(0x3D)', 'bits': '0000000000000000'}, '19': {'register_number': '003e', 'hex_bit_value': '0000', 'register_name': 'EEE Resolution Status(0x803E)', 'bits': '0000000000000000'}, '20': {'register_number': '001a', 'hex_bit_value': '247e', 'register_name': 'Cu Interrupt Status(0x1A)', 'bits': '0010010001111110'}, '21': {'register_number': '001b', 'hex_bit_value': '0f7e', 'register_name': 'Cu Interrupt Mask(0x1B)', 'bits': '0000111101111110'}, '22': {'register_number': '001e', 'hex_bit_value': '0000', 'register_name': 'Test 1 Reg(0x1E)', 'bits': '0000000000000000'}, '23': {'register_number': '002a', 'hex_bit_value': '06c2', 'register_name': 'Cu Power MII Ctrl RDB(0x02A)', 'bits': '0000011011000010'}, '24': {'register_number': '002c', 'hex_bit_value': '4004', 'register_name': 'Cu Misc Test RDB(0x02C)', 'bits': '0100000000000100'}, '25': {'register_number': '0003', 'hex_bit_value': '82f3', 'register_name': 'DTE MII Control(0x03)', 'bits': '1000001011110011'}, '26': {'register_number': '0007', 'hex_bit_value': '7277', 'register_name': 'Cu Misc Cntrl Reg(0x07)', 'bits': '0111001001110111'}, '27': {'register_number': '00e4', 'hex_bit_value': '0000', 'register_name': '10Base-T Radiation RDB Reg(0x01e4)', 'bits': '0000000000000000'}, '28': {'register_number': '00ea', 'hex_bit_value': '0100', 'register_name': '10Base-T Radiation RDB Reg(0x01ea)', 'bits': '0000000100000000'}, '29': {'register_number': '0021', 'hex_bit_value': '7ea8', 'register_name': 'RDB Reg(0x21)', 'bits': '0111111010101000'}, '30': {'register_number': '002b', 'hex_bit_value': '82f3', 'register_name': 'RDB Reg(0x2B)', 'bits': '1000001011110011'}, '31': {'register_number': '002f', 'hex_bit_value': '7277', 'register_name': 'RDB Reg(0x2F)', 'bits': '0111001001110111'}, '32': {'register_number': '0009', 'hex_bit_value': '871c', 'register_name': 'RDB Reg(0x09)', 'bits': '1000011100011100'}, '33': {'register_number': '000c', 'hex_bit_value': '8800', 'register_name': 'RDB Reg(0x0C)', 'bits': '1000100000000000'}, '34': {'register_number': '0019', 'hex_bit_value': '871c', 'register_name': 'Cu Aux Status Summary(0x19)', 'bits': '1000011100011100'}}} |
class Solution:
def intersection(self, nums1: List[int], nums2: List[int]) -> List[int]:
l = set(nums1)
ret = [i for i in nums2 if i in l]
return list(set(ret)) | class Solution:
def intersection(self, nums1: List[int], nums2: List[int]) -> List[int]:
l = set(nums1)
ret = [i for i in nums2 if i in l]
return list(set(ret)) |
# Class attributes ...
#
# Use dot to assign values to a class instance
class Point:
""" a 2D point """
p = Point()
p.x = 1
p.y = 2
assert p.x == 1
assert p.y == 2 | class Point:
""" a 2D point """
p = point()
p.x = 1
p.y = 2
assert p.x == 1
assert p.y == 2 |
"""API endpoints."""
class Endpoint(object):
API_PREFIX = '/api/'
VEHICLES = API_PREFIX + 'vehicles/' # ?dealer=AAA?model=XXX?fuel=YYY?transmission=ZZZ
DEALERS_CLOSEST_LIST = API_PREFIX + 'dealers/' # ?dealer=AAA?model=XXX?fuel=YYY?transmission=ZZZ?latitude=LLL?longitude=OOO
DEALER_CLOSEST = API_PREFIX + 'dealers/closest/' # ?dealer=AAA?model=XXX?fuel=YYY?transmission=ZZZ?latitude=LLL?longitude=OOO
DEALERS_IN_POLYGON = API_PREFIX + 'dealers/polygon/'
BOOKINGS_CREATE = API_PREFIX + 'bookings/create/' # {first_name, last_name, vehicle_id, pickup_date}
BOOKINGS_CANCEL = API_PREFIX + 'bookings/cancel/' # {booking_id, reason}
| """API endpoints."""
class Endpoint(object):
api_prefix = '/api/'
vehicles = API_PREFIX + 'vehicles/'
dealers_closest_list = API_PREFIX + 'dealers/'
dealer_closest = API_PREFIX + 'dealers/closest/'
dealers_in_polygon = API_PREFIX + 'dealers/polygon/'
bookings_create = API_PREFIX + 'bookings/create/'
bookings_cancel = API_PREFIX + 'bookings/cancel/' |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Oct 6 20:34:16 2019
@author: sodatab
MITx: 6.00.1x
"""
"""
01.2-Finger While Exercise 02
----------------------------
2. Convert the following into code that uses a while loop.
prints Hello!
prints 10
prints 8
prints 6
prints 4
prints 2
"""
"""Answer Script:"""
num = 12
print('Hello!')
while num > 2:
num -= 2
print(num)
| """
Created on Sun Oct 6 20:34:16 2019
@author: sodatab
MITx: 6.00.1x
"""
'\n01.2-Finger While Exercise 02\n----------------------------\n2. Convert the following into code that uses a while loop.\n\nprints Hello!\nprints 10\nprints 8\nprints 6\nprints 4\nprints 2\n'
'Answer Script:'
num = 12
print('Hello!')
while num > 2:
num -= 2
print(num) |
def solution(N):
b_rep = '{:b}'.format(N)
counter = 0
res = 0
prev_val = 0
count = False
for val in b_rep:
val = int(val)
if val - prev_val == -1:
count = True
counter += 1
if val - prev_val == 0 and count:
counter += 1
if val - prev_val == 1:
count = False
res = max(res, counter)
counter = 0
prev_val = val
return res
| def solution(N):
b_rep = '{:b}'.format(N)
counter = 0
res = 0
prev_val = 0
count = False
for val in b_rep:
val = int(val)
if val - prev_val == -1:
count = True
counter += 1
if val - prev_val == 0 and count:
counter += 1
if val - prev_val == 1:
count = False
res = max(res, counter)
counter = 0
prev_val = val
return res |
x = 30;
y = 3;
## addition
print("x + y : ",x + y);
## we can use + for concatenate string
print("Hello, " + "World!");
## Subtraction
print("x - y : ",x - y);
## Division
print("x / y : ",x / y);
## here division operator always return float type number
## Multiplication
print("x * y : ",x*y);
# we can use * operator to concatenate same string multiple time.
print("'word '*5 : ",'word'*5);
## Remainder
print("x%6 : ",x%6);
## Floor Division
print("x//7 : ",x//7);
## return division result in floor int type
## exponentition
print("2**4 : ",2**4);
## here 2 is base and 4 is power of base | x = 30
y = 3
print('x + y : ', x + y)
print('Hello, ' + 'World!')
print('x - y : ', x - y)
print('x / y : ', x / y)
print('x * y : ', x * y)
print("'word '*5 : ", 'word' * 5)
print('x%6 : ', x % 6)
print('x//7 : ', x // 7)
print('2**4 : ', 2 ** 4) |
class YAMLEmptyError(Exception):
"""The yaml configs file is empty, nothing to read from there."""
class BadInputs(Exception):
"""Bad inputs"""
class PeaFailToStart(SystemError):
"""When pea is failed to started"""
class GRPCServerError(Exception):
"""Can not connect to the grpc gateway"""
class BadClient(Exception):
"""A wrongly defined grpc client, can not communicate with bert2tf server correctly """
class NoExplicitMessage(Exception):
"""Waiting until all partial messages are received"""
class UnknownRequestError(Exception):
"""Unknown request type"""
class DriverError(Exception):
"""Base driver error"""
class UnattachedDriver(DriverError):
"""Driver is not attached to any BasePea or executor"""
class NoDriverForRequest(DriverError):
"""No matched driver for this request """
class UnknownControlCommand(RuntimeError):
"""The control command received can not be recognized"""
class RequestLoopEnd(KeyboardInterrupt):
"""The event loop of BasePea ends"""
class FlowTopologyError(Exception):
"""Flow exception when the topology is ambiguous."""
class FlowMissingPodError(Exception):
"""Flow exception when a pod can not be found in the flow."""
class FlowEmptyError(Exception):
"""Flow exception when flow was not built and to call flow external function, such as `predict()` """
| class Yamlemptyerror(Exception):
"""The yaml configs file is empty, nothing to read from there."""
class Badinputs(Exception):
"""Bad inputs"""
class Peafailtostart(SystemError):
"""When pea is failed to started"""
class Grpcservererror(Exception):
"""Can not connect to the grpc gateway"""
class Badclient(Exception):
"""A wrongly defined grpc client, can not communicate with bert2tf server correctly """
class Noexplicitmessage(Exception):
"""Waiting until all partial messages are received"""
class Unknownrequesterror(Exception):
"""Unknown request type"""
class Drivererror(Exception):
"""Base driver error"""
class Unattacheddriver(DriverError):
"""Driver is not attached to any BasePea or executor"""
class Nodriverforrequest(DriverError):
"""No matched driver for this request """
class Unknowncontrolcommand(RuntimeError):
"""The control command received can not be recognized"""
class Requestloopend(KeyboardInterrupt):
"""The event loop of BasePea ends"""
class Flowtopologyerror(Exception):
"""Flow exception when the topology is ambiguous."""
class Flowmissingpoderror(Exception):
"""Flow exception when a pod can not be found in the flow."""
class Flowemptyerror(Exception):
"""Flow exception when flow was not built and to call flow external function, such as `predict()` """ |
#!/usr/bin/env python3
# Please make sure this file can be executed.
# chmod +x hello.py
print('Hello World!!')
| print('Hello World!!') |
def seta(n):
for i in range(n):
if i == n - 1:
print((2 * n) * '*', end='')
print((i + 1) * '*')
else:
print((2 * n) * ' ', end='')
print((i + 1) * '*')
for j in range(n - 1, 0, -1):
print((2 * n) * ' ',end='')
print(j * '*')
seta(10)
| def seta(n):
for i in range(n):
if i == n - 1:
print(2 * n * '*', end='')
print((i + 1) * '*')
else:
print(2 * n * ' ', end='')
print((i + 1) * '*')
for j in range(n - 1, 0, -1):
print(2 * n * ' ', end='')
print(j * '*')
seta(10) |
'''input
atcoder beginner contest
ABC
'''
# -*- coding: utf-8 -*-
# AtCoder Beginner Contest
# Problem A
if __name__ == '__main__':
a, b, c = input().split()
result = a[0] + b[0] + c[0]
print(result.upper())
| """input
atcoder beginner contest
ABC
"""
if __name__ == '__main__':
(a, b, c) = input().split()
result = a[0] + b[0] + c[0]
print(result.upper()) |
file = open("AAPL.txt", "r")
lines = file.readlines()
prices = []
for line in lines:
price = float(line)
prices.append(price)
print(price)
print(prices) | file = open('AAPL.txt', 'r')
lines = file.readlines()
prices = []
for line in lines:
price = float(line)
prices.append(price)
print(price)
print(prices) |
'''
Problem Description:
--------------------
The program reads a file and counts
the number of blank spaces in a text file.
'''
print(__doc__)
print('-'*25)
fileName=input('Enter file name: ')
k=0
with open(fileName,'r')as f:
for line in f:
words=line.split()
for i in words:
for letter in i:
if letter.isspace:
k+=1
print('Occurance of blank space in text file \'{%s}\' is %d times'%(fileName,k)) | """
Problem Description:
--------------------
The program reads a file and counts
the number of blank spaces in a text file.
"""
print(__doc__)
print('-' * 25)
file_name = input('Enter file name: ')
k = 0
with open(fileName, 'r') as f:
for line in f:
words = line.split()
for i in words:
for letter in i:
if letter.isspace:
k += 1
print("Occurance of blank space in text file '{%s}' is %d times" % (fileName, k)) |
functions = {
'Add': (2, lambda p: p[0] + p[1]),
'Minus': (2, lambda p: p[0] - p[1]),
'UnaryMinus': (1, lambda p: -p[0]),
'Divide': (2, lambda p: p[0] / p[1]),
'Multiply': (2, lambda p: p[0] * p[1]),
'Modulo': (2, lambda p: p[0] % p[1]),
'EqualTo': (2, lambda p: p[0] == p[1]),
'NotEqualTo': (2, lambda p: p[0] != p[1]),
'GreaterThan': (2, lambda p: p[0] > p[1]),
'GreaterThanOrEqualTo': (2, lambda p: p[0] >= p[1]),
'LessThan': (2, lambda p: p[0] < p[1]),
'LessThanOrEqualTo': (2, lambda p: p[0] <= p[1]),
'And': (2, lambda p: p[0] and p[1]),
'Or': (2, lambda p: p[0] or p[1]),
'Xor': (2, lambda p: p[0] ^ p[1]),
'Not': (1, lambda p: not p[0])
}
typeMethods = {
'Boolean': ['EqualTo',
'NotEqualTo',
'And',
'Or',
'Xor',
'Not'],
'Number': ['EqualTo',
'NotEqualTo',
'Add',
'Minus',
'Divide',
'Multiply',
'Modulo',
'UnaryMinus',
'GreaterThan',
'GreaterThanOrEqualTo',
'LessThan',
'LessThanOrEqualTo'],
'String': ['EqualTo',
'NotEqualTo',
'Add']
}
for type, methods in typeMethods.items():
for method in methods:
functions[f'{type}.{method}'] = functions[method]
| functions = {'Add': (2, lambda p: p[0] + p[1]), 'Minus': (2, lambda p: p[0] - p[1]), 'UnaryMinus': (1, lambda p: -p[0]), 'Divide': (2, lambda p: p[0] / p[1]), 'Multiply': (2, lambda p: p[0] * p[1]), 'Modulo': (2, lambda p: p[0] % p[1]), 'EqualTo': (2, lambda p: p[0] == p[1]), 'NotEqualTo': (2, lambda p: p[0] != p[1]), 'GreaterThan': (2, lambda p: p[0] > p[1]), 'GreaterThanOrEqualTo': (2, lambda p: p[0] >= p[1]), 'LessThan': (2, lambda p: p[0] < p[1]), 'LessThanOrEqualTo': (2, lambda p: p[0] <= p[1]), 'And': (2, lambda p: p[0] and p[1]), 'Or': (2, lambda p: p[0] or p[1]), 'Xor': (2, lambda p: p[0] ^ p[1]), 'Not': (1, lambda p: not p[0])}
type_methods = {'Boolean': ['EqualTo', 'NotEqualTo', 'And', 'Or', 'Xor', 'Not'], 'Number': ['EqualTo', 'NotEqualTo', 'Add', 'Minus', 'Divide', 'Multiply', 'Modulo', 'UnaryMinus', 'GreaterThan', 'GreaterThanOrEqualTo', 'LessThan', 'LessThanOrEqualTo'], 'String': ['EqualTo', 'NotEqualTo', 'Add']}
for (type, methods) in typeMethods.items():
for method in methods:
functions[f'{type}.{method}'] = functions[method] |
class Features:
NOTEBOOKS = 'app.features.notebooks'
class Deployment:
SITE = 'app.deployment.site'
class Branding:
PRIVACY = 'app.configuration.privacy'
LICENSE = 'app.configuration.license'
HEADER_LOGO_ID = 'app.configuration.header.logo.file.id'
FOOTER_LOGO_ID = 'app.configuration.footer.logo.file.id'
FOOTER_LOGO_URL = 'app.configuration.footer.logo.url',
FAVICON_ID = 'app.configuration.favicon.file.id'
| class Features:
notebooks = 'app.features.notebooks'
class Deployment:
site = 'app.deployment.site'
class Branding:
privacy = 'app.configuration.privacy'
license = 'app.configuration.license'
header_logo_id = 'app.configuration.header.logo.file.id'
footer_logo_id = 'app.configuration.footer.logo.file.id'
footer_logo_url = ('app.configuration.footer.logo.url',)
favicon_id = 'app.configuration.favicon.file.id' |
"""This problem was asked by Snapchat.
You are given an array of length N, where each element i represents the number of ways
we can produce i units of change. For example, [1, 0, 1, 1, 2] would indicate that
there is only one way to make 0, 2, or 3 units, and two ways of making 4 units.
Given such an array, determine the denominations that must be in use.
In the case above, for example, there must be coins with value 2, 3, and 4.
""" | """This problem was asked by Snapchat.
You are given an array of length N, where each element i represents the number of ways
we can produce i units of change. For example, [1, 0, 1, 1, 2] would indicate that
there is only one way to make 0, 2, or 3 units, and two ways of making 4 units.
Given such an array, determine the denominations that must be in use.
In the case above, for example, there must be coins with value 2, 3, and 4.
""" |
WIDTH = 512
HEIGHT = 336
FPS = 50
PIX_FOR_BRIX = 16
STEPS_FOR_CYCLE = 16
N_STEP_FOR_TEST = 5
BLACK = (0, 0, 0)
BKGR = (0, 0, 0)
| width = 512
height = 336
fps = 50
pix_for_brix = 16
steps_for_cycle = 16
n_step_for_test = 5
black = (0, 0, 0)
bkgr = (0, 0, 0) |
# -*- coding: utf-8 -*-
"""
.. module:: pytfa
:platform: Unix, Windows
:synopsis: Thermodynamics-based Flux Analysis
.. moduleauthor:: pyTFA team
Pre-tuned configurations for faster solving
"""
def dg_relax_config(model):
"""
:param model:
:return:
"""
# grbtune output on a hard model :
#
# Tested 6992 parameter sets in 46793.78s
#
# Baseline parameter set: mean runtime 142.09s
#
# Improved parameter set 1 (mean runtime 3.27s):
#
# NormAdjust 0
# BranchDir 1
# DegenMoves 0
# Heuristics 0
# MIPFocus 1
# Cuts 3
#
# Improved parameter set 2 (mean runtime 3.30s):
#
# NormAdjust 0
# BranchDir 1
# DegenMoves 0
# Heuristics 0.001
# PreSparsify 0
#
# Improved parameter set 3 (mean runtime 3.34s):
#
# NormAdjust 0
# BranchDir 1
# DegenMoves 0
# Heuristics 0.001
#
# Improved parameter set 4 (mean runtime 5.22s):
#
# NormAdjust 1
# BranchDir 1
# DegenMoves 0
#
# Improved parameter set 5 (mean runtime 7.18s):
#
# BranchDir 1
# DegenMoves 0
if model.solver.interface.__name__ == 'optlang.gurobi_interface':
model.solver.problem.Params.NormAdjust = 0
model.solver.problem.Params.BranchDir = 1
model.solver.problem.Params.DegenMoves = 0
model.solver.problem.Params.Heuristics = 0.001
model.solver.problem.Params.Cuts = 3
model.solver.problem.Params.Presolve = 2
model.solver.problem.Params.Method = 0
| """
.. module:: pytfa
:platform: Unix, Windows
:synopsis: Thermodynamics-based Flux Analysis
.. moduleauthor:: pyTFA team
Pre-tuned configurations for faster solving
"""
def dg_relax_config(model):
"""
:param model:
:return:
"""
if model.solver.interface.__name__ == 'optlang.gurobi_interface':
model.solver.problem.Params.NormAdjust = 0
model.solver.problem.Params.BranchDir = 1
model.solver.problem.Params.DegenMoves = 0
model.solver.problem.Params.Heuristics = 0.001
model.solver.problem.Params.Cuts = 3
model.solver.problem.Params.Presolve = 2
model.solver.problem.Params.Method = 0 |
"""
PASSENGERS
"""
numPassengers = 3217
passenger_arriving = (
(6, 3, 5, 3, 2, 0, 6, 8, 4, 2, 4, 0), # 0
(5, 11, 6, 2, 1, 0, 7, 9, 7, 3, 1, 0), # 1
(3, 8, 6, 4, 3, 0, 5, 12, 3, 7, 1, 0), # 2
(6, 6, 6, 5, 3, 0, 3, 7, 5, 5, 3, 0), # 3
(1, 4, 7, 4, 4, 0, 7, 11, 9, 6, 3, 0), # 4
(5, 11, 5, 5, 0, 0, 5, 9, 4, 4, 1, 0), # 5
(3, 8, 16, 3, 2, 0, 7, 12, 5, 7, 2, 0), # 6
(2, 8, 6, 4, 1, 0, 4, 9, 4, 6, 2, 0), # 7
(5, 9, 5, 1, 3, 0, 5, 11, 0, 6, 1, 0), # 8
(4, 8, 6, 6, 3, 0, 5, 9, 5, 3, 3, 0), # 9
(6, 8, 11, 2, 1, 0, 7, 8, 6, 5, 0, 0), # 10
(5, 9, 2, 3, 3, 0, 3, 10, 5, 3, 3, 0), # 11
(4, 12, 9, 4, 3, 0, 4, 11, 6, 10, 2, 0), # 12
(4, 11, 10, 4, 1, 0, 8, 7, 4, 3, 1, 0), # 13
(3, 16, 9, 3, 2, 0, 7, 8, 6, 3, 1, 0), # 14
(3, 10, 2, 2, 1, 0, 9, 7, 5, 1, 3, 0), # 15
(7, 3, 9, 0, 1, 0, 6, 6, 10, 7, 6, 0), # 16
(5, 10, 6, 5, 5, 0, 4, 14, 6, 2, 2, 0), # 17
(1, 14, 4, 3, 3, 0, 6, 7, 8, 7, 3, 0), # 18
(3, 14, 10, 1, 1, 0, 13, 8, 5, 8, 3, 0), # 19
(3, 8, 7, 6, 2, 0, 5, 7, 8, 4, 3, 0), # 20
(5, 5, 6, 6, 3, 0, 6, 9, 7, 6, 1, 0), # 21
(3, 7, 11, 6, 0, 0, 4, 13, 5, 5, 0, 0), # 22
(2, 8, 7, 4, 2, 0, 5, 11, 7, 3, 0, 0), # 23
(6, 5, 8, 5, 1, 0, 5, 4, 9, 6, 4, 0), # 24
(4, 10, 7, 0, 0, 0, 11, 6, 8, 5, 2, 0), # 25
(3, 14, 10, 4, 3, 0, 7, 7, 11, 4, 3, 0), # 26
(5, 7, 9, 2, 2, 0, 4, 10, 6, 5, 3, 0), # 27
(5, 6, 8, 7, 2, 0, 5, 10, 3, 3, 1, 0), # 28
(6, 6, 8, 5, 1, 0, 1, 10, 2, 4, 3, 0), # 29
(6, 10, 7, 4, 3, 0, 10, 16, 7, 12, 1, 0), # 30
(2, 5, 9, 3, 1, 0, 7, 12, 5, 4, 1, 0), # 31
(5, 5, 14, 2, 2, 0, 7, 11, 6, 6, 1, 0), # 32
(7, 12, 8, 3, 9, 0, 2, 3, 7, 4, 5, 0), # 33
(6, 2, 11, 1, 0, 0, 7, 9, 4, 4, 4, 0), # 34
(8, 7, 10, 2, 3, 0, 6, 7, 3, 7, 3, 0), # 35
(6, 13, 11, 4, 2, 0, 5, 7, 8, 6, 2, 0), # 36
(4, 8, 10, 2, 2, 0, 6, 8, 3, 4, 2, 0), # 37
(8, 10, 2, 5, 2, 0, 7, 16, 9, 6, 0, 0), # 38
(3, 12, 7, 6, 3, 0, 8, 5, 2, 4, 6, 0), # 39
(3, 4, 6, 4, 2, 0, 7, 6, 3, 6, 0, 0), # 40
(3, 9, 7, 2, 1, 0, 3, 13, 8, 7, 5, 0), # 41
(3, 6, 6, 8, 1, 0, 4, 5, 4, 6, 2, 0), # 42
(3, 8, 6, 9, 1, 0, 11, 7, 5, 6, 1, 0), # 43
(5, 13, 8, 4, 2, 0, 5, 4, 7, 4, 5, 0), # 44
(5, 10, 7, 1, 3, 0, 5, 7, 3, 7, 2, 0), # 45
(2, 14, 4, 2, 2, 0, 6, 7, 8, 7, 4, 0), # 46
(6, 14, 10, 3, 1, 0, 10, 12, 10, 2, 4, 0), # 47
(4, 7, 7, 3, 1, 0, 4, 7, 4, 9, 2, 0), # 48
(5, 7, 7, 2, 0, 0, 4, 11, 5, 3, 3, 0), # 49
(5, 10, 6, 3, 1, 0, 3, 10, 10, 4, 7, 0), # 50
(5, 6, 9, 1, 4, 0, 6, 14, 5, 5, 5, 0), # 51
(5, 6, 6, 3, 3, 0, 11, 8, 5, 3, 5, 0), # 52
(4, 7, 4, 2, 1, 0, 5, 8, 6, 10, 1, 0), # 53
(4, 16, 6, 5, 1, 0, 6, 9, 3, 3, 3, 0), # 54
(3, 10, 7, 4, 1, 0, 6, 4, 8, 3, 3, 0), # 55
(4, 13, 6, 3, 2, 0, 9, 13, 5, 11, 6, 0), # 56
(2, 9, 11, 8, 3, 0, 6, 8, 7, 5, 3, 0), # 57
(4, 12, 4, 3, 2, 0, 7, 4, 4, 4, 3, 0), # 58
(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), # 59
)
station_arriving_intensity = (
(3.7095121817383676, 9.515044981060607, 11.19193043059126, 8.87078804347826, 10.000240384615385, 6.659510869565219), # 0
(3.7443308140669203, 9.620858238197952, 11.252381752534994, 8.920190141908213, 10.075193108974359, 6.657240994867151), # 1
(3.7787518681104277, 9.725101964085297, 11.31139817195087, 8.968504830917876, 10.148564102564103, 6.654901690821256), # 2
(3.8127461259877085, 9.827663671875001, 11.368936576156813, 9.01569089673913, 10.22028605769231, 6.652493274456523), # 3
(3.8462843698175795, 9.928430874719417, 11.424953852470724, 9.061707125603865, 10.290291666666668, 6.6500160628019325), # 4
(3.879337381718857, 10.027291085770905, 11.479406888210512, 9.106512303743962, 10.358513621794872, 6.647470372886473), # 5
(3.9118759438103607, 10.12413181818182, 11.53225257069409, 9.150065217391306, 10.424884615384617, 6.644856521739131), # 6
(3.943870838210907, 10.218840585104518, 11.58344778723936, 9.19232465277778, 10.489337339743592, 6.64217482638889), # 7
(3.975292847039314, 10.311304899691358, 11.632949425164242, 9.233249396135266, 10.551804487179488, 6.639425603864735), # 8
(4.006112752414399, 10.401412275094698, 11.680714371786634, 9.272798233695653, 10.61221875, 6.636609171195653), # 9
(4.03630133645498, 10.489050224466892, 11.72669951442445, 9.310929951690824, 10.670512820512823, 6.633725845410628), # 10
(4.065829381279876, 10.5741062609603, 11.7708617403956, 9.347603336352659, 10.726619391025642, 6.630775943538648), # 11
(4.094667669007903, 10.656467897727273, 11.813157937017996, 9.382777173913043, 10.780471153846154, 6.627759782608695), # 12
(4.122786981757876, 10.736022647920176, 11.85354499160954, 9.416410250603866, 10.832000801282053, 6.624677679649759), # 13
(4.15015810164862, 10.81265802469136, 11.891979791488144, 9.448461352657004, 10.881141025641025, 6.621529951690821), # 14
(4.1767518107989465, 10.886261541193182, 11.928419223971721, 9.478889266304348, 10.92782451923077, 6.618316915760871), # 15
(4.202538891327675, 10.956720710578002, 11.96282017637818, 9.507652777777778, 10.971983974358976, 6.61503888888889), # 16
(4.227490125353625, 11.023923045998176, 11.995139536025421, 9.53471067330918, 11.013552083333336, 6.611696188103866), # 17
(4.25157629499561, 11.087756060606061, 12.025334190231364, 9.560021739130436, 11.052461538461543, 6.608289130434783), # 18
(4.274768182372451, 11.148107267554012, 12.053361026313912, 9.58354476147343, 11.088645032051284, 6.604818032910629), # 19
(4.297036569602966, 11.204864179994388, 12.079176931590974, 9.60523852657005, 11.122035256410259, 6.601283212560387), # 20
(4.318352238805971, 11.257914311079544, 12.102738793380466, 9.625061820652174, 11.152564903846153, 6.597684986413044), # 21
(4.338685972100283, 11.307145173961842, 12.124003499000287, 9.642973429951692, 11.180166666666667, 6.5940236714975855), # 22
(4.358008551604722, 11.352444281793632, 12.142927935768354, 9.658932140700484, 11.204773237179488, 6.590299584842997), # 23
(4.3762907594381035, 11.393699147727272, 12.159468991002571, 9.672896739130437, 11.226317307692307, 6.586513043478261), # 24
(4.393503377719247, 11.430797284915124, 12.173583552020853, 9.684826011473431, 11.244731570512819, 6.582664364432368), # 25
(4.409617188566969, 11.46362620650954, 12.185228506141103, 9.694678743961353, 11.259948717948719, 6.5787538647343), # 26
(4.424602974100088, 11.492073425662877, 12.194360740681233, 9.702413722826089, 11.271901442307694, 6.574781861413045), # 27
(4.438431516437421, 11.516026455527497, 12.200937142959157, 9.707989734299519, 11.280522435897437, 6.570748671497586), # 28
(4.4510735976977855, 11.535372809255753, 12.204914600292774, 9.711365564613528, 11.285744391025641, 6.566654612016909), # 29
(4.4625, 11.55, 12.20625, 9.7125, 11.287500000000001, 6.562500000000001), # 30
(4.47319183983376, 11.56215031960227, 12.205248928140096, 9.712295118464054, 11.286861125886526, 6.556726763701484), # 31
(4.4836528452685425, 11.574140056818184, 12.202274033816424, 9.711684477124184, 11.28495815602837, 6.547834661835751), # 32
(4.493887715792838, 11.585967720170455, 12.197367798913046, 9.710674080882354, 11.281811569148937, 6.535910757121439), # 33
(4.503901150895141, 11.597631818181819, 12.19057270531401, 9.709269934640524, 11.277441843971632, 6.521042112277196), # 34
(4.513697850063939, 11.609130859374998, 12.181931234903383, 9.707478043300654, 11.27186945921986, 6.503315790021656), # 35
(4.523282512787724, 11.62046335227273, 12.171485869565219, 9.705304411764708, 11.265114893617023, 6.482818853073463), # 36
(4.532659838554988, 11.631627805397729, 12.159279091183576, 9.70275504493464, 11.257198625886524, 6.4596383641512585), # 37
(4.5418345268542195, 11.642622727272729, 12.145353381642513, 9.699835947712419, 11.248141134751775, 6.433861385973679), # 38
(4.5508112771739135, 11.653446626420456, 12.129751222826087, 9.696553125000001, 11.23796289893617, 6.40557498125937), # 39
(4.559594789002558, 11.664098011363638, 12.11251509661836, 9.692912581699348, 11.22668439716312, 6.37486621272697), # 40
(4.568189761828645, 11.674575390625, 12.093687484903382, 9.68892032271242, 11.214326108156028, 6.34182214309512), # 41
(4.576600895140665, 11.684877272727276, 12.07331086956522, 9.684582352941177, 11.2009085106383, 6.3065298350824595), # 42
(4.584832888427111, 11.69500216619318, 12.051427732487923, 9.679904677287583, 11.186452083333334, 6.26907635140763), # 43
(4.592890441176471, 11.704948579545455, 12.028080555555556, 9.674893300653595, 11.17097730496454, 6.229548754789272), # 44
(4.600778252877237, 11.714715021306818, 12.003311820652177, 9.669554227941177, 11.15450465425532, 6.188034107946028), # 45
(4.6085010230179035, 11.724300000000003, 11.97716400966184, 9.663893464052288, 11.137054609929079, 6.144619473596536), # 46
(4.616063451086957, 11.733702024147728, 11.9496796044686, 9.65791701388889, 11.118647650709221, 6.099391914459438), # 47
(4.623470236572891, 11.742919602272728, 11.920901086956523, 9.651630882352942, 11.099304255319149, 6.052438493253375), # 48
(4.630726078964194, 11.751951242897727, 11.890870939009663, 9.645041074346407, 11.079044902482272, 6.003846272696985), # 49
(4.6378356777493615, 11.760795454545454, 11.85963164251208, 9.638153594771243, 11.057890070921987, 5.953702315508913), # 50
(4.6448037324168805, 11.769450745738636, 11.827225679347826, 9.630974448529413, 11.035860239361703, 5.902093684407797), # 51
(4.651634942455243, 11.777915625, 11.793695531400965, 9.623509640522876, 11.012975886524824, 5.849107442112278), # 52
(4.658334007352941, 11.786188600852274, 11.759083680555555, 9.615765175653596, 10.989257491134753, 5.794830651340996), # 53
(4.6649056265984665, 11.79426818181818, 11.723432608695653, 9.60774705882353, 10.964725531914894, 5.739350374812594), # 54
(4.671354499680307, 11.802152876420456, 11.686784797705313, 9.599461294934642, 10.939400487588653, 5.682753675245711), # 55
(4.677685326086957, 11.809841193181818, 11.649182729468599, 9.59091388888889, 10.913302836879433, 5.625127615358988), # 56
(4.683902805306906, 11.817331640625003, 11.610668885869565, 9.582110845588236, 10.886453058510638, 5.566559257871065), # 57
(4.690011636828645, 11.824622727272727, 11.57128574879227, 9.573058169934642, 10.858871631205675, 5.507135665500583), # 58
(0.0, 0.0, 0.0, 0.0, 0.0, 0.0), # 59
)
passenger_arriving_acc = (
(6, 3, 5, 3, 2, 0, 6, 8, 4, 2, 4, 0), # 0
(11, 14, 11, 5, 3, 0, 13, 17, 11, 5, 5, 0), # 1
(14, 22, 17, 9, 6, 0, 18, 29, 14, 12, 6, 0), # 2
(20, 28, 23, 14, 9, 0, 21, 36, 19, 17, 9, 0), # 3
(21, 32, 30, 18, 13, 0, 28, 47, 28, 23, 12, 0), # 4
(26, 43, 35, 23, 13, 0, 33, 56, 32, 27, 13, 0), # 5
(29, 51, 51, 26, 15, 0, 40, 68, 37, 34, 15, 0), # 6
(31, 59, 57, 30, 16, 0, 44, 77, 41, 40, 17, 0), # 7
(36, 68, 62, 31, 19, 0, 49, 88, 41, 46, 18, 0), # 8
(40, 76, 68, 37, 22, 0, 54, 97, 46, 49, 21, 0), # 9
(46, 84, 79, 39, 23, 0, 61, 105, 52, 54, 21, 0), # 10
(51, 93, 81, 42, 26, 0, 64, 115, 57, 57, 24, 0), # 11
(55, 105, 90, 46, 29, 0, 68, 126, 63, 67, 26, 0), # 12
(59, 116, 100, 50, 30, 0, 76, 133, 67, 70, 27, 0), # 13
(62, 132, 109, 53, 32, 0, 83, 141, 73, 73, 28, 0), # 14
(65, 142, 111, 55, 33, 0, 92, 148, 78, 74, 31, 0), # 15
(72, 145, 120, 55, 34, 0, 98, 154, 88, 81, 37, 0), # 16
(77, 155, 126, 60, 39, 0, 102, 168, 94, 83, 39, 0), # 17
(78, 169, 130, 63, 42, 0, 108, 175, 102, 90, 42, 0), # 18
(81, 183, 140, 64, 43, 0, 121, 183, 107, 98, 45, 0), # 19
(84, 191, 147, 70, 45, 0, 126, 190, 115, 102, 48, 0), # 20
(89, 196, 153, 76, 48, 0, 132, 199, 122, 108, 49, 0), # 21
(92, 203, 164, 82, 48, 0, 136, 212, 127, 113, 49, 0), # 22
(94, 211, 171, 86, 50, 0, 141, 223, 134, 116, 49, 0), # 23
(100, 216, 179, 91, 51, 0, 146, 227, 143, 122, 53, 0), # 24
(104, 226, 186, 91, 51, 0, 157, 233, 151, 127, 55, 0), # 25
(107, 240, 196, 95, 54, 0, 164, 240, 162, 131, 58, 0), # 26
(112, 247, 205, 97, 56, 0, 168, 250, 168, 136, 61, 0), # 27
(117, 253, 213, 104, 58, 0, 173, 260, 171, 139, 62, 0), # 28
(123, 259, 221, 109, 59, 0, 174, 270, 173, 143, 65, 0), # 29
(129, 269, 228, 113, 62, 0, 184, 286, 180, 155, 66, 0), # 30
(131, 274, 237, 116, 63, 0, 191, 298, 185, 159, 67, 0), # 31
(136, 279, 251, 118, 65, 0, 198, 309, 191, 165, 68, 0), # 32
(143, 291, 259, 121, 74, 0, 200, 312, 198, 169, 73, 0), # 33
(149, 293, 270, 122, 74, 0, 207, 321, 202, 173, 77, 0), # 34
(157, 300, 280, 124, 77, 0, 213, 328, 205, 180, 80, 0), # 35
(163, 313, 291, 128, 79, 0, 218, 335, 213, 186, 82, 0), # 36
(167, 321, 301, 130, 81, 0, 224, 343, 216, 190, 84, 0), # 37
(175, 331, 303, 135, 83, 0, 231, 359, 225, 196, 84, 0), # 38
(178, 343, 310, 141, 86, 0, 239, 364, 227, 200, 90, 0), # 39
(181, 347, 316, 145, 88, 0, 246, 370, 230, 206, 90, 0), # 40
(184, 356, 323, 147, 89, 0, 249, 383, 238, 213, 95, 0), # 41
(187, 362, 329, 155, 90, 0, 253, 388, 242, 219, 97, 0), # 42
(190, 370, 335, 164, 91, 0, 264, 395, 247, 225, 98, 0), # 43
(195, 383, 343, 168, 93, 0, 269, 399, 254, 229, 103, 0), # 44
(200, 393, 350, 169, 96, 0, 274, 406, 257, 236, 105, 0), # 45
(202, 407, 354, 171, 98, 0, 280, 413, 265, 243, 109, 0), # 46
(208, 421, 364, 174, 99, 0, 290, 425, 275, 245, 113, 0), # 47
(212, 428, 371, 177, 100, 0, 294, 432, 279, 254, 115, 0), # 48
(217, 435, 378, 179, 100, 0, 298, 443, 284, 257, 118, 0), # 49
(222, 445, 384, 182, 101, 0, 301, 453, 294, 261, 125, 0), # 50
(227, 451, 393, 183, 105, 0, 307, 467, 299, 266, 130, 0), # 51
(232, 457, 399, 186, 108, 0, 318, 475, 304, 269, 135, 0), # 52
(236, 464, 403, 188, 109, 0, 323, 483, 310, 279, 136, 0), # 53
(240, 480, 409, 193, 110, 0, 329, 492, 313, 282, 139, 0), # 54
(243, 490, 416, 197, 111, 0, 335, 496, 321, 285, 142, 0), # 55
(247, 503, 422, 200, 113, 0, 344, 509, 326, 296, 148, 0), # 56
(249, 512, 433, 208, 116, 0, 350, 517, 333, 301, 151, 0), # 57
(253, 524, 437, 211, 118, 0, 357, 521, 337, 305, 154, 0), # 58
(253, 524, 437, 211, 118, 0, 357, 521, 337, 305, 154, 0), # 59
)
passenger_arriving_rate = (
(3.7095121817383676, 7.612035984848484, 6.715158258354756, 3.5483152173913037, 2.000048076923077, 0.0, 6.659510869565219, 8.000192307692307, 5.322472826086956, 4.476772172236504, 1.903008996212121, 0.0), # 0
(3.7443308140669203, 7.696686590558361, 6.751429051520996, 3.5680760567632848, 2.0150386217948717, 0.0, 6.657240994867151, 8.060154487179487, 5.352114085144928, 4.500952701013997, 1.9241716476395903, 0.0), # 1
(3.7787518681104277, 7.780081571268237, 6.786838903170522, 3.58740193236715, 2.0297128205128203, 0.0, 6.654901690821256, 8.118851282051281, 5.381102898550726, 4.524559268780347, 1.9450203928170593, 0.0), # 2
(3.8127461259877085, 7.8621309375, 6.821361945694087, 3.6062763586956517, 2.044057211538462, 0.0, 6.652493274456523, 8.176228846153847, 5.409414538043478, 4.547574630462725, 1.965532734375, 0.0), # 3
(3.8462843698175795, 7.942744699775533, 6.854972311482434, 3.624682850241546, 2.0580583333333333, 0.0, 6.6500160628019325, 8.232233333333333, 5.437024275362319, 4.569981540988289, 1.9856861749438832, 0.0), # 4
(3.879337381718857, 8.021832868616723, 6.887644132926307, 3.6426049214975844, 2.0717027243589743, 0.0, 6.647470372886473, 8.286810897435897, 5.463907382246377, 4.591762755284204, 2.005458217154181, 0.0), # 5
(3.9118759438103607, 8.099305454545455, 6.919351542416455, 3.660026086956522, 2.084976923076923, 0.0, 6.644856521739131, 8.339907692307692, 5.490039130434783, 4.612901028277636, 2.0248263636363637, 0.0), # 6
(3.943870838210907, 8.175072468083613, 6.950068672343615, 3.6769298611111116, 2.0978674679487184, 0.0, 6.64217482638889, 8.391469871794873, 5.515394791666668, 4.633379114895743, 2.043768117020903, 0.0), # 7
(3.975292847039314, 8.249043919753085, 6.979769655098544, 3.693299758454106, 2.1103608974358976, 0.0, 6.639425603864735, 8.44144358974359, 5.5399496376811594, 4.653179770065696, 2.062260979938271, 0.0), # 8
(4.006112752414399, 8.321129820075758, 7.00842862307198, 3.709119293478261, 2.12244375, 0.0, 6.636609171195653, 8.489775, 5.563678940217391, 4.672285748714653, 2.0802824550189394, 0.0), # 9
(4.03630133645498, 8.391240179573513, 7.03601970865467, 3.724371980676329, 2.134102564102564, 0.0, 6.633725845410628, 8.536410256410257, 5.586557971014494, 4.690679805769779, 2.0978100448933783, 0.0), # 10
(4.065829381279876, 8.459285008768239, 7.06251704423736, 3.739041334541063, 2.145323878205128, 0.0, 6.630775943538648, 8.581295512820512, 5.608562001811595, 4.70834469615824, 2.1148212521920597, 0.0), # 11
(4.094667669007903, 8.525174318181818, 7.087894762210797, 3.7531108695652167, 2.156094230769231, 0.0, 6.627759782608695, 8.624376923076923, 5.6296663043478254, 4.725263174807198, 2.1312935795454546, 0.0), # 12
(4.122786981757876, 8.58881811833614, 7.112126994965724, 3.766564100241546, 2.1664001602564102, 0.0, 6.624677679649759, 8.665600641025641, 5.649846150362319, 4.741417996643816, 2.147204529584035, 0.0), # 13
(4.15015810164862, 8.650126419753088, 7.135187874892886, 3.779384541062801, 2.1762282051282047, 0.0, 6.621529951690821, 8.704912820512819, 5.669076811594202, 4.756791916595257, 2.162531604938272, 0.0), # 14
(4.1767518107989465, 8.709009232954545, 7.157051534383032, 3.7915557065217387, 2.1855649038461538, 0.0, 6.618316915760871, 8.742259615384615, 5.6873335597826085, 4.771367689588688, 2.177252308238636, 0.0), # 15
(4.202538891327675, 8.7653765684624, 7.177692105826908, 3.803061111111111, 2.194396794871795, 0.0, 6.61503888888889, 8.77758717948718, 5.7045916666666665, 4.785128070551272, 2.1913441421156, 0.0), # 16
(4.227490125353625, 8.81913843679854, 7.197083721615253, 3.8138842693236716, 2.202710416666667, 0.0, 6.611696188103866, 8.810841666666668, 5.720826403985508, 4.798055814410168, 2.204784609199635, 0.0), # 17
(4.25157629499561, 8.870204848484848, 7.215200514138818, 3.824008695652174, 2.2104923076923084, 0.0, 6.608289130434783, 8.841969230769234, 5.736013043478262, 4.810133676092545, 2.217551212121212, 0.0), # 18
(4.274768182372451, 8.918485814043208, 7.232016615788346, 3.8334179045893717, 2.2177290064102566, 0.0, 6.604818032910629, 8.870916025641026, 5.750126856884058, 4.8213444105255645, 2.229621453510802, 0.0), # 19
(4.297036569602966, 8.96389134399551, 7.247506158954584, 3.8420954106280196, 2.2244070512820517, 0.0, 6.601283212560387, 8.897628205128207, 5.76314311594203, 4.831670772636389, 2.2409728359988774, 0.0), # 20
(4.318352238805971, 9.006331448863634, 7.261643276028279, 3.8500247282608693, 2.2305129807692303, 0.0, 6.597684986413044, 8.922051923076921, 5.775037092391305, 4.841095517352186, 2.2515828622159084, 0.0), # 21
(4.338685972100283, 9.045716139169473, 7.274402099400172, 3.8571893719806765, 2.2360333333333333, 0.0, 6.5940236714975855, 8.944133333333333, 5.785784057971015, 4.849601399600115, 2.2614290347923682, 0.0), # 22
(4.358008551604722, 9.081955425434906, 7.285756761461012, 3.8635728562801934, 2.2409546474358972, 0.0, 6.590299584842997, 8.963818589743589, 5.79535928442029, 4.857171174307341, 2.2704888563587264, 0.0), # 23
(4.3762907594381035, 9.114959318181818, 7.295681394601543, 3.869158695652174, 2.2452634615384612, 0.0, 6.586513043478261, 8.981053846153845, 5.803738043478262, 4.863787596401028, 2.2787398295454544, 0.0), # 24
(4.393503377719247, 9.1446378279321, 7.304150131212511, 3.8739304045893723, 2.2489463141025636, 0.0, 6.582664364432368, 8.995785256410255, 5.810895606884059, 4.869433420808341, 2.286159456983025, 0.0), # 25
(4.409617188566969, 9.17090096520763, 7.311137103684661, 3.8778714975845405, 2.2519897435897436, 0.0, 6.5787538647343, 9.007958974358974, 5.816807246376811, 4.874091402456441, 2.2927252413019077, 0.0), # 26
(4.424602974100088, 9.193658740530301, 7.31661644440874, 3.880965489130435, 2.2543802884615385, 0.0, 6.574781861413045, 9.017521153846154, 5.821448233695653, 4.877744296272493, 2.2984146851325753, 0.0), # 27
(4.438431516437421, 9.212821164421996, 7.320562285775494, 3.8831958937198072, 2.256104487179487, 0.0, 6.570748671497586, 9.024417948717948, 5.824793840579711, 4.8803748571836625, 2.303205291105499, 0.0), # 28
(4.4510735976977855, 9.228298247404602, 7.322948760175664, 3.884546225845411, 2.257148878205128, 0.0, 6.566654612016909, 9.028595512820512, 5.826819338768117, 4.881965840117109, 2.3070745618511506, 0.0), # 29
(4.4625, 9.24, 7.32375, 3.885, 2.2575000000000003, 0.0, 6.562500000000001, 9.030000000000001, 5.8275, 4.8825, 2.31, 0.0), # 30
(4.47319183983376, 9.249720255681815, 7.323149356884057, 3.884918047385621, 2.257372225177305, 0.0, 6.556726763701484, 9.02948890070922, 5.827377071078432, 4.882099571256038, 2.312430063920454, 0.0), # 31
(4.4836528452685425, 9.259312045454546, 7.3213644202898545, 3.884673790849673, 2.2569916312056737, 0.0, 6.547834661835751, 9.027966524822695, 5.82701068627451, 4.880909613526569, 2.3148280113636366, 0.0), # 32
(4.493887715792838, 9.268774176136363, 7.3184206793478275, 3.8842696323529413, 2.2563623138297872, 0.0, 6.535910757121439, 9.025449255319149, 5.826404448529412, 4.878947119565218, 2.3171935440340907, 0.0), # 33
(4.503901150895141, 9.278105454545454, 7.314343623188405, 3.8837079738562093, 2.2554883687943263, 0.0, 6.521042112277196, 9.021953475177305, 5.825561960784314, 4.876229082125604, 2.3195263636363634, 0.0), # 34
(4.513697850063939, 9.287304687499997, 7.3091587409420296, 3.882991217320261, 2.2543738918439717, 0.0, 6.503315790021656, 9.017495567375887, 5.824486825980392, 4.872772493961353, 2.3218261718749993, 0.0), # 35
(4.523282512787724, 9.296370681818182, 7.302891521739131, 3.8821217647058828, 2.253022978723404, 0.0, 6.482818853073463, 9.012091914893617, 5.823182647058824, 4.868594347826087, 2.3240926704545455, 0.0), # 36
(4.532659838554988, 9.305302244318183, 7.295567454710145, 3.881102017973856, 2.2514397251773044, 0.0, 6.4596383641512585, 9.005758900709218, 5.821653026960784, 4.86371163647343, 2.3263255610795457, 0.0), # 37
(4.5418345268542195, 9.314098181818181, 7.287212028985508, 3.8799343790849674, 2.249628226950355, 0.0, 6.433861385973679, 8.99851290780142, 5.819901568627452, 4.858141352657005, 2.3285245454545453, 0.0), # 38
(4.5508112771739135, 9.322757301136363, 7.277850733695652, 3.87862125, 2.247592579787234, 0.0, 6.40557498125937, 8.990370319148935, 5.817931875, 4.8519004891304345, 2.330689325284091, 0.0), # 39
(4.559594789002558, 9.33127840909091, 7.267509057971015, 3.8771650326797387, 2.245336879432624, 0.0, 6.37486621272697, 8.981347517730496, 5.815747549019608, 4.845006038647344, 2.3328196022727274, 0.0), # 40
(4.568189761828645, 9.3396603125, 7.256212490942029, 3.8755681290849675, 2.2428652216312055, 0.0, 6.34182214309512, 8.971460886524822, 5.813352193627452, 4.837474993961353, 2.334915078125, 0.0), # 41
(4.576600895140665, 9.34790181818182, 7.2439865217391315, 3.8738329411764707, 2.2401817021276598, 0.0, 6.3065298350824595, 8.960726808510639, 5.810749411764706, 4.829324347826088, 2.336975454545455, 0.0), # 42
(4.584832888427111, 9.356001732954544, 7.230856639492753, 3.8719618709150327, 2.2372904166666667, 0.0, 6.26907635140763, 8.949161666666667, 5.80794280637255, 4.820571092995169, 2.339000433238636, 0.0), # 43
(4.592890441176471, 9.363958863636363, 7.216848333333333, 3.8699573202614377, 2.2341954609929076, 0.0, 6.229548754789272, 8.93678184397163, 5.804935980392157, 4.811232222222222, 2.3409897159090907, 0.0), # 44
(4.600778252877237, 9.371772017045453, 7.201987092391306, 3.8678216911764705, 2.230900930851064, 0.0, 6.188034107946028, 8.923603723404256, 5.801732536764706, 4.80132472826087, 2.3429430042613633, 0.0), # 45
(4.6085010230179035, 9.379440000000002, 7.186298405797103, 3.8655573856209147, 2.2274109219858156, 0.0, 6.144619473596536, 8.909643687943262, 5.798336078431372, 4.790865603864735, 2.3448600000000006, 0.0), # 46
(4.616063451086957, 9.386961619318182, 7.16980776268116, 3.8631668055555552, 2.223729530141844, 0.0, 6.099391914459438, 8.894918120567375, 5.794750208333333, 4.77987184178744, 2.3467404048295455, 0.0), # 47
(4.623470236572891, 9.394335681818182, 7.152540652173913, 3.8606523529411763, 2.21986085106383, 0.0, 6.052438493253375, 8.87944340425532, 5.790978529411765, 4.7683604347826085, 2.3485839204545456, 0.0), # 48
(4.630726078964194, 9.401560994318181, 7.134522563405797, 3.8580164297385626, 2.2158089804964543, 0.0, 6.003846272696985, 8.863235921985817, 5.787024644607844, 4.7563483756038645, 2.3503902485795454, 0.0), # 49
(4.6378356777493615, 9.408636363636361, 7.115778985507247, 3.8552614379084966, 2.211578014184397, 0.0, 5.953702315508913, 8.846312056737588, 5.782892156862745, 4.743852657004831, 2.3521590909090904, 0.0), # 50
(4.6448037324168805, 9.415560596590907, 7.096335407608696, 3.852389779411765, 2.2071720478723407, 0.0, 5.902093684407797, 8.828688191489363, 5.778584669117648, 4.73089027173913, 2.353890149147727, 0.0), # 51
(4.651634942455243, 9.4223325, 7.0762173188405795, 3.84940385620915, 2.2025951773049646, 0.0, 5.849107442112278, 8.810380709219858, 5.774105784313726, 4.717478212560386, 2.355583125, 0.0), # 52
(4.658334007352941, 9.428950880681818, 7.055450208333333, 3.8463060702614382, 2.1978514982269504, 0.0, 5.794830651340996, 8.791405992907801, 5.769459105392158, 4.703633472222222, 2.3572377201704544, 0.0), # 53
(4.6649056265984665, 9.435414545454544, 7.034059565217391, 3.843098823529412, 2.192945106382979, 0.0, 5.739350374812594, 8.771780425531915, 5.764648235294119, 4.689373043478261, 2.358853636363636, 0.0), # 54
(4.671354499680307, 9.441722301136364, 7.012070878623187, 3.8397845179738566, 2.1878800975177306, 0.0, 5.682753675245711, 8.751520390070922, 5.759676776960785, 4.674713919082125, 2.360430575284091, 0.0), # 55
(4.677685326086957, 9.447872954545453, 6.989509637681159, 3.8363655555555556, 2.1826605673758865, 0.0, 5.625127615358988, 8.730642269503546, 5.754548333333334, 4.65967309178744, 2.361968238636363, 0.0), # 56
(4.683902805306906, 9.453865312500001, 6.966401331521738, 3.832844338235294, 2.1772906117021273, 0.0, 5.566559257871065, 8.70916244680851, 5.749266507352941, 4.644267554347826, 2.3634663281250003, 0.0), # 57
(4.690011636828645, 9.459698181818181, 6.942771449275362, 3.8292232679738563, 2.1717743262411346, 0.0, 5.507135665500583, 8.687097304964539, 5.743834901960785, 4.628514299516908, 2.3649245454545453, 0.0), # 58
(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0), # 59
)
passenger_allighting_rate = (
(0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 0
(0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 1
(0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 2
(0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 3
(0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 4
(0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 5
(0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 6
(0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 7
(0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 8
(0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 9
(0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 10
(0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 11
(0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 12
(0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 13
(0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 14
(0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 15
(0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 16
(0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 17
(0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 18
(0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 19
(0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 20
(0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 21
(0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 22
(0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 23
(0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 24
(0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 25
(0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 26
(0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 27
(0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 28
(0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 29
(0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 30
(0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 31
(0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 32
(0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 33
(0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 34
(0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 35
(0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 36
(0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 37
(0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 38
(0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 39
(0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 40
(0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 41
(0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 42
(0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 43
(0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 44
(0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 45
(0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 46
(0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 47
(0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 48
(0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 49
(0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 50
(0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 51
(0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 52
(0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 53
(0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 54
(0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 55
(0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 56
(0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 57
(0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 58
(0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 59
)
"""
parameters for reproducibiliy. More information: https://numpy.org/doc/stable/reference/random/parallel.html
"""
#initial entropy
entropy = 258194110137029475889902652135037600173
#index for seed sequence child
child_seed_index = (
1, # 0
49, # 1
)
| """
PASSENGERS
"""
num_passengers = 3217
passenger_arriving = ((6, 3, 5, 3, 2, 0, 6, 8, 4, 2, 4, 0), (5, 11, 6, 2, 1, 0, 7, 9, 7, 3, 1, 0), (3, 8, 6, 4, 3, 0, 5, 12, 3, 7, 1, 0), (6, 6, 6, 5, 3, 0, 3, 7, 5, 5, 3, 0), (1, 4, 7, 4, 4, 0, 7, 11, 9, 6, 3, 0), (5, 11, 5, 5, 0, 0, 5, 9, 4, 4, 1, 0), (3, 8, 16, 3, 2, 0, 7, 12, 5, 7, 2, 0), (2, 8, 6, 4, 1, 0, 4, 9, 4, 6, 2, 0), (5, 9, 5, 1, 3, 0, 5, 11, 0, 6, 1, 0), (4, 8, 6, 6, 3, 0, 5, 9, 5, 3, 3, 0), (6, 8, 11, 2, 1, 0, 7, 8, 6, 5, 0, 0), (5, 9, 2, 3, 3, 0, 3, 10, 5, 3, 3, 0), (4, 12, 9, 4, 3, 0, 4, 11, 6, 10, 2, 0), (4, 11, 10, 4, 1, 0, 8, 7, 4, 3, 1, 0), (3, 16, 9, 3, 2, 0, 7, 8, 6, 3, 1, 0), (3, 10, 2, 2, 1, 0, 9, 7, 5, 1, 3, 0), (7, 3, 9, 0, 1, 0, 6, 6, 10, 7, 6, 0), (5, 10, 6, 5, 5, 0, 4, 14, 6, 2, 2, 0), (1, 14, 4, 3, 3, 0, 6, 7, 8, 7, 3, 0), (3, 14, 10, 1, 1, 0, 13, 8, 5, 8, 3, 0), (3, 8, 7, 6, 2, 0, 5, 7, 8, 4, 3, 0), (5, 5, 6, 6, 3, 0, 6, 9, 7, 6, 1, 0), (3, 7, 11, 6, 0, 0, 4, 13, 5, 5, 0, 0), (2, 8, 7, 4, 2, 0, 5, 11, 7, 3, 0, 0), (6, 5, 8, 5, 1, 0, 5, 4, 9, 6, 4, 0), (4, 10, 7, 0, 0, 0, 11, 6, 8, 5, 2, 0), (3, 14, 10, 4, 3, 0, 7, 7, 11, 4, 3, 0), (5, 7, 9, 2, 2, 0, 4, 10, 6, 5, 3, 0), (5, 6, 8, 7, 2, 0, 5, 10, 3, 3, 1, 0), (6, 6, 8, 5, 1, 0, 1, 10, 2, 4, 3, 0), (6, 10, 7, 4, 3, 0, 10, 16, 7, 12, 1, 0), (2, 5, 9, 3, 1, 0, 7, 12, 5, 4, 1, 0), (5, 5, 14, 2, 2, 0, 7, 11, 6, 6, 1, 0), (7, 12, 8, 3, 9, 0, 2, 3, 7, 4, 5, 0), (6, 2, 11, 1, 0, 0, 7, 9, 4, 4, 4, 0), (8, 7, 10, 2, 3, 0, 6, 7, 3, 7, 3, 0), (6, 13, 11, 4, 2, 0, 5, 7, 8, 6, 2, 0), (4, 8, 10, 2, 2, 0, 6, 8, 3, 4, 2, 0), (8, 10, 2, 5, 2, 0, 7, 16, 9, 6, 0, 0), (3, 12, 7, 6, 3, 0, 8, 5, 2, 4, 6, 0), (3, 4, 6, 4, 2, 0, 7, 6, 3, 6, 0, 0), (3, 9, 7, 2, 1, 0, 3, 13, 8, 7, 5, 0), (3, 6, 6, 8, 1, 0, 4, 5, 4, 6, 2, 0), (3, 8, 6, 9, 1, 0, 11, 7, 5, 6, 1, 0), (5, 13, 8, 4, 2, 0, 5, 4, 7, 4, 5, 0), (5, 10, 7, 1, 3, 0, 5, 7, 3, 7, 2, 0), (2, 14, 4, 2, 2, 0, 6, 7, 8, 7, 4, 0), (6, 14, 10, 3, 1, 0, 10, 12, 10, 2, 4, 0), (4, 7, 7, 3, 1, 0, 4, 7, 4, 9, 2, 0), (5, 7, 7, 2, 0, 0, 4, 11, 5, 3, 3, 0), (5, 10, 6, 3, 1, 0, 3, 10, 10, 4, 7, 0), (5, 6, 9, 1, 4, 0, 6, 14, 5, 5, 5, 0), (5, 6, 6, 3, 3, 0, 11, 8, 5, 3, 5, 0), (4, 7, 4, 2, 1, 0, 5, 8, 6, 10, 1, 0), (4, 16, 6, 5, 1, 0, 6, 9, 3, 3, 3, 0), (3, 10, 7, 4, 1, 0, 6, 4, 8, 3, 3, 0), (4, 13, 6, 3, 2, 0, 9, 13, 5, 11, 6, 0), (2, 9, 11, 8, 3, 0, 6, 8, 7, 5, 3, 0), (4, 12, 4, 3, 2, 0, 7, 4, 4, 4, 3, 0), (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0))
station_arriving_intensity = ((3.7095121817383676, 9.515044981060607, 11.19193043059126, 8.87078804347826, 10.000240384615385, 6.659510869565219), (3.7443308140669203, 9.620858238197952, 11.252381752534994, 8.920190141908213, 10.075193108974359, 6.657240994867151), (3.7787518681104277, 9.725101964085297, 11.31139817195087, 8.968504830917876, 10.148564102564103, 6.654901690821256), (3.8127461259877085, 9.827663671875001, 11.368936576156813, 9.01569089673913, 10.22028605769231, 6.652493274456523), (3.8462843698175795, 9.928430874719417, 11.424953852470724, 9.061707125603865, 10.290291666666668, 6.6500160628019325), (3.879337381718857, 10.027291085770905, 11.479406888210512, 9.106512303743962, 10.358513621794872, 6.647470372886473), (3.9118759438103607, 10.12413181818182, 11.53225257069409, 9.150065217391306, 10.424884615384617, 6.644856521739131), (3.943870838210907, 10.218840585104518, 11.58344778723936, 9.19232465277778, 10.489337339743592, 6.64217482638889), (3.975292847039314, 10.311304899691358, 11.632949425164242, 9.233249396135266, 10.551804487179488, 6.639425603864735), (4.006112752414399, 10.401412275094698, 11.680714371786634, 9.272798233695653, 10.61221875, 6.636609171195653), (4.03630133645498, 10.489050224466892, 11.72669951442445, 9.310929951690824, 10.670512820512823, 6.633725845410628), (4.065829381279876, 10.5741062609603, 11.7708617403956, 9.347603336352659, 10.726619391025642, 6.630775943538648), (4.094667669007903, 10.656467897727273, 11.813157937017996, 9.382777173913043, 10.780471153846154, 6.627759782608695), (4.122786981757876, 10.736022647920176, 11.85354499160954, 9.416410250603866, 10.832000801282053, 6.624677679649759), (4.15015810164862, 10.81265802469136, 11.891979791488144, 9.448461352657004, 10.881141025641025, 6.621529951690821), (4.1767518107989465, 10.886261541193182, 11.928419223971721, 9.478889266304348, 10.92782451923077, 6.618316915760871), (4.202538891327675, 10.956720710578002, 11.96282017637818, 9.507652777777778, 10.971983974358976, 6.61503888888889), (4.227490125353625, 11.023923045998176, 11.995139536025421, 9.53471067330918, 11.013552083333336, 6.611696188103866), (4.25157629499561, 11.087756060606061, 12.025334190231364, 9.560021739130436, 11.052461538461543, 6.608289130434783), (4.274768182372451, 11.148107267554012, 12.053361026313912, 9.58354476147343, 11.088645032051284, 6.604818032910629), (4.297036569602966, 11.204864179994388, 12.079176931590974, 9.60523852657005, 11.122035256410259, 6.601283212560387), (4.318352238805971, 11.257914311079544, 12.102738793380466, 9.625061820652174, 11.152564903846153, 6.597684986413044), (4.338685972100283, 11.307145173961842, 12.124003499000287, 9.642973429951692, 11.180166666666667, 6.5940236714975855), (4.358008551604722, 11.352444281793632, 12.142927935768354, 9.658932140700484, 11.204773237179488, 6.590299584842997), (4.3762907594381035, 11.393699147727272, 12.159468991002571, 9.672896739130437, 11.226317307692307, 6.586513043478261), (4.393503377719247, 11.430797284915124, 12.173583552020853, 9.684826011473431, 11.244731570512819, 6.582664364432368), (4.409617188566969, 11.46362620650954, 12.185228506141103, 9.694678743961353, 11.259948717948719, 6.5787538647343), (4.424602974100088, 11.492073425662877, 12.194360740681233, 9.702413722826089, 11.271901442307694, 6.574781861413045), (4.438431516437421, 11.516026455527497, 12.200937142959157, 9.707989734299519, 11.280522435897437, 6.570748671497586), (4.4510735976977855, 11.535372809255753, 12.204914600292774, 9.711365564613528, 11.285744391025641, 6.566654612016909), (4.4625, 11.55, 12.20625, 9.7125, 11.287500000000001, 6.562500000000001), (4.47319183983376, 11.56215031960227, 12.205248928140096, 9.712295118464054, 11.286861125886526, 6.556726763701484), (4.4836528452685425, 11.574140056818184, 12.202274033816424, 9.711684477124184, 11.28495815602837, 6.547834661835751), (4.493887715792838, 11.585967720170455, 12.197367798913046, 9.710674080882354, 11.281811569148937, 6.535910757121439), (4.503901150895141, 11.597631818181819, 12.19057270531401, 9.709269934640524, 11.277441843971632, 6.521042112277196), (4.513697850063939, 11.609130859374998, 12.181931234903383, 9.707478043300654, 11.27186945921986, 6.503315790021656), (4.523282512787724, 11.62046335227273, 12.171485869565219, 9.705304411764708, 11.265114893617023, 6.482818853073463), (4.532659838554988, 11.631627805397729, 12.159279091183576, 9.70275504493464, 11.257198625886524, 6.4596383641512585), (4.5418345268542195, 11.642622727272729, 12.145353381642513, 9.699835947712419, 11.248141134751775, 6.433861385973679), (4.5508112771739135, 11.653446626420456, 12.129751222826087, 9.696553125000001, 11.23796289893617, 6.40557498125937), (4.559594789002558, 11.664098011363638, 12.11251509661836, 9.692912581699348, 11.22668439716312, 6.37486621272697), (4.568189761828645, 11.674575390625, 12.093687484903382, 9.68892032271242, 11.214326108156028, 6.34182214309512), (4.576600895140665, 11.684877272727276, 12.07331086956522, 9.684582352941177, 11.2009085106383, 6.3065298350824595), (4.584832888427111, 11.69500216619318, 12.051427732487923, 9.679904677287583, 11.186452083333334, 6.26907635140763), (4.592890441176471, 11.704948579545455, 12.028080555555556, 9.674893300653595, 11.17097730496454, 6.229548754789272), (4.600778252877237, 11.714715021306818, 12.003311820652177, 9.669554227941177, 11.15450465425532, 6.188034107946028), (4.6085010230179035, 11.724300000000003, 11.97716400966184, 9.663893464052288, 11.137054609929079, 6.144619473596536), (4.616063451086957, 11.733702024147728, 11.9496796044686, 9.65791701388889, 11.118647650709221, 6.099391914459438), (4.623470236572891, 11.742919602272728, 11.920901086956523, 9.651630882352942, 11.099304255319149, 6.052438493253375), (4.630726078964194, 11.751951242897727, 11.890870939009663, 9.645041074346407, 11.079044902482272, 6.003846272696985), (4.6378356777493615, 11.760795454545454, 11.85963164251208, 9.638153594771243, 11.057890070921987, 5.953702315508913), (4.6448037324168805, 11.769450745738636, 11.827225679347826, 9.630974448529413, 11.035860239361703, 5.902093684407797), (4.651634942455243, 11.777915625, 11.793695531400965, 9.623509640522876, 11.012975886524824, 5.849107442112278), (4.658334007352941, 11.786188600852274, 11.759083680555555, 9.615765175653596, 10.989257491134753, 5.794830651340996), (4.6649056265984665, 11.79426818181818, 11.723432608695653, 9.60774705882353, 10.964725531914894, 5.739350374812594), (4.671354499680307, 11.802152876420456, 11.686784797705313, 9.599461294934642, 10.939400487588653, 5.682753675245711), (4.677685326086957, 11.809841193181818, 11.649182729468599, 9.59091388888889, 10.913302836879433, 5.625127615358988), (4.683902805306906, 11.817331640625003, 11.610668885869565, 9.582110845588236, 10.886453058510638, 5.566559257871065), (4.690011636828645, 11.824622727272727, 11.57128574879227, 9.573058169934642, 10.858871631205675, 5.507135665500583), (0.0, 0.0, 0.0, 0.0, 0.0, 0.0))
passenger_arriving_acc = ((6, 3, 5, 3, 2, 0, 6, 8, 4, 2, 4, 0), (11, 14, 11, 5, 3, 0, 13, 17, 11, 5, 5, 0), (14, 22, 17, 9, 6, 0, 18, 29, 14, 12, 6, 0), (20, 28, 23, 14, 9, 0, 21, 36, 19, 17, 9, 0), (21, 32, 30, 18, 13, 0, 28, 47, 28, 23, 12, 0), (26, 43, 35, 23, 13, 0, 33, 56, 32, 27, 13, 0), (29, 51, 51, 26, 15, 0, 40, 68, 37, 34, 15, 0), (31, 59, 57, 30, 16, 0, 44, 77, 41, 40, 17, 0), (36, 68, 62, 31, 19, 0, 49, 88, 41, 46, 18, 0), (40, 76, 68, 37, 22, 0, 54, 97, 46, 49, 21, 0), (46, 84, 79, 39, 23, 0, 61, 105, 52, 54, 21, 0), (51, 93, 81, 42, 26, 0, 64, 115, 57, 57, 24, 0), (55, 105, 90, 46, 29, 0, 68, 126, 63, 67, 26, 0), (59, 116, 100, 50, 30, 0, 76, 133, 67, 70, 27, 0), (62, 132, 109, 53, 32, 0, 83, 141, 73, 73, 28, 0), (65, 142, 111, 55, 33, 0, 92, 148, 78, 74, 31, 0), (72, 145, 120, 55, 34, 0, 98, 154, 88, 81, 37, 0), (77, 155, 126, 60, 39, 0, 102, 168, 94, 83, 39, 0), (78, 169, 130, 63, 42, 0, 108, 175, 102, 90, 42, 0), (81, 183, 140, 64, 43, 0, 121, 183, 107, 98, 45, 0), (84, 191, 147, 70, 45, 0, 126, 190, 115, 102, 48, 0), (89, 196, 153, 76, 48, 0, 132, 199, 122, 108, 49, 0), (92, 203, 164, 82, 48, 0, 136, 212, 127, 113, 49, 0), (94, 211, 171, 86, 50, 0, 141, 223, 134, 116, 49, 0), (100, 216, 179, 91, 51, 0, 146, 227, 143, 122, 53, 0), (104, 226, 186, 91, 51, 0, 157, 233, 151, 127, 55, 0), (107, 240, 196, 95, 54, 0, 164, 240, 162, 131, 58, 0), (112, 247, 205, 97, 56, 0, 168, 250, 168, 136, 61, 0), (117, 253, 213, 104, 58, 0, 173, 260, 171, 139, 62, 0), (123, 259, 221, 109, 59, 0, 174, 270, 173, 143, 65, 0), (129, 269, 228, 113, 62, 0, 184, 286, 180, 155, 66, 0), (131, 274, 237, 116, 63, 0, 191, 298, 185, 159, 67, 0), (136, 279, 251, 118, 65, 0, 198, 309, 191, 165, 68, 0), (143, 291, 259, 121, 74, 0, 200, 312, 198, 169, 73, 0), (149, 293, 270, 122, 74, 0, 207, 321, 202, 173, 77, 0), (157, 300, 280, 124, 77, 0, 213, 328, 205, 180, 80, 0), (163, 313, 291, 128, 79, 0, 218, 335, 213, 186, 82, 0), (167, 321, 301, 130, 81, 0, 224, 343, 216, 190, 84, 0), (175, 331, 303, 135, 83, 0, 231, 359, 225, 196, 84, 0), (178, 343, 310, 141, 86, 0, 239, 364, 227, 200, 90, 0), (181, 347, 316, 145, 88, 0, 246, 370, 230, 206, 90, 0), (184, 356, 323, 147, 89, 0, 249, 383, 238, 213, 95, 0), (187, 362, 329, 155, 90, 0, 253, 388, 242, 219, 97, 0), (190, 370, 335, 164, 91, 0, 264, 395, 247, 225, 98, 0), (195, 383, 343, 168, 93, 0, 269, 399, 254, 229, 103, 0), (200, 393, 350, 169, 96, 0, 274, 406, 257, 236, 105, 0), (202, 407, 354, 171, 98, 0, 280, 413, 265, 243, 109, 0), (208, 421, 364, 174, 99, 0, 290, 425, 275, 245, 113, 0), (212, 428, 371, 177, 100, 0, 294, 432, 279, 254, 115, 0), (217, 435, 378, 179, 100, 0, 298, 443, 284, 257, 118, 0), (222, 445, 384, 182, 101, 0, 301, 453, 294, 261, 125, 0), (227, 451, 393, 183, 105, 0, 307, 467, 299, 266, 130, 0), (232, 457, 399, 186, 108, 0, 318, 475, 304, 269, 135, 0), (236, 464, 403, 188, 109, 0, 323, 483, 310, 279, 136, 0), (240, 480, 409, 193, 110, 0, 329, 492, 313, 282, 139, 0), (243, 490, 416, 197, 111, 0, 335, 496, 321, 285, 142, 0), (247, 503, 422, 200, 113, 0, 344, 509, 326, 296, 148, 0), (249, 512, 433, 208, 116, 0, 350, 517, 333, 301, 151, 0), (253, 524, 437, 211, 118, 0, 357, 521, 337, 305, 154, 0), (253, 524, 437, 211, 118, 0, 357, 521, 337, 305, 154, 0))
passenger_arriving_rate = ((3.7095121817383676, 7.612035984848484, 6.715158258354756, 3.5483152173913037, 2.000048076923077, 0.0, 6.659510869565219, 8.000192307692307, 5.322472826086956, 4.476772172236504, 1.903008996212121, 0.0), (3.7443308140669203, 7.696686590558361, 6.751429051520996, 3.5680760567632848, 2.0150386217948717, 0.0, 6.657240994867151, 8.060154487179487, 5.352114085144928, 4.500952701013997, 1.9241716476395903, 0.0), (3.7787518681104277, 7.780081571268237, 6.786838903170522, 3.58740193236715, 2.0297128205128203, 0.0, 6.654901690821256, 8.118851282051281, 5.381102898550726, 4.524559268780347, 1.9450203928170593, 0.0), (3.8127461259877085, 7.8621309375, 6.821361945694087, 3.6062763586956517, 2.044057211538462, 0.0, 6.652493274456523, 8.176228846153847, 5.409414538043478, 4.547574630462725, 1.965532734375, 0.0), (3.8462843698175795, 7.942744699775533, 6.854972311482434, 3.624682850241546, 2.0580583333333333, 0.0, 6.6500160628019325, 8.232233333333333, 5.437024275362319, 4.569981540988289, 1.9856861749438832, 0.0), (3.879337381718857, 8.021832868616723, 6.887644132926307, 3.6426049214975844, 2.0717027243589743, 0.0, 6.647470372886473, 8.286810897435897, 5.463907382246377, 4.591762755284204, 2.005458217154181, 0.0), (3.9118759438103607, 8.099305454545455, 6.919351542416455, 3.660026086956522, 2.084976923076923, 0.0, 6.644856521739131, 8.339907692307692, 5.490039130434783, 4.612901028277636, 2.0248263636363637, 0.0), (3.943870838210907, 8.175072468083613, 6.950068672343615, 3.6769298611111116, 2.0978674679487184, 0.0, 6.64217482638889, 8.391469871794873, 5.515394791666668, 4.633379114895743, 2.043768117020903, 0.0), (3.975292847039314, 8.249043919753085, 6.979769655098544, 3.693299758454106, 2.1103608974358976, 0.0, 6.639425603864735, 8.44144358974359, 5.5399496376811594, 4.653179770065696, 2.062260979938271, 0.0), (4.006112752414399, 8.321129820075758, 7.00842862307198, 3.709119293478261, 2.12244375, 0.0, 6.636609171195653, 8.489775, 5.563678940217391, 4.672285748714653, 2.0802824550189394, 0.0), (4.03630133645498, 8.391240179573513, 7.03601970865467, 3.724371980676329, 2.134102564102564, 0.0, 6.633725845410628, 8.536410256410257, 5.586557971014494, 4.690679805769779, 2.0978100448933783, 0.0), (4.065829381279876, 8.459285008768239, 7.06251704423736, 3.739041334541063, 2.145323878205128, 0.0, 6.630775943538648, 8.581295512820512, 5.608562001811595, 4.70834469615824, 2.1148212521920597, 0.0), (4.094667669007903, 8.525174318181818, 7.087894762210797, 3.7531108695652167, 2.156094230769231, 0.0, 6.627759782608695, 8.624376923076923, 5.6296663043478254, 4.725263174807198, 2.1312935795454546, 0.0), (4.122786981757876, 8.58881811833614, 7.112126994965724, 3.766564100241546, 2.1664001602564102, 0.0, 6.624677679649759, 8.665600641025641, 5.649846150362319, 4.741417996643816, 2.147204529584035, 0.0), (4.15015810164862, 8.650126419753088, 7.135187874892886, 3.779384541062801, 2.1762282051282047, 0.0, 6.621529951690821, 8.704912820512819, 5.669076811594202, 4.756791916595257, 2.162531604938272, 0.0), (4.1767518107989465, 8.709009232954545, 7.157051534383032, 3.7915557065217387, 2.1855649038461538, 0.0, 6.618316915760871, 8.742259615384615, 5.6873335597826085, 4.771367689588688, 2.177252308238636, 0.0), (4.202538891327675, 8.7653765684624, 7.177692105826908, 3.803061111111111, 2.194396794871795, 0.0, 6.61503888888889, 8.77758717948718, 5.7045916666666665, 4.785128070551272, 2.1913441421156, 0.0), (4.227490125353625, 8.81913843679854, 7.197083721615253, 3.8138842693236716, 2.202710416666667, 0.0, 6.611696188103866, 8.810841666666668, 5.720826403985508, 4.798055814410168, 2.204784609199635, 0.0), (4.25157629499561, 8.870204848484848, 7.215200514138818, 3.824008695652174, 2.2104923076923084, 0.0, 6.608289130434783, 8.841969230769234, 5.736013043478262, 4.810133676092545, 2.217551212121212, 0.0), (4.274768182372451, 8.918485814043208, 7.232016615788346, 3.8334179045893717, 2.2177290064102566, 0.0, 6.604818032910629, 8.870916025641026, 5.750126856884058, 4.8213444105255645, 2.229621453510802, 0.0), (4.297036569602966, 8.96389134399551, 7.247506158954584, 3.8420954106280196, 2.2244070512820517, 0.0, 6.601283212560387, 8.897628205128207, 5.76314311594203, 4.831670772636389, 2.2409728359988774, 0.0), (4.318352238805971, 9.006331448863634, 7.261643276028279, 3.8500247282608693, 2.2305129807692303, 0.0, 6.597684986413044, 8.922051923076921, 5.775037092391305, 4.841095517352186, 2.2515828622159084, 0.0), (4.338685972100283, 9.045716139169473, 7.274402099400172, 3.8571893719806765, 2.2360333333333333, 0.0, 6.5940236714975855, 8.944133333333333, 5.785784057971015, 4.849601399600115, 2.2614290347923682, 0.0), (4.358008551604722, 9.081955425434906, 7.285756761461012, 3.8635728562801934, 2.2409546474358972, 0.0, 6.590299584842997, 8.963818589743589, 5.79535928442029, 4.857171174307341, 2.2704888563587264, 0.0), (4.3762907594381035, 9.114959318181818, 7.295681394601543, 3.869158695652174, 2.2452634615384612, 0.0, 6.586513043478261, 8.981053846153845, 5.803738043478262, 4.863787596401028, 2.2787398295454544, 0.0), (4.393503377719247, 9.1446378279321, 7.304150131212511, 3.8739304045893723, 2.2489463141025636, 0.0, 6.582664364432368, 8.995785256410255, 5.810895606884059, 4.869433420808341, 2.286159456983025, 0.0), (4.409617188566969, 9.17090096520763, 7.311137103684661, 3.8778714975845405, 2.2519897435897436, 0.0, 6.5787538647343, 9.007958974358974, 5.816807246376811, 4.874091402456441, 2.2927252413019077, 0.0), (4.424602974100088, 9.193658740530301, 7.31661644440874, 3.880965489130435, 2.2543802884615385, 0.0, 6.574781861413045, 9.017521153846154, 5.821448233695653, 4.877744296272493, 2.2984146851325753, 0.0), (4.438431516437421, 9.212821164421996, 7.320562285775494, 3.8831958937198072, 2.256104487179487, 0.0, 6.570748671497586, 9.024417948717948, 5.824793840579711, 4.8803748571836625, 2.303205291105499, 0.0), (4.4510735976977855, 9.228298247404602, 7.322948760175664, 3.884546225845411, 2.257148878205128, 0.0, 6.566654612016909, 9.028595512820512, 5.826819338768117, 4.881965840117109, 2.3070745618511506, 0.0), (4.4625, 9.24, 7.32375, 3.885, 2.2575000000000003, 0.0, 6.562500000000001, 9.030000000000001, 5.8275, 4.8825, 2.31, 0.0), (4.47319183983376, 9.249720255681815, 7.323149356884057, 3.884918047385621, 2.257372225177305, 0.0, 6.556726763701484, 9.02948890070922, 5.827377071078432, 4.882099571256038, 2.312430063920454, 0.0), (4.4836528452685425, 9.259312045454546, 7.3213644202898545, 3.884673790849673, 2.2569916312056737, 0.0, 6.547834661835751, 9.027966524822695, 5.82701068627451, 4.880909613526569, 2.3148280113636366, 0.0), (4.493887715792838, 9.268774176136363, 7.3184206793478275, 3.8842696323529413, 2.2563623138297872, 0.0, 6.535910757121439, 9.025449255319149, 5.826404448529412, 4.878947119565218, 2.3171935440340907, 0.0), (4.503901150895141, 9.278105454545454, 7.314343623188405, 3.8837079738562093, 2.2554883687943263, 0.0, 6.521042112277196, 9.021953475177305, 5.825561960784314, 4.876229082125604, 2.3195263636363634, 0.0), (4.513697850063939, 9.287304687499997, 7.3091587409420296, 3.882991217320261, 2.2543738918439717, 0.0, 6.503315790021656, 9.017495567375887, 5.824486825980392, 4.872772493961353, 2.3218261718749993, 0.0), (4.523282512787724, 9.296370681818182, 7.302891521739131, 3.8821217647058828, 2.253022978723404, 0.0, 6.482818853073463, 9.012091914893617, 5.823182647058824, 4.868594347826087, 2.3240926704545455, 0.0), (4.532659838554988, 9.305302244318183, 7.295567454710145, 3.881102017973856, 2.2514397251773044, 0.0, 6.4596383641512585, 9.005758900709218, 5.821653026960784, 4.86371163647343, 2.3263255610795457, 0.0), (4.5418345268542195, 9.314098181818181, 7.287212028985508, 3.8799343790849674, 2.249628226950355, 0.0, 6.433861385973679, 8.99851290780142, 5.819901568627452, 4.858141352657005, 2.3285245454545453, 0.0), (4.5508112771739135, 9.322757301136363, 7.277850733695652, 3.87862125, 2.247592579787234, 0.0, 6.40557498125937, 8.990370319148935, 5.817931875, 4.8519004891304345, 2.330689325284091, 0.0), (4.559594789002558, 9.33127840909091, 7.267509057971015, 3.8771650326797387, 2.245336879432624, 0.0, 6.37486621272697, 8.981347517730496, 5.815747549019608, 4.845006038647344, 2.3328196022727274, 0.0), (4.568189761828645, 9.3396603125, 7.256212490942029, 3.8755681290849675, 2.2428652216312055, 0.0, 6.34182214309512, 8.971460886524822, 5.813352193627452, 4.837474993961353, 2.334915078125, 0.0), (4.576600895140665, 9.34790181818182, 7.2439865217391315, 3.8738329411764707, 2.2401817021276598, 0.0, 6.3065298350824595, 8.960726808510639, 5.810749411764706, 4.829324347826088, 2.336975454545455, 0.0), (4.584832888427111, 9.356001732954544, 7.230856639492753, 3.8719618709150327, 2.2372904166666667, 0.0, 6.26907635140763, 8.949161666666667, 5.80794280637255, 4.820571092995169, 2.339000433238636, 0.0), (4.592890441176471, 9.363958863636363, 7.216848333333333, 3.8699573202614377, 2.2341954609929076, 0.0, 6.229548754789272, 8.93678184397163, 5.804935980392157, 4.811232222222222, 2.3409897159090907, 0.0), (4.600778252877237, 9.371772017045453, 7.201987092391306, 3.8678216911764705, 2.230900930851064, 0.0, 6.188034107946028, 8.923603723404256, 5.801732536764706, 4.80132472826087, 2.3429430042613633, 0.0), (4.6085010230179035, 9.379440000000002, 7.186298405797103, 3.8655573856209147, 2.2274109219858156, 0.0, 6.144619473596536, 8.909643687943262, 5.798336078431372, 4.790865603864735, 2.3448600000000006, 0.0), (4.616063451086957, 9.386961619318182, 7.16980776268116, 3.8631668055555552, 2.223729530141844, 0.0, 6.099391914459438, 8.894918120567375, 5.794750208333333, 4.77987184178744, 2.3467404048295455, 0.0), (4.623470236572891, 9.394335681818182, 7.152540652173913, 3.8606523529411763, 2.21986085106383, 0.0, 6.052438493253375, 8.87944340425532, 5.790978529411765, 4.7683604347826085, 2.3485839204545456, 0.0), (4.630726078964194, 9.401560994318181, 7.134522563405797, 3.8580164297385626, 2.2158089804964543, 0.0, 6.003846272696985, 8.863235921985817, 5.787024644607844, 4.7563483756038645, 2.3503902485795454, 0.0), (4.6378356777493615, 9.408636363636361, 7.115778985507247, 3.8552614379084966, 2.211578014184397, 0.0, 5.953702315508913, 8.846312056737588, 5.782892156862745, 4.743852657004831, 2.3521590909090904, 0.0), (4.6448037324168805, 9.415560596590907, 7.096335407608696, 3.852389779411765, 2.2071720478723407, 0.0, 5.902093684407797, 8.828688191489363, 5.778584669117648, 4.73089027173913, 2.353890149147727, 0.0), (4.651634942455243, 9.4223325, 7.0762173188405795, 3.84940385620915, 2.2025951773049646, 0.0, 5.849107442112278, 8.810380709219858, 5.774105784313726, 4.717478212560386, 2.355583125, 0.0), (4.658334007352941, 9.428950880681818, 7.055450208333333, 3.8463060702614382, 2.1978514982269504, 0.0, 5.794830651340996, 8.791405992907801, 5.769459105392158, 4.703633472222222, 2.3572377201704544, 0.0), (4.6649056265984665, 9.435414545454544, 7.034059565217391, 3.843098823529412, 2.192945106382979, 0.0, 5.739350374812594, 8.771780425531915, 5.764648235294119, 4.689373043478261, 2.358853636363636, 0.0), (4.671354499680307, 9.441722301136364, 7.012070878623187, 3.8397845179738566, 2.1878800975177306, 0.0, 5.682753675245711, 8.751520390070922, 5.759676776960785, 4.674713919082125, 2.360430575284091, 0.0), (4.677685326086957, 9.447872954545453, 6.989509637681159, 3.8363655555555556, 2.1826605673758865, 0.0, 5.625127615358988, 8.730642269503546, 5.754548333333334, 4.65967309178744, 2.361968238636363, 0.0), (4.683902805306906, 9.453865312500001, 6.966401331521738, 3.832844338235294, 2.1772906117021273, 0.0, 5.566559257871065, 8.70916244680851, 5.749266507352941, 4.644267554347826, 2.3634663281250003, 0.0), (4.690011636828645, 9.459698181818181, 6.942771449275362, 3.8292232679738563, 2.1717743262411346, 0.0, 5.507135665500583, 8.687097304964539, 5.743834901960785, 4.628514299516908, 2.3649245454545453, 0.0), (0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0))
passenger_allighting_rate = ((0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1))
'\nparameters for reproducibiliy. More information: https://numpy.org/doc/stable/reference/random/parallel.html\n'
entropy = 258194110137029475889902652135037600173
child_seed_index = (1, 49) |