content
stringlengths
5
1.05M
from pathlib import Path import geopandas as gp import pygeos as pg from analysis.constants import M2_ACRES from analysis.lib.pygeos_util import intersection ownership_filename = "data/inputs/boundaries/ownership.feather" results_dir = Path("data/results/huc12") ownership_results_filename = results_dir / "ownershi...
# proxy module from __future__ import absolute_import from chaco.function_image_data import *
from lcarmq.rmq.abs_rmq import AbstractRmq from lcarmq.rmq.rmq import Rmq from lcarmq.rmq.bfc2000 import Bfc2000
import torch import torch.nn as nn import math import librosa def normalize_batch(x, seq_len, normalize_type: str): if normalize_type == "per_feature": assert not torch.isnan(x).any(), x x_mean = torch.zeros( (seq_len.shape[0], x.shape[1]), dtype=x.dtype, device=x.device) x_std...
# -*- coding: utf-8 -*- """ pyeasyga module """ import random import copy from operator import attrgetter import numpy as np from time import gmtime, strftime import matplotlib.pyplot as plt from libs.get_random import get_rollet_wheel as rollet from six.moves import range class GeneticAlgorithm(object): ""...
from .models import Member from rest_framework import serializers, viewsets class MemberSerializer(serializers.ModelSerializer): class Meta: model = Member fields = '__all__' class MemberViewSet(viewsets.ModelViewSet): queryset = Member.objects.all() serializer_class = MemberSerializer
from baseic import FunDemo FunDemo.message("JJGG", 25)
#!/usr/bin/env python3 import argparse import os import sys import uuid import util import service_app_id as app_id import service_cos as cos import service_cloudant as nosql import service_event_streams as es CREDENTIALS_FILE = './.credentials' COVSAFE_VIEW = 'covsafe-view' ES_TOPICS = 'covsafe' APPID_REGISTERED_APP...
from _functools import partial def f(a, b, c=0, d=0): return (a, b, c, d) f7 = partial(f, b=7, c=1) them = f7(10) assert them == (10, 7, 1, 0)
import shutil from typing import Any, Dict, Optional, Tuple from faker import Faker from nig.endpoints import INPUT_ROOT from restapi.services.authentication import Role from restapi.tests import API_URI, BaseTests, FlaskClient def create_test_env(client: FlaskClient, faker: Faker, study: bool = False) -> Any: ...
from controller import Robot def calculate_motor(signal): return (signal/100)*6.28 def run_robot(robot): #timestep = int(robot.getBasicTimeStep()) timestep = 64 #define sensor sensor = [] sensor_name =['ps0', 'ps1', 'ps2', 'ps3', 'ps4', 'ps5', 'ps6', 'ps7'] for i in range(8): ...
'''Train function. ''' import logging from os import path import time import lasagne import numpy as np from progressbar import Bar, ProgressBar, Percentage, Timer import theano from theano import tensor as T from utils import update_dict_of_lists from viz import save_images, save_movie logger = logging.getLogger...
flu_url = 'https://data.cityofchicago.org/api/views/rfdj-hdmf/rows.csv?accessType=DOWNLOAD' flu_path = 'Flu_Shot_Clinic_Locations_-_2013.csv' flu_shot_meta = { 'dataset_name': 'flu_shot_clinics', 'human_name': 'Flu Shot Clinic Locations', 'attribution': 'foo', 'description': 'bar', 'url': flu_url, ...
"""empty message Revision ID: f636a63c48d6 Revises: 10aadf62ab2a Create Date: 2021-11-16 19:45:56.961730 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = 'f636a63c48d6' down_revision = '10aadf62ab2a' branch_labels = None depends_on = None def upgrade(): # ...
from functools import lru_cache, partial from operator import attrgetter from django.conf import settings from MyCapytain.common.constants import RDF_NAMESPACES from MyCapytain.resources.collections.cts import XmlCtsTextInventoryMetadata from MyCapytain.resources.prototypes.cts import inventory as cts from .capitain...
__title__ = "gulpio2" __version__ = "0.0.4" __copyright__ = 'Copyright 2021 Will Price & TwentyBN' __description__ = "Binary storage format for deep learning on videos." __author__ = ", ".join("""\ Eren Golge (eren.golge@twentybn.com) Raghav Goyal (raghav.goyal@twentybn.com) Susanne Westphal (susanne.westphal@twentybn....
# -*- python -*- # -*- coding: utf-8 -*- # # michael a.g. aïvázis <michael.aivazis@para-sim.com> # # (c) 2013-2020 parasim inc # (c) 2010-2020 california institute of technology # all rights reserved # # get the package import altar # get the protocol from . import distribution # and my base class from .Base import B...
from dataclasses import dataclass from .t_artifact import TArtifact __NAMESPACE__ = "http://www.omg.org/spec/BPMN/20100524/MODEL" @dataclass class Artifact(TArtifact): class Meta: name = "artifact" namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL"
import re dic = {"1#": "#", "2#": "##", "3#": "###", "4#": "####", "5#": "#####", "6#": "######", "*": "**", "/": "*", "~": "~~", "_": "__", "--": "----"} # {"Better Markdown": "Markdown"} def replaceText(text, dic): for i, j in dic.items(): text = text.replace(i, j) print(text) fileName = inp...
from django.apps import apps from django.contrib import admin from comment.tests.base import BaseCommentTest from comment.models import FlagInstance, ReactionInstance class TestCommentAdmin(BaseCommentTest): def test_all_models_are_registered(self): app = apps.get_app_config('comment') models = a...
#!/usr/bin/env python # -*- coding: utf-8 -*- # Common Python library imports from __future__ import unicode_literals import six import zipfile import zlib # Pip package imports # Internal package imports from flask_mm import files DEFAULT_STORAGE = 'local' class BaseStorage(object): root = None DEFAULT_M...
import grpc from pygcdm.netcdf_encode import netCDF_Encode from pygcdm.protogen import gcdm_server_pb2_grpc as grpc_server from concurrent import futures class Responder(grpc_server.GcdmServicer): def __init__(self): self.encoder = netCDF_Encode() def GetNetcdfHeader(self, request, context): ...
# DESAFIO CLASSES E METODOS '''Crie uma classe carro que tenha no mínimo 3 propriedades, para a classe carro e no mínomo 3 metodos para ela''' from time import sleep cores = {'limpar': '\033[m', 'verde': '\033[32m', 'vermelho': '\033[31m', 'pretob': '\033[7;30m' } class Carro: ...
#!/usr/bin/python3 import numpy as np import itertools first = {} def hasVoid(B, gramatica): if B in gramatica.keys(): if 'ε' in gramatica[B]: return True return False def concatDicts(test_dict1, test_dict2): for key in test_dict1: if key in test_dict2: for val i...
# Author: Chengjia Lei import gym from RL_brain import DQNPrioritizedReplay import matplotlib.pyplot as plt import tensorflow as tf import numpy as np gym.envs.register( id='CartPole_long_pole-v0', entry_point='gym.envs.classic_control:CartPoleEnv', tags={'wrapper_config.TimeLim...
from .models import * from django.core.exceptions import ObjectDoesNotExist def context(request): if request.user.is_authenticated: try: my_profile = UserProfile.objects.get(user=request.user) my_posts = Post.objects.filter(post_holders=request.user) interviews = Nomina...
__all__ = ["plainramploader", "steppingramploader", "fullramploader"]
from captcha.fields import CaptchaField from django import forms from django.core.exceptions import ValidationError, NON_FIELD_ERRORS from relais import helpers, constants from relais.constants import RANGE_INDIVIDUAL, RANGE_TEAM from relais.models import ( CATEGORY_CHOICES, CONFIG_CHOICES, GENDER_CHOICES,...
import numpy as np class Operators: weights = -1 def propagate_backward(self, target, gammar, lrate= 0.1, momentum = 0.1): error = target - self.ret return error def reset(self): return 0 def set_init_weight_scale(self,x): return class OpTempo(Operators): ...
from boa3.builtin import NeoMetadata, metadata def Main() -> int: return 5 @metadata def standards_manifest() -> NeoMetadata: meta = NeoMetadata() meta.supported_standards = ['NEP-17'] # for nep17, boa checks if the standard is implemented return meta
import os import os.path import logging import json from gii.core import * from gii.moai.MOAIRuntime \ import \ MOAIRuntime, MOAILuaDelegate, LuaTableProxy, _G, _LuaTable, _LuaObject signals.register ( 'mock.init' ) ##----------------------------------------------------------------## _MOCK = LuaTableP...
from django.db import models class Article(models.Model): title = models.CharField(max_length=50) slug = models.SlugField() content = models.TextField() is_published = models.BooleanField(default=False)
import rest_framework.permissions as drf_permissions from rest_framework import generics import data from interfaces import views, permissions from interfaces.api import serializers class PublicationList(views.APIListView, views.APICreateView, generics.GenericAPIView): """ ProTReND database REST API. Op...
from bleu_score import compute_bleu def remove_tags(s): """ Removes tags that should be ignored when computing similarites :param s: Sentence as a list of words :return: Same sentence without the tags """ # tags = set(['<START>', '<END>', '<UNK>', 0, 1, 2, 3]) tags = set(['<START>', '<END>'...
# This file is a part of Arjuna # Copyright 2015-2021 Rahul Verma # Website: www.RahulVerma.net # 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...
import torch import numpy as np from pyannote.audio.features import RawAudio from pyannote.core import SlidingWindowFeature from graphs.models.base import BaseModel class SincNetPyAnnote(BaseModel): def __init__(self, device, weights='emb_voxceleb', sample_rate=16000, **kwargs): super(SincNetPyAnnote, se...
import inspect from ...utils import call_main def add_parser(sub_parser, raw): desc = """ Display the current git branch name. $ m git branch master """ sub_parser.add_parser( 'branch', help='display the current git branch', formatter_class=raw, ...
# TestSwiftExpressionObjCContext.py # # This source file is part of the Swift.org open source project # # Copyright (c) 2018 Apple Inc. and the Swift project authors # Licensed under Apache License v2.0 with Runtime Library Exception # # See https://swift.org/LICENSE.txt for license information # See https://swift.org/...
"""``cubi-tk sea-snap``: tools for supporting the Sea-snap pipeline. Available Commands ------------------ ``check-irods`` Check consistency of sample info, blueprint and files on SODAR. ``itransfer-raw-data`` Transfer raw data from ``work/input_links`` directory of ``ngs_mapping``. ``itransfer-results`` ...
import os import csv import threading from .classes import AccessNetwork from .path import single_source_shortest_path from .consts import MAX_LABEL_COST, MIN_TIME_BUDGET, \ BUDGET_TIME_INTVL, MAX_TIME_BUDGET __all__ = ['evaluate_accessibility'] def _get_interval_id(t): """ return interval ...
""" Modern, PEP 517 compliant build backend for building Python packages with extensions built using CMake. """ __version__ = '0.0.11a0'
from __future__ import absolute_import, division, print_function, unicode_literals import logging import numpy as np import torch from torch import tensor from madminer.utils.ml.models.ratio import DenseSingleParameterizedRatioModel, DenseDoublyParameterizedRatioModel logger = logging.getLogger(__name__) def evalu...
# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"). You # may not use this file except in compliance with the License. A copy of # the License is located at # # http://aws.amazon.com/apache2.0/ # # or in the "license" file acc...
def read_to_string(filename): chars = ['"'] with open(filename, "rb") as file: while True: data = file.read(7) if not data: break if len(data) < 7: data = data + b"\0" * (7 - len(data)) i = int.from_bytes(data, "big") # print("i:", *("{:08b}".format(d) for d in data)) sevens = [] ...
from pywatson.question.evidence_request import EvidenceRequest from pywatson.question.filter import Filter from pywatson.question.watson_question import WatsonQuestion class TestQuestion(object): """Unit tests for the WatsonQuestion class""" def test___init___basic(self, questions): """Question is co...
from KratosMultiphysics import * from KratosMultiphysics.sympy_fe_utilities import * from sympy import * import pprint def computeTau(params): print("\nCompute Stabilization Matrix\n") dim = params["dim"] # Spatial dimensions Tau = zeros(dim+2,dim+2) # Stabilization Matrix tau1 = Symbol('tau1') ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import sys if __name__ == '__main__': m = int(input("Enter the number of the season ")) if m < 1 or m > 4: print("Illegal value of m", file=sys.stderr) exit(1) if m == 1: print("The winter months are: December, January and February") ...
#!/usr/bin/env python from EPPs.common import StepEPP from pyclarity_lims.entities import Protocol class CheckStepUDF(StepEPP): """ Checks if steps specified in arguments have their default value or not """ def __init__(self, argv=None): super().__init__(argv) self.check_udfs = self.cm...
# LICENSED UNDER BSD-3-CLAUSE-CLEAR LICENSE # SEE PROVIDED LICENSE FILE IN ROOT DIRECTORY # Import Modules import logging import click from src.bgp import bgp from src.peeringdb import pdb from src.ip import ip from src.shodan import shodan from src.whois import whois from src.api import api class Throne: def __i...
import pytest from src.app import app as APIAppRoot from fastapi.testclient import TestClient @pytest.fixture(scope="package") def client(): with TestClient( APIAppRoot, base_url="http://testserver/api/bilibili/v3/" ) as client: yield client def test_video_info(client: TestClient): respo...
# clear the list elements = [1, 2, 3, 4, 5] del elements[:] print(elements) # replace all elements elements = [1, 2, 3, 4, 5] elements[:] = [5, 4, 3, 2, 1] print(elements) # copy the list elements = [1, 2, 3, 4, 5] copy_of_elements = elements[:] print(copy_of_elements is elements)
from django import forms from django.contrib.auth.forms import UserCreationForm from django.contrib.auth.models import User class LoginForm(forms.Form): username = forms.CharField(max_length = 100) password = forms.CharField(widget = forms.PasswordInput())
#!/usr/bin/python3 OPENVSWITCH_SERVICES_EXPRS = [r"ovsdb-\S+", r"ovs-vswitch\S+", r"ovn\S+"] OVS_PKGS = [r"libc-bin", r"openvswitch-switch", r"ovn", ] OVS_DAEMONS = {"ovs-vswitchd": {"logs": "var/log/openvswit...
from apptweak.plateform import * class Ios(Plateform): plateform_name = 'ios' def __init__(self): super().__init__(self.plateform_name) @classmethod def ratings(self, application_id, params = {}): return self.applications(application_id, API_END_PATH['ratings'], params) @classmet...
# Based on gearUtils-03.js by Dr A.R.Collins # Latest version: <www.arc.id.au/gearDrawing.html> # Calculation of Bezier coefficients for # Higuchi et al. approximation to an involute. # ref: YNU Digital Eng Lab Memorandum 05-1 from math import * from svg import * def genInvolutePolar(Rb, R): # Rb = base circle rad...
Cnt = 5 T = [0] * Cnt k1 = 0 Rez = 0 for k1 in range(0, Cnt): if (T[k1] < 186): Rez = Rez + 1 print("Rez=", Rez)
#!/usr/bin/env python import time start = time.time() # START OMIT import numpy as np counter = {'yes': 0, 'no': 0} big_list = set(np.random.randint(0, 10000, 10000000)) check_list = set(np.random.randint(0, 99999, 1000)) for number in check_list: if number in big_list: counter['yes'] += 1 else: ...
# # $Id: sphinxapi.py 1216 2008-03-14 23:25:39Z shodan $ # # Python version of Sphinx searchd client (Python API) # # Copyright (c) 2006-2008, Andrew Aksyonoff # Copyright (c) 2006, Mike Osadnik # All rights reserved # # This program is free software; you can redistribute it and/or modify # it under the terms of the GN...
#!/usr/bin/env python3 from src import nswairquality if __name__ == "__main__": x = nswairquality.NSWAirQuality() print(x.toJSON(True))
import tensorflow as tf from tensorflow.contrib import rnn import numpy as np import time import string import matplotlib.pyplot as plt from random import randint, choice ### to train on different data, just insert a path to a text file here: corpus_path = '../corpora/CNCR_2017-18_corpus.txt' ### # rest...
import numpy as np def losses_kron(B0_kron,B1_kron,B2_kron,gen_PG_point,baseMVA): """Compute losses based on Kron's Method.""" gen_PG_point_pu = np.array(gen_PG_point) / baseMVA #convert to p.u. B0_kron = np.array(B0_kron) B1_kron = np.array(B1_kron) B2_kron = np.array(B2_kron) # losses0 = B0_k...
#!/usr/bin/env python3 # coding: utf-8 # author: alice12ml from handler import Handler from config import API_TOKEN import requests import logging import subprocess import uuid class VideoHandler(Handler): @classmethod def response(cls, message): if message.get('document') and message['document'].get...
#!/usr/bin/env python3 ########################################################################## # Script to simulate Modelica models with JModelica. # ########################################################################## # Import the function for compilation of models and the load_fmu method from pymodelica imp...
import json import luigi from luigi.contrib.postgres import CopyToTable from datetime import datetime from nyc_ccci_etl.commons.configuration import get_database_connection_parameters from nyc_ccci_etl.utils.get_os_user import get_os_user from nyc_ccci_etl.utils.get_current_ip import get_current_ip from nyc_ccci_etl....
import itertools from z3 import z3 from teether.evm.state import SymRead, LazySubstituteState, translate from teether.util.z3_extra_util import get_vars_non_recursive, concrete, ast_eq class SymbolicResult(object): def __init__(self, xid, state, constraints, sha_constraints, target_op): self.xid = xid ...
# Paginator.py (vars-localize) from PyQt5 import QtGui from PyQt5.QtCore import pyqtSignal from PyQt5.QtGui import QIcon from PyQt5.QtWidgets import QWidget, QHBoxLayout, QPushButton, QLabel, QInputDialog __author__ = "Kevin Barnard" __copyright__ = "Copyright 2019, Monterey Bay Aquarium Research Institute" __credits_...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Fri Jan 10 01:12:40 2020 @author: kwanale1 """ import pandas as pd from ppandas import PDataFrame df1 = pd.read_csv("data/spatial-ref-region-point.csv") df1.rename(columns={"Region":"Location"},inplace=True) #print(df1.columns) df2_point = pd.read_csv("da...
"""General configuration for mpl plotting scripts""" from pathlib import Path from astropy import units as u from astropy.units import imperial BASE_PATH = Path(__file__).parent.parent FIGURE_WIDTH_AA = { "single-column": 90 * u.mm, "two-column": 180 * u.mm, "intermediate": 120 * u.mm, } class FigureSi...
from flask import render_template,request,redirect,url_for,abort, flash, jsonify from . import main from .forms import BlogForm,UpdateProfile, CommentForm from ..models import User,Blog,Comment from flask_login import login_required, current_user from .. import db,photos from ..request import get_blogs # Views @main....
#!/usr/bin/python import psutil def main(): count = 0 for proc in psutil.process_iter(): count += 1 print "%s proc = %s" % (str(count), str(proc)) main()
"""Initial Migration Revision ID: a3032c881fba Revises: 4a7e813c98de Create Date: 2019-02-11 19:28:22.793189 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = 'a3032c881fba' down_revision = '4a7e813c98de' branch_labels = None depends_on = None def upgrade(): ...
import pandas as pd import numpy as np def load_mie_file(filename): """ Loads the Mie parameters from a file. Parameters ---------- filename: str The name of the file storing the Mie scattering parameters Returns ------- my_df: xarray.Dataset The xarray Dataset storin...
from .effector import Effector class DefaultEffector(Effector): """default effector for Casbin.""" def merge_effects(self, expr, effects, results): """merges all matching results collected by the enforcer into a single decision.""" result = False if expr == "some(where (p_eft == allo...
# -*- coding: utf-8 -*- # MIT License # # Copyright (c) 2020 PANGAEA (https://www.pangaea.de/) # # 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 limita...
import pyperclip import random import string global users_list class User: ''' allows usto create new users and save their information for future usage ''' users_list = [] def __init__(self,first_name,last_name,password): ''' defining properties ''' # In variables self.first_name = first_name self....
from statistics import mean import matplotlib.pyplot as plt import numpy as np import pandas as pd from nltk import agreement def multi_kappa(data): ratingtask = agreement.AnnotationTask(data=data) return ratingtask.multi_kappa() def calculate_kappe(data, from_date, to_date, name): print('Calculating a...
import os from glob import glob import numpy as np import matplotlib.pyplot as plt if __name__ == "__main__": data_path = "./results/???/" # Change here save_folder = "./plots/learning/???/" # Change here meta = {} with open(data_path + "/meta.txt", "r") as param_file: for line in param_file...
from requests import * import utils import re match_ids = re.compile("href=\"/note/(.+?)\">") def check(host): s = session() # reg result = s.post(f"http://na2.{host}/", data={ "username": utils.randomString(), "password": "9pFrqCEyagsCbabGamT" }).content if b"Welcome to our super-...
if __name__ == '__main__': import os pipe = os.popen('/home/ivan/shortcuts/python hello-out.py') print(pipe.read()) print(pipe.close()) pipe = os.popen('/home/ivan/shortcuts/python hello-in.py', 'w') print(pipe.write('Gumby\n')) pipe.close() print(open('hello-in.txt').read())
n1 = int(input('Digite um número')) s = n1 - 1 a = n1 + 1 print("Seu sucessor é {} e seu antecessor é {} ".format(a,s))
from setuptools import setup setup( name='python-amazon-sp-api', version='0.11.0', install_requires=[ "requests", "six>=1.15,<2", "boto3>=1.16.39,<2", "cachetools~=4.2.0", "pytz", "confuse~=1.4.0" ], packages=['tests', 'tests.api', 'tests.api.orders',...
from scapy.layers.inet import IP, UDP from scapy.layers.ntp import NTP from scapy.packet import Packet from scapy.sendrecv import sniff, sr1, send from ntp_utils import ntp_time_now class NTPInterceptor: def intercept_req(self, pck): return pck def intercept_res(self, pck): return pck clas...
# The isBadVersion API is already defined for you. # @param version, an integer # @return a bool # def isBadVersion(version): class Solution: def firstBadVersion(self, n): """ :type n: int :rtype: int """ l, r = 1, n while l<r: m = (l+r)//2 ...
#!/usr/bin/python # Copyright (c) 2017 Tim Rightnour <thegarbledone@gmail.com> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', ...
# Generated by Django 2.0.6 on 2018-08-20 03:00 from django.db import migrations, models import django.utils.timezone class Migration(migrations.Migration): dependencies = [ ('imagesource', '0003_auto_20180820_1019'), ] operations = [ migrations.AlterField( model_name='image...
from __future__ import absolute_import # Copyright (c) 2010-2015 openpyxl from .external import ExternalLink
def findnotrepeat(inplist1): i = 0 while i < len(inplist1): if (i+1) == len(inplist1): return inplist1[i] elif inplist1[i] != inplist1[i+1]: return inplist1[i] else: i += 2 return "Todos tienen un par dentro de la lista" # PRUEBAS DE LA FUNC...
import torch def IntTensor(values, device='cuda:0'): """ Returns a Tensor of type torch.int containing the given values Parameters ---------- values : list the values of the tensor device : str the device to store the tensor to Returns ------- Tensor an in...
#!/usr/bin/env python2.7 # -*- coding: utf-8 -*- # region header ''' This module provides an easy way to compile, run and clean up a various \ number of scripts. ''' # # python3.5 # # pass from __future__ import absolute_import, division, print_function, \ unicode_literals # # ''' For conventions se...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ class implementations for real-time 3D feature extraction """ from abc import abstractmethod import pandas as pd import os import glob import numpy as np from tensorflow.keras import layers as L from tensorflow import keras from tomo_encoders.neural_nets.Unet3D impo...
from django.conf import settings from rest_framework.routers import DefaultRouter, SimpleRouter from itez.users.api.views import UserViewSet from itez.beneficiary.api.views import ( ProvinceAPIView, DistrictAPIView, ServiceAreaAPIView, WorkDetailAPIView ) if settings.DEBUG: router = DefaultRouter(...
import argparse from collections import defaultdict from pysam import VariantFile import numpy as np import matplotlib.pyplot as plt import seaborn as sns def plot_distributions(vafs, true_vafs, false_vafs): sns.set(rc={"figure.figsize": (20, 10)}) sns.set_style("white") # plt.hist(vafs, bins=100, color='...
import contextlib import os import shutil import tempfile import unittest from pikos.recorders.csv_file_recorder import CSVFileRecorder from pikos.recorders.abstract_recorder import RecorderError from pikos.tests.compat import TestCase from pikos.tests.dummy_record import DummyRecord class TestCSVFileRecorder(TestCa...
import socket import sys import time import os EMPTY_MESSAGE = "" # Клиентские команды COMMAND_JOIN = "/join" COMMAND_QUIT = "/quit" COMMAND_RENAME = "/rename" COMMAND_SEARCH = "/search" # Общие команды COMMAND_HELP = "/help" COMMAND_SHUTDOWN = "/shutdown" COMMAND_WHO = "/who" # Клиентские кома...
learning_python = __import__('learning_python')
from django.apps import AppConfig class RecipeAppConfig(AppConfig): name = 'recipe_app'
class ArgErrorType(Exception): """Raised when provided argument is of unsupported type.""" pass class UnreadableFileError(Exception): """Raised when pydicom cannot read provided file.""" pass
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # 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 applica...
import cv2 def get_image_data(filename): # Read file input img = cv2.imread(filename) # Create output list (length, width) image_data = (img.shape[1], img.shape[0]) return image_data
from .LiteralNode import LiteralNode class IntegerLiteralNode(LiteralNode): def __init__(self,loc,ref,value): super().__init__(loc,ref) self._value = value def value(self): return self._value def _dump(self,dumper): dumper.print_member("type_node", self.type_node()...