content stringlengths 5 1.05M |
|---|
# Generated by Django 2.2.7 on 2019-12-02 01:50
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Year',
fields=[
... |
#!/usr/bin/python
import sys
import json
import os
input = sys.argv[2]
if os.path.isfile(input):
json_data=open(input)
json_dict = json.load(json_data)
json_data.close()
else:
json_dict = dict()
def escape_latex(name):
CHARS = {
'&': r'\&',
'%': r'\%',
'$': r'\$',
... |
import boto3
from botocore.exceptions import ClientError
def run():
try:
aws_resource=boto3.resource('s3')
name_of_bucket=input("Please enter name of your bucket: ")
bucket = aws_resource.Bucket(name_of_bucket)
response = bucket.create(
ACL='public-read',
Cre... |
from datetime import datetime as DateTime
from vesper.tests.test_case import TestCase
from vesper.util.datetime_formatter import DateTimeFormatter
class DateTimeFormatterTests(TestCase):
def test_get_min_time_increment(self):
get_increment = DateTimeFormatter.get_min_time_increment
... |
__author__ = 'guorongxu'
import os
import sys
import logging
import pandas as pd
def parse(root_raw_dir, root_expression_dir, tumor_type, release_year, release_month, release_day):
mirna_file = root_raw_dir + "/" + tumor_type + "/gdac.broadinstitute.org_" + tumor_type \
+ ".Merge_mirnaseq__illumi... |
#!/usr/bin/python3
from decimal import Decimal
import pytest
import json
import time
from btc.config import Config
from btc.constants import *
from btc.websockets import BlockWebSocket
from btc.utils import convertToSatoshi, sortUnspentOutputs, decodeTransactionDetails
from logger import logger
from rpcutils.rpcconnect... |
from uuid import uuid4
from pydantic import BaseModel
from beanie import Document
from typing import Optional, List
class SkillsModel(Document):
skill_id : str = str(uuid4())
skill_name : str
tags : Optional[List[str]] = []
class Config:
anystr_lower = True
class Collection:
... |
import bar.baz as baz
def mod_func_1(a, b, c):
return a * b + c
class Foo():
def __init__(self, kiwi):
self.kiwi = kiwi
def do_instance_thing(self, a, b):
def recurse(items):
if isinstance(items, list):
return items
for item in items:
... |
def top_ten():
n=1
while n<=9:
sq=n*n
yield sq #Generators
n+=1
values = top_ten()
for i in values:
print(i)
|
"""
Module supporting analysis of variable declaration and usage.
"""
import ast
import sys
from typing import Dict, Set, List, Tuple
TYPE_COERCIONS = {
("bool", "i64"): "i64",
("i64", "bool"): "i64",
("bool", "f64"): "f64",
("f64", "bool"): "f64",
("i64", "f64"): "f64",
("f64", "i64"): "f64",... |
from distutils.core import setup
setup(
name='dns-monitor',
version='0.1',
packages=['dnsmon', 'dnsmon.tests', 'dnsmon.webapp'],
url='',
license='apache 2',
author='3ev0',
author_email='ipooters@gmail.com',
description='Monitor domains/IPs for changes'
)
|
from pymtl import *
from lizard.util.rtl.interface import Interface, UseInterface
from lizard.util.rtl.method import MethodSpec
from lizard.util.rtl.register import Register, RegisterInterface
from lizard.util.rtl.onehot import OneHotEncoder
from lizard.util.rtl.async_ram import AsynchronousRAM, AsynchronousRAMInterfa... |
""" This file defines the BADMM-based GPS algorithm. """
import copy
import logging
import numpy as np
import scipy as sp
import sys
# sys.path.append('/'.join(str.split(__file__, '/')[:-2]))
from gps.algorithm.algorithm import Algorithm
from gps.algorithm.algorithm_utils import PolicyInfo
from gps.algorithm.config ... |
import pandas as pd
import numpy as np
import os
import cv2
import time
import random
import argparse
import rasterio
from sklearn.utils import shuffle
parser = argparse.ArgumentParser(description='creates training sets to train and validate sealnet instances')
parser.add_argument('--rasters_dir', type=str, help='root... |
# -*- coding: UTF-8 -*-
import numpy
import setting
import setting
# Note: 重构独热码编码
# Time: 2021/12/7 10:29 下午
# Author: HengYi
# 原来的独热码编码时位置计算太依赖数字,这样每次改动图片大小时都有可能对应改动编码算法。
# 而且解码也必须依赖数字。从这两个角度优化,新的独热码代码如下:
# 参考链接 https://github.com/dee1024/pytorch-captcha-recognition/issues/18
# 在此基础上进行了针对性部署,达到了相同的效果
num = {'0': ... |
# flake8: noqa
from .oauth import OAuth, RemoteApp
|
from Funktion import Funktion, vorzeichen_str
from Grundklassen import Graph
import math
import tkinter as tk
class TangenteNormale_Frame(tk.Frame):
__funktion = None
funktionen = []
parameter = None
def __init__(self, master=None,parameter=None, ableitung=None, pdf_writer=None):
tk.Frame._... |
from pytest import mark
from pytest_mock import MockFixture
from {{ cookiecutter.project_slug }} import __main__ as main
@mark.unit
def test_init(mocker: MockFixture):
mock = mocker.patch.object(main, 'main')
bak = main.__name__
main.__name__ = '__main__'
main.init()
mock.assert_called_once()
... |
# coding: utf-8
import sys
import os
pardir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
sys.path.append(pardir)
|
from memory.space import Reserve
import instruction.asm as asm
import args
class RandomRNG:
def __init__(self):
if args.random_rng:
self.mod()
def mod(self):
import random
rng_table = list(range(256))
random.shuffle(rng_table)
space = Reserve(0x0fd00, 0x0fd... |
# Part of Pull Req #2 by @MaskedVirus | github.com/swatv3nub
import time
from datetime import timedelta
import requests
from pyrogram import filters
from pyrogram.types import InlineKeyboardButton, InlineKeyboardMarkup
from DaphneRobot import app
from DaphneRobot.core.decorators.errors import capture_err
__MODULE__... |
# encoding: utf-8
from __future__ import absolute_import
from __future__ import print_function
import logging
from datetime import datetime
import json
from .elements import Value
class InvalidReportError(Exception):
"""
Exception raised when the API says a report defintion is
invalid
"""
def no... |
from collections import defaultdict
from typing import Any, Dict, List, Union
from ..users.projector import get_user_name
from ..utils.projector import (
ProjectorAllDataProvider,
ProjectorElementException,
get_config,
get_model,
register_projector_slide,
)
# Important: All functions have to be p... |
counts = gdf['land_use_class'].value_counts() |
# -*- coding: utf-8 -*-
"""
@author: Rafaela BF
Faça um programa que resolva Bhaskara por meio de uma equação completa do segundo grau.
"""
eq = input("Entre com a equação: ")
aux =[""]*3
i = eq.find("²", 0)
aux[0] = eq[0:(i+1)]
j = eq.find("x", i)
aux[1] = eq[(i+1):(j+1)]
aux[2] = eq[(j+1):len(eq)]
i = 0
j = 0
#... |
import sys
def do_reduce(word, values):
return word, sum(values)
kv = dict()
for key, value in map(lambda x: x.split("\t"), (line for line in sys.stdin)):
if key not in kv:
kv[key] = [int(value)]
else:
kv[key].append(int(value))
for key, value in kv.items():
print(f"{key}\t{value}")... |
"""
Django settings for dental project.
Generated by 'django-admin startproject' using Django 3.0.3.
For more information on this file, see
https://docs.djangoproject.com/en/3.0/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.0/ref/settings/
"""
import os
imp... |
"""
========================================================================
MagicMemoryCL
========================================================================
A behavioral magic memory which is parameterized based on the number of
memory request/response ports. This version is a little different from
the one in pc... |
import cv2
cv2.setNumThreads(0)
cv2.ocl.setUseOpenCL(False)
import albumentations as al
from albumentations.augmentations import functional as F
from albumentations.pytorch import ToTensorV2
def get_common_train_transforms():
return [
# al.OneOf([
# al.RandomRotate90(),
# al.Rota... |
""" A setuptools based setup module. """
__author__ = "William Tucker"
__date__ = "2019-10-03"
__copyright__ = "Copyright 2019 United Kingdom Research and Innovation"
__license__ = "BSD - see LICENSE file in top-level directory"
from setuptools import setup, find_packages
with open("README.md") as readme_file:
... |
#!/usr/bin/env python3
import argparse
import time
import json
from argparse import RawTextHelpFormatter
from pyhmy import (
blockchain,
cli,
json_load,
Typgpy
)
from AutoNode import (
common,
util,
node,
validator
)
validator_addr = common.validator_config['validator-addr']
endpoint =... |
from typing import Dict, Optional
from unittest.mock import patch
import fakeredis
import pytest
from django.core.cache import cache
from graphql import get_default_backend
from redis import ConnectionPool
from ....graphql.api import schema
from ..buffers import RedisBuffer
from ..utils import GraphQLOperationRespons... |
from lib.losses3D.basic import *
import torch.nn as nn
# Code was adapted and mofified from https://github.com/wolny/pytorch-3dunet/blob/master/pytorch3dunet/unet3d/losses.py
class PixelWiseCrossEntropyLoss(nn.Module):
def __init__(self, class_weights=None, ignore_index=None):
super(PixelWiseCrossEntropyL... |
import tensorflow as tf
import numpy as np
def model(tensor_in, filtersizes, constraint=None, initializer=None):
# Downconv
layer1 = tf.layers.conv2d(
tensor_in,
filtersizes[0],
kernel_size=(4, 4),
strides=(1, 1),
padding="SAME",
activation=tf.nn.leaky_relu,
... |
from typing import Optional, List, Any, Dict, Union, TypeVar, cast
from reppy.cache import ReraiseExceptionPolicy, RobotsCache # type: ignore
from reppy.exceptions import ConnectionException # type: ignore
from lxml import html as lxmlhtml # type: ignore
from bs4 import BeautifulSoup # type: ignore
from itertools impor... |
# Generated by Django 2.2.5 on 2020-10-05 18:38
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('teams', '0013_auto_20201005_2330'),
]
operations = [
]
|
#!/bin/python
# -*- coding:utf-8 -*-
from __future__ import print_function
import os
import sys
import shutil
import subprocess
import logging
import re
import json
import xml.etree.ElementTree
def Error(msg):
logging.error('[RPT ERROR]{0}'.format(msg))
class MerlinRun(object):
def __init__(self, path, option... |
import itertools
import math
import time
def num_divisors(num):
factors = 0
for x in xrange(1, int(math.sqrt(num) + 1)):
if num % x == 0:
factors += 2
return factors
def main():
num = 0
for i in itertools.count():
num += i
if num_divisors(num) > 500:
print("The result is %d." % num)
return
if __... |
"""
membership_cli - cli tasks needed for memberhip management
"""
# standard
from logging import basicConfig, DEBUG, INFO, getLogger
from csv import DictReader
from datetime import timedelta, datetime
from os import mkdir
from os.path import join, exists
# pypi
from flask import g, current_app
from flask.cli import ... |
"""update version string during build"""
#=============================================================================
# imports
#=============================================================================
from __future__ import with_statement
# core
import os
import re
import time
from distutils.dist import Distrib... |
# Copyright (c) 2016 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... |
print("Logical Operators")
print("\nand operator")
weather = "sunny"
friends = "free"
if weather == "sunny" and friends == "free":
print("Go to Theme park")
else:
print("Stay home")
print("\nor operator")
if weather == "rainy" or friends == "busy":
print("Have rest")
print("\nnot operator")
print(8>4)
p... |
import argparse
def test_parser():
parser = argparse.ArgumentParser(description='linear eval test')
parser.add_argument('--train_type', default='linear_eval', type=str, help='standard')
parser.add_argument('--dataset', default='cifar-10', type=str, help='cifar-10/cifar-100')
parser.add_argument('--load... |
import os
__name__ = "diffgram"
__version__ = os.getenv('DIFFGRAM_SDK_VERSION')
from diffgram.core.core import Project
from diffgram.file.file import File
from diffgram.task.task import Task
|
import os
def breakingRecords(scores):
h = 0
l = 0
min_score = scores[0]
max_score = scores[0]
for s in scores[1:]:
if s > max_score:
max_score = s
h += 1
if s < min_score:
min_score = s
l += 1
return h, l
... |
import os, sys, subprocess
ignore = (
'tuple_keys.py',
'for_else.py',
'while_else.py',
'__getattr__.py',
'mi__getattr__.py',
)
TODO_FIX = (
'yield.py',
#'set_slice.py',
#'variable_kwargs.py',
)
for folder in 'class list calling str dict loop lang set'.split():
report = [
'JavaScript Backend Regression T... |
"""
OpenVINO DL Workbench
Class for creating accuracy scripts job
Copyright (c) 2021 Intel 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/LIC... |
import numpy as np
import math
from os import system
#import other program files
import loads
import reactions
import supports
import global_functions
system('cls')
def get_beam_length():
user_input = input("enter beam length (m) ")
if global_functions.is_number(user_input):
BEAM_LENGTH = eval(user_i... |
"""Shared utility functions"""
def get_transitive_files(label):
"""Get transitive sources for python files
Args:
label: A label of a python library.
Returns:
A list of transitive source files.
"""
return label[PyInfo].transitive_sources.to_list()
def get_transitive_deps(deps, provider... |
#!/usr/bin/env python3
# MIT License
#
# Copyright (c) 2021 Eugenio Parodi <ceccopierangiolieugenio AT googlemail DOT com>
#
# 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 restricti... |
###############################################
# Format numbers using format method
# Shiva K
###############################################
print("I have {0:d} cats".format(6))
print("I have {0:3d} cats".format(6))
print("I have {0:03d} cats".format(6))
print("I have {0:f} cats".format(6))
print("I have {0... |
import sys, os
import time
import torch
import visdom
import argparse
import numpy as np
import torch.nn as nn
import torch.nn.functional as F
import torchvision.models as models
from torch.autograd import Variable
from torch.utils import data
from tqdm import tqdm
from ptsemseg.models import get_model
from ptsemseg.... |
import numpy as np
import random
class RandomAgent:
"""A completely random soaring agent.
This is used to document the api for all agents."""
def get_action(self, observation):
"""Returns the action the agents intends to do
at the moment.
- 0: Decrease bank angle by five degrees.
... |
# coding: utf-8
import copy
from unittest import TestCase
from rels.relations import Relation, Column, Record
from rels import exceptions
class Enum(Relation):
name = Column(primary=True, no_index=False, primary_checks=True)
value = Column(external=True, no_index=False)
class EnumWithText(Relation):
n... |
# -*- coding: utf-8 -*-
"""
Created on Wed Jul 11 10:28:06 2018
@author: herminarto.nugroho
"""
import pandas as pd
import numpy as np
from PIL import Image
import torch
from torchvision import transforms
from torch.utils.data.dataset import Dataset # For custom datasets
from torch.utils.data.sampler import SubsetR... |
# classes to hold the physical components of the system
# e.g. the stellar light, dark matter, black hole, globular clusters
import numpy as np
import logging
from dynamite import mges as mge
class System(object):
"""The physical system being modelled
e.g. system is a galaxy. A system is composed of ``Compo... |
# from __future__ import division
# import math, random, re
# from collections import defaultdict, Counter, deque
# from linear_algebra import dot, get_row, get_column, make_matrix, magnitude, scalar_multiply, shape, distance
# from functools import partial
users = [
{ "id": 0, "name": "Hero" },
{ "id": 1, "na... |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Sat May 27 18:17:24 2017
@author: ollbap
"""
from tkinter import Label
from tkinter import LEFT
from MyGitUtil import gitPull
from MyGitUtil import gitPush
import traceback
import tkinter
from subprocess import call
from MyGitUtil import DirtyState
def... |
#!/usr/bin/env python3
"""Begin Imports"""
# Internal imports
from package.aur_manager import AURManager
from package.pacman_wrapper import PacmanWrapper
from package.fwupd_wrapper import FirmwareUpdateWrapper
# Python stdlib imports
from argparse import ArgumentParser
"""End Imports"""
def parse_args():
args =... |
# -*- coding: utf-8 -*-
import os
from gryphon.lib.models.emeraldhavoc.base import EmeraldHavocBase
import json
import uuid
from decimal import *
from collections import defaultdict
from gryphon.lib.money import Money
from gryphon.lib.exchange.consts import Consts
from gryphon.lib.exchange.exchange_factory import make... |
import unittest
import re
from scenario_test_support import *
class S07GrpcTest(unittest.TestCase):
maxDiff = None
archive = load_archive("07_grpc/intellij_files")
fortune_grpc_iml_content = archive["07_grpc/07_grpc.iml"]
def test_libraries(self):
self.assertEqual([
"jar://${BAZE... |
"""
DataTypes used by this provider
"""
import inspect
import ipaddress
import logging
import os
try:
from urllib.parse import urlparse
from urllib.parse import urljoin
except ImportError: # python 2
from urlparse import urlparse
from urlparse import urljoin
from keystoneclient.v3.regions import Regio... |
world_seed = bytearray([0x00, 0x00, 0x00, 0x00])
current_seed = world_seed.copy()
MAP_SIZE = 0x08
mem_map = bytearray([0x0F] * (MAP_SIZE * MAP_SIZE))
CONNECTION_TABLE = b'\x05\x0B\x06\x00\x0E\x05\x0B\x03\x09\x0E\x00\x00\x00\x0C\x00\x00\x00\x0C\x05\x06\x06\x0D\x0A\x09\x09\x0B\x06\x00\x00\x05\x0A\x00\x05\x0B\x06\x0... |
import unittest
import async
from async.test import (
QOTD,
QOTD_IP,
HOST,
ADDR,
)
class TestSocket(unittest.TestCase):
def test_basic(self):
s = async.socket()
def test_connection_made(self):
def cb1(*args, **kwds):
pass
def cb2(*args, **kwds):
... |
"""
Copyright (C) 2020 Intel 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 to in wri... |
from flask import (redirect, render_template, session, url_for,
current_app, flash)
from project.tickets import TicketsAPI
from project import rbac, db
from project.models import Entry
from . import student_blueprint
@student_blueprint.route('/')
@rbac.allow(['student', 'admin'], ['GET'])
def inde... |
# 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 agreed to in writing, ... |
from copy import copy
import sqlite3
import pytest
from pandas_to_sql import wrap_df
from pandas_to_sql.testing.utils import fake_data_creation
sql_connection = sqlite3.connect('./example.db') #create db
TABLE_NAME_1 = 'random_data_1'
DF1, SCHEMA_1 = fake_data_creation.create_fake_dataset()
DF1.to_sql(TABLE_NAME_1, ... |
range = xrange
input = raw_input
def read_list(t): return [t(x) for x in input().split()]
def read_line(t): return t(input())
def read_lines(t, N): return [t(input()) for _ in range(N)]
N, M = read_list(int)
board = [[int(x) for x in row] for row in read_lines(list, N)]
ans = [[0]*M for _ in range(N)]
drc = [(-1, 0... |
from .tree import *
|
"""
Tests for modifier.
"""
import unittest
from unit_tests import ModuleTest
import numpy as np
from spikey.snn import modifier
class TestModifier(unittest.TestCase, ModuleTest):
"""
Tests for modifier.
"""
TYPES = [modifier.Modifier]
BASE_CONFIG = {"param": "processing_time"}
if __name__ == "... |
import json
from pathlib import Path
import pickle
import numpy as np
import pandas as pd
class __Encoder(json.JSONEncoder):
def default(self, obj):
if isinstance(obj, np.ndarray):
return obj.tolist()
if isinstance(obj, np.int64):
return int(obj)
return json.JSONE... |
import time
import threading
import usb.core
import usb.util
import array
import cairocffi
import rgbtools
import cProfile
_FRAMES_PER_SECOND = 60.0
class DisplayParameters:
DISPLAY_WIDTH = 960
DISPLAY_HEIGHT = 160
BUFFER_WIDTH = 1024
BUFFER_HEIGHT = 160
class DisplayRenderer(threading.Thread):
'''
Disp... |
#!/usr/bin/env python3.5
# Copyright 2018 Brocade Communications Systems LLC. 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 also obtain a copy of the License at
# http://www.apache.org/licenses/LICE... |
# -*- coding: utf-8 -*-
# ------------------------------------------------------------------------------
# Name: chord.tables.py
# Purpose: data and tables for chord and set class processing.
#
# Authors: Christopher Ariza
#
# Copyright: Copyright © 2001-2011 Christopher Ariza
# Copyright: Co... |
from fort_14 import Fort14
from fort_15 import Fort15
from fort_dg import FortDG
import datetime
import yaml
class DGSWEMv2Input:
def __init__(self,fort14,fort15,fortdg):
self.mesh_node = {'format' : 'Adcirc',
'file_name' : fort14.filename}
if fort15.ics == 1:
... |
import torch
torch.manual_seed(10)
torch.cuda.manual_seed_all(10)
from torch.autograd import Variable
import header
import init
import sys
import train_parental
import randomSample
import latentSpaceExplore_VanillaHMC,latentSpaceExplore_NUTSHmc
config = sys.argv[1]
training_params,data_classes,network_params,misc_varia... |
# Copyright 2019 IBM 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 to in writing, ... |
# Copyright 2018 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
import logging
from typing import Iterable, Optional
from twitter.common.collections import OrderedSet
from pants.base.build_environment import get_buildroot, get_scm
from pants.base.cmd... |
# -*- coding: utf-8 -*-
import sys
import itertools
import json
import re
from ckan.common import config
from ckan.lib.cli import CkanCommand
import ckan.plugins.toolkit as toolkit
get_action = toolkit.get_action
class Migrate(CkanCommand):
'''Migrate
Usage:
migrate notes_translated
- Populate no... |
from django.contrib import admin
from django.conf import settings
from django.contrib.auth.models import Group
from django.contrib.auth.models import Permission
from django.contrib.sessions.models import Session
from mighty.admin.site import AdminSite
from mighty import fields, models as all_models
from mighty.admin.mo... |
from django.db import models
class TimeModel(models.Model):
"""
An abstract base class model that common attributes
"""
created = models.DateTimeField(auto_now_add=True, blank=True, null=True)
modified = models.DateTimeField(auto_now=True, blank=True, null=True)
class Meta:
app_label ... |
def repeat_to_length(string_to_expand: str, length: int) -> str:
"""
Repeat the string using a length variable
Args:
string_to_expand (`str`): string to repeat
length (`int`): length
Returns:
`str`: generated string
Examples:
>>> rep... |
import folium
map=folium.Map
map=folium.Map(location=[27.10, 93.60])
map.save("maptest.html")
|
"""
fs.filesize
===========
Functions for reporting filesizes
"""
from __future__ import division
from __future__ import unicode_literals
__all__ = ['traditional', 'decimal']
def _to_str(size, suffixes, base):
try:
size = int(size)
except ValueError:
raise ValueError(
"filesiz... |
# Copyright 2019 Microsoft 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 to in wri... |
from selenium.webdriver.common.by import By
class BasePageLocators:
TITLE = By.TAG_NAME, 'h1'
NAV_LINKS = By.CLASS_NAME, 'nav-link'
|
#!/usr/bin/env python3
################################################################################
# Copyright (C) 2016-2020 Abstract Horizon
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Apache License v2.0
# which accompanies this distribution, an... |
#!/usr/bin/env python
__author__ = "Brandon Geise"
__copyright__ = "Copyright 2016, Geisinger Health System"
__license__ = "Apache 2.0"
from flask import Flask, url_for, redirect, request, current_app
from flask_admin import Admin, AdminIndexView, menu, BaseView
from flask_admin.contrib.sqla import ModelView
from Ann... |
import time
from turtle import Screen
from player import Player
from car_manager import CarManager
from scoreboard import Scoreboard
screen = Screen()
def game():
screen.setup(width=600, height=400)
screen.tracer(0)
player = Player()
player.set_up()
scoreboard = Scoreboard()
car_manager = Car... |
# customformatter.py
# Defines a logging formatter to customize the logger's output:
# - sets the format: "time - logger - level - log (file:line)"
# - adds colour to the levels
import logging
class CustomFormatter(logging.Formatter):
"""
Custom logging formatter to colour-code the levels.
"""
# Colours for fo... |
#! coding:utf-8
from django.shortcuts import render, render_to_response, HttpResponse
from django.http import Http404
from django.template import RequestContext
from list.models import *
from evidence.models import MedicineEvidenceSummary
from directory.models import *
def show_medicine(request, id):
# get the medi... |
# -*- coding: utf-8 -*-
"""
Copyright [2009-2018] EMBL-European Bioinformatics Institute
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... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models
class Forum(models.Model):
title = models.CharField(max_length=30)
date_posted = models.DateField(auto_now_add=True, blank=True)
# owner = models.ForeignKey(User, on_delete=models.CASCADE)
class Comment(models.Mo... |
import unittest
import numpy as np
from op_test import OpTest
def conv2dtranspose_forward_naive(input_, filter_, conv2dtranspose_param):
# [2, 3, 5, 5]
in_n, in_c, in_h, in_w = input_.shape
# [3, 6, 3, 3]
f_c, out_c, f_h, f_w = filter_.shape
assert in_c == f_c
stride, pad = conv2dtranspose_pa... |
__author__ = 'Blake'
import os
import json
from synpost.fn.io import generic_collect
from synpost.fn.bootstrapping import load_from_list
from synpost.fn.serialization import TupleEncoder
from synpost.plugins.core import PluginMeta as PluginType
from synpost.objects.theme import DefaultTheme, Theme
from synpost.objec... |
import FWCore.ParameterSet.Config as cms
pfClustersFromHGC3DClusters = cms.EDProducer("PFClusterProducerFromHGC3DClusters",
src = cms.InputTag("hgcalBackEndLayer2Producer","HGCalBackendLayer2Processor3DClustering"),
corrector = cms.string("L1Trigger/Phase2L1ParticleFlow/data/hadcorr_HGCal3D_TC.root"),
corr... |
# coding: utf8
"""Conll format parser"""
from typing import Dict, Tuple, Any, Optional, List, Iterator, Iterable
import regex as re # type: ignore
COMMENT_MARKER = '#'
KEY_VALUE_COMMENT_PATTERN = COMMENT_MARKER + r'\s*([^=]+?)\s*=\s*(.+)'
SINGLETON_COMMENT_PATTERN = COMMENT_MARKER + r'\s*(\S.*?)\s*$'
FIELD_DELIMITE... |
__all__ = ['build_head']
def build_head(config, **kwargs):
# det head
from .det_db_head import DBHead
from .det_east_head import EASTHead
from .det_sast_head import SASTHead
# rec head
from .rec_ctc_head import CTCHead
# from .rec_att_head import AttentionHead
# from .rec_srn_head im... |
from utils.utils import *
from election.src.generator import *
from election.src.attacks import *
res_folder = create_res_forlder('election')
validators = generate_validators()
att_monopole(validators, res_folder)
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.