content stringlengths 5 1.05M |
|---|
from manim import *
import numpy as np
import math
import solarized
import tree_data
from util import Tree
class KutaleciStrom(Scene):
def construct(self):
g = Tree(
tree_data.example_vertices,
tree_data.example_edges,
layout="kamada_kawai",
layout_scale=2,... |
"""
This script will reduce the superset of observations to the set of
quasars (quasar-only catalog). Due to the varied sources for quasar records
in the superset (DR7Q, DR12Q, spAll), a unique identifier does not exist
across catalog sources for quasars. This script uses coordinate matching
with a radius of 0.5 arcse... |
# coding: utf-8
from spyne.application import Application
from spyne.decorator import rpc
from spyne import ServiceBase, String
from spyne.protocol.soap import Soap11
from spyne.server.wsgi import WsgiApplication
from wsgiref.simple_server import make_server
from spyne.model.complex import ComplexModel
import pymssql
... |
import collections
from inspect import getmembers, isroutine
from string import Formatter
from typing import Union
import forge
from requests import exceptions
class Param(object):
"""
Parameter marker.
"""
def __init__(self, type: str=None, default: str=None):
self.type = type
self.... |
import math
class Util:
def encode(self, x):
# calculate how many bytes are needed to represent integer x except 2 number bits
x_size = math.ceil((math.log(x + 1, 2) + 2) / 8)
if x_size != 1:
# setting number bits
mask = (x_size - 1) << 6 + ((x_size - 1) * 8)
... |
# -*- coding: utf-8 -*-
"""
Functions for comparing data
"""
import nibabel as nib
import numpy as np
from neuromaps import transforms
from neuromaps.datasets import ALIAS, DENSITIES
from neuromaps.images import load_gifti, load_nifti
_resampling_docs = dict(
resample_in="""\
src, trg : str or os.PathLike or ni... |
#!/usr/bin/env python
# -*- cpy-indent-level: 4; indent-tabs-mode: nil -*-
# ex: set expandtab softtabstop=4 shiftwidth=4:
#
# Copyright (C) 2015,2016,2017,2018 Contributor
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may o... |
# Copyright (C) 2021 Satoshi Konno. 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 applicable law... |
import json
import numpy as np
import pandas as pd
from src.EEGAnalysis import EEGAnalysis
if __name__ == '__main__':
# read form-result file to get codes and gender of the participants
participant_data = pd.read_csv('../data/form-results/form-results.csv')
participant_data = participant_data[['code', '... |
from __future__ import (
unicode_literals,
absolute_import,
print_function,
division,
)
import avb
import sys
if bytes is not str:
unicode = str
def pretty_value(value):
if isinstance(value, bytearray):
return "bytearray(%d)" % len(value)
# return ''.join(format(x, '02x') f... |
from random import choice as random_choice
from typing import Callable, List
from functools import cmp_to_key
from game_state import Card, PlayerAction, PlayerTurn, GameState, take_action
def greedy(state: GameState) -> PlayerTurn:
def normalized_change_compare(a: PlayerAction, b: PlayerAction) -> bool:
... |
import os
import sys
import numpy as np
from pathlib import Path
from PIL import Image
def delete_data_subdirs(loc) :
directory = Path(loc)
for item in directory.iterdir():
if item.is_dir():
delete_data_subdirs(item)
else:
item.unlink()
def vnorm(im) :
return np.sqr... |
# pyre-ignore-all-errors
# TODO: Change `pyre-ignore-all-errors` to `pyre-strict` on line 1, so we get
# to see all type errors in this file.
# This exercise will be an extension of the test framework exercise we had in
# the callback protocol section. Please go through that exercise first before
# attempting this on... |
import os
import torch
from megatron import get_args, print_rank_0
from megatron.checkpointing import get_checkpoint_tracker_filename, get_checkpoint_name
from megatron.module import MegatronModule
from megatron import mpu, get_tokenizer
from megatron.model.utils import init_method_normal
from megatron.model.language_m... |
"""Unit tests for the OWASP Dependency Check dependencies collector."""
from collector_utilities.functions import sha1_hash
from .base import OWASPDependencyCheckTestCase
class OWASPDependencyCheckDependenciesTest(OWASPDependencyCheckTestCase):
"""Unit tests for the OWASP Dependency Check metrics."""
METRI... |
import os
HOST = '0.0.0.0'
PORT = 8081
|
#!/usr/bin/env python
import struct
import sys
import os
import hashlib
import binascii
from pyasn1_modules import rfc2437,rfc2459
from pyasn1.codec.der import decoder
import rsa
from rsa import common, transform, core
ABOOT_HEADER_LEN = 40
ABOOT_MAGIC = '\x00\x00\x00\x05'
SHA1_HASH_SIZE = 20
SHA256_HASH_SIZE = 3... |
##Author: Ilia Rushkin, VPAL Research, Harvard University, Cambridge, MA, USA
import numpy as np
import pandas as pd
from fakeInitials import initialize_variables
from derivedData import calculate_derived_data
from empiricalEstimation import estimate
class MultiplicativeFormulation(object):
def __init__(self, **... |
import os
import sys
import random
import cv2
import numpy as np
import tensorflow as tf
RESIZE_AXIS_SIZE_MIN = 256.0
RESIZE_AXIS_SIZE_MAX = 384.0
HOLE_SIZE_MIN = 96
HOLE_SIZE_MAX = 128
CROP_SIZE = 256
MEAN_PIXEL_SAMPLES = 1000
class MaskedImageDataset:
""" Class for converting a bunch of images to a image comple... |
# encoding=utf-8
# Copyright 2020 The TensorFlow Datasets Authors and the HuggingFace Datasets 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/... |
import util
import numpy as np
def example_weights():
"""This is an example function that returns weights.
Use this function as a template for optimal_step_weights and optimal_sigmoid_weights.
You do not need to modify this function for this assignment.
"""
w = {}
w['hidden_layer_0_1'] = 0
... |
from flask import request, render_template
from functools import wraps
from .config import config
from lxml import etree
import logging
import requests
import json
logging.basicConfig(level=logging.DEBUG)
def load(app):
config(app)
def insert_tags(page):
if isinstance(page, etree._ElementTree):
... |
import collections
import hashlib
import json
import os
import subprocess
import time
from typing import Dict, Any
import requests
from anyscale.sdk.anyscale_client.sdk import AnyscaleSDK
from ray_release.logger import logger
ANYSCALE_HOST = os.environ.get("ANYSCALE_HOST", "https://console.anyscale.com")
def deep_... |
"""\
Copyright (c) 2009 Paul J. Davis <paul.joseph.davis@gmail.com>
This file is part of hypercouch which is released uner the MIT license.
"""
|
#!/usr/bin/python3
import re
import cronus.beat as beat
import psutil
import requests
from gpiozero import JamHat
from loguru import logger
URL = "http://localhost/admin/api.php"
DISABLE_TIME = 300
def get_web_password():
with open("/etc/pihole/setupVars.conf") as f:
search = re.search(r"WEBPASSWORD=(?... |
import pyupbit # python -m pip install pyupbit
tickers = pyupbit.get_tickers()
print(tickers)
print(len(tickers))
tickers = pyupbit.get_tickers(fiat="KRW")
print(tickers)
tickers = pyupbit.get_tickers(fiat="BTC")
print(len(tickers)) |
DEATH_SAVE = "death save"
UNCON_SAVE = "unconsciousness save"
PERMANENT_WOUND_SAVE = "permanent wound save"
RECOVERY_CHECK = "recovery check"
RECOVERY_TREATMENT = "recovery treatment"
REVIVE_TREATMENT = "revive treatment"
(
NONE,
DEATH,
UNCONSCIOUSNESS,
CAUSE_SERIOUS_WOUND,
CAUSE_PERMANENT_WOUND,
... |
# Generated by Django 2.2.1 on 2019-09-13 22:08
from django.db import migrations, models
import django.db.models.deletion
import smart_selects.db_fields
class Migration(migrations.Migration):
initial = True
dependencies = [
('bible', '0004_auto_20190914_0000'),
]
operations = [
mig... |
'''
输入整数数组 arr ,找出其中最小的 k 个数。例如,输入4、5、1、6、2、7、3、8这8个数字,则最小的4个数字是1、2、3、4。
示例 1:
输入:arr = [3,2,1], k = 2
输出:[1,2] 或者 [2,1]
示例 2:
输入:arr = [0,1,2,1], k = 1
输出:[0]
限制:
0 <= k <= arr.length <= 10000
0 <= arr[i] <= 10000
'''
class Solution:
def getLeastNumbers(self, arr: List[int], k: int) -> List[int]:
... |
# OOP practice / classes
# learn about OOP by emulating the append method
class NewList(DQ): # use DQ for dataquest checking
pass
newlist_1 = NewList()
print(type(newlist_1))
class NewList(DQ):
def first_method():
return "This is my first method"
newlist = NewList()
class NewList(DQ):
def first_... |
# -*- coding: utf-8 -*-
import os
import optparse
import sys
import mamonsu.lib.platform as platform
from mamonsu.lib.parser import MissOptsParser
from mamonsu.lib.config import Config
from mamonsu.plugins.pgsql.driver.checks import is_conn_to_db
from mamonsu import __version__ as mamonsu_version
from mamonsu.lib.def... |
from __future__ import division
import gzip
import cPickle
import theano
import theano.tensor as T
import numpy as np
import pylab as pl
# ------- DEBUG CODE --------
# def softmax(mat):
# exp_vals = np.exp(mat)
# sum_exp = np.sum(exp_vals,axis=1)
# return np.true_divide(exp_vals,sum_exp)
#
# def neq(a,b... |
from django.db import models
# Create your models here.
class DocumentStatement(models.Model):
statement_id = models.AutoField(primary_key=True)
document_type = models.TextField(blank=True, null=True)
statement_type = models.TextField(blank=True, null=True)
includes_heading = models.BooleanField(blank... |
import cv2, glob, os, math, argparse
import numpy as np
from PyQt5.QtWidgets import \
QApplication, QMainWindow, QLabel, QPushButton,\
QHBoxLayout, QVBoxLayout, QGridLayout, QWidget,\
QLineEdit, QSizePolicy, QFileDialog, QDialog,\
QSpacerItem, QGroupBox, QRadioButton
from PyQt5.QtGui import \
... |
class Microstate():
def __init__(self):
self.index = None
self.label = None
self.weight = 0.0
self.probability = 0.0
self.basin = None
self.coordinates = None
self.color = None
self.size = None
|
########################################################
# Copyright (c) 2015-2017 by European Commission. #
# All Rights Reserved. #
########################################################
extends("BaseKPI.py")
"""
Congestion Rent (euro)
-----------------------
Indexed by
* en... |
# MIT License
#
# Copyright (c) 2020 Stɑrry Shivɑm
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIA... |
import pandas as pd
from telethon import TelegramClient
from telethon.tl.types import PeerUser, PeerChannel, PeerChat
from parsers.utils import export_dataframe, detect_language
from parsers.config import config
import logging
log = logging.getLogger(__name__)
async def list_dialogs(client, own_name):
result = [... |
from timeit import default_timer as timer
start = timer()
print("ALL THE NOTES YOU NEED TO LEARN PYTHON")
# File Handling
"""
file Opening Modes : r w a r+ w+ a+ ab wb ab+ wb+
General Methods:
open() used to open the file
with open <file >as <variable>: used to automati... |
_base_ = [
'../../_base_/default_runtime.py',
'../../_base_/recog_datasets/seg_toy_data.py',
'../../_base_/recog_models/seg.py',
'../../_base_/recog_pipelines/seg_pipeline.py',
]
train_list = {{_base_.train_list}}
test_list = {{_base_.test_list}}
train_pipeline = {{_base_.train_pipeline}}
test_pipelin... |
# Generated by Django 2.0.5 on 2018-06-04 20:51
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('servicios', '0001_initial'),
migrations.swappable_dependency(se... |
# 23 - Faça um programa que leia um número de 0 a 9999
# e mostre na tela cada um dos dígitos separados.
num = int(input('Digite um numero: '))
u = num // 1 % 10
d = num // 10 % 10
c = num // 100 % 10
m = num // 1000 % 10
print('Analisando o número {}'.format(num))
print('Milhar: {}, centena: {}, dezena: {}, unidade: ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
from gi.repository import Gtk
from gi.repository import Gdk
from gi.repository import GObject
from objects import HORIZONTAL, VERTICAL
from .__init__ import *
from .notification import Notification
from .stock import EXPAND_PROPERTIES, CONTRACT_P... |
from typing import Optional
import hypothesis.strategies as st
import numpy as np
from hypothesis import assume
from unitair import count_qubits
from unitair.simulation.utils import gate_batch_size
from .tensors import state_vectors, tensors_size_fixed, \
state_vectors_with_metadata, operators
@st.composite
def... |
class Node:
def __init__(self, value):
self.value = value
self.left = None
self.right = None
class BinaryTree:
def __init__(self):
self.root = None
def in_order(self):
results = []
def visit(node):
# visits left node
if node.left:
... |
import os
from PNN import PNN
from Utilities import *
# Train the neural network that is used in the paper
# Training without a GPU should generally be faster for this network
os.environ['CUDA_VISIBLE_DEVICES'] = '-1'
ts1 = TimeScript()
# Define neural network training parameters and training range
rs =... |
#! /usr/bin/env python
# fetch transforms list
# https://pytorch.org/vision/stable/transforms.html
# source
# https://stackoverflow.com/questions/328356/extracting-text-from-html-file-using-python
# from bs4 import BeautifulSoup
# my_HTML = #Some HTML file (could be a website, you can use urllib for that)
# soup = B... |
#!/usr/bin/env python
# encoding: utf-8
name = "Solvent Descriptors"
shortDesc = u""
longDesc = u"""
"""
entry(
index = 1,
label = "water",
molecule = "O",
solvent = SolventData(
s_g = 2.743,
b_g = 4.814,
e_g = 0.822,
l_g = -0.213,
a_g = 3.904,
c_g = -1.... |
import gym
import gym_anytrading
from agents.agent_dqn import *
from models.stock_model_dqn_seq import *
#create environment
env = gym.make("forex-v0")
env.reset()
#create DQN agent
agent = AgentDQN(env, ModelDQNSeq)
#train, uncomment for run training
for iteration in range(1000000):
agent.mai... |
import requests
post_url = 'https://paste.buttscicl.es/api/v1/new'
data = {
'text': 'Hello World!',
'unlisted': True
}
r = requests.post(post_url, data=data)
|
import csv
import pysam
import numpy as np
class Genotype:
"""
Loads, processes and returns the kinship matrix,
parental probabilities at genotyped markers
and genotypes of all variants.
Attributes
----------
N_samples : int
Number of samples used for heritability and as... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# plot.py
"""Basic plotting class objects for DVHA-Stats based on matplotlib"""
#
# Copyright (c) 2020 Dan Cutright
# This file is part of DVHA-Stats, released under a MIT license.
# See the file LICENSE included with this distribution, also
# available at https://g... |
#credit: freecodecamp Youtube Channel
class Question:
def __init__ (self, prompt, answer):
self.prompt = prompt
self.answer = answer
|
import asyncio
import functools
import itertools
import os
import string
import subprocess
import libvirt
import pkg_resources
import yaml
import vanir.api
import vanir.backup
import vanir.config
import vanir.devices
import vanir.firewall
import vanir.storage
import vanir.utils
import vanir.vm
impo... |
import json
from flask import Blueprint, request
from utils.sink import sink_data
data_sink = Blueprint("data-sink", __name__)
@data_sink.route("/", methods=["POST"])
def index():
try:
data = json.loads(request.data)
if not ("key" in data and "message" in data):
raise Exception()
... |
from turtle import *
i = 0
while True:
i += 1
forward(i * 10)
right(144)
if abs(pos()) > 400:
break
exitonclick()
|
import keras
from webdnn.frontend.keras.converter import KerasConverter
from webdnn.graph.operators.embedding import Embedding
from webdnn.graph.order import OrderCN, OrderNT
@KerasConverter.register_handler("Embedding")
def _convert_embedding(converter: KerasConverter, k_op: "keras.layers.Embedding"):
x = conve... |
import argparse
import torch
import torch.nn.init
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
import torchvision.datasets as dset
import torch.backends.cudnn as cudnn
import torchvision.models as models
from tensorboard_logger import configure, log_value
from convNet import *
f... |
class Repeater(object):
def repeat(self, N): print N*"*-*"
|
# -*- coding: utf-8 -*-
import pytest
import os
import datetime
from pypds import RELEASE, IMG
@pytest.fixture
def instrument():
return 'vims'
@pytest.fixture
def release_md5():
return 'covims_0064_md5.txt'
@pytest.fixture
def release_int():
return 64
@pytest.fixture
def release_str():
return 'cov... |
import dragonfly as df
import server, constants
import asyncio
import functools
import inspect
async def focus_component(cmp):
if not cmp['visible']:
raise InvalidMenuOption('Cannot focus non-visible component')
x, y = cmp['center']
await server.set_mouse_position(x, y)
def find_component_conta... |
#!/usr/bin/env python3
for _ in range(int(input())):
input() # don't need n
print(max(map(int, input().split())))
|
'''
Training script for VGG-16.
'''
from tqdm import tqdm
import torch
from torch.optim import Adam, lr_scheduler
from torch.utils.data import DataLoader
import torchvision.transforms as transforms
from image_transforms import RandomRotate, RandomHorizontalFlip, RandomNoise, RandomVerticalFlip, RandomShear, ToTensor
fr... |
# coding=utf-8
from io import StringIO
import logging
import pandas as pd
import pptx_template.text as txt
import pptx_template.pyel as pyel
log = logging.getLogger()
def load_data_into_table(table, model):
# テーブルIDを取得
table_id = get_table_id(table)
if not table_id:
return
log.debug("table_i... |
import os
import matplotlib
import numpy as np
from acme_diags.driver.utils.general import get_output_dir
matplotlib.use("agg")
import matplotlib.pyplot as plt # isort:skip # noqa: E402
def plot(var, regions_to_data, parameter):
# Data is a list based on the len of the regions parameter.
# Each element i... |
import logging
logging.basicConfig(
level=logging.DEBUG,
filename='myexample.log',
format='%(asctime)s %(name)s %(filename)s:%(lineno)d %(levelname)s %(message)s',
)
logger = logging.getLogger(__name__)
logger.debug('Another example')
logger.info('Another info example')
logger.error(... |
#----------------------------------------
# OrthDNNs for Pytorch
#
# Copyright 2018 Yuxin Wen
#----------------------------------------
from __future__ import division
import time
begin = time.time()
import argparse
import os
import math
import numpy as np
import torch
import torch.nn as nn
import torch.nn.parallel
i... |
###################################################################################################################
#
# A P I M O D E L S
#
# THIS IS THE DATABASE MODEL DEFINITION
#
###################################################################################################################
from datetime impor... |
"""
Tests for the entry point of pypy-c, app_main.py.
"""
from __future__ import with_statement
import py
import sys, os, re, runpy, subprocess
from rpython.tool.udir import udir
from contextlib import contextmanager
from pypy import pypydir
from lib_pypy._pypy_interact import irc_header
try:
import __pypy__
excep... |
"""Auto-generate All of Us configuration for Jupyter 'Snippets Menu' extension.
Additionally, create smoke test scripts for both R and Python that include all
the snippets.
See also: https://jupyter-contrib-nbextensions.readthedocs.io/en/latest/nbextensions/snippets_menu/readme.html
"""
import glob
import jinja2
imp... |
#!/usr/bin/env python
# encoding: utf-8
"""
"""
VERSION = "8.9"
INDEX = "./index"
DATABASE = "./gml/gml.sqlite"
CRS_EXCEPTIONS = 'CRS_exceptions.csv'
# ['kind'(in whoosh), 'short kind', 'space for formating', 'explenation of abbr', count', 'link to new query', 'long kind']
facets_list = [
['CRS','CRS','','Coordinate... |
""" Tests for functions and classes in parser_obj.py """
import unittest
import mock
from certbot_nginx._internal.parser_obj import COMMENT_BLOCK
from certbot_nginx._internal.parser_obj import parse_raw
class CommentHelpersTest(unittest.TestCase):
def test_is_comment(self):
from certbot_nginx._internal... |
from os import listdir
cuisine = dict() #{'Asian': ['BeefTeriyakiNoodles',....], .....}
prices = dict() #{'BeefTeriyakiNoodles': (6, 'Asian'), .....}
difficulty = dict() #{'BeefTeriyakiNoodles': (5, 'Asian'), .....}
main = 'Recipes/'
for dirname in listdir(main):
if dirname == 'README.md': continue
cuisine[di... |
import os
import tempfile
from typing import Callable
import numpy as np
import tensorflow as tf
from absl.testing import absltest, parameterized
from psutil import virtual_memory
from tests.test_models import INPUT_SHAPE, TEST_PARAMS
# Assure the machine has enough memory for the conversion. Not enough RAM will kil... |
from google.appengine.ext import ndb
import user
class Play(ndb.Model):
user = ndb.KeyProperty(user.User, required=True)
game = ndb.StringProperty(default='top')
points = ndb.IntegerProperty(default=0)
round = ndb.IntegerProperty(default=1)
answer = ndb.StringProperty(default='hai')
order = ndb... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
import sys
import os
import shutil
import subprocess
from . import translate
def which(program):
"""
Function for checking if an executable exists on a system.
Thanks:
http://stackoverflow.com/questions/377017/test-i... |
import pytest
from collections import deque
from functools import partial
import numpy as np
from scipy import signal
from psiaudio import pipeline
from psiaudio.pipeline import normalize_index
@pytest.fixture
def data1d(fs):
md = {'foo': 'bar'}
data = np.random.uniform(size=100000)
return pipeline.Pip... |
import os
from unittest.mock import patch
from requests import HTTPError
from carball.rattletrap.rattletrap_utils import get_rattletrap_binaries, get_rattletrap_path, download_rattletrap
from carball.rattletrap.run_rattletrap import create_rattletrap_command
from carball.rattletrap.check_rattletrap_version import upd... |
import time
import push
import login
import config
import random
import honkai2
import genshin
import setting
import mihoyobbs
import honkai3rd
from loghelper import log
from error import CookieError
def main():
# 初始化,加载配置
return_data = "\n米游社: "
config.load_config()
if config.config["enable"]:
... |
from dataclasses import dataclass, field
from concurrent.futures import ProcessPoolExecutor
import pandas as pd
import numpy as np
@dataclass
class AdvancedMetricsCreator():
master: pd.core.frame.DataFrame
n_jobs: int = None
def recreate(self):
all_results = []
... |
from flask import Flask, render_template, request
import sys
from .models import db_wrapper
from .views.token import token
from .common import JWT
try:
import config
except ImportError:
print("ERROR: El archivo de configuración no existe!")
sys.exit(1)
app = Flask(__name__)
app.config.from_object('confi... |
class Pilha:
def __init__(self):
self.items = []
def empilhar(self, item):
self.items.append(item)
def desempilhar(self):
if self.isEmpty():
return False
else:
return self.items.pop()
def isEmpty(self):
return (self.items == [])
entrada = ... |
"""
Copyright (c) 2022 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 writin... |
from setuptools import find_packages
from setuptools import setup
setup(
name="vggface",
version="v1.0.0",
description="VGGFace for TFv2",
url="https://github.com/claudiourbina/VGGFace",
author="Claudio Urbina",
author_email="claudiourbina.vc@gmail.com",
license="MIT",
packages=find_pac... |
# -*- coding: utf-8 -*-
# Standard library imports
# Third party imports
from x import bad_import # noqa
# Local application / specific library imports
class Dummy(object):
pass
|
r""" Write Signal Data.
This example writes a signal value for 10 times.
This is used to demonstrate a signal single point output session.
This example uses hardcoded signal names that use the NIXNET_example database.
To use your own database, you need to add an alias to your database file using the NI-XNET
Dat... |
"""Autogenerated 2021-11-16T11:37:36.581971 by redcap_classfiles.py
"""
from ....pgrest import *
from ...constants import Constants
from ..rcconstants import REDCapConstants
from ..rcaptable import RcapTable
__all__ = ["RcapReportableEventdeviationV03"]
class RcapReportableEventdeviationV03(RcapTable):
"""Repo... |
"""Credential / configuration lookup handler."""
import urllib
import json
import boto3
class CredVault(): # pylint: disable=R0902
"""Class to handle configuration lookups."""
def __init__(self, logger):
"""Init the object and base parameters."""
region_lookup = "http://169.254.169.254/latest... |
# 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 math
from dataclasses import dataclass, field
import torch
import torch.nn.functional as F
from fairseq import metrics, utils
from fai... |
import sys
sys.path.append('..')
import numpy as np
from tensorflow.keras.models import *
from tensorflow.keras.layers import *
from tensorflow.keras.optimizers import *
from utils import *
from Network import *
"""
NeuralNet for the game of TicTacToe.
Author: Yamuna Krishnamurthy, github.com/yamsgithub
"""
cla... |
import logging
from django.conf import settings
from django.contrib import messages
from django.contrib.auth.mixins import (
PermissionRequiredMixin as _PermissionRequiredMixin,
)
from django.contrib.contenttypes.models import ContentType
from django.core.exceptions import FieldDoesNotExist, ValidationError
from d... |
# Generated by Django 3.0.3 on 2020-03-18 14:59
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('posthog', '0034_pg_trgm_and_btree_20200318_1447'),
]
operations = [
migrations.RunSQL(
"CREATE INDEX posthog_event_properties_current_url... |
import os
import sys
base = os.path.join(os.path.dirname(os.path.abspath(__file__)), '../')
sys.path.append(base)
import tqdm
import collections
import numpy as np
import torch
import torchvision
from misc.metric import get_num_correct
from misc.logger import Logger
from misc.plot import plot
from spatial_sensitiv... |
from django.views.generic import TemplateView
from books.views import BookListView
class HomeView(TemplateView):
template_name = "home.html"
def dispatch(self, request, *args, **kwargs):
if request.user.is_authenticated():
return BookListView.as_view()(request)
return super(Home... |
import unittest
from app import track_id_specified
from app import TRACK_ID_PARAM
class GetHandlerUnitTests(unittest.TestCase):
def test_track_id_specified_false_when_params_is_none(self):
self.assertFalse(track_id_specified(None))
def test_track_id_specified_false_when_track_id_param_is_none(self):... |
"""
An implementation of Deep Q-network (DQN) for solo_escape_task
DQN is a Model free, off policy, reinforcement learning algorithm (https://deepmind.com/research/dqn/)
Author: LinZHanK (linzhank@gmail.com)
"""
from __future__ import absolute_import, division, print_function
import sys
import os
from datetime import ... |
#!/usr/bin/env python
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
from azurectl.version import __VERSION__
config = {
'name': 'azurectl',
'description': 'Manage Azure PubCloud Service',
'author': 'PubCloud Development team',
'url': 'https://github.co... |
# -*- coding: utf-8 -*-
# Copyright 2015 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""cros chroot: Enter the chroot for the current build environment."""
from __future__ import print_function
import argparse
fr... |
import time
import os
import pathlib
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.support.select import Select
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support.... |
# Generated by Django 3.2.3 on 2021-05-27 13:53
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('user_profile', '0003_order_payment_method'),
]
operations = [
migrations.AlterField(
model_name='profile',
name='pho... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.