text stringlengths 2 999k |
|---|
from django.test import TestCase
from django_keycloak.factories import OpenIdConnectProfileFactory
from django_keycloak.tests.mixins import MockTestCaseMixin
from django_keycloak.auth.backends import KeycloakAuthorizationBase
class BackendsKeycloakAuthorizationBaseHasPermTestCase(
MockTestCaseMixin, TestCase... |
#!/usr/bin/env python3
##############################################################################
# Project: arrayfunc
# Module: benchmark_fma.py
# Purpose: Benchmark tests for 'arrayfunc' functions.
# Language: Python 3.5
# Date: 20-Dec-2018.
# Ver: 07-Sep-2021.
#
#####################################... |
import pandas as pd
import sys
from sentence_transformers import SentenceTransformer, InputExample
from sentence_transformers.evaluation import EmbeddingSimilarityEvaluator, BinaryClassificationEvaluator
# Get the label as the value in the second place of the string (e.g., '(0, 5)' returns 0)
def get_lab(x):
retur... |
# -*- coding: utf-8 -*-
import hashlib
from .restful import check_res, session_get, session_post, session_delete, session_put
from data import SessionModel
def calPassword(pwd: str):
sha = hashlib.sha256()
sha.update(bytes(pwd, encoding='utf8'))
return sha.hexdigest()
class UserService:
@staticmet... |
# -*- coding: utf-8 -*-
"""
Created on Thu Jan 4 20:48:38 2018
@author: James Jiang
"""
all_lines = [line.rstrip('\n') for line in open('Data.txt')]
all_containers = [int(i) for i in all_lines]
all_containers.sort(reverse=True)
total_number = 2**(len(all_containers))
count = 0
min_num = len(all_containers)
i = 0
... |
class CandlestickInterval:
MIN1 = "1min"
MIN5 = "5min"
MIN15 = "15min"
MIN30 = "30min"
MIN60 = "60min"
HOUR4 = "4hour"
DAY1 = "1day"
MON1 = "1mon"
WEEK1 = "1week"
YEAR1 = "1year"
INVALID = None
class OrderSide:
BUY = "buy"
SELL = "sell"
INVALID = None
class Tr... |
import errno
import json
import subprocess
import six
from . import constants
from . import errors
from .utils import create_environment_dict
from .utils import find_executable
class Store(object):
def __init__(self, program, environment=None):
""" Create a store object that acts as an interface to
... |
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: POGOProtos/Settings/Master/PlayerLevelSettings.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 google.protobuf import message as _message
fr... |
# -*- coding: utf-8 -*-
# this file is released under public domain and you can use without limitations
#########################################################################
## This is a sample controller
## - index is the default action of any application
## - user is required for authentication and authorization... |
# Generated by Django 2.0.4 on 2018-04-25 14:27
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('zoo', '0002_exhibit'),
]
operations = [
migrations.CreateModel(
name='Animal',
fiel... |
import itertools
import copy
import sys
from locality_part import *
from street_part import *
from number_part import *
from type_part import *
# location qualifiers, eg "Main Hall", "Smith Oval"
from location_qualifier_part import *
# floor/level part, eg "First Floor", "Basement Level"
from level_part impor... |
from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^(?P<code>[0-9]+)/annual_report$', views.annual_report, name='annual_report'),
url(r'^stock_list$', views.stock_list, name='stock_list'),
url(r'^(?P<code>[0-9]+)/tick_data$', views.tick_data, name='tick_data'),
url(r'^(?P<code>... |
import numpy as np
from ..util import max_range
from .interface import Interface, DataError
class MultiInterface(Interface):
"""
MultiInterface allows wrapping around a list of tabular datasets
including dataframes, the columnar dictionary format or 2D tabular
NumPy arrays. Using the split method the... |
from django.db import models
# Create your models here.
class Driverstanding(models.Model):
driverStandingsId = models.IntegerField(primary_key=True)
raceId = models.ForeignKey('races.Race', on_delete=models.CASCADE)
driverId = models.ForeignKey('drivers.Driver', on_delete=models.CASCADE)
points = mode... |
from pyroute2 import netns, NDB, netlink, NSPopen
from contextlib import contextmanager
import ipaddress
import subprocess
import os
import os.path
"""
TODO: Add an introduction to network namespaces, veth interfaces, and bridges,
and explain why we use them here.
"""
BRIDGE_NF_CALL_IPTABLES = "/proc/sys/net/bridge/b... |
# 020 - O mesmo professor do desafio anterior quer sortear a ordem de apresentação dos alunos. Faça um programa que leia o nome dos quatro alunos e mostre a ordem sorteada.
'''
from random import shuffle
aluno1 = input('Primeiro aluno: ')
aluno2 = input('Segundo aluno: ')
aluno3 = input('Terceiro aluno: ')
aluno4 = in... |
"""
sphinx.domains.changeset
~~~~~~~~~~~~~~~~~~~~~~~~
The changeset domain.
:copyright: Copyright 2007-2019 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from collections import namedtuple
from typing import cast
from docutils import nodes
from sphinx import addno... |
# Generated by Django 2.1.15 on 2020-11-29 18:06
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('flightApp', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='reservation',... |
"""Plot intensity profile of theoretical beam patterns."""
import matplotlib.pyplot as plt
import numpy as np
from frbpoppy.survey import Survey
PATTERNS = ['perfect', 'gaussian', 'airy-0', 'airy-4']
SURVEY = 'apertif'
MIN_Y = 1e-6
n = 500000
for pattern in PATTERNS:
n_sidelobes = 1
p = pattern
z = 0
... |
import cv2
class SimplePreprocessor:
def __init__(self, width, height, inter=cv2.INTER_AREA):
self.width = width
self.height = height
self.inter = inter
def preprocess(self, image):
# Resize the image to a fixed size and ignore the aspect ratio
return cv2.resize(image, ... |
import pandas as pd
import matplotlib.cm as cm
import numpy as np
import matplotlib.pyplot as plt
def plot(problemVariants, *, zero, outfile, numThreads):
columns = ['Problem', 'NotTriedYet', 'Scheduled', 'Success', 'Timeout', 'Stopped', 'Ended']
colors = ['w', 'tab:purple', 'tab:green', 'tab:orange', 'tab:red... |
#! /usr/bin/env python
# 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
... |
# -*- coding: utf-8 -*-
# Copyright 2020 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... |
from __future__ import print_function
import FWCore.ParameterSet.Config as cms
import sys
process = cms.Process("CASTORDQM")
unitTest=False
if 'unitTest=True' in sys.argv:
unitTest=True
#=================================
# Event Source
#================================+
if unitTest:
process.load("DQM.Integr... |
# -*- coding: utf-8 -*-
"""
@Author: tushushu
@Date: 2018-11-14 11:11:35
@Last Modified by: tushushu
@Last Modified time: 2018-11-14 11:11:35
"""
from copy import copy
from itertools import tee
from numpy import exp, ndarray
from random import randint
from statistics import median
from time import time
from typing i... |
from django.db import models
DAY_CHOICES = [
('vkl', 'Koko viikonloppu'),
('la', 'Vain lauantai'),
('su', 'Vain sunnuntai'),
]
class Artist(models.Model):
site = models.ForeignKey('sites.Site', on_delete=models.CASCADE)
day = models.CharField(max_length=max(len(i) for (i, j) in DAY_CHOICES), def... |
#!/usr/bin/env python
from fake_rpi import printf
from fake_rpi import toggle_print
# Replace libraries by fake ones
import sys
import fake_rpi
sys.modules['RPi'] = fake_rpi.RPi
sys.modules['smbus'] = fake_rpi.smbus
# Then keep the transparent import everywhere in the application and dependencies
import RPi.GPIO as... |
import sys
from pipenv.patched.notpip._internal.cli.main import main
from pipenv.patched.notpip._internal.utils.typing import MYPY_CHECK_RUNNING
if MYPY_CHECK_RUNNING:
from typing import Optional, List
def _wrapper(args=None):
# type: (Optional[List[str]]) -> int
"""Central wrapper for all old entrypoin... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = 'ipetrash'
import requests
import re
import json
rs = requests.get('https://go.mail.ru/search?q=cats')
print(rs)
data = re.search('go.dataJson = (.+);', rs.text)
if not data:
print('Not data!')
quit()
data = data.group(1)
rs_data = json.loads(da... |
import os
import sys
import torch
import numpy as np
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
ROOT_DIR = os.path.dirname(BASE_DIR)
sys.path.append(os.path.join(ROOT_DIR, 'ops'))
import cpp_wrappers.cpp_subsampling.grid_subsampling as cpp_subsampling
def grid_subsampling(points, features=None, labels=Non... |
#!/usr/bin/env python3
import sys
sys.path.insert(0,'../')
from aoc_input import *
from itertools import permutations
if len(sys.argv) != 2:
print('Usage:', sys.argv[0], '<input.txt>')
sys.exit(1)
def flatten(s):
ret = []
level = 0
for c in s:
if c == '[':
level += 1
e... |
# Copyright (c) 2014-2017, NVIDIA CORPORATION. All rights reserved.
from __future__ import absolute_import
import io
import json
import math
import os
import tarfile
import zipfile
import flask
import werkzeug.exceptions
from . import images as model_images
from . import ModelJob
from digits.pretrained_model.job im... |
'''面试题43:1~n整数中1出现的次数
输入一个整数n,求1~n这n个整数的十进制表示中1出现的次数。
--------------
Example:
input:12
output: 5 # 1,10,11,12
'''
def nums_of_1(n):
if n < 0:
return 0
return __nums_of_1(str(n), 0)
def __nums_of_1(n_str, idx):
if n_str is None or idx == len(n_str) or n_str[idx] < '0' or n_str[idx] > '9':
... |
#!/usr/bin/env python
"""Working with nested data hands-on exercise / coding challenge."""
"""08-15-21"""
import json
import os
# Get the absolute path for the directory where this file is located "here"
here = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(here, "interfaces.json")) as file:
... |
# This Python file uses the following encoding: utf-8
"""autogenerated by genpy from std_msgs/ByteMultiArray.msg. Do not edit."""
import sys
python3 = True if sys.hexversion > 0x03000000 else False
import genpy
import struct
import std_msgs.msg
class ByteMultiArray(genpy.Message):
_md5sum = "70ea476cbcfd65ac2f68f3c... |
from bc.agent.random import RandomAgent
from bc.agent.bc import BCAgent
from bc.agent.regression import RegressionAgent
from bc.agent.rl import RLAgent
|
# imports for mathematical functions
import numpy as np
from numpy import nanmean, nan
import sys
from scipy.spatial import distance
import pandas as pd
def __cluster_assignment(data, cluster_centers, N, K):
""" Assign each point in the dataset to a cluster based on its distance from cluster centers
This ... |
# Copyright (c) 2021-2022, 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://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ... |
# Acknowledgement: The implementation of Anisotropic Diffusion Filtering is borrowed from Alistair Muldal's code (https://pastebin.com/sBsPX4Y7). We thank them for this
import numpy as np
import warnings
def anisodiff(img,niter=1,kappa=50,gamma=0.1,step=(1.,1.),option=1,ploton=False):
"""
Anisotropic di... |
import re
from genie.metaparser import MetaParser
from genie.metaparser.util.schemaengine import Optional, Any
# ===================================
# Schema for:
# * 'show cts sxp connections brief'
# ===================================
class ShowCtsSxpConnectionsBriefSchema(MetaParser):
"""Schema for show cts ... |
"""
Driver of graph construction, optimization, and linking.
"""
import copy
import copyreg
import logging
import os
import pickle
import time
import warnings
from itertools import chain
from typing import List
import numpy as np
import aesara
import aesara.compile.profiling
from aesara.compile.compilelock import l... |
""" goTenna API objects - part of pyGT https://github.com/sybip/pyGT """
""" WARNING: not to be confused with gtairobj.py ("air" radio objects) """
from struct import pack, unpack
from binascii import hexlify, unhexlify
from datetime import datetime
import time
from pyTLV import tlvPack, tlvRead
from pygth16 import g... |
from .Proxy import Proxy
from robot.libraries.BuiltIn import BuiltIn
import sys
from robot.libraries.Screenshot import Screenshot
from robot.api import logger
import I18nListener as i18n
import ManyTranslations as ui
from robot.libraries.Collections import _Dictionary
class DictionariesShouldBeEqualProxy(Proxy):
d... |
#
# Copyright 2021 Red Hat Inc.
# SPDX-License-Identifier: Apache-2.0
#
"""OCP Query Handling for Reports."""
import copy
import logging
from django.db.models import F
from tenant_schemas.utils import tenant_context
from api.models import Provider
from api.report.azure.openshift.provider_map import OCPAzureProviderMa... |
# -*- coding: ascii -*-
#
# Copyright 2006-2012
# Andr\xe9 Malo or his licensors, as applicable
#
# 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-... |
import sys
import json
import argparse
import ply
import os
# The FastParser parses input using PLY
class FastParser:
def __init__(self, generatedFilesOutputDir=None):
from ply import lex
from ply import yacc
generateFiles = not generatedFilesOutputDir is None
if generateFiles:
... |
from pyzork.menu_scene import MenuScene
from pyzork.room_scene import RoomScene
# Responsible for loading scenes, processing commands,
# Owns all actors.
class Director:
def __init__(self, settings, game_data):
self.settings = settings
self.menu_data = game_data["menus"]
self.room_data = ga... |
#!/usr/bin/python
import argparse
import sys, subprocess
import time
params = {
'GCI' : 'gcloud compute instances',
'ZONE' : 'us-west1-b',
'INSTANCE_NAME' : 'myinstance',
'TEMPLATE_NAME' : 'cpu-tiny',
# 'DISK' : 'disk1'
}
cpu_types = {
'cpu-tiny' : 'f1-micro', # $0.004, 1 cpu, 0.6 GB ra... |
from logging.config import fileConfig
from sqlalchemy import engine_from_config
from sqlalchemy import pool
from sqlalchemy import create_engine
from sqlalchemy.ext.declarative import declarative_base
from alembic import context
import sys
import os
sys.path.append(os.path.join(os.path.dirname(__file__), ".."))
from ... |
import hashlib
import json
import time
import sqlite3 as sql
import random
def get_head(email):
return 'https://s.gravatar.com/avatar/' + hashlib.md5(email.lower().encode()).hexdigest() + '?s=144'
class DataBase:
def __init__(self):
self.file_db_init = "db_init.sql"
self.file_room_init = "ro... |
import pytest
from django.urls import resolve, reverse
from fahari.users.models import User
pytestmark = pytest.mark.django_db
def test_detail(user: User):
assert (
reverse("users:detail", kwargs={"username": user.username}) == f"/users/{user.username}/"
)
assert resolve(f"/users/{user.username}... |
from OpenGLCffi.GLES2 import params
@params(api='gles2', prms=['texture', 'target', 'origtexture', 'internalformat', 'minlevel', 'numlevels', 'minlayer', 'numlayers'])
def glTextureViewEXT(texture, target, origtexture, internalformat, minlevel, numlevels, minlayer, numlayers):
pass
|
from sklearn.preprocessing._function_transformer import FunctionTransformer as Op
import lale.helpers
import lale.operators
import lale.docstrings
from numpy import nan, inf
class FunctionTransformerImpl():
def __init__(self, func=None, inverse_func=None, validate=None, accept_sparse=False, pass_y='deprecated', ... |
# Copyright 2018 Open Source Robotics Foundation, 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... |
from math import pi, sqrt, sin, cos
from raytracer.tuple import (
tuple,
point,
vector,
magnitude,
normalize,
dot,
cross,
Color,
)
from raytracer.canvas import canvas
from raytracer.util import equal
from raytracer.matrices import Matrix, I
from raytracer.transformations import (
tr... |
#!/usr/bin/env python3
'''This is a copy of the python script that bashtop starts in a coprocess when using psutil for data collection'''
import os, sys, subprocess, re, time, psutil
from datetime import timedelta
from collections import defaultdict
from typing import List, Set, Dict, Tuple, Optional, Union
system: ... |
#! /usr/bin/python3 -i
import unicodedata
from tokenizers import Tokenizer,models,pre_tokenizers,normalizers,decoders,trainers
from transformers import RemBertTokenizerFast,AutoTokenizer
tkz=AutoTokenizer.from_pretrained("KoichiYasuoka/bert-base-japanese-luw-upos")
alp=[c for c in tkz.convert_ids_to_tokens([i for i in... |
from rs4 import asynchat, asyncore
import re, os, sys
import ssl
import socket
import time
import zlib
from warnings import warn
from errno import ECONNRESET, ENOTCONN, ESHUTDOWN, ECONNABORTED, EWOULDBLOCK
if os.name == "nt":
from errno import WSAENOTCONN
import select
import threading
from . import adns
from ..protoc... |
import six
import copy
import json
class lazy_format(object):
__slots__ = ('fmt', 'args', 'kwargs')
def __init__(self, fmt, *args, **kwargs):
self.fmt = fmt
self.args = args
self.kwargs = kwargs
def __str__(self):
return self.fmt.format(*self.args, **self.kwargs)
def sa... |
import os
import json
import collections
import re
import markdown
from . import config
from . import stixhelpers
from . import relationshiphelpers
from . import util
def generate():
"""Responsible for verifying group directory and starting off
group markdown generation
"""
# Verify if directory e... |
'''
Merge Two Sorted Lists
Asked in:
Microsoft
Yahoo
Amazon
Merge two sorted linked lists and return it as a new list.
The new list should be made by splicing together the nodes of the first two lists, and should also be sorted.
For example, given following linked lists :
5 -> 8 -> 20
4 -> 11 -> 15
The merged ... |
"""
ro.py
A modern, asynchronous wrapper for the Roblox web API.
Copyright 2020-present jmkdev
License: MIT, see LICENSE
"""
# Find the original here: https://github.com/Rapptz/discord.py/blob/master/discord/__init__.py
__title__ = "roblox"
__author__ = "jmkdev"
__license__ = "MIT"
__copyright__ = "Copyright 2... |
"""API Star Contrib."""
__author__ = """Ryan Anguiano"""
__email__ = 'ryan.anguiano@gmail.com'
__version__ = '0.0.6'
|
from django.contrib import admin
from .models import Comment, Follow, Group, Post
EMPTY_VALUE = '-пусто-'
class CommentInLine(admin.TabularInline):
model = Comment
@admin.register(Post)
class PostAdmin(admin.ModelAdmin):
list_display = ('text', 'pub_date', 'author',)
search_fields = ('text',)
list... |
# -- coding: utf-8 --
import logging
import serial
import struct
class TemperatureLogger:
_SERIAL_SPEED = 9600
_SERIAL_TIMEOUT = 1
_PAYLOAD_REQUEST = 'A'
_PAYLOAD_SIZE = 45
_PAYLOAD_DATA_OFFSET_LOW = 7
_PAYLOAD_DATA_OFFSET_HIGH = 9
def __init__(self, port):
self._logger = loggin... |
"""Plotting functions for visualizing distributions."""
from __future__ import division
import numpy as np
from scipy import stats
import pandas as pd
import matplotlib as mpl
import matplotlib.pyplot as plt
import matplotlib.transforms as tx
from matplotlib.collections import LineCollection
import warnings
from distut... |
# ----------------------------------------------------------------------------
# Copyright (c) 2016-2019, QIIME 2 development team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file LICENSE, distributed with this software.
# ------------------------------------------------... |
from __future__ import annotations
import asyncio
import logging
from collections import UserDict
from time import sleep
import pytest
import dask.config
import distributed.system
from distributed import Client, Event, Nanny, Worker, wait
from distributed.core import Status
from distributed.spill import has_zict_21... |
#!/usr/bin/python
#
# Copyright 2010 Google 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 a... |
from os import path as os_path
from os import mkdir as os_mkdir
from rdkit.Chem import MolFromSmiles, MolFromInchi, MolToSmiles, MolToInchi, MolToInchiKey
from csv import DictReader as csv_DictReader
from csv import reader as csv_reader
from logging import getLogger as logging_getLogger... |
# coding: utf8
from __future__ import unicode_literals
from ...symbols import ORTH, LEMMA
_exc = {}
# Time
for exc_data in [
{LEMMA: "قبل الميلاد", ORTH: "ق.م"},
{LEMMA: "بعد الميلاد", ORTH: "ب. م"},
{LEMMA: "ميلادي", ORTH: ".م"},
{LEMMA: "هجري", ORTH: ".هـ"},
{LEMMA: "توفي", ORTH: ".ت"},
]:
... |
import filer.fields.file
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
("cms", "0003_auto_20140926_2347"),
("filer", "0001_initial"),
]
o... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import simplejson as json
from alipay.aop.api.FileItem import FileItem
from alipay.aop.api.constant.ParamConstants import *
from alipay.aop.api.domain.AlipayCommerceKidsTokenCreateModel import AlipayCommerceKidsTokenCreateModel
class AlipayCommerceKidsTokenCreateReques... |
# Copyright (c) 2018-2020, NVIDIA CORPORATION.
from __future__ import division
import inspect
import itertools
import numbers
import pickle
import sys
import warnings
from collections import OrderedDict, defaultdict
from collections.abc import Iterable, Mapping, Sequence
import cupy
import numpy as np
import pandas a... |
import datetime
import pytest
from flashbriefing.models import Feed, Item, ItemType
@pytest.mark.django_db
def test_item_type_audio():
feed = Feed.objects.create(title='FEED')
item = Item.objects.create(
feed=feed, title='ITEM', audio_content='/audio.mp3',
published_date=datetime.datetime.utc... |
#sqlite connect and interact with db
#sqlite db name test.sqlite
#sqlite db location c:\python27\
#db tables = users (name)
import sqlite3 #imports sqlite module
conn = sqlite3.connect('test.sqlite') #connects to the test.sqlite db
c = conn.cursor()
#variable define section
tablename1 = 'users'
newfield = 'use... |
Entity.objects.get(name__icontains = u'ed')
|
from constant import *
from common_object import Variant, Boundary, Loop
import vcf
import sys
import random
import re
import numpy as np
import warnings
def extract_variants(input_file, sample, vt=None, svtype=None, notgt=None, qual=30, all_variant=False):
'''
In pyVCF, start and end are 0-based, but POS is ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
###############################################################################
# Copyright Kitware Inc. and Epidemico Inc.
#
# Licensed under the Apache License, Version 2.0 ( the "License" );
# you may not use this file except in compliance with the License.
# You ma... |
from django.apps import AppConfig
from django.utils.translation import ugettext_lazy as _
class UsersConfig(AppConfig):
name = 'dvhb_hybrid.users'
label = 'dvhb_hybrid.users'
verbose_name = _('users')
|
import smart_imports
smart_imports.all()
class DropItemAbilityTest(helpers.UseAbilityTaskMixin, utils_testcase.TestCase):
PROCESSOR = deck.drop_item.DropItem
def setUp(self):
super(DropItemAbilityTest, self).setUp()
game_logic.create_test_map()
self.account = self.accounts_factory... |
#!/usr/bin/env python
from Builder import get_workspace
import argparse
parser = argparse.ArgumentParser(description='Build binned workspaces.')
parser.add_argument('argument', type=str, choices = ['bins','chans','nps','events'],
help='The parameter to be scaled')
parser.add_argument('-l',dest='so... |
# -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2016-2019 CERN.
#
# Invenio is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
"""File size limiting functionality for Invenio-Files-REST."""
def file_size_limite... |
# -*- coding: utf-8 -*-
"""
flask.wrappers
~~~~~~~~~~~~~~
Implements the WSGI wrappers (request and response).
:copyright: (c) 2015 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
from werkzeug.exceptions import BadRequest
from werkzeug.wrappers import Request as RequestBase, R... |
"""
Settings and configuration for Django.
Read values from the module specified by the DJANGO_SETTINGS_MODULE environment
variable, and then from django.conf.global_settings; see the global_settings.py
for a list of all possible variables.
"""
import importlib
from importlib.util import find_spec
class Settings(ob... |
from __future__ import absolute_import
from __future__ import print_function
from six.moves import map
from six.moves import range
if 1:
import numpy as N
from statlib import pstat, stats
from .pstat import *
from .stats import *
from numpy import linalg as LA
import operator, math
def aano... |
"""
Image resampling methods.
"""
import numpy as np
import scipy.interpolate
import scipy.ndimage
from sunpy.util.exceptions import warn_deprecated
__all__ = ['resample', 'reshape_image_to_4d_superpixel']
def resample(orig, dimensions, method='linear', center=False, minusone=False):
"""
Returns a new `nump... |
# Copyright 2013 Hewlett-Packard Development Company, L.P.
# 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... |
# -----------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# -----------------------------------------------------------------------------
""... |
# from def_InstantRaise import InstanceRaise
# from def_Momentum1mo import Momentum1mo
# from def_Momentum3mos import Momentum3mos
# from def_Updown import Updown
from def_Dual import Dual
# InstanceRaise() # 16 min
# Momentum3mos() # 3 min 57 sec
# Momentum1mo() # 4 min 40 sec
# Updown() # 4 min 20 sec
Dual() # 40 se... |
import wx
from resource_path import resource_path
from subprocess import Popen
from SpreadsheettoEAD.func.globals import init
import SpreadsheettoEAD.func.globals
import xml.etree.cElementTree as ET
import wx.lib.scrolledpanel as scrolled
from SpreadsheettoEAD import SpreadsheettoEAD
import traceback
import sys
from t... |
# -*- coding: utf-8 -*-
"""
:mod:`orion.core.worker` -- Coordination of the optimization procedure
======================================================================
.. module:: worker
:platform: Unix
:synopsis: Executes optimization steps and runs training experiment
with parameter values suggested.
... |
#!/usr/bin/env python3
# day213.py
# By Sebastian Raaphorst
from typing import List
from itertools import combinations
def is_valid_ip_segment(s: str) -> bool:
if not s.isnumeric():
return False
if len(s) == 0:
return False
if len(s) > 1 and s[0] == '0':
return False
if int(s)... |
import numpy as np
import matplotlib.pyplot as plt
import gurobipy as gp
from gurobipy import GRB, quicksum
"""
The user MUST install Gurobi to use this program.
Check https://www.gurobi.com/ for installation details.
"""
def Solve1BitCS(y,Z,m,d,s):
'''
This function creates a quadratic programming model, cal... |
#!/usr/bin/env python3
import rospy
rospy.init_node("buzzer")
rospy.spin()
|
# conding: utf-8
from sys import argv
from os.path import exists
script, fromFile, toFile = argv
print('Copying form %s to %s' %(fromFile, toFile))
# we could to these two on one line too, how?
input = open(fromFile)
inData = input.read()
print('The input file is %d bytes long' % len(inData))
print('Does the outp... |
import sys,string,argparse
from optparse import OptionParser
parser = argparse.ArgumentParser(description="VS Using QuickVina2")
parser.add_argument('receptor', metavar='receptor',help="receptor in PDBQT file")
parser.add_argument('dbase', metavar='dbase', help="database in SDF file with full hydrogen")
parser.add_argu... |
# Constants (User configurable)
APP_NAME = '2018_11_20_Periscope_X_PaintingSegmentationCheck' # Used to generate derivative names unique to the application.
# DOCKER REGISTRY INFORMATION:
DOCKERHUB_TAG = 'bethcimini/distributed-cellprofiler:1.2.1_319_highmem_plugins'
# AWS GENERAL SETTINGS:
AWS_REGION... |
# Code for tagging temporal expressions in text
# For details of the TIMEX format, see http://timex2.mitre.org/
# Converted to Python3 by Brian Hockenmaier in 2019
import re
import string
import os
import sys
from datetime import datetime, timedelta
# Python3 version no longer requires eGenix.com mx Base Distribution... |
#!/usr/bin/env python3
# Tests check_format.py. This must be run in a context where the clang
# version and settings are compatible with the one in the Envoy
# docker. Normally this is run via check_format_test.sh, which
# executes it in under docker.
from __future__ import print_function
from run_command import run... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.