text stringlengths 2 999k |
|---|
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Created on Tue Feb 10 14:35:05 2015
@author: jsc-mth
"""
from __future__ import division
from __future__ import division
import numpy as np
from decimal import *
import pycity_calc.energysystems.electricalHeater as ElHeaterEx
import pycity_base.classes.Weather as Wea... |
# Copyright 2021 Huawei Technologies Co., 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 applicable law or agreed to... |
import os
from setuptools import find_packages, setup
with open(os.path.join(os.path.dirname(__file__), 'README.md')) as readme:
README = readme.read()
# allow setup.py to be run from any path
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))
setup(
name='django-rest-passwordres... |
""" Contains Batch classes for images """
import os
import warnings
from numbers import Number
import numpy as np
import PIL
import PIL.ImageOps
import PIL.ImageChops
import PIL.ImageFilter
import PIL.ImageEnhance
from .batch import Batch
from .decorators import action, apply_parallel, inbatch_parallel
from .dsindex ... |
"""
WSGI config for bryansWebsite project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/howto/deployment/wsgi/
"""
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "bryansWebsite.settings")
from d... |
"""Django static file storage backend for OpenEdX."""
from django.conf import settings
from pipeline.storage import PipelineCachedStorage
from openedx.core.storage import ProductionStorage
class CDNMixin(object):
"""Mixin to activate CDN urls on a static files storage backend."""
def url(self, name, force=... |
# Copyright 2013-2019 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Tassel(Package):
"""TASSEL is a software package to evaluate traits associations,
e... |
import discord
from discord.ext import commands
import datetime
class JoinLogs(commands.Cog):
def __init__(self, bot):
self.bot = bot
@commands.Cog.listener()
async def on_member_join(self, member):
join_logs = member.guild.get_channel(self.bot.config.get("join_logs_chan", None))
... |
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... |
Midan_Metal_Axe0 = [[148, 0, 123, 107, 0, 162, 81, 3.44], u'Midan Metal Axe+DET12+DET12', 1, 14576]
Midan_Metal_Axe1 = [[148, 12, 123, 95, 0, 162, 81, 3.44], u'Midan Metal Axe+DET12+ACC12', 1, 14576]
Midan_Metal_Axe2 = [[148, 24, 123, 83, 0, 162, 81, 3.44], u'Midan Metal Axe+ACC12+ACC12', 1, 14576]
Augmented_Hellfire_B... |
# Copyright 2018 The Oppia 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 applicable ... |
import os
import external_arrow
def get_cpp_path():
module_path = os.path.dirname(os.path.abspath(external_arrow.__file__))
cpp_path = os.path.join(module_path, 'lib', 'cpp_arrow')
return cpp_path
|
# Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.
# Copyright (c) 2021 NVIDIA Corporation. 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:/... |
"""
This module provides errors/exceptions and warnings of general use for SunPy.
Exceptions that are specific to a given package should **not** be here,
but rather in the particular package.
"""
from astropy.utils.exceptions import AstropyWarning
__all__ = ["NoMapsInFileError",
"SunpyWarning", "SunpyUser... |
"""
Basic utility functions
"""
from __future__ import annotations
import json
import docker
from cloudfiles import CloudFiles
import cloudvolume as cv
def sendjsonfile(cloudvolume: cv.CloudVolume,
filename: str,
content: str
) -> None:
"""Stores a json file us... |
# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved.
#
# NVIDIA CORPORATION and its licensors retain all intellectual property
# and proprietary rights in and to this software, related documentation
# and any modifications thereto. Any use, reproduction, disclosure or
# distribution of this software and re... |
def div(func):
def wrapper(*args, **kwargs):
return '<div>'+func(*args, **kwargs)+'</div>'
return wrapper
def article(func):
def wrapper(*args, **kwargs):
return '<article>'+func(*args, **kwargs)+'</article>'
return wrapper
def p(func):
def wrapper(*args, **kwargs):
retur... |
import unittest
import os
import dbt.flags
import dbt.compilation
from collections import OrderedDict
class CompilerTest(unittest.TestCase):
def assertEqualIgnoreWhitespace(self, a, b):
self.assertEqual(
"".join(a.split()),
"".join(b.split()))
def setUp(self):
dbt.f... |
"""
REST API Documentation for Family Law Act
OpenAPI spec version: v1
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
Unles... |
# encoding: UTF-8
from __future__ import print_function
from enum import Enum
class OrderStatus(Enum):
NONE = -1
NEWBORN = 0
PENDING_SUBMIT = 1
PENDING_CANCEL = 2
SUBMITTED = 3
ACKNOWLEDGED = 4
CANCELED = 5
FILLED = 6
PARTIALLY_FILLED = 8
|
"""Initialize main package."""
|
# Copyright 2019 The TensorNetwork 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 ... |
from tensorflow import keras
from skimage import io
import numpy as np
import matplotlib.pyplot as plt
import cv2
import os
os.environ["CUDA_VISIBLE_DEVICES"] = '-1'
'''
mymodel4_30: 30:0.5
mymodel4_50epoch:50epoch 0.98:0.2
'''
path='D:\pycharm project'
#ori_files= os.listdir('D:\FYP\original') #D:\FYP\... |
# ============================================================================
#
# Copyright (C) 2007-2016 Conceptive Engineering bvba.
# www.conceptive.be / info@conceptive.be
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following condition... |
import numpy as np
import pylab as pl
import matplotlib.pyplot as plt
from matplotlib.ticker import AutoMinorLocator
from matplotlib.ticker import MultipleLocator
from scipy import interpolate
import importlib
import sys
import os
import paths; importlib.reload(paths)
import pltaux; importlib.reload(pltaux)
import... |
"""This module has methods to manage the topologies in Toka controller.
This module has methods for the following -
- Creating a new topology
- Searching topologies
- Delete a topology
- Reserve a topology
- Release a topology
Compatible with the following Toka controller version(s) -
>= 1.4.8.0
Com... |
from abc import ABC
from rest_framework import serializers
from django.contrib.auth.models import User
from evernote.models import *
class UserSerializer(serializers.ModelSerializer):
notes = serializers.PrimaryKeyRelatedField(many=True, read_only=True)
class Meta:
model = User
fields = ('id... |
import cell
from celery import current_app as celery
class BlenderActor(cell.Actor):
types = ('direct', 'round-robin')
def __init__(self, connection=None, *args, **kwargs):
# - use celery's connection by default,
# - means the agent must be started from where it has access
# - to the... |
# qubit number=2
# total number=9
import cirq
import qiskit
from qiskit.providers.aer import QasmSimulator
from qiskit.test.mock import FakeVigo
from qiskit import IBMQ
from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister
from qiskit import BasicAer, execute, transpile
from pprint import pprint
from q... |
import cv2
import numpy
from pathlib import Path
from scandir import scandir
def get_folder(path):
output_dir = Path(path)
# output_dir.mkdir(parents=True, exist_ok=True)
return output_dir
def get_image_paths(directory):
return [x.path for x in scandir(directory) if x.name.endswith('.... |
#!/usr/bin/env python
#---------------------------------------------------------------------
# IDAPython - Python plugin for Interactive Disassembler
#
# Original IDC.IDC:
# Copyright (c) 1990-2010 Ilfak Guilfanov
#
# Python conversion:
# Copyright (c) 2004-2010 Gergely Erdelyi <gergely.erdelyi@d-dome.net>
#
# All righ... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import io
import mock
import os
import re
import string
import sys
import tempfile
import unittest
from django.contrib.auth.models import Group, User
from django.db.models import Q
from django.db.models.query_utils import DeferredAttribute
from django.a... |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2011 University of Southern California
#
# 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/... |
# This file helps to compute a version number in source trees obtained from
# git-archive tarball (such as those provided by githubs download-from-tag
# feature). Distribution tarballs (built by setup.py sdist) and build
# directories (produced by setup.py build) will contain a much shorter file
# that just contains th... |
"""
FridgeAI's command-line shell interface.
To add a new command, create a function with the @command decorator.
Function name must have an underscore in front.
Function docstring optionally defines a help statement for your command, which
is displayed by the 'help' command.
"""
import cv2
import os
available_comman... |
#!/usr/bin/env python
import os
import re
import sys
import csv
import errno
import requests
import argparse
## Example ids supported by this script
SRA_IDS = ['PRJNA63463', 'SAMN00765663', 'SRA023522', 'SRP003255', 'SRR390278', 'SRS282569', 'SRX111814']
ENA_IDS = ['ERA2421642', 'ERP120836', 'ERR674736', 'ERS4399631'... |
"""
Helper functions for the LocalizerX module.
"""
from __future__ import absolute_import, unicode_literals
import logging
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from openedx.core.djangoapps.site_configuration import helpers as configuration_helpers
LOGGER = loggin... |
#!/usr/bin/env python3
import argparse
from pathlib import Path
from elftools.elf.elffile import ELFError
from pypcode_emu.ghidra import ELFPCodeEmuHeadless, PCodeEmuHeadless
parser = argparse.ArgumentParser()
parser.add_argument("binary", help="Input binary file (binary/ELF)", metavar="BIN")
parser.add_argument("-... |
from django.shortcuts import render
from basic_app import forms
def index(request):
return render(request,'basic_app/index.html')
def my_form_view(request):
if request.method == 'POST':
print('psteeeeed')
form = forms.my_form(request.POST)
# print(form)
# print ("name " + form.... |
import unittest
import os
import intel_extension_for_pytorch._C as core
def get_ipex_isa_env_setting():
env_isa = os.getenv('ATEN_CPU_CAPABILITY')
return env_isa
def get_currnet_isa_level():
return core._get_current_isa_level().lower()
class TestDynDisp(unittest.TestCase):
def test_env_setting(self... |
"""
# Definition for a Node.
class Node:
def __init__(self, val=None, children=None):
self.val = val
self.children = children
"""
class Solution:
def postorder(self, root: 'Node') -> List[int]:
if not root:
return []
stack = [root]
res = []
while st... |
#---------------------------------------------------------------------------
# Copyright 2013-2019 The Open Source Electronic Health Record Alliance
#
# 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 Licen... |
#
# Copyright 2021 XEBIALABS
#
# 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, distribute, subli... |
# Copyright 2019 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... |
#!/usr/bin/env python
"""
Training on a single process
"""
from __future__ import division
import argparse
import os
import random
import torch
import onmt.opts as opts
from graph_embedding import init_condition_transformer
from onmt.inputters.inputter import build_dataset_iter, lazily_load_dataset, \
_load_... |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 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
#
# ... |
import json
import argparse
import demisto_client
from slackclient import SlackClient
from Tests.test_integration import __create_integration_instance, __delete_integrations_instances
from Tests.test_content import ParallelPrintsManager
from Tests.test_utils import str2bool, print_color, print_error, LOG_COLORS, print... |
#!/usr/bin/env python3
import argparse
import logging
import os
import sys
import platform
# import random
import threading
import pickle
import time
import queue
import uuid
import zmq
import json
from mpi4py import MPI
from parsl.version import VERSION as PARSL_VERSION
from ipyparallel.serialize import unpack_appl... |
import base64
import requests
import time
from pycrest import version
from pycrest.compat import bytes_, text_
from pycrest.errors import APIException
try:
from urllib.parse import quote
except ImportError: # pragma: no cover
from urllib import quote
import logging
logger = logging.getLogger("pycrest.eve")
... |
from typing import Tuple
import torch
from torch.utils.data import DataLoader
from tqdm import tqdm
from dataset.base import Base as DatasetBase
from model import Model
class Evaluator(object):
def __init__(self, dataset: DatasetBase, path_to_data_dir: str, path_to_results_dir: str):
super().__init__()
... |
import redshells.data.data_frame_utils
from redshells.data.load_data_of_task import LoadDataOfTask
from redshells.data.load_existing_file import LoadExistingFile
|
# Copyright 2019 The Texar 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 applicable ... |
import shutil
import sys
from datetime import datetime
from pathlib import Path
from typing import Any, Dict, List, Tuple
import pytest
import hesiod.core as hcore
from hesiod import get_cfg_copy, get_out_dir, get_run_name, hcfg, hmain
from hesiod.core import _parse_args
def test_args_kwargs(base_cfg_dir: Path, sim... |
import pygame
def scale_image(img, factor):
size = round(img.get_width() * factor), round(img.get_height() * factor)
return pygame.transform.scale(img, size)
def blit_rotate_center(win, image, top_left, angle):
rotated_image = pygame.transform.rotate(image, angle)
new_rect = rotated_image.... |
# 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 may ... |
#2001203004 - Do The Sang (nhom 5)
#Binary Search in Python
def bSearch(arr,x,low,high):
while low<=high:
mid=(low+high)//2
if arr[mid]==x:
return mid
elif arr[mid]<x:
low=mid+1
else:
high=mid-1
return -1
arr=[3,4,6,7,8,9]
x=4
result=bSearch(arr,x,0,len(arr)-1)
if result!=-1:
print("Phan tu",arr[r... |
# Generated by Django 2.0.5 on 2018-07-08 19:31
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('grou... |
import numpy as np
from pysao.eim.evolutionary_interpolation import EvolutionaryInterpolationModel
from pysao.metamodels.metamodel import Metamodel
class EIModel(Metamodel):
def __init__(self):
Metamodel.__init__(self)
self.model = None
def _predict(self, X):
return self.model.predic... |
#!/usr/bin/env python3
# Copyright (c) 2019 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
""" Test node eviction logic
When the number of peers has reached the limit of maximum connections,
the next ... |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from... |
import torch
from transformers import BertTokenizer, BertModel
from wiki_search.dataset import Document
torch.set_grad_enabled(False)
MODEL_NAME = 'bert-base-cased'
class BertRanking(object):
def __init__(self, device: str = 'cuda:0'):
self.device = torch.device(device)
self.model = BertModel.fr... |
#from __future__ import print_function
import numpy
from amuse.units import units
from amuse.units import quantities
from amuse.units import constants
from amuse.units import nbody_system
from amuse.ext.bridge import bridge
from amuse.community.phigrape.interface import PhiGRAPE
from amuse.community.ph4.interface impor... |
from instagram.client import InstagramAPI
import json
import datetime
from geopy.geocoders import Nominatim
from collections import Counter
DISTANCE = 1500
TEL_AVIV = (32.085300, 34.781768)
RIO = (-22.906847, -43.172896)
LONDON = (51.507351, -0.127758)
GAZA = (31.354676, 34.308826)
JERUSALEM = (31.768319, 35.213710)
... |
"""
This function help to feed in train and test datasets.
Select model archtecture and seed then output corresponding model.
"""
from __future__ import print_function
import os
import argparse
import torch
import torch.nn as nn
import torch.nn.functional as F #233
import torch.optim as optim
from torchvis... |
# testing/assertions.py
# Copyright (C) 2005-2020 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
from __future__ import absolute_import
import contextlib
import re
import sys... |
from abc import ABC, abstractmethod
from enum import Enum
from random import choice
from typing import List
class OrderType(Enum):
"""Типы возможных заказов"""
CAPPUCCINO = 1
LATTE = 2
ESPRESSO = 3
class Order:
"""Класс заказа"""
order_id: int = 1
def __init__(self, order_type: OrderTyp... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2020-2022 Barcelona Supercomputing Center (BSC), Spain
#
# 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... |
import math
def rotate(point, angle):
ox = 0
oy = 0
px, py = point
qx = ox + math.cos(angle) * (px - ox) - math.sin(angle) * (py - oy)
qy = oy + math.sin(angle) * (px - ox) + math.cos(angle) * (py - oy)
return [qx, qy]
with open("12/nav.txt") as f:
lines = [x.strip() for x in f.readline... |
from .sidebarupdater import main
|
#!/usr/bin/env python3
"""esphome setup script."""
from setuptools import setup, find_packages
import os
from esphome import const
PROJECT_NAME = 'esphome'
PROJECT_PACKAGE_NAME = 'esphome'
PROJECT_LICENSE = 'MIT'
PROJECT_AUTHOR = 'ESPHome'
PROJECT_COPYRIGHT = '2019, ESPHome'
PROJECT_URL = 'https://esphome.io/'
PROJEC... |
# -*- coding: utf-8 -*-
#
# model_comparison.py
#
"""
"""
__author__ = 'Severin Langberg'
__email__ = 'langberg91@gmail.com'
import os
import utils
import ioutil
import shutil
import logging
import model_selection
import feature_selection
import numpy as np
import pandas as pd
from datetime import datetime
from m... |
from django.contrib.auth.hashers import make_password
from django.contrib.auth.models import User
from rest_framework import serializers
from profiles.models import Profile
class ProfileSerializer(serializers.ModelSerializer):
class Meta:
model = Profile
fields = ['notification_enabled', 'subscr... |
"""Sensor platform for UniFi integration.
Support for bandwidth sensors of network clients.
Support for uptime sensors of network clients.
"""
from homeassistant.components.sensor import DEVICE_CLASS_TIMESTAMP, DOMAIN
from homeassistant.const import DATA_MEGABYTES
from homeassistant.core import callback
from homeassis... |
# This is the solution for Maximum Slice Problem > Max Profit
#
# This is marked as PAINLESS difficulty
def solution(A):
global_max_sum = 0
local_max_sum = 0
for i in range(1, len(A)):
d = A[i] - A[i - 1]
local_max_sum = max(d, local_max_sum + d)
global_max_sum = max(local_max_sum, ... |
import itertools
import logging
from pathlib import Path
from det3d.builder import build_box_coder
from det3d.utils.config_tool import get_downsample_factor
from kitti_paths import *
norm_cfg = None
tasks = [dict(num_class=1, class_names=["Car"],),]
class_names = list(itertools.chain(*[t["class_names"] for t in tasks]... |
"""Compatibility module defining operations on duck numpy-arrays.
Currently, this means Dask or NumPy arrays. None of these functions should
accept or return xarray objects.
"""
import contextlib
import inspect
import warnings
from functools import partial
import numpy as np
import pandas as pd
from . import dask_ar... |
import json
from pathlib import Path
from typing import Any, Mapping, Optional, Union, cast, get_args
import pulumi_nomad as nomad
from infra.config import STACK_NAME
from infra.nomad_service_postgres import NomadServicePostgresDbArgs
import pulumi
_ValidNomadVarTypePrimitives = Union[str, bool, int]
_ValidNomadVarT... |
"""empty message
Revision ID: 270947efbfd8
Revises: 19c82f38f866
Create Date: 2019-03-15 19:15:04.944062
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '270947efbfd8'
down_revision = '19c82f38f866'
branch_labels = None
depends_on = None
def upgrade():
# ... |
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "pmuseosfinal.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
|
from escnn.nn import FieldType, GeometricTensor
from escnn.group import Representation
from escnn.kernels import KernelBasis
from torch_geometric.data import Data
from .rd_point_convolution import _RdPointConv
from typing import Callable, Tuple, Dict, Union, List
import torch
import numpy as np
import math
__... |
#!/usr/bin/python3
import argparse
from http import server
import json
import subprocess
def main():
argp = argparse.ArgumentParser()
argp.add_argument('--host', default='0.0.0.0')
argp.add_argument('--port', default=6969, type=int)
# argp.add_argument('--password')
args = argp.parse_args()
... |
import os
import pele_platform.constants.constants as cs
import pele_platform.main as main
from . import test_adaptive as ta
test_path = os.path.join(cs.DIR, "Examples")
BOX_RES_ARGS = os.path.join(test_path, "box/input.yaml")
BOX_RES = [
'"fixedCenter": [-3.6559998989105225, 64.46499633789062, 2.3980000019073486... |
"""
P3-D65 Colourspace
==================
Defines the *P3-D65* colourspace:
- :attr:`colour.models.RGB_COLOURSPACE_P3_D65`.
"""
from __future__ import annotations
import numpy as np
from functools import partial
from colour.colorimetry import CCS_ILLUMINANTS
from colour.hints import NDArray
from colour.models.rg... |
from django.core.exceptions import ValidationError
from ..classes import SettingNamespaceMigration
from .literals import TEST_SETTING_VALIDATION_BAD_VALUE
class TestNamespaceMigrationOne(SettingNamespaceMigration):
def smart_settings_test_setting_0001(self, value):
return '{}_0001'.format(value)
class... |
import os
# --- JupyterHub ---
c.JupyterHub.ip = '0.0.0.0'
c.JupyterHub.port = 8000
c.JupyterHub.cookie_secret = '288696652124211857713239dcd33bba50309572f4725ad4bc50107613fd7ba8'
c.JupyterHub.confirm_no_ssl = True
c.JupyterHub.log_level = 'DEBUG'
c.JupyterHub.admin_access = False
# --- ConfigurableHTTPProxy ---
c.Co... |
import datetime
import os
import sys
from dotenv import load_dotenv
from exavault import ResourcesApi
from exavault import NotificationsApi
from exavault.models.add_folder_request_body import AddFolderRequestBody
from exavault.models.add_notification_request_body import AddNotificationRequestBody
##
# sample_get_noti... |
def search(query, groups):
for group in groups:
if query in group.lower():
return True
return False
|
# Description: Variable Arguments in a Python Function
def functionWithFixedArguments(arg):
print("Arguments to functionWithFixedArguments:", arg)
print()
# 1. The *args is used to send a non-keyworded variable length argument list to the function.
# 2. When we have a formal parameter of the form *args, it ... |
# Copyright 2018 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 applicab... |
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT license.
import copy
import json
import textwrap
from typing import List, Dict, Optional, Mapping, Any, Iterable, Union, Tuple
from collections import OrderedDict
from functools import partial
import numpy as np
from numpy.random i... |
# coding: utf-8
"""
OpenAPI Petstore
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
... |
# -*- coding: utf-8 -*-
"""
Defines the unit tests for the :mod:`colour_datasets.loaders.jakob2019` module.
"""
import unittest
from colour_datasets.loaders import DatasetLoader_Jakob2019, build_Jakob2019
__author__ = 'Colour Developers'
__copyright__ = 'Copyright (C) 2019-2021 - Colour Developers'
__license__ = 'Ne... |
"""
This file can only be run as a module.
In the root directory run python tests.test_fft
"""
import os, sys
import pytest
from src import fft # fft has been imported in __init__.py in src
def test_basic():
print(fft([1,2,3,4,5,6,7,8]))
def announce(test="basic"):
print(f"package name: {__package__}")
... |
import numpy as np
import cv2
import sys
def main():
if len(sys.argv) == 1: # pass the device number
cap = cv2.VideoCapture(0)
else:
try:
cap = cv2.VideoCapture(int(sys.argv[1]))
except:
cap = cv2.VideoCapture(sys.argv[1])
cap.set(cv2.CAP_PROP_FRAME_WIDTH... |
import discord
from discord.ext import commands
from random import choice
from cogs.config import colour
from cogs.commands import commands_names
from cogs.config import colour
from cogs.commands import commands_names as cs
from cogs.glossary import speech_setting
commands_names = cs.music_player
BOARD_CELLS = {
... |
"""Test for the GeoNet NZ Volcanic Alert Level GeoJSON feed."""
import aiohttp
import pytest
from aio_geojson_client.consts import UPDATE_OK
from aio_geojson_geonetnz_volcano.consts import ATTRIBUTION
from aio_geojson_geonetnz_volcano.feed import GeonetnzVolcanoFeed
from tests.utils import load_fixture
@pytest.mark.... |
from logging import getLogger, INFO, Formatter
logger = getLogger(__name__)
logger.setLevel(INFO)
|
from ast import literal_eval
from os import getenv
MASK_COLOR = literal_eval(getenv('MASK_COLOR', '(0, 0, 255)'))
OUTPUT_IMAGE_FORMAT = getenv('OUTPUT_IMAGE_FORMAT', 'jpg')
|
# Generated by Django 2.1 on 2018-09-09 03:05
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
('MRR', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='MRRRunTi... |
# ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distrib... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.