content
stringlengths
5
1.05M
a=input('Write integer number from 0 to 30: ') print(' '+'*'*int(a)+' ') for i in range(0,int(a)-1,1): print('*'+' '*int(a)+'*') print('*'*(int(a)+2)) for i in range(0,int(a),1): print('*'+' '*int(a)+'*')
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # LOGGING INIT import time import os,sys import logging # get a logger logger = logging.getLogger() logger.setLevel(logging.DEBUG) # we want two handlers # one for the sys.stdout (console) # one for writing into the logfile if len(logger.handlers) != 2: # c...
import sys, csv, json, numpy, scipy, math from numpy import array from scipy.cluster.vq import vq, kmeans2, whiten # Parse incoming JSON data #feed = json.loads(sys.argv[1]) with open(sys.argv[1]) as tempfile: for line in tempfile: feed = json.loads(line) # Assign variables data = json.loads(feed['melted']) rowHea...
import os from setuptools import setup, find_packages version = "0.0.1" # Description from README.md base_dir = os.path.dirname(os.path.abspath(__file__)) long_description = "\n\n".join([open(os.path.join(base_dir, "README.md"), "r").read()]) setup( name="bio_test_artifacts", version=version, description...
# -*- coding: utf-8 -*- from click.testing import CliRunner import pytest @pytest.fixture(scope='function') def runner(): return CliRunner()
#!/usr/bin/python3 import discord import requests import json import re import formatter import os client = discord.Client() # key: channels to run in. value: default formatter if not specified channels = {} # bot token token = None # whitelisted roles roles = [] # utf-8 encoding of paperclip emoji (comparing emojis i...
import os import shutil def move_files(origin, destination, cs8_codes): for root, dirs, files in os.walk(origin): for file in files: path = os.path.join(root, file) file_name = os.path.split(path)[-1] for cs8_code in cs8_codes: if cs8_code.upper() in fi...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.conf import settings from django.shortcuts import render from django.urls import reverse from django.views.generic import FormView from lgr.tools.utils import download_file from lgr_advanced.lgr_tools.api import lgr_intersect_union, lgr_comp_...
syntax = r'^(?:\%|\+eval )(?P<statement>.+)$' def eval(caller, statement): # We use caller.write directly to avoid unescaping the text. caller.write("< %s" % (eval(statement), )) eval.safe = False eval.complete = True
class Solution: def decodeString(self, s: str) -> str: stack = [] temp = [] for ch in s: if ch != ']': stack.append(ch) else: while stack[-1] != '[': temp.append(stack.pop()) stack.pop() # pop '[' ...
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
from ansiblelint import AnsibleLintRule class ImproperAlignment(AnsibleLintRule): id = 'ANSIBLE0016' descreiption = 'double spaces are used for indentation instead of tabulation' severity = 'medium' tags = {'complex'} version_added = 'v1.0.0' shortdesc = 'consistency of indentation and alignmn...
import unittest import responses from securenative.config.securenative_options import SecureNativeOptions from securenative.http.securenative_http_client import SecureNativeHttpClient class SecureNativeHttpClientTest(unittest.TestCase): @responses.activate def test_should_make_simple_post_call(self): ...
import requests from connection.connection_variables import link_for_rebill from parameters.subscription.case_1.subsciption_params import * from parameters.rebill.case_1.rebill_params import * from parameters.cancel.case_1.cancel_params import * def case_one_subscription(): return requests.get(link_for_rebill, ca...
# Packages Import import argparse import cv2 import os import numpy as np # construct the argument parser and parse the arguments ap = argparse.ArgumentParser() ap.add_argument("-m", "--model", required=True, help="path to BING objectness saliency model") ap.add_argument("-i", "--image", required=True, help="path to...
def get_input(): with open("input.txt") as f: card_pub_key, door_pub_key = f.read().splitlines() return int(card_pub_key), int(door_pub_key) def transform(value, subject_number): return (value * subject_number) % 20201227 def get_loop_size(pub_key): value = 1 loop_size = 0 while True...
import sys sys.path.insert(0, "..") import time from opcua import ua, Server from opcua.server.history_sql import HistorySQLite import redis HOST = '180.76.242.57' KEY = '66CFF484948668381143656' if __name__ == "__main__": r = redis.Redis(host=HOST, port=6379, db=0) # setup our server server = Server(...
import discord import datetime from discord.ext import commands from sqlalchemy.ext.asyncio import AsyncSession from src.postgres import database class Info(discord.ui.View): def __init__(self, member: discord.Member, created_time: str, deleted_time: str, event_edit: str): super().__init__() self...
# -*- coding: utf-8 -*- """ Python Database Connectivity lib """ from pydbclib.database import Database from pydbclib.drivers import CommonDriver, SQLAlchemyDriver __author__ = "liyatao" __version__ = '2.2.2' def connect(*args, **kwargs): driver = kwargs.get("driver", "sqlalchemy") kwargs.update(driver=d...
#! /usr/bin/env python """ twist_to_motors - converts a twist message to motor commands based on differential drive. Copyright (C) 2012 Jon Stephan. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by ...
from .errors import NotDomainSlicerError, WrongSlicerError from .util import * import warnings class DataDomainSlicer(object): def __init__( self, data_domain, number_of_steps, frame_selection, frame_fraction, mode='generator' ): ''' Abstract Cl...
#%% from utils.config import Config import pandas as pd #%% c = Config() c.validate_files() #%% df1 = pd.read_csv(c.uid_300K, nrows=1000) #%% # this code need to be refactored into a util # or save a clean file to dataset df1_columns_index = [15, 2,3,5,7,8,9,10,11,12] df1_columns_labels = ['uid','bilayer', 'mo...
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright 2016-2020 CERN # # 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 ...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import modelcluster.fields import wagtail.wagtailcore.fields class Migration(migrations.Migration): dependencies = [ ('wagtailcore', '0010_change_page_owner_to_null_on_delete'), ('wagtaildocs...
from rest_framework import serializers from .models import YearPlan from ..workOrder.serializers import WorkOrderMiniSerializer class YearPlanMiniSerializer(serializers.ModelSerializer): class Meta: model = YearPlan fields = ['id', 'year', 'cantidadAudit'] class YearPlanSerializer(serializers.M...
#!/usr/bin/env python from pwn import * import textwrap # buffer writer a = ''' or al, 3 xchg ecx, ebx shl edx, 12 int 0x80 ''' a = asm(a) binstr = ''.join('{0:08b}'.format(ord(x), 'b') for x in a) for line in textwrap.wrap(binstr, 110): print line print a.encode('hex') print len(a) # for GDB test buf_address = 0x...
no_list = {"tor:", "getblocktemplate", " ping ", " pong "} for i in range(1, 5): with open("Desktop/"+str(i)+".log", "r") as r: with open("Desktop/"+str(i)+"-clean.log", "a+") as w: for line in r: if not any(s in line for s in no_list): w.write(line)
import setuptools setuptools.setup( name="nonebot_plugin_blackjack", version="0.0.4", keywords=("pip", "nonebot2", "nonebot", "nonebot_plugin"), description="""nonebot2 21点插件""", url="https://github.com/yaowan233/nonebot-plugin-blackjack", packages=setuptools.find_packages(), cla...
from .conv_module import ConvModule from .norm import build_norm_layer __all__ = [ 'ConvModule', 'build_norm_layer' ]
import json import tempfile import pandas as pd from libalignmentrs.record import Record from alignmentrs.aln.mixins import serde from alignmentrs.aln.mixins.serde import ( col_metadata_str_formatter, col_metadata_to_str) from alignmentrs.aln.mixins.tests.mocks import MockData class MockAlignment(serde.FastaSer...
""" Autopsy Forensic Browser Copyright 2016-2020 Basis Technology Corp. Contact: carrier <at> sleuthkit <dot> org 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...
# 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 # d...
""" These added function are used to: - Get ticket donations value - Get ticket donations list - Get the percentage value of a donation towards its goal """ import stripe from django import template register = template.Library() @register.filter def get_ticket_donation_value(option): """ Ge...
from modules.attention import Attention from modules.biLSTM import BidirectionalLSTM from modules.resnet50v1 import ResNet, ResNet_FeatureExtractor from modules.TPS_STN import TPS_SpatialTransformerNetwork from modules.vgg_bn import UpConv, init_weights, vgg16_bn
from os.path import abspath, dirname, join import nltk import spacy import stop_words def get_stopwords(source="spacy"): """Return German stopwords based on given source. Written by Leo Nguyen. Contact Xenovortex, if problems arises. Args: source (str, optional): source to load stopwords fro...
''' Tax calculate. You can choose tax rate. ''' class TaxCalculate(): """Class of taxes""" tax_rates = { "1":0.18, "2":0.08, "3":0.01 } def tax_rate(self): """Asking tax rate""" print("***** Tax Calculator *****") work_on = True while work_on: ...
from hamcrest import assert_that, equal_to from lib.users_get import handler def test_users_get(): event = {} context = {} response = handler(event, context) assert_that(response['statusCode'], equal_to(200))
import requests import csv import plotly.io as pio import plotly.graph_objects as go import time import json state = [] infected = [] recovered = [] okDate = [] okInfected = [] nyNum = [] nyDate = [] nyInfected = [] okNum = [] txNum = [] txDate = [] txInfected = [] count = 0 covidURL = "https://covidtracking.com/api/...
#!/usr/bin/env python # -*- coding: utf-8 -*- # use : python==3.6.3rc1 import os import json import csv import time import sqlite3 from email.mime.multipart import MIMEMultipart from email.mime.application import MIMEApplication from email.mime.base import MIMEBase #用於承載附檔 from email import encoders #用於附檔編碼 from ema...
""" run test: cd FLACT python -m test.test or in VsCode, Run config TestAll """ import doctest import importlib MODULES = [ # common 'common.BNFParser', 'common.production', # FLAAT charpter 6 'FLAAT.ch6.algo_6_1', 'FLAAT.ch6.algo_6_2', 'FLAAT.ch6.algo_6_3', 'FLAAT.ch6.algo_6_3_1', 'FLAAT.ch6.a...
from enum import Enum class lang(Enum): """Represents all available languages.""" English = "en-gb" German = "de-de"
""" ## AWS CDK Assets <!--BEGIN STABILITY BANNER-->--- ![Deprecated](https://img.shields.io/badge/deprecated-critical.svg?style=for-the-badge) > This API may emit warnings. Backward compatibility is not guaranteed. --- <!--END STABILITY BANNER--> All types moved to @aws-cdk/core. """ import abc import builtins im...
import os BASEDIR = os.path.abspath(os.path.dirname(__file__)) class Config: SECRET_KEY = os.environ.get('SECRET_KEY') SQLALCHEMY_COMMIT_ON_TEARDOWN = True SQLALCHEMY_TRACK_MODIFICATIONS = False SQLALCHEMY_DATABASE_URI = os.environ.get('DATABASE_URL') SSL_DISABLE = True MAIL_SERVER = 'smtp....
from zope.interface import implements from twisted.trial import unittest from foolscap.ipb import IRemoteReference from foolscap.test.common import HelperTarget, Target, ShouldFailMixin from foolscap.eventual import flushEventualQueue from foolscap import broker, referenceable, api class Remote: implements(IRemot...
# -*- coding: utf-8 -*- from abc import ABC from copy import deepcopy from dataclasses import asdict, dataclass from datetime import datetime, timezone from enum import Enum, unique from typing import Optional __author__ = 'ft' class SessionNSBase(ABC): def to_dict(self): return asdict(self) @class...
# coding=utf-8 # Copyright 2020 The Google Research 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
from __future__ import division, print_function import unittest import unittest.mock as mock from smqtk_relevancy.interfaces.relevancy_index import RelevancyIndex from smqtk_descriptors import DescriptorElement from typing import Dict, Any, Iterable class DummyRI (RelevancyIndex): @classmethod def is_usab...
from utils.utils import change_ds_transform, get_unique_counts from sampler.ranking import get_items_idx_of_min_segment, get_norm_subset_idx from utils.log import Log from modeling.autoencoder import Autoencoder # from utils.utils import get_items_idx_of_min_segment, change_ds_transform, get_unique_counts, get_norm_sub...
""" Partition command implementation. """ from ..exceptions import ImportProblemError arguments = [ {('-m', '--module'): { 'dest': 'module', 'required': True, 'help': 'path to the module with models to be partitioned' }} ] def run(args): """ Prepares models from specified mod...
#!/usr/bin/env python3 from threading import Timer import threading import time import socket HOST = '127.0.0.1' # The server's hostname or IP address PORT = 65432 # The port used by the server def timing(): t = Timer(10) t.start() t.join() with socket.socket(socket.AF_INET, socket.SOCK_STREAM) ...
# -*- coding: utf-8 -*- # # Copyright (c) 2017 Red Hat, 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 applicabl...
from django.urls import path from . import views urlpatterns = [ path('skills/',views.skills, name='skills') ]
from directory_api_client.client import api_client import pytest import requests import requests_mock from contact import constants, forms, views routing_steps = [step for step, _ in views.RoutingFormView.form_list] @pytest.fixture def domestic_data(captcha_stub): return { 'given_name': 'Test', ...
import time import zmq def operar(operacion): op1 = int(operacion[0]) op2 = int(operacion[1]) operador = operacion[2] if operador == "+": return op1 + op2 elif operador == "-": return op1 - op2 elif operador == "*": return op1 * op2 elif operador == "/": ...
"""Choices for Thycotic Secret Server Plugin.""" from nautobot.utilities.choices import ChoiceSet class ThycoticSecretChoices(ChoiceSet): """Choices for Thycotic Secret Server Result.""" SECRET_PASSWORD = "password" # nosec SECRET_USERNAME = "username" # nosec SECRET_URL = "url" # nosec SECRET...
import numpy as np import os import sys from datetime import datetime from netCDF4 import Dataset #from scale.io import ScaleIO #mems = list(range(1, 51)) time = datetime( 2018, 6, 24, 0, 0, 0 ) MEMBER = 1 mem_list = [str(x).zfill(4) for x in range(1,MEMBER+1)] mem_list.append("mean") mem_list.append("mdet") print(...
#!/usr/bin/python # -*- coding: utf-8 -*- ## License: Apache 2.0. See LICENSE file in root directory. ## Copyright(c) 2019 Intel Corporation. All Rights Reserved. # Python 2/3 compatibility from __future__ import print_function """ This example shows how to use T265 intrinsics and extrinsics in OpenCV to asynchronousl...
# DO NOT EDIT! # This file was automatically generated by "generate_id_constants_from_stableid.py" __all__ = ["unit_typeid", "ability_id", "upgrade_id", "buff_id", "effect_id"] from .unit_typeid import UnitTypeId from .ability_id import AbilityId from .upgrade_id import UpgradeId from .buff_id import BuffId from .effe...
"""Fixed Athlete Policies """ from typing import Union from abc import ABC, abstractmethod import numpy as np import bdgym.envs.utils as utils from bdgym.envs.exercise_assistant.manual_control import AssistantEventHandler from bdgym.envs.exercise_assistant.action import \ AthleteAction, DiscreteAssistantAction fr...
import json import io import pytest from aiohttp import web import aiosparkapi.requests as requests import aiosparkapi.exceptions as exceptions def get_headers(request): headers = {} if request.headers.get('Authorization'): headers['Authorization'] = request.headers['Authorization'] if request.h...
import numpy import math import uuid from scikits.audiolab import wavread from src.client.microphone_proxy import MicrophoneProxy from src.server_dgram.server import Server class Orchestrator: def __init__(self, config): # File name self.__audio = config["audio"] # Audio data self...
import discord from discord.ext import commands from PIL import Image import re from typing import Optional, List from io import BytesIO from src.utils import send_message_webhook, doc_url from src.architus_emoji import ArchitusEmoji from src.generate.emoji_list import generate from lib.config import logger from lib....
import os import argparse import sys parser = argparse.ArgumentParser('Creates symbolic links of the files from one directory onto another') parser.add_argument("--filenames_dir", type=str, nargs=1, required=True, help='Directory where to get prefixes of filenames to be linked') parser.add_argument("--filenames_suffix...
import numpy as np import imageio import os import itertools import dps from dps.datasets.base import PatchesDataset from dps.utils import Param, resize_image class ShapesDataset(PatchesDataset): """ Display a specific set of shapes in random positions. """ shape_specs = Param(help="space-separated string of...
from django.apps import AppConfig class UnicornMessagingConfig(AppConfig): name = 'unicorn_messaging'
import os BASE_URL = 'https://api.wiseoldman.net' GROUP_ID = os.environ['GROUP_ID']
from flask import Flask, request from flask_restful import reqparse, Resource, Api import numpy as np import networkx as nx import itertools app = Flask(__name__) api = Api(app) # parser = reqparse.RequestParser() # parser.add_argument('data') # create a map from cluenames to edges edges = {} for edge in itertools.c...
from django.core.management.base import BaseCommand from django.contrib.auth import get_user_model class Command(BaseCommand): help = 'Data da Base do SuperUser' def handle(self, **options): self.stdout.write('Criando dados Gerais de SuperUser') User = get_user_model() superuser = ...
"""Unit tests for gridrad_utils.py.""" import unittest import numpy from gewittergefahr.gg_utils import gridrad_utils from gewittergefahr.gg_utils import radar_utils TOLERANCE = 1e-6 # The following constants are used to test fields_and_refl_heights_to_pairs. FIELD_NAMES = [ radar_utils.REFL_NAME, radar_utils.DI...
# -*- coding: utf-8 -*- from __future__ import (division, print_function, absolute_import, unicode_literals) import numpy as np import scipy.stats as stats __all__ = ["RandomVariable", "NormalRandomVariable", "UniformRandomVariable", "LognormalRandomVariable", "DiscreteUniformRandomV...
#!/usr/bin/env python # -*- coding:utf-8 -*- # # Copyright (c) 2013-present SMHI, Swedish Meteorological and Hydrological Institute # License: MIT License (see LICENSE.txt or http://opensource.org/licenses/mit). # import os # import pathlib import urllib import json import traceback import codecs import...
from talon import Module mod = Module() mod.tag("zoom")
# # 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...
import sys from django.conf import settings from rest_framework.authentication import get_authorization_header from api.models import RequestLog def _report_error_to_rollbar(request, auth): ROLLBAR = getattr(settings, 'ROLLBAR', {}) if ROLLBAR: import rollbar rollbar.report_exc_info( ...
import random with open("./randnumbers", "w") as f: vec = [] for i in xrange(100): vec.append(random.getrandbits(32)) vec.sort() for i in vec: f.write(str(i) + "\n")
# -*- coding: utf-8 -*- """Test Config """ import os import sys sys.path.insert(1, os.path.abspath(os.path.join(os.path.dirname(__file__), os.path.pardir)))
data = np.loadtxt(filename)
import pytest def transform_expected(events, expected): c_events = len(events) c_expected = len(expected) for x in xrange(max(c_events, c_expected)): key, payload = events[x] if x < c_events else (None, None) ex = expected[x] if x < c_expected else None if ex is None: ...
#!/usr/bin/python # -*- coding: utf-8 -*- from collections import OrderedDict from typing import Dict, Union from typing import List from urllib.parse import urlencode from urllib.parse import urlparse, parse_qs, urlunparse class URLParam(object): def __init__(self, scheme: str, netloc: str, path: str, params: s...
from unittest import TestCase from unittest.mock import Mock, patch import pytest from pytest import approx from functions import mpc_to_mly from voevent import VOEventFromXml, VOEventFromEventId import tests.voevent_test_data as test_data import ligo from ligo.gracedb.exceptions import HTTPError @patch("ligo.grace...
from __future__ import absolute_import # Copyright (c) 2010-2019 openpyxl """ OO-based reader """ import posixpath from warnings import warn from openpyxl.xml.functions import fromstring from openpyxl.packaging.relationship import ( get_dependents, get_rels_path, get_rel, ) from openpyxl.packaging.manif...
from cProfile import label from docx2txt.docx2txt import process import streamlit as st import streamlit as st import streamlit.components.v1 as stc import sqlite3 as sql import pandas as pd import datetime # File Processing Pkgs import pandas as pd import docx2txt from PIL import Image from PyPDF2 import PdfFileReade...
#!/usr/bin/env python3 # Decription: # This program takes user input commands and sends them # to a seperate program that deals with making the motors # on the ROSPerch move. # Adapted Sources: # Motor command code is adapted from the UTAP 2020 # code at https://github.com/jdicecco/UTAP/ # License: # Software License A...
""" Tests for test cases directory. """ # TODO: check http://code.google.com/p/unladen-swallow/wiki/Benchmarks import os from distutils.version import LooseVersion import numpy import unittest from pythran.tests import TestFromDir class TestCases(TestFromDir): """ Class to check all tests in the cases director...
# Generated by Django 3.2.5 on 2021-09-02 07:20 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('data', '0053_alter_taxon_reference'), ] operations = [ migrations.AlterField( model_name='taxon', name='reference', ...
import sys import functools import click from tabulate import tabulate from sotabenchapi import errors def handle_errors(m404=None): def decorator(func): @functools.wraps(func) def wrapper(*args, **kwargs): try: return func(*args, **kwargs) except errors.H...
# -*- encoding: utf-8 -*- """ Python Aplication Template Licence: GPLv3 """ import os from app.libs.jsonEncoder import DateTimeEncoder from dotenv import load_dotenv, find_dotenv load_dotenv(find_dotenv()) class Config(object): TESTING = os.environ.get("TESTING", False) DATABASE_URI = os.environ.get("MAESTR...
from ...core.utils import functions, py3, ctypes_wrap from .misc import load_lib import numpy as np import ctypes import collections _depends_local=["...core.utils.ctypes_wrap"] class IMAQdxGenericError(RuntimeError): """Generic IMAQdx error.""" pass class IMAQdxLibError(IMAQdxGenericError): """Gene...
from setuptools import setup setup(name='nicehash_api', version='0.11', description='API for nicehash', keywords='nicehash mine', url='https://github.com/edilio/nicehash_api', author='DEGConnect', author_email='info@degconnect.com', license='MIT', packages=["nicehash_ap...
""" This is config file for the application. """ from os import environ from dotenv import load_dotenv from .__types.db import Postgresql # Load environment variables from .env file load_dotenv() DEBUG = True _db = Postgresql( username=environ.get("POSTGRES_USER"), password=environ.get("POSTGRES_PASSWORD"), ...
def converter_tabela_dicionario(lista_tuplas): #cria uma lista para armazenar os dicionarios lista_pessoas = [] for p in lista_tuplas: #----- Criação do dicionario que representa uma pessoa dicionario_pessoa = {'Id': 0, 'Nome' : '', 'Sobrenome': '', 'Idade' : 0, 'Endereco_Id': 0} #--...
"""AttentionGRU and AttentionUpdateGateGRU. """ # Authors: Hongwei Zhang # License: MIT import math import torch import torch.nn as nn import torch.nn.init as init import torch.nn.functional as F from torch.nn.utils.rnn import PackedSequence class AttentionGRUCell(nn.Module): def __init__(self, input_size, hi...
from appkit.api.v0_2_8 import App app = App(__name__) @app.route("/") def home(): return '<a href="#" target="_blank">Clique</a>' app.run()
# -*- coding: utf-8 -*- # Begin CVS Header # $Source: /Volumes/Home/Users/shoops/cvs/copasi_dev/copasi/bindings/python/unittests/Test_CReportDefinitionVector.py,v $ # $Revision: 1.7 $ # $Name: $ # $Author: gauges $ # $Date: 2008/04/21 10:27:07 $ # End CVS Header # Copyright (C) 2008 by Pedro Mendes, V...
import os log_path = "/home/hengkai/Desktop/AFL/llvm_mode/trace/file-o3.log" cxx_path = "/home/hengkai/Desktop/file-FILE5_32/install/o3/fuzz/file-o3.log" total = 0 hit = 0 log_list = [] log_file = open(log_path, "r") hit_list = [] for line in log_file: log_list.append(line.split(":")[1]) cxx_file = open(cxx_path, ...
from .models import catagories import re from .master import sortInfo from itertools import chain def addTegenrekening(transactions): ''' Automaticlly adds Ibans to the database based on keywords stored in the database. ''' cat = catagories.objects regex = cat.values_list('regex') regex1 =...
#!/usr/bin/env python # Copyright (C) 2014 Ion Torrent Systems, Inc. All Rights Reserved '''Shows Data Management information for a Report''' import sys import argparse from iondb.bin import djangoinit from iondb.rundb import models from iondb.rundb.data import dmactions_types as dmtypes def main(report_name): r...
""" Create classification report, confusion matrix, AUROC, AUPRC, Attention weights inputs: df_test_pred.csv training viz outputs: 'reports/figures' dataset with viz data: 'models/predictions' """ import os import sys from pathlib import Path import yaml import json import pandas as pd import copy from sklearn.metric...
from botocore.exceptions import ClientError def validate_client_conn(func): def func_wrapper(self, *args, **kwargs): if self.client: return func(self, *args, **kwargs) else: raise RuntimeError("Client not initialized properly") return func_wrapper def handle_client_e...
import unittest from .remove_duplicates_from_sorted_list import Solution, ListNode class Test(unittest.TestCase): @classmethod def setUpClass(cls) -> None: cls.sol = Solution() def test_example1(self): n = ListNode(1, ListNode(1, ListNode(2))) result = self.sol.deleteDuplicates(n)...