content
stringlengths
1
1.05M
input_ids
sequencelengths
1
883k
ratio_char_token
float64
1
22.9
token_count
int64
1
883k
from rest_framework_gis import serializers from rest_framework import serializers as s from .models import ( Artificialisee2015to2018, Artificielle2018, CommunesSybarval, CouvertureSol, EnveloppeUrbaine2018, Ocsge, Renaturee2018to2015, Sybarval, Voirie2018, ZonesBaties2018, UsageSol, )
[ 6738, 1334, 62, 30604, 62, 70, 271, 1330, 11389, 11341, 198, 6738, 1334, 62, 30604, 1330, 11389, 11341, 355, 264, 198, 198, 6738, 764, 27530, 1330, 357, 198, 220, 220, 220, 35941, 786, 68, 4626, 1462, 7908, 11, 198, 220, 220, 220, 3683, 811, 8207, 293, 7908, 11, 198, 220, 220, 220, 1520, 4015, 13940, 5657, 2100, 11, 198, 220, 220, 220, 15062, 1851, 495, 36949, 11, 198, 220, 220, 220, 2039, 626, 10365, 68, 16692, 65, 5718, 7908, 11, 198, 220, 220, 220, 440, 6359, 469, 11, 198, 220, 220, 220, 7152, 1300, 68, 7908, 1462, 4626, 11, 198, 220, 220, 220, 1632, 5657, 2100, 11, 198, 220, 220, 220, 569, 10840, 494, 7908, 11, 198, 220, 220, 220, 1168, 1952, 24541, 444, 7908, 11, 198, 220, 220, 220, 29566, 36949, 11, 198, 8, 628, 628, 628, 628, 628, 628, 198 ]
2.422535
142
from django.contrib import admin from .models import SearchResult # Register your models here. admin.site.register(SearchResult, SearchResultAdmin)
[ 6738, 42625, 14208, 13, 3642, 822, 1330, 13169, 198, 6738, 764, 27530, 1330, 11140, 23004, 198, 198, 2, 17296, 534, 4981, 994, 13, 198, 198, 28482, 13, 15654, 13, 30238, 7, 18243, 23004, 11, 11140, 23004, 46787, 8 ]
3.921053
38
import asyncio import os import tempfile from contextlib import ExitStack from typing import Text, Optional, List, Union, Dict from rasa.importers.importer import TrainingDataImporter from rasa import model from rasa.model import FingerprintComparisonResult from rasa.core.domain import Domain from rasa.utils.common import TempDirectoryPath from rasa.cli.utils import ( print_success, print_warning, print_error, bcolors, print_color, ) from rasa.constants import DEFAULT_MODELS_PATH, DEFAULT_CORE_SUBDIRECTORY_NAME def train_core( domain: Union[Domain, Text], config: Text, stories: Text, output: Text, train_path: Optional[Text] = None, fixed_model_name: Optional[Text] = None, additional_arguments: Optional[Dict] = None, ) -> Optional[Text]: loop = asyncio.get_event_loop() return loop.run_until_complete( train_core_async( domain=domain, config=config, stories=stories, output=output, train_path=train_path, fixed_model_name=fixed_model_name, additional_arguments=additional_arguments, ) ) def train_nlu( config: Text, nlu_data: Text, output: Text, train_path: Optional[Text] = None, fixed_model_name: Optional[Text] = None, persist_nlu_training_data: bool = False, ) -> Optional[Text]: """Trains an NLU model. Args: config: Path to the config file for NLU. nlu_data: Path to the NLU training data. output: Output path. train_path: If `None` the model will be trained in a temporary directory, otherwise in the provided directory. fixed_model_name: Name of the model to be stored. persist_nlu_training_data: `True` if the NLU training data should be persisted with the model. Returns: If `train_path` is given it returns the path to the model archive, otherwise the path to the directory with the trained model files. """ loop = asyncio.get_event_loop() return loop.run_until_complete( _train_nlu_async( config, nlu_data, output, train_path, fixed_model_name, persist_nlu_training_data, ) )
[ 11748, 30351, 952, 198, 11748, 28686, 198, 11748, 20218, 7753, 198, 6738, 4732, 8019, 1330, 29739, 25896, 198, 6738, 19720, 1330, 8255, 11, 32233, 11, 7343, 11, 4479, 11, 360, 713, 198, 198, 6738, 374, 15462, 13, 320, 1819, 1010, 13, 320, 26634, 1330, 13614, 6601, 3546, 26634, 198, 6738, 374, 15462, 1330, 2746, 198, 6738, 374, 15462, 13, 19849, 1330, 39454, 4798, 50249, 1653, 23004, 198, 6738, 374, 15462, 13, 7295, 13, 27830, 1330, 20021, 198, 6738, 374, 15462, 13, 26791, 13, 11321, 1330, 24189, 43055, 15235, 198, 198, 6738, 374, 15462, 13, 44506, 13, 26791, 1330, 357, 198, 220, 220, 220, 3601, 62, 13138, 11, 198, 220, 220, 220, 3601, 62, 43917, 11, 198, 220, 220, 220, 3601, 62, 18224, 11, 198, 220, 220, 220, 275, 4033, 669, 11, 198, 220, 220, 220, 3601, 62, 8043, 11, 198, 8, 198, 6738, 374, 15462, 13, 9979, 1187, 1330, 5550, 38865, 62, 33365, 37142, 62, 34219, 11, 5550, 38865, 62, 34, 6965, 62, 50, 10526, 17931, 23988, 15513, 62, 20608, 628, 628, 628, 198, 198, 4299, 4512, 62, 7295, 7, 198, 220, 220, 220, 7386, 25, 4479, 58, 43961, 11, 8255, 4357, 198, 220, 220, 220, 4566, 25, 8255, 11, 198, 220, 220, 220, 3923, 25, 8255, 11, 198, 220, 220, 220, 5072, 25, 8255, 11, 198, 220, 220, 220, 4512, 62, 6978, 25, 32233, 58, 8206, 60, 796, 6045, 11, 198, 220, 220, 220, 5969, 62, 19849, 62, 3672, 25, 32233, 58, 8206, 60, 796, 6045, 11, 198, 220, 220, 220, 3224, 62, 853, 2886, 25, 32233, 58, 35, 713, 60, 796, 6045, 11, 198, 8, 4613, 32233, 58, 8206, 5974, 198, 220, 220, 220, 9052, 796, 30351, 952, 13, 1136, 62, 15596, 62, 26268, 3419, 198, 220, 220, 220, 1441, 9052, 13, 5143, 62, 28446, 62, 20751, 7, 198, 220, 220, 220, 220, 220, 220, 220, 4512, 62, 7295, 62, 292, 13361, 7, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 7386, 28, 27830, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 4566, 28, 11250, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 3923, 28, 50164, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 5072, 28, 22915, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 4512, 62, 6978, 28, 27432, 62, 6978, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 5969, 62, 19849, 62, 3672, 28, 34021, 62, 19849, 62, 3672, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 3224, 62, 853, 2886, 28, 2860, 1859, 62, 853, 2886, 11, 198, 220, 220, 220, 220, 220, 220, 220, 1267, 198, 220, 220, 220, 1267, 628, 628, 198, 4299, 4512, 62, 77, 2290, 7, 198, 220, 220, 220, 4566, 25, 8255, 11, 198, 220, 220, 220, 299, 2290, 62, 7890, 25, 8255, 11, 198, 220, 220, 220, 5072, 25, 8255, 11, 198, 220, 220, 220, 4512, 62, 6978, 25, 32233, 58, 8206, 60, 796, 6045, 11, 198, 220, 220, 220, 5969, 62, 19849, 62, 3672, 25, 32233, 58, 8206, 60, 796, 6045, 11, 198, 220, 220, 220, 21160, 62, 77, 2290, 62, 34409, 62, 7890, 25, 20512, 796, 10352, 11, 198, 8, 4613, 32233, 58, 8206, 5974, 198, 220, 220, 220, 37227, 2898, 1299, 281, 22879, 52, 2746, 13, 628, 220, 220, 220, 943, 14542, 25, 198, 220, 220, 220, 220, 220, 220, 220, 4566, 25, 10644, 284, 262, 4566, 2393, 329, 22879, 52, 13, 198, 220, 220, 220, 220, 220, 220, 220, 299, 2290, 62, 7890, 25, 10644, 284, 262, 22879, 52, 3047, 1366, 13, 198, 220, 220, 220, 220, 220, 220, 220, 5072, 25, 25235, 3108, 13, 198, 220, 220, 220, 220, 220, 220, 220, 4512, 62, 6978, 25, 1002, 4600, 14202, 63, 262, 2746, 481, 307, 8776, 287, 257, 8584, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 8619, 11, 4306, 287, 262, 2810, 8619, 13, 198, 220, 220, 220, 220, 220, 220, 220, 5969, 62, 19849, 62, 3672, 25, 6530, 286, 262, 2746, 284, 307, 8574, 13, 198, 220, 220, 220, 220, 220, 220, 220, 21160, 62, 77, 2290, 62, 34409, 62, 7890, 25, 4600, 17821, 63, 611, 262, 22879, 52, 3047, 1366, 815, 307, 33264, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 351, 262, 2746, 13, 628, 198, 220, 220, 220, 16409, 25, 198, 220, 220, 220, 220, 220, 220, 220, 1002, 4600, 27432, 62, 6978, 63, 318, 1813, 340, 5860, 262, 3108, 284, 262, 2746, 15424, 11, 198, 220, 220, 220, 220, 220, 220, 220, 4306, 262, 3108, 284, 262, 8619, 351, 262, 8776, 2746, 3696, 13, 628, 220, 220, 220, 37227, 628, 220, 220, 220, 9052, 796, 30351, 952, 13, 1136, 62, 15596, 62, 26268, 3419, 198, 220, 220, 220, 1441, 9052, 13, 5143, 62, 28446, 62, 20751, 7, 198, 220, 220, 220, 220, 220, 220, 220, 4808, 27432, 62, 77, 2290, 62, 292, 13361, 7, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 4566, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 299, 2290, 62, 7890, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 5072, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 4512, 62, 6978, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 5969, 62, 19849, 62, 3672, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 21160, 62, 77, 2290, 62, 34409, 62, 7890, 11, 198, 220, 220, 220, 220, 220, 220, 220, 1267, 198, 220, 220, 220, 1267, 628, 198 ]
2.385246
976
# ============================================================================ # FILE: default.py # AUTHOR: Shougo Matsushita <Shougo.Matsu at gmail.com> # License: MIT license # ============================================================================ import re import typing from denite.util import echo, error, clearmatch, regex_convert_py_vim from denite.util import Nvim, UserContext, Candidates, Candidate from denite.parent import SyncParent
[ 2, 38093, 2559, 18604, 198, 2, 45811, 25, 4277, 13, 9078, 198, 2, 44746, 25, 911, 280, 2188, 30107, 1530, 5350, 1279, 2484, 280, 2188, 13, 44, 19231, 379, 308, 4529, 13, 785, 29, 198, 2, 13789, 25, 17168, 5964, 198, 2, 38093, 2559, 18604, 198, 198, 11748, 302, 198, 11748, 19720, 198, 198, 6738, 2853, 578, 13, 22602, 1330, 9809, 11, 4049, 11, 1598, 15699, 11, 40364, 62, 1102, 1851, 62, 9078, 62, 31124, 198, 6738, 2853, 578, 13, 22602, 1330, 399, 31124, 11, 11787, 21947, 11, 15518, 37051, 11, 40327, 198, 6738, 2853, 578, 13, 8000, 1330, 35908, 24546, 628 ]
4.460784
102
# -*- coding: utf-8 -*- """Context managers implemented for (mostly) internal use""" import contextlib import functools from io import UnsupportedOperation import os import sys __all__ = ["RedirectStdout", "RedirectStderr"] RedirectStdout = functools.partial(_stdchannel_redirected, sys.stdout) RedirectStderr = functools.partial(_stdchannel_redirected, sys.stderr) RedirectNoOp = functools.partial(_stdchannel_redirected, None, "")
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 198, 37811, 21947, 11663, 9177, 329, 357, 29471, 8, 5387, 779, 37811, 198, 198, 11748, 4732, 8019, 198, 11748, 1257, 310, 10141, 198, 6738, 33245, 1330, 791, 15999, 32180, 198, 11748, 28686, 198, 11748, 25064, 628, 198, 834, 439, 834, 796, 14631, 7738, 1060, 1273, 67, 448, 1600, 366, 7738, 1060, 1273, 1082, 81, 8973, 628, 198, 198, 7738, 1060, 1273, 67, 448, 796, 1257, 310, 10141, 13, 47172, 28264, 19282, 17620, 62, 445, 1060, 276, 11, 25064, 13, 19282, 448, 8, 198, 7738, 1060, 1273, 1082, 81, 796, 1257, 310, 10141, 13, 47172, 28264, 19282, 17620, 62, 445, 1060, 276, 11, 25064, 13, 301, 1082, 81, 8, 198, 7738, 1060, 2949, 18257, 796, 1257, 310, 10141, 13, 47172, 28264, 19282, 17620, 62, 445, 1060, 276, 11, 6045, 11, 366, 4943, 198 ]
3.013699
146
# -*- coding: utf-8 -*- from __future__ import unicode_literals from . import __version__ as app_version app_name = "pos_kiosk" app_title = "Pos Kiosk" app_publisher = "9t9it" app_description = "Kiosk App" app_icon = "octicon octicon-file-directory" app_color = "grey" app_email = "info@9t9it.com" app_license = "MIT" # Includes in <head> # ------------------ # include js, css files in header of desk.html # app_include_css = "/assets/pos_kiosk/css/pos_kiosk.css" # app_include_js = "/assets/pos_kiosk/js/pos_kiosk.js" # include js, css files in header of web template # web_include_css = "/assets/pos_kiosk/css/pos_kiosk.css" # web_include_js = "/assets/pos_kiosk/js/pos_kiosk.js" # include js in page # page_js = {"page" : "public/js/file.js"} # page_js = { # "kiosk": ["public/js/pos_page_js.js", "public/js/includes/number_to_words.js"] # } # include js in doctype views # doctype_js = {"doctype" : "public/js/doctype.js"} # doctype_list_js = {"doctype" : "public/js/doctype_list.js"} # doctype_tree_js = {"doctype" : "public/js/doctype_tree.js"} # doctype_calendar_js = {"doctype" : "public/js/doctype_calendar.js"} fixtures = [ { "doctype": "Custom Field", "filters": [ [ "name", "in", [ "Sales Invoice Item-pos_kiosk", "Mode of Payment-logo" ] ] ] } ] # Home Pages # ---------- # application home page (will override Website Settings) # home_page = "login" # website user home page (by Role) # role_home_page = { # "Role": "home_page" # } # Website user home page (by function) # get_website_user_home_page = "pos_kiosk.utils.get_home_page" # Generators # ---------- # automatically create page for each record of this doctype # website_generators = ["Web Page"] # Installation # ------------ # before_install = "pos_kiosk.install.before_install" # after_install = "pos_kiosk.install.after_install" # Desk Notifications # ------------------ # See frappe.core.notifications.get_notification_config # notification_config = "pos_kiosk.notifications.get_notification_config" # Permissions # ----------- # Permissions evaluated in scripted ways # permission_query_conditions = { # "Event": "frappe.desk.doctype.event.event.get_permission_query_conditions", # } # # has_permission = { # "Event": "frappe.desk.doctype.event.event.has_permission", # } # Document Events # --------------- # Hook on document methods and events # doc_events = { # "*": { # "on_update": "method", # "on_cancel": "method", # "on_trash": "method" # } # } # Scheduled Tasks # --------------- # scheduler_events = { # "all": [ # "pos_kiosk.tasks.all" # ], # "daily": [ # "pos_kiosk.tasks.daily" # ], # "hourly": [ # "pos_kiosk.tasks.hourly" # ], # "weekly": [ # "pos_kiosk.tasks.weekly" # ] # "monthly": [ # "pos_kiosk.tasks.monthly" # ] # } # Testing # ------- # before_tests = "pos_kiosk.install.before_tests" # Overriding Whitelisted Methods # ------------------------------ # # override_whitelisted_methods = { # "pos_bahrain.api.get_item_details.get_item_details": "pos_kiosk.api.item.get_item_details" # noqa # }
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 6738, 11593, 37443, 834, 1330, 28000, 1098, 62, 17201, 874, 198, 6738, 764, 1330, 11593, 9641, 834, 355, 598, 62, 9641, 198, 198, 1324, 62, 3672, 796, 366, 1930, 62, 4106, 418, 74, 1, 198, 1324, 62, 7839, 796, 366, 21604, 509, 4267, 74, 1, 198, 1324, 62, 12984, 8191, 796, 366, 24, 83, 24, 270, 1, 198, 1324, 62, 11213, 796, 366, 42, 4267, 74, 2034, 1, 198, 1324, 62, 4749, 796, 366, 38441, 4749, 19318, 4749, 12, 7753, 12, 34945, 1, 198, 1324, 62, 8043, 796, 366, 49502, 1, 198, 1324, 62, 12888, 796, 366, 10951, 31, 24, 83, 24, 270, 13, 785, 1, 198, 1324, 62, 43085, 796, 366, 36393, 1, 198, 198, 2, 29581, 287, 1279, 2256, 29, 198, 2, 34400, 438, 198, 198, 2, 2291, 44804, 11, 269, 824, 3696, 287, 13639, 286, 6915, 13, 6494, 198, 2, 598, 62, 17256, 62, 25471, 796, 12813, 19668, 14, 1930, 62, 4106, 418, 74, 14, 25471, 14, 1930, 62, 4106, 418, 74, 13, 25471, 1, 198, 2, 598, 62, 17256, 62, 8457, 796, 12813, 19668, 14, 1930, 62, 4106, 418, 74, 14, 8457, 14, 1930, 62, 4106, 418, 74, 13, 8457, 1, 198, 198, 2, 2291, 44804, 11, 269, 824, 3696, 287, 13639, 286, 3992, 11055, 198, 2, 3992, 62, 17256, 62, 25471, 796, 12813, 19668, 14, 1930, 62, 4106, 418, 74, 14, 25471, 14, 1930, 62, 4106, 418, 74, 13, 25471, 1, 198, 2, 3992, 62, 17256, 62, 8457, 796, 12813, 19668, 14, 1930, 62, 4106, 418, 74, 14, 8457, 14, 1930, 62, 4106, 418, 74, 13, 8457, 1, 198, 198, 2, 2291, 44804, 287, 2443, 198, 2, 2443, 62, 8457, 796, 19779, 7700, 1, 1058, 366, 11377, 14, 8457, 14, 7753, 13, 8457, 20662, 198, 2, 2443, 62, 8457, 796, 1391, 198, 2, 220, 220, 220, 220, 366, 4106, 418, 74, 1298, 14631, 11377, 14, 8457, 14, 1930, 62, 7700, 62, 8457, 13, 8457, 1600, 366, 11377, 14, 8457, 14, 42813, 14, 17618, 62, 1462, 62, 10879, 13, 8457, 8973, 198, 2, 1782, 198, 198, 2, 2291, 44804, 287, 10412, 2981, 5009, 198, 2, 10412, 2981, 62, 8457, 796, 19779, 4598, 310, 2981, 1, 1058, 366, 11377, 14, 8457, 14, 4598, 310, 2981, 13, 8457, 20662, 198, 2, 10412, 2981, 62, 4868, 62, 8457, 796, 19779, 4598, 310, 2981, 1, 1058, 366, 11377, 14, 8457, 14, 4598, 310, 2981, 62, 4868, 13, 8457, 20662, 198, 2, 10412, 2981, 62, 21048, 62, 8457, 796, 19779, 4598, 310, 2981, 1, 1058, 366, 11377, 14, 8457, 14, 4598, 310, 2981, 62, 21048, 13, 8457, 20662, 198, 2, 10412, 2981, 62, 9948, 9239, 62, 8457, 796, 19779, 4598, 310, 2981, 1, 1058, 366, 11377, 14, 8457, 14, 4598, 310, 2981, 62, 9948, 9239, 13, 8457, 20662, 198, 69, 25506, 796, 685, 198, 220, 220, 220, 1391, 198, 220, 220, 220, 220, 220, 220, 220, 366, 4598, 310, 2981, 1298, 366, 15022, 7663, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 366, 10379, 1010, 1298, 685, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 685, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 3672, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 259, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 685, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 44490, 10001, 2942, 9097, 12, 1930, 62, 4106, 418, 74, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 19076, 286, 28784, 12, 6404, 78, 1, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2361, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2361, 198, 220, 220, 220, 220, 220, 220, 220, 2361, 198, 220, 220, 220, 1782, 198, 60, 198, 2, 5995, 28221, 198, 2, 24200, 438, 198, 198, 2, 3586, 1363, 2443, 357, 10594, 20957, 15887, 16163, 8, 198, 2, 1363, 62, 7700, 796, 366, 38235, 1, 198, 198, 2, 3052, 2836, 1363, 2443, 357, 1525, 20934, 8, 198, 2, 2597, 62, 11195, 62, 7700, 796, 1391, 198, 2, 197, 1, 47445, 1298, 366, 11195, 62, 7700, 1, 198, 2, 1782, 198, 198, 2, 15887, 2836, 1363, 2443, 357, 1525, 2163, 8, 198, 2, 651, 62, 732, 12485, 62, 7220, 62, 11195, 62, 7700, 796, 366, 1930, 62, 4106, 418, 74, 13, 26791, 13, 1136, 62, 11195, 62, 7700, 1, 198, 198, 2, 2980, 2024, 198, 2, 24200, 438, 198, 198, 2, 6338, 2251, 2443, 329, 1123, 1700, 286, 428, 10412, 2981, 198, 2, 3052, 62, 8612, 2024, 796, 14631, 13908, 7873, 8973, 198, 198, 2, 32588, 198, 2, 220, 10541, 198, 198, 2, 878, 62, 17350, 796, 366, 1930, 62, 4106, 418, 74, 13, 17350, 13, 19052, 62, 17350, 1, 198, 2, 706, 62, 17350, 796, 366, 1930, 62, 4106, 418, 74, 13, 17350, 13, 8499, 62, 17350, 1, 198, 198, 2, 39246, 1892, 6637, 198, 2, 34400, 438, 198, 2, 4091, 5306, 27768, 13, 7295, 13, 1662, 6637, 13, 1136, 62, 1662, 2649, 62, 11250, 198, 198, 2, 14483, 62, 11250, 796, 366, 1930, 62, 4106, 418, 74, 13, 1662, 6637, 13, 1136, 62, 1662, 2649, 62, 11250, 1, 198, 198, 2, 2448, 8481, 198, 2, 24200, 6329, 198, 2, 2448, 8481, 16726, 287, 37341, 2842, 198, 198, 2, 7170, 62, 22766, 62, 17561, 1756, 796, 1391, 198, 2, 220, 197, 1, 9237, 1298, 366, 69, 430, 27768, 13, 8906, 74, 13, 4598, 310, 2981, 13, 15596, 13, 15596, 13, 1136, 62, 525, 3411, 62, 22766, 62, 17561, 1756, 1600, 198, 2, 1782, 198, 2, 198, 2, 468, 62, 525, 3411, 796, 1391, 198, 2, 220, 197, 1, 9237, 1298, 366, 69, 430, 27768, 13, 8906, 74, 13, 4598, 310, 2981, 13, 15596, 13, 15596, 13, 10134, 62, 525, 3411, 1600, 198, 2, 1782, 198, 198, 2, 16854, 18715, 198, 2, 220, 24305, 198, 2, 18531, 319, 3188, 5050, 290, 2995, 198, 198, 2, 2205, 62, 31534, 796, 1391, 198, 2, 220, 197, 1, 9, 1298, 1391, 198, 2, 220, 197, 197, 1, 261, 62, 19119, 1298, 366, 24396, 1600, 198, 2, 220, 197, 197, 1, 261, 62, 66, 21130, 1298, 366, 24396, 1600, 198, 2, 220, 197, 197, 1, 261, 62, 2213, 1077, 1298, 366, 24396, 1, 198, 2, 197, 92, 198, 2, 1782, 198, 198, 2, 27774, 6309, 309, 6791, 198, 2, 220, 24305, 198, 198, 2, 6038, 18173, 62, 31534, 796, 1391, 198, 2, 220, 197, 1, 439, 1298, 685, 198, 2, 220, 197, 197, 1, 1930, 62, 4106, 418, 74, 13, 83, 6791, 13, 439, 1, 198, 2, 220, 197, 4357, 198, 2, 220, 197, 1, 29468, 1298, 685, 198, 2, 220, 197, 197, 1, 1930, 62, 4106, 418, 74, 13, 83, 6791, 13, 29468, 1, 198, 2, 220, 197, 4357, 198, 2, 220, 197, 1, 9769, 306, 1298, 685, 198, 2, 220, 197, 197, 1, 1930, 62, 4106, 418, 74, 13, 83, 6791, 13, 9769, 306, 1, 198, 2, 220, 197, 4357, 198, 2, 220, 197, 1, 45291, 1298, 685, 198, 2, 220, 197, 197, 1, 1930, 62, 4106, 418, 74, 13, 83, 6791, 13, 45291, 1, 198, 2, 220, 197, 60, 198, 2, 220, 197, 1, 8424, 306, 1298, 685, 198, 2, 220, 197, 197, 1, 1930, 62, 4106, 418, 74, 13, 83, 6791, 13, 8424, 306, 1, 198, 2, 220, 197, 60, 198, 2, 1782, 198, 198, 2, 23983, 198, 2, 35656, 198, 198, 2, 878, 62, 41989, 796, 366, 1930, 62, 4106, 418, 74, 13, 17350, 13, 19052, 62, 41989, 1, 198, 198, 2, 3827, 81, 2530, 13183, 417, 6347, 25458, 198, 2, 34400, 26171, 198, 2, 198, 2, 20957, 62, 1929, 270, 417, 6347, 62, 24396, 82, 796, 1391, 198, 2, 220, 197, 1, 1930, 62, 47041, 3201, 13, 15042, 13, 1136, 62, 9186, 62, 36604, 13, 1136, 62, 9186, 62, 36604, 1298, 366, 1930, 62, 4106, 418, 74, 13, 15042, 13, 9186, 13, 1136, 62, 9186, 62, 36604, 1, 220, 1303, 645, 20402, 198, 2, 1782, 628 ]
2.319625
1,386
from keras import Model, Input from keras.layers import Dense, concatenate, LSTM, Reshape, Permute, Embedding, Dropout, Convolution1D, Flatten from keras.optimizers import Adam from pypagai.models.base import KerasModel
[ 6738, 41927, 292, 1330, 9104, 11, 23412, 198, 6738, 41927, 292, 13, 75, 6962, 1330, 360, 1072, 11, 1673, 36686, 378, 11, 406, 2257, 44, 11, 1874, 71, 1758, 11, 2448, 76, 1133, 11, 13302, 6048, 278, 11, 14258, 448, 11, 34872, 2122, 16, 35, 11, 1610, 41769, 198, 6738, 41927, 292, 13, 40085, 11341, 1330, 7244, 198, 198, 6738, 279, 4464, 363, 1872, 13, 27530, 13, 8692, 1330, 17337, 292, 17633, 628, 628 ]
3.027027
74
from .fully_connected import FullyConnectedLatentVariable from .convolutional import ConvolutionalLatentVariable
[ 6738, 764, 2759, 62, 15236, 1330, 40234, 13313, 276, 24220, 298, 43015, 198, 6738, 764, 42946, 2122, 282, 1330, 34872, 2122, 282, 24220, 298, 43015, 198 ]
4.346154
26
#!/usr/bin/env python # -*- coding:utf-8 -*- # Author: ''' PNASNet in PyTorch. Paper: Progressive Neural Architecture Search ''' from easyai.base_name.block_name import NormalizationType, ActivationType from easyai.base_name.backbone_name import BackboneName from easyai.model.backbone.utility.base_backbone import * from easyai.model.base_block.utility.utility_block import ConvBNActivationBlock from easyai.model.base_block.cls.pnasnet_block import CellA, CellB __all__ = ['pnasnet_A', 'pnasnet_B']
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 198, 2, 532, 9, 12, 19617, 25, 40477, 12, 23, 532, 9, 12, 198, 2, 6434, 25, 198, 7061, 6, 350, 18293, 7934, 287, 9485, 15884, 354, 13, 198, 42950, 25, 25852, 47986, 29778, 11140, 198, 7061, 6, 198, 198, 6738, 2562, 1872, 13, 8692, 62, 3672, 13, 9967, 62, 3672, 1330, 14435, 1634, 6030, 11, 13144, 341, 6030, 198, 6738, 2562, 1872, 13, 8692, 62, 3672, 13, 1891, 15992, 62, 3672, 1330, 5157, 15992, 5376, 198, 6738, 2562, 1872, 13, 19849, 13, 1891, 15992, 13, 315, 879, 13, 8692, 62, 1891, 15992, 1330, 1635, 198, 6738, 2562, 1872, 13, 19849, 13, 8692, 62, 9967, 13, 315, 879, 13, 315, 879, 62, 9967, 1330, 34872, 33, 4535, 310, 26939, 12235, 198, 6738, 2562, 1872, 13, 19849, 13, 8692, 62, 9967, 13, 565, 82, 13, 21999, 292, 3262, 62, 9967, 1330, 12440, 32, 11, 12440, 33, 198, 198, 834, 439, 834, 796, 37250, 21999, 292, 3262, 62, 32, 3256, 705, 21999, 292, 3262, 62, 33, 20520, 628, 628 ]
2.891429
175
# -*- coding: utf-8 -*- # coding=utf-8 import json import os import math import logging import requests import time from map_download.cmd.BaseDownloader import DownloadEngine, BaseDownloaderThread, latlng2tile_terrain, BoundBox if __name__ == '__main__': if 1: logger = logging.getLogger('down') try: root = r'/Users/cugxy/Documents/data/downloader' formatter = logging.Formatter('%(levelname)s-%(message)s') hdlr = logging.StreamHandler() log_file = os.path.join(root, 'down.log') file_hdlr = logging.FileHandler(log_file) file_hdlr.setFormatter(formatter) logger.addHandler(file_hdlr) logger.addHandler(hdlr) logger.setLevel(logging.INFO) min_lng = -180.0 max_lng = 180.0 min_lat = -90.0 max_lat = 90.0 start_zoom = 0 end_zoom = 5 bbox = BoundBox(max_lat, max_lng, min_lat, min_lng, start_zoom, end_zoom) d = TerrainDownloadEngine(root, bbox, 8, logger) d.start() time.sleep(10000) logger.error('main thread out') except Exception as e: logger.error(e) if 0: accessToken = get_access_token() pass
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 2, 220, 19617, 28, 40477, 12, 23, 198, 11748, 33918, 198, 11748, 28686, 198, 11748, 10688, 198, 11748, 18931, 198, 11748, 7007, 198, 11748, 640, 198, 198, 6738, 3975, 62, 15002, 13, 28758, 13, 14881, 10002, 263, 1330, 10472, 13798, 11, 7308, 10002, 263, 16818, 11, 3042, 75, 782, 17, 40927, 62, 353, 3201, 11, 30149, 14253, 628, 628, 198, 198, 361, 11593, 3672, 834, 6624, 705, 834, 12417, 834, 10354, 198, 220, 220, 220, 611, 352, 25, 198, 220, 220, 220, 220, 220, 220, 220, 49706, 796, 18931, 13, 1136, 11187, 1362, 10786, 2902, 11537, 198, 220, 220, 220, 220, 220, 220, 220, 1949, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 6808, 796, 374, 26488, 14490, 14, 66, 1018, 5431, 14, 38354, 14, 7890, 14, 15002, 263, 6, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1296, 1436, 796, 18931, 13, 8479, 1436, 10786, 4, 7, 5715, 3672, 8, 82, 12, 4, 7, 20500, 8, 82, 11537, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 289, 67, 14050, 796, 18931, 13, 12124, 25060, 3419, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2604, 62, 7753, 796, 28686, 13, 6978, 13, 22179, 7, 15763, 11, 705, 2902, 13, 6404, 11537, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2393, 62, 31298, 14050, 796, 18931, 13, 8979, 25060, 7, 6404, 62, 7753, 8, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2393, 62, 31298, 14050, 13, 2617, 8479, 1436, 7, 687, 1436, 8, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 49706, 13, 2860, 25060, 7, 7753, 62, 31298, 14050, 8, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 49706, 13, 2860, 25060, 7, 31298, 14050, 8, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 49706, 13, 2617, 4971, 7, 6404, 2667, 13, 10778, 8, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 949, 62, 75, 782, 796, 532, 15259, 13, 15, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 3509, 62, 75, 782, 796, 11546, 13, 15, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 949, 62, 15460, 796, 532, 3829, 13, 15, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 3509, 62, 15460, 796, 4101, 13, 15, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 923, 62, 89, 4207, 796, 657, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 886, 62, 89, 4207, 796, 642, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 275, 3524, 796, 30149, 14253, 7, 9806, 62, 15460, 11, 3509, 62, 75, 782, 11, 949, 62, 15460, 11, 949, 62, 75, 782, 11, 923, 62, 89, 4207, 11, 886, 62, 89, 4207, 8, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 288, 796, 3813, 3201, 10002, 13798, 7, 15763, 11, 275, 3524, 11, 807, 11, 49706, 8, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 288, 13, 9688, 3419, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 640, 13, 42832, 7, 49388, 8, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 49706, 13, 18224, 10786, 12417, 4704, 503, 11537, 198, 220, 220, 220, 220, 220, 220, 220, 2845, 35528, 355, 304, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 49706, 13, 18224, 7, 68, 8, 198, 220, 220, 220, 611, 657, 25, 198, 220, 220, 220, 220, 220, 220, 220, 1895, 30642, 796, 651, 62, 15526, 62, 30001, 3419, 198, 220, 220, 220, 1208, 628 ]
2.001536
651
# coding: utf-8 """ Kubernetes No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 OpenAPI spec version: v1.12.4 Generated by: https://github.com/swagger-api/swagger-codegen.git """ from __future__ import absolute_import import re # noqa: F401 # python 2 and python 3 compatibility library import six from kubernetes_asyncio.client.api_client import ApiClient
[ 2, 19617, 25, 3384, 69, 12, 23, 198, 198, 37811, 198, 220, 220, 220, 12554, 527, 3262, 274, 628, 220, 220, 220, 1400, 6764, 2810, 357, 27568, 416, 2451, 7928, 6127, 5235, 3740, 1378, 12567, 13, 785, 14, 2032, 7928, 12, 15042, 14, 2032, 7928, 12, 8189, 5235, 8, 220, 1303, 645, 20402, 25, 412, 33548, 628, 220, 220, 220, 4946, 17614, 1020, 2196, 25, 410, 16, 13, 1065, 13, 19, 198, 220, 220, 220, 220, 198, 220, 220, 220, 2980, 515, 416, 25, 3740, 1378, 12567, 13, 785, 14, 2032, 7928, 12, 15042, 14, 2032, 7928, 12, 8189, 5235, 13, 18300, 198, 37811, 628, 198, 6738, 11593, 37443, 834, 1330, 4112, 62, 11748, 198, 198, 11748, 302, 220, 1303, 645, 20402, 25, 376, 21844, 198, 198, 2, 21015, 362, 290, 21015, 513, 17764, 5888, 198, 11748, 2237, 198, 198, 6738, 479, 18478, 3262, 274, 62, 292, 13361, 952, 13, 16366, 13, 15042, 62, 16366, 1330, 5949, 72, 11792, 628 ]
2.84375
160
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Fri Nov 10 23:28:58 2017 @author: dhingratul """ import urllib.request import os from selenium import webdriver from selenium.webdriver.support.ui import Select from bs4 import BeautifulSoup import ssl import requests import wget from PyPDF2 import PdfFileReader def is_valid_pdf(fn): """Check is the PDF valid """ try: with open(fn, 'rb') as f: pdf = PdfFileReader(f) numpages = pdf.numPages return (numpages > 0) except Exception as e: return False
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 18, 198, 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 37811, 198, 41972, 319, 19480, 5267, 838, 2242, 25, 2078, 25, 3365, 2177, 198, 198, 31, 9800, 25, 288, 722, 10366, 377, 198, 37811, 198, 11748, 2956, 297, 571, 13, 25927, 198, 11748, 28686, 198, 6738, 384, 11925, 1505, 1330, 3992, 26230, 198, 6738, 384, 11925, 1505, 13, 12384, 26230, 13, 11284, 13, 9019, 1330, 9683, 198, 6738, 275, 82, 19, 1330, 23762, 50, 10486, 198, 11748, 264, 6649, 198, 11748, 7007, 198, 11748, 266, 1136, 198, 6738, 9485, 20456, 17, 1330, 350, 7568, 8979, 33634, 628, 628, 628, 198, 4299, 318, 62, 12102, 62, 12315, 7, 22184, 2599, 198, 220, 220, 220, 37227, 9787, 318, 262, 12960, 4938, 37227, 198, 220, 220, 220, 1949, 25, 198, 220, 220, 220, 220, 220, 220, 220, 351, 1280, 7, 22184, 11, 705, 26145, 11537, 355, 277, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 37124, 796, 350, 7568, 8979, 33634, 7, 69, 8, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 299, 931, 1095, 796, 37124, 13, 22510, 47798, 198, 220, 220, 220, 220, 220, 220, 220, 1441, 357, 77, 931, 1095, 1875, 657, 8, 198, 220, 220, 220, 2845, 35528, 355, 304, 25, 198, 220, 220, 220, 220, 220, 220, 220, 1441, 10352, 198 ]
2.457627
236
""" Experiment summary ------------------ Treat each province/state in a country cases over time as a vector, do a simple K-Nearest Neighbor between countries. What country has the most similar trajectory to a given country? Plots similar countries """ import sys sys.path.insert(0, '..') from utils import data import os import sklearn import numpy as np import json import matplotlib.pyplot as plt plt.style.use('fivethirtyeight') # ------------ HYPERPARAMETERS ------------- BASE_PATH = '../COVID-19/csse_covid_19_data/' # ------------------------------------------ confirmed = os.path.join( BASE_PATH, 'csse_covid_19_time_series', 'time_series_covid19_confirmed_global.csv') confirmed = data.load_csv_data(confirmed) features = [] targets = [] fig = plt.figure(figsize=(12, 12)) ax = fig.add_subplot(111) cm = plt.get_cmap('jet') NUM_COLORS = 0 LINE_STYLES = ['solid', 'dashed', 'dotted'] NUM_STYLES = len(LINE_STYLES) dist_diff = os.path.join('../exp/results/', 'knn_raw.json') f = open(dist_diff,) dist_diff = json.load(f) for region, dist in dist_diff.items(): plt.style.use('fivethirtyeight') fig = plt.figure(figsize=(12, 12)) ax = fig.add_subplot(111) cm = plt.get_cmap('jet') other_region = dist['manhattan'][0] regions = [region, other_region] for val in regions: df = data.filter_by_attribute( confirmed, "Country/Region", val) cases, labels = data.get_cases_chronologically(df) cases = cases.sum(axis=0) lines = ax.plot(cases, label=val) ax.set_ylabel('# of confirmed cases') ax.set_xlabel("Time (days since Jan 22, 2020)") ax.set_yscale('log') ax.legend() plt.tight_layout() region = region.replace('*', '') other_region = other_region.replace('*', '') plt.title(f'Comparing confirmed cases in {region} and {other_region}') plt.savefig(f'results/raw_manhattan/{region}.png') plt.close() print(region)
[ 37811, 198, 20468, 3681, 10638, 198, 1783, 438, 198, 51, 630, 1123, 8473, 14, 5219, 287, 257, 1499, 2663, 625, 640, 198, 292, 257, 15879, 11, 466, 257, 2829, 509, 12, 8199, 12423, 28708, 1022, 198, 9127, 1678, 13, 1867, 1499, 468, 262, 749, 2092, 22942, 198, 1462, 257, 1813, 1499, 30, 198, 198, 3646, 1747, 2092, 2678, 198, 37811, 198, 198, 11748, 25064, 198, 17597, 13, 6978, 13, 28463, 7, 15, 11, 705, 492, 11537, 198, 198, 6738, 3384, 4487, 1330, 1366, 198, 11748, 28686, 198, 11748, 1341, 35720, 198, 11748, 299, 32152, 355, 45941, 198, 11748, 33918, 198, 11748, 2603, 29487, 8019, 13, 9078, 29487, 355, 458, 83, 198, 198, 489, 83, 13, 7635, 13, 1904, 10786, 13261, 400, 5893, 26022, 11537, 198, 198, 2, 220, 10541, 43624, 18973, 27082, 2390, 2767, 4877, 220, 32501, 198, 33, 11159, 62, 34219, 796, 705, 40720, 8220, 11008, 12, 1129, 14, 6359, 325, 62, 66, 709, 312, 62, 1129, 62, 7890, 14, 6, 198, 2, 20368, 35937, 198, 198, 36349, 796, 28686, 13, 6978, 13, 22179, 7, 198, 220, 220, 220, 49688, 62, 34219, 11, 198, 220, 220, 220, 705, 6359, 325, 62, 66, 709, 312, 62, 1129, 62, 2435, 62, 25076, 3256, 198, 220, 220, 220, 705, 2435, 62, 25076, 62, 66, 709, 312, 1129, 62, 36349, 62, 20541, 13, 40664, 11537, 198, 36349, 796, 1366, 13, 2220, 62, 40664, 62, 7890, 7, 36349, 8, 198, 40890, 796, 17635, 198, 83, 853, 1039, 796, 17635, 198, 198, 5647, 796, 458, 83, 13, 26875, 7, 5647, 7857, 16193, 1065, 11, 1105, 4008, 198, 897, 796, 2336, 13, 2860, 62, 7266, 29487, 7, 16243, 8, 198, 11215, 796, 458, 83, 13, 1136, 62, 66, 8899, 10786, 31173, 11537, 198, 41359, 62, 25154, 20673, 796, 657, 198, 24027, 62, 2257, 56, 28378, 796, 37250, 39390, 3256, 705, 67, 5263, 3256, 705, 67, 8426, 20520, 198, 41359, 62, 2257, 56, 28378, 796, 18896, 7, 24027, 62, 2257, 56, 28378, 8, 198, 198, 17080, 62, 26069, 796, 28686, 13, 6978, 13, 22179, 10786, 40720, 11201, 14, 43420, 14, 3256, 705, 15418, 77, 62, 1831, 13, 17752, 11537, 198, 69, 796, 1280, 7, 17080, 62, 26069, 35751, 198, 17080, 62, 26069, 796, 33918, 13, 2220, 7, 69, 8, 198, 198, 1640, 3814, 11, 1233, 287, 1233, 62, 26069, 13, 23814, 33529, 198, 220, 220, 220, 458, 83, 13, 7635, 13, 1904, 10786, 13261, 400, 5893, 26022, 11537, 628, 220, 220, 220, 2336, 796, 458, 83, 13, 26875, 7, 5647, 7857, 16193, 1065, 11, 1105, 4008, 198, 220, 220, 220, 7877, 796, 2336, 13, 2860, 62, 7266, 29487, 7, 16243, 8, 198, 220, 220, 220, 12067, 796, 458, 83, 13, 1136, 62, 66, 8899, 10786, 31173, 11537, 628, 220, 220, 220, 584, 62, 36996, 796, 1233, 17816, 805, 12904, 6, 7131, 15, 60, 198, 220, 220, 220, 7652, 796, 685, 36996, 11, 584, 62, 36996, 60, 198, 220, 220, 220, 329, 1188, 287, 7652, 25, 198, 220, 220, 220, 220, 220, 220, 220, 47764, 796, 1366, 13, 24455, 62, 1525, 62, 42348, 7, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 4999, 11, 366, 33921, 14, 47371, 1600, 1188, 8, 198, 220, 220, 220, 220, 220, 220, 220, 2663, 11, 14722, 796, 1366, 13, 1136, 62, 33964, 62, 11413, 13437, 7, 7568, 8, 198, 220, 220, 220, 220, 220, 220, 220, 2663, 796, 2663, 13, 16345, 7, 22704, 28, 15, 8, 628, 220, 220, 220, 220, 220, 220, 220, 3951, 796, 7877, 13, 29487, 7, 33964, 11, 6167, 28, 2100, 8, 628, 220, 220, 220, 7877, 13, 2617, 62, 2645, 9608, 10786, 2, 286, 4999, 2663, 11537, 198, 220, 220, 220, 7877, 13, 2617, 62, 87, 18242, 7203, 7575, 357, 12545, 1201, 2365, 2534, 11, 12131, 8, 4943, 198, 220, 220, 220, 7877, 13, 2617, 62, 28349, 1000, 10786, 6404, 11537, 198, 220, 220, 220, 7877, 13, 1455, 437, 3419, 198, 220, 220, 220, 458, 83, 13, 33464, 62, 39786, 3419, 198, 220, 220, 220, 3814, 796, 3814, 13, 33491, 10786, 9, 3256, 10148, 8, 198, 220, 220, 220, 584, 62, 36996, 796, 584, 62, 36996, 13, 33491, 10786, 9, 3256, 10148, 8, 198, 220, 220, 220, 458, 83, 13, 7839, 7, 69, 6, 7293, 1723, 4999, 2663, 287, 1391, 36996, 92, 290, 1391, 847, 62, 36996, 92, 11537, 198, 220, 220, 220, 458, 83, 13, 21928, 5647, 7, 69, 821, 82, 8376, 14, 1831, 62, 805, 12904, 14, 90, 36996, 27422, 11134, 11537, 198, 220, 220, 220, 458, 83, 13, 19836, 3419, 198, 220, 220, 220, 3601, 7, 36996, 8 ]
2.580475
758
""" Rational Activation Functions for MXNET ======================================= This module allows you to create Rational Neural Networks using Learnable Rational activation functions with MXNET networks. """ import mxnet as mx from mxnet import initializer from mxnet.gluon import HybridBlock from rational.utils.get_weights import get_parameters from rational.mxnet.versions import _version_a, _version_b, _version_c, _version_d from rational._base.rational_base import Rational_base
[ 37811, 198, 49, 864, 13144, 341, 40480, 329, 26135, 12884, 198, 10052, 1421, 18604, 198, 198, 1212, 8265, 3578, 345, 284, 2251, 46863, 47986, 27862, 1262, 14365, 540, 198, 49, 864, 14916, 5499, 351, 26135, 12884, 7686, 13, 198, 37811, 198, 11748, 285, 87, 3262, 355, 285, 87, 198, 6738, 285, 87, 3262, 1330, 4238, 7509, 198, 6738, 285, 87, 3262, 13, 70, 2290, 261, 1330, 29481, 12235, 198, 198, 6738, 9377, 13, 26791, 13, 1136, 62, 43775, 1330, 651, 62, 17143, 7307, 198, 6738, 9377, 13, 36802, 3262, 13, 47178, 1330, 4808, 9641, 62, 64, 11, 4808, 9641, 62, 65, 11, 4808, 9641, 62, 66, 11, 4808, 9641, 62, 67, 198, 6738, 9377, 13557, 8692, 13, 20310, 62, 8692, 1330, 46863, 62, 8692, 628 ]
3.944
125
"""Utils for criterion.""" import torch import torch.nn.functional as F def normalize(x, axis=-1): """Performs L2-Norm.""" num = x denom = torch.norm(x, 2, axis, keepdim=True).expand_as(x) + 1e-12 return num / denom # Source : https://github.com/earhian/Humpback-Whale-Identification-1st-/blob/master/models/triplet_loss.py def euclidean_dist(x, y): """Computes Euclidean distance.""" m, n = x.size(0), y.size(0) xx = torch.pow(x, 2).sum(1, keepdim=True).expand(m, n) yy = torch.pow(x, 2).sum(1, keepdim=True).expand(m, m).t() dist = xx + yy - 2 * torch.matmul(x, y.t()) dist = dist.clamp(min=1e-12).sqrt() return dist def cosine_dist(x, y): """Computes Cosine Distance.""" x = F.normalize(x, dim=1) y = F.normalize(y, dim=1) dist = 2 - 2 * torch.mm(x, y.t()) return dist
[ 37811, 18274, 4487, 329, 34054, 526, 15931, 198, 11748, 28034, 198, 11748, 28034, 13, 20471, 13, 45124, 355, 376, 628, 198, 4299, 3487, 1096, 7, 87, 11, 16488, 10779, 16, 2599, 198, 220, 220, 220, 37227, 5990, 23914, 406, 17, 12, 35393, 526, 15931, 198, 220, 220, 220, 997, 796, 2124, 198, 220, 220, 220, 2853, 296, 796, 28034, 13, 27237, 7, 87, 11, 362, 11, 16488, 11, 1394, 27740, 28, 17821, 737, 11201, 392, 62, 292, 7, 87, 8, 1343, 352, 68, 12, 1065, 198, 220, 220, 220, 1441, 997, 1220, 2853, 296, 628, 198, 2, 8090, 1058, 3740, 1378, 12567, 13, 785, 14, 451, 71, 666, 14, 39, 931, 1891, 12, 1199, 1000, 12, 33234, 2649, 12, 16, 301, 12, 14, 2436, 672, 14, 9866, 14, 27530, 14, 28461, 37069, 62, 22462, 13, 9078, 198, 4299, 304, 36616, 485, 272, 62, 17080, 7, 87, 11, 331, 2599, 198, 220, 220, 220, 37227, 7293, 1769, 48862, 485, 272, 5253, 526, 15931, 198, 220, 220, 220, 285, 11, 299, 796, 2124, 13, 7857, 7, 15, 828, 331, 13, 7857, 7, 15, 8, 198, 220, 220, 220, 31383, 796, 28034, 13, 79, 322, 7, 87, 11, 362, 737, 16345, 7, 16, 11, 1394, 27740, 28, 17821, 737, 11201, 392, 7, 76, 11, 299, 8, 198, 220, 220, 220, 331, 88, 796, 28034, 13, 79, 322, 7, 87, 11, 362, 737, 16345, 7, 16, 11, 1394, 27740, 28, 17821, 737, 11201, 392, 7, 76, 11, 285, 737, 83, 3419, 198, 220, 220, 220, 1233, 796, 31383, 1343, 331, 88, 532, 362, 1635, 28034, 13, 6759, 76, 377, 7, 87, 11, 331, 13, 83, 28955, 628, 220, 220, 220, 1233, 796, 1233, 13, 565, 696, 7, 1084, 28, 16, 68, 12, 1065, 737, 31166, 17034, 3419, 628, 220, 220, 220, 1441, 1233, 628, 198, 4299, 8615, 500, 62, 17080, 7, 87, 11, 331, 2599, 198, 220, 220, 220, 37227, 7293, 1769, 10437, 500, 34600, 526, 15931, 198, 220, 220, 220, 2124, 796, 376, 13, 11265, 1096, 7, 87, 11, 5391, 28, 16, 8, 198, 220, 220, 220, 331, 796, 376, 13, 11265, 1096, 7, 88, 11, 5391, 28, 16, 8, 198, 220, 220, 220, 1233, 796, 362, 532, 362, 1635, 28034, 13, 3020, 7, 87, 11, 331, 13, 83, 28955, 198, 220, 220, 220, 1441, 1233, 198 ]
2.197917
384
"""Tests for the sbahn_munich integration""" line_dict = { "name": "S3", "color": "#333333", "text_color": "#444444", }
[ 37811, 51, 3558, 329, 262, 264, 65, 15386, 62, 6199, 488, 11812, 37811, 628, 198, 1370, 62, 11600, 796, 1391, 198, 220, 220, 220, 366, 3672, 1298, 366, 50, 18, 1600, 198, 220, 220, 220, 366, 8043, 1298, 25113, 24840, 2091, 1600, 198, 220, 220, 220, 366, 5239, 62, 8043, 1298, 25113, 2598, 2598, 2598, 1600, 198, 92, 198 ]
2.271186
59
#! /usr/bin/env python2.7 # -*- coding: latin-1 -*- from flask import Blueprint from flask import current_app from flask import render_template from flask_login import login_required homestack = Blueprint("homestack", __name__, url_prefix="/homestack")
[ 2, 0, 1220, 14629, 14, 8800, 14, 24330, 21015, 17, 13, 22, 198, 2, 532, 9, 12, 19617, 25, 3042, 259, 12, 16, 532, 9, 12, 198, 198, 6738, 42903, 1330, 39932, 198, 6738, 42903, 1330, 1459, 62, 1324, 198, 6738, 42903, 1330, 8543, 62, 28243, 198, 198, 6738, 42903, 62, 38235, 1330, 17594, 62, 35827, 198, 198, 26452, 395, 441, 796, 39932, 7203, 26452, 395, 441, 1600, 11593, 3672, 834, 11, 19016, 62, 40290, 35922, 26452, 395, 441, 4943, 628 ]
3.17284
81
"""Forms for RTD donations""" import logging from django import forms from django.conf import settings from django.utils.translation import ugettext_lazy as _ from readthedocs.payments.forms import StripeModelForm, StripeResourceMixin from readthedocs.payments.utils import stripe from .models import Supporter log = logging.getLogger(__name__)
[ 37811, 8479, 82, 329, 11923, 35, 10976, 37811, 198, 198, 11748, 18931, 198, 198, 6738, 42625, 14208, 1330, 5107, 198, 6738, 42625, 14208, 13, 10414, 1330, 6460, 198, 6738, 42625, 14208, 13, 26791, 13, 41519, 1330, 334, 1136, 5239, 62, 75, 12582, 355, 4808, 198, 198, 6738, 1100, 83, 704, 420, 82, 13, 15577, 902, 13, 23914, 1330, 26137, 431, 17633, 8479, 11, 26137, 431, 26198, 35608, 259, 198, 6738, 1100, 83, 704, 420, 82, 13, 15577, 902, 13, 26791, 1330, 39858, 198, 198, 6738, 764, 27530, 1330, 8105, 4337, 198, 198, 6404, 796, 18931, 13, 1136, 11187, 1362, 7, 834, 3672, 834, 8, 628, 198 ]
3.320755
106
#!/usr/bin/env python # -*- coding: utf-8 -*- from .base import DataReaderBase from ..tools import COL, _get_dates, to_float, to_int import pandas as pd #from pandas.tseries.frequencies import to_offset from six.moves import cStringIO as StringIO import logging import traceback import datetime import json import token, tokenize def ymd_to_date(y, m, d): """ Returns date >>> expiration = {u'd': 1, u'm': 12, u'y': 2014} >>> ymd_to_date(**expiration) datetime.date(2014, 12, 1) >>> ymd_to_date(2014, 3, 1) datetime.date(2014, 3, 1) """ return(datetime.date(year=y, month=m, day=d)) def date_to_ymd(date): """ Returns dict like {'y': ..., 'm': ..., 'd': ...} >>> date_to_ymd(datetime.date(year=2010, month=1, day=3)) {'y': 2010, 'm': 1, 'd': 3} """ d = { 'y': date.year, 'm': date.month, 'd': date.day } return(d) def fix_lazy_json(in_text): """ Handle lazy JSON - to fix expecting property name this function fixes the json output from google http://stackoverflow.com/questions/4033633/handling-lazy-json-in-python-expecting-property-name """ tokengen = tokenize.generate_tokens(StringIO(in_text).readline) result = [] for tokid, tokval, _, _, _ in tokengen: # fix unquoted strings if (tokid == token.NAME): if tokval not in ['true', 'false', 'null', '-Infinity', 'Infinity', 'NaN']: tokid = token.STRING tokval = u'"%s"' % tokval # fix single-quoted strings elif (tokid == token.STRING): if tokval.startswith ("'"): tokval = u'"%s"' % tokval[1:-1].replace ('"', '\\"') # remove invalid commas elif (tokid == token.OP) and ((tokval == '}') or (tokval == ']')): if (len(result) > 0) and (result[-1][1] == ','): result.pop() # fix single-quoted strings elif (tokid == token.STRING): if tokval.startswith ("'"): tokval = u'"%s"' % tokval[1:-1].replace ('"', '\\"') result.append((tokid, tokval)) return tokenize.untokenize(result) if __name__ == "__main__": import doctest doctest.testmod()
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 198, 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 198, 6738, 764, 8692, 1330, 6060, 33634, 14881, 198, 6738, 11485, 31391, 1330, 20444, 11, 4808, 1136, 62, 19581, 11, 284, 62, 22468, 11, 284, 62, 600, 198, 198, 11748, 19798, 292, 355, 279, 67, 198, 2, 6738, 19798, 292, 13, 912, 10640, 13, 69, 8897, 3976, 1330, 284, 62, 28968, 198, 6738, 2237, 13, 76, 5241, 1330, 269, 10100, 9399, 355, 10903, 9399, 198, 11748, 18931, 198, 11748, 12854, 1891, 198, 11748, 4818, 8079, 198, 198, 11748, 33918, 198, 11748, 11241, 11, 11241, 1096, 628, 198, 4299, 331, 9132, 62, 1462, 62, 4475, 7, 88, 11, 285, 11, 288, 2599, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 16409, 3128, 628, 220, 220, 220, 13163, 28385, 796, 1391, 84, 1549, 10354, 352, 11, 334, 1101, 10354, 1105, 11, 334, 6, 88, 10354, 1946, 92, 198, 220, 220, 220, 13163, 331, 9132, 62, 1462, 62, 4475, 7, 1174, 1069, 10514, 8, 198, 220, 220, 220, 4818, 8079, 13, 4475, 7, 4967, 11, 1105, 11, 352, 8, 628, 220, 220, 220, 13163, 331, 9132, 62, 1462, 62, 4475, 7, 4967, 11, 513, 11, 352, 8, 198, 220, 220, 220, 4818, 8079, 13, 4475, 7, 4967, 11, 513, 11, 352, 8, 628, 220, 220, 220, 37227, 198, 220, 220, 220, 1441, 7, 19608, 8079, 13, 4475, 7, 1941, 28, 88, 11, 1227, 28, 76, 11, 1110, 28, 67, 4008, 198, 198, 4299, 3128, 62, 1462, 62, 4948, 67, 7, 4475, 2599, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 16409, 8633, 588, 1391, 6, 88, 10354, 2644, 11, 705, 76, 10354, 2644, 11, 705, 67, 10354, 2644, 92, 628, 220, 220, 220, 13163, 3128, 62, 1462, 62, 4948, 67, 7, 19608, 8079, 13, 4475, 7, 1941, 28, 10333, 11, 1227, 28, 16, 11, 1110, 28, 18, 4008, 198, 220, 220, 220, 1391, 6, 88, 10354, 3050, 11, 705, 76, 10354, 352, 11, 705, 67, 10354, 513, 92, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 288, 796, 1391, 198, 220, 220, 220, 220, 220, 220, 220, 705, 88, 10354, 3128, 13, 1941, 11, 198, 220, 220, 220, 220, 220, 220, 220, 705, 76, 10354, 3128, 13, 8424, 11, 198, 220, 220, 220, 220, 220, 220, 220, 705, 67, 10354, 3128, 13, 820, 198, 220, 220, 220, 1782, 198, 220, 220, 220, 1441, 7, 67, 8, 198, 198, 4299, 4259, 62, 75, 12582, 62, 17752, 7, 259, 62, 5239, 2599, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 33141, 16931, 19449, 532, 284, 4259, 12451, 3119, 1438, 198, 220, 220, 220, 428, 2163, 13040, 262, 33918, 5072, 422, 23645, 198, 220, 220, 220, 2638, 1378, 25558, 2502, 11125, 13, 785, 14, 6138, 507, 14, 1821, 29211, 2091, 14, 4993, 1359, 12, 75, 12582, 12, 17752, 12, 259, 12, 29412, 12, 1069, 35570, 12, 26745, 12, 3672, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 284, 74, 1516, 268, 796, 11241, 1096, 13, 8612, 378, 62, 83, 482, 641, 7, 10100, 9399, 7, 259, 62, 5239, 737, 961, 1370, 8, 628, 220, 220, 220, 1255, 796, 17635, 198, 220, 220, 220, 329, 284, 38439, 11, 284, 74, 2100, 11, 4808, 11, 4808, 11, 4808, 287, 284, 74, 1516, 268, 25, 198, 220, 220, 220, 220, 220, 220, 220, 1303, 4259, 555, 421, 5191, 13042, 198, 220, 220, 220, 220, 220, 220, 220, 611, 357, 83, 482, 312, 6624, 11241, 13, 20608, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 611, 284, 74, 2100, 407, 287, 37250, 7942, 3256, 705, 9562, 3256, 705, 8423, 3256, 705, 12, 18943, 6269, 3256, 705, 18943, 6269, 3256, 705, 26705, 45, 6, 5974, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 284, 38439, 796, 11241, 13, 18601, 2751, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 284, 74, 2100, 796, 334, 29653, 4, 82, 30543, 4064, 284, 74, 2100, 628, 220, 220, 220, 220, 220, 220, 220, 1303, 4259, 2060, 12, 421, 5191, 13042, 198, 220, 220, 220, 220, 220, 220, 220, 1288, 361, 357, 83, 482, 312, 6624, 11241, 13, 18601, 2751, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 611, 284, 74, 2100, 13, 9688, 2032, 342, 5855, 29653, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 284, 74, 2100, 796, 334, 29653, 4, 82, 30543, 4064, 284, 74, 2100, 58, 16, 21912, 16, 4083, 33491, 19203, 1, 3256, 705, 6852, 1, 11537, 628, 220, 220, 220, 220, 220, 220, 220, 1303, 4781, 12515, 725, 292, 198, 220, 220, 220, 220, 220, 220, 220, 1288, 361, 357, 83, 482, 312, 6624, 11241, 13, 3185, 8, 290, 14808, 83, 482, 2100, 6624, 705, 92, 11537, 393, 357, 83, 482, 2100, 6624, 705, 60, 11537, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 611, 357, 11925, 7, 20274, 8, 1875, 657, 8, 290, 357, 20274, 58, 12, 16, 7131, 16, 60, 6624, 705, 4032, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1255, 13, 12924, 3419, 628, 220, 220, 220, 220, 220, 220, 220, 1303, 4259, 2060, 12, 421, 5191, 13042, 198, 220, 220, 220, 220, 220, 220, 220, 1288, 361, 357, 83, 482, 312, 6624, 11241, 13, 18601, 2751, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 611, 284, 74, 2100, 13, 9688, 2032, 342, 5855, 29653, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 284, 74, 2100, 796, 334, 29653, 4, 82, 30543, 4064, 284, 74, 2100, 58, 16, 21912, 16, 4083, 33491, 19203, 1, 3256, 705, 6852, 1, 11537, 628, 220, 220, 220, 220, 220, 220, 220, 1255, 13, 33295, 19510, 83, 482, 312, 11, 284, 74, 2100, 4008, 628, 220, 220, 220, 1441, 11241, 1096, 13, 2797, 4233, 1096, 7, 20274, 8, 198, 198, 361, 11593, 3672, 834, 6624, 366, 834, 12417, 834, 1298, 198, 220, 220, 220, 1330, 10412, 395, 198, 220, 220, 220, 10412, 395, 13, 9288, 4666, 3419, 198 ]
2.140267
1,048
# !/usr/bin/python # -*- coding: utf-8 -*- # @time : 2019/11/2 21:08 # @author : Mo # @function: from keras_textclassification.data_preprocess.text_preprocess import load_json, save_json from keras_textclassification.conf.path_config import path_model_dir path_fast_text_model_vocab2index = path_model_dir + 'vocab2index.json' path_fast_text_model_l2i_i2l = path_model_dir + 'l2i_i2l.json' import numpy as np import os
[ 2, 5145, 14, 14629, 14, 8800, 14, 29412, 198, 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 2, 2488, 2435, 220, 220, 220, 1058, 13130, 14, 1157, 14, 17, 2310, 25, 2919, 198, 2, 2488, 9800, 220, 1058, 4270, 198, 2, 2488, 8818, 25, 628, 198, 6738, 41927, 292, 62, 5239, 4871, 2649, 13, 7890, 62, 3866, 14681, 13, 5239, 62, 3866, 14681, 1330, 3440, 62, 17752, 11, 3613, 62, 17752, 198, 6738, 41927, 292, 62, 5239, 4871, 2649, 13, 10414, 13, 6978, 62, 11250, 1330, 3108, 62, 19849, 62, 15908, 198, 6978, 62, 7217, 62, 5239, 62, 19849, 62, 18893, 397, 17, 9630, 796, 3108, 62, 19849, 62, 15908, 1343, 705, 18893, 397, 17, 9630, 13, 17752, 6, 198, 6978, 62, 7217, 62, 5239, 62, 19849, 62, 75, 17, 72, 62, 72, 17, 75, 796, 3108, 62, 19849, 62, 15908, 1343, 705, 75, 17, 72, 62, 72, 17, 75, 13, 17752, 6, 198, 198, 11748, 299, 32152, 355, 45941, 198, 11748, 28686, 628, 628, 628 ]
2.505814
172
# Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from gpu_tests.gpu_test_expectations import GpuTestExpectations # See the GpuTestExpectations class for documentation.
[ 2, 15069, 1946, 383, 18255, 1505, 46665, 13, 1439, 2489, 10395, 13, 198, 2, 5765, 286, 428, 2723, 2438, 318, 21825, 416, 257, 347, 10305, 12, 7635, 5964, 326, 460, 307, 198, 2, 1043, 287, 262, 38559, 24290, 2393, 13, 198, 198, 6738, 308, 19944, 62, 41989, 13, 46999, 62, 9288, 62, 1069, 806, 602, 1330, 402, 19944, 14402, 3109, 806, 602, 198, 198, 2, 4091, 262, 402, 19944, 14402, 3109, 806, 602, 1398, 329, 10314, 13, 198 ]
3.628205
78
# -*- coding: utf-8 -*- # Generated by Django 1.11.13 on 2018-06-08 22:54 from __future__ import unicode_literals from django.conf import settings import django.contrib.postgres.fields.jsonb from django.db import migrations, models import django.db.models.deletion
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 2, 2980, 515, 416, 37770, 352, 13, 1157, 13, 1485, 319, 2864, 12, 3312, 12, 2919, 2534, 25, 4051, 198, 6738, 11593, 37443, 834, 1330, 28000, 1098, 62, 17201, 874, 198, 198, 6738, 42625, 14208, 13, 10414, 1330, 6460, 198, 11748, 42625, 14208, 13, 3642, 822, 13, 7353, 34239, 13, 25747, 13, 17752, 65, 198, 6738, 42625, 14208, 13, 9945, 1330, 15720, 602, 11, 4981, 198, 11748, 42625, 14208, 13, 9945, 13, 27530, 13, 2934, 1616, 295, 628 ]
2.902174
92
import setuptools #enables develop setuptools.setup( name='pysvm', version='0.1', description='PySVM : A NumPy implementation of SVM based on SMO algorithm', author_email="191300064@smail.nju.edu.cn", packages=['pysvm'], license='MIT License', long_description=open('README.md', encoding='utf-8').read(), install_requires=[ # 'numpy', 'sklearn' ], url='https://github.com/Kaslanarian/PySVM', )
[ 11748, 900, 37623, 10141, 220, 1303, 268, 2977, 1205, 198, 198, 2617, 37623, 10141, 13, 40406, 7, 198, 220, 220, 220, 1438, 11639, 79, 893, 14761, 3256, 198, 220, 220, 220, 2196, 11639, 15, 13, 16, 3256, 198, 220, 220, 220, 6764, 11639, 20519, 50, 15996, 1058, 317, 31835, 20519, 7822, 286, 311, 15996, 1912, 319, 9447, 46, 11862, 3256, 198, 220, 220, 220, 1772, 62, 12888, 2625, 1129, 1485, 830, 2414, 31, 82, 4529, 13, 77, 14396, 13, 15532, 13, 31522, 1600, 198, 220, 220, 220, 10392, 28, 17816, 79, 893, 14761, 6, 4357, 198, 220, 220, 220, 5964, 11639, 36393, 13789, 3256, 198, 220, 220, 220, 890, 62, 11213, 28, 9654, 10786, 15675, 11682, 13, 9132, 3256, 21004, 11639, 40477, 12, 23, 27691, 961, 22784, 198, 220, 220, 220, 2721, 62, 47911, 41888, 220, 1303, 198, 220, 220, 220, 220, 220, 220, 220, 705, 77, 32152, 3256, 705, 8135, 35720, 6, 198, 220, 220, 220, 16589, 198, 220, 220, 220, 19016, 11639, 5450, 1378, 12567, 13, 785, 14, 42, 292, 9620, 3699, 14, 20519, 50, 15996, 3256, 198, 8, 198 ]
2.445055
182
######## Image Object Detection Using Tensorflow-trained Classifier ######### # # Author: Evan Juras # Date: 1/15/18 # Description: # This program uses a TensorFlow-trained classifier to perform object detection. # It loads the classifier uses it to perform object detection on an image. # It draws boxes and scores around the objects of interest in the image. ## Some of the code is copied from Google's example at ## https://github.com/tensorflow/models/blob/master/research/object_detection/object_detection_tutorial.ipynb ## and some is copied from Dat Tran's example at ## https://github.com/datitran/object_detector_app/blob/master/object_detection_app.py ## but I changed it to make it more understandable to me. # Import packages import os import cv2 import numpy as np import tensorflow as tf import sys # This is needed since the notebook is stored in the object_detection folder. sys.path.append("..") # Import utilites from utils import label_map_util from utils import visualization_utils as vis_util # Name of the directory containing the object detection module we're using MODEL_NAME = 'inference_graph' IMAGE_NAME = 'test1.jpg' # Grab path to current working directory CWD_PATH = os.getcwd() # Path to frozen detection graph .pb file, which contains the model that is used # for object detection. PATH_TO_CKPT = os.path.join(CWD_PATH,MODEL_NAME,'frozen_inference_graph.pb') # Path to label map file PATH_TO_LABELS = os.path.join(CWD_PATH,'training','labelmap.pbtxt') # Path to image PATH_TO_IMAGE = os.path.join(CWD_PATH,IMAGE_NAME) # Number of classes the object detector can identify NUM_CLASSES = 6 # Load the label map. # Label maps map indices to category names, so that when our convolution # network predicts `5`, we know that this corresponds to `king`. # Here we use internal utility functions, but anything that returns a # dictionary mapping integers to appropriate string labels would be fine label_map = label_map_util.load_labelmap(PATH_TO_LABELS) categories = label_map_util.convert_label_map_to_categories(label_map, max_num_classes=NUM_CLASSES, use_display_name=True) category_index = label_map_util.create_category_index(categories) # Load the Tensorflow model into memory. detection_graph = tf.Graph() with detection_graph.as_default(): od_graph_def = tf.GraphDef() with tf.gfile.GFile(PATH_TO_CKPT, 'rb') as fid: serialized_graph = fid.read() od_graph_def.ParseFromString(serialized_graph) tf.import_graph_def(od_graph_def, name='') sess = tf.Session(graph=detection_graph) # Define input and output tensors (i.e. data) for the object detection classifier # Input tensor is the image image_tensor = detection_graph.get_tensor_by_name('image_tensor:0') # Output tensors are the detection boxes, scores, and classes # Each box represents a part of the image where a particular object was detected detection_boxes = detection_graph.get_tensor_by_name('detection_boxes:0') # Each score represents level of confidence for each of the objects. # The score is shown on the result image, together with the class label. detection_scores = detection_graph.get_tensor_by_name('detection_scores:0') detection_classes = detection_graph.get_tensor_by_name('detection_classes:0') # Number of objects detected num_detections = detection_graph.get_tensor_by_name('num_detections:0') # Load image using OpenCV and # expand image dimensions to have shape: [1, None, None, 3] # i.e. a single-column array, where each item in the column has the pixel RGB value image = cv2.imread(PATH_TO_IMAGE) image_expanded = np.expand_dims(image, axis=0) # Perform the actual detection by running the model with the image as input (boxes, scores, classes, num) = sess.run( [detection_boxes, detection_scores, detection_classes, num_detections], feed_dict={image_tensor: image_expanded}) # Draw the results of the detection (aka 'visulaize the results') vis_util.visualize_boxes_and_labels_on_image_array( image, np.squeeze(boxes), np.squeeze(classes).astype(np.int32), np.squeeze(scores), category_index, use_normalized_coordinates=True, line_thickness=8, min_score_thresh=0.60) # All the results have been drawn on image. Now display the image. cv2.imshow('Object detector', image) # Press any key to close the image cv2.waitKey(0) # Clean up cv2.destroyAllWindows()
[ 7804, 7412, 9515, 46254, 8554, 309, 22854, 11125, 12, 35311, 5016, 7483, 1303, 7804, 198, 2, 198, 2, 6434, 25, 21523, 449, 17786, 198, 2, 7536, 25, 352, 14, 1314, 14, 1507, 198, 2, 12489, 25, 220, 198, 2, 770, 1430, 3544, 257, 309, 22854, 37535, 12, 35311, 1398, 7483, 284, 1620, 2134, 13326, 13, 198, 2, 632, 15989, 262, 1398, 7483, 3544, 340, 284, 1620, 2134, 13326, 319, 281, 2939, 13, 198, 2, 632, 14293, 10559, 290, 8198, 1088, 262, 5563, 286, 1393, 287, 262, 2939, 13, 198, 198, 2235, 2773, 286, 262, 2438, 318, 18984, 422, 3012, 338, 1672, 379, 198, 2235, 3740, 1378, 12567, 13, 785, 14, 83, 22854, 11125, 14, 27530, 14, 2436, 672, 14, 9866, 14, 34033, 14, 15252, 62, 15255, 3213, 14, 15252, 62, 15255, 3213, 62, 83, 44917, 13, 541, 2047, 65, 198, 198, 2235, 290, 617, 318, 18984, 422, 16092, 833, 272, 338, 1672, 379, 198, 2235, 3740, 1378, 12567, 13, 785, 14, 19608, 270, 2596, 14, 15252, 62, 15255, 9250, 62, 1324, 14, 2436, 672, 14, 9866, 14, 15252, 62, 15255, 3213, 62, 1324, 13, 9078, 198, 198, 2235, 475, 314, 3421, 340, 284, 787, 340, 517, 21977, 284, 502, 13, 198, 198, 2, 17267, 10392, 198, 11748, 28686, 198, 11748, 269, 85, 17, 198, 11748, 299, 32152, 355, 45941, 198, 11748, 11192, 273, 11125, 355, 48700, 198, 11748, 25064, 198, 198, 2, 770, 318, 2622, 1201, 262, 20922, 318, 8574, 287, 262, 2134, 62, 15255, 3213, 9483, 13, 198, 17597, 13, 6978, 13, 33295, 7203, 492, 4943, 198, 198, 2, 17267, 7736, 2737, 198, 6738, 3384, 4487, 1330, 6167, 62, 8899, 62, 22602, 198, 6738, 3384, 4487, 1330, 32704, 62, 26791, 355, 1490, 62, 22602, 198, 198, 2, 6530, 286, 262, 8619, 7268, 262, 2134, 13326, 8265, 356, 821, 1262, 198, 33365, 3698, 62, 20608, 796, 705, 259, 4288, 62, 34960, 6, 198, 3955, 11879, 62, 20608, 796, 705, 9288, 16, 13, 9479, 6, 198, 198, 2, 25339, 3108, 284, 1459, 1762, 8619, 198, 34, 22332, 62, 34219, 796, 28686, 13, 1136, 66, 16993, 3419, 198, 198, 2, 10644, 284, 12912, 13326, 4823, 764, 40842, 2393, 11, 543, 4909, 262, 2746, 326, 318, 973, 198, 2, 329, 2134, 13326, 13, 198, 34219, 62, 10468, 62, 34, 42, 11571, 796, 28686, 13, 6978, 13, 22179, 7, 34, 22332, 62, 34219, 11, 33365, 3698, 62, 20608, 4032, 69, 42005, 62, 259, 4288, 62, 34960, 13, 40842, 11537, 198, 198, 2, 10644, 284, 6167, 3975, 2393, 198, 34219, 62, 10468, 62, 48780, 37142, 796, 28686, 13, 6978, 13, 22179, 7, 34, 22332, 62, 34219, 4032, 34409, 41707, 18242, 8899, 13, 40842, 14116, 11537, 198, 198, 2, 10644, 284, 2939, 198, 34219, 62, 10468, 62, 3955, 11879, 796, 28686, 13, 6978, 13, 22179, 7, 34, 22332, 62, 34219, 11, 3955, 11879, 62, 20608, 8, 198, 198, 2, 7913, 286, 6097, 262, 2134, 31029, 460, 5911, 198, 41359, 62, 31631, 1546, 796, 718, 198, 198, 2, 8778, 262, 6167, 3975, 13, 198, 2, 36052, 8739, 3975, 36525, 284, 6536, 3891, 11, 523, 326, 618, 674, 3063, 2122, 198, 2, 3127, 26334, 4600, 20, 47671, 356, 760, 326, 428, 24866, 284, 4600, 3364, 44646, 198, 2, 3423, 356, 779, 5387, 10361, 5499, 11, 475, 1997, 326, 5860, 257, 198, 2, 22155, 16855, 37014, 284, 5035, 4731, 14722, 561, 307, 3734, 198, 18242, 62, 8899, 796, 6167, 62, 8899, 62, 22602, 13, 2220, 62, 18242, 8899, 7, 34219, 62, 10468, 62, 48780, 37142, 8, 198, 66, 26129, 796, 6167, 62, 8899, 62, 22602, 13, 1102, 1851, 62, 18242, 62, 8899, 62, 1462, 62, 66, 26129, 7, 18242, 62, 8899, 11, 3509, 62, 22510, 62, 37724, 28, 41359, 62, 31631, 1546, 11, 779, 62, 13812, 62, 3672, 28, 17821, 8, 198, 22872, 62, 9630, 796, 6167, 62, 8899, 62, 22602, 13, 17953, 62, 22872, 62, 9630, 7, 66, 26129, 8, 198, 198, 2, 8778, 262, 309, 22854, 11125, 2746, 656, 4088, 13, 198, 15255, 3213, 62, 34960, 796, 48700, 13, 37065, 3419, 198, 4480, 13326, 62, 34960, 13, 292, 62, 12286, 33529, 198, 220, 220, 220, 16298, 62, 34960, 62, 4299, 796, 48700, 13, 37065, 7469, 3419, 198, 220, 220, 220, 351, 48700, 13, 70, 7753, 13, 38, 8979, 7, 34219, 62, 10468, 62, 34, 42, 11571, 11, 705, 26145, 11537, 355, 49909, 25, 198, 220, 220, 220, 220, 220, 220, 220, 11389, 1143, 62, 34960, 796, 49909, 13, 961, 3419, 198, 220, 220, 220, 220, 220, 220, 220, 16298, 62, 34960, 62, 4299, 13, 10044, 325, 4863, 10100, 7, 46911, 1143, 62, 34960, 8, 198, 220, 220, 220, 220, 220, 220, 220, 48700, 13, 11748, 62, 34960, 62, 4299, 7, 375, 62, 34960, 62, 4299, 11, 1438, 28, 7061, 8, 628, 220, 220, 220, 264, 408, 796, 48700, 13, 36044, 7, 34960, 28, 15255, 3213, 62, 34960, 8, 198, 198, 2, 2896, 500, 5128, 290, 5072, 11192, 669, 357, 72, 13, 68, 13, 1366, 8, 329, 262, 2134, 13326, 1398, 7483, 198, 198, 2, 23412, 11192, 273, 318, 262, 2939, 198, 9060, 62, 83, 22854, 796, 13326, 62, 34960, 13, 1136, 62, 83, 22854, 62, 1525, 62, 3672, 10786, 9060, 62, 83, 22854, 25, 15, 11537, 198, 198, 2, 25235, 11192, 669, 389, 262, 13326, 10559, 11, 8198, 11, 290, 6097, 198, 2, 5501, 3091, 6870, 257, 636, 286, 262, 2939, 810, 257, 1948, 2134, 373, 12326, 198, 15255, 3213, 62, 29305, 796, 13326, 62, 34960, 13, 1136, 62, 83, 22854, 62, 1525, 62, 3672, 10786, 15255, 3213, 62, 29305, 25, 15, 11537, 198, 198, 2, 5501, 4776, 6870, 1241, 286, 6628, 329, 1123, 286, 262, 5563, 13, 198, 2, 383, 4776, 318, 3402, 319, 262, 1255, 2939, 11, 1978, 351, 262, 1398, 6167, 13, 198, 15255, 3213, 62, 1416, 2850, 796, 13326, 62, 34960, 13, 1136, 62, 83, 22854, 62, 1525, 62, 3672, 10786, 15255, 3213, 62, 1416, 2850, 25, 15, 11537, 198, 15255, 3213, 62, 37724, 796, 13326, 62, 34960, 13, 1136, 62, 83, 22854, 62, 1525, 62, 3672, 10786, 15255, 3213, 62, 37724, 25, 15, 11537, 198, 198, 2, 7913, 286, 5563, 12326, 198, 22510, 62, 15255, 478, 507, 796, 13326, 62, 34960, 13, 1136, 62, 83, 22854, 62, 1525, 62, 3672, 10786, 22510, 62, 15255, 478, 507, 25, 15, 11537, 198, 198, 2, 8778, 2939, 1262, 4946, 33538, 290, 198, 2, 4292, 2939, 15225, 284, 423, 5485, 25, 685, 16, 11, 6045, 11, 6045, 11, 513, 60, 198, 2, 1312, 13, 68, 13, 257, 2060, 12, 28665, 7177, 11, 810, 1123, 2378, 287, 262, 5721, 468, 262, 17465, 25228, 1988, 198, 9060, 796, 269, 85, 17, 13, 320, 961, 7, 34219, 62, 10468, 62, 3955, 11879, 8, 198, 9060, 62, 11201, 12249, 796, 45941, 13, 11201, 392, 62, 67, 12078, 7, 9060, 11, 16488, 28, 15, 8, 198, 198, 2, 35006, 262, 4036, 13326, 416, 2491, 262, 2746, 351, 262, 2939, 355, 5128, 198, 7, 29305, 11, 8198, 11, 6097, 11, 997, 8, 796, 264, 408, 13, 5143, 7, 198, 220, 220, 220, 685, 15255, 3213, 62, 29305, 11, 13326, 62, 1416, 2850, 11, 13326, 62, 37724, 11, 997, 62, 15255, 478, 507, 4357, 198, 220, 220, 220, 3745, 62, 11600, 34758, 9060, 62, 83, 22854, 25, 2939, 62, 11201, 12249, 30072, 198, 198, 2, 15315, 262, 2482, 286, 262, 13326, 357, 8130, 705, 4703, 4712, 1096, 262, 2482, 11537, 198, 198, 4703, 62, 22602, 13, 41464, 1096, 62, 29305, 62, 392, 62, 23912, 1424, 62, 261, 62, 9060, 62, 18747, 7, 198, 220, 220, 220, 2939, 11, 198, 220, 220, 220, 45941, 13, 16485, 1453, 2736, 7, 29305, 828, 198, 220, 220, 220, 45941, 13, 16485, 1453, 2736, 7, 37724, 737, 459, 2981, 7, 37659, 13, 600, 2624, 828, 198, 220, 220, 220, 45941, 13, 16485, 1453, 2736, 7, 1416, 2850, 828, 198, 220, 220, 220, 6536, 62, 9630, 11, 198, 220, 220, 220, 779, 62, 11265, 1143, 62, 37652, 17540, 28, 17821, 11, 198, 220, 220, 220, 1627, 62, 400, 624, 1108, 28, 23, 11, 198, 220, 220, 220, 949, 62, 26675, 62, 400, 3447, 28, 15, 13, 1899, 8, 198, 198, 2, 1439, 262, 2482, 423, 587, 7428, 319, 2939, 13, 2735, 3359, 262, 2939, 13, 198, 33967, 17, 13, 320, 12860, 10786, 10267, 31029, 3256, 2939, 8, 198, 198, 2, 4332, 597, 1994, 284, 1969, 262, 2939, 198, 33967, 17, 13, 17077, 9218, 7, 15, 8, 198, 198, 2, 5985, 510, 198, 33967, 17, 13, 41659, 3237, 11209, 3419, 198 ]
3.122769
1,401
from data_collection.management.commands import BaseXpressDemocracyClubCsvImporter
[ 6738, 1366, 62, 43681, 13, 27604, 13, 9503, 1746, 1330, 7308, 55, 8439, 11522, 17818, 42350, 34, 21370, 3546, 26634, 198 ]
3.952381
21
from django.db.models import Q from django.shortcuts import render from django.http import Http404 # Create your views here. from rest_framework.views import APIView from rest_framework.response import Response from rest_framework.decorators import api_view from .models import Product, Category from .serializers import ProductSerializer, CategorySerializer
[ 6738, 42625, 14208, 13, 9945, 13, 27530, 1330, 1195, 198, 198, 6738, 42625, 14208, 13, 19509, 23779, 1330, 8543, 198, 6738, 42625, 14208, 13, 4023, 1330, 367, 29281, 26429, 198, 198, 2, 13610, 534, 5009, 994, 13, 198, 6738, 1334, 62, 30604, 13, 33571, 1330, 3486, 3824, 769, 198, 6738, 1334, 62, 30604, 13, 26209, 1330, 18261, 198, 6738, 1334, 62, 30604, 13, 12501, 273, 2024, 1330, 40391, 62, 1177, 198, 198, 6738, 764, 27530, 1330, 8721, 11, 21743, 198, 6738, 764, 46911, 11341, 1330, 8721, 32634, 7509, 11, 21743, 32634, 7509 ]
3.923913
92
from sys import maxsize
[ 6738, 25064, 1330, 3509, 7857, 628, 198 ]
3.714286
7
########################################################################## # # Copyright (c) 2010-2012, Image Engine Design Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # * Neither the name of Image Engine Design nor the names of any # other contributors to this software may be used to endorse or # promote products derived from this software without specific prior # written permission. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS # IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, # THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR # PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # ########################################################################## from __future__ import with_statement import os import sys import shutil import unittest import IECore if __name__ == "__main__": unittest.main()
[ 29113, 29113, 7804, 2235, 198, 2, 198, 2, 220, 15069, 357, 66, 8, 3050, 12, 6999, 11, 7412, 7117, 8495, 3457, 13, 1439, 2489, 10395, 13, 198, 2, 198, 2, 220, 2297, 396, 3890, 290, 779, 287, 2723, 290, 13934, 5107, 11, 351, 393, 1231, 198, 2, 220, 17613, 11, 389, 10431, 2810, 326, 262, 1708, 3403, 389, 198, 2, 220, 1138, 25, 198, 2, 198, 2, 220, 220, 220, 220, 1635, 2297, 396, 2455, 507, 286, 2723, 2438, 1276, 12377, 262, 2029, 6634, 198, 2, 220, 220, 220, 220, 220, 220, 4003, 11, 428, 1351, 286, 3403, 290, 262, 1708, 37592, 13, 198, 2, 198, 2, 220, 220, 220, 220, 1635, 2297, 396, 2455, 507, 287, 13934, 1296, 1276, 22919, 262, 2029, 6634, 198, 2, 220, 220, 220, 220, 220, 220, 4003, 11, 428, 1351, 286, 3403, 290, 262, 1708, 37592, 287, 262, 198, 2, 220, 220, 220, 220, 220, 220, 10314, 290, 14, 273, 584, 5696, 2810, 351, 262, 6082, 13, 198, 2, 198, 2, 220, 220, 220, 220, 1635, 16126, 262, 1438, 286, 7412, 7117, 8495, 4249, 262, 3891, 286, 597, 198, 2, 220, 220, 220, 220, 220, 220, 584, 20420, 284, 428, 3788, 743, 307, 973, 284, 11438, 393, 198, 2, 220, 220, 220, 220, 220, 220, 7719, 3186, 10944, 422, 428, 3788, 1231, 2176, 3161, 198, 2, 220, 220, 220, 220, 220, 220, 3194, 7170, 13, 198, 2, 198, 2, 220, 12680, 47466, 3180, 36592, 2389, 1961, 11050, 3336, 27975, 38162, 9947, 367, 15173, 4877, 5357, 27342, 9865, 3843, 20673, 366, 1921, 198, 2, 220, 3180, 1, 5357, 15529, 7788, 32761, 6375, 8959, 49094, 34764, 11015, 11, 47783, 2751, 11, 21728, 5626, 40880, 5390, 11, 198, 2, 220, 3336, 8959, 49094, 34764, 11015, 3963, 34482, 3398, 1565, 5603, 25382, 5357, 376, 46144, 7473, 317, 16652, 2149, 37232, 198, 2, 220, 33079, 48933, 15986, 13954, 48778, 1961, 13, 3268, 8005, 49261, 50163, 3336, 27975, 38162, 9947, 47210, 21479, 6375, 198, 2, 220, 27342, 9865, 3843, 20673, 9348, 43031, 19146, 7473, 15529, 42242, 11, 3268, 17931, 23988, 11, 19387, 25256, 1847, 11, 38846, 11, 198, 2, 220, 7788, 3620, 6489, 13153, 11, 6375, 7102, 5188, 10917, 3525, 12576, 29506, 25552, 357, 1268, 39149, 2751, 11, 21728, 5626, 40880, 5390, 11, 198, 2, 220, 41755, 11335, 10979, 3963, 28932, 2257, 2043, 37780, 21090, 50, 6375, 49254, 26, 406, 18420, 3963, 23210, 11, 42865, 11, 6375, 198, 2, 220, 4810, 19238, 29722, 26, 6375, 43949, 44180, 23255, 49, 8577, 24131, 8, 29630, 36, 5959, 7257, 2937, 1961, 5357, 6177, 15529, 3336, 15513, 3963, 198, 2, 220, 43031, 25382, 11, 7655, 2767, 16879, 3268, 27342, 10659, 11, 19269, 18379, 43031, 25382, 11, 6375, 309, 9863, 357, 1268, 39149, 2751, 198, 2, 220, 399, 7156, 43, 3528, 18310, 6375, 25401, 54, 24352, 8, 5923, 1797, 2751, 3268, 15529, 34882, 16289, 3963, 3336, 23210, 3963, 12680, 198, 2, 220, 47466, 11, 45886, 16876, 5984, 29817, 1961, 3963, 3336, 28069, 11584, 25382, 3963, 13558, 3398, 29506, 11879, 13, 198, 2, 198, 29113, 29113, 7804, 2235, 198, 198, 6738, 11593, 37443, 834, 1330, 351, 62, 26090, 198, 198, 11748, 28686, 198, 11748, 25064, 198, 11748, 4423, 346, 198, 11748, 555, 715, 395, 198, 11748, 314, 2943, 382, 198, 198, 361, 11593, 3672, 834, 6624, 366, 834, 12417, 834, 1298, 198, 197, 403, 715, 395, 13, 12417, 3419, 198 ]
3.498195
554
"""Pacman game domain.""" from rlpy.Tools import __rlpy_location__ from .Domain import Domain from .PacmanPackage import layout, pacman, game, ghostAgents from .PacmanPackage import graphicsDisplay import numpy as np from copy import deepcopy import os import time __copyright__ = "Copyright 2013, RLPy http://acl.mit.edu/RLPy" __credits__ = ["Alborz Geramifard", "Robert H. Klein", "Christoph Dann", "William Dabney", "Jonathan P. How"] __license__ = "BSD 3-Clause" __author__ = "Austin Hays"
[ 37811, 18844, 805, 983, 7386, 526, 15931, 198, 6738, 374, 75, 9078, 13, 33637, 1330, 11593, 45895, 9078, 62, 24886, 834, 198, 6738, 764, 43961, 1330, 20021, 198, 6738, 764, 18844, 805, 27813, 1330, 12461, 11, 23503, 805, 11, 983, 11, 10905, 10262, 658, 198, 6738, 764, 18844, 805, 27813, 1330, 9382, 23114, 198, 11748, 299, 32152, 355, 45941, 198, 6738, 4866, 1330, 2769, 30073, 198, 11748, 28686, 198, 11748, 640, 198, 198, 834, 22163, 4766, 834, 796, 366, 15269, 2211, 11, 371, 19930, 88, 2638, 1378, 37779, 13, 2781, 13, 15532, 14, 7836, 20519, 1, 198, 834, 66, 20696, 834, 796, 14631, 2348, 2865, 89, 13573, 321, 361, 446, 1600, 366, 19156, 367, 13, 22864, 1600, 366, 10684, 2522, 360, 1236, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 17121, 360, 397, 1681, 1600, 366, 30365, 350, 13, 1374, 8973, 198, 834, 43085, 834, 796, 366, 21800, 513, 12, 2601, 682, 1, 198, 834, 9800, 834, 796, 366, 40245, 367, 592, 1, 628, 198 ]
2.942529
174
from zeit.cms.i18n import MessageFactory as _ import zope.interface import zope.schema
[ 6738, 41271, 270, 13, 46406, 13, 72, 1507, 77, 1330, 16000, 22810, 355, 4808, 198, 11748, 1976, 3008, 13, 39994, 198, 11748, 1976, 3008, 13, 15952, 2611, 628 ]
3.142857
28
N, M = map(int, input().split()) for i in range(1, M + 1): if i % 2 == 1: j = (i - 1) // 2 print(1 + j, M + 1 - j) else: j = (i - 2) // 2 print(M + 2 + j, 2 * M + 1 - j)
[ 45, 11, 337, 796, 3975, 7, 600, 11, 5128, 22446, 35312, 28955, 198, 198, 1640, 1312, 287, 2837, 7, 16, 11, 337, 1343, 352, 2599, 198, 220, 220, 220, 611, 1312, 4064, 362, 6624, 352, 25, 198, 220, 220, 220, 220, 220, 220, 220, 474, 796, 357, 72, 532, 352, 8, 3373, 362, 198, 220, 220, 220, 220, 220, 220, 220, 3601, 7, 16, 1343, 474, 11, 337, 1343, 352, 532, 474, 8, 198, 220, 220, 220, 2073, 25, 198, 220, 220, 220, 220, 220, 220, 220, 474, 796, 357, 72, 532, 362, 8, 3373, 362, 198, 220, 220, 220, 220, 220, 220, 220, 3601, 7, 44, 1343, 362, 1343, 474, 11, 362, 1635, 337, 1343, 352, 532, 474, 8, 198 ]
1.743802
121
#!/usr/bin/env python # -*- coding: utf-8 -*- # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. import re import sys from setuptools import setup from setuptools.command.test import test as TestCommand __version__ = '' with open('facebookbot/__about__.py', 'r') as fd: reg = re.compile(r'__version__ = [\'"]([^\'"]*)[\'"]') for line in fd: m = reg.match(line) if m: __version__ = m.group(1) break with open('README.rst', 'r') as fd: long_description = fd.read() setup( name="fbsdk", version=__version__, author="Sam Chang", author_email="t0915290092@gmail.com", maintainer="Sam Chang", maintainer_email="t0915290092@gmail.com", url="https://github.com/boompieman/fbsdk", description="Facebook Messaging API SDK for Python", long_description=long_description, license='Apache License 2.0', packages=[ "facebookbot", "facebookbot.models" ], install_requires=_requirements(), classifiers=[ "Development Status :: 5 - Production/Stable", "License :: OSI Approved :: Apache Software License", "Intended Audience :: Developers", "Programming Language :: Python :: 3", "Topic :: Software Development" ] )
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 198, 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 2, 220, 49962, 739, 262, 24843, 13789, 11, 10628, 362, 13, 15, 357, 1169, 366, 34156, 15341, 345, 743, 198, 2, 220, 407, 779, 428, 2393, 2845, 287, 11846, 351, 262, 13789, 13, 921, 743, 7330, 198, 2, 220, 257, 4866, 286, 262, 13789, 379, 198, 2, 198, 2, 220, 220, 220, 220, 220, 220, 2638, 1378, 2503, 13, 43073, 13, 2398, 14, 677, 4541, 14, 43, 2149, 24290, 12, 17, 13, 15, 198, 2, 198, 2, 220, 17486, 2672, 416, 9723, 1099, 393, 4987, 284, 287, 3597, 11, 3788, 198, 2, 220, 9387, 739, 262, 13789, 318, 9387, 319, 281, 366, 1921, 3180, 1, 29809, 1797, 11, 42881, 198, 2, 220, 34764, 11015, 6375, 7102, 49828, 11053, 3963, 15529, 509, 12115, 11, 2035, 4911, 393, 17142, 13, 4091, 262, 198, 2, 220, 13789, 329, 262, 2176, 3303, 15030, 21627, 290, 11247, 198, 2, 220, 739, 262, 13789, 13, 628, 198, 11748, 302, 198, 11748, 25064, 198, 198, 6738, 900, 37623, 10141, 1330, 9058, 198, 6738, 900, 37623, 10141, 13, 21812, 13, 9288, 1330, 1332, 355, 6208, 21575, 198, 198, 834, 9641, 834, 796, 10148, 198, 4480, 1280, 10786, 19024, 13645, 14, 834, 10755, 834, 13, 9078, 3256, 705, 81, 11537, 355, 277, 67, 25, 198, 220, 220, 220, 842, 796, 302, 13, 5589, 576, 7, 81, 6, 834, 9641, 834, 796, 685, 43054, 8973, 26933, 61, 43054, 8973, 28104, 58, 43054, 8973, 11537, 198, 220, 220, 220, 329, 1627, 287, 277, 67, 25, 198, 220, 220, 220, 220, 220, 220, 220, 285, 796, 842, 13, 15699, 7, 1370, 8, 198, 220, 220, 220, 220, 220, 220, 220, 611, 285, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 11593, 9641, 834, 796, 285, 13, 8094, 7, 16, 8, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2270, 628, 198, 198, 4480, 1280, 10786, 15675, 11682, 13, 81, 301, 3256, 705, 81, 11537, 355, 277, 67, 25, 198, 220, 220, 220, 890, 62, 11213, 796, 277, 67, 13, 961, 3419, 198, 198, 40406, 7, 198, 220, 220, 220, 1438, 2625, 69, 1443, 34388, 1600, 198, 220, 220, 220, 2196, 28, 834, 9641, 834, 11, 198, 220, 220, 220, 1772, 2625, 16305, 22597, 1600, 198, 220, 220, 220, 1772, 62, 12888, 2625, 83, 2931, 1314, 1959, 405, 5892, 31, 14816, 13, 785, 1600, 198, 220, 220, 220, 5529, 263, 2625, 16305, 22597, 1600, 198, 220, 220, 220, 5529, 263, 62, 12888, 2625, 83, 2931, 1314, 1959, 405, 5892, 31, 14816, 13, 785, 1600, 198, 220, 220, 220, 19016, 2625, 5450, 1378, 12567, 13, 785, 14, 2127, 3361, 72, 8463, 14, 69, 1443, 34388, 1600, 198, 220, 220, 220, 6764, 2625, 12025, 10626, 3039, 7824, 26144, 329, 11361, 1600, 198, 220, 220, 220, 890, 62, 11213, 28, 6511, 62, 11213, 11, 198, 220, 220, 220, 5964, 11639, 25189, 4891, 13789, 362, 13, 15, 3256, 198, 220, 220, 220, 10392, 41888, 198, 220, 220, 220, 220, 220, 220, 220, 366, 19024, 13645, 1600, 366, 19024, 13645, 13, 27530, 1, 198, 220, 220, 220, 16589, 198, 220, 220, 220, 2721, 62, 47911, 28, 62, 8897, 18883, 22784, 198, 220, 220, 220, 1398, 13350, 41888, 198, 220, 220, 220, 220, 220, 220, 220, 366, 41206, 12678, 7904, 642, 532, 19174, 14, 1273, 540, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 366, 34156, 7904, 7294, 40, 20010, 1079, 7904, 24843, 10442, 13789, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 366, 5317, 1631, 7591, 1240, 7904, 34152, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 366, 15167, 2229, 15417, 7904, 11361, 7904, 513, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 366, 33221, 7904, 10442, 7712, 1, 198, 220, 220, 220, 2361, 198, 8, 198 ]
2.744186
645
# coding=utf-8 # Copyright (c) Facebook, Inc. and its affiliates. # Copyright (c) HuggingFace Inc. team. # # 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. """PyTorch MMBT model. """ import torch from torch import nn from torch.nn import CrossEntropyLoss, MSELoss from ...file_utils import add_start_docstrings, add_start_docstrings_to_model_forward, replace_return_docstrings from ...modeling_outputs import BaseModelOutputWithPooling, SequenceClassifierOutput from ...modeling_utils import ModuleUtilsMixin from ...utils import logging logger = logging.get_logger(__name__) _CONFIG_FOR_DOC = "MMBTConfig" MMBT_START_DOCSTRING = r""" MMBT model was proposed in [Supervised Multimodal Bitransformers for Classifying Images and Text](https://github.com/facebookresearch/mmbt) by Douwe Kiela, Suvrat Bhooshan, Hamed Firooz, Davide Testuggine. It's a supervised multimodal bitransformer model that fuses information from text and other image encoders, and obtain state-of-the-art performance on various multimodal classification benchmark tasks. This model inherits from [`PreTrainedModel`]. Check the superclass documentation for the generic methods the library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads etc.) This model is also a PyTorch [torch.nn.Module](https://pytorch.org/docs/stable/nn.html#torch.nn.Module) subclass. Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and behavior. Parameters: config ([`MMBTConfig`]): Model configuration class with all the parameters of the model. Initializing with a config file does not load the weights associated with the model, only the configuration. transformer (:class: *~nn.Module*): A text transformer that is used by MMBT. It should have embeddings, encoder, and pooler attributes. encoder (:class: *~nn.Module*): Encoder for the second modality. It should take in a batch of modal inputs and return k, n dimension embeddings. """ MMBT_INPUTS_DOCSTRING = r""" Args: input_modal (`torch.FloatTensor` of shape `(batch_size, ***)`): The other modality data. It will be the shape that the encoder for that type expects. e.g. With an Image Encoder, the shape would be (batch_size, channels, height, width) input_ids (`torch.LongTensor` of shape `(batch_size, sequence_length)`): Indices of input sequence tokens in the vocabulary. It does not expect [CLS] token to be added as it's appended to the end of other modality embeddings. Indices can be obtained using [`BertTokenizer`]. See [`PreTrainedTokenizer.encode`] and [`PreTrainedTokenizer.__call__`] for details. [What are input IDs?](../glossary#input-ids) modal_start_tokens (`torch.LongTensor` of shape `(batch_size,)`, *optional*): Optional start token to be added to Other Modality Embedding. [CLS] Most commonly used for classification tasks. modal_end_tokens (`torch.LongTensor` of shape `(batch_size,)`, *optional*): Optional end token to be added to Other Modality Embedding. [SEP] Most commonly used. attention_mask (*optional*) `torch.FloatTensor` of shape `(batch_size, sequence_length)`: Mask to avoid performing attention on padding token indices. Mask values selected in `[0, 1]`: - 1 for tokens that are **not masked**, - 0 for tokens that are **masked**. [What are attention masks?](../glossary#attention-mask) token_type_ids (*optional*) `torch.LongTensor` of shape `(batch_size, sequence_length)`: Segment token indices to indicate first and second portions of the inputs. Indices are selected in `[0, 1]`: - 0 corresponds to a *sentence A* token, - 1 corresponds to a *sentence B* token. [What are token type IDs?](../glossary#token-type-ids) modal_token_type_ids (*optional*) `torch.LongTensor` of shape `(batch_size, modal_sequence_length)`: Segment token indices to indicate different portions of the non-text modality. The embeddings from these tokens will be summed with the respective token embeddings for the non-text modality. position_ids (`torch.LongTensor` of shape `(batch_size, sequence_length)`, *optional*): Indices of positions of each input sequence tokens in the position embeddings. Selected in the range `[0, config.max_position_embeddings - 1]`. [What are position IDs?](../glossary#position-ids) modal_position_ids (`torch.LongTensor` of shape `(batch_size, modal_sequence_length)`, *optional*): Indices of positions of each input sequence tokens in the position embeddings for the non-text modality. Selected in the range `[0, config.max_position_embeddings - 1]`. [What are position IDs?](../glossary#position-ids) head_mask (`torch.FloatTensor` of shape `(num_heads,)` or `(num_layers, num_heads)`, *optional*): Mask to nullify selected heads of the self-attention modules. Mask values selected in `[0, 1]`: - 1 indicates the head is **not masked**, - 0 indicates the head is **masked**. inputs_embeds (`torch.FloatTensor` of shape `(batch_size, sequence_length, embedding_dim)`, *optional*): Optionally, instead of passing `input_ids` you can choose to directly pass an embedded representation. This is useful if you want more control over how to convert `input_ids` indices into associated vectors than the model's internal embedding lookup matrix. encoder_hidden_states (`torch.FloatTensor` of shape `(batch_size, sequence_length, hidden_size)`, *optional*): Sequence of hidden-states at the output of the last layer of the encoder. Used in the cross-attention if the model is configured as a decoder. encoder_attention_mask (`torch.FloatTensor` of shape `(batch_size, sequence_length)`, *optional*): Mask to avoid performing attention on the padding token indices of the encoder input. This mask is used in the cross-attention if the model is configured as a decoder. Mask values selected in `[0, 1]`: - 1 for tokens that are **not masked**, - 0 for tokens that are **masked**. output_attentions (`bool`, *optional*): Whether or not to return the attentions tensors of all attention layers. See `attentions` under returned tensors for more detail. output_hidden_states (`bool`, *optional*): Whether or not to return the hidden states of all layers. See `hidden_states` under returned tensors for more detail. return_dict (`bool`, *optional*): Whether or not to return a [`~file_utils.ModelOutput`] instead of a plain tuple. """
[ 2, 19617, 28, 40477, 12, 23, 198, 2, 15069, 357, 66, 8, 3203, 11, 3457, 13, 290, 663, 29116, 13, 198, 2, 15069, 357, 66, 8, 12905, 2667, 32388, 3457, 13, 1074, 13, 198, 2, 198, 2, 49962, 739, 262, 24843, 13789, 11, 10628, 362, 13, 15, 357, 1169, 366, 34156, 15341, 198, 2, 345, 743, 407, 779, 428, 2393, 2845, 287, 11846, 351, 262, 13789, 13, 198, 2, 921, 743, 7330, 257, 4866, 286, 262, 13789, 379, 198, 2, 198, 2, 220, 220, 220, 220, 2638, 1378, 2503, 13, 43073, 13, 2398, 14, 677, 4541, 14, 43, 2149, 24290, 12, 17, 13, 15, 198, 2, 198, 2, 17486, 2672, 416, 9723, 1099, 393, 4987, 284, 287, 3597, 11, 3788, 198, 2, 9387, 739, 262, 13789, 318, 9387, 319, 281, 366, 1921, 3180, 1, 29809, 1797, 11, 198, 2, 42881, 34764, 11015, 6375, 7102, 49828, 11053, 3963, 15529, 509, 12115, 11, 2035, 4911, 393, 17142, 13, 198, 2, 4091, 262, 13789, 329, 262, 2176, 3303, 15030, 21627, 290, 198, 2, 11247, 739, 262, 13789, 13, 198, 37811, 20519, 15884, 354, 337, 10744, 51, 2746, 13, 37227, 628, 198, 11748, 28034, 198, 6738, 28034, 1330, 299, 77, 198, 6738, 28034, 13, 20471, 1330, 6372, 14539, 28338, 43, 793, 11, 6579, 3698, 793, 198, 198, 6738, 2644, 7753, 62, 26791, 1330, 751, 62, 9688, 62, 15390, 37336, 11, 751, 62, 9688, 62, 15390, 37336, 62, 1462, 62, 19849, 62, 11813, 11, 6330, 62, 7783, 62, 15390, 37336, 198, 6738, 2644, 4666, 10809, 62, 22915, 82, 1330, 7308, 17633, 26410, 3152, 27201, 278, 11, 45835, 9487, 7483, 26410, 198, 6738, 2644, 4666, 10809, 62, 26791, 1330, 19937, 18274, 4487, 35608, 259, 198, 6738, 2644, 26791, 1330, 18931, 628, 198, 6404, 1362, 796, 18931, 13, 1136, 62, 6404, 1362, 7, 834, 3672, 834, 8, 198, 198, 62, 10943, 16254, 62, 13775, 62, 38715, 796, 366, 44, 10744, 51, 16934, 1, 628, 198, 198, 44, 10744, 51, 62, 2257, 7227, 62, 38715, 18601, 2751, 796, 374, 37811, 198, 220, 220, 220, 337, 10744, 51, 2746, 373, 5150, 287, 685, 12442, 16149, 7854, 320, 375, 282, 4722, 26084, 687, 364, 329, 5016, 4035, 5382, 290, 8255, 16151, 5450, 1378, 12567, 13, 785, 14, 19024, 34033, 14, 76, 2022, 83, 8, 416, 5728, 732, 509, 8207, 64, 11, 1778, 85, 10366, 347, 8873, 3768, 272, 11, 367, 2434, 376, 7058, 8590, 11, 2544, 485, 6208, 6837, 500, 13, 198, 220, 220, 220, 632, 338, 257, 28679, 43104, 375, 282, 1643, 26084, 16354, 2746, 326, 277, 2664, 1321, 422, 2420, 290, 584, 2939, 2207, 375, 364, 11, 290, 198, 220, 220, 220, 7330, 1181, 12, 1659, 12, 1169, 12, 433, 2854, 319, 2972, 43104, 375, 282, 17923, 18335, 8861, 13, 628, 220, 220, 220, 770, 2746, 10639, 896, 422, 685, 63, 6719, 2898, 1328, 17633, 63, 4083, 6822, 262, 2208, 4871, 10314, 329, 262, 14276, 198, 220, 220, 220, 5050, 262, 5888, 23986, 329, 477, 663, 2746, 357, 10508, 355, 22023, 393, 8914, 11, 581, 2890, 262, 5128, 11525, 67, 654, 11, 198, 220, 220, 220, 778, 46493, 6665, 3503, 2014, 628, 220, 220, 220, 770, 2746, 318, 635, 257, 9485, 15884, 354, 685, 13165, 354, 13, 20471, 13, 26796, 16151, 5450, 1378, 9078, 13165, 354, 13, 2398, 14, 31628, 14, 31284, 14, 20471, 13, 6494, 2, 13165, 354, 13, 20471, 13, 26796, 8, 198, 220, 220, 220, 47611, 13, 5765, 340, 355, 257, 3218, 9485, 15884, 354, 19937, 290, 3522, 284, 262, 9485, 15884, 354, 10314, 329, 477, 2300, 3519, 284, 198, 220, 220, 220, 2276, 8748, 290, 4069, 13, 628, 220, 220, 220, 40117, 25, 198, 220, 220, 220, 220, 220, 220, 220, 4566, 29565, 63, 44, 10744, 51, 16934, 63, 60, 2599, 9104, 8398, 1398, 351, 477, 262, 10007, 286, 262, 2746, 13, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 20768, 2890, 351, 257, 4566, 2393, 857, 407, 3440, 262, 19590, 3917, 351, 262, 2746, 11, 691, 262, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 8398, 13, 198, 220, 220, 220, 220, 220, 220, 220, 47385, 357, 25, 4871, 25, 1635, 93, 20471, 13, 26796, 9, 2599, 317, 2420, 47385, 326, 318, 973, 416, 337, 10744, 51, 13, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 632, 815, 423, 11525, 67, 654, 11, 2207, 12342, 11, 290, 5933, 263, 12608, 13, 198, 220, 220, 220, 220, 220, 220, 220, 2207, 12342, 357, 25, 4871, 25, 1635, 93, 20471, 13, 26796, 9, 2599, 14711, 12342, 329, 262, 1218, 953, 1483, 13, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 632, 815, 1011, 287, 257, 15458, 286, 953, 282, 17311, 290, 1441, 479, 11, 299, 15793, 11525, 67, 654, 13, 198, 37811, 198, 198, 44, 10744, 51, 62, 1268, 30076, 50, 62, 38715, 18601, 2751, 796, 374, 37811, 198, 220, 220, 220, 943, 14542, 25, 198, 220, 220, 220, 220, 220, 220, 220, 5128, 62, 4666, 282, 357, 63, 13165, 354, 13, 43879, 51, 22854, 63, 286, 5485, 4600, 7, 43501, 62, 7857, 11, 17202, 8, 63, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 383, 584, 953, 1483, 1366, 13, 632, 481, 307, 262, 5485, 326, 262, 2207, 12342, 329, 326, 2099, 13423, 13, 304, 13, 70, 13, 2080, 281, 7412, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 14711, 12342, 11, 262, 5485, 561, 307, 357, 43501, 62, 7857, 11, 9619, 11, 6001, 11, 9647, 8, 198, 220, 220, 220, 220, 220, 220, 220, 5128, 62, 2340, 357, 63, 13165, 354, 13, 14617, 51, 22854, 63, 286, 5485, 4600, 7, 43501, 62, 7857, 11, 8379, 62, 13664, 8, 63, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1423, 1063, 286, 5128, 8379, 16326, 287, 262, 25818, 13, 632, 857, 407, 1607, 685, 5097, 50, 60, 11241, 284, 307, 2087, 355, 340, 338, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 598, 1631, 284, 262, 886, 286, 584, 953, 1483, 11525, 67, 654, 13, 1423, 1063, 460, 307, 6492, 1262, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 685, 63, 33, 861, 30642, 7509, 63, 4083, 4091, 685, 63, 6719, 2898, 1328, 30642, 7509, 13, 268, 8189, 63, 60, 290, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 685, 63, 6719, 2898, 1328, 30642, 7509, 13, 834, 13345, 834, 63, 60, 329, 3307, 13, 628, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 685, 2061, 389, 5128, 32373, 30, 16151, 40720, 4743, 793, 560, 2, 15414, 12, 2340, 8, 198, 220, 220, 220, 220, 220, 220, 220, 953, 282, 62, 9688, 62, 83, 482, 641, 357, 63, 13165, 354, 13, 14617, 51, 22854, 63, 286, 5485, 4600, 7, 43501, 62, 7857, 35751, 47671, 1635, 25968, 9, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 32233, 923, 11241, 284, 307, 2087, 284, 3819, 3401, 1483, 13302, 6048, 278, 13, 685, 5097, 50, 60, 4042, 8811, 973, 329, 17923, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 8861, 13, 198, 220, 220, 220, 220, 220, 220, 220, 953, 282, 62, 437, 62, 83, 482, 641, 357, 63, 13165, 354, 13, 14617, 51, 22854, 63, 286, 5485, 4600, 7, 43501, 62, 7857, 35751, 47671, 1635, 25968, 9, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 32233, 886, 11241, 284, 307, 2087, 284, 3819, 3401, 1483, 13302, 6048, 278, 13, 685, 5188, 47, 60, 4042, 8811, 973, 13, 198, 220, 220, 220, 220, 220, 220, 220, 3241, 62, 27932, 20789, 25968, 28104, 4600, 13165, 354, 13, 43879, 51, 22854, 63, 286, 5485, 4600, 7, 43501, 62, 7857, 11, 8379, 62, 13664, 8, 63, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 18007, 284, 3368, 9489, 3241, 319, 24511, 11241, 36525, 13, 18007, 3815, 6163, 287, 4600, 58, 15, 11, 352, 60, 63, 25, 628, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 532, 352, 329, 16326, 326, 389, 12429, 1662, 29229, 1174, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 532, 657, 329, 16326, 326, 389, 12429, 27932, 276, 1174, 13, 628, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 685, 2061, 389, 3241, 20680, 30, 16151, 40720, 4743, 793, 560, 2, 1078, 1463, 12, 27932, 8, 198, 220, 220, 220, 220, 220, 220, 220, 11241, 62, 4906, 62, 2340, 20789, 25968, 28104, 4600, 13165, 354, 13, 14617, 51, 22854, 63, 286, 5485, 4600, 7, 43501, 62, 7857, 11, 8379, 62, 13664, 8, 63, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1001, 5154, 11241, 36525, 284, 7603, 717, 290, 1218, 16690, 286, 262, 17311, 13, 1423, 1063, 389, 6163, 287, 4600, 58, 15, 11, 352, 60, 63, 25, 628, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 532, 657, 24866, 284, 257, 1635, 34086, 594, 317, 9, 11241, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 532, 352, 24866, 284, 257, 1635, 34086, 594, 347, 9, 11241, 13, 628, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 685, 2061, 389, 11241, 2099, 32373, 30, 16151, 40720, 4743, 793, 560, 2, 30001, 12, 4906, 12, 2340, 8, 198, 220, 220, 220, 220, 220, 220, 220, 953, 282, 62, 30001, 62, 4906, 62, 2340, 20789, 25968, 28104, 4600, 13165, 354, 13, 14617, 51, 22854, 63, 286, 5485, 4600, 7, 43501, 62, 7857, 11, 953, 282, 62, 43167, 62, 13664, 8, 63, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1001, 5154, 11241, 36525, 284, 7603, 1180, 16690, 286, 262, 1729, 12, 5239, 953, 1483, 13, 383, 11525, 67, 654, 422, 777, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 16326, 481, 307, 32794, 351, 262, 11756, 11241, 11525, 67, 654, 329, 262, 1729, 12, 5239, 953, 1483, 13, 198, 220, 220, 220, 220, 220, 220, 220, 2292, 62, 2340, 357, 63, 13165, 354, 13, 14617, 51, 22854, 63, 286, 5485, 4600, 7, 43501, 62, 7857, 11, 8379, 62, 13664, 8, 47671, 1635, 25968, 9, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1423, 1063, 286, 6116, 286, 1123, 5128, 8379, 16326, 287, 262, 2292, 11525, 67, 654, 13, 41344, 287, 262, 2837, 4600, 58, 15, 11, 4566, 13, 9806, 62, 9150, 62, 20521, 67, 654, 532, 352, 60, 44646, 628, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 685, 2061, 389, 2292, 32373, 30, 16151, 40720, 4743, 793, 560, 2, 9150, 12, 2340, 8, 198, 220, 220, 220, 220, 220, 220, 220, 953, 282, 62, 9150, 62, 2340, 357, 63, 13165, 354, 13, 14617, 51, 22854, 63, 286, 5485, 4600, 7, 43501, 62, 7857, 11, 953, 282, 62, 43167, 62, 13664, 8, 47671, 1635, 25968, 9, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1423, 1063, 286, 6116, 286, 1123, 5128, 8379, 16326, 287, 262, 2292, 11525, 67, 654, 329, 262, 1729, 12, 5239, 953, 1483, 13, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 41344, 287, 262, 2837, 4600, 58, 15, 11, 4566, 13, 9806, 62, 9150, 62, 20521, 67, 654, 532, 352, 60, 44646, 628, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 685, 2061, 389, 2292, 32373, 30, 16151, 40720, 4743, 793, 560, 2, 9150, 12, 2340, 8, 198, 220, 220, 220, 220, 220, 220, 220, 1182, 62, 27932, 357, 63, 13165, 354, 13, 43879, 51, 22854, 63, 286, 5485, 4600, 7, 22510, 62, 16600, 35751, 63, 393, 4600, 7, 22510, 62, 75, 6962, 11, 997, 62, 16600, 8, 47671, 1635, 25968, 9, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 18007, 284, 9242, 1958, 6163, 6665, 286, 262, 2116, 12, 1078, 1463, 13103, 13, 18007, 3815, 6163, 287, 4600, 58, 15, 11, 352, 60, 63, 25, 628, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 532, 352, 9217, 262, 1182, 318, 12429, 1662, 29229, 1174, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 532, 657, 9217, 262, 1182, 318, 12429, 27932, 276, 1174, 13, 628, 220, 220, 220, 220, 220, 220, 220, 17311, 62, 20521, 82, 357, 63, 13165, 354, 13, 43879, 51, 22854, 63, 286, 5485, 4600, 7, 43501, 62, 7857, 11, 8379, 62, 13664, 11, 11525, 12083, 62, 27740, 8, 47671, 1635, 25968, 9, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 16018, 453, 11, 2427, 286, 6427, 4600, 15414, 62, 2340, 63, 345, 460, 3853, 284, 3264, 1208, 281, 14553, 10552, 13, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 770, 318, 4465, 611, 345, 765, 517, 1630, 625, 703, 284, 10385, 4600, 15414, 62, 2340, 63, 36525, 656, 3917, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 30104, 621, 262, 2746, 338, 5387, 11525, 12083, 35847, 17593, 13, 198, 220, 220, 220, 220, 220, 220, 220, 2207, 12342, 62, 30342, 62, 27219, 357, 63, 13165, 354, 13, 43879, 51, 22854, 63, 286, 5485, 4600, 7, 43501, 62, 7857, 11, 8379, 62, 13664, 11, 7104, 62, 7857, 8, 47671, 1635, 25968, 9, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 45835, 286, 7104, 12, 27219, 379, 262, 5072, 286, 262, 938, 7679, 286, 262, 2207, 12342, 13, 16718, 287, 262, 3272, 12, 1078, 1463, 611, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 262, 2746, 318, 17839, 355, 257, 875, 12342, 13, 198, 220, 220, 220, 220, 220, 220, 220, 2207, 12342, 62, 1078, 1463, 62, 27932, 357, 63, 13165, 354, 13, 43879, 51, 22854, 63, 286, 5485, 4600, 7, 43501, 62, 7857, 11, 8379, 62, 13664, 8, 47671, 1635, 25968, 9, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 18007, 284, 3368, 9489, 3241, 319, 262, 24511, 11241, 36525, 286, 262, 2207, 12342, 5128, 13, 770, 9335, 318, 973, 287, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 262, 3272, 12, 1078, 1463, 611, 262, 2746, 318, 17839, 355, 257, 875, 12342, 13, 18007, 3815, 6163, 287, 4600, 58, 15, 11, 352, 60, 63, 25, 628, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 532, 352, 329, 16326, 326, 389, 12429, 1662, 29229, 1174, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 532, 657, 329, 16326, 326, 389, 12429, 27932, 276, 1174, 13, 628, 220, 220, 220, 220, 220, 220, 220, 5072, 62, 1078, 298, 507, 357, 63, 30388, 47671, 1635, 25968, 9, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 10127, 393, 407, 284, 1441, 262, 32649, 507, 11192, 669, 286, 477, 3241, 11685, 13, 4091, 4600, 1078, 298, 507, 63, 739, 4504, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 11192, 669, 329, 517, 3703, 13, 198, 220, 220, 220, 220, 220, 220, 220, 5072, 62, 30342, 62, 27219, 357, 63, 30388, 47671, 1635, 25968, 9, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 10127, 393, 407, 284, 1441, 262, 7104, 2585, 286, 477, 11685, 13, 4091, 4600, 30342, 62, 27219, 63, 739, 4504, 11192, 669, 329, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 517, 3703, 13, 198, 220, 220, 220, 220, 220, 220, 220, 1441, 62, 11600, 357, 63, 30388, 47671, 1635, 25968, 9, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 10127, 393, 407, 284, 1441, 257, 685, 63, 93, 7753, 62, 26791, 13, 17633, 26410, 63, 60, 2427, 286, 257, 8631, 46545, 13, 198, 37811, 628, 198 ]
2.849831
2,657
from abc import ( ABC, abstractmethod, ) import logging from typing import ( TYPE_CHECKING, Tuple, Type, ) from eth._utils.datatypes import ( Configurable, ) from eth.db.backends.base import ( BaseAtomicDB, ) from eth.exceptions import ( BlockNotFound, ) from eth.validation import ( validate_word, ) from eth_typing import ( Hash32, ) from eth_utils import ( ValidationError, encode_hex, ) from eth2._utils.ssz import ( validate_imported_block_unchanged, ) from eth2.beacon.db.chain import ( BaseBeaconChainDB, BeaconChainDB, ) from eth2.beacon.exceptions import ( BlockClassError, StateMachineNotFound, ) from eth2.beacon.types.blocks import ( BaseBeaconBlock, ) from eth2.beacon.types.states import ( BeaconState, ) from eth2.beacon.typing import ( FromBlockParams, Slot, ) from eth2.beacon.validation import ( validate_slot, ) if TYPE_CHECKING: from eth2.beacon.state_machines.base import ( # noqa: F401 BaseBeaconStateMachine, ) # # Block API # def get_block_class(self, block_root: Hash32) -> Type[BaseBeaconBlock]: slot = self.chaindb.get_slot_by_root(block_root) sm_class = self.get_state_machine_class_for_block_slot(slot) block_class = sm_class.block_class return block_class def create_block_from_parent(self, parent_block: BaseBeaconBlock, block_params: FromBlockParams) -> BaseBeaconBlock: """ Passthrough helper to the ``StateMachine`` class of the block descending from the given block. """ return self.get_state_machine_class_for_block_slot( slot=parent_block.slot + 1 if block_params.slot is None else block_params.slot, ).create_block_from_parent(parent_block, block_params) def get_block_by_root(self, block_root: Hash32) -> BaseBeaconBlock: """ Return the requested block as specified by block hash. Raise ``BlockNotFound`` if there's no block with the given hash in the db. """ validate_word(block_root, title="Block Hash") block_class = self.get_block_class(block_root) return self.chaindb.get_block_by_root(block_root, block_class) def get_canonical_head(self) -> BaseBeaconBlock: """ Return the block at the canonical chain head. Raise ``CanonicalHeadNotFound`` if there's no head defined for the canonical chain. """ block_root = self.chaindb.get_canonical_head_root() block_class = self.get_block_class(block_root) return self.chaindb.get_block_by_root(block_root, block_class) def get_score(self, block_root: Hash32) -> int: """ Return the score of the block with the given hash. Raise ``BlockNotFound`` if there is no matching black hash. """ return self.chaindb.get_score(block_root) def ensure_block(self, block: BaseBeaconBlock=None) -> BaseBeaconBlock: """ Return ``block`` if it is not ``None``, otherwise return the block of the canonical head. """ if block is None: head = self.get_canonical_head() return self.create_block_from_parent(head, FromBlockParams()) else: return block def get_block(self) -> BaseBeaconBlock: """ Return the current TIP block. """ return self.get_state_machine().block def get_canonical_block_by_slot(self, slot: Slot) -> BaseBeaconBlock: """ Return the block with the given number in the canonical chain. Raise ``BlockNotFound`` if there's no block with the given number in the canonical chain. """ validate_slot(slot) return self.get_block_by_root(self.chaindb.get_canonical_block_root(slot)) def get_canonical_block_root(self, slot: Slot) -> Hash32: """ Return the block hash with the given number in the canonical chain. Raise ``BlockNotFound`` if there's no block with the given number in the canonical chain. """ return self.chaindb.get_canonical_block_root(slot) def import_block( self, block: BaseBeaconBlock, perform_validation: bool=True ) -> Tuple[BaseBeaconBlock, Tuple[BaseBeaconBlock, ...], Tuple[BaseBeaconBlock, ...]]: """ Import a complete block and returns a 3-tuple - the imported block - a tuple of blocks which are now part of the canonical chain. - a tuple of blocks which were canonical and now are no longer canonical. """ try: parent_block = self.get_block_by_root(block.previous_block_root) except BlockNotFound: raise ValidationError( "Attempt to import block #{}. Cannot import block {} before importing " "its parent block at {}".format( block.slot, block.signed_root, block.previous_block_root, ) ) base_block_for_import = self.create_block_from_parent( parent_block, FromBlockParams(), ) state, imported_block = self.get_state_machine(base_block_for_import).import_block(block) # Validate the imported block. if perform_validation: validate_imported_block_unchanged(imported_block, block) # TODO: Now it just persists all state. Should design how to clean up the old state. self.chaindb.persist_state(state) ( new_canonical_blocks, old_canonical_blocks, ) = self.chaindb.persist_block(imported_block, imported_block.__class__) self.logger.debug( 'IMPORTED_BLOCK: slot %s | signed root %s', imported_block.slot, encode_hex(imported_block.signed_root), ) return imported_block, new_canonical_blocks, old_canonical_blocks
[ 6738, 450, 66, 1330, 357, 198, 220, 220, 220, 9738, 11, 198, 220, 220, 220, 12531, 24396, 11, 198, 8, 198, 11748, 18931, 198, 6738, 19720, 1330, 357, 198, 220, 220, 220, 41876, 62, 50084, 2751, 11, 198, 220, 220, 220, 309, 29291, 11, 198, 220, 220, 220, 5994, 11, 198, 8, 198, 198, 6738, 4555, 13557, 26791, 13, 19608, 265, 9497, 1330, 357, 198, 220, 220, 220, 17056, 11970, 11, 198, 8, 198, 6738, 4555, 13, 9945, 13, 1891, 2412, 13, 8692, 1330, 357, 198, 220, 220, 220, 7308, 2953, 10179, 11012, 11, 198, 8, 198, 6738, 4555, 13, 1069, 11755, 1330, 357, 198, 220, 220, 220, 9726, 3673, 21077, 11, 198, 8, 198, 6738, 4555, 13, 12102, 341, 1330, 357, 198, 220, 220, 220, 26571, 62, 4775, 11, 198, 8, 198, 6738, 4555, 62, 774, 13886, 1330, 357, 198, 220, 220, 220, 21059, 2624, 11, 198, 8, 198, 6738, 4555, 62, 26791, 1330, 357, 198, 220, 220, 220, 3254, 24765, 12331, 11, 198, 220, 220, 220, 37773, 62, 33095, 11, 198, 8, 198, 198, 6738, 4555, 17, 13557, 26791, 13, 824, 89, 1330, 357, 198, 220, 220, 220, 26571, 62, 320, 9213, 62, 9967, 62, 3316, 5102, 11, 198, 8, 198, 6738, 4555, 17, 13, 1350, 7807, 13, 9945, 13, 7983, 1330, 357, 198, 220, 220, 220, 7308, 3856, 7807, 35491, 11012, 11, 198, 220, 220, 220, 29729, 35491, 11012, 11, 198, 8, 198, 6738, 4555, 17, 13, 1350, 7807, 13, 1069, 11755, 1330, 357, 198, 220, 220, 220, 9726, 9487, 12331, 11, 198, 220, 220, 220, 1812, 37573, 3673, 21077, 11, 198, 8, 198, 6738, 4555, 17, 13, 1350, 7807, 13, 19199, 13, 27372, 1330, 357, 198, 220, 220, 220, 7308, 3856, 7807, 12235, 11, 198, 8, 198, 6738, 4555, 17, 13, 1350, 7807, 13, 19199, 13, 27219, 1330, 357, 198, 220, 220, 220, 29729, 9012, 11, 198, 8, 198, 6738, 4555, 17, 13, 1350, 7807, 13, 774, 13886, 1330, 357, 198, 220, 220, 220, 3574, 12235, 10044, 4105, 11, 198, 220, 220, 220, 32026, 11, 198, 8, 198, 6738, 4555, 17, 13, 1350, 7807, 13, 12102, 341, 1330, 357, 198, 220, 220, 220, 26571, 62, 43384, 11, 198, 8, 198, 198, 361, 41876, 62, 50084, 2751, 25, 198, 220, 220, 220, 422, 4555, 17, 13, 1350, 7807, 13, 5219, 62, 76, 620, 1127, 13, 8692, 1330, 357, 220, 1303, 645, 20402, 25, 376, 21844, 198, 220, 220, 220, 220, 220, 220, 220, 7308, 3856, 7807, 9012, 37573, 11, 198, 220, 220, 220, 1267, 628, 628, 220, 220, 220, 1303, 198, 220, 220, 220, 1303, 9726, 7824, 198, 220, 220, 220, 1303, 198, 220, 220, 220, 825, 651, 62, 9967, 62, 4871, 7, 944, 11, 2512, 62, 15763, 25, 21059, 2624, 8, 4613, 5994, 58, 14881, 3856, 7807, 12235, 5974, 198, 220, 220, 220, 220, 220, 220, 220, 10852, 796, 2116, 13, 7983, 9945, 13, 1136, 62, 43384, 62, 1525, 62, 15763, 7, 9967, 62, 15763, 8, 198, 220, 220, 220, 220, 220, 220, 220, 895, 62, 4871, 796, 2116, 13, 1136, 62, 5219, 62, 30243, 62, 4871, 62, 1640, 62, 9967, 62, 43384, 7, 43384, 8, 198, 220, 220, 220, 220, 220, 220, 220, 2512, 62, 4871, 796, 895, 62, 4871, 13, 9967, 62, 4871, 198, 220, 220, 220, 220, 220, 220, 220, 1441, 2512, 62, 4871, 628, 220, 220, 220, 825, 2251, 62, 9967, 62, 6738, 62, 8000, 7, 944, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2560, 62, 9967, 25, 7308, 3856, 7807, 12235, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2512, 62, 37266, 25, 3574, 12235, 10044, 4105, 8, 4613, 7308, 3856, 7807, 12235, 25, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 198, 220, 220, 220, 220, 220, 220, 220, 17454, 48476, 740, 31904, 284, 262, 7559, 9012, 37573, 15506, 1398, 286, 262, 2512, 31491, 422, 262, 198, 220, 220, 220, 220, 220, 220, 220, 1813, 2512, 13, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 198, 220, 220, 220, 220, 220, 220, 220, 1441, 2116, 13, 1136, 62, 5219, 62, 30243, 62, 4871, 62, 1640, 62, 9967, 62, 43384, 7, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 10852, 28, 8000, 62, 9967, 13, 43384, 1343, 352, 611, 2512, 62, 37266, 13, 43384, 318, 6045, 2073, 2512, 62, 37266, 13, 43384, 11, 198, 220, 220, 220, 220, 220, 220, 220, 6739, 17953, 62, 9967, 62, 6738, 62, 8000, 7, 8000, 62, 9967, 11, 2512, 62, 37266, 8, 628, 220, 220, 220, 825, 651, 62, 9967, 62, 1525, 62, 15763, 7, 944, 11, 2512, 62, 15763, 25, 21059, 2624, 8, 4613, 7308, 3856, 7807, 12235, 25, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 198, 220, 220, 220, 220, 220, 220, 220, 8229, 262, 9167, 2512, 355, 7368, 416, 2512, 12234, 13, 628, 220, 220, 220, 220, 220, 220, 220, 35123, 7559, 12235, 3673, 21077, 15506, 611, 612, 338, 645, 2512, 351, 262, 1813, 12234, 287, 262, 20613, 13, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 198, 220, 220, 220, 220, 220, 220, 220, 26571, 62, 4775, 7, 9967, 62, 15763, 11, 3670, 2625, 12235, 21059, 4943, 628, 220, 220, 220, 220, 220, 220, 220, 2512, 62, 4871, 796, 2116, 13, 1136, 62, 9967, 62, 4871, 7, 9967, 62, 15763, 8, 198, 220, 220, 220, 220, 220, 220, 220, 1441, 2116, 13, 7983, 9945, 13, 1136, 62, 9967, 62, 1525, 62, 15763, 7, 9967, 62, 15763, 11, 2512, 62, 4871, 8, 628, 220, 220, 220, 825, 651, 62, 49883, 605, 62, 2256, 7, 944, 8, 4613, 7308, 3856, 7807, 12235, 25, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 198, 220, 220, 220, 220, 220, 220, 220, 8229, 262, 2512, 379, 262, 40091, 6333, 1182, 13, 628, 220, 220, 220, 220, 220, 220, 220, 35123, 7559, 6090, 261, 605, 13847, 3673, 21077, 15506, 611, 612, 338, 645, 1182, 5447, 329, 262, 40091, 6333, 13, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 198, 220, 220, 220, 220, 220, 220, 220, 2512, 62, 15763, 796, 2116, 13, 7983, 9945, 13, 1136, 62, 49883, 605, 62, 2256, 62, 15763, 3419, 628, 220, 220, 220, 220, 220, 220, 220, 2512, 62, 4871, 796, 2116, 13, 1136, 62, 9967, 62, 4871, 7, 9967, 62, 15763, 8, 198, 220, 220, 220, 220, 220, 220, 220, 1441, 2116, 13, 7983, 9945, 13, 1136, 62, 9967, 62, 1525, 62, 15763, 7, 9967, 62, 15763, 11, 2512, 62, 4871, 8, 628, 220, 220, 220, 825, 651, 62, 26675, 7, 944, 11, 2512, 62, 15763, 25, 21059, 2624, 8, 4613, 493, 25, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 198, 220, 220, 220, 220, 220, 220, 220, 8229, 262, 4776, 286, 262, 2512, 351, 262, 1813, 12234, 13, 628, 220, 220, 220, 220, 220, 220, 220, 35123, 7559, 12235, 3673, 21077, 15506, 611, 612, 318, 645, 12336, 2042, 12234, 13, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 198, 220, 220, 220, 220, 220, 220, 220, 1441, 2116, 13, 7983, 9945, 13, 1136, 62, 26675, 7, 9967, 62, 15763, 8, 628, 220, 220, 220, 825, 4155, 62, 9967, 7, 944, 11, 2512, 25, 7308, 3856, 7807, 12235, 28, 14202, 8, 4613, 7308, 3856, 7807, 12235, 25, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 198, 220, 220, 220, 220, 220, 220, 220, 8229, 7559, 9967, 15506, 611, 340, 318, 407, 7559, 14202, 15506, 11, 4306, 1441, 262, 2512, 198, 220, 220, 220, 220, 220, 220, 220, 286, 262, 40091, 1182, 13, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 198, 220, 220, 220, 220, 220, 220, 220, 611, 2512, 318, 6045, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1182, 796, 2116, 13, 1136, 62, 49883, 605, 62, 2256, 3419, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1441, 2116, 13, 17953, 62, 9967, 62, 6738, 62, 8000, 7, 2256, 11, 3574, 12235, 10044, 4105, 28955, 198, 220, 220, 220, 220, 220, 220, 220, 2073, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1441, 2512, 628, 220, 220, 220, 825, 651, 62, 9967, 7, 944, 8, 4613, 7308, 3856, 7807, 12235, 25, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 198, 220, 220, 220, 220, 220, 220, 220, 8229, 262, 1459, 309, 4061, 2512, 13, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 198, 220, 220, 220, 220, 220, 220, 220, 1441, 2116, 13, 1136, 62, 5219, 62, 30243, 22446, 9967, 628, 220, 220, 220, 825, 651, 62, 49883, 605, 62, 9967, 62, 1525, 62, 43384, 7, 944, 11, 10852, 25, 32026, 8, 4613, 7308, 3856, 7807, 12235, 25, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 198, 220, 220, 220, 220, 220, 220, 220, 8229, 262, 2512, 351, 262, 1813, 1271, 287, 262, 40091, 6333, 13, 628, 220, 220, 220, 220, 220, 220, 220, 35123, 7559, 12235, 3673, 21077, 15506, 611, 612, 338, 645, 2512, 351, 262, 1813, 1271, 287, 262, 198, 220, 220, 220, 220, 220, 220, 220, 40091, 6333, 13, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 198, 220, 220, 220, 220, 220, 220, 220, 26571, 62, 43384, 7, 43384, 8, 198, 220, 220, 220, 220, 220, 220, 220, 1441, 2116, 13, 1136, 62, 9967, 62, 1525, 62, 15763, 7, 944, 13, 7983, 9945, 13, 1136, 62, 49883, 605, 62, 9967, 62, 15763, 7, 43384, 4008, 628, 220, 220, 220, 825, 651, 62, 49883, 605, 62, 9967, 62, 15763, 7, 944, 11, 10852, 25, 32026, 8, 4613, 21059, 2624, 25, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 198, 220, 220, 220, 220, 220, 220, 220, 8229, 262, 2512, 12234, 351, 262, 1813, 1271, 287, 262, 40091, 6333, 13, 628, 220, 220, 220, 220, 220, 220, 220, 35123, 7559, 12235, 3673, 21077, 15506, 611, 612, 338, 645, 2512, 351, 262, 1813, 1271, 287, 262, 198, 220, 220, 220, 220, 220, 220, 220, 40091, 6333, 13, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 198, 220, 220, 220, 220, 220, 220, 220, 1441, 2116, 13, 7983, 9945, 13, 1136, 62, 49883, 605, 62, 9967, 62, 15763, 7, 43384, 8, 628, 220, 220, 220, 825, 1330, 62, 9967, 7, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2116, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2512, 25, 7308, 3856, 7807, 12235, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1620, 62, 12102, 341, 25, 20512, 28, 17821, 198, 220, 220, 220, 1267, 4613, 309, 29291, 58, 14881, 3856, 7807, 12235, 11, 309, 29291, 58, 14881, 3856, 7807, 12235, 11, 2644, 4357, 309, 29291, 58, 14881, 3856, 7807, 12235, 11, 2644, 60, 5974, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 198, 220, 220, 220, 220, 220, 220, 220, 17267, 257, 1844, 2512, 290, 5860, 257, 513, 12, 83, 29291, 628, 220, 220, 220, 220, 220, 220, 220, 532, 262, 17392, 2512, 198, 220, 220, 220, 220, 220, 220, 220, 532, 257, 46545, 286, 7021, 543, 389, 783, 636, 286, 262, 40091, 6333, 13, 198, 220, 220, 220, 220, 220, 220, 220, 532, 257, 46545, 286, 7021, 543, 547, 40091, 290, 783, 389, 645, 2392, 40091, 13, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 628, 220, 220, 220, 220, 220, 220, 220, 1949, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2560, 62, 9967, 796, 2116, 13, 1136, 62, 9967, 62, 1525, 62, 15763, 7, 9967, 13, 3866, 1442, 62, 9967, 62, 15763, 8, 198, 220, 220, 220, 220, 220, 220, 220, 2845, 9726, 3673, 21077, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 5298, 3254, 24765, 12331, 7, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 37177, 284, 1330, 2512, 1303, 90, 27422, 220, 26003, 1330, 2512, 23884, 878, 33332, 366, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 896, 2560, 2512, 379, 23884, 1911, 18982, 7, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2512, 13, 43384, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2512, 13, 32696, 62, 15763, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2512, 13, 3866, 1442, 62, 9967, 62, 15763, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1267, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1267, 198, 220, 220, 220, 220, 220, 220, 220, 2779, 62, 9967, 62, 1640, 62, 11748, 796, 2116, 13, 17953, 62, 9967, 62, 6738, 62, 8000, 7, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2560, 62, 9967, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 3574, 12235, 10044, 4105, 22784, 198, 220, 220, 220, 220, 220, 220, 220, 1267, 198, 220, 220, 220, 220, 220, 220, 220, 1181, 11, 17392, 62, 9967, 796, 2116, 13, 1136, 62, 5219, 62, 30243, 7, 8692, 62, 9967, 62, 1640, 62, 11748, 737, 11748, 62, 9967, 7, 9967, 8, 628, 220, 220, 220, 220, 220, 220, 220, 1303, 3254, 20540, 262, 17392, 2512, 13, 198, 220, 220, 220, 220, 220, 220, 220, 611, 1620, 62, 12102, 341, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 26571, 62, 320, 9213, 62, 9967, 62, 3316, 5102, 7, 320, 9213, 62, 9967, 11, 2512, 8, 628, 220, 220, 220, 220, 220, 220, 220, 1303, 16926, 46, 25, 2735, 340, 655, 35545, 477, 1181, 13, 10358, 1486, 703, 284, 3424, 510, 262, 1468, 1181, 13, 198, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 7983, 9945, 13, 19276, 396, 62, 5219, 7, 5219, 8, 628, 220, 220, 220, 220, 220, 220, 220, 357, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 649, 62, 49883, 605, 62, 27372, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1468, 62, 49883, 605, 62, 27372, 11, 198, 220, 220, 220, 220, 220, 220, 220, 1267, 796, 2116, 13, 7983, 9945, 13, 19276, 396, 62, 9967, 7, 320, 9213, 62, 9967, 11, 17392, 62, 9967, 13, 834, 4871, 834, 8, 628, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 6404, 1362, 13, 24442, 7, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 705, 3955, 15490, 1961, 62, 9148, 11290, 25, 10852, 4064, 82, 930, 4488, 6808, 4064, 82, 3256, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 17392, 62, 9967, 13, 43384, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 37773, 62, 33095, 7, 320, 9213, 62, 9967, 13, 32696, 62, 15763, 828, 198, 220, 220, 220, 220, 220, 220, 220, 1267, 628, 220, 220, 220, 220, 220, 220, 220, 1441, 17392, 62, 9967, 11, 649, 62, 49883, 605, 62, 27372, 11, 1468, 62, 49883, 605, 62, 27372, 198 ]
2.345961
2,587
#!/usr/local/bin/python3 import paramiko,time #using as SSH Client client = paramiko.SSHClient() # check dir(client) to find available options. # auto adjust host key verification with yes or no client.set_missing_host_key_policy(paramiko.AutoAddPolicy()) # time for connecting to remote Cisco IOS """ Manually taking input addr = input('Provide IP address to connect to: ') user = input('Username: ') pwd = getpass.getpass('Password: ')""" # Taking input from files f1 = open("devices.txt","r") f2 = open("commands.txt","r") for line in f1: client = paramiko.SSHClient() client.set_missing_host_key_policy(paramiko.AutoAddPolicy()) data = line.split(" ") # print(data) addr = data[0] user = data[1] pwd = data[2] f3 = open(addr+".txt","w+") # print(addr +" "+ user +" " +pwd) client.connect(addr,username=user,password=pwd,allow_agent=False,look_for_keys=False) # we have to ask for Shell device_access = client.invoke_shell() for line in f2: device_access.send(line) time.sleep(1) output = device_access.recv(55000).decode('ascii') f3.write(output) """ THIS CODE IS FOR SINGLE COMMAND, FOR MULTIPLE COMMANDS CODE BELOW # send command to the device device_access.send("ter len 0\nshow run \n") time.sleep(2) # receive output from the device, convert it to byte-like format and print it print(device_access.recv(550000).decode('ascii')) # We can print the same to a file too with open("csr1000v.txt","w") as f: f.write(device_access.recv(550000).decode('ascii'))"""
[ 2, 48443, 14629, 14, 12001, 14, 8800, 14, 29412, 18, 198, 198, 11748, 5772, 12125, 11, 2435, 198, 198, 2, 3500, 355, 33825, 20985, 198, 198, 16366, 796, 5772, 12125, 13, 5432, 39, 11792, 3419, 198, 198, 2, 2198, 26672, 7, 16366, 8, 284, 1064, 1695, 3689, 13, 198, 2, 8295, 4532, 2583, 1994, 19637, 351, 3763, 393, 645, 198, 16366, 13, 2617, 62, 45688, 62, 4774, 62, 2539, 62, 30586, 7, 17143, 12125, 13, 27722, 4550, 36727, 28955, 198, 198, 2, 640, 329, 14320, 284, 6569, 28289, 314, 2640, 198, 37811, 198, 5124, 935, 2263, 5128, 198, 29851, 796, 5128, 10786, 15946, 485, 6101, 2209, 284, 2018, 284, 25, 705, 8, 198, 7220, 796, 5128, 10786, 5842, 13292, 25, 705, 8, 198, 79, 16993, 796, 651, 6603, 13, 1136, 6603, 10786, 35215, 25, 705, 8, 37811, 198, 198, 2, 20879, 5128, 422, 3696, 198, 198, 69, 16, 796, 1280, 7203, 42034, 13, 14116, 2430, 81, 4943, 198, 69, 17, 796, 1280, 7203, 9503, 1746, 13, 14116, 2430, 81, 4943, 198, 198, 1640, 1627, 287, 277, 16, 25, 628, 220, 220, 220, 5456, 796, 5772, 12125, 13, 5432, 39, 11792, 3419, 198, 220, 220, 220, 5456, 13, 2617, 62, 45688, 62, 4774, 62, 2539, 62, 30586, 7, 17143, 12125, 13, 27722, 4550, 36727, 28955, 198, 220, 220, 220, 1366, 796, 1627, 13, 35312, 7203, 366, 8, 198, 2, 220, 220, 220, 3601, 7, 7890, 8, 198, 220, 220, 220, 37817, 796, 1366, 58, 15, 60, 198, 220, 220, 220, 2836, 796, 1366, 58, 16, 60, 198, 220, 220, 220, 279, 16993, 796, 1366, 58, 17, 60, 628, 220, 220, 220, 277, 18, 796, 1280, 7, 29851, 10, 1911, 14116, 2430, 86, 10, 4943, 198, 198, 2, 3601, 7, 29851, 1343, 1, 43825, 2836, 1343, 1, 366, 1343, 79, 16993, 8, 628, 220, 220, 220, 5456, 13, 8443, 7, 29851, 11, 29460, 28, 7220, 11, 28712, 28, 79, 16993, 11, 12154, 62, 25781, 28, 25101, 11, 5460, 62, 1640, 62, 13083, 28, 25101, 8, 198, 198, 2, 356, 423, 284, 1265, 329, 17537, 628, 220, 220, 220, 3335, 62, 15526, 796, 5456, 13, 37669, 62, 29149, 3419, 628, 198, 220, 220, 220, 329, 1627, 287, 277, 17, 25, 198, 220, 220, 220, 220, 220, 220, 220, 3335, 62, 15526, 13, 21280, 7, 1370, 8, 198, 220, 220, 220, 220, 220, 220, 220, 640, 13, 42832, 7, 16, 8, 628, 220, 220, 220, 5072, 796, 3335, 62, 15526, 13, 8344, 85, 7, 2816, 830, 737, 12501, 1098, 10786, 292, 979, 72, 11537, 198, 220, 220, 220, 277, 18, 13, 13564, 7, 22915, 8, 198, 198, 37811, 198, 43559, 42714, 3180, 7473, 311, 2751, 2538, 22240, 6981, 11, 7473, 337, 16724, 4061, 2538, 9440, 10725, 5258, 42714, 45339, 198, 198, 2, 3758, 3141, 284, 262, 3335, 198, 220, 220, 220, 3335, 62, 15526, 13, 21280, 7203, 353, 18896, 657, 59, 77, 12860, 1057, 3467, 77, 4943, 198, 220, 220, 220, 640, 13, 42832, 7, 17, 8, 198, 198, 2, 3328, 5072, 422, 262, 3335, 11, 10385, 340, 284, 18022, 12, 2339, 5794, 290, 3601, 340, 198, 4798, 7, 25202, 62, 15526, 13, 8344, 85, 7, 2816, 2388, 737, 12501, 1098, 10786, 292, 979, 72, 6, 4008, 198, 198, 2, 775, 460, 3601, 262, 976, 284, 257, 2393, 1165, 198, 198, 4480, 1280, 7203, 6359, 81, 12825, 85, 13, 14116, 2430, 86, 4943, 355, 277, 25, 198, 220, 220, 220, 277, 13, 13564, 7, 25202, 62, 15526, 13, 8344, 85, 7, 2816, 2388, 737, 12501, 1098, 10786, 292, 979, 72, 6, 4008, 37811 ]
2.658744
589
# for n in range(400,500): # i = n // 100 # j = n // 10 % 10 # k = n % 10 # if n == i ** 3 + j ** 3 + k ** 3: # print(n) # (16) # input("():") # s1 = input("():") # l1 = s1.split(' ') # l2 = [] # for i in l1: # if i.isdigit(): # l2.append(int(i)) # for i in l2: # if not (i % 6): # print(i, end=" ") # (17) out_l1 = [] while 1: in_1 = input(":") nums_l1 = in_1.split(' ')
[ 2, 329, 299, 287, 2837, 7, 7029, 11, 4059, 2599, 198, 2, 220, 220, 220, 220, 1312, 796, 299, 3373, 1802, 198, 2, 220, 220, 220, 220, 474, 796, 299, 3373, 838, 4064, 838, 198, 2, 220, 220, 220, 220, 479, 796, 299, 4064, 838, 198, 2, 220, 220, 220, 220, 611, 299, 6624, 1312, 12429, 513, 1343, 474, 12429, 513, 1343, 479, 12429, 513, 25, 198, 2, 220, 220, 220, 220, 220, 220, 220, 220, 3601, 7, 77, 8, 628, 198, 2, 357, 1433, 8, 198, 2, 5128, 7203, 33529, 4943, 198, 2, 264, 16, 796, 5128, 7203, 33529, 4943, 198, 198, 2, 300, 16, 796, 264, 16, 13, 35312, 10786, 705, 8, 198, 2, 300, 17, 796, 17635, 198, 2, 329, 1312, 287, 300, 16, 25, 198, 2, 220, 220, 220, 220, 611, 1312, 13, 9409, 328, 270, 33529, 198, 2, 220, 220, 220, 220, 220, 220, 220, 220, 300, 17, 13, 33295, 7, 600, 7, 72, 4008, 198, 198, 2, 329, 1312, 287, 300, 17, 25, 198, 2, 220, 220, 220, 220, 611, 407, 357, 72, 4064, 718, 2599, 198, 2, 220, 220, 220, 220, 220, 220, 220, 220, 3601, 7, 72, 11, 886, 2625, 366, 8, 198, 198, 2, 357, 1558, 8, 198, 448, 62, 75, 16, 796, 17635, 198, 198, 4514, 352, 25, 198, 220, 220, 220, 287, 62, 16, 796, 5128, 7, 2404, 8, 198, 220, 220, 220, 997, 82, 62, 75, 16, 796, 287, 62, 16, 13, 35312, 10786, 705, 8, 628, 628, 628, 628, 628, 628, 198 ]
1.74902
255
""" A query transformer is a function that accepts a program and returns a program, plus a priority level. Higher priority transformers are placed closer to the front of the list. Were ensuring is a function, because were going to evaluate it later 31 . Well assume there wont be an enormous number of transformer additions, and walk the list linearly to add a new one. Well leave a note in case this assumption turns out to be false a binary search is much more time-optimal for long lists, but adds a little complexity and doesnt really speed up short lists. """ """ Dagoba.T = [] # transformers (more than meets the eye) """ """ Dagoba.addTransformer = function(fun, priority) { if(typeof fun != 'function') return Dagoba.error('Invalid transformer function') for(var i = 0; i < Dagoba.T.length; i++) # OPT: binary search if(priority > Dagoba.T[i].priority) break Dagoba.T.splice(i, 0, {priority: priority, fun: fun}) } """ """ Dagoba.transform = function(program) { return Dagoba.T.reduce(function(acc, transformer) { return transformer.fun(acc) }, program) } """ """ Dagoba.addAlias = function(newname, oldname, defaults) { defaults = defaults || [] # default arguments for the alias Dagoba.addPipetype(newname, function() {}) # because there's no method catchall in js Dagoba.addTransformer(function(program) { return program.map(function(step) { if(step[0] != newname) return step return [oldname, Dagoba.extend(step[1], defaults)] }) }, 100) # these need to run early, so they get a high priority } """ """ Dagoba.extend = function(list, defaults) { return Object.keys(defaults).reduce(function(acc, key) { if(typeof list[key] != 'undefined') return acc acc[key] = defaults[key] return acc }, list) } """
[ 37811, 198, 32, 12405, 47385, 318, 257, 2163, 326, 18178, 257, 1430, 290, 5860, 257, 1430, 11, 5556, 257, 8475, 1241, 13, 198, 48708, 8475, 6121, 364, 389, 4624, 5699, 284, 262, 2166, 286, 262, 1351, 13, 15176, 13359, 318, 257, 2163, 11, 198, 13893, 547, 1016, 284, 13446, 340, 1568, 3261, 764, 198, 5779, 7048, 612, 28329, 307, 281, 9812, 1271, 286, 47385, 19885, 11, 198, 392, 2513, 262, 1351, 9493, 11458, 284, 751, 257, 649, 530, 13, 198, 5779, 2666, 257, 3465, 287, 1339, 428, 13196, 4962, 503, 284, 307, 3991, 220, 198, 64, 13934, 2989, 318, 881, 517, 640, 12, 8738, 4402, 329, 890, 8341, 11, 198, 4360, 6673, 257, 1310, 13357, 290, 46701, 1107, 2866, 510, 1790, 8341, 13, 198, 37811, 628, 198, 37811, 198, 198, 35, 363, 19981, 13, 51, 796, 17635, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 6121, 364, 357, 3549, 621, 11185, 262, 4151, 8, 198, 37811, 198, 198, 37811, 198, 35, 363, 19981, 13, 2860, 8291, 16354, 796, 2163, 7, 12543, 11, 8475, 8, 1391, 198, 220, 611, 7, 4906, 1659, 1257, 14512, 705, 8818, 11537, 198, 220, 220, 220, 1441, 32167, 19981, 13, 18224, 10786, 44651, 47385, 2163, 11537, 628, 220, 329, 7, 7785, 1312, 796, 657, 26, 1312, 1279, 32167, 19981, 13, 51, 13, 13664, 26, 1312, 29577, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 39852, 25, 13934, 2989, 198, 220, 220, 220, 611, 7, 49336, 1875, 32167, 19981, 13, 51, 58, 72, 4083, 49336, 8, 2270, 628, 220, 32167, 19981, 13, 51, 13, 22018, 501, 7, 72, 11, 657, 11, 1391, 49336, 25, 8475, 11, 1257, 25, 1257, 30072, 198, 92, 198, 37811, 198, 198, 37811, 198, 35, 363, 19981, 13, 35636, 796, 2163, 7, 23065, 8, 1391, 198, 220, 1441, 32167, 19981, 13, 51, 13, 445, 7234, 7, 8818, 7, 4134, 11, 47385, 8, 1391, 198, 220, 220, 220, 1441, 47385, 13, 12543, 7, 4134, 8, 198, 220, 8964, 1430, 8, 198, 92, 198, 37811, 198, 198, 37811, 198, 198, 35, 363, 19981, 13, 2860, 40489, 796, 2163, 7, 3605, 3672, 11, 1468, 3672, 11, 26235, 8, 1391, 198, 220, 26235, 796, 26235, 8614, 17635, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 4277, 7159, 329, 262, 16144, 198, 220, 32167, 19981, 13, 2860, 47, 541, 2963, 431, 7, 3605, 3672, 11, 2163, 3419, 23884, 8, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 780, 612, 338, 645, 2446, 4929, 439, 287, 44804, 198, 220, 32167, 19981, 13, 2860, 8291, 16354, 7, 8818, 7, 23065, 8, 1391, 198, 220, 220, 220, 1441, 1430, 13, 8899, 7, 8818, 7, 9662, 8, 1391, 198, 220, 220, 220, 220, 220, 611, 7, 9662, 58, 15, 60, 14512, 649, 3672, 8, 1441, 2239, 198, 220, 220, 220, 220, 220, 1441, 685, 727, 3672, 11, 32167, 19981, 13, 2302, 437, 7, 9662, 58, 16, 4357, 26235, 15437, 198, 220, 220, 220, 32092, 198, 220, 8964, 1802, 8, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 777, 761, 284, 1057, 1903, 11, 523, 484, 651, 257, 1029, 8475, 198, 92, 198, 37811, 198, 198, 37811, 198, 35, 363, 19981, 13, 2302, 437, 796, 2163, 7, 4868, 11, 26235, 8, 1391, 198, 220, 1441, 9515, 13, 13083, 7, 12286, 82, 737, 445, 7234, 7, 8818, 7, 4134, 11, 1994, 8, 1391, 198, 220, 220, 220, 611, 7, 4906, 1659, 1351, 58, 2539, 60, 14512, 705, 917, 18156, 11537, 1441, 697, 198, 220, 220, 220, 697, 58, 2539, 60, 796, 26235, 58, 2539, 60, 198, 220, 220, 220, 1441, 697, 198, 220, 8964, 1351, 8, 198, 92, 198, 37811, 198 ]
2.632979
752
#!/usr/bin/python3.6.8+ # -*- coding:utf-8 -*- """ @auth: cml @date: 2020-12-2 @desc: ... """
[ 2, 48443, 14629, 14, 8800, 14, 29412, 18, 13, 21, 13, 23, 10, 198, 2, 532, 9, 12, 19617, 25, 40477, 12, 23, 532, 9, 12, 198, 37811, 198, 31, 18439, 25, 269, 4029, 198, 31, 4475, 25, 12131, 12, 1065, 12, 17, 198, 31, 20147, 25, 2644, 198, 37811, 628, 198 ]
1.846154
52
# -*- coding: utf-8 -*- """ pyboleto.html ~~~~~~~~~~~~~ Classe Responsvel por fazer o output do boleto em html. :copyright: 2012 by Artur Felipe de Sousa :license: BSD, see LICENSE for more details. """ import os import string import sys import codecs import base64 from itertools import chain if sys.version_info < (3,): from itertools import izip_longest as zip_longest zip_longest # chamando para evitar erro de nao uso do zip_longest else: from itertools import zip_longest DIGITS = [ ['n', 'n', 'w', 'w', 'n'], ['w', 'n', 'n', 'n', 'w'], ['n', 'w', 'n', 'n', 'w'], ['w', 'w', 'n', 'n', 'n'], ['n', 'n', 'w', 'n', 'w'], ['w', 'n', 'w', 'n', 'n'], ['n', 'w', 'w', 'n', 'n'], ['n', 'n', 'n', 'w', 'w'], ['w', 'n', 'n', 'w', 'n'], ['n', 'w', 'n', 'w', 'n'], ]
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 37811, 198, 220, 220, 220, 12972, 45693, 1462, 13, 6494, 198, 220, 220, 220, 220, 15116, 8728, 93, 628, 220, 220, 220, 1012, 21612, 20549, 626, 16964, 277, 19178, 267, 5072, 466, 1489, 293, 1462, 795, 27711, 13, 628, 220, 220, 220, 1058, 22163, 4766, 25, 220, 2321, 416, 3683, 333, 13937, 3757, 390, 311, 516, 64, 198, 220, 220, 220, 1058, 43085, 25, 347, 10305, 11, 766, 38559, 24290, 329, 517, 3307, 13, 198, 198, 37811, 198, 11748, 28686, 198, 11748, 4731, 198, 11748, 25064, 198, 11748, 40481, 82, 198, 11748, 2779, 2414, 198, 198, 6738, 340, 861, 10141, 1330, 6333, 198, 361, 25064, 13, 9641, 62, 10951, 1279, 357, 18, 11, 2599, 198, 220, 220, 220, 422, 340, 861, 10141, 1330, 220, 528, 541, 62, 6511, 395, 355, 19974, 62, 6511, 395, 198, 220, 220, 220, 19974, 62, 6511, 395, 220, 1303, 442, 321, 25440, 31215, 819, 7940, 1931, 305, 390, 299, 5488, 514, 78, 466, 19974, 62, 6511, 395, 198, 17772, 25, 198, 220, 220, 220, 422, 340, 861, 10141, 1330, 19974, 62, 6511, 395, 198, 198, 35, 3528, 29722, 796, 685, 198, 220, 220, 220, 37250, 77, 3256, 705, 77, 3256, 705, 86, 3256, 705, 86, 3256, 705, 77, 6, 4357, 198, 220, 220, 220, 37250, 86, 3256, 705, 77, 3256, 705, 77, 3256, 705, 77, 3256, 705, 86, 6, 4357, 198, 220, 220, 220, 37250, 77, 3256, 705, 86, 3256, 705, 77, 3256, 705, 77, 3256, 705, 86, 6, 4357, 198, 220, 220, 220, 37250, 86, 3256, 705, 86, 3256, 705, 77, 3256, 705, 77, 3256, 705, 77, 6, 4357, 198, 220, 220, 220, 37250, 77, 3256, 705, 77, 3256, 705, 86, 3256, 705, 77, 3256, 705, 86, 6, 4357, 198, 220, 220, 220, 37250, 86, 3256, 705, 77, 3256, 705, 86, 3256, 705, 77, 3256, 705, 77, 6, 4357, 198, 220, 220, 220, 37250, 77, 3256, 705, 86, 3256, 705, 86, 3256, 705, 77, 3256, 705, 77, 6, 4357, 198, 220, 220, 220, 37250, 77, 3256, 705, 77, 3256, 705, 77, 3256, 705, 86, 3256, 705, 86, 6, 4357, 198, 220, 220, 220, 37250, 86, 3256, 705, 77, 3256, 705, 77, 3256, 705, 86, 3256, 705, 77, 6, 4357, 198, 220, 220, 220, 37250, 77, 3256, 705, 86, 3256, 705, 77, 3256, 705, 86, 3256, 705, 77, 6, 4357, 198, 60, 628 ]
2.09204
402
summary = 0 i = 0 while i < 5: summary = summary + i print(summary) i = i + 1
[ 49736, 796, 657, 198, 198, 72, 796, 657, 198, 4514, 1312, 1279, 642, 25, 198, 220, 220, 220, 10638, 796, 10638, 1343, 1312, 198, 220, 220, 220, 3601, 7, 49736, 8, 198, 220, 220, 220, 1312, 796, 1312, 1343, 352, 198 ]
2.219512
41
import imtreat img = imtreat.imageManagerClass.openImageFunction("../images/soleil.png", 0) img = imtreat.definedModesClass.detailEnhanceFunction(img) imtreat.imageManagerClass.saveImageFunction("/Tlchargements/", "image_1", ".png", img)
[ 11748, 545, 83, 630, 198, 198, 9600, 796, 545, 83, 630, 13, 9060, 13511, 9487, 13, 9654, 5159, 22203, 7203, 40720, 17566, 14, 6753, 346, 13, 11134, 1600, 657, 8, 198, 198, 9600, 796, 545, 83, 630, 13, 23211, 44, 4147, 9487, 13, 49170, 35476, 590, 22203, 7, 9600, 8, 198, 198, 320, 83, 630, 13, 9060, 13511, 9487, 13, 21928, 5159, 22203, 7203, 14, 51, 75, 11121, 3196, 14, 1600, 366, 9060, 62, 16, 1600, 27071, 11134, 1600, 33705, 8, 198 ]
2.939024
82
# Copyright (c) 2016 TUBITAK BILGEM # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from oslo_config import cfg hyperv_opt_group = cfg.OptGroup("hyperv", title='The Hyper-V feature', help=""" The hyperv feature allows you to configure the Hyper-V hypervisor driver to be used within an OpenStack deployment. """) hyperv_opts = [ cfg.FloatOpt('dynamic_memory_ratio', default=1.0, help=""" Dynamic memory ratio Enables dynamic memory allocation (ballooning) when set to a value greater than 1. The value expresses the ratio between the total RAM assigned to an instance and its startup RAM amount. For example a ratio of 2.0 for an instance with 1024MB of RAM implies 512MB of RAM allocated at startup. Possible values: * 1.0: Disables dynamic memory allocation (Default). * Float values greater than 1.0: Enables allocation of total implied RAM divided by this value for startup. """), cfg.BoolOpt('enable_instance_metrics_collection', default=False, help=""" Enable instance metrics collection Enables metrics collections for an instance by using Hyper-V's metric APIs. Collected data can be retrieved by other apps and services, e.g.: Ceilometer. """), cfg.StrOpt('instances_path_share', default="", help=""" Instances path share The name of a Windows share mapped to the "instances_path" dir and used by the resize feature to copy files to the target host. If left blank, an administrative share (hidden network share) will be used, looking for the same "instances_path" used locally. Possible values: * "": An administrative share will be used (Default). * Name of a Windows share. Related options: * "instances_path": The directory which will be used if this option here is left blank. """), cfg.BoolOpt('limit_cpu_features', default=False, help=""" Limit CPU features This flag is needed to support live migration to hosts with different CPU features and checked during instance creation in order to limit the CPU features used by the instance. """), cfg.IntOpt('mounted_disk_query_retry_count', default=10, min=0, help=""" Mounted disk query retry count The number of times to retry checking for a mounted disk. The query runs until the device can be found or the retry count is reached. Possible values: * Positive integer values. Values greater than 1 is recommended (Default: 10). Related options: * Time interval between disk mount retries is declared with "mounted_disk_query_retry_interval" option. """), cfg.IntOpt('mounted_disk_query_retry_interval', default=5, min=0, help=""" Mounted disk query retry interval Interval between checks for a mounted disk, in seconds. Possible values: * Time in seconds (Default: 5). Related options: * This option is meaningful when the mounted_disk_query_retry_count is greater than 1. * The retry loop runs with mounted_disk_query_retry_count and mounted_disk_query_retry_interval configuration options. """), cfg.IntOpt('power_state_check_timeframe', default=60, min=0, help=""" Power state check timeframe The timeframe to be checked for instance power state changes. This option is used to fetch the state of the instance from Hyper-V through the WMI interface, within the specified timeframe. Possible values: * Timeframe in seconds (Default: 60). """), cfg.IntOpt('power_state_event_polling_interval', default=2, min=0, help=""" Power state event polling interval Instance power state change event polling frequency. Sets the listener interval for power state events to the given value. This option enhances the internal lifecycle notifications of instances that reboot themselves. It is unlikely that an operator has to change this value. Possible values: * Time in seconds (Default: 2). """), cfg.StrOpt('qemu_img_cmd', default="qemu-img.exe", help=""" qemu-img command qemu-img is required for some of the image related operations like converting between different image types. You can get it from here: (http://qemu.weilnetz.de/) or you can install the Cloudbase OpenStack Hyper-V Compute Driver (https://cloudbase.it/openstack-hyperv-driver/) which automatically sets the proper path for this config option. You can either give the full path of qemu-img.exe or set its path in the PATH environment variable and leave this option to the default value. Possible values: * Name of the qemu-img executable, in case it is in the same directory as the nova-compute service or its path is in the PATH environment variable (Default). * Path of qemu-img command (DRIVELETTER:\PATH\TO\QEMU-IMG\COMMAND). Related options: * If the config_drive_cdrom option is False, qemu-img will be used to convert the ISO to a VHD, otherwise the config drive will remain an ISO. To use config drive with Hyper-V, you must set the ``mkisofs_cmd`` value to the full path to an ``mkisofs.exe`` installation. """), cfg.StrOpt('vswitch_name', help=""" External virtual switch name The Hyper-V Virtual Switch is a software-based layer-2 Ethernet network switch that is available with the installation of the Hyper-V server role. The switch includes programmatically managed and extensible capabilities to connect virtual machines to both virtual networks and the physical network. In addition, Hyper-V Virtual Switch provides policy enforcement for security, isolation, and service levels. The vSwitch represented by this config option must be an external one (not internal or private). Possible values: * If not provided, the first of a list of available vswitches is used. This list is queried using WQL. * Virtual switch name. """), cfg.IntOpt('wait_soft_reboot_seconds', default=60, min=0, help=""" Wait soft reboot seconds Number of seconds to wait for instance to shut down after soft reboot request is made. We fall back to hard reboot if instance does not shutdown within this window. Possible values: * Time in seconds (Default: 60). """), cfg.BoolOpt('config_drive_cdrom', default=False, help=""" Mount config drive as a CD drive. OpenStack can be configured to write instance metadata to a config drive, which is then attached to the instance before it boots. The config drive can be attached as a disk drive (default) or as a CD drive. Related options: * This option is meaningful with ``force_config_drive`` option set to ``True`` or when the REST API call to create an instance will have ``--config-drive=True`` flag. * ``config_drive_format`` option must be set to ``iso9660`` in order to use CD drive as the config drive image. * To use config drive with Hyper-V, you must set the ``mkisofs_cmd`` value to the full path to an ``mkisofs.exe`` installation. Additionally, you must set the ``qemu_img_cmd`` value to the full path to an ``qemu-img`` command installation. * You can configure the Compute service to always create a configuration drive by setting the ``force_config_drive`` option to ``True``. """), cfg.BoolOpt('config_drive_inject_password', default=False, help=""" Inject password to config drive. When enabled, the admin password will be available from the config drive image. Related options: * This option is meaningful when used with other options that enable config drive usage with Hyper-V, such as ``force_config_drive``. """), cfg.IntOpt('volume_attach_retry_count', default=10, min=0, help=""" Volume attach retry count The number of times to retry attaching a volume. Volume attachment is retried until success or the given retry count is reached. Possible values: * Positive integer values (Default: 10). Related options: * Time interval between attachment attempts is declared with volume_attach_retry_interval option. """), cfg.IntOpt('volume_attach_retry_interval', default=5, min=0, help=""" Volume attach retry interval Interval between volume attachment attempts, in seconds. Possible values: * Time in seconds (Default: 5). Related options: * This options is meaningful when volume_attach_retry_count is greater than 1. * The retry loop runs with volume_attach_retry_count and volume_attach_retry_interval configuration options. """), cfg.BoolOpt('enable_remotefx', default=False, help=""" Enable RemoteFX feature This requires at least one DirectX 11 capable graphics adapter for Windows / Hyper-V Server 2012 R2 or newer and RDS-Virtualization feature has to be enabled. Instances with RemoteFX can be requested with the following flavor extra specs: **os:resolution**. Guest VM screen resolution size. Acceptable values:: 1024x768, 1280x1024, 1600x1200, 1920x1200, 2560x1600, 3840x2160 ``3840x2160`` is only available on Windows / Hyper-V Server 2016. **os:monitors**. Guest VM number of monitors. Acceptable values:: [1, 4] - Windows / Hyper-V Server 2012 R2 [1, 8] - Windows / Hyper-V Server 2016 **os:vram**. Guest VM VRAM amount. Only available on Windows / Hyper-V Server 2016. Acceptable values:: 64, 128, 256, 512, 1024 """), cfg.BoolOpt('use_multipath_io', default=False, help=""" Use multipath connections when attaching iSCSI or FC disks. This requires the Multipath IO Windows feature to be enabled. MPIO must be configured to claim such devices. """), cfg.ListOpt('iscsi_initiator_list', default=[], help=""" List of iSCSI initiators that will be used for estabilishing iSCSI sessions. If none are specified, the Microsoft iSCSI initiator service will choose the initiator. """) ]
[ 2, 15069, 357, 66, 8, 1584, 309, 10526, 2043, 10206, 347, 4146, 38, 3620, 198, 2, 1439, 6923, 33876, 13, 198, 2, 198, 2, 220, 220, 220, 49962, 739, 262, 24843, 13789, 11, 10628, 362, 13, 15, 357, 1169, 366, 34156, 15341, 345, 743, 198, 2, 220, 220, 220, 407, 779, 428, 2393, 2845, 287, 11846, 351, 262, 13789, 13, 921, 743, 7330, 198, 2, 220, 220, 220, 257, 4866, 286, 262, 13789, 379, 198, 2, 198, 2, 220, 220, 220, 220, 220, 220, 220, 220, 2638, 1378, 2503, 13, 43073, 13, 2398, 14, 677, 4541, 14, 43, 2149, 24290, 12, 17, 13, 15, 198, 2, 198, 2, 220, 220, 220, 17486, 2672, 416, 9723, 1099, 393, 4987, 284, 287, 3597, 11, 3788, 198, 2, 220, 220, 220, 9387, 739, 262, 13789, 318, 9387, 319, 281, 366, 1921, 3180, 1, 29809, 1797, 11, 42881, 198, 2, 220, 220, 220, 34764, 11015, 6375, 7102, 49828, 11053, 3963, 15529, 509, 12115, 11, 2035, 4911, 393, 17142, 13, 4091, 262, 198, 2, 220, 220, 220, 13789, 329, 262, 2176, 3303, 15030, 21627, 290, 11247, 198, 2, 220, 220, 220, 739, 262, 13789, 13, 198, 198, 6738, 28686, 5439, 62, 11250, 1330, 30218, 70, 198, 198, 49229, 85, 62, 8738, 62, 8094, 796, 30218, 70, 13, 27871, 13247, 7203, 49229, 85, 1600, 198, 220, 220, 220, 3670, 11639, 464, 15079, 12, 53, 3895, 3256, 198, 220, 220, 220, 1037, 2625, 15931, 198, 464, 8718, 85, 3895, 3578, 345, 284, 17425, 262, 15079, 12, 53, 8718, 13131, 198, 26230, 284, 307, 973, 1626, 281, 4946, 25896, 14833, 13, 198, 15931, 4943, 198, 198, 49229, 85, 62, 404, 912, 796, 685, 198, 220, 220, 220, 30218, 70, 13, 43879, 27871, 10786, 67, 28995, 62, 31673, 62, 10366, 952, 3256, 198, 220, 220, 220, 220, 220, 220, 220, 4277, 28, 16, 13, 15, 11, 198, 220, 220, 220, 220, 220, 220, 220, 1037, 2625, 15931, 198, 44090, 4088, 8064, 198, 198, 4834, 2977, 8925, 4088, 20157, 357, 1894, 2049, 278, 8, 618, 900, 284, 257, 1988, 198, 18223, 263, 621, 352, 13, 383, 1988, 27505, 262, 8064, 1022, 262, 2472, 13931, 198, 562, 3916, 284, 281, 4554, 290, 663, 13693, 13931, 2033, 13, 1114, 1672, 257, 198, 10366, 952, 286, 362, 13, 15, 329, 281, 4554, 351, 28119, 10744, 286, 13931, 15565, 22243, 10744, 286, 198, 24115, 19171, 379, 13693, 13, 198, 198, 47, 4733, 3815, 25, 198, 198, 9, 352, 13, 15, 25, 3167, 2977, 8925, 4088, 20157, 357, 19463, 737, 198, 9, 48436, 3815, 3744, 621, 352, 13, 15, 25, 2039, 2977, 20157, 286, 2472, 17142, 198, 220, 13931, 9086, 416, 428, 1988, 329, 13693, 13, 198, 15931, 12340, 198, 220, 220, 220, 30218, 70, 13, 33, 970, 27871, 10786, 21633, 62, 39098, 62, 4164, 10466, 62, 43681, 3256, 198, 220, 220, 220, 220, 220, 220, 220, 4277, 28, 25101, 11, 198, 220, 220, 220, 220, 220, 220, 220, 1037, 2625, 15931, 198, 36695, 4554, 20731, 4947, 198, 198, 4834, 2977, 20731, 17268, 329, 281, 4554, 416, 1262, 15079, 12, 53, 338, 198, 4164, 1173, 23113, 13, 9745, 276, 1366, 460, 307, 29517, 416, 584, 6725, 290, 198, 30416, 11, 304, 13, 70, 11207, 20101, 346, 15635, 13, 198, 15931, 12340, 198, 220, 220, 220, 30218, 70, 13, 13290, 27871, 10786, 8625, 1817, 62, 6978, 62, 20077, 3256, 198, 220, 220, 220, 220, 220, 220, 220, 4277, 2625, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 1037, 2625, 15931, 198, 6310, 1817, 3108, 2648, 198, 198, 464, 1438, 286, 257, 3964, 2648, 27661, 284, 262, 366, 8625, 1817, 62, 6978, 1, 26672, 198, 392, 973, 416, 262, 47558, 3895, 284, 4866, 3696, 284, 262, 2496, 2583, 13, 198, 1532, 1364, 9178, 11, 281, 11553, 2648, 357, 30342, 3127, 2648, 8, 481, 198, 1350, 973, 11, 2045, 329, 262, 976, 366, 8625, 1817, 62, 6978, 1, 973, 15726, 13, 198, 198, 47, 4733, 3815, 25, 198, 198, 9, 366, 1298, 1052, 11553, 2648, 481, 307, 973, 357, 19463, 737, 198, 9, 6530, 286, 257, 3964, 2648, 13, 198, 198, 9819, 3689, 25, 198, 198, 9, 366, 8625, 1817, 62, 6978, 1298, 383, 8619, 543, 481, 307, 973, 611, 428, 3038, 198, 220, 994, 318, 1364, 9178, 13, 198, 15931, 12340, 198, 220, 220, 220, 30218, 70, 13, 33, 970, 27871, 10786, 32374, 62, 36166, 62, 40890, 3256, 198, 220, 220, 220, 220, 220, 220, 220, 4277, 28, 25101, 11, 198, 220, 220, 220, 220, 220, 220, 220, 1037, 2625, 15931, 198, 39184, 9135, 3033, 198, 198, 1212, 6056, 318, 2622, 284, 1104, 2107, 13472, 284, 11453, 351, 198, 39799, 9135, 3033, 290, 10667, 1141, 4554, 6282, 198, 259, 1502, 284, 4179, 262, 9135, 3033, 973, 416, 262, 4554, 13, 198, 15931, 12340, 198, 220, 220, 220, 30218, 70, 13, 5317, 27871, 10786, 29728, 62, 39531, 62, 22766, 62, 1186, 563, 62, 9127, 3256, 198, 220, 220, 220, 220, 220, 220, 220, 4277, 28, 940, 11, 198, 220, 220, 220, 220, 220, 220, 220, 949, 28, 15, 11, 198, 220, 220, 220, 220, 220, 220, 220, 1037, 2625, 15931, 198, 35452, 276, 11898, 12405, 1005, 563, 954, 198, 198, 464, 1271, 286, 1661, 284, 1005, 563, 10627, 329, 257, 12623, 11898, 13, 198, 464, 12405, 4539, 1566, 262, 3335, 460, 307, 1043, 393, 262, 1005, 563, 198, 9127, 318, 4251, 13, 198, 198, 47, 4733, 3815, 25, 198, 198, 9, 33733, 18253, 3815, 13, 27068, 3744, 621, 352, 318, 7151, 198, 220, 357, 19463, 25, 838, 737, 198, 198, 9819, 3689, 25, 198, 198, 9, 3862, 16654, 1022, 11898, 3817, 1005, 1678, 318, 6875, 351, 198, 220, 366, 29728, 62, 39531, 62, 22766, 62, 1186, 563, 62, 3849, 2100, 1, 3038, 13, 198, 15931, 12340, 198, 220, 220, 220, 30218, 70, 13, 5317, 27871, 10786, 29728, 62, 39531, 62, 22766, 62, 1186, 563, 62, 3849, 2100, 3256, 198, 220, 220, 220, 220, 220, 220, 220, 4277, 28, 20, 11, 198, 220, 220, 220, 220, 220, 220, 220, 949, 28, 15, 11, 198, 220, 220, 220, 220, 220, 220, 220, 1037, 2625, 15931, 198, 35452, 276, 11898, 12405, 1005, 563, 16654, 198, 198, 9492, 2100, 1022, 8794, 329, 257, 12623, 11898, 11, 287, 4201, 13, 198, 198, 47, 4733, 3815, 25, 198, 198, 9, 3862, 287, 4201, 357, 19463, 25, 642, 737, 198, 198, 9819, 3689, 25, 198, 198, 9, 770, 3038, 318, 11570, 618, 262, 12623, 62, 39531, 62, 22766, 62, 1186, 563, 62, 9127, 198, 220, 318, 3744, 621, 352, 13, 198, 9, 383, 1005, 563, 9052, 4539, 351, 12623, 62, 39531, 62, 22766, 62, 1186, 563, 62, 9127, 290, 198, 220, 12623, 62, 39531, 62, 22766, 62, 1186, 563, 62, 3849, 2100, 8398, 3689, 13, 198, 15931, 12340, 198, 220, 220, 220, 30218, 70, 13, 5317, 27871, 10786, 6477, 62, 5219, 62, 9122, 62, 2435, 14535, 3256, 198, 220, 220, 220, 220, 220, 220, 220, 4277, 28, 1899, 11, 198, 220, 220, 220, 220, 220, 220, 220, 949, 28, 15, 11, 198, 220, 220, 220, 220, 220, 220, 220, 1037, 2625, 15931, 198, 13434, 1181, 2198, 41352, 198, 198, 464, 41352, 284, 307, 10667, 329, 4554, 1176, 1181, 2458, 13, 198, 1212, 3038, 318, 973, 284, 21207, 262, 1181, 286, 262, 4554, 422, 15079, 12, 53, 198, 9579, 262, 370, 8895, 7071, 11, 1626, 262, 7368, 41352, 13, 198, 198, 47, 4733, 3815, 25, 198, 198, 9, 3862, 14535, 287, 4201, 357, 19463, 25, 3126, 737, 198, 15931, 12340, 198, 220, 220, 220, 30218, 70, 13, 5317, 27871, 10786, 6477, 62, 5219, 62, 15596, 62, 30393, 278, 62, 3849, 2100, 3256, 198, 220, 220, 220, 220, 220, 220, 220, 4277, 28, 17, 11, 198, 220, 220, 220, 220, 220, 220, 220, 949, 28, 15, 11, 198, 220, 220, 220, 220, 220, 220, 220, 1037, 2625, 15931, 198, 13434, 1181, 1785, 13985, 16654, 198, 198, 33384, 1176, 1181, 1487, 1785, 13985, 8373, 13, 21394, 262, 198, 4868, 877, 16654, 329, 1176, 1181, 2995, 284, 262, 1813, 1988, 13, 198, 1212, 3038, 32479, 262, 5387, 3868, 47510, 19605, 286, 198, 8625, 1817, 326, 20149, 2405, 13, 632, 318, 7485, 326, 281, 10088, 198, 10134, 284, 1487, 428, 1988, 13, 198, 198, 47, 4733, 3815, 25, 198, 198, 9, 3862, 287, 4201, 357, 19463, 25, 362, 737, 198, 15931, 12340, 198, 220, 220, 220, 30218, 70, 13, 13290, 27871, 10786, 80, 368, 84, 62, 9600, 62, 28758, 3256, 198, 220, 220, 220, 220, 220, 220, 220, 4277, 2625, 80, 368, 84, 12, 9600, 13, 13499, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 1037, 2625, 15931, 198, 80, 368, 84, 12, 9600, 3141, 198, 198, 80, 368, 84, 12, 9600, 318, 2672, 329, 617, 286, 262, 2939, 3519, 4560, 198, 2339, 23202, 1022, 1180, 2939, 3858, 13, 921, 460, 651, 340, 198, 6738, 994, 25, 357, 4023, 1378, 80, 368, 84, 13, 732, 346, 3262, 89, 13, 2934, 34729, 393, 345, 460, 2721, 262, 198, 18839, 8692, 4946, 25896, 15079, 12, 53, 3082, 1133, 12434, 198, 7, 5450, 1378, 17721, 8692, 13, 270, 14, 9654, 25558, 12, 49229, 85, 12, 26230, 34729, 543, 6338, 198, 28709, 262, 1774, 3108, 329, 428, 4566, 3038, 13, 921, 460, 2035, 1577, 262, 198, 12853, 3108, 286, 10662, 368, 84, 12, 9600, 13, 13499, 393, 900, 663, 3108, 287, 262, 46490, 2858, 198, 45286, 290, 2666, 428, 3038, 284, 262, 4277, 1988, 13, 198, 198, 47, 4733, 3815, 25, 198, 198, 9, 6530, 286, 262, 10662, 368, 84, 12, 9600, 28883, 11, 287, 1339, 340, 318, 287, 262, 976, 198, 220, 8619, 355, 262, 645, 6862, 12, 5589, 1133, 2139, 393, 663, 3108, 318, 287, 262, 198, 220, 46490, 2858, 7885, 357, 19463, 737, 198, 9, 10644, 286, 10662, 368, 84, 12, 9600, 3141, 357, 7707, 9306, 28882, 5781, 7479, 34219, 59, 10468, 59, 48, 3620, 52, 12, 3955, 38, 59, 9858, 44, 6981, 737, 198, 198, 9819, 3689, 25, 198, 198, 9, 1002, 262, 4566, 62, 19472, 62, 10210, 398, 3038, 318, 10352, 11, 10662, 368, 84, 12, 9600, 481, 307, 973, 284, 198, 220, 10385, 262, 19694, 284, 257, 569, 10227, 11, 4306, 262, 4566, 3708, 481, 198, 220, 3520, 281, 19694, 13, 1675, 779, 4566, 3708, 351, 15079, 12, 53, 11, 345, 1276, 198, 220, 900, 262, 7559, 28015, 271, 1659, 82, 62, 28758, 15506, 1988, 284, 262, 1336, 3108, 284, 281, 7559, 28015, 271, 1659, 82, 13, 13499, 15506, 198, 220, 9988, 13, 198, 15931, 12340, 198, 220, 220, 220, 30218, 70, 13, 13290, 27871, 10786, 85, 31943, 62, 3672, 3256, 198, 220, 220, 220, 220, 220, 220, 220, 1037, 2625, 15931, 198, 41506, 7166, 5078, 1438, 198, 198, 464, 15079, 12, 53, 15595, 14645, 318, 257, 3788, 12, 3106, 7679, 12, 17, 31903, 198, 27349, 5078, 326, 318, 1695, 351, 262, 9988, 286, 262, 198, 38197, 12, 53, 4382, 2597, 13, 383, 5078, 3407, 1430, 49454, 5257, 198, 392, 1070, 27339, 9889, 284, 2018, 7166, 8217, 284, 1111, 198, 32844, 7686, 290, 262, 3518, 3127, 13, 554, 3090, 11, 15079, 12, 53, 198, 37725, 14645, 3769, 2450, 5394, 329, 2324, 11, 15133, 11, 198, 392, 2139, 2974, 13, 383, 410, 38978, 7997, 416, 428, 4566, 3038, 198, 27238, 307, 281, 7097, 530, 357, 1662, 5387, 393, 2839, 737, 198, 198, 47, 4733, 3815, 25, 198, 198, 9, 1002, 407, 2810, 11, 262, 717, 286, 257, 1351, 286, 1695, 410, 2032, 9249, 198, 220, 318, 973, 13, 770, 1351, 318, 42517, 798, 1262, 370, 9711, 13, 198, 9, 15595, 5078, 1438, 13, 198, 15931, 12340, 198, 220, 220, 220, 30218, 70, 13, 5317, 27871, 10786, 17077, 62, 4215, 62, 260, 18769, 62, 43012, 3256, 198, 220, 220, 220, 220, 220, 220, 220, 4277, 28, 1899, 11, 198, 220, 220, 220, 220, 220, 220, 220, 949, 28, 15, 11, 198, 220, 220, 220, 220, 220, 220, 220, 1037, 2625, 15931, 198, 21321, 2705, 20149, 4201, 198, 198, 15057, 286, 4201, 284, 4043, 329, 4554, 284, 4423, 866, 706, 2705, 198, 260, 18769, 2581, 318, 925, 13, 775, 2121, 736, 284, 1327, 20149, 611, 4554, 198, 22437, 407, 18325, 1626, 428, 4324, 13, 198, 198, 47, 4733, 3815, 25, 198, 198, 9, 3862, 287, 4201, 357, 19463, 25, 3126, 737, 198, 15931, 12340, 198, 220, 220, 220, 30218, 70, 13, 33, 970, 27871, 10786, 11250, 62, 19472, 62, 10210, 398, 3256, 198, 220, 220, 220, 220, 220, 220, 220, 4277, 28, 25101, 11, 198, 220, 220, 220, 220, 220, 220, 220, 1037, 2625, 15931, 198, 35452, 4566, 3708, 355, 257, 6458, 3708, 13, 198, 198, 11505, 25896, 460, 307, 17839, 284, 3551, 4554, 20150, 284, 257, 4566, 3708, 11, 543, 198, 271, 788, 7223, 284, 262, 4554, 878, 340, 14412, 13, 383, 4566, 3708, 460, 307, 198, 1078, 2317, 355, 257, 11898, 3708, 357, 12286, 8, 393, 355, 257, 6458, 3708, 13, 198, 198, 9819, 3689, 25, 198, 198, 9, 770, 3038, 318, 11570, 351, 7559, 3174, 62, 11250, 62, 19472, 15506, 3038, 900, 284, 7559, 17821, 15506, 198, 220, 393, 618, 262, 30617, 7824, 869, 284, 2251, 281, 4554, 481, 423, 198, 220, 7559, 438, 11250, 12, 19472, 28, 17821, 15506, 6056, 13, 198, 9, 7559, 11250, 62, 19472, 62, 18982, 15506, 3038, 1276, 307, 900, 284, 7559, 26786, 4846, 1899, 15506, 287, 1502, 284, 779, 198, 220, 6458, 3708, 355, 262, 4566, 3708, 2939, 13, 198, 9, 1675, 779, 4566, 3708, 351, 15079, 12, 53, 11, 345, 1276, 900, 262, 198, 220, 7559, 28015, 271, 1659, 82, 62, 28758, 15506, 1988, 284, 262, 1336, 3108, 284, 281, 7559, 28015, 271, 1659, 82, 13, 13499, 15506, 9988, 13, 198, 220, 12032, 11, 345, 1276, 900, 262, 7559, 80, 368, 84, 62, 9600, 62, 28758, 15506, 1988, 284, 262, 1336, 3108, 198, 220, 284, 281, 7559, 80, 368, 84, 12, 9600, 15506, 3141, 9988, 13, 198, 9, 921, 460, 17425, 262, 3082, 1133, 2139, 284, 1464, 2251, 257, 8398, 198, 220, 3708, 416, 4634, 262, 7559, 3174, 62, 11250, 62, 19472, 15506, 3038, 284, 7559, 17821, 15506, 13, 198, 15931, 12340, 198, 220, 220, 220, 30218, 70, 13, 33, 970, 27871, 10786, 11250, 62, 19472, 62, 259, 752, 62, 28712, 3256, 198, 220, 220, 220, 220, 220, 220, 220, 4277, 28, 25101, 11, 198, 220, 220, 220, 220, 220, 220, 220, 1037, 2625, 15931, 198, 818, 752, 9206, 284, 4566, 3708, 13, 198, 198, 2215, 9343, 11, 262, 13169, 9206, 481, 307, 1695, 422, 262, 4566, 3708, 2939, 13, 198, 198, 9819, 3689, 25, 198, 198, 9, 770, 3038, 318, 11570, 618, 973, 351, 584, 3689, 326, 7139, 198, 220, 4566, 3708, 8748, 351, 15079, 12, 53, 11, 884, 355, 7559, 3174, 62, 11250, 62, 19472, 15506, 13, 198, 15931, 12340, 198, 220, 220, 220, 30218, 70, 13, 5317, 27871, 10786, 29048, 62, 47348, 62, 1186, 563, 62, 9127, 3256, 198, 220, 220, 220, 220, 220, 220, 220, 4277, 28, 940, 11, 198, 220, 220, 220, 220, 220, 220, 220, 949, 28, 15, 11, 198, 220, 220, 220, 220, 220, 220, 220, 1037, 2625, 15931, 198, 31715, 10199, 1005, 563, 954, 198, 198, 464, 1271, 286, 1661, 284, 1005, 563, 39550, 257, 6115, 13, 14701, 18231, 198, 271, 1005, 2228, 1566, 1943, 393, 262, 1813, 1005, 563, 954, 318, 4251, 13, 198, 198, 47, 4733, 3815, 25, 198, 198, 9, 33733, 18253, 3815, 357, 19463, 25, 838, 737, 198, 198, 9819, 3689, 25, 198, 198, 9, 3862, 16654, 1022, 18231, 6370, 318, 6875, 351, 198, 220, 6115, 62, 47348, 62, 1186, 563, 62, 3849, 2100, 3038, 13, 198, 15931, 12340, 198, 220, 220, 220, 30218, 70, 13, 5317, 27871, 10786, 29048, 62, 47348, 62, 1186, 563, 62, 3849, 2100, 3256, 198, 220, 220, 220, 220, 220, 220, 220, 4277, 28, 20, 11, 198, 220, 220, 220, 220, 220, 220, 220, 949, 28, 15, 11, 198, 220, 220, 220, 220, 220, 220, 220, 1037, 2625, 15931, 198, 31715, 10199, 1005, 563, 16654, 198, 198, 9492, 2100, 1022, 6115, 18231, 6370, 11, 287, 4201, 13, 198, 198, 47, 4733, 3815, 25, 198, 198, 9, 3862, 287, 4201, 357, 19463, 25, 642, 737, 198, 198, 9819, 3689, 25, 198, 198, 9, 770, 3689, 318, 11570, 618, 6115, 62, 47348, 62, 1186, 563, 62, 9127, 198, 220, 318, 3744, 621, 352, 13, 198, 9, 383, 1005, 563, 9052, 4539, 351, 6115, 62, 47348, 62, 1186, 563, 62, 9127, 290, 198, 220, 6115, 62, 47348, 62, 1186, 563, 62, 3849, 2100, 8398, 3689, 13, 198, 15931, 12340, 198, 220, 220, 220, 30218, 70, 13, 33, 970, 27871, 10786, 21633, 62, 2787, 313, 891, 87, 3256, 198, 220, 220, 220, 220, 220, 220, 220, 4277, 28, 25101, 11, 198, 220, 220, 220, 220, 220, 220, 220, 1037, 2625, 15931, 198, 36695, 21520, 17213, 3895, 198, 198, 1212, 4433, 379, 1551, 530, 37017, 1367, 6007, 9382, 21302, 329, 198, 11209, 1220, 15079, 12, 53, 9652, 2321, 371, 17, 393, 15064, 290, 371, 5258, 12, 37725, 1634, 198, 30053, 468, 284, 307, 9343, 13, 198, 198, 6310, 1817, 351, 21520, 17213, 460, 307, 9167, 351, 262, 1708, 9565, 198, 26086, 25274, 25, 198, 198, 1174, 418, 25, 29268, 1174, 13, 22358, 16990, 3159, 6323, 2546, 13, 21699, 540, 3815, 3712, 628, 220, 220, 220, 28119, 87, 30610, 11, 37674, 87, 35500, 11, 26143, 87, 27550, 11, 14062, 87, 27550, 11, 1679, 1899, 87, 36150, 11, 4353, 1821, 87, 17, 14198, 198, 198, 15506, 2548, 1821, 87, 17, 14198, 15506, 318, 691, 1695, 319, 3964, 1220, 15079, 12, 53, 9652, 1584, 13, 198, 198, 1174, 418, 25, 2144, 6742, 1174, 13, 22358, 16990, 1271, 286, 19374, 13, 21699, 540, 3815, 3712, 628, 220, 220, 220, 685, 16, 11, 604, 60, 532, 3964, 1220, 15079, 12, 53, 9652, 2321, 371, 17, 198, 220, 220, 220, 685, 16, 11, 807, 60, 532, 3964, 1220, 15079, 12, 53, 9652, 1584, 198, 198, 1174, 418, 25, 85, 859, 1174, 13, 22358, 16990, 6453, 2390, 2033, 13, 5514, 1695, 319, 198, 11209, 1220, 15079, 12, 53, 9652, 1584, 13, 21699, 540, 3815, 3712, 628, 220, 220, 220, 5598, 11, 13108, 11, 17759, 11, 22243, 11, 28119, 198, 15931, 12340, 198, 220, 220, 220, 30218, 70, 13, 33, 970, 27871, 10786, 1904, 62, 16680, 541, 776, 62, 952, 3256, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 4277, 28, 25101, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1037, 2625, 15931, 198, 11041, 18540, 776, 8787, 618, 39550, 1312, 6173, 11584, 393, 10029, 32505, 13, 198, 198, 1212, 4433, 262, 7854, 541, 776, 24418, 3964, 3895, 284, 307, 9343, 13, 4904, 9399, 1276, 307, 198, 11250, 1522, 284, 1624, 884, 4410, 13, 198, 15931, 12340, 198, 220, 220, 220, 30218, 70, 13, 8053, 27871, 10786, 2304, 13396, 62, 259, 8846, 1352, 62, 4868, 3256, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 4277, 41888, 4357, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1037, 2625, 15931, 198, 8053, 286, 1312, 6173, 11584, 5383, 2024, 326, 481, 307, 973, 329, 2803, 346, 3929, 1312, 6173, 11584, 10991, 13, 198, 198, 1532, 4844, 389, 7368, 11, 262, 5413, 1312, 6173, 11584, 5383, 1352, 2139, 481, 3853, 262, 198, 259, 8846, 1352, 13, 198, 15931, 4943, 198, 60, 628, 198 ]
3.21266
3,207
import requests words_list = requests.get("https://raw.githubusercontent.com/atebits/Words/master/Words/fr.txt").text words_list = filter(lambda x: len(x) > 4, words_list.split('\n')) path = input("Chemin d'criture ? (words.txt) ") if path == "": path = "./words.txt" with open(path, "w", encoding="utf-8") as file: file.write('\n'.join(words_list))
[ 11748, 7007, 198, 198, 10879, 62, 4868, 796, 7007, 13, 1136, 7203, 5450, 1378, 1831, 13, 12567, 43667, 13, 785, 14, 378, 9895, 14, 37117, 14, 9866, 14, 37117, 14, 8310, 13, 14116, 11074, 5239, 198, 198, 10879, 62, 4868, 796, 8106, 7, 50033, 2124, 25, 18896, 7, 87, 8, 1875, 604, 11, 2456, 62, 4868, 13, 35312, 10786, 59, 77, 6, 4008, 198, 198, 6978, 796, 5128, 7203, 7376, 1084, 288, 6, 22213, 495, 5633, 357, 10879, 13, 14116, 8, 366, 8, 198, 198, 361, 3108, 6624, 366, 1298, 198, 220, 220, 220, 3108, 796, 366, 19571, 10879, 13, 14116, 1, 198, 198, 4480, 1280, 7, 6978, 11, 366, 86, 1600, 21004, 2625, 40477, 12, 23, 4943, 355, 2393, 25, 198, 220, 220, 220, 2393, 13, 13564, 10786, 59, 77, 4458, 22179, 7, 10879, 62, 4868, 4008 ]
2.623188
138
import unittest from unittest import mock import os import subprocess from testfixtures import TempDirectory from simplegallery.upload.uploader_factory import get_uploader if __name__ == '__main__': unittest.main()
[ 11748, 555, 715, 395, 198, 6738, 555, 715, 395, 1330, 15290, 198, 11748, 28686, 198, 11748, 850, 14681, 198, 6738, 1332, 69, 25506, 1330, 24189, 43055, 198, 6738, 2829, 24460, 13, 25850, 13, 25850, 263, 62, 69, 9548, 1330, 651, 62, 25850, 263, 628, 198, 198, 361, 11593, 3672, 834, 6624, 705, 834, 12417, 834, 10354, 198, 220, 220, 220, 555, 715, 395, 13, 12417, 3419, 198 ]
3.313433
67
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'add_subject.ui' # # Created by: PyQt4 UI code generator 4.11.4 # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, QtGui try: _fromUtf8 = QtCore.QString.fromUtf8 except AttributeError: try: _encoding = QtGui.QApplication.UnicodeUTF8 except AttributeError: if __name__ == "__main__": import sys app = QtGui.QApplication(sys.argv) Dialog_add_subject = QtGui.QDialog() ui = Ui_Dialog_add_subject() ui.setupUi(Dialog_add_subject) Dialog_add_subject.show() sys.exit(app.exec_())
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 201, 198, 201, 198, 2, 5178, 7822, 7560, 422, 3555, 334, 72, 2393, 705, 2860, 62, 32796, 13, 9019, 6, 201, 198, 2, 201, 198, 2, 15622, 416, 25, 9485, 48, 83, 19, 12454, 2438, 17301, 604, 13, 1157, 13, 19, 201, 198, 2, 201, 198, 2, 39410, 0, 1439, 2458, 925, 287, 428, 2393, 481, 307, 2626, 0, 201, 198, 201, 198, 6738, 9485, 48, 83, 19, 1330, 33734, 14055, 11, 33734, 8205, 72, 201, 198, 201, 198, 28311, 25, 201, 198, 220, 220, 220, 4808, 6738, 18274, 69, 23, 796, 33734, 14055, 13, 48, 10100, 13, 6738, 18274, 69, 23, 201, 198, 16341, 3460, 4163, 12331, 25, 201, 198, 201, 198, 28311, 25, 201, 198, 220, 220, 220, 4808, 12685, 7656, 796, 33734, 8205, 72, 13, 48, 23416, 13, 3118, 291, 1098, 48504, 23, 201, 198, 16341, 3460, 4163, 12331, 25, 201, 198, 201, 198, 201, 198, 361, 11593, 3672, 834, 6624, 366, 834, 12417, 834, 1298, 201, 198, 220, 220, 220, 1330, 25064, 201, 198, 220, 220, 220, 598, 796, 33734, 8205, 72, 13, 48, 23416, 7, 17597, 13, 853, 85, 8, 201, 198, 220, 220, 220, 21269, 519, 62, 2860, 62, 32796, 796, 33734, 8205, 72, 13, 48, 44204, 3419, 201, 198, 220, 220, 220, 334, 72, 796, 471, 72, 62, 44204, 62, 2860, 62, 32796, 3419, 201, 198, 220, 220, 220, 334, 72, 13, 40406, 52, 72, 7, 44204, 62, 2860, 62, 32796, 8, 201, 198, 220, 220, 220, 21269, 519, 62, 2860, 62, 32796, 13, 12860, 3419, 201, 198, 220, 220, 220, 25064, 13, 37023, 7, 1324, 13, 18558, 62, 28955, 201, 198, 201, 198 ]
2.302817
284
from django.db.models import signals from django.test import TestCase from django.core import management from django.utils import six from shared_models import models PRE_SYNCDB_ARGS = ['app', 'create_models', 'verbosity', 'interactive', 'db'] SYNCDB_DATABASE = 'default' SYNCDB_VERBOSITY = 1 SYNCDB_INTERACTIVE = False # We connect receiver here and not in unit test code because we need to # connect receiver before test runner creates database. That is, sequence of # actions would be: # # 1. Test runner imports this module. # 2. We connect receiver. # 3. Test runner calls syncdb for create default database. # 4. Test runner execute our unit test code. pre_syncdb_receiver = OneTimeReceiver() signals.pre_syncdb.connect(pre_syncdb_receiver, sender=models)
[ 6738, 42625, 14208, 13, 9945, 13, 27530, 1330, 10425, 198, 6738, 42625, 14208, 13, 9288, 1330, 6208, 20448, 198, 6738, 42625, 14208, 13, 7295, 1330, 4542, 198, 6738, 42625, 14208, 13, 26791, 1330, 2237, 198, 198, 6738, 4888, 62, 27530, 1330, 4981, 628, 198, 46437, 62, 23060, 7792, 11012, 62, 1503, 14313, 796, 37250, 1324, 3256, 705, 17953, 62, 27530, 3256, 705, 19011, 16579, 3256, 705, 3849, 5275, 3256, 705, 9945, 20520, 198, 23060, 7792, 11012, 62, 35, 1404, 6242, 11159, 796, 705, 12286, 6, 198, 23060, 7792, 11012, 62, 5959, 33, 2640, 9050, 796, 352, 198, 23060, 7792, 11012, 62, 41358, 10659, 9306, 796, 10352, 628, 628, 198, 2, 775, 2018, 9733, 994, 290, 407, 287, 4326, 1332, 2438, 780, 356, 761, 284, 198, 2, 2018, 9733, 878, 1332, 17490, 8075, 6831, 13, 220, 1320, 318, 11, 8379, 286, 198, 2, 4028, 561, 307, 25, 198, 2, 198, 2, 220, 220, 352, 13, 6208, 17490, 17944, 428, 8265, 13, 198, 2, 220, 220, 362, 13, 775, 2018, 9733, 13, 198, 2, 220, 220, 513, 13, 6208, 17490, 3848, 17510, 9945, 329, 2251, 4277, 6831, 13, 198, 2, 220, 220, 604, 13, 6208, 17490, 12260, 674, 4326, 1332, 2438, 13, 198, 3866, 62, 27261, 9945, 62, 260, 39729, 796, 1881, 7575, 3041, 39729, 3419, 198, 12683, 874, 13, 3866, 62, 27261, 9945, 13, 8443, 7, 3866, 62, 27261, 9945, 62, 260, 39729, 11, 29788, 28, 27530, 8, 628 ]
3.273109
238
# Copyright The PyTorch Lightning team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import logging import os import re from pytorch_lightning.plugins.environments.cluster_environment import ClusterEnvironment log = logging.getLogger(__name__)
[ 2, 15069, 383, 9485, 15884, 354, 12469, 1074, 13, 198, 2, 198, 2, 49962, 739, 262, 24843, 13789, 11, 10628, 362, 13, 15, 357, 1169, 366, 34156, 15341, 198, 2, 345, 743, 407, 779, 428, 2393, 2845, 287, 11846, 351, 262, 13789, 13, 198, 2, 921, 743, 7330, 257, 4866, 286, 262, 13789, 379, 198, 2, 198, 2, 220, 220, 220, 220, 2638, 1378, 2503, 13, 43073, 13, 2398, 14, 677, 4541, 14, 43, 2149, 24290, 12, 17, 13, 15, 198, 2, 198, 2, 17486, 2672, 416, 9723, 1099, 393, 4987, 284, 287, 3597, 11, 3788, 198, 2, 9387, 739, 262, 13789, 318, 9387, 319, 281, 366, 1921, 3180, 1, 29809, 1797, 11, 198, 2, 42881, 34764, 11015, 6375, 7102, 49828, 11053, 3963, 15529, 509, 12115, 11, 2035, 4911, 393, 17142, 13, 198, 2, 4091, 262, 13789, 329, 262, 2176, 3303, 15030, 21627, 290, 198, 2, 11247, 739, 262, 13789, 13, 198, 198, 11748, 18931, 198, 11748, 28686, 198, 11748, 302, 198, 198, 6738, 12972, 13165, 354, 62, 2971, 768, 13, 37390, 13, 268, 12103, 13, 565, 5819, 62, 38986, 1330, 38279, 31441, 198, 198, 6404, 796, 18931, 13, 1136, 11187, 1362, 7, 834, 3672, 834, 8, 628 ]
3.782828
198
#!/usr/bin/env python import time import os import math from trackball import TrackBall print("""Trackball: Mouse Use the trackball as a mouse in Raspbian, with right-click when the switch is pressed. Press Ctrl+C to exit! """) trackball = TrackBall(interrupt_pin=4) trackball.set_rgbw(0, 0, 0, 0) # Check for xte (used to control mouse) use_xte = os.system('which xte') == 0 if use_xte == 0: raise RuntimeError("xte not found. Did you sudo apt install xautomation?") while True: up, down, left, right, switch, state = trackball.read() # Send movements and clicks to xte if switch: cmd = 'xte "mouseclick 1"' os.system(cmd) elif right or up or left or down: x = right - left x = math.copysign(x**2, x) y = down - up y = math.copysign(y**2, y) cmd = 'xte "mousermove {} {}"'.format(int(x), int(y)) os.system(cmd) time.sleep(0.0001)
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 198, 11748, 640, 198, 11748, 28686, 198, 11748, 10688, 198, 6738, 2610, 1894, 1330, 17762, 23410, 198, 198, 4798, 7203, 15931, 24802, 1894, 25, 21839, 198, 198, 11041, 262, 2610, 1894, 355, 257, 10211, 287, 371, 5126, 12210, 11, 351, 826, 12, 12976, 198, 12518, 262, 5078, 318, 12070, 13, 198, 198, 13800, 19212, 10, 34, 284, 8420, 0, 198, 15931, 4943, 198, 198, 11659, 1894, 796, 17762, 23410, 7, 3849, 3622, 62, 11635, 28, 19, 8, 198, 11659, 1894, 13, 2617, 62, 81, 22296, 86, 7, 15, 11, 657, 11, 657, 11, 657, 8, 198, 198, 2, 6822, 329, 2124, 660, 357, 1484, 284, 1630, 10211, 8, 198, 1904, 62, 87, 660, 796, 28686, 13, 10057, 10786, 4758, 2124, 660, 11537, 6624, 657, 198, 198, 361, 779, 62, 87, 660, 6624, 657, 25, 198, 220, 220, 220, 5298, 43160, 12331, 7203, 87, 660, 407, 1043, 13, 7731, 345, 21061, 15409, 2721, 2124, 2306, 296, 341, 1701, 8, 198, 198, 4514, 6407, 25, 198, 220, 220, 220, 510, 11, 866, 11, 1364, 11, 826, 11, 5078, 11, 1181, 796, 2610, 1894, 13, 961, 3419, 628, 220, 220, 220, 1303, 16290, 8650, 290, 25785, 284, 2124, 660, 198, 220, 220, 220, 611, 5078, 25, 198, 220, 220, 220, 220, 220, 220, 220, 23991, 796, 705, 87, 660, 366, 35888, 12976, 352, 30543, 198, 220, 220, 220, 220, 220, 220, 220, 28686, 13, 10057, 7, 28758, 8, 198, 220, 220, 220, 1288, 361, 826, 393, 510, 393, 1364, 393, 866, 25, 198, 220, 220, 220, 220, 220, 220, 220, 2124, 796, 826, 532, 1364, 198, 220, 220, 220, 220, 220, 220, 220, 2124, 796, 10688, 13, 22163, 893, 570, 7, 87, 1174, 17, 11, 2124, 8, 198, 220, 220, 220, 220, 220, 220, 220, 331, 796, 866, 532, 510, 198, 220, 220, 220, 220, 220, 220, 220, 331, 796, 10688, 13, 22163, 893, 570, 7, 88, 1174, 17, 11, 331, 8, 198, 220, 220, 220, 220, 220, 220, 220, 23991, 796, 705, 87, 660, 366, 76, 516, 7780, 659, 23884, 23884, 1, 4458, 18982, 7, 600, 7, 87, 828, 493, 7, 88, 4008, 198, 220, 220, 220, 220, 220, 220, 220, 28686, 13, 10057, 7, 28758, 8, 628, 220, 220, 220, 640, 13, 42832, 7, 15, 13, 18005, 8, 198 ]
2.404145
386
"""GaussianMLPRegressorModel.""" import numpy as np import tensorflow as tf import tensorflow_probability as tfp from garage.experiment import deterministic from garage.tf.models import GaussianMLPModel
[ 37811, 35389, 31562, 5805, 4805, 1533, 44292, 17633, 526, 15931, 198, 11748, 299, 32152, 355, 45941, 198, 11748, 11192, 273, 11125, 355, 48700, 198, 11748, 11192, 273, 11125, 62, 1676, 65, 1799, 355, 256, 46428, 198, 198, 6738, 15591, 13, 23100, 3681, 1330, 2206, 49228, 198, 6738, 15591, 13, 27110, 13, 27530, 1330, 12822, 31562, 5805, 47, 17633, 628 ]
3.474576
59
import torch import torch.nn as nn import torch.optim as optim import torch.nn.functional as F import torch.backends.cudnn as cudnn import torchvision import torchvision.transforms as transforms import torchvision.datasets as datasets import os import argparse from torch.autograd import Variable from extensions.utils import progress_bar from extensions.model_refinery_wrapper import ModelRefineryWrapper from extensions.refinery_loss import RefineryLoss from models import ShuffleNetv2_wrapper from models import DiracDeltaNet_wrapper parser = argparse.ArgumentParser(description='PyTorch imagenet inference') parser.add_argument('--datadir', help='path to dataset') parser.add_argument('--inputdir', help='path to input model') args = parser.parse_args() # Data print('==> Preparing data..') # Data loading code valdir = os.path.join(args.datadir, 'val') normalize = transforms.Normalize(mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225]) transform_test = transforms.Compose([ transforms.Resize(256), transforms.CenterCrop(224), transforms.ToTensor(), normalize, ]) #imagenet testset = datasets.ImageFolder(valdir, transform_test) num_classes=1000 testloader = torch.utils.data.DataLoader(testset, batch_size=1000, shuffle=False, pin_memory=True, num_workers=30) use_cuda = torch.cuda.is_available() print('Using input path: %s' % args.inputdir) checkpoint = torch.load(args.inputdir) init_net = checkpoint['net'] net=init_net.to('cpu') label_refinery=torch.load('./resnet50.t7') net = ModelRefineryWrapper(net, label_refinery) device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu") print(device) if torch.cuda.device_count() > 1: print("Let's use", torch.cuda.device_count(), "GPUs!") net = nn.DataParallel(net) net=net.to(device) criterion = RefineryLoss() def accuracy(output, target, topk=(1,)): """Computes the precision@k for the specified values of k""" with torch.no_grad(): maxk = max(topk) batch_size = target.size(0) _, pred = output.topk(maxk, 1, True, True) pred = pred.t() correct = pred.eq(target.view(1, -1).expand_as(pred)) res = [] for k in topk: correct_k = correct[:k].view(-1).float().sum(0, keepdim=True) res.append(correct_k) return res acc1,acc5,loss=test() print('top-1 accuracy: {0:.3f}%, top-5 accuracy: {1:.3f}%'.format(acc1,acc5))
[ 11748, 28034, 201, 198, 11748, 28034, 13, 20471, 355, 299, 77, 201, 198, 11748, 28034, 13, 40085, 355, 6436, 201, 198, 11748, 28034, 13, 20471, 13, 45124, 355, 376, 201, 198, 11748, 28034, 13, 1891, 2412, 13, 66, 463, 20471, 355, 269, 463, 20471, 201, 198, 201, 198, 11748, 28034, 10178, 201, 198, 11748, 28034, 10178, 13, 7645, 23914, 355, 31408, 201, 198, 11748, 28034, 10178, 13, 19608, 292, 1039, 355, 40522, 201, 198, 201, 198, 11748, 28686, 201, 198, 11748, 1822, 29572, 201, 198, 201, 198, 6738, 28034, 13, 2306, 519, 6335, 1330, 35748, 201, 198, 6738, 18366, 13, 26791, 1330, 4371, 62, 5657, 201, 198, 6738, 18366, 13, 19849, 62, 5420, 15451, 62, 48553, 1330, 9104, 8134, 15451, 36918, 2848, 201, 198, 6738, 18366, 13, 5420, 15451, 62, 22462, 1330, 6524, 15451, 43, 793, 201, 198, 201, 198, 6738, 4981, 1330, 911, 18137, 7934, 85, 17, 62, 48553, 201, 198, 6738, 4981, 1330, 36202, 330, 42430, 7934, 62, 48553, 201, 198, 201, 198, 201, 198, 48610, 796, 1822, 29572, 13, 28100, 1713, 46677, 7, 11213, 11639, 20519, 15884, 354, 3590, 268, 316, 32278, 11537, 201, 198, 48610, 13, 2860, 62, 49140, 10786, 438, 19608, 324, 343, 3256, 1037, 11639, 6978, 284, 27039, 11537, 201, 198, 48610, 13, 2860, 62, 49140, 10786, 438, 15414, 15908, 3256, 1037, 11639, 6978, 284, 5128, 2746, 11537, 201, 198, 22046, 796, 30751, 13, 29572, 62, 22046, 3419, 201, 198, 201, 198, 201, 198, 2, 6060, 201, 198, 4798, 10786, 855, 29, 19141, 1723, 1366, 492, 11537, 201, 198, 2, 6060, 11046, 2438, 201, 198, 85, 1940, 343, 796, 28686, 13, 6978, 13, 22179, 7, 22046, 13, 19608, 324, 343, 11, 705, 2100, 11537, 201, 198, 220, 220, 220, 220, 201, 198, 11265, 1096, 796, 31408, 13, 26447, 1096, 7, 32604, 41888, 15, 13, 32642, 11, 657, 13, 29228, 11, 657, 13, 29703, 4357, 201, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 14367, 41888, 15, 13, 23539, 11, 657, 13, 24137, 11, 657, 13, 18182, 12962, 201, 198, 201, 198, 201, 198, 35636, 62, 9288, 796, 31408, 13, 7293, 577, 26933, 201, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 31408, 13, 4965, 1096, 7, 11645, 828, 201, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 31408, 13, 23656, 34, 1773, 7, 24137, 828, 201, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 31408, 13, 2514, 51, 22854, 22784, 201, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 3487, 1096, 11, 201, 198, 220, 220, 220, 220, 220, 220, 220, 33761, 201, 198, 201, 198, 2, 320, 11286, 316, 201, 198, 9288, 2617, 796, 40522, 13, 5159, 41092, 7, 85, 1940, 343, 11, 6121, 62, 9288, 8, 201, 198, 22510, 62, 37724, 28, 12825, 201, 198, 201, 198, 9288, 29356, 796, 28034, 13, 26791, 13, 7890, 13, 6601, 17401, 7, 9288, 2617, 11, 15458, 62, 7857, 28, 12825, 11, 36273, 28, 25101, 11, 6757, 62, 31673, 28, 17821, 11, 997, 62, 22896, 28, 1270, 8, 201, 198, 201, 198, 201, 198, 1904, 62, 66, 15339, 796, 28034, 13, 66, 15339, 13, 271, 62, 15182, 3419, 201, 198, 201, 198, 4798, 10786, 12814, 5128, 3108, 25, 4064, 82, 6, 4064, 26498, 13, 15414, 15908, 8, 201, 198, 9122, 4122, 796, 28034, 13, 2220, 7, 22046, 13, 15414, 15908, 8, 201, 198, 15003, 62, 3262, 796, 26954, 17816, 3262, 20520, 201, 198, 3262, 28, 15003, 62, 3262, 13, 1462, 10786, 36166, 11537, 201, 198, 201, 198, 18242, 62, 5420, 15451, 28, 13165, 354, 13, 2220, 7, 4458, 14, 411, 3262, 1120, 13, 83, 22, 11537, 201, 198, 3262, 796, 9104, 8134, 15451, 36918, 2848, 7, 3262, 11, 6167, 62, 5420, 15451, 8, 201, 198, 201, 198, 25202, 796, 28034, 13, 25202, 7203, 66, 15339, 25, 15, 1, 611, 28034, 13, 66, 15339, 13, 271, 62, 15182, 3419, 2073, 366, 36166, 4943, 201, 198, 4798, 7, 25202, 8, 201, 198, 201, 198, 361, 28034, 13, 66, 15339, 13, 25202, 62, 9127, 3419, 1875, 352, 25, 201, 198, 220, 220, 220, 3601, 7203, 5756, 338, 779, 1600, 28034, 13, 66, 15339, 13, 25202, 62, 9127, 22784, 366, 33346, 82, 2474, 8, 201, 198, 220, 220, 220, 2010, 796, 299, 77, 13, 6601, 10044, 29363, 7, 3262, 8, 201, 198, 201, 198, 3262, 28, 3262, 13, 1462, 7, 25202, 8, 201, 198, 201, 198, 22213, 28019, 796, 6524, 15451, 43, 793, 3419, 201, 198, 201, 198, 201, 198, 201, 198, 4299, 9922, 7, 22915, 11, 2496, 11, 1353, 74, 16193, 16, 35751, 2599, 201, 198, 220, 220, 220, 37227, 7293, 1769, 262, 15440, 31, 74, 329, 262, 7368, 3815, 286, 479, 37811, 201, 198, 220, 220, 220, 351, 28034, 13, 3919, 62, 9744, 33529, 201, 198, 220, 220, 220, 220, 220, 220, 220, 3509, 74, 796, 3509, 7, 4852, 74, 8, 201, 198, 220, 220, 220, 220, 220, 220, 220, 15458, 62, 7857, 796, 2496, 13, 7857, 7, 15, 8, 201, 198, 201, 198, 220, 220, 220, 220, 220, 220, 220, 4808, 11, 2747, 796, 5072, 13, 4852, 74, 7, 9806, 74, 11, 352, 11, 6407, 11, 6407, 8, 201, 198, 220, 220, 220, 220, 220, 220, 220, 2747, 796, 2747, 13, 83, 3419, 201, 198, 220, 220, 220, 220, 220, 220, 220, 3376, 796, 2747, 13, 27363, 7, 16793, 13, 1177, 7, 16, 11, 532, 16, 737, 11201, 392, 62, 292, 7, 28764, 4008, 201, 198, 201, 198, 220, 220, 220, 220, 220, 220, 220, 581, 796, 17635, 201, 198, 220, 220, 220, 220, 220, 220, 220, 329, 479, 287, 1353, 74, 25, 201, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 3376, 62, 74, 796, 3376, 58, 25, 74, 4083, 1177, 32590, 16, 737, 22468, 22446, 16345, 7, 15, 11, 1394, 27740, 28, 17821, 8, 201, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 581, 13, 33295, 7, 30283, 62, 74, 8, 201, 198, 220, 220, 220, 220, 220, 220, 220, 1441, 581, 201, 198, 201, 198, 201, 198, 4134, 16, 11, 4134, 20, 11, 22462, 28, 9288, 3419, 201, 198, 4798, 10786, 4852, 12, 16, 9922, 25, 1391, 15, 25, 13, 18, 69, 92, 7441, 1353, 12, 20, 9922, 25, 1391, 16, 25, 13, 18, 69, 92, 4, 4458, 18982, 7, 4134, 16, 11, 4134, 20, 4008, 201, 198 ]
2.402585
1,083
"""Model Parameters Module.""" import torch.optim as optim from .search import SamplingSearch, GreedySearch, BeamSearch SEARCH_FACTORY = { 'sampling': SamplingSearch, 'greedy': GreedySearch, 'beam': BeamSearch, } OPTIMIZER_FACTORY = { 'adadelta': optim.Adadelta, 'adagrad': optim.Adagrad, 'adam': optim.Adam, 'adamax': optim.Adamax, 'rmsprop': optim.RMSprop, 'sgd': optim.SGD }
[ 37811, 17633, 40117, 19937, 526, 15931, 198, 11748, 28034, 13, 40085, 355, 6436, 198, 6738, 764, 12947, 1330, 3409, 11347, 18243, 11, 11955, 4716, 18243, 11, 25855, 18243, 198, 198, 5188, 31315, 62, 37, 10659, 15513, 796, 1391, 198, 220, 220, 220, 705, 37687, 11347, 10354, 3409, 11347, 18243, 11, 198, 220, 220, 220, 705, 16694, 4716, 10354, 11955, 4716, 18243, 11, 198, 220, 220, 220, 705, 40045, 10354, 25855, 18243, 11, 198, 92, 198, 198, 3185, 51, 3955, 14887, 1137, 62, 37, 10659, 15513, 796, 1391, 198, 220, 220, 220, 705, 324, 324, 12514, 10354, 6436, 13, 2782, 324, 12514, 11, 198, 220, 220, 220, 705, 324, 363, 6335, 10354, 6436, 13, 2782, 363, 6335, 11, 198, 220, 220, 220, 705, 324, 321, 10354, 6436, 13, 23159, 11, 198, 220, 220, 220, 705, 324, 321, 897, 10354, 6436, 13, 23159, 897, 11, 198, 220, 220, 220, 705, 81, 907, 22930, 10354, 6436, 13, 49, 5653, 22930, 11, 198, 220, 220, 220, 705, 82, 21287, 10354, 6436, 13, 38475, 35, 198, 92, 198 ]
2.404624
173
# # Copyright (c) 2021 The GPflux Contributors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # import abc import numpy as np import pytest import tensorflow as tf import tensorflow_probability as tfp from gpflow.kullback_leiblers import gauss_kl from gpflux.encoders import DirectlyParameterizedNormalDiag from gpflux.layers import LatentVariableLayer, LayerWithObservations, TrackableLayer tf.keras.backend.set_floatx("float64") ############ # Utilities ############ def _zero_one_normal_prior(w_dim): """ N(0, I) prior """ return tfp.distributions.MultivariateNormalDiag(loc=np.zeros(w_dim), scale_diag=np.ones(w_dim)) ############ # Tests ############ class ArrayMatcher: def __init__(self, expected): self.expected = expected def test_no_tensorflow_metaclass_overwritten(): """ LayerWithObservations is a subclass of tf.keras.layers.Layer (via TrackableLayer); this test ensures that TrackableLayer does not have a metaclass, and hence by adding the ABCMeta to LayerWithObservations we are not accidentally removing some required TensorFlow magic metaclass. """ assert LayerWithObservations.__bases__ == (TrackableLayer,) assert type(TrackableLayer) is type assert type(LayerWithObservations) is abc.ABCMeta
[ 2, 198, 2, 15069, 357, 66, 8, 33448, 383, 14714, 69, 22564, 25767, 669, 13, 198, 2, 198, 2, 49962, 739, 262, 24843, 13789, 11, 10628, 362, 13, 15, 357, 1169, 366, 34156, 15341, 198, 2, 345, 743, 407, 779, 428, 2393, 2845, 287, 11846, 351, 262, 13789, 13, 198, 2, 921, 743, 7330, 257, 4866, 286, 262, 13789, 379, 198, 2, 198, 2, 220, 220, 220, 220, 2638, 1378, 2503, 13, 43073, 13, 2398, 14, 677, 4541, 14, 43, 2149, 24290, 12, 17, 13, 15, 198, 2, 198, 2, 17486, 2672, 416, 9723, 1099, 393, 4987, 284, 287, 3597, 11, 3788, 198, 2, 9387, 739, 262, 13789, 318, 9387, 319, 281, 366, 1921, 3180, 1, 29809, 1797, 11, 198, 2, 42881, 34764, 11015, 6375, 7102, 49828, 11053, 3963, 15529, 509, 12115, 11, 2035, 4911, 393, 17142, 13, 198, 2, 4091, 262, 13789, 329, 262, 2176, 3303, 15030, 21627, 290, 198, 2, 11247, 739, 262, 13789, 13, 198, 2, 198, 198, 11748, 450, 66, 198, 198, 11748, 299, 32152, 355, 45941, 198, 11748, 12972, 9288, 198, 11748, 11192, 273, 11125, 355, 48700, 198, 11748, 11192, 273, 11125, 62, 1676, 65, 1799, 355, 256, 46428, 198, 198, 6738, 27809, 11125, 13, 74, 724, 1891, 62, 293, 571, 8116, 1330, 31986, 1046, 62, 41582, 198, 198, 6738, 27809, 69, 22564, 13, 12685, 375, 364, 1330, 4128, 306, 36301, 1143, 26447, 18683, 363, 198, 6738, 27809, 69, 22564, 13, 75, 6962, 1330, 5476, 298, 43015, 49925, 11, 34398, 3152, 31310, 712, 602, 11, 17762, 540, 49925, 198, 198, 27110, 13, 6122, 292, 13, 1891, 437, 13, 2617, 62, 22468, 87, 7203, 22468, 2414, 4943, 198, 198, 7804, 4242, 198, 2, 41086, 198, 7804, 4242, 628, 198, 4299, 4808, 22570, 62, 505, 62, 11265, 62, 3448, 273, 7, 86, 62, 27740, 2599, 198, 220, 220, 220, 37227, 399, 7, 15, 11, 314, 8, 3161, 37227, 198, 220, 220, 220, 1441, 256, 46428, 13, 17080, 2455, 507, 13, 15205, 42524, 26447, 18683, 363, 7, 17946, 28, 37659, 13, 9107, 418, 7, 86, 62, 27740, 828, 5046, 62, 10989, 363, 28, 37659, 13, 1952, 7, 86, 62, 27740, 4008, 628, 198, 198, 7804, 4242, 198, 2, 30307, 198, 7804, 4242, 628, 628, 198, 4871, 15690, 19044, 2044, 25, 198, 220, 220, 220, 825, 11593, 15003, 834, 7, 944, 11, 2938, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 40319, 796, 2938, 628, 628, 198, 4299, 1332, 62, 3919, 62, 83, 22854, 11125, 62, 4164, 330, 31172, 62, 2502, 15266, 33529, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 34398, 3152, 31310, 712, 602, 318, 257, 47611, 286, 48700, 13, 6122, 292, 13, 75, 6962, 13, 49925, 357, 8869, 17762, 540, 49925, 1776, 198, 220, 220, 220, 428, 1332, 19047, 326, 17762, 540, 49925, 857, 407, 423, 257, 1138, 330, 31172, 11, 290, 12891, 416, 4375, 198, 220, 220, 220, 262, 9738, 48526, 284, 34398, 3152, 31310, 712, 602, 356, 389, 407, 14716, 10829, 617, 2672, 198, 220, 220, 220, 309, 22854, 37535, 5536, 1138, 330, 31172, 13, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 6818, 34398, 3152, 31310, 712, 602, 13, 834, 65, 1386, 834, 6624, 357, 24802, 540, 49925, 35751, 198, 220, 220, 220, 6818, 2099, 7, 24802, 540, 49925, 8, 318, 2099, 198, 220, 220, 220, 6818, 2099, 7, 49925, 3152, 31310, 712, 602, 8, 318, 450, 66, 13, 24694, 48526, 198 ]
3.170213
564
#!/usr/bin/env python # from actingweb import actor from actingweb import config from actingweb import trust from actingweb import auth import webapp2 import os from google.appengine.ext.webapp import template import json import logging import datetime import time # /trust handlers # # GET /trust with query parameters (relationship, type, and peerid) to retrieve trust relationships (auth: only creator and admins allowed) # POST /trust with json body to initiate a trust relationship between this # actor and another (reciprocal relationship) (auth: only creator and admins allowed) # POST /trust/{relationship} with json body to create new trust # relationship (see config.py for default relationship and auto-accept, no # auth required) # GET /trust/{relationship}}/{actorid} to get details on a specific relationship (auth: creator, admin, or peer secret) # POST /trust/{relationship}}/{actorid} to send information to a peer about changes in the relationship # PUT /trust/{relationship}}/{actorid} with a json body to change details on a relationship (baseuri, secret, desc) (auth: creator, # admin, or peer secret) # DELETE /trust/{relationship}}/{actorid} to delete a relationship (with # ?peer=true if the delete is from the peer) (auth: creator, admin, or # peer secret) # Handling requests to trust/ # Handling requests to /trust/*, e.g. /trust/friend # Handling requests to specific relationships, e.g. /trust/friend/12f2ae53bd application = webapp2.WSGIApplication([ webapp2.Route(r'/<id>/trust<:/?>', rootHandler, name='rootHandler'), webapp2.Route(r'/<id>/trust/<relationship><:/?>', relationshipHandler, name='relationshipHandler'), webapp2.Route(r'/<id>/trust/<relationship>/<peerid><:/?>', trustHandler, name='trustHandler'), ], debug=True)
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 198, 2, 198, 6738, 7205, 12384, 1330, 8674, 198, 6738, 7205, 12384, 1330, 4566, 198, 6738, 7205, 12384, 1330, 3774, 198, 6738, 7205, 12384, 1330, 6284, 198, 198, 11748, 3992, 1324, 17, 198, 198, 11748, 28686, 198, 6738, 23645, 13, 1324, 18392, 13, 2302, 13, 12384, 1324, 1330, 11055, 198, 11748, 33918, 198, 11748, 18931, 198, 11748, 4818, 8079, 198, 11748, 640, 628, 198, 2, 1220, 38087, 32847, 198, 2, 198, 2, 17151, 1220, 38087, 351, 12405, 10007, 357, 39468, 1056, 11, 2099, 11, 290, 12720, 312, 8, 284, 19818, 3774, 6958, 357, 18439, 25, 691, 13172, 290, 44563, 3142, 8, 198, 2, 24582, 1220, 38087, 351, 33918, 1767, 284, 22118, 257, 3774, 2776, 1022, 428, 198, 2, 220, 220, 8674, 290, 1194, 357, 8344, 541, 43270, 2776, 8, 357, 18439, 25, 691, 13172, 290, 44563, 3142, 8, 198, 2, 24582, 1220, 38087, 14, 90, 39468, 1056, 92, 351, 33918, 1767, 284, 2251, 649, 3774, 198, 2, 220, 220, 2776, 357, 3826, 4566, 13, 9078, 329, 4277, 2776, 290, 8295, 12, 13635, 11, 645, 198, 2, 220, 220, 6284, 2672, 8, 198, 2, 17151, 1220, 38087, 14, 90, 39468, 1056, 11709, 14, 90, 11218, 312, 92, 284, 651, 3307, 319, 257, 2176, 2776, 357, 18439, 25, 13172, 11, 13169, 11, 393, 12720, 3200, 8, 198, 2, 24582, 1220, 38087, 14, 90, 39468, 1056, 11709, 14, 90, 11218, 312, 92, 284, 3758, 1321, 284, 257, 12720, 546, 2458, 287, 262, 2776, 198, 2, 350, 3843, 1220, 38087, 14, 90, 39468, 1056, 11709, 14, 90, 11218, 312, 92, 351, 257, 33918, 1767, 284, 1487, 3307, 319, 257, 2776, 357, 8692, 9900, 11, 3200, 11, 1715, 8, 357, 18439, 25, 13172, 11, 198, 2, 220, 220, 13169, 11, 393, 12720, 3200, 8, 198, 2, 5550, 2538, 9328, 1220, 38087, 14, 90, 39468, 1056, 11709, 14, 90, 11218, 312, 92, 284, 12233, 257, 2776, 357, 4480, 198, 2, 220, 220, 5633, 33350, 28, 7942, 611, 262, 12233, 318, 422, 262, 12720, 8, 357, 18439, 25, 13172, 11, 13169, 11, 393, 198, 2, 220, 220, 12720, 3200, 8, 198, 198, 2, 49500, 7007, 284, 3774, 14, 628, 198, 2, 49500, 7007, 284, 1220, 38087, 15211, 11, 304, 13, 70, 13, 1220, 38087, 14, 6726, 628, 198, 2, 49500, 7007, 284, 2176, 6958, 11, 304, 13, 70, 13, 1220, 38087, 14, 6726, 14, 1065, 69, 17, 3609, 4310, 17457, 628, 198, 31438, 796, 3992, 1324, 17, 13, 19416, 38, 3539, 381, 10142, 26933, 198, 220, 220, 220, 3992, 1324, 17, 13, 43401, 7, 81, 26488, 27, 312, 29, 14, 38087, 27, 14079, 30, 29, 3256, 6808, 25060, 11, 1438, 11639, 15763, 25060, 33809, 198, 220, 220, 220, 3992, 1324, 17, 13, 43401, 7, 81, 26488, 27, 312, 29, 14, 38087, 14, 27, 39468, 1056, 6927, 14079, 30, 29, 3256, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2776, 25060, 11, 1438, 11639, 39468, 1056, 25060, 33809, 198, 220, 220, 220, 3992, 1324, 17, 13, 43401, 7, 81, 26488, 27, 312, 29, 14, 38087, 14, 27, 39468, 1056, 29, 14, 27, 33350, 312, 6927, 14079, 30, 29, 3256, 3774, 25060, 11, 1438, 11639, 38087, 25060, 33809, 198, 4357, 14257, 28, 17821, 8, 198 ]
3.332721
544
README.md exists but content is empty. Use the Edit dataset card button to edit it.
Downloads last month
9
Edit dataset card