text
stringlengths
1
927k
# The MIT License (MIT) # # Copyright (c) 2014-2015 Bjoern Lange # # 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 limitation the rights to use, copy,...
from torch import Tensor from torch import nn from transformers import DistilBertModel, DistilBertTokenizer import json from typing import Union, Tuple, List, Dict, Optional import os import numpy as np import logging class DistilBERT(nn.Module): """DEPRECATED: Please use models.Transformer instead. DistilBER...
#!/usr/bin/env python3 import pathlib from typing import List import pandas as pd HEADER = ["id", "otu_table", "obs_metadata", "sample_metadata", "children_map"] def main(files: List[pathlib.Path], name: str) -> None: """Create samplesheet for list of files""" data = [] for file in files: dir =...
from describe.core.system import System from describe.core.lattice import Lattice
#!/usr/bin/env python # Licensed to Cloudera, Inc. under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. Cloudera, Inc. licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you ma...
# 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 ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
import streamlit as st import pandas as pd import numpy as np import matplotlib.pyplot as plt from datetime import datetime import warnings warnings.filterwarnings('ignore') import random st.title('Прогнозирование цены футболистов') st.markdown('Целью этого проета было предсказание цен на молодых атакующих футболисто...
#! /usr/bin/python #coding:utf-8 from django import forms from django.conf import settings # form for register class RegisterForm(forms.Form): username = forms.CharField(widget=forms.TextInput(attrs={"placeholder":"username", "required": "required",}), max_length=50, error_messages={"required": "username can not be n...
import sublime from ui.read import settings as read_settings from ui.write import write, highlight as write_highlight from lookup import file_type as lookup_file_type from ui.read import x as ui_read from ui.read import spots as read_spots from ui.read import regions as ui_regions from core.read import read as core_rea...
# Copyright 2015 Yale University - Grablab # 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 limitation the rights to use, copy, modify, merge, publish, distr...
#!/usr/bin/env python3 # -*- coding:utf-8 -*- # Copyright (c) Megvii Inc. All rights reserved. import math from loguru import logger import torch import torch.nn as nn import torch.nn.functional as F from yolox.utils import bboxes_iou, meshgrid from .losses import IOUloss from .network_blocks import BaseConv, DWCon...
class AbstractConfigModel: def merge(self, config: "AbstractConfigModel"): for key, value in self.__dict__.items(): updated_attr = getattr(config, key, None) if updated_attr: if isinstance(updated_attr, dict) and hasattr(value, "__dict__"): value._...
#!/Library/Frameworks/Python.framework/Versions/3.7/bin/python3 from netmiko import ConnectHandler cisco_csr = { 'device_type' : 'cisco_ios', 'host' : '172.16.43.153', 'username' : 'root', 'password' : 'cisco' } # By checking couple of things connecthandler will allow you to connect ''' . device_type ''' device...
import random from torch.utils.data import ( DFIterDataPipe, IterDataPipe, functional_datapipe, ) try: import pandas # type: ignore[import] # pandas used only for prototyping, will be shortly replaced with TorchArrow WITH_PANDAS = True except ImportError: WITH_PANDAS = False @functional...
import argparse from udacidrone import Drone from udacidrone.connection import MavlinkConnection import time if __name__ == "__main__": parser = argparse.ArgumentParser() parser.add_argument('--port', type=int, default=5760, help='Port number') parser.add_argument('--host', type=str, default='127.0.0.1', ...
# 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 uvicorn from fastapi import FastAPI, File, UploadFile from starlette.responses import RedirectResponse app_desc = """<h2>Try this app by demostrating[a,b,c,d,e] data and index for `api/res`</h2> <h2>Try get/add/modify/delete rest functions and verify return response </h2> <br>by Aniket Maurya""" app = Fast...
import sys n = int(sys.stdin.readline().rstrip()) table = dict() for _ in range(n): b, a = sys.stdin.readline().split() table[b] = a n, *s = sys.stdin.read().split() def main(): t = '' for c in s: if c in table: t += table[c] else: t += c return t if __nam...
"""wiki版本追踪 Revision ID: ac28bef87cb9 Revises: c5d936a18918 Create Date: 2020-09-05 15:09:30.698554 """ import ormtypes from alembic import op import sqlalchemy as sa from sqlalchemy.dialects import mysql # revision identifiers, used by Alembic. revision = 'ac28bef87cb9' down_revision = 'c5d936a18918' branch_labels ...
space = [ ['EnumParameter', 'INT_WIDTH_THETA', [1, 2, 3, 4 , 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]], ['EnumParameter', 'FRA_WIDTH_THETA', [1, 2, 3, 4 , 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]], ['EnumParameter', 'INT_WIDTH_COS', [1, 2, 3, 4 , 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]], ['EnumParameter'...
class Layer: def forward(self, x): ''' forward propagation Parameters --- x: matrix input from last layer Returns --- out: matrix output of current layer ''' raise NotImplementedError def backprop(self, d): ''' backward propagation Parameters -...
import os import sys import numpy as np from os.path import abspath, basename, join from subprocess import Popen from time import sleep from seisflows.tools import unix from seisflows.tools.tools import call, findpath, nproc, saveobj from seisflows.config import ParameterError, custom_import PAR = sys.modules['seisf...
#!/usr/bin/env python ############################################################################### # Copyright 2017 The Apollo 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 ...
#!/bin/python # ENTech SS # This file contains misc. data for main script. # This file dose not contain code for Home Config or the chatbot import logging from concurrent.futures import ThreadPoolExecutor CHAS = None # CHAS Masterclass def get_chas(): """ Returns the CHAS masterclass for usage. Great...
# Copyright (c) 2016 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Helper functions for gcc_toolchain.gni wrappers.""" import gzip import os import re import subprocess import shlex import shutil import sys import th...
par_impar = [[],[]] # Cria duas listas dentro de uma (matriz) cont_P_I = [0,0] # Variaveis q contam quantos elementos tem em cada vetor def veri (valor_, ind_, txt_): # Função: adiciona no vetor certo e verifica se está cheio par_impar[ind_].append(valor_) #...
def genFile(name): return open(name, "w+") def writeFile(f , content): f.write(content)
############################################################################## # # Copyright (c) 2000-2009 Jens Vagelpohl and Contributors. All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # THIS S...
from vedo import Arc import numpy as np import vtk print('---------------------------------') print('vtkVersion', vtk.vtkVersion().GetVTKVersion()) print('---------------------------------') ##################################### arc = Arc(center=None, point1=(1, 1, 1), point2=None, normal=(0, 0, 1), angle=np.pi) asse...
from typing import AsyncIterator from ._compat import DeprecatedAsyncContextManager from ._eventloop import get_asynclib def open_signal_receiver(*signals: int) -> DeprecatedAsyncContextManager[AsyncIterator[int]]: """ Start receiving operating system signals. :param signals: signals to receive (e.g. ``...
from typing import Any, Dict import httpx from ...client import AuthenticatedClient from ...types import Response def _get_kwargs( profile: str, *, client: AuthenticatedClient, ) -> Dict[str, Any]: url = "{}/profile/{profile}".format(client.base_url, profile=profile) headers: Dict[str, Any] = c...
#!/usr/bin/env python import rospy from std_msgs.msg import Float32 from geometry_msgs.msg import Twist class TwistToMotors(): def __init__(self): rospy.init_node("twist_to_motors") nodename = rospy.get_name() rospy.loginfo("%s started" % nodename) self.w = rospy...
class Super(object): attribute = 3 def func(self): return 1 class Inner(): pass class Sub(Super): #? 13 Sub.attribute def attribute(self): pass #! 8 ['attribute = 3'] def attribute(self): pass #! 4 ['def func'] func = 3 #! 12 ['def func'] ...
#!/usr/bin/env python import math import time import dothat.backlight as backlight import dothat.lcd as lcd print(""" This example gives a basic demo of Display-o-Tron HAT's features. It will sweep the backlight, scan the bargraph and display text on screen! Press CTRL+C to exit. """) pirate = [ [0x00, 0x1f, ...
from rest_framework.authentication import SessionAuthentication class SessionAuthAll(SessionAuthentication): def authenticate(self, request): """ Returns a `User` and force CSRF even if the user is Unauthenticated """ # Get the session-based user from the underlying HttpR...
## core data structures import networkx as nx import numpy as np import scipy.sparse as sp from .decomposition import get_calculation_method class Class: def __init__(self, lab_id, name, members): self.name = name self.id = lab_id self.index = -1 self.members = members # ids of me...
from __future__ import annotations from typing import List class A: x: str y: B class B: w: List[A]
from app import app @app.route('/') @app.route('/index') def index(): return "Hello, World!"
""" @author: Salvatore Calderaro @author: Simone Contini """ from sklearn.feature_extraction.text import CountVectorizer from sklearn.model_selection import GridSearchCV from sklearn.decomposition import LatentDirichletAllocation as LDA from textblob import TextBlob from wordcloud import WordCloud from deep_translator...
# 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 th...
## Placeholder code, copied from old version # import numpy as np # from multiprocessing import Pool # # def simulate(choice_problem, system_model, report, threads, trials): # pool = Pool(threads) # # params = setup_simulation(choice_problem, system_model, report) # sims = [Simulator(trials // threads, par...
CHAPTER = 1
# Do not edit this file directly. # It was auto-generated by: code/programs/reflexivity/reflexive_refresh load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") def fontconfig(): http_archive( name="fontconfig" , build_file="//bazel/deps/fontconfig:build.BUILD" , sha256="711...
import os cmd = "\"C:\\Program Files\\3Delight\\bin\\tdlmake.exe\\\" \"D:\\tmp\\shaveTest_01_fullRenderPass_1.tif\" \"D:\\tmp\\shaveTest_01_fullRenderPass_1.tdl\" os.system( cmd )
name= input('What is your name?: ') age=input('What is your age?: ') print('Hello '+ name + '! You are '+ age + ' years old.') num1=input('Enter a digit: ') num2=input('Enter a second number:') answer=float(num1)+float(num2) print(answer)
#!/usr/bin/env python # Copyright 2019-2020 The University of Manchester, UK # Copyright 2020 Vlaams Instituut voor Biotechnologie (VIB), BE # Copyright 2020 Barcelona Supercomputing Center (BSC), ES # Copyright 2020 Center for Advanced Studies, Research and Development in Sardinia (CRS4), IT # # Licensed under the Ap...
# -*- coding: utf-8 -*- from django.views.generic import FormView from django.http import HttpResponseRedirect from django.contrib.auth import login, authenticate, logout from django.views.generic.base import TemplateView, RedirectView from braces.views import LoginRequiredMixin from .forms import LoginForm class E...
# -*- coding: utf-8 -*- # Generated by Django 1.11.2 on 2017-07-23 13:45 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion import wagtail.wagtailcore.blocks import wagtail.wagtailcore.fields import wagtail.wagtailimages.blocks class Migration(migrations...
#!/usr/bin/python import re import sys from mininet.net import Mininet from mininet.node import Controller, RemoteController, OVSController from mininet.node import CPULimitedHost, Host, Node from mininet.node import OVSKernelSwitch, UserSwitch from mininet.node import IVSSwitch from mininet.cli import CLI from mininet...
# # Copyright (c) 2020 IBM Corp. # 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 writi...
#!/usr/bin/env python import os import sgmake from common import Status from common import Support from common import Settings from common.Plugin import Plugin import clean.clean def make(project): try: project.cmakepath = "" except: pass try: os.mkdir("build") except: ...
"""Transform a dataset into an imbalanced dataset.""" # Authors: Dayvid Oliveira # Guillaume Lemaitre <g.lemaitre58@gmail.com> # Christos Aridas # License: MIT from collections import Counter from ..under_sampling import RandomUnderSampler from ..utils import check_sampling_strategy def make_imba...
# -*- coding: utf-8 -*- # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: from __future__ import print_function, division, unicode_literals, absolute_import import os from distutils.version import LooseVersion from .info import (LONG_DESCRIPTION as __doc...
#!/usr/bin/python3 """ Handles I/O, writing and reading, of JSON for storage of all class instances """ import json from models import base_model ''' import <model> dynamic ''' from datetime import datetime strptime = datetime.strptime to_json = base_model.BaseModel.to_json class FileStorage: """ handles...
"""empty message Revision ID: 306f880b11c3 Revises: 255f81eff867 Create Date: 2018-08-03 15:07:44.354557 """ import sqlalchemy as sa from alembic import op # revision identifiers, used by Alembic. revision = '306f880b11c3' down_revision = '255f81eff867' branch_labels = None depends_on = None def upgrade(): op....
"""Support for IKEA Tradfri sensors.""" from __future__ import annotations from collections.abc import Callable from typing import Any, cast from pytradfri.command import Command from homeassistant.components.sensor import SensorEntity from homeassistant.config_entries import ConfigEntry from homeassistant.const imp...
""" Utilities for Cloud Backends """ def parse_remote_path(remote_path): """ Parses a remote pathname into its protocol, bucket, and key. These are fields required by the current cloud backends """ # Simple, but should work fields = remote_path.split("/") assert len(fields) > 3, "Improper...
from uteis import numeros num = int(input("Digite um valor: ")) fat = numeros.fatorial(num) print(f"O fatorial de {num} é {fat}") print(f'O dobro de {num} é {numeros.dobro(num)}')
# 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 os import importlib import logging from http import HTTPStatus import requests import simplejson import argparse parser = argparse.ArgumentParser() parser.add_argument("prefix", help="Snippets prefix to process. Like 'minimal_api', 'relationship_', etc") parser.add_argument("-v", "--verbose", help="set logging...
# # ptf --test-dir ptftests fast-reboot --qlen=1000 --platform remote -t 'verbose=True;dut_username="admin";dut_hostname="10.0.0.243";reboot_limit_in_seconds=30;portchannel_ports_file="/tmp/portchannel_interfaces.json";vlan_ports_file="/tmp/vlan_interfaces.json";ports_file="/tmp/ports.json";dut_mac="4c:76:25:f5:48:80";...
# Copyright 2020 Google Research. 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...
# coding=utf-8 # Copyright 2020 The HuggingFace Inc. team, Microsoft Corporation. # # 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...
import socket import sys import struct def deal_with_connection(connection): data = bytearray() while True: buf = connection.recv(4096) data.extend(buf) if len(buf) < 4096: break address = "%d.%d.%d.%d" % (data[0], data[1], data[2], data[3]) origi...
from __future__ import print_function import torch import torch.nn as nn import torch.optim as optim import torch.nn.functional as F from torch.autograd import Variable torch.backends.cudnn.bencmark = True import os,sys,cv2,random,datetime import argparse import numpy as np from dataset import ImageDataset from matl...
# -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: google/ads/googleads_v3/proto/enums/promotion_extension_discount_modifier.proto import sys _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf import descriptor as _descriptor from g...
# -*- coding: utf-8 -*- ''' Miscellaneous pipeline handling utility functions Functions ========= :func:`pipeline_node_colors` ---------------------------- :func:`pipeline_link_color` --------------------------- :func:`dot_graph_from_pipeline` ------------------------------- :func:`dot_graph_from_workflow` -----------...
import random class Simulador(): """ Classe destinada a simulação de dados de voo """ def __init__(self): """ Construtor da classe Simulador """ # Gerando lista de dados self._altitude = [x for x in range(3000)] + [3000-x for x in range(3000)] # Simulando dados d...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- ''' QSDsan: Quantitative Sustainable Design for sanitation and resource recovery systems This module is developed by: Smiti Mittal <smitimittal@gmail.com> Yalin Li <zoe.yalin.li@gmail.com> This module is under the University of Illinois/NCSA Open Source License....
from .dlca import DynamicLCATestCase from .ia import DynamicIATestCase from .td import TemporalDistributionTestCase from .climate import ClimateMetricsTestCase
import lldbsuite.test.lldbinline as lldbinline from lldbsuite.test.decorators import * lldbinline.MakeInlineTest(__file__, globals(), decorators=[swiftTest,skipUnlessDarwin, expectedFailureAll(bugnumber="rdar://60396797", setting=('symbols.use-swift-clangimporter', 'false')...
import os.path import sys import sqlite3 from pathlib import Path DATABASE = 'db.sqlite' SCHEMA = 'schema.sql' db_path = str(Path(sys.path[0]) / DATABASE) schema_path = str(Path(sys.path[0]) / SCHEMA) def create_db(): # test if schema exists if os.path.isfile(schema_path): # connect to, or create da...
from inspect import signature def get_function_attr_values(function, attrs=None): # Fetch default values from function attributes # In: # function: function module, function where values are fetched # attrs: None returns all, str returns only the one specified...
__author__ = "Katharina Eggensperger" __copyright__ = "Copyright 2015, ML4AAD" __license__ = "GPLv3" __maintainer__ = "Katharina Eggensperger" __email__ = "eggenspk@cs.uni-freiburg.de" __version__ = "0.0.1" import unittest import numpy as np from smac.tae import StatusType from smac.runhistory import runhistory, run...
# Copyright (c) 2013 Mirantis 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 writ...
from collections import defaultdict from datetime import date, datetime, timedelta from dateutil.relativedelta import relativedelta from typing import Callable from itertools import product from functools import lru_cache from time import time import platform import multiprocessing #empyrical风险指标计算模块 from empyrical imp...
import numpy as np import pytest import pandas as pd from pandas import DataFrame, Index, MultiIndex, Series import pandas._testing as tm from pandas.core.util.hashing import hash_tuples from pandas.util import hash_array, hash_pandas_object @pytest.fixture( params=[ Series([1, 2, 3] * 3, dtype="int32"),...
import os BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) PROJECT_ROOT = os.path.normpath(os.path.join(os.path.dirname(__file__), "django_address")) SECRET_KEY = "NOTREALLY" DATABASES = {"default": {"ENGINE": "django.db.backends.sqlite3", "NAME": os.path.join(BASE_DIR, "db.sqlite3"),}} INSTA...
import os from datetime import datetime from django.test import SimpleTestCase from django.utils.functional import lazystr from django.utils.html import ( conditional_escape, escape, escapejs, format_html, html_safe, json_script, linebreaks, smart_urlquote, strip_spaces_between_tags...
"""REST python implementation for EEG data analysis.""" ''' For more see http://www.neuro.uestc.edu.cn/rest/ Reference: 1. Yao D (2001) A method to standardize a reference of scalp EEG recordings to a point at infinity. Physiol Meas 22:693?11. doi: 10.1088/0967-3334/22/4/305 2. Dong L, Li F, Liu ...
from KratosMultiphysics import * from KratosMultiphysics.DEMApplication import * import swimming_DEM_algorithm import swimming_DEM_procedures as SDP import math BaseAlgorithm = swimming_DEM_algorithm.Algorithm import h5py class Algorithm(BaseAlgorithm): def __init__(self, varying_parameters = Parameters("{}")): ...
from tests.util import BaseTest class Test_TYCO110(BaseTest): @classmethod def flags(cls): return ["--tyco_generic_alt"] def test_pass_1(self): code = """ import typing def foo(x: typing.MutableMapping): ... """ result = self.run_flake8(code) ...
""" Read and write ZIP files. """ import struct, os, time, sys, shutil import binascii, cStringIO, stat import io import re import string try: import zlib # We may need its compression method crc32 = zlib.crc32 except ImportError: zlib = None crc32 = binascii.crc32 __all__ = ["BadZipfile", "error", "Z...
#!/usr/bin/env python3 # Copyright (c) 2016-2017 The Knotcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. import re import fnmatch import sys import subprocess import datetime import os #######################...
#!/usr/bin/env python # -*- coding: utf-8 -*- """Defines full-referene image quality metricsself. These methods require a ground truth in order to make a quality assessment. .. moduleauthor:: Daniel J Ching <carterbox@users.noreply.github.com> """ __author__ = "Daniel Ching" __copyright__ = "Copyright (c) 2016, UChi...
# -*- coding: utf-8 -*- from setuptools import setup, find_packages with open('README.rst') as f: readme = f.read() with open('LICENSE') as f: license = f.read() setup( name='api_ai_translate', version='0.1.0', description='Translate API.AI agents.', long_description=readme, author='Fra...
# -*- coding: utf-8 -*- # # inventory/accounts/api/tests/test_accounts_api.py # import base64 from django.contrib.auth import get_user_model from django.utils.translation import gettext from rest_framework.reverse import reverse from rest_framework import status from rest_framework.test import APITestCase from inve...
#!/usr/bin/python #-*-coding:utf-8-*- # Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved. # # Licensed under the Apa...
from functools import partial import traceback import sys from typing import TYPE_CHECKING from PyQt5.QtCore import QObject, pyqtSignal from PyQt5.QtWidgets import (QHBoxLayout, QLabel, QVBoxLayout) from electrum_but.plugin import hook from electrum_but.i18n import _ from electrum_but.gui.qt.util import ThreadedButto...
#!/usr/bin/env python2 # Copyright (c) 2014-2015 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # Exercise the listtransactions API from test_framework.test_framework import BitcoinTestFramework from ...
# -*- coding: utf-8 -*- # Copyright 2015, 2016 OpenMarket Ltd # # 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 contextlib import datetime import logging from typing import Optional from django.contrib.postgres.fields import JSONField from django.core import validators from django.core.files.base import ContentFile from django.core.files.storage import Storage from django.db import DEFAULT_DB_ALIAS from django.db import ...
from typing import List, Type from pydfs_lineup_optimizer.settings import BaseSettings, LineupPosition from pydfs_lineup_optimizer.constants import Sport, Site, PlayerRank from pydfs_lineup_optimizer.sites.sites_registry import SitesRegistry from pydfs_lineup_optimizer.rules import OptimizerRule, FanduelSingleGameMVPRu...
"""Collection of MXNet general functions, wrapped to fit Ivy syntax and signature.""" # global import os _round = round import mxnet as mx from typing import Union from mxnet import profiler as _profiler # local import ivy from ivy.functional.ivy.device import Profiler as BaseProfiler def dev( x: mx.nd.NDArray...
import numpy as np import pytest from physt import special_histograms from physt.special_histograms import AzimuthalHistogram, azimuthal @pytest.fixture def empty_azimuthal() -> AzimuthalHistogram: return azimuthal( np.zeros( 0, ), np.zeros( 0, ), ) c...
from office365api.model.model import Model class Message(Model): select = ['From', 'Subject', 'Body', 'ToRecipients', 'DateTimeReceived', 'HasAttachments'] def __init__(self, From, ToRecipients, Subject, Body, HasAttachments=False, Id=None, DateTimeReceived=None): self.Id = Id ...
#!/usr/bin/env python3 # Copyright (c) 2014 Wladimir J. van der Laan # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. ''' Run this script from the root of the repository to update all translations from transifex. It will do the foll...
from django.db.models import Q from django.test import TestCase from rest_framework.test import APIClient from albums.models import Album from albums.views import AlbumViewSet from rest_framework_datatables_editor.pagination import ( DatatablesPageNumberPagination ) class DatatablesEditorTestCase(TestCase): ...
#!/usr/bin/env python3 from PIL import Image, ImageSequence from easyhid import Enumeration from time import sleep import signal import sys def signal_handler(sig, frame): try: # Blank screen on shutdown dev.send_feature_report(bytearray([0x61] + [0x00] * 641)) dev.close() print("\n")...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import django.contrib.postgres.fields class Migration(migrations.Migration): dependencies = [ ('cases', '0014_label_uuid_not_null'), ] operations = [ migrations.CreateModel( ...