content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
from typing import Optional
from pydantic.main import BaseModel
| [
6738,
19720,
1330,
32233,
198,
198,
6738,
279,
5173,
5109,
13,
12417,
1330,
7308,
17633,
628,
628,
628,
628,
198
] | 3.65 | 20 |
from networking_p4.services.service_drivers.default.services.attach_module import AttachModuleService
from networking_p4.services.service_drivers.default.services.configure_module import ConfigureModuleService
from networking_p4.services.service_drivers.default.services.create_module import CreateModuleService
from networking_p4.services.service_drivers.default.services.delete_module import DeleteModuleService
from networking_p4.services.service_drivers.default.services.detach_module import DetachModuleService
from networking_p4.services.service_drivers.default.services.module_configuration import GetModuleConfigurationService
from networking_p4.services.service_drivers.default.services.unconfigure_module import UnconfigureModuleService
from networking_p4.services.service_drivers.default.services.update_module import UpdateModuleService
from networking_p4.services.service_drivers.driver_api import P4DriverApi, P4DriverBase
from oslo_log import log as logging
from networking_p4.services.service_drivers.default import rpc as p4_rpc
from networking_p4.services.common import rpc_topics
from neutron_lib import context as n_context
import neutron.common.rpc as n_rpc
LOG = logging.getLogger(__name__)
class DefaultP4Driver(P4DriverApi,
P4DriverBase):
""" Implementation of default driver for P4 service """
| [
6738,
19140,
62,
79,
19,
13,
30416,
13,
15271,
62,
36702,
13,
12286,
13,
30416,
13,
47348,
62,
21412,
1330,
3460,
620,
26796,
16177,
198,
6738,
19140,
62,
79,
19,
13,
30416,
13,
15271,
62,
36702,
13,
12286,
13,
30416,
13,
11250,
495... | 3.626344 | 372 |
# Hello World program.
# This is where you write a comment.
if __name__ == "__main__":
hello_world()
| [
2,
18435,
2159,
1430,
13,
198,
2,
770,
318,
810,
345,
3551,
257,
2912,
13,
628,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
23748,
62,
6894,
3419,
198
] | 2.972222 | 36 |
import requests
import unittest
import json
import uuid
from flask_probanno import GET, POST, PUT
from controllers.probanno_management import CALCULATE_PROBANNO_JOB
from controllers.job import COMPLETE
BASE_URL = "http://probannoweb.systemsbiology.net/api"
HEADERS = {'cache-control': 'no-cache'}
FASTA_1 = '267377'
CACHED_FASTA = '243232'
CACHED_FASTA_NAME = 'Methanocaldococcus jannaschii (strain ATCC 43067 / DSM 2661 / JAL-1 / JCM 10045 / NBRC 100440)'
NOT_A_FASTA = 'abcdef'
MY_FASTA_NAME = 'my_sequence'
TEST_MODEL_FILE = 'maripaludis_model.json'
GAPFILL_MODEL_JOB = "gapfill_model"
def make_api_request(path, method, headers, params=None, files=None, data=None):
"""
helper method for making a request and unpacking the JSON result
:param path: sub path of the API
:param method: HTTP method
:param headers: Associated headers
:return: HTTP result
"""
response = requests.request(method, BASE_URL + path, headers=headers, params=params, files=files, data=data)
return response
def make_and_unpack_request(path, method, headers, params=None, files=None, data=None):
"""
helper method for making a request and unpacking the JSON result
:param path: sub path of the API
:param method: HTTP method
:param headers: Associated headers
:return: HTTP result
"""
response = make_api_request(path, method, headers, params=params, files=files, data=data)
return json.loads(response.text)
if __name__ == '__main__':
unittest.main()
| [
11748,
7007,
198,
11748,
555,
715,
395,
198,
11748,
33918,
198,
11748,
334,
27112,
198,
198,
6738,
42903,
62,
1676,
65,
1236,
78,
1330,
17151,
11,
24582,
11,
350,
3843,
198,
6738,
20624,
13,
1676,
65,
1236,
78,
62,
27604,
1330,
33290,... | 2.741071 | 560 |
from fastapi import FastAPI
from pytest import fixture
from tortoise import Model
from tortoise.backends.base.executor import EXECUTOR_CACHE
from tortoise.contrib.fastapi import register_tortoise
from tortoise.fields import IntField, TextField
from fastapi_pagination import Page, add_pagination
from fastapi_pagination.ext.tortoise import paginate
from fastapi_pagination.limit_offset import Page as LimitOffsetPage
from ..base import BasePaginationTestCase, SafeTestClient, UserOut
from ..utils import faker
@fixture(
scope="session",
params=[True, False],
ids=["model", "query"],
)
@fixture(scope="session")
| [
6738,
3049,
15042,
1330,
12549,
17614,
198,
6738,
12972,
9288,
1330,
29220,
198,
6738,
7619,
25678,
1330,
9104,
198,
6738,
7619,
25678,
13,
1891,
2412,
13,
8692,
13,
18558,
38409,
1330,
7788,
2943,
3843,
1581,
62,
34,
2246,
13909,
198,
... | 3.219388 | 196 |
# =============================================================================
# periscope-ps (blipp)
#
# Copyright (c) 2013-2016, Trustees of Indiana University,
# All rights reserved.
#
# This software may be modified and distributed under the terms of the BSD
# license. See the COPYING file for details.
#
# This software was created at the Indiana University Center for Research in
# Extreme Scale Technologies (CREST).
# =============================================================================
import ConfigParser
import socket
import netifaces
import utils
SCHEMAS = {
'networkresources': 'http://unis.crest.iu.edu/schema/20160630/networkresource#',
'nodes': 'http://unis.crest.iu.edu/schema/20160630/node#',
'domains': 'http://unis.crest.iu.edu/schema/20160630/domain#',
'ports': 'http://unis.crest.iu.edu/schema/20160630/port#',
'links': 'http://unis.crest.iu.edu/schema/20160630/link#',
'paths': 'http://unis.crest.iu.edu/schema/20160630/path#',
'networks': 'http://unis.crest.iu.edu/schema/20160630/network#',
'topologies': 'http://unis.crest.iu.edu/schema/20160630/topology#',
'services': 'http://unis.crest.iu.edu/schema/20160630/service#',
'blipp': 'http://unis.crest.iu.edu/schema/20160630/blipp#',
'metadata': 'http://unis.crest.iu.edu/schema/20160630/metadata#',
'datum': 'http://unis.crest.iu.edu/schema/20160630/datum#',
'data': 'http://unis.crest.iu.edu/schema/20160630/data#',
'measurement': 'http://unis.crest.iu.edu/schema/20160630/measurement#',
}
MIME = {
'HTML': 'text/html',
'JSON': 'application/json',
'PLAIN': 'text/plain',
'SSE': 'text/event-stream',
'PSJSON': 'application/perfsonar+json',
'PSBSON': 'application/perfsonar+bson',
'PSXML': 'application/perfsonar+xml',
}
'''
Calculate URN deterministic way with a goal to make it as unique as
possible. We might still get into situation where urn might not be unique
if appropriate reverse dns entries are not set or duplicate MAC addresses
are used.
We construct urn as follows.
case 1) socket.getfqdn() resolves into monitor.incentre.iu.edu then
urn=urn:ogf:network:domain=incentre.iu.edu:node=monitor:
case 2) socket.getgqdn() fails then
urn=urn:ogf:network:domain=<FQDN>:node=<default_interface_ip>_<mac_address_of_default_interface>_<hostname>:
'''
HOSTNAME = socket.getfqdn() ### this might fail n give hostname
fqdn = socket.getfqdn()
hostname = socket.gethostname()
if not fqdn or not hostname:
raise Exception("socket.getfqdn or socket.gethostname failed.\
Try setting urn manually.")
#we check fqdn != hostname, if not then we have success
if fqdn != hostname:
domain = fqdn.replace(hostname+".", "")
HOST_URN = "urn:ogf:network:domain=%s:node=%s:" % (domain, hostname)
else:
try:
default_ip, default_iface = utils.get_default_gateway_linux()
default_ip = netifaces.ifaddresses(default_iface)[netifaces.AF_INET][0]["addr"]
default_mac = netifaces.ifaddresses(default_iface)[netifaces.AF_LINK][0]["addr"]
default_mac = utils.clean_mac(default_mac)
HOST_URN = "urn:ogf:network:domain=%s:node=%s_%s_%s" % \
(fqdn, default_ip, default_mac, hostname)
except Exception:
domain = fqdn.replace(hostname+".", "")
HOST_URN = "urn:ogf:network:domain=%s:node=%s:" % (domain, hostname)
NODE_INFO_FILE="/usr/local/etc/node.info"
STANDALONE_DEFAULTS = {
"$schema": SCHEMAS["services"],
"status": "ON",
"serviceType": "ps:tools:blipp",
"ttl": 600,
"properties": {
"configurations": {
"unis_url": "http://localhost:8888",
"unis_max_backoff": 3600,
"unis_poll_interval":300,
"use_ssl": "",
"ssl_cafile": "",
"probe_defaults": {
"collection_schedule": "builtins.simple",
"schedule_params": {"every": 2}, # run every 2 seconds
"collection_size": 10000000, # ~10 megabytes
"collection_ttl": 1500000, # ~17 days
"reporting_params": 1, # report every probe (no default aggregation)
"reporting_tolerance": 10 # store 10 on unreachable MS
},
"probes": {
}
}
}
}
nconf = {}
AUTH_UUID = None
UNIS_ID = None
MS_URL = None
GN_ADDR = None
try:
with open(NODE_INFO_FILE, 'r') as cfile:
for line in cfile:
name, var = line.partition("=")[::2]
nconf[name.strip()] = str(var).rstrip()
try:
MS_URL = nconf['ms_instance']
except Exception as e:
pass
try:
AUTH_UUID = nconf['auth_uuid']
except Exception as e:
pass
try:
UNIS_ID = nconf['unis_id']
except Exception as e:
pass
try:
GN_ADDR = nconf['gn_address']
except Exception as e:
pass
except IOError:
pass
if AUTH_UUID:
STANDALONE_DEFAULTS["properties"].update({"geni": {"slice_uuid":AUTH_UUID}})
if MS_URL:
STANDALONE_DEFAULTS["properties"]["configurations"]["probe_defaults"].update({"ms_url":MS_URL})
##################################################################
# Netlogger stuff... pasted from Ahmed's peri-tornado
##################################################################
import logging, logging.handlers
from netlogger import nllog
DEBUG = False
TRACE = False
CONSOLE = True
NETLOGGER_NAMESPACE = "blippd"
WORKSPACE = "."
def config_logger():
"""Configures netlogger"""
nllog.PROJECT_NAMESPACE = NETLOGGER_NAMESPACE
#logging.setLoggerClass(nllog.PrettyBPLogger)
logging.setLoggerClass(nllog.BPLogger)
log = logging.getLogger(nllog.PROJECT_NAMESPACE)
handler = logging.StreamHandler()
handler.setFormatter(logging.Formatter("%(message)s"))
log.addHandler(handler)
if GN_ADDR:
# setup socket to global node, GN
socketHandler = logging.handlers.SocketHandler(GN_ADDR,
logging.handlers.DEFAULT_TCP_LOGGING_PORT)
log.addHandler(socketHandler)
# set level
if TRACE:
log_level = (logging.WARN, logging.INFO, logging.DEBUG,
nllog.TRACE)[3]
elif DEBUG:
log_level = (logging.WARN, logging.INFO, logging.DEBUG,
nllog.TRACE)[2]
elif CONSOLE:
log_level = (logging.WARN, logging.INFO, logging.DEBUG,
25)[3]
else:
log_level = (logging.WARN, logging.INFO, logging.DEBUG,
nllog.TRACE)[1]
log.setLevel(log_level)
def get_logger(namespace=NETLOGGER_NAMESPACE, logfile=None, level=None):
"""Return logger object"""
# Test if netlogger is initialized
if nllog.PROJECT_NAMESPACE != NETLOGGER_NAMESPACE:
config_logger()
if logfile:
add_filehandler(logfile)
if level:
set_level(level)
return nllog.get_logger(namespace)
##################################################################
# Read in a configuration file
##################################################################
CONFIG_FILE="/etc/periscope/blippd.conf"
config = ConfigParser.RawConfigParser()
config.read(CONFIG_FILE)
main_config = ["unis_url", "ms_url", "data_file", "ssl_cert", "ssl_key",
"ssl_cafile", "unis_poll_interval", "use_ssl"]
probe_map = {"registration_probe": ["service_type", "service_name", "service_description",
"service_accesspoint", "pidfile", "process_name",
"service_ttl"],
"net": ["unis_url"],
"cpu": ["proc_dir"],
"mem": []}
for key in main_config:
try:
value = config.get("main", key)
STANDALONE_DEFAULTS["properties"]["configurations"].update({key: value})
except:
pass
for section in config.sections():
if section == "main":
continue
module = config.get(section, "module")
if module in probe_map.keys():
conf = dict()
conf.update({"probe_module": module})
# set the schedule interval if present (otherwise will get probe default)
try:
conf.update({"schedule_params": {"every": (int)(config.get(section, "interval"))}})
except:
pass
for key in probe_map[module]:
try:
value = config.get(section, key)
conf.update({key: value})
except:
pass
STANDALONE_DEFAULTS["properties"]["configurations"]["probes"].update({section: conf})
| [
2,
38093,
25609,
198,
2,
220,
583,
2304,
3008,
12,
862,
357,
2436,
3974,
8,
198,
2,
198,
2,
220,
15069,
357,
66,
8,
2211,
12,
5304,
11,
9870,
2841,
286,
10278,
2059,
11,
198,
2,
220,
1439,
2489,
10395,
13,
198,
2,
198,
2,
220,... | 2.292328 | 3,780 |
"""Events API module."""
import logging
from future.utils import raise_from
from splitio.api import APIException, headers_from_metadata
from splitio.api.client import HttpClientException
class EventsAPI(object): # pylint: disable=too-few-public-methods
"""Class that uses an httpClient to communicate with the events API."""
def __init__(self, http_client, apikey, sdk_metadata):
"""
Class constructor.
:param http_client: HTTP Client responsble for issuing calls to the backend.
:type http_client: HttpClient
:param apikey: User apikey token.
:type apikey: string
:param sdk_metadata: SDK version & machine name & IP.
:type sdk_metadata: splitio.client.util.SdkMetadata
"""
self._logger = logging.getLogger(self.__class__.__name__)
self._client = http_client
self._apikey = apikey
self._metadata = headers_from_metadata(sdk_metadata)
@staticmethod
def _build_bulk(events):
"""
Build event bulk as expected by the API.
:param events: Events to be bundled.
:type events: list(splitio.models.events.Event)
:return: Formatted bulk.
:rtype: dict
"""
return [
{
'key': event.key,
'trafficTypeName': event.traffic_type_name,
'eventTypeId': event.event_type_id,
'value': event.value,
'timestamp': event.timestamp,
'properties': event.properties,
}
for event in events
]
def flush_events(self, events):
"""
Send events to the backend.
:param events: Events bulk
:type events: list
:return: True if flush was successful. False otherwise
:rtype: bool
"""
bulk = self._build_bulk(events)
try:
response = self._client.post(
'events',
'/events/bulk',
self._apikey,
body=bulk,
extra_headers=self._metadata
)
if not 200 <= response.status_code < 300:
raise APIException(response.body, response.status_code)
except HttpClientException as exc:
self._logger.error('Http client is throwing exceptions')
self._logger.debug('Error: ', exc_info=True)
raise_from(APIException('Events not flushed properly.'), exc)
| [
37811,
37103,
7824,
8265,
526,
15931,
198,
11748,
18931,
198,
198,
6738,
2003,
13,
26791,
1330,
5298,
62,
6738,
198,
198,
6738,
6626,
952,
13,
15042,
1330,
7824,
16922,
11,
24697,
62,
6738,
62,
38993,
198,
6738,
6626,
952,
13,
15042,
... | 2.222222 | 1,116 |
from setuptools import setup
setup(
name='pyhatchbuck',
version='0.4',
description='Python library for Hatchbuck API',
url='https://github.com/jakesen/pyhatchbuck',
author='Jacob Senecal',
author_email='jacob.senecal@gmail.com',
license='MIT',
packages=['hatchbuck',],
install_requires=['requests',],
)
| [
6738,
900,
37623,
10141,
1330,
9058,
198,
198,
40406,
7,
198,
220,
220,
220,
1438,
11639,
9078,
71,
963,
27041,
3256,
198,
220,
220,
220,
2196,
11639,
15,
13,
19,
3256,
198,
220,
220,
220,
6764,
11639,
37906,
5888,
329,
31537,
27041,
... | 2.59542 | 131 |
# Copyright 2021 - 2022 Universität Tübingen, DKFZ and EMBL
# for the German Human Genome-Phenome Archive (GHGA)
#
# 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.
"""Test the messaging API (pubsub)"""
from typing import Any, Callable, Dict
from ghga_message_schemas import schemas
from ghga_service_chassis_lib.utils import exec_with_timeout
from internal_file_registry_service.pubsub import (
subscribe_registration_request,
subscribe_stage_requests,
)
from ..fixtures import ( # noqa: F401
DEFAULT_CONFIG,
amqp_fixture,
get_config,
psql_fixture,
s3_fixture,
state,
)
def sub_and_pub_test_generic(
upstream_topic_name: str,
downstream_topic_name: str,
upstream_message: Dict[str, Any],
upstream_msg_schema: dict,
downstream_msg_schema: dict,
subscribe_func: Callable,
psql_fixture, # noqa: F811
s3_fixture, # noqa: F811
amqp_fixture, # noqa: F811
):
"""Generic function for testing functions that first subscribe and then publish."""
config = get_config(
sources=[psql_fixture.config, s3_fixture.config, amqp_fixture.config]
)
# initialize upstream and downstream test services that will publish or receive
# messages to or from this service:
upstream_publisher = amqp_fixture.get_test_publisher(
topic_name=upstream_topic_name,
message_schema=upstream_msg_schema,
)
downstream_subscriber = amqp_fixture.get_test_subscriber(
topic_name=downstream_topic_name,
message_schema=downstream_msg_schema,
)
# publish a stage request:
upstream_publisher.publish(upstream_message)
# process the stage request:
exec_with_timeout(
func=lambda: subscribe_func(config=config, run_forever=False),
timeout_after=2,
)
# expect stage confirmation message:
downstream_message = downstream_subscriber.subscribe(timeout_after=2)
assert downstream_message["file_id"] == upstream_message["file_id"]
def test_subscribe_stage_requests(psql_fixture, s3_fixture, amqp_fixture): # noqa: F811
"""Test `subscribe_stage_requests` function"""
sub_and_pub_test_generic(
upstream_topic_name=DEFAULT_CONFIG.topic_name_stage_request,
downstream_topic_name=DEFAULT_CONFIG.topic_name_staged_to_outbox,
upstream_message=state.FILES["no_grouping_label_in_message"].message, # type: ignore
upstream_msg_schema=schemas.SCHEMAS["non_staged_file_requested"],
downstream_msg_schema=schemas.SCHEMAS["file_staged_for_download"],
subscribe_func=subscribe_stage_requests,
psql_fixture=psql_fixture,
s3_fixture=s3_fixture,
amqp_fixture=amqp_fixture,
)
def test_subscribe_registration_request(
psql_fixture, s3_fixture, amqp_fixture # noqa: F811
):
"""Test `subscribe_registration_request` function"""
sub_and_pub_test_generic(
upstream_topic_name=DEFAULT_CONFIG.topic_name_reg_request,
downstream_topic_name=DEFAULT_CONFIG.topic_name_registered,
upstream_message=state.FILES["in_inbox_only"].message, # type: ignore
upstream_msg_schema=schemas.SCHEMAS["file_upload_received"],
downstream_msg_schema=schemas.SCHEMAS["file_internally_registered"],
subscribe_func=subscribe_registration_request,
psql_fixture=psql_fixture,
s3_fixture=s3_fixture,
amqp_fixture=amqp_fixture,
)
| [
2,
15069,
33448,
532,
33160,
26986,
270,
11033,
83,
309,
9116,
4623,
268,
11,
32975,
37,
57,
290,
17228,
9148,
198,
2,
329,
262,
2679,
5524,
5215,
462,
12,
47,
831,
462,
20816,
357,
17511,
9273,
8,
198,
2,
198,
2,
49962,
739,
262,... | 2.592838 | 1,508 |
import sys
import ctypes
import struct
a = 59
x = y = a
b = 125.54
c = 'Hello World!'
print(id(a))
print(sys.getsizeof(a))
print(ctypes.string_at(id(a), sys.getsizeof(a)))
print(struct.unpack('LLLLLLl', ctypes.string_at(id(a), sys.getsizeof(a))))
print(id(int))
print('*' * 50)
print(id(b))
print(sys.getsizeof(b))
z = b
b = 122.99
print(ctypes.string_at(id(b), sys.getsizeof(b)))
print(struct.unpack('LLLd', ctypes.string_at(id(b), sys.getsizeof(b))))
print(id(float))
print('*' * 50)
print(id(c))
print(sys.getsizeof(c))
z = b
b = 122.99
print(ctypes.string_at(id(c), sys.getsizeof(c)))
print(struct.unpack('LLLLLLLLLLli' + 'c' * 13, ctypes.string_at(id(c), sys.getsizeof(c))))
print('*' * 50)
lst = [1, 2, 3, 4]
print(struct.unpack('LLLL' + 'L' * 5 * 4, ctypes.string_at(id(lst), sys.getsizeof(lst))))
| [
11748,
25064,
198,
11748,
269,
19199,
198,
11748,
2878,
628,
198,
64,
796,
7863,
198,
87,
796,
331,
796,
257,
198,
65,
796,
13151,
13,
4051,
198,
66,
796,
705,
15496,
2159,
13679,
198,
198,
4798,
7,
312,
7,
64,
4008,
198,
4798,
7,... | 2.159151 | 377 |
from peewee import AutoField, TextField, BigIntegerField, BooleanField, ForeignKeyField
from inscrawler.persistence.entity.base_model import BaseModel
from inscrawler.persistence.entity.profile_entity import ProfileEntity
# TODO create indexes
| [
6738,
613,
413,
1453,
1330,
11160,
15878,
11,
8255,
15878,
11,
4403,
46541,
15878,
11,
41146,
15878,
11,
8708,
9218,
15878,
198,
198,
6738,
1035,
66,
39464,
13,
19276,
13274,
13,
26858,
13,
8692,
62,
19849,
1330,
7308,
17633,
198,
6738,... | 3.859375 | 64 |
import sys
import math
from collections import defaultdict, deque
sys.setrecursionlimit(10 ** 6)
stdin = sys.stdin
INF = float('inf')
MOD = 10 ** 9 + 7
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().strip()
N = ni()
ans = 1
A = []
for i in range(2, N + 1):
A.append(i)
print(lcm(A) + 1) | [
11748,
25064,
198,
11748,
10688,
198,
6738,
17268,
1330,
4277,
11600,
11,
390,
4188,
198,
198,
17597,
13,
2617,
8344,
24197,
32374,
7,
940,
12429,
718,
8,
198,
19282,
259,
796,
25064,
13,
19282,
259,
198,
198,
1268,
37,
796,
12178,
10... | 2.492958 | 142 |
import argparse
import sys, os
import imageio
import tensorflow as tf
import Classification_BatchDataset
import TensorflowUtils as utils
import pickle
import time
from tensorflow.keras.models import Sequential, Model
from tensorflow.keras.layers import Conv2D, MaxPool2D, Dropout, Flatten, Dense, Input, Lambda
from tensorflow.keras.losses import CategoricalCrossentropy
from tensorflow.keras.metrics import Accuracy
from tensorflow.keras.optimizers import Adam
from tensorflow.keras import regularizers
from tensorflow.keras.regularizers import l2
from tensorflow.keras.preprocessing.image import ImageDataGenerator
from tensorflow.keras.callbacks import Callback
from sklearn.utils import shuffle
import numpy as np
import numpy.random as rng
FLAGS = None
def loadimgs(path,n = 0):
'''
path => Path of train directory or test directory
'''
X=[]
y = []
cat_dict = {}
lang_dict = {}
curr_y = n
# we load every alphabet seperately so we can isolate them later
for alphabet in os.listdir(path):
print("loading alphabet: " + alphabet)
lang_dict[alphabet] = [curr_y,None]
alphabet_path = os.path.join(path,alphabet)
# every letter/category has it's own column in the array, so load seperately
for letter in os.listdir(alphabet_path):
cat_dict[curr_y] = (alphabet, letter)
category_images=[]
letter_path = os.path.join(alphabet_path, letter)
# read all the images in the current category
dirlist = os.listdir(letter_path)
if len(dirlist)>1:
for filename in dirlist:
image_path = os.path.join(letter_path, filename)
image = imageio.imread(image_path)
category_images.append(image)
# print(len(category_images))
y.append(curr_y)
try:
uu = np.stack(category_images)
X.append(uu)
# edge case - last one
except ValueError as e:
print(e)
print("error - category_images:", category_images)
print(letter)
curr_y += 1
lang_dict[alphabet][1] = curr_y - 1
y = np.vstack(y)
X = np.stack(X)
return X,y,lang_dict
# def initialize_weights(shape, name=None):
# """
# The paper, http://www.cs.utoronto.ca/~gkoch/files/msc-thesis.pdf
# suggests to initialize CNN layer weights with mean as 0.0 and standard deviation of 0.01
# """
# return tf.random.normal(shape, mean = 0.0, stddev = 0.01)
#
# def initialize_bias(shape, name=None):
# """
# The paper, http://www.cs.utoronto.ca/~gkoch/files/msc-thesis.pdf
# suggests to initialize CNN layer bias with mean as 0.5 and standard deviation of 0.01
# """
# return tf.random.normal(shape, mean = 0.5, stddev = 0.01)
def get_siamese_model(input_shape):
"""
Model architecture based on the one provided in: http://www.cs.utoronto.ca/~gkoch/files/msc-thesis.pdf
"""
# Define the tensors for the two input images
left_input = Input(input_shape)
right_input = Input(input_shape)
initialize_weights = tf.keras.initializers.RandomNormal(mean=0., stddev=0.01)
initialize_bias = tf.keras.initializers.RandomNormal(mean=0.5, stddev=0.01)
# Convolutional Neural Network
model = Sequential([
Conv2D(64, (10,10), activation='relu', input_shape=input_shape,
kernel_initializer=initialize_weights, kernel_regularizer=l2(2e-4)),
MaxPool2D(),
Conv2D(128, (7,7), activation='relu',
kernel_initializer=initialize_weights,
bias_initializer=initialize_bias, kernel_regularizer=l2(2e-4)),
MaxPool2D(),
Conv2D(128, (4,4), activation='relu', kernel_initializer=initialize_weights,
bias_initializer=initialize_bias, kernel_regularizer=l2(2e-4)),
MaxPool2D(),
Conv2D(256, (4,4), activation='relu', kernel_initializer=initialize_weights,
bias_initializer=initialize_bias, kernel_regularizer=l2(2e-4)),
Flatten(),
Dense(4096, activation='sigmoid',
kernel_regularizer=l2(1e-3),
kernel_initializer=initialize_weights,bias_initializer=initialize_bias)
])
# Generate the encodings (feature vectors) for the two images
encoded_l = model(left_input)
encoded_r = model(right_input)
# Add a customized layer to compute the absolute difference between the encodings
L1_layer = Lambda(lambda tensors:tf.math.abs(tensors[0] - tensors[1]))
L1_distance = L1_layer([encoded_l, encoded_r])
# Add a dense layer with a sigmoid unit to generate the similarity score
prediction = Dense(1,activation='sigmoid',bias_initializer=initialize_bias)(L1_distance)
# Connect the inputs with the outputs
siamese_net = Model(inputs=[left_input,right_input],outputs=prediction)
# return the model
return siamese_net
def get_batch(batch_size,s="train"):
"""Create batch of n pairs, half same class, half different class"""
if s == 'train':
X = Xtrain
categories = train_classes
else:
X = Xval
categories = val_classes
n_classes, n_examples, h, w = X.shape
# randomly sample several classes to use in the batch
categories = rng.choice(n_classes,size=(batch_size,),replace=False)
# initialize 2 empty arrays for the input image batch
pairs=[np.zeros((batch_size, h, w,1)) for i in range(2)]
# initialize vector for the targets
targets=np.zeros((batch_size,))
# make one half of it '1's, so 2nd half of batch has same class
targets[batch_size//2:] = 1
for i in range(batch_size):
category = categories[i]
idx_1 = rng.randint(0, n_examples)
pairs[0][i,:,:,:] = X[category, idx_1].reshape(h, w, 1)
idx_2 = rng.randint(0, n_examples)
# pick images of same class for 1st half, different for 2nd
if i >= batch_size // 2:
category_2 = category
else:
# add a random number to the category modulo n classes to ensure 2nd image has a different category
category_2 = (category + rng.randint(1,n_classes)) % n_classes
pairs[1][i,:,:,:] = X[category_2,idx_2].reshape(h, w,1)
return pairs, targets
def generate(batch_size, s="train"):
"""a generator for batches, so model.fit_generator can be used. """
while True:
pairs, targets = get_batch(batch_size,s)
yield (pairs, targets)
def make_oneshot_task(N, s="val", language=None):
"""Create pairs of test image, support set for testing N way one-shot learning. """
if s == 'train':
X = Xtrain
categories = train_classes
elif s == 'val':
X = Xval
categories = val_classes
else :
X = Xtest2
categories = test2_classes
n_classes, n_examples,h, w = X.shape
indices = rng.randint(0, n_examples,size=(N,))
if language is not None: # if language is specified, select characters for that language
low, high = categories[language]
if N > high - low:
raise ValueError("This language ({}) has less than {} letters".format(language, N))
categories = rng.choice(range(low,high),size=(N,),replace=False)
else: # if no language specified just pick a bunch of random letters
categories = rng.choice(range(n_classes),size=(N,),replace=False)
true_category = categories[0]
ex1, ex2 = rng.choice(n_examples,replace=False,size=(2,))
test_image = np.asarray([X[true_category,ex1,:,:]]*N).reshape(N, h,w,1)
support_set = X[categories,indices,:,:]
support_set[0,:,:] = X[true_category,ex2]
support_set = support_set.reshape(N, h, w,1)
targets = np.zeros((N,))
targets[0] = 1
targets, test_image, support_set = shuffle(targets, test_image, support_set)
pairs = [test_image,support_set]
return pairs, targets
def test_oneshot(model, N, k, s = "val", verbose = 0):
"""Test average N way oneshot learning accuracy of a siamese neural net over k one-shot tasks"""
n_correct = 0
if verbose:
print("Evaluating model on {} random {} way one-shot learning tasks from {} ... \n".format(k,N, s))
for i in range(k):
inputs, targets = make_oneshot_task(N,s)
probs = model.predict(inputs)
if np.argmax(probs) == np.argmax(targets):
n_correct+=1
# else:
# print(targets[np.argmax(targets)])
percent_correct = (100.0 * n_correct / k)
if verbose:
print("Got an average of {}% {} way one-shot learning accuracy \n".format(percent_correct,N))
return percent_correct
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument('--data_dir', type=str,
default='dataset',
help='Directory for storing input data')
parser.add_argument('--batch_size', type=int,
default=128)
parser.add_argument('--epochs', type=int,
default=50)
parser.add_argument('--steps', type=int,
default=1000)
parser.add_argument('-n', default=100, type=int)
FLAGS, unparsed = parser.parse_known_args()
dataset_dir = FLAGS.data_dir
batch_size=FLAGS.batch_size
nperclass = 100
epochs=FLAGS.epochs
steps = FLAGS.steps
# mode=FLAGS.mode
train_dir = os.path.join(dataset_dir, 'train')
validation_dir = os.path.join(dataset_dir, 'validate')
intrain_test_dir = os.path.join(dataset_dir, 'test2')
# classes= os.listdir(train_dir)
model = get_siamese_model((220, 120, 1))
model.summary()
optimizer = Adam(learning_rate=0.00006)
model.compile(loss="binary_crossentropy",optimizer=optimizer)
X,y,c = loadimgs(train_dir)
with open(os.path.join(dataset_dir,"train.pickle"), "wb") as f:
pickle.dump((X,c),f)
Xval,yval,cval=loadimgs(validation_dir)
with open(os.path.join(dataset_dir,"val.pickle"), "wb") as f:
pickle.dump((Xval,cval),f)
Xtest2,ytest2,ctest2=loadimgs(intrain_test_dir)
with open(os.path.join(dataset_dir,"test2.pickle"), "wb") as f:
pickle.dump((Xtest2,ctest2),f)
with open(os.path.join(dataset_dir, "train.pickle"), "rb") as f:
(Xtrain, train_classes) = pickle.load(f)
with open(os.path.join(dataset_dir, "val.pickle"), "rb") as f:
(Xval, val_classes) = pickle.load(f)
with open(os.path.join(dataset_dir, "test2.pickle"), "rb") as f:
(Xtest2, test2_classes) = pickle.load(f)
evaluate_every = 1 # interval for evaluating on one-shot tasks
n_iter = 7500 # No. of training iterations
N_way = 18 # how many classes for testing one-shot tasks
n_val = 200 # how many one-shot tasks to validate on
best = -1
print("Starting training process!")
print("-------------------------------------")
t_start = time.time()
history = model.fit(generate(batch_size, "train"), steps_per_epoch=steps, epochs=epochs, callbacks=[CustomCallback()])
print(history)
# for i in range(1, n_iter+1):
# (inputs,targets) = get_batch(batch_size)
# loss = model.train_on_batch(inputs, targets)
# if i % evaluate_every == 0:
# print("\n ------------- \n")
# print("Time for {0} iterations: {1} mins".format(i, (time.time()-t_start)/60.0))
# print("Train Loss: {0}".format(loss))
# val_acc = test_oneshot(model, N_way, n_val, verbose=True)
# model.save_weights(os.path.join(dataset_dir, 'weights.{}.h5'.format(i)))
# if val_acc >= best:
# print("Current best: {0}, previous best: {1}".format(val_acc, best))
# best = val_acc
| [
198,
198,
11748,
1822,
29572,
198,
11748,
25064,
11,
28686,
198,
198,
11748,
2939,
952,
198,
11748,
11192,
273,
11125,
355,
48700,
198,
11748,
40984,
62,
33,
963,
27354,
292,
316,
198,
11748,
309,
22854,
11125,
18274,
4487,
355,
3384,
4... | 2.322311 | 5,141 |
# -*- coding: utf-8 -*-
"""
Created March 2015 by JT Fuchs, UNC.
This program interpolates grids of models. It is called by finegrid.py, which contains all the necessary options. Unless you want to change which wavelengths to keep, you shouldn't need to change things here. But keep in mind that interpolation is tricky, you should look at the results carefully.
"""
import numpy as np
import matplotlib.pyplot as plt
from scipy.interpolate import InterpolatedUnivariateSpline
from scipy.interpolate import RectBivariateSpline
import os
import datetime
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
41972,
2805,
1853,
416,
449,
51,
376,
37533,
11,
39151,
13,
198,
198,
1212,
1430,
39555,
689,
50000,
286,
4981,
13,
632,
318,
1444,
416,
3734,
25928,
13,
9... | 3.706667 | 150 |
import re
# Search for an upper case "S" character in the beginning of a word, and print its position:
txt = "The rain in Spain"
x = re.search(r"\bS\w+", txt)
print(x.span())
| [
11748,
302,
198,
198,
2,
11140,
329,
281,
6727,
1339,
366,
50,
1,
2095,
287,
262,
3726,
286,
257,
1573,
11,
290,
3601,
663,
2292,
25,
198,
198,
14116,
796,
366,
464,
6290,
287,
8602,
1,
198,
87,
796,
302,
13,
12947,
7,
81,
1,
... | 2.809524 | 63 |
#!/usr/bin/env python
# coding: utf-8
# In[31]:
from typing import Optional, Callable, Tuple, List, NoReturn
from functools import partial, reduce
import matplotlib.pyplot as plt
import matplotlib.image as img
import numpy as np
import cv2 as cv
import PIL as pil
# In[2]:
# User-defined functions, utils module found in the same directory as Erosion.ipynb
from utils import binarise, side_by_side
# In[3]:
x = img.imread('imagenes/Im1T4.png')
# In[4]:
plt.imshow(x, cmap='gray')
# In[5]:
x = 1 - x
# In[6]:
plt.imshow(x, cmap='gray')
# In[7]:
binaria = binarise(x)
plt.imshow(binaria, cmap='gray')
# In[8]:
help(cv.dilate)
# In[9]:
kernel = np.ones((10, 10))
side_by_side(binaria, cv.dilate(binaria, kernel), title1='Original', title2=f'Kernel {kernel.shape}')
# In[10]:
kernel = np.ones((2, 50))
side_by_side(binaria, cv.dilate(binaria, kernel), title1='Original', title2=f'Kernel {kernel.shape}')
# In[11]:
kernel = np.ones((50, 2))
side_by_side(binaria, cv.dilate(binaria, kernel), title1='Original', title2=f'Kernel {kernel.shape}')
# # Example found on page 643
# In[12]:
text = cv.imread('imagenes/text.png', 0)
text.shape
# In[13]:
plt.imshow(text, cmap='gray')
# In[14]:
text2 = binarise(text, threshold=115)
plt.imshow(text2, cmap='gray')
# In[15]:
kernel = np.ones((1, 1))
side_by_side(text2, cv.dilate(text2, kernel), title1='Original', title2=f'Kernel {kernel.shape}')
# In[16]:
kernel = np.ones((3, 3))
side_by_side(text2[400:, 400:], cv.dilate(text2[400:, 400:], kernel), title1='Original', title2=f'Kernel {kernel.shape}')
# In[17]:
kernel = np.ones((15, 15))
side_by_side(text2, cv.dilate(text2, kernel), title1='Original', title2=f'Kernel {kernel.shape}')
# In[ ]:
# In[43]:
A = np.zeros((11, 11))
A[5, 5] = 1
plt.grid()
plt.imshow(A, cmap='gray')
# In[42]:
B = [A, np.ones((3, 1)), np.ones((1, 3))]
dilate_decomposed = reduce(lambda x, y: cv.dilate(x, y), B)
plt.grid()
plt.imshow(dilate_decomposed, cmap='gray')
# In[49]:
y = np.array([1, 1, 0, 0, 1, 1, 0, 1, 0])
y.shape = 3, 3
y = np.uint8(y)
y
# In[52]:
side_by_side(A, cv.dilate(A, y))
# In[40]:
np.ones((3, 1))
# In[ ]:
reverse
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
19617,
25,
3384,
69,
12,
23,
198,
198,
2,
554,
58,
3132,
5974,
628,
198,
6738,
19720,
1330,
32233,
11,
4889,
540,
11,
309,
29291,
11,
7343,
11,
1400,
13615,
198,
6738,
1257,
310... | 2.229757 | 988 |
from .bulletin import Bulletin
from bs4 import BeautifulSoup
import re
| [
6738,
764,
15065,
1616,
259,
1330,
30551,
198,
6738,
275,
82,
19,
1330,
23762,
50,
10486,
198,
198,
11748,
302,
628,
198
] | 3.363636 | 22 |
"""
Copyright Jun 2021 Konstantin Briukhnov (kooltew at gmail.com) (@CostaBru). San-Francisco Bay Area.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
"""
from flags.flags import doUseLimits, doSolveSuperInc
from .knapsack import knapsackSolver
from .knapsackNd import knapsackNSolver
from .knapsackPareto import *
from collections import defaultdict
from collections import deque
from decimal import Decimal
import time
import math
import sys
from .paretoPoint import paretoPoint, paretoPoint1
from .wPoint import wPoint1
| [
37811,
198,
15269,
7653,
33448,
17431,
18797,
259,
25866,
2724,
21116,
709,
357,
74,
970,
83,
413,
379,
308,
4529,
13,
785,
8,
4275,
13729,
64,
33,
622,
737,
2986,
12,
42885,
4861,
4696,
9498,
13,
198,
198,
5990,
3411,
318,
29376,
7... | 3.774436 | 399 |
from mido import Message
from settings import MIDI_MSG_NOTE_OFFSET
from utility.state import KeyState
| [
6738,
3095,
78,
1330,
16000,
198,
6738,
6460,
1330,
33439,
62,
5653,
38,
62,
16580,
62,
27977,
28480,
198,
6738,
10361,
13,
5219,
1330,
7383,
9012,
628
] | 3.814815 | 27 |
import torch
import torch.nn as nn
import torch.utils.data as data
import torch.optim as optim
import torch.nn.functional as F
import torchaudio
class TextTransform:
"""Maps characters to integers and vice versa"""
def text_to_int(self, text):
""" Use a character map and convert text to an integer sequence """
int_sequence = []
for c in text:
if c == ' ':
ch = self.char_map['<SPACE>']
else:
ch = self.char_map[c]
int_sequence.append(ch)
return int_sequence
def int_to_text(self, labels):
""" Use a character map and convert integer labels to an text sequence """
string = []
for i in labels:
string.append(self.index_map[i])
return ''.join(string).replace('<SPACE>', ' ')
text_transform = TextTransform()
class CNNLayerNorm(nn.Module):
"""Layer normalization built for cnns input"""
class ResidualCNN(nn.Module):
"""Residual CNN inspired by https://arxiv.org/pdf/1603.05027.pdf
except with layer norm instead of batch norm
"""
| [
11748,
28034,
201,
198,
11748,
28034,
13,
20471,
355,
299,
77,
201,
198,
11748,
28034,
13,
26791,
13,
7890,
355,
1366,
201,
198,
11748,
28034,
13,
40085,
355,
6436,
201,
198,
11748,
28034,
13,
20471,
13,
45124,
355,
376,
201,
198,
117... | 2.349593 | 492 |
resources = {
'style': {
'Animation' : 16973824,
'Animation.Activity' : 16973825,
'Animation.Dialog' : 16973826,
'Animation.InputMethod' : 16973910,
'Animation.Toast' : 16973828,
'Animation.Translucent' : 16973827,
'DeviceDefault.ButtonBar' : 16974287,
'DeviceDefault.ButtonBar.AlertDialog' : 16974288,
'DeviceDefault.Light.ButtonBar' : 16974290,
'DeviceDefault.Light.ButtonBar.AlertDialog' : 16974291,
'DeviceDefault.Light.SegmentedButton' : 16974292,
'DeviceDefault.SegmentedButton' : 16974289,
'Holo.ButtonBar' : 16974053,
'Holo.ButtonBar.AlertDialog' : 16974055,
'Holo.Light.ButtonBar' : 16974054,
'Holo.Light.ButtonBar.AlertDialog' : 16974056,
'Holo.Light.SegmentedButton' : 16974058,
'Holo.SegmentedButton' : 16974057,
'MediaButton' : 16973879,
'MediaButton.Ffwd' : 16973883,
'MediaButton.Next' : 16973881,
'MediaButton.Pause' : 16973885,
'MediaButton.Play' : 16973882,
'MediaButton.Previous' : 16973880,
'MediaButton.Rew' : 16973884,
'TextAppearance' : 16973886,
'TextAppearance.DeviceDefault' : 16974253,
'TextAppearance.DeviceDefault.DialogWindowTitle' : 16974264,
'TextAppearance.DeviceDefault.Inverse' : 16974254,
'TextAppearance.DeviceDefault.Large' : 16974255,
'TextAppearance.DeviceDefault.Large.Inverse' : 16974256,
'TextAppearance.DeviceDefault.Medium' : 16974257,
'TextAppearance.DeviceDefault.Medium.Inverse' : 16974258,
'TextAppearance.DeviceDefault.SearchResult.Subtitle' : 16974262,
'TextAppearance.DeviceDefault.SearchResult.Title' : 16974261,
'TextAppearance.DeviceDefault.Small' : 16974259,
'TextAppearance.DeviceDefault.Small.Inverse' : 16974260,
'TextAppearance.DeviceDefault.Widget' : 16974265,
'TextAppearance.DeviceDefault.Widget.ActionBar.Menu' : 16974286,
'TextAppearance.DeviceDefault.Widget.ActionBar.Subtitle' : 16974279,
'TextAppearance.DeviceDefault.Widget.ActionBar.Subtitle.Inverse' : 16974283,
'TextAppearance.DeviceDefault.Widget.ActionBar.Title' : 16974278,
'TextAppearance.DeviceDefault.Widget.ActionBar.Title.Inverse' : 16974282,
'TextAppearance.DeviceDefault.Widget.ActionMode.Subtitle' : 16974281,
'TextAppearance.DeviceDefault.Widget.ActionMode.Subtitle.Inverse' : 16974285,
'TextAppearance.DeviceDefault.Widget.ActionMode.Title' : 16974280,
'TextAppearance.DeviceDefault.Widget.ActionMode.Title.Inverse' : 16974284,
'TextAppearance.DeviceDefault.Widget.Button' : 16974266,
'TextAppearance.DeviceDefault.Widget.DropDownHint' : 16974271,
'TextAppearance.DeviceDefault.Widget.DropDownItem' : 16974272,
'TextAppearance.DeviceDefault.Widget.EditText' : 16974274,
'TextAppearance.DeviceDefault.Widget.IconMenu.Item' : 16974267,
'TextAppearance.DeviceDefault.Widget.PopupMenu' : 16974275,
'TextAppearance.DeviceDefault.Widget.PopupMenu.Large' : 16974276,
'TextAppearance.DeviceDefault.Widget.PopupMenu.Small' : 16974277,
'TextAppearance.DeviceDefault.Widget.TabWidget' : 16974268,
'TextAppearance.DeviceDefault.Widget.TextView' : 16974269,
'TextAppearance.DeviceDefault.Widget.TextView.PopupMenu' : 16974270,
'TextAppearance.DeviceDefault.Widget.TextView.SpinnerItem' : 16974273,
'TextAppearance.DeviceDefault.WindowTitle' : 16974263,
'TextAppearance.DialogWindowTitle' : 16973889,
'TextAppearance.Holo' : 16974075,
'TextAppearance.Holo.DialogWindowTitle' : 16974103,
'TextAppearance.Holo.Inverse' : 16974076,
'TextAppearance.Holo.Large' : 16974077,
'TextAppearance.Holo.Large.Inverse' : 16974078,
'TextAppearance.Holo.Medium' : 16974079,
'TextAppearance.Holo.Medium.Inverse' : 16974080,
'TextAppearance.Holo.SearchResult.Subtitle' : 16974084,
'TextAppearance.Holo.SearchResult.Title' : 16974083,
'TextAppearance.Holo.Small' : 16974081,
'TextAppearance.Holo.Small.Inverse' : 16974082,
'TextAppearance.Holo.Widget' : 16974085,
'TextAppearance.Holo.Widget.ActionBar.Menu' : 16974112,
'TextAppearance.Holo.Widget.ActionBar.Subtitle' : 16974099,
'TextAppearance.Holo.Widget.ActionBar.Subtitle.Inverse' : 16974109,
'TextAppearance.Holo.Widget.ActionBar.Title' : 16974098,
'TextAppearance.Holo.Widget.ActionBar.Title.Inverse' : 16974108,
'TextAppearance.Holo.Widget.ActionMode.Subtitle' : 16974101,
'TextAppearance.Holo.Widget.ActionMode.Subtitle.Inverse' : 16974111,
'TextAppearance.Holo.Widget.ActionMode.Title' : 16974100,
'TextAppearance.Holo.Widget.ActionMode.Title.Inverse' : 16974110,
'TextAppearance.Holo.Widget.Button' : 16974086,
'TextAppearance.Holo.Widget.DropDownHint' : 16974091,
'TextAppearance.Holo.Widget.DropDownItem' : 16974092,
'TextAppearance.Holo.Widget.EditText' : 16974094,
'TextAppearance.Holo.Widget.IconMenu.Item' : 16974087,
'TextAppearance.Holo.Widget.PopupMenu' : 16974095,
'TextAppearance.Holo.Widget.PopupMenu.Large' : 16974096,
'TextAppearance.Holo.Widget.PopupMenu.Small' : 16974097,
'TextAppearance.Holo.Widget.TabWidget' : 16974088,
'TextAppearance.Holo.Widget.TextView' : 16974089,
'TextAppearance.Holo.Widget.TextView.PopupMenu' : 16974090,
'TextAppearance.Holo.Widget.TextView.SpinnerItem' : 16974093,
'TextAppearance.Holo.WindowTitle' : 16974102,
'TextAppearance.Inverse' : 16973887,
'TextAppearance.Large' : 16973890,
'TextAppearance.Large.Inverse' : 16973891,
'TextAppearance.Material' : 16974317,
'TextAppearance.Material.Body1' : 16974320,
'TextAppearance.Material.Body2' : 16974319,
'TextAppearance.Material.Button' : 16974318,
'TextAppearance.Material.Caption' : 16974321,
'TextAppearance.Material.DialogWindowTitle' : 16974322,
'TextAppearance.Material.Display1' : 16974326,
'TextAppearance.Material.Display2' : 16974325,
'TextAppearance.Material.Display3' : 16974324,
'TextAppearance.Material.Display4' : 16974323,
'TextAppearance.Material.Headline' : 16974327,
'TextAppearance.Material.Inverse' : 16974328,
'TextAppearance.Material.Large' : 16974329,
'TextAppearance.Material.Large.Inverse' : 16974330,
'TextAppearance.Material.Medium' : 16974331,
'TextAppearance.Material.Medium.Inverse' : 16974332,
'TextAppearance.Material.Menu' : 16974333,
'TextAppearance.Material.Notification' : 16974334,
'TextAppearance.Material.Notification.Emphasis' : 16974335,
'TextAppearance.Material.Notification.Info' : 16974336,
'TextAppearance.Material.Notification.Line2' : 16974337,
'TextAppearance.Material.Notification.Time' : 16974338,
'TextAppearance.Material.Notification.Title' : 16974339,
'TextAppearance.Material.SearchResult.Subtitle' : 16974340,
'TextAppearance.Material.SearchResult.Title' : 16974341,
'TextAppearance.Material.Small' : 16974342,
'TextAppearance.Material.Small.Inverse' : 16974343,
'TextAppearance.Material.Subhead' : 16974344,
'TextAppearance.Material.Title' : 16974345,
'TextAppearance.Material.Widget' : 16974347,
'TextAppearance.Material.Widget.ActionBar.Menu' : 16974348,
'TextAppearance.Material.Widget.ActionBar.Subtitle' : 16974349,
'TextAppearance.Material.Widget.ActionBar.Subtitle.Inverse' : 16974350,
'TextAppearance.Material.Widget.ActionBar.Title' : 16974351,
'TextAppearance.Material.Widget.ActionBar.Title.Inverse' : 16974352,
'TextAppearance.Material.Widget.ActionMode.Subtitle' : 16974353,
'TextAppearance.Material.Widget.ActionMode.Subtitle.Inverse' : 16974354,
'TextAppearance.Material.Widget.ActionMode.Title' : 16974355,
'TextAppearance.Material.Widget.ActionMode.Title.Inverse' : 16974356,
'TextAppearance.Material.Widget.Button' : 16974357,
'TextAppearance.Material.Widget.DropDownHint' : 16974358,
'TextAppearance.Material.Widget.DropDownItem' : 16974359,
'TextAppearance.Material.Widget.EditText' : 16974360,
'TextAppearance.Material.Widget.IconMenu.Item' : 16974361,
'TextAppearance.Material.Widget.PopupMenu' : 16974362,
'TextAppearance.Material.Widget.PopupMenu.Large' : 16974363,
'TextAppearance.Material.Widget.PopupMenu.Small' : 16974364,
'TextAppearance.Material.Widget.TabWidget' : 16974365,
'TextAppearance.Material.Widget.TextView' : 16974366,
'TextAppearance.Material.Widget.TextView.PopupMenu' : 16974367,
'TextAppearance.Material.Widget.TextView.SpinnerItem' : 16974368,
'TextAppearance.Material.Widget.Toolbar.Subtitle' : 16974369,
'TextAppearance.Material.Widget.Toolbar.Title' : 16974370,
'TextAppearance.Material.WindowTitle' : 16974346,
'TextAppearance.Medium' : 16973892,
'TextAppearance.Medium.Inverse' : 16973893,
'TextAppearance.Small' : 16973894,
'TextAppearance.Small.Inverse' : 16973895,
'TextAppearance.StatusBar.EventContent' : 16973927,
'TextAppearance.StatusBar.EventContent.Title' : 16973928,
'TextAppearance.StatusBar.Icon' : 16973926,
'TextAppearance.StatusBar.Title' : 16973925,
'TextAppearance.SuggestionHighlight' : 16974104,
'TextAppearance.Theme' : 16973888,
'TextAppearance.Theme.Dialog' : 16973896,
'TextAppearance.Widget' : 16973897,
'TextAppearance.Widget.Button' : 16973898,
'TextAppearance.Widget.DropDownHint' : 16973904,
'TextAppearance.Widget.DropDownItem' : 16973905,
'TextAppearance.Widget.EditText' : 16973900,
'TextAppearance.Widget.IconMenu.Item' : 16973899,
'TextAppearance.Widget.PopupMenu.Large' : 16973952,
'TextAppearance.Widget.PopupMenu.Small' : 16973953,
'TextAppearance.Widget.TabWidget' : 16973901,
'TextAppearance.Widget.TextView' : 16973902,
'TextAppearance.Widget.TextView.PopupMenu' : 16973903,
'TextAppearance.Widget.TextView.SpinnerItem' : 16973906,
'TextAppearance.WindowTitle' : 16973907,
'Theme' : 16973829,
'ThemeOverlay' : 16974407,
'ThemeOverlay.Material' : 16974408,
'ThemeOverlay.Material.ActionBar' : 16974409,
'ThemeOverlay.Material.Dark' : 16974411,
'ThemeOverlay.Material.Dark.ActionBar' : 16974412,
'ThemeOverlay.Material.Light' : 16974410,
'Theme.Black' : 16973832,
'Theme.Black.NoTitleBar' : 16973833,
'Theme.Black.NoTitleBar.Fullscreen' : 16973834,
'Theme.DeviceDefault' : 16974120,
'Theme.DeviceDefault.Dialog' : 16974126,
'Theme.DeviceDefault.DialogWhenLarge' : 16974134,
'Theme.DeviceDefault.DialogWhenLarge.NoActionBar' : 16974135,
'Theme.DeviceDefault.Dialog.MinWidth' : 16974127,
'Theme.DeviceDefault.Dialog.NoActionBar' : 16974128,
'Theme.DeviceDefault.Dialog.NoActionBar.MinWidth' : 16974129,
'Theme.DeviceDefault.InputMethod' : 16974142,
'Theme.DeviceDefault.Light' : 16974123,
'Theme.DeviceDefault.Light.DarkActionBar' : 16974143,
'Theme.DeviceDefault.Light.Dialog' : 16974130,
'Theme.DeviceDefault.Light.DialogWhenLarge' : 16974136,
'Theme.DeviceDefault.Light.DialogWhenLarge.NoActionBar' : 16974137,
'Theme.DeviceDefault.Light.Dialog.MinWidth' : 16974131,
'Theme.DeviceDefault.Light.Dialog.NoActionBar' : 16974132,
'Theme.DeviceDefault.Light.Dialog.NoActionBar.MinWidth' : 16974133,
'Theme.DeviceDefault.Light.NoActionBar' : 16974124,
'Theme.DeviceDefault.Light.NoActionBar.Fullscreen' : 16974125,
'Theme.DeviceDefault.Light.NoActionBar.Overscan' : 16974304,
'Theme.DeviceDefault.Light.NoActionBar.TranslucentDecor' : 16974308,
'Theme.DeviceDefault.Light.Panel' : 16974139,
'Theme.DeviceDefault.NoActionBar' : 16974121,
'Theme.DeviceDefault.NoActionBar.Fullscreen' : 16974122,
'Theme.DeviceDefault.NoActionBar.Overscan' : 16974303,
'Theme.DeviceDefault.NoActionBar.TranslucentDecor' : 16974307,
'Theme.DeviceDefault.Panel' : 16974138,
'Theme.DeviceDefault.Settings' : 16974371,
'Theme.DeviceDefault.Wallpaper' : 16974140,
'Theme.DeviceDefault.Wallpaper.NoTitleBar' : 16974141,
'Theme.Dialog' : 16973835,
'Theme.Holo' : 16973931,
'Theme.Holo.Dialog' : 16973935,
'Theme.Holo.DialogWhenLarge' : 16973943,
'Theme.Holo.DialogWhenLarge.NoActionBar' : 16973944,
'Theme.Holo.Dialog.MinWidth' : 16973936,
'Theme.Holo.Dialog.NoActionBar' : 16973937,
'Theme.Holo.Dialog.NoActionBar.MinWidth' : 16973938,
'Theme.Holo.InputMethod' : 16973951,
'Theme.Holo.Light' : 16973934,
'Theme.Holo.Light.DarkActionBar' : 16974105,
'Theme.Holo.Light.Dialog' : 16973939,
'Theme.Holo.Light.DialogWhenLarge' : 16973945,
'Theme.Holo.Light.DialogWhenLarge.NoActionBar' : 16973946,
'Theme.Holo.Light.Dialog.MinWidth' : 16973940,
'Theme.Holo.Light.Dialog.NoActionBar' : 16973941,
'Theme.Holo.Light.Dialog.NoActionBar.MinWidth' : 16973942,
'Theme.Holo.Light.NoActionBar' : 16974064,
'Theme.Holo.Light.NoActionBar.Fullscreen' : 16974065,
'Theme.Holo.Light.NoActionBar.Overscan' : 16974302,
'Theme.Holo.Light.NoActionBar.TranslucentDecor' : 16974306,
'Theme.Holo.Light.Panel' : 16973948,
'Theme.Holo.NoActionBar' : 16973932,
'Theme.Holo.NoActionBar.Fullscreen' : 16973933,
'Theme.Holo.NoActionBar.Overscan' : 16974301,
'Theme.Holo.NoActionBar.TranslucentDecor' : 16974305,
'Theme.Holo.Panel' : 16973947,
'Theme.Holo.Wallpaper' : 16973949,
'Theme.Holo.Wallpaper.NoTitleBar' : 16973950,
'Theme.InputMethod' : 16973908,
'Theme.Light' : 16973836,
'Theme.Light.NoTitleBar' : 16973837,
'Theme.Light.NoTitleBar.Fullscreen' : 16973838,
'Theme.Light.Panel' : 16973914,
'Theme.Light.WallpaperSettings' : 16973922,
'Theme.Material' : 16974372,
'Theme.Material.Dialog' : 16974373,
'Theme.Material.DialogWhenLarge' : 16974379,
'Theme.Material.DialogWhenLarge.NoActionBar' : 16974380,
'Theme.Material.Dialog.Alert' : 16974374,
'Theme.Material.Dialog.MinWidth' : 16974375,
'Theme.Material.Dialog.NoActionBar' : 16974376,
'Theme.Material.Dialog.NoActionBar.MinWidth' : 16974377,
'Theme.Material.Dialog.Presentation' : 16974378,
'Theme.Material.InputMethod' : 16974381,
'Theme.Material.Light' : 16974391,
'Theme.Material.Light.DarkActionBar' : 16974392,
'Theme.Material.Light.Dialog' : 16974393,
'Theme.Material.Light.DialogWhenLarge' : 16974399,
'Theme.Material.Light.DialogWhenLarge.NoActionBar' : 16974400,
'Theme.Material.Light.Dialog.Alert' : 16974394,
'Theme.Material.Light.Dialog.MinWidth' : 16974395,
'Theme.Material.Light.Dialog.NoActionBar' : 16974396,
'Theme.Material.Light.Dialog.NoActionBar.MinWidth' : 16974397,
'Theme.Material.Light.Dialog.Presentation' : 16974398,
'Theme.Material.Light.NoActionBar' : 16974401,
'Theme.Material.Light.NoActionBar.Fullscreen' : 16974402,
'Theme.Material.Light.NoActionBar.Overscan' : 16974403,
'Theme.Material.Light.NoActionBar.TranslucentDecor' : 16974404,
'Theme.Material.Light.Panel' : 16974405,
'Theme.Material.Light.Voice' : 16974406,
'Theme.Material.NoActionBar' : 16974382,
'Theme.Material.NoActionBar.Fullscreen' : 16974383,
'Theme.Material.NoActionBar.Overscan' : 16974384,
'Theme.Material.NoActionBar.TranslucentDecor' : 16974385,
'Theme.Material.Panel' : 16974386,
'Theme.Material.Settings' : 16974387,
'Theme.Material.Voice' : 16974388,
'Theme.Material.Wallpaper' : 16974389,
'Theme.Material.Wallpaper.NoTitleBar' : 16974390,
'Theme.NoDisplay' : 16973909,
'Theme.NoTitleBar' : 16973830,
'Theme.NoTitleBar.Fullscreen' : 16973831,
'Theme.NoTitleBar.OverlayActionModes' : 16973930,
'Theme.Panel' : 16973913,
'Theme.Translucent' : 16973839,
'Theme.Translucent.NoTitleBar' : 16973840,
'Theme.Translucent.NoTitleBar.Fullscreen' : 16973841,
'Theme.Wallpaper' : 16973918,
'Theme.WallpaperSettings' : 16973921,
'Theme.Wallpaper.NoTitleBar' : 16973919,
'Theme.Wallpaper.NoTitleBar.Fullscreen' : 16973920,
'Theme.WithActionBar' : 16973929,
'Widget' : 16973842,
'Widget.AbsListView' : 16973843,
'Widget.ActionBar' : 16973954,
'Widget.ActionBar.TabBar' : 16974068,
'Widget.ActionBar.TabText' : 16974067,
'Widget.ActionBar.TabView' : 16974066,
'Widget.ActionButton' : 16973956,
'Widget.ActionButton.CloseMode' : 16973960,
'Widget.ActionButton.Overflow' : 16973959,
'Widget.AutoCompleteTextView' : 16973863,
'Widget.Button' : 16973844,
'Widget.Button.Inset' : 16973845,
'Widget.Button.Small' : 16973846,
'Widget.Button.Toggle' : 16973847,
'Widget.CalendarView' : 16974059,
'Widget.CompoundButton' : 16973848,
'Widget.CompoundButton.CheckBox' : 16973849,
'Widget.CompoundButton.RadioButton' : 16973850,
'Widget.CompoundButton.Star' : 16973851,
'Widget.DatePicker' : 16974062,
'Widget.DeviceDefault' : 16974144,
'Widget.DeviceDefault.ActionBar' : 16974187,
'Widget.DeviceDefault.ActionBar.Solid' : 16974195,
'Widget.DeviceDefault.ActionBar.TabBar' : 16974194,
'Widget.DeviceDefault.ActionBar.TabText' : 16974193,
'Widget.DeviceDefault.ActionBar.TabView' : 16974192,
'Widget.DeviceDefault.ActionButton' : 16974182,
'Widget.DeviceDefault.ActionButton.CloseMode' : 16974186,
'Widget.DeviceDefault.ActionButton.Overflow' : 16974183,
'Widget.DeviceDefault.ActionButton.TextButton' : 16974184,
'Widget.DeviceDefault.ActionMode' : 16974185,
'Widget.DeviceDefault.AutoCompleteTextView' : 16974151,
'Widget.DeviceDefault.Button' : 16974145,
'Widget.DeviceDefault.Button.Borderless' : 16974188,
'Widget.DeviceDefault.Button.Borderless.Small' : 16974149,
'Widget.DeviceDefault.Button.Inset' : 16974147,
'Widget.DeviceDefault.Button.Small' : 16974146,
'Widget.DeviceDefault.Button.Toggle' : 16974148,
'Widget.DeviceDefault.CalendarView' : 16974190,
'Widget.DeviceDefault.CheckedTextView' : 16974299,
'Widget.DeviceDefault.CompoundButton.CheckBox' : 16974152,
'Widget.DeviceDefault.CompoundButton.RadioButton' : 16974169,
'Widget.DeviceDefault.CompoundButton.Star' : 16974173,
'Widget.DeviceDefault.DatePicker' : 16974191,
'Widget.DeviceDefault.DropDownItem' : 16974177,
'Widget.DeviceDefault.DropDownItem.Spinner' : 16974178,
'Widget.DeviceDefault.EditText' : 16974154,
'Widget.DeviceDefault.ExpandableListView' : 16974155,
'Widget.DeviceDefault.FastScroll' : 16974313,
'Widget.DeviceDefault.GridView' : 16974156,
'Widget.DeviceDefault.HorizontalScrollView' : 16974171,
'Widget.DeviceDefault.ImageButton' : 16974157,
'Widget.DeviceDefault.Light' : 16974196,
'Widget.DeviceDefault.Light.ActionBar' : 16974243,
'Widget.DeviceDefault.Light.ActionBar.Solid' : 16974247,
'Widget.DeviceDefault.Light.ActionBar.Solid.Inverse' : 16974248,
'Widget.DeviceDefault.Light.ActionBar.TabBar' : 16974246,
'Widget.DeviceDefault.Light.ActionBar.TabBar.Inverse' : 16974249,
'Widget.DeviceDefault.Light.ActionBar.TabText' : 16974245,
'Widget.DeviceDefault.Light.ActionBar.TabText.Inverse' : 16974251,
'Widget.DeviceDefault.Light.ActionBar.TabView' : 16974244,
'Widget.DeviceDefault.Light.ActionBar.TabView.Inverse' : 16974250,
'Widget.DeviceDefault.Light.ActionButton' : 16974239,
'Widget.DeviceDefault.Light.ActionButton.CloseMode' : 16974242,
'Widget.DeviceDefault.Light.ActionButton.Overflow' : 16974240,
'Widget.DeviceDefault.Light.ActionMode' : 16974241,
'Widget.DeviceDefault.Light.ActionMode.Inverse' : 16974252,
'Widget.DeviceDefault.Light.AutoCompleteTextView' : 16974203,
'Widget.DeviceDefault.Light.Button' : 16974197,
'Widget.DeviceDefault.Light.Button.Borderless.Small' : 16974201,
'Widget.DeviceDefault.Light.Button.Inset' : 16974199,
'Widget.DeviceDefault.Light.Button.Small' : 16974198,
'Widget.DeviceDefault.Light.Button.Toggle' : 16974200,
'Widget.DeviceDefault.Light.CalendarView' : 16974238,
'Widget.DeviceDefault.Light.CheckedTextView' : 16974300,
'Widget.DeviceDefault.Light.CompoundButton.CheckBox' : 16974204,
'Widget.DeviceDefault.Light.CompoundButton.RadioButton' : 16974224,
'Widget.DeviceDefault.Light.CompoundButton.Star' : 16974228,
'Widget.DeviceDefault.Light.DropDownItem' : 16974232,
'Widget.DeviceDefault.Light.DropDownItem.Spinner' : 16974233,
'Widget.DeviceDefault.Light.EditText' : 16974206,
'Widget.DeviceDefault.Light.ExpandableListView' : 16974207,
'Widget.DeviceDefault.Light.FastScroll' : 16974315,
'Widget.DeviceDefault.Light.GridView' : 16974208,
'Widget.DeviceDefault.Light.HorizontalScrollView' : 16974226,
'Widget.DeviceDefault.Light.ImageButton' : 16974209,
'Widget.DeviceDefault.Light.ListPopupWindow' : 16974235,
'Widget.DeviceDefault.Light.ListView' : 16974210,
'Widget.DeviceDefault.Light.ListView.DropDown' : 16974205,
'Widget.DeviceDefault.Light.MediaRouteButton' : 16974296,
'Widget.DeviceDefault.Light.PopupMenu' : 16974236,
'Widget.DeviceDefault.Light.PopupWindow' : 16974211,
'Widget.DeviceDefault.Light.ProgressBar' : 16974212,
'Widget.DeviceDefault.Light.ProgressBar.Horizontal' : 16974213,
'Widget.DeviceDefault.Light.ProgressBar.Inverse' : 16974217,
'Widget.DeviceDefault.Light.ProgressBar.Large' : 16974216,
'Widget.DeviceDefault.Light.ProgressBar.Large.Inverse' : 16974219,
'Widget.DeviceDefault.Light.ProgressBar.Small' : 16974214,
'Widget.DeviceDefault.Light.ProgressBar.Small.Inverse' : 16974218,
'Widget.DeviceDefault.Light.ProgressBar.Small.Title' : 16974215,
'Widget.DeviceDefault.Light.RatingBar' : 16974221,
'Widget.DeviceDefault.Light.RatingBar.Indicator' : 16974222,
'Widget.DeviceDefault.Light.RatingBar.Small' : 16974223,
'Widget.DeviceDefault.Light.ScrollView' : 16974225,
'Widget.DeviceDefault.Light.SeekBar' : 16974220,
'Widget.DeviceDefault.Light.Spinner' : 16974227,
'Widget.DeviceDefault.Light.StackView' : 16974316,
'Widget.DeviceDefault.Light.Tab' : 16974237,
'Widget.DeviceDefault.Light.TabWidget' : 16974229,
'Widget.DeviceDefault.Light.TextView' : 16974202,
'Widget.DeviceDefault.Light.TextView.SpinnerItem' : 16974234,
'Widget.DeviceDefault.Light.WebTextView' : 16974230,
'Widget.DeviceDefault.Light.WebView' : 16974231,
'Widget.DeviceDefault.ListPopupWindow' : 16974180,
'Widget.DeviceDefault.ListView' : 16974158,
'Widget.DeviceDefault.ListView.DropDown' : 16974153,
'Widget.DeviceDefault.MediaRouteButton' : 16974295,
'Widget.DeviceDefault.PopupMenu' : 16974181,
'Widget.DeviceDefault.PopupWindow' : 16974159,
'Widget.DeviceDefault.ProgressBar' : 16974160,
'Widget.DeviceDefault.ProgressBar.Horizontal' : 16974161,
'Widget.DeviceDefault.ProgressBar.Large' : 16974164,
'Widget.DeviceDefault.ProgressBar.Small' : 16974162,
'Widget.DeviceDefault.ProgressBar.Small.Title' : 16974163,
'Widget.DeviceDefault.RatingBar' : 16974166,
'Widget.DeviceDefault.RatingBar.Indicator' : 16974167,
'Widget.DeviceDefault.RatingBar.Small' : 16974168,
'Widget.DeviceDefault.ScrollView' : 16974170,
'Widget.DeviceDefault.SeekBar' : 16974165,
'Widget.DeviceDefault.Spinner' : 16974172,
'Widget.DeviceDefault.StackView' : 16974314,
'Widget.DeviceDefault.Tab' : 16974189,
'Widget.DeviceDefault.TabWidget' : 16974174,
'Widget.DeviceDefault.TextView' : 16974150,
'Widget.DeviceDefault.TextView.SpinnerItem' : 16974179,
'Widget.DeviceDefault.WebTextView' : 16974175,
'Widget.DeviceDefault.WebView' : 16974176,
'Widget.DropDownItem' : 16973867,
'Widget.DropDownItem.Spinner' : 16973868,
'Widget.EditText' : 16973859,
'Widget.ExpandableListView' : 16973860,
'Widget.FastScroll' : 16974309,
'Widget.FragmentBreadCrumbs' : 16973961,
'Widget.Gallery' : 16973877,
'Widget.GridView' : 16973874,
'Widget.Holo' : 16973962,
'Widget.Holo.ActionBar' : 16974004,
'Widget.Holo.ActionBar.Solid' : 16974113,
'Widget.Holo.ActionBar.TabBar' : 16974071,
'Widget.Holo.ActionBar.TabText' : 16974070,
'Widget.Holo.ActionBar.TabView' : 16974069,
'Widget.Holo.ActionButton' : 16973999,
'Widget.Holo.ActionButton.CloseMode' : 16974003,
'Widget.Holo.ActionButton.Overflow' : 16974000,
'Widget.Holo.ActionButton.TextButton' : 16974001,
'Widget.Holo.ActionMode' : 16974002,
'Widget.Holo.AutoCompleteTextView' : 16973968,
'Widget.Holo.Button' : 16973963,
'Widget.Holo.Button.Borderless' : 16974050,
'Widget.Holo.Button.Borderless.Small' : 16974106,
'Widget.Holo.Button.Inset' : 16973965,
'Widget.Holo.Button.Small' : 16973964,
'Widget.Holo.Button.Toggle' : 16973966,
'Widget.Holo.CalendarView' : 16974060,
'Widget.Holo.CheckedTextView' : 16974297,
'Widget.Holo.CompoundButton.CheckBox' : 16973969,
'Widget.Holo.CompoundButton.RadioButton' : 16973986,
'Widget.Holo.CompoundButton.Star' : 16973990,
'Widget.Holo.DatePicker' : 16974063,
'Widget.Holo.DropDownItem' : 16973994,
'Widget.Holo.DropDownItem.Spinner' : 16973995,
'Widget.Holo.EditText' : 16973971,
'Widget.Holo.ExpandableListView' : 16973972,
'Widget.Holo.GridView' : 16973973,
'Widget.Holo.HorizontalScrollView' : 16973988,
'Widget.Holo.ImageButton' : 16973974,
'Widget.Holo.Light' : 16974005,
'Widget.Holo.Light.ActionBar' : 16974049,
'Widget.Holo.Light.ActionBar.Solid' : 16974114,
'Widget.Holo.Light.ActionBar.Solid.Inverse' : 16974115,
'Widget.Holo.Light.ActionBar.TabBar' : 16974074,
'Widget.Holo.Light.ActionBar.TabBar.Inverse' : 16974116,
'Widget.Holo.Light.ActionBar.TabText' : 16974073,
'Widget.Holo.Light.ActionBar.TabText.Inverse' : 16974118,
'Widget.Holo.Light.ActionBar.TabView' : 16974072,
'Widget.Holo.Light.ActionBar.TabView.Inverse' : 16974117,
'Widget.Holo.Light.ActionButton' : 16974045,
'Widget.Holo.Light.ActionButton.CloseMode' : 16974048,
'Widget.Holo.Light.ActionButton.Overflow' : 16974046,
'Widget.Holo.Light.ActionMode' : 16974047,
'Widget.Holo.Light.ActionMode.Inverse' : 16974119,
'Widget.Holo.Light.AutoCompleteTextView' : 16974011,
'Widget.Holo.Light.Button' : 16974006,
'Widget.Holo.Light.Button.Borderless.Small' : 16974107,
'Widget.Holo.Light.Button.Inset' : 16974008,
'Widget.Holo.Light.Button.Small' : 16974007,
'Widget.Holo.Light.Button.Toggle' : 16974009,
'Widget.Holo.Light.CalendarView' : 16974061,
'Widget.Holo.Light.CheckedTextView' : 16974298,
'Widget.Holo.Light.CompoundButton.CheckBox' : 16974012,
'Widget.Holo.Light.CompoundButton.RadioButton' : 16974032,
'Widget.Holo.Light.CompoundButton.Star' : 16974036,
'Widget.Holo.Light.DropDownItem' : 16974040,
'Widget.Holo.Light.DropDownItem.Spinner' : 16974041,
'Widget.Holo.Light.EditText' : 16974014,
'Widget.Holo.Light.ExpandableListView' : 16974015,
'Widget.Holo.Light.GridView' : 16974016,
'Widget.Holo.Light.HorizontalScrollView' : 16974034,
'Widget.Holo.Light.ImageButton' : 16974017,
'Widget.Holo.Light.ListPopupWindow' : 16974043,
'Widget.Holo.Light.ListView' : 16974018,
'Widget.Holo.Light.ListView.DropDown' : 16974013,
'Widget.Holo.Light.MediaRouteButton' : 16974294,
'Widget.Holo.Light.PopupMenu' : 16974044,
'Widget.Holo.Light.PopupWindow' : 16974019,
'Widget.Holo.Light.ProgressBar' : 16974020,
'Widget.Holo.Light.ProgressBar.Horizontal' : 16974021,
'Widget.Holo.Light.ProgressBar.Inverse' : 16974025,
'Widget.Holo.Light.ProgressBar.Large' : 16974024,
'Widget.Holo.Light.ProgressBar.Large.Inverse' : 16974027,
'Widget.Holo.Light.ProgressBar.Small' : 16974022,
'Widget.Holo.Light.ProgressBar.Small.Inverse' : 16974026,
'Widget.Holo.Light.ProgressBar.Small.Title' : 16974023,
'Widget.Holo.Light.RatingBar' : 16974029,
'Widget.Holo.Light.RatingBar.Indicator' : 16974030,
'Widget.Holo.Light.RatingBar.Small' : 16974031,
'Widget.Holo.Light.ScrollView' : 16974033,
'Widget.Holo.Light.SeekBar' : 16974028,
'Widget.Holo.Light.Spinner' : 16974035,
'Widget.Holo.Light.Tab' : 16974052,
'Widget.Holo.Light.TabWidget' : 16974037,
'Widget.Holo.Light.TextView' : 16974010,
'Widget.Holo.Light.TextView.SpinnerItem' : 16974042,
'Widget.Holo.Light.WebTextView' : 16974038,
'Widget.Holo.Light.WebView' : 16974039,
'Widget.Holo.ListPopupWindow' : 16973997,
'Widget.Holo.ListView' : 16973975,
'Widget.Holo.ListView.DropDown' : 16973970,
'Widget.Holo.MediaRouteButton' : 16974293,
'Widget.Holo.PopupMenu' : 16973998,
'Widget.Holo.PopupWindow' : 16973976,
'Widget.Holo.ProgressBar' : 16973977,
'Widget.Holo.ProgressBar.Horizontal' : 16973978,
'Widget.Holo.ProgressBar.Large' : 16973981,
'Widget.Holo.ProgressBar.Small' : 16973979,
'Widget.Holo.ProgressBar.Small.Title' : 16973980,
'Widget.Holo.RatingBar' : 16973983,
'Widget.Holo.RatingBar.Indicator' : 16973984,
'Widget.Holo.RatingBar.Small' : 16973985,
'Widget.Holo.ScrollView' : 16973987,
'Widget.Holo.SeekBar' : 16973982,
'Widget.Holo.Spinner' : 16973989,
'Widget.Holo.Tab' : 16974051,
'Widget.Holo.TabWidget' : 16973991,
'Widget.Holo.TextView' : 16973967,
'Widget.Holo.TextView.SpinnerItem' : 16973996,
'Widget.Holo.WebTextView' : 16973992,
'Widget.Holo.WebView' : 16973993,
'Widget.ImageButton' : 16973862,
'Widget.ImageWell' : 16973861,
'Widget.KeyboardView' : 16973911,
'Widget.ListPopupWindow' : 16973957,
'Widget.ListView' : 16973870,
'Widget.ListView.DropDown' : 16973872,
'Widget.ListView.Menu' : 16973873,
'Widget.ListView.White' : 16973871,
'Widget.Material' : 16974413,
'Widget.Material.ActionBar' : 16974414,
'Widget.Material.ActionBar.Solid' : 16974415,
'Widget.Material.ActionBar.TabBar' : 16974416,
'Widget.Material.ActionBar.TabText' : 16974417,
'Widget.Material.ActionBar.TabView' : 16974418,
'Widget.Material.ActionButton' : 16974419,
'Widget.Material.ActionButton.CloseMode' : 16974420,
'Widget.Material.ActionButton.Overflow' : 16974421,
'Widget.Material.ActionMode' : 16974422,
'Widget.Material.AutoCompleteTextView' : 16974423,
'Widget.Material.Button' : 16974424,
'Widget.Material.ButtonBar' : 16974431,
'Widget.Material.ButtonBar.AlertDialog' : 16974432,
'Widget.Material.Button.Borderless' : 16974425,
'Widget.Material.Button.Borderless.Colored' : 16974426,
'Widget.Material.Button.Borderless.Small' : 16974427,
'Widget.Material.Button.Inset' : 16974428,
'Widget.Material.Button.Small' : 16974429,
'Widget.Material.Button.Toggle' : 16974430,
'Widget.Material.CalendarView' : 16974433,
'Widget.Material.CheckedTextView' : 16974434,
'Widget.Material.CompoundButton.CheckBox' : 16974435,
'Widget.Material.CompoundButton.RadioButton' : 16974436,
'Widget.Material.CompoundButton.Star' : 16974437,
'Widget.Material.DatePicker' : 16974438,
'Widget.Material.DropDownItem' : 16974439,
'Widget.Material.DropDownItem.Spinner' : 16974440,
'Widget.Material.EditText' : 16974441,
'Widget.Material.ExpandableListView' : 16974442,
'Widget.Material.FastScroll' : 16974443,
'Widget.Material.GridView' : 16974444,
'Widget.Material.HorizontalScrollView' : 16974445,
'Widget.Material.ImageButton' : 16974446,
'Widget.Material.Light' : 16974478,
'Widget.Material.Light.ActionBar' : 16974479,
'Widget.Material.Light.ActionBar.Solid' : 16974480,
'Widget.Material.Light.ActionBar.TabBar' : 16974481,
'Widget.Material.Light.ActionBar.TabText' : 16974482,
'Widget.Material.Light.ActionBar.TabView' : 16974483,
'Widget.Material.Light.ActionButton' : 16974484,
'Widget.Material.Light.ActionButton.CloseMode' : 16974485,
'Widget.Material.Light.ActionButton.Overflow' : 16974486,
'Widget.Material.Light.ActionMode' : 16974487,
'Widget.Material.Light.AutoCompleteTextView' : 16974488,
'Widget.Material.Light.Button' : 16974489,
'Widget.Material.Light.ButtonBar' : 16974496,
'Widget.Material.Light.ButtonBar.AlertDialog' : 16974497,
'Widget.Material.Light.Button.Borderless' : 16974490,
'Widget.Material.Light.Button.Borderless.Colored' : 16974491,
'Widget.Material.Light.Button.Borderless.Small' : 16974492,
'Widget.Material.Light.Button.Inset' : 16974493,
'Widget.Material.Light.Button.Small' : 16974494,
'Widget.Material.Light.Button.Toggle' : 16974495,
'Widget.Material.Light.CalendarView' : 16974498,
'Widget.Material.Light.CheckedTextView' : 16974499,
'Widget.Material.Light.CompoundButton.CheckBox' : 16974500,
'Widget.Material.Light.CompoundButton.RadioButton' : 16974501,
'Widget.Material.Light.CompoundButton.Star' : 16974502,
'Widget.Material.Light.DatePicker' : 16974503,
'Widget.Material.Light.DropDownItem' : 16974504,
'Widget.Material.Light.DropDownItem.Spinner' : 16974505,
'Widget.Material.Light.EditText' : 16974506,
'Widget.Material.Light.ExpandableListView' : 16974507,
'Widget.Material.Light.FastScroll' : 16974508,
'Widget.Material.Light.GridView' : 16974509,
'Widget.Material.Light.HorizontalScrollView' : 16974510,
'Widget.Material.Light.ImageButton' : 16974511,
'Widget.Material.Light.ListPopupWindow' : 16974512,
'Widget.Material.Light.ListView' : 16974513,
'Widget.Material.Light.ListView.DropDown' : 16974514,
'Widget.Material.Light.MediaRouteButton' : 16974515,
'Widget.Material.Light.PopupMenu' : 16974516,
'Widget.Material.Light.PopupMenu.Overflow' : 16974517,
'Widget.Material.Light.PopupWindow' : 16974518,
'Widget.Material.Light.ProgressBar' : 16974519,
'Widget.Material.Light.ProgressBar.Horizontal' : 16974520,
'Widget.Material.Light.ProgressBar.Inverse' : 16974521,
'Widget.Material.Light.ProgressBar.Large' : 16974522,
'Widget.Material.Light.ProgressBar.Large.Inverse' : 16974523,
'Widget.Material.Light.ProgressBar.Small' : 16974524,
'Widget.Material.Light.ProgressBar.Small.Inverse' : 16974525,
'Widget.Material.Light.ProgressBar.Small.Title' : 16974526,
'Widget.Material.Light.RatingBar' : 16974527,
'Widget.Material.Light.RatingBar.Indicator' : 16974528,
'Widget.Material.Light.RatingBar.Small' : 16974529,
'Widget.Material.Light.ScrollView' : 16974530,
'Widget.Material.Light.SearchView' : 16974531,
'Widget.Material.Light.SeekBar' : 16974532,
'Widget.Material.Light.SegmentedButton' : 16974533,
'Widget.Material.Light.Spinner' : 16974535,
'Widget.Material.Light.Spinner.Underlined' : 16974536,
'Widget.Material.Light.StackView' : 16974534,
'Widget.Material.Light.Tab' : 16974537,
'Widget.Material.Light.TabWidget' : 16974538,
'Widget.Material.Light.TextView' : 16974539,
'Widget.Material.Light.TextView.SpinnerItem' : 16974540,
'Widget.Material.Light.TimePicker' : 16974541,
'Widget.Material.Light.WebTextView' : 16974542,
'Widget.Material.Light.WebView' : 16974543,
'Widget.Material.ListPopupWindow' : 16974447,
'Widget.Material.ListView' : 16974448,
'Widget.Material.ListView.DropDown' : 16974449,
'Widget.Material.MediaRouteButton' : 16974450,
'Widget.Material.PopupMenu' : 16974451,
'Widget.Material.PopupMenu.Overflow' : 16974452,
'Widget.Material.PopupWindow' : 16974453,
'Widget.Material.ProgressBar' : 16974454,
'Widget.Material.ProgressBar.Horizontal' : 16974455,
'Widget.Material.ProgressBar.Large' : 16974456,
'Widget.Material.ProgressBar.Small' : 16974457,
'Widget.Material.ProgressBar.Small.Title' : 16974458,
'Widget.Material.RatingBar' : 16974459,
'Widget.Material.RatingBar.Indicator' : 16974460,
'Widget.Material.RatingBar.Small' : 16974461,
'Widget.Material.ScrollView' : 16974462,
'Widget.Material.SearchView' : 16974463,
'Widget.Material.SeekBar' : 16974464,
'Widget.Material.SegmentedButton' : 16974465,
'Widget.Material.Spinner' : 16974467,
'Widget.Material.Spinner.Underlined' : 16974468,
'Widget.Material.StackView' : 16974466,
'Widget.Material.Tab' : 16974469,
'Widget.Material.TabWidget' : 16974470,
'Widget.Material.TextView' : 16974471,
'Widget.Material.TextView.SpinnerItem' : 16974472,
'Widget.Material.TimePicker' : 16974473,
'Widget.Material.Toolbar' : 16974474,
'Widget.Material.Toolbar.Button.Navigation' : 16974475,
'Widget.Material.WebTextView' : 16974476,
'Widget.Material.WebView' : 16974477,
'Widget.PopupMenu' : 16973958,
'Widget.PopupWindow' : 16973878,
'Widget.ProgressBar' : 16973852,
'Widget.ProgressBar.Horizontal' : 16973855,
'Widget.ProgressBar.Inverse' : 16973915,
'Widget.ProgressBar.Large' : 16973853,
'Widget.ProgressBar.Large.Inverse' : 16973916,
'Widget.ProgressBar.Small' : 16973854,
'Widget.ProgressBar.Small.Inverse' : 16973917,
'Widget.RatingBar' : 16973857,
'Widget.ScrollView' : 16973869,
'Widget.SeekBar' : 16973856,
'Widget.Spinner' : 16973864,
'Widget.Spinner.DropDown' : 16973955,
'Widget.StackView' : 16974310,
'Widget.TabWidget' : 16973876,
'Widget.TextView' : 16973858,
'Widget.TextView.PopupMenu' : 16973865,
'Widget.TextView.SpinnerItem' : 16973866,
'Widget.Toolbar' : 16974311,
'Widget.Toolbar.Button.Navigation' : 16974312,
'Widget.WebView' : 16973875,
},
'attr': {
'theme' : 16842752,
'label' : 16842753,
'icon' : 16842754,
'name' : 16842755,
'manageSpaceActivity' : 16842756,
'allowClearUserData' : 16842757,
'permission' : 16842758,
'readPermission' : 16842759,
'writePermission' : 16842760,
'protectionLevel' : 16842761,
'permissionGroup' : 16842762,
'sharedUserId' : 16842763,
'hasCode' : 16842764,
'persistent' : 16842765,
'enabled' : 16842766,
'debuggable' : 16842767,
'exported' : 16842768,
'process' : 16842769,
'taskAffinity' : 16842770,
'multiprocess' : 16842771,
'finishOnTaskLaunch' : 16842772,
'clearTaskOnLaunch' : 16842773,
'stateNotNeeded' : 16842774,
'excludeFromRecents' : 16842775,
'authorities' : 16842776,
'syncable' : 16842777,
'initOrder' : 16842778,
'grantUriPermissions' : 16842779,
'priority' : 16842780,
'launchMode' : 16842781,
'screenOrientation' : 16842782,
'configChanges' : 16842783,
'description' : 16842784,
'targetPackage' : 16842785,
'handleProfiling' : 16842786,
'functionalTest' : 16842787,
'value' : 16842788,
'resource' : 16842789,
'mimeType' : 16842790,
'scheme' : 16842791,
'host' : 16842792,
'port' : 16842793,
'path' : 16842794,
'pathPrefix' : 16842795,
'pathPattern' : 16842796,
'action' : 16842797,
'data' : 16842798,
'targetClass' : 16842799,
'colorForeground' : 16842800,
'colorBackground' : 16842801,
'backgroundDimAmount' : 16842802,
'disabledAlpha' : 16842803,
'textAppearance' : 16842804,
'textAppearanceInverse' : 16842805,
'textColorPrimary' : 16842806,
'textColorPrimaryDisableOnly' : 16842807,
'textColorSecondary' : 16842808,
'textColorPrimaryInverse' : 16842809,
'textColorSecondaryInverse' : 16842810,
'textColorPrimaryNoDisable' : 16842811,
'textColorSecondaryNoDisable' : 16842812,
'textColorPrimaryInverseNoDisable' : 16842813,
'textColorSecondaryInverseNoDisable' : 16842814,
'textColorHintInverse' : 16842815,
'textAppearanceLarge' : 16842816,
'textAppearanceMedium' : 16842817,
'textAppearanceSmall' : 16842818,
'textAppearanceLargeInverse' : 16842819,
'textAppearanceMediumInverse' : 16842820,
'textAppearanceSmallInverse' : 16842821,
'textCheckMark' : 16842822,
'textCheckMarkInverse' : 16842823,
'buttonStyle' : 16842824,
'buttonStyleSmall' : 16842825,
'buttonStyleInset' : 16842826,
'buttonStyleToggle' : 16842827,
'galleryItemBackground' : 16842828,
'listPreferredItemHeight' : 16842829,
'expandableListPreferredItemPaddingLeft' : 16842830,
'expandableListPreferredChildPaddingLeft' : 16842831,
'expandableListPreferredItemIndicatorLeft' : 16842832,
'expandableListPreferredItemIndicatorRight' : 16842833,
'expandableListPreferredChildIndicatorLeft' : 16842834,
'expandableListPreferredChildIndicatorRight' : 16842835,
'windowBackground' : 16842836,
'windowFrame' : 16842837,
'windowNoTitle' : 16842838,
'windowIsFloating' : 16842839,
'windowIsTranslucent' : 16842840,
'windowContentOverlay' : 16842841,
'windowTitleSize' : 16842842,
'windowTitleStyle' : 16842843,
'windowTitleBackgroundStyle' : 16842844,
'alertDialogStyle' : 16842845,
'panelBackground' : 16842846,
'panelFullBackground' : 16842847,
'panelColorForeground' : 16842848,
'panelColorBackground' : 16842849,
'panelTextAppearance' : 16842850,
'scrollbarSize' : 16842851,
'scrollbarThumbHorizontal' : 16842852,
'scrollbarThumbVertical' : 16842853,
'scrollbarTrackHorizontal' : 16842854,
'scrollbarTrackVertical' : 16842855,
'scrollbarAlwaysDrawHorizontalTrack' : 16842856,
'scrollbarAlwaysDrawVerticalTrack' : 16842857,
'absListViewStyle' : 16842858,
'autoCompleteTextViewStyle' : 16842859,
'checkboxStyle' : 16842860,
'dropDownListViewStyle' : 16842861,
'editTextStyle' : 16842862,
'expandableListViewStyle' : 16842863,
'galleryStyle' : 16842864,
'gridViewStyle' : 16842865,
'imageButtonStyle' : 16842866,
'imageWellStyle' : 16842867,
'listViewStyle' : 16842868,
'listViewWhiteStyle' : 16842869,
'popupWindowStyle' : 16842870,
'progressBarStyle' : 16842871,
'progressBarStyleHorizontal' : 16842872,
'progressBarStyleSmall' : 16842873,
'progressBarStyleLarge' : 16842874,
'seekBarStyle' : 16842875,
'ratingBarStyle' : 16842876,
'ratingBarStyleSmall' : 16842877,
'radioButtonStyle' : 16842878,
'scrollbarStyle' : 16842879,
'scrollViewStyle' : 16842880,
'spinnerStyle' : 16842881,
'starStyle' : 16842882,
'tabWidgetStyle' : 16842883,
'textViewStyle' : 16842884,
'webViewStyle' : 16842885,
'dropDownItemStyle' : 16842886,
'spinnerDropDownItemStyle' : 16842887,
'dropDownHintAppearance' : 16842888,
'spinnerItemStyle' : 16842889,
'mapViewStyle' : 16842890,
'preferenceScreenStyle' : 16842891,
'preferenceCategoryStyle' : 16842892,
'preferenceInformationStyle' : 16842893,
'preferenceStyle' : 16842894,
'checkBoxPreferenceStyle' : 16842895,
'yesNoPreferenceStyle' : 16842896,
'dialogPreferenceStyle' : 16842897,
'editTextPreferenceStyle' : 16842898,
'ringtonePreferenceStyle' : 16842899,
'preferenceLayoutChild' : 16842900,
'textSize' : 16842901,
'typeface' : 16842902,
'textStyle' : 16842903,
'textColor' : 16842904,
'textColorHighlight' : 16842905,
'textColorHint' : 16842906,
'textColorLink' : 16842907,
'state_focused' : 16842908,
'state_window_focused' : 16842909,
'state_enabled' : 16842910,
'state_checkable' : 16842911,
'state_checked' : 16842912,
'state_selected' : 16842913,
'state_active' : 16842914,
'state_single' : 16842915,
'state_first' : 16842916,
'state_middle' : 16842917,
'state_last' : 16842918,
'state_pressed' : 16842919,
'state_expanded' : 16842920,
'state_empty' : 16842921,
'state_above_anchor' : 16842922,
'ellipsize' : 16842923,
'x' : 16842924,
'y' : 16842925,
'windowAnimationStyle' : 16842926,
'gravity' : 16842927,
'autoLink' : 16842928,
'linksClickable' : 16842929,
'entries' : 16842930,
'layout_gravity' : 16842931,
'windowEnterAnimation' : 16842932,
'windowExitAnimation' : 16842933,
'windowShowAnimation' : 16842934,
'windowHideAnimation' : 16842935,
'activityOpenEnterAnimation' : 16842936,
'activityOpenExitAnimation' : 16842937,
'activityCloseEnterAnimation' : 16842938,
'activityCloseExitAnimation' : 16842939,
'taskOpenEnterAnimation' : 16842940,
'taskOpenExitAnimation' : 16842941,
'taskCloseEnterAnimation' : 16842942,
'taskCloseExitAnimation' : 16842943,
'taskToFrontEnterAnimation' : 16842944,
'taskToFrontExitAnimation' : 16842945,
'taskToBackEnterAnimation' : 16842946,
'taskToBackExitAnimation' : 16842947,
'orientation' : 16842948,
'keycode' : 16842949,
'fullDark' : 16842950,
'topDark' : 16842951,
'centerDark' : 16842952,
'bottomDark' : 16842953,
'fullBright' : 16842954,
'topBright' : 16842955,
'centerBright' : 16842956,
'bottomBright' : 16842957,
'bottomMedium' : 16842958,
'centerMedium' : 16842959,
'id' : 16842960,
'tag' : 16842961,
'scrollX' : 16842962,
'scrollY' : 16842963,
'background' : 16842964,
'padding' : 16842965,
'paddingLeft' : 16842966,
'paddingTop' : 16842967,
'paddingRight' : 16842968,
'paddingBottom' : 16842969,
'focusable' : 16842970,
'focusableInTouchMode' : 16842971,
'visibility' : 16842972,
'fitsSystemWindows' : 16842973,
'scrollbars' : 16842974,
'fadingEdge' : 16842975,
'fadingEdgeLength' : 16842976,
'nextFocusLeft' : 16842977,
'nextFocusRight' : 16842978,
'nextFocusUp' : 16842979,
'nextFocusDown' : 16842980,
'clickable' : 16842981,
'longClickable' : 16842982,
'saveEnabled' : 16842983,
'drawingCacheQuality' : 16842984,
'duplicateParentState' : 16842985,
'clipChildren' : 16842986,
'clipToPadding' : 16842987,
'layoutAnimation' : 16842988,
'animationCache' : 16842989,
'persistentDrawingCache' : 16842990,
'alwaysDrawnWithCache' : 16842991,
'addStatesFromChildren' : 16842992,
'descendantFocusability' : 16842993,
'layout' : 16842994,
'inflatedId' : 16842995,
'layout_width' : 16842996,
'layout_height' : 16842997,
'layout_margin' : 16842998,
'layout_marginLeft' : 16842999,
'layout_marginTop' : 16843000,
'layout_marginRight' : 16843001,
'layout_marginBottom' : 16843002,
'listSelector' : 16843003,
'drawSelectorOnTop' : 16843004,
'stackFromBottom' : 16843005,
'scrollingCache' : 16843006,
'textFilterEnabled' : 16843007,
'transcriptMode' : 16843008,
'cacheColorHint' : 16843009,
'dial' : 16843010,
'hand_hour' : 16843011,
'hand_minute' : 16843012,
'format' : 16843013,
'checked' : 16843014,
'button' : 16843015,
'checkMark' : 16843016,
'foreground' : 16843017,
'measureAllChildren' : 16843018,
'groupIndicator' : 16843019,
'childIndicator' : 16843020,
'indicatorLeft' : 16843021,
'indicatorRight' : 16843022,
'childIndicatorLeft' : 16843023,
'childIndicatorRight' : 16843024,
'childDivider' : 16843025,
'animationDuration' : 16843026,
'spacing' : 16843027,
'horizontalSpacing' : 16843028,
'verticalSpacing' : 16843029,
'stretchMode' : 16843030,
'columnWidth' : 16843031,
'numColumns' : 16843032,
'src' : 16843033,
'antialias' : 16843034,
'filter' : 16843035,
'dither' : 16843036,
'scaleType' : 16843037,
'adjustViewBounds' : 16843038,
'maxWidth' : 16843039,
'maxHeight' : 16843040,
'tint' : 16843041,
'baselineAlignBottom' : 16843042,
'cropToPadding' : 16843043,
'textOn' : 16843044,
'textOff' : 16843045,
'baselineAligned' : 16843046,
'baselineAlignedChildIndex' : 16843047,
'weightSum' : 16843048,
'divider' : 16843049,
'dividerHeight' : 16843050,
'choiceMode' : 16843051,
'itemTextAppearance' : 16843052,
'horizontalDivider' : 16843053,
'verticalDivider' : 16843054,
'headerBackground' : 16843055,
'itemBackground' : 16843056,
'itemIconDisabledAlpha' : 16843057,
'rowHeight' : 16843058,
'maxRows' : 16843059,
'maxItemsPerRow' : 16843060,
'moreIcon' : 16843061,
'max' : 16843062,
'progress' : 16843063,
'secondaryProgress' : 16843064,
'indeterminate' : 16843065,
'indeterminateOnly' : 16843066,
'indeterminateDrawable' : 16843067,
'progressDrawable' : 16843068,
'indeterminateDuration' : 16843069,
'indeterminateBehavior' : 16843070,
'minWidth' : 16843071,
'minHeight' : 16843072,
'interpolator' : 16843073,
'thumb' : 16843074,
'thumbOffset' : 16843075,
'numStars' : 16843076,
'rating' : 16843077,
'stepSize' : 16843078,
'isIndicator' : 16843079,
'checkedButton' : 16843080,
'stretchColumns' : 16843081,
'shrinkColumns' : 16843082,
'collapseColumns' : 16843083,
'layout_column' : 16843084,
'layout_span' : 16843085,
'bufferType' : 16843086,
'text' : 16843087,
'hint' : 16843088,
'textScaleX' : 16843089,
'cursorVisible' : 16843090,
'maxLines' : 16843091,
'lines' : 16843092,
'height' : 16843093,
'minLines' : 16843094,
'maxEms' : 16843095,
'ems' : 16843096,
'width' : 16843097,
'minEms' : 16843098,
'scrollHorizontally' : 16843099,
'password' : 16843100,
'singleLine' : 16843101,
'selectAllOnFocus' : 16843102,
'includeFontPadding' : 16843103,
'maxLength' : 16843104,
'shadowColor' : 16843105,
'shadowDx' : 16843106,
'shadowDy' : 16843107,
'shadowRadius' : 16843108,
'numeric' : 16843109,
'digits' : 16843110,
'phoneNumber' : 16843111,
'inputMethod' : 16843112,
'capitalize' : 16843113,
'autoText' : 16843114,
'editable' : 16843115,
'freezesText' : 16843116,
'drawableTop' : 16843117,
'drawableBottom' : 16843118,
'drawableLeft' : 16843119,
'drawableRight' : 16843120,
'drawablePadding' : 16843121,
'completionHint' : 16843122,
'completionHintView' : 16843123,
'completionThreshold' : 16843124,
'dropDownSelector' : 16843125,
'popupBackground' : 16843126,
'inAnimation' : 16843127,
'outAnimation' : 16843128,
'flipInterval' : 16843129,
'fillViewport' : 16843130,
'prompt' : 16843131,
'startYear' : 16843132,
'endYear' : 16843133,
'mode' : 16843134,
'layout_x' : 16843135,
'layout_y' : 16843136,
'layout_weight' : 16843137,
'layout_toLeftOf' : 16843138,
'layout_toRightOf' : 16843139,
'layout_above' : 16843140,
'layout_below' : 16843141,
'layout_alignBaseline' : 16843142,
'layout_alignLeft' : 16843143,
'layout_alignTop' : 16843144,
'layout_alignRight' : 16843145,
'layout_alignBottom' : 16843146,
'layout_alignParentLeft' : 16843147,
'layout_alignParentTop' : 16843148,
'layout_alignParentRight' : 16843149,
'layout_alignParentBottom' : 16843150,
'layout_centerInParent' : 16843151,
'layout_centerHorizontal' : 16843152,
'layout_centerVertical' : 16843153,
'layout_alignWithParentIfMissing' : 16843154,
'layout_scale' : 16843155,
'visible' : 16843156,
'variablePadding' : 16843157,
'constantSize' : 16843158,
'oneshot' : 16843159,
'duration' : 16843160,
'drawable' : 16843161,
'shape' : 16843162,
'innerRadiusRatio' : 16843163,
'thicknessRatio' : 16843164,
'startColor' : 16843165,
'endColor' : 16843166,
'useLevel' : 16843167,
'angle' : 16843168,
'type' : 16843169,
'centerX' : 16843170,
'centerY' : 16843171,
'gradientRadius' : 16843172,
'color' : 16843173,
'dashWidth' : 16843174,
'dashGap' : 16843175,
'radius' : 16843176,
'topLeftRadius' : 16843177,
'topRightRadius' : 16843178,
'bottomLeftRadius' : 16843179,
'bottomRightRadius' : 16843180,
'left' : 16843181,
'top' : 16843182,
'right' : 16843183,
'bottom' : 16843184,
'minLevel' : 16843185,
'maxLevel' : 16843186,
'fromDegrees' : 16843187,
'toDegrees' : 16843188,
'pivotX' : 16843189,
'pivotY' : 16843190,
'insetLeft' : 16843191,
'insetRight' : 16843192,
'insetTop' : 16843193,
'insetBottom' : 16843194,
'shareInterpolator' : 16843195,
'fillBefore' : 16843196,
'fillAfter' : 16843197,
'startOffset' : 16843198,
'repeatCount' : 16843199,
'repeatMode' : 16843200,
'zAdjustment' : 16843201,
'fromXScale' : 16843202,
'toXScale' : 16843203,
'fromYScale' : 16843204,
'toYScale' : 16843205,
'fromXDelta' : 16843206,
'toXDelta' : 16843207,
'fromYDelta' : 16843208,
'toYDelta' : 16843209,
'fromAlpha' : 16843210,
'toAlpha' : 16843211,
'delay' : 16843212,
'animation' : 16843213,
'animationOrder' : 16843214,
'columnDelay' : 16843215,
'rowDelay' : 16843216,
'direction' : 16843217,
'directionPriority' : 16843218,
'factor' : 16843219,
'cycles' : 16843220,
'searchMode' : 16843221,
'searchSuggestAuthority' : 16843222,
'searchSuggestPath' : 16843223,
'searchSuggestSelection' : 16843224,
'searchSuggestIntentAction' : 16843225,
'searchSuggestIntentData' : 16843226,
'queryActionMsg' : 16843227,
'suggestActionMsg' : 16843228,
'suggestActionMsgColumn' : 16843229,
'menuCategory' : 16843230,
'orderInCategory' : 16843231,
'checkableBehavior' : 16843232,
'title' : 16843233,
'titleCondensed' : 16843234,
'alphabeticShortcut' : 16843235,
'numericShortcut' : 16843236,
'checkable' : 16843237,
'selectable' : 16843238,
'orderingFromXml' : 16843239,
'key' : 16843240,
'summary' : 16843241,
'order' : 16843242,
'widgetLayout' : 16843243,
'dependency' : 16843244,
'defaultValue' : 16843245,
'shouldDisableView' : 16843246,
'summaryOn' : 16843247,
'summaryOff' : 16843248,
'disableDependentsState' : 16843249,
'dialogTitle' : 16843250,
'dialogMessage' : 16843251,
'dialogIcon' : 16843252,
'positiveButtonText' : 16843253,
'negativeButtonText' : 16843254,
'dialogLayout' : 16843255,
'entryValues' : 16843256,
'ringtoneType' : 16843257,
'showDefault' : 16843258,
'showSilent' : 16843259,
'scaleWidth' : 16843260,
'scaleHeight' : 16843261,
'scaleGravity' : 16843262,
'ignoreGravity' : 16843263,
'foregroundGravity' : 16843264,
'tileMode' : 16843265,
'targetActivity' : 16843266,
'alwaysRetainTaskState' : 16843267,
'allowTaskReparenting' : 16843268,
'searchButtonText' : 16843269,
'colorForegroundInverse' : 16843270,
'textAppearanceButton' : 16843271,
'listSeparatorTextViewStyle' : 16843272,
'streamType' : 16843273,
'clipOrientation' : 16843274,
'centerColor' : 16843275,
'minSdkVersion' : 16843276,
'windowFullscreen' : 16843277,
'unselectedAlpha' : 16843278,
'progressBarStyleSmallTitle' : 16843279,
'ratingBarStyleIndicator' : 16843280,
'apiKey' : 16843281,
'textColorTertiary' : 16843282,
'textColorTertiaryInverse' : 16843283,
'listDivider' : 16843284,
'soundEffectsEnabled' : 16843285,
'keepScreenOn' : 16843286,
'lineSpacingExtra' : 16843287,
'lineSpacingMultiplier' : 16843288,
'listChoiceIndicatorSingle' : 16843289,
'listChoiceIndicatorMultiple' : 16843290,
'versionCode' : 16843291,
'versionName' : 16843292,
'marqueeRepeatLimit' : 16843293,
'windowNoDisplay' : 16843294,
'backgroundDimEnabled' : 16843295,
'inputType' : 16843296,
'isDefault' : 16843297,
'windowDisablePreview' : 16843298,
'privateImeOptions' : 16843299,
'editorExtras' : 16843300,
'settingsActivity' : 16843301,
'fastScrollEnabled' : 16843302,
'reqTouchScreen' : 16843303,
'reqKeyboardType' : 16843304,
'reqHardKeyboard' : 16843305,
'reqNavigation' : 16843306,
'windowSoftInputMode' : 16843307,
'imeFullscreenBackground' : 16843308,
'noHistory' : 16843309,
'headerDividersEnabled' : 16843310,
'footerDividersEnabled' : 16843311,
'candidatesTextStyleSpans' : 16843312,
'smoothScrollbar' : 16843313,
'reqFiveWayNav' : 16843314,
'keyBackground' : 16843315,
'keyTextSize' : 16843316,
'labelTextSize' : 16843317,
'keyTextColor' : 16843318,
'keyPreviewLayout' : 16843319,
'keyPreviewOffset' : 16843320,
'keyPreviewHeight' : 16843321,
'verticalCorrection' : 16843322,
'popupLayout' : 16843323,
'state_long_pressable' : 16843324,
'keyWidth' : 16843325,
'keyHeight' : 16843326,
'horizontalGap' : 16843327,
'verticalGap' : 16843328,
'rowEdgeFlags' : 16843329,
'codes' : 16843330,
'popupKeyboard' : 16843331,
'popupCharacters' : 16843332,
'keyEdgeFlags' : 16843333,
'isModifier' : 16843334,
'isSticky' : 16843335,
'isRepeatable' : 16843336,
'iconPreview' : 16843337,
'keyOutputText' : 16843338,
'keyLabel' : 16843339,
'keyIcon' : 16843340,
'keyboardMode' : 16843341,
'isScrollContainer' : 16843342,
'fillEnabled' : 16843343,
'updatePeriodMillis' : 16843344,
'initialLayout' : 16843345,
'voiceSearchMode' : 16843346,
'voiceLanguageModel' : 16843347,
'voicePromptText' : 16843348,
'voiceLanguage' : 16843349,
'voiceMaxResults' : 16843350,
'bottomOffset' : 16843351,
'topOffset' : 16843352,
'allowSingleTap' : 16843353,
'handle' : 16843354,
'content' : 16843355,
'animateOnClick' : 16843356,
'configure' : 16843357,
'hapticFeedbackEnabled' : 16843358,
'innerRadius' : 16843359,
'thickness' : 16843360,
'sharedUserLabel' : 16843361,
'dropDownWidth' : 16843362,
'dropDownAnchor' : 16843363,
'imeOptions' : 16843364,
'imeActionLabel' : 16843365,
'imeActionId' : 16843366,
'imeExtractEnterAnimation' : 16843368,
'imeExtractExitAnimation' : 16843369,
'tension' : 16843370,
'extraTension' : 16843371,
'anyDensity' : 16843372,
'searchSuggestThreshold' : 16843373,
'includeInGlobalSearch' : 16843374,
'onClick' : 16843375,
'targetSdkVersion' : 16843376,
'maxSdkVersion' : 16843377,
'testOnly' : 16843378,
'contentDescription' : 16843379,
'gestureStrokeWidth' : 16843380,
'gestureColor' : 16843381,
'uncertainGestureColor' : 16843382,
'fadeOffset' : 16843383,
'fadeDuration' : 16843384,
'gestureStrokeType' : 16843385,
'gestureStrokeLengthThreshold' : 16843386,
'gestureStrokeSquarenessThreshold' : 16843387,
'gestureStrokeAngleThreshold' : 16843388,
'eventsInterceptionEnabled' : 16843389,
'fadeEnabled' : 16843390,
'backupAgent' : 16843391,
'allowBackup' : 16843392,
'glEsVersion' : 16843393,
'queryAfterZeroResults' : 16843394,
'dropDownHeight' : 16843395,
'smallScreens' : 16843396,
'normalScreens' : 16843397,
'largeScreens' : 16843398,
'progressBarStyleInverse' : 16843399,
'progressBarStyleSmallInverse' : 16843400,
'progressBarStyleLargeInverse' : 16843401,
'searchSettingsDescription' : 16843402,
'textColorPrimaryInverseDisableOnly' : 16843403,
'autoUrlDetect' : 16843404,
'resizeable' : 16843405,
'required' : 16843406,
'accountType' : 16843407,
'contentAuthority' : 16843408,
'userVisible' : 16843409,
'windowShowWallpaper' : 16843410,
'wallpaperOpenEnterAnimation' : 16843411,
'wallpaperOpenExitAnimation' : 16843412,
'wallpaperCloseEnterAnimation' : 16843413,
'wallpaperCloseExitAnimation' : 16843414,
'wallpaperIntraOpenEnterAnimation' : 16843415,
'wallpaperIntraOpenExitAnimation' : 16843416,
'wallpaperIntraCloseEnterAnimation' : 16843417,
'wallpaperIntraCloseExitAnimation' : 16843418,
'supportsUploading' : 16843419,
'killAfterRestore' : 16843420,
'restoreNeedsApplication' : 16843421,
'smallIcon' : 16843422,
'accountPreferences' : 16843423,
'textAppearanceSearchResultSubtitle' : 16843424,
'textAppearanceSearchResultTitle' : 16843425,
'summaryColumn' : 16843426,
'detailColumn' : 16843427,
'detailSocialSummary' : 16843428,
'thumbnail' : 16843429,
'detachWallpaper' : 16843430,
'finishOnCloseSystemDialogs' : 16843431,
'scrollbarFadeDuration' : 16843432,
'scrollbarDefaultDelayBeforeFade' : 16843433,
'fadeScrollbars' : 16843434,
'colorBackgroundCacheHint' : 16843435,
'dropDownHorizontalOffset' : 16843436,
'dropDownVerticalOffset' : 16843437,
'quickContactBadgeStyleWindowSmall' : 16843438,
'quickContactBadgeStyleWindowMedium' : 16843439,
'quickContactBadgeStyleWindowLarge' : 16843440,
'quickContactBadgeStyleSmallWindowSmall' : 16843441,
'quickContactBadgeStyleSmallWindowMedium' : 16843442,
'quickContactBadgeStyleSmallWindowLarge' : 16843443,
'author' : 16843444,
'autoStart' : 16843445,
'expandableListViewWhiteStyle' : 16843446,
'installLocation' : 16843447,
'vmSafeMode' : 16843448,
'webTextViewStyle' : 16843449,
'restoreAnyVersion' : 16843450,
'tabStripLeft' : 16843451,
'tabStripRight' : 16843452,
'tabStripEnabled' : 16843453,
'logo' : 16843454,
'xlargeScreens' : 16843455,
'immersive' : 16843456,
'overScrollMode' : 16843457,
'overScrollHeader' : 16843458,
'overScrollFooter' : 16843459,
'filterTouchesWhenObscured' : 16843460,
'textSelectHandleLeft' : 16843461,
'textSelectHandleRight' : 16843462,
'textSelectHandle' : 16843463,
'textSelectHandleWindowStyle' : 16843464,
'popupAnimationStyle' : 16843465,
'screenSize' : 16843466,
'screenDensity' : 16843467,
'allContactsName' : 16843468,
'windowActionBar' : 16843469,
'actionBarStyle' : 16843470,
'navigationMode' : 16843471,
'displayOptions' : 16843472,
'subtitle' : 16843473,
'customNavigationLayout' : 16843474,
'hardwareAccelerated' : 16843475,
'measureWithLargestChild' : 16843476,
'animateFirstView' : 16843477,
'dropDownSpinnerStyle' : 16843478,
'actionDropDownStyle' : 16843479,
'actionButtonStyle' : 16843480,
'showAsAction' : 16843481,
'previewImage' : 16843482,
'actionModeBackground' : 16843483,
'actionModeCloseDrawable' : 16843484,
'windowActionModeOverlay' : 16843485,
'valueFrom' : 16843486,
'valueTo' : 16843487,
'valueType' : 16843488,
'propertyName' : 16843489,
'ordering' : 16843490,
'fragment' : 16843491,
'windowActionBarOverlay' : 16843492,
'fragmentOpenEnterAnimation' : 16843493,
'fragmentOpenExitAnimation' : 16843494,
'fragmentCloseEnterAnimation' : 16843495,
'fragmentCloseExitAnimation' : 16843496,
'fragmentFadeEnterAnimation' : 16843497,
'fragmentFadeExitAnimation' : 16843498,
'actionBarSize' : 16843499,
'imeSubtypeLocale' : 16843500,
'imeSubtypeMode' : 16843501,
'imeSubtypeExtraValue' : 16843502,
'splitMotionEvents' : 16843503,
'listChoiceBackgroundIndicator' : 16843504,
'spinnerMode' : 16843505,
'animateLayoutChanges' : 16843506,
'actionBarTabStyle' : 16843507,
'actionBarTabBarStyle' : 16843508,
'actionBarTabTextStyle' : 16843509,
'actionOverflowButtonStyle' : 16843510,
'actionModeCloseButtonStyle' : 16843511,
'titleTextStyle' : 16843512,
'subtitleTextStyle' : 16843513,
'iconifiedByDefault' : 16843514,
'actionLayout' : 16843515,
'actionViewClass' : 16843516,
'activatedBackgroundIndicator' : 16843517,
'state_activated' : 16843518,
'listPopupWindowStyle' : 16843519,
'popupMenuStyle' : 16843520,
'textAppearanceLargePopupMenu' : 16843521,
'textAppearanceSmallPopupMenu' : 16843522,
'breadCrumbTitle' : 16843523,
'breadCrumbShortTitle' : 16843524,
'listDividerAlertDialog' : 16843525,
'textColorAlertDialogListItem' : 16843526,
'loopViews' : 16843527,
'dialogTheme' : 16843528,
'alertDialogTheme' : 16843529,
'dividerVertical' : 16843530,
'homeAsUpIndicator' : 16843531,
'enterFadeDuration' : 16843532,
'exitFadeDuration' : 16843533,
'selectableItemBackground' : 16843534,
'autoAdvanceViewId' : 16843535,
'useIntrinsicSizeAsMinimum' : 16843536,
'actionModeCutDrawable' : 16843537,
'actionModeCopyDrawable' : 16843538,
'actionModePasteDrawable' : 16843539,
'textEditPasteWindowLayout' : 16843540,
'textEditNoPasteWindowLayout' : 16843541,
'textIsSelectable' : 16843542,
'windowEnableSplitTouch' : 16843543,
'indeterminateProgressStyle' : 16843544,
'progressBarPadding' : 16843545,
'animationResolution' : 16843546,
'state_accelerated' : 16843547,
'baseline' : 16843548,
'homeLayout' : 16843549,
'opacity' : 16843550,
'alpha' : 16843551,
'transformPivotX' : 16843552,
'transformPivotY' : 16843553,
'translationX' : 16843554,
'translationY' : 16843555,
'scaleX' : 16843556,
'scaleY' : 16843557,
'rotation' : 16843558,
'rotationX' : 16843559,
'rotationY' : 16843560,
'showDividers' : 16843561,
'dividerPadding' : 16843562,
'borderlessButtonStyle' : 16843563,
'dividerHorizontal' : 16843564,
'itemPadding' : 16843565,
'buttonBarStyle' : 16843566,
'buttonBarButtonStyle' : 16843567,
'segmentedButtonStyle' : 16843568,
'staticWallpaperPreview' : 16843569,
'allowParallelSyncs' : 16843570,
'isAlwaysSyncable' : 16843571,
'verticalScrollbarPosition' : 16843572,
'fastScrollAlwaysVisible' : 16843573,
'fastScrollThumbDrawable' : 16843574,
'fastScrollPreviewBackgroundLeft' : 16843575,
'fastScrollPreviewBackgroundRight' : 16843576,
'fastScrollTrackDrawable' : 16843577,
'fastScrollOverlayPosition' : 16843578,
'customTokens' : 16843579,
'nextFocusForward' : 16843580,
'firstDayOfWeek' : 16843581,
'showWeekNumber' : 16843582,
'minDate' : 16843583,
'maxDate' : 16843584,
'shownWeekCount' : 16843585,
'selectedWeekBackgroundColor' : 16843586,
'focusedMonthDateColor' : 16843587,
'unfocusedMonthDateColor' : 16843588,
'weekNumberColor' : 16843589,
'weekSeparatorLineColor' : 16843590,
'selectedDateVerticalBar' : 16843591,
'weekDayTextAppearance' : 16843592,
'dateTextAppearance' : 16843593,
'solidColor' : 16843594,
'spinnersShown' : 16843595,
'calendarViewShown' : 16843596,
'state_multiline' : 16843597,
'detailsElementBackground' : 16843598,
'textColorHighlightInverse' : 16843599,
'textColorLinkInverse' : 16843600,
'editTextColor' : 16843601,
'editTextBackground' : 16843602,
'horizontalScrollViewStyle' : 16843603,
'layerType' : 16843604,
'alertDialogIcon' : 16843605,
'windowMinWidthMajor' : 16843606,
'windowMinWidthMinor' : 16843607,
'queryHint' : 16843608,
'fastScrollTextColor' : 16843609,
'largeHeap' : 16843610,
'windowCloseOnTouchOutside' : 16843611,
'datePickerStyle' : 16843612,
'calendarViewStyle' : 16843613,
'textEditSidePasteWindowLayout' : 16843614,
'textEditSideNoPasteWindowLayout' : 16843615,
'actionMenuTextAppearance' : 16843616,
'actionMenuTextColor' : 16843617,
'textCursorDrawable' : 16843618,
'resizeMode' : 16843619,
'requiresSmallestWidthDp' : 16843620,
'compatibleWidthLimitDp' : 16843621,
'largestWidthLimitDp' : 16843622,
'state_hovered' : 16843623,
'state_drag_can_accept' : 16843624,
'state_drag_hovered' : 16843625,
'stopWithTask' : 16843626,
'switchTextOn' : 16843627,
'switchTextOff' : 16843628,
'switchPreferenceStyle' : 16843629,
'switchTextAppearance' : 16843630,
'track' : 16843631,
'switchMinWidth' : 16843632,
'switchPadding' : 16843633,
'thumbTextPadding' : 16843634,
'textSuggestionsWindowStyle' : 16843635,
'textEditSuggestionItemLayout' : 16843636,
'rowCount' : 16843637,
'rowOrderPreserved' : 16843638,
'columnCount' : 16843639,
'columnOrderPreserved' : 16843640,
'useDefaultMargins' : 16843641,
'alignmentMode' : 16843642,
'layout_row' : 16843643,
'layout_rowSpan' : 16843644,
'layout_columnSpan' : 16843645,
'actionModeSelectAllDrawable' : 16843646,
'isAuxiliary' : 16843647,
'accessibilityEventTypes' : 16843648,
'packageNames' : 16843649,
'accessibilityFeedbackType' : 16843650,
'notificationTimeout' : 16843651,
'accessibilityFlags' : 16843652,
'canRetrieveWindowContent' : 16843653,
'listPreferredItemHeightLarge' : 16843654,
'listPreferredItemHeightSmall' : 16843655,
'actionBarSplitStyle' : 16843656,
'actionProviderClass' : 16843657,
'backgroundStacked' : 16843658,
'backgroundSplit' : 16843659,
'textAllCaps' : 16843660,
'colorPressedHighlight' : 16843661,
'colorLongPressedHighlight' : 16843662,
'colorFocusedHighlight' : 16843663,
'colorActivatedHighlight' : 16843664,
'colorMultiSelectHighlight' : 16843665,
'drawableStart' : 16843666,
'drawableEnd' : 16843667,
'actionModeStyle' : 16843668,
'minResizeWidth' : 16843669,
'minResizeHeight' : 16843670,
'actionBarWidgetTheme' : 16843671,
'uiOptions' : 16843672,
'subtypeLocale' : 16843673,
'subtypeExtraValue' : 16843674,
'actionBarDivider' : 16843675,
'actionBarItemBackground' : 16843676,
'actionModeSplitBackground' : 16843677,
'textAppearanceListItem' : 16843678,
'textAppearanceListItemSmall' : 16843679,
'targetDescriptions' : 16843680,
'directionDescriptions' : 16843681,
'overridesImplicitlyEnabledSubtype' : 16843682,
'listPreferredItemPaddingLeft' : 16843683,
'listPreferredItemPaddingRight' : 16843684,
'requiresFadingEdge' : 16843685,
'publicKey' : 16843686,
'parentActivityName' : 16843687,
'isolatedProcess' : 16843689,
'importantForAccessibility' : 16843690,
'keyboardLayout' : 16843691,
'fontFamily' : 16843692,
'mediaRouteButtonStyle' : 16843693,
'mediaRouteTypes' : 16843694,
'supportsRtl' : 16843695,
'textDirection' : 16843696,
'textAlignment' : 16843697,
'layoutDirection' : 16843698,
'paddingStart' : 16843699,
'paddingEnd' : 16843700,
'layout_marginStart' : 16843701,
'layout_marginEnd' : 16843702,
'layout_toStartOf' : 16843703,
'layout_toEndOf' : 16843704,
'layout_alignStart' : 16843705,
'layout_alignEnd' : 16843706,
'layout_alignParentStart' : 16843707,
'layout_alignParentEnd' : 16843708,
'listPreferredItemPaddingStart' : 16843709,
'listPreferredItemPaddingEnd' : 16843710,
'singleUser' : 16843711,
'presentationTheme' : 16843712,
'subtypeId' : 16843713,
'initialKeyguardLayout' : 16843714,
'widgetCategory' : 16843716,
'permissionGroupFlags' : 16843717,
'labelFor' : 16843718,
'permissionFlags' : 16843719,
'checkedTextViewStyle' : 16843720,
'showOnLockScreen' : 16843721,
'format12Hour' : 16843722,
'format24Hour' : 16843723,
'timeZone' : 16843724,
'mipMap' : 16843725,
'mirrorForRtl' : 16843726,
'windowOverscan' : 16843727,
'requiredForAllUsers' : 16843728,
'indicatorStart' : 16843729,
'indicatorEnd' : 16843730,
'childIndicatorStart' : 16843731,
'childIndicatorEnd' : 16843732,
'restrictedAccountType' : 16843733,
'requiredAccountType' : 16843734,
'canRequestTouchExplorationMode' : 16843735,
'canRequestEnhancedWebAccessibility' : 16843736,
'canRequestFilterKeyEvents' : 16843737,
'layoutMode' : 16843738,
'keySet' : 16843739,
'targetId' : 16843740,
'fromScene' : 16843741,
'toScene' : 16843742,
'transition' : 16843743,
'transitionOrdering' : 16843744,
'fadingMode' : 16843745,
'startDelay' : 16843746,
'ssp' : 16843747,
'sspPrefix' : 16843748,
'sspPattern' : 16843749,
'addPrintersActivity' : 16843750,
'vendor' : 16843751,
'category' : 16843752,
'isAsciiCapable' : 16843753,
'autoMirrored' : 16843754,
'supportsSwitchingToNextInputMethod' : 16843755,
'requireDeviceUnlock' : 16843756,
'apduServiceBanner' : 16843757,
'accessibilityLiveRegion' : 16843758,
'windowTranslucentStatus' : 16843759,
'windowTranslucentNavigation' : 16843760,
'advancedPrintOptionsActivity' : 16843761,
'banner' : 16843762,
'windowSwipeToDismiss' : 16843763,
'isGame' : 16843764,
'allowEmbedded' : 16843765,
'setupActivity' : 16843766,
'fastScrollStyle' : 16843767,
'windowContentTransitions' : 16843768,
'windowContentTransitionManager' : 16843769,
'translationZ' : 16843770,
'tintMode' : 16843771,
'controlX1' : 16843772,
'controlY1' : 16843773,
'controlX2' : 16843774,
'controlY2' : 16843775,
'transitionName' : 16843776,
'transitionGroup' : 16843777,
'viewportWidth' : 16843778,
'viewportHeight' : 16843779,
'fillColor' : 16843780,
'pathData' : 16843781,
'strokeColor' : 16843782,
'strokeWidth' : 16843783,
'trimPathStart' : 16843784,
'trimPathEnd' : 16843785,
'trimPathOffset' : 16843786,
'strokeLineCap' : 16843787,
'strokeLineJoin' : 16843788,
'strokeMiterLimit' : 16843789,
'colorControlNormal' : 16843817,
'colorControlActivated' : 16843818,
'colorButtonNormal' : 16843819,
'colorControlHighlight' : 16843820,
'persistableMode' : 16843821,
'titleTextAppearance' : 16843822,
'subtitleTextAppearance' : 16843823,
'slideEdge' : 16843824,
'actionBarTheme' : 16843825,
'textAppearanceListItemSecondary' : 16843826,
'colorPrimary' : 16843827,
'colorPrimaryDark' : 16843828,
'colorAccent' : 16843829,
'nestedScrollingEnabled' : 16843830,
'windowEnterTransition' : 16843831,
'windowExitTransition' : 16843832,
'windowSharedElementEnterTransition' : 16843833,
'windowSharedElementExitTransition' : 16843834,
'windowAllowReturnTransitionOverlap' : 16843835,
'windowAllowEnterTransitionOverlap' : 16843836,
'sessionService' : 16843837,
'stackViewStyle' : 16843838,
'switchStyle' : 16843839,
'elevation' : 16843840,
'excludeId' : 16843841,
'excludeClass' : 16843842,
'hideOnContentScroll' : 16843843,
'actionOverflowMenuStyle' : 16843844,
'documentLaunchMode' : 16843845,
'maxRecents' : 16843846,
'autoRemoveFromRecents' : 16843847,
'stateListAnimator' : 16843848,
'toId' : 16843849,
'fromId' : 16843850,
'reversible' : 16843851,
'splitTrack' : 16843852,
'targetName' : 16843853,
'excludeName' : 16843854,
'matchOrder' : 16843855,
'windowDrawsSystemBarBackgrounds' : 16843856,
'statusBarColor' : 16843857,
'navigationBarColor' : 16843858,
'contentInsetStart' : 16843859,
'contentInsetEnd' : 16843860,
'contentInsetLeft' : 16843861,
'contentInsetRight' : 16843862,
'paddingMode' : 16843863,
'layout_rowWeight' : 16843864,
'layout_columnWeight' : 16843865,
'translateX' : 16843866,
'translateY' : 16843867,
'selectableItemBackgroundBorderless' : 16843868,
'elegantTextHeight' : 16843869,
'searchKeyphraseId' : 16843870,
'searchKeyphrase' : 16843871,
'searchKeyphraseSupportedLocales' : 16843872,
'windowTransitionBackgroundFadeDuration' : 16843873,
'overlapAnchor' : 16843874,
'progressTint' : 16843875,
'progressTintMode' : 16843876,
'progressBackgroundTint' : 16843877,
'progressBackgroundTintMode' : 16843878,
'secondaryProgressTint' : 16843879,
'secondaryProgressTintMode' : 16843880,
'indeterminateTint' : 16843881,
'indeterminateTintMode' : 16843882,
'backgroundTint' : 16843883,
'backgroundTintMode' : 16843884,
'foregroundTint' : 16843885,
'foregroundTintMode' : 16843886,
'buttonTint' : 16843887,
'buttonTintMode' : 16843888,
'thumbTint' : 16843889,
'thumbTintMode' : 16843890,
'fullBackupOnly' : 16843891,
'propertyXName' : 16843892,
'propertyYName' : 16843893,
'relinquishTaskIdentity' : 16843894,
'tileModeX' : 16843895,
'tileModeY' : 16843896,
'actionModeShareDrawable' : 16843897,
'actionModeFindDrawable' : 16843898,
'actionModeWebSearchDrawable' : 16843899,
'transitionVisibilityMode' : 16843900,
'minimumHorizontalAngle' : 16843901,
'minimumVerticalAngle' : 16843902,
'maximumAngle' : 16843903,
'searchViewStyle' : 16843904,
'closeIcon' : 16843905,
'goIcon' : 16843906,
'searchIcon' : 16843907,
'voiceIcon' : 16843908,
'commitIcon' : 16843909,
'suggestionRowLayout' : 16843910,
'queryBackground' : 16843911,
'submitBackground' : 16843912,
'buttonBarPositiveButtonStyle' : 16843913,
'buttonBarNeutralButtonStyle' : 16843914,
'buttonBarNegativeButtonStyle' : 16843915,
'popupElevation' : 16843916,
'actionBarPopupTheme' : 16843917,
'multiArch' : 16843918,
'touchscreenBlocksFocus' : 16843919,
'windowElevation' : 16843920,
'launchTaskBehindTargetAnimation' : 16843921,
'launchTaskBehindSourceAnimation' : 16843922,
'restrictionType' : 16843923,
'dayOfWeekBackground' : 16843924,
'dayOfWeekTextAppearance' : 16843925,
'headerMonthTextAppearance' : 16843926,
'headerDayOfMonthTextAppearance' : 16843927,
'headerYearTextAppearance' : 16843928,
'yearListItemTextAppearance' : 16843929,
'yearListSelectorColor' : 16843930,
'calendarTextColor' : 16843931,
'recognitionService' : 16843932,
'timePickerStyle' : 16843933,
'timePickerDialogTheme' : 16843934,
'headerTimeTextAppearance' : 16843935,
'headerAmPmTextAppearance' : 16843936,
'numbersTextColor' : 16843937,
'numbersBackgroundColor' : 16843938,
'numbersSelectorColor' : 16843939,
'amPmTextColor' : 16843940,
'amPmBackgroundColor' : 16843941,
'searchKeyphraseRecognitionFlags' : 16843942,
'checkMarkTint' : 16843943,
'checkMarkTintMode' : 16843944,
'popupTheme' : 16843945,
'toolbarStyle' : 16843946,
'windowClipToOutline' : 16843947,
'datePickerDialogTheme' : 16843948,
'showText' : 16843949,
'windowReturnTransition' : 16843950,
'windowReenterTransition' : 16843951,
'windowSharedElementReturnTransition' : 16843952,
'windowSharedElementReenterTransition' : 16843953,
'resumeWhilePausing' : 16843954,
'datePickerMode' : 16843955,
'timePickerMode' : 16843956,
'inset' : 16843957,
'letterSpacing' : 16843958,
'fontFeatureSettings' : 16843959,
'outlineProvider' : 16843960,
'contentAgeHint' : 16843961,
'country' : 16843962,
'windowSharedElementsUseOverlay' : 16843963,
'reparent' : 16843964,
'reparentWithOverlay' : 16843965,
'ambientShadowAlpha' : 16843966,
'spotShadowAlpha' : 16843967,
'navigationIcon' : 16843968,
'navigationContentDescription' : 16843969,
'fragmentExitTransition' : 16843970,
'fragmentEnterTransition' : 16843971,
'fragmentSharedElementEnterTransition' : 16843972,
'fragmentReturnTransition' : 16843973,
'fragmentSharedElementReturnTransition' : 16843974,
'fragmentReenterTransition' : 16843975,
'fragmentAllowEnterTransitionOverlap' : 16843976,
'fragmentAllowReturnTransitionOverlap' : 16843977,
'patternPathData' : 16843978,
'strokeAlpha' : 16843979,
'fillAlpha' : 16843980,
'windowActivityTransitions' : 16843981,
'colorEdgeEffect' : 16843982
}
}
SYSTEM_RESOURCES = {
"attributes": {
"forward": {k: v for k, v in resources['attr'].items()},
"inverse": {v: k for k, v in resources['attr'].items()}
},
"styles": {
"forward": {k: v for k, v in resources['style'].items()},
"inverse": {v: k for k, v in resources['style'].items()}
}
}
| [
37540,
796,
1391,
198,
220,
220,
220,
705,
7635,
10354,
1391,
198,
220,
220,
220,
220,
220,
220,
220,
705,
39520,
6,
1058,
1467,
5607,
2548,
1731,
11,
198,
220,
220,
220,
220,
220,
220,
220,
705,
39520,
13,
16516,
6,
1058,
1467,
5... | 2.125189 | 40,946 |
import asyncio
import logging
import logging.handlers
import discord
from discord.ext import commands, tasks
| [
11748,
30351,
952,
198,
11748,
18931,
198,
11748,
18931,
13,
4993,
8116,
198,
198,
11748,
36446,
198,
6738,
36446,
13,
2302,
1330,
9729,
11,
8861,
628,
198
] | 4.148148 | 27 |
from typing import Dict
from fastapi import FastAPI, Query
from text_similarity.similarity import Texts
app = FastAPI()
@app.post("/similarity")
| [
6738,
19720,
1330,
360,
713,
198,
198,
6738,
3049,
15042,
1330,
12549,
17614,
11,
43301,
198,
198,
6738,
2420,
62,
38610,
414,
13,
38610,
414,
1330,
8255,
82,
198,
198,
1324,
796,
12549,
17614,
3419,
628,
198,
31,
1324,
13,
7353,
7203... | 3.191489 | 47 |
"""Hello World for python."""
a = 3
print(a)
print(a, ' helloworld number')
| [
37811,
15496,
2159,
329,
21015,
526,
15931,
198,
64,
796,
513,
198,
4798,
7,
64,
8,
198,
198,
4798,
7,
64,
11,
705,
5968,
322,
1764,
1271,
11537,
198
] | 2.655172 | 29 |
import requests
from threading import Thread
from django.db import connection
from django.utils import timezone
from .models import Player
| [
11748,
7007,
198,
6738,
4704,
278,
1330,
14122,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
4637,
198,
6738,
42625,
14208,
13,
26791,
1330,
640,
11340,
198,
198,
6738,
764,
27530,
1330,
7853,
628,
628
] | 4.114286 | 35 |
# Copyright 2021 Sony Group Corporation.
#
# 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.
"""
Provide data iterator for MNIST examples.
"""
import argparse
import random
import os
import numpy
import struct
import zlib
import tqdm
import numpy as np
import csv
from imageio import imwrite
from nnabla.logger import logger
from nnabla.utils.data_iterator import data_iterator
from nnabla.utils.data_source import DataSource
from nnabla.utils.data_source_loader import download
def load_mnist(train=True):
"""
Load MNIST dataset images and labels from the original page by Yan LeCun or the cache file.
Args:
train (bool): The testing dataset will be returned if False. Training data has 60000 images, while testing has 10000 images.
Returns:
numpy.ndarray: A shape of (#images, 1, 28, 28). Values in [0.0, 1.0].
numpy.ndarray: A shape of (#images, 1). Values in {0, 1, ..., 9}.
"""
if train:
image_uri = "https://github.com/zalandoresearch/fashion-mnist/train-images-idx3-ubyte.gz"
label_uri = "https://github.com/zalandoresearch/fashion-mnist/train-labels-idx1-ubyte.gz"
else:
image_uri = (
"https://github.com/zalandoresearch/fashion-mnist/t10k-images-idx3-ubyte.gz"
)
label_uri = (
"https://github.com/zalandoresearch/fashion-mnist/t10k-labels-idx1-ubyte.gz"
)
logger.info("Getting label data from {}.".format(label_uri))
# With python3 we can write this logic as following, but with
# python2, gzip.object does not support file-like object and
# urllib.request does not support 'with statement'.
#
# with request.urlopen(label_uri) as r, gzip.open(r) as f:
# _, size = struct.unpack('>II', f.read(8))
# labels = numpy.frombuffer(f.read(), numpy.uint8).reshape(-1, 1)
#
r = download(label_uri)
data = zlib.decompress(r.read(), zlib.MAX_WBITS | 32)
_, size = struct.unpack(">II", data[0:8])
labels = numpy.frombuffer(data[8:], numpy.uint8).reshape(-1, 1)
r.close()
logger.info("Getting label data done.")
logger.info("Getting image data from {}.".format(image_uri))
r = download(image_uri)
data = zlib.decompress(r.read(), zlib.MAX_WBITS | 32)
_, size, height, width = struct.unpack(">IIII", data[0:16])
images = numpy.frombuffer(data[16:], numpy.uint8).reshape(
size, 1, height, width)
r.close()
logger.info("Getting image data done.")
return images, labels
class FashionMnistDataSource(DataSource):
"""
Get data directly from MNIST dataset from Internet(yann.lecun.com).
"""
@property
def images(self):
"""Get copy of whole data with a shape of (N, 1, H, W)."""
return self._images.copy()
@property
def labels(self):
"""Get copy of whole label with a shape of (N, 1)."""
return self._labels.copy()
@property
def data_iterator_fashion_mnist(
batch_size,
train=True,
rng=None,
shuffle=True,
with_memory_cache=False,
with_file_cache=False,
label_shuffle=False,
label_shuffle_rate=0.1,
):
"""
Provide DataIterator with :py:class:`FashionMnistDataSource`
with_memory_cache and with_file_cache option's default value is all False,
because :py:class:`FashionMnistDataSource` is able to store all data into memory.
For example,
.. code-block:: python
with data_iterator_mnist(True, batch_size) as di:
for data in di:
SOME CODE TO USE data.
"""
return data_iterator(
FashionMnistDataSource(
train=train,
shuffle=shuffle,
rng=rng,
label_shuffle=label_shuffle,
label_shuffle_rate=label_shuffle_rate,
),
batch_size,
rng,
with_memory_cache,
with_file_cache,
)
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument(
"--label_shuffle", action="store_true", help="generate label shuffled dataset"
)
parser.add_argument("--seed", type=int, default=0)
parser.add_argument("--shuffle_rate", type=float, default=0.1)
args = parser.parse_args()
set_seed()
print("Label Shuffle: ", args.label_shuffle)
main()
| [
2,
15069,
33448,
10184,
4912,
10501,
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,
92... | 2.525263 | 1,900 |
#!/usr/bin/env python
# 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 signal
__author__ = 'Oscar Eriksson <oscar.eriks@gmail.com>'
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
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,
9... | 3.643678 | 174 |
import json
from e2e.Libs.BLS import PrivateKey, PublicKey
from e2e.Classes.Consensus.DataDifficulty import SignedDataDifficulty
from e2e.Classes.Consensus.MeritRemoval import SignedMeritRemoval
from e2e.Vectors.Generation.PrototypeChain import PrototypeChain
proto: PrototypeChain = PrototypeChain(1, False)
blsPrivKey: PrivateKey = PrivateKey(0)
blsPubKey: PublicKey = blsPrivKey.toPublicKey()
#Create a DataDifficulty.
dataDiff: SignedDataDifficulty = SignedDataDifficulty(3, 0)
dataDiff.sign(0, blsPrivKey)
#Create a conflicting DataDifficulty with the same nonce.
dataDiffConflicting: SignedDataDifficulty = SignedDataDifficulty(1, 0)
dataDiffConflicting.sign(0, blsPrivKey)
#Create a MeritRemoval out of the two of them.
mr1: SignedMeritRemoval = SignedMeritRemoval(dataDiff, dataDiffConflicting)
proto.add(elements=[dataDiff, dataDiffConflicting])
#Create two more DataDifficulties with a different nonce.
dataDiff = SignedDataDifficulty(3, 1)
dataDiff.sign(0, blsPrivKey)
dataDiffConflicting = SignedDataDifficulty(1, 1)
dataDiffConflicting.sign(0, blsPrivKey)
#Create another MeritRemoval out of these two.
mr2: SignedMeritRemoval = SignedMeritRemoval(dataDiff, dataDiffConflicting)
with open("e2e/Vectors/Consensus/MeritRemoval/Multiple.json", "w") as vectors:
vectors.write(json.dumps({
"blockchain": proto.toJSON(),
"removals": [mr1.toSignedJSON(), mr2.toSignedJSON()]
}))
| [
11748,
33918,
198,
198,
6738,
304,
17,
68,
13,
25835,
82,
13,
33,
6561,
1330,
15348,
9218,
11,
5094,
9218,
198,
198,
6738,
304,
17,
68,
13,
9487,
274,
13,
9444,
7314,
13,
6601,
28813,
22402,
1330,
36215,
6601,
28813,
22402,
198,
673... | 2.957983 | 476 |
import pathlib
import sys
import pytest
from relion._parser.processgraph import ProcessGraph
from relion._parser.processnode import ProcessNode
from relion._parser.relion_pipeline import RelionPipeline
@pytest.fixture
@pytest.fixture
@pytest.fixture
@pytest.fixture
@pytest.fixture
@pytest.mark.skipif(sys.platform == "win32", reason="does not run on windows")
| [
11748,
3108,
8019,
198,
11748,
25064,
198,
198,
11748,
12972,
9288,
198,
198,
6738,
823,
295,
13557,
48610,
13,
14681,
34960,
1330,
10854,
37065,
198,
6738,
823,
295,
13557,
48610,
13,
14681,
17440,
1330,
10854,
19667,
198,
6738,
823,
295... | 3.007874 | 127 |
from django.contrib import admin
from django.urls import path
from .views import blog
urlpatterns = [
path('', blog, name='blog'),
]
| [
6738,
42625,
14208,
13,
3642,
822,
1330,
13169,
198,
6738,
42625,
14208,
13,
6371,
82,
1330,
3108,
198,
6738,
764,
33571,
1330,
4130,
628,
198,
6371,
33279,
82,
796,
685,
198,
220,
220,
220,
3108,
10786,
3256,
4130,
11,
1438,
11639,
1... | 3.021739 | 46 |
#!/usr/bin/env python
# encoding: utf-8
"""
@version: 0.0
@author: hailang
@Email: seahailang@gmail.com
@software: PyCharm
@file: snake_env.py
@time: 2018/6/21 15:45
"""
import numpy as np
import gym
from gym.spaces import Discrete
if __name__ == '__main__':
s = SnakeEnv(10,[10]) | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
21004,
25,
3384,
69,
12,
23,
628,
198,
37811,
198,
31,
9641,
25,
657,
13,
15,
198,
31,
9800,
25,
32405,
648,
198,
31,
15333,
25,
384,
993,
603,
648,
31,
14816,
13,
785,
198,
... | 2.420168 | 119 |
n1 = int(input('Digite um número: '))
print(f'O dobro do número {n1} é {n1*2} o seu triplo {n1*3} e sua raiz quadrada é {n1**(1/2)}')
| [
77,
16,
796,
493,
7,
15414,
10786,
19511,
578,
23781,
299,
21356,
647,
78,
25,
705,
4008,
198,
4798,
7,
69,
6,
46,
466,
7957,
466,
299,
21356,
647,
78,
1391,
77,
16,
92,
38251,
1391,
77,
16,
9,
17,
92,
267,
384,
84,
1333,
489,... | 1.835616 | 73 |
#!/usr/bin/python
import HistGen_py
import numpy
myHist = [100, 300, 300, 700, 900, 600, 400, 200, 300, 100]
myBins = ["infrared", "red", "orange", "yellow", "sour", "green", "teal", "blue", "violet", "ultraviolet"]
myTest = HistGen_py.HistGen(myHist)
for i in range(0,10):
index = myTest.genIndex(numpy.random.randint(0, high=numpy.iinfo(numpy.uint64).max, dtype='uint64'))
while index == len(myHist):
index = myTest.genIndex(numpy.random.randint(0, high=numpy.iinfo(numpy.uint64).max, dtype='uint64'))
print(myBins[index]) | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
198,
11748,
5590,
13746,
62,
9078,
198,
11748,
299,
32152,
198,
198,
1820,
13749,
796,
685,
3064,
11,
5867,
11,
5867,
11,
13037,
11,
15897,
11,
10053,
11,
7337,
11,
939,
11,
5867,
11,
1802,... | 2.451613 | 217 |
"""
C DLLs
======
:Author: Caterina Urban
"""
from ctypes import util, CDLL
libc = CDLL(util.find_library('c'))
libapron = CDLL('libapron.so')
libgmp = CDLL(util.find_library('gmp'))
libmpfr = CDLL(util.find_library('mpfr'))
| [
37811,
198,
34,
360,
3069,
82,
198,
50155,
198,
198,
25,
13838,
25,
40742,
1437,
14665,
198,
37811,
198,
6738,
269,
19199,
1330,
7736,
11,
6458,
3069,
198,
198,
8019,
66,
796,
6458,
3069,
7,
22602,
13,
19796,
62,
32016,
10786,
66,
6... | 2.360825 | 97 |
##__________________________________________________________________||
import collections
##__________________________________________________________________||
EventBuilderConfig = collections.namedtuple(
'EventBuilderConfig',
'base component'
)
# base is for roottree.EventBuilderConfig
##__________________________________________________________________||
| [
2235,
27193,
834,
15886,
198,
11748,
17268,
198,
198,
2235,
27193,
834,
15886,
198,
9237,
32875,
16934,
796,
17268,
13,
13190,
83,
29291,
7,
198,
220,
220,
220,
705,
9237,
32875,
16934,
3256,
198,
220,
220,
220,
705,
8692,
7515,
6,
19... | 5.888889 | 63 |
import asyncio
import logging
from dataclasses import dataclass
from typing import Optional
from kafka import KafkaConsumer
from kafka.errors import KafkaError
from laksyt.config.config import Config
from laksyt.entities.kafka.consumer import get_kafka_consumer
from laksyt.entities.kafka.schedule import Schedule, get_schedule
from laksyt.entities.report import HealthReport
logger = logging.getLogger(__name__)
@dataclass
class KafkaMessage:
"""Represents the offset&bytes pair that is Kafka message"""
offset: int
raw_bytes: bytes
class KafkaPoller:
"""Wrapper around KafkaConsumer that continuously polls for messages and
reports any errors along the way without breaking its stride
"""
def __init__(
self,
schedule: Schedule,
kafka_consumer: KafkaConsumer
):
"""Uses polling schedule and KafkaConsumer"""
self._schedule = schedule
self._kafka_consumer = kafka_consumer
def __aiter__(self):
"""Makes poller instances asynchronously iterable"""
return self.poll_continuously()
async def poll_continuously(self):
"""Exposes continuous polling function as an asynchronous generator"""
while True:
yield self._poll_once()
await asyncio.sleep(self._schedule.delay)
def _poll_once(self) -> Optional[list[HealthReport]]:
"""Does one synchronous poll and deserializes polled messages, if any,
into HealthReports
"""
batch = self._do_poll()
return self._deserialize_batch(batch)
def _do_poll(self) -> Optional[list[KafkaMessage]]:
"""Polls next limited batch of reports from Kafka, with timeout, then
commits offsets and returns flat list of Kafka messages
If polling or parsing fails, None is returned. For empty batches, an
empty list is returned.
"""
try:
raw_messages = self._kafka_consumer.poll(
timeout_ms=self._schedule.timeout * 1000,
max_records=self._schedule.max_records
)
except KafkaError:
logger.exception("Failed to poll for messages due to Kafka error")
return None
try:
self._kafka_consumer.commit()
except KafkaError:
logger.exception("Failed to commit topic offset due to Kafka error")
return self._parse_messages(raw_messages)
@staticmethod
def _parse_messages(raw_messages: Optional[dict]) \
-> Optional[list[KafkaMessage]]:
"""Extracts flat list of Kafka messages from Kafka's output
If given raw data cannot be parsed, an error is logged, then None is
returned. If a batch has no messages, an empty list is returned.
"""
result = None
try:
result = [
KafkaMessage(message.offset, message.value)
for _, messages in raw_messages.items()
for message in messages
]
except AttributeError:
logger.exception(
f"Failed to parse Kafka messages; dropping: {raw_messages}"
)
return result
def _deserialize_batch(self, batch: Optional[list[KafkaMessage]]) \
-> Optional[list[HealthReport]]:
"""Deserializes Kafka offset/message pairs and reports batch status"""
if batch is None:
return None # polling errors reported where encountered
reports = []
if not batch:
logger.info("Received empty batch of reports") # valid case
return reports
for message in batch:
report = self._deserialize_report(message)
if report is not None:
reports.append(report)
logger.info(f"Received {report}")
if not reports:
logger.error(
f"Failed to deserialize any of {len(batch)} Kafka messages"
" in latest batch"
)
elif len(reports) != len(batch):
logger.error(
f"Failed to deserialize {len(batch) - len(reports)}"
f" out of {len(batch)} Kafka messages in latest batch"
)
else:
logger.info(f"Received batch of {len(reports)} reports")
return reports
@staticmethod
def _deserialize_report(message: KafkaMessage) -> Optional[HealthReport]:
"""Deserializes Kafka message to HealthReport"""
offset, raw_bytes = message.offset, message.raw_bytes
report = None
try:
report = HealthReport.deserialize(raw_bytes)
except StopIteration: # deserialization fails with this exception
logger.error( # stack trace is more or less useless, so just error
f"Failed to deserialize Kafka message [offset: {offset},"
f" bytes: {raw_bytes}]; dropping"
)
return report
def get_kafka_poller(config: Config) -> KafkaPoller:
"""Extracts and validates Kafka consumer parameters from the application
config file for the active profile, then constructs and returns the
poller object
"""
return KafkaPoller(
get_schedule(config),
get_kafka_consumer(config)
)
| [
11748,
30351,
952,
198,
11748,
18931,
198,
6738,
4818,
330,
28958,
1330,
4818,
330,
31172,
198,
6738,
19720,
1330,
32233,
198,
198,
6738,
479,
1878,
4914,
1330,
46906,
49106,
198,
6738,
479,
1878,
4914,
13,
48277,
1330,
46906,
12331,
198,... | 2.445215 | 2,163 |
from django.apps import AppConfig
| [
6738,
42625,
14208,
13,
18211,
1330,
2034,
16934,
628
] | 3.888889 | 9 |
"""Initializer class to prepare training"""
import json
from torch.utils.data import DataLoader
from mvrss.utils.paths import Paths
from mvrss.loaders.dataset import Carrada
from mvrss.loaders.dataloaders import SequenceCarradaDataset
class Initializer:
"""Class to prepare training model
PARAMETERS
----------
cfg: dict
Configuration file used for train/test
"""
def get_data(self):
"""Return parameters of the training"""
return self._structure_data()
| [
37811,
24243,
7509,
1398,
284,
8335,
3047,
37811,
198,
11748,
33918,
198,
6738,
28034,
13,
26791,
13,
7890,
1330,
6060,
17401,
198,
198,
6738,
285,
37020,
824,
13,
26791,
13,
6978,
82,
1330,
10644,
82,
198,
6738,
285,
37020,
824,
13,
... | 2.947674 | 172 |
#
# Copyright (c) 2015 Red Hat
# Licensed under The MIT License (MIT)
# http://opensource.org/licenses/MIT
#
import json
from django.dispatch import receiver
from django.db.models.signals import post_save
from . import models
from pdc.apps.component import signals as component_signals
from pdc.apps.component import models as component_models
@receiver(post_save, sender=component_models.ReleaseComponent)
def component_post_save_handler(sender, instance, **kwargs):
"""Create or delete OSBS record after component is saved.
"""
if instance.type.has_osbs and not hasattr(instance, 'osbs'):
models.OSBSRecord.objects.create(component=instance)
elif not instance.type.has_osbs and hasattr(instance, 'osbs'):
models.OSBSRecord.objects.get(component=instance).delete()
@receiver(post_save, sender=component_models.ReleaseComponentType)
def type_post_save_handler(sender, instance, **kwargs):
"""Create records for all components if their type now has OSBS.
If the has_osbs has been set to True, this call will take quite a lot of
time.
"""
if instance.has_osbs:
models.OSBSRecord.objects.bulk_create(
[models.OSBSRecord(component=c)
for c in instance.release_components.filter(osbs__isnull=True)]
)
else:
models.OSBSRecord.objects.filter(component__type=instance).delete()
@receiver(component_signals.releasecomponent_clone)
| [
2,
198,
2,
15069,
357,
66,
8,
1853,
2297,
10983,
198,
2,
49962,
739,
383,
17168,
13789,
357,
36393,
8,
198,
2,
2638,
1378,
44813,
1668,
13,
2398,
14,
677,
4541,
14,
36393,
198,
2,
198,
11748,
33918,
198,
198,
6738,
42625,
14208,
1... | 2.912779 | 493 |
import os
def read_file(filename):
"""Read the contents of a file in the tests directory."""
root_dir = os.path.dirname(os.path.realpath(__file__))
with open(os.path.join(root_dir, filename), 'r') as f:
return f.read()
| [
11748,
28686,
628,
198,
4299,
1100,
62,
7753,
7,
34345,
2599,
198,
220,
220,
220,
37227,
5569,
262,
10154,
286,
257,
2393,
287,
262,
5254,
8619,
526,
15931,
198,
220,
220,
220,
6808,
62,
15908,
796,
28686,
13,
6978,
13,
15908,
3672,
... | 2.591398 | 93 |
import os
import json
from itertools import product
import numpy as np
from PIL import Image
from os import walk
import cv2
from detectron2 import model_zoo
from detectron2.config import get_cfg
from detectron2.data import DatasetCatalog
from detectron2.data import MetadataCatalog
from detectron2.data.datasets import register_coco_instances
from detectron2.engine import DefaultPredictor
from detectron2.utils.visualizer import ColorMode
from detectron2.utils.visualizer import Visualizer
OUTPUT_IMAGE_EXTENSION = '.png'
INPUT_DIR = 'raw_images'
OUTPUT_DIR = 'processed_images'
# All this should better be refactored into a class
def segment_image_into_tiles(
filename,
tile_dimensions = (None, None),
dir_in = "",
dir_out = "",
ext = OUTPUT_IMAGE_EXTENSION,
save_tiles=True):
"""
Segments an image into tiles.
:param filename: The name of the image file to segment.
:type filename: str
:param dir_in: The directory containing the image file.
:type dir_in: str
:param dir_out: The directory to save the tiles to.
:type dir_out: str
:param ext: The extension of the image file.
:type ext: str
:param tile_dimensions: The dimensions of the tiles.
:type tile_dimensions: tuple
:param save_tiles: Whether or not to save the tiles.
:type save_tiles: bool
"""
tiles = dict()
name, _ = os.path.splitext(filename)
img = Image.open(os.path.join(dir_in, filename))
img_w, img_h = img.size
tile_w = tile_dimensions[0] if tile_dimensions[0] is not None else img_w
tile_h = tile_dimensions[1] if tile_dimensions[1] is not None else img_h
grid = product(range(0, img_h-img_h%tile_h, tile_h), range(0, img_w-img_w%tile_w, tile_w))
for i, j in grid:
box = (j, i, j+tile_w, i+tile_h)
out = os.path.join(dir_out, f'{name}_{i}_{j}{ext}')
tile = img.crop(box)
if save_tiles:
tile.save(out)
tiles[out] = tile
return tiles
if __name__ == '__main__':
import argparse
parser = argparse.ArgumentParser(description='Hold detection')
parser.add_argument('images_path', type=str, default='', help='The input wall image file')
parser.add_argument('model_path', type=str, default='', help='climbnet model weights')
parser.add_argument('tile_width', type=int, default=0, help='Tile width')
parser.add_argument('tile_height', type=int, default=0, help='Tile height')
parser.add_argument('combine_results', type=bool, default=False, help='Mix results of split detection and overall detection')
args = parser.parse_args()
f = []
for (dirpath, dirnames, filenames) in walk(args.images_path):
f.extend(filenames)
break
main(f, args.model_path, args.tile_width, args.tile_height, args.combine_results)
# sample run:
# > python .\extract_holds.py raw_images ..\model_weights\model_d2_R_50_FPN_3x.pth 0 600 False | [
11748,
28686,
198,
11748,
33918,
198,
6738,
340,
861,
10141,
1330,
1720,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
350,
4146,
1330,
7412,
198,
6738,
28686,
1330,
2513,
628,
198,
11748,
269,
85,
17,
198,
6738,
4886,
1313,
17,
1330,
... | 2.622878 | 1,119 |
from django.views.generic.detail import DetailView
from django.views.generic.list import ListView
from django.views.generic.edit import CreateView, UpdateView, DeleteView
from django.utils.decorators import method_decorator
from django.contrib.auth.decorators import login_required
from django.core.urlresolvers import reverse_lazy
from django_tables2 import SingleTableView, RequestConfig
from .models import SkosConcept, SkosConceptScheme, SkosLabel
from .forms import SkosConceptForm, SkosConceptSchemeForm, SkosLabelForm, GenericFilterFormHelper
from .tables import SkosConceptTable
from .filters import SkosConceptFilter
#####################################################
# ConceptScheme
#####################################################
###################################################
# SkosLabel
###################################################
| [
6738,
42625,
14208,
13,
33571,
13,
41357,
13,
49170,
1330,
42585,
7680,
198,
6738,
42625,
14208,
13,
33571,
13,
41357,
13,
4868,
1330,
7343,
7680,
198,
6738,
42625,
14208,
13,
33571,
13,
41357,
13,
19312,
1330,
13610,
7680,
11,
10133,
7... | 4.050228 | 219 |
from mongoengine import connect
from config import Config
from db.models.subscriptions import Subscriptions
| [
6738,
285,
25162,
18392,
1330,
2018,
198,
6738,
4566,
1330,
17056,
198,
6738,
20613,
13,
27530,
13,
7266,
12048,
507,
1330,
3834,
12048,
507,
198
] | 4.32 | 25 |
from ray.rllib.models.tf.tf_modelv2 import TFModelV2
from ray.rllib.models.tf.fcnet_v2 import FullyConnectedNetwork
from ray.rllib.models import Model # deprecated and should not be used.
class CustomModel_1(Model):
"""
Sample custom model with LSTM.
Still working but deprecated and should not be used.
Need to update this class.
see: https://ray.readthedocs.io/en/latest/rllib-models.html
"""
"""
def _build_layers_v2(self, input_dict, num_outputs, options):
hidden = 512
cell_size = 256
#S = input_dict["obs"]
S = tf.layers.flatten(input_dict["obs"])
with tf.variable_scope(tf.VariableScope(tf.AUTO_REUSE, "shared"),
reuse=tf.AUTO_REUSE,
auxiliary_name_scope=False):
last_layer = tf.layers.dense(S, hidden, activation=tf.nn.relu, name="fc1")
last_layer = tf.layers.dense(last_layer, hidden, activation=tf.nn.relu, name="fc2")
last_layer = tf.layers.dense(last_layer, hidden, activation=tf.nn.relu, name="fc3")
last_layer = self._lstm(last_layer, cell_size)
output = tf.layers.dense(last_layer, num_outputs, activation=tf.nn.softmax, name="mu")
return output, last_layer
"""
| [
6738,
26842,
13,
81,
297,
571,
13,
27530,
13,
27110,
13,
27110,
62,
19849,
85,
17,
1330,
24958,
17633,
53,
17,
198,
6738,
26842,
13,
81,
297,
571,
13,
27530,
13,
27110,
13,
16072,
3262,
62,
85,
17,
1330,
40234,
13313,
276,
26245,
... | 2.254867 | 565 |
from django.conf import settings
from django.db.models import options
from django.db.models.signals import class_prepared, pre_init
options.DEFAULT_NAMES = options.DEFAULT_NAMES + ('db_prefix',)
pre_init.connect(model_prefix)
class_prepared.connect(model_prefix)
| [
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
6738,
42625,
14208,
13,
9945,
13,
27530,
1330,
3689,
198,
6738,
42625,
14208,
13,
9945,
13,
27530,
13,
12683,
874,
1330,
1398,
62,
3866,
29190,
11,
662,
62,
15003,
198,
198,
25811,
13,
7... | 3.068966 | 87 |
import clodius.tiles.time_interval as hgti
import os.path as op
| [
11748,
537,
375,
3754,
13,
83,
2915,
13,
2435,
62,
3849,
2100,
355,
289,
13655,
72,
198,
11748,
28686,
13,
6978,
355,
1034,
628
] | 2.708333 | 24 |
# Generated by Django 2.1.11 on 2020-01-02 18:56
from django.db import migrations, models
import qatrack.qatrack_core.fields
| [
2,
2980,
515,
416,
37770,
362,
13,
16,
13,
1157,
319,
12131,
12,
486,
12,
2999,
1248,
25,
3980,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
198,
198,
11748,
10662,
265,
39638,
13,
80,
265,
39638,
62,
7295,
... | 2.782609 | 46 |
from pynput.keyboard import Key, Controller
import time
keyboard = Controller()
try:
while 1:
time.sleep(3)
keyboard.press(Key.alt)
keyboard.press(Key.f4)
except KeyboardInterrupt:
pass
| [
6738,
279,
2047,
1996,
13,
2539,
3526,
1330,
7383,
11,
22741,
198,
11748,
640,
198,
198,
2539,
3526,
796,
22741,
3419,
198,
28311,
25,
198,
220,
220,
220,
981,
352,
25,
198,
220,
220,
220,
220,
220,
220,
220,
640,
13,
42832,
7,
18... | 2.433333 | 90 |
from __future__ import absolute_import
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from future import standard_library
standard_library.install_aliases()
from celery import Celery
app = Celery("hysds")
app.config_from_object("celeryconfig")
if __name__ == "__main__":
app.start()
| [
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
198,
6738,
11593,
37443,
834,
1330,
7297,
198,
198,
6738,
2003,
1330,
3... | 3.358491 | 106 |
from .msisdn_header import *
| [
198,
6738,
764,
907,
9409,
77,
62,
25677,
1330,
1635,
198
] | 2.727273 | 11 |
from functools import wraps
from werkzeug.exceptions import BadRequest
from flask import request, jsonify
| [
6738,
1257,
310,
10141,
1330,
27521,
198,
6738,
266,
9587,
2736,
1018,
13,
1069,
11755,
1330,
7772,
18453,
198,
6738,
42903,
1330,
2581,
11,
33918,
1958,
628,
198
] | 3.857143 | 28 |
from functools import partial
from pathlib import Path
import librosa
import numpy as np
import soundfile as sf
import toml
import torch
from torch.nn import functional
from torch.utils.data import DataLoader
from tqdm import tqdm
from audio_zen.acoustics.feature import stft, istft
from audio_zen.utils import initialize_module, prepare_device, prepare_empty_dir
if __name__ == '__main__':
ipt = torch.rand(10, 1, 257, 100)
opt = BaseInferencer._unfold_along_time(ipt, 30)
print(opt.shape) | [
6738,
1257,
310,
10141,
1330,
13027,
198,
6738,
3108,
8019,
1330,
10644,
198,
198,
11748,
9195,
4951,
64,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
2128,
7753,
355,
264,
69,
198,
11748,
284,
4029,
198,
11748,
28034,
198,
6738,
280... | 3.02994 | 167 |
#!/usr/bin/env python
import rospy
import sys
import unittest
import threading
from turtlesim.msg import Pose
from geometry_msgs.msg import Twist
from skiros2_skill.ros.skill_layer_interface import SkillLayerInterface
PKG = 'integration_tests'
NAME = 'test_integration_tm'
## A sample python unit test
if __name__ == '__main__':
import rostest
rostest.rosrun(PKG, NAME, 'test_skiros2.SuiteTest', sys.argv)
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
11748,
686,
2777,
88,
198,
198,
11748,
25064,
198,
11748,
555,
715,
395,
198,
11748,
4704,
278,
198,
6738,
36288,
320,
13,
19662,
1330,
37557,
198,
6738,
22939,
62,
907,
14542,
13,
196... | 2.863946 | 147 |
from ocpmodels.preprocessing import AtomsToGraphs
from ocpmodels.datasets import SinglePointLmdbDataset, TrajectoryLmdbDataset
import ase.io
from ase.build import bulk
from ase.build import fcc100, add_adsorbate, molecule
from ase.constraints import FixAtoms
from ase.calculators.emt import EMT
from ase.optimize import BFGS
import matplotlib.pyplot as plt
import lmdb
import pickle
from tqdm import tqdm
import torch
import os
import glob
import re
import logging
import shutil
ADS_DL_LINK = "https://dl.fbaipublicfiles.com/opencatalystproject/data/per_adsorbate_is2res/"
if __name__ == '__main__':
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('--root_dir', type=str, default="adsorbate-data")
args = parser.parse_args()
process_adsorbates(args.root_dir)
| [
6738,
267,
66,
4426,
375,
1424,
13,
3866,
36948,
1330,
1629,
3150,
2514,
37065,
82,
198,
6738,
267,
66,
4426,
375,
1424,
13,
19608,
292,
1039,
1330,
14206,
12727,
43,
9132,
65,
27354,
292,
316,
11,
4759,
752,
652,
43,
9132,
65,
2735... | 2.722772 | 303 |
from .AAA3A_utils.cogsutils import CogsUtils # isort:skip
from redbot.core import commands # isort:skip
from redbot.core.i18n import Translator, cog_i18n # isort:skip
from redbot.core.bot import Red # isort:skip
import discord # isort:skip
import typing # isort:skip
from .helpers import embed_from_msg
from redbot.core.utils.tunnel import Tunnel
if CogsUtils().is_dpy2: # To remove
setattr(commands, 'Literal', typing.Literal)
# Credits:
# Thanks to TrustyJAID's Backup for starting the command to list the latest source channel messages! (https://github.com/TrustyJAID/Trusty-cogs/tree/master/backup)
# Thanks to QuoteTools from SimBad for the embed!
# Thanks to Speak from @epic guy for the webhooks! (https://github.com/npc203/npc-cogs/tree/main/speak)
# Thanks to Say from LaggronsDumb for the attachments in the single messages and webhooks! (https://github.com/laggron42/Laggrons-Dumb-Cogs/tree/v3/say)
# Thanks to CruxCraft on GitHub for the idea of allowing channels from other servers! (https://github.com/AAA3A-AAA3A/AAA3A-cogs/issues/1)
# Thanks to @epic guy on Discord for the basic syntax (command groups, commands) and also commands (await ctx.send, await ctx.author.send, await ctx.message.delete())!
# Thanks to the developers of the cogs I added features to as it taught me how to make a cog! (Chessgame by WildStriker, Captcha by Kreusada, Speak by Epic guy and Rommer by Dav)
# Thanks to all the people who helped me with some commands in the #coding channel of the redbot support server!
_ = Translator("TransferChannel", __file__)
@cog_i18n(_)
class TextChannelGuildConverter(discord.ext.commands.TextChannelConverter):
"""Similar to d.py's TextChannelConverter but only returns if we have already
passed our hierarchy checks and find in all guilds.
"""
class TransferChannel(commands.Cog):
"""A cog to transfer all messages channel in a other channel!"""
@commands.command(aliases=["channeltransfer"])
@commands.admin_or_permissions(manage_guild=True)
@commands.guild_only()
async def transferchannel(self, ctx: commands.Context, source: TextChannelGuildConverter, destination: TextChannelGuildConverter, limit: int, way: commands.Literal["embed", "webhook", "message"]):
"""
Transfer all messages channel in a other channel. This might take a long time.
You can specify the id of a channel from another server.
`source` is partial name or ID of the source channel
`destination` is partial name or ID of the destination channel
`way` is the used way
- `embed` Do you want to transfer the message as an embed?
- `webhook` Do you want to send the messages with webhooks (name and avatar of the original author)?
- `message`Do you want to transfer the message as a simple message?
"""
permissions = destination.permissions_for(destination.guild.me)
if way == "embed":
if not permissions.embed_links:
await ctx.send(_("I need to have all the following permissions for the {destination.name} channel ({destination.id}) in {destination.guild.name} ({destination.guild.id}).\n`embed_links`.").format(**locals()))
return
elif way == "webhook":
if not permissions.manage_guild:
await ctx.send(_("I need to have all the following permissions for the {destination.name} channel ({destination.id}) in {destination.guild.name} ({destination.guild.id}).\n`manage_channels`").format(**locals()))
return
count = 0
if self.cogsutils.is_dpy2:
msgList = [message async for message in source.history(limit=limit + 1, oldest_first=False)]
else:
msgList = await source.history(limit=limit + 1, oldest_first=False).flatten()
msgList.reverse()
for message in msgList:
if not message.id == ctx.message.id:
count += 1
files = await Tunnel.files_from_attatch(message)
if way == "embed":
em = embed_from_msg(message, self.cogsutils)
await destination.send(embed=em)
elif way == "webhook":
hook = await self.cogsutils.get_hook(destination)
await hook.send(
username=message.author.display_name,
avatar_url=message.author.display_avatar if self.cogsutils.is_dpy2 else message.author.avatar_url,
content=message.content,
files=files,
)
elif way == "message":
iso_format = message.created_at.isoformat()
msg1 = "\n".join(
[
_("**Author:** {message.author}({message.author.id}").format(**locals()),
_("**Channel:** <#{message.channel.id}>").format(**locals()),
_("**Time(UTC):** {isoformat}").format(**locals())
]
)
if len(msg1) + len(message.content) < 2000:
await ctx.send(msg1 + "\n\n" + message.content, files=files)
else:
await ctx.send(msg1)
await ctx.send(message.content, files=files)
await ctx.send(_("{count} messages transfered from {source.mention} to {destination.mention}").format(**locals())) | [
6738,
764,
29697,
18,
32,
62,
26791,
13,
66,
18463,
26791,
1330,
327,
18463,
18274,
4487,
220,
1303,
318,
419,
25,
48267,
201,
198,
6738,
2266,
13645,
13,
7295,
1330,
9729,
220,
1303,
318,
419,
25,
48267,
201,
198,
6738,
2266,
13645,
... | 2.327658 | 2,408 |
#!/usr/bin/env python3
#Import packages
from flask import *
#Import local packages
import dbHandler as db
#Start flask app
app = Flask(__name__)
#Default index page
@app.route('/')
#The town page, the game will automatically direct the page to your town when accesing this URL
@app.route('/login/')
#The town page, the game will automatically direct the page to your town when accesing this URL
@app.route('/town/')
@app.route('/group/')
@app.route('/g/<username>')
#Post requests
@app.route('/login/', methods=['POST'])
if __name__ == "__main__":
#Initailize the database
db.init("./database/")
#db.end()
app.run(debug=True, host="0.0.0.0")
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
2,
20939,
10392,
198,
6738,
42903,
1330,
1635,
198,
198,
2,
20939,
1957,
10392,
198,
11748,
20613,
25060,
355,
20613,
198,
198,
2,
10434,
42903,
598,
198,
1324,
796,
46947,
7,... | 2.794979 | 239 |
'''
Author: JIANG Yilun
Date: 2022-02-21 15:13:14
LastEditTime: 2022-02-21 15:16:30
LastEditors: JIANG Yilun
Description:
FilePath: /UGA_INF/INF101/TP/TP6/2.6.1.4_mirror.py
'''
import sys
import math
# Auto-generated code below aims at helping you parse
# the standard input according to the problem statement.
n = int(input()) # the number of temperatures to analyse
temp = []
for i in input().split():
# t: a temperature expressed as an integer ranging from -273 to 5526
t = int(i)
temp.append(t)
# Write an answer using print
# To debug: print("Debug messages...", file=sys.stderr, flush=True)
print(proche_zero(temp)) | [
7061,
6,
198,
13838,
25,
449,
40,
15567,
575,
346,
403,
198,
10430,
25,
33160,
12,
2999,
12,
2481,
1315,
25,
1485,
25,
1415,
198,
5956,
18378,
7575,
25,
33160,
12,
2999,
12,
2481,
1315,
25,
1433,
25,
1270,
198,
5956,
18378,
669,
2... | 2.79476 | 229 |
from django.contrib import admin
from django.urls import path
from leaderboard import views
from django.contrib.auth.views import LoginView #, LogoutView
urlpatterns = [
path('', views.main, name='main'),
path('leaderboard/', views.leaderboard_view, name='leaderboard'),
path('comments/', views.comments, name='comments'),
path('register/', views.reg, name='register'),
path('login/', LoginView.as_view(), name='login'),
path('logout/', views.LogoutFormView.as_view(), name='logout'),
]
| [
6738,
42625,
14208,
13,
3642,
822,
1330,
13169,
198,
6738,
42625,
14208,
13,
6371,
82,
1330,
3108,
198,
6738,
3554,
3526,
1330,
5009,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
13,
33571,
1330,
23093,
7680,
220,
1303,
11,
5972,
... | 3.132911 | 158 |
#!/usr/local/bin/python3
# noinspection PyShadowingBuiltins,PyUnusedLocal
def compute(val1, val2):
'''
Function returning the sum of two parameters.
Args:
val1 : Integer between 0 and 100.
val2 : Integer between 0 and 100.
Return:
Integer : Sum of val1 and val2.
'''
return val1 + val2;
if __name__ == '__main__':
# Tests.
print("1 + 3 = {}".format(sum(1,3)))
print("0 + 0 = {}".format(sum(0,0)))
| [
2,
48443,
14629,
14,
12001,
14,
8800,
14,
29412,
18,
198,
198,
2,
645,
1040,
14978,
9485,
27447,
278,
39582,
1040,
11,
20519,
3118,
1484,
14565,
198,
4299,
24061,
7,
2100,
16,
11,
1188,
17,
2599,
198,
220,
220,
220,
705,
7061,
198,
... | 2.362694 | 193 |
from routersploit import (
exploits,
print_error,
print_success,
print_info,
print_status,
http_request,
mute,
validators,
)
class Exploit(exploits.Exploit):
"""
Netwave IP Camera - Password Disclosure
"""
__info__ = {
'name': 'Netwave_IP_camera',
'description': 'This exploit will try to retrieve WPA password and ddns host name, '
'Also it would try to read memory leak in order to find username and password',
'authors': [
'renos stoikos <rstoikos[at]gmail.com>', # routesploit module
'spiritnull', # exploit-db.com exploit
],
'references': [
'https://www.exploit-db.com/exploits/41236/',
],
'devices': [
'Netwave IP Camera',
],
}
target = exploits.Option('', 'Target address e.g. http://192.168.1.1', validators=validators.url) # target address
port = exploits.Option(80, 'Target port', validators=validators.integer) # default port
@mute
| [
6738,
41144,
489,
30711,
1330,
357,
198,
220,
220,
220,
27062,
11,
198,
220,
220,
220,
3601,
62,
18224,
11,
198,
220,
220,
220,
3601,
62,
13138,
11,
198,
220,
220,
220,
3601,
62,
10951,
11,
198,
220,
220,
220,
3601,
62,
13376,
11,... | 2.312775 | 454 |
import json
from basic_class import *
# fp = open("../config/header_pure.txt", "r")
fp = open("../../config/header_pure.txt", "r")
header_list = []
while True:
line = fp.readline()
# print(line)
if line == "*":
break
elif line == "":
continue
else:
l = line.split()
if line[0] == 'h':
header = Header(l[1], int(l[2]), int(l[3]))
header_list.append(header)
elif line[0] == 'f':
field = Field(l[1], int(l[2]), int(l[3]))
header_list[-1].addField(field)
elif line[0] == 'n':
if int(l[2]) == 0:
continue
header_list[-1].next_header_type_internal_offset = int(l[1])
header_list[-1].next_header_type_length = int(l[2])
elif line[0] == 'm':
if l[2] == "0":
continue
next_header = NextHeader(l[1], l[2])
header_list[-1].addNextHeader(next_header)
json_data = {}
for header in header_list:
fields = header.fields
next_headers = header.next_headers
field_dict = {}
next_header_dict = {}
for field in fields:
field_dict[field.field_name] = {"field_name": field.field_name,
"field_length": field.field_length,
"field_internal_offset": field.field_internal_offset}
for next_header in next_headers:
next_header_dict[next_header.header_tag] = {"header_tag": next_header.header_tag,
"header_name": next_header.header_name}
json_data[header.header_name] = {"header_name": header.header_name,
"header_length": header.header_length,
"next_header_type_internal_offset": header.next_header_type_internal_offset,
"next_header_type_length": header.next_header_type_length,
"field_num": header.field_num,
"fields": field_dict,
"next_headers": next_header_dict}
filename = "../../config/header.json"
with open(filename, 'w') as file_obj:
json.dump(json_data, file_obj, indent=3)
# json_string = json.dumps(json_data, indent=3)
# print(json_string)
# print('Header: {}'.format(header.header_name))
# print('\theader length: {}'.format(header.header_length))
# print('\tfield num: {}'.format(header.field_num))
# if(header.next_header_type_length != 0):
# print('\tnext_header_type_internal_offset: {}'.format(header.next_header_type_internal_offset))
# print('\tnext_header_type_length: {}'.format(header.next_header_type_length))
# print('\tFields:')
# for field in header.fields:
# print('\t\t{} {} {}'.format(field.field_name, field.field_length, field.field_internal_offset))
# print('\tNext Headers:')
# for next_header in header.next_headers:
# print('\t\t{} {}'.format(next_header.header_tag, next_header.header_name))
| [
11748,
33918,
198,
6738,
4096,
62,
4871,
1330,
1635,
198,
198,
2,
277,
79,
796,
1280,
7203,
40720,
11250,
14,
25677,
62,
37424,
13,
14116,
1600,
366,
81,
4943,
198,
46428,
796,
1280,
7203,
40720,
40720,
11250,
14,
25677,
62,
37424,
13... | 2.02945 | 1,528 |
from RedNeuronal import RedNeuronal
import h5py
# direccion alvaro
# data = h5py.File(r"C:\Users\Lenovo\Downloads\modelado\practica_3\digitos.h5", "r")
# direccion dussan
data = h5py.File(r"C:\Users\Dussan\Desktop\digitos_con_signos.h5", "r")
X_train = data["X_train"][:]
y_train = data["y_train"][:]
X_test = data["X_test"][:]
y_test = data["y_test"][:]
r= RedNeuronal()
#Por cada valor
r.capa1 = 784
r.capa2 = 256
r.capa3 = 64
r.capa4 = 12
r.inicializar_parametros()
r.fit(X_train, y_train)
r.cargar("theta_digitos.h5")
# mostrar rrendimiento en consola
r.obtener_presicion(X_test, y_test)
r.obtener_matriz_confusion_por_valor(X_test, y_test) | [
6738,
2297,
8199,
333,
20996,
1330,
2297,
8199,
333,
20996,
198,
11748,
289,
20,
9078,
198,
198,
2,
19958,
535,
295,
435,
7785,
78,
198,
2,
1366,
796,
289,
20,
9078,
13,
8979,
7,
81,
1,
34,
7479,
14490,
59,
30659,
18768,
59,
10002... | 2.114007 | 307 |
"""
A class for the deep memory process. Deep memory is a flavor spawned by the techniques
displayed in Memorizing Transformers (https://arxiv.org/abs/2203.08913). However,
rather thqn saving each instance to an external memory bank, instead we search a
space of differential memory, and only train the topk instances
"""
from typing import Optional
import torch
from torch import nn
from Utility.Torch.Learnables import Layers
class DeepMemoryTransformer(nn.Module):
"""
Deep Memory is designed to allow efficient computation and collection
of facts gathered from a variety of sources with minimal overhead.
The input to the layer is, as is standard, the query. The key and
value, however, are generated internally from a stored bank of
parameters which are intended to change rapidly
TopK is used to limit the regions which may be active at a particular
time, providing some degree of binning
"""
def __init__(self,
query_width: int,
output_width: int,
memory_length: int,
heads: int,
topk: int,
):
"""
:param query_width: How wide the query embedding width is
:param output_width: How wide the output width will be
:param memory_length: How long the memory will be.
:param heads: The number of heads to make.
:param topk: The number of entities to keep per head.
"""
assert query_width % heads == 0
super().__init__()
head_width = query_width//heads
memory = torch.zeros([heads, memory_length, head_width], requires_grad=True)
memory = torch.nn.init.kaiming_uniform(memory, requires_grad=True)
self.memory = nn.Parameter(memory, requires_grad=True)
self.topk = topk
self.query_projector([query_width], [heads, head_width])
self.key_projector([head_width], [head_width], heads)
self.final_projector([heads, head_width], [output_width])
| [
37811,
198,
198,
32,
1398,
329,
262,
2769,
4088,
1429,
13,
10766,
4088,
318,
257,
9565,
29013,
416,
262,
7605,
198,
13812,
276,
287,
41157,
2890,
39185,
357,
5450,
1378,
283,
87,
452,
13,
2398,
14,
8937,
14,
17572,
18,
13,
49352,
14... | 2.77459 | 732 |
import sqlite3 as sqlite
import os.path
import atexit
import threading
class Litedao:
"""
It's recommended to use Dao by composition. Meaning: don't subclass it.
DAO: Data Access Object (this one is built to work with SQLite).
You give an SQL request with some params or not, it spills out the result nicely !
You can even get the list of tables or columns.
"""
def __init__(self, path, init_script=None, raise_exception=True,
raise_warning=True, connection_kwargs=None):
"""
- path: absolute path to database file
- init_script: a path to a file, a file-like object or a string of sql code
Example_a: "CREATE TABLE my_table(id INTEGER NOT NULL PRIMARY KEY);"
Example_b: "/path/to/script.sql"
- raise_exception: By default, True, so exceptions (sqlite.Error) will be raised
- raise_warning: By default, True, so exceptions (sqlite.Warning) will be raised
- connection_kwargs: connections arguments used while calling the
method "sqlite.connect()"
"""
self._path = os.path.normpath(path)
self._init_script = init_script
self._raise_exception = raise_exception
self._raise_warning = raise_warning
self._lock = threading.Lock()
use_init_script = False
self._con = None
self._is_new = False
if not os.path.isfile(path):
self._is_new = True
use_init_script = True
try:
connection_kwargs = {} if connection_kwargs is None else connection_kwargs
if "check_same_thread" in connection_kwargs:
del connection_kwargs["check_same_thread"]
self._con = sqlite.connect(path,
check_same_thread=False,
**connection_kwargs)
except sqlite.Error as e:
raise e
finally:
atexit.register(self.close)
if use_init_script and init_script:
self.script(init_script)
# ====================================
# PROPERTIES
# ====================================
@property
@property
def con(self):
"""
Connection object
"""
return self._con
@property
@property
def is_new(self):
"""
Returns True if the database has just been created, otherwise returns False
"""
return self._is_new
# ====================================
# PUBLIC METHODS
# ====================================
def test(self):
"""
Returns True if this is a legal database, otherwise returns False
"""
cache = self._raise_exception
self._raise_exception = True
legal = True
try:
self.tables()
except sqlite.Error as e:
legal = False
except sqlite.Warning as e:
legal = False
self._raise_exception = cache
return legal
def edit(self, sql, param=None):
"""
Use this method to edit your database.
Formally: Data Definition Language (DDL) and Data Manipulation Language (DML).
It returns True or False or raises sqlite.Error, sqlite.Warning
"""
with self._lock:
param = () if param is None else param
result = True
cur = None
try:
cur = self._con.cursor()
cur.execute(sql, param)
self._con.commit()
except sqlite.Error as e:
result = False
if self._raise_exception:
raise
except sqlite.Warning as e:
result = False
if self._raise_warning:
raise
finally:
if cur:
cur.close()
return result
def query(self, sql, param=None):
"""
Use this method to query your database.
Formally: Data Query Language (DQL)
It returns a tuple: (data, description).
Data is a list with data from ur query.
Description is a list with the name of columns related to data
Example: ( [1, "Jack", 50], ["id", "name", "age"] )
This method can raise sqlite.Error, sqlite.Warning
"""
with self._lock:
param = () if param is None else param
description = []
data = []
cur = None
try:
cur = self._con.cursor()
cur.execute(sql, param)
data = cur.fetchall()
description = cur.description
except sqlite.Error as e:
if self._raise_exception:
raise
except sqlite.Warning as e:
if self._raise_warning:
raise
finally:
if cur:
cur.close()
return [x[0] for x in description], data
def script(self, script):
"""
Executes the script as an sql-script. Meaning: there are multiple lines of sql.
This method returns nothing but could raise sqlite.Error, sqlite.Warning.
script could be a path to a file, a file-like object or just a string.
"""
with self._lock:
cur = None
try:
script = self._stringify_script(script)
cur = self._con.cursor()
cur.executescript(script)
except sqlite.Error as e:
if self._raise_exception:
raise
except sqlite.Warning as e:
if self._raise_warning:
raise
finally:
if cur:
cur.close()
def export(self):
"""
export the database: it returns a string of sql code.
This method can raise sqlite.Error, sqlite.Warning
"""
with self._lock:
result = ""
try:
"\n".join(self._con.iterdump())
except sqlite.Error as e:
if self._raise_exception:
raise
except sqlite.Warning as e:
if self._raise_warning:
raise
return result
def tables(self):
"""
Returns the list of tables names.
Example: ["table_1", "table_2"]
This method can raise sqlite.Error, sqlite.Warning
"""
with self._lock:
data = []
cur = None
try:
cur = self._con.cursor()
cur.execute("SELECT name FROM sqlite_master WHERE type='table' AND name NOT LIKE 'sqlite_%'")
data = cur.fetchall()
except sqlite.Error as e:
if self._raise_exception:
raise
except sqlite.Warning as e:
if self._raise_warning:
raise
finally:
if cur:
cur.close()
return [item[0] for item in data]
def columns(self, table):
"""
Returns the list of columns names of the given table name
A column is like:
(int_id, str_column_name, str_column_datatype, int_boolean_nullability,
default_value, int_primary_key)
Example:
[(0, "id", "INTEGER", 1, None, 1),
(1, "name", "TEXT", 0, None, 0),
(2, "age", "INTEGER", 1, None, 0)]
This method can raise sqlite.Error, sqlite.Warning
"""
with self._lock:
data = []
cur = None
try:
cur = self._con.cursor()
cur.execute("pragma table_info('{}')".format(table))
data = cur.fetchall()
except sqlite.Error as e:
if self._raise_exception:
raise
except sqlite.Warning as e:
if self._raise_warning:
raise
finally:
if cur:
cur.close()
return data
def close(self):
"""
Well, it closes the connection
"""
with self._lock:
if self._con:
try:
self._con.close()
except Exception:
pass
self._con = None
atexit.unregister(self.close)
def _stringify_script(self, script):
""" This method will:
- try to read the script: if the script is a file-like object,
the content (string) will be returned
- try to open the script: if the script is a path to a file,
the content (string) will be returned
- if the script is already a string, it will be returned as it,
- the script will be returned as it if failed to read/open
"""
# if script is a file-like object
try:
script = script.read()
except Exception as e:
pass
else:
return script
# if script is a path to a file
try:
with open(script, "r") as file:
script = file.read()
except Exception as e:
pass
else:
return script
return script
| [
11748,
44161,
578,
18,
355,
44161,
578,
198,
11748,
28686,
13,
6978,
198,
11748,
379,
37023,
198,
11748,
4704,
278,
628,
198,
4871,
406,
863,
5488,
25,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
632,
338,
7151,
284,
779,
360,
54... | 2.014249 | 4,702 |
## MODIFIED FROM _init_paths.py
import os
import sys
PATH_CURRENT = os.path.abspath(os.path.dirname(__file__))
# print(PATH_CURRENT)
# get parent dir: https://stackoverflow.com/questions/2860153/how-do-i-get-the-parent-directory-in-python
from pathlib import Path
PATH_PARENT = Path(PATH_CURRENT).parent
#PATH_PARENT = os.path.abspath(os.path.dirname(__file__)+os.path.sep+os.pardir) # THIS DOESN'T WORK IN SOME ENVIRONMENTS
#print(PATH_PARENT)
PATH_LIB = os.path.join(PATH_PARENT, 'lib')
#print(PATH_LIB)
add_path(PATH_LIB)
PATH_MM = os.path.join(PATH_PARENT, 'lib/poseeval/py-motmetrics')
add_path(PATH_MM)
#print(sys.path)
| [
2235,
19164,
28343,
16034,
4808,
15003,
62,
6978,
82,
13,
9078,
198,
11748,
28686,
198,
11748,
25064,
198,
198,
34219,
62,
34,
39237,
796,
28686,
13,
6978,
13,
397,
2777,
776,
7,
418,
13,
6978,
13,
15908,
3672,
7,
834,
7753,
834,
40... | 2.463035 | 257 |
import io
import os
import os.path
import sys
import unittest
from cmdstanpy import TMPDIR
from cmdstanpy.lib import Model, SamplerArgs, RunSet
from cmdstanpy.cmds import compile_model, sample, summary, diagnose
from cmdstanpy.cmds import get_drawset, save_csvfiles
datafiles_path = os.path.join('test', 'data')
# TODO: test compile with existing exe - timestamp on exe unchanged
# TODO: test overwrite with existing exe - timestamp on exe updated
if __name__ == '__main__':
unittest.main()
| [
11748,
33245,
198,
11748,
28686,
198,
11748,
28686,
13,
6978,
198,
11748,
25064,
198,
11748,
555,
715,
395,
198,
198,
6738,
23991,
14192,
9078,
1330,
21232,
5760,
4663,
198,
6738,
23991,
14192,
9078,
13,
8019,
1330,
9104,
11,
3409,
20053,... | 3.115152 | 165 |
from django.template.loader import get_template | [
6738,
42625,
14208,
13,
28243,
13,
29356,
1330,
651,
62,
28243
] | 4.272727 | 11 |
# This script will extract the important ride data from a .tcx
# file specified by the user. The code below will then extract
# the speed and power values at each time step. The data recording
# of the Garmin MUST be set to one data point per second, as the
# analysis assumes a time-step of 1 second.
import lxml.etree as ET
import os
from os import path
| [
2,
770,
4226,
481,
7925,
262,
1593,
6594,
1366,
422,
257,
764,
23047,
87,
198,
2,
2393,
7368,
416,
262,
2836,
13,
383,
2438,
2174,
481,
788,
7925,
198,
2,
262,
2866,
290,
1176,
3815,
379,
1123,
640,
2239,
13,
383,
1366,
8296,
198,... | 3.934066 | 91 |
"""
Package of lms page objects for acceptance tests
"""
import os
# Get the URL of the instance under test
HOSTNAME = os.environ.get('BOK_CHOY_HOSTNAME', 'localhost')
LMS_PORT = os.environ.get('BOK_CHOY_LMS_PORT', 8003)
BASE_URL = os.environ.get('test_url', f'http://{HOSTNAME}:{LMS_PORT}')
| [
37811,
198,
27813,
286,
300,
907,
2443,
5563,
329,
13427,
5254,
198,
37811,
628,
198,
11748,
28686,
198,
198,
2,
3497,
262,
10289,
286,
262,
4554,
739,
1332,
198,
39,
10892,
20608,
796,
28686,
13,
268,
2268,
13,
1136,
10786,
8202,
42,... | 2.587719 | 114 |
from django.contrib import admin
# Register your models here.
from ml.models import EECStats, EPStats, ETDStats
@admin.register(EECStats)
@admin.register(EPStats)
@admin.register(ETDStats)
| [
6738,
42625,
14208,
13,
3642,
822,
1330,
13169,
198,
198,
2,
17296,
534,
4981,
994,
13,
198,
6738,
25962,
13,
27530,
1330,
412,
2943,
29668,
11,
14724,
29668,
11,
12152,
35,
29668,
198,
198,
31,
28482,
13,
30238,
7,
36,
2943,
29668,
... | 2.855072 | 69 |
"""
Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the given sum.
Note: A leaf is a node with no children.
Example:
Given the below binary tree and sum = 22,
5
/ \
4 8
/ / \
11 13 4
/ \ \
7 2 1
return true, as there exist a root-to-leaf path 5->4->11->2 which sum is 22.
Solution:
1. dfs + recursion
2. bfs + stack
So we start from a stack which contains the root node and the corresponding remaining sum which is sum - root.val. Then we proceed to the iterations: pop the current node out of the stack and return True if the remaining sum is 0 and we're on the leaf node. If the remaining sum is not zero or we're not on the leaf yet then we push the child nodes and corresponding remaining sums into stack.
"""
# Definition for a binary tree node.
# class TreeNode:
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
# DFS + Recursion
# Time-O(N), where N is the number of nodes in the tree
# Space-worst O(N), best O(logN)
# Space complexity : in the worst case, the tree is completely unbalanced, e.g. each node has only one child node, the recursion call would occur NN times (the height of the tree), therefore the storage to keep the call stack would be \mathcal{O}(N)O(N). But in the best case (the tree is completely balanced), the height of the tree would be \log(N)log(N). Therefore, the space complexity in this case would be \mathcal{O}(\log(N))O(log(N)).
# BFS + Stack
# Use stack to store each node's condition, [node, remaining value], updating the remaining sum to cumulate at each visit.
# Time - O(N)
# Space - [O(logN), O(N)]
| [
37811,
198,
15056,
257,
13934,
5509,
290,
257,
2160,
11,
5004,
611,
262,
5509,
468,
257,
6808,
12,
1462,
12,
33201,
3108,
884,
326,
4375,
510,
477,
262,
3815,
1863,
262,
3108,
21767,
262,
1813,
2160,
13,
198,
198,
6425,
25,
317,
128... | 3.129264 | 557 |
'''Autogenerated by xml_generate script, do not edit!'''
from OpenGL import platform as _p, arrays
# Code generation uses this
from OpenGL.raw.GLX import _types as _cs
# End users want this...
from OpenGL.raw.GLX._types import *
from OpenGL.raw.GLX import _errors
from OpenGL.constant import Constant as _C
import ctypes
_EXTENSION_NAME = 'GLX_MESA_pixmap_colormap'
@_f
@_p.types(_cs.GLXPixmap,ctypes.POINTER(_cs.Display),ctypes.POINTER(_cs.XVisualInfo),_cs.Pixmap,_cs.Colormap)
| [
7061,
6,
16541,
519,
877,
515,
416,
35555,
62,
8612,
378,
4226,
11,
466,
407,
4370,
0,
7061,
6,
201,
198,
6738,
30672,
1330,
3859,
355,
4808,
79,
11,
26515,
201,
198,
2,
6127,
5270,
3544,
428,
201,
198,
6738,
30672,
13,
1831,
13,
... | 2.632979 | 188 |
import bisect
from collections import OrderedDict
from reprlib import recursive_repr as _recursive_repr
# import pandas as pd
# pd.set_option('mode.chained_assignment', 'raise')
from controllers.mpc_controller import MpcController
from controllers.controller_base import ControllerBase
from structdict import StructDict, struct_repr, named_struct_dict
from models.mld_model import MldSystemModel, MldModel, MldInfo
from utils.func_utils import ParNotSet
from utils.helper_funcs import is_all_None
from typing import MutableMapping, AnyStr
| [
11748,
47457,
478,
198,
6738,
17268,
1330,
14230,
1068,
35,
713,
198,
6738,
41575,
8019,
1330,
45115,
62,
260,
1050,
355,
4808,
8344,
30753,
62,
260,
1050,
198,
198,
2,
1330,
19798,
292,
355,
279,
67,
198,
2,
279,
67,
13,
2617,
62,
... | 3.37037 | 162 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import binascii
import time
import unittest
from unittest.mock import patch
from ontology.ont_sdk import OntologySdk
from ontology.smart_contract.neo_contract.abi.abi_function import AbiFunction
from ontology.smart_contract.neo_contract.abi.abi_info import AbiInfo
from ontology.wallet.wallet_manager import WalletManager
from pot.default_settings import (
GAS_LIMIT,
GAS_PRICE,
WALLET_PATH,
CONTRACT_ABI,
ONT_RPC_ADDRESS,
CONTRACT_ADDRESS_HEX
)
from pot.invoke_saving_pot import InvokeSavingPot
ontology = OntologySdk()
remote_rpc_address = 'http://polaris3.ont.io:20336'
ontology.set_rpc(remote_rpc_address)
wallet_manager = WalletManager()
wallet_manager.open_wallet(WALLET_PATH)
password = input('password: ')
gas_limit = 20000000
gas_price = 500
acct = wallet_manager.get_account('AKeDu9QW6hfAhwpvCwNNwkEQt1LkUQpBpW', password)
saving_pot = InvokeSavingPot(ontology, CONTRACT_ABI, CONTRACT_ADDRESS_HEX)
if __name__ == '__main__':
unittest.main()
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
11748,
9874,
292,
979,
72,
198,
11748,
640,
198,
11748,
555,
715,
395,
198,
6738,
555,
715,
395,
13,
76,
735,
1... | 2.535627 | 407 |
import os
from dotenv import load_dotenv
basedir = os.path.abspath(os.path.dirname(__file__))
load_dotenv(os.path.join(basedir, '.env'))
| [
11748,
28686,
198,
6738,
16605,
24330,
1330,
3440,
62,
26518,
24330,
198,
3106,
343,
796,
28686,
13,
6978,
13,
397,
2777,
776,
7,
418,
13,
6978,
13,
15908,
3672,
7,
834,
7753,
834,
4008,
198,
2220,
62,
26518,
24330,
7,
418,
13,
6978... | 2.555556 | 54 |
print(Solution().findNthDigit(194))
| [
198,
198,
4798,
7,
46344,
22446,
19796,
45,
400,
19511,
270,
7,
22913,
4008,
198
] | 2.533333 | 15 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = 'Benjamin Milde'
import requests
import json
import redis
import re
from timer import Timer
red = redis.StrictRedis()
#Todo: refactor. This has been mved to the relevant event generator
#Abstracts away the details of communicating with the ambient server
#Do most of the message passing with redis, now standard version | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
834,
9800,
834,
796,
705,
11696,
13337,
29087,
68,
6,
198,
198,
11748,
7007,
198,
11748,
33918,
198,
11748,
2266,
271,
... | 3.33913 | 115 |
# imports
import requests
import json
from bs4 import BeautifulSoup
from tqdm import tqdm
import random
from utilities import dict_from_json
#websites: (these are the websites with the same format as UK)
#does not work:
#'https://us.pandora.net/en/jewelry/?start={}&sz=36&format=page-element''
websites = ['https://cn.pandora.net/zh/jewellery/?start={}&sz=36&format=page-element',
'https://hk.pandora.net/en/jewellery/?start={}&sz=36&format=page-element',
'https://jp.pandora.net/ja/jewellery/?start={}&sz=36&format=page-element',
'https://hk.pandora.net/en/jewellery/?start={}&sz=36&format=page-element',
'https://nz.pandora.net/en/jewellery/?start={}&sz=36&format=page-element',
'https://sg.pandora.net/en/jewellery/?start={}&sz=36&format=page-element',
'https://dk.pandora.net/da/smykker/?start={}&sz=36&format=page-element',
'https://de.pandora.net/de/schmuck/?start={}&sz=36&format=page-element',
'https://fr.pandora.net/fr/bijoux/?start={}&sz=36&format=page-element',
'https://it.pandora.net/it/gioielli/?start={}&sz=36&format=page-element',
'https://uk.pandora.net/en/jewellery/?start={}&sz=36&format=page-element',
'https://nl.pandora.net/nl/sieraden/?start={}&sz=36&format=page-element',
'https://pl.pandora.net/pl/bizuteria/?start={}&sz=36&format=page-element',
'https://se.pandora.net/sv/smycken/?start={}&sz=36&format=page-element',
'https://at.pandora.net/de/schmuck/?start={}&sz=36&format=page-element',
'https://au.pandora.net/en/jewellery/?start={}&sz=36&format=page-element',
'https://au.pandora.net/en/jewellery/?start={}&sz=36&format=page-element']
headers = ['Mozilla/5.0 CK={} (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36',
'Mozilla/5.0 (iPad; CPU OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148']
if __name__ == "__main__":
new_catalog = create_catalog(save=True, websites=websites)
has_no_class = dict_from_json('id_not_in_masterfile.json')
for product in has_no_class:
if product in new_catalog.keys():
new_catalog.pop(product)
a_file = open("../catalog.json", "w")
json.dump(new_catalog, a_file)
a_file.close() | [
2,
17944,
198,
11748,
7007,
198,
11748,
33918,
198,
6738,
275,
82,
19,
1330,
23762,
50,
10486,
198,
6738,
256,
80,
36020,
1330,
256,
80,
36020,
198,
11748,
4738,
198,
6738,
20081,
1330,
8633,
62,
6738,
62,
17752,
628,
198,
2,
732,
1... | 2.129721 | 1,218 |
# -*- coding: utf-8 -*-
from __future__ import division #~ Domysle dzielenie int jako liczb float
# from igraph import * #~ Niepotrzebne
import random #~ Niepotrzebne
import matplotlib
# matplotlib.use('Agg')
import matplotlib.pyplot as plt #~ Do wykresow
from matplotlib import rc
import time #~ Niepotrzebne
import os.path #~ Do sprawdzania istnienia plikow
import numpy as np #~ Do operacjach na array
import cPickle as pickle
import json
from FilesManagment import CheckFolder, CompressData
from PIL import Image
#~ Funkcja bierze liste i odwraca tam gdzie sa mniejsze niz 0.5
#~ Funkcja bierze liste i przedloza ja zerami lub jedynkami do zadanej wielkosci
if __name__ == '__main__':
# skrypt do analizowania przejscia fazowego
rc('font', family='Arial') #Plotowanie polskich liter
#~ Definicje stalych symulacji
stg = {
# 'CONST_CLIQUE' : 3, #~ Wielkosc kliki
'CONST_VERTICES' : 1000, #~ Ilosc wezlow
'CONST_OVERRIDEN' : False, #~ Czy ma nadpisywac pliki podczas zapisywania wynikow
'CONST_DUMP' : True, # czy ma zrzucac wektory wynikow
# 'CONST_PATH_BASIC_FOLDER' : 'Wyniki_barabasi_lazy_fazowe',
'CONST_PATH_BASIC_FOLDER' : 'Wyniki_lazy_meanK',
'CONST_MEAN_k' : 22.0,
'CONST_PATH_WYK' : 'time_dla_er_lazy_fazowe_k8',
'CONST_FAZOWE' : False,
'CONST_START_MAGNETIZATION' : 0.5
}
analyze(stg)
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
6738,
11593,
37443,
834,
1330,
7297,
1303,
93,
9666,
893,
293,
288,
89,
8207,
268,
494,
493,
474,
25496,
3476,
14969,
12178,
198,
2,
422,
45329,
1470,
1330,
1635,
220,
... | 2.010695 | 748 |
# -------Global Variables---------
# Game board
board =["-","-","-",
"-","-","-",
"-","-","-",]
# If game is still going
game_still_going = True
# Who won? Or tie?
winner = None
# Whos turn is it
current_player = "X"
# Display board
# Play a game of tic tac toe
# Handle a single turn of an arbitrary player
play_game()
# board
# display board
# play game
# handle turn
# check win
# check rows
# check columns
# check diagonals
# check tie
# flip player
| [
2,
35656,
22289,
15965,
2977,
45537,
198,
198,
2,
3776,
3096,
198,
3526,
796,
14692,
12,
2430,
12,
2430,
12,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
27444,
2430,
12,
2430,
12,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
27... | 2.797753 | 178 |
# -*- coding: utf-8 -*-
"""
Created on Tue Jun 25 17:34:23 2019
@author: chalbeisen
This program is to download audios. The required arguments are set by the
powershell script "Run-audio_download.ps1".
"""
from LookingToListen_Audio_clean import Audio
import argparse
import sys
'''
------------------------------------------------------------------------------
desc: get parameters from script "Run-audio_download.ps1"
param:
argv: arguments from script "Run-audio_download.ps1"
return: parsed arguments
------------------------------------------------------------------------------
'''
'''
------------------------------------------------------------------------------
desc: run audio download
param:
argv: arguments from script "Run-audio_download.ps1"
return: -
------------------------------------------------------------------------------
'''
if __name__== "__main__":
main(parse_arguments(sys.argv[1:])) | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
201,
198,
37811,
201,
198,
41972,
319,
30030,
7653,
1679,
1596,
25,
2682,
25,
1954,
13130,
201,
198,
201,
198,
31,
9800,
25,
442,
282,
1350,
13254,
201,
198,
201,
198,
1212... | 3.439446 | 289 |
import numpy as np
import matplotlib.pyplot as plt
import torch
import random
device = 'cuda' if torch.cuda.is_available() else 'cpu'
from scipy.ndimage import gaussian_filter
import sys
from tqdm import tqdm
from functools import partial
import acd
from copy import deepcopy
sys.path.append('../..')
sys.path.append('../../..')
from transforms_torch import bandpass_filter
# plt.style.use('dark_background')
sys.path.append('../../../dsets/mnist')
import dset
from model import Net, Net2c
from util import *
from numpy.fft import *
from torch import nn
from style import *
from captum.attr import (
InputXGradient,
Saliency,
GradientShap,
DeepLift,
DeepLiftShap,
IntegratedGradients,
LayerConductance,
NeuronConductance,
NoiseTunnel,
)
import pickle as pkl
from torchvision import datasets, transforms
from sklearn.decomposition import NMF
import transform_wrappers
import visualize as viz
from model import Net, Net2c
torch.manual_seed(42)
np.random.seed(42)
from acd_wooseok.acd.scores import cd
from acd_wooseok.acd.util import tiling_2d
from acd_wooseok.acd.scores import score_funcs
from torchvision import datasets, transforms
# import modules
from funcs import *
from matfac import *
sys.path.append('../../../..')
from hierarchical_dnn_interpretations.acd.scores import cd as acd
# load args
args = dset.get_args()
args.batch_size = int(args.batch_size/2) # half the batchsize
args.epochs = 50
args.cuda = not args.no_cuda and torch.cuda.is_available()
# load mnist dataloader
train_loader, test_loader = dset.load_data_with_indices(args.batch_size, args.test_batch_size, device)
# dataset
X = train_loader.dataset.data.numpy().astype(np.float32)
X = X.reshape(X.shape[0], -1)
X /= 255
Y = train_loader.dataset.targets.numpy()
X_test = test_loader.dataset.data.numpy().astype(np.float32)
X_test = X_test.reshape(X_test.shape[0], -1)
X_test /= 255
Y_test = test_loader.dataset.targets.numpy()
# load NMF object
# run NMF
# nmf = NMF(n_components=30, max_iter=1000)
# nmf.fit(X)
# pkl.dump(nmf, open('./results/nmf_30.pkl', 'wb'))
nmf = pkl.load(open('../results/nmf_30.pkl', 'rb'))
D = nmf.components_
# nmf transform
W = nmf.transform(X)
W_test = nmf.transform(X_test)
# store results
list_of_results = {
'acd': [],
'cd': []
}
for n_iter in range(nmf.n_components):
dict_indx = n_iter
model = Net2c().to(device)
model.load_state_dict(torch.load('../models/nmf/net2c_{}.pth'.format(dict_indx), map_location=device))
model = model.eval()
# knockout first dictionary and redefine train and test dataset
indx = np.argwhere(W[:,dict_indx] > 0).flatten()
indx_t = np.argwhere(W_test[:,dict_indx] > 0).flatten()
# subset dataloader
train_loader, test_loader = dset.load_data_with_indices(args.batch_size,
args.test_batch_size,
device,
subset_index=[indx, indx_t])
# nmf transform layers
nmf_transformer = transform_wrappers.TransformLayers(D).to(device)
# convert nmf weight to tensor
W_test_t = torch.Tensor(W_test).to(device)
sweep_dim = 1
tiles = torch.Tensor(tiling_2d.gen_tiles(W_test[0:1], fill=0, method='cd', sweep_dim=sweep_dim)).to(device)
# store results
results = {
'acd': [],
'cd': []
}
for batch_indx, (data, target, data_indx) in enumerate(test_loader):
# loop over nmf basis
scores_acd = []
scores_cd = []
for basis_indx in range(nmf.n_components):
im_parts = nmf_transformer(W_test_t[data_indx]*tiles[basis_indx])
scores_acd.append(acd.cd(data, model, mask=None, model_type=None, device='cuda', transform=None,
relevant=im_parts)[0].data.cpu().numpy()[:,0])
scores_cd.append(cd.cd(data, model, mask=None, model_type=None, device='cuda', transform=None,
relevant=im_parts)[0].data.cpu().numpy()[:,0])
print('\r iter, batch index: {}, {} [component index: {}]'.format(n_iter, batch_indx, basis_indx), end='')
scores_acd = np.vstack(scores_acd).T
scores_cd = np.vstack(scores_cd).T
results['acd'].append(scores_acd)
results['cd'].append(scores_cd)
list_of_results['acd'].append(np.vstack(results['acd']))
list_of_results['cd'].append(np.vstack(results['cd']))
pkl.dump(list_of_results, open('../results/cd_nmf.pkl', 'wb'))
| [
11748,
299,
32152,
355,
45941,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
11748,
28034,
198,
11748,
4738,
198,
25202,
796,
705,
66,
15339,
6,
611,
28034,
13,
66,
15339,
13,
271,
62,
15182,
3419,
2073,
705,
3616... | 2.25259 | 2,027 |
import json
from django.test import TestCase
from django.urls import reverse
from rest_framework.test import APIClient
from .constants import TEST_EMAIL
from .constants import TEST_FIRSTNAME
from .constants import TEST_LASTNAME
| [
11748,
33918,
198,
198,
6738,
42625,
14208,
13,
9288,
1330,
6208,
20448,
198,
6738,
42625,
14208,
13,
6371,
82,
1330,
9575,
198,
6738,
1334,
62,
30604,
13,
9288,
1330,
3486,
2149,
75,
1153,
198,
198,
6738,
764,
9979,
1187,
1330,
43001,
... | 3.447761 | 67 |
import json
import random
import string
from asyncio import TimeoutError
from datetime import datetime as dt
from io import BytesIO
from time import time
import discord
from PyDictionary import PyDictionary as dictionary
from discord.ext import commands, flags
from humanize import naturaltime as nt
from jikanpy import AioJikan
from sr_api import Client
from CyberTron5000.utils import (
paginator,
cyberformat
)
from CyberTron5000.utils.lists import (
INDICATOR_LETTERS,
ANIMALS,
EMOTIONS
)
class Fun(commands.Cog):
"""Fun commands"""
@commands.command()
async def horror(self, ctx, limit: int = 5):
"""spoopy"""
posts = []
async with self.bot.session.get(f"https://www.reddit.com/r/twosentencehorror/hot.json") as r:
res = await r.json()
for i in res['data']['children']:
posts.append(i['data'])
counter = 0
embeds = []
async with ctx.typing():
for s in random.sample(posts, len(posts)):
text = cyberformat.shorten(f"{s['title']}\n{s['selftext']}")
embeds.append(discord.Embed(description=text[:2000], colour=self.bot.colour))
counter += 1
if counter == limit:
break
else:
continue
p = paginator.CatchAllMenu(paginator.EmbedSource(embeds))
await p.start(ctx)
@commands.command()
async def pfpcycle(self, ctx):
"""if you're reading this it probably isnt your business"""
pfps = ['http://tinyurl.com/y8ccnxm3',
'https://images-ext-1.discordapp.net/external/6HjseNKji1C5wbK9Wb_jnIluzFWrCRW6xqhfboNtDDI/%3Fsize%3D1024/https/cdn.discordapp.com/avatars/350349365937700864/bbbff13a570231108b7afa383416b62a.png',
'http://tinyurl.com/ycjuvusq',
'https://cdn.discordapp.com/avatars/350349365937700864/f38bc11cf4360a9267a55962fcd71809.png?size=1024',
'https://media.discordapp.net/attachments/381963689470984203/732283634190516304/coolweavile.png?width=962&height=962',
'https://images-ext-1.discordapp.net/external/XVtT9nLyPYTWfNw4GSjvRMKibuKafi6_VCyVwSfW4C8/%3Fsize%3D1024/https/cdn.discordapp.com/avatars/350349365937700864/d027959b2a204f7587092a7a249e7377.png?width=962&height=962',
'https://media.discordapp.net/attachments/735325249138065468/735681377785348156/image0.png',
'https://media.discordapp.net/attachments/735325249138065468/735681378292596736/image1.png',
'https://media.discordapp.net/attachments/735325249138065468/735681378867478528/image2.png',
'https://media.discordapp.net/attachments/735325249138065468/735681379387441152/image3.png',
'https://media.discordapp.net/attachments/735325249138065468/735682125239681074/image0.png'
'http://i.some-random-api.ml/pokemon/weavile.png']
embeds = [discord.Embed(colour=self.bot.colour).set_image(url=p) for p in pfps]
a = paginator.CatchAllMenu(paginator.EmbedSource(embeds))
await a.start(ctx)
@commands.group(invoke_without_command=True, help="Replies with what you said and deletes your message.",
aliases=['say'])
@reply.command(invoke_without_command=True,
help="Replies with what you said and deletes your message, but in an embed.")
@reply.command(invoke_without_command=True,
help="Replies with what you said and deletes your message, but in a different channel.")
@reply.command(invoke_without_command=True, help="Replies with what you said and deletes your message, but UwU.")
@reply.command(help="🅱", invoke_without_command=True)
@reply.command(aliases=['msg'], help="Message a user something. ", invoke_without_command=True)
@reply.command(help="Spams a message.", invoke_without_command=True)
@reply.command(invoke_without_command=True, aliases=['emoji', 'em'])
async def indicator(self, ctx, *, message):
"""reply in emojis"""
msg = ''
letters = list(string.ascii_lowercase)
for x in message:
if x in letters:
msg += f':regional_indicator_{x}:'
else:
msg += INDICATOR_LETTERS.get(x, x)
await ctx.send('\u200b' + msg)
@reply.command()
async def mock(self, ctx, *, message):
"""Like that spongebob meme"""
await ctx.send(cyberformat.better_random_char(message))
@commands.command(help="Asks the mystical Ouija Board a question...")
@commands.command(aliases=['cf'], help="Flips a coin.")
@commands.command(help="How bigbrain are you? Find out.")
@commands.command(help="Ask the Bot about your peers")
@commands.group(invoke_without_command=True, aliases=["em"],
help="do an emoji from a different server that cybertron is in.")
@emoji.command()
@commands.command(aliases=['gt'])
async def greentext(self, ctx):
"""Write a greentext story"""
story = []
await ctx.send(
f"Greentext story starting! Type `{ctx.prefix}quit`, `{ctx.prefix}exit`, or `{ctx.prefix}finish` to see your final story!")
while True:
try:
msg = await self.bot.wait_for('message', timeout=300, check=lambda x: x.author == ctx.author)
if msg.content in (f'{ctx.prefix}quit', f'{ctx.prefix}exit', f'{ctx.prefix}finish'):
break
story.append(msg.content.replace('```', '\u200b'))
await msg.add_reaction(ctx.tick())
except TimeoutError:
break
story = '\n'.join([f'>{line}' for line in story])
return await ctx.send(embed=discord.Embed(colour=discord.Color.green(),
description=f"**{ctx.author}**'s story```css\n{story}\n```"))
@commands.command(aliases=['bin'])
async def binary(self, ctx, *, message):
"""Convert text to binary."""
binary = await self.sr.encode_binary(message)
await ctx.send(f"```py\n{binary}```")
@commands.command(aliases=['fb', 'from-bin'])
async def from_binary(self, ctx, *, binary):
"""Convert text from binary."""
binary = await self.sr.decode_binary(binary)
await ctx.send(binary)
@commands.command()
async def owner(self, ctx):
"""Shows you who made this bot"""
return await ctx.send(f"it is {self.bot.owner}")
@commands.command()
@commands.command(aliases=['choice'])
@commands.group(invoke_without_command=True)
async def todo(self, ctx):
"""Shows your current todo list"""
items = []
results = sorted((await self.get_all_todo(ctx.author.id)), key=lambda x: x['time'])
for each in results:
time = dt.utcfromtimestamp(each['time'])
since = nt(dt.utcnow() - time)
if each['description']:
desc_em = "❔"
else:
desc_em = ""
items.append(f"[{each['todo']}]({each['message_url']}) (ID: {each['id']} | Created {since}) {desc_em}")
source = paginator.IndexedListSource(data=items, embed=discord.Embed(colour=self.bot.colour),
title="Items (`❔` indicates that the todo has a description)", per_page=5)
menu = paginator.CatchAllMenu(source=source)
menu.add_info_fields({"❔": "Indicates that the todo has a description"})
await menu.start(ctx)
@todo.command()
async def add(self, ctx, *, todo):
"""Adds an item to your todo list"""
if len(todo) > 50:
return await ctx.send("Your todo is too long. Please be more consice.")
id = random.randint(1, 99999)
await self.bot.db.execute(
"INSERT INTO todo (todo, id, time, message_url, user_id) VALUES ($1, $2, $3, $4, $5)", todo, id, time(),
str(ctx.message.jump_url), ctx.author.id)
await ctx.send(f"{ctx.tick()} Inserted `{todo}` into your todo list! (ID: `{id}`)")
@todo.command(aliases=['rm', 'remove'])
async def resolve(self, ctx, *id: int):
"""Resolves an item from your todo list"""
items = await self.get_all_todo(ctx.author.id)
todos = [item[0] for item in items]
ids = [item[1] for item in items]
if any(item not in ids for item in id):
return await ctx.send("You passed in invalid id's!")
message = []
for i in id:
message.append(f"• {todos[ids.index(i)]}")
await self.bot.db.execute("DELETE FROM todo WHERE user_id = $1 AND id = $2", ctx.author.id, i)
await ctx.send(
f"{ctx.tick()} Deleted **{len(id)}** items from your todo list:\n" + "\n".join(message))
@todo.command()
async def list(self, ctx):
"""Shows your todo list"""
command = self.bot.get_command('todo')
await ctx.invoke(command)
@todo.command()
async def clear(self, ctx):
"""Clears all of your todos"""
num = len((await self.bot.db.fetch("SELECT * FROM todo WHERE user_id = $1", ctx.author.id)))
await self.bot.db.execute("DELETE FROM todo WHERE user_id = $1", ctx.author.id)
await ctx.send(f"{ctx.tick()} Deleted **{num}** items from your todo list!")
@todo.command(aliases=['show'])
async def info(self, ctx, id: int):
"""Shows you info on a todo"""
results = await self.bot.db.fetch("SELECT * FROM todo WHERE id = $1", id)
if not results:
raise commands.BadArgument(f'{id} is not a valid todo!')
results = results[0]
embed = discord.Embed(colour=self.bot.colour)
embed.title = f"{results['todo']} » `{results['id']}`"
time = dt.utcfromtimestamp(results['time'])
since = nt(dt.utcnow() - time)
embed.description = f'{results["description"] or ""}\n'
embed.description += f"<:clock:738186842343735387> **{since}**\n"
embed.description += f"**{time.strftime('%A %B %d, %Y at %I:%M %p')}**"
await ctx.send(embed=embed)
@todo.command(aliases=['add_desc', 'ad'])
async def describe(self, ctx, id: int, *, description):
"""Add a description for your todo"""
results = await self.bot.db.fetch("SELECT * FROM todo WHERE id = $1", id)
if not results:
raise commands.BadArgument(f'{id} is not a valid todo!')
if len(description) > 250:
return await ctx.send("That description is too long!")
await self.bot.db.execute("UPDATE todo SET description = $1 WHERE id = $2", description, id)
await ctx.send(
f"{ctx.tick()} Set todo description for `{id}` ({results[0]['todo']}) to `{description}`")
@flags.add_flag("--limit", type=int, default=500)
@flags.add_flag("--channel", type=discord.TextChannel)
@flags.command()
async def snipe(self, ctx, **flags):
"""Shows the most recently deleted messages in a given channel"""
# i know i shouldnt be using json for this
channel = flags.get('channel') or ctx.channel
with open('./json_files/snipes.json', 'r') as f:
snipes = json.load(f)
try:
channel_snipes = snipes[str(channel.id)]
except KeyError:
return await ctx.send(f"{channel} has no deleted messages.")
embeds = []
for snipe in reversed(channel_snipes[:flags.get('limit')]):
try:
author = self.bot.get_user(int(snipe['author'])) or await self.bot.fetch_user(int(snipe['author'])
img = author.avatar_url
except:
author = "Unknown User"
img = "https://media.discordapp.net/attachments/740678305237303454/866900622271971348/avvy.png"
embed = discord.Embed(colour=self.bot.colour)
desc = snipe['content']
if not desc and snipe.get('embed'):
desc = '`<Embedded Message>`'
embed.description = desc
since = dt.strptime(snipe['created_at'], '%Y-%m-%d %H:%M:%S.%f')
embed.set_author(name=f"{author} said in {str(channel)}", icon_url=img)
embed.timestamp = since
embeds.append(embed)
source = paginator.EmbedSource(embeds, footer=False)
await paginator.CatchAllMenu(source).start(ctx)
@commands.command(aliases=['af'])
async def animalfact(self, ctx, animal=None):
"""Shows a fact about an animal of your choice."""
if not animal:
return await ctx.send(
f"**Valid Animal Choices:**\ncat, dog, koala, fox, bird, elephant, panda, racoon, kangaroo, giraffe, whale")
try:
animal = str(animal).lower().replace(' ', '_')
em = ANIMALS.get(animal)
fact = await self.sr.get_fact(animal)
await ctx.send(f"{em} **Random {animal.replace('_', ' ').title()} Fact:**\n{fact}")
except Exception as error:
return await ctx.send(error)
async def get_attachement(self, image_url: str, ext='png') -> discord.File:
"""Gives you a valid image attachment of any url"""
async with self.bot.session.get(image_url) as r:
data = await r.read()
image = BytesIO(data)
return discord.File(image, filename=f'image.{ext}')
@commands.command()
async def inspiration(self, ctx):
"""Get inspired"""
async with self.bot.session.get('https://inspirobot.me/api?generate=true') as r:
data = await r.text()
file = await self.get_attachement(data)
await ctx.send(content=f"**Inspiration**", file=file)
@commands.command(aliases=['aimg'])
async def animalimg(self, ctx, *, animal=None):
"""Shows an image of an animal of your choice."""
if not animal:
return await ctx.send(
f"**Valid Animal Choices:**\ncat, dog, koala, fox, birb, red panda, panda, racoon, kangaroo")
try:
async with ctx.typing():
animal = str(animal).lower().replace(' ', '_')
image = await self.sr.get_image(animal)
file = await self.get_attachement(image.url)
await ctx.send(f"{ANIMALS.get(animal, '')} **Random {animal.replace('_', ' ').title()} Image:**",
file=file)
except Exception as error:
return await ctx.send(error)
@commands.command()
@commands.command()
@commands.command()
@commands.command()
@commands.command()
async def dog(self, ctx):
"""Shows you an image of a dog."""
async with self.bot.session.get('https://dog.ceo/api/breeds/image/random') as r, ctx.typing():
data = await r.json()
file = await self.get_attachement(data['message'])
await ctx.send(f"{ANIMALS.get('dog')} **Random Dog Image**", file=file)
@commands.group(aliases=['dictionary'], invoke_without_command=True)
async def word(self, ctx, *, word):
"""Fetch a word's definition"""
# thanks to deviljamjar for this idea
# find the original here: https://github.com/DevilJamJar/DevilBot/blob/master/cogs/utility.py/#L48-#L65
async with ctx.typing():
try:
ret = await self.bot.loop.run_in_executor(None, self._dictionary.meaning, word)
except Exception as error:
raise error
embed = discord.Embed(colour=self.bot.colour, title=word.lower())
if not ret:
raise commands.BadArgument("this word was not found in the dictionary!")
embed.description = self.format_meanings(ret)
await ctx.send(embed=embed)
@word.command(aliases=['syn'])
async def synonyms(self, ctx, *, word):
"""Shows you the synonyms of a word."""
async with ctx.typing():
try:
ret = await self.bot.loop.run_in_executor(None, self._dictionary.synonym, word)
except Exception as error:
raise error
embed = discord.Embed(colour=self.bot.colour, title=word.lower())
embed.description = ', '.join(ret)
await ctx.send(embed=embed)
@word.command(aliases=['ant'])
async def antonyms(self, ctx, *, word):
"""Shows you the antonyms of a word."""
async with ctx.typing():
try:
ret = await self.bot.loop.run_in_executor(None, self._dictionary.antonym, word)
except Exception as error:
raise error
embed = discord.Embed(colour=self.bot.colour, title=word.lower())
embed.description = ', '.join(ret)
await ctx.send(embed=embed)
@word.command()
async def many(self, ctx, *words):
"""Get information on many words"""
command = self.bot.get_command('words')
await ctx.invoke(command, *words)
@commands.command()
async def words(self, ctx, *words):
"""Get information on many words"""
async with ctx.typing():
_dict = dictionary(*words)
try:
ret = await self.bot.loop.run_in_executor(None, _dict.getMeanings)
except Exception as error:
raise error
embed = discord.Embed(colour=self.bot.colour)
embed.title = "Words"
not_found = list()
for word in words:
meanings = ret.get(word)
if not meanings:
not_found.append(word)
continue
embed.add_field(name=word.lower(), value=self.format_meanings(meanings))
if not_found:
embed.set_footer(text=', '.join(not_found) + " were not found.")
try:
await ctx.send(embed=embed)
except discord.HTTPException:
return await ctx.send("You passed in too many words!")
@commands.command()
async def ship(self, ctx, member_1: discord.Member, member_2: discord.Member):
"""Ship 2 members"""
from random import randint
rate = randint(1, 100)
await ctx.send(f"""**{member_1}** | <a:hug:748315930685210746> {rate}% :heart: | **{member_2}**""")
def setup(bot):
bot.add_cog(Fun(bot))
| [
11748,
33918,
198,
11748,
4738,
198,
11748,
4731,
198,
6738,
30351,
952,
1330,
3862,
448,
12331,
198,
6738,
4818,
8079,
1330,
4818,
8079,
355,
288,
83,
198,
6738,
33245,
1330,
2750,
4879,
9399,
198,
6738,
640,
1330,
640,
198,
198,
11748... | 2.164535 | 8,521 |
from point import Point | [
6738,
966,
1330,
6252
] | 5.75 | 4 |
# -*- coding: utf-8 -*-
"""
Script Name:
Author: Do Trinh/Jimmy - 3D artist.
Description:
"""
# -------------------------------------------------------------------------------------------------------------
""" Import """
from pyPLM.damg import DAMGDICT
# -------------------------------------------------------------------------------------------------------------
# Created by Trinh Do on 5/6/2020 - 3:13 AM
# © 2017 - 2020 DAMGteam. All rights reserved
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
198,
7391,
6530,
25,
220,
198,
13838,
25,
2141,
33822,
71,
14,
40335,
532,
513,
35,
6802,
13,
198,
198,
11828,
25,
628,
198,
37811,
198,
2,
16529,
3880,
... | 4.524272 | 103 |
from poker_ai.poker.dealer import Dealer
from poker_ai.poker.card import Card
| [
6738,
27101,
62,
1872,
13,
79,
11020,
13,
31769,
263,
1330,
44480,
198,
6738,
27101,
62,
1872,
13,
79,
11020,
13,
9517,
1330,
5172,
628
] | 3.16 | 25 |
import pygame
import sys
import os
import csv
import random
from pygame import *
from minigame1.Player import *
from minigame1.Mobs import *
from minigame1.Camera import *
from minigame1.KeyBlock import *
from minigame1.PilarBlock import *
from minigame1.Text import *
from minigame1.HighScore import *
from pprint import pprint
| [
11748,
12972,
6057,
198,
11748,
25064,
198,
11748,
28686,
198,
11748,
269,
21370,
198,
11748,
4738,
198,
6738,
12972,
6057,
1330,
1635,
198,
6738,
949,
328,
480,
16,
13,
14140,
1330,
1635,
198,
6738,
949,
328,
480,
16,
13,
44,
8158,
1... | 2.973684 | 114 |
# Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above
# copyright notice, this list of conditions and the following
# disclaimer.
# 2. 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.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER "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 HOLDER 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 blinkpy.common.host_mock import MockHost
from blinkpy.common.path_finder import RELATIVE_WEB_TESTS
from blinkpy.common.system.executive_mock import MockExecutive, ScriptError
from blinkpy.common.system.filesystem_mock import MockFileSystem
from blinkpy.common.system.log_testing import LoggingTestCase
from blinkpy.w3c.test_copier import TestCopier
MOCK_WEB_TESTS = '/mock-checkout/' + RELATIVE_WEB_TESTS
FAKE_SOURCE_REPO_DIR = '/blink'
FAKE_FILES = {
MOCK_WEB_TESTS + 'external/OWNERS': '',
'/blink/w3c/dir/has_shebang.txt': '#!',
'/blink/w3c/dir/README.txt': '',
'/blink/w3c/dir/OWNERS': '',
'/blink/w3c/dir/reftest.list': '',
MOCK_WEB_TESTS + 'external/README.txt': '',
MOCK_WEB_TESTS + 'W3CImportExpectations': '',
}
| [
2,
15069,
357,
34,
8,
2211,
21771,
11998,
3457,
40132,
13,
1439,
2489,
10395,
13,
198,
2,
198,
2,
2297,
396,
3890,
290,
779,
287,
2723,
290,
13934,
5107,
11,
351,
393,
1231,
198,
2,
17613,
11,
389,
10431,
2810,
326,
262,
1708,
340... | 2.952045 | 709 |
# -*- coding: utf-8 -*-
"""
paperchase.manage.journals
~~~~~~~~~~~~~~~~~~~~~
jorunals management commands
"""
import datetime
from flask.ext.script import Command, prompt, prompt_pass
from werkzeug.datastructures import MultiDict
from ..services import users | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
220,
220,
220,
3348,
354,
589,
13,
805,
496,
13,
73,
18408,
198,
220,
220,
220,
220,
27156,
8728,
93,
628,
220,
220,
220,
474,
273,
403,
874,
4542,
9729,... | 3.033333 | 90 |
"""Top-level package for simple-otp."""
__author__ = """Kshitij Nagvekar"""
__email__ = 'kshitij.nagvekar@workindia.in'
__version__ = '0.1.0'
try:
from secrets import SystemRandom
except ImportError:
from random import SystemRandom
from typing import Sequence
from .otp import OTP
random = SystemRandom()
def generate_secret(
length: int = 16,
chars: Sequence[str] = None
) -> str:
"""
Generates a secret which can be used as secret key
:param length: key length
:param chars: list of characters to be used to generate secret key
:return: secret key string
"""
if chars is None:
chars = list('ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890')
return ''.join(
random.choice(chars)
for _ in range(length)
)
__all__ = ["generate_secret", "OTP"]
| [
37811,
9126,
12,
5715,
5301,
329,
2829,
12,
313,
79,
526,
15931,
198,
198,
834,
9800,
834,
796,
37227,
42,
16211,
2926,
15196,
303,
21070,
37811,
198,
834,
12888,
834,
796,
705,
591,
17945,
2926,
13,
77,
363,
303,
21070,
31,
1818,
5... | 2.669935 | 306 |
import matplotlib.pyplot as plt
import numpy as np
import os
import pandas as pd
# Find path for cases
curr_dir_path = os.path.dirname(os.path.realpath(__file__))
# print(curr_dir_path)
# cases = os.listdir(curr_dir_path + '/Cases')
# pop = cases.index('baseCase')
# cases.pop(pop)
# Label graph with bold characters
font_axis_publish = {
'color': 'black',
'weight': 'bold',
'size': 22,
}
# Read in digitized data
digi_n = pd.read_csv(
curr_dir_path + '/n_nstar_radius.dat',
header = 0,
sep = '\t',
names = ['r', 'n_nstar']
)
digi_T = pd.read_csv(
curr_dir_path + '/T_Tstar_radius.dat',
header = 0,
sep = '\t',
names = ['r', 'T_Tstar']
)
sim = pd.read_csv(
curr_dir_path + '/postProcessing/sampleDict/0.3/horizontalLine_Ttra_Ar_rhoN_Ar.csv'
)
print(sim['Ttra_Ar'])
sim = sim[['distance', 'rhoN_Ar', 'Ttra_Ar']].dropna()
sim['rhoN_Ar'] = sim['rhoN_Ar'] / 6.02e20
sim['Ttra_Ar'] = sim['Ttra_Ar'] / 800.0
plt.title('DSMC vs DAC', fontdict = font_axis_publish)
plt.ylabel('n/n*', fontdict = font_axis_publish)
plt.xlabel('r', fontdict = font_axis_publish)
plt.plot(digi_n['r'], digi_n['n_nstar'], label = 'digitized (DAC)')
plt.plot(sim['distance'], sim['rhoN_Ar'], label = 'simulated (DSMC)')
plt.legend()
plt.yscale('log')
plt.savefig(curr_dir_path + '/digitized_vs_analytical_n.png')
plt.close()
plt.title('DSMC vs DAC', fontdict = font_axis_publish)
plt.ylabel('T/T*', fontdict = font_axis_publish)
plt.xlabel('r', fontdict = font_axis_publish)
plt.plot(digi_T['r'], digi_T['T_Tstar'], label = 'digitized (DAC)')
plt.plot(sim['distance'], sim['Ttra_Ar'], label = 'simulated (DSMC)')
plt.legend()
plt.yscale('log')
plt.savefig(curr_dir_path + '/digitized_vs_analytical_T.png')
plt.close()
| [
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
28686,
198,
11748,
19798,
292,
355,
279,
67,
198,
198,
2,
9938,
3108,
329,
2663,
198,
22019,
81,
62,
15908,
62,
6978,
796,
28686,... | 2.1618 | 822 |
import json
import logging
import os
from flask import Flask, request, jsonify
from pointy.api.add_points import add_points
from pointy.api.add_team import add_team
from pointy.api.add_user import add_user
from pointy.api.get_score import get_score
from pointy.api.get_scoreboard import get_scoreboard, get_scoreboard_page
from pointy.setup_logging import setup_logging
setup_logging()
logger = logging.getLogger(__name__)
app = Flask(__name__)
verify_token = os.environ.get('POINTY_VERIFY_TOKEN')
@app.route('/add-points', methods=['POST'])
@app.route('/get-score', methods=['POST'])
@app.route('/get-scoreboard', methods=['POST'])
@app.route('/add-team', methods=['POST'])
@app.route('/event-endpoint', methods=['POST'])
@app.route('/interactive-endpoint', methods=['POST'])
@app.route('/oauth-redirect', methods=[''])
| [
11748,
33918,
198,
11748,
18931,
198,
11748,
28686,
198,
198,
6738,
42903,
1330,
46947,
11,
2581,
11,
33918,
1958,
198,
198,
6738,
966,
88,
13,
15042,
13,
2860,
62,
13033,
1330,
751,
62,
13033,
198,
6738,
966,
88,
13,
15042,
13,
2860,... | 2.803333 | 300 |
"""
█▀▄▀█ █▀▀ ▀█▀ █▀▀ █▀█ █▀ ▀█▀ ▄▀█ ▀█▀
█░▀░█ ██▄ ░█░ ██▄ █▄█ ▄█ ░█░ █▀█ ░█░
Import & export routines.
The code is licensed under the MIT license.
"""
__appname__ = 'routines'
__version__ = '0.0.1'
from .routine import Routine
| [
37811,
198,
8115,
44033,
45786,
44033,
8115,
447,
225,
8115,
44033,
44033,
447,
225,
44033,
8115,
44033,
447,
225,
8115,
44033,
44033,
447,
225,
8115,
44033,
8115,
447,
225,
8115,
44033,
447,
225,
44033,
8115,
44033,
447,
225,
45786,
4403... | 1.622378 | 143 |
import random
| [
11748,
4738,
201,
198
] | 3.75 | 4 |
import pickle
import os
from tkinter import *
import time
if __name__ == "__main__":
fileNameOfJob = 'mov_1.pkl'
if(not os.path.exists( fileNameOfJob)):
pass
with open(fileNameOfJob,'rb') as f:
currMoove =pickle.load(f)
print(' loaded moove with %i cadrs'%len(currMoove))
root = Tk()
canvas = Canvas(root, width=600+3, height=700+3)
canvas.pack()
canvas.create_rectangle(0, 0, 600+2, 700+2, fill="white")
cAlin=[]
cApo=[]
firstCadr =currMoove[0]
for lin in firstCadr.lines:
cA = canvas.create_line(lin[0], lin[1], lin[2], lin[3], fill="#555555", width = lin[4])
cAlin.append(cA)
for po in firstCadr.points:
cA = canvas.create_oval(po[0]-po[2], po[1]-po[2],po[0]+po[2],po[1]+po[2], fill="#FF5555")
cApo.append(cA)
for i,cadr in enumerate(currMoove):
currTime=time.time()
for lin in range( len(cadr.lines)):
if not cadr.lines[lin][5]:
canvas.coords(cAlin[lin], cadr.lines[lin][0], cadr.lines[lin][1], cadr.lines[lin][2], cadr.lines[lin][3])
else:
canvas.coords(cAlin[lin], 0, 0, 0, 1)
for po in range( len(cadr.points)):
large = cadr.points[po][2]
canvas.coords(cApo[po], cadr.points[po][0]-large, cadr.points[po][1]-large,cadr.points[po][0]+large, cadr.points[po][1]+large)
root.update()
time.sleep(1/250)
root.destroy()
| [
11748,
2298,
293,
201,
198,
11748,
28686,
201,
198,
6738,
256,
74,
3849,
1330,
1635,
201,
198,
11748,
640,
201,
198,
201,
198,
201,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
201,
198,
220,
220,
220,
2393,
5376,
5... | 1.848341 | 844 |
import re
import streamlit as st
import pandas as pd
import numpy as np
import altair as alt
from PIL import Image
import requests
import sys,os
pato = os.path.dirname
direccion=pato(pato(pato(__file__)))
sys.path.append(direccion)
from notebooks.Canada import df_canada
from notebooks.Canada_2 import df_canada1
from notebooks.Japon import df_japon
from notebooks.Japon_2 import df_japon1
from notebooks.Vietnam import df_vietnam
from notebooks.Singapur import df_singapur
from notebooks.Corea import df_corea
from notebooks.Corea_aranceles import df_corea1
from notebooks.paisesfinal import df_paises
from notebooks.Aranceles import aranceles
from SRC.utils_.mining_data_tb import *
from SRC.utils_.visualization_tb import *
df = None
st.set_page_config(layout="wide")
menu = st.sidebar.selectbox('Menu:',
options=["Portada", "Informacion básica", "Casos de estudio", "DataFrames","El datamama","Conclusiones","Información"])
st.title(' La importancia de los acuerdos comerciales internacionales')
if menu == 'Portada':
st.markdown('### En este estudio se pretende refutar la importancia de los acuerdos comerciales internacionales para el comercio de la Unión Europea.')
st.write('¿Los acuerdos comerciales ayudan al comercio de la Unión Europea?: **SI**')
st.markdown ("###### Fuentes: Comisión Europea, Datacomex, Eurostacom, ICEX y Access2Markets.")
st.markdown('### Exportaciones UE - País / Importaciones País - UE')
grafico1 = Image.open(direccion + os.sep + 'resources' + os.sep + 'imp_exp_total.png')
st.image (grafico1,use_column_width=True)
st.markdown('### Importaciones UE - País')
grafico2 = Image.open(direccion + os.sep + 'resources' + os.sep + 'imp_totales.png')
st.image (grafico2,use_column_width=True)
st.markdown('### Exportaciones País - UE')
grafico3 = Image.open(direccion + os.sep + 'resources' + os.sep + 'exp_totales.png')
st.image (grafico3,use_column_width=True)
if menu == "Informacion básica":
st.markdown('## Definiciones')
st.write ("1. **Acuerdo libre comercio:** acuerdo firmado por uno o varios países que lo que pretenden es mejorar el comercio entre ambos bloques a través de la eliminación de trabas arancelarias y no arancelarias.")
st.write ("2. **Barreras no arancelarias:** aquellas que impiden el correcto comercio entre dos bloques económicos y que no son de índole arancelario. Entre ellas se encuentras los procedimiento de entrada, los procesos de registro del producto, de inspeccion sanitaria, etc.")
st.write ("3. **Aranceles:** impuestos que se cobran por la entrada de bienes o servicios extranjeros en el mercado nacional de un determinado país.")
st.write ("4. **Existen dos tipos de aranceles:** aplicados como un porcentaje del valor del bien o los que se les aplica un valor fijo por una unidad de medida establecida (por ejemplo una cantidad de toneladas, hectolitros, etc.)")
st.write ("5. **Contingentes:** cantidad exenta de aranceles o a la que se le aplica un arancel menor. A partir de ese volumen los aranceles aumentan.")
st.write ("6. **Clasificación arancelaria:** proceso por el que se asigna a cada mercancía un código numérico basado en ciertos criterios como son la naturaleza del producto o los países de origen y destino.")
st.write ("7. **Taric:** clasificación arancelario usado por la Unión Europea.")
if menu == "Casos de estudio":
submenu=st.sidebar.selectbox(label="País:",
options=["Corea del Sur","Japón","Canadá"])
if submenu=="Corea del Sur":
st.markdown('## El caso coreano: reacción inmediata ')
checkbox_graficas = st.sidebar.checkbox("Gráficas", value=True)
checkbox_correlaciones = st.sidebar.checkbox("Correlaciones", value=True)
if checkbox_graficas:
st.write("Aumento en las exportaciones e importaciones de un **72,26%** y un **105,76%**, respectivamente. ")
st.write ("Reducción de los aranceles: ")
st.write ("- Reduccion mediana de las importaciones del 27% al 5%. ")
st.write ("- Reduccion mediana de las exportaciones del 14% al 0%. ")
col1, col2 = st.beta_columns(2)
with col1:
st.markdown('### Importaciones de Corea del Sur a la Unión Europea ')
st.plotly_chart(importaciones_total(df_corea1,"Corea del Sur"),use_container_width=True)
with col2:
st.markdown('### Exportaciones de Corea del Sur a la Unión Europea ')
st.plotly_chart(exportaciones_total(df_corea1,"Corea del Sur"),use_container_width=True)
if checkbox_correlaciones:
col1, col2 = st.beta_columns(2)
with col1:
st.markdown('### Aranceles 2011 ')
st.plotly_chart(violin_pre(aranceles),use_container_width=True)
with col2:
st.markdown('### Aranceles 2020 ')
st.plotly_chart(violin_post(aranceles),use_container_width=True)
if submenu=="Japón":
st.markdown('## El caso japonés: la larga marcha ')
st.write ("Disminución en las exportaciones de un **-3,35%** y un aumento el **27,72%** de las importaciones.")
col1, col2 = st.beta_columns(2)
with col1:
st.markdown('### Importaciones de Japón a la Unión Europea ')
st.plotly_chart(importaciones_total(df_japon1,"Japón"),use_container_width=True)
with col2:
st.markdown('### Exportaciones de Japón a la Unión Europea ')
st.plotly_chart(exportaciones_total(df_japon1,"Japón"),use_container_width=True)
if submenu=="Canadá":
st.markdown('## El caso canadiense: con x de mixta')
st.write ("Aumento en las exportaciones e importaciones de un **41,59%** y un **141,80%**, respectivamente.")
col1, col2 = st.beta_columns(2)
with col1:
st.markdown('### Importaciones de Canadá a la Unión Europea ')
st.plotly_chart(importaciones_total(df_canada1,"Canadá"),use_container_width=False)
with col2:
st.markdown('### Exportaciones de Canadá a la Unión Europea ')
st.plotly_chart(exportaciones_total(df_canada1,"Canadá"),use_container_width=False)
if menu == "DataFrames":
submenu=st.sidebar.selectbox(label="País:",
options=["Canadá","Corea del Sur","Japón","Singapur","Vietnam"])
if submenu=="Canadá":
col1, col2 = st.beta_columns(2)
with col1:
st.markdown('### Datos antes y despues acuerdo ')
df1 = pd.read_csv(direccion + os.sep + 'data' + os.sep + "csvlimpioCanadá1.csv",nrows=20)
st.table(df1)
with col2:
st.markdown('### Datos completos')
df = pd.read_csv(direccion + os.sep + 'data' + os.sep + "csvlimpioCanadá.csv",nrows=20)
st.table(df)
if submenu=="Corea del Sur":
st.markdown('### Datos antes y despues acuerdo ')
df2 = pd.read_csv(direccion + os.sep + 'data' + os.sep + "csvlimpioCorea_del_Sur_1.csv",nrows=50)
st.table(df2)
if submenu=="Japón":
col1, col2 = st.beta_columns(2)
with col1:
st.markdown('### Datos antes y despues acuerdo ')
df3 = pd.read_csv(direccion + os.sep + 'data' + os.sep + "csvlimpioJapón1.csv",nrows=50)
st.table(df3)
with col2:
st.markdown('### Datos completos')
df4 = pd.read_csv(direccion + os.sep + 'data' + os.sep + "csvlimpioJapón.csv",nrows=50)
st.table(df4)
if submenu=="Singapur":
st.markdown('### Datos completos')
df3 = pd.read_csv(direccion + os.sep + 'data' + os.sep + "csvlimpioSingapur.csv",nrows=50)
st.table(df3)
if submenu=="Vietnam":
st.markdown('### Datos completos')
df3 = pd.read_csv(direccion + os.sep + 'data' + os.sep + "csvlimpioVietnam.csv",nrows=50)
st.table(df3)
if menu == "El datamama":
r = requests.get("http://localhost:8080/give_me_id?token_id=R70423563").json()
df = pd.DataFrame(r)
st.write(df)
if menu == "Conclusiones":
st.markdown('## Conclusiones')
st.write ("- Todos los tipos de acuerdos comerciales desde aquellos que son más ambiciosos hasta aquellos que son más conservadores ayudan a mejorar el comercio internacional.")
st.write ("- La correlación entre las exportaciones e importaciones con respecto a los aranceles es inversa.")
st.write ("- A mayor rapidez en la implantacion mayor aumento en el comercio internacional.")
st.write ("- Las barreras arancelarias tienen un peso muy importante en el aumento o disminucion del comercio.")
st.write ("- La comparación entre los países que han adpotado las medidas hace más tiempo y los que las han adoptado hace menos indica que el comercio entre los diferentes bloques se incrementa mucho más tras los acuerdos ")
st.write ("- Las economías con mayor apertura comercial tienden a ser más dependientes del sector exterior que las economias protectoras.")
st.write ("- Importante remarcar que hay una serie de variables no númericas (barreras no arancelarias) que tienen un gran impacto en el comercio, habría que hacer un análisis más profundo.")
if menu == "Información":
st.markdown("### Para más información:")
st.write(" 1. [Linkedin](https://www.linkedin.com/in/pabloeduardomartinezpicazo/)")
st.write(" 2. Correo electónico: pabloeduardo.martinezpicazo@gmail.com")
Imagen_despedida= Image.open(direccion + os.sep + 'resources' + os.sep + 'agradecimiento.jpg')
st.image (Imagen_despedida,use_column_width=True) | [
11748,
302,
198,
11748,
4269,
18250,
355,
336,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
5988,
958,
355,
5988,
198,
6738,
350,
4146,
1330,
7412,
198,
11748,
7007,
198,
11748,
25064,
11,
418,
... | 2.312545 | 4,185 |
from rest_framework import viewsets
from rest_framework.filters import SearchFilter
from rest_framework.response import Response
from . import biz, models, serializers
from parkinglot.models import ParkingLot
from utils.django_base import BaseApiPagination
| [
6738,
1334,
62,
30604,
1330,
5009,
1039,
198,
6738,
1334,
62,
30604,
13,
10379,
1010,
1330,
11140,
22417,
198,
6738,
1334,
62,
30604,
13,
26209,
1330,
18261,
198,
198,
6738,
764,
1330,
275,
528,
11,
4981,
11,
11389,
11341,
198,
6738,
... | 3.869565 | 69 |
class HelloCNN(nn.Module):
"""
Simple CNN Clssifier
"""
| [
4871,
18435,
18474,
7,
20471,
13,
26796,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
17427,
8100,
1012,
824,
7483,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
... | 1.833333 | 48 |
from research.three_phase.Engine import *
from scipy.sparse import lil_matrix
np.set_printoptions(linewidth=100000)
def set_sub(A, cols, rows, sub_mat):
"""
Set sub-matrix in place into sparse matrix
:param A: Sparse matrix
:param cols: array of columns (size m)
:param rows: array of rows (size n)
:param sub_mat: dense array (size n x m)
"""
for i, a in enumerate(rows):
for j, b in enumerate(cols):
A[a, b] = sub_mat[i, j]
def y_bus(circuit: Circuit):
"""
Vectorized 3-phase Y bus building
:param circuit: Circuit instance
:return:
"""
n = len(circuit.buses)
m = len(circuit.branches)
Cf = lil_matrix((3 * m, 3 * n))
Ct = lil_matrix((3 * m, 3 * n))
yff = lil_matrix((3 * m, 3 * m), dtype=complex)
yft = lil_matrix((3 * m, 3 * m), dtype=complex)
ytf = lil_matrix((3 * m, 3 * m), dtype=complex)
ytt = lil_matrix((3 * m, 3 * m), dtype=complex)
bus_idx = dict()
# compile nodes
for k, elm in enumerate(circuit.buses):
# store the object and its index in a dictionary
bus_idx[elm] = k
br_ind = np.array([0, 1, 2])
for k, branch in enumerate(circuit.branches):
# get the single-phase bus indices
f_idx = bus_idx[branch.f]
t_idx = bus_idx[branch.t]
# expand the bus indices to the n-phase scheme
f3 = 3 * f_idx + branch.phases_from
t3 = 3 * t_idx + branch.phases_to
# expand the branch index to the n-phase scheme
b3 = 3 * k + br_ind
# set the connectivity matrices (note that we set the values at (b3[0], f3[0]), (b3[1], f3[1]), (b3[2], f3[2])
Cf[b3, f3] = np.ones(3, dtype=int)
Ct[b3, t3] = np.ones(3, dtype=int)
# get the four 3x3 primitives of the branch
A, B, C, D, _, _ = branch.get_ABCD(Sbase=circuit.Sbase)
# set the sub-matrices
set_sub(A=yff, cols=b3, rows=b3, sub_mat=A)
set_sub(A=yft, cols=b3, rows=b3, sub_mat=B)
set_sub(A=ytf, cols=b3, rows=b3, sub_mat=C)
set_sub(A=ytt, cols=b3, rows=b3, sub_mat=D)
# compose Yf, Yt and Ybus
yf = yff * Cf + yft * Ct
yt = ytf * Cf + ytt * Ct
ybus = Cf.transpose() * yf + Ct.transpose() * yt
print(ybus.todense())
if __name__ == "__main__":
P = np.array([2.5, 2.5, 2.5])
S = np.array([2+2j, 20+2j, 40+3j])
b1 = Bus("B1", number_of_phases=3, Vnom=10.0)
b1.is_slack = True
b1.add_generator(Generator("", P=P, v=1.0))
b2 = Bus("B2", number_of_phases=3, Vnom=10.0)
b2.add_load(LoadSIY("", S, np.zeros_like(S), np.zeros_like(S)))
b3 = Bus("B3", number_of_phases=3, Vnom=10.0)
# b3.add_generator(Generator("", P=P*0.5, v=1.0))
line_type1 = LineTypeSeq(name="",
Z_SEQ=np.array([0.4606 + 1.7536j, 0.1808 + 0.6054j, 0.1808 + 0.6054j])/100,
Ysh_SEQ=np.array([0, 0, 0]))
lne1 = Line("L1", line_type1, bus_from=b1, bus_to=b2, conn_from=[0, 1, 2], conn_to=[0, 1, 2], length=100.0)
lne2 = Line("L2", line_type1, bus_from=b2, bus_to=b3, conn_from=[0, 1, 2], conn_to=[0, 1, 2], length=10.0)
circuit_ = Circuit(Sbase=100)
circuit_.buses.append(b1)
circuit_.buses.append(b2)
circuit_.buses.append(b3)
circuit_.branches.append(lne1)
circuit_.branches.append(lne2)
y_bus(circuit=circuit_)
| [
198,
6738,
2267,
13,
15542,
62,
40715,
13,
13798,
1330,
1635,
198,
198,
6738,
629,
541,
88,
13,
82,
29572,
1330,
42280,
62,
6759,
8609,
198,
198,
37659,
13,
2617,
62,
4798,
25811,
7,
2815,
413,
5649,
28,
3064,
830,
8,
628,
198,
42... | 1.989412 | 1,700 |