text stringlengths 2 999k |
|---|
#!/usr/bin/env python
'''
This python file runs a ROS-node of name drone_control which holds the position of e-Drone on the given dummy.
This node publishes and subsribes the following topics:
PUBLICATIONS SUBSCRIPTIONS
/drone_command /whycon/poses
/alt_error /pid_tuning_altitude
/pitch_error /pid_t... |
# -*- coding: utf-8 -*-
"""
file: module_spores_rest_test.py
Unit tests for the REST interface to SporesRunner methods
"""
import os
import unittest
import requests
from mdstudio_smartcyp.spores_run import spores_version_info
from tests.module.unittest_baseclass import UnittestPythonCompatibility
FILEPATH = os.pat... |
nasdaq_tickers = {"AACG":"Ata Creativity Global",
"AAL":"American Airlines Gp",
"AAME":"Atlantic Amer Cp",
"AAOI":"Applied Optoelect",
"AAON":"Aaon Inc",
"AAPL":"Apple Inc",
"AAWW":"Atlas Air Ww",
"AAXJ":"All Country Asia Ex Japan Ishares MSCI ETF",
"AAXN":"Axon Inc",
"ABCB":"Ameris Bancorp",
"ABEO":"Abeona T... |
# coding: utf8
def cache_func(cache_instance, timeout=None):
def dec(func):
def wrapper(*args, **kwargs):
key = '%s:%s|' % (func.__module__, func.__name__) + repr((args, kwargs))
result = cache_instance.get(key)
if result:
return result
else:... |
# coding: utf-8
"""
convertapi
Convert API lets you effortlessly convert file formats and types. # noqa: E501
OpenAPI spec version: v1
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import unittest
import cloudmersive_convert_api_... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""The setup script."""
from setuptools import setup, find_packages
with open('README.rst') as readme_file:
readme = readme_file.read()
with open('./docs/history.rst') as history_file:
history = history_file.read()
requirements = [
'pandas',
'numpy',
... |
from django.db import models
class ShortenedLink(models.Model):
"""Represents a shortened URL used to share routes"""
key = models.CharField(max_length=30, db_index=True) # base-58-encoded UUID
destination = models.CharField(max_length=2048)
create_date = models.DateTimeField(auto_now_add=True)
i... |
import json
print('Start - Creating client-config.json')
# Reading the .env file.
with open('.env', 'r') as f:
content = f.readlines()
# Extracting environment keys.
content = [line.strip().split('=') for line in content if '=' in line]
with open('./public/client-config.json', "w") as file:
file.write(json.... |
import numpy as np
import pandas as pd
from unittest import TestCase
from .IOP_AOPs.QAA_analysis import apply_QAA
class Testgcdistance(TestCase):
def test_apply_QAA(self):
"""
This is a function to evaluate the QAA algorithm
"""
try:
N_samples = 10
Bandas ... |
#my first program in Python
print("Hello world")
|
import sympy as sp
from dataclasses import dataclass
import numpy.typing as npt
from typing import Optional
@dataclass
class Metric:
"""Generic Metric class used to represent Metrics in General Relativity"""
components: npt.ArrayLike
symbols: Optional[sp.symbols] = sp.symbols("t x y z")
def __abs__... |
#!/usr/bin/env python3
import tensorflow as tf
import numpy as np
from svhn_dataset import SVHN
def bbox_area(a):
return tf.maximum(tf.zeros_like(a[...,2]), a[...,2] - a[...,0]) * tf.maximum(tf.zeros_like(a[...,2]), a[...,3] - a[...,1])
def bbox_iou(a, b):
""" Compute IoU for two bboxes a, b.
Each bbox... |
from UQpy.sensitivity.MorrisSensitivity import MorrisSensitivity
from UQpy.sensitivity.PceSensitivity import PceSensitivity
from . import MorrisSensitivity
|
# Used when testing all apps at once
from biostar.settings import *
from biostar.accounts.settings import *
from biostar.emailer.settings import *
from biostar.recipes.settings import *
from biostar.forum.settings import *
INSTALLED_APPS = DEFAULT_APPS + FORUM_APPS + PAGEDOWN_APP + PLANET_APPS + ENGINE_APPS + ACCOUNT... |
from floodsystem.stationdata import build_station_list
from floodsystem.geo import rivers_by_station_number
def run():
stations = build_station_list()
output = rivers_by_station_number(stations, 9)
print(len(output))
print(output)
if __name__ == "__main__":
print("*** Task 1E: CUED Par... |
#!/usr/bin/python
from bs4 import BeautifulSoup
import os
import sys
"""
List all of the files in the current directory and sub-directories.
"""
def list_all_files(inputDir):
allFiles = []
for (dirname, dirnames, filenames) in os.walk(inputDir):
# Put all file names end up with ".xml" in t... |
sym_fs = open("scanned_sym.txt","r")
temp = sym_fs.readline()
switcher= {}
count=1
inp_sym = sym_fs.readline()
while inp_sym!='':
inp_sym = int(inp_sym)
inp_sym = inp_sym+1
switcher[inp_sym]=count
count=count+1
inp_sym = sym_fs.readline()
sym_fs.close()
def sym_trans(i):
return switcher.get(i)
enc_sym_nu = count... |
import asyncio
import datetime
import sqlalchemy as sa
from aiopg.sa import create_engine
metadata = sa.MetaData()
now = datetime.datetime.now
tbl = sa.Table(
'tbl', metadata,
sa.Column('MyIDField', sa.Integer, key='id', primary_key=True),
sa.Column('NaMe', sa.String(255), key='name', default='default n... |
import networkx as nx
import numpy as np
import random
import scipy.sparse as sp
from sklearn.model_selection import StratifiedKFold
"""Adapted from https://github.com/weihua916/powerful-gnns/blob/master/util.py"""
class S2VGraph(object):
def __init__(self, g, label, node_tags=None, node_features=[]):
'''... |
import sys
import pytest
import copy
from sdl2.ext import color
from sdl2.ext.color import Color
from sdl2.ext.compat import *
@pytest.fixture(scope="module")
def test_colors():
# Define some RGB colors for testing
rgb = [
(0, 0, 0), (255, 255, 255),
(255, 0, 0), (0, 255, 0), (0, 0, 255),
... |
"""
Copyright 2020 The OneFlow 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 applicable law or agr... |
# -*- coding: utf-8 -*-
"""Demo59_GradientDescentSigmoid.ipynb
# **Delve Deeper**
We need sound conceptual foundation to be good Machine Learning Artists
## Leggo
"""
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import tensorflow as tf
print(tf.__version__)
def sigmoid(x):
return 1/(1... |
from unittest import mock
from liberapay.billing.payday import create_payday_issue, main, NoPayday, Payday
from liberapay.billing.transactions import create_debt
from liberapay.i18n.currencies import MoneyBasket
from liberapay.models.exchange_route import ExchangeRoute
from liberapay.models.participant import Particip... |
#!/usr/bin/env python3
import argparse
import json
import logging
import os
import sys
import scipy.io.wavfile as siw
import math
import numpy as np
def get_args():
parser = argparse.ArgumentParser(
"""Extract noises from the corpus based on the non-speech regions.
e.g. {} /export/corpora4/CHiME5... |
import tensorflow as tf
import numpy as np
import csv
import cv2
from scipy import ndimage
import os
import sklearn
from sklearn.model_selection import train_test_split
global SOURCE_PATH, EPOCHS
SOURCE_PATH = 'new_data2/'
EPOCHS = 1
def create_model():
print("Creating Model")
# Ask to create a new mode... |
'''
May 2017
@author: Burkhard A. Meier
'''
import wx
from wx import glcanvas
from OpenGL.GL import *
from OpenGL.GLUT import *
|
import ctypes as C
MAGIC = b'\x1F\x8B'
"""bytes: Magic bytes identifying BGZF block"""
MAX_BLOCK_SIZE = 2 ** 16 - 1
"""int: This is the maximum BGZF block size imposed by the domain of the two byte block size subfield value."""
MAX_BLOCK_BUFFER_TYPE = C.c_ubyte * MAX_BLOCK_SIZE
"""C.Array: The ctypes array type inst... |
# Copyright 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/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wr... |
from logging import getLogger
from unittest.mock import patch
import responses
from django import test
from django.utils import timezone
from hexa.catalog.models import Index
from hexa.user_management.models import Membership, Team, User
from ..api import Dhis2Client
from ..models import (
Credentials,
DataE... |
import math
import ipdb
import torch
import random
import numpy as np
import _pickle as pickle
import revtok
import os
from itertools import groupby
import getpass
from collections import Counter
from torch.autograd import Variable
from torchtext import data, datasets
from nltk.translate.gleu_score import sentence_gle... |
import ecdsa
import base64
from hashlib import sha256
def generate_ecdsa_keys():
"""This function takes care of creating your private and public (your address) keys.
It's very important you don't lose any of them or those wallets will be lost
forever. If someone else get access to your private key, you ri... |
from model.Range import Range
class __ConstMeta(type):
def __setattr__(self, name, value):
if name in self.__dict__:
raise TypeError(f'Can\'t rebind const ({name})')
else:
self.__setattr__(name, value)
class Constant(metaclass=__ConstMeta):
CHARACTER_IMAGE_HEIGHT = 10... |
#!/bin/env python
# Python script to convert Xwiki syntax to Wordpress syntax (mostly HTML)
################################################################################
import sys, getopt, re
def usage():
print"""
Usage: """ + sys.argv[0] + """ -i /input/file/path [-o /output/file/path]
-i, --input=
Specifie... |
"""
Django settings for galleria project.
Generated by 'django-admin startproject' using Django 3.1.3.
For more information on this file, see
https://docs.djangoproject.com/en/3.1/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.1/ref/settings/
"""
from pathli... |
# -*- mode: python; coding: utf-8 -*-
# Copyright (c) 2018 Radio Astronomy Software Group
# Licensed under the 2-clause BSD License
"""Tests for common utility functions."""
import os
import copy
import re
import pytest
import numpy as np
from astropy import units
from astropy.time import Time
from astropy.coordinate... |
import pytest
from asynctest import mock as async_mock
from .....connections.models import connection_target
from .....connections.models.diddoc import DIDDoc, PublicKey, PublicKeyType, Service
from .....messaging.base_handler import HandlerException
from .....messaging.request_context import RequestContext
from ........ |
# coding=utf-8
import sys
import subprocess
from subprocess import Popen, PIPE
from time import sleep
import requests
from pytest import fail
def get_with_retries(url):
n = 0
while True:
try:
return requests.get(url)
except requests.ConnectionError:
if n < 20:
... |
"""A custom Sphinx HTML Translator for Bootstrap layout
"""
from distutils.version import LooseVersion
from docutils import nodes
import sphinx
from sphinx.writers.html5 import HTML5Translator
from sphinx.util import logging
from sphinx.ext.autosummary import autosummary_table
logger = logging.getLogger(__name__)
c... |
#!/usr/bin/env python3
# Copyright (c) 2015-2016 The Bitcоin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
import socket
from test_framework.socks5 import Socks5Configuration, Socks5Command, Socks5Server, Addres... |
__author__ = 'Owen'
from regulars import *
class Object:
name = 'Default'
def __init__(self,name):
self.name = name
self.Attributes = {}
self.isAssigned = False
self.AttList = []
def apply_attribute(self,attribute,value):
if not not numbers.search(value).group():
... |
import sys
sys.path.insert(1,"../../../")
import h2o
from tests import pyunit_utils
def pca_scoring():
print "Importing arrests.csv data..."
arrestsH2O = h2o.upload_file(pyunit_utils.locate("smalldata/pca_test/USArrests.csv"))
print "Run PCA with transform = 'DEMEAN'"
fitH2O = h2o.prcomp(x=arrest... |
from django.apps import AppConfig
class SightConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'sight'
verbose_name = '景点模块'
|
import unittest
from opaflib import parser
from ply.lex import LexError
class ParserTest(unittest.TestCase):
def setUp(self):
pass
def tearDown(self):
pass
def testNormalParser(self):
object_tags_tbl = [
('array', '[ 1 (string) <414141> null ]'),
('number', '1')... |
from stencil_kernel import *
import sys
import numpy
import math
width = 50
height = 50
image_in = open('mallard_tiny.raw', 'rb')
stdev_d = 1
stdev_s = 70
radius = 1
class Kernel(object):
def kernel(self, in_img, filter_d, filter_s, out_img):
for x in out_img.interior_points():
for y in in_img.ne... |
# lattices.py - build FCA concepts lattice from context
"""Formal Concept Analysis concept lattices."""
import heapq
import operator
from . import tools
from . import visualize
__all__ = ['Lattice']
class Lattice(object):
"""Formal concept lattice as directed acyclic graph of concepts.
Usage:
>>> fr... |
# Copyright (c) 2012 OpenStack Foundation
# 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 ... |
from datetime import timedelta, datetime
import dateutil.parser
from modules.connections.jira_connection import Jira_Connection
from modules.models.configuration import Configuration
from modules.models.task_entry import Task_Entry
from modules.worklog_core.services.worklog_service import Worklog_Service
from todois... |
# Copyright 2015: Mirantis 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 os
import os.path
from subprocess import call
from jinja2 import Template
from nima.exceptions import NimaException, NotAProjectDirectory
def restart_nginx():
call(["systemctl", "restart", "nginx"])
class Site:
def __init__(self, directory: str, config):
self.config = config
self.dire... |
# Copyright 2020 The SQLFlow 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 applicable law o... |
from coalib.bearlib.abstractions.Linter import linter
from dependency_management.requirements.GemRequirement import GemRequirement
@linter(executable='puppet-lint',
output_format='regex',
output_regex=r'(?P<line>\d+):(?P<column>\d+):'
r'(?P<severity>warning|error):(?P<message>.+)'... |
#!/usr/bin/env python2
# Copyright (c) 2014 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 proper accounting with malleable transactions
#
from test_framework import BitcoinTestFramework
from... |
#!/usr/bin/env python
# *****************************************************************************
# $Id$
#
# Project: GDAL Utilities
# Purpose: Python port of Commandline application to list info about a file.
# Author: Even Rouault, <even dot rouault at mines dash paris dot org>
#
# Port from gdalinfo.c whose ... |
#!/usr/bin/env python3
# Copyright (c) 2013-2017 The Fastbitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# Generate seeds.txt from Pieter's DNS seeder
#
NSEEDS=512
MAX_SEEDS_PER_ASN=2
MIN_BLOCKS = 33760... |
#!/usr/bin/env python
#
# Copyright (c) 2016, The OpenThread Authors.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright
# notic... |
import time
import torch
import torch.nn.functional as F
import torch.nn as nn
from torch.utils.data import TensorDataset, DataLoader
IMG_LEN = 1024
TXT_LEN = 300
N_CLASSES = 50
BATCH_SIZE = 2048
criterion = nn.MSELoss()
def prepare_data_for_torch(X_train, X_val):
x_img_train, x_txt_train = X_train[0], X_train... |
# -*- coding: utf-8 -*-
"""Define base tokenizers."""
import sys
import abc
import yaml
import tensorflow as tf
from opennmt.utils import misc
class Tokenizer(abc.ABC):
"""Base class for tokenizers."""
@property
def in_graph(self):
"""Returns ``True`` if this tokenizer can be run in graph (i.e. uses Te... |
import unittest
import dicombrowser as db
import os
class TestBrowser(unittest.TestCase):
# def __init__(self):
# pass
def setUp(self):
pass
def tearDown(self):
pass
def get_next_test_directory(self):
curdir = os.path.join(os.path.dirname(os.path.abspath(__file__)), '... |
import os
import glob
import gzip
import toml
import cmdy
from diot import Diot
bamfile = {{ in.bamfile | repr }}
snpfile = {{ in.snpfile | repr }}
outdir = {{ out.outdir | repr }}
freec = {{ envs.freec | repr }}
ncores = {{ envs.ncores | repr }}
bedtools = {{ envs.bedtools | repr }}
sambamba = {{ envs.sambamba | repr... |
# (C) Datadog, Inc. 2010-2018
# All rights reserved
# Licensed under Simplified BSD License (see LICENSE)
import pytest
import mock
# 3p
from prometheus_client import generate_latest, CollectorRegistry, Gauge
# project
from datadog_checks.prometheus import PrometheusCheck
instance = {
'prometheus_url': 'http://... |
# (c) 2019, NetApp, Inc
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
''' unit tests for Ansible module: na_ontap_login_messages'''
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import json
import pytest
from ansible.module_util... |
import wave
from threading import Thread
from pyaudio import PyAudio
def play_wav(path):
def target():
chunk = 1024
f = wave.open(path)
p = PyAudio()
stream = p.open(format=p.get_format_from_width(f.getsampwidth()), channels=f.getnchannels(),
rate=f.getfram... |
import _plotly_utils.basevalidators
class FamilysrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(
self, plotly_name="familysrc", parent_name="icicle.outsidetextfont", **kwargs
):
super(FamilysrcValidator, self).__init__(
plotly_name=plotly_name,
par... |
from contextlib import contextmanager
import datetime
from datetime import timedelta
from distutils.version import LooseVersion
from io import BytesIO
import os
import tempfile
from warnings import catch_warnings, simplefilter
import numpy as np
import pytest
from pandas.compat import (
PY35, PY36, is_platform_li... |
import functools
import torch.nn as nn
from models.taming.util_modules import ActNorm
def weights_init(m):
classname = m.__class__.__name__
if classname.find('Conv') != -1:
nn.init.normal_(m.weight.data, 0.0, 0.02)
elif classname.find('BatchNorm') != -1:
nn.init.normal_(m.weight.data, 1.0... |
# -*- coding:utf-8 -*-
"""
MySQL database backend for Django.
Requires mysqlclient: https://pypi.python.org/pypi/mysqlclient/
MySQLdb is supported for Python 2 only: http://sourceforge.net/projects/mysql-python
"""
from __future__ import unicode_literals
import datetime
import re
import sys
import warnings
#
# 如果要切换... |
"""Analysis of gas pipeline «P-01»
"""
#import logging
import numpy as np
from pdover2t.pipe import *
Di = 617.2 * 1.e-3
WT = 24.22 * 1.e-3
Do = pipe_Do(Di, WT)
CSA = pipe_CSA(Do, Di)
# pipe_length = 12.2
# # p.11
# Do = 0.3229
# coating_layers = [
# (0.0003, 1300, "FBE"),
# (0.0003, 900, "adhesive"),
... |
#! /usr/bin/env python2
#
# This file is part of khmer, http://github.com/ged-lab/khmer/, and is
# Copyright (C) Michigan State University, 2009-2014. It is licensed under
# the three-clause BSD license; see doc/LICENSE.txt.
# Contact: khmer-project@idyll.org
# pylint: disable=missing-docstring,invalid-name
"""
Build a... |
import numpy as np
import matplotlib.pyplot as plt
from lstm_vae import create_lstm_vae
def get_data():
# read data from file
data = np.fromfile('sample_data.dat').reshape(419,13)
timesteps = 3
dataX = []
for i in range(len(data) - timesteps - 1):
x = data[i:(i+timesteps), :]
dataX... |
# ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distrib... |
# -*- coding: utf-8 -*-
__author__ = "Daniel1147 (sxn91401@gmail.com)"
__license__ = "Apache 2.0"
# pypi/conda library
import uvicorn
from fastapi import FastAPI, HTTPException, Response, status
# scip plugin
from eureka.model.application_model import ApplicationModel
from eureka.model.applications_model import Appl... |
import numpy as np
from cyDPP.elem_sympoly import elem_sympoly
def sample_k(eigenvals, k):
"""
Sample a given number of eigenvalues according to p(S) \propto prod eigenvals \in S
"""
E = elem_sympoly(eigenvals, k)
i = len(eigenvals)
remaining = k
S = np.zeros((k, ), dtype=int)
while ... |
from flask import Blueprint, request, jsonify, render_template
from apps.home.models import News, Classify
count = Blueprint('count', __name__)
@count.route('/admin/newcount/', methods=['POST', 'GET'])
def news_count():
if request.method == 'GET':
data = {}
title = []
count = []
... |
# 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... |
# authors: Congzhe Cao, email:congzhe@ualberta.ca
# Duanshun Li, email:duanshun@ualberta.ca
# This is the code repo for the paper "Deep-learning based decoding of constrained sequence codes",
# in IEEE Journal on Selected Areas in Communications, https://ieeexplore.ieee.org/document/8792188.
# Credit is also g... |
# birkhoff.py - decompose a doubly stochastic matrix into permutation matrices
#
# Copyright 2015 Jeffrey Finkelstein.
#
# This file is part of Birkhoff.
#
# Birkhoff is free software: you can redistribute it and/or modify it under the
# terms of the GNU General Public License as published by the Free Software
# Founda... |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
__a... |
import spinup
from spinup.user_config import DEFAULT_BACKEND
from spinup.utils.run_utils import ExperimentGrid
from spinup.utils.serialization_utils import convert_json
import argparse
import gym
import json
import os, subprocess, sys
import os.path as osp
import string
import tensorflow as tf
import torch
from copy im... |
from __future__ import unicode_literals
import boto
import boto3
import pytest
import sure # noqa
from boto.exception import EC2ResponseError
from botocore.exceptions import ClientError
from moto import mock_ec2, mock_ec2_deprecated
from moto.ec2 import ec2_backends
from moto.ec2.models import OWNER_ID
from moto.kms... |
#!/usr/bin/env python2.7
# Copyright 2015 gRPC 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 l... |
"""
Django settings for storagetree project.
Generated by 'django-admin startproject' using Django 2.1.3.
For more information on this file, see
https://docs.djangoproject.com/en/2.1/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.1/ref/settings/
"""
import o... |
#######################################################
#
# __chat.py
# Python implementation of the Class __chat
# Generated by Enterprise Architect
# Created on: 11-Feb-2020 11:08:10 AM
# Original author: Corvo
#
#######################################################
from chatgrp import chatgrp
class __chat:... |
import math
from utils.data.collates import NormalizePAD, ResizeNormalize
from PIL import ImageFont, ImageDraw, Image
from pathlib import Path
from utils.utility import initial_logger
logger = initial_logger()
import numpy as np
import cv2
import uuid
class AlignCollate(object):
def __init__(self, img... |
#!/usr/bin/env python3
import asyncio
import concurrent.futures
import datetime
import hashlib
import json
import time
import re
import os
import secrets
import time
import urllib.request
import urllib.error
from decimal import Decimal
from typing import Tuple
import blspy
from chia.types.blockchain_format.coin imp... |
import argparse
import codecs
import hashlib
import os
import random
import time
from string import Template
from twisted.enterprise import adbapi
from twisted.internet import task, reactor
from twisted.internet.protocol import Factory
try:
from OpenSSL import crypto
from OpenSSL.SSL import TLSv1_2_METHOD
... |
# Copyright 2017-2022 TensorHub, 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 to in writ... |
import os
from argparse import Namespace
import numpy as np
import torch
# from pl_examples import LightningTemplateModel
from pytorch_lightning import Trainer
from pytorch_lightning.callbacks import ModelCheckpoint
from pytorch_lightning.loggers import TestTubeLogger, TensorBoardLogger
from tests.base import Lightni... |
import requests
from django.utils.http import urlencode
from config.settings import AUTH_BASE_URL
from users.exceptions import AuthProcessError
class AuthService(object):
AUTH_URL = AUTH_BASE_URL + '/oauth/authorize/'
USER_URL = AUTH_BASE_URL + '/oauth/user/'
ACCESS_TOKEN_URL = AUTH_BASE_URL + '/oauth/ac... |
# Algorithm 2 : Parallel Translation
import torch
import torchvision
from torch import nn
from torch import optim
import torch.nn.functional as F
from torch.autograd import Variable
from torch.utils.data import DataLoader
from torchvision import transforms
from torchvision.utils import save_image
#from torc... |
import os
from setuptools import setup
# We follow Semantic Versioning (https://semver.org/)
_MAJOR_VERSION = "0"
_MINOR_VERSION = "0"
_PATCH_VERSION = "1"
with open(os.path.join(os.path.dirname(__file__), "requirements.txt")) as fp:
install_requires = fp.read().split("\n")
setup(
name="accumulator-batching... |
"""
homeassistant.components.switch.transmission
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Enable or disable Transmission BitTorrent client Turtle Mode.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/switch.transmission/
"""
import logging
from homea... |
import argparse
import logging
from typing import Any, Dict, List, Optional
import annofabapi
import pandas
import annofabcli
from annofabcli import AnnofabApiFacade
from annofabcli.common.cli import AbstractCommandLineInterface, ArgumentParser, build_annofabapi_resource_and_login
from annofabcli.common.enums import ... |
import csv
import json
df = open("bridgeData3.csv",'r').readlines()
fin = open('final.csv','r').readlines()
# Skips the header of the csv
finCsv = fin[1:]
finalCsv = df[1:]
obj = {}
# loop through the csv with images
for i in finalCsv:
x = i.split(',')
obj[x[1]] = {'bridge_name':x[0],'proj_code':x[1],'before_i... |
#!/bin/env python3
import sys
import os
import subprocess
import random
# Redhawk has only 4 cores per node on compute nodes; 2 GPUs per node; one PCI bus
execfile = 'shockbubble'
if sys.argv.__len__() == 1:
print("Usage : ")
print(" run_radial.py <nodes> <ntasks-per-node> <gpus-per-node> <nout>")
pr... |
r"""
CryptoMiniSat Solver
This solver relies on Python bindings provided by upstream cryptominisat.
The ``cryptominisat`` package should be installed on your Sage installation.
AUTHORS:
- Thierry Monteil (2017): complete rewrite, using upstream Python bindings,
works with crypominisat 5.
- Martin Albrecht (2012):... |
import pyoxenmq
import ss
import time
import base64
import json
from nacl.encoding import HexEncoder, Base64Encoder
from nacl.hash import blake2b
from nacl.signing import VerifyKey, SigningKey
from nacl.public import PrivateKey
import nacl.exceptions
def test_session_auth(omq, random_mn, sk, exclude):
"""
Sess... |
"""Tests for `fileviewer` package."""
import pytest
from pkg_resources import parse_version
import fileviewer
def test_valid_version():
"""Check that the package defines a valid ``__version__``."""
v_curr = parse_version(fileviewer.__version__)
v_orig = parse_version("0.1.0-dev")
assert v_curr >= v_... |
#!/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... |
##################### Dependency Inversion Violation ####################
# class TensorFlowEvaluator:
#
# def evaluate(self):
# print("Evaluating with TensorFlow.")
#
#
# class MLPipeline:
#
# def __init__(self):
# self.evaluator = TensorFlowEvaluator()
#
# def evaluate(self):
# sel... |
"""
Contains the command group
used for the Discord Bot.
"""
import datetime
import logging
import discord
from discord.ext import commands
from discord.ext.commands import Context
from .database import guilds as guild_db
log = logging.getLogger(__name__)
class NerodiaDiscordCog:
def __init__(self, bot):
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.