content
stringlengths
5
1.05M
import numpy as np import pandas as pd import collections from . import arrops from .region import parse_region, regions_add_name_column _rc = { 'colnames':{ 'chrom':'chrom', 'start':'start', 'end':'end' } } def _get_default_colnames(): return _rc['colnames']['chrom'], _rc['colna...
import unittest from app.models.products import * class TestProductprod_records(unittest.TestCase): def setUp(self): self.prod_record = Products(0,'crisps','snacks','4cartons',500) return self.prod_record def test_prod_id(self): # Tests that the id is equal to the given id sel...
from pykiwoom.kiwoom import * kiwoom = Kiwoom() kiwoom.CommConnect(block=True) 전일가 = kiwoom.GetMasterLastPrice("005930") print(int(전일가)) print(type(전일가))
# stickit.py # Copyright (c) 2017 Mads Hagbarth Damsbo. All Rights Reserved. # Not for redistribution. import nuke import nuke.splinewarp as sw import string #This is used by the code. Include! import math import struct import time ''' REAL TODO: General Feedback: In regards to assist its hard to figure if somethin...
import tkinter as tk import numpy as np import time import matplotlib as mpl from PIL import Image, ImageTk import matplotlib.backends.tkagg as tkagg from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg,NavigationToolbar2Tk class MoviePlayer(tk.Frame): def __init__(self, data, Ts=1): #...
import beautifulsoup4 import cookielib import mechanize br = mechanize.Browser() jar = cookielib.LWPCookieJar() br.set_cookiejar(jar) br.set_handle_equiv( True ) br.set_handle_gzip( True ) br.set_handle_redirect( True ) br.set_handle_referer( True ) br.set_handle_robots( False )
def cal(n): ans=0;a=0 if(n!=1): x=1;a=0 if(n<=10): if(n>=7): ans+=2 return ans if(n>=4): ans+=1 return ans return ans while(n>=x): x*=10 a+=1 ...
import functools import re from typing import Any, Dict, Set, Tuple, Type from django.core.exceptions import FieldDoesNotExist from django.db.models import OneToOneRel, Q from django.db.models.functions import Coalesce from tate.legacy.models import LegacyPageMixin from wagtail.core.models import Page, get_page_models...
""" A program to initialize all fonts used in Kivy Cupertino """ from kivycupertino import fonts_path from kivy.core.text import LabelBase fonts = [ { 'name': 'San Francisco', 'fn_regular': fonts_path + 'sf.otf', 'fn_italic': fonts_path + 'sf-italic.otf', 'fn_bold': fonts_path + 's...
""" Defines the standard functions and properties of """ import logging, os, operator from math import sin, cos, atan2, pi from collections import OrderedDict import json import numpy as np class Model(object): '''The abstract class for a grounded semantics model Model's Contract: - constructor...
from .transforms import Compose from .transforms import RandomHorizontalFlip from .transforms import ToTensor from .transforms import Normalize from .build import build_transforms
""" OPA authorization middleware. """ __author__ = "William Tucker" __date__ = "2021-01-18" __copyright__ = "Copyright 2020 United Kingdom Research and Innovation" __license__ = "BSD - see LICENSE file in top-level package directory" import logging from django.conf import settings from opa_client.opa import OpaClie...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- from collections import deque from math import factorial import unittest FNAME = "input.txt" TEST_FNAME = "test_input.txt" def main(): """Main function.""" data = load_input(FNAME) len_preamble = 25 part1(data, len_preamble) part2(data, len_preamble)...
# coding=utf-8 """ Collects all number values from the db.serverStatus() command, other values are ignored. **Note:** this collector expects pymongo 2.4 and onward. See the pymongo changelog for more details: http://api.mongodb.org/python/current/changelog.html#changes-in-version-2-4 #### Dependencies * pymongo #...
from sqlalchemy import and_ from changes.config import db from changes.constants import Result, Status from changes.models import Project, ProjectPlan, Build, Job, JobPlan from changes.utils.locking import lock @lock def update_project_stats(project_id): last_5_builds = Build.query.filter_by( result=Resu...
"""Model evaluation tools.""" import os import sklearn import itertools import numpy as np import pandas as pd import sklearn.metrics as skmetrics from matplotlib import pyplot as plt from healthcareai.common.healthcareai_error import HealthcareAIError DIAGONAL_LINE_COLOR = '#bbbbbb' DIAGONAL_LINE_S...
''' 创建应用程序,并注册相关蓝图 ''' import dataclasses import uuid from flask import Flask as _Flask from flask.json import JSONEncoder as _JSONEncoder from app.libs.error_code import ServerError from datetime import date, datetime from werkzeug.http import http_date # from flask_wtf.csrf import CsrfProtect from flask_login ...
#!/usr/bin/env python # -*- coding: utf-8 -*- """Python Cursor on Target Module Test Context.""" import os import sys sys.path.insert(0, os.path.abspath('..')) import pycot # NOQA pylint: disable=C0413,W0611 __author__ = 'Greg Albrecht W2GMD <oss@undef.net>' __copyright__ = 'Copyright 2020 Orion Labs, Inc.' __lic...
import FWCore.ParameterSet.Config as cms import TrackingTools.TrackFitters.KFFittingSmoother_cfi GsfElectronFittingSmoother = TrackingTools.TrackFitters.KFFittingSmoother_cfi.KFFittingSmoother.clone() GsfElectronFittingSmoother.ComponentName = 'GsfElectronFittingSmoother' GsfElectronFittingSmoother.Fitter = 'GsfTrajec...
import gi import math import cairo import numpy from dock import Dock, create_icon, get_gicon_pixbuf, pixbuf2image gi.require_version('Gtk', '3.0') # noqa gi.require_version('Gdk', '3.0') # noqa gi.require_version('Gio', '2.0') # noqa gi.require_version('GObject', '2.0') # noqa from applications import AppCache, ...
# Copyright (c) Facebook, Inc. and its affiliates. """ Utility functions for processing point clouds. Author: Charles R. Qi and Or Litany """ import os import sys import torch # Point cloud IO import numpy as np from plyfile import PlyData, PlyElement # Mesh IO import trimesh # -----------------------------------...
import numpy as np import matplotlib matplotlib.use('Agg') matplotlib.rcParams['pdf.fonttype'] = 42 matplotlib.rcParams['ps.fonttype'] = 42 import matplotlib.pyplot as plt def imshow(image, dimshuffle = None, rescale = False, complementary = False): ''' >>> plot the images after some transformation ''' ...
from github_secrets.cli import cli cli()
# -*- coding: utf-8 -*- # # Copyright 2020 BigML # # 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 ag...
<<<<<<< HEAD print("Enter the 1st no:") a=int(input()) print("Enter the 2nd no:") b=int(input()) m=max(a,b) print("Maximum:",m) ======= print("Enter the 1st no:") a=int(input()) print("Enter the 1st no:") b=int(input()) m=max(a,b) print("Maximum:",m) >>>>>>> 2257f55f5843ae1dad09e255fabb5f6ceef87af7
import tensorflow as tf import os LAYER_SIZE = 350 PROB_WIN_LAYER_SIZE_1 = 100 PROB_WIN_LAYER_SIZE_2 = 50 TENSORFLOW_SAVE_FILE = 'agent' TENSORFLOW_CHECKPOINT_FOLDER = 'tensorflow_checkpoint' class Model: """ Neural network to implement deep Q-learning with memory """ def __init__(self, num_states, n...
# -*- coding: utf-8 -*- """Tests of the internal tabulate functions.""" from __future__ import print_function from __future__ import unicode_literals import tabulate as T from common import assert_equal, assert_in, assert_raises, SkipTest def test_multiline_width(): "Internal: _multiline_width()" multiline_...
#!/usr/bin/python # encoding: utf-8 """ @auth: zhaopan @time: 2018/4/11 09:58 """ from proxy2 import * class ProxyZCBLHandler(ProxyRequestHandler): def request_handler(self, req, req_body): pass def response_handler(self, req, req_body, res, res_body): if req.path == 'https://bjjj.zhongcheba...
from pyston.contrib.dynamo.paginator import DynamoCursorBasedPaginator as OriginDynamoCursorBasedPaginator class DynamoCursorBasedPaginator(OriginDynamoCursorBasedPaginator): type = 'cursor-based-paginator'
def foo(): print("in foo") def bar(): print("in bar") my_var = 0 print("importing test module")
import pandas as pd import numpy as np import matplotlib.pyplot as plt scenario_filenames = ["OUTPUT_110011_20201117123025"] scenario_labels =["Lockdown enabled,Self Isolation,Mask Compliance (0.5)"] MAX_DAY = 250#250#120 POPULATION = 10000.0 FIGSIZE = [20,10] plt.rcParams.update({'font.size': 22}) #### compari...
#!/usr/bin/env python # Copyright 2012-2018 CERN for the benefit of the ATLAS collaboration. # # 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 ...
# encoding=utf8 import datetime import unittest from wsme.api import FunctionArgument, FunctionDefinition from wsme.rest.args import from_param, from_params, args_from_args from wsme.exc import InvalidInput from wsme.types import UserType, Unset, ArrayType, DictType class MyUserType(UserType): basetype = str ...
import unittest from mock import patch from basset_client.git import get_git_info, parse_branch, parse_commit_message, parse_commit_info class GitTest(unittest.TestCase): @patch('basset_client.git.subprocess.Popen') def test_parse_branch(self, mock_popen): process = mock_popen.return_value p...
import numpy as np import cv2 import matplotlib.pyplot as plt import matplotlib.image as mpimg import pickle import glob import al_consts #Whelper class to calibrate camera and undo distortion from images class AlCalibration: def __init__(self, nx=9, ny=6 , cal_images=al_consts.CALIBRATION_IMAGES , test_images...
class GenerationFactory(object): """description of class""" def buildDictionaryfromPostRequest(form): numrows = form['numrows'] dictionary = {} counter_group = 1 for j in form.items(): num_row = j[0][3] if j[0][4].isnumeric(): num_row =j[0][...
import tensorflow as tf def compute_reward(seq, actions, ignore_far_sim=True, temp_dist_thre=20, use_gpu=False): """ Compute diversity reward and representativeness reward Args: seq: sequence of features, shape (1, seq_len, dim) actions: binary action sequence, shape (1, seq_len, 1) ignore_far_sim (bool): wh...
class Solution: def findUnsortedSubarray(self, nums: List[int]) -> int: nums_length = len(nums) left = 0 right = nums_length - 1 # finding the left out of order while left < nums_length - 1: if nums[left] > nums[left + 1]: break left +...
import pandas as pd import numpy as np import random as rd from sklearn.decomposition import PCA from sklearn import preprocessing import matplotlib.pyplot as plt #PPREPARE DATA #################################################################### genes = ['gene' + str(i) for i in range(1, 101)] wt = ['wt' + str(i) for...
# -*- coding: utf-8 - # # This file is part of couchdbkit released under the MIT license. # See the NOTICE for more information. from hashlib import sha256 import os from .... import Document, SchemaListProperty, StringProperty, \ StringListProperty class Permission(Document): name = StringProperty(required=Tr...
import os def get_db(DB_PATH): classes = [x for x in sorted(os.listdir(DB_PATH))] tmp = [[os.path.join(DB_PATH, c, x) for x in sorted(os.listdir(os.path.join(DB_PATH, c)))] for c in classes] im_paths = [] labels = [] for l, t in enumerate(tmp): im_paths.extend(t) labels.extend([l] ...
import os import sys a='his way of connecting with the family was always making us a dish , making us dinner , " louis gal@@ icia said .' # b=a.replace('"','') # print(b) # exit() file_path = "/search/odin/haiyang/fairseq_exp/t2t_decoder/test_data/wmt17test2001.src" with open(file_path, "r") as f: # line=a.replace...
from urllib.parse import urlparse, urlencode from nameko.extensions import DependencyProvider from couchbase.cluster import Cluster from couchbase.cluster import PasswordAuthenticator COUCHBASE_KEY = 'COUCHBASE' class Couchbase(DependencyProvider): def __init__(self, bucket): self.cluster = None ...
# # Copyright (c) 2018 TECHNICAL UNIVERSITY OF MUNICH, DEPARTMENT OF MECHANICAL ENGINEERING, CHAIR OF APPLIED MECHANICS, # BOLTZMANNSTRASSE 15, 85748 GARCHING/MUNICH, GERMANY, RIXEN@TUM.DE. # # Distributed under 3-Clause BSD license. See LICENSE file for more information. # """ Solver-module to solve problems, which a...
import json from typing import Generator import requests def lazy_load_json(path: str) -> Generator: """ Lazy load MOCK_DATA.json Lazy load MOCK_DATA.json line by line and parsing to string to json Arguments: path (str): path to MOCK_DATA.json Returns: Generator...
# import email # import imaplib # import re # import parsedatetime # from datetime import datetime # from dateutil.parser import parse # from flask import Flask, jsonify, render_template, request # from flask_script import Manager # import logging # # # def dttm_from_timtuple(d): # return datetime( # d.tm_y...
""" Ionization cross section models. """ # Standard library modules. # Third party modules. # Local modules. from pymontecarlo_gui.options.model.base import ModelFieldBase # Globals and constants variables. class IonizationCrossSectionModelField(ModelFieldBase): def title(self): return "Ionization cro...
# -*- coding: utf-8 -*- from __future__ import absolute_import from django.conf.urls import url from django.contrib import admin from django.forms.models import modelform_factory from django.http import JsonResponse from django.views.decorators.csrf import csrf_exempt from . import views from .. import settings as fi...
#!/usr/bin/env python # Tinta # Copyright 2021 github.com/brandoncript # This program is bound to the Hippocratic License 2.1 # Full text is available here: # https://firstdonoharm.dev/version/2/1/license # Further to adherence to the Hippocratic Licenese, permission is hereby # granted, free of charge, to any perso...
# wink-tokenizer # Multilingual tokenizer that automatically tags each token with its type. # # Copyright (C) 2017-19 GRAYPE Systems Private Limited # # This file is part of “wink-tokenizer”. # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and...
import workers from checks import health_task from polyaxon.settings import K8SEventsCeleryTasks @workers.app.task(name=K8SEventsCeleryTasks.K8S_EVENTS_HEALTH, ignore_result=False) def k8s_events_health(x: int, y: int) -> int: return health_task.health_task(x, y)
# -*- coding: utf-8 -*- from __future__ import absolute_import, division, print_function from builtins import super, range, zip, round, map from .base import ( DiTToHasTraits, Float, Unicode, Any, Int, Bool, List, observe, Instance, ) from .position import Position class PhaseLoa...
from django.shortcuts import render, redirect from django.http import Http404, JsonResponse from django.contrib.auth.decorators import login_required from .models import Passenger, PassengerProfile from .forms import NewPassenger, PassengerLogin from django.contrib import messages from django.core.exceptions import Obj...
import threading from queue import Queue class A(threading.Thread): def __init__(self, q, lis): super(A, self).__init__() self.q = q self.lis = lis def run(self): print('self.qsize is:{}'.format(self.q.qsize())) print('lis is : {}'.format(self.lis)) ...
import requests class Prowl: def __init__(self, apikey): self.apikey = apikey def send_notification(self, message): data = {'apikey': self.apikey, 'application': 'Corona Zahlen', 'event': message} response = requests.post('https://api.prowlapp.com/publ...
# -*- coding: utf-8 -*- """Module for privacy policy-related views."""
# -*- coding: utf-8 -*- """ ========================================= Submaps and Cropping ========================================= In this example we demonstrate how to get a submap of a map. """ ############################################################################## # Start by importing the necessary module...
import numpy as np from collections import defaultdict import math from functools import cmp_to_key import random import graph import estimation import rewiring #Note: We use round to even. def check_deg_vec(deg_vec): sum_deg_vec = 0 for k in deg_vec: if deg_vec[k] < 0: print("Error: The ...
from kinematics import * from generator import * import blender_utils import sympy import sys def main(argv): if len(argv) < 2: print("usage : " + argv[0] + " <blend_file> [<endpoint>]") exit() x = sympy.Symbol("x") y = sympy.Symbol("y") z = sympy.Symbol("z") blender_utils.call_bl...
import json import pickle with open("data/drinks_dict.txt") as f: content = f.read() data = json.loads(content.replace("'", '"').replace("\n", '')) # Generation of database of drinks drinks_db = {} count = 0 # Generation of user goals drinks_user_goals = [] drinks_user_goals.append({'request_slots': {'DRINK':...
import urllib, json import requests from django.core.management.base import BaseCommand from France.models import vaccinFrance, regionsFrance class Command(BaseCommand): help = 'Reload regions data' def handle(self, *args, **kwargs): r = requests.get('https://www.data.gouv.fr/fr/datasets/r/16cb2df...
import os from pathlib import Path from jinja2 import Environment, FileSystemLoader, select_autoescape from sanic import Sanic, response class Springboard: def __init__(self, sanic: Sanic, frontend_dir: Path = Path('./frontend'), add_html_routes: bool = True): self.sanic = sanic ...
""" Car类 """ class Car(object): description = ['大众','丰田','广本','沃尔沃','凯迪拉克'] def __init__(self, l, w, h, brand): self.L = l self.W = w self.H = h self.brand = brand def modify_des(self): if self.description != None: return self.description else: ...
from flask import json, request from app.dao.money import get_acc_id, get_acc_descs, get_accsums, get_cat_id, get_cats, get_money_acc, \ get_money_item_row, get_money_items, post_money_acc, post_money_item from app.dao.dashboard import get_user_data_content from app.dao.income import get_income_items from app.main....
import zmq context = zmq.Context() # Socket to talk to server print("Connecting to hello world server…") socket = context.socket(zmq.REQ) socket.connect("tcp://localhost:9779") out_command = "" while out_command.lower() != "exit": out_command = input("Command to serial port: ") socket.send_string(out_comman...
import sys import traceback import threading import logging from util import init_logger, tohexs, s2b, uunq from dataparser import RoughParser import select import socket import time import abc import event import json from device.devicect10 import SendBufferTimer from action import ActionPing, RV_DATA_WAI...
# -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: google/ads/googleads_v3/proto/common/segments.proto import sys _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf import descriptor as _descriptor from google.protobuf import messag...
from .mse import mse from .rmse import rmse
#!/usr/bin/env python """ Wrapper for the Simulated Annealing Solver provided by GSL. The simulated annealing algorithm takes random walks through the problem space, looking for points with low energies; in these random walks, the probability of taking a step is determined by the Boltzmann distribution, ...
# -*- coding: utf-8 -*- """ Created on Tue Jul 10 10:51:18 2018 @author: olmer.garciab """ # implementing class example P=[[0,0.5,0,0,0.,0.5,0], [0,0,0.8,0,0.0,0,0.2], [0,0.,0,0.6,0.4,0,0], [0,0.,0,0,0.,0,1], [0.2,0.4,0.4,0,0,0,0], [0.1,0.,0,0,0.,0.9,0], [0,0.,0,0,0.,0,1]] R=[-2,-2,-2,10,1,-1,0] ...
#!/usr/bin/env python3 import argparse import binascii import socket import struct import threading import os import sys import aiohttp from aiohttp import web # Configuration PORT_BLOBS = 9021 PORT_DEBUG = 9022 # Context current_file = None # Sockets def server_blobs(): s = socket.socket(socket.AF_INET, socke...
## THIS IS A MODIFIED EXAMPLE FROM THE CIRQ WEBSITE ## import cirq import numpy as np import matplotlib.pylab as plt ## define a custom gate in Cirq class MyGate1(cirq.SingleQubitGate): def _unitary_(self): return np.array([[3 / 5, 4 / 5], [-4 / 5, 3 / 5]]) def __str__(self): re...
x = [4, 4, 4, 1, 2, 3, 3, 4, 2, 4] y = ["4", "4", "4", "1", "2", "3", "3", "4", "2", "4"] z = enumerate(y) for i,j in z: print(i, j)
import uvicorn from fastapi import FastAPI, File, UploadFile from starlette.responses import StreamingResponse from inference_api import get_FINED_edge, read_imagefile import cv2 import numpy as np import io app = FastAPI() #route @app.get('/') def index(): return {"Data" : "Homepage Test"} @app.post("/predict...
import serial import time ser = serial.Serial( port='/dev/ttyUSB0',\ baudrate=115200 ) try: with open('../cmd.txt') as f: line = f.readline() while line: ser.write(line.encode()) line = f.readline() time.sleep(0.1) except PermissionError as e: print...
import sys import math import sys import os import csv import numpy as np class naive_bayes(): ########## SET OF FUNTIONS FOR THE NAIVE BAYES CLASSIFIER ############ #The naive bayes classifies scans the training set to find the posterior #probabilities of an class given an instance. Then, ...
import requests import sys import re def get_merged_pull_reqs_since_last_release(token): """ Get all the merged pull requests since the last release. """ stopPattern = r"^(r|R)elease v" pull_reqs = [] found_last_release = False page = 1 print("Getting PRs since last release.") whi...
#!/usr/bin/env python # Standard packages import sys import argparse # Third-party packages from toil.job import Job # Package methods from ddb import configuration from ddb_ngsflow import pipeline from ddb_ngsflow.utils import utilities if __name__ == "__main__": parser = argparse.ArgumentParser() parser....
print('\033[1;34m{:=^40}\033[m'.format(' LOJA OLHOS DA CARA ')) v = float(input('\033[1;33mQual o valor das compras? R$\033[m')) print('\033[36m-=-'*15) op = int(input('''\033[1;33mQual a sua condição de pagamento?\033[m \033[37m[1]-Á vista dinheiro/cheque (10% Desconto)\033[m \033[36m[2]-Á vista no cartão (5% Des...
# Generated by Django 3.2.11 on 2022-01-13 19:01 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ("assignments", "0009_populate_enrollments"), ] operations = [ migrations.RemoveField( model_name="assignment", name="course"...
# This is an auto-generated Django model module. # You'll have to do the following manually to clean this up: # * Rearrange models' order # * Make sure each model has one field with primary_key=True # * Remove `managed = False` lines if you wish to allow Django to create, modify, and delete the table # Feel free ...
import tkinter import tkMessageBox top = Tkinter.Tk() def helloCallBack(): tkMessageBox.showinfo( "Hello Python", "Hello World") B = Tkinter.Button(top, text ="Hello", command = helloCallBack) B.pack() top.mainloop()
# Copyright 2015 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. DEPS = [ 'ios', 'recipe_engine/platform', 'recipe_engine/properties', 'recipe_engine/raw_io', ] def RunSteps(api): api.ios.checkout() api.ios.re...
"""This module configures logging for Stibium""" import logging logging.basicConfig(format='%(asctime)s-%(name)s-%(levelname)s-%(message)s') log = logging.getLogger('stibium') log.setLevel(logging.DEBUG) # FIXME, should be defined at bot instantiation _fblog = logging.getLogger('client') _fblog.setLevel(logging.WARNIN...
# # Copyright (c) 2017-2018 Wind River Systems, Inc. # # SPDX-License-Identifier: Apache-2.0 # from django.utils.translation import ugettext_lazy as _ import horizon # Load the api rest services into Horizon import starlingx_dashboard.api.rest # noqa: F401 pylint: disable=unused-import class DCAdmin(horizon.Dash...
# -*- coding: utf-8 -*- from __future__ import print_function, absolute_import import os import sys import time import threading from tornado import ioloop from notebook.notebookapp import NotebookApp, flags, aliases from traitlets import Bool, Unicode from jupyterlab_launcher import LabConfig, add_handlers from se...
if __name__ != '__main__': from template.Rect import Rect from template.init import * else: from Rect import Rect from init import * s3 = boto3.resource('s3') # fileName = "invoice.pdf" # bucketName = "poc-cloudformation-bucket" # function load predefined template co-ordinate from template.json file...
# -*- coding: utf-8 -*- import factory from koalixcrm.crm.models import ReportingPeriod from koalixcrm.crm.factories.factory_project import StandardProjectFactory from koalixcrm.crm.factories.factory_reporting_period_status import ReportingReportingPeriodStatusFactory class StandardReportingPeriodFactory(factory.dja...
#!/usr/bin/env python ## ## See COPYING file distributed along with the ncanda-data-integration package ## for the copyright and license terms ## import os import json import shutil import fnmatch import tempfile import subprocess import sibis def export_spiral_files(xnat, resource_location, to_directory, stroop...
n,m,*a=map(int,open(0).read().split()) c=[0]*-~n for i in a[:m]:c[i]+=1 q=c.index(0) for p,x in zip(a,a[m:]):c[p]-=1;c[x]+=1;q=min((p,q)[c[p]>0:]) print(q)
# a simple attempt at a color matching, stack choosing card game # joadavis Oct 20, 2016 # Another attempt at a game in one .py file # No AI for this version, just two players taking turns # objects - cards, buttons [draw, place, take, help], game session (to track turns) # need to display scores and player labels # d...
S, W = map(int, input().split()) if(W >= S): print("unsafe") else: print("safe")
from django import forms from .models import Pet class PetForm(forms.ModelForm): class Meta: model = Pet fields = ["name","type","genus","age","explanation","pet_image"]
""" Build the given Jail base """ from .parser import Jockerfile from .backends.utils import get_backend def build(jockerfile='Jockerfile', build=None, install=False): """ Build the base from the given Jockerfile. """ jail_backend = get_backend() jockerfile = Jockerfile(jockerfile) jail_backen...
from mpl_toolkits.mplot3d import Axes3D import matplotlib.pyplot as plt import numpy as np from . import resampling as rs def plotClouds(Vs, colors, fignum): color_list = ['r','g','b','c','y','m','k'] fig = plt.figure(fignum) ax = fig.add_subplot(111, projection='3d') if colors: for V, col...
#!/usr/bin/env python """ Contains the sqlintf.DataProduct class definition Please note that this module is private. The sqlintf.DataProduct class is available in the ``wpipe.sqlintf`` namespace - use that instead. """ from .core import sa, orm from .OptOwner import OptOwner __all__ = ['DataProduct'] class DataProd...
from tkinter import * from tkinter import simpledialog, filedialog from os import system from tkinter import font from time import sleep from tkinter import colorchooser from os import system, name import re from time import sleep def clear(): # for windows if name == 'nt': _ = system('cls') els...
""" Author: Justin Cappos Start Date: 27 June 2008 Description: Adapted from repy's emulcomm (part of the Seattle project) """ import socket STABLE_PUBLIC_IPS = ["18.7.22.69", # M.I.T "171.67.216.8", # Stanford "169.229.131.81", # Berkley "140.142.12.202"] # Univ. of Washington def get_lo...
""" Some common path functions and classes applications. """ __author__ = "Brian Allen Vanderburg II" __copyright__ = "Copyright (C) 2018-2019 Brian Allen Vanderburg II" __license__ = "Apache License 2.0" __all__ = ["AppPathsBase", "AppPaths"] import os import tempfile from typing import Sequence, Optional from . ...
import pytest import cv2 from plantcv.plantcv import analyze_color, outputs @pytest.mark.parametrize("colorspace", ["all", "lab", "hsv", "rgb"]) def test_analyze_color(colorspace, test_data): """Test for PlantCV.""" # Clear previous outputs outputs.clear() # Read in test data img = cv2.imread(test...