content stringlengths 5 1.05M |
|---|
"""
Brainstem mesh using a tapered cylinder
"""
from __future__ import division
import copy
from opencmiss.zinc.element import Element
from opencmiss.zinc.node import Node
from opencmiss.zinc.field import Field, FieldFindMeshLocation
from opencmiss.utils.zinc.field import Field, findOrCreateFieldCoordinates, findOrCre... |
# detected_template = self._wait_for_template(['login/main_panel', 'login/close_announcement'],
# max_retry=60, retry_interval=2)
# if detected_template == 'login/close_announcement':
# self.logger.debug('detected announcement, closing it')
# self._click_template('log... |
import urllib3
import requests
import os
import time
import threading
from Crypto.Cipher import AES
from bs4 import BeautifulSoup
urllib3.disable_warnings()
site_url = "https://jable.tv/videos/abp-984/"
request_header = {
"authority": "tggfk0.cdnlab.live",
"method": "GET",
"scheme": "https",
"accept":... |
# encoding=utf-8
"""
Script for generating figure which groups work in the survey by base classifier used.
"""
import argparse
import os
import numpy as np
import pandas as pd
import seaborn
from matplotlib import cm
from matplotlib import pyplot as plt
try:
from scripts import load_data
except... |
# Copyright 2016 Dell Inc.
# ALL RIGHTS RESERVED.
#
# This file is provided for demonstration and educational uses only.
# Permission to use, copy, modify and distribute this file for
# any purpose and without fee is hereby granted, provided that the
# above copyright notice and this permission notice appear in a... |
from rest_framework.viewsets import ModelViewSet
from Employee_Registration.models import Employee
from API.serializer import EmployeeSerializer
#queryset = Select all objects in the model
class EmployeeViewset(ModelViewSet):
queryset = Employee.objects.all()
serializer_class = EmployeeSerializer |
def checkdictionary(word):
commanddictionary = ['visitsite:','close','shell:']
for x in range(len(commanddictionary)):
for command in commanddictionary:
if command in word:
return word
else:
return False
|
import os
import pytest
from bs4 import BeautifulSoup
from sphinx.testing.path import path
# from sphinx.application import Sphinx
pytest_plugins = "sphinx.testing.fixtures"
@pytest.fixture(scope="session")
def rootdir():
return path(__file__).parent.abspath() / "roots"
@pytest.fixture()
def content(app):
... |
from draft_content import read_draft_content_src
from simple_srt import tracks_to_srt_string
if __name__ == '__main__':
print(r'''剪映的草稿文件一般位于 C:\Users\您的用户名\AppData\Local\JianyingPro\User Data\Projects 。''')
draft_content_directory = input("请输入 draft_content.json 的地址>>")
if not draft_content_direct... |
# -*- coding: utf-8 -*-
# Copyright (C) 2012-2014 Mag. Christian Tanzer All rights reserved
# Glasauergasse 32, A--1130 Wien, Austria. tanzer@swing.co.at
# #*** <License> ************************************************************#
# This module is part of the package GTW.RST.
#
# This module is licensed under the te... |
import numpy as np
from incremental_trees.models.classification.streaming_extc import StreamingEXTC
from incremental_trees.models.classification.streaming_rfc import StreamingRFC
from incremental_trees.models.regression.streaming_extr import StreamingEXTR
from incremental_trees.models.regression.streaming_rfr import S... |
from typing import Optional
from aiohttp import ClientSession
class HttpAsyncSession:
session: Optional[ClientSession] = None
def start(self):
self.session = ClientSession()
async def stop(self):
await self.session.close()
self.session = None
def __call__(self) -> ClientSes... |
class FunctionResult:
def __init__(
self,
message,
path=None
):
super().__init__()
if path:
new_path = []
for p in path:
if type(p) is str:
new_path.append(p)
elif p:
new_path... |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright [2010] [Anso Labs, 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
... |
# Copyright (C) 2019 Intel 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 required by applicable law or agreed to in wri... |
def Euler_Simple_Linear_System(t, dt):
"""
Args:
time: time
dt: time-step
Returns:
r_E: Excitation Firing Rate
r_I: Inhibition Firing Rate
"""
tau_E = 100
tau_I = 120
n = len(t)
r_I = 20*np.ones(n)
r_E = 30*np.ones(n)
for i in range(n-1):
dr_E = -r_I[i]/tau_E
r_E[i+1] = r_... |
"""Utility script to create the training and test json files for speechrecognition.
"""
import os
import argparse
import json
import random
def main(args):
data = []
directory = args.file_folder_directory
filetxtname = args.file_folder_directory.rpartition('/')[2]
percent = args.percent
... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Mar 2 12:45:22 2022
@author: devoncallan
"""
import numpy as np
import math
PI = np.pi
SQRT3 = np.sqrt(3)
SQRT3_OVER_TWO = np.sqrt(3)/2
SQRT3_OVER_THREE = np.sqrt(3)/3
SQRT3_OVER_SIX = np.sqrt(3)/6
class Model:
def __init__(self, name:str, f... |
from pathlib import Path
from pyspark.sql import SparkSession, functions as f
from pyspark.sql.dataframe import DataFrame
from src.helpers.run import Run, get_last_run_timestamp
from src.G_prepare_synthetic_annotations_for_ner.schemas import (
SYNTHESISED_ANNOTATIONS_INPUT_SCHEMA,
)
# Monkeypatch in case I don... |
# Generated by Django 2.2.1 on 2019-05-30 13:23
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUT... |
import json
import argparse
from bs4 import BeautifulSoup
import hashlib
import requests
import os,sys
parser = argparse.ArgumentParser()
parser.add_argument('-c', help='Config file', required=True)
parser.add_argument('-o', help='Output file', required=True)
args = parser.parse_args()
def main():
config_file = o... |
from datetime import datetime
from functools import reduce
from typing import Tuple, NamedTuple, TypeVar, Callable, Iterable
from fn.func import curried
from fn.iters import filter_tuple, map_tuple
from fn.monad import Either
from models import Station
from .updater_interactor import UpdaterInteractor
UpdateResponse... |
# Midpoint circle drawing algorithm
from graphics import *
import time
import ctypes
user32 = ctypes.windll.user32
scrnWidth, scrnHeight= (user32.GetSystemMetrics(0)-100), (user32.GetSystemMetrics(1)-100)
print("Circle drawing using Midpoint algorithm : ")
center = tuple(int(x.strip()) for x in input("Enter co... |
from tensorflow.keras.preprocessing.image import ImageDataGenerator
from tensorflow.keras.applications import VGG16, Xception, DenseNet201 ,ResNet50, InceptionV3 #pretrained model
from tensorflow.keras.layers import AveragePooling2D, MaxPooling2D
from tensorflow.keras.layers import Dropout
from tensorflow.ker... |
from netaddr import IPAddress
__all__ = [
'to_server_dict',
'to_dns_zone_dict',
'to_dns_record_dict'
]
def to_server_dict(server):
public_ips = [ip['addr'] for ip in server.addresses['public']]
private_ips = [ip['addr'] for ip in server.addresses['private']]
# Pick out first public IPv4 and ... |
import matplotlib
matplotlib.rcParams['text.usetex'] = True
import matplotlib.pyplot as plt
import numpy as np
import sympy as sp
"""
# ax.quiver([sx],[sy],[sz],[ex],[ey],[ez])
sx[] = starting compoent of x cordinate
sy[] = starting compoent of y cordinate
sz[] = starting compoent of z cord... |
import os
import sys
import re
class LogFile:
def __init__(self):
pass
def parse_star_log(self, file_path):
'''Parse STAR-aligner log file.
STAR aligner outputs the final log file (*.Log.final.out).
This function is used for parsing the final log fil... |
from pysb.examples import bngwiki_egfr_simple
from pysb.simulator import AmiciSimulator
import os
import platform
import shutil
try:
import amici
except:
amici = None
if platform.system() != 'Windows':
class TestAmiciSimulatorBase(object):
def __init__(self):
self.model = bngwiki_egf... |
# Greewald et al. 1998
Japanese_names = ["Hitaka", "Yokomichi", "Fukamachi", "Yamamoto", "Itsumatsu", "Yagimoto", "Kawabashi", "Tsukimoto", "Kushibashi", "Tanaka", "Kuzumaki", "Takasawa", "Fujimoto", "Sugimoto", "Fukuyama", "Samukawa", "Harashima", "Sakata", "Kamakura", "Namikawa", "Kitayama", "Nakamoto", "Minakami", "... |
from django.db.models.signals import post_save
from django.conf import settings
from django.dispatch import receiver
from . models import Profile
@receiver(post_save, sender=settings.AUTH_USER_MODEL)
def create_or_update_user_profile(sender, instance, created, **kwargs):
if created:
Profile.objec... |
from .sbaas_base_query_select import sbaas_base_query_select
from sqlalchemy.exc import SQLAlchemyError
class sbaas_base_query_drop(sbaas_base_query_select):
def drop_table_sqlalchemyModel(self, model_I, warn_I=True):
'''drop table
INPUT:
model_I = sqlalchemy model
warn_I = if True,... |
"""
Talking NPC - Griatch 2011, grungies1138 2016
"""
from .talking_npc import CmdTalk, TalkingCmdSet, TalkingNPC # noqa
|
# -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2017-05-30 13:25
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Status',... |
import os
c = get_config() # noqa: F821
c.NotebookApp.open_browser = False
c.ServerApp.token = ''
c.ServerApp.password = ''
c.ServerApp.base_url=os.getenv('NB_PREFIX', '')
c.FileContentsManager.delete_to_trash = False
c.ServerProxy.servers = {}
c.ServerProxy.servers['vscode'] = {
'command': ['/bin/bash', '-c', ... |
import sys
from textwrap import dedent
import pytest
from hbutils.testing import capture_output, disable_output
@pytest.mark.unittest
class TestTestingCaptureOutput:
def test_capture_output(self):
with capture_output() as r:
print('This is stdout.')
print('This is stderr.', file=... |
class Offset:
def __init__(self, offset: int):
self.offset = offset
def __str__(self) -> str:
return f'({self.offset})' if self.offset != 0 else '' |
"""Test zigate light."""
import unittest
class TestLight(unittest.TestCase):
def test_light(self):
from custom_components.zigate import light # noqa
if __name__ == '__main__':
unittest.main()
|
#!/usr/bin/env python
"""
Finds signs and loads them in a gui to edit
"""
import os, sys
import Tix, tkFileDialog
# local module
try:
import nbt
except ImportError:
# nbt not in search path. Let's see if it can be found in the parent folder
extrasearchpath = os.path.realpath(os.path.join(sys.path[0],os.pardir))
if... |
import os
client_stmt = "psql -p 7483 -h localhost -U pedroholanda -c "
def runTPCH(scale):
query_1 = '\"select l_returnflag, l_linestatus, sum(l_quantity) as sum_qty, sum(l_extendedprice) as sum_base_price, sum(l_extendedprice * (1 - l_discount)) as sum_disc_price, sum(l_extendedprice * (1 - l_discount) * (1 + ... |
# -*- coding: utf-8 -*-
"""Module for cookbook testing
This test should be run from main yt directory.
Example:
$ sed -e '/where/d' -i nose.cfg setup.cfg
$ nosetests doc/source/cookbook/tests/test_cookbook.py -P -v
"""
import glob
import os
import subprocess
import sys
def run_with_capture(*args, **kw... |
#!/usr/bin/env python2
import pysynphot as S
import pyfits as pf
from collections import OrderedDict
import numpy as np
import matplotlib.pyplot as plt
from PHOENIX_tools import load_flux_full, w_full
from deredden import deredden
c_ang = 2.99792458e18 #A s^-1
#data for GWOri
#wl [microns], f_nu [Jy], sys_err (as fr... |
# ALL the combinations of 4 digit combo
def FourDigitCombinations():
numbers=[]
for code in range(10000):
code=str(code).zfill(4)
print(code)
numbers.append(code)
# Same as above but more pythonic
def oneLineCombinations():
numbers = list(map(lambda x: str(x).zfill(4), [i for i in r... |
# helper functions
import numpy as np
# log of determinant of a matrix
# Cholesky decomposition is twice as fast as LU-decomposition when used to calculate general matrix determinants
def logdet(A):
U = np.linalg.cholesky(A).T # A = (U.T) * U
y = 2*np.sum(np.log(np.diag(U))) # logdet(A) = log(det(A)) wh... |
from django import template
register = template.Library()
def do_user_avatar(parser, token):
return UserAvatarNode()
class UserAvatarNode(template.Node):
def render(self, context):
user = context['request'].user
if not user.is_anonymous():
return_value = user.avatar_num
... |
import math
rooms = int(input())
people = int(input())
all = math.floor(people/rooms)
stars = ''.join(['*' for r in range(all)])
extra = people%rooms
for room in range(rooms):
if extra > 0:
print(stars+"*")
extra-=1
else:
print(stars)
|
# Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
import sys
import mock
import pytest
client_session_helper = mock.Mock()
helper = mock.Mock()
sys.modules["client_session_helper"] = client_session_helper
sys.modules["helper"] = helper
@pytest.fixture()... |
from io import StringIO
import sys
from django.contrib.auth import get_user_model
from django.core.management import call_command
from django.test import TestCase
from data_management.models import Object, StorageLocation, StorageRoot
class AddExampleDataTests(TestCase):
def test_command_output(self):
""... |
#/usr/bin/env python2
import sys
import serial
import time
IPDONTCARE = -1
IP0 = 0
IP1 = 1
CMD_MASK = 0xc0
CMD_SV = 0x00
CMD_PA = 0x40
CMD_DI ... |
import logging
from datetime import timedelta
from django.conf import settings
from django.db.models import Max
from django.utils.dateparse import parse_datetime
from apps.physicaldevice.models import Device
from apps.project.models import Project
from apps.sqsworker.action import Action
from apps.sqsworker.exception... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu May 3 10:45:33 2018
@author: Frank Kane
"""
from surprise import accuracy
class EvaluatedAlgorithm:
"""
It defines a wrapper for calling the Recommender Metrics module.
"""
def __init__(self, algorithm, name):
... |
import random as rnd
adjs = []
with open("adjectives.txt") as f:
adjs = list(f)
animals = []
with open("animalsExtended.txt") as f:
animals = list(f)
colors = []
with open("colours.txt") as f:
colors = list(f)
nouns = []
with open("nouns_basic.txt") as f:
nouns = list(f)
verbs = []
with open("verb... |
from __future__ import absolute_import, division
import sys
from cctbx import crystal, sgtbx
from iotbx import mtz
def measure(hklin, spacegroup):
'''Look at HKLIN, see how strong the absences (according to the given
spacegroup) are... looking for IPR / SIGIPR.'''
mtz_obj = mtz.object(hklin)
sg = sgtbx.spa... |
"""Dungeon generator."""
from random import randint, choice, sample
from time import time
from tiletypes import TileTypes
from message import MsgType
import constants as cons
class Room():
"""A room in a dungeon. Holds info about as well as
methods for interacting with a room while randomly constructing
... |
#!/usr/bin/env python3
from flask import Flask
from configparser import ConfigParser
__author__ = "Richard Pöttler & Manuel Pirker"
__copyright__ = "Copyright (c) 2021 Richard Pöttler & Manuel Pirker"
__license__ = "MIT"
__email__ = "manuel.pirker@tugraz.at"
app = Flask(__name__)
config = ConfigParser()
config.rea... |
"""
Ingest and parse WZDx feed data to Work Zone Data Sandbox.
"""
import json
import logging
import os
import traceback
from wzdx_sandbox.wzdx_sandbox import WorkZoneSandbox
logger = logging.getLogger()
logger.setLevel(logging.INFO) # necessary to make sure aws is logging
BUCKET = os.environ.get('BUCKET')
if No... |
#!/usr/bin/env python
# -- encoding: utf-8 --
#
# Copyright 2015 Telefónica Investigación y Desarrollo, S.A.U
#
# This file is part of FI-Core project.
#
# 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 ... |
from django.db import models
from django.contrib.auth.models import User
# Create your models here.
class Domain(models.Model):
domain = models.CharField(max_length=128, unique=True, help_text="域名")
path = models.CharField(max_length=255, help_text="域名区域文件路径")
create_time = models.DateTimeField(auto_now=... |
"""emrcontainers module initialization; sets value for base decorator."""
from .models import emrcontainers_backends
from ..core.models import base_decorator
REGION = "us-east-1"
mock_emrcontainers = base_decorator(emrcontainers_backends)
|
"""
Formantando valores com modificadores - aula 5
:s - Texto (strings)
:d - inteiro (int)
:f - numero de ponto flutuante (float)
:.(numero)f - quantidade de casa decimais (float) ex: :.2f
: (caractere) (> ou < ou ^) (quantidade) (tipo - s, d ou f)
> - esquerda
< - Direita
^ - centro
"""
nome = 'Pedro'
sobrenome = 'He... |
import json
import requests_mock
from helix_fhir_client_sdk.fhir_client import FhirClient
from helix_fhir_client_sdk.responses.fhir_get_response import FhirGetResponse
def test_fhir_client_bundle() -> None:
with requests_mock.Mocker() as mock:
url = "http://foo"
response_text = {
"re... |
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.nn import init
class HSwish(nn.Module):
def __init__(self, inplace=True):
super(HSwish, self).__init__()
self.inplace = inplace
def forward(self, x):
out = x * F.relu6(x + 3, inplace=self.inplace) / 6
return out
class HSigmoid(n... |
import unittest
from app.models import Pitch,User,Comment
from app import db
class TestPost(unittest.TestCase):
def setUp(self):
self.user_Daniel = User(username = 'Daniel',password = 'daniel', email = 'daniel@ms.com')
self.new_pitch = Pitch(id=1, category = 'interview',title = 'promotion', pitch =... |
# This is an auto-generated Django model module.
# You'll have to do the following manually to clean this up:
# * Rearrange models' order
# * Make sure each model has one field with primary_key=True
# * Make sure each ForeignKey and OneToOneField has `on_delete` set to the desired behavior
# * Remove `managed =... |
"""Command to show metadata."""
import asyncio
from typing import Optional
import click
from astoria.common.messages.astmetad import MetadataManagerMessage
from astoria.consumers.astctl.command import SingleManagerMessageCommand
loop = asyncio.get_event_loop()
@click.command("show")
@click.option("-v", "--verbose"... |
import os
import soundfile as sf
import torch
import torch.utils.data as data_utils
os.system("CHECKPOINT_FILENAME=avg_checkpoint_all.pt "
"python /Users/bdubel/Documents/ZHAW/BA/fairseq/scripts/average_checkpoints.py "
"--inputs /Users/bdubel/Documents/ZHAW/BA/data/swiss_all/checkpoints --num-epoc... |
#!/usr/bin/env python
import os
import shutil
import subprocess
import sys
import tarfile
import urllib
# Get the sources, unzip them, delete the archive
filename,_ = urllib.urlretrieve("http://sourceforge.net/projects/itk/files/itk/3.14/InsightToolkit-3.14.0.tar.gz/download")
archive = tarfile.open(filename)
arc... |
class Middle(General):
|
# coding: utf-8
from __future__ import absolute_import
import unittest
from gitee.api.milestones_api import MilestonesApi # noqa: E501
class TestMilestonesApi(unittest.TestCase):
"""MilestonesApi unit test stubs"""
def setUp(self):
self.api = MilestonesApi() # noqa: E501
def tearDown(self)... |
################################################################################
# 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... |
class Graph:
def __init__(self, edges):
self.edges = edges
self.graph_dict = {}
for start, end in self.edges:
if start in self.graph_dict:
# one value already exists. append to list
self.graph_dict[start].append(end)
else:
... |
from src.wrapper.sh1106 import Screen
from src.modules.clock_module import Module as ClockModule
from src.modules.temperature_module import Module as TemperatureModule
from PIL import Image, ImageDraw, ImageFont
import os
font_path = os.path.join('assets', 'Font.ttf')
class MenuItem:
def __init__(self, title, mod... |
# Embedded file name: /usr/lib/enigma2/python/Plugins/Extensions/MyMetrix/metrixCloudSync.py
import metrixDefaults
import random
import metrixCore
import traceback
config = metrixDefaults.loadDefaults()
def getSyncRow(area, category, keyname, keydescription, value, order = 0):
row = []
row.append(area)
row... |
#!/usr/bin/env python
# Copyright 2021 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 ... |
#!/usr/bin/env python
# coding: utf-8
# In[ ]:
import numpy,matplotlib,pandas
from general_functions import *
import matplotlib.pyplot as plt
# In[ ]:
font = {'size' : 14, 'family' : 'serif', 'serif' : 'cm'}
plt.rc('font', **font)
plt.rcParams['image.interpolation'] = 'nearest'
plt.rcParams['lines.linewidth'] ... |
# -*- coding: utf-8 -*-
##########################################################
# Rutap Bot 2019 Setting Module #
# 모든 저작권은 팀 화공이 소유합니다. 모든 권리를 보유합니다. #
# BSD 3-Clause License #
##########################################################
"""
[여는 말]
... |
from ._lasso_problem import LassoProblem
|
from setuptools import setup, find_packages
setup(
name='py-manage-server',
version='0.0.1',
description='server config manager written in Python',
long_description='README.md',
author='Danil Koudlo',
author_email='dkoudlo@gmail.com',
install_requires=["PyYAML"],
url='https://... |
import json
import urlparse
from collections import OrderedDict
from django.conf import settings
from django.utils.http import urlencode
import requests
from django_statsd.clients import statsd
import olympia.core.logger
from olympia import amo
log = olympia.core.logger.getLogger('z.amo')
def call_recommendatio... |
import torch.nn as nn
from mmgen.models.architectures.pggan import (EqualizedLRConvModule,
EqualizedLRConvUpModule,
EqualizedLRLinearModule)
from mmgen.models.architectures.stylegan.modules import (Blur, ConstantInput,
... |
# coding: utf-8
# !/usr/bin/env python
import json
from datetime import datetime
import matplotlib.pyplot as plt
import numpy as np
import tweepy as tw
# read keys ignoring the last char in file: \n.
with open('./keys.txt') as f:
consumer_key = f.readline()[:-1]
consumer_secret = f.readline()[:-1]
access... |
# -*- coding: utf-8 -*-
# Copyright (c) 2021, Peter Zatka-Haas and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
# import frappe
from frappe.model.document import Document
from frappe.model.naming import make_autoname
class Customer(Document):
def autoname(sel... |
from .session import WithSession
class Variometer(WithSession):
def get_vario(self) -> float: # ft/s
-self._session.get('velocities/v-down-fps', float)
|
# -*- coding: utf-8 -*-
"""
Created on Fri Dec 18 14:11:31 2020
@author: leonardo
"""
from numpy import arange, random, array, argmin, vstack, atleast_1d, round
from numpy import hstack, exp, matmul, log, ones, linalg, transpose as trans
from numpy import meshgrid, min as nmin
from matplotlib import pyplot ... |
from importlib import import_module
from inspect import isclass
from pathlib import Path
from pkgutil import iter_modules
from typing import Dict, Type
from comparators.base import ComparatorBase
comparators: Dict[str, Type[ComparatorBase]] = {}
_package_dir = Path(__file__).resolve().parent
for (_, modul... |
import math
import scapy.config
def skip_interface(network, netmask, iface, address):
return network==0 or iface=='lo' or address=='127.0.0.1' or address=='0.0.0.0' or netmask<=0 or netmask==0xFFFFFFFF or iface.startswith('docker')
def long2net(netmask):
if (netmask <= 0 or netmask >= 0xFFFFFFFF):
rai... |
class AnnotationError(Exception):
pass
class AnnotationDirectoryNoWriteAccess(AnnotationError):
pass
|
#coding=utf-8
class Logger(object):
def __init__(self, path):
self.file_path = path
# self.file = open(self.file_path, "w")
print "logger init"
def log_line(self,txt):
return
self.file.write(txt)
# self.file.flush()
def log_list(self,list):
... |
from modularodm import Q
from rest_framework import generics, permissions as drf_permissions
from framework.auth.oauth_scopes import CoreScopes
from api.base import permissions as base_permissions
from api.base.views import JSONAPIBaseView
from api.base.filters import ODMFilterMixin
from api.registrations.views imp... |
from drf_spectacular.utils import extend_schema_field
from drf_spectacular.openapi import OpenApiTypes
from rest_framework import serializers
from baserow.core.models import GroupInvitation
class GroupInvitationSerializer(serializers.ModelSerializer):
class Meta:
model = GroupInvitation
fields =... |
import argparse
import curses
from .objects.blacklistaction import BlacklistAction
from .objects.bonemarketargumentparser import BoneMarketArgumentParser
from .objects.enumaction import EnumAction
from .objects.listaction import ListAction
from .solve import *
parser = BoneMarketArgumentParser(
prog='Bone Mar... |
from django.conf.urls import url
from beer.views import BeerView
urlpatterns = [
url(r'^beer/$', BeerView.as_view(), name='beer-post'),
url(r'^beer/(?P<pk>.*)/$', BeerView.as_view(), name='beer-get'),
]
beer_api_urls = urlpatterns
|
from .widget import Widget, DOMWidget, CallbackDispatcher, register
from .widget_bool import Checkbox, ToggleButton
from .widget_button import Button
from .widget_box import Box, FlexBox, HBox, VBox
from .widget_float import FloatText, BoundedFloatText, FloatSlider, FloatProgress, FloatRangeSlider
from .widget_image i... |
__author__ = 'gtfx'
|
from __future__ import print_function
from __future__ import unicode_literals
import time
import sys
import os
import shutil
import csv
import pyspark
from pyspark.sql import SparkSession
from pyspark.sql.functions import *
from pyspark.ml.evaluation import RegressionEvaluator
from pyspark.ml.recommendation import AL... |
#!/usr/bin/env python
'''Funktion zur Zuweisung der AKFs zu den Excel Zellen'''
__author__ = 'Andreas Iakobou'
__version__ = '1.0'
__email__ = 'andreas.iakobou@partner.bmw.de'
import datetime
from datetime import timedelta
from .writexlsx import write_data
def planning(workbook, sheet, monday, akfs, Prüffeld):
... |
"""
This python file preprocesses the German Credit Dataset.
"""
import numpy as np
import pandas as pd
import tensorflow as tf
from sklearn.model_selection import train_test_split
"""
https://dataverse.harvard.edu/dataset.xhtml?persistentId=doi:10.7910/DVN/Q8MAW8
"""
# make outputs stable across ... |
# coding: utf-8
from __future__ import unicode_literals
from django.core.serializers.json import DjangoJSONEncoder
class CustomJsonEncoder(DjangoJSONEncoder):
def default(self, o):
if hasattr(o, '__class__') and o.__class__.__name__ == '__proxy__':
return str(o)
return DjangoJSONEncode... |
import logging
import unittest
import time
from requests import HTTPError
from configcatclient.autopollingcachepolicy import AutoPollingCachePolicy
from configcatclient.configcache import InMemoryConfigCache
from configcatclienttests.mocks import ConfigFetcherMock, ConfigFetcherWithErrorMock, ConfigFetcherWaitMock, \
... |
# -*- coding: utf-8 -*- #
# Copyright 2019 Google LLC. 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 requir... |
"""Control the sc2monitor."""
import asyncio
import logging
import math
import time
from datetime import datetime, timedelta
from operator import itemgetter
import aiohttp
import sc2monitor.model as model
from sc2monitor.handlers import SQLAlchemyHandler
from sc2monitor.sc2api import SC2API
logger = logging.getLogge... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.