text stringlengths 2 999k |
|---|
from turtle import Turtle
class Ball(Turtle):
def __init__(self):
super().__init__()
self.shape("circle")
self.color("white")
self.penup()
self.speed_x = 2
self.speed_y = 2
def move(self):
new_x = self.xcor() + self.speed_x
new_y = self.ycor() ... |
# 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 pulumi
import pulumi.runtime
class GetRouteTableResult(object):
"""
A collection of values returned by getRouteTable.
... |
import wx
import os
import imagebrowser
import Utils
#------------------------------------------------------------------------------------------------
class SetGraphicDialog( wx.Dialog ):
def __init__( self, parent, id = wx.ID_ANY, graphic = None ):
super().__init__( parent, id, "Set Graphic",
style=wx.DEFAUL... |
import numpy as np
from .utils import trig_sum
def lombscargle_fast(t, y, dy, f0, df, Nf,
center_data=True, fit_mean=True,
normalization='standard',
use_fft=True, trig_sum_kwds=None):
"""Fast Lomb-Scargle Periodogram
This implements the Press & ... |
from django.db import models
from django.contrib.contenttypes.fields import GenericForeignKey
from django.contrib.contenttypes.models import ContentType
from django.conf import settings
from api.models.bigpicture import BigPicture
import datetime
import statistics
class Rating(models.Model):
target_bp = models.Fo... |
import os
import subprocess
import config
result = {}
cwd = os.path.dirname( os.path.realpath( __file__ ) )
def parse_file(f):
if not config.omit_xrdb:
subprocess.call("xrdb -merge " + f, shell = True)
res = os.popen("xrdb -query").read()[:-1].split("\n")
for i in res:
fields = i.split(":... |
# These imports are part of pyobjc:
from Foundation import NSUserNotification
from Foundation import NSUserNotificationCenter
from Foundation import NSUserNotificationDefaultSoundName
def send_notification(title, text, wantSound=True):
# Use NSUserNotification to construct our notification:
notification = NSUs... |
# -*- coding: utf-8 -*-
"""
Progress bar
------------
"""
from __future__ import division, print_function
import datetime
import sys
import warnings
from abc import abstractmethod
from plumbum.cli.termsize import get_terminal_size
from plumbum.lib import six
class ProgressBase(six.ABC):
"""Base class for progre... |
from testpkguno import ClassA
class ClassB(ClassA):
def __init__(self, **kwargs):
pass
# Overwriting one method from ClassA to
# test that ordering of inheritance is
# respected
def banarchy(self, nonsense=True):
return(nonsense)
def hello_there(self, greeting):
pas... |
import cyscs as scs
import pytest
import cyscs.examples as ex
import scipy.sparse as sp
import numpy as np
def test_simple_lp():
data, cone = ex.simple_lp()
sol = scs.solve(data, cone)
def test_extra_arg():
data, cone = ex.simple_lp()
sol = scs.solve(data, cone, eps=1e-9, alpha=.1, nonsense_arg='nons... |
__author__ = ['dmorina', 'shirish']
from oauth2_provider.oauth2_backends import OAuthLibCore, get_oauthlib_core
from django.utils.http import urlencode
import ast
def get_model_or_none(model, *args, **kwargs):
"""
Get model object or return None, this will catch the DoesNotExist error.
Keyword A... |
import json
import unittest
from unittest.mock import patch
from signer import lambda_handler
from signer.lambda_handler import get_free_call_signer_address
class TestSignUPAPI(unittest.TestCase):
def setUp(self):
pass
@patch("common.utils.Utils.report_slack")
def test_signature_for_free_call(se... |
# Generated by Django 2.0.6 on 2018-06-15 15:52
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Student',
fields=[
('id', models.AutoField(... |
# LIBTBX_SET_DISPATCHER_NAME phenix.sort_hetatms
# TODO sort waters by distance from macromolecule
# FIXME special treatment required for carbohydrates?
from __future__ import absolute_import, division, print_function
from libtbx.utils import Sorry, Usage, null_out
from libtbx import adopt_init_args
from libtbx impor... |
#!/usr/bin/env python3
import json
import logging
import os
import sys
from github import Github
from report import create_build_html_report
from s3_helper import S3Helper
from get_robot_token import get_best_robot_token
from pr_info import PRInfo, get_event
from commit_status_helper import get_commit
from ci_config ... |
import collections
import re
import urllib.parse
from datetime import datetime
import pysolr
import requests
from babel.dates import format_date
from babel.numbers import format_decimal
from edh_web_application.models.Place import Place
from edh_web_application.models.convert import inscription
from edh_web_applicatio... |
import numpy as np
import cv2
import os
import sys
import logging
from visionlib.utils.webutils import web
from visionlib.utils.imgutils import Image
class ODetection:
"""This class contains all functions to detect objects from an image.
. . .
Methods:
detect_objects():
U... |
# -*- coding: utf-8 -*-
"""
hold global config
"""
import logging
_global_dict = {}
def init_glb():
"""
initialize global variables
"""
global _global_dict
_global_dict = {
"configManage": None,
"projectScript": None,
"userData": {},
"deviceInstance": None,
... |
# Given a graph (adjacency matrix) calculates the minimum distance between each vertex pair
from collections import defaultdict
INF = 999999999
class Graph:
# Constructor
def __init__(self, vertices, directed=True):
# default dictionary to store graph
self.graph = defaultdict(list)
... |
from __future__ import print_function, division
from sympy.combinatorics import Permutation as Perm
from sympy.combinatorics.perm_groups import PermutationGroup
from sympy.core import Basic, Tuple
from sympy.core.compatibility import as_int, range
from sympy.sets import FiniteSet
from sympy.utilities.iterables import ... |
# -*- coding: utf-8 -*-
from ._global import _f
"========================================边栏类======================================"
# 栏间线
column_sep = _f(r'''(?P<xx> # 栏线线型
F| # 反线
S| # 双线
Z| # 正线(缺省)
D| # 点线
Q| # 曲线
=| # 双曲线
CW| # 外粗内细文武线
XW| # 外细内粗文武线
{lace} # 花边线
)'''... |
# Copyright 2018 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
#! /usr/bin/env python
"""Setup file for yang package
See:
https://packaging.python.org/en/latest/distributing.html
"""
import os
import re
import sys
import shlex
import unittest
import subprocess
from setuptools import setup, find_packages, Command
from setuptools.command.test import test
pkg_name = 'yang.con... |
import os
import re
from typing import Any
from typing import Dict
from typing import Iterator
from typing import List
from lark import Lark
from lark import Token
from lark import Tree
class InvalidMarker(ValueError):
"""
An invalid marker was found, users should refer to PEP 508.
"""
... |
#!/usr/bin/env python3
# Copyright (c) 2010 ArtForz -- public domain half-a-node
# Copyright (c) 2012 Jeff Garzik
# Copyright (c) 2010-2016 The Bitcoin Core developers
# Copyright (c) 2019 Bitcoin Association
# Distributed under the Open BSV software license, see the accompanying file LICENSE.
"""Bitcoin P2P network ha... |
RAWDATA_DIR = '/staging/as/skchoudh/re-ribo-datasets/hg38/SRP059546'
OUT_DIR = '/staging/as/skchoudh/re-ribo-analysis/hg38/SRP059546'
GENOME_FASTA = '/home/cmb-06/as/skchoudh/genomes/hg38/fasta/Homo_sapiens.GRCh38.dna_sm.primary_assembly.fa'
CHROM_SIZES = '/home/cmb-06/as/skchoudh/genomes/hg38/fasta/Homo_sapiens.GRCh38... |
from django.core.exceptions import SuspiciousOperation
from django.db.models.sql.compiler import SQLInsertCompiler, SQLUpdateCompiler
from psqlextra.expressions import HStoreValue
class PostgresReturningUpdateCompiler(SQLUpdateCompiler):
"""Compiler for SQL UPDATE statements that return
the primary keys of t... |
# Define here the models for your scraped items
#
# See documentation in:
# https://docs.scrapy.org/en/latest/topics/items.html
import scrapy
class FileDownloadItem(scrapy.Item):
file_urls = scrapy.Field()
files = scrapy.Field()
|
# coding: utf-8
"""
OpenAPI Petstore
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
... |
import os
from apistar.frameworks.wsgi import WSGIApp as App
from apistar.http import Response, Request
from apistar import Route
from psutil import cpu_percent
class CORSApp(App):
"""
Wraps an app, so that it injects CORS headers.
"""
def finalize_response(self, response: Response) -> Response:
... |
default_app_config = 'workflow.apps.WorkflowAppConfig'
|
"""
Copyright © 2021-2022 The Johns Hopkins University Applied Physics Laboratory LLC
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
right... |
"""
Retrain the YOLO model for your own dataset.
"""
import numpy as np
import keras.backend as K
from keras.layers import Input, Lambda
from keras.models import Model
from keras.optimizers import Adam
from keras.callbacks import TensorBoard, ModelCheckpoint, ReduceLROnPlateau, EarlyStopping
from yolo3.model import p... |
from CTFd.utils import get_app_config
from CTFd.utils.migrations import get_current_revision, create_database, drop_database, upgrade, stamp
from CTFd.utils.uploads import get_uploader
from CTFd.models import db
from CTFd.cache import cache
from datafreeze.format import SERIALIZERS
from flask import current_app as app
... |
from ..models import Key
from .literals import TEST_KEY_PRIVATE_DATA, TEST_KEY_PUBLIC_FILE_PATH
class KeyAPIViewTestMixin:
def _request_test_key_create_view(self):
return self.post(
viewname='rest_api:key-list', data={
'key_data': TEST_KEY_PRIVATE_DATA
}
)
... |
"""
@author: Anuj Kumar
@email: cdac.anuj@gmail.com
@date: 16-Apr-18
"""
import logging
from utility.services import Services
logging.basicConfig(format='%(asctime)s - %(levelname)s: %(message)s', datefmt='%m/%d/%Y %I:%M:%S %p',
level=logging.INFO)
from selenium.webdriver.support.select import Sel... |
import math
import torch
from .sampling import vonmises_quat_rand, quat_mult
# from display import bo_display
def cyclotron_twist_z(N,L,k,kappa,dtype):
pos = torch.tensor(L).type(dtype)*torch.rand(N,3).type(dtype)
if type(L)==float or type(L)==int:
qtarget = torch.cat((
torch.cos((2*m... |
# -*- coding: utf-8 -*-
"""
tests.templating
~~~~~~~~~~~~~~~~
Template functionality
:copyright: 2010 Pallets
:license: BSD-3-Clause
"""
import logging
import pytest
import werkzeug.serving
from jinja2 import TemplateNotFound
import flask
def test_context_processing(app, client):
@app.cont... |
from bocadillo import App
from bocadillo.testing import create_client
def test_no_allowed_origins_by_default():
app = App(enable_cors=True)
@app.route("/")
async def index(req, res):
pass
client = create_client(app)
response = client.options(
"/",
headers={
"o... |
#!/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.
'''
Run this script from the root of the repository to update all translations from
transifex.
It will do the following... |
import random
import os
import cv2
BIT_NUMBER = 10
from datetime import datetime
def getRandomFileName(fileName):
return f"{fileName}_%s" % (datetime.now().strftime("%Y%m%d%H%M%S"))
# Find greatest common divisor (GCD) using Extended Euclid
def GCD(a, b):
d, x, y = 0, 0, 0
if b > a:
a, b = b, ... |
n1 = int(input('Digite um número:'))
n2 = int(input('Digite outro número:'))
print(n1 + n2)
|
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.forms import widgets, ModelChoiceField
from django.utils.encoding import force_text
from django.utils.html import format_html
from django.utils.translation import ugettext_lazy as _
from filer.models.imagemodels import Image
from cms.plugin_p... |
from bokeh.plotting import figure, output_file, show
from FadingStatistics import FadingStatistics
import math
from data import debug_events
tests = [5]
def compress_signal(raw_value, trend_stats):
COMPRESSION_FACTOR = 3.0
normalized_value = raw_value - trend_stats.mean()
compression_limit = COMPRESSIO... |
from django.core.exceptions import ImproperlyConfigured
from actstream.registry import register, registry
from actstream.tests.base import ActivityBaseTestCase
from testapp_nested.models import my_model
class TestAppNestedTests(ActivityBaseTestCase):
def test_registration(self):
self.assertIn(my_model.... |
import pytest
import json
from collections import defaultdict
import time
import brickschema
from tqdm import tqdm
from rdflib import URIRef
from .util import make_readable
import sys
sys.path.append("..")
from bricksrc.version import BRICK_VERSION # noqa: E402
from bricksrc.namespaces import BRICK # noqa: E402
"""... |
# This code is part of Qiskit.
#
# (C) Copyright IBM 2017, 2018.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivat... |
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: chirpstack-api/as_pb/as_pb.proto
"""Generated protocol buffer code."""
from google.protobuf.internal import enum_type_wrapper
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message... |
# input: .JSON stream
# output: .JSON stream - optimized for a tracing based JIT
import sys
import json
from form_blocks import form_blocks
from util import flatten
from tdce_hj424 import opt_dce
def opt_trace(func):
# open profiling file
profile_file = "tests/branch_profile.json" # Hardcoded for convenience
... |
#!/usr/bin/env python
"""
_TestMonitor_
This is the test class for monitors
"""
from __future__ import print_function
import os.path
import time
from WMCore.Algorithms.SubprocessAlgos import *
from WMCore.WMRuntime.Monitors.WMRuntimeMonitor import WMRuntimeMonitor
from WMCore.WMSpec.Steps.Executor import getStepSpa... |
import torch
import torch.nn as nn
import torch.nn.functional as F
import transformers
from .utils import AttentionBlock
class PositionEmbedding(nn.Module):
def __init__(self, config):
super().__init__()
self.position_embeddings = nn.Embedding(
config.max_position_embeddings, config.hi... |
# -*- coding: utf-8 -*-
#
# Copyright (c) 2015 Cisco Systems, Inc. and others. 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... |
"""API properties.
"""
from __future__ import print_function
from __future__ import unicode_literals
from tabulate import tabulate, tabulate_formats, simple_separated_format
from platform import python_version_tuple
if python_version_tuple() >= ('3','3','0'):
from inspect import signature, _empty
else:
from... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
from collections import OrderedDict
import re
import sys
reload(sys)
sys.setdefaultencoding("utf-8")
f = open("preprocess/iso9", 'rb')
lines = [line for line in f]
bigru = lines[::4]
smallru = lines[1::4]
bigen = lines[2::4]
smallen = lines[3::4]
iso = OrderedDict()
for br, s... |
import os
import pytest
from notion_df.agent import download
NOTION_API_KEY = os.environ.get("NOTION_API_KEY")
NOTION_LARGE_DF = os.environ.get("NOTION_LARGE_DF")
NOTION_LARGE_DF_ROWS = 150
def test_nrows():
if not NOTION_LARGE_DF or not NOTION_API_KEY:
pytest.skip("API key not provided")
df = downlo... |
from justgood import imjustgood
api = imjustgood("YOUR_APIKEY_HERE")
data = api.jadian("17-08-1945")
print(data)
# EXAMPLE GET CERTAIN ATTRIBUTES
result = "Date : {}".format(data["result"]["date"])
result += "\n\nRelated : {}".format(data["result"]["related"])
result += "\n\nDescription : {}".format(data["result"][... |
# -*- coding: utf8 -*-
"""
"""
__author__ = "Jérôme Samson"
__copyright__ = "Copyright 2014, Mikros Image"
import os
import sys
import csv
import time
import datetime
from optparse import OptionParser
import numpy as np
import pygal
from pygal.style import *
try:
import simplejson as json
except ImportEr... |
# 119. Pascal's Triangle II
# Time: O(rowIndex^2)
# Space: O(rowIndex)
class Solution:
def getRow(self, rowIndex: int) -> List[int]:
ans = [1]
for i in range(rowIndex):
next_level = [0]*(len(ans)+1)
for j in range(len(next_level)):
if j==0 or j==len(next_l... |
class LeapYearFinder(object):
def __init__(self):
pass
def findLeapYear(self, startYear, endYear):
leapYearRecord = []
for i in range(int(startYear),int(endYear)):
year = i
print(year,end = "\t")
#If year is divisible by 4... |
"""
This code calculates the photon loss (kappa) due to the capacitive coupling between CPWs
and input/output transmission lines in a quantum circuit.
Two cases are treated: In the first case, three arguments are passed to the function kappa_in
and the resonant frequency of the CPW is input as a float. In the se... |
import pafy
import vlc
import time
from enum import IntEnum, auto
import logging
logging.basicConfig(level=logging.DEBUG, format="[%(levelname)s]: %(asctime)s:%(module)s:%(message)s")
# Use
class Action(IntEnum):
PLAY = 1
PAUSE = 2
STOP = 3
MUTE = 4
VOL_UP = 5
VOL_DN = 6
class VLCMediaPlaye... |
import numpy as np
import matplotlib.pyplot as plt
from scipy.stats import multivariate_normal
mean = [2,5]
cov = [[1,-0.1],[-0.1,1]]
X = np.random.multivariate_normal(mean,cov,size=10)
X_hat = np.empty(X.shape)
X_hat[:,0] = (X[:,0]-np.mean(X[:,0]))/np.std(X[:,0])
X_hat[:,1] = (X[:,1]-np.m... |
# 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 ... |
# -*- coding: utf-8 -*-
# ------------------------------------------------------------------------------
#
# Copyright 2022 Valory AG
# Copyright 2018-2020 Fetch.AI Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# ... |
# Copyright (c) OpenMMLab. All rights reserved.
import os
from functools import partial
from typing import Callable
import numpy as np
import onnx
import pytest
import torch
import torch.nn as nn
import torch.nn.functional as F
try:
from mmcv.tensorrt import (TRTWrapper, is_tensorrt_plugin_loaded, onnx2trt,
... |
from mongoengine import connect
from flask import Flask
app = Flask(__name__, instance_relative_config=True)
app.config.from_object('config')
connect(app.config['DB_NAME']) |
import torch
import numpy as np
class ExperienceReplay:
def __init__(self, psi_dim, x_dim, y_dim, device, sphere_cut=False):
self._psi_dim = psi_dim
self._x_dim = x_dim
self._y_dim = y_dim
self._device = device
self._sphere_cut = sphere_cut
self._y = torch.zeros(0, s... |
import os
import sys
VERSION = '2.21-dev0'
INSTALL_PREFIX = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
MIN_PYTHON_VERSION = (3, 5, 0)
# Check python version
if sys.version_info[:3] < MIN_PYTHON_VERSION:
sys.stderr.write('Unsupported Python version: '
'Python >= %d.%d.%d i... |
from __future__ import print_function
import argparse
import os
import subprocess
import tensorflow as tf
import tensorflow.contrib.slim as slim
from tensorflow.python.framework import graph_io
from lpr.trainer import inference
from utils.helpers import load_module
def parse_args():
parser = argparse.ArgumentPar... |
#!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'bank_backend.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise I... |
"""Example: Transform a point and invert the transformation
"""
from compas.geometry import Point
from compas.geometry import Rotation
from math import pi
p = Point(3, 4, 5)
T = Rotation.from_axis_and_angle([2, 2, 2], pi / 4)
p.transform(T) # transform Point p with T
print(p)
Tinv = T.inverse() # create inverse Tr... |
from . import overrides
from . import build_data
from . import check_data |
import platform
if platform.system().lower() == 'windows':
from .windows import *
else:
raise RuntimeError(f'This "{platform.system()}" platform does not supported.')
|
"""
Reads a file and returns the number of lines, words, and characters - similar to
the UNIX wc utility
"""
from re import sub
class TextAnilize:
def __init__(self, **qwargs):
self._file = 'file' in qwargs and qwargs['file'] or 'file'
self._text = 'text' in qwargs and qwargs['text'] or ''
... |
# -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... |
print("allo") |
import logging
import pytest
import retrying
import dcos.errors
import shakedown
import sdk_cmd
import sdk_install
import sdk_marathon
import sdk_plan
import sdk_tasks
from tests import config
log = logging.getLogger(__name__)
@pytest.fixture(scope='module', autouse=True)
def configure_package(configure_security... |
import requests
# from dotenv import load_dotenv
import os
import json
import logging
import urllib3
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
# Set logger
logger_format = '[%(asctime)s] - [%(name)s] - [%(levelname)s] - %(message)s'
logging.basicConfig(level=logging.INFO, format=logger_forma... |
from flask import Flask, url_for, render_template
from datetime import date
from json import load
import re
app = Flask(__name__)
with open("market_orders.json", 'r') as data:
market_orders = load(data)["market_orders"]
@app.route("/")
def index():
return render_template("index.html")
@app.route("/summary")
d... |
# -*- coding: utf-8 -*-
"""Linear_Regression.ipynb
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/154CXhkgz--XVuKrGLFkiNi-S1Iv1GdCU
"""
# We start by doing the required imports
import torch
import torch.nn as nn
import numpy as np
import matplotlib.p... |
from __future__ import print_function
from ghelpers import *
from helpers import write_json_log
class GAppsManager(object):
def __init__(self, config):
admin_email = config['super_admin_email']
key_path = config['key_file_path']
scopes = [
'https://www.googleapis.com/auth/admin... |
"""Module with JSON marshaler for Siren objects."""
import logging
from lila.serialization.marshaler import Marshaler
from lila.serialization.json.field import FieldMarshaler
from lila.serialization.json.action import ActionMarshaler
from lila.serialization.json.link import LinkMarshaler, EmbeddedLinkMarshaler
from l... |
# -*- coding: utf-8 -*-
# Copyright 2020 The StackStorm Authors.
# Copyright 2019 Extreme Networks, 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... |
"""
Django settings for rblmonitor project.
For more information on this file, see
https://docs.djangoproject.com/en/dev/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/dev/ref/settings/
"""
from django.urls import reverse_lazy
from os.path import dirname, join, ... |
import abc
import builtins
import collections
import collections.abc
import copy
from itertools import permutations
import pickle
from random import choice
import sys
from test import support
import threading
import time
import unittest
import unittest.mock
from weakref import proxy
import contextlib
import functools
... |
from __future__ import absolute_import
import contextlib
from .compat import mock
@contextlib.contextmanager
def mock_signal_receiver(signal, wraps=None, **kwargs):
"""
Taken from mock_django as importing mock_django created issues with Django
1.9+
Temporarily attaches a receiver to the provided ``... |
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "mysite.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
|
from typing import Any, Dict, List
import vaa
class Scheme:
"""A base class for implementing a custom validator.
The custom validator should implement `is_valid` method.
The method should return True if the data is valid.
Otherwise, it should set `errors` attribute and return False.
"""
da... |
class PATH:
GROUPS = "/groups"
MACHINES = "/machines"
class TAGS:
GROUPS = "groups"
MACHINES = "machines"
|
# -*- coding: utf-8 -*-
'''Common library with references to all the functions'''
__author__ = 'Mark Zwaving'
__email__ = 'markzwaving@gmail.com'
__copyright__ = 'Copyright (C) Mark Zwaving. All rights reserved.'
__license__ = 'MIT License'
__version__ = '0.0.1'
__maintainer__ = 'Mark Zwaving'
__s... |
# Copyright 2017 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... |
from selenium.webdriver.support.ui import WebDriverWait
from selenium.common.exceptions import TimeoutException
"""
This class wait for element with specified time, If not getting it throws exception
"""
class WaitForElement:
@staticmethod
def wait(driver, id, time_out=100):
try:
WebDrive... |
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class PerlFileSlurper(PerlPackage):
"""A simple, sane and efficient module to slurp a file"""
... |
# Generated by Django 3.1.3 on 2021-04-16 14:12
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('onlinecourse', '0002_auto_20210416_1104'),
]
operations = [
migrations.RemoveField(
model_name='question',
name='course',
... |
from collections import Iterable
from mathsat import msat_term, msat_env
from mathsat import msat_make_true, msat_make_false
from mathsat import msat_make_constant, msat_declare_function
from mathsat import msat_get_rational_type
from mathsat import msat_make_and as _msat_make_and
from mathsat import msat_make_or as _... |
from Crypto.Cipher import AES
import base64
import time
from hashlib import md5
enc = '3Y6SUOJw4QCM1fukxt2TWB2eO5giteB2TjzxJudeb2mnQYqLoND2bzU14Fc4hKZGi6Ezmeyh7MeHQT21GwCSDouhM5nsoezHh0E9tRsAkg4='
cipher = base64.b64decode(enc)
#Change the range max value according to the day of the event you are solving this challe... |
# -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------
import asy... |
import _plotly_utils.basevalidators
class HoverinfosrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(
self, plotly_name='hoverinfosrc', parent_name='cone', **kwargs
):
super(HoverinfosrcValidator, self).__init__(
plotly_name=plotly_name,
parent_name... |
# Generated by Django 3.2.4 on 2021-07-14 12:59
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('crud', '0018_auto_20210713_0117'),
]
operations = [
migrations.AlterField(
model_name='cat',
name='created_at',
... |
# %% lib import
from setuptools import setup, find_packages
import antools as ant
# %% pypi package setup
# classifiers for pypi package
CLASSIFIERS = [
'Framework :: IDLE',
'Topic :: Utilities',
'Development Status :: 3 - Alpha',
'License :: OSI Approved :: MIT License',
'Programming Language :: ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.