content stringlengths 5 1.05M |
|---|
# -*- coding: utf-8 -*-
"""Config based auth mechanism."""
import json
import os
import time
import confuse
from confuse import Configuration
from confuse import ConfigValueError
from confuse import NotFoundError
from requests import models
from requests.auth import AuthBase
from .basic import login as base_login
d... |
# MIT License
#
# Copyright (c) 2020 Edinburgh Architecture and Systems (EASE) Lab @ University of Edinburgh
#
# 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... |
import pickle
from sklearn.manifold import TSNE
data = pickle.load(open('pickles/vectorlists.pickle', 'rb'))
data = data[1:]
for i in range(len(data)):
data[i] = data[i][1:]
model = TSNE(learning_rate = 100, n_components = 3, n_iter=2000)
transformed = model.fit_transform(data)
#saving in pickle
with open('pickle... |
import time
import threading
import subprocess
from datetime import datetime
from shutil import which
from mysqlog.parser import SlowQueryLog
PT_FINGERPRINT_EXISTS = which("pt-fingerprint")
class SlowQueryLogProducer(threading.Thread):
def __init__(self, file, queue, **config):
threading.Thread.__init... |
#!/usr/bin/env python
from __future__ import print_function, division
import argparse
import sys
try:
import pip._internal.pep425tags as p
except:
import pip.pep425tags as p
try:
# For Python 3.0 and later
from urllib.request import urlopen, HTTPError, Request
except ImportError:
# Fall back to Pyth... |
class Constants(object):
OVO_URL_PRODUCTION = "https://api.ovo.id/pos"
OVO_URL_STAGING = "https://api.byte-stack.net/pos"
TRANSACTION_TYPE = {
"ptp": {
"type": "0200",
"code": "040000"
},
"reversal": {
"type": "0400",
"code": "040000"
... |
import os
class Config:
def __init__(self):
self.env = 'development' if self.isDev(self.getEnvVar('ENV')) else self.getEnvVar('ENV')
self.dbURI = 'mongodb://localhost:27017/' if self.isDev(self.env) else self.getEnvVar('DB_URI')
self.dbName = '~~name~~'
def getEnvVar(self, key):
... |
from django.urls import reverse
from django.conf import settings
from django.test import override_settings, tag
from . import base, views
ADMIN_LOGIN_URL = 'dz-admin:login'
class AdminTestsMixin(views.ListViewTestsMixin):
def test_unauthorized_request_should_redirect_to_login(self):
for model_name in ('... |
# Copyright 2018 The TensorFlow Probability 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 o... |
# from tensorflow.keras.preprocessing.text import Tokenizer
import pickle
def read_data(file_path: str):
conversations = []
with open(file_path, 'r') as f:
for line_i in f:
conversations.append(line_i)
return conversations
def separate_conversation_by_participants(conversations: list... |
i = 0
print("Atomówki do skopiowania! Wpisz tekst który chcesz żeby spamiło");
hehe = input();
while i < 60000:
print(hehe, i);
i += 1 |
# noinspection PyUnresolvedReferences
from .warmup_core import main, RequestResult
__version__ = "0.1.6"
|
from itertools import groupby
def brute(min, max):
return sum(1 for x in range(min, max+1) if is_valid(str(x)))
def is_valid(x):
return always_increasing(x) and has_only_double(x)
def always_increasing(x):
return all(int(x[i]) <= int(x[i+1]) for i in range(5))
def has_double(x):
return any(x[i] ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Tests for `py2neo_compat.py2neo_compat` package."""
from __future__ import absolute_import, print_function
import inspect
import operator
import os
import sys
import pytest
import py2neo
import six
from py2neo_compat.util import foremost
from py2neo_compat import (
... |
"""Tests for the sensor module."""
from gidgethub import GitHubException
from pytest_homeassistant_custom_component.async_mock import AsyncMock, MagicMock
from custom_components.github_custom.sensor import GitHubRepoSensor
async def test_async_update_success(hass, aioclient_mock):
"""Tests a fully successful asy... |
import unittest
class LongExpText(unittest.TestCase):
def test_longexp(self):
REPS = 65580
l = eval("[" + "2," * REPS + "]")
self.assertEqual(len(l), REPS)
if __name__ == "__main__":
unittest.main()
|
import numpy as np
import cv2
capture = cv2.VideoCapture('highway.mp4')
while(capture.isOpened()):
ret, frame = capture.read()
cv2.imshow('frame',frame)
key = cv2.waitKey(25)
if key == 27:
break
capture.release()
cv2.destroyAllWindows() |
from django.conf.urls import url
from django.urls import include, path
from . import views
urlpatterns = [
path('',views.home,name='home'),
path('student/',views.student_home,name='student_home'),
path('faculty/',views.faculty_home,name='faculty_home'),
path('admin/',views.admin_home,name='admin_home'),
path('pop... |
from a10sdk.common.A10BaseClass import A10BaseClass
class VportList(A10BaseClass):
"""This class does not support CRUD Operations please use parent.
:param vserver: {"type": "string", "format": "string"}
:param port: {"type": "number", "format": "number"}
:param DeviceProxy: The device proxy for... |
"""
Multispectral URLs.
For more information on this file, see
https://docs.djangoproject.com/en/3.2/topics/http/urls/
"""
|
from django.db import models
from django.forms import ModelForm
from django.contrib.auth.models import User
class UserForm(ModelForm):
class Meta:
model = User
fields = ['username', 'password']
class Student(models.Model):
user = models.OneToOneField(User, null=True, on_delete=models.CASCADE)
... |
"""Statistics tracker class file.
"""
# Imports
import time
import json
import base64
from numpy import exp
from configparser import get_option
class Tracker(object):
"""Statistics class file.
Attributes:
arrived_lst (list): Temporary list of packets that have arrived out of order.
call_s... |
import numpy as np
# Module to find Square root, Cube root
loop = 1
# int for loop
while int(loop) == int(loop):
opr = input('''What operation you want to do (+,-,/,*,##,^,^^,//,///) [// Means square root, ^ means square,
/// means cube root, ^^ means cube, ## means average] - ''')
# Asking what operatio... |
from .sumo_reward import SumoReward
from .sumo_reward_runner import SumoRewardRunner
|
import numpy as np
import time
import warnings
warnings.filterwarnings("ignore")
def get_internal_processing_config():
return {
"image_buffer": {
"name": "Image history",
"value": 100,
"limits": [10, 10000],
"type": int,
"text": None,
},... |
import unittest
from compiler import error
class TestLoggerMock(unittest.TestCase):
"""Test the API of the LoggerMock class."""
@classmethod
def setUpClass(cls):
cls.logger_class = error.LoggerMock
@classmethod
def _make_logger(cls):
return cls.logger_class()
def setUp(self... |
import torch
import torch.nn as nn
import torch.nn.functional as F
import math
from pdb import set_trace as st
class CNN_OriginalFedAvg(torch.nn.Module):
"""The CNN model used in the original FedAvg paper:
"Communication-Efficient Learning of Deep Networks from Decentralized Data"
https://arxiv.org/abs/16... |
from __future__ import absolute_import
from .discrete_action import DiscreteAction
from .discrete_action_mapping import DiscreteActionMapping, DiscreteActionMappingEntry
from .discrete_action_pool import DiscreteActionPool
from .discrete_observation import DiscreteObservation
from .discrete_observation_mapping import D... |
import time
from copy import deepcopy
from Foundation import NSArray
from AppKit import NSOnOffButton, NSRoundRectBezelStyle, NSDate, NSColor, NSFontNameAttribute, \
NSFormatter, NSTextField, NSTextView, NSTextFieldCell, NSView, NSNoTabsNoBorder, NSButton, NSObject, \
NSDecimalNumber, NSString, NSInsetRect, NSN... |
from leapp.models import Model, fields
from leapp.topics import BootPrepTopic, SystemInfoTopic
from leapp.utils.deprecation import deprecated
class DracutModule(Model):
"""
Specify a dracut module that should be included into the initramfs
The specified dracut module has to be compatible with the target ... |
import pandas as pd
import nvstrings
import time
strs = nvstrings.from_csv('/data/tweets.csv', 7).to_host()
vlist1 = []
vlist1.extend(strs)
vlist1.extend(strs)
vlist1.extend(strs)
vlist1.extend(vlist1)
vlist1.extend(vlist1)
vlist1.extend(vlist1)
vlist1.extend(vlist1)
vlist1.extend(vlist1)
vlist1.extend(vlist1)
vlist... |
from six import string_types
from sys import exit
from time import time
from types import FunctionType
from nozdormu.loader import BenchLoader
from nozdormu.runner import BenchRunner
class BenchProgram:
"""This program loads and runs the tests"""
module = None # For testing purposes
def __init__(self, m... |
from ..interfaces import check_direction
from .. import ExchangeRequired
class ExchangeRef(object):
"""
Codifies the information required to define an exchange. The supplied information could be either object or
reference/link; it isn't specified.
"""
is_reference = None
entity_type = 'exchan... |
import pygame,random
from spritesheetparser import Spritesheet
from tiles import TileMap
from camera import *
from Player import *
from hud import *
from math import ceil
import json
class Engine():
def __init__(self):
pygame.init()
#pygame.mixer.pre_init(44100, -16, 2, 512)
#mixer.init()
self.clock = pyg... |
#!/usr/local/bin/python3
import sys
import os
from datetime import datetime
# Record TAG
TAG_STRING = 0x01
TAG_LOAD_CLASS = 0x02
TAG_UNLOAD_CLASS = 0x03
TAG_STACK_FRAME = 0x04
TAG_STACK_TRACE = 0x05
TAG_ALLOC_SITES = 0x06
TAG_HEAP_SUMMARY = 0x07
TAG_START_THREAD = 0x0A
TAG_END_THREAD = 0x0B
TAG_HEAP_DUMP = 0x0C
TAG_HE... |
from flask import Flask, render_template, url_for
from pyowm import OWM
from flask import jsonify
from flask_cors import CORS
from sklearn import tree
from sklearn.neighbors import NearestNeighbors
from sklearn.feature_extraction.text import CountVectorizer
import http.client
import json
import pandas as pd
import req... |
import tensorflow as tf
class ModelConfig():
u_hidden_sizes = [2048,1024] # hidden layers's size for the row branch
v_hidden_sizes = [2048,1024] # hidden layers's size for the column branch
dropout_keep_prob = 0.1 # dropout rate = 1.0 - dropout_keep_prob
use_bn = True # ... |
#!/usr/bin/python3
#License: WTFPL <http://www.wtfpl.net/>
#Author: zertap
import http.cookiejar
import urllib.request
from bs4 import BeautifulSoup
from io import StringIO
import sqlite3
import re
class NexusScraper():
opener = None
catid_parser = None
def __init__(self, cookie_path):
... |
# -*- coding: utf-8 -*-
import csv, os, os.path, re, urllib2
from zipfile import ZipFile
import pg
import private
database = 'cz2013'
schema = 'cz'
fullGeom = 'full_geom'
googGeom = 'goog_geom'
def process():
createDatabase( database)
db = openDatabase( database )
db.addUtilityFunctions()
createSchema( db )
... |
import operator
import functools
from os.path import abspath, dirname, join
_ROOT = dirname(dirname(abspath(__file__)))
def get_input_lines(name):
path = join(_ROOT, "inputs", name)
with open(path) as f:
return f.read().splitlines()
def product(numbers):
return functools.reduce(operator.mul, n... |
'''
This program is a handler to retrieve user's profile from data base.
It stores user_id, preferences, allergies and history.
'''
import ast
from src import frigo as fridge
from src.client_side.profiles_service_requester import get_profil
class User :
# attributs
user_id = None
preferences = []
allergies =... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat Oct 26 16:56:26 2019
@author: Chris
"""
import pandas as pd
import numpy as np
import re
import argparse
def reader(file):
MOx = []
MOy = []
MOz = []
MO_atomname = []
MO_atomnumber = []
MO_residuenumber = []
Wx =... |
import requests
# go to /profile/settings > test to generate a new token
token = "Bearer <token goes here>"
lab_id = '<course ID goes here>'
site = "https://canvas.instructure.com/api/v1/courses/%s/group_categories" % lab_id
headers = {'Authorization': token}
data = {'per_page': 100000}
categories = requests.get(site... |
from __future__ import unicode_literals
import io
import re, os, pickle, shutil, sys
import logging
import copy
from threading import Thread
from Queue import Queue
from ftplib import FTP, FTP_TLS
from sys import platform
from .utilslinux import is_file_open
from .utils import boolstr, sub_list
from .providers import B... |
# -*- coding=utf-8 -*-
r"""
MIT License
Copyright (c) 2021 PlayerG9
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, modi... |
"""
Package containing the specification of the 'convert' sub-command.
"""
from ._convert_main import convert_main
from ._ConvertOptions import ConvertOptions
from ._help import convert_help
from ._macros import perform_macro_expansion
|
from lps36.errors.error import LPS36Error
from lps36.errors.connection import ConnectionError
|
from bhabana.models import Bottle
from bhabana.models import TransLinear as Linear
class BottleLinear(Bottle, Linear):
''' Perform the reshape routine before and after a linear projection '''
pass |
from abc import ABC, abstractmethod
from contextlib import asynccontextmanager, contextmanager
from time import time
from typing import TYPE_CHECKING, Any, AsyncIterator, Iterator, Optional
if TYPE_CHECKING: # pragma: no cover
from yatq.dto import Task
class BaseJob(ABC):
def __init__(self, task: "Task") ->... |
# Copyright (c) 2015 Shotgun Software Inc.
#
# CONFIDENTIAL AND PROPRIETARY
#
# This work is provided "AS IS" and subject to the Shotgun Pipeline Toolkit
# Source Code License included in this distribution package. See LICENSE.
# By accessing, using, copying or modifying this work you indicate your
# agreement to t... |
#!/usr/bin/env python
from setuptools import setup
setup(
name='midi',
version='v0.3.0',
description='Python MIDI API',
author='giles hall',
author_email='ghall@csh.rit.edu',
package_dir={'midi': 'src'},
packages=['midi'],
scripts=[
'scripts/mididump.py',
],
)
|
# -*- coding: utf-8 -*-
# Copyright © Spyder Project Contributors
# Licensed under the terms of the MIT License
# (see spyder/__init__.py for details)
"""Kite client dispatcher decorators."""
import functools
def send_request(req=None, method=None):
"""Call function req and then send its results via HTTP."""
... |
# 1.4.2 Woche 1, Block 4, Aufgabe 2
# Dekleration
name = "Simon Meier"
# Ausgabe
print(len(name))
|
# Copyright (c) 2018 gevent contributors. See LICENSE for details.
# Portions of this code taken from the gogreen project:
# http://github.com/slideinc/gogreen
#
# Copyright (c) 2005-2010 Slide, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are pe... |
import json
from rlbot.agents.base_agent import BaseAgent, SimpleControllerState, BOT_CONFIG_AGENT_HEADER, BOT_NAME_KEY
from rlbot.messages.flat.QuickChatSelection import QuickChatSelection
from rlbot.parsing.custom_config import ConfigObject
from rlbot.utils.game_state_util import GameState, BallState, CarState, Phys... |
#Faça um programa que leia o nome de todos os alunos e faça uma ordem de quem vai apresentar os trabalhos
from random import shuffle
n1 = str(input ("Informe o primeiro nome"))
n2 = str(input("Informe o segundo nome"))
n3 = str(input("Informe o terceiro nome"))
n4 = str(input("Informe o quarto nome"))
lista = [n1, n2,... |
"""Answer class to represent a Quora answer."""
from quora.content import Content
from quora.question import Question
class Answer:
def __init__(self, data_dict, user, language="en"):
"""Constructs the `Answer` object."""
self.id = data_dict.get("id")
self.aid = data_dict.get("aid")
... |
from datetime import datetime
now = datetime.now()
now_str = now.strftime("%Y-%m-%d %H:%M")
# => 2019-10-12 16:16 |
############
# Compute raw sun data using pvlib
#
# 2021-09-01
# Peter Dudfield
#
# The data is about
# - 1MB for a 2 of days, for ~2000 sites and takes about ~1 minutes
# - 6MB for a 10 of days, for ~2000 sites and takes about ~1 minutes
# - 252MB for a 365 of days, for ~2000 sites and takes about ~11 minutes (on a ma... |
#!/usr/bin/env python3
import tenma.module as tenma
import argparse
import signal
import sys
parser = argparse.ArgumentParser(description='Setup control for Tenma Power Supply')
parser.add_argument('-v', '--voltage', help='set voltage', required=True, type=float)
parser.add_argument('-c', '--current', help='set curre... |
import urllib.parse
import json
from decimal import Decimal
from typing import Union
from aiohttp import ClientSession
from .confirmation import ConfirmationExecutor
from .exceptions import ApiException, TooManyRequests
from .models import Currency, SteamUrl, GameOptions
from .utils import (
text_between,
get... |
from unittest import TestCase
from utils.testing.Direct_API_Server import Direct_API_Server
class test_File_Distributor(TestCase):
@classmethod
def setUpClass(cls) -> None:
cls.client = Direct_API_Server().setup()
cls.prefix = 'file-generator'
def test_generate(self):
path = f"{se... |
from src.app.auth.model import UserModel
from src.common.exceptions import ExceptionHandler
class PostAuthService(object):
""" Amazon Cognito invokes this trigger to initiate the custom authentication flow. """
def __init__(self, event):
"""
:param self.event: dict
:return: dict
... |
import rdkit
from rdkit import Chem
import numpy as np
import pandas as pd
from functools import partial
from multiprocessing import Pool
import pandas as pd
from tqdm.auto import tqdm
import pathlib
import argparse
def get_parser():
parser = argparse.ArgumentParser()
parser.add_argument(
'--model', ... |
import sys
import re
from typing import List
from pathlib import Path
from dbxdeploy.poetry.PoetryPathResolver import PoetryPathResolver
from dbxdeploy.package.RequirementsConfig import RequirementsConfig
from dbxdeploy.shell.runner import run_and_read_output
from dbxdeploy.package.requirements_regex import LOCAL_FILE_... |
from mqc.visitors import Counter
from mqc.pileup.pileup import MotifPileup
from typing import Dict
import numpy as np
import pandas as pd
import matplotlib
matplotlib.use('Agg') # import before pyplot import!
import matplotlib.pyplot as plt
import seaborn as sns
import os
class CoverageCounter(Counter):
"""
... |
"""
********************************************************************************
compas_rv2.scene
********************************************************************************
.. currentmodule:: compas_rv2.scene
.. autosummary::
:toctree: generated/
:nosignatures:
Scene
"""
from __future__ impor... |
# -*- coding: utf-8 -*-
"""
Created on Sun Nov 14 01:13:54 2021
@author: Pranav
"""
import streamlit as st
import random
def main():
st.title('Design of Springs')
st.header('Made with :heart: by Pranav Garg')
st.subheader('Input Section')
max_force = st.number_input("Enter... |
from os import path
from typing import TYPE_CHECKING, Any, Dict, Hashable, Optional
from peakina.cache import Cache
from peakina.datasource import DataSource
if TYPE_CHECKING:
import pandas as pd
class DataPool:
def __init__(
self,
config: Dict[Hashable, Dict[str, Any]],
data_sources... |
from __future__ import unicode_literals
import json
import logging
from builtins import str
from copy import deepcopy
from datetime import datetime
from pathlib import Path
from future.utils import iteritems, itervalues
from snips_nlu.common.log_utils import log_elapsed_time, log_result
from snips_nlu.common.utils i... |
import logging
import threading
from typing import List, Optional
from .models import State, StateFlag
_logger = logging.getLogger(__name__)
class StateManager:
def __init__(
self,
start_state: State,
faulted_state: State = None,
name: str = None,
shutdown_flags: List[St... |
import os
RABBIT_MQ_HOSTNAME = os.environ.get("RABBIT_MQ_HOSTNAME", "localhost")
RABBIT_MQ_PORT = os.environ.get("RABBIT_MQ_PORT", 5672)
RABBIT_MQ_LOGIN = os.environ.get("RABBIT_MQ_LOGIN", "guest")
RABBIT_MQ_PASSWORD = os.environ.get("RABBIT_MQ_PASSWORD", "guest")
ENCRYPTOR_URL = os.environ.get("ENCRYPTOR_URL", "http... |
import hashlib
import flask
import requests
import sys
from flask import render_template
from flask import request
from flask import url_for
import uuid
import string
import random
from bson.objectid import ObjectId
import json
import logging
# Date handling
import arrow # Replacement for datetime, based on moment.j... |
from pinto.security import RootACL
class Root(RootACL):
pass
def includeme(config):
config.add_route('admin_login', '/login', factory=Root)
config.add_route('admin_logout', '/logout', factory=Root)
config.add_route('admin_settings', '/settings', factory=Root)
config.add_route('admin_index', '/', f... |
"""Function to output data to CosmosDB"""
# pylint: disable=logging-fstring-interpolation
# pylint: disable=consider-using-from-import
# pylint: disable=broad-except
# pylint: disable=raise-missing-from
import logging
import asyncio
from azure.cosmos.aio import CosmosClient
from shared_code import get_config, aio_help... |
from rpython.rtyper.test.test_llinterp import gengraph, interpret
from rpython.rtyper.error import TyperError
from rpython.rtyper.lltypesystem import lltype, llmemory, rffi
from rpython.rlib import rgc # Force registration of gc.collect
import gc
import py, sys
def test_collect():
def f():
return gc.collec... |
#!/usr/bin/env python
# coding=utf-8
'''
Author: luantianyu
LastEditors: Luan Tianyu
email: 1558747541@qq.com
github: https://github.com/tianyuluan/
Date: 2021-09-07 19:26:09
LastEditTime: 2021-12-02 10:35:27
motto: Still water run deep
Description: Modify here please
FilePath: /mmdetection/tools/tt.py
'''
import cv2
... |
#!/usr/bin/env python
"""docstring"""
import os
from xml.etree import ElementTree as ET
import argparse
# create a class that opens and reads any xml format
# pwx
# gpx
# etc
# json
class OpenXMLFile(object):
"""docstring"""
def open(self):
tree = ET.parse(self)
root = tree.getroot()
def... |
from ttracker.settings import ARENA_FOLDER
import os
def test_arena_folder():
assert os.path.exists(ARENA_FOLDER)
|
import dash_core_components as dcc
import dash_html_components as html
from dash.dependencies import Output, Input
from app import app
import numpy as np
import db_query as db
import datetime
serial = 3390197892757083161
def generate_table(dataframe, max_rows=10):
return html.Table(
# Header
[ht... |
import asyncio
import importlib
import os
import re
import typing
from vkbottle.api.token_generator.consistent import ConsistentTokenGenerator
from vkbottle.api.token_generator.single import SingleTokenGenerator
from vkbottle.dispatch.filter import AndFilter, OrFilter
from vkbottle.dispatch.rules import ABCRule
if ty... |
#!/usr/bin/env python3
# This script fetches training data and trains the neural network stored in `./models`
import sys
import glob
import utils
import os
import shutil
from nn import *
import numpy as np
import datetime
realDir = os.path.dirname(os.path.realpath(__file__))
dataDir = os.path.join(realDir, 'train/da... |
import pytest
from meilisearch_cli._docs import TreeBuildError, build_tree
def test_build_tree_error():
with pytest.raises(TreeBuildError):
build_tree(links=[])
|
from wtforms import TextAreaField,StringField,SubmitField
from .. models import Blog,User,Comment,Subscribe
from wtforms.validators import Required,Length,Email
from flask_wtf import FlaskForm
from flask_wtf.file import FileAllowed,FileRequired,FileField
from flask_login import current_user
from ..import db,photos
from... |
from __future__ import absolute_import
from pytest_sherlock.sherlock import Sherlock
def pytest_addoption(parser):
group = parser.getgroup("sherlock", "Try to find coupled tests")
group.addoption(
"--flaky-test",
action="store",
dest="flaky_test",
help="Set the flaky tests whi... |
#########################################################################
## Structure of network.
#########################################################################
import torch
import torch.nn as nn
from model.block import ResizeLayer
from model.block import HourglassPINet
class PINet(nn.Module):
def __i... |
# -*- coding: utf-8 -*-
# Copyright (c) 2016-2020 by University of Kassel and Fraunhofer Institute for Energy Economics
# and Energy System Technology (IEE), Kassel. All rights reserved.
import pytest
from pandapower.test.toolbox import create_test_network
from pandapower.plotting.generic_geodata import create_generi... |
import abc
import re
from dataclasses import dataclass
from pathlib import Path
from typing import Dict, List, Optional, Pattern, Tuple, Union
import cli_ui as ui
import schema
import tomlkit
from tomlkit.toml_document import TOMLDocument
from tbump.error import Error
from tbump.hooks import HOOKS_CLASSES, Hook
@da... |
"""Basic Indexes and simple forward facing views"""
# django imports
from django.shortcuts import render
# local imports
from OR_web_GUI.models import Rule, Input, Output
from .hidden import check_output_state
# import for GPIO in real vs. test env
try:
import OPi.GPIO as GPIO
fake = False
except ImportError:
... |
# -*- coding: utf-8 -*-
"""<base> template"""
from ..environment import env
base = env.from_string("""\
<base {% if href -%} href="{{ href }}" {% endif -%}
{% if target -%} target="{{ target }}" {% endif -%}>
""")
|
class ChangePasswordWindowActions:
def __init__(self, model, view):
self.__model = model
self.__view = view
self.__key = None
def on_change_password_window(self, key, window):
self.__key = key
self.__view.set_window(self.__key, window, self)
self.focus_window()
... |
__author__ = 'Sanjarbek Hudaiberdiev'
from lib.db import DbClass
# from lib.utils.classes import Kplet
from lib.db.prok1402 import neighborhoods_path
import os
import sys
def store_kplets_pile(kplets_pile, cdd2id, file2id):
_sql_kplet = """insert ignore into bacteria_2plets (kplet_1, kplet_2) values \n"""
... |
import logging
import time
from django.conf import settings
from django.contrib.auth import get_user_model
from .models import Outage
logger = logging.getLogger(__name__)
def execution_time_logger(fun):
def wrapper(*args, **kwargs):
start = time.time()
result = fun(*args, **kwargs)
end ... |
from pixela_letters import pixela
if __name__ == '__main__':
pixela.run()
|
# -*- coding: utf-8 -*-
"""Output related functions and classes for testing."""
import os
import unittest
from dfvfs.lib import definitions as dfvfs_definitions
from dfvfs.path import factory as path_spec_factory
from plaso.formatters import interface as formatters_interface
from plaso.formatters import mediator as ... |
from unittest.mock import patch
from jose import JWTError, jwk, jwt
import pytest
from requests.exceptions import Timeout
from controlpanel.api.models import User
TEST_CLIENT_ID = "test-client-id"
TEST_KID = "test-key-id"
TEST_SUB = "github|1234"
# The RSA key below is for testing only. DO NOT USE for anything els... |
from django.shortcuts import render
from django.http import JsonResponse
from .models import Therapist, TherapySlot
from django.core import serializers
from django.views.decorators.csrf import csrf_exempt
import json
def get_all_therapists(request):
if request.method == "GET":
therapists = Therapist.objec... |
from SeleniumLibrary import SeleniumLibrary
from robot.api.deco import keyword
import selenium
from robot.libraries.BuiltIn import BuiltIn
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
__version__ = '1.0'
class DebuggingLibrary:
""" Library for remote chrome browser
""... |
# Copyright 2021 The KServe Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wr... |
from .docker import Docker
from .exceptions import DockerContainerError, DockerError
__version__ = "0.19.1"
__all__ = ("Docker", "DockerError", "DockerContainerError")
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.