content stringlengths 5 1.05M |
|---|
#!/usr/bin/env python
"""calls simviz1.py with different m values (in a loop)"""
import sys, os, commands
usage = 'Usage: %s m_min m_max m_increment [ simviz1.py options ]' \
% sys.argv[0]
try:
m_min = float(sys.argv[1])
m_max = float(sys.argv[2])
dm = float(sys.argv[3])
except IndexError:
p... |
SECRET_KEY = 'vsdjhv093rvo32l2mlfk32l2VJsvormkm'
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'lidi_db',
'USER': 'admin_lidi',
'PASSWORD': 'testpwd1',
'HOST': 'localhost',
'PORT': ''
}
}
EMAIL_HOST = ''
EMAIL_HOST_USER = ''
EMAIL_HO... |
# third party
import torch
# syft absolute
from syft.core.common.serde.deserialize import _deserialize
from syft.lib.python import ValuesIndices
def test_torch_valuesindices_serde():
x = torch.Tensor([1, 2, 3])
y = x.cummax(0)
values = y.values
indices = y.indices
ser = y.serialize()
# horri... |
import sys
sys.path.insert(0, ".")
# from trimesh.exchange.obj import load_obj
import trimesh
import cv2
import numpy as np
from nara.camera import Camera
from nara.vis import Plot
from nara.rasterizing import rasterizing
camera = 10
frame = 250
person = "377"
# extri_fpath = f"data/easymocap/extri_{camera}.yml"
#... |
# -*- coding: utf-8 -*-
"""
meraki_sdk
This file was automatically generated for meraki by APIMATIC v2.0 ( https://apimatic.io ).
"""
from meraki_sdk.api_helper import APIHelper
from meraki_sdk.configuration import Configuration
from meraki_sdk.controllers.base_controller import BaseController
fro... |
from webob import status_map as _STATUS
from web.dispatch.resource import Collection as _Collection
from marrow.mongo.query import Ops as _Ops
from ..resource.domain import Domain as _Domain
class Redirections(_Collection):
"""A collection for the management of redirections on a per-domain basis."""
__resource_... |
from flasgger import Swagger
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from flask_redis import FlaskRedis
from flask_migrate import Migrate
from flask_admin import Admin
from .config import config
import sentry_sdk
from sentry_sdk.integrations.flask import FlaskIntegration
if config.SENTRY_DSN... |
'''
Created on 01-06-2013
@author: Damian Rusinek <damian.rusinek@gmail.com>
'''
from aqopa.model import MetricsServiceParam
from aqopa.model.parser.lex_yacc import LexYaccParserExtension
class Builder():
def create_metrics_services_param_reputation(self, token):
"""
metrics_services_param ... |
from pymoo.core.population import Population
def test_has_method():
pop = Population(100)
assert pop.has("X")
assert not pop.has("opt")
pop[:-1].set("opt", False)
assert not pop.has("opt")
pop[-1].set("opt", True)
assert pop.has("opt")
|
import time
import random
import threading
def calculatePrimeFactors(n):
primfac = []
d = 2
while d*d <= n:
while (n % d) == 0:
primfac.append(d)
n //= d
d += 1
if n > 1:
primfac.append(n)
return primfac
def executeProc():
for i in range(1000):
rand = random.randint(20000, 10... |
import time
import datetime
import botbuilder
import modules.botlog as botlog
import modules.command.commandhub as hub
import modules.symphony.datafeed as datafeed
import modules.plugins.commandloader as cmdloader
import modules.symphony.messaging as messaging
import modules.symphony.messagedetail as messageDetail
impo... |
#!/usr/bin/python
import sys
import pyvips
# import logging
# logging.basicConfig(level = logging.DEBUG)
a = pyvips.Image.new_from_file(sys.argv[1])
b = a.write_to_buffer(".jpg")
c = pyvips.Image.new_from_buffer(b, "")
|
import torch
import torch.nn as nn
from ..builder import NECKS
class Linear_block(nn.Module):
def __init__(self, in_c, out_c, kernel=(1, 1), stride=(1, 1), padding=(0, 0), groups=1):
super(Linear_block, self).__init__()
self.conv = nn.Conv2d(in_c, out_channels=out_c, kernel_size=kernel, groups=gro... |
"""
The render job watch panel allows you to
1. setup filters to automatically load jobs. (defaults to loading your jobs)
2. individually add jobs you want to watch.
"""
import os
import logging
from functools import partial
import plow.client
from plow.client import JobState, TaskState
from plow.gui.manifest ... |
import pandas as pd
import api
class DataSet(object):
data = pd.DataFrame()
def __init__(self, dir: str, name: str, data_format: str, sheet_name: str = 'Sheet1'):
self.directory = dir
self.name = name
self.data_format = data_format
self.path = self.directory + self.name + '.' ... |
from locust import HttpUser, TaskSet, LoadTestShape, task
import socketio, math, random, time
def poissonDistSample():
mean = 5
L = math.exp(-mean)
k = 0
p = 1.0
# do while
p *= random.random()
k += 1
while (p > L):
p *= random.random()
k += 1
return k-1
c... |
""" Run MuJoCo Maze experiments.
"""
import os
from typing import Optional
import click
import numpy as np
from torch import optim
import nets
import ppimoc
import our_oc
import rainy
import vis_mjmaze
from rainy.envs import EnvExt, pybullet_parallel
from rainy.net import option_critic as oc
from rainy.net.policy... |
# pylint: disable=duplicate-code
#The GOST cryptographic functions.
#
#Author: Evgeny Drobotun (c) 2020
#License: MIT
"""
General features of the ghostcrypto package.
The module that implements auxiliary functions for the operation of the
gostcrypto module.
"""
# pylint: enable=duplicate-code
def check_value(value... |
from vkwave.bots.utils.keyboards import Keyboard
from bot.platforms.vk.utilities.keyboards import menu_button
from bot.utilities.api.constants import BUILDINGS
from bot.utilities.api.constants import LIBRARIES
from bot.utilities.api.constants import SPORTSCOMPLEX
from bot.utilities.api.constants import DORMS
from bot... |
import copy
import os
from pathlib import Path
import pdb
import shutil
import f90nml
import pytest
import yaml
import payu
from payu.models.fms import Fms
from test.common import tmpdir
verbose = False
def rmtmp():
try:
shutil.rmtree(tmpdir)
except FileNotFoundError:
pass
def mktmp():
... |
from bs4 import BeautifulSoup
import glob
spark_scala_base_url = open('data.url').read().strip()
class Description(object):
def __init__(self, name, annotation, description, source_url):
self.name = name
self.description = '<p>{}</p>'.format(description)
self.annotation = annotation
self.source_url = source_... |
import sys
import argparse
import traceback
import tl.exceptions
from tl.utility.logging import Logger
def parser():
return {
'help': 'Remove duplicate rows of each candidates according to specified column and keep the one with higher score on '
'specified column or keep the one with speci... |
from gene_parser import Genotype, parse_genotype
with open("dane_geny.txt") as f:
lines = [line.strip() for line in f.readlines()]
def czy_odporny(genotyp: Genotype) -> bool:
lewa_czesc_kodujaca = ""
prawa_czesc_kodujaca = ""
for g in genotyp.genes:
lewa_czesc_kodujaca += g
prawy_genoty... |
"""
File to represent catan board as a graph, with nodes as settlements and edges as road positions.
Will need to map nodes to neighbors
Idea is to have classes for nodes and edges, each has values like "is_empty" and "owner", therefore we initialize
board to "empty" nodes to allow easy traversal and contsraint chec... |
def get_lines():
with open("input.txt") as f:
return [line.strip() for line in f.readlines()]
yesList = []
total = 0
for line in get_lines():
if len(line) == 0:
total += len(yesList)
yesList = []
else:
for char in line:
if char not in yesList:
yes... |
#!/usr/bin/env python3
import sys
data = []
with open('input13.txt') as f:
for line in f:
data.append(line.strip())
now = int(data[0])
bus = data[1].split(',')
rts = {int(x): 'D' for x in bus if x != 'x'}
x = sorted(rts.keys())[0]
h, m = 0, x
query = False
while True:
if x == now:
query = ... |
from antarest.study.storage.rawstudy.model.filesystem.config.model import (
FileStudyTreeConfig,
)
from antarest.study.storage.rawstudy.model.filesystem.context import (
ContextServer,
)
from antarest.study.storage.rawstudy.model.filesystem.ini_file_node import (
IniFileNode,
)
class InputThermalClustersA... |
import scitools.std as plt
#import matplotlib.pyplot as plt
import sys
import odespy
import numpy as np
class RHS:
"""m*u'' + b*f(u') + k*u = A_F*cos(w_F*t). Linear/quadratic f."""
def __init__(self, m=1, b=0, k=2*np.pi, A_F=0.01, w_F=1.5,
I=1, V=0, damping='linear'):
self.m, self.b, ... |
import datetime
import functools
import frozendict
import requests
from app import config
# This feature requires an API KEY
# get yours free @ visual-crossing-weather.p.rapidapi.com
SUCCESS_STATUS = 0
ERROR_STATUS = -1
MIN_HISTORICAL_YEAR = 1975
MAX_FUTURE_YEAR = 2050
HISTORY_TYPE = "history"
HISTORICAL_FORECAST_... |
from flask_sqlalchemy import SQLAlchemy
from flask_migrate import Migrate
db = SQLAlchemy()
migrate = Migrate() |
from __future__ import annotations
from urllib.parse import urljoin
from httpx import AsyncClient, Response
from .base import BaseClient
from ..exceptions import (
SessionBodyParameterError,
SessionExistsError,
SessionNotFoundError,
ConnectionBodyParameterError,
ConnectionIPCAMError,
SessionD... |
"""
This module implements a learner, using the specified messenger.
"""
from proposal import Proposal
import threading
import time
import pickle
LEARNER_DEBUG = False
BENCHMARK = False
class Learner():
"""
Implementation of a Paxon learner.
@param messenger: the messenger instance that will be used
... |
#!/usr/bin/env python
# coding: utf-8
"""
File Name: eval_indexer.py
Author: Wan Ji
E-mail: wanji@live.com
Created on: Tue Jul 28 13:31:06 2015 CST
"""
DESCRIPTION = """
Evaluation the performance of HDIdx.
"""
import os
import argparse
import logging
import time
import tempfile
import numpy as np
f... |
# Copyright 2014-2020 Chris Cummins <chrisc.101@gmail.com>.
#
# 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... |
"""
Decorators that helps defining argument types.
"""
from typing import Any, Type, Union
from script_args_parser.arguments import CUSTOM_TYPES_MAPPING
def dataclass_argument(decorated: Type[Any]) -> Type[Any]:
"""
Register decorated dataclass as supported argument type.
:param decorated: dataclass to ... |
from django.db import models
# Create your models here.
class Article(models.Model):
title = models.CharField(max_length=255, null=False) |
import os
import aiohttp
import asyncio
import json
import datetime
import logging
import gidgethub
from gidgethub import aiohttp as gh_aiohttp
from utils.auth import get_jwt, get_installation, get_installation_access_token
logging.basicConfig(
level=logging.INFO,
filename='./logs/regularClose.log',
format... |
from pathlib import Path
from subprocess import run
from shutil import rmtree
from django.core.management.base import BaseCommand, CommandError
class Command(BaseCommand):
help = 'Build the frontend assets using webpack'
def add_arguments(self, parser):
parser.add_argument('--watch', action="store_t... |
# Copyright 2016 The Johns Hopkins University Applied Physics Laboratory
#
# 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 ... |
def main(j, args, params, tags, tasklet):
doc = args.doc
dbdata = j.core.grid.healthchecker.checkDBs()
out = list()
results = list()
for result in dbdata:
results.append(result)
for noderesults in results:
for nid, result in sorted(noderesults.items()):
for category,... |
import numpy as np
import pandas as pd
customers = pd.read_csv('data/olist_customers_dataset.csv')
geolocations = pd.read_csv('data/olist_geolocation_dataset.csv')
items = pd.read_csv('data/olist_order_items_dataset.csv')
payments = pd.read_csv('data/olist_order_payments_dataset.csv')
reviews = pd.read_csv('data/olist... |
from ..client import Client
class TargetingRecommendations(Client):
def get_targets_recommendations(self, params):
self.uri_path = "/sd/targets/recommendations"
self.method = "post"
self.data = params
return self.execute()
|
# -*- coding: utf-8 -*-
import time,hashlib,json,re,os,platform
import datetime as core_datetime
from kcweb import config
from kcweb.utill.dateutil.relativedelta import relativedelta as core_relativedelta
from kcweb.utill.db import mysql as kcwmysql
from kcweb.utill.db import mongodb as kcwmongodb
from kcweb.utill.db i... |
from django.apps import AppConfig
class KingAliyunConfig(AppConfig):
name = 'king_aliyun'
|
# Generated by Django 2.1.7 on 2019-06-09 02:50
import django.contrib.postgres.fields
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('account', '0005_auto_20190609_0248'),
]
operations = [
migrations.RemoveField(
model_name=... |
# -*- coding: utf-8 -*-
# -- prioritized --
from gevent import monkey
monkey.patch_all()
# -- stdlib --
import argparse
import datetime
import logging
import sys
# -- third party --
from raven.handlers.logging import SentryHandler
from raven.transport.gevent import GeventedHTTPTransport
import raven
import yaml
# -... |
# Generated by Django 3.0.5 on 2020-08-25 17:07
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0021_instagram'),
]
operations = [
migrations.AddField(
model_name='tag',
name='filter_search',
... |
#Author-Autodesk Inc.
#Description-Delete empty components from an assembly.
import adsk, adsk.core, adsk.fusion, traceback
def main():
ui = None
try:
app = adsk.core.Application.get()
ui = app.userInterface
# Get all components in the active design.
product = app.acti... |
#!/usr/bin/python
""" Auto-vLAG"""
import shlex
def pn_cli(module):
""" Build the cli command """
username = module.params['pn_cliusername']
password = module.params['pn_clipassword']
cli = '/usr/bin/cli --quiet '
if username and password:
cli += '--user %s:%s ' % (username, password)
... |
# -*- coding: utf-8 -*-
"""
Description :
VGG for ImageNet-1K, implemented in PyTorch.
Original paper: 'Very Deep Convolutional Networks for Large-Scale Image Recognition,'
https://arxiv.org/abs/1409.1556.
Author : xxm
"""
__all__ = ['VGG', 'vgg1... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
smorest_sfs.modules.storages.mixin
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
文件Mixin处理模块
"""
from typing import IO, Optional
from werkzeug.datastructures import FileStorage
from smorest_sfs.extensions import db
from smorest_sfs.utils.storages import load_storage... |
# -*- coding: utf-8 -*-
# Copyright (c) 2010-2017 Tuukka Turto
#
# 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,... |
#!/usr/bin/env python
import xlwt
# Strings passed to (for example) Worksheet.write can be unicode objects,
# or str (8-bit) objects, which are then decoded into unicode.
# The encoding to be used defaults to 'ascii'. This can be overridden
# when the Workbook instance is created:
book = xlwt.Workbook(encoding='cp125... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
"""
from datetime import datetime
import numpy as np
from numpy import ma
from oceansdb.etopo import ETOPO
def test_import():
# A shortcut
from oceansdb import ETOPO
db = ETOPO()
def test_available_vars():
db = ETOPO()
for v in ['elevatio... |
import pydub
import pydub.playback
import datetime
import os.path
import schedule
import time
import logging
import sys
AGITATION_TIME = '19:00'
def get_current_date_label():
return str(datetime.date.today())
def get_play_list():
audio_dir = os.path.join('playlist', get_current_date_label())
if os.pat... |
import os
def ptpython_shell_runner(env, help):
from ptpython.repl import embed, run_config
history = os.path.expanduser('~/.ptpython_history')
print(help)
return embed(locals=env.copy(), history_filename=history, configure=run_config)
def ptipython_shell_runner(env, help):
try:
from ptp... |
from .aetg import AETGGenerator
from .base import BaseGenerator
from .matrix import MatrixGenerator
__all__ = [
'BaseGenerator', 'MatrixGenerator', 'AETGGenerator',
]
|
from flask import abort, flash, render_template
from flask_babel import _
from notifications_python_client.errors import HTTPError
from app import user_api_client
from app.main import main
from app.main.forms import ForgotPasswordForm
@main.route('/forgot-password', methods=['GET', 'POST'])
def forgot_password():
... |
#! /usr/bin/env python
import os
import time
now = time.time()
def search_and_remove_from(search_dir=''):
if not os.path.isdir(search_dir):
print('search_dir %s is not directory' % search_dir)
return
for cur_dir, sub_dirs, filenames in os.walk(search_dir):
for filename in filenames:
... |
import re
import pytest
from spidermon.contrib.monitors.mixins import ValidationMonitorMixin
from spidermon.contrib.scrapy.monitors import BaseScrapyMonitor
from spidermon.data import Data
stats = {
'spidermon/validation/fields': 100,
'spidermon/validation/fields/errors': 20,
'spidermon/validation/field... |
from diofant import (DiracDelta, Function, Heaviside, Rational, cos, exp, pi,
sin, symbols)
from diofant.integrals.deltafunctions import change_mul, deltaintegrate
__all__ = ()
f = Function('f')
x_1, x_2, x, y, z = symbols('x_1 x_2 x y z')
def test_change_mul():
assert change_mul(x, x) == ... |
# Copyright (c) [2012]-[2021] Shanghai Yitu Technology Co., Ltd.
#
# This source code is licensed under the Clear BSD License
# LICENSE file in the root directory of this file
# All rights reserved.
from .t2t_vit import *
from .t2t_vit_se import *
from .t2t_vit_dense import *
from .t2t_vit_ghost import *
|
# Copyright 2020 The DDSP Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... |
from operator import attrgetter
import pyangbind.lib.xpathhelper as xpathhelper
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType, RestrictedClassType, TypedListType
from pyangbind.lib.yangtypes import YANGBool, YANGListType, YANGDynClass, ReferenceType
from pyangbind.lib.base import PybindBase
from d... |
from django.contrib import admin
# Register your models here.
from .models import DeliveryType, Letter
@admin.register(DeliveryType)
class DeliveryTypeAdmin(admin.ModelAdmin):
pass
@admin.register(Letter)
class LetterAdmin(admin.ModelAdmin):
list_display = ['customer', 'date_created']
list_filter = ['cu... |
import hashlib
import base64
import math
def hash_file(file_name, buffer_size=64*1024):
"""
From https://gist.github.com/formido/821003
From https://stackoverflow.com/questions/22058048/hashing-a-file-in-python
"""
hasher = hashlib.sha1()
with open(file_name, 'rb') as f:
while Tru... |
# Generated by Django 2.0.3 on 2018-03-27 07:48
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('app', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='user',
name='id',
field=model... |
#!/usr/bin/env python
"""
###############################
Software Package List Book View
###############################
"""
# -*- coding: utf-8 -*-
#
# rtk.software.ListBook.py is part of the RTK Project
#
# All rights reserved.
# Copyright 2007 - 2017 Andrew Rowland andrew.rowland <AT> reliaqual <DOT> com
#
#... |
"""
B3g4
RepVGG(num_blocks=[4, 6, 16, 1],
width_multiplier=[3, 3, 3, 5], override_groups_map=g4_map)
"""
g4_map = {l: 4 for l in [2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26]}
model = dict(type='ImageClassifier',
backbone=dict(type='RepVGG',
num_classes=100... |
source_suffix = ".txt"
master_doc = "index"
extensions = ["sphinxcontrib.multilatex"]
|
# GENERATED BY KOMAND SDK - DO NOT EDIT
import komand
import json
class Input:
TRANSID = "transid"
class Output:
KML = "kml"
class GetKmlInput(komand.Input):
schema = json.loads("""
{
"type": "object",
"title": "Variables",
"properties": {
"transid": {
"type": "string",
... |
import re
import fnmatch
import tempfile
from pynvim.api.buffer import Buffer
from pynvim.api.window import Window
from collections import OrderedDict
from dataclasses import dataclass
from enum import Enum
from typing import Optional, Iterator, Tuple, Sequence, Any
from functools import partial
from .graph_log import ... |
import tkSimpleDialog
from Tkinter import (Tk, Menu, Frame, Label, Button, PhotoImage, Text, Entry,
Scrollbar, Toplevel, Listbox, RAISED, RIGHT, LEFT, WORD,
Y, END, BOTTOM, TOP, X, SINGLE)
import notetaker.ncore as ncore #note core sql
import timer #Timer
from notetaker.days i... |
"""set database for pytest
"""
import pytest
from django.conf import settings
@pytest.fixture(scope='session')
@pytest.mark.django_db()
def django_db_setup():
"""set db
"""
settings.DATABASES['default'] = {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'ctrl_test_pysat',
'PORT': 33... |
import os, glob, shutil
from myhdl import *
from UK101AddressDecode import UK101AddressDecode
AL = Signal(intbv(0)[16:])
MonitorRom = Signal(bool(0))
ACIA = Signal(bool(0))
KeyBoardPort = Signal(bool(0))
VideoMem = Signal(bool(0))
BasicRom = Signal(bool(0))
Ram = Signal(bool(0))
for conv in (toVHDL, toVerilog):
... |
"""Machinery to step through tasks.
This can be tested without ROS; ros_tasks_runner.py contains a subclass which
integrates with ROS to publish logging and debugging topics.
"""
from __future__ import print_function
import time
class TimedEnd(object):
def __init__(self, seconds):
self.seconds = second... |
from enum import Enum, unique
@unique
class MessageType(Enum):
ItemFill = 0x00
DungeonFill = 0x01
EquipmentFill = 0x02
RequestItem = 0x03
AcquireItem = 0x04
Finish = 0x05
LobbyRequest = 0x10
LobbyEntry = 0x11
Create = 0x12
Destroy = 0x13
Identify = 0x14
Knock = 0x15
... |
import re
from django.db import connection
from django.urls import URLResolver
from .utils import get_domain_model
class TenantPrefixPattern:
converters = {}
@property
def tenant_prefix(self):
DomainModel = get_domain_model()
try:
domain = DomainModel.objects.exclude(folder=... |
from behave import register_type
from .utils import parse_py
import random
from pyethereum import trie
from pyethereum import rlp
register_type(Py=parse_py)
def gen_random_value():
value = range(random.randint(5, 40))
value.extend([0]*20)
random.shuffle(value)
value = ''.join(str(x) for x in value)
... |
"""
Setup Process
- Install if not installed
pip
target module
"""
import os
import sys
import subprocess
import platform
### Check OS ###
os_platform = platform.system()
os_release = platform.release()
os_version = platform.version()
if not (os_platform == "Windows"):
# Non-Windows, probably UNIX, Linux or MacOS... |
"""
Pytest test running.
This module implements the ``test()`` function for NumPy modules. The usual
boiler plate for doing that is to put the following in the module
``__init__.py`` file::
from numpy._pytesttester import PytestTester
test = PytestTester(__name__).test
del PytestTester
Warnings filterin... |
"""Test Project entities."""
from MySQLdb import IntegrityError
import logging
import unittest
from unit_test_helper import ConsistencyTestCase
from model import Checkpoint, Program, Project, ParticipantData
import mysql_connection
class TestSqlModel(ConsistencyTestCase):
"""Test general features of MySQL-backe... |
"""
test_make_section_rdf.py -- given a course section structure,
make RDF for the section and roles that link the section to term,
instructor and course
Version 0.1 MC 2014-08-23
-- Initial version.
"""
__author__ = "Michael Conlon"
__copyright__ = "Copyright 2014, University of Florida"
__licen... |
import argparse
import time
import typing
import pandas as pd
import numpy as np
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
plt.style.use('bmh')
import torch
from torch import nn
import torch.nn.functional as F
import torch.optim as optim
import os
import sys
import datetime
sys.path.... |
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from credentials import email, password, discord_pass
import time
import os
class Automate:
def google_login():
global driver
driver = webdriver.Chrome()
driver.get('https://www.google.com')
sign_in_... |
# pylama:ignore=W0401,W0611
import msgpack
from datetime import datetime
from seraphsix import constants
from seraphsix.models.destiny import *
def encode_data(obj):
if isinstance(obj, datetime):
obj = {
"__datetime__": True,
"as_str": obj.strftime(constants.DESTINY_DATE_FORMAT),... |
from residencies.models import Resident
def is_valid_queryparam(param):
return param != '' and param is not None
def filter_resident(request):
residents = Resident.objects.all()
first_name = request.GET.get('first_name')
last_name = request.GET.get('last_name')
student_ID = request.GET.get('stu... |
#!/usr/bin/env python
# coding: utf-8
# Importing Libraries
import numpy as np
import cv2
import heapq
import math
import sys
class Find_Dist():
# Class to find clearance distance
# load_image() = This will take user input
def load_image(self):
dir =sys.argv[1]
# dir = './human_corrid... |
import sys
import unittest
import os
# Get arguments passed to blender
argv = sys.argv
if "--" not in argv:
argv = [] # as if no args are passed
else:
argv = argv[argv.index("--") + 1:] # get all args after "--"
# Ensure source directory in Blender python path
project_dir = argv[0]
sys.path.append(os.path.... |
from db.connect import session
from db.models import User
def add_user():
user = User(username='admin', password='123344')
session.add(user)
session.commit()
print('添加用户成功!')
def delete_user():
user = session.query(User).filter(User.username == 'admin123')[0]
session.delete(user... |
# -*- coding: utf-8 -*-
"""
Este módulo de Python permite procesar datos de medición de energía eléctrica.
Para esto define la clase :class:`measurement.measurement.Measurement` que
hace uso de otras clases como son
:class:`measurement.record.MeasurementRecord`, para el procesamiento de los
registros, la clase :class... |
"""
test_client
author: Tim "tjtimer" Jedro
created: 24.10.18
"""
from aiohttp import ClientSession
from aio_arango.client import ArangoClient
async def test_client_login():
cl = ArangoClient('root', 'arango-pw')
assert cl.is_authenticated is False
await cl.login()
assert cl.is_authenticated is True... |
import backtrader as bt
import datetime
import pytest
import backtrader_plotting.bokeh.bokeh
from backtrader_plotting import Bokeh, OptBrowser
from strategies.togglestrategy import ToggleStrategy
from asserts.asserts import assert_num_tabs, assert_num_figures
from testcommon import getdatadir
# set to 'show' for deb... |
from m3d.exceptions.m3d_exceptions import M3DIllegalArgumentException
from m3d.hadoop.algorithm.scala_classes import ScalaClasses
from m3d.hadoop.core.hive_table import HiveTable
from m3d.hadoop.load.load_hadoop import LoadHadoop
class AppendLoad(LoadHadoop):
def __init__(self, execution_system, dataset, load_par... |
#! /usr/bin/python3.9
from sensors import Sensor
from mqtt import EdgeCom
from backend import MyDB
import signal, time
PERIOD_SEC = 60 * 5
class ProgramKilled(Exception):
pass
def signal_handler(signum, frame):
raise ProgramKilled
if __name__ == "__main__":
signal.signal(signal.SIGTERM, signal_handler)
... |
n1 = int(input('digite um valor: '))
n2 = int(input('digite um valor: '))
s = n1 + n2
print(f'a soma entre {n1} e {n2} vale {s}') |
from check_defn import *
import numpy as np
def test(file, matrix):
accuracy = 0
counter = 0
test_examples = 0
line = file.readline()
#word list
word_list = []
#query list
query_list = []
#Reads the data from the file
while(line!=''):
(word,query) = line.sp... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Generates an AHK script from a dictionary file, and language file."""
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import datetime
import errno
from functools import singledispatch
import os
import sys
fro... |
# Generated by Django 2.2.13 on 2020-11-02 09:38
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('contacts', '0050_employee_is_active'),
]
operations = [
migrations.AlterField(
model_name='candidate',
name='haad_d... |
# -*- coding: utf-8 -*-
"""
Created on Wed Jul 13 17:57:27 2016
@author: Simon
"""
from Bio import SeqIO
import sys
import os
import azoarcus_seq_tools as sq
from ruffus import *
import argparse
import multiprocessing
parser = argparse.ArgumentParser(description="Extract Azoarcus meta data from sequences")
parser.ad... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.