text
stringlengths
2
999k
# Copyright 2016 Google Inc. 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 applicable law or ...
# Copyright 2019 Robert Bosch GmbH # Copyright 2021 Christophe Bedard # # 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...
keys = [ [' ', ' ', '1', ' ', ' '], [' ', '2', '3', '4', ' '], ['5', '6', '7', '8', '9'], [' ', 'A', 'B', 'C', ' '], [' ', ' ', 'D', ' ', ' '] ] x = testX = 0 y = testY = 2 numbers = [] for line in open('input.txt', 'r'): for c in line: testX = x testY = y if c == 'U': testY = m...
import abc import attr import pandas as pd import numpy as np from sklearn.preprocessing import OneHotEncoder from sklearn.base import BaseEstimator from .data import TaskData, ColumnType from .dataset import VarType class Task(abc.ABC): @abc.abstractmethod def fit(self, data: TaskData): pass @...
import os basedir = os.path.abspath(os.path.dirname(__file__)) SQLALCHEMY_DATABASE_URI = 'sqlite:///{db_uri}'.format( db_uri=os.path.join(basedir, 'db', 'mergebot.db')) # TODO(jasonkuster): Configure migration. # SQLALCHEMY_MIGRATE_REPO = os.path.join(basedir, 'db_repository')
""" Django settings for ANGA_UTM project. Generated by 'django-admin startproject' using Django 1.11.3. For more information on this file, see https://docs.djangoproject.com/en/1.11/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.11/ref/settings/ """ import o...
from django.shortcuts import render,redirect from django.http import HttpResponse,HttpResponseRedirect from django.utils import timezone from django.urls import reverse from django.contrib.auth.models import User, auth from .models import Stock def home(request): if User.is_authenticated: Latest_Added_Stoc...
"""Views related to file management. StaticFile: - POST /file - GET /file/{file_id} - DELETE /file/{file_id} """ import logging import mimetypes import requests import werkzeug from flask import jsonify, request, current_app from flask_login import login_required, current_user from PIL import Image from sqlalchemy.e...
import time import matplotlib import matplotlib.pyplot as plt import pyaudio import numpy as np matplotlib.use('Agg') # https://stackoverflow.com/questions/7088672/pyaudio-working-but-spits-out-error-messages-each-time class Plotter: def __init__(self): self.count = 0 self.x = [] self.y ...
import logging import sys import traceback verbosity_to_logging_level = { 0: logging.CRITICAL, 1: logging.ERROR, 2: logging.WARNING, 3: logging.INFO, 4: logging.DEBUG, } def exception_handler(etype, value, tb): # Report to file logging.exception(''.join(traceback.format_exception(ety...
from django import forms from django.forms import ModelForm from django.contrib.auth.models import Group from todo.models import Item, List from django.contrib.auth import get_user_model class AddListForm(ModelForm): # The picklist showing allowable groups to which a new list can be added # determines which g...
""" Multiplicative symmetric functions A realization `h` of the ring of symmetric functions is multiplicative if for a partition `\lambda = (\lambda_1,\lambda_2,\ldots)` we have `h_\lambda = h_{\lambda_1} h_{\lambda_2} \cdots`. """ #***************************************************************************** # ...
# -*- coding: utf-8 -*- ''' Support for Alternatives system :codeauthor: Radek Rada <radek.rada@gmail.com> ''' from __future__ import absolute_import # Import python libs import os import logging # Import Salt libs import salt.utils # Import 3rd-party libs import salt.ext.six as six __outputter__ = { 'display...
from django.contrib import admin from django.contrib.auth.admin import UserAdmin as BaseUserAdmin from django.utils.translation import gettext as _ from core import models class UserAdmin(BaseUserAdmin): ordering = ['id'] list_display = ['email', 'name'] fieldsets = ( (None, {'fields': ('email', ...
import cv2 import time import os fullpath = os.path.join(cv2.data.haarcascades, 'haarcascade_frontalface_default.xml') face_cascade = cv2.CascadeClassifier(fullpath) cap = cv2.VideoCapture(0) while (True): #Reading frame from the live video feed ret, frame = cap.read() if not ret: print(...
""" To understand why this file is here, please read: http://cookiecutter-django.readthedocs.io/en/latest/faq.html#why-is-there-a-django-contrib-sites-directory-in-cookiecutter-django """ from django.conf import settings from django.db import migrations def update_site_forward(apps, schema_editor): """Set site d...
"""auto generate book_transaction table Revision ID: 2e2c34db1cf5 Revises: 856336fb4dfc Create Date: 2022-02-19 21:11:52.730614 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '2e2c34db1cf5' down_revision = '856336fb4dfc' branch_labels = None depends_on = None ...
# Copyright 2021 The Brax Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wri...
from crispy_forms.helper import FormHelper from crispy_forms.layout import Layout, HTML, Submit from django import forms from django.contrib.auth.mixins import LoginRequiredMixin from django.urls import reverse_lazy from django.views.generic import UpdateView from YtManagerApp.models import UserSettings class Settin...
import math import pytest import optuna from optuna.pruners import percentile from optuna.structs import StudyDirection from optuna.structs import TrialState from optuna import type_checking if type_checking.TYPE_CHECKING: from typing import List # NOQA from typing import Tuple # NOQA from optuna.stud...
# -*- coding: utf-8 -*- __author__ = "MJ (tsngmj@gmail.com)" __license__ = "Apache 2.0" # standard library from abc import ABC, abstractmethod # scip plugin from ribbon.loadbalancer.server_list_filter import ServerListFilter """ Interface that defines the methods sed to obtain the List of Servers """ # scip plugin...
# Copyright (c) 2021 PaddlePaddle 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 appli...
import asyncio import logging from typing import Any from airtouch3 import ( AirTouch3, AT3AcFanSpeed, AT3AcMode, AT3AcUnit, AT3Group, AT3GroupMode, ) from homeassistant.components.climate import ClimateEntity from homeassistant.components.climate.const import ( FAN_AUTO, FAN_DIFFUSE, ...
#Escreva uma programa que leia um valor em metros e o exiba convertido #em centimetros e milimetros
from kapi.api_resources.resume import Resume from kapi.api_resources.availability import Availability
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under t...
import glob import os import random _list = glob.glob('*help/*.wav') length = len(_list) validation_list = random.sample(_list, int(length*.8)) testing_list = list(set(_list) - set(validation_list)) with open('validation_list.txt', 'w') as f: for i in validation_list: f.write(i+'\n') f.close() ...
# Generated by Django 3.0.8 on 2020-08-10 19:26 import datetime from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('patient_app', '0001_initial'), ] operations = [ migrations.AlterField( model_name='booking_patient...
# encoding: utf-8 from flask import jsonify, request from application import app from application.models.window import Window from application.routes.widget import format_response_dict import json def _format_response_dict (record, rules = ('-widgets.windows',)): dictionary = record.to_dict(rules = rules) widge...
# # Copyright 2017 Quantopian, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wr...
from abc import abstractmethod, ABCMeta from rummy.player.player import Player from rummy.ui.view import View class PlayerController(metaclass=ABCMeta): @staticmethod @abstractmethod def show_start_turn(player: Player): pass @staticmethod @abstractmethod def show_end_turn(player: Pl...
import logging __version__ = "0.1.3" logging.getLogger(__name__).addHandler(logging.NullHandler())
import os from pathlib import Path import logging DATA_DIR = "data" PROCESSED_DATA_DIR = "processed" OUTPUT_DATA_DIR = "output" project_dir = Path(__file__).resolve().parents[1] data_dir = os.path.join(project_dir, DATA_DIR) processed_data_dir = os.path.join(data_dir, PROCESSED_DATA_DIR) output_data_dir = os.path.jo...
import unittest.mock as mock from django.contrib.auth.models import AnonymousUser, Group, User from django.test import TestCase from rest_access_policy import AccessPolicy, AccessPolicyException from rest_framework.decorators import api_view from rest_framework.viewsets import ModelViewSet class FakeRequest(object):...
"""Support for skip/xfail functions and markers.""" import os import platform import sys import traceback from collections.abc import Mapping from typing import Generator from typing import Optional from typing import Tuple from typing import Type import attr from _pytest.config import Config from _pytest.config impo...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright (c) 2019 Huawei Technologies Co., Ltd. # A-Tune is licensed under the Mulan PSL v2. # You can use this software according to the terms and conditions of the Mulan PSL v2. # You may obtain a copy of Mulan PSL v2 at: # http://license.coscl.org.cn/MulanPSL2 # ...
from pythonforandroid.recipe import PythonRecipe class RequestsRecipe(PythonRecipe): version = '2.13.0' url = 'https://github.com/kennethreitz/requests/archive/v{version}.tar.gz' depends = [('hostpython2', 'hostpython3crystax'), 'setuptools'] site_packages_name = 'requests' call_hostpython_via_tar...
import json import random import string import sys import copy MAXTRY = 6 UNKNOWN = 0 NOTUSED = 1 WRONG_PLACE = 2 MATCHED = 3 FAIL = -1 answers_2022 = [ 'rebus','boost','truss','siege','tiger','banal','slump','crank','gorge','query', 'drink','favor','abbey','tangy','panic','solar','shire','proxy','point', 'robot','...
# encoding: utf-8 ''' @author: Minghao Guo @contact: mh.guo0111@gmail.com @software: nef @file: crystal_to_id.py @date: 6/14/2019 @desc: ''' import numpy as np from srfnef import nef_class from srfnef.geometry import PetEcatScanner @nef_class class CrystalToId: def __call__(self, crystal_pos: np.ndarray, scanner...
from collections import deque from dagster import check from dagster.core.definitions.resource import ScopedResourcesBuilder from dagster.core.errors import ( DagsterInvariantViolationError, DagsterResourceFunctionError, DagsterUserCodeExecutionError, user_code_error_boundary, ) from dagster.core.event...
def foo(): a = 5 return 10 + a def bar(): a = 1e6 return a / 5.0 def tests(): assert foo() == 15 assert bar() == 2e5 tests() if hasattr(foo, "__jit__"): print("Has jit") foo.__jit__() tests()
expected_output = { 'total_tunnels': 1, 'sessions': 16, 'tunnels' : { 1: { 'loc_tunnel_id': 11367, 'rem_tunnel_id': 26859, 'remote_name': "LAC", 'state': "est", 'remote_address': "99.1.1.1", 'l2tp_class': "airtel" } ...
import unittest import torch import tqdm from torchvision import transforms as torch_transforms from pytorch_adapt.datasets import MNISTM from pytorch_adapt.utils.constants import IMAGENET_MEAN, IMAGENET_STD from .. import DATASET_FOLDER, RUN_DATASET_TESTS from .utils import skip_reason class TestMNISTM(unittest.T...
#!/usr/bin/env python # -*- coding: utf-8 -*- # dicomparser.py """Class that parses and returns formatted DICOM RT data.""" # Copyright (c) 2009-2016 Aditya Panchal # Copyright (c) 2009-2010 Roy Keyes # This file is part of dicompyler-core, released under a BSD license. # See the file license.txt included with this ...
class wrongpath(BaseException): pass raise Exception("provided path is wrong")
"""@package model_minimizer Model minimizer method to solve the trust-region subproblem. """ import numpy as np from numpy import linalg as la from .posdef_check import posdef_check TOL = np.sqrt(np.finfo(float).eps) def h_lambda(evals, evecs, lam): """ Returns the positive definite H by adding a factor of the ...
"""Rasterio's GDAL/AWS environment""" from contextlib import ExitStack from functools import wraps, total_ordering from inspect import getfullargspec as getargspec import logging import os import re import threading import warnings import attr import rasterio._loading with rasterio._loading.add_gdal_dll_directories(...
from pytorch_classification.utils import Bar, AverageMeter import multiprocessing as mp import numpy as np import time, copy from utils import * class Arena(): """ An Arena class where any 2 agents can be pit against each other. """ def __init__(self, player1, player2, game, display=None, num_workers=1...
from __future__ import print_function from __future__ import division from . import _C import numpy as np ################################################################################################################################################### def get_random_time_mesh(ti, tf, min_dt): if tf<=ti: return ...
import itertools import random import sys from .buildNPC4 import BuildNPC4 from ..utility.find_best_match import find_best_match from .careers4 import Careers4 from ...data import bot_char_dat ## From Archives of the Empire # ['Reiklander','Dwarf','Halfling','High Elf','Wood Elf','Gnome','Nordlander','Middenheimer',...
#!/usr/bin/env python # encoding: utf-8 # # Copyright (c) 2009 Doug Hellmann All rights reserved. # """ """ #end_pymotw_header import resource print 'Resource limits (soft/hard):' for name, desc in [ ('RLIMIT_CORE', 'core file size'), ('RLIMIT_CPU', 'CPU time'), ('RLIMIT_FSIZE', 'file size'), ('RLIMI...
from trainer import * from vae_model import VAE from data import * from samples import * model = VAE(vocab,vector).to(device) fit(model, train_data) model.eval() sample = sample.take_samples(model,n_batch) print(sample)
""" Copyright (c) Contributors to the Open 3D Engine Project. For complete copyright and license terms please see the LICENSE at the root of this distribution. SPDX-License-Identifier: Apache-2.0 OR MIT Test case ID : C4982800 Test Case Title : Verify that the shape Sphere can be selected from the drop downlist and t...
# 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 applicable law or agreed to in...
# Copyright 2012 OpenStack Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in...
''' Segment out pocket shapes from top ranked pockets ''' import torch import torch.nn as nn from unet import Unet import numpy as np import logging import argparse import wandb import sys import os import molgrid from skimage.morphology import binary_dilation from skimage.morphology import cube from skimage.morphology...
# Foremast - Pipeline Tooling # # Copyright 2018 Gogo, 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required...
# Generated by Django 2.1.5 on 2021-08-18 12:39 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('core', '0001_initial'), ] operations = [ migrations.CreateModel( name='UnitCharge', ...
# # Dynamic virtualization provider framework # # Individual virtualization providers are defined in modules within this directory inheriting # Provider class and replacing or augmenting its methods (most commonly, transform) # import platform import subprocess import os import typing # Related modules from box impor...
import numpy import ruamel.yaml as ry from dolo.misc.display import read_file_or_url import yaml def yaml_import(fname, check=True, check_only=False): txt = read_file_or_url(fname) if check: from dolo.linter import lint output = lint(txt) if len(output) > 0: print(output...
# Copyright 2021 VMware, Inc. # SPDX-License-Identifier: Apache-2.0 import logging from unittest.mock import MagicMock import pytest from vdk.api.plugin.connection_hook_spec import ( ConnectionHookSpec, ) from vdk.internal.builtin_plugins.connection.connection_hooks import ( ConnectionHookSpecFactory, ) from v...
import matplotlib.pyplot as plt from matplotlib import path import numpy as np from scipy.optimize import least_squares import matplotlib.patches as patches import cv2 import hylite from hylite.reference.features import HyFeature from hylite import HyData from hylite.project import pix_to_ray_pano, pix_to_ray_persp ...
# -*- coding: utf-8 -*- # Copyright (C) 2008-2017, Luis Pedro Coelho <luis@luispedro.org> # vim: set ts=4 sts=4 sw=4 expandtab smartindent: # # 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...
from django.db import models from project.store.models.abstracts import TimeStampedModel from project.store.models import User, Book class Cart(TimeStampedModel): """database table for cart""" user = models.OneToOneField(User, on_delete=models.CASCADE) items = models.ManyToManyField('CartItem') def ...
from niaaml_gui import __version__ def test_version(): assert __version__ == '0.1.0'
import pyaf.Bench.TS_datasets as tsds import tests.artificial.process_artificial_dataset as art art.process_dataset(N = 128 , FREQ = 'D', seed = 0, trendtype = "LinearTrend", cycle_length = 0, transform = "BoxCox", sigma = 0.0, exog_count = 100, ar_order = 12);
def read_user(string): """ str -> dict """ parts = string.split() d = {'first': parts[0], 'last': parts[1], 'custId': parts[3], 'username': parts[5], 'password': parts[7]} return (d) def read_users(string): """ str -> list[dict] """ user_strings = string.spl...
# -*- coding: utf-8 -*- """ ramlient ~~~~~~~~ Access to a RAML API done right, in Python. :copyright: (c) 2017 by Timo Furrer <tuxtimo@gmail.com> :license: MIT, see LICENSE for more details. """ import ast import os import sys import codecs from setuptools import setup, find_packages # These py...
""" Upwork OAuth1 backend """ from .oauth import BaseOAuth1 class UpworkOAuth(BaseOAuth1): """Upwork OAuth authentication backend""" name = 'upwork' ID_KEY = 'id' AUTHORIZATION_URL = 'https://www.upwork.com/services/api/auth' REQUEST_TOKEN_URL = 'https://www.upwork.com/api/auth/v1/oauth/token/requ...
#### NOTICE: THIS FILE IS AUTOGENERATED #### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY #### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES from swgpy.object import * def create(kernel): result = Tangible() result.template = "object/tangible/furniture/modern/shared_bar_piece_curve_s2.iff" result.attribute_te...
""" Installs the required modules for the tools to work properly. """ import os from os.path import dirname from ec.utils import get from ec.types.basics import yn def main(): # from: http://stackoverflow.com/questions/12966147/how-can-i-install-python-modules-programmatically-through-a-python-script if not get(des...
import sys from collections import defaultdict comps = sys.argv[1:-1] output = sys.argv[-1] comp = defaultdict(lambda: [0 for x in range(len(comps))]) for i, file in enumerate(comps): with open(file) as inp: for line in inp: transcript = line.strip() comp[transcript][i...
__version__ = '0.0.21'
from fabric.api import local from fabric.api import put from fabric.api import task from fabric.api import execute from flask_frozen import Freezer from main import app HOST = "cardinal.stanford.edu" @task def freeze(): print("Building static version of app...") freezer = Freezer(app) freezer.freeze() print("Free...
import requests import urllib.parse from dataclasses import dataclass from itertools import chain from .geography import Geography, _search_geography from .group import Group, _search_groups from .variable import Variable, _search_variables from .utils import * from typing import List, Optional, Tuple @dataclass cla...
import datetime from django.db import DEFAULT_DB_ALIAS from django.test import TestCase from django.utils import tzinfo from models import Donut, RumBaba from django.conf import settings class DataTypesTestCase(TestCase): def test_boolean_type(self): d = Donut(name='Apple Fritter') self.assertFal...
import os import sys import pyNastran from pyNastran.utils import check_path from pyNastran.utils.arg_handling import argparse_to_dict, swap_key, update_message #from gui.formats import format_string if sys.version_info < (3, 7): # pragma: no cover sys.exit("requires Python 3.7+...") SUPPORT_MULTIMODEL = False...
class ReturnStatus(object): def __init__(self, status, reason, message): self.status = status self.reason = reason self.message = message
import os import pytest pa = pytest.importorskip("pyarrow") pd = pytest.importorskip("pandas") import numpy as np # noqa import pandas.util.testing as tm # noqa from pymapd._parsers import _load_schema, _load_data # noqa HERE = os.path.dirname(__file__) def make_data_batch(): arrow_version = pa.__version__ ...
"""Training utilities.""" import os from typing import Any, Dict, Union import pytorch_lightning as pl import torch from loguru import logger from pytorch_lightning.callbacks.base import Callback from pytorch_lightning.callbacks.early_stopping import EarlyStopping from pytorch_lightning.callbacks.model_checkpoint impo...
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
from .svg import rename_ids from tempfile import TemporaryDirectory import subprocess import os import hashlib import lxml.etree as et def render_latex(text): args = ("/usr/bin/pdflatex", "-interaction=batchmode", "content.tex") with TemporaryDirectory(prefix="elphie-") as wdir: ...
from marshmallow import ValidationError, missing from .abstract import BaseDataObject from .exceptions import FieldNotLoadedError, UnknownFieldInDBError from .i18n import gettext as _ __all__ = ('data_proxy_factory', 'missing') class BaseDataProxy: __slots__ = ('not_loaded_fields', '_data', '_modified_data', ...
# O(n^2) solution import sys def best_profit(prices): maxi = - sys.maxsize for i in range(len(prices)-1): for j in range(i+1, len(prices)): profit = prices[j] - prices[i] if profit > maxi: maxi = profit return maxi if __name__ == "__main__": prices...
"""Disassembler of Python byte code into mnemonics.""" import sys import types import collections import io from opcode import * from opcode import __all__ as _opcodes_all __all__ = ["code_info", "dis", "disassemble", "distb", "disco", "findlinestarts", "findlabels", "show_code", "g...
# coding=utf-8 from requests import HTTPError from ..base import BitbucketCloudBase from .projects import Projects from ..repositories import WorkspaceRepositories class Workspaces(BitbucketCloudBase): def __init__(self, url, *args, **kwargs): super(Workspaces, self).__init__(url, *args, **kwargs) ...
lista = [] while True: lista.append(input('informe para colocar em ordem alfabetica ')) sair = int(input('deseja continuar se sim pressione 0 se não 1 ')) lista.sort() if sair == 1: break print(lista)
import pytest from contextlib import contextmanager from uuid import uuid4 from hashlib import md5 from celery_singleton.backends.redis import RedisBackend from celery_singleton.backends import get_backend from celery_singleton import backends def random_hash(): return "SINGLETON_TEST_KEY_PREFIX_" + md5(uuid4()....
#!/usr/bin/env python3 # -*- coding: utf-8 -*- from nodal.core.nodes import BaseNode class NoOp(BaseNode): @property def output_type(self) -> object: if not self.has_input(0): return self._output_type return self.input(0).output_type def _execute(self): if not self.h...
# generated from catkin/cmake/template/pkg.context.pc.in CATKIN_PACKAGE_PREFIX = "" PROJECT_PKG_CONFIG_INCLUDE_DIRS = "/home/pls/ydlidar_ws/devel/include".split(';') if "/home/pls/ydlidar_ws/devel/include" != "" else [] PROJECT_CATKIN_DEPENDS = "message_runtime;std_msgs;geometry_msgs".replace(';', ' ') PKG_CONFIG_LIBRA...
# Generated by Django 4.0.1 on 2022-01-29 13:40 import common.fileds from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('common', '0001_initial'), ] operations = [ migrations.CreateModel( name='Client', fields=[ ...
# -*- coding: utf-8 -*- import ast import csv import inspect from os import listdir, path from sys import version_info import pkg_resources if version_info.major == 2: class suppress: """ https://stackoverflow.com/a/34113126 """ def __init__(self, *exception): self.e...
from util.common import nvl2, nvl, to_html, from_html filepath = '/Users/royce/Dropbox/Documents/Memorize/javascript/Blank.txt' with open(filepath, 'r') as f: card_count = 0 add_tag = False for line in f: if line.strip(' ') != "\n" and not 'deprecated' in line.lower(): tabs = line...
from django.contrib import admin from .models import Species admin.site.register(Species) # Register your models here.
from django.contrib.auth import get_user_model, authenticate from django.utils.translation import ugettext_lazy as _ from rest_framework import serializers class UserSerializer(serializers.ModelSerializer): """Serializer for the users object""" class Meta: model = get_user_model() fields = ('...
import pandas as pd from definitions import DATA_DIR def get_packs() -> pd.DataFrame: table_nek = pd.read_csv(DATA_DIR.joinpath('table_nek_2020_01.csv')) pack_counts = table_nek.groupby('path').count().pack_id.reset_index() pack_counts['path'] = pack_counts['path'].apply(lambda x: "/".join(x.split('/')[-2...
import asyncio import csv from collections import deque from datetime import datetime from typing import List, Deque, AsyncGenerator, Any from aat.config import EventType, InstrumentType, Side, TradingType from aat.core import ExchangeType, Event, Instrument, Trade, Order from aat.exchange import Exchange class CSV(E...
import pytest import requests @pytest.fixture(autouse=True) def disable_network_calls(monkeypatch): def stunted_get(): raise RuntimeError("Network access not allowed during testing!") monkeypatch.setattr(requests, "get", lambda *args, **kwargs: stunted_get())
from typing import FrozenSet from collections import Iterable from math import log, ceil from mathsat import msat_term, msat_env from mathsat import msat_make_constant, msat_declare_function from mathsat import msat_get_integer_type, msat_get_rational_type, msat_get_bool_type from mathsat import msat_make_and, msa...
from .base import * # noqa from .base import env # GENERAL # ------------------------------------------------------------------------------ # https://docs.djangoproject.com/en/dev/ref/settings/#debug DEBUG = True # https://docs.djangoproject.com/en/dev/ref/settings/#secret-key SECRET_KEY = env('DJANGO_SECRET_KEY', de...