content
stringlengths
5
1.05M
import os from typing import List, Optional from uuid import uuid4 import PIL import pytest import arcade import arcade.gui from arcade.gui import UIClickable, UIManager from arcade.gui.ui_style import UIStyle class TestUIManager(UIManager): def __init__(self, *args, **kwargs): super().__init__(*args, *...
class Solution(object): def deleteDuplicates(self, head): ht = {} it = head while head: if head.val in ht: ht[head.val] += 1 else: ht[head.val] = 1 head = head.next headRef = None last = None whi...
#!/usr/bin/env python import sys from os.path import exists as path_exists from pyscaffold.api import create_project from pyscaffold.cli import run from pyscaffold.extensions.github_actions import GithubActions def test_create_project_with_github_actions(tmpfolder): # Given options with the GithubActions extensi...
import glob from os.path import join import numpy as n import astropy.io.fits as fits import lib_functions_1pt as lib import os import sys #Quantity studied version = 'v4' qty = "mvir" # one point function lists fileC = n.array(glob.glob( join(os.environ['MD_DIR'], "MD_*Gpc*", version, qty,"out_*_Central_JKresampli...
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*- # # Copyright 2002 Ben Escoto <ben@emerose.org> # Copyright 2007 Kenneth Loafman <kenneth@loafman.com> # # This file is part of duplicity. # # Duplicity is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License...
from django.test import TestCase from rest_framework.test import APIClient from teams.models import Team class TeamTestCase(TestCase): """ Test set for Team CRD (there is no update here) """ client = APIClient() trainer_id = 0 team_id = 0 def setUp(self): """ Set up case. ...
import os import sqlite3 from datetime import datetime from flask import g DATABASE = 'test.db' def get_db(): if not os.path.isfile(DATABASE): create_database() db = getattr(g, '_database', None) if db is None: db = g._database = sqlite3.connect(DATABASE) return db def save_msg(msg...
__author__ = "Hangi,Kim" __copyright__ = "Copyright 2012-2013, The SAGA Project" __license__ = "MIT" """ IBM LoadLeveler job adaptor implementation reference for pbs job adaptor & sge job adaptor implementation Hangi, Kim hgkim@kisti.re.kr """ import os import re import time from urllib.parse impor...
# Privacy Policy Browser # Credit: Josiah Baldwin, Eric Dale, Ethan Fleming, Jacob Hilt, # Darian Hutchinson, Joshua Lund, Bennett Wright # # The alexa skill is implemented as a collection of handlers for certain types of user input. # This is paired with a S3 bucket that is holding data about location & acce...
from sklearn.preprocessing import StandardScaler from scipy import ndimage import nilearn from sklearn.preprocessing import MinMaxScaler from sklearn.preprocessing import RobustScaler from sklearn.preprocessing import PowerTransformer from scipy.stats import variation import numpy as np from densratio import densratio ...
class Player(object): def __init__(self, name, connection): self.connection = connection self.name = name self.score = 0
import json from typing import List, Tuple import boto3 from botocore.client import BaseClient from logger.decorator import lambda_auto_logging from logger.my_logger import MyLogger from utils.lambda_tool import get_environ_values from utils.s3_tool import ( create_key_of_eorzea_database_merged_item, create_k...
#!/usr/bin/python """ `yap_ipython.external.mathjax` is deprecated with yap_ipython 4.0+ mathjax is now install by default with the notebook package """ import sys if __name__ == '__main__' : sys.exit("yap_ipython.external.mathjax is deprecated, Mathjax is now installed by default with the notebook package")
from random import random from player import Player from pokerUtils import PokerUtils from board import Board def decide(playerdecision, player, callamount, raiseamount=0): # fold if playerdecision == 2: print(player.getname() + " loses") players.remove(player) # raise if...
# # # This script compiles and runs all examples in /examples # by mpifort and mpirun on four processors. # # # Glob: https://docs.python.org/2/library/glob.html import glob # OS: https://docs.python.org/2/library/os.html import os for ftest in glob.glob('examples/*.f90'): print("compile "+ftest) os.system('mpifor...
from django_unicorn.components import UnicornView import requests from bs4 import BeautifulSoup class ContcompView(UnicornView): url = "https://example.com" headers = { 'Access-Control-Allow-Origin': '*', 'Access-Control-Allow-Methods': 'GET', 'Access-Control-Allow-Headers': 'Content-Type', 'Ac...
from flask import Blueprint, render_template, jsonify, app from edinet import edinet_methods from eve_docs.config import get_cfg def edinet_docs(): blueprints = [edinet_methods.edinet_methods] eve_docs = Blueprint('eve_docs', __name__, template_folder='templates') @eve_docs.route...
from app.dao.permissions_dao import permission_dao from tests.app.db import create_service def test_get_permissions_by_user_id_returns_all_permissions(sample_service): permissions = permission_dao.get_permissions_by_user_id(user_id=sample_service.users[0].id) assert len(permissions) == 8 assert sorted(["m...
from django.urls import path from .views import * from .import views app_name = 'offers' urlpatterns = [ # Renda Fixa # ------------------------------------------------------------------------------------------------------------------ # Listar path('rf/listar/', OfferRfListView.as_view(), name="lista...
from ..legend import Legend def size_continuous_legend(title=None, description=None, footer=None, prop='size', variable='size_value', dynamic=True, ascending=False, format=None): """Helper function for quickly creating a size continuous legend. Args: prop (str, optional): A...
import unittest from app.models import Role class RoleModelTest(unittest.TestCase): def setUp(self): self.new_role = Role('1','admin') if __name__ =='__main__': unittest.main()
""" dotfiles ~~~~~~~~ Dotfiles is a tool to make managing your dotfile symlinks in $HOME easy, allowing you to keep all your dotfiles in a single directory. :copyright: (c) 2011-2016 by Jon Bernard. :license: ISC, see LICENSE.rst for more details. """ __version__ = '0.9.dev0'
""" """ import sys sys.path.append("..") # import one subdirectory up in files import numpy as np from networks.networks import IsoMPS #%% XXZ Tenpy MPO from tenpy.models.model import CouplingMPOModel, NearestNeighborModel from tenpy.tools.params import asConfig from tenpy.networks.site import SpinHalfSite #__all__...
#!/usr/bin/env python """booleanRules.py: Infers network from pseudotime and binary expression. To run type python booleanRules.py gene expressionFile step orderFile maxAct maxRep networkFile threshold thresholdStep gene: name of gene e.g. Gata1. This should match gene names in expression and network files. expressionF...
"""Ekea for EAM model""" import os, subprocess, json, shutil from ekea.e3smapp import E3SMApp, here from ekea.utils import xmlquery # EAM app class EAMKernel(E3SMApp): _name_ = "eam" _version_ = "0.1.0" # main entry def perform(self, args): self.generate(args, "exclude_e3sm_eam.ini")
import os import sys from pathlib import Path from data_pipeline.config import settings from data_pipeline.utils import ( download_file_from_url, get_module_logger, ) logger = get_module_logger(__name__) def check_score_data_source( score_csv_data_path: Path, score_data_source: str, ) -> None: "...
""" This file contains the implementation of the class GameObject. Author: Alejandro Mujica (aledrums@gmail.com) Date: 07/22/20 """ from src.mixins import DrawableMixin, CollisionMixin class GameObject(DrawableMixin, CollisionMixin): # Object sides TOP = 'top' RIGHT = 'right' BOTTOM = 'bottom' LE...
#!/usr/bin/env python2 # Fill in checksum/size of an option rom, and pad it to proper length. # # Copyright (C) 2009 Kevin O'Connor <kevin@koconnor.net> # # This file may be distributed under the terms of the GNU GPLv3 license. import sys def alignpos(pos, alignbytes): mask = alignbytes - 1 return (pos + mas...
# We start by importing all the modules we will need, as well as the helper document with all our functions import argparse import torch import numpy as np from torch import nn from torch import optim import torch.nn.functional as F import os from torchvision import datasets, transforms, models from collections import ...
from django.contrib import admin from django.urls import path, include from django.contrib.sitemaps.views import sitemap from website.sitemaps import PostSitemap sitemaps = { 'posts': PostSitemap } urlpatterns = [ path('mkubwa/', admin.site.urls), path('accounts/', include('accounts.urls', namespace='acco...
import multiprocessing import time from multiprocessing.connection import Listener, Client from typing import Dict, Any, List import tqdm from autopandas_v2.ml.inference.interfaces import RelGraphInterface class ModelStore: def __init__(self, path_map: Dict[Any, str]): self.path_map = path_map s...
# -*- coding: utf-8 -*- """This module populates the tables of bio2bel_reactome.""" import logging from collections import defaultdict from typing import Dict, List, Mapping, Optional, Set import pandas as pd from tqdm import tqdm from bio2bel.compath import CompathManager from pyobo import get_name_id_mapping from...
from collections import namedtuple from sqlalchemy.orm.exc import NoResultFound from parks.models import DBSession from parks.models import Park from parks.models import StampCollection from parks.models import User from parks.models import UserEmail def get_user_by_id(user_id): return DBSession.query( U...
from tkinter import * from tkinter.ttk import * from cep_price_console.cntr_upload.CntrUploadTab import CntrUploadTab from cep_price_console.utils.log_utils import CustomAdapter, debug from cep_price_console.cntr_upload.Treeview import TreeviewConstructor, TreeColumn, TreeRow import logging class Step5ReviewUpload(Cn...
# start_chrome -> input_date -> scroll_down-> find_cards_info -> save -> find_next (goto) from selenium import webdriver from selenium.webdriver.common.keys import Keys import time import csv import os def start_chrome(): driver = webdriver.Chrome(executable_path='./chromedriver.exe') driver.start_client() ...
import client import get_plant import time import RPi.GPIO as GPIO import picamera import math import numpy as np import argparse import cv2 import json import MPU9250 # GPIO setup GPIO.setmode(GPIO.BCM) GPIO.setup(17, GPIO.OUT) GPIO.setup(25, GPIO.OUT) servo=GPIO.PWM(17, 100) # Connect to the server and take possess...
from marshmallow_sqlalchemy import SQLAlchemyAutoSchema from variance.models.muscle import MuscleModel, MuscleGroupModel class MuscleSchema(SQLAlchemyAutoSchema): class Meta: model = MuscleModel load_instance = False class MuscleGroupSchema(SQLAlchemyAutoSchema): class Meta: model = ...
from django.contrib import admin from .models import PageCheckResult @admin.register(PageCheckResult) class PageCheckResultAdmin(admin.ModelAdmin): list_display = ('buschenschank', 'created', 'tag_name', 'website', 'return_code') list_filter = ('created', 'return_code', 'tag_name') se...
from player import Player class Human(Player): def __init__(self, symbol: str, name: str = "You"): super().__init__(name, symbol) def move(self, state: list[str]): print(f"{self.name} is to move!") while True: inp = input("Enter an integer between 1 and 9 representing an e...
import mnist_loader import network2 from task_gen import TaskGen import numpy as np training_data2, validation_data2, test_data2 = mnist_loader.load_data_wrapper() task_gen = TaskGen() training_data = task_gen.generate(1000) validation_data = task_gen.generate(1000, False) ''' print training_data2[0][1] print training...
# -*- coding: utf-8 -*- import hashlib import unicodedata from collections import Counter, defaultdict from six import text_type from hayes.analysis import builtin_simple_analyzer from hayes.ext.stopwords import ( english_stopwords, finnish_stopwords, russian_stopwords, swedish_stopwords, unicode_punctuation_...
from app import db from datetime import datetime from werkzeug.security import generate_password_hash,check_password_hash from flask_login import UserMixin from app import login class User(UserMixin,db.Model): id=db.Column(db.Integer,primary_key=True) username = db.Column(db.String(64),index=True,unique=True...
from dataclasses import dataclass from typing import Sequence from .phrase import Phrase from .translation_sources import TranslationSources from .word_alignment_matrix import WordAlignmentMatrix @dataclass(frozen=True) class TranslationResult: source_segment: Sequence[str] target_segment: Sequence[str] ...
#!/usr/bin/env python from collections import defaultdict # 000000000111111111122222222222333333333344444444 # 123456789012345678901234567890123456789012345678 # Step G must be finished before step X can begin. def parse_line(input_line): return input_line[5], input_line[36] def parse_input(content): retur...
from lxml.builder import E from sciencebeam_lab.lxml_to_svg import ( iter_svg_pages_for_lxml, SVG_TEXT, SVG_G, SVG_DOC ) SOME_TEXT = "some text" SOME_X = "10" SOME_Y = "20" SOME_BASE = "25" SOME_HEIGHT = "30" SOME_FONT_SIZE = "40" SOME_FONT_FAMILY = "Fontastic" SOME_FONT_COLOR = '#123' class LXML(object): ...
# coding: utf8 from __future__ import print_function import os, sys, re from xml.dom import minidom class HamshahriReader(): """ interfaces [Hamshahri Corpus](http://ece.ut.ac.ir/dbrg/hamshahri/files/HAM2/Corpus.zip) that you must download and extract it. >>> hamshahri = HamshahriReader(root='corpora/hamshahri')...
# -*- coding: utf-8 -*- # # michael a.g. aïvázis # orthologue # (c) 1998-2019 all rights reserved # # class declaration class Mapping: """ Mix-in class that forms the basis of the representation of mappings Mappings are dictionaries with arbitrary keys whose values are nodes """ # types fro...
import streamlit as st st.title('titulo') st.button('cl') st.sidebar.radio('radio',[1,2,3]) for i in range(10): st.write('holla')
#!python from __future__ import print_function import time from arduino_device import findArduinoDevicePorts from arduino_olfactometer import ArduinoOlfactometers from arduino_olfactometer import isOlfactometerPortInfo from faa_actuation import PwmController from faa_actuation import CurrentController from faa_actuati...
import bs4 print("BlockDMask") print(3 + 4)
from collections import Counter,defaultdict import numpy as np import os import pandas as pd import time start_time=time.time() def time_passed(): return time.time() - start_time scores={} num_row_ids=8607230 def update_tally(preds,preds_per_row_id,weight): for i in range(len(preds)): if preds[i] i...
from django.conf.urls import patterns, url urlpatterns = patterns( '', url(r'^(?P<slug>[-\w]+)/$', 'blog.views.show_post', name='post'), )
#!/usr/bin/env python # -*- coding: utf-8 -*- # time: 2020-8-9 23:11:00 # version: 1.0 # __author__: zhilong import pymysql def main(): conn = pymysql.connect(host='localhost', user='root', password='rootpwd', db='novelsite') cursor = conn.cursor() sql = 'create table novel(novelid int primary key auto_incr...
import simuvex from simuvex.s_type import SimTypeFd, SimTypeInt from claripy import BVV ###################################### # getc ###################################### class _IO_getc(simuvex.SimProcedure): # pylint:disable=arguments-differ def run(self, f_p): #additional code trace_dat...
import matplotlib.pyplot as plt import numpy as np plt.style.use('_mpl-gallery') def get_data(filename): with open(filename) as f: lines = f.readlines() data=[[],[]] for line in lines: curr_line=line[0:-2] x,y=curr_line.split(" "); x=float(x) y=float(y) data[0].append(x) data[1].append(y) ...
"""Multi-consumer multi-producer dispatching mechanism Originally based on pydispatch (BSD) http://pypi.python.org/pypi/PyDispatcher/2.0.1 See license.txt for original license. Heavily modified for Django's purposes. """ from .dispatcher import Signal, receiver # NOQA from .tasks import register_tasks, set_task_name...
import requests import pathlib import shutil from typing import Dict, Tuple, List, Optional import xml.etree.ElementTree as ET HERE = pathlib.Path(__file__).absolute().parent GL_XML_URL = 'https://raw.githubusercontent.com/KhronosGroup/OpenGL-Registry/master/xml/gl.xml' # noqa: E501 class Command: def ...
"""Refactor candidates table Revision ID: fbf89710dead Revises: d67d42b06b11 Create Date: 2020-11-12 16:34:25.642126 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = 'fbf89710dead' down_revision = '73ca57416d1c' branch_labels = None depends_on = None def upgra...
from django.template import RequestContext, loader from django.conf import settings from django.core.exceptions import PermissionDenied from django.http import HttpResponseForbidden class Http403(Exception): pass def render_to_403(*args, **kwargs): """ Returns a HttpResponseForbidden whose content i...
# Copyright (C) 2019 Google Inc. # Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file> """Mixins for entities.""" # pylint: disable=too-few-public-methods class Reviewable(object): """A mixin for reviewable objects.""" def update_review(self, new_review): """Update obj review dict an...
from time import sleep x = 10 while x >= 0: print(x) sleep(0.5) x -= 1 print('Fogo!!')
from django.conf.urls import url from . import views urlpatterns = [ url(r"^login/(?P<service>\w+)/$", views.oauth_login, name="oauth_access_login"), url(r"^callback/(?P<service>\w+)/$", views.oauth_callback, name="oauth_access_callback"), url(r"^finish_signup/(?P<service>\w+)/$", views.finish_signup, na...
import typing import bs4 __author__ = "Jérémie Lumbroso <lumbroso@cs.princeton.edu>" __all__ = [ "split_name", "extract_text", ] CS_SCRAPING_LABEL_CLASS = "person-label" def split_name(name: str) -> typing.Tuple[str, str]: """ Returns a likely `(first, last)` split given a full name. This uses ...
from django.contrib import admin from reviews import models class CompanyAdmin(admin.ModelAdmin): form = models.CompanyForm list_display = ('name',) exclude = () class CityAdmin(admin.ModelAdmin): form = models.CityForm list_display = ('name',) exclude = () class PersonAdmin(admin.ModelAdm...
# coding: utf-8 """ qTest Manager API Version 8.6 - 9.1 qTest Manager API Version 8.6 - 9.1 OpenAPI spec version: 8.6 - 9.1 Generated by: https://github.com/swagger-api/swagger-codegen.git """ from pprint import pformat from six import iteritems import re class CommentQuery...
#!/usr/bin/env python import rospy import sys import time import math import tf import tf2_ros import serial import csv from rugby_lib.imu_gy85 import GY85 from geometry_msgs.msg import Twist, TransformStamped from rugby.msg import * from nav_msgs.msg import Odometry from std_msgs.msg import String from std_msgs.msg ...
######################################################################### # Walks through a file system tree and execute a command on files # # Jean-Louis Dessalles 2012 # ######################################################################### """ Walks through ...
#!/usr/bin/env python3 import sys import re txt = sys.stdin.read() def logger(msg): sys.stderr.write("{}\n".format(msg)) txt = txt.replace("’", "'") lines = txt.split("\n") lines = [line.strip() for line in lines] lines = [line for line in lines if len(line)] row = None num = 0 tmpl = "MarketVendor.where(mark...
#!/usr/bin/env python ############################################################################ # # 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 A...
import json import requests import secrets sld = "pleasenoban2011" tlds = [] with open('tlds.txt') as _tlds: _tlds = _tlds.readlines() for _tld in _tlds: _tld = _tld.strip("\n") tlds.append(f"{sld}.{_tld}") # split list in half _len_half = len(tlds) // 2 tlds_first_set = tlds[:len(tlds) // ...
# coding=utf-8 import re from sqlalchemy.orm.exc import NoResultFound from ultros_site.base_sink import BaseSink from ultros_site.database.schema.news_post import NewsPost from ultros_site.decorators import render_api __author__ = "Gareth Coles" class APINewsRoute(BaseSink): route = re.compile(r"/api/v1/news/(...
class api_response: def __init__(self, status, info, data): self.status = status self.info = info self.data = data def get_api_response(self): return { "status": self.status, "info": self.info, "data": s...
# -*- coding: utf-8 -*- def get_file_content(filename): """ 读取文件, 返回一个生成器对象 :param filename: :return: """ with open(filename, encoding='utf-8') as f: while True: line = f.read(512) if line: yield line else: # 如果line为None, 那么说明已经读取到文...
from django.urls import path from .views import ProfileUpdateView, ProfileDetailView urlpatterns = [ path('<slug:slug>/', ProfileDetailView.as_view(), name='profile-detail'), path('<slug:slug>/edit/', ProfileUpdateView.as_view(), name='profile-settings'), ]
#!/usr/bin/env python #-*- coding: utf-8 -*- # Python 3.7 # # @Author: Jxtopher # @License: CC-BY-NC-SA # @Date: 2019-04 # @Version: 1 # @Purpose: # see https://packages.debian.org/jessie/wordlist # see /usr/share/dict/ # import numpy as np from itertools import cycle import matplotlib matplotlib...
from odoo.tests.common import TransactionCase class TestComputeDomain(TransactionCase): at_install = True post_install = True def setUp(self): super(TestComputeDomain, self).setUp() self.demo_user = self.env.ref("base.user_demo") self.env["ir.rule"].create( { ...
#%% import os, glob import numpy as np import tensorflow as tf # from myDataset import * # from myconfig import cfg # from yoloNet import * # model = yoloNetModle() # tf.keras.utils.plot_model(model, show_shapes=True, show_layer_names=True) # weight_reader = WeightReader('yolo.weights') # print(weight_reader.all_we...
class Cliente: def __init__(self, nome, email, plano): self.nome = nome self.email = email self.lista_planos = ["basic", "premium"]#se fosse uma variavel somente pra essa funcao, nao precisaria do self. if plano in self.lista_planos: self.plano = plano else: ...
import sys f=open(sys.argv[1],'r') patch_no=sys.argv[2] #g=open('/Volumes/Unnamed/patched_function_old/'+patch_no,'r') #method=g.readline().strip() from unidiff import PatchSet import os def get_patched_class(patch_no): patchfile=os.path.join('../../patches',patch_no) patch = PatchSet.from_filename(patchfile,en...
# -*- coding: utf-8 -*- """Concrete VeiL api objects.""" from .cluster import VeilCluster from .controller import VeilController from .data_pool import VeilDataPool from .domain import (DomainBackupConfiguration, DomainConfiguration, DomainTcpUsb, DomainUpdateConfiguration, VeilDomain, VeilGuestAge...
from unittest import mock from py.test.tools import ( BaseTestCase, ) from py.src.match.model.data import ( GlobalRankedData, ) from py.src.view_model import ( GlobalViewModelCache, ) class GlobalIntegrationTest(BaseTestCase): @classmethod def setUpChildClass(cls): cls.matches = cls.sam...
""" Miscellanea utilities """ from __future__ import ( division, absolute_import, print_function, unicode_literals ) import sys, os, tempfile, logging if sys.version_info >= (3,): import urllib.request as urllib2 import urllib.parse as urlparse else: import urllib2 import urlparse # Courtesy of http...
''' Author= 'Parampreet Singh' Project= 'https://github.com/paramsingh96/TensorFlow-Tutorials' Simple tutorial for understanding MNIST Data Sets ''' # Importing different libraries import tensorflow as tf import matplotlib.pyplot as plt import numpy as np import tensorflow.examples.tutorials.mnist.inp...
import concurrent.futures import datetime import itertools import json import logging import os from typing import Dict, Iterable, List import kafka from finitestate.common.retry_utils import retry from finitestate.common.timer import CodeTimer from finitestate.firmware.datasets import Dataset, Density, Format, Granu...
#!/usr/bin/env python import sys, os import errno import arsdkparser from common import * #=============================================================================== # root file that includes all generated c files #=============================================================================== def gen_root_jni(c...
# Generated by Django 3.2.2 on 2021-05-18 19:03 import datetime from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='Email', fields=[ ('id', mod...
# -*- coding: utf-8 -*- __author__ = "Frank Becker <fb@alien8.de>" __copyright__ = "Frank Becker" __license__ = "mit" import importlib def test_module_imports(): """Test if all modules can be imported.""" modules = ["api", "auth", "awattar", "cli", "config", "defaults", "poller", "utils", "weather"] for...
class Queue: def __init__(self): self.storage = [] def size(self): return len(self.storage) def enqueue(self, item): self.storage.append(item) def dequeue(self): return self.storage.pop(0)
# yellowbrick.utils # Utility functions and helpers for the Yellowbrick library. # # Author: Jason Keung <jason.s.keung@gmail.com> # Author: Patrick O'Melveny <pvomelveny@gmail.com> # Author: Benjamin Bengfort <bbengfort@districtdatalabs.com> # Author: Rebecca Bilbro <rbilbro@districtdatalabs.com> # Created: T...
# Generated by Django 3.2.7 on 2021-11-26 08:30 from django.db import migrations # Migration that creates a user group called "Download approved user" def create_barrier_search_download_approved_group(apps, schema_editor): Group = apps.get_model("auth", "Group") Group.objects.create(name="Download approved u...
import numpy as np # # class Decoration: # def __init__(self, s0, s1, s2, r0, r1, r2): # self.s0 = s0 # self.s1 = s1 # self.s2 = s2 # self.r0 = r0 # self.r1 = r1 # self.r2 = r2 # assert len(s0) == 3, "s0 not a valid R^3 vector" # assert len(s1) == 3, "...
# -*- coding: utf-8 -*- # Copyright 2019 Cohesity Inc. import cohesity_management_sdk.models.agent_information import cohesity_management_sdk.models.datastore_information import cohesity_management_sdk.models.vmware_object_id import cohesity_management_sdk.models.vmware_tag_attributes import cohesity_management_sdk.mo...
from adv_finance.multiprocess.multiprocess import mp_pandas_obj, process_jobs, process_jobs_
import pytest from icevision.all import * @pytest.fixture def coco_bbox_parser(coco_dir): return parsers.COCOBBoxParser(coco_dir / "annotations.json", coco_dir / "images") @pytest.fixture def coco_mask_parser(coco_dir): return parsers.COCOMaskParser(coco_dir / "annotations.json", coco_dir / "images") def ...
################################################################################ # # Package : AlphaPy # Module : analysis # Created : July 11, 2013 # # Copyright 2017 ScottFree Analytics LLC # Mark Conway & Robert D. Scott II # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use ...
import asyncio import discord from common import botcolour, botname, db, logo, prefix from discord.ext import commands from modules.utils import getChannel, isAdmin, system_notification class New(commands.Cog): def __init__(self, bot): self.bot = bot @commands.command(name="new", aliases=['create'])...
import math import random import numpy as np import quaternion from scipy import integrate import cv2 from scipy.interpolate import RegularGridInterpolator, NearestNDInterpolator from scipy.interpolate.interpnd import LinearNDInterpolator from visnav.algo.image import ImageProc from visnav.algo import tool...
import os import pickle import json import numpy as np from sklearn.externals import joblib from sklearn.linear_model import Ridge from inference_schema.schema_decorators import input_schema, output_schema from inference_schema.parameter_types.numpy_parameter_type import NumpyParameterType def init(): global mod...
import SimpleHTTPServer import SocketServer import sys import time class MyHandler(SimpleHTTPServer.SimpleHTTPRequestHandler): def handle_one_request(self): time.sleep(0.1) return SimpleHTTPServer.SimpleHTTPRequestHandler.handle_one_request(self) print("Serving local directory") httpd = SocketServer.TC...
""" Support to interface with LGE ThinQ Devices. """ __version__ = "0.23.0" PROJECT_URL = "https://github.com/ollo69/ha-smartthinq-sensors/" ISSUE_URL = "{}issues".format(PROJECT_URL) DOMAIN = "smartthinq_sensors" MIN_HA_MAJ_VER = 2022 MIN_HA_MIN_VER = 5 __min_ha_version__ = f"{MIN_HA_MAJ_VER}.{MIN_HA_MIN_VER}.0" C...