content
stringlengths
5
1.05M
my_name = 'Zed A. Show' my_age = 35 # not a lie my_height = 74 # inches my_weight = 180 #lbs my_eyes = 'blue' my_teeth = 'white' my_hair = 'brown' print(f"Let's talk about {my_name}.") print(f"He's {my_height} inches tall.") print(f"He's {my_weight} pounds heavy.") print("Actually that's not too heavy.") print(f"He's ...
#!/usr/bin/env python from PyQt4 import QtGui from PyQt4 import QtCore from PyQt4 import Qt import PyQt4.Qwt5 as Qwt import os class Relay_Frame_Vertical(QtGui.QFrame): def __init__(self, cfg): super(Relay_Frame_Vertical, self).__init__() #self.parent = parent self.rel_idx = cfg['idx'] ...
class WorldObject(object): def __init__(self): self.is_player = False self.is_crate = False self.is_wall = False self.is_goal = False def is_empty(self): return (not self.is_player) and (not self.is_crate) and (not self.is_wall) and (not self.is_goal) class World(objec...
# Crie um programa que leia quanto dinheiro uma pessoa tem na carteira. # E mostre quantos dólares ela pode comprar. r = float(input('Quantos R$ você tem na carteira ? ')) d = r / 3.27 print(f'Com R${r:.2f} você pode comprar US${d:.2f}')
import logging import unittest from unittest.mock import Mock from MyPiEye.Storage import S3Storage from MyPiEye.CLI import load_config logging.basicConfig(level=logging.INFO) class S3Tests(unittest.TestCase): def test_upload(self): config = load_config(Mock(), Mock(), 'D:\\Data\\projects\\python\\tmp\\...
def function(): foo = 1 gen_expr = (bar for bar in xrange(10)) print foo
def reverse_string(str1): return str1[::-1] def capitalize_string(str1): return str1.capitalize()
from utop.pane import PaneSet, Pane from utop.views.footer import Footer as FooterView from utop.views.header import Header as HeaderView from utop.views.content import Content as ContentView class DefaultPaneSet(PaneSet): def set_panes(self): stdscr = self.model.stdscr maxx = self.model.maxx ...
#!/usr/bin/env python # In[11]: # OBJECTS AS A METAPHOR from datetime import date today = date(2011, 9, 2) str(date(2011, 12, 2) - today) today.year today.strftime("%A, %B %d") # Objects, class, instances ofclass, attributes, # methods (function valued attributes),behaviour and information. # Dot notation-combined...
"""Tests for `osxphotos exiftool` command.""" import glob import json import os import pytest from click.testing import CliRunner from osxphotos.cli.exiftool_cli import exiftool from osxphotos.cli.export import export from osxphotos.exiftool import ExifTool, get_exiftool_path from .test_cli import CLI_EXIFTOOL, PHO...
from django.core.exceptions import ImproperlyConfigured from django.test.utils import override_settings from django.urls import NoReverseMatch from django_hosts.resolvers import (get_host, get_host_patterns, get_hostconf, get_hostconf_module, reverse, reverse_host) from .base impor...
from .simple_pick_and_place import SimplePickAndPlace from .machine_blocking_process import MachineBlockingProcess from .close_gripper import CloseGripper from .initialize import Initialize from .open_gripper import OpenGripper
""" """ CASSANDRA_1 = "192.168.59.103" CASSANDRA_KEYSPACE = "test" NUMBER_OF_NODES = 1 PROVIDERS = [ 'dataone', 'arxiv_oai', 'crossref', 'pubmed', 'figshare', 'scitech', 'clinicaltrials', 'plos', 'mit', 'vtech', 'cmu', 'columbia', 'calpoly', 'opensiuc', '...
#!/usr/bin/env python # coding: utf-8 # # # Tutorial 1: "What" models # __Content creators:__ Matt Laporte, Byron Galbraith, Konrad Kording # # __Content reviewers:__ Dalin Guo, Aishwarya Balwani, Madineh Sarvestani, Maryam Vaziri-Pashkam, Michael Waskom # # We would like to acknowledge [Steinmetz _et al._ (2019)]...
import math import numpy as np import string import json import os import sys import logging import boto3 import nltk from dotenv import load_dotenv from nltk.corpus import stopwords from fastprogress.fastprogress import progress_bar from nltk.tokenize import word_tokenize from tensorflow.keras.models import Sequentia...
from django.shortcuts import render from django.conf import settings import jwt, requests from .models import User from rest_framework.views import APIView from rest_framework.response import Response from rest_framework import status, serializers from rest_framework import permissions, generics from .serializers impor...
#!/usr/bin/python3 # coding: utf-8 """ This module is to download subtitle from Disney+ """ import re import os import logging import shutil from common.utils import Platform, get_locale, http_request, HTTPMethod, download_files from common.subtitle import convert_subtitle, merge_subtitle_fragments from services.serv...
# Copyright 2021 Uday Vidyadharan # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wri...
# coding=utf-8 """ Core Commands plugin for DecoraterBot. """ import traceback import time import discord from discord.ext import commands from DecoraterBotUtils.BotErrors import CogUnloadError from DecoraterBotUtils.utils import * class CoreCommands: """ Core Commands class for DecoraterBot. """ def...
#!opt/anaconda3/bin/python python # -*- coding: utf-8 -*- from os import listdir from os.path import isfile from posixpath import join import numpy as np from scipy.io.wavfile import write from systems.cubic_map import cubic_map from systems.cyclostationary import cyclostationary from systems.freitas import freitas fr...
import logging from django.conf import settings from django.db import transaction from django.contrib.auth.models import User, Group, ContentType from django.core.exceptions import PermissionDenied from django.http import HttpRequest, HttpResponseRedirect, HttpResponse, \ HttpResponseForbidden, HttpResponseNotFoun...
#!/usr/bin/env python3 import argparse import os.path import sys import pandas as pd import pyshark from scapy.utils import RawPcapReader from scapy.layers.l2 import Ether from scapy.layers.inet import IP, UDP, TCP from tqdm import tqdm #-------------------------------------------------- def render_csv_row(pkt_sh, pk...
#!/usr/bin/env python # -*- coding: utf-8 -*- import logging as loggers import numpy as np import theano from deepy.utils import UniformInitializer from deepy.core.env import env from deepy.core.tensor_conversion import neural_computation_prefer_tensor, convert_to_theano_var logging = loggers.getLogger("deepy") c...
"""VerbCL Elastic.""" import multiprocessing from typing import Any from typing import List from elasticsearch_dsl import analyzer from elasticsearch_dsl import Boolean from elasticsearch_dsl import connections from elasticsearch_dsl import Document from elasticsearch_dsl import Float from elasticsearch_dsl import Int...
import tensorflow as tf from absl import app from absl import flags import urllib.request from tqdm import tqdm import json import tarfile import os print("Path at terminal when executing this file") print(os.getcwd() + "\n") print("This file path, relative to os.getcwd()") print(__file__ + "\n") print("This file fu...
# Copyright 2004-present Facebook. All rights reserved. # pyre-unsafe import functools import glob import json import logging import os import subprocess import sys import tempfile import threading from collections import namedtuple from json.decoder import JSONDecodeError from logging import Logger from typing impo...
import logging import random import pickle import bz2 import _pickle as cPickle import praw import sklearn from fastapi import APIRouter import pandas as pd from pydantic import BaseModel, Field, validator log = logging.getLogger(__name__) router = APIRouter() class Item(BaseModel): """Use this data model to pa...
#!/usr/bin/env python #coding=utf-8 ############################################### # File Name: p_feature.py # Author: Junliang Guo@USTC # Email: guojunll@mail.ustc.edu.cn ############################################### import sys from scipy import sparse as sp from scipy import io as sio import numpy as np from io i...
""" - (main_strat_random.py) """ from time import sleep from datetime import date from random import randrange from tda.client import synchronous from decimal import Decimal, setcontext, BasicContext # slowly converting everyting to the new API from z_art.progress_report.api_progress_report import report_config from...
import path_magic import unittest import os from function_space import FunctionSpace from mesh import CrazyMesh import numpy as np import numpy.testing as npt from inner_product import inner from forms import Form, ExtGaussForm_0 import matplotlib.pyplot as plt from basis_forms import BasisForm def func(x, y): re...
#!/usr/bin/python3 # Example line: Step A must be finished before step L can begin. edges = [(ord(x[1]) - ord('A'), ord(x[7]) - ord('A')) for x in map(lambda x: x.split(), open('input.in').readlines())] workers = 5 for e in edges: print('{} → {}'.format(chr(ord('A') + e[0]),chr(ord('A') + e[1]))) class Node(object)...
### Place holder ###
''' Queries current running WAS stats and saves them to a file (C) 2015 Alex Ivkin Run using the following command: wsadmin.[bat|sh] -lang jython -user wsadmin -password wsadmin -f collectWASPerformanceStats.py <stats_file> [-l] You can omit -user and -password. wsadmin is in \Program Files\IBM\WebSphere\AppServer\bi...
# Copyright (c) 2016, # # Author(s): Henko Aantjes, # # Date: 28/07/2016 ...
#数据导出 也可以使用terminal 直接运行 from scrapy import cmdline #数据导出到json # cmdline.execute('scrapy crawl douban_spider -o output.json'.split()) #数据导出到csv格式 cmdline.execute('scrapy crawl douban_spider -o output.csv'.split())
# -*- coding: utf-8 -*- # # test_environments.py # # purpose: Create a venv/conda env based on the given requirement file. # author: Filipe P. A. Fernandes # e-mail: ocefpaf@gmail # web: http://ocefpaf.github.io/ # created: 14-Aug-2014 # modified: Wed 20 Aug 2014 09:56:36 PM BRT # # obs: # import os import ...
# The following comments couldn't be translated into the new config version: #tauTo3MuOutputModuleAODSIM & import FWCore.ParameterSet.Config as cms # # HeavyFlavorAnalysis output modules # from HeavyFlavorAnalysis.Skimming.onia_OutputModules_cff import *
from typing import Any, List, Optional from fastapi.exceptions import RequestValidationError from fastapi.responses import UJSONResponse from pydantic import EnumError, EnumMemberError, StrRegexError from starlette.exceptions import HTTPException as StarletteHTTPException def parse_error(err: Any, field_names: List,...
# -*- coding: utf-8 -*- from typing import Any, Dict, List, Type from pyshacl.constraints.constraint_component import ConstraintComponent from pyshacl.constraints.core.cardinality_constraints import MaxCountConstraintComponent, MinCountConstraintComponent from pyshacl.constraints.core.logical_constraints import ( ...
import cv2 import Model import torch import torch.nn as nn import numpy as np from torchvision import datasets, transforms import matplotlib.pyplot as plt import glob import random import math dir_list = glob.glob('dataset/train/*.png') tran = transforms.ToTensor() net = Model.DNCNN(1, 64, 3) net = net.float() ...
import logging import os import subprocess repo_url = os.environ.get("TIMESERIES_SERVER_REPO") # sqlite_path = os.environ.get("TIMESERIES_SERVER_DATA_DIR") # NOT FULL FILENAME # os.makedirs(sqlite_path, exist_ok=True) local_repo_path = os.environ.get("TIMESERIES_SERVER_REPO_PATH") os.makedirs(os.path.dirname(local_re...
import cudamat_ext as cm import GPULock GPULock.GetGPULock() cm.cublas_init() cm.CUDAMatrix.init_random() import numpy as np import datetime, time def test_softmax(): m = 2000 n = 128 data = np.random.randn(m, n) prob = data - data.max(axis=0).reshape(1,-1) prob = np.exp(prob) / np.exp(prob).sum(...
import logging import copy import torch from torch import nn class MyEmbeddings(nn.Embedding): def __init__(self, word_to_idx, embedding_dim): super(MyEmbeddings, self).__init__(len(word_to_idx), embedding_dim) self.embedding_dim = embedding_dim self.vocab_size = len(word_to_idx) s...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ /*************************************************************************** OSGeo4Mac Python startup script for setting env vars in dev builds and installs of QGIS when built off dependencies from homebrew-osgeo4mac tap -----------------...
""" Utility routines for the maximum entropy module. Most of them are either Python replacements for the corresponding Fortran routines or wrappers around matrices to allow the maxent module to manipulate ndarrays, scipy sparse matrices, and PySparse matrices a common interface. Perhaps the logsumexp() function belon...
from datetime import date class TableItem(object): tableItemNr = 0 tableItemDate = date.today() tableItemMaxNumCategories = 1 tableItemCategoriesAmount = [] tableItemAmount = 0.0 def __init__(self): self.tableItemCategoriesAmount = [] def setNr(self, nr): self....
""" r6satus-python Extract player data of Rainbow six siege. """ import json import sys import asyncio import r6sapi from pymongo import MongoClient import datetime OperatorTypes = { "DOC": "Defense", "TWITCH": "Attack", "ASH": "Attack", "THERMITE": "Attack", "BLITZ": "Attack", "BUCK": ...
n = int(input()) k = int(input()) minX = 1 maxX = n*n ans = 0 while minX <= maxX: midX = (minX + maxX) // 2 cnt = 0 for i in range(1, n+1): cnt += min([midX//i, n]) if cnt >= k: ans = midX maxX = midX - 1 else: minX = midX + 1 print(ans)
import os import __main__ _MAIN_FILE =__main__.__file__ _MAIN_DIR = os.path.dirname(_MAIN_FILE) _MAIN_FILE_NO_EXT = os.path.splitext(os.path.basename(_MAIN_FILE))[0] INPUT_DATA = [] with open(f"{_MAIN_DIR}/../input/{_MAIN_FILE_NO_EXT}.txt", 'r') as inputFile: INPUT_DATA = [x.rstrip() for x in input...
# global import jax import jax.numpy as jnp from typing import Optional # local import ivy from ivy.functional.backends.jax import JaxArray def bitwise_left_shift(x1: JaxArray, x2: JaxArray, out: Optional[JaxArray] = None)\ -> JaxArray: if isinstance(x2, int)...
# # @lc app=leetcode id=82 lang=python3 # # [82] Remove Duplicates from Sorted List II # # https://leetcode.com/problems/remove-duplicates-from-sorted-list-ii/description/ # # algorithms # Medium (39.04%) # Likes: 2704 # Dislikes: 122 # Total Accepted: 317.3K # Total Submissions: 807.9K # Testcase Example: '[1,2...
import factory from brouwers.kits.tests.factories import ModelKitFactory from brouwers.users.tests.factories import UserFactory from ..models import ( KitReview, KitReviewProperty, KitReviewPropertyRating, KitReviewVote ) class KitReviewFactory(factory.django.DjangoModelFactory): model_kit = factory.SubFact...
import unittest from python.src import utils class test_utils(unittest.TestCase): def test_add(self): self.assertEqual(5, utils.add(2,3)) def test_divide(self): self.assertEqual(2, utils.divide(4,2)) class Test_Calculator(unittest.TestCase): def test_add(self): self.assertEqual(5, utils.Calcu...
#!./bin/python # ---------------------------------------------------------------------- # Compile handlebars templates # ---------------------------------------------------------------------- # Copyright (C) 2007-2019 The NOC Project # See LICENSE for details # ----------------------------------------------------------...
from flask import current_app as app, render_template, render_template_string, request, redirect, abort, jsonify, json as json_mod, url_for, session, Blueprint, Response from CTFd.utils import authed, ip2long, long2ip, is_setup, validate_url, get_config, set_config, sha512, get_ip, cache, is_on_team from CTFd.models im...
import tensorflow as tf import numpy as np import fileinput import gzip vocab = {"": 0} def read_data(file_name, n): data = [] finput = fileinput.input(file_name, openhook=gzip.open) i = 0 for line in finput: line = line.decode() elems = line.strip().split("\t") if len(elems) =...
#!/usr/bin/env python # coding: utf-8 # # Welcome to M-LSD demo # # In this demo, you can simply run line segment detection and box detection with our M-LSD models. # # Thanks to [gradio](https://gradio.app/), this demo is interactive! # # - For the line segment detection demo: Launch line segment detection with M-...
# emacs: -*- mode: python; py-indent-offset: 4; tab-width: 4; indent-tabs-mode: nil -*- # ex: set sts=4 ts=4 sw=4 et: # ## ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ## # # See COPYING file distributed along with the datalad package for the # copyright and license terms. # # ## ### ### ...
n1 = float(input('Diga a primeira nota: ')) while n1 < 0 or n1 > 10: n1 = float(input('Valor inválido, por favor digite outro: ')) n2 = float(input('Diga a segunda nota: ')) while n2 < 0 or n2 > 10: n2 = float(input('Valor inválido, por favor digite outro: ')) med = (n1+n2)/2 if med < 5.0: print('Sua média ...
import argparse import sys from os.path import dirname, join, realpath import tables sys.path.insert(0, realpath(join(dirname(__file__), '../..'))) from base.config_loader import ConfigLoader from base.data.data_table import COLUMN_MOUSE_ID, COLUMN_LABEL def parse(): parser = argparse.ArgumentParser(descriptio...
import runway import keras_ocr import numpy as np @runway.setup def setup(): return keras_ocr.pipeline.Pipeline() @runway.command('recognize', inputs={'image': runway.image}, outputs={'bboxes': runway.array(runway.image_bounding_box), 'labels': runway.array(runway.text)}) def recognize(model, inputs): width...
import functools from gaphas.view import GtkView from gi.repository import Gdk, GLib, Gtk from gaphor.core import Transaction from gaphor.core.modeling import Presentation def shortcut_tool(view, modeling_language, event_manager): ctrl = Gtk.EventControllerKey.new(view) ctrl.connect("key-pressed", on_delete...
""" Given a reference to the head node of a singly-linked list, write a function that reverses the linked list in place. The function should return the new head of the reversed list. In order to do this in O(1) space (in-place), you cannot make a new list, you need to use the existing nodes. In order to do this in O(...
from django.conf import settings from django.conf.urls.static import static from django.http import HttpResponse from django.urls import include, path from django.utils.translation import ugettext from django.views.decorators.csrf import csrf_exempt from helusers.admin_site import admin from common.utils import get_ap...
from mock import patch from pysparkling import Context from jobs.wordcount import analyze @patch('jobs.wordcount.WordCountJobContext.initalize_counter') @patch('jobs.wordcount.WordCountJobContext.inc_counter') def test_wordcount_analyze(_, __): result = analyze(Context()) assert len(result) == 327 assert r...
from setuptools import setup, find_packages VERSION='0.1' long_description='A tool that stores AWS events from a resource to elastic search.' packages=[ 'elasticevents', ] install_requires=[ 'boto3', 'click', ] def main(): setup_info = dict( name='Elasticevents', version=VERSION, ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Copyright 2020 by Murray Altheim. All rights reserved. This file is part of # the Robot OS project and is released under the "Apache Licence, Version 2.0". # Please see the LICENSE file included as part of this package. # # author: altheim # created: 2020-01-18 # mo...
import logging from .File import File from .Profile import Profile from .Root import Root from .session import * logging.basicConfig(format='%(levelname)s: %(message)s', level=logging.INFO)
""" test_terminal ~~~~~~~~~~~~~~~~ """ import unittest from domonic.decorators import silence from domonic.terminal import * class TestCase(unittest.TestCase): def test_bash_ls(self): files = ls() # print(files) assert "domonic" in files # return self.assertIn("do...
# Generated by Django 3.2 on 2021-08-28 20:31 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ('payment', '0001_initial'), ] operations = [ migrations.CreateModel( name='Ord...
# Copyright 2019 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
"""Functions for safely printing in parallel.""" try: import horovod.torch as hvd except ModuleNotFoundError: pass use_horovod = False def set_horovod_status(new_value): """ Set the horovod status for printing. By setting the horovod status via this function it can be ensured that printing w...
# -*- coding: utf-8 -*- u"""Jupyterhub login :copyright: Copyright (c) 2020 RadiaSoft LLC. All Rights Reserved. :license: http://www.apache.org/licenses/LICENSE-2.0.html """ from __future__ import absolute_import, division, print_function from pykern import pkconfig from pykern.pkcollections import PKDict from pykern...
#!/usr/bin/env python import docker import json import os import uuid from esbulkstream import Documents def main(): cwd = os.getcwd() docker_client = docker.from_env() es = Documents('sbom') with open("top-containers.json") as fh: container_names = json.load(fh)['containers'] for c i...
''' Code for JAX implementations presented in: Enabling Fast Differentially Private SGD via Just-in-Time Compilation and Vectorization ''' import itertools import time from functools import partial import haiku as hk import jax import jax.numpy as jnp import numpy as np from jax import grad, jit, random, vmap from ja...
""" Preprocessing of the Fichier Canadien des Éléments Nutritifs (FCEN) data before using it to characterize OFF ingredients """ import os import pandas as pd import json from ingredients_characterization.vars import FCEN_DATA_DIR, FCEN_NUTRIMENTS_TO_OFF, FCEN_DATA_FILEPATH # Reading data from FCEN food_names = pd.r...
from landscapemodel import * from plots import * def ABtest(comparison,path,species=1,tmax=100,tshow=(0,-1),**kwargs): """A/B testing: plot results side-by-side for sets of options in comparison""" path=Path(path).mkdir() prm=deepcopy(LandscapeModel.dft_prm) prm['species']=species prm['landx']=prm...
from requests import Session from requests.adapters import HTTPAdapter from urllib3 import Retry class RetrySession(Session): def __init__(self, retries=3, backoff_factor=0.5, status_forcelist=None): super().__init__() retry = Retry(total=retries, read=retries, backoff_factor=backoff_factor, statu...
#-*- coding: utf-8 -*- from django_town.utils import CaseLessDict from .errors import AccessDeniedError from django_town.utils import class_from_path from django_town.core.settings import OAUTH2_SETTINGS from django_town.oauth2.user import OAuth2User def authorization_from_django_request(request): return request...
from django.forms import ModelForm from .models import Student, Teacher, SchoolClass, Parent, Subject, Lesson from django import forms YEARS = (2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016) class AddStudentForm(ModelForm): second_name = forms.CharField(required=False) address...
#coding = utf-8 import unittest import requests from selenium import webdriver import json import re import time class modifiedPhoneNum(unittest.TestCase): def setUp(self): self.driver = webdriver.Chrome() self.driver.implicitly_wait(10.0) self.driver.maximize_window() self.loginNum...
from django.urls import path from . import views urlpatterns = [ path('<int:root>', views.index, name='index'), path('freshmen-groups', views.index, {"root": 5}, name='index'), path('subjects', views.index, {"root": 15}, name='index'), path('websites', views.website, {"root": 18}, name='website') ]
import os, glob papka_korpus = os.path.dirname(os.path.abspath(__file__)) papka_apertium = os.path.join(papka_korpus, "testApertium/") from tqdm import tqdm from time import monotonic, sleep from datetime import timedelta global_katolog = os.path.join(papka_korpus, "testbasictexts/") files = glob.glob(global_katolog+"...
#!/usr/bin/env python #from .core import * import numpy as np import pandas as pd import shutil import urllib import urlparse from os.path import splitext, basename import os import util from pprint import pprint import StringIO import db from core import * from IPython.core.debugger import Tracer class Term(UploadCs...
import click import gsextract.gse_parser as gse_parser @click.command() @click.argument('input_file', type=click.Path(exists=True)) @click.argument('output_file', type=click.Path()) @click.option('--stream/--no-stream', default=False, help='Stream continuously from the file. Use the --stream flag to dump to a pcap fro...
#!/usr/bin/env python # -*- coding:utf-8 -*- # author:pyy # datetime:2018/12/29 10:33 from peewee import ForeignKeyField, CharField, TextField, IntegerField, JOIN from Myforum.Forum.models import BaseModel from Myforum.apps.users.models import User class Question(BaseModel): user = ForeignKeyField(User, verbose_...
import io import os import numpy as np import tensorflow as tf from tensorflow.keras import layers from PIL import Image import flask from flask import send_file, abort from flask import jsonify, make_response from flask import request from flask_cors import CORS from pymemcache.client import base ...
#!/usr/bin/env python3 """Module containing the ParmedHMassRepartition class and the command line interface.""" import argparse import shutil, re from pathlib import Path, PurePath from biobb_common.generic.biobb_object import BiobbObject from biobb_common.configuration import settings from biobb_common.tools import ...
# Generated by Django 3.0.11 on 2020-12-28 08:18 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('users', '0001_initial'), ] operations = [ migrations.AddField( model_name='user', name='fav_color', fie...
""" """ import datetime from fastapi import params from fastapi import security import fastapi import sqlalchemy as sa import sqlalchemy.orm from rss_reader import models from rss_reader import security as rss_security from rss_reader.api import crud from rss_reader.api import deps from rss_reader.api import schemas ...
from __future__ import annotations from typing import Any, Dict, Optional import requests from ice3x.clients.abc import IceCubedClientBase from ice3x.decorators import add_nonce, requires_authentication class IceCubedSyncClient(IceCubedClientBase): def _fetch_resource( self, method: str, suffix: str, pa...
# Copyright (c) 2019, MD2K Center of Excellence # - Nasir Ali <nasir.ali08@gmail.com> # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above cop...
""" Unit tests for kindle_to_md.py | parse_json_file(). """ import pytest from kindle_to_md import parse_json_file from kindle_to_md import MisformattedKindleData @pytest.mark.usefixtures( 'file_paths' ) @pytest.mark.usefixtures( 'test_data' ) class TestParseJSONFile : def test_parse_good_book( self ) : ...
import pytest from DevOps import Sum from DevOps import Sub from DevOps import Mul from DevOps import Div def test_somar(): assert Sum(2,4)==6 def test_sub(): assert Sub(2,4)==-2 def test_mul(): assert Mul(2,4)==8 def test_div(): assert Div(2,4)==0.5
import argparse import sys # We need sys so that we can pass argv to QApplication import os import warnings import pandas as pd import petab.C as ptc import pyqtgraph as pg from PySide6 import QtWidgets, QtCore, QtGui from PySide6.QtWidgets import ( QVBoxLayout, QComboBox, QWidget, QLabel, QTreeView ) from petab ...
# -*- coding: utf-8 -*- """ spcconvert - batch conversion and webpage building for SPC images """ import cvtools import cv2 import os import sys import glob import time import datetime import json import shutil import math import tarfile from multiprocessing import Pool, Process, Queue from threading import Thread im...
import discord class administrator: def __init__(self, rankie, logging): self.__rankie = rankie self.__logging = logging # Attaches and sends managed_channels to a discord message async def get_log_file(self, ctx): try: await ctx.message.reply(file=discord.File(f'logs/ra...
import os from tqdm import trange import torch from torch.nn import functional as F from torch import distributions as dist from im2mesh.common import ( compute_iou, make_3d_grid, fix_K_camera, get_camera_args ) from im2mesh.utils import visualize as vis from im2mesh.training import BaseTrainer from im2mesh.onet.l...
import scipy.io as sio cats = ["Peace","Affection","Esteem","Anticipation","Engagement","Confidence","Happiness","Pleasure","Excitement","Surprise","Sympathy","Doubt/Confusion","Disconnection","Fatigue","Embarrassment","Yearning","Disapproval","Aversion","Annoyance","Anger","Sensitivity","Sadness","Disquietment","Fear...
from rest_framework import viewsets, permissions from api.permissions import IsOwner from updates.models import UpdateSubscription from updates.serializers import UpdateSubscriptionSerializer class UpdateSubscriptionViewSet(viewsets.ModelViewSet): """ API endpoints for subscription management """ ...