content
stringlengths
1
1.05M
input_ids
listlengths
1
883k
ratio_char_token
float64
1
22.9
token_count
int64
1
883k
# (C) Datadog, Inc. 2018-present # All rights reserved # Licensed under a 3-clause BSD style license (see LICENSE) import click from ..console import CONTEXT_SETTINGS from .check import check_run from .ls import ls from .prune import prune from .reload import reload_env from .shell import shell from .start import start from .stop import stop from .test import test ALL_COMMANDS = (check_run, ls, prune, reload_env, shell, start, stop, test) for command in ALL_COMMANDS: env.add_command(command)
[ 2, 357, 34, 8, 16092, 324, 519, 11, 3457, 13, 2864, 12, 25579, 198, 2, 1439, 2489, 10395, 198, 2, 49962, 739, 257, 513, 12, 565, 682, 347, 10305, 3918, 5964, 357, 3826, 38559, 24290, 8, 198, 11748, 3904, 198, 198, 6738, 11485, 419...
3.142857
161
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi SDK Generator. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union from .. import _utilities, _tables from . import outputs from ._enums import * from ._inputs import * __all__ = ['PrivateStoreOffer']
[ 2, 19617, 28, 40477, 12, 23, 198, 2, 17202, 39410, 25, 428, 2393, 373, 7560, 416, 262, 21624, 12994, 26144, 35986, 13, 17202, 198, 2, 17202, 2141, 407, 4370, 416, 1021, 4556, 345, 821, 1728, 345, 760, 644, 345, 389, 1804, 0, 17202, ...
3.626087
115
from locust import HttpUser, TaskSet, task, constant from locust import LoadTestShape
[ 6738, 1179, 436, 1330, 367, 29281, 12982, 11, 15941, 7248, 11, 4876, 11, 6937, 198, 6738, 1179, 436, 1330, 8778, 14402, 33383, 628, 628 ]
3.708333
24
# coding:utf-8 from sqlalchemy import text from db.basic_db import db_session from db.models import SeedIds from decorators.decorator import db_commit_decorator def get_seed(): """ Get all user id to be crawled :return: user ids """ return db_session.query(SeedIds).filter(text('status=0')).all() def get_seed_ids(): """ Get all user id to be crawled :return: user ids """ return db_session.query(SeedIds.uid).filter(text('is_crawled=0')).all() def get_home_ids(): """ Get all user id who's home pages need to be crawled :return: user ids """ return db_session.query(SeedIds.uid).filter(text('home_crawled=0')).all()
[ 2, 19617, 25, 40477, 12, 23, 198, 6738, 44161, 282, 26599, 1330, 2420, 198, 6738, 20613, 13, 35487, 62, 9945, 1330, 20613, 62, 29891, 198, 6738, 20613, 13, 27530, 1330, 23262, 7390, 82, 198, 6738, 11705, 2024, 13, 12501, 273, 1352, 13...
2.578947
266
""" Area Weighted Interpolation """ import numpy as np import geopandas as gpd from ._vectorized_raster_interpolation import _fast_append_profile_in_gdf import warnings from scipy.sparse import dok_matrix, diags, coo_matrix import pandas as pd from tobler.util.util import _check_crs, _nan_check, _inf_check, _check_presence_of_crs def _area_tables_binning(source_df, target_df, spatial_index): """Construct area allocation and source-target correspondence tables using a spatial indexing approach ... NOTE: this currently relies on Geopandas' spatial index machinery Parameters ---------- source_df : geopandas.GeoDataFrame GeoDataFrame containing input data and polygons target_df : geopandas.GeoDataFramee GeoDataFrame defining the output geometries spatial_index : str Spatial index to use to build the allocation of area from source to target tables. It currently support the following values: - "source": build the spatial index on `source_df` - "target": build the spatial index on `target_df` - "auto": attempts to guess the most efficient alternative. Currently, this option uses the largest table to build the index, and performs a `bulk_query` on the shorter table. Returns ------- tables : scipy.sparse.dok_matrix """ if _check_crs(source_df, target_df): pass else: return None df1 = source_df.copy() df2 = target_df.copy() # it is generally more performant to use the longer df as spatial index if spatial_index == "auto": if df1.shape[0] > df2.shape[0]: spatial_index = "source" else: spatial_index = "target" if spatial_index == "source": ids_tgt, ids_src = df1.sindex.query_bulk(df2.geometry, predicate="intersects") elif spatial_index == "target": ids_src, ids_tgt = df2.sindex.query_bulk(df1.geometry, predicate="intersects") else: raise ValueError( f"'{spatial_index}' is not a valid option. Use 'auto', 'source' or 'target'." ) areas = df1.geometry.values[ids_src].intersection(df2.geometry.values[ids_tgt]).area table = coo_matrix( (areas, (ids_src, ids_tgt),), shape=(df1.shape[0], df2.shape[0]), dtype=np.float32, ) table = table.todok() return table def _area_tables(source_df, target_df): """ Construct area allocation and source-target correspondence tables. Parameters ---------- source_df : geopandas.GeoDataFrame target_df : geopandas.GeoDataFrame Returns ------- tables : tuple (optional) two 2-D numpy arrays SU: area of intersection of source geometry i with union geometry j UT: binary mapping of union geometry j to target geometry t Notes ----- The assumption is both dataframes have the same coordinate reference system. Union geometry is a geometry formed by the intersection of a source geometry and a target geometry SU Maps source geometry to union geometry, UT maps union geometry to target geometry """ if _check_crs(source_df, target_df): pass else: return None source_df = source_df.copy() source_df = source_df.copy() n_s = source_df.shape[0] n_t = target_df.shape[0] _left = np.arange(n_s) _right = np.arange(n_t) source_df.loc[:, "_left"] = _left # create temporary index for union target_df.loc[:, "_right"] = _right # create temporary index for union res_union = gpd.overlay(source_df, target_df, how="union") n_u, _ = res_union.shape SU = np.zeros( (n_s, n_u) ) # holds area of intersection of source geom with union geom UT = np.zeros((n_u, n_t)) # binary table mapping union geom to target geom for index, row in res_union.iterrows(): # only union polygons that intersect both a source and a target geometry matter if not np.isnan(row["_left"]) and not np.isnan(row["_right"]): s_id = int(row["_left"]) t_id = int(row["_right"]) SU[s_id, index] = row[row.geometry.name].area UT[index, t_id] = 1 source_df.drop(["_left"], axis=1, inplace=True) target_df.drop(["_right"], axis=1, inplace=True) return SU, UT def _area_interpolate_binning( source_df, target_df, extensive_variables=None, intensive_variables=None, table=None, allocate_total=True, spatial_index="auto", ): """ Area interpolation for extensive and intensive variables. Parameters ---------- source_df : geopandas.GeoDataFrame target_df : geopandas.GeoDataFrame extensive_variables : list [Optional. Default=None] Columns in dataframes for extensive variables intensive_variables : list [Optional. Default=None] Columns in dataframes for intensive variables table : scipy.sparse.dok_matrix [Optional. Default=None] Area allocation source-target correspondence table. If not provided, it will be built from `source_df` and `target_df` using `tobler.area_interpolate._area_tables_binning` allocate_total : boolean [Optional. Default=True] True if total value of source area should be allocated. False if denominator is area of i. Note that the two cases would be identical when the area of the source polygon is exhausted by intersections. See Notes for more details. spatial_index : str [Optional. Default="auto"] Spatial index to use to build the allocation of area from source to target tables. It currently support the following values: - "source": build the spatial index on `source_df` - "target": build the spatial index on `target_df` - "auto": attempts to guess the most efficient alternative. Currently, this option uses the largest table to build the index, and performs a `bulk_query` on the shorter table. Returns ------- estimates : geopandas.GeoDataFrame new geodaraframe with interpolated variables as columns and target_df geometry as output geometry Notes ----- The assumption is both dataframes have the same coordinate reference system. For an extensive variable, the estimate at target polygon j (default case) is: .. math:: v_j = \\sum_i v_i w_{i,j} w_{i,j} = a_{i,j} / \\sum_k a_{i,k} If the area of the source polygon is not exhausted by intersections with target polygons and there is reason to not allocate the complete value of an extensive attribute, then setting allocate_total=False will use the following weights: .. math:: v_j = \\sum_i v_i w_{i,j} w_{i,j} = a_{i,j} / a_i where a_i is the total area of source polygon i. For an intensive variable, the estimate at target polygon j is: .. math:: v_j = \\sum_i v_i w_{i,j} w_{i,j} = a_{i,j} / \\sum_k a_{k,j} """ source_df = source_df.copy() target_df = target_df.copy() if _check_crs(source_df, target_df): pass else: return None if table is None: table = _area_tables_binning(source_df, target_df, spatial_index) den = source_df[source_df.geometry.name].area.values if allocate_total: den = np.asarray(table.sum(axis=1)) den = den + (den == 0) den = 1.0 / den n = den.shape[0] den = den.reshape((n,)) den = diags([den], [0]) weights = den.dot(table) # row standardize table dfs = [] extensive = [] if extensive_variables: for variable in extensive_variables: vals = _nan_check(source_df, variable) vals = _inf_check(source_df, variable) estimates = diags([vals], [0]).dot(weights) estimates = estimates.sum(axis=0) extensive.append(estimates.tolist()[0]) extensive = np.asarray(extensive) extensive = np.array(extensive) extensive = pd.DataFrame(extensive.T, columns=extensive_variables) area = np.asarray(table.sum(axis=0)) den = 1.0 / (area + (area == 0)) n, k = den.shape den = den.reshape((k,)) den = diags([den], [0]) weights = table.dot(den) intensive = [] if intensive_variables: for variable in intensive_variables: vals = _nan_check(source_df, variable) vals = _inf_check(source_df, variable) n = vals.shape[0] vals = vals.reshape((n,)) estimates = diags([vals], [0]) estimates = estimates.dot(weights).sum(axis=0) intensive.append(estimates.tolist()[0]) intensive = np.asarray(intensive) intensive = pd.DataFrame(intensive.T, columns=intensive_variables) if extensive_variables: dfs.append(extensive) if intensive_variables: dfs.append(intensive) df = pd.concat(dfs, axis=1) df["geometry"] = target_df[target_df.geometry.name].reset_index(drop=True) df = gpd.GeoDataFrame(df.replace(np.inf, np.nan)) return df def _area_interpolate( source_df, target_df, extensive_variables=None, intensive_variables=None, tables=None, allocate_total=True, ): """ Area interpolation for extensive and intensive variables. Parameters ---------- source_df : geopandas.GeoDataFrame (required) geodataframe with polygon geometries target_df : geopandas.GeoDataFrame (required) geodataframe with polygon geometries extensive_variables : list, (optional) columns in dataframes for extensive variables intensive_variables : list, (optional) columns in dataframes for intensive variables tables : tuple (optional) two 2-D numpy arrays SU: area of intersection of source geometry i with union geometry j UT: binary mapping of union geometry j to target geometry t allocate_total : boolean True if total value of source area should be allocated. False if denominator is area of i. Note that the two cases would be identical when the area of the source polygon is exhausted by intersections. See Notes for more details. Returns ------- estimates : geopandas.GeoDataFrame new geodaraframe with interpolated variables as columns and target_df geometry as output geometry Notes ----- The assumption is both dataframes have the same coordinate reference system. For an extensive variable, the estimate at target polygon j (default case) is: v_j = \sum_i v_i w_{i,j} w_{i,j} = a_{i,j} / \sum_k a_{i,k} If the area of the source polygon is not exhausted by intersections with target polygons and there is reason to not allocate the complete value of an extensive attribute, then setting allocate_total=False will use the following weights: v_j = \sum_i v_i w_{i,j} w_{i,j} = a_{i,j} / a_i where a_i is the total area of source polygon i. For an intensive variable, the estimate at target polygon j is: v_j = \sum_i v_i w_{i,j} w_{i,j} = a_{i,j} / \sum_k a_{k,j} """ source_df = source_df.copy() target_df = target_df.copy() if _check_crs(source_df, target_df): pass else: return None if tables is None: SU, UT = _area_tables(source_df, target_df) else: SU, UT = tables den = source_df[source_df.geometry.name].area.values if allocate_total: den = SU.sum(axis=1) den = den + (den == 0) weights = np.dot(np.diag(1 / den), SU) dfs = [] extensive = [] if extensive_variables: for variable in extensive_variables: vals = _nan_check(source_df, variable) vals = _inf_check(source_df, variable) estimates = np.dot(np.diag(vals), weights) estimates = np.dot(estimates, UT) estimates = estimates.sum(axis=0) extensive.append(estimates) extensive = np.array(extensive) extensive = pd.DataFrame(extensive.T, columns=extensive_variables) ST = np.dot(SU, UT) area = ST.sum(axis=0) den = np.diag(1.0 / (area + (area == 0))) weights = np.dot(ST, den) intensive = [] if intensive_variables: for variable in intensive_variables: vals = _nan_check(source_df, variable) vals = _inf_check(source_df, variable) vals.shape = (len(vals), 1) est = (vals * weights).sum(axis=0) intensive.append(est) intensive = np.array(intensive) intensive = pd.DataFrame(intensive.T, columns=intensive_variables) if extensive_variables: dfs.append(extensive) if intensive_variables: dfs.append(intensive) df = pd.concat(dfs, axis=1) df["geometry"] = target_df[target_df.geometry.name].reset_index(drop=True) df = gpd.GeoDataFrame(df.replace(np.inf, np.nan)) return df def _area_tables_raster( source_df, target_df, raster_path, codes=[21, 22, 23, 24], force_crs_match=True ): """ Construct area allocation and source-target correspondence tables according to a raster 'populated' areas Parameters ---------- source_df : geopandas.GeoDataFrame geeodataframe with geometry column of polygon type target_df : geopandas.GeoDataFrame geodataframe with geometry column of polygon type raster_path : str the path to the associated raster image. codes : list list of integer code values that should be considered as 'populated'. Since this draw inspiration using the National Land Cover Database (NLCD), the default is 21 (Developed, Open Space), 22 (Developed, Low Intensity), 23 (Developed, Medium Intensity) and 24 (Developed, High Intensity). The description of each code can be found here: https://www.mrlc.gov/sites/default/files/metadata/landcover.html Only taken into consideration for harmonization raster based. force_crs_match : bool (default is True) Whether the Coordinate Reference System (CRS) of the polygon will be reprojected to the CRS of the raster file. It is recommended to let this argument as True. Returns ------- tables: tuple (optional) two 2-D numpy arrays SU: area of intersection of source geometry i with union geometry j UT: binary mapping of union geometry j to target geometry t Notes ----- The assumption is both dataframes have the same coordinate reference system. Union geometry is a geometry formed by the intersection of a source geometry and a target geometry SU Maps source geometry to union geometry, UT maps union geometry to target geometry """ if _check_crs(source_df, target_df): pass else: return None source_df = source_df.copy() target_df = target_df.copy() n_s = source_df.shape[0] n_t = target_df.shape[0] _left = np.arange(n_s) _right = np.arange(n_t) source_df.loc[:, "_left"] = _left # create temporary index for union target_df.loc[:, "_right"] = _right # create temporary index for union res_union_pre = gpd.overlay(source_df, target_df, how="union") # Establishing a CRS for the generated union warnings.warn( "The CRS for the generated union will be set to be the same as source_df." ) res_union_pre.crs = source_df.crs # The 'append_profile_in_gdf' function is present in nlcd.py script res_union = _fast_append_profile_in_gdf( res_union_pre, raster_path, force_crs_match=force_crs_match ) str_codes = [str(i) for i in codes] str_list = ["Type_" + i for i in str_codes] # Extract list of code names that actually appear in the appended dataset str_list_ok = [col for col in res_union.columns if col in str_list] res_union["Populated_Pixels"] = res_union[str_list_ok].sum(axis=1) n_u, _ = res_union.shape SU = np.zeros( (n_s, n_u) ) # holds area of intersection of source geom with union geom UT = np.zeros((n_u, n_t)) # binary table mapping union geom to target geom for index, row in res_union.iterrows(): # only union polygons that intersect both a source and a target geometry matter if not np.isnan(row["_left"]) and not np.isnan(row["_right"]): s_id = int(row["_left"]) t_id = int(row["_right"]) SU[s_id, index] = row["Populated_Pixels"] UT[index, t_id] = 1 source_df.drop(["_left"], axis=1, inplace=True) target_df.drop(["_right"], axis=1, inplace=True) return SU, UT
[ 37811, 198, 30547, 14331, 276, 4225, 16104, 341, 198, 198, 37811, 198, 198, 11748, 299, 32152, 355, 45941, 198, 11748, 30324, 392, 292, 355, 27809, 67, 198, 6738, 47540, 31364, 1143, 62, 81, 1603, 62, 3849, 16104, 341, 1330, 4808, 7217,...
2.543673
6,583
## # This software was developed and / or modified by Raytheon Company, # pursuant to Contract DG133W-05-CQ-1067 with the US Government. # # U.S. EXPORT CONTROLLED TECHNICAL DATA # This software product contains export-restricted data whose # export/transfer/disclosure is restricted by U.S. law. Dissemination # to non-U.S. persons whether in the United States or abroad requires # an export license or other authorization. # # Contractor Name: Raytheon Company # Contractor Address: 6825 Pine Street, Suite 340 # Mail Stop B8 # Omaha, NE 68106 # 402.291.0100 # # See the AWIPS II Master Rights File ("Master Rights File.pdf") for # further licensing information. ## # ---------------------------------------------------------------------------- # This software is in the public domain, furnished "as is", without technical # support, and with no warranty, express or implied, as to its usefulness for # any purpose. # # Headlines Timing # # Author: # ---------------------------------------------------------------------------- #set up to test area names and part of states # without locationName defined areaT1 = """ AreaDictionary['FLZ050']['fullStateName'] = 'Florida' AreaDictionary['FLZ050']['partOfState'] = 'western' AreaDictionary['FLZ057']['fullStateName'] = 'Florida' AreaDictionary['FLZ057']['partOfState'] = 'western' AreaDictionary['FLZ160']['fullStateName'] = 'Florida' AreaDictionary['FLZ160']['partOfState'] = 'central' AreaDictionary['FLZ151']['fullStateName'] = 'Florida' AreaDictionary['FLZ151']['partOfState'] = 'central' AreaDictionary['FLZ043']['fullStateName'] = 'Florida' AreaDictionary['FLZ043']['partOfState'] = 'central' AreaDictionary['FLZ162']['fullStateName'] = 'Florida' AreaDictionary['FLZ162']['partOfState'] = 'central' AreaDictionary['FLZ165']['fullStateName'] = 'Florida' AreaDictionary['FLZ165']['partOfState'] = 'central' AreaDictionary['FLZ056']['fullStateName'] = 'Florida' AreaDictionary['FLZ056']['partOfState'] = 'southern' AreaDictionary['FLZ052']['fullStateName'] = 'Georgia' AreaDictionary['FLZ052']['partOfState'] = 'western' AreaDictionary['FLZ155']['fullStateName'] = 'Georgia' AreaDictionary['FLZ155']['partOfState'] = 'western' AreaDictionary['FLZ061']['fullStateName'] = 'Georgia' AreaDictionary['FLZ061']['partOfState'] = 'southern' AreaDictionary['FLZ148']['fullStateName'] = 'Georgia' AreaDictionary['FLZ148']['partOfState'] = 'southern' AreaDictionary['FLZ142']['fullStateName'] = 'South Carolina' AreaDictionary['FLZ142']['partOfState'] = 'western' AreaDictionary['FLZ043']['fullStateName'] = 'South Carolina' AreaDictionary['FLZ043']['partOfState'] = 'western' """ #with location name defined areaT2= """ AreaDictionary['FLZ050']['fullStateName'] = 'Florida' AreaDictionary['FLZ050']['partOfState'] = 'western' AreaDictionary['FLZ050']['locationName'] = 'Clearfield' AreaDictionary['FLZ057']['fullStateName'] = 'Florida' AreaDictionary['FLZ057']['partOfState'] = 'western' AreaDictionary['FLZ057']['locationName'] = 'Clearfield' AreaDictionary['FLZ160']['fullStateName'] = 'Florida' AreaDictionary['FLZ160']['partOfState'] = 'central' AreaDictionary['FLZ160']['locationName'] = 'Aunt Ruby' AreaDictionary['FLZ151']['fullStateName'] = 'Florida' AreaDictionary['FLZ151']['partOfState'] = 'central' AreaDictionary['FLZ151']['locationName'] = 'Aunt Ruby' AreaDictionary['FLZ043']['fullStateName'] = 'Florida' AreaDictionary['FLZ043']['partOfState'] = 'central' AreaDictionary['FLZ043']['locationName'] = 'Adams' AreaDictionary['FLZ162']['fullStateName'] = 'Florida' AreaDictionary['FLZ162']['partOfState'] = 'central' AreaDictionary['FLZ162']['locationName'] = 'Adams' AreaDictionary['FLZ165']['fullStateName'] = 'Florida' AreaDictionary['FLZ165']['partOfState'] = 'central' #AreaDictionary['FLZ165']['locationName'] = 'western' AreaDictionary['FLZ056']['fullStateName'] = 'Florida' AreaDictionary['FLZ056']['partOfState'] = 'southern' AreaDictionary['FLZ056']['locationName'] = 'Tampa' AreaDictionary['FLZ052']['fullStateName'] = 'Georgia' AreaDictionary['FLZ052']['partOfState'] = 'western' AreaDictionary['FLZ052']['locationName'] = 'Tampa' AreaDictionary['FLZ155']['fullStateName'] = 'Georgia' AreaDictionary['FLZ155']['partOfState'] = 'western' AreaDictionary['FLZ155']['locationName'] = 'Atlanta' AreaDictionary['FLZ061']['fullStateName'] = 'Georgia' AreaDictionary['FLZ061']['partOfState'] = 'southern' AreaDictionary['FLZ061']['locationName'] = 'Beach' AreaDictionary['FLZ148']['fullStateName'] = 'Georgia' AreaDictionary['FLZ148']['partOfState'] = 'southern' AreaDictionary['FLZ148']['locationName'] = 'Beach' AreaDictionary['FLZ142']['fullStateName'] = 'South Carolina' AreaDictionary['FLZ142']['partOfState'] = 'western' AreaDictionary['FLZ142']['locationName'] = 'South Park' AreaDictionary['FLZ043']['fullStateName'] = 'South Carolina' AreaDictionary['FLZ043']['partOfState'] = 'western' AreaDictionary['FLZ043']['locationName'] = 'South Park' """ #for testing of parishes, counties, and areas areaT3 = """ AreaDictionary['FLC017']['fullStateName'] = 'Louisiana' AreaDictionary['FLC017']['partOfState'] = 'western' AreaDictionary['FLC017']['independentCity'] = 1 AreaDictionary['FLC105']['fullStateName'] = 'Louisiana' AreaDictionary['FLC105']['partOfState'] = 'western' AreaDictionary['FLC027']['fullStateName'] = 'Louisiana' AreaDictionary['FLC027']['partOfState'] = 'western' AreaDictionary['FLC053']['fullStateName'] = 'Florida' AreaDictionary['FLC053']['partOfState'] = 'western' """ areaT3FIPS0= '#Definition["areaType"] = "FIPS"' areaT3FIPS1= 'Definition["areaType"] = "FIPS"' scripts = [ { "commentary": "Clear out all Hazards Table and Grids.", "name": "Hazard_FFA_0", "productType": None, "clearHazardsTable": 1, "checkStrings": [], }, { "commentary": "NEW FFA", "name": "Hazard_FFA_1", "drtTime": "20100101_0510", "productType": "Hazard_FFA_Local", "cmdLineVars": "{('Flood Reason', 'floodReason'): 'ER '}", "createGrids": [ ("Fcst", "Hazards", "DISCRETE", -100, 100, "<None>", "all"), ("Fcst", "Hazards", "DISCRETE", 0, 3, "FA.A", ["FLZ149"]), ], "checkStrings": ["URGENT - IMMEDIATE BROADCAST REQUESTED", "Flood Watch", "National Weather Service Tampa Bay Ruskin FL", "FLZ149-", "/X.NEW.KTBW.FA.A.0001.100101T0510Z-100101T0800Z/", "/00000.0.ER.000000T0000Z.000000T0000Z.000000T0000Z.OO/", "Coastal Pasco-", "1210 AM EST Fri Jan 1 2010", "...FLOOD WATCH IN EFFECT UNTIL 3 AM EST EARLY THIS MORNING...", "The National Weather Service in Tampa Bay Ruskin has issued a", "* Flood Watch for a portion of west central Florida, including the following area, Coastal Pasco.", "* Until 3 AM EST early this morning", ], }, { "commentary": "CON FFA", "name": "Hazard_FFA_2", "drtTime": "20100101_0530", "productType": "Hazard_FFA_Local", "cmdLineVars": "{('Flood Reason', 'floodReason'): 'SM '}", "createGrids": [ ("Fcst", "Hazards", "DISCRETE", -100, 100, "<None>", "all"), ("Fcst", "Hazards", "DISCRETE", 0, 3, "FA.A", ["FLZ149"]), ], "checkStrings": ["Flood Watch", "National Weather Service Tampa Bay Ruskin FL", "FLZ149-", "/X.CON.KTBW.FA.A.0001.000000T0000Z-100101T0800Z/", "/00000.0.SM.000000T0000Z.000000T0000Z.000000T0000Z.OO/", "...FLOOD WATCH REMAINS IN EFFECT UNTIL 3 AM EST EARLY THIS MORNING...", "The Flood Watch continues for", "* A portion of west central Florida, including the following area, Coastal Pasco.", "* Until 3 AM EST early this morning", ], }, { "commentary": "EXA FFA", "name": "Hazard_FFA_3", "drtTime": "20100101_0700", "productType": "Hazard_FFA_Local", "cmdLineVars": "{('Flood Reason', 'floodReason'): 'DM '}", "createGrids": [ ("Fcst", "Hazards", "DISCRETE", -100, 100, "<None>", "all"), ("Fcst", "Hazards", "DISCRETE", 0, 3, "FA.A", ["FLZ149","FLZ057"]), ], "checkStrings": ["URGENT - IMMEDIATE BROADCAST REQUESTED", "Flood Watch", "National Weather Service Tampa Bay Ruskin FL", "FLZ057-", "/X.EXA.KTBW.FA.A.0001.000000T0000Z-100101T0800Z/", "/00000.0.DM.000000T0000Z.000000T0000Z.000000T0000Z.OO/", "...FLOOD WATCH IN EFFECT UNTIL 3 AM EST EARLY THIS MORNING...", "The National Weather Service in Tampa Bay Ruskin has expanded the", "* Flood Watch to include a portion of south central Florida, including the following area, Highlands.", "* Until 3 AM EST early this morning", "FLZ149-", "/X.CON.KTBW.FA.A.0001.000000T0000Z-100101T0800Z/", "/00000.0.DM.000000T0000Z.000000T0000Z.000000T0000Z.OO/", "...FLOOD WATCH REMAINS IN EFFECT UNTIL 3 AM EST EARLY THIS MORNING...", "The Flood Watch continues for", "* A portion of west central Florida, including the following area, Coastal Pasco.", "* Until 3 AM EST early this morning", ], }, { "commentary": "CAN FFA, NEW FFA", "name": "Hazard_FFA_4", "drtTime": "20100101_0720", "productType": "Hazard_FFA_Local", "cmdLineVars": "{('Flood Reason', 'floodReason'): 'IJ '}", "createGrids": [ ("Fcst", "Hazards", "DISCRETE", -100, 100, "<None>", "all"), ("Fcst", "Hazards", "DISCRETE", 0, 8, "FF.A", ["FLZ057"]), ("Fcst", "Hazards", "DISCRETE", 24, 32, "FF.A", ["FLZ057"]), ], "checkStrings": ["URGENT - IMMEDIATE BROADCAST REQUESTED", "Flood Watch", "National Weather Service Tampa Bay Ruskin FL", "FLZ057-", "/X.CAN.KTBW.FA.A.0001.000000T0000Z-100101T0800Z/", "/X.NEW.KTBW.FF.A.0001.100101T0720Z-100101T1300Z/", "/X.NEW.KTBW.FF.A.0002.100102T0500Z-100102T1300Z/", "/00000.0.IJ.000000T0000Z.000000T0000Z.000000T0000Z.OO/", "...FLASH FLOOD WATCH IN EFFECT UNTIL 8 AM EST THIS MORNING...", "...FLASH FLOOD WATCH IN EFFECT FROM LATE TONIGHT THROUGH SATURDAY MORNING...", "...FLOOD WATCH IS CANCELLED...", "The National Weather Service in Tampa Bay Ruskin has issued a", "* Flash Flood Watch for a portion of south central Florida, including the following area, Highlands.", "* Until 8 AM EST this morning", "The National Weather Service in Tampa Bay Ruskin has issued a", "* Flash Flood Watch for a portion of south central Florida, including the following area, Highlands.", "* From late tonight through Saturday morning", "The Flood Watch for a portion of south central Florida has been cancelled.", "FLZ149-", "/X.CAN.KTBW.FA.A.0001.000000T0000Z-100101T0800Z/", "/00000.0.IJ.000000T0000Z.000000T0000Z.000000T0000Z.OO/", "...FLOOD WATCH IS CANCELLED...", "The Flood Watch for a portion of west central Florida has been cancelled." ], }, { "commentary": "EXP FFA, 2 NEW FFA", "name": "Hazard_FFA_5", "drtTime": "20100101_1300", "productType": "Hazard_FFA_Local", "cmdLineVars": "{('Flood Reason', 'floodReason'): 'FS '}", "createGrids": [ ("Fcst", "Hazards", "DISCRETE", -100, 100, "<None>", "all"), ("Fcst", "Hazards", "DISCRETE", 24, 32, "FF.A", ["FLZ057"]), ("Fcst", "Hazards", "DISCRETE", 46, 62, "FF.A", ["FLZ057"]), ("Fcst", "Hazards", "DISCRETE", 45, 46, "FA.A", ["FLZ149"]), ("Fcst", "Hazards", "DISCRETE", 46, 62, "FA.A", ["FLZ149"]), ("Fcst", "Hazards", "DISCRETE", 62, 68, "FA.A", ["FLZ149"]), ], "checkStrings": ["URGENT - IMMEDIATE BROADCAST REQUESTED", "Flood Watch", "National Weather Service Tampa Bay Ruskin FL", "FLZ057-", "/X.EXP.KTBW.FF.A.0001.000000T0000Z-100101T1300Z/", "/X.NEW.KTBW.FF.A.0003.100103T0300Z-100103T1900Z/", "/X.CON.KTBW.FF.A.0002.100102T0500Z-100102T1300Z/", "/00000.0.FS.000000T0000Z.000000T0000Z.000000T0000Z.OO/", "...FLASH FLOOD WATCH REMAINS IN EFFECT FROM LATE TONIGHT THROUGH SATURDAY MORNING...", "...FLASH FLOOD WATCH IN EFFECT FROM SATURDAY EVENING THROUGH SUNDAY AFTERNOON...", "...FLASH FLOOD WATCH HAS EXPIRED...", "The Flash Flood Watch continues for", "* A portion of south central Florida, including the following area, Highlands.", "* From late tonight through Saturday morning", "The National Weather Service in Tampa Bay Ruskin has issued a", "* Flash Flood Watch for a portion of south central Florida, including the following area, Highlands.", "* From Saturday evening through Sunday afternoon", "The Flash Flood Watch for a portion of south central Florida has expired.", "FLZ149-", "/X.NEW.KTBW.FA.A.0002.100103T0200Z-100104T0100Z/", "/00000.0.FS.000000T0000Z.000000T0000Z.000000T0000Z.OO/", "...FLOOD WATCH IN EFFECT FROM SATURDAY EVENING THROUGH SUNDAY EVENING...", "The National Weather Service in Tampa Bay Ruskin has issued a", "* Flood Watch for a portion of west central Florida, including the following area, Coastal Pasco.", "* From Saturday evening through Sunday evening", ], }, { "commentary": "CON test of multiple events", "name": "Hazard_FFA_6", "drtTime": "20100102_0300", "productType": "Hazard_FFA_Local", "cmdLineVars": "{('Flood Reason', 'floodReason'): 'RS '}", "createGrids": [ ("Fcst", "Hazards", "DISCRETE", -100, 100, "<None>", "all"), ("Fcst", "Hazards", "DISCRETE", 24, 32, "FF.A", ["FLZ057"]), ("Fcst", "Hazards", "DISCRETE", 46, 62, "FF.A", ["FLZ057"]), ("Fcst", "Hazards", "DISCRETE", 45, 46, "FA.A", ["FLZ149"]), ("Fcst", "Hazards", "DISCRETE", 46, 62, "FA.A", ["FLZ149"]), ("Fcst", "Hazards", "DISCRETE", 62, 68, "FA.A", ["FLZ149"]), ], "checkStrings": ["Flood Watch", "National Weather Service Tampa Bay Ruskin FL", "FLZ057-", "/X.CON.KTBW.FF.A.0002.100102T0500Z-100102T1300Z/", "/X.CON.KTBW.FF.A.0003.100103T0300Z-100103T1900Z/", "/00000.0.RS.000000T0000Z.000000T0000Z.000000T0000Z.OO/", "...FLASH FLOOD WATCH REMAINS IN EFFECT UNTIL 8 AM EST SATURDAY...", "...FLASH FLOOD WATCH REMAINS IN EFFECT FROM SATURDAY EVENING THROUGH SUNDAY AFTERNOON...", "The Flash Flood Watch continues for", "* A portion of south central Florida, including the following area, Highlands.", "* Until 8 AM EST Saturday", "The Flash Flood Watch continues for", "* A portion of south central Florida, including the following area, Highlands.", "* From Saturday evening through Sunday afternoon", "FLZ149-", "/X.CON.KTBW.FA.A.0002.100103T0200Z-100104T0100Z/", "/00000.0.RS.000000T0000Z.000000T0000Z.000000T0000Z.OO/", "...FLOOD WATCH REMAINS IN EFFECT FROM SATURDAY EVENING THROUGH SUNDAY EVENING...", "The Flood Watch continues for", "* A portion of west central Florida, including the following area, Coastal Pasco.", "* From Saturday evening through Sunday evening", ], }, { "commentary": "middle of 1st event", "name": "Hazard_FFA_7", "drtTime": "20100102_0700", "productType": "Hazard_FFA_Local", "cmdLineVars": "{('Flood Reason', 'floodReason'): 'ER '}", "createGrids": [ ("Fcst", "Hazards", "DISCRETE", -100, 100, "<None>", "all"), ("Fcst", "Hazards", "DISCRETE", 24, 32, "FF.A", ["FLZ057"]), ("Fcst", "Hazards", "DISCRETE", 46, 62, "FF.A", ["FLZ057"]), ("Fcst", "Hazards", "DISCRETE", 45, 46, "FA.A", ["FLZ149"]), ("Fcst", "Hazards", "DISCRETE", 46, 62, "FA.A", ["FLZ149"]), ("Fcst", "Hazards", "DISCRETE", 62, 68, "FA.A", ["FLZ149"]), ], "checkStrings": ["Flood Watch", "National Weather Service Tampa Bay Ruskin FL", "FLZ057-", "/X.CON.KTBW.FF.A.0002.000000T0000Z-100102T1300Z/", "/X.CON.KTBW.FF.A.0003.100103T0300Z-100103T1900Z/", "/00000.0.ER.000000T0000Z.000000T0000Z.000000T0000Z.OO/", "...FLASH FLOOD WATCH REMAINS IN EFFECT UNTIL 8 AM EST THIS MORNING...", "...FLASH FLOOD WATCH REMAINS IN EFFECT FROM THIS EVENING THROUGH SUNDAY AFTERNOON...", "The Flash Flood Watch continues for", "* A portion of south central Florida, including the following area, Highlands.", "* Until 8 AM EST this morning", "The Flash Flood Watch continues for", "* A portion of south central Florida, including the following area, Highlands.", "* From this evening through Sunday afternoon", "FLZ149-", "/X.CON.KTBW.FA.A.0002.100103T0200Z-100104T0100Z/", "/00000.0.ER.000000T0000Z.000000T0000Z.000000T0000Z.OO/", "...FLOOD WATCH REMAINS IN EFFECT FROM THIS EVENING THROUGH SUNDAY EVENING...", "The Flood Watch continues for", "* A portion of west central Florida, including the following area, Coastal Pasco.", "* From this evening through Sunday evening", ], }, { "commentary": "joining two events", "name": "Hazard_FFA_8", "drtTime": "20100102_1200", "productType": "Hazard_FFA_Local", "cmdLineVars": "{('Flood Reason', 'floodReason'): 'IC '}", "createGrids": [ ("Fcst", "Hazards", "DISCRETE", -100, 100, "<None>", "all"), ("Fcst", "Hazards", "DISCRETE", 24, 45, "FF.A", ["FLZ057"]), ("Fcst", "Hazards", "DISCRETE", 45, 62, "FF.A", ["FLZ057"]), ("Fcst", "Hazards", "DISCRETE", 45, 62, "FA.A", ["FLZ149"]), ("Fcst", "Hazards", "DISCRETE", 62, 68, "FA.A", ["FLZ149"]), ], "checkStrings": ["URGENT - IMMEDIATE BROADCAST REQUESTED", "Flood Watch", "National Weather Service Tampa Bay Ruskin FL", "FLZ057-", "/X.CAN.KTBW.FF.A.0002.000000T0000Z-100102T1300Z/", "/X.EXT.KTBW.FF.A.0003.100102T1200Z-100103T1900Z/", "/00000.0.IC.000000T0000Z.000000T0000Z.000000T0000Z.OO/", "...FLASH FLOOD WATCH NOW IN EFFECT THROUGH SUNDAY AFTERNOON...", "The Flash Flood Watch is now in effect for", "* A portion of south central Florida, including the following area, Highlands.", "* Through Sunday afternoon", "FLZ149-", "/X.CON.KTBW.FA.A.0002.100103T0200Z-100104T0100Z/", "/00000.0.IC.000000T0000Z.000000T0000Z.000000T0000Z.OO/", "...FLOOD WATCH REMAINS IN EFFECT FROM THIS EVENING THROUGH SUNDAY EVENING...", "The Flood Watch continues for", "* A portion of west central Florida, including the following area, Coastal Pasco.", "* From this evening through Sunday evening", ], }, { "commentary": "into the tail end of the events", "name": "Hazard_FFA_9", "drtTime": "20100103_1100", "productType": "Hazard_FFA_Local", "cmdLineVars": "{('Flood Reason', 'floodReason'): 'SM '}", "createGrids": [ ("Fcst", "Hazards", "DISCRETE", -100, 100, "<None>", "all"), ("Fcst", "Hazards", "DISCRETE", 24, 45, "FF.A", ["FLZ057"]), ("Fcst", "Hazards", "DISCRETE", 45, 62, "FF.A", ["FLZ057"]), ("Fcst", "Hazards", "DISCRETE", 45, 62, "FA.A", ["FLZ149"]), ("Fcst", "Hazards", "DISCRETE", 62, 68, "FA.A", ["FLZ149"]), ], "checkStrings": ["Flood Watch", "National Weather Service Tampa Bay Ruskin FL", "FLZ057-", "/X.CON.KTBW.FF.A.0003.000000T0000Z-100103T1900Z/", "/00000.0.SM.000000T0000Z.000000T0000Z.000000T0000Z.OO/", "...FLASH FLOOD WATCH REMAINS IN EFFECT UNTIL 2 PM EST THIS AFTERNOON...", "The Flash Flood Watch continues for", "* A portion of south central Florida, including the following area, Highlands.", "* Until 2 PM EST this afternoon", "FLZ149-", "/X.CON.KTBW.FA.A.0002.000000T0000Z-100104T0100Z/", "/00000.0.SM.000000T0000Z.000000T0000Z.000000T0000Z.OO/", "...FLOOD WATCH REMAINS IN EFFECT THROUGH THIS EVENING...", "The Flood Watch continues for", "* A portion of west central Florida, including the following area, Coastal Pasco.", "* Through this evening", ], }, { "commentary": "exp 1st event, continue 2nd event", "name": "Hazard_FFA_10", "drtTime": "20100103_1855", "productType": "Hazard_FFA_Local", "cmdLineVars": "{('Flood Reason', 'floodReason'): 'DR '}", "createGrids": [ ("Fcst", "Hazards", "DISCRETE", -100, 100, "<None>", "all"), ("Fcst", "Hazards", "DISCRETE", 24, 45, "FF.A", ["FLZ057"]), ("Fcst", "Hazards", "DISCRETE", 45, 62, "FF.A", ["FLZ057"]), ("Fcst", "Hazards", "DISCRETE", 45, 62, "FA.A", ["FLZ149"]), ("Fcst", "Hazards", "DISCRETE", 62, 68, "FA.A", ["FLZ149"]), ], "checkStrings": ["Flood Watch", "National Weather Service Tampa Bay Ruskin FL", "FLZ057-", "/X.EXP.KTBW.FF.A.0003.000000T0000Z-100103T1900Z/", "/00000.0.DR.000000T0000Z.000000T0000Z.000000T0000Z.OO/", "...FLASH FLOOD WATCH WILL EXPIRE AT 2 PM EST THIS AFTERNOON...", "The Flash Flood Watch for a portion of south central Florida will expire at 2 PM EST this afternoon.", "FLZ149-", "/X.CON.KTBW.FA.A.0002.000000T0000Z-100104T0100Z/", "/00000.0.DR.000000T0000Z.000000T0000Z.000000T0000Z.OO/", "...FLOOD WATCH REMAINS IN EFFECT UNTIL 8 PM EST THIS EVENING...", "The Flood Watch continues for", "* A portion of west central Florida, including the following area, Coastal Pasco.", "* Until 8 PM EST this evening", ], }, { "commentary": "cancel 2nd event", "name": "Hazard_FFA_11", "drtTime": "20100104_0000", "productType": "Hazard_FFA_Local", "cmdLineVars": "{('Flood Reason', 'floodReason'): 'GO '}", "createGrids": [ ("Fcst", "Hazards", "DISCRETE", -100, 100, "<None>", "all"), ], "checkStrings": ["Flood Watch", "National Weather Service Tampa Bay Ruskin FL", "FLZ149-", "/X.CAN.KTBW.FA.A.0002.000000T0000Z-100104T0100Z/", "/00000.0.GO.000000T0000Z.000000T0000Z.000000T0000Z.OO/", "...FLOOD WATCH IS CANCELLED...", "The Flood Watch for a portion of west central Florida has been cancelled.", ], }, { "commentary": "Deleting hazard grids.", "name": "Hazard_FFA_12", "productType": None, "checkStrings": [], "clearHazardsTable": 1, }, # Begin detailed phrasing of location tests { "commentary": "one state, single area, w/o location", "name": "Hazard_FFA_13a", "drtTime": "20100101_0510", "productType": "Hazard_FFA_Local", "cmdLineVars": "{('Flood Reason', 'floodReason'): 'ER '}", "decodeVTEC": 0, "vtecMode": "O", "fileChanges": [("AreaDictionary", "TextUtility", "add", areaT1, "delete"),], "createGrids": [ ("Fcst", "Hazards", "DISCRETE", -100, 100, "<None>", "all"), ("Fcst", "Hazards", "DISCRETE", 0, 3, "FA.A", ["FLZ050"]), ], "checkStrings": [ "WGUS62 KTBW 010510", "FFATBW", "URGENT - IMMEDIATE BROADCAST REQUESTED", "Flood Watch", "National Weather Service Tampa Bay Ruskin FL", "1210 AM EST Fri Jan 1 2010", "...|*Overview headline (must edit)*|...", ".|*Overview (must edit)*|.", "FLZ050-010800-", "/O.NEW.KTBW.FA.A.0001.100101T0510Z-100101T0800Z/", "/00000.0.ER.000000T0000Z.000000T0000Z.000000T0000Z.OO/", "Pinellas-", "1210 AM EST Fri Jan 1 2010", "...FLOOD WATCH IN EFFECT UNTIL 3 AM EST EARLY THIS MORNING...", "The National Weather Service in Tampa Bay Ruskin has issued a", "* Flood Watch for a portion of western Florida, including the following area, Pinellas.", "* Until 3 AM EST early this morning", "* |* Basis for the watch *|", "* |* (optional) potential impacts of flooding *|", "PRECAUTIONARY/PREPAREDNESS ACTIONS...", "A Flood Watch means there is a potential for flooding based on current forecasts.", "You should monitor later forecasts and be alert for possible Flood Warnings. Those living in areas prone to flooding should be prepared to take action should flooding develop.", "&&", "$$", ], }, { "commentary": "one state, single area, w location", "name": "Hazard_FFA_13b", "drtTime": "20100101_0510", "productType": "Hazard_FFA_Local", "cmdLineVars": "{('Flood Reason', 'floodReason'): 'ER '}", "decodeVTEC": 0, "vtecMode": "O", "fileChanges": [("AreaDictionary", "TextUtility", "add", areaT2, "delete"),], "createGrids": [ ("Fcst", "Hazards", "DISCRETE", -100, 100, "<None>", "all"), ("Fcst", "Hazards", "DISCRETE", 0, 3, "FA.A", ["FLZ050"]), ], "checkStrings": [ "WGUS62 KTBW 010510", "FFATBW", "URGENT - IMMEDIATE BROADCAST REQUESTED", "Flood Watch", "National Weather Service Tampa Bay Ruskin FL", "1210 AM EST Fri Jan 1 2010", "...|*Overview headline (must edit)*|...", ".|*Overview (must edit)*|.", "FLZ050-010800-", "/O.NEW.KTBW.FA.A.0001.100101T0510Z-100101T0800Z/", "/00000.0.ER.000000T0000Z.000000T0000Z.000000T0000Z.OO/", "Pinellas-", "1210 AM EST Fri Jan 1 2010", "...FLOOD WATCH IN EFFECT UNTIL 3 AM EST EARLY THIS MORNING...", "The National Weather Service in Tampa Bay Ruskin has issued a", "* Flood Watch for a portion of western Florida, including the following area, Clearfield.", "* Until 3 AM EST early this morning", "* |* Basis for the watch *|", "* |* (optional) potential impacts of flooding *|", "PRECAUTIONARY/PREPAREDNESS ACTIONS...", "A Flood Watch means there is a potential for flooding based on current forecasts.", "You should monitor later forecasts and be alert for possible Flood Warnings. Those living in areas prone to flooding should be prepared to take action should flooding develop.", "&&", "$$", ], }, { "commentary": "two states, single area, w/o location", "name": "Hazard_FFA_14a", "drtTime": "20100101_0510", "productType": "Hazard_FFA_Local", "cmdLineVars": "{('Flood Reason', 'floodReason'): 'ER '}", "decodeVTEC": 0, "vtecMode": "O", "fileChanges": [("AreaDictionary", "TextUtility", "add", areaT1, "delete"),], "createGrids": [ ("Fcst", "Hazards", "DISCRETE", -100, 100, "<None>", "all"), ("Fcst", "Hazards", "DISCRETE", 0, 3, "FA.A", ["FLZ050","FLZ057", "FLZ052","FLZ155"]), ], "checkStrings": [ "WGUS62 KTBW 010510", "FFATBW", "URGENT - IMMEDIATE BROADCAST REQUESTED", "Flood Watch", "National Weather Service Tampa Bay Ruskin FL", "1210 AM EST Fri Jan 1 2010", "...|*Overview headline (must edit)*|...", ".|*Overview (must edit)*|.", "FLZ050-052-057-155-010800-", "/O.NEW.KTBW.FA.A.0001.100101T0510Z-100101T0800Z/", "/00000.0.ER.000000T0000Z.000000T0000Z.000000T0000Z.OO/", "Pinellas-Polk-Highlands-Coastal Manatee-", # "Including the cities of St. Petersburg, Clearwater, Largo, ", # "Lakeland, Winter Haven, Bradenton, Bayshore Gardens, ", # "Palmetto, Sebring, Avon Park, Placid Lakes", "1210 AM EST Fri Jan 1 2010", "...FLOOD WATCH IN EFFECT UNTIL 3 AM EST EARLY THIS MORNING...", "The National Weather Service in Tampa Bay Ruskin has issued a", "* Flood Watch for portions of western Florida and western Georgia, including the following areas, in western Florida, Highlands and Pinellas. In western Georgia, Coastal Manatee and Polk.", "* Until 3 AM EST early this morning", "* |* Basis for the watch *|", "* |* (optional) potential impacts of flooding *|", "PRECAUTIONARY/PREPAREDNESS ACTIONS...", "A Flood Watch means there is a potential for flooding based on current forecasts.", "You should monitor later forecasts and be alert for possible Flood Warnings. Those living in areas prone to flooding should be prepared to take action should flooding develop.", "&&", "$$", ], }, { "commentary": "two states, single area, w location", "name": "Hazard_FFA_14b", "drtTime": "20100101_0510", "productType": "Hazard_FFA_Local", "cmdLineVars": "{('Flood Reason', 'floodReason'): 'ER '}", "decodeVTEC": 0, "vtecMode": "O", "fileChanges": [("AreaDictionary", "TextUtility", "add", areaT2, "delete"),], "createGrids": [ ("Fcst", "Hazards", "DISCRETE", -100, 100, "<None>", "all"), ("Fcst", "Hazards", "DISCRETE", 0, 3, "FA.A", ["FLZ050","FLZ057", "FLZ052","FLZ155"]), ], "checkStrings": [ "WGUS62 KTBW 010510", "FFATBW", "URGENT - IMMEDIATE BROADCAST REQUESTED", "Flood Watch", "National Weather Service Tampa Bay Ruskin FL", "1210 AM EST Fri Jan 1 2010", "...|*Overview headline (must edit)*|...", ".|*Overview (must edit)*|.", "FLZ050-052-057-155-010800-", "/O.NEW.KTBW.FA.A.0001.100101T0510Z-100101T0800Z/", "/00000.0.ER.000000T0000Z.000000T0000Z.000000T0000Z.OO/", "Pinellas-Polk-Highlands-Coastal Manatee-", "1210 AM EST Fri Jan 1 2010", "...FLOOD WATCH IN EFFECT UNTIL 3 AM EST EARLY THIS MORNING...", "The National Weather Service in Tampa Bay Ruskin has issued a", "* Flood Watch for portions of western Florida and western Georgia, including the following areas, in western Florida, Clearfield. In western Georgia, Atlanta and Tampa.", "* Until 3 AM EST early this morning", "* |* Basis for the watch *|", "* |* (optional) potential impacts of flooding *|", "PRECAUTIONARY/PREPAREDNESS ACTIONS...", "A Flood Watch means there is a potential for flooding based on current forecasts.", "You should monitor later forecasts and be alert for possible Flood Warnings. Those living in areas prone to flooding should be prepared to take action should flooding develop.", "&&", "$$", ], }, { "commentary": "one state, multiple areas, w/o location", "name": "Hazard_FFA_15a", "drtTime": "20100101_0510", "productType": "Hazard_FFA_Local", "cmdLineVars": "{('Flood Reason', 'floodReason'): 'ER '}", "decodeVTEC": 0, "vtecMode": "O", "fileChanges": [("AreaDictionary", "TextUtility", "add", areaT1, "delete"),], "createGrids": [ ("Fcst", "Hazards", "DISCRETE", -100, 100, "<None>", "all"), ("Fcst", "Hazards", "DISCRETE", 0, 3, "FA.A", ["FLZ050","FLZ160", "FLZ057","FLZ151","FLZ056"]), ], "checkStrings": [ "WGUS62 KTBW 010510", "FFATBW", "URGENT - IMMEDIATE BROADCAST REQUESTED", "Flood Watch", "National Weather Service Tampa Bay Ruskin FL", "1210 AM EST Fri Jan 1 2010", "...|*Overview headline (must edit)*|...", ".|*Overview (must edit)*|.", "FLZ050-056-057-151-160-010800-", "/O.NEW.KTBW.FA.A.0001.100101T0510Z-100101T0800Z/", "/00000.0.ER.000000T0000Z.000000T0000Z.000000T0000Z.OO/", "Pinellas-Hardee-Highlands-Coastal Hillsborough-Coastal Sarasota-", "1210 AM EST Fri Jan 1 2010", "...FLOOD WATCH IN EFFECT UNTIL 3 AM EST EARLY THIS MORNING...", "The National Weather Service in Tampa Bay Ruskin has issued a", "* Flood Watch for portions of central Florida, southern Florida, and western Florida, including the following areas, in central Florida, Coastal Hillsborough and Coastal Sarasota. In southern Florida, Hardee. In western Florida, Highlands and Pinellas.", "* Until 3 AM EST early this morning", "* |* Basis for the watch *|", "* |* (optional) potential impacts of flooding *|", "PRECAUTIONARY/PREPAREDNESS ACTIONS...", "A Flood Watch means there is a potential for flooding based on current forecasts.", "You should monitor later forecasts and be alert for possible Flood Warnings. Those living in areas prone to flooding should be prepared to take action should flooding develop.", "&&", "$$", ], }, { "commentary": "one state, multiple areas, w location", "name": "Hazard_FFA_15b", "drtTime": "20100101_0510", "productType": "Hazard_FFA_Local", "cmdLineVars": "{('Flood Reason', 'floodReason'): 'ER '}", "decodeVTEC": 0, "vtecMode": "O", "fileChanges": [("AreaDictionary", "TextUtility", "add", areaT2, "delete"),], "createGrids": [ ("Fcst", "Hazards", "DISCRETE", -100, 100, "<None>", "all"), ("Fcst", "Hazards", "DISCRETE", 0, 3, "FA.A", ["FLZ050","FLZ160", "FLZ057","FLZ151","FLZ056"]), ], "checkStrings": [ "WGUS62 KTBW 010510", "FFATBW", "URGENT - IMMEDIATE BROADCAST REQUESTED", "Flood Watch", "National Weather Service Tampa Bay Ruskin FL", "1210 AM EST Fri Jan 1 2010", "...|*Overview headline (must edit)*|...", ".|*Overview (must edit)*|.", "FLZ050-056-057-151-160-010800-", "/O.NEW.KTBW.FA.A.0001.100101T0510Z-100101T0800Z/", "/00000.0.ER.000000T0000Z.000000T0000Z.000000T0000Z.OO/", "Pinellas-Hardee-Highlands-Coastal Hillsborough-Coastal Sarasota-", "1210 AM EST Fri Jan 1 2010", "...FLOOD WATCH IN EFFECT UNTIL 3 AM EST EARLY THIS MORNING...", "The National Weather Service in Tampa Bay Ruskin has issued a", "* Flood Watch for portions of central Florida, southern Florida, and western Florida, including the following areas, in central Florida, Aunt Ruby. In southern Florida, Tampa. In western Florida, Clearfield.", "* Until 3 AM EST early this morning", "* |* Basis for the watch *|", "* |* (optional) potential impacts of flooding *|", "PRECAUTIONARY/PREPAREDNESS ACTIONS...", "A Flood Watch means there is a potential for flooding based on current forecasts.", "You should monitor later forecasts and be alert for possible Flood Warnings. Those living in areas prone to flooding should be prepared to take action should flooding develop.", "&&", "$$", ], }, { "commentary": "two states, single area 1st, mulitple area 2nd, w/o location", "name": "Hazard_FFA_16a", "drtTime": "20100101_0510", "productType": "Hazard_FFA_Local", "cmdLineVars": "{('Flood Reason', 'floodReason'): 'ER '}", "decodeVTEC": 0, "vtecMode": "O", "fileChanges": [("AreaDictionary", "TextUtility", "add", areaT1, "delete"),], "createGrids": [ ("Fcst", "Hazards", "DISCRETE", -100, 100, "<None>", "all"), ("Fcst", "Hazards", "DISCRETE", 0, 3, "FA.A", ["FLZ050","FLZ052", "FLZ155","FLZ061"]), ], "checkStrings": [ "WGUS62 KTBW 010510", "FFATBW", "URGENT - IMMEDIATE BROADCAST REQUESTED", "Flood Watch", "National Weather Service Tampa Bay Ruskin FL", "1210 AM EST Fri Jan 1 2010", "...|*Overview headline (must edit)*|...", ".|*Overview (must edit)*|.", "FLZ050-052-061-155-010800-", "/O.NEW.KTBW.FA.A.0001.100101T0510Z-100101T0800Z/", "/00000.0.ER.000000T0000Z.000000T0000Z.000000T0000Z.OO/", "Pinellas-Polk-DeSoto-Coastal Manatee-", "1210 AM EST Fri Jan 1 2010", "...FLOOD WATCH IN EFFECT UNTIL 3 AM EST EARLY THIS MORNING...", "The National Weather Service in Tampa Bay Ruskin has issued a", "* Flood Watch for portions of western Florida and Georgia, including the following areas, in western Florida, Pinellas. In Georgia, Coastal Manatee, DeSoto, and Polk.", "* Until 3 AM EST early this morning", "* |* Basis for the watch *|", "* |* (optional) potential impacts of flooding *|", "PRECAUTIONARY/PREPAREDNESS ACTIONS...", "A Flood Watch means there is a potential for flooding based on current forecasts.", "You should monitor later forecasts and be alert for possible Flood Warnings. Those living in areas prone to flooding should be prepared to take action should flooding develop.", "&&", "$$", ], }, { "commentary": "two states, single area 1st, mulitple area 2nd, w location", "name": "Hazard_FFA_16b", "drtTime": "20100101_0510", "productType": "Hazard_FFA_Local", "cmdLineVars": "{('Flood Reason', 'floodReason'): 'ER '}", "decodeVTEC": 0, "vtecMode": "O", "fileChanges": [("AreaDictionary", "TextUtility", "add", areaT2, "delete"),], "createGrids": [ ("Fcst", "Hazards", "DISCRETE", -100, 100, "<None>", "all"), ("Fcst", "Hazards", "DISCRETE", 0, 3, "FA.A", ["FLZ050","FLZ052", "FLZ155","FLZ061"]), ], "checkStrings": [ "WGUS62 KTBW 010510", "FFATBW", "URGENT - IMMEDIATE BROADCAST REQUESTED", "Flood Watch", "National Weather Service Tampa Bay Ruskin FL", "1210 AM EST Fri Jan 1 2010", "...|*Overview headline (must edit)*|...", ".|*Overview (must edit)*|.", "FLZ050-052-061-155-010800-", "/O.NEW.KTBW.FA.A.0001.100101T0510Z-100101T0800Z/", "/00000.0.ER.000000T0000Z.000000T0000Z.000000T0000Z.OO/", "Pinellas-Polk-DeSoto-Coastal Manatee-", "1210 AM EST Fri Jan 1 2010", "...FLOOD WATCH IN EFFECT UNTIL 3 AM EST EARLY THIS MORNING...", "The National Weather Service in Tampa Bay Ruskin has issued a", "* Flood Watch for portions of western Florida and Georgia, including the following areas, in western Florida, Clearfield. In Georgia, Atlanta, Beach, and Tampa.", "* Until 3 AM EST early this morning", "* |* Basis for the watch *|", "* |* (optional) potential impacts of flooding *|", "PRECAUTIONARY/PREPAREDNESS ACTIONS...", "A Flood Watch means there is a potential for flooding based on current forecasts.", "You should monitor later forecasts and be alert for possible Flood Warnings. Those living in areas prone to flooding should be prepared to take action should flooding develop.", "&&", "$$", ], }, { "commentary": "two states, multiple areas, w/o location", "name": "Hazard_FFA_17a", "drtTime": "20100101_0510", "productType": "Hazard_FFA_Local", "cmdLineVars": "{('Flood Reason', 'floodReason'): 'ER '}", "decodeVTEC": 0, "vtecMode": "O", "fileChanges": [("AreaDictionary", "TextUtility", "add", areaT1, "delete"),], "createGrids": [ ("Fcst", "Hazards", "DISCRETE", -100, 100, "<None>", "all"), ("Fcst", "Hazards", "DISCRETE", 0, 3, "FA.A", ["FLZ050","FLZ057", "FLZ160","FLZ151","FLZ052","FLZ155","FLZ061","FLZ148"]), ], "checkStrings": [ "WGUS62 KTBW 010510", "FFATBW", "URGENT - IMMEDIATE BROADCAST REQUESTED", "Flood Watch", "National Weather Service Tampa Bay Ruskin FL", "1210 AM EST Fri Jan 1 2010", "...|*Overview headline (must edit)*|...", ".|*Overview (must edit)*|.", "FLZ050-052-057-061-148-151-155-160-010800-", "/O.NEW.KTBW.FA.A.0001.100101T0510Z-100101T0800Z/", "/00000.0.ER.000000T0000Z.000000T0000Z.000000T0000Z.OO/", "Pinellas-Polk-Highlands-DeSoto-Coastal Hernando-", "Coastal Hillsborough-Coastal Manatee-Coastal Sarasota-", "1210 AM EST Fri Jan 1 2010", "...FLOOD WATCH IN EFFECT UNTIL 3 AM EST EARLY THIS MORNING...", "The National Weather Service in Tampa Bay Ruskin has issued a", "* Flood Watch for portions of Florida and Georgia, including the following areas, in Florida, Coastal Hillsborough, Coastal Sarasota, Highlands, and Pinellas. In Georgia, Coastal Hernando, Coastal Manatee, DeSoto, and Polk.", "* Until 3 AM EST early this morning", "* |* Basis for the watch *|", "* |* (optional) potential impacts of flooding *|", "PRECAUTIONARY/PREPAREDNESS ACTIONS...", "A Flood Watch means there is a potential for flooding based on current forecasts.", "You should monitor later forecasts and be alert for possible Flood Warnings. Those living in areas prone to flooding should be prepared to take action should flooding develop.", "&&", "$$", ], }, { "commentary": "two states, multiple areas, w location", "name": "Hazard_FFA_17b", "drtTime": "20100101_0510", "productType": "Hazard_FFA_Local", "cmdLineVars": "{('Flood Reason', 'floodReason'): 'ER '}", "decodeVTEC": 0, "vtecMode": "O", "fileChanges": [("AreaDictionary", "TextUtility", "add", areaT2, "delete"),], "createGrids": [ ("Fcst", "Hazards", "DISCRETE", -100, 100, "<None>", "all"), ("Fcst", "Hazards", "DISCRETE", 0, 3, "FA.A", ["FLZ050","FLZ057", "FLZ160","FLZ151","FLZ052","FLZ155","FLZ061","FLZ148"]), ], "checkStrings": [ "WGUS62 KTBW 010510", "FFATBW", "URGENT - IMMEDIATE BROADCAST REQUESTED", "Flood Watch", "National Weather Service Tampa Bay Ruskin FL", "1210 AM EST Fri Jan 1 2010", "...|*Overview headline (must edit)*|...", ".|*Overview (must edit)*|.", "FLZ050-052-057-061-148-151-155-160-010800-", "/O.NEW.KTBW.FA.A.0001.100101T0510Z-100101T0800Z/", "/00000.0.ER.000000T0000Z.000000T0000Z.000000T0000Z.OO/", "Pinellas-Polk-Highlands-DeSoto-Coastal Hernando-", "Coastal Hillsborough-Coastal Manatee-Coastal Sarasota-", "1210 AM EST Fri Jan 1 2010", "...FLOOD WATCH IN EFFECT UNTIL 3 AM EST EARLY THIS MORNING...", "The National Weather Service in Tampa Bay Ruskin has issued a", "* Flood Watch for portions of Florida and Georgia, including the following areas, in Florida, Aunt Ruby and Clearfield. In Georgia, Atlanta, Beach, and Tampa.", "* Until 3 AM EST early this morning", "* |* Basis for the watch *|", "* |* (optional) potential impacts of flooding *|", "PRECAUTIONARY/PREPAREDNESS ACTIONS...", "A Flood Watch means there is a potential for flooding based on current forecasts.", "You should monitor later forecasts and be alert for possible Flood Warnings. Those living in areas prone to flooding should be prepared to take action should flooding develop.", "&&", "$$", ], }, { "commentary": "parishes 1, independent 1, counties 1", "name": "Hazard_FFA_18a", "drtTime": "20100101_0510", "productType": "Hazard_FFA_Local", "cmdLineVars": "{('Flood Reason', 'floodReason'): 'ER '}", "decodeVTEC": 0, "vtecMode": "O", "fileChanges": [ ("AreaDictionary", "TextUtility", "add", areaT3, "delete"), ("Hazard_FFA_Local", "TextProduct", "replace", (areaT3FIPS0, areaT3FIPS1), "delete"), ], "createGrids": [ ("Fcst", "Hazards", "DISCRETE", -100, 100, "<None>", "all"), ("Fcst", "Hazards", "DISCRETE", 0, 3, "FA.A", ["FLC017","FLC027", "FLC053"]), ], "checkStrings": [ "WGUS62 KTBW 010510", "FFATBW", "URGENT - IMMEDIATE BROADCAST REQUESTED", "Flood Watch", "National Weather Service Tampa Bay Ruskin FL", "1210 AM EST Fri Jan 1 2010", "...|*Overview headline (must edit)*|...", ".|*Overview (must edit)*|.", "FLC017-027-053-010800-", "/O.NEW.KTBW.FA.A.0001.100101T0510Z-100101T0800Z/", "/00000.0.ER.000000T0000Z.000000T0000Z.000000T0000Z.OO/", "Citrus-DeSoto-Hernando-", "1210 AM EST Fri Jan 1 2010", "...FLOOD WATCH IN EFFECT UNTIL 3 AM EST EARLY THIS MORNING...", "The National Weather Service in Tampa Bay Ruskin has issued a", "* Flood Watch for portions of western Florida and western Louisiana, including the following county, independent city, and parish, in western Florida, Hernando. In western Louisiana, Citrus and DeSoto.", "* Until 3 AM EST early this morning", "* |* Basis for the watch *|", "* |* (optional) potential impacts of flooding *|", "PRECAUTIONARY/PREPAREDNESS ACTIONS...", "A Flood Watch means there is a potential for flooding based on current forecasts.", "You should monitor later forecasts and be alert for possible Flood Warnings. Those living in areas prone to flooding should be prepared to take action should flooding develop.", "&&", "$$", ], }, { "commentary": "parishes 2, independent 1, counties 1", "name": "Hazard_FFA_18b", "drtTime": "20100101_0510", "productType": "Hazard_FFA_Local", "cmdLineVars": "{('Flood Reason', 'floodReason'): 'ER '}", "decodeVTEC": 0, "vtecMode": "O", "fileChanges": [ ("AreaDictionary", "TextUtility", "add", areaT3, "delete"), ("Hazard_FFA_Local", "TextProduct", "replace", (areaT3FIPS0, areaT3FIPS1), "delete"), ], "createGrids": [ ("Fcst", "Hazards", "DISCRETE", -100, 100, "<None>", "all"), ("Fcst", "Hazards", "DISCRETE", 0, 3, "FA.A", ["FLC017","FLC027", "FLC053","FLC105"]), ], "checkStrings": [ "WGUS62 KTBW 010510", "FFATBW", "URGENT - IMMEDIATE BROADCAST REQUESTED", "Flood Watch", "National Weather Service Tampa Bay Ruskin FL", "1210 AM EST Fri Jan 1 2010", "...|*Overview headline (must edit)*|...", ".|*Overview (must edit)*|.", "FLC017-027-053-105-010800-", "/O.NEW.KTBW.FA.A.0001.100101T0510Z-100101T0800Z/", "/00000.0.ER.000000T0000Z.000000T0000Z.000000T0000Z.OO/", "Citrus-DeSoto-Hernando-Polk-", "1210 AM EST Fri Jan 1 2010", "...FLOOD WATCH IN EFFECT UNTIL 3 AM EST EARLY THIS MORNING...", "The National Weather Service in Tampa Bay Ruskin has issued a", "* Flood Watch for portions of western Florida and western Louisiana, including the following county, independent city, and parishes, in western Florida, Hernando. In western Louisiana, Citrus, DeSoto, and Polk.", "* Until 3 AM EST early this morning", "* |* Basis for the watch *|", "* |* (optional) potential impacts of flooding *|", "PRECAUTIONARY/PREPAREDNESS ACTIONS...", "A Flood Watch means there is a potential for flooding based on current forecasts.", "You should monitor later forecasts and be alert for possible Flood Warnings. Those living in areas prone to flooding should be prepared to take action should flooding develop.", "&&", "$$", ], }, ] import TestScript
[ 2235, 198, 2, 770, 3788, 373, 4166, 290, 1220, 393, 9518, 416, 7760, 1169, 261, 5834, 11, 198, 2, 12997, 284, 17453, 46133, 16945, 54, 12, 2713, 12, 34, 48, 12, 940, 3134, 351, 262, 1294, 5070, 13, 201, 198, 2, 220, 201, 198, 2,...
2.24784
21,873
import time old_input_value = False flag_falling_edge = None start = None flag_output_mask = False DELAY_CONST = 10 # delay time from falling edge ... . output = None if __name__ == '__main__': DELAY_CONST=int(input("Hello \nPlease Enter Your delay value here :")) while True: response_function()
[ 11748, 640, 201, 198, 201, 198, 201, 198, 727, 62, 15414, 62, 8367, 796, 10352, 201, 198, 32109, 62, 7207, 278, 62, 14907, 796, 6045, 201, 198, 9688, 796, 6045, 201, 198, 32109, 62, 22915, 62, 27932, 796, 10352, 201, 198, 35, 3698, ...
2.25
164
from ansiblemetrics.ansible_modules import DEPRECATED_MODULES_LIST from ansiblemetrics.ansible_metric import AnsibleMetric
[ 6738, 9093, 856, 4164, 10466, 13, 504, 856, 62, 18170, 1330, 5550, 47, 38827, 11617, 62, 33365, 6239, 1546, 62, 45849, 198, 6738, 9093, 856, 4164, 10466, 13, 504, 856, 62, 4164, 1173, 1330, 28038, 856, 9171, 1173, 628 ]
3.179487
39
""" This module does validation for data input in incidents """ import re
[ 37811, 770, 8265, 857, 21201, 329, 1366, 5128, 287, 10207, 37227, 198, 11748, 302, 628, 198, 220, 220, 220, 220 ]
4
20
#!/usr/bin/python from distutils.version import LooseVersion import argparse import logging import requests import re session = requests.Session() # authorization token TOKEN_URL = "https://auth.docker.io/token?service=registry.docker.io&scope=repository:%s:pull" # find all tags TAGS_URL = "https://index.docker.io/v2/%s/tags/list" TAG_RE = re.compile("^[\d]+(\.[\d]+)*$") # get image digest for target TARGET_DIGEST = "https://index.docker.io/v2/%(repository)s/manifests/%(tag)s" if __name__ == '__main__': parser = argparse.ArgumentParser( usage="""Version checker script This file retreives the latest version of ghost container image from docker hub It can be run with both python 2.7 and 3.6""") parser.add_argument("repository", nargs='?', help="repository name [default:library/ghost]", default="library/ghost") parser.add_argument('-d', '--debug', action='store_true') parser.add_argument('-q', '--quiet', action='store_true') args = parser.parse_args() # set up level of logging level = logging.INFO if args.quiet: level = logging.WARNING elif args.debug: level = logging.DEBUG # set up logging to console logging.basicConfig(format='%(levelname)s - %(funcName)s - %(message)s') logger = logging.getLogger() logger.setLevel(level) logging.debug(args) # version needs to be print to output in order to be retrieved by Makefile print(find_latest(args.repository))
[ 2, 48443, 14629, 14, 8800, 14, 29412, 198, 6738, 1233, 26791, 13, 9641, 1330, 6706, 577, 14815, 198, 198, 11748, 1822, 29572, 198, 11748, 18931, 198, 11748, 7007, 198, 11748, 302, 198, 198, 29891, 796, 7007, 13, 36044, 3419, 198, 198, ...
2.725777
547
from .terraform import TerraformManager import pytest from _pytest.tmpdir import TempPathFactory
[ 6738, 764, 353, 430, 687, 1330, 24118, 687, 13511, 198, 11748, 12972, 9288, 198, 6738, 4808, 9078, 9288, 13, 22065, 15908, 1330, 24189, 15235, 22810, 628 ]
3.769231
26
#!/usr/bin/env python # -*- coding: utf-8 -*- # # vim: encoding=utf-8 # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. from __future__ import unicode_literals from datetime import date # import os # import sys PATH = 'content' TIMEZONE = 'UTC' DEFAULT_LANG = u'en' AUTHOR = u'Treasurer Team' SITENAME = u'Apache Treasurer' SITEDOMAIN = 'treasurer.apache.org' SITEURL = 'https://treasurer.apache.org' # SITELOGO = 'https://treasurer.apache.org/images/logo.png' # SITEDESC = u'<blank>' SITEREPOSITORY = 'https://github.com/apache/treasurer-site/blob/main/content/pages/' TRADEMARKS = u'Apache and the Apache feather logo are trademarks or registered trademarks' CURRENTYEAR = date.today().year # Save pages using full directory preservation PAGES_PATHS = ['content'] # PATH_METADATA= '(?P<path_no_ext>.*)\..*' # PAGE_SAVE_AS= '{path_no_ext}.html' PAGE_URL = '{slug}.html' SLUGIFY_SOURCE = 'basename' PAGE_SAVE_AS = '{slug}.html' # We want to serve any images STATIC_PATHS = ['.htaccess', 'images'] # We don't use articles, but we don't want pelican to think # that content/ contains articles. ARTICLE_PATHS = ['articles'] # Disable these pages ARCHIVES_SAVE_AS = '' ARTICLE_SAVE_AS = '' AUTHORS_SAVE_AS = '' CATEGORIES_SAVE_AS = '' INDEX_SAVE_AS = '' TAGS_SAVE_AS = '' # Enable ATOM feed and Disable other feeds FEED_DOMAIN = SITEURL FEED_ALL_ATOM = 'feeds/all.atom.xml' CATEGORY_FEED_ATOM = None TRANSLATION_FEED_ATOM = None AUTHOR_FEED_ATOM = None AUTHOR_FEED_RSS = None # Pelican Plugins # The provided location. If the buildbot does not have a new plugin then look into requirements.txt PLUGIN_PATHS = ['./theme/plugins'] PLUGINS = ['toc', 'pelican-gfm', 'sitemap'] # TOC Generator TOC_HEADERS = r"h[1-6]" # Sitemap Generator SITEMAP = { "exclude": ["tag/", "category/"], "format": "xml", "priorities": { "articles": 0.1, "indexes": 0.1, "pages": 0.8 }, "changefreqs": { "articles": "never", "indexes": "never", "pages": "monthly" } } # Unused links LINKS = ( ) SOCIAL = ( ) DEFAULT_PAGINATION = False # Uncomment following line if you want document-relative URLs when developing # RELATIVE_URLS = True
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 198, 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 1303, 198, 2, 43907, 25, 21004, 28, 40477, 12, 23, 198, 2, 198, 2, 49962, 284, 262, 24843, 10442, 5693, 357, 1921, 37, 8...
2.738562
1,071
# -*- coding: utf-8 -*- #Copyright (c) 2010,12 Walter Bender #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 random import uniform from math import sin, cos, pi, sqrt from gettext import gettext as _ import gtk import cairo from taconstants import TURTLE_LAYER, DEFAULT_TURTLE_COLORS from tasprite_factory import SVG, svg_str_to_pixbuf from tacanvas import wrap100, COLOR_TABLE from sprites import Sprite from tautils import debug_output SHAPES = 36 def generate_turtle_pixbufs(colors): """ Generate pixbufs for generic turtles """ shapes = [] svg = SVG() svg.set_scale(1.0) for i in range(SHAPES): svg.set_orientation(i * 10) shapes.append(svg_str_to_pixbuf(svg.turtle(colors))) return shapes
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 2, 15269, 357, 66, 8, 3050, 11, 1065, 15819, 34535, 198, 198, 2, 5990, 3411, 318, 29376, 7520, 11, 1479, 286, 3877, 11, 284, 597, 1048, 16727, 257, 4866, 198, 2, 165...
3.15245
551
try: from django.forms.utils import pretty_name except ImportError: from django.forms.forms import pretty_name from django.template import Context from django.template.loader import render_to_string from .compat import context_flatten
[ 28311, 25, 198, 220, 220, 220, 422, 42625, 14208, 13, 23914, 13, 26791, 1330, 2495, 62, 3672, 198, 16341, 17267, 12331, 25, 198, 220, 220, 220, 422, 42625, 14208, 13, 23914, 13, 23914, 1330, 2495, 62, 3672, 198, 6738, 42625, 14208, 13...
3.450704
71
""" """ from eodc_openeo_bindings.map_utils import map_default def map_lt(process): """ """ param_dict = {'y': 'float'} return map_default(process, 'lt', 'apply', param_dict) def map_lte(process): """ """ param_dict = {'y': 'float'} return map_default(process, 'lte', 'apply', param_dict) def map_gt(process): """ """ param_dict = {'y': 'float'} return map_default(process, 'gt', 'apply', param_dict) def map_gte(process): """ """ param_dict = {'y': 'float'} return map_default(process, 'gte', 'apply', param_dict) def map_eq(process): """ """ param_dict = {'y': 'numpy.array'} # NOTE: how to map type dynamically to support strings? if 'delta' in process['arguments']: param_dict['delta'] = 'int' if 'case_sensitive' in process['arguments']: param_dict['case_sensitive'] = 'bool' return map_default(process, 'eq', 'apply', param_dict)
[ 37811, 198, 198, 37811, 198, 198, 6738, 304, 375, 66, 62, 404, 1734, 78, 62, 21653, 654, 13, 8899, 62, 26791, 1330, 3975, 62, 12286, 628, 198, 4299, 3975, 62, 2528, 7, 14681, 2599, 198, 220, 220, 220, 37227, 628, 220, 220, 220, 37...
2.421446
401
"""FLOW RELATED SYSTEM TEST CASES."""
[ 37811, 3697, 3913, 29749, 11617, 36230, 43001, 35106, 1546, 526, 15931, 198 ]
3.166667
12
#!/usr/bin/python # -*- coding: utf-8 -*- from flask import Flask, request, abort, render_template from datetime import timedelta import pymysql from search import start_search, decorate page_dir = "E:/WEBPAGES_RAW" app = Flask(__name__) app.config['DEBUG'] = True app.config['SEND_FILE_MAX_AGE_DEFAULT'] = timedelta(seconds=1) connection = pymysql.connect(host="localhost",port=3306,user="root",db="spicy_pot") cursor = connection.cursor() app.run(host='0.0.0.0',port=80,debug=True)
[ 2, 48443, 14629, 14, 8800, 14, 29412, 201, 198, 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 201, 198, 201, 198, 6738, 42903, 1330, 46947, 11, 2581, 11, 15614, 11, 8543, 62, 28243, 201, 198, 6738, 4818, 8079, 1330, 28...
2.507389
203
#!/usr/bin/env pvpython # -*- Python -*- (syntax highlighting) # ---------------------------------------------------------------------- # # Brad T. Aagaard, U.S. Geological Survey # Charles A. Williams, GNS Science # Matthew G. Knepley, University at Buffalo # # This code was developed as part of the Computational Infrastructure # for Geodynamics (http://geodynamics.org). # # Copyright (c) 2010-2021 University of California, Davis # # See LICENSE.md.md for license information. # # ---------------------------------------------------------------------- # Plot the undeformed domain as a gray wireframe and then the deformed # domain, colored by the value of the x-displacemenet. # User-specified parameters. # # Default values for parameters. To use different values, overwrite # them in the ParaView Python shell or on the command line. For # example, set OUTPUT_DIR to the absolute path if not starting # ParaView from the terminal shell where you ran PyLith: # # import os # OUTPUT_DIR = os.path.join(os.environ["HOME"], "src", "pylith", "examples", "2d", "subduction", "output") DEFAULTS = { "OUTPUT_DIR": "output", "SIM": "step02", "WARP_SCALE": 10.0e+3, "FIELD": "displacement", "FIELD_COMPONENT": "Magnitude", "TIMESTEP": 0, # Use 0 for first, -1 for last. } # ---------------------------------------------------------------------- from paraview.simple import * import os # ---------------------------------------------------------------------- if __name__ == "__main__": # Running from outside the ParaView GUI via pvpython import argparse parser = argparse.ArgumentParser() parser.add_argument("--output-dir", action="store", dest="output_dir", default=DEFAULTS["OUTPUT_DIR"]) parser.add_argument("--sim", action="store", dest="sim", default=DEFAULTS["SIM"]) parser.add_argument("--warp-scale", action="store", type=float, dest="warp_scale", default=DEFAULTS["WARP_SCALE"]) parser.add_argument("--field", action="store", dest="field", default=DEFAULTS["FIELD"]) parser.add_argument("--component", action="store", dest="field_component", default=DEFAULTS["FIELD_COMPONENT"]) parser.add_argument("--timestep", action="store", dest="timestep", default=-1) parser.add_argument("--screenshot", action="store", dest="screenshot") args = parser.parse_args() visualize(args) view = GetRenderView() view.CameraPosition = [78002.89373974672, -1531813.1739094853, 595774.2094961794] view.CameraFocalPoint = [-45014.6313325238, 149523.68421156122, -335271.271063906] view.CameraViewUp = [0.0, 0.0, 1.0] view.ViewSize = [960, 540] view.Update() if args.screenshot: WriteImage(args.screenshot) Interact() else: # Running inside the ParaView GUI visualize(Parameters()) # End of file
[ 2, 48443, 14629, 14, 8800, 14, 24330, 279, 85, 29412, 198, 2, 532, 9, 12, 11361, 532, 9, 12, 357, 1837, 41641, 21292, 8, 198, 2, 16529, 23031, 198, 2, 198, 2, 8114, 309, 13, 317, 8126, 446, 11, 471, 13, 50, 13, 34246, 13084, 1...
3.019068
944
from spaceone.inventory.libs.manager import AWSManager # todo: __init__ #
[ 6738, 2272, 505, 13, 24807, 13, 8019, 82, 13, 37153, 1330, 30865, 13511, 628, 198, 2, 284, 4598, 25, 11593, 15003, 834, 220, 220, 220, 220, 220, 198, 2, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 198 ]
2.214286
42
#!/usr/bin/env python import argparse import hashlib import os import tempfile from lib.config import s3_config from lib.util import download, rm_rf, s3put DIST_URL = 'https://atom.io/download/atom-shell/' if __name__ == '__main__': import sys sys.exit(main())
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 198, 198, 11748, 1822, 29572, 198, 11748, 12234, 8019, 198, 11748, 28686, 198, 11748, 20218, 7753, 198, 198, 6738, 9195, 13, 11250, 1330, 264, 18, 62, 11250, 198, 6738, 9195, 13, 22602, 1330,...
2.787879
99
# import the necessary packages from sklearn.cluster import KMeans import skimage import matplotlib.pyplot as plt import argparse import cv2 # import the necessary packages import numpy as np import cv2 # construct the argument parser and parse the arguments ap = argparse.ArgumentParser() ap.add_argument("-i", "--image", required = True, help = "Path to the image") ap.add_argument("-c", "--clusters", required = True, type = int, help = "# of clusters") args = vars(ap.parse_args()) # load the image and convert it from BGR to RGB so that # we can dispaly it with matplotlib image = cv2.imread(args["image"]) image2 = cv2.cvtColor(image, cv2.COLOR_BGR2RGB) image = skimage.color.rgb2lab(image2) # show our image plt.figure() plt.axis("off") plt.imshow(image2) # reshape the image to be a list of pixels imagedata = image.reshape((image.shape[0] * image.shape[1], 3)) # cluster the pixel intensities clt = KMeans(n_clusters = args["clusters"]) clt.fit(imagedata) hist = centroid_histogram(clt) bar = plot_colors(hist, clt.cluster_centers_) # show our color bar plt.figure() plt.axis("off") plt.imshow(bar) imagek=mean_image(image,clt) plt.figure() plt.axis("off") plt.imshow(imagek) plt.show()
[ 2, 1330, 262, 3306, 10392, 201, 198, 6738, 1341, 35720, 13, 565, 5819, 1330, 509, 5308, 504, 201, 198, 11748, 1341, 9060, 201, 198, 11748, 2603, 29487, 8019, 13, 9078, 29487, 355, 458, 83, 201, 198, 11748, 1822, 29572, 201, 198, 11748...
2.564682
487
from sys import argv from base64 import b64encode with open("data", 'rb') as fIn: b = fIn.read() print(b64encode(b).decode())
[ 6738, 25064, 1330, 1822, 85, 198, 6738, 2779, 2414, 1330, 275, 2414, 268, 8189, 198, 198, 4480, 1280, 7203, 7890, 1600, 705, 26145, 11537, 355, 277, 818, 25, 198, 220, 220, 220, 275, 796, 277, 818, 13, 961, 3419, 198, 220, 220, 220,...
2.436364
55
#!/usr/bin/env python # -*- coding: utf-8 -*- """ .. codeauthor:: Cdric Dumay <cedric.dumay@gmail.com> """ import logging import sys, os, json from cdumay_rest_client.client import RESTClient from cdumay_rest_client.exceptions import NotFound, HTTPException def oncritical(exc): """description of oncritical""" if isinstance(exc, HTTPException): logging.critical(exc.message) else: logging.critical(str(exc)) sys.exit(1) def file_exists(filename): """description of file_exists""" filename = os.path.realpath(filename) logging.debug("Checking file: {}".format(filename)) if not os.path.exists(filename): raise NoSuchFile( message="No such file '{}'".format(filename), extra=dict(filename=filename) ) return filename def file_write(dst, data): """description of file_write""" if dst: dst = os.path.realpath(dst) logging.debug("Saving to: {}".format(dst)) out = open(dst, "w") else: logging.debug("Current std will be used") out = sys.stdout json.dump( data, out, ensure_ascii=False, sort_keys=True, indent=2, separators=(',', ': ') ) def from_local(src, dst=None): """description of from_local""" try: file_write(dst, json.load(open(file_exists(src), "r"))) except Exception as exc: oncritical(exc) def from_remote(src, dst=None): """description of fromurl""" try: file_write( dst, RESTClient(server=src).do_request(method="GET", path="") ) except Exception as exc: oncritical(exc)
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 198, 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 198, 37811, 198, 492, 2438, 9800, 3712, 327, 67, 1173, 30933, 323, 1279, 771, 1173, 13, 67, 388, 323, 31, 14816, 13, ...
2.363112
694
import numpy as np import pytest import apexpy import tempfile import os import h5py from ttools import create_dataset, config, io, utils map_periods = [np.timedelta64(10, 'm'), np.timedelta64(30, 'm'), np.timedelta64(1, 'h'), np.timedelta64(2, 'h')] def test_calculate_bins(): mlat = np.arange(10)[None, :, None] * np.ones((1, 1, 10)) mlt = np.arange(10)[None, None, :] * np.ones((1, 10, 1)) tec = np.zeros((1, 10, 10)) tec[0, 0, 0] = 10 tec[0, 0, -1] = 20 tec[0, -1, 0] = 30 times = ssmlon = np.ones(1) * np.nan be = np.array([-.5, 4.5, 9.5]) bins = [be, be] out_t, out_tec, out_ssm, out_n, out_std = create_dataset.calculate_bins(mlat.ravel(), mlt.ravel(), tec.ravel(), times, ssmlon, bins) assert np.isnan(out_t) assert np.isnan(out_ssm) assert out_tec.shape == (2, 2) assert out_tec[0, 0] == 10 / 25 assert out_tec[0, 1] == 20 / 25 assert out_tec[1, 0] == 30 / 25 assert out_tec[1, 1] == 0 assert np.all(out_n == 25) def test_process_dataset(): start_date = np.datetime64("2012-03-07") end_date = np.datetime64("2012-03-08") file_dt = np.timedelta64(12, 'h') mlat_bins = np.array([35, 45, 55, 65]) mlt_bins = np.array([-1.5, -.5, .5, 1.5]) dates = np.arange(start_date, end_date, file_dt) with tempfile.TemporaryDirectory() as tempdir: files = [os.path.join(tempdir, fn_pattern(d)) for d in dates] create_dataset.process_dataset(start_date, end_date, mlat_bins, mlt_bins, apex_dt=np.timedelta64(365, 'D'), file_dt=file_dt, output_dir=tempdir, file_name_pattern=fn_pattern) grid_fn = os.path.join(tempdir, 'grid.h5') assert os.path.exists(grid_fn) with h5py.File(grid_fn, 'r') as f: mlt_vals = f['mlt'][()] mlat_vals = f['mlat'][()] assert np.all(mlt_vals == [-1, 0, 1]) assert np.all(mlat_vals == [40, 50, 60]) for f, d in zip(files, dates): assert os.path.exists(f) tec, times, ssmlon, n, std = io.open_tec_file(f) assert tec.shape == (12, 3, 3) assert utils.datetime64_to_timestamp(d) == times[0]
[ 11748, 299, 32152, 355, 45941, 198, 11748, 12972, 9288, 198, 11748, 40167, 9078, 198, 11748, 20218, 7753, 198, 11748, 28686, 198, 11748, 289, 20, 9078, 198, 198, 6738, 256, 31391, 1330, 2251, 62, 19608, 292, 316, 11, 4566, 11, 33245, 11...
1.930213
1,175
import typer if __name__ == "__main__": typer.run(main)
[ 11748, 1259, 525, 628, 628, 198, 361, 11593, 3672, 834, 6624, 366, 834, 12417, 834, 1298, 198, 220, 220, 220, 1259, 525, 13, 5143, 7, 12417, 8, 198 ]
2.285714
28
import socket import threading from time import sleep from threading import Thread import json import sys try: timeout = 5 if len(sys.argv) > 1: if (len(sys.argv) -1 ) % 2 != 0: print "\nInvalid number of arguments\n\n-t Time between tests in seconds\n" sys.exit() else: if sys.argv[1] == "-t" and sys.argv[2].isdigit() and int(sys.argv[2]) > 2: timeout = int(sys.argv[2]) else: print "\nInvalid arguments\n\n-t Time between tests in seconds\n" sys.exit() print "\nqft-client.py v1.s\n\n" json_cfg = json.loads(open("client.cfg").read()) print "Config loaded. Starting tests in 1 second...\n\n" sleep(1) while True: for item in json_cfg: if item["type"] == "tcp": t = Thread(target=TCPTest, args=( item["remote_address"], item["port"], item["test_for"])) elif item["type"] == "udp": t = Thread(target=UDPTest, args=( item["remote_address"], item["port"], item["test_for"])) else: print "Invalid Type!" t.start() sleep(timeout) print "\n=======================================================\n" except IOError as e: print("Config file, client.cfg, not found") sys.exit() except ValueError as e: print("Error in config JSON") sys.exit()
[ 11748, 17802, 201, 198, 11748, 4704, 278, 201, 198, 6738, 640, 1330, 3993, 201, 198, 6738, 4704, 278, 1330, 14122, 201, 198, 11748, 33918, 201, 198, 11748, 25064, 201, 198, 201, 198, 201, 198, 28311, 25, 201, 198, 220, 220, 220, 220, ...
1.95528
805
#!/usr/bin/env python2 import math import os import random import sys import time import logging import argparse import numpy as np from six.moves import xrange import json import torch import torch.nn as nn import torch.optim as optim from torch import cuda from torch.autograd import Variable from torch.nn.utils import clip_grad_norm import data_utils import network import cPickle as pickle import datetime parser = argparse.ArgumentParser() parser.add_argument('--param_init', type=float, default=0.1, help='Parameters are initialized over uniform distribution in (-param_init, param_init)') parser.add_argument('--num_epochs', type=int, default=30, help='number of training epochs') #default 30 parser.add_argument('--learning_rate', type=float, default=0.005, # default 0.005 help='learning rate') parser.add_argument('--learning_rate_decay_factor', type=float, default=0.8, help='learning rate decays by this much') parser.add_argument('--learning_rate_decay_steps', type=int, default=2000, # default=2000 help='decay the learning rate after certain steps') parser.add_argument('--max_gradient_norm', type=float, default=5.0, help='clip gradients to this norm') parser.add_argument('--batch_size', type=int, default=64, #default 100 help='batch size') parser.add_argument('--max_depth', type=int, default=100, help='max depth for tree models') parser.add_argument('--hidden_size', type=int, default=256, help='size of each model layer') parser.add_argument('--embedding_size', type=int, default=256, help='size of the embedding') parser.add_argument('--dropout_rate', type=float, default=0.75, # default=0.5 help='dropout rate') parser.add_argument('--num_layers', type=int, default=1, # default=1, help='number of layers in the model') parser.add_argument('--source_vocab_size', type=int, default=0, help='source vocabulary size (0: no limit)') parser.add_argument('--target_vocab_size', type=int, default=0, help='target vocabulary size (0: no limit)') parser.add_argument('--train_dir_checkpoints', type=str, default='/home/lola/nn/checkpoints', # default='../model_ckpts/tree2tree/', help='training directory - checkpoints') parser.add_argument('--training_dataset', type=str, default='/home/lola/nn/models_train.json', # default='../data/CS-JS/BL/preprocessed_progs_train.json', help='training dataset path') parser.add_argument('--validation_dataset', type=str, default='/home/lola/nn/models_valid.json', #default='../data/CS-JS/BL/preprocessed_progs_valid.json', help='validation dataset path') parser.add_argument('--test_dataset', type=str, default='/home/lola/nn/models_test.json', #default='../data/CS-JS/BL/preprocessed_progs_test.json', help='test dataset path') parser.add_argument('--load_model', type=str, default='/home/lola/nn/neuralnetwork.pth', # default=None help='path to the pretrained model') parser.add_argument('--vocab_filename', type=str, default=None, help='filename for the vocabularies') parser.add_argument('--steps_per_checkpoint', type=int, default=500, help='number of training steps per checkpoint') parser.add_argument('--max_source_len', type=int, default=115, help='max length for input') parser.add_argument('--max_target_len', type=int, default=315, help='max length for output') parser.add_argument('--test', action='store_true', help='set to true for testing') parser.add_argument('--no_attention', action='store_true', help='set to true to disable attention') parser.add_argument('--no_pf', action='store_true', help='set to true to disable parent attention feeding') parser.add_argument('--no_train', help='set to true to prevent the network from training', action='store_true') args = parser.parse_args() main()
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 17, 198, 198, 11748, 10688, 198, 11748, 28686, 198, 11748, 4738, 198, 11748, 25064, 198, 11748, 640, 198, 11748, 18931, 198, 11748, 1822, 29572, 198, 198, 11748, 299, 32152, 355, 45941, 198, ...
2.605946
1,581
# Copyright (c) 2013-2014 Rackspace, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # 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. """ Shared business logic. """ from barbican.common import exception from barbican.common import utils from barbican.common import validators from barbican.model import models LOG = utils.getLogger(__name__) def get_or_create_tenant(keystone_id, tenant_repo): """Returns tenant with matching keystone_id. Creates it if it does not exist. :param keystone_id: The external-to-Barbican ID for this tenant. :param tenant_repo: Tenant repository. :return: Tenant model instance """ tenant = tenant_repo.find_by_keystone_id(keystone_id, suppress_exception=True) if not tenant: LOG.debug('Creating tenant for {0}'.format(keystone_id)) tenant = models.Tenant() tenant.keystone_id = keystone_id tenant.status = models.States.ACTIVE tenant_repo.create_from(tenant) return tenant def create_secret(data, tenant, crypto_manager, secret_repo, tenant_secret_repo, datum_repo, kek_repo, ok_to_generate=False): """Common business logic to create a secret.""" time_keeper = utils.TimeKeeper('Create Secret Resource') new_secret = models.Secret(data) time_keeper.mark('after Secret model create') new_datum = None content_type = data.get('payload_content_type', 'application/octet-stream') if 'payload' in data: payload = data.get('payload') content_encoding = data.get('payload_content_encoding') LOG.debug('Encrypting payload...') new_datum = crypto_manager.encrypt(payload, content_type, content_encoding, new_secret, tenant, kek_repo, enforce_text_only=True) time_keeper.mark('after encrypt') elif ok_to_generate: LOG.debug('Generating new secret...') # TODO(atiwari): With new typed Order API proposal # we need to translate new_secret to meta # currently it is working as meta will have same attributes new_datum = crypto_manager. \ generate_symmetric_encryption_key(new_secret, content_type, tenant, kek_repo) time_keeper.mark('after secret generate') else: LOG.debug('Creating metadata only for the new secret. ' 'A subsequent PUT is required') # Create Secret entities in datastore. secret_repo.create_from(new_secret) time_keeper.mark('after Secret datastore create') new_assoc = models.TenantSecret() time_keeper.mark('after TenantSecret model create') new_assoc.tenant_id = tenant.id new_assoc.secret_id = new_secret.id new_assoc.role = "admin" new_assoc.status = models.States.ACTIVE tenant_secret_repo.create_from(new_assoc) time_keeper.mark('after TenantSecret datastore create') if new_datum: new_datum.secret_id = new_secret.id datum_repo.create_from(new_datum) time_keeper.mark('after Datum datastore create') time_keeper.dump() return new_secret def create_encrypted_datum(secret, payload, content_type, content_encoding, tenant, crypto_manager, datum_repo, kek_repo): """Modifies the secret to add the plain_text secret information. :param secret: the secret entity to associate the secret data to :param payload: secret data to store :param content_type: payload content mime type :param content_encoding: payload content encoding :param tenant: the tenant (entity) who owns the secret :param crypto_manager: the crypto plugin manager :param datum_repo: the encrypted datum repository :param kek_repo: the KEK metadata repository :retval The response body, None if N/A """ if not payload: raise exception.NoDataToProcess() if validators.secret_too_big(payload): raise exception.LimitExceeded() if secret.encrypted_data: raise ValueError('Secret already has encrypted data stored for it.') # Encrypt payload LOG.debug('Encrypting secret payload...') new_datum = crypto_manager.encrypt(payload, content_type, content_encoding, secret, tenant, kek_repo) datum_repo.create_from(new_datum) return new_datum
[ 2, 15069, 357, 66, 8, 2211, 12, 4967, 37927, 13200, 11, 3457, 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, ...
2.258173
2,386
from math import sqrt for prime in stream_primes(10001): print(prime)
[ 6738, 10688, 1330, 19862, 17034, 198, 198, 1640, 6994, 287, 4269, 62, 1050, 999, 7, 3064, 486, 2599, 198, 220, 220, 220, 3601, 7, 35505, 8, 198 ]
2.777778
27
import datetime from app.models import Log from flask_login import current_user from app.extensions import db # https://stackoverflow.com/questions/6558535/find-the-date-for-the-first-monday-after-a-given-date
[ 11748, 4818, 8079, 198, 6738, 598, 13, 27530, 1330, 5972, 198, 6738, 42903, 62, 38235, 1330, 1459, 62, 7220, 198, 6738, 598, 13, 2302, 5736, 1330, 20613, 628, 198, 2, 3740, 1378, 25558, 2502, 11125, 13, 785, 14, 6138, 507, 14, 35916, ...
3.132353
68
power = {'BUSES': {'Area': 1.33155, 'Bus/Area': 1.33155, 'Bus/Gate Leakage': 0.00662954, 'Bus/Peak Dynamic': 0.0, 'Bus/Runtime Dynamic': 0.0, 'Bus/Subthreshold Leakage': 0.0691322, 'Bus/Subthreshold Leakage with power gating': 0.0259246, 'Gate Leakage': 0.00662954, 'Peak Dynamic': 0.0, 'Runtime Dynamic': 0.0, 'Subthreshold Leakage': 0.0691322, 'Subthreshold Leakage with power gating': 0.0259246}, 'Core': [{'Area': 32.6082, 'Execution Unit/Area': 8.2042, 'Execution Unit/Complex ALUs/Area': 0.235435, 'Execution Unit/Complex ALUs/Gate Leakage': 0.0132646, 'Execution Unit/Complex ALUs/Peak Dynamic': 0.181181, 'Execution Unit/Complex ALUs/Runtime Dynamic': 0.344996, 'Execution Unit/Complex ALUs/Subthreshold Leakage': 0.20111, 'Execution Unit/Complex ALUs/Subthreshold Leakage with power gating': 0.0754163, 'Execution Unit/Floating Point Units/Area': 4.6585, 'Execution Unit/Floating Point Units/Gate Leakage': 0.0656156, 'Execution Unit/Floating Point Units/Peak Dynamic': 0.977935, 'Execution Unit/Floating Point Units/Runtime Dynamic': 0.304033, 'Execution Unit/Floating Point Units/Subthreshold Leakage': 0.994829, 'Execution Unit/Floating Point Units/Subthreshold Leakage with power gating': 0.373061, 'Execution Unit/Gate Leakage': 0.122718, 'Execution Unit/Instruction Scheduler/Area': 2.17927, 'Execution Unit/Instruction Scheduler/FP Instruction Window/Area': 0.328073, 'Execution Unit/Instruction Scheduler/FP Instruction Window/Gate Leakage': 0.00115349, 'Execution Unit/Instruction Scheduler/FP Instruction Window/Peak Dynamic': 1.20978, 'Execution Unit/Instruction Scheduler/FP Instruction Window/Runtime Dynamic': 0.486054, 'Execution Unit/Instruction Scheduler/FP Instruction Window/Subthreshold Leakage': 0.017004, 'Execution Unit/Instruction Scheduler/FP Instruction Window/Subthreshold Leakage with power gating': 0.00962066, 'Execution Unit/Instruction Scheduler/Gate Leakage': 0.00730101, 'Execution Unit/Instruction Scheduler/Instruction Window/Area': 1.00996, 'Execution Unit/Instruction Scheduler/Instruction Window/Gate Leakage': 0.00529112, 'Execution Unit/Instruction Scheduler/Instruction Window/Peak Dynamic': 2.07911, 'Execution Unit/Instruction Scheduler/Instruction Window/Runtime Dynamic': 0.841669, 'Execution Unit/Instruction Scheduler/Instruction Window/Subthreshold Leakage': 0.0800117, 'Execution Unit/Instruction Scheduler/Instruction Window/Subthreshold Leakage with power gating': 0.0455351, 'Execution Unit/Instruction Scheduler/Peak Dynamic': 4.84781, 'Execution Unit/Instruction Scheduler/ROB/Area': 0.841232, 'Execution Unit/Instruction Scheduler/ROB/Gate Leakage': 0.000856399, 'Execution Unit/Instruction Scheduler/ROB/Peak Dynamic': 1.55892, 'Execution Unit/Instruction Scheduler/ROB/Runtime Dynamic': 0.482721, 'Execution Unit/Instruction Scheduler/ROB/Subthreshold Leakage': 0.0178624, 'Execution Unit/Instruction Scheduler/ROB/Subthreshold Leakage with power gating': 0.00897339, 'Execution Unit/Instruction Scheduler/Runtime Dynamic': 1.81044, 'Execution Unit/Instruction Scheduler/Subthreshold Leakage': 0.114878, 'Execution Unit/Instruction Scheduler/Subthreshold Leakage with power gating': 0.0641291, 'Execution Unit/Integer ALUs/Area': 0.47087, 'Execution Unit/Integer ALUs/Gate Leakage': 0.0265291, 'Execution Unit/Integer ALUs/Peak Dynamic': 0.330514, 'Execution Unit/Integer ALUs/Runtime Dynamic': 0.101344, 'Execution Unit/Integer ALUs/Subthreshold Leakage': 0.40222, 'Execution Unit/Integer ALUs/Subthreshold Leakage with power gating': 0.150833, 'Execution Unit/Peak Dynamic': 7.28395, 'Execution Unit/Register Files/Area': 0.570804, 'Execution Unit/Register Files/Floating Point RF/Area': 0.208131, 'Execution Unit/Register Files/Floating Point RF/Gate Leakage': 0.000232788, 'Execution Unit/Register Files/Floating Point RF/Peak Dynamic': 0.184753, 'Execution Unit/Register Files/Floating Point RF/Runtime Dynamic': 0.0176198, 'Execution Unit/Register Files/Floating Point RF/Subthreshold Leakage': 0.00399698, 'Execution Unit/Register Files/Floating Point RF/Subthreshold Leakage with power gating': 0.00176968, 'Execution Unit/Register Files/Gate Leakage': 0.000622708, 'Execution Unit/Register Files/Integer RF/Area': 0.362673, 'Execution Unit/Register Files/Integer RF/Gate Leakage': 0.00038992, 'Execution Unit/Register Files/Integer RF/Peak Dynamic': 0.195265, 'Execution Unit/Register Files/Integer RF/Runtime Dynamic': 0.130309, 'Execution Unit/Register Files/Integer RF/Subthreshold Leakage': 0.00614175, 'Execution Unit/Register Files/Integer RF/Subthreshold Leakage with power gating': 0.00246675, 'Execution Unit/Register Files/Peak Dynamic': 0.380018, 'Execution Unit/Register Files/Runtime Dynamic': 0.147929, 'Execution Unit/Register Files/Subthreshold Leakage': 0.0101387, 'Execution Unit/Register Files/Subthreshold Leakage with power gating': 0.00423643, 'Execution Unit/Results Broadcast Bus/Area Overhead': 0.0442632, 'Execution Unit/Results Broadcast Bus/Gate Leakage': 0.00607074, 'Execution Unit/Results Broadcast Bus/Peak Dynamic': 0.521478, 'Execution Unit/Results Broadcast Bus/Runtime Dynamic': 1.08927, 'Execution Unit/Results Broadcast Bus/Subthreshold Leakage': 0.0920413, 'Execution Unit/Results Broadcast Bus/Subthreshold Leakage with power gating': 0.0345155, 'Execution Unit/Runtime Dynamic': 3.79801, 'Execution Unit/Subthreshold Leakage': 1.83518, 'Execution Unit/Subthreshold Leakage with power gating': 0.709678, 'Gate Leakage': 0.372997, 'Instruction Fetch Unit/Area': 5.86007, 'Instruction Fetch Unit/Branch Predictor/Area': 0.138516, 'Instruction Fetch Unit/Branch Predictor/Chooser/Area': 0.0435221, 'Instruction Fetch Unit/Branch Predictor/Chooser/Gate Leakage': 0.000278362, 'Instruction Fetch Unit/Branch Predictor/Chooser/Peak Dynamic': 0.0168831, 'Instruction Fetch Unit/Branch Predictor/Chooser/Runtime Dynamic': 0.00272158, 'Instruction Fetch Unit/Branch Predictor/Chooser/Subthreshold Leakage': 0.00759719, 'Instruction Fetch Unit/Branch Predictor/Chooser/Subthreshold Leakage with power gating': 0.0039236, 'Instruction Fetch Unit/Branch Predictor/Gate Leakage': 0.000757657, 'Instruction Fetch Unit/Branch Predictor/Global Predictor/Area': 0.0435221, 'Instruction Fetch Unit/Branch Predictor/Global Predictor/Gate Leakage': 0.000278362, 'Instruction Fetch Unit/Branch Predictor/Global Predictor/Peak Dynamic': 0.0168831, 'Instruction Fetch Unit/Branch Predictor/Global Predictor/Runtime Dynamic': 0.00272158, 'Instruction Fetch Unit/Branch Predictor/Global Predictor/Subthreshold Leakage': 0.00759719, 'Instruction Fetch Unit/Branch Predictor/Global Predictor/Subthreshold Leakage with power gating': 0.0039236, 'Instruction Fetch Unit/Branch Predictor/L1_Local Predictor/Area': 0.0257064, 'Instruction Fetch Unit/Branch Predictor/L1_Local Predictor/Gate Leakage': 0.000154548, 'Instruction Fetch Unit/Branch Predictor/L1_Local Predictor/Peak Dynamic': 0.0142575, 'Instruction Fetch Unit/Branch Predictor/L1_Local Predictor/Runtime Dynamic': 0.0023766, 'Instruction Fetch Unit/Branch Predictor/L1_Local Predictor/Subthreshold Leakage': 0.00384344, 'Instruction Fetch Unit/Branch Predictor/L1_Local Predictor/Subthreshold Leakage with power gating': 0.00198631, 'Instruction Fetch Unit/Branch Predictor/L2_Local Predictor/Area': 0.0151917, 'Instruction Fetch Unit/Branch Predictor/L2_Local Predictor/Gate Leakage': 8.00196e-05, 'Instruction Fetch Unit/Branch Predictor/L2_Local Predictor/Peak Dynamic': 0.00527447, 'Instruction Fetch Unit/Branch Predictor/L2_Local Predictor/Runtime Dynamic': 0.000923356, 'Instruction Fetch Unit/Branch Predictor/L2_Local Predictor/Subthreshold Leakage': 0.00181347, 'Instruction Fetch Unit/Branch Predictor/L2_Local Predictor/Subthreshold Leakage with power gating': 0.000957045, 'Instruction Fetch Unit/Branch Predictor/Peak Dynamic': 0.0597838, 'Instruction Fetch Unit/Branch Predictor/RAS/Area': 0.0105732, 'Instruction Fetch Unit/Branch Predictor/RAS/Gate Leakage': 4.63858e-05, 'Instruction Fetch Unit/Branch Predictor/RAS/Peak Dynamic': 0.0117602, 'Instruction Fetch Unit/Branch Predictor/RAS/Runtime Dynamic': 0.00187191, 'Instruction Fetch Unit/Branch Predictor/RAS/Subthreshold Leakage': 0.000932505, 'Instruction Fetch Unit/Branch Predictor/RAS/Subthreshold Leakage with power gating': 0.000494733, 'Instruction Fetch Unit/Branch Predictor/Runtime Dynamic': 0.00969166, 'Instruction Fetch Unit/Branch Predictor/Subthreshold Leakage': 0.0199703, 'Instruction Fetch Unit/Branch Predictor/Subthreshold Leakage with power gating': 0.0103282, 'Instruction Fetch Unit/Branch Target Buffer/Area': 0.64954, 'Instruction Fetch Unit/Branch Target Buffer/Gate Leakage': 0.00272758, 'Instruction Fetch Unit/Branch Target Buffer/Peak Dynamic': 0.177867, 'Instruction Fetch Unit/Branch Target Buffer/Runtime Dynamic': 0.0258763, 'Instruction Fetch Unit/Branch Target Buffer/Subthreshold Leakage': 0.0811682, 'Instruction Fetch Unit/Branch Target Buffer/Subthreshold Leakage with power gating': 0.0435357, 'Instruction Fetch Unit/Gate Leakage': 0.0590479, 'Instruction Fetch Unit/Instruction Buffer/Area': 0.0226323, 'Instruction Fetch Unit/Instruction Buffer/Gate Leakage': 6.83558e-05, 'Instruction Fetch Unit/Instruction Buffer/Peak Dynamic': 0.606827, 'Instruction Fetch Unit/Instruction Buffer/Runtime Dynamic': 0.12527, 'Instruction Fetch Unit/Instruction Buffer/Subthreshold Leakage': 0.00151885, 'Instruction Fetch Unit/Instruction Buffer/Subthreshold Leakage with power gating': 0.000701682, 'Instruction Fetch Unit/Instruction Cache/Area': 3.14635, 'Instruction Fetch Unit/Instruction Cache/Gate Leakage': 0.029931, 'Instruction Fetch Unit/Instruction Cache/Peak Dynamic': 6.43323, 'Instruction Fetch Unit/Instruction Cache/Runtime Dynamic': 0.372767, 'Instruction Fetch Unit/Instruction Cache/Subthreshold Leakage': 0.367022, 'Instruction Fetch Unit/Instruction Cache/Subthreshold Leakage with power gating': 0.180386, 'Instruction Fetch Unit/Instruction Decoder/Area': 1.85799, 'Instruction Fetch Unit/Instruction Decoder/Gate Leakage': 0.0222493, 'Instruction Fetch Unit/Instruction Decoder/Peak Dynamic': 1.37404, 'Instruction Fetch Unit/Instruction Decoder/Runtime Dynamic': 0.425473, 'Instruction Fetch Unit/Instruction Decoder/Subthreshold Leakage': 0.442943, 'Instruction Fetch Unit/Instruction Decoder/Subthreshold Leakage with power gating': 0.166104, 'Instruction Fetch Unit/Peak Dynamic': 8.96874, 'Instruction Fetch Unit/Runtime Dynamic': 0.959077, 'Instruction Fetch Unit/Subthreshold Leakage': 0.932587, 'Instruction Fetch Unit/Subthreshold Leakage with power gating': 0.408542, 'L2/Area': 4.53318, 'L2/Gate Leakage': 0.015464, 'L2/Peak Dynamic': 0.090727, 'L2/Runtime Dynamic': 0.0127692, 'L2/Subthreshold Leakage': 0.834142, 'L2/Subthreshold Leakage with power gating': 0.401066, 'Load Store Unit/Area': 8.80969, 'Load Store Unit/Data Cache/Area': 6.84535, 'Load Store Unit/Data Cache/Gate Leakage': 0.0279261, 'Load Store Unit/Data Cache/Peak Dynamic': 4.08122, 'Load Store Unit/Data Cache/Runtime Dynamic': 1.38167, 'Load Store Unit/Data Cache/Subthreshold Leakage': 0.527675, 'Load Store Unit/Data Cache/Subthreshold Leakage with power gating': 0.25085, 'Load Store Unit/Gate Leakage': 0.0351387, 'Load Store Unit/LoadQ/Area': 0.0836782, 'Load Store Unit/LoadQ/Gate Leakage': 0.00059896, 'Load Store Unit/LoadQ/Peak Dynamic': 0.0920133, 'Load Store Unit/LoadQ/Runtime Dynamic': 0.0920133, 'Load Store Unit/LoadQ/Subthreshold Leakage': 0.00941961, 'Load Store Unit/LoadQ/Subthreshold Leakage with power gating': 0.00536918, 'Load Store Unit/Peak Dynamic': 4.51749, 'Load Store Unit/Runtime Dynamic': 1.92746, 'Load Store Unit/StoreQ/Area': 0.322079, 'Load Store Unit/StoreQ/Gate Leakage': 0.00329971, 'Load Store Unit/StoreQ/Peak Dynamic': 0.226889, 'Load Store Unit/StoreQ/Runtime Dynamic': 0.453778, 'Load Store Unit/StoreQ/Subthreshold Leakage': 0.0345621, 'Load Store Unit/StoreQ/Subthreshold Leakage with power gating': 0.0197004, 'Load Store Unit/Subthreshold Leakage': 0.591622, 'Load Store Unit/Subthreshold Leakage with power gating': 0.283406, 'Memory Management Unit/Area': 0.434579, 'Memory Management Unit/Dtlb/Area': 0.0879726, 'Memory Management Unit/Dtlb/Gate Leakage': 0.00088729, 'Memory Management Unit/Dtlb/Peak Dynamic': 0.0805237, 'Memory Management Unit/Dtlb/Runtime Dynamic': 0.0817258, 'Memory Management Unit/Dtlb/Subthreshold Leakage': 0.0155699, 'Memory Management Unit/Dtlb/Subthreshold Leakage with power gating': 0.00887485, 'Memory Management Unit/Gate Leakage': 0.00813591, 'Memory Management Unit/Itlb/Area': 0.301552, 'Memory Management Unit/Itlb/Gate Leakage': 0.00393464, 'Memory Management Unit/Itlb/Peak Dynamic': 0.399995, 'Memory Management Unit/Itlb/Runtime Dynamic': 0.061585, 'Memory Management Unit/Itlb/Subthreshold Leakage': 0.0413758, 'Memory Management Unit/Itlb/Subthreshold Leakage with power gating': 0.0235842, 'Memory Management Unit/Peak Dynamic': 0.697703, 'Memory Management Unit/Runtime Dynamic': 0.143311, 'Memory Management Unit/Subthreshold Leakage': 0.0769113, 'Memory Management Unit/Subthreshold Leakage with power gating': 0.0399462, 'Peak Dynamic': 26.1203, 'Renaming Unit/Area': 0.369768, 'Renaming Unit/FP Front End RAT/Area': 0.168486, 'Renaming Unit/FP Front End RAT/Gate Leakage': 0.00489731, 'Renaming Unit/FP Front End RAT/Peak Dynamic': 3.33511, 'Renaming Unit/FP Front End RAT/Runtime Dynamic': 0.644561, 'Renaming Unit/FP Front End RAT/Subthreshold Leakage': 0.0437281, 'Renaming Unit/FP Front End RAT/Subthreshold Leakage with power gating': 0.024925, 'Renaming Unit/Free List/Area': 0.0414755, 'Renaming Unit/Free List/Gate Leakage': 4.15911e-05, 'Renaming Unit/Free List/Peak Dynamic': 0.0401324, 'Renaming Unit/Free List/Runtime Dynamic': 0.0326103, 'Renaming Unit/Free List/Subthreshold Leakage': 0.000670426, 'Renaming Unit/Free List/Subthreshold Leakage with power gating': 0.000377987, 'Renaming Unit/Gate Leakage': 0.00863632, 'Renaming Unit/Int Front End RAT/Area': 0.114751, 'Renaming Unit/Int Front End RAT/Gate Leakage': 0.00038343, 'Renaming Unit/Int Front End RAT/Peak Dynamic': 0.86945, 'Renaming Unit/Int Front End RAT/Runtime Dynamic': 0.237087, 'Renaming Unit/Int Front End RAT/Subthreshold Leakage': 0.00611897, 'Renaming Unit/Int Front End RAT/Subthreshold Leakage with power gating': 0.00348781, 'Renaming Unit/Peak Dynamic': 4.56169, 'Renaming Unit/Runtime Dynamic': 0.914258, 'Renaming Unit/Subthreshold Leakage': 0.070483, 'Renaming Unit/Subthreshold Leakage with power gating': 0.0362779, 'Runtime Dynamic': 7.75489, 'Subthreshold Leakage': 6.21877, 'Subthreshold Leakage with power gating': 2.58311}, {'Area': 32.0201, 'Execution Unit/Area': 7.68434, 'Execution Unit/Complex ALUs/Area': 0.235435, 'Execution Unit/Complex ALUs/Gate Leakage': 0.0132646, 'Execution Unit/Complex ALUs/Peak Dynamic': 0.11996, 'Execution Unit/Complex ALUs/Runtime Dynamic': 0.29691, 'Execution Unit/Complex ALUs/Subthreshold Leakage': 0.20111, 'Execution Unit/Complex ALUs/Subthreshold Leakage with power gating': 0.0754163, 'Execution Unit/Floating Point Units/Area': 4.6585, 'Execution Unit/Floating Point Units/Gate Leakage': 0.0656156, 'Execution Unit/Floating Point Units/Peak Dynamic': 0.64733, 'Execution Unit/Floating Point Units/Runtime Dynamic': 0.304033, 'Execution Unit/Floating Point Units/Subthreshold Leakage': 0.994829, 'Execution Unit/Floating Point Units/Subthreshold Leakage with power gating': 0.373061, 'Execution Unit/Gate Leakage': 0.120359, 'Execution Unit/Instruction Scheduler/Area': 1.66526, 'Execution Unit/Instruction Scheduler/FP Instruction Window/Area': 0.275653, 'Execution Unit/Instruction Scheduler/FP Instruction Window/Gate Leakage': 0.000977433, 'Execution Unit/Instruction Scheduler/FP Instruction Window/Peak Dynamic': 1.04181, 'Execution Unit/Instruction Scheduler/FP Instruction Window/Runtime Dynamic': 0.234954, 'Execution Unit/Instruction Scheduler/FP Instruction Window/Subthreshold Leakage': 0.0143453, 'Execution Unit/Instruction Scheduler/FP Instruction Window/Subthreshold Leakage with power gating': 0.00810519, 'Execution Unit/Instruction Scheduler/Gate Leakage': 0.00568913, 'Execution Unit/Instruction Scheduler/Instruction Window/Area': 0.805223, 'Execution Unit/Instruction Scheduler/Instruction Window/Gate Leakage': 0.00414562, 'Execution Unit/Instruction Scheduler/Instruction Window/Peak Dynamic': 1.6763, 'Execution Unit/Instruction Scheduler/Instruction Window/Runtime Dynamic': 0.378972, 'Execution Unit/Instruction Scheduler/Instruction Window/Subthreshold Leakage': 0.0625755, 'Execution Unit/Instruction Scheduler/Instruction Window/Subthreshold Leakage with power gating': 0.0355964, 'Execution Unit/Instruction Scheduler/Peak Dynamic': 3.82262, 'Execution Unit/Instruction Scheduler/ROB/Area': 0.584388, 'Execution Unit/Instruction Scheduler/ROB/Gate Leakage': 0.00056608, 'Execution Unit/Instruction Scheduler/ROB/Peak Dynamic': 1.10451, 'Execution Unit/Instruction Scheduler/ROB/Runtime Dynamic': 0.191292, 'Execution Unit/Instruction Scheduler/ROB/Subthreshold Leakage': 0.00906853, 'Execution Unit/Instruction Scheduler/ROB/Subthreshold Leakage with power gating': 0.00364446, 'Execution Unit/Instruction Scheduler/Runtime Dynamic': 0.805218, 'Execution Unit/Instruction Scheduler/Subthreshold Leakage': 0.0859892, 'Execution Unit/Instruction Scheduler/Subthreshold Leakage with power gating': 0.047346, 'Execution Unit/Integer ALUs/Area': 0.47087, 'Execution Unit/Integer ALUs/Gate Leakage': 0.0265291, 'Execution Unit/Integer ALUs/Peak Dynamic': 0.169475, 'Execution Unit/Integer ALUs/Runtime Dynamic': 0.101344, 'Execution Unit/Integer ALUs/Subthreshold Leakage': 0.40222, 'Execution Unit/Integer ALUs/Subthreshold Leakage with power gating': 0.150833, 'Execution Unit/Peak Dynamic': 5.2954, 'Execution Unit/Register Files/Area': 0.570804, 'Execution Unit/Register Files/Floating Point RF/Area': 0.208131, 'Execution Unit/Register Files/Floating Point RF/Gate Leakage': 0.000232788, 'Execution Unit/Register Files/Floating Point RF/Peak Dynamic': 0.122295, 'Execution Unit/Register Files/Floating Point RF/Runtime Dynamic': 0.00985502, 'Execution Unit/Register Files/Floating Point RF/Subthreshold Leakage': 0.00399698, 'Execution Unit/Register Files/Floating Point RF/Subthreshold Leakage with power gating': 0.00176968, 'Execution Unit/Register Files/Gate Leakage': 0.000622708, 'Execution Unit/Register Files/Integer RF/Area': 0.362673, 'Execution Unit/Register Files/Integer RF/Gate Leakage': 0.00038992, 'Execution Unit/Register Files/Integer RF/Peak Dynamic': 0.116195, 'Execution Unit/Register Files/Integer RF/Runtime Dynamic': 0.0728839, 'Execution Unit/Register Files/Integer RF/Subthreshold Leakage': 0.00614175, 'Execution Unit/Register Files/Integer RF/Subthreshold Leakage with power gating': 0.00246675, 'Execution Unit/Register Files/Peak Dynamic': 0.23849, 'Execution Unit/Register Files/Runtime Dynamic': 0.0827389, 'Execution Unit/Register Files/Subthreshold Leakage': 0.0101387, 'Execution Unit/Register Files/Subthreshold Leakage with power gating': 0.00423643, 'Execution Unit/Results Broadcast Bus/Area Overhead': 0.0390912, 'Execution Unit/Results Broadcast Bus/Gate Leakage': 0.00537402, 'Execution Unit/Results Broadcast Bus/Peak Dynamic': 0.274787, 'Execution Unit/Results Broadcast Bus/Runtime Dynamic': 0.565173, 'Execution Unit/Results Broadcast Bus/Subthreshold Leakage': 0.081478, 'Execution Unit/Results Broadcast Bus/Subthreshold Leakage with power gating': 0.0305543, 'Execution Unit/Runtime Dynamic': 2.15542, 'Execution Unit/Subthreshold Leakage': 1.79543, 'Execution Unit/Subthreshold Leakage with power gating': 0.688821, 'Gate Leakage': 0.368936, 'Instruction Fetch Unit/Area': 5.85939, 'Instruction Fetch Unit/Branch Predictor/Area': 0.138516, 'Instruction Fetch Unit/Branch Predictor/Chooser/Area': 0.0435221, 'Instruction Fetch Unit/Branch Predictor/Chooser/Gate Leakage': 0.000278362, 'Instruction Fetch Unit/Branch Predictor/Chooser/Peak Dynamic': 0.0168831, 'Instruction Fetch Unit/Branch Predictor/Chooser/Runtime Dynamic': 0.00133282, 'Instruction Fetch Unit/Branch Predictor/Chooser/Subthreshold Leakage': 0.00759719, 'Instruction Fetch Unit/Branch Predictor/Chooser/Subthreshold Leakage with power gating': 0.0039236, 'Instruction Fetch Unit/Branch Predictor/Gate Leakage': 0.000757657, 'Instruction Fetch Unit/Branch Predictor/Global Predictor/Area': 0.0435221, 'Instruction Fetch Unit/Branch Predictor/Global Predictor/Gate Leakage': 0.000278362, 'Instruction Fetch Unit/Branch Predictor/Global Predictor/Peak Dynamic': 0.0168831, 'Instruction Fetch Unit/Branch Predictor/Global Predictor/Runtime Dynamic': 0.00133282, 'Instruction Fetch Unit/Branch Predictor/Global Predictor/Subthreshold Leakage': 0.00759719, 'Instruction Fetch Unit/Branch Predictor/Global Predictor/Subthreshold Leakage with power gating': 0.0039236, 'Instruction Fetch Unit/Branch Predictor/L1_Local Predictor/Area': 0.0257064, 'Instruction Fetch Unit/Branch Predictor/L1_Local Predictor/Gate Leakage': 0.000154548, 'Instruction Fetch Unit/Branch Predictor/L1_Local Predictor/Peak Dynamic': 0.0142575, 'Instruction Fetch Unit/Branch Predictor/L1_Local Predictor/Runtime Dynamic': 0.00118494, 'Instruction Fetch Unit/Branch Predictor/L1_Local Predictor/Subthreshold Leakage': 0.00384344, 'Instruction Fetch Unit/Branch Predictor/L1_Local Predictor/Subthreshold Leakage with power gating': 0.00198631, 'Instruction Fetch Unit/Branch Predictor/L2_Local Predictor/Area': 0.0151917, 'Instruction Fetch Unit/Branch Predictor/L2_Local Predictor/Gate Leakage': 8.00196e-05, 'Instruction Fetch Unit/Branch Predictor/L2_Local Predictor/Peak Dynamic': 0.00527447, 'Instruction Fetch Unit/Branch Predictor/L2_Local Predictor/Runtime Dynamic': 0.000471861, 'Instruction Fetch Unit/Branch Predictor/L2_Local Predictor/Subthreshold Leakage': 0.00181347, 'Instruction Fetch Unit/Branch Predictor/L2_Local Predictor/Subthreshold Leakage with power gating': 0.000957045, 'Instruction Fetch Unit/Branch Predictor/Peak Dynamic': 0.0597838, 'Instruction Fetch Unit/Branch Predictor/RAS/Area': 0.0105732, 'Instruction Fetch Unit/Branch Predictor/RAS/Gate Leakage': 4.63858e-05, 'Instruction Fetch Unit/Branch Predictor/RAS/Peak Dynamic': 0.0117602, 'Instruction Fetch Unit/Branch Predictor/RAS/Runtime Dynamic': 0.00104698, 'Instruction Fetch Unit/Branch Predictor/RAS/Subthreshold Leakage': 0.000932505, 'Instruction Fetch Unit/Branch Predictor/RAS/Subthreshold Leakage with power gating': 0.000494733, 'Instruction Fetch Unit/Branch Predictor/Runtime Dynamic': 0.00489756, 'Instruction Fetch Unit/Branch Predictor/Subthreshold Leakage': 0.0199703, 'Instruction Fetch Unit/Branch Predictor/Subthreshold Leakage with power gating': 0.0103282, 'Instruction Fetch Unit/Branch Target Buffer/Area': 0.64954, 'Instruction Fetch Unit/Branch Target Buffer/Gate Leakage': 0.00272758, 'Instruction Fetch Unit/Branch Target Buffer/Peak Dynamic': 0.177867, 'Instruction Fetch Unit/Branch Target Buffer/Runtime Dynamic': 0.0119197, 'Instruction Fetch Unit/Branch Target Buffer/Subthreshold Leakage': 0.0811682, 'Instruction Fetch Unit/Branch Target Buffer/Subthreshold Leakage with power gating': 0.0435357, 'Instruction Fetch Unit/Gate Leakage': 0.0589979, 'Instruction Fetch Unit/Instruction Buffer/Area': 0.0226323, 'Instruction Fetch Unit/Instruction Buffer/Gate Leakage': 6.83558e-05, 'Instruction Fetch Unit/Instruction Buffer/Peak Dynamic': 0.606827, 'Instruction Fetch Unit/Instruction Buffer/Runtime Dynamic': 0.0700652, 'Instruction Fetch Unit/Instruction Buffer/Subthreshold Leakage': 0.00151885, 'Instruction Fetch Unit/Instruction Buffer/Subthreshold Leakage with power gating': 0.000701682, 'Instruction Fetch Unit/Instruction Cache/Area': 3.14635, 'Instruction Fetch Unit/Instruction Cache/Gate Leakage': 0.029931, 'Instruction Fetch Unit/Instruction Cache/Peak Dynamic': 4.45674, 'Instruction Fetch Unit/Instruction Cache/Runtime Dynamic': 0.197355, 'Instruction Fetch Unit/Instruction Cache/Subthreshold Leakage': 0.367022, 'Instruction Fetch Unit/Instruction Cache/Subthreshold Leakage with power gating': 0.180386, 'Instruction Fetch Unit/Instruction Decoder/Area': 1.85799, 'Instruction Fetch Unit/Instruction Decoder/Gate Leakage': 0.0222493, 'Instruction Fetch Unit/Instruction Decoder/Peak Dynamic': 1.37404, 'Instruction Fetch Unit/Instruction Decoder/Runtime Dynamic': 0.237973, 'Instruction Fetch Unit/Instruction Decoder/Subthreshold Leakage': 0.442943, 'Instruction Fetch Unit/Instruction Decoder/Subthreshold Leakage with power gating': 0.166104, 'Instruction Fetch Unit/Peak Dynamic': 6.89155, 'Instruction Fetch Unit/Runtime Dynamic': 0.522211, 'Instruction Fetch Unit/Subthreshold Leakage': 0.932286, 'Instruction Fetch Unit/Subthreshold Leakage with power gating': 0.40843, 'L2/Area': 4.53318, 'L2/Gate Leakage': 0.015464, 'L2/Peak Dynamic': 0.0504299, 'L2/Runtime Dynamic': 0.0069462, 'L2/Subthreshold Leakage': 0.834142, 'L2/Subthreshold Leakage with power gating': 0.401066, 'Load Store Unit/Area': 8.80901, 'Load Store Unit/Data Cache/Area': 6.84535, 'Load Store Unit/Data Cache/Gate Leakage': 0.0279261, 'Load Store Unit/Data Cache/Peak Dynamic': 2.70196, 'Load Store Unit/Data Cache/Runtime Dynamic': 0.713329, 'Load Store Unit/Data Cache/Subthreshold Leakage': 0.527675, 'Load Store Unit/Data Cache/Subthreshold Leakage with power gating': 0.25085, 'Load Store Unit/Gate Leakage': 0.0350888, 'Load Store Unit/LoadQ/Area': 0.0836782, 'Load Store Unit/LoadQ/Gate Leakage': 0.00059896, 'Load Store Unit/LoadQ/Peak Dynamic': 0.0473909, 'Load Store Unit/LoadQ/Runtime Dynamic': 0.0473909, 'Load Store Unit/LoadQ/Subthreshold Leakage': 0.00941961, 'Load Store Unit/LoadQ/Subthreshold Leakage with power gating': 0.00536918, 'Load Store Unit/Peak Dynamic': 2.92575, 'Load Store Unit/Runtime Dynamic': 0.994436, 'Load Store Unit/StoreQ/Area': 0.322079, 'Load Store Unit/StoreQ/Gate Leakage': 0.00329971, 'Load Store Unit/StoreQ/Peak Dynamic': 0.116858, 'Load Store Unit/StoreQ/Runtime Dynamic': 0.233716, 'Load Store Unit/StoreQ/Subthreshold Leakage': 0.0345621, 'Load Store Unit/StoreQ/Subthreshold Leakage with power gating': 0.0197004, 'Load Store Unit/Subthreshold Leakage': 0.591321, 'Load Store Unit/Subthreshold Leakage with power gating': 0.283293, 'Memory Management Unit/Area': 0.4339, 'Memory Management Unit/Dtlb/Area': 0.0879726, 'Memory Management Unit/Dtlb/Gate Leakage': 0.00088729, 'Memory Management Unit/Dtlb/Peak Dynamic': 0.0414733, 'Memory Management Unit/Dtlb/Runtime Dynamic': 0.0421754, 'Memory Management Unit/Dtlb/Subthreshold Leakage': 0.0155699, 'Memory Management Unit/Dtlb/Subthreshold Leakage with power gating': 0.00887485, 'Memory Management Unit/Gate Leakage': 0.00808595, 'Memory Management Unit/Itlb/Area': 0.301552, 'Memory Management Unit/Itlb/Gate Leakage': 0.00393464, 'Memory Management Unit/Itlb/Peak Dynamic': 0.277104, 'Memory Management Unit/Itlb/Runtime Dynamic': 0.0325171, 'Memory Management Unit/Itlb/Subthreshold Leakage': 0.0413758, 'Memory Management Unit/Itlb/Subthreshold Leakage with power gating': 0.0235842, 'Memory Management Unit/Peak Dynamic': 0.504457, 'Memory Management Unit/Runtime Dynamic': 0.0746925, 'Memory Management Unit/Subthreshold Leakage': 0.0766103, 'Memory Management Unit/Subthreshold Leakage with power gating': 0.0398333, 'Peak Dynamic': 19.2571, 'Renaming Unit/Area': 0.303608, 'Renaming Unit/FP Front End RAT/Area': 0.131045, 'Renaming Unit/FP Front End RAT/Gate Leakage': 0.00351123, 'Renaming Unit/FP Front End RAT/Peak Dynamic': 2.51468, 'Renaming Unit/FP Front End RAT/Runtime Dynamic': 0.321701, 'Renaming Unit/FP Front End RAT/Subthreshold Leakage': 0.0308571, 'Renaming Unit/FP Front End RAT/Subthreshold Leakage with power gating': 0.0175885, 'Renaming Unit/Free List/Area': 0.0340654, 'Renaming Unit/Free List/Gate Leakage': 2.5481e-05, 'Renaming Unit/Free List/Peak Dynamic': 0.0306032, 'Renaming Unit/Free List/Runtime Dynamic': 0.0145155, 'Renaming Unit/Free List/Subthreshold Leakage': 0.000370144, 'Renaming Unit/Free List/Subthreshold Leakage with power gating': 0.000201064, 'Renaming Unit/Gate Leakage': 0.00708398, 'Renaming Unit/Int Front End RAT/Area': 0.0941223, 'Renaming Unit/Int Front End RAT/Gate Leakage': 0.000283242, 'Renaming Unit/Int Front End RAT/Peak Dynamic': 0.731965, 'Renaming Unit/Int Front End RAT/Runtime Dynamic': 0.111753, 'Renaming Unit/Int Front End RAT/Subthreshold Leakage': 0.00435488, 'Renaming Unit/Int Front End RAT/Subthreshold Leakage with power gating': 0.00248228, 'Renaming Unit/Peak Dynamic': 3.58947, 'Renaming Unit/Runtime Dynamic': 0.44797, 'Renaming Unit/Subthreshold Leakage': 0.0552466, 'Renaming Unit/Subthreshold Leakage with power gating': 0.0276461, 'Runtime Dynamic': 4.20167, 'Subthreshold Leakage': 6.16288, 'Subthreshold Leakage with power gating': 2.55328}, {'Area': 32.0201, 'Execution Unit/Area': 7.68434, 'Execution Unit/Complex ALUs/Area': 0.235435, 'Execution Unit/Complex ALUs/Gate Leakage': 0.0132646, 'Execution Unit/Complex ALUs/Peak Dynamic': 0.0065108, 'Execution Unit/Complex ALUs/Runtime Dynamic': 0.207803, 'Execution Unit/Complex ALUs/Subthreshold Leakage': 0.20111, 'Execution Unit/Complex ALUs/Subthreshold Leakage with power gating': 0.0754163, 'Execution Unit/Floating Point Units/Area': 4.6585, 'Execution Unit/Floating Point Units/Gate Leakage': 0.0656156, 'Execution Unit/Floating Point Units/Peak Dynamic': 0.0335685, 'Execution Unit/Floating Point Units/Runtime Dynamic': 0.304033, 'Execution Unit/Floating Point Units/Subthreshold Leakage': 0.994829, 'Execution Unit/Floating Point Units/Subthreshold Leakage with power gating': 0.373061, 'Execution Unit/Gate Leakage': 0.120359, 'Execution Unit/Instruction Scheduler/Area': 1.66526, 'Execution Unit/Instruction Scheduler/FP Instruction Window/Area': 0.275653, 'Execution Unit/Instruction Scheduler/FP Instruction Window/Gate Leakage': 0.000977433, 'Execution Unit/Instruction Scheduler/FP Instruction Window/Peak Dynamic': 1.04181, 'Execution Unit/Instruction Scheduler/FP Instruction Window/Runtime Dynamic': 0.102536, 'Execution Unit/Instruction Scheduler/FP Instruction Window/Subthreshold Leakage': 0.0143453, 'Execution Unit/Instruction Scheduler/FP Instruction Window/Subthreshold Leakage with power gating': 0.00810519, 'Execution Unit/Instruction Scheduler/Gate Leakage': 0.00568913, 'Execution Unit/Instruction Scheduler/Instruction Window/Area': 0.805223, 'Execution Unit/Instruction Scheduler/Instruction Window/Gate Leakage': 0.00414562, 'Execution Unit/Instruction Scheduler/Instruction Window/Peak Dynamic': 1.6763, 'Execution Unit/Instruction Scheduler/Instruction Window/Runtime Dynamic': 0.165386, 'Execution Unit/Instruction Scheduler/Instruction Window/Subthreshold Leakage': 0.0625755, 'Execution Unit/Instruction Scheduler/Instruction Window/Subthreshold Leakage with power gating': 0.0355964, 'Execution Unit/Instruction Scheduler/Peak Dynamic': 3.82262, 'Execution Unit/Instruction Scheduler/ROB/Area': 0.584388, 'Execution Unit/Instruction Scheduler/ROB/Gate Leakage': 0.00056608, 'Execution Unit/Instruction Scheduler/ROB/Peak Dynamic': 1.10451, 'Execution Unit/Instruction Scheduler/ROB/Runtime Dynamic': 0.0834813, 'Execution Unit/Instruction Scheduler/ROB/Subthreshold Leakage': 0.00906853, 'Execution Unit/Instruction Scheduler/ROB/Subthreshold Leakage with power gating': 0.00364446, 'Execution Unit/Instruction Scheduler/Runtime Dynamic': 0.351403, 'Execution Unit/Instruction Scheduler/Subthreshold Leakage': 0.0859892, 'Execution Unit/Instruction Scheduler/Subthreshold Leakage with power gating': 0.047346, 'Execution Unit/Integer ALUs/Area': 0.47087, 'Execution Unit/Integer ALUs/Gate Leakage': 0.0265291, 'Execution Unit/Integer ALUs/Peak Dynamic': 0.112125, 'Execution Unit/Integer ALUs/Runtime Dynamic': 0.101344, 'Execution Unit/Integer ALUs/Subthreshold Leakage': 0.40222, 'Execution Unit/Integer ALUs/Subthreshold Leakage with power gating': 0.150833, 'Execution Unit/Peak Dynamic': 4.10223, 'Execution Unit/Register Files/Area': 0.570804, 'Execution Unit/Register Files/Floating Point RF/Area': 0.208131, 'Execution Unit/Register Files/Floating Point RF/Gate Leakage': 0.000232788, 'Execution Unit/Register Files/Floating Point RF/Peak Dynamic': 0.00634181, 'Execution Unit/Register Files/Floating Point RF/Runtime Dynamic': 0.0043008, 'Execution Unit/Register Files/Floating Point RF/Subthreshold Leakage': 0.00399698, 'Execution Unit/Register Files/Floating Point RF/Subthreshold Leakage with power gating': 0.00176968, 'Execution Unit/Register Files/Gate Leakage': 0.000622708, 'Execution Unit/Register Files/Integer RF/Area': 0.362673, 'Execution Unit/Register Files/Integer RF/Gate Leakage': 0.00038992, 'Execution Unit/Register Files/Integer RF/Peak Dynamic': 0.0336025, 'Execution Unit/Register Files/Integer RF/Runtime Dynamic': 0.0318071, 'Execution Unit/Register Files/Integer RF/Subthreshold Leakage': 0.00614175, 'Execution Unit/Register Files/Integer RF/Subthreshold Leakage with power gating': 0.00246675, 'Execution Unit/Register Files/Peak Dynamic': 0.0399443, 'Execution Unit/Register Files/Runtime Dynamic': 0.0361079, 'Execution Unit/Register Files/Subthreshold Leakage': 0.0101387, 'Execution Unit/Register Files/Subthreshold Leakage with power gating': 0.00423643, 'Execution Unit/Results Broadcast Bus/Area Overhead': 0.0390912, 'Execution Unit/Results Broadcast Bus/Gate Leakage': 0.00537402, 'Execution Unit/Results Broadcast Bus/Peak Dynamic': 0.0724192, 'Execution Unit/Results Broadcast Bus/Runtime Dynamic': 0.179703, 'Execution Unit/Results Broadcast Bus/Subthreshold Leakage': 0.081478, 'Execution Unit/Results Broadcast Bus/Subthreshold Leakage with power gating': 0.0305543, 'Execution Unit/Runtime Dynamic': 1.18039, 'Execution Unit/Subthreshold Leakage': 1.79543, 'Execution Unit/Subthreshold Leakage with power gating': 0.688821, 'Gate Leakage': 0.368936, 'Instruction Fetch Unit/Area': 5.85939, 'Instruction Fetch Unit/Branch Predictor/Area': 0.138516, 'Instruction Fetch Unit/Branch Predictor/Chooser/Area': 0.0435221, 'Instruction Fetch Unit/Branch Predictor/Chooser/Gate Leakage': 0.000278362, 'Instruction Fetch Unit/Branch Predictor/Chooser/Peak Dynamic': 0.0168831, 'Instruction Fetch Unit/Branch Predictor/Chooser/Runtime Dynamic': 0.00112696, 'Instruction Fetch Unit/Branch Predictor/Chooser/Subthreshold Leakage': 0.00759719, 'Instruction Fetch Unit/Branch Predictor/Chooser/Subthreshold Leakage with power gating': 0.0039236, 'Instruction Fetch Unit/Branch Predictor/Gate Leakage': 0.000757657, 'Instruction Fetch Unit/Branch Predictor/Global Predictor/Area': 0.0435221, 'Instruction Fetch Unit/Branch Predictor/Global Predictor/Gate Leakage': 0.000278362, 'Instruction Fetch Unit/Branch Predictor/Global Predictor/Peak Dynamic': 0.0168831, 'Instruction Fetch Unit/Branch Predictor/Global Predictor/Runtime Dynamic': 0.00112696, 'Instruction Fetch Unit/Branch Predictor/Global Predictor/Subthreshold Leakage': 0.00759719, 'Instruction Fetch Unit/Branch Predictor/Global Predictor/Subthreshold Leakage with power gating': 0.0039236, 'Instruction Fetch Unit/Branch Predictor/L1_Local Predictor/Area': 0.0257064, 'Instruction Fetch Unit/Branch Predictor/L1_Local Predictor/Gate Leakage': 0.000154548, 'Instruction Fetch Unit/Branch Predictor/L1_Local Predictor/Peak Dynamic': 0.0142575, 'Instruction Fetch Unit/Branch Predictor/L1_Local Predictor/Runtime Dynamic': 0.000995662, 'Instruction Fetch Unit/Branch Predictor/L1_Local Predictor/Subthreshold Leakage': 0.00384344, 'Instruction Fetch Unit/Branch Predictor/L1_Local Predictor/Subthreshold Leakage with power gating': 0.00198631, 'Instruction Fetch Unit/Branch Predictor/L2_Local Predictor/Area': 0.0151917, 'Instruction Fetch Unit/Branch Predictor/L2_Local Predictor/Gate Leakage': 8.00196e-05, 'Instruction Fetch Unit/Branch Predictor/L2_Local Predictor/Peak Dynamic': 0.00527447, 'Instruction Fetch Unit/Branch Predictor/L2_Local Predictor/Runtime Dynamic': 0.000393137, 'Instruction Fetch Unit/Branch Predictor/L2_Local Predictor/Subthreshold Leakage': 0.00181347, 'Instruction Fetch Unit/Branch Predictor/L2_Local Predictor/Subthreshold Leakage with power gating': 0.000957045, 'Instruction Fetch Unit/Branch Predictor/Peak Dynamic': 0.0597838, 'Instruction Fetch Unit/Branch Predictor/RAS/Area': 0.0105732, 'Instruction Fetch Unit/Branch Predictor/RAS/Gate Leakage': 4.63858e-05, 'Instruction Fetch Unit/Branch Predictor/RAS/Peak Dynamic': 0.0117602, 'Instruction Fetch Unit/Branch Predictor/RAS/Runtime Dynamic': 0.000456911, 'Instruction Fetch Unit/Branch Predictor/RAS/Subthreshold Leakage': 0.000932505, 'Instruction Fetch Unit/Branch Predictor/RAS/Subthreshold Leakage with power gating': 0.000494733, 'Instruction Fetch Unit/Branch Predictor/Runtime Dynamic': 0.0037065, 'Instruction Fetch Unit/Branch Predictor/Subthreshold Leakage': 0.0199703, 'Instruction Fetch Unit/Branch Predictor/Subthreshold Leakage with power gating': 0.0103282, 'Instruction Fetch Unit/Branch Target Buffer/Area': 0.64954, 'Instruction Fetch Unit/Branch Target Buffer/Gate Leakage': 0.00272758, 'Instruction Fetch Unit/Branch Target Buffer/Peak Dynamic': 0.177867, 'Instruction Fetch Unit/Branch Target Buffer/Runtime Dynamic': 0.0103022, 'Instruction Fetch Unit/Branch Target Buffer/Subthreshold Leakage': 0.0811682, 'Instruction Fetch Unit/Branch Target Buffer/Subthreshold Leakage with power gating': 0.0435357, 'Instruction Fetch Unit/Gate Leakage': 0.0589979, 'Instruction Fetch Unit/Instruction Buffer/Area': 0.0226323, 'Instruction Fetch Unit/Instruction Buffer/Gate Leakage': 6.83558e-05, 'Instruction Fetch Unit/Instruction Buffer/Peak Dynamic': 0.606827, 'Instruction Fetch Unit/Instruction Buffer/Runtime Dynamic': 0.0305769, 'Instruction Fetch Unit/Instruction Buffer/Subthreshold Leakage': 0.00151885, 'Instruction Fetch Unit/Instruction Buffer/Subthreshold Leakage with power gating': 0.000701682, 'Instruction Fetch Unit/Instruction Cache/Area': 3.14635, 'Instruction Fetch Unit/Instruction Cache/Gate Leakage': 0.029931, 'Instruction Fetch Unit/Instruction Cache/Peak Dynamic': 1.94496, 'Instruction Fetch Unit/Instruction Cache/Runtime Dynamic': 0.0958958, 'Instruction Fetch Unit/Instruction Cache/Subthreshold Leakage': 0.367022, 'Instruction Fetch Unit/Instruction Cache/Subthreshold Leakage with power gating': 0.180386, 'Instruction Fetch Unit/Instruction Decoder/Area': 1.85799, 'Instruction Fetch Unit/Instruction Decoder/Gate Leakage': 0.0222493, 'Instruction Fetch Unit/Instruction Decoder/Peak Dynamic': 1.37404, 'Instruction Fetch Unit/Instruction Decoder/Runtime Dynamic': 0.103853, 'Instruction Fetch Unit/Instruction Decoder/Subthreshold Leakage': 0.442943, 'Instruction Fetch Unit/Instruction Decoder/Subthreshold Leakage with power gating': 0.166104, 'Instruction Fetch Unit/Peak Dynamic': 4.25787, 'Instruction Fetch Unit/Runtime Dynamic': 0.244335, 'Instruction Fetch Unit/Subthreshold Leakage': 0.932286, 'Instruction Fetch Unit/Subthreshold Leakage with power gating': 0.40843, 'L2/Area': 4.53318, 'L2/Gate Leakage': 0.015464, 'L2/Peak Dynamic': 0.0538499, 'L2/Runtime Dynamic': 0.0148173, 'L2/Subthreshold Leakage': 0.834142, 'L2/Subthreshold Leakage with power gating': 0.401066, 'Load Store Unit/Area': 8.80901, 'Load Store Unit/Data Cache/Area': 6.84535, 'Load Store Unit/Data Cache/Gate Leakage': 0.0279261, 'Load Store Unit/Data Cache/Peak Dynamic': 2.02873, 'Load Store Unit/Data Cache/Runtime Dynamic': 0.40237, 'Load Store Unit/Data Cache/Subthreshold Leakage': 0.527675, 'Load Store Unit/Data Cache/Subthreshold Leakage with power gating': 0.25085, 'Load Store Unit/Gate Leakage': 0.0350888, 'Load Store Unit/LoadQ/Area': 0.0836782, 'Load Store Unit/LoadQ/Gate Leakage': 0.00059896, 'Load Store Unit/LoadQ/Peak Dynamic': 0.0256105, 'Load Store Unit/LoadQ/Runtime Dynamic': 0.0256104, 'Load Store Unit/LoadQ/Subthreshold Leakage': 0.00941961, 'Load Store Unit/LoadQ/Subthreshold Leakage with power gating': 0.00536918, 'Load Store Unit/Peak Dynamic': 2.14967, 'Load Store Unit/Runtime Dynamic': 0.554282, 'Load Store Unit/StoreQ/Area': 0.322079, 'Load Store Unit/StoreQ/Gate Leakage': 0.00329971, 'Load Store Unit/StoreQ/Peak Dynamic': 0.063151, 'Load Store Unit/StoreQ/Runtime Dynamic': 0.126302, 'Load Store Unit/StoreQ/Subthreshold Leakage': 0.0345621, 'Load Store Unit/StoreQ/Subthreshold Leakage with power gating': 0.0197004, 'Load Store Unit/Subthreshold Leakage': 0.591321, 'Load Store Unit/Subthreshold Leakage with power gating': 0.283293, 'Memory Management Unit/Area': 0.4339, 'Memory Management Unit/Dtlb/Area': 0.0879726, 'Memory Management Unit/Dtlb/Gate Leakage': 0.00088729, 'Memory Management Unit/Dtlb/Peak Dynamic': 0.0224125, 'Memory Management Unit/Dtlb/Runtime Dynamic': 0.0232096, 'Memory Management Unit/Dtlb/Subthreshold Leakage': 0.0155699, 'Memory Management Unit/Dtlb/Subthreshold Leakage with power gating': 0.00887485, 'Memory Management Unit/Gate Leakage': 0.00808595, 'Memory Management Unit/Itlb/Area': 0.301552, 'Memory Management Unit/Itlb/Gate Leakage': 0.00393464, 'Memory Management Unit/Itlb/Peak Dynamic': 0.12093, 'Memory Management Unit/Itlb/Runtime Dynamic': 0.0157552, 'Memory Management Unit/Itlb/Subthreshold Leakage': 0.0413758, 'Memory Management Unit/Itlb/Subthreshold Leakage with power gating': 0.0235842, 'Memory Management Unit/Peak Dynamic': 0.31554, 'Memory Management Unit/Runtime Dynamic': 0.0389648, 'Memory Management Unit/Subthreshold Leakage': 0.0766103, 'Memory Management Unit/Subthreshold Leakage with power gating': 0.0398333, 'Peak Dynamic': 14.4686, 'Renaming Unit/Area': 0.303608, 'Renaming Unit/FP Front End RAT/Area': 0.131045, 'Renaming Unit/FP Front End RAT/Gate Leakage': 0.00351123, 'Renaming Unit/FP Front End RAT/Peak Dynamic': 2.51468, 'Renaming Unit/FP Front End RAT/Runtime Dynamic': 0.0166828, 'Renaming Unit/FP Front End RAT/Subthreshold Leakage': 0.0308571, 'Renaming Unit/FP Front End RAT/Subthreshold Leakage with power gating': 0.0175885, 'Renaming Unit/Free List/Area': 0.0340654, 'Renaming Unit/Free List/Gate Leakage': 2.5481e-05, 'Renaming Unit/Free List/Peak Dynamic': 0.0306032, 'Renaming Unit/Free List/Runtime Dynamic': 0.00482915, 'Renaming Unit/Free List/Subthreshold Leakage': 0.000370144, 'Renaming Unit/Free List/Subthreshold Leakage with power gating': 0.000201064, 'Renaming Unit/Gate Leakage': 0.00708398, 'Renaming Unit/Int Front End RAT/Area': 0.0941223, 'Renaming Unit/Int Front End RAT/Gate Leakage': 0.000283242, 'Renaming Unit/Int Front End RAT/Peak Dynamic': 0.731965, 'Renaming Unit/Int Front End RAT/Runtime Dynamic': 0.0520126, 'Renaming Unit/Int Front End RAT/Subthreshold Leakage': 0.00435488, 'Renaming Unit/Int Front End RAT/Subthreshold Leakage with power gating': 0.00248228, 'Renaming Unit/Peak Dynamic': 3.58947, 'Renaming Unit/Runtime Dynamic': 0.0735245, 'Renaming Unit/Subthreshold Leakage': 0.0552466, 'Renaming Unit/Subthreshold Leakage with power gating': 0.0276461, 'Runtime Dynamic': 2.10632, 'Subthreshold Leakage': 6.16288, 'Subthreshold Leakage with power gating': 2.55328}, {'Area': 32.0201, 'Execution Unit/Area': 7.68434, 'Execution Unit/Complex ALUs/Area': 0.235435, 'Execution Unit/Complex ALUs/Gate Leakage': 0.0132646, 'Execution Unit/Complex ALUs/Peak Dynamic': 0.00682822, 'Execution Unit/Complex ALUs/Runtime Dynamic': 0.208052, 'Execution Unit/Complex ALUs/Subthreshold Leakage': 0.20111, 'Execution Unit/Complex ALUs/Subthreshold Leakage with power gating': 0.0754163, 'Execution Unit/Floating Point Units/Area': 4.6585, 'Execution Unit/Floating Point Units/Gate Leakage': 0.0656156, 'Execution Unit/Floating Point Units/Peak Dynamic': 0.0364806, 'Execution Unit/Floating Point Units/Runtime Dynamic': 0.304033, 'Execution Unit/Floating Point Units/Subthreshold Leakage': 0.994829, 'Execution Unit/Floating Point Units/Subthreshold Leakage with power gating': 0.373061, 'Execution Unit/Gate Leakage': 0.120359, 'Execution Unit/Instruction Scheduler/Area': 1.66526, 'Execution Unit/Instruction Scheduler/FP Instruction Window/Area': 0.275653, 'Execution Unit/Instruction Scheduler/FP Instruction Window/Gate Leakage': 0.000977433, 'Execution Unit/Instruction Scheduler/FP Instruction Window/Peak Dynamic': 1.04181, 'Execution Unit/Instruction Scheduler/FP Instruction Window/Runtime Dynamic': 0.106185, 'Execution Unit/Instruction Scheduler/FP Instruction Window/Subthreshold Leakage': 0.0143453, 'Execution Unit/Instruction Scheduler/FP Instruction Window/Subthreshold Leakage with power gating': 0.00810519, 'Execution Unit/Instruction Scheduler/Gate Leakage': 0.00568913, 'Execution Unit/Instruction Scheduler/Instruction Window/Area': 0.805223, 'Execution Unit/Instruction Scheduler/Instruction Window/Gate Leakage': 0.00414562, 'Execution Unit/Instruction Scheduler/Instruction Window/Peak Dynamic': 1.6763, 'Execution Unit/Instruction Scheduler/Instruction Window/Runtime Dynamic': 0.171272, 'Execution Unit/Instruction Scheduler/Instruction Window/Subthreshold Leakage': 0.0625755, 'Execution Unit/Instruction Scheduler/Instruction Window/Subthreshold Leakage with power gating': 0.0355964, 'Execution Unit/Instruction Scheduler/Peak Dynamic': 3.82262, 'Execution Unit/Instruction Scheduler/ROB/Area': 0.584388, 'Execution Unit/Instruction Scheduler/ROB/Gate Leakage': 0.00056608, 'Execution Unit/Instruction Scheduler/ROB/Peak Dynamic': 1.10451, 'Execution Unit/Instruction Scheduler/ROB/Runtime Dynamic': 0.0864526, 'Execution Unit/Instruction Scheduler/ROB/Subthreshold Leakage': 0.00906853, 'Execution Unit/Instruction Scheduler/ROB/Subthreshold Leakage with power gating': 0.00364446, 'Execution Unit/Instruction Scheduler/Runtime Dynamic': 0.36391, 'Execution Unit/Instruction Scheduler/Subthreshold Leakage': 0.0859892, 'Execution Unit/Instruction Scheduler/Subthreshold Leakage with power gating': 0.047346, 'Execution Unit/Integer ALUs/Area': 0.47087, 'Execution Unit/Integer ALUs/Gate Leakage': 0.0265291, 'Execution Unit/Integer ALUs/Peak Dynamic': 0.115853, 'Execution Unit/Integer ALUs/Runtime Dynamic': 0.101344, 'Execution Unit/Integer ALUs/Subthreshold Leakage': 0.40222, 'Execution Unit/Integer ALUs/Subthreshold Leakage with power gating': 0.150833, 'Execution Unit/Peak Dynamic': 4.11398, 'Execution Unit/Register Files/Area': 0.570804, 'Execution Unit/Register Files/Floating Point RF/Area': 0.208131, 'Execution Unit/Register Files/Floating Point RF/Gate Leakage': 0.000232788, 'Execution Unit/Register Files/Floating Point RF/Peak Dynamic': 0.00689197, 'Execution Unit/Register Files/Floating Point RF/Runtime Dynamic': 0.00445387, 'Execution Unit/Register Files/Floating Point RF/Subthreshold Leakage': 0.00399698, 'Execution Unit/Register Files/Floating Point RF/Subthreshold Leakage with power gating': 0.00176968, 'Execution Unit/Register Files/Gate Leakage': 0.000622708, 'Execution Unit/Register Files/Integer RF/Area': 0.362673, 'Execution Unit/Register Files/Integer RF/Gate Leakage': 0.00038992, 'Execution Unit/Register Files/Integer RF/Peak Dynamic': 0.0347798, 'Execution Unit/Register Files/Integer RF/Runtime Dynamic': 0.0329391, 'Execution Unit/Register Files/Integer RF/Subthreshold Leakage': 0.00614175, 'Execution Unit/Register Files/Integer RF/Subthreshold Leakage with power gating': 0.00246675, 'Execution Unit/Register Files/Peak Dynamic': 0.0416718, 'Execution Unit/Register Files/Runtime Dynamic': 0.037393, 'Execution Unit/Register Files/Subthreshold Leakage': 0.0101387, 'Execution Unit/Register Files/Subthreshold Leakage with power gating': 0.00423643, 'Execution Unit/Results Broadcast Bus/Area Overhead': 0.0390912, 'Execution Unit/Results Broadcast Bus/Gate Leakage': 0.00537402, 'Execution Unit/Results Broadcast Bus/Peak Dynamic': 0.0749788, 'Execution Unit/Results Broadcast Bus/Runtime Dynamic': 0.202833, 'Execution Unit/Results Broadcast Bus/Subthreshold Leakage': 0.081478, 'Execution Unit/Results Broadcast Bus/Subthreshold Leakage with power gating': 0.0305543, 'Execution Unit/Runtime Dynamic': 1.21756, 'Execution Unit/Subthreshold Leakage': 1.79543, 'Execution Unit/Subthreshold Leakage with power gating': 0.688821, 'Gate Leakage': 0.368936, 'Instruction Fetch Unit/Area': 5.85939, 'Instruction Fetch Unit/Branch Predictor/Area': 0.138516, 'Instruction Fetch Unit/Branch Predictor/Chooser/Area': 0.0435221, 'Instruction Fetch Unit/Branch Predictor/Chooser/Gate Leakage': 0.000278362, 'Instruction Fetch Unit/Branch Predictor/Chooser/Peak Dynamic': 0.0168831, 'Instruction Fetch Unit/Branch Predictor/Chooser/Runtime Dynamic': 0.000625326, 'Instruction Fetch Unit/Branch Predictor/Chooser/Subthreshold Leakage': 0.00759719, 'Instruction Fetch Unit/Branch Predictor/Chooser/Subthreshold Leakage with power gating': 0.0039236, 'Instruction Fetch Unit/Branch Predictor/Gate Leakage': 0.000757657, 'Instruction Fetch Unit/Branch Predictor/Global Predictor/Area': 0.0435221, 'Instruction Fetch Unit/Branch Predictor/Global Predictor/Gate Leakage': 0.000278362, 'Instruction Fetch Unit/Branch Predictor/Global Predictor/Peak Dynamic': 0.0168831, 'Instruction Fetch Unit/Branch Predictor/Global Predictor/Runtime Dynamic': 0.000625326, 'Instruction Fetch Unit/Branch Predictor/Global Predictor/Subthreshold Leakage': 0.00759719, 'Instruction Fetch Unit/Branch Predictor/Global Predictor/Subthreshold Leakage with power gating': 0.0039236, 'Instruction Fetch Unit/Branch Predictor/L1_Local Predictor/Area': 0.0257064, 'Instruction Fetch Unit/Branch Predictor/L1_Local Predictor/Gate Leakage': 0.000154548, 'Instruction Fetch Unit/Branch Predictor/L1_Local Predictor/Peak Dynamic': 0.0142575, 'Instruction Fetch Unit/Branch Predictor/L1_Local Predictor/Runtime Dynamic': 0.000550159, 'Instruction Fetch Unit/Branch Predictor/L1_Local Predictor/Subthreshold Leakage': 0.00384344, 'Instruction Fetch Unit/Branch Predictor/L1_Local Predictor/Subthreshold Leakage with power gating': 0.00198631, 'Instruction Fetch Unit/Branch Predictor/L2_Local Predictor/Area': 0.0151917, 'Instruction Fetch Unit/Branch Predictor/L2_Local Predictor/Gate Leakage': 8.00196e-05, 'Instruction Fetch Unit/Branch Predictor/L2_Local Predictor/Peak Dynamic': 0.00527447, 'Instruction Fetch Unit/Branch Predictor/L2_Local Predictor/Runtime Dynamic': 0.000215984, 'Instruction Fetch Unit/Branch Predictor/L2_Local Predictor/Subthreshold Leakage': 0.00181347, 'Instruction Fetch Unit/Branch Predictor/L2_Local Predictor/Subthreshold Leakage with power gating': 0.000957045, 'Instruction Fetch Unit/Branch Predictor/Peak Dynamic': 0.0597838, 'Instruction Fetch Unit/Branch Predictor/RAS/Area': 0.0105732, 'Instruction Fetch Unit/Branch Predictor/RAS/Gate Leakage': 4.63858e-05, 'Instruction Fetch Unit/Branch Predictor/RAS/Peak Dynamic': 0.0117602, 'Instruction Fetch Unit/Branch Predictor/RAS/Runtime Dynamic': 0.000473173, 'Instruction Fetch Unit/Branch Predictor/RAS/Subthreshold Leakage': 0.000932505, 'Instruction Fetch Unit/Branch Predictor/RAS/Subthreshold Leakage with power gating': 0.000494733, 'Instruction Fetch Unit/Branch Predictor/Runtime Dynamic': 0.00227399, 'Instruction Fetch Unit/Branch Predictor/Subthreshold Leakage': 0.0199703, 'Instruction Fetch Unit/Branch Predictor/Subthreshold Leakage with power gating': 0.0103282, 'Instruction Fetch Unit/Branch Target Buffer/Area': 0.64954, 'Instruction Fetch Unit/Branch Target Buffer/Gate Leakage': 0.00272758, 'Instruction Fetch Unit/Branch Target Buffer/Peak Dynamic': 0.177867, 'Instruction Fetch Unit/Branch Target Buffer/Runtime Dynamic': 0.00579905, 'Instruction Fetch Unit/Branch Target Buffer/Subthreshold Leakage': 0.0811682, 'Instruction Fetch Unit/Branch Target Buffer/Subthreshold Leakage with power gating': 0.0435357, 'Instruction Fetch Unit/Gate Leakage': 0.0589979, 'Instruction Fetch Unit/Instruction Buffer/Area': 0.0226323, 'Instruction Fetch Unit/Instruction Buffer/Gate Leakage': 6.83558e-05, 'Instruction Fetch Unit/Instruction Buffer/Peak Dynamic': 0.606827, 'Instruction Fetch Unit/Instruction Buffer/Runtime Dynamic': 0.0316652, 'Instruction Fetch Unit/Instruction Buffer/Subthreshold Leakage': 0.00151885, 'Instruction Fetch Unit/Instruction Buffer/Subthreshold Leakage with power gating': 0.000701682, 'Instruction Fetch Unit/Instruction Cache/Area': 3.14635, 'Instruction Fetch Unit/Instruction Cache/Gate Leakage': 0.029931, 'Instruction Fetch Unit/Instruction Cache/Peak Dynamic': 2.01418, 'Instruction Fetch Unit/Instruction Cache/Runtime Dynamic': 0.0689457, 'Instruction Fetch Unit/Instruction Cache/Subthreshold Leakage': 0.367022, 'Instruction Fetch Unit/Instruction Cache/Subthreshold Leakage with power gating': 0.180386, 'Instruction Fetch Unit/Instruction Decoder/Area': 1.85799, 'Instruction Fetch Unit/Instruction Decoder/Gate Leakage': 0.0222493, 'Instruction Fetch Unit/Instruction Decoder/Peak Dynamic': 1.37404, 'Instruction Fetch Unit/Instruction Decoder/Runtime Dynamic': 0.107549, 'Instruction Fetch Unit/Instruction Decoder/Subthreshold Leakage': 0.442943, 'Instruction Fetch Unit/Instruction Decoder/Subthreshold Leakage with power gating': 0.166104, 'Instruction Fetch Unit/Peak Dynamic': 4.33045, 'Instruction Fetch Unit/Runtime Dynamic': 0.216233, 'Instruction Fetch Unit/Subthreshold Leakage': 0.932286, 'Instruction Fetch Unit/Subthreshold Leakage with power gating': 0.40843, 'L2/Area': 4.53318, 'L2/Gate Leakage': 0.015464, 'L2/Peak Dynamic': 0.0418086, 'L2/Runtime Dynamic': 0.00989266, 'L2/Subthreshold Leakage': 0.834142, 'L2/Subthreshold Leakage with power gating': 0.401066, 'Load Store Unit/Area': 8.80901, 'Load Store Unit/Data Cache/Area': 6.84535, 'Load Store Unit/Data Cache/Gate Leakage': 0.0279261, 'Load Store Unit/Data Cache/Peak Dynamic': 2.36015, 'Load Store Unit/Data Cache/Runtime Dynamic': 0.554162, 'Load Store Unit/Data Cache/Subthreshold Leakage': 0.527675, 'Load Store Unit/Data Cache/Subthreshold Leakage with power gating': 0.25085, 'Load Store Unit/Gate Leakage': 0.0350888, 'Load Store Unit/LoadQ/Area': 0.0836782, 'Load Store Unit/LoadQ/Gate Leakage': 0.00059896, 'Load Store Unit/LoadQ/Peak Dynamic': 0.0363327, 'Load Store Unit/LoadQ/Runtime Dynamic': 0.0363327, 'Load Store Unit/LoadQ/Subthreshold Leakage': 0.00941961, 'Load Store Unit/LoadQ/Subthreshold Leakage with power gating': 0.00536918, 'Load Store Unit/Peak Dynamic': 2.53172, 'Load Store Unit/Runtime Dynamic': 0.769675, 'Load Store Unit/StoreQ/Area': 0.322079, 'Load Store Unit/StoreQ/Gate Leakage': 0.00329971, 'Load Store Unit/StoreQ/Peak Dynamic': 0.0895903, 'Load Store Unit/StoreQ/Runtime Dynamic': 0.17918, 'Load Store Unit/StoreQ/Subthreshold Leakage': 0.0345621, 'Load Store Unit/StoreQ/Subthreshold Leakage with power gating': 0.0197004, 'Load Store Unit/Subthreshold Leakage': 0.591321, 'Load Store Unit/Subthreshold Leakage with power gating': 0.283293, 'Memory Management Unit/Area': 0.4339, 'Memory Management Unit/Dtlb/Area': 0.0879726, 'Memory Management Unit/Dtlb/Gate Leakage': 0.00088729, 'Memory Management Unit/Dtlb/Peak Dynamic': 0.0317959, 'Memory Management Unit/Dtlb/Runtime Dynamic': 0.0324228, 'Memory Management Unit/Dtlb/Subthreshold Leakage': 0.0155699, 'Memory Management Unit/Dtlb/Subthreshold Leakage with power gating': 0.00887485, 'Memory Management Unit/Gate Leakage': 0.00808595, 'Memory Management Unit/Itlb/Area': 0.301552, 'Memory Management Unit/Itlb/Gate Leakage': 0.00393464, 'Memory Management Unit/Itlb/Peak Dynamic': 0.125234, 'Memory Management Unit/Itlb/Runtime Dynamic': 0.0113054, 'Memory Management Unit/Itlb/Subthreshold Leakage': 0.0413758, 'Memory Management Unit/Itlb/Subthreshold Leakage with power gating': 0.0235842, 'Memory Management Unit/Peak Dynamic': 0.335963, 'Memory Management Unit/Runtime Dynamic': 0.0437282, 'Memory Management Unit/Subthreshold Leakage': 0.0766103, 'Memory Management Unit/Subthreshold Leakage with power gating': 0.0398333, 'Peak Dynamic': 14.9434, 'Renaming Unit/Area': 0.303608, 'Renaming Unit/FP Front End RAT/Area': 0.131045, 'Renaming Unit/FP Front End RAT/Gate Leakage': 0.00351123, 'Renaming Unit/FP Front End RAT/Peak Dynamic': 2.51468, 'Renaming Unit/FP Front End RAT/Runtime Dynamic': 0.0181291, 'Renaming Unit/FP Front End RAT/Subthreshold Leakage': 0.0308571, 'Renaming Unit/FP Front End RAT/Subthreshold Leakage with power gating': 0.0175885, 'Renaming Unit/Free List/Area': 0.0340654, 'Renaming Unit/Free List/Gate Leakage': 2.5481e-05, 'Renaming Unit/Free List/Peak Dynamic': 0.0306032, 'Renaming Unit/Free List/Runtime Dynamic': 0.0050114, 'Renaming Unit/Free List/Subthreshold Leakage': 0.000370144, 'Renaming Unit/Free List/Subthreshold Leakage with power gating': 0.000201064, 'Renaming Unit/Gate Leakage': 0.00708398, 'Renaming Unit/Int Front End RAT/Area': 0.0941223, 'Renaming Unit/Int Front End RAT/Gate Leakage': 0.000283242, 'Renaming Unit/Int Front End RAT/Peak Dynamic': 0.731965, 'Renaming Unit/Int Front End RAT/Runtime Dynamic': 0.0551057, 'Renaming Unit/Int Front End RAT/Subthreshold Leakage': 0.00435488, 'Renaming Unit/Int Front End RAT/Subthreshold Leakage with power gating': 0.00248228, 'Renaming Unit/Peak Dynamic': 3.58947, 'Renaming Unit/Runtime Dynamic': 0.0782462, 'Renaming Unit/Subthreshold Leakage': 0.0552466, 'Renaming Unit/Subthreshold Leakage with power gating': 0.0276461, 'Runtime Dynamic': 2.33534, 'Subthreshold Leakage': 6.16288, 'Subthreshold Leakage with power gating': 2.55328}], 'DRAM': {'Area': 0, 'Gate Leakage': 0, 'Peak Dynamic': 3.868411224021876, 'Runtime Dynamic': 3.868411224021876, 'Subthreshold Leakage': 4.252, 'Subthreshold Leakage with power gating': 4.252}, 'L3': [{'Area': 61.9075, 'Gate Leakage': 0.0484137, 'Peak Dynamic': 0.371973, 'Runtime Dynamic': 0.183113, 'Subthreshold Leakage': 6.80085, 'Subthreshold Leakage with power gating': 3.32364}], 'Processor': {'Area': 191.908, 'Gate Leakage': 1.53485, 'Peak Dynamic': 75.1614, 'Peak Power': 108.274, 'Runtime Dynamic': 16.5813, 'Subthreshold Leakage': 31.5774, 'Subthreshold Leakage with power gating': 13.9484, 'Total Cores/Area': 128.669, 'Total Cores/Gate Leakage': 1.4798, 'Total Cores/Peak Dynamic': 74.7894, 'Total Cores/Runtime Dynamic': 16.3982, 'Total Cores/Subthreshold Leakage': 24.7074, 'Total Cores/Subthreshold Leakage with power gating': 10.2429, 'Total L3s/Area': 61.9075, 'Total L3s/Gate Leakage': 0.0484137, 'Total L3s/Peak Dynamic': 0.371973, 'Total L3s/Runtime Dynamic': 0.183113, 'Total L3s/Subthreshold Leakage': 6.80085, 'Total L3s/Subthreshold Leakage with power gating': 3.32364, 'Total Leakage': 33.1122, 'Total NoCs/Area': 1.33155, 'Total NoCs/Gate Leakage': 0.00662954, 'Total NoCs/Peak Dynamic': 0.0, 'Total NoCs/Runtime Dynamic': 0.0, 'Total NoCs/Subthreshold Leakage': 0.0691322, 'Total NoCs/Subthreshold Leakage with power gating': 0.0259246}}
[ 6477, 796, 1391, 6, 45346, 1546, 10354, 1391, 6, 30547, 10354, 352, 13, 2091, 18742, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 705, 16286, 14, 30547, 10354, 352, 13, 2091, 18742, 11, 198, 220, 220, 220, 220, 220, ...
2.34359
29,282
from typing import List, Dict import json from gtmcore.http import ConcurrentRequestManager, ConcurrentRequest from gtmcore.environment.packagemanager import PackageManager, PackageResult, PackageMetadata from gtmcore.container import container_for_context from gtmcore.labbook import LabBook from gtmcore.logging import LMLogger logger = LMLogger.get_logger()
[ 6738, 19720, 1330, 7343, 11, 360, 713, 198, 11748, 33918, 198, 6738, 308, 17209, 7295, 13, 4023, 1330, 13223, 6657, 18453, 13511, 11, 13223, 6657, 18453, 198, 198, 6738, 308, 17209, 7295, 13, 38986, 13, 8002, 363, 8463, 3536, 1330, 1571...
3.553398
103
"""Conversion of Matplotlib / Seaborn inputs to plotly.""" import os.path as op from pkg_resources import resource_filename import json def mpl_to_px_inputs(inputs, plt_types=None): """Convert typical matplotlib inputs to plotly to simplify API. Parameters ---------- inputs : dict Dictionary of inputs plt_types : string or list or None Sub select some plotting types (e.g heatmap, line etc.). If None, all types are used Returns ------- outputs : dict Dictionary of converted inputs """ # load reference table file = op.join(op.dirname(__file__), "io_mpl_to_px.json") with open(file, 'r') as f: table = json.load(f) # go through the desired plotting types for conversion if plt_types is None: plt_types = list(table.keys()) if isinstance(plt_types, str): plt_types = [plt_types] ref = {} for plt_type in plt_types: ref.update(table[plt_type]) # convert inputs outputs = {} for k, v in inputs.items(): if k in ref.keys(): k = ref[k] outputs[k] = v return outputs
[ 37811, 3103, 9641, 286, 6550, 29487, 8019, 1220, 1001, 397, 1211, 17311, 284, 7110, 306, 526, 15931, 198, 11748, 28686, 13, 6978, 355, 1034, 198, 6738, 279, 10025, 62, 37540, 1330, 8271, 62, 34345, 198, 11748, 33918, 628, 198, 4299, 285...
2.471983
464
"""Fizzbuzz for loop variant 3""" for x in range(1, 101): OUTPUT = "" if x % 3 == 0: OUTPUT += "Fizz" if x % 5 == 0: OUTPUT += "Buzz" print(OUTPUT or x)
[ 37811, 37, 6457, 65, 4715, 329, 9052, 15304, 513, 37811, 198, 1640, 2124, 287, 2837, 7, 16, 11, 8949, 2599, 198, 220, 220, 220, 16289, 30076, 796, 13538, 198, 220, 220, 220, 611, 2124, 4064, 513, 6624, 657, 25, 198, 220, 220, 220, ...
2.021739
92
from tensor.main_module import Tensor import numpy as np
[ 6738, 11192, 273, 13, 12417, 62, 21412, 1330, 309, 22854, 198, 11748, 299, 32152, 355, 45941 ]
3.5
16
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. import re from django.urls import reverse from django.utils.translation import gettext_lazy as _ from horizon import exceptions from horizon import forms from horizon import messages from openstack_dashboard import api KEY_NAME_REGEX = re.compile(r"^[a-zA-Z0-9-_:. /]+$", re.UNICODE) KEY_ERROR_MESSAGES = { 'invalid': _("The key must match the following the regex: " "'^[a-zA-Z0-9-_:. /]'")}
[ 2, 49962, 739, 262, 24843, 13789, 11, 10628, 362, 13, 15, 357, 1169, 366, 34156, 15341, 345, 743, 198, 2, 407, 779, 428, 2393, 2845, 287, 11846, 351, 262, 13789, 13, 921, 743, 7330, 198, 2, 257, 4866, 286, 262, 13789, 379, 198, 2,...
3.14658
307
# coding=utf-8 # Copyright (c) 2021 Ant Group import sys LABEL_SEP = '@' INDENT_STRING1 = ' ' INDENT_STRING2 = '' EMPTY_TOKEN = '___EMPTY___'
[ 2, 19617, 28, 40477, 12, 23, 198, 2, 15069, 357, 66, 8, 33448, 3738, 4912, 198, 198, 11748, 25064, 198, 198, 48780, 3698, 62, 5188, 47, 796, 705, 31, 6, 198, 198, 12115, 3525, 62, 18601, 2751, 16, 796, 705, 705, 198, 12115, 3525, ...
2.272727
66
import pytest from iminuit import minimize import numpy as np from numpy.testing import assert_allclose, assert_equal opt = pytest.importorskip("scipy.optimize")
[ 11748, 12972, 9288, 198, 6738, 545, 259, 5013, 1330, 17775, 198, 11748, 299, 32152, 355, 45941, 198, 6738, 299, 32152, 13, 33407, 1330, 6818, 62, 439, 19836, 11, 6818, 62, 40496, 198, 198, 8738, 796, 12972, 9288, 13, 11748, 669, 74, 5...
3.016667
60
# coded by: salism3 # 23 - 05 - 2020 23:18 (Malam Takbir) from bs4 import BeautifulSoup as parser from . import sorting import re
[ 2, 30817, 416, 25, 3664, 1042, 18, 201, 198, 2, 2242, 532, 8870, 532, 12131, 2242, 25, 1507, 357, 15029, 321, 15804, 65, 343, 8, 201, 198, 201, 198, 6738, 275, 82, 19, 1330, 23762, 50, 10486, 355, 30751, 201, 198, 6738, 764, 1330,...
2.72
50
# coding: utf-8 """ TGS API A production scale tool for BYOND server management # noqa: E501 OpenAPI spec version: 9.0.0 Generated by: https://github.com/swagger-api/swagger-codegen.git """ from __future__ import absolute_import import unittest import swagger_client from swagger_client.models.watchdog_status import WatchdogStatus # noqa: E501 from swagger_client.rest import ApiException if __name__ == '__main__': unittest.main()
[ 2, 19617, 25, 3384, 69, 12, 23, 198, 198, 37811, 198, 220, 220, 220, 309, 14313, 7824, 628, 220, 220, 220, 317, 3227, 5046, 2891, 329, 11050, 18672, 4382, 4542, 220, 1303, 645, 20402, 25, 412, 33548, 628, 220, 220, 220, 4946, 17614,...
2.808383
167
from setuptools import find_packages, setup setup( name='src', packages=find_packages(), version='0.1.0', description='Python codebase for the housing classification ML problem', author='Joesan', license='', )
[ 6738, 900, 37623, 10141, 1330, 1064, 62, 43789, 11, 9058, 198, 198, 40406, 7, 198, 220, 220, 220, 1438, 11639, 10677, 3256, 198, 220, 220, 220, 10392, 28, 19796, 62, 43789, 22784, 198, 220, 220, 220, 2196, 11639, 15, 13, 16, 13, 15,...
2.9375
80
# Copyright (c) OpenMMLab. All rights reserved. import pytest import torch from mmedit.models.backbones.sr_backbones.edvr_net import (EDVRNet, PCDAlignment, TSAFusion) def test_pcd_alignment(): """Test PCDAlignment.""" # cpu pcd_alignment = PCDAlignment(mid_channels=4, deform_groups=2) input_list = [] for i in range(3, 0, -1): input_list.append(torch.rand(1, 4, 2**i, 2**i)) pcd_alignment = pcd_alignment input_list = [v for v in input_list] output = pcd_alignment(input_list, input_list) assert output.shape == (1, 4, 8, 8) with pytest.raises(AssertionError): pcd_alignment(input_list[0:2], input_list) # gpu if torch.cuda.is_available(): pcd_alignment = PCDAlignment(mid_channels=4, deform_groups=2) input_list = [] for i in range(3, 0, -1): input_list.append(torch.rand(1, 4, 2**i, 2**i)) pcd_alignment = pcd_alignment.cuda() input_list = [v.cuda() for v in input_list] output = pcd_alignment(input_list, input_list) assert output.shape == (1, 4, 8, 8) with pytest.raises(AssertionError): pcd_alignment(input_list[0:2], input_list) def test_tsa_fusion(): """Test TSAFusion.""" # cpu tsa_fusion = TSAFusion(mid_channels=4, num_frames=5, center_frame_idx=2) input_tensor = torch.rand(1, 5, 4, 8, 8) output = tsa_fusion(input_tensor) assert output.shape == (1, 4, 8, 8) # gpu if torch.cuda.is_available(): tsa_fusion = tsa_fusion.cuda() input_tensor = input_tensor.cuda() output = tsa_fusion(input_tensor) assert output.shape == (1, 4, 8, 8) def test_edvrnet(): """Test EDVRNet.""" # cpu # with tsa edvrnet = EDVRNet( 3, 3, mid_channels=8, num_frames=5, deform_groups=2, num_blocks_extraction=1, num_blocks_reconstruction=1, center_frame_idx=2, with_tsa=True) input_tensor = torch.rand(1, 5, 3, 8, 8) edvrnet.init_weights(pretrained=None) output = edvrnet(input_tensor) assert output.shape == (1, 3, 32, 32) # without tsa edvrnet = EDVRNet( 3, 3, mid_channels=8, num_frames=5, deform_groups=2, num_blocks_extraction=1, num_blocks_reconstruction=1, center_frame_idx=2, with_tsa=False) output = edvrnet(input_tensor) assert output.shape == (1, 3, 32, 32) with pytest.raises(AssertionError): # The height and width of inputs should be a multiple of 4 input_tensor = torch.rand(1, 5, 3, 3, 3) edvrnet(input_tensor) with pytest.raises(TypeError): # pretrained should be str or None edvrnet.init_weights(pretrained=[1]) # gpu if torch.cuda.is_available(): # with tsa edvrnet = EDVRNet( 3, 3, mid_channels=8, num_frames=5, deform_groups=2, num_blocks_extraction=1, num_blocks_reconstruction=1, center_frame_idx=2, with_tsa=True).cuda() input_tensor = torch.rand(1, 5, 3, 8, 8).cuda() edvrnet.init_weights(pretrained=None) output = edvrnet(input_tensor) assert output.shape == (1, 3, 32, 32) # without tsa edvrnet = EDVRNet( 3, 3, mid_channels=8, num_frames=5, deform_groups=2, num_blocks_extraction=1, num_blocks_reconstruction=1, center_frame_idx=2, with_tsa=False).cuda() output = edvrnet(input_tensor) assert output.shape == (1, 3, 32, 32) with pytest.raises(AssertionError): # The height and width of inputs should be a multiple of 4 input_tensor = torch.rand(1, 5, 3, 3, 3).cuda() edvrnet(input_tensor) with pytest.raises(TypeError): # pretrained should be str or None edvrnet.init_weights(pretrained=[1])
[ 2, 15069, 357, 66, 8, 4946, 44, 5805, 397, 13, 1439, 2489, 10395, 13, 198, 11748, 12972, 9288, 198, 11748, 28034, 198, 198, 6738, 285, 1150, 270, 13, 27530, 13, 1891, 35095, 13, 27891, 62, 1891, 35095, 13, 276, 37020, 62, 3262, 1330...
1.928604
2,171
# type: ignore __all__ = [ "readDatastoreImage", "datastore", ]
[ 2, 2099, 25, 8856, 198, 198, 834, 439, 834, 796, 685, 198, 220, 220, 220, 366, 961, 27354, 459, 382, 5159, 1600, 198, 220, 220, 220, 366, 19608, 459, 382, 1600, 198, 60, 628, 198 ]
2.142857
35
import os from shutil import rmtree from tempfile import mkdtemp from unittest import TestCase from enjoliver import generator
[ 11748, 28686, 198, 6738, 4423, 346, 1330, 374, 16762, 631, 198, 6738, 20218, 7753, 1330, 33480, 67, 29510, 198, 6738, 555, 715, 395, 1330, 6208, 20448, 198, 198, 6738, 551, 73, 349, 1428, 1330, 17301, 628, 628, 628 ]
3.5
38
# Enter your code here. Read input from STDIN. Print output to STDOUT import calendar mm,dd,yyyy = map(int,input().split()) day = ["MONDAY","TUESDAY","WEDNESDAY","THURSDAY","FRIDAY","SATURDAY","SUNDAY"] val = int (calendar.weekday(yyyy,mm,dd)) print(day[val])
[ 2, 6062, 534, 2438, 994, 13, 4149, 5128, 422, 48571, 1268, 13, 12578, 5072, 284, 48571, 12425, 198, 198, 11748, 11845, 198, 198, 3020, 11, 1860, 11, 22556, 22556, 796, 3975, 7, 600, 11, 15414, 22446, 35312, 28955, 198, 198, 820, 796, ...
2.623762
101
"""Defines the models for trigger rules and events""" from __future__ import unicode_literals import django.contrib.postgres.fields from django.db import models, transaction from django.utils.timezone import now
[ 37811, 7469, 1127, 262, 4981, 329, 7616, 3173, 290, 2995, 37811, 198, 6738, 11593, 37443, 834, 1330, 28000, 1098, 62, 17201, 874, 198, 198, 11748, 42625, 14208, 13, 3642, 822, 13, 7353, 34239, 13, 25747, 198, 6738, 42625, 14208, 13, 994...
3.677966
59
""" Given scores of N athletes, find their relative ranks and the people with the top three highest scores, who will be awarded medals: "Gold Medal", "Silver Medal" and "Bronze Medal". Example 1: Input: [5, 4, 3, 2, 1] Output: ["Gold Medal", "Silver Medal", "Bronze Medal", "4", "5"] Explanation: The first three athletes got the top three highest scores, so they got "Gold Medal", "Silver Medal" and "Bronze Medal". For the left two athletes, you just need to output their relative ranks according to their scores. Note: N is a positive integer and won't exceed 10,000. All the scores of athletes are guaranteed to be unique. """
[ 37811, 198, 15056, 8198, 286, 399, 10856, 11, 1064, 511, 3585, 9803, 290, 262, 661, 351, 262, 1353, 220, 198, 15542, 4511, 8198, 11, 508, 481, 307, 11343, 28057, 25, 366, 13306, 9064, 1600, 366, 26766, 9064, 1, 290, 220, 198, 1, 187...
3.403061
196
from ..base import BaseHistoryItem, GenericHistoryItem from ..utils import PolymorphicBase
[ 6738, 11485, 8692, 1330, 7308, 18122, 7449, 11, 42044, 18122, 7449, 198, 6738, 11485, 26791, 1330, 12280, 24503, 291, 14881, 628, 628, 198 ]
4.130435
23
import sys import numpy as np from sern import * ids, lon, lat = np.loadtxt('nodes', unpack = True) links = np.loadtxt('links', dtype = 'int') A, b = AdjacencyMatrix(ids, links) lon, lat = lon[b], lat[b] n = A.shape[0] # LinkProbability expects A as triu A = A[np.triu_indices(n, 1)] # play around with the scale, maybe you don't need log binning? D, x = IntegerDistances(lat, lon, scale = 50) p = LinkProbability(A, D) from matplotlib import pyplot as pl pl.plot(p, 'bo') pl.ylabel('Link probability given distance') pl.xlabel('Bin number') pl.savefig('link_prob_bin.png') pl.close('all') pl.semilogx(x, p, 'bo') pl.ylabel('Link probability given distance') pl.xlabel('Distance [km]') pl.savefig('link_prob_distance.png')
[ 11748, 25064, 198, 11748, 299, 32152, 355, 45941, 198, 6738, 1055, 77, 1330, 1635, 198, 198, 2340, 11, 300, 261, 11, 3042, 796, 45941, 13, 2220, 14116, 10786, 77, 4147, 3256, 555, 8002, 796, 6407, 8, 198, 28751, 796, 45941, 13, 2220, ...
2.568905
283
# Copyright 2018 Flight Lab authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. """Library for components related to running apps.""" import subprocess import threading from components import base from protos import controller_pb2 from utils import app
[ 2, 15069, 2864, 13365, 3498, 7035, 13, 198, 2, 198, 2, 49962, 739, 262, 24843, 13789, 11, 10628, 362, 13, 15, 357, 1169, 366, 34156, 15341, 198, 2, 345, 743, 407, 779, 428, 2393, 2845, 287, 11846, 351, 262, 13789, 13, 198, 2, 921,...
3.994737
190
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved from .acquisition import AcquisitionFunction from .analytic import ( AnalyticAcquisitionFunction, ConstrainedExpectedImprovement, ExpectedImprovement, NoisyExpectedImprovement, PosteriorMean, ProbabilityOfImprovement, UpperConfidenceBound, ) from .fixed_feature import FixedFeatureAcquisitionFunction from .monte_carlo import ( MCAcquisitionFunction, qExpectedImprovement, qNoisyExpectedImprovement, qProbabilityOfImprovement, qSimpleRegret, qUpperConfidenceBound, ) from .objective import ( ConstrainedMCObjective, GenericMCObjective, IdentityMCObjective, LinearMCObjective, MCAcquisitionObjective, ScalarizedObjective, ) from .utils import get_acquisition_function __all__ = [ "AcquisitionFunction", "AnalyticAcquisitionFunction", "ConstrainedExpectedImprovement", "ExpectedImprovement", "FixedFeatureAcquisitionFunction", "NoisyExpectedImprovement", "PosteriorMean", "ProbabilityOfImprovement", "UpperConfidenceBound", "qExpectedImprovement", "qNoisyExpectedImprovement", "qProbabilityOfImprovement", "qSimpleRegret", "qUpperConfidenceBound", "ConstrainedMCObjective", "GenericMCObjective", "IdentityMCObjective", "LinearMCObjective", "MCAcquisitionFunction", "MCAcquisitionObjective", "ScalarizedObjective", "get_acquisition_function", ]
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 18, 198, 198, 2, 15069, 357, 66, 8, 3203, 11, 3457, 13, 290, 663, 29116, 13, 1439, 6923, 33876, 198, 198, 6738, 764, 43561, 10027, 1330, 44564, 22203, 198, 6738, 764, 38200, 13370, 1330, ...
2.729583
551
"""Randomize the minitaur_gym_alternating_leg_env when reset() is called. The randomization include swing_offset, extension_offset of all legs that mimics bent legs, desired_pitch from user input, battery voltage and motor damping. """ import os, inspect currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe()))) parentdir = os.path.dirname(os.path.dirname(currentdir)) parentdir = os.path.dirname(os.path.dirname(parentdir)) os.sys.path.insert(0, parentdir) import numpy as np import tf.compat.v1 as tf from pybullet_envs.minitaur.envs import env_randomizer_base # Absolute range. NUM_LEGS = 4 BATTERY_VOLTAGE_RANGE = (14.8, 16.8) MOTOR_VISCOUS_DAMPING_RANGE = (0, 0.01)
[ 37811, 29531, 1096, 262, 949, 270, 2899, 62, 1360, 76, 62, 33645, 803, 62, 1455, 62, 24330, 618, 13259, 3419, 318, 1444, 13, 198, 198, 464, 4738, 1634, 2291, 9628, 62, 28968, 11, 7552, 62, 28968, 286, 477, 7405, 326, 17007, 873, 198...
2.768627
255
""" The TensorProductState class and supporting functionality. """ #*************************************************************************************************** # Copyright 2015, 2019 National Technology & Engineering Solutions of Sandia, LLC (NTESS). # Under the terms of Contract DE-NA0003525 with NTESS, the U.S. Government retains certain rights # in this software. # 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 or in the LICENSE file in the root pyGSTi directory. #*************************************************************************************************** import functools as _functools import itertools as _itertools import numpy as _np from pygsti.modelmembers.states.state import State as _State from pygsti.modelmembers import modelmember as _modelmember, term as _term from pygsti.baseobjs import statespace as _statespace from pygsti.tools import listtools as _lt from pygsti.tools import matrixtools as _mt
[ 37811, 198, 464, 309, 22854, 15667, 9012, 1398, 290, 6493, 11244, 13, 198, 37811, 198, 2, 17174, 17174, 17174, 8162, 198, 2, 15069, 1853, 11, 13130, 2351, 8987, 1222, 14044, 23555, 286, 3837, 544, 11, 11419, 357, 11251, 7597, 737, 198, ...
4.091912
272
import graphene import graphene_django from django.http import HttpResponseForbidden from graphene_django.views import GraphQLView from graphql import GraphQLError from edivorce.apps.core.models import Document graphql_schema = graphene.Schema(query=Query, mutation=Mutations)
[ 11748, 42463, 198, 11748, 42463, 62, 28241, 14208, 198, 6738, 42625, 14208, 13, 4023, 1330, 367, 29281, 31077, 1890, 37978, 198, 6738, 42463, 62, 28241, 14208, 13, 33571, 1330, 29681, 9711, 7680, 198, 6738, 4823, 13976, 1330, 29681, 48, 2...
3.457831
83
from .exceptions import MazeNotSolved, AlgorithmNotFound from .dijkstra import Dijkstra from .astar import Astar from functools import wraps import warnings from daedalus import Maze as _maze from PIL import Image warnings.simplefilter("once", UserWarning)
[ 6738, 764, 1069, 11755, 1330, 33412, 3673, 50, 5634, 11, 978, 42289, 3673, 21077, 198, 6738, 764, 67, 45961, 12044, 1330, 360, 45961, 12044, 198, 6738, 764, 459, 283, 1330, 317, 7364, 198, 198, 6738, 1257, 310, 10141, 1330, 27521, 198, ...
3.48
75
import os
[ 11748, 28686, 628, 628 ]
3.25
4
#!/usr/bin/python """Interface to OpenShift oc command""" import os import shlex import shutil import subprocess from ansible.module_utils.basic import AnsibleModule ADDITIONAL_PATH_LOOKUPS = ['/usr/local/bin', os.path.expanduser('~/bin')] def locate_oc_binary(): """Find and return oc binary file""" # https://github.com/openshift/openshift-ansible/issues/3410 # oc can be in /usr/local/bin in some cases, but that may not # be in $PATH due to ansible/sudo paths = os.environ.get("PATH", os.defpath).split(os.pathsep) + ADDITIONAL_PATH_LOOKUPS oc_binary = 'oc' # Use shutil.which if it is available, otherwise fallback to a naive path search try: which_result = shutil.which(oc_binary, path=os.pathsep.join(paths)) if which_result is not None: oc_binary = which_result except AttributeError: for path in paths: if os.path.exists(os.path.join(path, oc_binary)): oc_binary = os.path.join(path, oc_binary) break return oc_binary def main(): """Module that executes commands on a remote OpenShift cluster""" module = AnsibleModule( argument_spec=dict( namespace=dict(type="str", required=False), config_file=dict(type="str", required=True), cmd=dict(type="str", required=True), extra_args=dict(type="list", default=[]), ), ) cmd = [locate_oc_binary(), '--config', module.params["config_file"]] if module.params["namespace"]: cmd += ['-n', module.params["namespace"]] cmd += shlex.split(module.params["cmd"]) + module.params["extra_args"] failed = True try: cmd_result = subprocess.check_output(list(cmd), stderr=subprocess.STDOUT) failed = False except subprocess.CalledProcessError as exc: cmd_result = '[rc {}] {}\n{}'.format(exc.returncode, ' '.join(exc.cmd), exc.output) except OSError as exc: # we get this when 'oc' is not there cmd_result = str(exc) module.exit_json( changed=False, failed=failed, result=cmd_result, ) if __name__ == '__main__': main()
[ 2, 48443, 14629, 14, 8800, 14, 29412, 198, 37811, 39317, 284, 4946, 33377, 267, 66, 3141, 37811, 198, 198, 11748, 28686, 198, 11748, 427, 2588, 198, 11748, 4423, 346, 198, 11748, 850, 14681, 198, 198, 6738, 9093, 856, 13, 21412, 62, 2...
2.392544
912
import fractions
[ 11748, 49876, 628 ]
6
3
import ansible import pprint from ansible import utils from jinja2 import Environment, PackageLoader from collections import namedtuple from ansible import utils from ansible.parsing.dataloader import DataLoader from ansible.vars import VariableManager from ansible.inventory import Inventory from ansible.executor.playbook_executor import PlaybookExecutor from ansible.plugins.callback import CallbackBase from callbacks import PlaybookCallback def invoke_ansible_playbook(module_path, e_vars, playbook_path="site.yml", console=True): """ Invokes playbook """ loader = DataLoader() variable_manager = VariableManager() variable_manager.extra_vars = e_vars inventory = Inventory(loader=loader, variable_manager=variable_manager, host_list=['localhost']) passwords = {} utils.VERBOSITY = 4 Options = namedtuple('Options', ['listtags', 'listtasks', 'listhosts', 'syntax', 'connection', 'module_path', 'forks', 'remote_user', 'private_key_file', 'ssh_common_args', 'ssh_extra_args', 'sftp_extra_args', 'scp_extra_args', 'become', 'become_method', 'become_user', 'verbosity', 'check']) options = Options(listtags=False, listtasks=False, listhosts=False, syntax=False, connection='ssh', module_path=module_path, forks=100, remote_user='root', private_key_file=None, ssh_common_args=None, ssh_extra_args=None, sftp_extra_args=None, scp_extra_args=None, become=False, become_method=None, become_user='root', verbosity=utils.VERBOSITY, check=False) pbex = PlaybookExecutor(playbooks=[playbook_path], inventory=inventory, variable_manager=variable_manager, loader=loader, options=options, passwords=passwords) if not console: cb = PlaybookCallback() pbex._tqm._stdout_callback = cb return_code = pbex.run() results = cb.results else: results = pbex.run() return results
[ 11748, 9093, 856, 198, 11748, 279, 4798, 198, 6738, 9093, 856, 1330, 3384, 4487, 198, 6738, 474, 259, 6592, 17, 1330, 9344, 11, 15717, 17401, 198, 6738, 17268, 1330, 3706, 83, 29291, 198, 6738, 9093, 856, 1330, 3384, 4487, 198, 6738, ...
1.67489
1,824
#!/usr/bin/env python3 import itertools import string from elasticsearch import Elasticsearch,helpers import sys import os from glob import glob import pandas as pd import json host = sys.argv[1] port = int(sys.argv[2]) alias = sys.argv[3] print(host) print(port) print(alias) es = Elasticsearch([{'host': host, 'port': port}]) # create our test index # Get all csv files in /root/data files = [y for x in os.walk('/root/data') for y in glob(os.path.join(x[0], '*.csv'))] count = 0 es.indices.delete(index=alias + '*', ignore=[400, 404]) indices = [] for file in files: data = pd.read_csv(file, sep=None, engine='python') index = alias + '_'.join(file.split('/')) index = clean_field(index).lower().split('_csv')[0] indices.append(index) es.indices.create(index) for col in data.columns: if col.startswith('Unnamed'): del data[col] else: data.rename(columns= { col : clean_field(col) },inplace=True ) data = data.reset_index() # Make sure there is no duplicate indexing data.rename(columns={'index':'row'},inplace =True) data['File'] = file data['_id'] = data['File'] + '.{}.'.format(str(count)) + data.reset_index()['index'].apply(str) data['_type'] = "document" data['_index'] = index records = data.to_json(orient='records') records = json.loads(records) helpers.bulk(es, records, chunk_size=100) count += 1 print(es.count(index=index)) # Create an index table in elasticsearch to locate the files indices_table = pd.DataFrame() indices_table['Index'] = pd.Series(indices) indices_table['File'] = pd.Series(files) indices_table['Alias'] = alias indices_table['_id'] = indices_table['Alias'] + '.' + indices_table['File'] indices_table['_type'] = "document" indices_table['_index'] = alias + '_indices' es.indices.create(alias + '_indices') records = indices_table.to_json(orient='records') records = json.loads(records) helpers.bulk(es, records, chunk_size=100) print(es.count(index=alias + '_indices'))
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 18, 198, 198, 11748, 340, 861, 10141, 198, 11748, 4731, 198, 6738, 27468, 12947, 1330, 48567, 12947, 11, 16794, 364, 198, 11748, 25064, 198, 11748, 28686, 198, 6738, 15095, 1330, 15095, 198, ...
2.544888
802
print a if b: if c: d e
[ 4798, 257, 198, 198, 361, 275, 25, 220, 220, 220, 220, 198, 220, 220, 220, 611, 269, 25, 198, 220, 220, 220, 220, 220, 220, 220, 288, 198, 220, 220, 220, 304, 198 ]
1.363636
33
from absl import app from mainLoop import main if __name__ == '__main__': app.run(main)
[ 201, 198, 6738, 2352, 75, 1330, 598, 201, 198, 6738, 1388, 39516, 1330, 1388, 201, 198, 220, 220, 220, 220, 201, 198, 201, 198, 361, 11593, 3672, 834, 6624, 705, 834, 12417, 834, 10354, 201, 198, 220, 220, 220, 598, 13, 5143, 7, 1...
2.255319
47
from __future__ import absolute_import from builtins import str from builtins import input import sys import argparse from . import bosart_scrape import datetime import json if __name__ == '__main__': main()
[ 6738, 11593, 37443, 834, 1330, 4112, 62, 11748, 198, 6738, 3170, 1040, 1330, 965, 198, 6738, 3170, 1040, 1330, 5128, 198, 11748, 25064, 198, 11748, 1822, 29572, 198, 6738, 764, 1330, 37284, 433, 62, 1416, 13484, 198, 11748, 4818, 8079, ...
3.384615
65
#!/usr/bin/env python # vgm2electron.py # Tool for converting SN76489-based PSG VGM data to Acorn Electron # By Simon Morris (https://github.com/simondotm/) # See https://github.com/simondotm/vgm-packer # # Copyright (c) 2019 Simon Morris. All rights reserved. # # "MIT License": # 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. import functools import itertools import struct import sys import time import binascii import math import operator import os from modules.vgmparser import VgmStream #------------------------------------------------------------------------ # Main() #------------------------------------------------------------------------ import argparse # Determine if running as a script if __name__ == '__main__': print("Vgm2Electron.py : VGM music converter for Acorn Electron") print("Written in 2019 by Simon Morris, https://github.com/simondotm/vgm-packer") print("") epilog_string = "" parser = argparse.ArgumentParser( formatter_class=argparse.RawDescriptionHelpFormatter, epilog=epilog_string) parser.add_argument("input", help="VGM source file (must be single SN76489 PSG format) [input]") parser.add_argument("-o", "--output", metavar="<output>", help="write VGC file <output> (default is '[input].vgc')") parser.add_argument("-v", "--verbose", help="Enable verbose mode", action="store_true") parser.add_argument("-a", "--attenuation", default="444", metavar="<nnn>", help="Set attenuation threshold for each channel, 3 character string where each character is 0-F and 0 is loudest, 4 is 50%, F is quietest, default: 444") parser.add_argument("-t", "--transpose", default="000", metavar="<nnn>", help="Set octaves to transpose for each channel, where 1 is +1 octave and F is -1 octave.") parser.add_argument("-c", "--channels", default="123", metavar="[1][2][3]", help="Set which channels will be included in the conversion, default 123, which means all 3 channels") parser.add_argument("-q", "--technique", default=2, metavar="<n>", help="Set which downmix technique to use 1 or 2.") args = parser.parse_args() src = args.input dst = args.output if dst == None: dst = os.path.splitext(src)[0] + ".electron.vgm" # attenuation options attenuation = args.attenuation if (len(attenuation) != 3): print("ERROR: attenuation must be 3 values eg. '444'") sys.exit() #print("attenuation=" + attenuation) VgmElectron.ATTENTUATION_THRESHOLD1 = int(attenuation[0],16) VgmElectron.ATTENTUATION_THRESHOLD2 = int(attenuation[1],16) VgmElectron.ATTENTUATION_THRESHOLD3 = int(attenuation[2],16) # transpose options transpose = args.transpose if (len(transpose) != 3): print("ERROR: transpose must be 3 values eg. '000'") sys.exit() #print("transpose=" + transpose) # 0 1 2 3 4 5 6 7 8 9 a b c d e f ttable = [0,1,2,3,4,5,6,7,-8,-7,-6,-5,-4,-3,-2,-1] VgmElectron.TRANSPOSE_OCTAVES1 = ttable[ int(transpose[0],16) ] VgmElectron.TRANSPOSE_OCTAVES2 = ttable[ int(transpose[1],16) ] VgmElectron.TRANSPOSE_OCTAVES3 = ttable[ int(transpose[2],16) ] # channel options print(args.channels) VgmElectron.ENABLE_CHANNEL1 = args.channels.find("1") >= 0 VgmElectron.ENABLE_CHANNEL2 = args.channels.find("2") >= 0 VgmElectron.ENABLE_CHANNEL3 = args.channels.find("3") >= 0 print("Channel 1: Enabled=" + str(VgmElectron.ENABLE_CHANNEL1) + ", Transpose=" + str(VgmElectron.TRANSPOSE_OCTAVES1) + ", Attenuation="+str(VgmElectron.ATTENTUATION_THRESHOLD1)) print("Channel 2: Enabled=" + str(VgmElectron.ENABLE_CHANNEL2) + ", Transpose=" + str(VgmElectron.TRANSPOSE_OCTAVES2) + ", Attenuation="+str(VgmElectron.ATTENTUATION_THRESHOLD2)) print("Channel 3: Enabled=" + str(VgmElectron.ENABLE_CHANNEL3) + ", Transpose=" + str(VgmElectron.TRANSPOSE_OCTAVES3) + ", Attenuation="+str(VgmElectron.ATTENTUATION_THRESHOLD3)) # technique VgmElectron.USE_TECHNIQUE = int(args.technique) print("Using technique " + str(VgmElectron.USE_TECHNIQUE)) # check for missing files if not os.path.isfile(src): print("ERROR: File '" + src + "' not found") sys.exit() packer = VgmElectron() packer.VERBOSE = args.verbose packer.process(src, dst)
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 198, 2, 410, 39870, 17, 9509, 1313, 13, 9078, 198, 2, 16984, 329, 23202, 11346, 22, 2414, 4531, 12, 3106, 6599, 38, 569, 15548, 1366, 284, 4013, 1211, 5903, 1313, 198, 2, 2750, 11288, 144...
2.913587
1,759
import webapp2 import tweepy import json import csv import os import statistics import bokeh from bokeh.io import show, output_file from bokeh.plotting import figure from bokeh.models import HoverTool, ColumnDataSource from bokeh.embed import components, json_item from bokeh.resources import INLINE from bokeh.models.glyphs import Line, Text import numpy as np import random import operator from collections import Counter from vaderSentiment.vaderSentiment import SentimentIntensityAnalyzer """ ---AUTHOR: --- Robert Thorstad thorstadrs@gmail.com ---LICENSE: --- MIT License. ---ABOUT: --- Application to get the sentiment of recent tweets based on a keyword. Example: keyword -> "taco bell" retrieve 300 recent tweets mentioning taco bell. get average sentiment. plot distribution of tweets and sentiment. plot most informative words for this application. This script runs based on google app server. Expects Python 2.7 Depenencies need to be included in the lib/ directory (pip install -t lib [PACKAGE_NAME]) The main work is done by the MainPage class. The get() method runs the main pipeline of code and returns HTML as a string. Working online version: https://twittersentiment-247018.appspot.com/ """ def get_tweets(keyword, max_tweets=200): """ Given a keyword as a string (e.g. "data science"), get recent tweets matching that string up to # max_tweets. Return a list of tweets, represented as strings. """ # API keys. consumer_key = "kNOG1klRMMUYbsjMuY5TKl4lE" consumer_secret = "ieghv6WI1qseYly43A0Ra1MPksEw1i5Onma0txfEu5aHantD2v" access_key = "3291622062-15ssVc0qpJXf2SFXbA7vgfl1Sooz4Ueo2DGPQVz" access_secret = "9XJuzgGSVLnx93tq6NfRzMT07S6o2lzjmHfjt3VRlkqXn" # Initialize tweepy API object and authorize using API key. auth = tweepy.OAuthHandler(consumer_key, consumer_secret) auth.set_access_token(access_key, access_secret) api = tweepy.API(auth) """ Get tweets.""" alltweets = [] for status in tweepy.Cursor( api.search, q=keyword + " -RT", # the -RT flag excludes retweets. count=1000, result_type="recent", include_entities=True, monitor_rate_limit=True, wait_on_rate_limit=True, lang="en", ).items(): # get text of the tweet, encoding as utf-8. text = str(status.text.encode("utf-8")) # add to the data structure, alltweets, holding the tweets. alltweets.append(text) # if we've reached max_tweets, break. if len(alltweets) >= max_tweets: break return alltweets def plot_tweets(tweets, sentiment_scores): """ Create a histogram-style barplot of tweets and their sentiment. Return a bokeh plot object, expressed as a tuple of (resources, script, div). Where : resources: some CSS, etc. that goes in the head of the webpage for styling the plot. script: javascript for the plot to function. expressed as string. div: html div container for the plot. expressed as string. """ # Sort tweets from negative to positive. # This step is not strictly necessary, but makes it easier to see the overall shape of the data. sorted_indices = np.argsort(sentiment_scores) sentiment_scores = np.array(sentiment_scores)[sorted_indices] tweets = np.array(tweets)[sorted_indices] # Express the data as a bokeh data source object. source = ColumnDataSource(data={ "text": tweets, "sentiment": sentiment_scores, "x": np.arange(len(tweets)), }) """ Create plot. """ # Create plot object. width = 0.9 p = figure(x_axis_label="Tweet", y_axis_label="Sentiment (0 = Neutral)") p.vbar(source=source, x="x", top="sentiment", width=width) # Add hover tool, allowing mouseover to view text and sentiment. hover = HoverTool( tooltips=[ ("text", "@text"), ("sentiment", "@sentiment") ], formatters={ "text": "printf", "sentiment": "printf" }, mode="vline" ) p.add_tools(hover) """ Format plot. """ # axis font size p.xaxis.axis_label_text_font_size = "15pt" p.yaxis.axis_label_text_font_size = "15pt" # remove tick marks from axes p.xaxis.major_tick_line_color = None p.xaxis.minor_tick_line_color = None p.yaxis.major_tick_line_color = None p.yaxis.minor_tick_line_color = None # adjust plot width, height scale = 1.5 p.plot_height = int(250 * scale) p.plot_width = int(450 * scale) # remove toolbar (e.g. move, resize, etc) from right of plot. p.toolbar.logo = None p.toolbar_location = None # remove gridlines p.xgrid.visible = False p.ygrid.visible = False # remove x axis tick labels (done by setting label fontsize to 0 pt) p.xaxis.major_label_text_font_size = '0pt' """ Export plot """ # Create resources string, which is CSS, etc. that goes in the head of resources = INLINE.render() # Get javascript (script) and HTML div (div) for the plot. script, div = components(p) return (resources, script, div) def plot_reason(tweets, sentiment_scores): """ Plot the top words that lead us to the classification as positive or negative. Return: script : javascript for the plot, expressed as string. div : html container for the plot, expressed as string. NOTE: requires the shared resources attribute from plot_tweets() in the HTML header. """ """ Calculate the sentiment of each individual token in the tweets. """ # list tokens, keeping only unique tokens (e.g. remove repeated words). all_toks = [] for tweet in tweets: toks = tweet.lower().split() all_toks.extend(toks) all_toks = [tok for tok in set(all_toks)] # remove duplicates. # calculate sentiment of each token. sm = VaderSentimentModel() toks_sentiment = [sm.classify_sentiment(tok) for tok in all_toks] """ sort tokens by sentiment. if overall valence is negative, sort negative to postitive. if overall valence is positive, sort positive to negative. thus, in any case, the earliest elements in the list are the most informative words. """ nwords = 20 # negative? sort neg -> positive. if np.mean(sentiment_scores) < 0: sorted_indices = np.argsort(toks_sentiment) # else (positive)? sort positive -> negative else: sorted_indices = np.argsort(toks_sentiment)[::-1] # toks_to_plot: shape (nwords, ) list of informative tokens. # sentiment_to_plot: shape (nwords, ) list of sentiment of these tokens. toks_to_plot = np.array(all_toks)[sorted_indices][:nwords] sentiment_to_plot = np.array(toks_sentiment)[sorted_indices][:nwords] # convert all sentiment scores to positive values. # this is for DISPLAY only, to make all plots go from left to right. # we still retain the correct tokens and sorting order. sentiment_to_plot = np.array([abs(v) for v in sentiment_to_plot]) """ Set up plot. - create data source object. - define formatting variables. """ text_offset = 0.1 source = ColumnDataSource(data={ "token": toks_to_plot, "sentiment": sentiment_to_plot, "x": np.arange(len(toks_to_plot))[::-1], "label_x": sentiment_to_plot + text_offset }) """ Make plot. """ # Create initial plot. width = 0.9 xrange = [0, max(sentiment_to_plot) + 1] p2 = figure(x_axis_label="Sentiment", y_axis_label="Word", x_range=xrange) p2.hbar(source=source, y="x", right="sentiment", height=width) """ Format plot. """ # Annotate each bar with the word being represented. glyph = Text(x="label_x", y="x", text="token") p2.add_glyph(source, glyph) # Axis labels. p2.xaxis.axis_label_text_font_size = "15pt" p2.yaxis.axis_label_text_font_size = "15pt" # Remove ticks. p2.xaxis.major_tick_line_color = None p2.xaxis.minor_tick_line_color = None p2.yaxis.major_tick_line_color = None p2.yaxis.minor_tick_line_color = None # Remove y axis tick labels. p2.yaxis.major_label_text_font_size = '0pt' # Plot width, height. scale = 1.5 p2.plot_height = int(250 * scale) p2.plot_width = int(250 * scale) # remove toolbar (e.g. move, resize, etc) from right of plot. p2.toolbar.logo = None p2.toolbar_location = None # remove gridlines p2.xgrid.visible = False p2.ygrid.visible = False # remove x axis tick labels (set font to 0pt) p2.xaxis.major_label_text_font_size = '0pt' # get bokeh component for plot 2. script2, div2 = components(p2) return (script2, div2) # Run application. routes = [('/', MainPage)] my_app = webapp2.WSGIApplication(routes, debug=True)
[ 11748, 3992, 1324, 17, 198, 11748, 4184, 538, 88, 198, 11748, 33918, 198, 11748, 269, 21370, 198, 11748, 28686, 198, 11748, 7869, 198, 11748, 1489, 365, 71, 198, 6738, 1489, 365, 71, 13, 952, 1330, 905, 11, 5072, 62, 7753, 198, 6738, ...
2.338318
4,079
import unittest import clifford as cl from clifford import g3c from numpy import pi, e import numpy as np from scipy.sparse.linalg.matfuncs import _sinch as sinch from clifford import MultiVector from pygacal.common.cgatools import ( Sandwich, Dilator, Translator, Reflector, inversion, Rotor, Transversor, I3, I5, VectorEquality, Distance, ga_log, ga_exp, MVEqual, Meet, extractBivectorParameters_complicated, ga_exp_complicated, one) from pygacal.geometry import createRandomBivector, createRandomVector, createRandomPoints from pygacal.geometry.lines import createLine from pygacal.geometry.planes import createPlane layout = g3c.layout locals().update(g3c.blades) ep, en, up, down, homo, E0, ninf, no = (g3c.stuff["ep"], g3c.stuff["en"], g3c.stuff["up"], g3c.stuff["down"], g3c.stuff["homo"], g3c.stuff["E0"], g3c.stuff["einf"], -g3c.stuff["eo"]) np.random.seed(2512) if __name__ == "__main__": unittest.main()
[ 11748, 555, 715, 395, 198, 198, 11748, 19516, 585, 355, 537, 198, 6738, 19516, 585, 1330, 308, 18, 66, 198, 6738, 299, 32152, 1330, 31028, 11, 304, 198, 11748, 299, 32152, 355, 45941, 198, 198, 6738, 629, 541, 88, 13, 82, 29572, 13,...
2.157791
507
# # # # # # # # Developed by Yakov V. Panov (C) Ling Black 2020 # @site http://ling.black # # # # # # # # Developed by Yakov V. Panov (C) Ling Black 2020 # @site http://ling.black from typing import List from fastapi import APIRouter, Depends, HTTPException from pydantic import BaseModel from core.response import RequestLimit from database import get_db, DatabaseUtils from database.wow.models import PostModel, PostCommentsModel from wow.interface.entity import PostCategory, Post, PostCategoryCreate, PostCreate, PostLikeCreate, PostCommentCreate from wow.utils.posts import PostsUtils from wow.utils.users import BlizzardUsersUtils router = APIRouter() # ----------------------------------- # CATEGORIES # ----------------------------------- # ----------------------------------- # POSTS # -----------------------------------
[ 2, 220, 220, 198, 2, 220, 220, 198, 2, 220, 220, 198, 2, 220, 220, 198, 2, 220, 220, 198, 2, 220, 220, 198, 2, 198, 2, 220, 6013, 276, 416, 30254, 709, 569, 13, 5961, 709, 357, 34, 8, 25116, 220, 2619, 12131, 198, 2, 220, ...
3.091837
294
from pandac.PandaModules import *
[ 6738, 19798, 330, 13, 47, 5282, 5841, 5028, 1330, 1635, 198 ]
3.090909
11
import datetime import pickle import tensorflow as tf def save_checkpoint(model, current_step, epoch, output_path, **kwargs): """ Save TF Vocoder model """ state = { 'model': model.weights, 'step': current_step, 'epoch': epoch, 'date': datetime.date.today().strftime("%B %d, %Y"), } state.update(kwargs) pickle.dump(state, open(output_path, 'wb')) def load_checkpoint(model, checkpoint_path): """ Load TF Vocoder model """ checkpoint = pickle.load(open(checkpoint_path, 'rb')) chkp_var_dict = {var.name: var.numpy() for var in checkpoint['model']} tf_vars = model.weights for tf_var in tf_vars: layer_name = tf_var.name chkp_var_value = chkp_var_dict[layer_name] tf.keras.backend.set_value(tf_var, chkp_var_value) return model
[ 11748, 4818, 8079, 198, 11748, 2298, 293, 198, 11748, 11192, 273, 11125, 355, 48700, 628, 198, 4299, 3613, 62, 9122, 4122, 7, 19849, 11, 1459, 62, 9662, 11, 36835, 11, 5072, 62, 6978, 11, 12429, 46265, 22046, 2599, 198, 220, 220, 220,...
2.354108
353
from flee import flee """ Generation 1 code. Incorporates only distance, travel always takes one day. """ if __name__ == "__main__": test_path_choice()
[ 6738, 11562, 1330, 11562, 198, 198, 37811, 198, 8645, 341, 352, 2438, 13, 3457, 31150, 689, 691, 5253, 11, 3067, 1464, 2753, 530, 1110, 13, 198, 37811, 628, 198, 198, 361, 11593, 3672, 834, 6624, 366, 834, 12417, 834, 1298, 198, 220, ...
3.137255
51
import matplotlib matplotlib.use('Agg') import config import parse_midas_data import parse_HMP_data import os.path import pylab import sys import numpy import diversity_utils import gene_diversity_utils import calculate_substitution_rates import stats_utils import matplotlib.colors as colors import matplotlib.cm as cmx from math import log10,ceil import matplotlib as mpl import matplotlib.pyplot as plt import matplotlib.gridspec as gridspec from numpy.random import randint from scipy.cluster.hierarchy import dendrogram, linkage from scipy.cluster.hierarchy import cophenet from scipy.cluster.hierarchy import fcluster from scipy.stats import gaussian_kde mpl.rcParams['font.size'] = 6 mpl.rcParams['lines.linewidth'] = 0.5 mpl.rcParams['legend.frameon'] = False mpl.rcParams['legend.fontsize'] = 'small' ################################################################################ # # Standard header to read in argument information # ################################################################################ import argparse parser = argparse.ArgumentParser() parser.add_argument("--debug", help="Loads only a subset of SNPs for speed", action="store_true") parser.add_argument("--chunk-size", type=int, help="max number of records to load", default=1000000000) args = parser.parse_args() debug = args.debug chunk_size = args.chunk_size ################################################################################ good_species_list = ['Bacteroides_vulgatus_57955', 'Bacteroides_uniformis_57318', 'Alistipes_putredinis_61533'] #################################################### # # Set up Figure (3 panels, arranged in 1x3 grid) # #################################################### pylab.figure(1,figsize=(7,1.5)) fig = pylab.gcf() # make three panels panels outer_grid = gridspec.GridSpec(1,3,width_ratios=[1,1,1],wspace=0.1) ####### # # SNP divergence vs Gene divergence in B. vulgatus # ####### gene_axis = plt.Subplot(fig, outer_grid[0]) fig.add_subplot(gene_axis) gene_axis.set_ylabel('SNP divergence\n %s' % (good_species_list[0])) gene_axis.set_xlabel('Gene divergence\n %s' % (good_species_list[0])) gene_axis.set_ylim([1e-06,1e-01]) #gene_axis.set_xlim([1e-02,1]) gene_axis.spines['top'].set_visible(False) gene_axis.spines['right'].set_visible(False) gene_axis.get_xaxis().tick_bottom() gene_axis.get_yaxis().tick_left() ####### # # SNP divergence (B vulgatus) vs SNP divergence (A putredinis) # ####### species_axis_1 = plt.Subplot(fig, outer_grid[1]) fig.add_subplot(species_axis_1) species_axis_1.set_xlabel('SNP divergence\n %s' % (good_species_list[1])) species_axis_1.set_ylim([1e-06,1e-01]) species_axis_1.set_xlim([1e-06,1e-01]) species_axis_1.spines['top'].set_visible(False) species_axis_1.spines['right'].set_visible(False) species_axis_1.get_xaxis().tick_bottom() species_axis_1.get_yaxis().tick_left() ####### # # SNP divergence (B vulgatus) vs SNP divergence (A putredinis) # ####### species_axis_2 = plt.Subplot(fig, outer_grid[2]) fig.add_subplot(species_axis_2) species_axis_2.set_xlabel('SNP divergence\n %s' % (good_species_list[2])) species_axis_2.set_ylim([1e-06,1e-01]) species_axis_2.set_xlim([1e-06,1e-01]) species_axis_2.spines['top'].set_visible(False) species_axis_2.spines['right'].set_visible(False) species_axis_2.get_xaxis().tick_bottom() species_axis_2.get_yaxis().tick_left() ######## # # Now do calculation and plot figures # ######## sys.stderr.write("Loading sample metadata...\n") subject_sample_map = parse_HMP_data.parse_subject_sample_map() sample_order_map = parse_HMP_data.parse_sample_order_map() sys.stderr.write("Done!\n") snp_divergence_map = {species_name: {} for species_name in good_species_list} gene_divergence_map = {species_name: {} for species_name in good_species_list} for species_name in good_species_list: sys.stderr.write("Loading haploid samples...\n") snp_samples = diversity_utils.calculate_haploid_samples(species_name, debug=debug) sys.stderr.write("Calculating unique samples...\n") # Only consider one sample per person snp_samples = snp_samples[parse_midas_data.calculate_unique_samples(subject_sample_map, sample_list=snp_samples)] sys.stderr.write("Loading pre-computed substitution rates for %s...\n" % species_name) substitution_rate_map = calculate_substitution_rates.load_substitution_rate_map(species_name) sys.stderr.write("Calculating snp matrix...\n") dummy_samples, snp_difference_matrix, snp_opportunity_matrix = calculate_substitution_rates.calculate_matrices_from_substitution_rate_map(substitution_rate_map, 'core', allowed_samples=snp_samples) snp_samples = dummy_samples sys.stderr.write("Done!\n") sys.stderr.write("Calculating gene matrix...\n") gene_samples, gene_difference_matrix, gene_opportunity_matrix = calculate_substitution_rates.calculate_matrices_from_substitution_rate_map(substitution_rate_map, 'genes', allowed_samples=snp_samples) snp_samples = gene_samples sys.stderr.write("Done!\n") # Focus on the subset of samples that have sufficient gene depth and snp depth desired_samples = gene_samples # Figure out which pairs of indices in desired_samples belong to diff subjects desired_same_sample_idxs, desired_same_subject_idxs, desired_diff_subject_idxs = parse_midas_data.calculate_subject_pairs( subject_sample_map, desired_samples) # Turn these into indices for snp and gene matrices snp_sample_idx_map = parse_midas_data.calculate_sample_idx_map(desired_samples, snp_samples) gene_sample_idx_map = parse_midas_data.calculate_sample_idx_map(desired_samples, gene_samples) same_subject_snp_idxs = parse_midas_data.apply_sample_index_map_to_indices(snp_sample_idx_map, desired_same_subject_idxs) same_subject_gene_idxs = parse_midas_data.apply_sample_index_map_to_indices(gene_sample_idx_map, desired_same_subject_idxs) diff_subject_snp_idxs = parse_midas_data.apply_sample_index_map_to_indices(snp_sample_idx_map, desired_diff_subject_idxs) diff_subject_gene_idxs = parse_midas_data.apply_sample_index_map_to_indices(gene_sample_idx_map, desired_diff_subject_idxs) for sample_pair_idx in xrange(0,len(diff_subject_snp_idxs[0])): snp_i = diff_subject_snp_idxs[0][sample_pair_idx] snp_j = diff_subject_snp_idxs[1][sample_pair_idx] gene_i = diff_subject_gene_idxs[0][sample_pair_idx] gene_j = diff_subject_gene_idxs[1][sample_pair_idx] sample_i = desired_samples[gene_i] sample_j = desired_samples[gene_j] # This will serve as a key in snp_divergence_map sample_pair = frozenset([sample_i,sample_j]) # Focus on pairs of samples with sufficient coverage if snp_opportunity_matrix[snp_i,snp_j]>0: snp_d = snp_difference_matrix[snp_i,snp_j]*1.0/snp_opportunity_matrix[snp_i,snp_j] snp_divergence_map[species_name][sample_pair] = snp_d if gene_opportunity_matrix[gene_i, gene_j]>0: gene_d = gene_difference_matrix[gene_i, gene_j]*1.0/gene_opportunity_matrix[gene_i, gene_j] gene_divergence_map[species_name][sample_pair] = gene_d ################# # # Plot figures! # ################# # First calculate SNP vs gene divergence in B. vulgatus species_name = good_species_list[0] snp_divergences = [] gene_divergences = [] # Loop over sample pairs that are in both snp_divergence_map and gene_divergence_map for sample_pair in (set(snp_divergence_map[species_name].keys()) & set(gene_divergence_map[species_name].keys()) ): snp_divergences.append( snp_divergence_map[species_name][sample_pair] ) gene_divergences.append( gene_divergence_map[species_name][sample_pair] ) snp_divergences = numpy.array(snp_divergences) gene_divergences = numpy.array(gene_divergences) # Null expectation (medians line up) median_ratio = numpy.median(snp_divergences)/numpy.median(gene_divergences) gene_axis.loglog([1e-02,1],[1e-02*median_ratio,1*median_ratio],'k-',linewidth=0.25) gene_axis.loglog(gene_divergences, snp_divergences, 'r.', markersize=2,alpha=0.5,markeredgewidth=0, rasterized=True) # Then SNP divergence between two species species_1 = good_species_list[0] species_2 = good_species_list[1] snp_divergences_1 = [] snp_divergences_2 = [] # Loop over sample pairs that are in both snp_divergence_map and gene_divergence_map for sample_pair in (set(snp_divergence_map[species_1].keys()) & set(snp_divergence_map[species_2].keys()) ): snp_divergences_1.append( snp_divergence_map[species_1][sample_pair] ) snp_divergences_2.append( snp_divergence_map[species_2][sample_pair] ) snp_divergences_1 = numpy.array(snp_divergences_1) snp_divergences_2 = numpy.array(snp_divergences_2) # Null expectation (medians line up) median_ratio = numpy.median(snp_divergences_1)/numpy.median(snp_divergences_2) species_axis_1.loglog([1e-06,1e-01],[1e-06*median_ratio,1e-01*median_ratio],'k-',linewidth=0.25) # Observed values species_axis_1.loglog(snp_divergences_2, snp_divergences_1, 'r.', markersize=2,alpha=0.5,markeredgewidth=0, rasterized=True) # Then SNP divergence between other two species species_1 = good_species_list[0] species_2 = good_species_list[2] snp_divergences_1 = [] snp_divergences_2 = [] # Loop over sample pairs that are in both snp_divergence_map and gene_divergence_map for sample_pair in (set(snp_divergence_map[species_1].keys()) & set(snp_divergence_map[species_2].keys()) ): snp_divergences_1.append( snp_divergence_map[species_1][sample_pair] ) snp_divergences_2.append( snp_divergence_map[species_2][sample_pair] ) snp_divergences_1 = numpy.array(snp_divergences_1) snp_divergences_2 = numpy.array(snp_divergences_2) # Null expectation (medians line up) median_ratio = numpy.median(snp_divergences_1)/numpy.median(snp_divergences_2) species_axis_2.loglog([1e-06,1e-01],[1e-06*median_ratio,1e-01*median_ratio],'k-',linewidth=0.25) species_axis_2.loglog(snp_divergences_2, snp_divergences_1, 'r.', markersize=2,alpha=0.5,markeredgewidth=0,rasterized=True) # Since y-axes are shared, do not duplicate ticklables species_axis_1.set_yticklabels([]) species_axis_2.set_yticklabels([]) sys.stderr.write("Saving figure...\t") fig.savefig('%s/supplemental_divergence_correlations.pdf' % (parse_midas_data.analysis_directory),bbox_inches='tight',dpi=600) sys.stderr.write("Done!\n")
[ 11748, 2603, 29487, 8019, 220, 220, 198, 6759, 29487, 8019, 13, 1904, 10786, 46384, 11537, 220, 198, 11748, 4566, 198, 11748, 21136, 62, 13602, 292, 62, 7890, 198, 11748, 21136, 62, 39, 7378, 62, 7890, 198, 11748, 28686, 13, 6978, 198, ...
2.474107
4,229
import sys import copy import matplotlib import matplotlib.pyplot as plt import seaborn as sns from collections import Counter from .utils import * import numpy as np import pandas as pd
[ 11748, 25064, 198, 11748, 4866, 198, 11748, 2603, 29487, 8019, 198, 11748, 2603, 29487, 8019, 13, 9078, 29487, 355, 458, 83, 198, 11748, 384, 397, 1211, 355, 3013, 82, 198, 6738, 17268, 1330, 15034, 198, 6738, 764, 26791, 1330, 1635, 19...
3.509434
53
""" DataWriter.py """ from DataController import DataController from DataReader import DataReader from vtk import vtkMetaImageWriter from vtk import vtkXMLImageDataWriter
[ 37811, 198, 6601, 34379, 13, 9078, 198, 37811, 198, 198, 6738, 6060, 22130, 1330, 6060, 22130, 198, 6738, 6060, 33634, 1330, 6060, 33634, 198, 6738, 410, 30488, 1330, 410, 30488, 48526, 5159, 34379, 198, 6738, 410, 30488, 1330, 410, 30488...
3.76087
46
from itertools import chain from django.conf import settings from django.contrib.gis.db import models as gis_models from django.db import models, router, transaction from django.utils import timezone from django.utils.translation import gettext_lazy as _ from ..fields import CleaningJsonField from ..validators import DictListValidator, TextField, TimestampField from .constants import GK25FIN_SRID from .enforcement_domain import EnforcementDomain from .mixins import TimestampedModelMixin from .parking import Parking
[ 6738, 340, 861, 10141, 1330, 6333, 198, 198, 6738, 42625, 14208, 13, 10414, 1330, 6460, 198, 6738, 42625, 14208, 13, 3642, 822, 13, 70, 271, 13, 9945, 1330, 4981, 355, 308, 271, 62, 27530, 198, 6738, 42625, 14208, 13, 9945, 1330, 4981...
3.655172
145
#!/usr/bin/env python # encoding:utf-8 # ############################################################################## # The MIT License (MIT) # # Copyright (c) [2015] [baidu.com] # # 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. # ############################################################################## """ LogEntropy """ import glob import collections import pandas from sklearn.feature_extraction.text import CountVectorizer import math if __name__ == '__main__': lsaEntropy = LogEntropy() lsaEntropy.logEntropyWeighting()
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 198, 2, 21004, 25, 40477, 12, 23, 198, 198, 2, 1303, 29113, 29113, 7804, 4242, 2, 198, 2, 383, 17168, 13789, 357, 36393, 8, 198, 2, 198, 2, 15069, 357, 66, 8, 685, 4626, 60, 685, 65, ...
3.792683
410
a = 5 b = 7 a,b = b,a print a print b
[ 64, 796, 642, 198, 65, 796, 767, 198, 198, 64, 11, 65, 796, 275, 11, 64, 198, 198, 4798, 257, 198, 4798, 275, 198 ]
1.666667
24
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Tests for the union find data structure. """ try: from ..unionfind import UnionFind except ValueError: pass def test_unionfind_basics(): """ Test the basic properties of unionfind. """ u = UnionFind([1, 2, 3]) assert u.in_same_set(1, 2) is False assert u.in_same_set(2, 3) is False u.union(1, 3) assert u.in_same_set(1, 2) is False assert u.in_same_set(3, 1) assert u.get_root(1) == u.get_root(3) def test_unionfind_adding_elements(): """ Test adding operations, mostly syntactic sugar. """ u = UnionFind([1, 2]) u.add(['a', 'b']) assert 1 in u assert 'a' in u def test_unionfind_example(): """ Test on a slightly more invovled example. """ u = UnionFind([1, 2, 3, 4, 5]) u.union(1, 3) u.union(2, 4) assert u.in_same_set(1, 3) assert u.in_same_set(4, 2) assert not u.in_same_set(2, 5) assert not u.in_same_set(2, 1) assert not u.in_same_set(1, 4) u.union(5, 1) assert u.in_same_set(3, 5) def test_unionfind_several(): """ Test that we can take union of more than two elements. """ u = UnionFind([1, 2, 3, 4, 5, 6, 7, 8]) u.union([1, 2, 3]) u.union([4, 5, 6]) u.union([7, 8]) assert u.in_same_set(1, 3) assert u.in_same_set(6, 4) assert u.in_same_set(7, 8) assert not u.in_same_set(2, 5) assert not u.in_same_set(4, 8) def test_unionfind_compression(): """ Test path compression and the union by rank. """ # Test the ranking elements = list(range(100)) u = UnionFind(elements) for i in range(len(elements) - 1): u.union(elements[i], elements[i + 1]) assert max(u._rank.values()) == 1 # Test path compression parent_nodes = list(u._parent.values()) assert all(parent == parent_nodes[0] for parent in parent_nodes) if __name__ == "__main__": import pytest # --durations=10 <- May be used to show potentially slow tests pytest.main(args=['.', '--doctest-modules', '-v'])
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 18, 198, 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 37811, 198, 51, 3558, 329, 262, 6441, 1064, 1366, 4645, 13, 198, 37811, 198, 198, 28311, 25, 198, 220, 220, 220, ...
2.138477
1,011
# Genetic Algorithm for solving the Traveling Salesman problem # Authors: Mihaela Stoycheva, Vukan Turkulov # Includes import configparser import math import matplotlib.pyplot as plt import numpy import random import sys from operator import itemgetter #Global variables(yay!) # Configuration variables(read from config.txt) mutation_rate = 0; population_size = 0; elitism_rate = 0; tournament_rate = 0; max_iterations = 0; input_file_name = ""; parent_rate = 0; # General global variables cities = {}; number_of_cities = 0; parent_number = 0; tournament_size = 0; elite_number = 0; crossover_number = 0; def test_stuff(): """ p1 = "abcdefg"; p2 = "1234567"; for i in range(0,10): print(create_child(p1,p2)); ind = [1,2,3,4,5,6]; print("Before", ind); mutate_individual(ind); print("After", ind); exit();""" #main init(); do_what_needs_to_be_done()
[ 2, 42295, 978, 42289, 329, 18120, 262, 13524, 278, 17329, 805, 1917, 198, 2, 46665, 25, 337, 4449, 3010, 64, 520, 726, 2395, 6862, 11, 569, 2724, 272, 8484, 377, 709, 198, 198, 2, 29581, 198, 11748, 4566, 48610, 198, 11748, 10688, 1...
2.540166
361
# Generated by Django 3.2.8 on 2021-11-25 17:50 from django.db import migrations
[ 2, 2980, 515, 416, 37770, 513, 13, 17, 13, 23, 319, 33448, 12, 1157, 12, 1495, 1596, 25, 1120, 198, 198, 6738, 42625, 14208, 13, 9945, 1330, 15720, 602, 628 ]
2.766667
30
from django.apps import AppConfig
[ 6738, 42625, 14208, 13, 18211, 1330, 2034, 16934, 628 ]
3.888889
9
from plugins.core.player_manager_plugin.plugin import PlayerManagerPlugin from plugins.core.player_manager_plugin.manager import ( Banned, UserLevels, permissions, PlayerManager )
[ 6738, 20652, 13, 7295, 13, 7829, 62, 37153, 62, 33803, 13, 33803, 1330, 7853, 13511, 37233, 198, 6738, 20652, 13, 7295, 13, 7829, 62, 37153, 62, 33803, 13, 37153, 1330, 357, 198, 220, 220, 220, 347, 3577, 11, 198, 220, 220, 220, 117...
3.213115
61
from builtins import str from builtins import range from builtins import object import logging import inspect import os def validate_custom_attributes(custom_attributes_dict, section, custom_attributes): section_dict = {} if custom_attributes and section in custom_attributes_dict: for key, value in list(custom_attributes.items()): if key in custom_attributes_dict[section]: #Sanitize the value try: type_attr = custom_attributes_dict[section][key]['type'] limits = custom_attributes_dict[section][key]['limits'] if type_attr == 'int': value = int(value) if value in range(limits[0], limits[1]): section_dict.update({key:value}) else: logging.info("Skipping key: %s, value: %s due to" \ "validation failure" % (key, value)) elif type_attr == 'str': if len(value) in range(limits[0], limits[1]): section_dict.update({key:value}) else: logging.info("Skipping key: %s, value: %s due to" \ "validation failure" % (key, value)) elif type_attr == 'bool': if value in limits: if value == 'True': value = '' elif value == 'False': value = 'no ' section_dict.update({key:value}) else: logging.info("Skipping key: %s, value: %s due to" \ "validation failure" % (key, value)) elif inspect.isclass(eval(type_attr)): new_custom_attr = eval(type_attr)(key, value) if new_custom_attr.validate(): value = new_custom_attr.post_validation() section_dict.update({key:value}) else: logging.info("Skipping key: %s, value: %s due to" \ "validation failure" % (key, value)) except Exception as e: logging.error(str(e)) continue return section_dict
[ 6738, 3170, 1040, 1330, 965, 198, 6738, 3170, 1040, 1330, 2837, 198, 6738, 3170, 1040, 1330, 2134, 198, 11748, 18931, 198, 11748, 10104, 198, 11748, 28686, 198, 198, 4299, 26571, 62, 23144, 62, 1078, 7657, 7, 23144, 62, 1078, 7657, 62, ...
1.713996
1,479
import gdb cache = TypeCache()
[ 198, 11748, 308, 9945, 198, 220, 220, 220, 220, 198, 23870, 796, 5994, 30562, 3419, 198 ]
2.3125
16
import os import sys directory = sys.argv[1] outfile = open("key_phrases.csv","w") files = {} for filename in os.listdir(directory): text=[] with open(os.path.join(directory, filename)) as f: text=[l.strip() for l in f if len(l.strip())>2] data='' for t in text: if len(t.split()) > 1: data = data+'. '+t.strip() whitelist = set('abcdefghijklmnopqrstuvwxy ABCDEFGHIJKLMNOPQRSTUVWXYZ') answer = ''.join(filter(whitelist.__contains__, data)) answer=' '.join(answer.split()) import rake import operator rake_object = rake.Rake("/home/ashutosh/Sudeshna/RAKE-tutorial/data/stoplists/SmartStoplist.txt", 3,3,1) import pprint pp = pprint.PrettyPrinter() keywords = rake_object.run(answer) for entry in keywords: outfile.write("%s, %s\n" % (entry[0], str(entry[1])) ) outfile.close()
[ 11748, 28686, 198, 11748, 25064, 198, 34945, 796, 25064, 13, 853, 85, 58, 16, 60, 198, 448, 7753, 796, 1280, 7203, 2539, 62, 746, 81, 1386, 13, 40664, 2430, 86, 4943, 198, 198, 16624, 796, 23884, 198, 198, 1640, 29472, 287, 28686, 1...
2.432024
331
"""Unit tests for helper utilities in :mod:`dftinputgen.utils`.""" import os import pytest from ase import io as ase_io from dftinputgen.utils import get_elem_symbol from dftinputgen.utils import read_crystal_structure from dftinputgen.utils import get_kpoint_grid_from_spacing from dftinputgen.utils import DftInputGeneratorUtilsError test_base_dir = os.path.dirname(__file__) feo_conv_file = os.path.join(test_base_dir, "qe", "files", "feo_conv.vasp") feo_conv = ase_io.read(feo_conv_file)
[ 37811, 26453, 5254, 329, 31904, 20081, 287, 1058, 4666, 25, 63, 67, 701, 15414, 5235, 13, 26791, 63, 526, 15931, 198, 198, 11748, 28686, 198, 11748, 12972, 9288, 198, 198, 6738, 257, 325, 1330, 33245, 355, 257, 325, 62, 952, 198, 198,...
2.673797
187
from django.contrib.auth.models import User from django.db.models import (Model, TextField, DateTimeField, ForeignKey, CASCADE) from asgiref.sync import async_to_sync from channels.layers import get_channel_layer from django.db import models import json
[ 6738, 42625, 14208, 13, 3642, 822, 13, 18439, 13, 27530, 1330, 11787, 198, 6738, 42625, 14208, 13, 9945, 13, 27530, 1330, 357, 17633, 11, 8255, 15878, 11, 7536, 7575, 15878, 11, 8708, 9218, 11, 198, 220, 220, 220, 220, 220, 220, 220, ...
2.672897
107
import tensorflow as tf import numpy as np # utility methods def batch_mlp(input, output_sizes, variable_scope): """Apply MLP to the final axis of a 3D tensor (reusing already defined MLPs). Args: input: input tensor of shape [B,n,d_in]. output_sizes: An iterable containing the output sizes of the MLP as defined in `basic.Linear`. variable_scope: String giving the name of the variable scope. If this is set to be the same as a previously defined MLP, then the weights are reused. Returns: tensor of shape [B,n,d_out] where d_out=output_sizes[-1] """ # Get the shapes of the input and reshape to parallelise across observations batch_size, _, filter_size = input.shape.as_list() output = tf.reshape(input, (-1, filter_size)) output.set_shape((None, filter_size)) # Pass through MLP with tf.variable_scope(variable_scope, reuse=tf.AUTO_REUSE): for i, size in enumerate(output_sizes[:-1]): output = tf.nn.relu( tf.layers.dense(output, size, name="layer_{}".format(i))) # Last layer without a ReLu output = tf.layers.dense( output, output_sizes[-1], name="layer_{}".format(i + 1)) # Bring back into original shape output = tf.reshape(output, (batch_size, -1, output_sizes[-1])) return output def uniform_attention(q, v): """Uniform attention. Equivalent to np. Args: q: queries. tensor of shape [B,m,d_k]. v: values. tensor of shape [B,n,d_v]. Returns: tensor of shape [B,m,d_v]. """ total_points = tf.shape(q)[1] rep = tf.reduce_mean(v, axis=1, keepdims=True) # [B,1,d_v] rep = tf.tile(rep, [1, total_points, 1]) return rep def laplace_attention(q, k, v, scale, normalise): """Computes laplace exponential attention. Args: q: queries. tensor of shape [B,m,d_k]. k: keys. tensor of shape [B,n,d_k]. v: values. tensor of shape [B,n,d_v]. scale: float that scales the L1 distance. normalise: Boolean that determines whether weights sum to 1. Returns: tensor of shape [B,m,d_v]. """ k = tf.expand_dims(k, axis=1) # [B,1,n,d_k] q = tf.expand_dims(q, axis=2) # [B,m,1,d_k] unnorm_weights = - tf.abs((k - q) / scale) # [B,m,n,d_k] unnorm_weights = tf.reduce_sum(unnorm_weights, axis=-1) # [B,m,n] if normalise: weight_fn = tf.nn.softmax else: weight_fn = lambda x: 1 + tf.tanh(x) weights = weight_fn(unnorm_weights) # [B,m,n] rep = tf.einsum('bik,bkj->bij', weights, v) # [B,m,d_v] return rep def dot_product_attention(q, k, v, normalise): """Computes dot product attention. Args: q: queries. tensor of shape [B,m,d_k]. k: keys. tensor of shape [B,n,d_k]. v: values. tensor of shape [B,n,d_v]. normalise: Boolean that determines whether weights sum to 1. Returns: tensor of shape [B,m,d_v]. """ d_k = tf.shape(q)[-1] scale = tf.sqrt(tf.cast(d_k, tf.float32)) unnorm_weights = tf.einsum('bjk,bik->bij', k, q) / scale # [B,m,n] if normalise: weight_fn = tf.nn.softmax else: weight_fn = tf.sigmoid weights = weight_fn(unnorm_weights) # [B,m,n] rep = tf.einsum('bik,bkj->bij', weights, v) # [B,m,d_v] return rep def multihead_attention(q, k, v, num_heads=8): """Computes multi-head attention. Args: q: queries. tensor of shape [B,m,d_k]. k: keys. tensor of shape [B,n,d_k]. v: values. tensor of shape [B,n,d_v]. num_heads: number of heads. Should divide d_v. Returns: tensor of shape [B,m,d_v]. """ d_k = q.get_shape().as_list()[-1] d_v = v.get_shape().as_list()[-1] head_size = d_v / num_heads key_initializer = tf.random_normal_initializer(stddev=d_k**-0.5) value_initializer = tf.random_normal_initializer(stddev=d_v**-0.5) rep = tf.constant(0.0) for h in range(num_heads): o = dot_product_attention( tf.layers.Conv1D(head_size, 1, kernel_initializer=key_initializer, name='wq%d' % h, use_bias=False, padding='VALID')(q), tf.layers.Conv1D(head_size, 1, kernel_initializer=key_initializer, name='wk%d' % h, use_bias=False, padding='VALID')(k), tf.layers.Conv1D(head_size, 1, kernel_initializer=key_initializer, name='wv%d' % h, use_bias=False, padding='VALID')(v), normalise=True) rep += tf.layers.Conv1D(d_v, 1, kernel_initializer=value_initializer, name='wo%d' % h, use_bias=False, padding='VALID')(o) return rep
[ 11748, 11192, 273, 11125, 355, 48700, 198, 11748, 299, 32152, 355, 45941, 198, 198, 2, 10361, 5050, 198, 4299, 15458, 62, 4029, 79, 7, 15414, 11, 5072, 62, 82, 4340, 11, 7885, 62, 29982, 2599, 198, 220, 37227, 44836, 10373, 47, 284, ...
2.261796
1,971
from typing import Dict, Tuple, Optional from pathlib import Path import asyncio from ._mask import Mask from ._event import Event from ._base import InotifyBase __all__ = ('Minotaur',)
[ 6738, 19720, 1330, 360, 713, 11, 309, 29291, 11, 32233, 198, 6738, 3108, 8019, 1330, 10644, 198, 198, 11748, 30351, 952, 198, 198, 6738, 47540, 27932, 1330, 18007, 198, 6738, 47540, 15596, 1330, 8558, 198, 6738, 47540, 8692, 1330, 554, ...
3.410714
56
"""! @brief Collection of examples devoted to containers. @authors Andrei Novikov (pyclustering@yandex.ru) @date 2014-2020 @copyright BSD-3-Clause """
[ 37811, 0, 201, 198, 201, 198, 31, 65, 3796, 12251, 286, 6096, 13378, 284, 16472, 13, 201, 198, 201, 198, 31, 41617, 10948, 72, 5267, 1134, 709, 357, 9078, 565, 436, 1586, 31, 88, 392, 1069, 13, 622, 8, 201, 198, 31, 4475, 1946, ...
2.555556
63
import argparse import sys import torch import numpy as np import torch.nn as nn from torch.utils.data import DataLoader from torchvision.datasets import MNIST from torchvision.datasets import CIFAR10 import torchvision.transforms as transforms import matplotlib.pyplot as plt parser = argparse.ArgumentParser(description='PyTorch Novelty Detection') # TRAINING PARAMS parser.add_argument('--epochs', type=int, default=100, metavar='', help='Amount of epochs for training (default: 100)') parser.add_argument('--batch_size', type=int, default=1000, metavar='', help='Batch size for SGD (default: 100)') parser.add_argument('--lrate', type=float, default=0.0001, metavar="", help="Learning rate (default: 0.001") parser.add_argument('--with_cuda', action='store_true', dest='use_cuda', help="Shall cuda be used (default: False)") parser.add_argument('--model', type=int, default=0, help="Which model to train (0=KLminimizer, 1=Euclidean-Minimizer) (default: 0)") parser.add_argument('--plots', action='store_true', dest='plots', help="Shall matplotlib be used (default: False)") parser.add_argument('--grid', action='store_true', dest='grid', help="Grid search (default: False)") argv = parser.parse_args() sys.argv = [sys.argv[0]] from ummon import * from negvarbound import * from model import * from helpers import Evaluator import helpers torch.manual_seed(4) if __name__ == '__main__': # WOOD transform = transform=transforms.Compose([transforms.ToTensor(), transforms.Normalize(mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225]), VGG19Features("pool4"), helpers.flatten_transform]) wood_data = ImagePatches("/ext/data/Wood-0035.png", mode='rgb', train=True, stride_y=14, stride_x=14, window_size=28, transform=transform) wood_data_test = AnomalyImagePatches("/ext/data/Wood-0035.png", mode='rgb', train=True, stride_y=14, stride_x=14, window_size=28, transform=transform, propability=1.0, anomaly=SquareAnomaly(size=8, color=255)) wood_data = [wood_data[i][0].data for i in range(len(wood_data))] wood_data = torch.stack(wood_data).numpy() / 10 wood_data_test = [wood_data_test[i][0].data for i in range(len(wood_data_test))] wood_data_test = torch.stack(wood_data_test).numpy() / 10 # Novelty data_novelty = wood_data_test # Train data_train = wood_data # Val data_val = data_train ###################################################### # NORMAL DISTRIBUTION ###################################################### # Model model = ModelNormal(input_features = data_train.shape[1], hidden_layer=20, latent_features=20) torch.manual_seed(4) # LOSS criterion = KLLoss(model=model, size_average=False) # INSTANTIATE OPTIMIZER optimizer = torch.optim.SGD(model.parameters(), lr=argv.lrate, weight_decay=1) #Evaluator evaluator = Evaluator(model, data_train, data_val, data_novelty) # Activate matplotlib argv.plots = True with Logger(loglevel=10, log_batch_interval=601) as lg: # CREATE A TRAINER my_trainer = UnsupervisedTrainer(lg, model, criterion, optimizer, trainingstate = Trainingstate(), model_filename="KL_MIN", use_cuda= argv.use_cuda, profile = False, convergence_eps = 1e-5) # START TRAINING my_trainer.fit(dataloader_training=(wood_data, 20), epochs=200) evaluator.evaluate_model(argv) ###################################################### # LOGNORMAL ###################################################### # Model model = ModelLogNormal(input_features = data_train.shape[1], hidden_layer=20, latent_features=20) torch.manual_seed(4) # LOSS criterion = KLLoss_lognormal(model=model, size_average=False) # INSTANTIATE OPTIMIZER optimizer = torch.optim.SGD(model.parameters(), lr=argv.lrate, weight_decay=1) #Evaluator evaluator = Evaluator(model, data_train, data_val, data_novelty) # Activate matplotlib argv.plots = True with Logger(loglevel=10, log_batch_interval=601) as lg: # CREATE A TRAINER my_trainer = UnsupervisedTrainer(lg, model, criterion, optimizer, trainingstate = Trainingstate(), model_filename="KL_MIN", use_cuda= argv.use_cuda, profile = False, convergence_eps = 1e-5) # START TRAINING my_trainer.fit(dataloader_training=(data_train, 20), epochs=argv.epochs) evaluator.evaluate_model(argv) ###################################################### # LAPLACE ###################################################### # Model model = ModelLaplace(input_features = data_train.shape[1], hidden_layer=20, latent_features=20) torch.manual_seed(4) # LOSS criterion = KLLoss_laplace(model=model, size_average=False, mean=2, scale=0.5) # INSTANTIATE OPTIMIZER optimizer = torch.optim.SGD(model.parameters(), lr=0.000001, weight_decay=1) #Evaluator evaluator = Evaluator(model, data_train, data_val, data_novelty) # Activate matplotlib argv.plots = True with Logger(loglevel=10, log_batch_interval=601) as lg: # CREATE A TRAINER my_trainer = UnsupervisedTrainer(lg, model, criterion, optimizer, trainingstate = Trainingstate(), model_filename="KL_MIN", use_cuda= argv.use_cuda, profile = False, convergence_eps = 1e-1) # START TRAINING my_trainer.fit(dataloader_training=(data_train, 20), epochs=300) evaluator.evaluate_model(argv) # {'AUROC LAT (TRAIN)': 0.8743801652892562, # 'AUROC LAT (VAL)': 0.8661157024793389, # 'AUROC REC (TRAIN)': 0.86900826446281, # 'AUROC REC (VAL)': 0.8528925619834712} ###################################################### # LAPLACE WITH R-SHIFT ###################################################### # Model model = ModelLaplace(input_features = data_train.shape[1], hidden_layer=20, latent_features=20) torch.manual_seed(4) # LOSS criterion = CombinedLoss(model) # INSTANTIATE OPTIMIZER optimizer = torch.optim.SGD(model.parameters(), lr=argv.lrate, weight_decay=1) #Evaluator evaluator = Evaluator(model, data_train, data_val, data_novelty) # Activate matplotlib argv.plots = True with Logger(loglevel=10, log_batch_interval=601) as lg: # CREATE A TRAINER my_trainer = UnsupervisedTrainer(lg, model, criterion, optimizer, trainingstate = Trainingstate(), model_filename="KL_MIN", use_cuda= argv.use_cuda, profile = False, convergence_eps = 1e-3) # START TRAINING my_trainer.fit(dataloader_training=(data_train, 20), epochs=200) evaluator.evaluate_model(argv) # {'AUROC LAT (TRAIN)': 0.8590909090909091, # 'AUROC LAT (VAL)': 0.8752066115702479, # 'AUROC REC (TRAIN)': 0.8677685950413224, # 'AUROC REC (VAL)': 0.8619834710743801}
[ 11748, 1822, 29572, 198, 11748, 25064, 198, 11748, 28034, 198, 11748, 299, 32152, 355, 45941, 198, 11748, 28034, 13, 20471, 355, 299, 77, 198, 6738, 28034, 13, 26791, 13, 7890, 1330, 6060, 17401, 198, 6738, 28034, 10178, 13, 19608, 292, ...
2.00048
4,165
# -*- coding: utf-8 -*- """CNN.ipynb Automatically generated by Colaboratory. Original file is located at https://colab.research.google.com/drive/1Tq6HUya2PrC0SmyOIFo2c_eVtguRED2q """ import torch import torch.nn as nn import torch.optim as optim import torch.nn.functional as F from torch.utils.data import DataLoader import torchvision.datasets as datasets import torchvision.transforms as transforms model = CNN(1,10) x = torch.randn((64,1,28,28)) print(model(x).shape) device = torch.device("cuda" if torch.cuda.is_available() else "cpu") device in_channels = 1 num_classes = 10 learning_rate = 0.001 batch_size = 64 num_epochs = 4 train_dataset = datasets.MNIST(root = "dataset/",train = True,transform = transforms.ToTensor(),download = True) train_loader = DataLoader(dataset=train_dataset,batch_size=64,shuffle=True) test_dataset = train_dataset = datasets.MNIST(root = "dataset/",train = False,transform = transforms.ToTensor(),download = True) test_loader = DataLoader(dataset = test_dataset,batch_size = batch_size,shuffle = True) model = CNN(1,10).to(device = device) criterion = nn.CrossEntropyLoss() optimizer = optim.Adam(model.parameters(),lr = learning_rate) for epoch in range(num_epochs): for batch_idx,(data,targets) in enumerate(train_loader): #get data to cuda if possible data = data.cuda() targets = targets.cuda() scores = model(data) loss = criterion(scores,targets) #backward optimizer.zero_grad() loss.backward() #gradient_descent or adam-step optimizer.step() # Check the accuracy for the training step check_accuracy(train_loader,model) check_accuracy(test_loader,model)
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 37811, 18474, 13, 541, 2047, 65, 198, 198, 38062, 4142, 7560, 416, 1623, 4820, 2870, 13, 198, 198, 20556, 2393, 318, 5140, 379, 198, 220, 220, 220, 3740, 1378, 4033, 3...
2.731588
611
# -*- coding: utf-8 -*- # @Time : 2020-07-30 15:06 # @Author : yingyuankai # @Email : yingyuankai@aliyun.com # @File : qa_evaluators.py import os import logging import numpy as np import tensorflow as tf import json from pprint import pprint from collections import defaultdict from aispace.utils.eval_utils import calc_em_score, calc_f1_score from aispace.utils.io_utils import save_json from aispace.utils.print_utils import print_boxed from aispace.utils.metrics_utils import ConfusionMatrix __all__ = [ 'EvaluatorForQaSimple', 'EvaluatorForQaWithImpossible' ] logger = logging.getLogger(__name__)
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 2, 2488, 7575, 220, 220, 220, 1058, 12131, 12, 2998, 12, 1270, 1315, 25, 3312, 198, 2, 2488, 13838, 220, 1058, 331, 278, 24767, 962, 1872, 198, 2, 2488, 15333, 220, ...
2.630252
238
import pytest import torch def pytest_report_header(): return f'torch: {torch.__version__}'
[ 11748, 12972, 9288, 198, 11748, 28034, 628, 628, 198, 4299, 12972, 9288, 62, 13116, 62, 25677, 33529, 198, 220, 220, 220, 1441, 277, 470, 273, 354, 25, 1391, 13165, 354, 13, 834, 9641, 834, 92, 6, 198 ]
2.702703
37
"""Treadmill hierarchical scheduler. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import abc import collections import datetime import heapq import itertools import logging import operator import sys import time import enum import numpy as np import six _LOGGER = logging.getLogger(__name__) MAX_PRIORITY = 100 DEFAULT_RANK = 100 _UNPLACED_RANK = sys.maxsize DIMENSION_COUNT = None _MAX_UTILIZATION = float('inf') _GLOBAL_ORDER_BASE = time.mktime((2014, 1, 1, 0, 0, 0, 0, 0, 0)) # 21 day DEFAULT_SERVER_UPTIME = 21 * 24 * 60 * 60 # 1 day MIN_SERVER_UPTIME = 1 * 24 * 60 * 60 # 7 days DEFAULT_MAX_APP_LEASE = 7 * 24 * 60 * 60 # Default partition threshold DEFAULT_THRESHOLD = 0.9 # pylint: disable=C0302,too-many-lines def _bit_count(value): """Returns number of bits set. """ count = 0 while value: value &= value - 1 count += 1 return count def zero_capacity(): """Returns zero capacity vector. """ assert DIMENSION_COUNT is not None, 'Dimension count not set.' return np.zeros(DIMENSION_COUNT) def eps_capacity(): """Returns eps capacity vector. """ assert DIMENSION_COUNT is not None, 'Dimension count not set.' return np.array( [np.finfo(float).eps for _x in range(0, DIMENSION_COUNT)] ) def _global_order(): """Use timestamp in nanoseconds, from Jan 1st 2014, to break tie in scheduling conflicts for apps of the same priority, in a FIFO fashion. """ # Take the current EPOCH in nanosec global_order = int(time.time() * 1000000) - _GLOBAL_ORDER_BASE return global_order def utilization(demand, allocated, available): """Calculates utilization score. """ return np.max(np.subtract(demand, allocated) / available) def _all(oper, left, right): """Short circuit all for ndarray. """ return all( oper(ai, bi) for ai, bi in six.moves.zip(left, right) ) def _any(oper, left, right): """Short circuit any for ndarray. """ return any( oper(ai, bi) for ai, bi in six.moves.zip(left, right) ) def _any_eq(left, right): """Short circuit any eq for ndarray. """ return _any(operator.eq, left, right) def _any_isclose(left, right): """Short circuit any isclose for ndarray. """ return _any(np.isclose, left, right) def _any_lt(left, right): """Short circuit any lt for ndarray. """ return _any(operator.lt, left, right) def _any_le(left, right): """Short circuit any le for ndarray. """ return _any(operator.le, left, right) def _any_gt(left, right): """Short circuit any gt for ndarray. """ return _any(operator.gt, left, right) def _any_ge(left, right): """Short circuit any ge for ndarray. """ return _any(operator.ge, left, right) def _all_eq(left, right): """Short circuit all eq for ndarray. """ return _all(operator.eq, left, right) def _all_isclose(left, right): """Short circuit all isclose for ndarray. """ return _all(np.isclose, left, right) def _all_lt(left, right): """Short circuit all lt for ndarray. """ return _all(operator.lt, left, right) def _all_le(left, right): """Short circuit all le for ndarray. """ return _all(operator.le, left, right) def _all_gt(left, right): """Short circuit all gt for ndarray. """ return _all(operator.gt, left, right) def _all_ge(left, right): """Short circuit all ge for ndarray. """ return _all(operator.ge, left, right) def adjust_valid_until(self, child_valid_until): """Recursively adjust valid until time. """ if child_valid_until: self.valid_until = max(self.valid_until, child_valid_until) else: if self.empty(): self.valid_until = 0 else: self.valid_until = max([node.valid_until for node in self.children_iter()]) if self.parent: self.parent.adjust_valid_until(child_valid_until) def remove_child_traits(self, node_name): """Recursively remove child traits up. """ self.traits.remove(node_name) if self.parent: self.parent.remove_child_traits(self.name) self.parent.add_child_traits(self) def reset_children(self): """Reset children to empty list. """ for child in self.children_iter(): child.parent = None self.children = list() self.children_by_name = dict() def add_node(self, node): """Add child node, set the traits and propagate traits up. """ assert node.parent is None assert node.name not in self.children_by_name node.parent = self self.children.append(node) self.children_by_name[node.name] = node self.add_child_traits(node) self.increment_affinity(node.affinity_counters) self.add_labels(node.labels) self.adjust_valid_until(node.valid_until) def add_labels(self, labels): """Recursively add labels to self and parents. """ self.labels.update(labels) if self.parent: self.parent.add_labels(self.labels) def remove_node(self, node): """Remove child node and adjust the traits. """ assert node.name in self.children_by_name del self.children_by_name[node.name] for idx in six.moves.xrange(0, len(self.children)): if self.children[idx] == node: self.children[idx] = None self.remove_child_traits(node.name) self.decrement_affinity(node.affinity_counters) self.adjust_valid_until(None) node.parent = None return node def remove_node_by_name(self, nodename): """Removes node by name. """ assert nodename in self.children_by_name return self.remove_node(self.children_by_name[nodename]) def check_app_constraints(self, app): """Find app placement on the node. """ if app.allocation is not None: if app.allocation.label not in self.labels: _LOGGER.info('Missing label: %s on %s', app.allocation.label, self.name) return False if app.traits != 0 and not self.traits.has(app.traits): _LOGGER.info('Missing traits: %s on %s', app.traits, self.name) return False if not self.check_app_affinity_limit(app): return False if _any_gt(app.demand, self.free_capacity): _LOGGER.info('Not enough free capacity: %s', self.free_capacity) return False return True def check_app_affinity_limit(self, app): """Check app affinity limits """ count = self.affinity_counters[app.affinity.name] limit = app.affinity.limits[self.level] return count < limit def put(self, _app): """Abstract method, should never be called. """ raise Exception('Not implemented.') def size(self, label): """Returns total capacity of the children. """ if self.empty() or label not in self.labels: return eps_capacity() return np.sum([ n.size(label) for n in self.children_iter()], 0) def members(self): """Return set of all leaf node names. """ names = dict() for node in self.children_iter(): names.update(node.members()) return names def increment_affinity(self, counters): """Increment affinity counters recursively. """ self.affinity_counters.update(counters) if self.parent: self.parent.increment_affinity(counters) def decrement_affinity(self, counters): """Decrement affinity counters recursively. """ self.affinity_counters.subtract(counters) if self.parent: self.parent.decrement_affinity(counters) class Bucket(Node): """Collection of nodes/buckets. """ __slots__ = ( 'affinity_strategies', 'traits', ) _default_strategy_t = SpreadStrategy def set_affinity_strategy(self, affinity, strategy_t): """Initilaizes placement strategy for given affinity. """ self.affinity_strategies[affinity] = strategy_t(self) def get_affinity_strategy(self, affinity): """Returns placement strategy for the affinity, defaults to spread. """ if affinity not in self.affinity_strategies: self.set_affinity_strategy(affinity, Bucket._default_strategy_t) return self.affinity_strategies[affinity] def adjust_capacity_up(self, new_capacity): """Node can only increase capacity. """ self.free_capacity = np.maximum(self.free_capacity, new_capacity) if self.parent: self.parent.adjust_capacity_up(self.free_capacity) def adjust_capacity_down(self, prev_capacity=None): """Called when capacity is decreased. """ if self.empty(): self.free_capacity = zero_capacity() if self.parent: self.parent.adjust_capacity_down() else: if prev_capacity is not None and _all_lt(prev_capacity, self.free_capacity): return free_capacity = zero_capacity() for child_node in self.children_iter(): if child_node.state is not State.up: continue free_capacity = np.maximum(free_capacity, child_node.free_capacity) # If resulting free_capacity is less the previous, we need to # adjust the parent, otherwise, nothing needs to be done. prev_capacity = self.free_capacity.copy() if _any_lt(free_capacity, self.free_capacity): self.free_capacity = free_capacity if self.parent: self.parent.adjust_capacity_down(prev_capacity) def add_node(self, node): """Adds node to the bucket. """ super(Bucket, self).add_node(node) self.adjust_capacity_up(node.free_capacity) def remove_node(self, node): """Removes node from the bucket. """ super(Bucket, self).remove_node(node) # if _any_isclose(self.free_capacity, node.free_capacity): self.adjust_capacity_down(node.free_capacity) return node def put(self, app): """Try to put app on one of the nodes that belong to the bucket. """ # Check if it is feasible to put app on some node low in the # hierarchy _LOGGER.debug('bucket.put: %s => %s', app.name, self.name) if not self.check_app_constraints(app): return False strategy = self.get_affinity_strategy(app.affinity.name) node = strategy.suggested_node() if node is None: _LOGGER.debug('All nodes in the bucket deleted.') return False nodename0 = node.name first = True while True: # End of iteration. if not first and node.name == nodename0: _LOGGER.debug('Finished iterating on: %s.', self.name) break first = False _LOGGER.debug('Trying node: %s:', node.name) if node.state is not State.up: _LOGGER.debug('Node not up: %s, %s', node.name, node.state) else: if node.put(app): return True node = strategy.next_node() return False class Server(Node): """Server object, final app placement. """ __slots__ = ( 'init_capacity', 'apps', 'up_since', 'presence_id', ) def is_same(self, other): """Compares capacity and traits against another server. valid_until is ignored, as server comes up after reboot will have different valid_until value. """ return (self.labels == other.labels and _all_eq(self.init_capacity, other.init_capacity) and self.traits.is_same(other.traits)) def put(self, app): """Tries to put the app on the server. """ assert app.name not in self.apps _LOGGER.debug('server.put: %s => %s', app.name, self.name) if not self.check_app_lifetime(app): return False if not self.check_app_constraints(app): return False prev_capacity = self.free_capacity.copy() self.free_capacity -= app.demand self.apps[app.name] = app self.increment_affinity([app.affinity.name]) app.server = self.name if self.parent: self.parent.adjust_capacity_down(prev_capacity) if app.placement_expiry is None: app.placement_expiry = time.time() + app.lease return True def restore(self, app, placement_expiry=None): """Put app back on the server, ignore app lifetime. """ _LOGGER.debug('server.restore: %s => %s (%s)', app.name, self.name, placement_expiry) lease = app.lease # If not explicit if placement_expiry is None: placement_expiry = app.placement_expiry app.lease = 0 rc = self.put(app) app.lease = lease app.placement_expiry = placement_expiry return rc def renew(self, app): """Try to extend the placement for app lease. """ can_renew = self.check_app_lifetime(app) if can_renew: app.placement_expiry = time.time() + app.lease return can_renew def check_app_lifetime(self, app): """Check if the app lease fits until server is rebooted. """ # app with 0 lease can be placed anywhere (ignore potentially # expired servers) if not app.lease: return True return time.time() + app.lease < self.valid_until def remove(self, app_name): """Removes app from the server. """ assert app_name in self.apps app = self.apps[app_name] del self.apps[app_name] app.server = None app.evicted = True app.unschedule = False app.placement_expiry = None self.free_capacity += app.demand self.decrement_affinity([app.affinity.name]) if self.parent: self.parent.adjust_capacity_up(self.free_capacity) def remove_all(self): """Remove all apps. """ # iterate over copy of the keys, as we are removing them in the loop. for appname in list(self.apps): self.remove(appname) def size(self, label): """Return server capacity. """ if label not in self.labels: return eps_capacity() return self.init_capacity def members(self): """Return set of all leaf node names. """ return {self.name: self} def set_state(self, state, since): """Change host state. """ if self.state is state: return super(Server, self).set_state(state, since) if state == State.up: if self.parent: self.parent.adjust_capacity_up(self.free_capacity) elif state in (State.down, State.frozen): if self.parent: self.parent.adjust_capacity_down(self.free_capacity) else: raise Exception('Invalid state: ' % state) class Allocation: """Allocation manages queue of apps sharing same reserved capacity. In reality allocation is tied to grn via application proid. Applications within the allocation are organized by application priority. Allocations are ranked, and the rank is used to globally order applications from different allocations into global queue. Default allocation has rank 100. Defining allocation with lower rank will result in all it's applications to be evaluated first regardless of utilization. This is used to model "system" applications that should be always present regardless of utilization. Allocation queue can be capped with max_utilization parameter. If set, it will specify the max_utilization which will be considered for scheduling. """ __slots__ = ( 'reserved', 'rank', 'rank_adjustment', 'traits', 'label', 'max_utilization', 'apps', 'sub_allocations', 'path', 'constraints', ) def set_reserved(self, reserved): """Update reserved capacity. """ if reserved is None: self.reserved = zero_capacity() elif isinstance(reserved, int): assert reserved == 0 self.reserved = zero_capacity() elif isinstance(reserved, float): assert reserved == 0.0 self.reserved = zero_capacity() elif isinstance(reserved, list): assert len(reserved) == DIMENSION_COUNT self.reserved = np.array(reserved, dtype=float) elif isinstance(reserved, np.ndarray): self.reserved = reserved else: assert 'Unsupported type: %r' % type(reserved) def update(self, reserved, rank, rank_adjustment, max_utilization=None): """Updates allocation. """ if rank is not None: self.rank = rank else: self.rank = DEFAULT_RANK if rank_adjustment is not None: self.rank_adjustment = rank_adjustment self.set_reserved(reserved) self.set_max_utilization(max_utilization) def set_max_utilization(self, max_utilization): """Sets max_utilization, accounting for default None value. """ if max_utilization is not None: self.max_utilization = max_utilization else: self.max_utilization = _MAX_UTILIZATION def set_traits(self, traits): """Set traits, account for default None value. """ if not traits: self.traits = 0 else: self.traits = traits def add(self, app): """Add application to the allocation queue. Once added, the scheduler will make an attempt to place the app on one of the cell nodes. """ # Check that there are no duplicate app names. if app.name in self.apps: _LOGGER.warning( 'Duplicate app on alllocation queue: %s', app.name ) return app.allocation = self self.apps[app.name] = app def remove(self, name): """Remove application from the allocation queue. """ if name in self.apps: self.apps[name].allocation = None del self.apps[name] def total_reserved(self): """Total reserved capacity including sub-allocs. """ return six.moves.reduce( lambda acc, alloc: acc + alloc.total_reserved(), six.itervalues(self.sub_allocations), self.reserved ) def add_sub_alloc(self, name, alloc): """Add child allocation. """ self.sub_allocations[name] = alloc assert not alloc.path alloc.path = self.path + [name] alloc.label = self.label def remove_sub_alloc(self, name): """Remove chlid allocation. """ if name in self.sub_allocations: del self.sub_allocations[name] def get_sub_alloc(self, name): """Return sub allocation, create empty if it does not exist. """ if name not in self.sub_allocations: self.add_sub_alloc(name, Allocation()) return self.sub_allocations[name] def all_apps(self): """Return all apps in allocation and sub-allocations.""" all_apps = list(six.itervalues(self.apps)) for alloc in six.itervalues(self.sub_allocations): all_apps.extend(alloc.all_apps()) return all_apps class Partition: """Cell partition. """ __slots__ = ( 'allocation', 'max_server_uptime', 'max_lease', 'threshold', 'label', '_reboot_buckets', '_reboot_dates', '_reboot_last', ) def _find_bucket(self, timestamp): """Try to find bucket with given timestamp. """ for bucket in self._reboot_buckets: if bucket.timestamp == timestamp: return bucket return None def add(self, server, timestamp=None): """Add server. """ bucket = None if timestamp: bucket = self._find_bucket(timestamp) # servers with larger than max lifetime should be rebooted at # the next opportunity if (self._reboot_buckets[0].timestamp > server.up_since + DEFAULT_SERVER_UPTIME): bucket = self._reboot_buckets[0] if not bucket: bucket = min(reversed(self._reboot_buckets), key=lambda b: b.cost(server)) bucket.add(server) def remove(self, server): """Remove server. """ for bucket in self._reboot_buckets: bucket.remove(server) def tick(self, now): """Do per-tick-bookkeeping. """ while self._reboot_last <= now + DEFAULT_SERVER_UPTIME: bucket = RebootBucket(next(self._reboot_dates)) self._reboot_buckets.append(bucket) self._reboot_last = bucket.timestamp while self._reboot_buckets[0].timestamp < now: self._reboot_buckets.pop(0) # pylint: disable=invalid-name def reboot_dates(schedule, start_date=None): """Generate list of valid reboot dates. """ date = datetime.date.today() if start_date: date = start_date while True: weekday = date.weekday() if weekday in schedule: h, m, s = schedule[weekday] yield time.mktime((date.year, date.month, date.day, h, m, s, 0, 0, 0)) date += datetime.timedelta(days=1) def dumps(cell): """Serializes cell to string. """ del cell return '' def loads(data): """Loads scheduler from string. """ del data assert False, 'not implemented.'
[ 37811, 51, 961, 17805, 38958, 6038, 18173, 13, 198, 37811, 198, 198, 6738, 11593, 37443, 834, 1330, 4112, 62, 11748, 198, 6738, 11593, 37443, 834, 1330, 7297, 198, 6738, 11593, 37443, 834, 1330, 3601, 62, 8818, 198, 6738, 11593, 37443, ...
2.250916
10,103
import random import sys import time import json import os import warnings import numpy as np import glob, os stat_mini = 1 stat_max = 0 listBanners = [] #HOW TO USE IT: #1 copy the opening.txt #2 remove the graphic (but do keep top logo for consistency) #3 add ASCII art that is 78 or less characters in width #4 save txt file under a complete new name
[ 11748, 4738, 198, 11748, 25064, 198, 11748, 640, 198, 198, 11748, 33918, 198, 11748, 28686, 198, 11748, 14601, 198, 198, 11748, 299, 32152, 355, 45941, 628, 198, 11748, 15095, 11, 28686, 198, 198, 14269, 62, 45313, 220, 220, 220, 220, 7...
2.571429
161
from dataclasses import dataclass LIGHT = theme( name='LIGHT', bg_color=None, fg_color='black', lb_color='#f0f0f0', ttk_theme='xpnative' ) DARK = theme( name='DARK', bg_color='#424242', fg_color='white', lb_color='#424242', ttk_theme='black' )
[ 6738, 4818, 330, 28958, 220, 1330, 4818, 330, 31172, 201, 198, 201, 198, 43, 9947, 796, 7505, 7, 201, 198, 220, 220, 220, 220, 220, 220, 220, 1438, 11639, 43, 9947, 3256, 220, 201, 198, 220, 220, 220, 220, 220, 220, 220, 275, 70, ...
1.650224
223
import os import sys import re import json import logging import torch from transformers import ( HfArgumentParser, set_seed, AutoTokenizer, AutoConfig, EvalPrediction, ) from src.model.ca_mtl import CaMtl, CaMtlArguments from src.utils.misc import MultiTaskDataArguments, Split from src.mtl_trainer import MultiTaskTrainer, MultiTaskTrainingArguments from src.data.mtl_dataset import MultiTaskDataset from src.data.task_dataset import TaskDataset logger = logging.getLogger(__name__) if __name__ == "__main__": main()
[ 11748, 28686, 198, 11748, 25064, 198, 11748, 302, 198, 11748, 33918, 198, 11748, 18931, 198, 198, 11748, 28034, 198, 6738, 6121, 364, 1330, 357, 198, 220, 220, 220, 367, 69, 28100, 1713, 46677, 11, 198, 220, 220, 220, 900, 62, 28826, ...
2.850515
194
#!/usr/bin/env python3 """Read data in CSV format from websocket """ import sys import asyncio import websockets # read url from command line if len(sys.argv) >= 2: uri = sys.argv[1] else: # host url and port uri = "ws://localhost:8314" print("*==* ", sys.argv[0], " Lese Daten von url ", uri) # run web client asyncio.get_event_loop().run_until_complete(read_ws())
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 18, 198, 37811, 5569, 1366, 287, 44189, 5794, 422, 2639, 5459, 198, 37811, 198, 198, 11748, 25064, 198, 11748, 30351, 952, 198, 11748, 2639, 11603, 198, 198, 2, 1100, 19016, 422, 3141, 1627, ...
2.587838
148
import os import sys import itertools import json _NONE = object() sys.modules[__name__] = SettingManager()
[ 11748, 28686, 198, 11748, 25064, 198, 11748, 340, 861, 10141, 198, 11748, 33918, 198, 198, 62, 45, 11651, 796, 2134, 3419, 628, 198, 198, 17597, 13, 18170, 58, 834, 3672, 834, 60, 796, 25700, 13511, 3419, 198 ]
3.027027
37
""" This file contains partial objects related to Roblox groups. """ from __future__ import annotations from typing import TYPE_CHECKING from ..bases.basegroup import BaseGroup from ..bases.baseuser import BaseUser if TYPE_CHECKING: from ..client import Client
[ 37811, 198, 198, 1212, 2393, 4909, 13027, 5563, 3519, 284, 3851, 75, 1140, 2628, 13, 198, 198, 37811, 198, 6738, 11593, 37443, 834, 1330, 37647, 198, 6738, 19720, 1330, 41876, 62, 50084, 2751, 198, 198, 6738, 11485, 65, 1386, 13, 8692, ...
3.613333
75