text stringlengths 1 927k |
|---|
"""create account loginsource column for user table
Revision ID: 5659632c7b2a
Revises: ea64b4d55bfb
Create Date: 2020-07-20 07:33:13.584759
"""
import sqlalchemy as sa
from alembic import op
# revision identifiers, used by Alembic.
revision = '5659632c7b2a'
down_revision = 'ea64b4d55bfb'
branch_labels = None
depend... |
import FWCore.ParameterSet.Config as cms
from RecoEgamma.EgammaIsolationAlgos.gamHcalExtractorBlocks_cff import *
gamIsoDepositHcalFromHits = cms.EDProducer("CandIsoDepositProducer",
src = cms.InputTag("photons"),
trackType = cms.string('candidate'),
MultipleDepositsFlag = cms.bool(False),
ExtractorPS... |
"""Support for Amcrest IP cameras."""
import asyncio
from datetime import timedelta
import logging
from urllib3.exceptions import HTTPError
from amcrest import AmcrestError
import voluptuous as vol
from homeassistant.components.camera import (
Camera,
CAMERA_SERVICE_SCHEMA,
SUPPORT_ON_OFF,
SUPPORT_STR... |
# Generated by Django 3.1.3 on 2021-02-17 19:13
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('department', '0001_initial'),
migrations.swappable_dependency(s... |
# Generated by Django 2.0.3 on 2018-03-27 23:36
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Address',
fields=[
... |
# Generated by Django 2.1.3 on 2018-11-25 09:23
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('decaptcha', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='captcharecord',
name='hashkey',
... |
import math
import numpy as np
import vsketch
class RandomFlowerSketch(vsketch.SketchClass):
num_line = vsketch.Param(200, 1)
point_per_line = vsketch.Param(100, 1)
rdir_range = vsketch.Param(math.pi / 6)
def draw(self, vsk: vsketch.Vsketch) -> None:
vsk.size("a4", landscape=True)
v... |
#!/usr/bin/env python3
import sys
from setuptools.command.test import test as TestCommand
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
settings = dict()
with open('requirements.txt') as file_requirements:
requirements = file_requirements.read().splitlines()
wit... |
from config import Config
import numpy as np
class BowlConfig(Config):
"""Configuration for training on the toy shapes dataset.
Derives from the base Config class and overrides values specific
to the toy shapes dataset.
"""
# Give the configuration a recognizable name
NAME = "bowl"
# Train ... |
import inspect
import json
import logging
import requests
import yaml
from abc import ABCMeta
from inflection import camelize
from inflection import dasherize
from inflection import underscore
from pathlib import Path
from typing import Any
from typing import Dict
from typing import List
from typing import Optional
f... |
"""Windows platform implementation."""
from __future__ import absolute_import
from __future__ import division
import ctypes
import errno
import functools
import subprocess
from collections import namedtuple
from ctypes import windll
from ctypes import wintypes
from kolibri.core.analytics.pskolibri.common import Acces... |
from YaDiskClient.YaDiskClient import YaDisk, YaDiskException
from .chunk_partitioner import ChunkPartitioner
class YaDiskWithProgress(YaDisk):
def upload(self, file, path):
resp = self._sendRequest("PUT", path, data=ChunkPartitioner(file, 'Uploading library'))
if resp.status_code != 201:
... |
import json
class Json:
def encode(self, request):
return json.dumps(request.body)
def decode(self, data):
return json.loads(data)
def content_type(self):
return "application/json" |
import unittest
import numpy as np
import numpy.testing as npt
from sparse_dot_mkl import gram_matrix_mkl
from sparse_dot_mkl.tests.test_mkl import MATRIX_1
class TestGramMatrix(unittest.TestCase):
@classmethod
def setUpClass(cls):
gram_ut = np.dot(MATRIX_1.A.T, MATRIX_1.A)
gram_ut[np.tril_in... |
from typing import Any, Dict, List
AnyDict = Dict[Any, Any]
StageKey = str
StageType = List[Dict[str, Any]]
ScriptDict = Dict[str, StageType] |
# Vicfred
# https://atcoder.jp/contests/abc042/tasks/abc042_a
# implementation, sorting
ins = list(map(int, input().split()))
ins.sort()
if ins == [5, 5, 7]:
print("YES")
else:
print("NO") |
#!/usr/bin/env python3.10
from police_lineups.singletons import Server
app = Server().current.app |
# -*- coding: utf-8 -*-
#
# Tethys Platform documentation build configuration file, created by
# sphinx-quickstart on Sat Oct 18 17:30:09 2014.
#
# 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... |
import requests
import re
import time
##
while 1:
# Waiting for the request
url = "http://quotidian-twins.000webhostapp.com/rasp.php"
payload = {'hall': '205'}
r=requests.post(url, data=payload)
#a = r.text.split("\n")
a=r.text
a = re.findall(r"[\w']+", a)
#print (a)
print(r.text)
if... |
from aio_net_events import NetworkEventDetector
from aio_net_events.backends.base import NetworkEventDetectorBackend
from anyio import CancelScope, create_task_group, sleep
from collections import defaultdict
from pytest import fixture, mark
from typing import Dict, List, Optional
class MockBackend(NetworkEventDetect... |
from math import fabs
import random
import graph
import solve_linalg
import stabilization
PRECISION = 5
def generate_matrix(size):
return [
[round(random.random(), PRECISION) if i != j else 0.0 for j in range(size)]
for i in range(size)
]
def output(title, caption, data):
print(title)
... |
import asn1tools
from utils import x509
from utils import io
from utils import misc
from utils import crypto
VALID_ASN_FILE = 'valid.asn'
EXPORTED_KEY_NAME = 'key.pem'
EXPORTED_CHAIN_NAME = 'chain.pem'
EXPORTED_CRL_NAME = 'crl.der'
def main():
args = misc.parse_arguments()
# Compile the ASN.1 specification
... |
"""
# Perspective Viewer
[Perspective](https://github.com/finos/perspective#readme) is an interactive visualization
component for large, real-time datasets. It comes with the `perspective-viewer` web component.
It enables analysts and traders at large banks like J.P.Morgan to understand their data. But it is
also ver... |
#!/usr/bin/env python
#
# Copyright 2016 Google 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.apache.org/licenses/LICENSE-2.0
#
# Unless requir... |
# pylint: disable=no-member,consider-using-enumerate
"""Broadcast operators"""
from __future__ import absolute_import as _abs
import tvm
from .import tag
from .util import get_const_tuple, equal_const_int
def _get_bcast_info(original_shape, target_shape):
"""Get the broadcasting info.
bcast_info = _get_bcast_... |
'''
input: direct user input in string
no filtering
sink: run ls in a dir
'''
'''
Created by Paul E. Black and William Mentzer 2020
This software was developed at the National Institute of Standards and Technology
by employees of the Federal Government in the course of their official duties.
Pursuant to title 17 Secti... |
import unittest
import numpy as np
import transforms3d as t3d
import open3d as o3
from probreg import l2dist_regs
from probreg import transformation as tf
class SVRTest(unittest.TestCase):
def setUp(self):
pcd = o3.io.read_point_cloud('data/horse.ply')
pcd = pcd.voxel_down_sample(voxel_size=0.01)
... |
# Copyright (c) Anish Acharya.
# Licensed under the MIT License
import numpy as np
from .base_gar import GAR
from scipy import stats
from typing import List
"""
Computes Trimmed mean estimates
Cite: Yin, Chen, Ramchandran, Bartlett : Byzantine-Robust Distributed Learning: Towards Optimal Statistical Rates
"""
class ... |
# -*- coding: utf-8 -*-
# Authors: Robert Luke <mail@robertluke.net>
# Eric Larson <larson.eric.d@gmail.com>
# simplified BSD-3 license
import os.path as op
import shutil
import os
import datetime as dt
import numpy as np
import pytest
from numpy.testing import assert_allclose, assert_array_equal
... |
import torch
import torch.nn as nn
import torch.nn.functional as F
from mmcv.cnn.bricks.transformer import build_dropout
from mmcv.cnn.utils.weight_init import trunc_normal_
from mmcv.runner.base_module import BaseModule
from ..builder import ATTENTION
from .helpers import to_2tuple
class WindowMSA(BaseModule):
... |
"""Tests for the utils module."""
from soco.utils import deprecated
# Deprecation decorator
def test_deprecation(recwarn):
@deprecated("0.7")
def dummy(args):
"""My docs."""
pass
@deprecated("0.8", "better_function", "0.12")
def dummy2(args):
"""My docs."""
pass
... |
import os
import yaml
import librosa
import numpy as np
from tqdm import tqdm
def slice_signal(file, window_size, stride, sample_rate):
wav, sr = librosa.load(file, sr=None)
if sr != sample_rate:
wav = librosa.resample(wav, sr, sample_rate)
wav = wav / np.max(np.abs(wav))
if np.max(wav) >... |
__author__ = "scott"
import requests
import json
import uuid
import os
AUTHORIZE_URL = "https://twist.com/oauth/authorize"
TOKEN_URL = "https://twist.com/oauth/access_token"
# callback url specified when the application was defined
# e.g. http://dev.twist.test:4567/v3/
CALLBACK_URI = "<<enter the callback url for yo... |
import py, os
from pypy.rlib.objectmodel import specialize
from pypy.rpython.lltypesystem import lltype, llmemory
from pypy.rlib.rarithmetic import intmask, r_uint
from pypy.jit.codegen.model import AbstractRGenOp, GenLabel, GenBuilder
from pypy.jit.codegen.model import GenVar, GenConst, CodeGenSwitch
from pypy.jit.cod... |
from django.db import models
from django.contrib.auth.models import User
# Create your models here.
class User(models.Model):
name = models.CharField(max_length=30)
user_id = models.IntegerField()
hood_id = models.IntegerField(blank=True, null=True)
email = models.EmailField()
date = models.DateFi... |
import math
from functools import partial
from functools import partialmethod
import torch
import torch.nn as nn
import torch.nn.functional as F
from .resnet import conv1x1x1, Bottleneck, ResNet
def partialclass(cls, *args, **kwargs):
class PartialClass(cls):
__init__ = partialmethod(cls.__init__, *arg... |
from csv import DictReader
from datetime import datetime
import logging
from pathlib import Path
import pickle
from pprint import pprint
import sys
from time import sleep
import click
import requests
from rich.console import Console
from rich.logging import RichHandler
from rich.prompt import Confirm, Prompt
from rich... |
# import pafy # https://github.com/mps-youtube/pafy
# import vlc
# import urllib
# import json
# from slackeventsapi import SlackEventAdapter
# from slack import WebClient
# from slack_webhook import Slack
# from ytplayer_pkg.youtube_lib import YouTubePlayer, YouTubeVideo
# from urllib.parse import urlencode
# import ... |
from django.db import models
import uuid
# Related Model
from api.models.post import Post
from api.models.author import Author
# List of tuples containing the content-types that are handled by this model
ContentTypes = [
('text/markdown' , 'text/markdown'),
('text/plain' , 'text/plain'),
('appl... |
# -*- coding: utf-8 -*-
"""
pygments.lexers.typoscript
~~~~~~~~~~~~~~~~~~~~~~~~~~
Lexers for TypoScript
`TypoScriptLexer`
A TypoScript lexer.
`TypoScriptCssDataLexer`
Lexer that highlights markers, constants and registers within css.
`TypoScriptHtmlDataLexer`
Lexer th... |
"""Forms for users."""
import logging
from crispy_forms.helper import FormHelper
from crispy_forms.layout import Submit, Layout, Fieldset, ButtonHolder, HTML
from django_select2.forms import Select2Widget
from taggit.forms import TagField
from taggit_labels.widgets import LabelWidget
from django import forms
from .... |
# Copyright (c) 2016 Uber Technologies, Inc.
#
# 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, merge, publ... |
#! C:\IronPython27\ipy.exe
import clr
import sys
import threading
from Microsoft.Win32 import Registry
for vsver in ["14.0", "12.0", "11.0", "10.0"]:
key = Registry.LocalMachine.OpenSubKey("Software\\Microsoft\\PythonTools\\" + vsver)
if not key:
continue
value = key.GetValue("InstallDir")
key.... |
import os
import pytest
from . import run
from .conditions import has_http
def test_unit(cmake, unittest):
cwd = cmake(
["sentry_test_unit"], {"SENTRY_BACKEND": "none", "SENTRY_TRANSPORT": "none"}
)
env = dict(os.environ)
run(cwd, "sentry_test_unit", ["--no-summary", unittest], check=True, env... |
# --------------------------
# UFSC - CTC - INE - INE5603
# Exercício Processa Números
# --------------------------
# Classe responsável por verificar se lista não possui números repetidos.
from view.paineis.painel_abstrato import PainelAbstrato
from model.processa_numeros import sem_repeticoes
class PainelSemRepetic... |
# 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 2.0 (the
# "License"); you may not u... |
from __future__ import unicode_literals
from .models import apigateway_backends
from ..core.models import MockAWS, base_decorator
apigateway_backend = apigateway_backends['us-east-1']
mock_apigateway = base_decorator(apigateway_backends) |
# Copyright (c) 2021-2022, NVIDIA CORPORATION & AFFILIATES
#
# SPDX-License-Identifier: BSD-3-Clause
import numpy as np
import cupy as cp
import cuquantum
from cuquantum import custatevec as cusv
nIndexBits = 3
nSvSize = (1 << nIndexBits)
nMaxShots = 5
nShots = 5
bitStringLen = 2;
bitOrdering = np.asarr... |
"""
This is the Centralized pit application.
Pit owns blobs for analysis, the results of the analysis, the rules used to
score analysis, and serves it all up on demand.
"""
import os
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from flask_migrate import Migrate
import flask_restless_swagger
from fl... |
from typing import Callable, List, Optional
import blspy
from blspy import AugSchemeMPL, PrivateKey
from chia.types.coin_solution import CoinSolution
from chia.types.spend_bundle import SpendBundle
from chia.util.condition_tools import conditions_dict_for_solution, pkm_pairs_for_conditions_dict
async def sign_coin_... |
# Author: Kevin Köck
# Copyright Kevin Köck 2017-2019 Released under the MIT license
# Created on 2017-10-28
COMPONENT_NAME = "I2C"
"""
example config:
{
package: .machine.i2c
component: I2C
constructor_args: {
SCL: D4
SDA: 4
#FREQ: 100000 #optional, defaults to 100000
}
}
... |
# Generated by Django 2.1.15 on 2020-06-03 16:28
import core.models
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0005_auto_20200531_1556'),
]
operations = [
migrations.AddField(
model_name='recipe',
na... |
import sys
if "locust" in sys.argv[0]:
try:
# monkey patch all at beginning to avoid RecursionError when running locust.
# `from gevent import monkey; monkey.patch_all()` will be triggered when importing locust
from locust import main as locust_main
print("NOTICE: gevent monkey pat... |
"""
# -*- coding:utf-8 -*-
# based on:
# - txamqp-helpers by Dan Siemon <dan@coverfire.com> (March 2010)
# http://git.coverfire.com/?p=txamqp-twistd.git;a=tree
# - Post by Brian Chandler
# https://groups.google.com/forum/#!topic/pika-python/o_deVmGondk
# - Pika Documentation
# https://pika.readthedocs.io/en... |
from email.header import Header
from email import encoders
from email.mime.text import MIMEText
from email.mime.multipart import MIMEMultipart
from email.mime.image import MIMEImage
import smtplib
import pdfkit
import subprocess
import os
import time
from selenium import webdriver
import logging as log
log.basicConfi... |
# Copyright (c) 2017-present, Facebook, 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 agreed... |
from sys import maxsize
from typing import Any, Callable, List, Optional, TypeVar
from reactivex import Observable
from reactivex import operators as ops
_T = TypeVar("_T")
# pylint: disable=redefined-builtin
def slice_(
start: Optional[int] = None, stop: Optional[int] = None, step: Optional[int] = None
) -> Ca... |
from pydantic import BaseSettings
class Config(BaseSettings):
tuling_url: str
tuling_apikey: str
class Config:
extra = "ignore" |
# Copyright (c) 2018 PaddlePaddle 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 app... |
import unittest
from zoo import *
class TestHabitat(unittest.TestCase):
def test_name_empty_string_by_default(self):
habitat = Habitat()
self.assertEqual(habitat.name, '')
def test_members_empty_set_by_default(self):
habitat = Habitat()
self.assertIsInstance(habitat.members, set)
def test_add_animal_to_h... |
#!/usr/bin/env python
import pandas as pd
import numpy as np
import csv
import glob
import os
import re
import sys
import argparse
import configparser
import logging
'''
python script to merge source loss tables for Provinces and territories
where PSRA runs have een split up by economic region or sub regions
can be ... |
#!/usr/bin/python
#
# Copyright 2015 Google 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.apache.org/licenses/LICENSE-2.0
#
# Unless required b... |
import pickle
import torch
from tqdm.auto import tqdm
from gpt2_predictor import GPT2Predictor, GPT2TestSearchQueryDataModule
if __name__ == '__main__':
encoding = {
'Arts': 0,
'Business': 11,
'Computers': 10,
'Games': 12,
'Health': 9,
'Home': 6,
'News': 14,
... |
from setuptools import find_packages
from setuptools import setup
import os
version = '2.4.2.dev0'
longdesc = open(os.path.join(os.path.dirname(__file__), 'README.rst')).read()
longdesc += open(os.path.join(os.path.dirname(__file__), 'CHANGES.rst')).read()
longdesc += open(os.path.join(os.path.dirname(__file__), 'LIC... |
from django.test import TestCase, Client
from leads.models import Lead
from common.models import Address, User
from accounts.models import Account
class TestLeadModel(object):
def setUp(self):
self.client = Client()
self.user = User.objects.create(username='uday', email='u@mp.com', role="ADMIN")
... |
import json
import os
import time
import uuid
from copy import deepcopy
from datetime import datetime, timedelta, timezone
from random import randint
from urllib.parse import parse_qs, urlparse, urlsplit
import pystac
from pydantic.datetime_parse import parse_datetime
from pystac.utils import datetime_to_str
from shap... |
# model
model = Model()
i1 = Input("op1", "TENSOR_FLOAT32", "{2, 2, 2, 2}")
i2 = Output("op2", "TENSOR_FLOAT32", "{2, 2, 2, 2}")
model = model.Operation("SQRT", i1).To(i2)
# Example 1. Input in operand 0,
input0 = {i1: # input 0
[36, 90, 43, 36, 2, 22, 19, 10, 9, 80, 40, 90, 15, 56, 18, 12]}
output0 = {i2: ... |
import sys
import logging
import ast
import constants as c
import copy
import numpy
import os
import qcck
import qcgf
import qcio
import qcrp
import qcts
import qcutils
import time
import xlrd
import meteorologicalfunctions as mf
log = logging.getLogger('qc.ls')
def l1qc(cf):
# --- this is a separate actor in a s... |
#!/usr/bin/env python
#-*- coding:utf-8 -*-
# Author: Kun Huang <academicgareth@gmail.com>
from scalpels.db import api as db_api
LOWEST=8
def get_last_task():
last_task = db_api.task_get_last()
return last_task
def run(config):
uuid = config.get("uuid")
last = config.get("last")
if last and uui... |
#
# 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 2.0
# (the "License"); you may not us... |
"""
Copies all files under Participant/:id from ptc-uploads-all-of-us-rdr-prod to
awardee bucket with a site subdirectory. i.e. gs://aouxxx/Participant/hpo-site-xxx/P:id
include a "no-site-pairing" subdirectory for thos participants not paired.
Input: csv file with 'pmi_id' and 'paired_site' headers.
Input: awardee bu... |
from __future__ import print_function
import keras.backend as K
import keras.losses as losses
import keras.optimizers as optimizers
import numpy as np
from keras.callbacks import ModelCheckpoint
from keras.layers.advanced_activations import LeakyReLU
from keras.layers import Input, RepeatVector, Reshape
from keras.la... |
import random
import csv
FILE_NAME = "./data/bigtestfile.data"
COLUMNS = 1000
ROWS = 1000000
if __name__ == "__main__":
with open(FILE_NAME, "w") as file:
write = csv.writer(file)
for row in range(ROWS):
data = [ random.randint(0, 1000) for numbers in range(COLUMNS) ]
wr... |
#!/bin/python
# -*- coding: utf-8 -*-
#
# [kuuhakuDev]
# [DownloadYoutubeList]
#Descargar lista de reproduccion en youtube
#
#
#Usted puede copiar, editar, distribuir y hacer lo que quiera
#con el codigo presente...
#
#Leer licencia
import urllib2
import argparse
import commands
import os
href = "pl-video-title... |
import setuptools
with open("requirements.txt", "r") as f:
requirements = [line.replace("\n", "") for line in f.readlines()]
with open("README.md", "r") as fh:
long_description = fh.read()
with open("gdeltdoc/__init__.py", "r") as g:
version = "1.0.0"
for line in g.readlines():
if "__version_... |
# Generated by Django 3.0.3 on 2020-05-13 20:30
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import openfacstrack.apps.core.models
import openfacstrack.apps.track.models
class Migration(migrations.Migration):
initial = True
dependencies = [
... |
#!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... |
# Copyright 2017 TWO SIGMA OPEN SOURCE, 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 agree... |
import sys
sys.path.append('/home/pi/Dexter/GoPiGo3/Software/Python')
import scavbot
import config
from coneutils import calibrate
boundaries_dict = calibrate.load_boundaries('coneutils/boundaries.json')
image_model_dir = '/home/pi/Desktop/code/capstone_project/capstone-project-3/scav-hunt/custom_model_edgeTPU/'
cone... |
# Generated by Django 2.2 on 2019-04-14 18:10
import courses.fields
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('courses', '0002_content_file_image_text_video'),
]
operations = [
migrations.AlterModelOptions(
name='content',
... |
print("------------class enum.Enum")
from enum import Enum, unique, auto
class Color(Enum):
RED = 1
GREEN = 2
BLUE = 3
print(type(Color.RED))
print(isinstance(Color.GREEN, Color)) # True
print(repr(Color.RED))
print(Color.RED)
print(Color.RED.name)
print(Color.RED.value)
print(Color.RED == 1) # False
... |
from dbconfig import connection
from exception import QueryFieldException, EmptyArgsException
import sqlines
from sqlite3 import OperationalError
import logging
logging.basicConfig(format=u' %(message)s', level=logging.INFO)
class Query:
'''
The query class for querying our database.
All methods of the c... |
# Copyright (c) 2021 PaddlePaddle 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 appli... |
# Copyright The Cloud Custodian Authors.
# SPDX-License-Identifier: Apache-2.0
#
from c7n_kube.query import QueryResourceManager, TypeInfo
from c7n_kube.provider import resources
@resources.register('daemon-set')
class DaemonSet(QueryResourceManager):
class resource_type(TypeInfo):
group = 'Apps'
... |
import datetime
import pytz
from django.contrib.auth import get_user_model
from django.test import TestCase
from django.utils import timezone
from rest_framework import serializers
from accounts.models import Email, Major, PhoneNumber, School, User
from accounts.serializers import (
EmailSerializer,
MajorSeri... |
from __future__ import print_function
import FWCore.ParameterSet.Config as cms
process = cms.Process("ViewDigi")
# Dump of different types of digis produced
# by CSC RawToDigi chane
process.load("SimGeneral.MixingModule.mixNoPU_cfi")
process.load("Geometry.MuonCommonData.muonIdealGeometryXML_cfi")
process.load("Geo... |
# Copyright 2016-2018, Pulumi Corporation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed t... |
#!/usr/bin/env python3
# Copyright (c) 2014-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the listtransactions API."""
from test_framework.test_framework import BitcoinTestFramework
from ... |
import threading
import time
RASPBERRY = object()
BEAGLEBONE = object()
board = RASPBERRY
try:
# Try with Raspberry PI imports first
import spidev
import RPi.GPIO as GPIO
SPIClass = spidev.SpiDev
def_pin_rst = 22
def_pin_irq = 18
def_pin_mode = GPIO.BOARD
except ImportError:
# If they f... |
#!/usr/bin/python
"""
This script takes several vcf files with editing sites and determines editing islands
Created on 24.09.17
@author: david
"""
import argparse
from Genome import Genome
from VariantSet import VariantSet
parser = argparse.ArgumentParser(description='reanalyze editing islands.')
parser.add_argumen... |
import logging
import math
from typing import Any, Dict, List, Optional, Tuple
import torch
import torch.nn.functional as F
from torch.autograd import Variable
from overrides import overrides
from allennlp.common import Params
from allennlp.data import Vocabulary
from allennlp.models.model import Model
from allennlp.... |
version_osbot_gsuite = "v0.32 (GW)" |
'''
实验名称:【我的学习系统】之OLED中文显示(I2C总线)
版本:v1.0
日期:2021.6.5
作者:kaixindelele
'''
from machine import SoftI2C,Pin #从machine模块导入I2C、Pin子模块
from ssd1306 import SSD1306_I2C #从ssd1306模块中导入SSD1306_I2C子模块
class OLED_Show:
def __init__(self, sda_pin=18, scl_pin=23):
# 初始化I2C,设定好端口
self.i2c =... |
#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import warnings
from typing import Any, List, Optional
from ax.core.experiment import Experiment
from ax.core.search_s... |
# -*- coding: utf-8 -*-
# Copyright 2011 Yelp
#
# 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 ... |
# 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 the S... |
"""
This script builds the multi-structured database. Each node is present in every layer.
The higher layer has the edges from the previous layer and their first neighbours.
"""
import sqlite3
from collections import OrderedDict as od
# Building mock data set
DB = od([('signor', 'SLK_Core'),
('PSP', ... |
"""
molssi_devops_uf.py
Workshop
Handles the primary functions
"""
def mean(num_list):
"""
Calculate the mean/average of a list of numbers
Parameters
------------
num_list : list
THe list to take the average of
Returns
------------
mean_list : float
The mean of the ... |
"""Execute the AWS CLI update-kubeconfig command."""
from __future__ import print_function
import os
import logging
import shutil
import six
import yaml
LOGGER = logging.getLogger(__name__)
def copy_template_to_env(path, env, region):
"""Copy k8s module template into new environment directory."""
overlays_d... |
"""
This module lets you practice MUTATION of objects
by changing the values of instance variables.
Authors: David Mutchler, Amanda Stouder, Chandan Rupakheti, Katie Dion,
Claude Anderson, Delvin Defoe, Curt Clifton, their colleagues,
and PUT_YOUR_NAME_HERE.
""" # Done: 1. PUT YOUR NAME IN THE A... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.