text stringlengths 2 999k |
|---|
# Copyright 2018-2021 Jakub Kuczys (https://github.com/jack1142)
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... |
# Copyright 2020 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... |
# -*- coding: utf-8 -*-
from typing import Any
class JobCalcError(Exception):
"""Base exception used by the app. All custom exceptions should inherit
from this class.
"""
def __init__(self, msg: str=None) -> None:
self.msg = msg
def __str__(self) -> str:
name = self.__class__._... |
#!/usr/bin/env python3
## -*- coding: utf-8 -*-
##
## $ python3 ./backward_slicing.py
## [slicing] 0x40058b: movzx eax, byte ptr [rax]
## [slicing] 0x40058e: movsx eax, al
## [slicing] 0x400591: sub eax, 1
## [slicing] 0x400594: xor eax, 0x55
## [slicing] 0x400597: mov ecx, eax
##
from __future__ import print_function... |
import sys
import re
import math
import textwrap
class ModuleDocumentation(object):
"""
documentation for a single module
"""
valid_categories = ['driver', 'estimator', 'controller', 'system',
'communication', 'command', 'template']
max_line_length = 80 # wrap lines that a... |
import datetime
import json
from operator import or_
from functools import reduce
from django.contrib import messages
from django.contrib.auth.decorators import login_required
from django.http import HttpResponse, HttpResponseRedirect
# Create your views here.
from django.db.models import Q
from django.short... |
from ...mixin import TemplateRendererMixin
from ...__version__ import get_version
from argparse import ArgumentParser
class PdbReformer(TemplateRendererMixin):
@classmethod
def template(cls) -> str:
return f"# Generated by fmojinja version {get_version()}" + """
PREFIX := {{ prefix }}
PDB :={% for pa... |
import sys
from typing import TYPE_CHECKING
if sys.version_info < (3, 7) or TYPE_CHECKING:
from ._rotation import Rotation
else:
from _plotly_utils.importers import relative_import
__all__, __getattr__, __dir__ = relative_import(
__name__, [], ["._rotation.Rotation"]
)
|
import FWCore.ParameterSet.Config as cms
from SimG4Core.Application.hectorParameter_cfi import *
## HF Raddam Dose Class in /SimG4CMS/Calo
from SimG4CMS.Calo.HFDarkeningParams_cff import *
## HF shower parameters
from Geometry.HcalSimData.HFParameters_cff import *
## Modification needed for H2 TestBeam studies
from... |
# -*- coding: utf-8 -*-
"""selin(1).ipynb
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/17_eVt28SluHB_hQNwNlwvH2KqPftxkh3
"""
import os
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
import cv2
from ... |
# -*- coding: utf-8 -*-
# Copyright 2022 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... |
import pytest
from tenable_io.api.models import User, UserList
from tenable_io.api.users import UserCreateRequest
from tenable_io.api.users import UserEditRequest
from tests.base import BaseTest
from tests.config import TenableIOTestConfig
class TestUsersApi(BaseTest):
@pytest.fixture(scope='class')
def us... |
from flask import request, Flask
from flask_cors import CORS
app = Flask(__name__)
app.config['DEBUG'] = True
CORS(app)
# Setup configuration file
import configparser
config = configparser.ConfigParser()
config.read('api_config.ini')
# Setup logs test
import logging
logging.basicConfig(filename=config['PATH']['LOG... |
#!/usr/bin/python
# This file is part of Ansible
#
# 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 option) any later version.
#
# Ansible is distributed... |
from core.lattice import Lattice
# ---- Pyrite ATS tensor ----- #
FeS2 = Lattice([5.417],'P a -3')
r = [0,0,0]
q = [0,1,1]
Fats = FeS2.genTensor(r,q)
print(Fats) |
from distutils.core import setup
setup(
name="django-mailer",
version=__import__("mailer").__version__,
description="A reusable Django app for queuing the sending of email",
long_description=open("docs/usage.txt").read(),
author="James Tauber",
author_email="jtauber@jtauber.com",
url="http... |
import json
import os
import pandas as pd
from fastai.text import (
AWD_LSTM,
TextClasDataBunch,
TextLMDataBunch,
language_model_learner,
text_classifier_learner,
)
from sklearn.model_selection import train_test_split
data = "data"
model = "model_fastai"
if __name__ == "__main__":
train_jso... |
# -*- coding: utf-8 -*-
#
# needs test docs documentation build configuration file, created by
# sphinx-quickstart on Tue Mar 28 11:37:14 2017.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated fil... |
# -*- coding: utf-8 -*-
# Copyright 2018 IBM.
#
# 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 agre... |
"""
This script was made by soeque1 at 24/07/20.
To implement code for training your model.
"""
import logging
from argparse import ArgumentParser, Namespace
from logging import getLogger
import pytorch_lightning as pl
import torch
import torch.nn.functional as F
from pytorch_lightning import Trainer
from pyt... |
import pandas as pd
import numpy as np
import torch
#data_path = "./NER_multilabel_data_v2.csv"
BATCH_SIZE = 16
def get_trainset_data_loader(tokenizer, data_path = "",
BATCH_SIZE = BATCH_SIZE):
df = pd.read_csv(data_path)
all_tags = df.newTag
all_tags = set(all_tags)
all... |
import json
from b_lambda_layer_common.api_gateway.neighbour_endpoint import NeighbourEndpoint
from b_lambda_layer_common.exceptions.container.not_reached_error import NotReachedError
from . import root
with open(f'{root}/dummy_event.json', 'r') as file:
dummy_event = json.loads(file.read())
def test_FUNC_call_... |
#!/usr/bin/python3
# Halide tutorial lesson 3
# This lesson demonstrates how to inspect what the Halide compiler is producing.
# This lesson can be built by invoking the command:
# make tutorial_lesson_03_debugging_1
# in a shell with the current directory at the top of the halide source tree.
# Otherwise, see the... |
# -*- coding: utf-8 -*-
import os
import time
#[用户名,时间区间列表,端口列表]
def time_port_stat(dir_prefix): #定义一个函数
file_dir=dir_prefix +"china students\\"
txt_filename=[fname for fname in os.listdir(file_dir) if fname.endswith('.txt')]#搜索指定目录下txt文
for e in txt_filename:
file_path=file_dir+e
fread=op... |
from abc import abstractmethod
from .decl import VarDecl
from .serialization import Deserializer
from typing import BinaryIO, Iterable, Set, Tuple
class AtomicChange:
def __init__(self, change_id: str, deserialization: Deserializer):
self._change_id = change_id
self._deserialization = deserializat... |
# coding: utf-8
import base64
import boto3
import os
import re
from botocore.config import Config
from botocore.exceptions import ClientError
from boto3 import (
resource as boto3resource,
client as boto3client
)
from wrapanapi.entities import (Instance, Network, NetworkMixin, Stack, StackMixin,
... |
from django.db.models.query import Prefetch
from django.utils.functional import classproperty
from drf_eager_fields.serializers import EagerFieldsSerializer
from rest_framework import serializers
from ..models import Country
class CountrySerializer(serializers.ModelSerializer, EagerFieldsSerializer):
class Meta:... |
from django.urls import re_path
from . import views
urlpatterns = [
re_path(
r"^stripe-webhook$",
views.stripe_webhook,
name="promoted.stripe_webhook",
),
]
|
# -*- coding: utf-8 -*-
"""
ModelSubset toolbox
=============
"""
__authors__ = 'Tiago Bilo'
__copyright__ = "left"
__credits__ = "Tiago Bilo"
__license__ = "MIT"
__version__ = "1.0.0"
__maintainer__ = "Tiago Bilo"
__email__ = "tiago.bilo@gmail.com"
__status__ = "Beta"
__all__ = "models"
from models import *
from ... |
'''tzinfo timezone information for America/Pangnirtung.'''
from pytz.tzinfo import DstTzInfo
from pytz.tzinfo import memorized_datetime as d
from pytz.tzinfo import memorized_ttinfo as i
class Pangnirtung(DstTzInfo):
'''America/Pangnirtung timezone definition. See datetime.tzinfo for details'''
zone = 'Americ... |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.4 on 2017-09-07 16:01
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('aa_stripe', '0010_auto_20170822_1004'),
]
operations = [
migrations.AddFiel... |
from flask import Flask, render_template
from btscan import BTScan
from os import environ
from datetime import datetime
import requests
alertHttpUrl = environ['ALERT_HTTP']
notifyHttpUrl = environ['NOTIFY_HTTP']
alertTimer = int(environ['ALERT_TIMER'])
notifyTimer = int(environ['NOTIFY_TIMER'])
proximityAddress = env... |
#! /usr/bin/env python
"""Python sports betting toolbox."""
import codecs
import os
from setuptools import find_packages, setup
ver_file = os.path.join('sportsbet', '_version.py')
with open(ver_file) as f:
exec(f.read())
DISTNAME = 'sports-betting'
DESCRIPTION = 'Python sports betting toolbox.'
with codecs.open... |
#!/usr/bin/env python3
"""
Write a Python program to find the class wise roll number from a tuple-of-tuples.
Using the python standard library: collections:
1) namedtuple(): factory function for creating tuple subclasses with named fields
2) deque: list-like container with fast appends and pops on either end
... |
class Carrinho(object):
def __init__(self):
self.id_cliente = None
self.id_produto = None
self.quantidade = None
self.preco = None
pass
def mostrar_itens(self):
pass
def incluir(self):
pass
|
import discord
from discord.ext import commands
import platform
import random
import cogs._json
class Fun(commands.Cog):
def __init__(self, client):
self.client = client
@commands.Cog.listener()
async def on_ready(self):
print(f"{self.__class__.__name__} Cog had been loaded\n-----")
... |
#
# BSD 3-Clause License
#
# Copyright (c) 2017 xxxx
# All rights reserved.
# Copyright 2021 Huawei Technologies Co., Ltd
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain ... |
import logging
from psycopg2 import connect
from psycopg2.sql import SQL
from .utils import logging, DATABASE
logger = logging.getLogger(__name__)
health = """
DROP TABLE IF EXISTS health;
CREATE TABLE health AS
SELECT
COALESCE(a.tags->>'name:en', a.tags->>'name') AS name,
COALESCE(a.tags-... |
# Buffer all output to prevent test cases writing to stdout or stderr
import io, sys
sys.stdout = io.StringIO()
sys.stderr = io.StringIO()
del io
del sys
# The user source code will be injected here
$$__USER_CODE__$$
# The code that is leveraged by our test case invocation code
_______unitTestResultVectors = []
#... |
from rest_framework import serializers
from otree.models.subsession import BaseSubsession
from otree.models.group import BaseGroup
from otree.models.player import BasePlayer
from otree.models import Session, Participant
# we filter out these 'technical' fields.
block_fields = ['_gbat_arrived', '_gbat_grouped', '_index... |
"""
ASGI config for mock project.
It exposes the ASGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.0/howto/deployment/asgi/
"""
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_SETTINGS... |
import sys
import random
some_list = []
for n in range(1,1001):
some_list.append(n)
print(f"Size of list with {n} items: {sys.getsizeof(some_list)}")
random_list = []
for n in range(1000):
random_list.append(random.randint(1,1_000_000))
for number in random_list:
if number == 7321:
print(... |
"""
Copyright (c) Facebook, Inc. and its affiliates.
"""
import os
import time
import signal
import random
import logging
import faulthandler
from multiprocessing import set_start_method
if __name__ == "__main__":
set_start_method("spawn", force=True)
import shutil
from droidlet import dashboard
from droidlet.too... |
#!usr/bin/python3
from bladerunner import run
run()
|
# -*- coding: utf-8 -*-
import sys
import math
from gii.qt.controls.GenericTreeWidget import GenericTreeWidget, GenericTreeFilter
from gii.qt.controls.GenericListWidget import GenericListWidget
from gii.qt.controls.PropertyEditor import PropertyEditor
from gii.qt.IconCache import ge... |
import subprocess
import time
import os.path
import json
################################################################################
def build_cmd(file_name, param, np):
return build_prun(file_name, param, np) # TODO: change here
################################################################################... |
import collections
import pkg_resources
import os
config = {}
class ConfigLoader:
def __init__(self):
executed = {}
for file in pkg_resources.resource_listdir(__name__, "config"):
if file.endswith(".py"):
name = file[:-3]
path = pkg_resources.resource_f... |
from ._integrand import Integrand
from ..discrete_distribution import Sobol
from ..true_measure import Gaussian
from ..util import ParameterError
from numpy import *
from scipy.stats import norm
class MLCallOptions(Integrand):
"""
Various call options from finance using Milstein discretization with $2^l$ time... |
from __future__ import print_function
# TODO wybrac konwencje -- szybka podmiana jednej funkcji
# czy kolekcja:zadanie:kolejka -> test:crawler:todo
# czy zadanie:kolekcja:kolejka -> crawler:test:todo
# czy zadanie:kolejka:kolekcja -> crawler:todo:test
import redis
from multiprocessing import Pool
from itertools impor... |
from django.shortcuts import render
from django.http import HttpResponse, HttpResponseRedirect
from django.urls import reverse
from .custom_functions import (
get_field_y_range,
create_user_deck_group,
create_user_deck_choice,
create_user_deck,
)
from django.views.decorators.csrf import ensure_csrf_cook... |
from pathlib import Path
from .cardanopy_config import CardanoPyConfig
import json
import os
class Substitution(object):
@staticmethod
def generate(dry_run: bool, target_config_dir: Path, config: CardanoPyConfig, subs: tuple = tuple()):
for dir_name, subdirList, fileList in os.walk(target_config_dir)... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Exceptions to be raised by every other sub-package"""
__all__ = ['RestApixBaseException', 'ResourceNotFound']
class RestApixBaseException(Exception):
"""Base exception for crux utils."""
pass
class ResourceNotFound(RestApixBaseException):
"""Resource ... |
##
## Copyright (C) 2017, Amit Aides, all rights reserved.
##
## This file is part of Camera Network
## (see https://bitbucket.org/amitibo/cameranetwork_git).
##
## Redistribution and use in source and binary forms, with or without modification,
## are permitted provided that the following conditions are met:
##
## ... |
from output.models.nist_data.atomic.byte.schema_instance.nistschema_sv_iv_atomic_byte_fraction_digits_1_xsd.nistschema_sv_iv_atomic_byte_fraction_digits_1 import NistschemaSvIvAtomicByteFractionDigits1
__all__ = [
"NistschemaSvIvAtomicByteFractionDigits1",
]
|
from django.db import models
# Create your models here.
class GBPMain(models.Model):
name = models.CharField(max_length=50, verbose_name="mainData")
value = models.CharField(max_length=50, verbose_name="mainValue")
changeRate = models.CharField(max_length=50, verbose_name="mainChangeRate")
changeType =... |
from gym_pybullet_drones.envs.single_agent_rl.BaseSingleAgentAviary import BaseSingleAgentAviary
from gym_pybullet_drones.envs.single_agent_rl.TakeoffAviary import TakeoffAviary
from gym_pybullet_drones.envs.single_agent_rl.HoverAviary import HoverAviary
from gym_pybullet_drones.envs.single_agent_rl.FlyThruGateAviary i... |
from typing import Any, Dict, List
from owonHDS import owonHDS
import sys
import time
import re
import numpy as np
import pyqtgraph as pg
from pyqtgraph.Qt import QtCore
CHANNEL_COLORS = {"CH1": "y", "CH2": "b"}
def float_from_str(val: str) -> float:
_prefix = {
"p": 1e-12, # pico
"n": 1e-9, #... |
import pytest
from pydantic import AnyUrl, BaseModel, EmailStr, HttpUrl, NameEmail, PostgresDsn, RedisDsn, ValidationError, stricturl
from pydantic.networks import validate_email
try:
import email_validator
except ImportError:
email_validator = None
@pytest.mark.parametrize(
'value',
[
'http... |
def dot_product(nums):
result = 1
for c in nums:
result *= int(c)
return result
NUMBER = "7316717653133062491922511967442657474235534919493496983520312774506326239578318016984801869478851843858615607891129494954595017379583319528532088055111254069874715852386305071569329096329522744304355766896648... |
"""
"""
import unittest
import arcpy
class TestDataTypeUInt(unittest.TestCase):
"""Tests the uint task datatype"""
config = None
@classmethod
def setUpClass(cls):
"""Class setup creates a toolbox file wrapper"""
cls.config.setup_toolbox('IDL', 'qa_idltaskengine_datatype_uint',
... |
import uuid
import controller.modules.NetworkGraph
from controller.modules.NetworkGraph import ConnectionEdge
from controller.modules.NetworkGraph import ConnEdgeAdjacenctList
class NetworkGraphTest():
def __init__(self):
self._node_id = None
self._node_ids = []
self._max_nodes = 12
... |
import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SECRET_KEY = 'jnhjttydRTDBjnOIm'
INSTALLED_APPS = [
'tests',
'djmoney'
]
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
'TEST': {
... |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... |
# bumpversion --current-version <__version__> (major|minor|patch) setup.py
import pathlib
from setuptools import setup
# The directory containing this file
HERE = pathlib.Path(__file__).parent
README = (HERE / "README.md").read_text()
with (HERE / "requirements.txt").open() as f:
requirements = f.read().splitli... |
import abc
import datetime
from typing import Union, List
class AbstractPikaBus(abc.ABC):
@property
@abc.abstractmethod
def connection(self):
"""
returns connection.
:rtype: pika.adapters.blocking_connection
"""
pass
@property
@abc.abstractmethod
def ch... |
import datetime
import os
import torch
import torch.nn.functional as F
from torch.utils.data import DataLoader, RandomSampler, TensorDataset
from tqdm import tqdm
from tqdm import trange
from common.evaluators.bert_evaluator import BertEvaluator
from datasets.bert_processors.abstract_processor import convert_examples... |
"""
Contains all the widget representations used in the designer and specifies all the styles that can be applied to them
"""
# ======================================================================= #
# Copyright (C) 2019 Hoverset Group. #
# ========================================... |
from __future__ import unicode_literals
from collections import OrderedDict
from django.utils.encoding import python_2_unicode_compatible
from django.db import models
from ..helpers.validators import data_group_name_validator
@python_2_unicode_compatible
class DataGroup(models.Model):
name = models.SlugField(max... |
# -*- coding: utf-8 -*-
from model.contact import Contact
def test_add_contact(app):
app.session.login(username="admin", password="secret")
app.contact.fill_data(Contact(firstname="Aleh", lastname="Shybaila", title="QA", company="BBB",
address="123 Main Str, Cupertino, CA 950... |
"""Neural networks for MRI reconstruction
References
----------
..[A2017] Jonas Adler, Ozan Oktem (2017)
Learned Primal-dual Reconstruction
https://arxiv.org/abs/1707.06474
..[C2019] Jing Cheng et al. (2019)
Model Learning: Primal Dual Networks for Fast MR imaging
https://arxiv.org/abs/1908.02426
..... |
#!/usr/bin/env python2
# Copyright (c) 2014-2015 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import *
# Creat... |
"""
https://adventofcode.com/2020/day/24
"""
from lobbylayout import lobbylayout
if __name__ == '__main__':
ts = lobbylayout.TileSet('..\input\input2020_24a.txt')
print("Part 1: {}".format(ts.flippedCount()))
genCounts = ts.playGame(100)
print("Part 2: {}".format(genCounts[-1]))
|
from django.db import models
from modelmonitor import monitor
@monitor.changed
class MonitorAllFields(models.Model):
first_field = models.IntegerField(default=0)
second_field = models.IntegerField(default=0)
@monitor.changed("monitored_field")
class MonitorSomeFields(models.Model):
monitored_field = mod... |
from __future__ import division
from __future__ import print_function
from __future__ import absolute_import
import os
import time
import pdb
import itertools
from collections import OrderedDict
import tensorflow as tf
import numpy as np
from tqdm import trange
from scipy.io import savemat, loadmat
from mbpo.models.... |
# generated from catkin/cmake/template/pkg.context.pc.in
CATKIN_PACKAGE_PREFIX = ""
PROJECT_PKG_CONFIG_INCLUDE_DIRS = "${prefix}/include;/usr/include".split(';') if "${prefix}/include;/usr/include" != "" else []
PROJECT_CATKIN_DEPENDS = "message_runtime;std_msgs".replace(';', ' ')
PKG_CONFIG_LIBRARIES_WITH_PREFIX = "".... |
# ***************************************************************
# Copyright (c) 2020 Jittor. Authors:
# Guowei Yang <471184555@qq.com>
# Dun Liang <randonlang@gmail.com>.
# All Rights Reserved.
# This file is subject to the terms and conditions defined in
# file 'LICENSE.txt', which is part of this source c... |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright 2013 vArmour Networks Inc.
# 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.apa... |
import pytest
def test_kubernetes():
from cloudmesh.cluster.providers import KubernetesCluster
kube = KubernetesCluster()
assert False
def test_nomad():
from cloudmesh.cluster.providers import NomadCluster
nomad = NomadCluster()
assert False
|
import unittest
import pandas as pd
from context import market
from market.Marketactor import marketactor, market_Buyer, market_Seller
class TestActors(unittest.TestCase):
def test_is_actor(self):
for obj in [marketactor, market_Buyer, market_Seller]:
print('Testing Object: ', s... |
import pandas as pd
import numpy as np
from scipy.optimize import curve_fit
df = pd.read_csv('cabioage.csv')
def beta(data, pred='totage', resp='drybio_bole'):
pmin = min(data[pred])
pmax = max(data[pred])
dmin = min(data[data[pred] == pmin][resp])
dmax = max(data[data[pred] == pmax][resp])
retur... |
ASL_TRAIN_PATH = "../training_data"
HAND_TRAIN_PATH = "../RHD_published_v2/"
JSON_PATH = "./pickle/model.json"
WEIGHTS_PATH = "./pickle/model.h5"
|
"""Flask Config module."""
import os
class Config(object):
"""Base configuration for the flask app."""
SQLALCHEMY_TRACK_MODIFICATIONS = False
JOBS = [
{
'id': 'job1',
'func': 'moontracker.app:check_alerts',
'trigger': 'interval',
'seconds': 10
... |
# Copyright 2019 IBM Corporation All Rights Reserved.
#
# SPDX-License-Identifier: Apache-2.0
import os
from socket import gethostbyname, gethostname
from flask import request, has_request_context
import requests
from . import app_qpylib
# pylint: disable=too-many-arguments
QRADAR_CSRF = 'QRadarCSRF'
SEC_HEADER = 'S... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""The setup script."""
import re
from setuptools import setup, find_packages
from distutils.core import Command
class DepsCommand(Command):
"""A custom distutils command to print selective dependency groups.
# show available dependency groups:
python setup... |
import requests
import json
import smtplib, ssl
import time
from datetime import datetime, timedelta
from .models import *
from django.conf import settings
from django.template import Context
from django.template.loader import render_to_string
from django.core.mail import EmailMultiAlternatives, EmailMessage, send_mail... |
from functools import lru_cache
from typing import Any, Dict, Iterable, List, Literal
from swiftclient.service import SwiftService, SwiftUploadObject
BucketName = Literal['ap', 'am']
def _check_upload(results: List[Dict]) -> None:
for result in results:
if not result.get('success'):
raise Va... |
import discord
import random
import time
import re
import datetime
from discord.ext import commands
from pytz import timezone
from random import randint
class MyHelpCommand(commands.MinimalHelpCommand):
messages = [
"As I say-",
"Pogchampo",
"F for PogChamp",
"If you see this, you a... |
"""
Django settings for tweeter3 project.
Generated by 'django-admin startproject' using Django 2.1.2.
For more information on this file, see
https://docs.djangoproject.com/en/2.1/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.1/ref/settings/
"""
import os
... |
# Coyright 2017-2019 Nativepython 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 ... |
"""
Django settings for terminal project.
Generated by 'django-admin startproject' using Django 1.10.8.
For more information on this file, see
https://docs.djangoproject.com/en/1.10/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.10/ref/settings/
"""
import o... |
#
import unittest
from datasets.stcar_ds import StcarDs
class TStcarDs(unittest.TestCase):
# python -m unittest -v utc.datasets.t_stcar_ds.TStcarDs.test_draw_bbox
def test_draw_bbox(self):
ds = StcarDs()
ds.draw_bbox() |
from django.contrib.auth.models import User
from django.test import TestCase
from dfirtrack_config.forms import SystemImporterFileCsvConfigForm
from dfirtrack_main.models import Analysisstatus, Systemstatus, Tag, Tagcolor
class SystemImporterFileCsvConfigFormTagSpecificTestCase(TestCase):
""" system importer fil... |
#----------------------------------------------------------------------------
# SFF-8436 QSFP+ 10 Gbs 4X PLUGGABLE TRANSCEIVER
#----------------------------------------------------------------------------
from __future__ import print_function
try:
import fcntl
import struct
import sys
import time
... |
from .sum_tree import SumTree
from .action_noise import NoiseCreator
from .replay_buffer import BufferCreator |
""" Google Text to Speech
Available Commands:
.tts LanguageCode as reply to a message
.tts LangaugeCode | text to speak"""
import asyncio
import os
import subprocess
from datetime import datetime
from gtts import gTTS
from uniborg.util import admin_cmd
@borg.on(admin_cmd(pattern="tts ?(.*)"))
async def _(event):
... |
# -*- coding: utf-8 -*-
# Copyright 2020 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... |
class ProjectNotFound(Exception):
pass
class ConnectionNotFound(Exception):
pass
class GroupNotFound(KeyError):
pass
class OrderNotInRightFormat(TypeError):
pass
class ReservedVariableNameError(Exception):
pass
class PassedFieldNotInQuery(Exception):
pass
|
# Generated by Django 3.0.1 on 2020-01-22 03:12
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('blogApp', '0006_auto_20200121_2211'),
]
operations = [
migrations.RemoveField(
model_name='blog',
name='image',
),
... |
from util.filesystem import get_save_path, listsortdir, get_path_from_name, get_saves
import pytest, subprocess
class TestFilesystem(object):
''' Tests for the filesystem utils. '''
def test_get_save_path(self):
assert isinstance( get_save_path(), str )
def test_listsortdir(self):
asser... |
# Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.