text stringlengths 2 999k |
|---|
#! python3
# -*- encoding: utf-8 -*-
'''
Current module: rman.manager
Rough version history:
v1.0 Original version to use
********************************************************************
@AUTHOR: Administrator-Bruce Luo(罗科峰)
MAIL: luokefeng@163.com
RCS: rman.manager, v1.0 2018年11月22日
... |
#!/usr/bin/python3
# this library allows us to generate uuis values.
import uuid
howmany= int(input("How many UUIDs should be generated? "))
print("Generatting UUIDs...")
# range is required because an int cannot be looped
for rando in range(howmany):
print( uuid.uuid4() )
|
import torch
import torch.nn as nn
from torch.nn import CrossEntropyLoss, MSELoss
from transformers.configuration_bert import BertConfig
from transformers.modeling_bert import BertLayerNorm, BertPreTrainedModel, gelu, BertModel
COLUMN_SQL_LABEL_COUNT = 502
SQL_DIFF_LABEL_COUNT = 120
class BertForContext(BertPreTrain... |
"""(c) All rights reserved. ECOLE POLYTECHNIQUE FEDERALE DE LAUSANNE, Switzerland, VPSI, 2017"""
import json
import re
from time import sleep
from django.test import tag
from django.urls import reverse
from rest_framework.test import APITestCase
from api import rancher
from api.redis import flush_all
from api.tests... |
# Mad Libs Generator - Sagar Kargathra 10/07/2020
"""
mad-libs-project.py
Interactive display of a mad lib, which is provided as a Python format string,
with all the cues being dictionary formats, in the form {cue}.
In this version, the cues are extracted from the story automatically,
and the user is prompted for the... |
from kid_readout.interactive import *
import time
import numpy as np
from equipment.custom import mmwave_source
from equipment.hittite import signal_generator
from equipment.srs import lockin
from xystage import stepper
from kid_readout.equipment import hardware
from kid_readout.measurement import mmw_source_sweep, ... |
#!/usr/bin/env python3
import functools
def chinese_reminder_theorem(pairs):
n = functools.reduce(lambda a, b: a * b, [pair[0] for pair in pairs])
x = 0
for pair in pairs:
bi = pair[1]
ni = int(n / pair[0])
num = ni % pair[0]
xi = 1
while (xi * num) % pair[0] != 1:... |
"""
DataFrame
---------
An efficient 2D container for potentially mixed-type time series or other
labeled data series.
Similar to its R counterpart, data.frame, except providing automatic data
alignment and a host of useful data manipulation methods having to do with the
labeling information
"""
from __future__ import... |
# Impacket - Collection of Python classes for working with network protocols.
#
# SECUREAUTH LABS. Copyright (C) 2020 SecureAuth Corporation. All rights reserved.
#
# This software is provided under a slightly modified version
# of the Apache Software License. See the accompanying LICENSE file
# for more information.
#... |
# Faça um programa que leia um ângulo qualquer e
# mostre na tela o valor do seno, cosseno e tangente
# desse ângulo.
import math
angulo = float(input('Digite o ângulo que você deseja: '))
seno = math.sin(math.radians(angulo))
cosseno = math.cos(math.radians(angulo))
tangente = math.tan(math.radians(angulo))
print('O ... |
'''
Creación BBDD a través de peewee
'''
import peewee
db = peewee.SqliteDatabase('aceites.db')
class DB(peewee.Model):
class Meta:
database = db |
from huobi import RequestClient
from datetime import datetime
from huobi.model import *
import talib
import numpy as np
import matplotlib.pyplot as plt
from huobi.model.bararray import BarArray
from huobi.model.tradeinfoarray import TradeInfoArray
from huobi.impl.utils.emailsender import MyEmailContent
request_client ... |
__all__ = ["time_rule", "quant_quest_time_rule", "us_time_rule", "nse_time_rule", "custom_time_rule"]
|
import logging
from logging.handlers import RotatingFileHandler
FALLBACK_FORMAT = '%(asctime)s [%(levelname)s] %(process)d#%(thread)d: %(name)s - %(message)s'
def init_logger(app, logger):
level = getattr(logging, app.config['LOG_LEVEL'].upper())
file_name = app.config['LOG_FILE_NAME']
max_bytes = app.co... |
# 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! ***
# Export this package's modules as members:
from ._enums import *
from .get_guest_configuration_assignment import *
from .get_guest_configuration_hcrpa... |
"""
Define a function that can accept two strings as input and concatenate them and then print it in console.
"""
"""Question:
Define a function that can accept two strings as input and concatenate them and then print it in console.
Hints:
Use + to concatenate the strings
"""
def printValue(s1,s2):
print s1+s2
print... |
##########################################################################
#
# pgAdmin 4 - PostgreSQL Tools
#
# Copyright (C) 2013 - 2020, The pgAdmin Development Team
# This software is released under the PostgreSQL Licence
#
##########################################################################
from __future__ i... |
# -*- coding: utf-8 -*-
import os
import numpy as np
import rstr
from dfa import DFA
def gen_dataset(fname):
with open(os.path.expanduser(fname), 'r') as f:
str_dataset = f.read()
dict_dataset = {}
cur_id = '0'
fl = []
for r in str_dataset.split('\n'):
if r == '':
dic... |
from ctypes import Structure, POINTER, c_char_p, c_int
from .dll import _bind
from .stdinc import Uint8
__all__ = ["SDL_version", "SDL_MAJOR_VERSION", "SDL_MINOR_VERSION",
"SDL_PATCHLEVEL", "SDL_VERSION", "SDL_VERSIONNUM",
"SDL_COMPILEDVERSION", "SDL_VERSION_ATLEAST", "SDL_GetVersion",
... |
# https://packaging.python.org/tutorials/packaging-projects/
import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="example-pkg-YOUR-USERNAME-HERE", # Replace with your own username
version="0.0.1",
author="Example Author",
author_email="author@e... |
from collections import namedtuple
from itertools import count
from glob import glob
from time import time, sleep
from .synthesis import Synthesis
from .utils import Fold
from .kmerSetDB import kmerSetDB
from .kmerSetArray import kmerSetArray
import sys
import numpy
import... |
import time
import numpy as np
import xobjects as xo
from xfields.contexts import add_default_kernels
from pysixtrack.be_beamfields.gaussian_fields import get_Ex_Ey_Gx_Gy_gauss
from pysixtrack.mathlibs import MathlibDefault
ctx = xo.ContextCpu()
ctx = xo.ContextCpu(omp_num_threads=4)
#ctx = xo.ContextCupy()
#ctx = ... |
# -*- coding: utf-8 -*-
"""Module that defines a class through which application configuration settings can be retrieved."""
import typing as t
class Settings:
"""Container to provide configuration settings for the application."""
def __init__(self, prefix: str):
"""Initialize the class.
:pa... |
from DTL.api import BaseDict
#------------------------------------------------------------
#------------------------------------------------------------
class DotifyDict(BaseDict):
#------------------------------------------------------------
def __eq__(self, other):
return dict.__eq__(self, other)
... |
import os
import time
import asyncio
import io
import userbot.plugins.sql_helper.pmpermit_sql as pmpermit_sql
from telethon.tl.functions.users import GetFullUserRequest
from telethon import events, errors, functions, types
from userbot import ALIVE_NAME, CUSTOM_PMPERMIT
from userbot.utils import admin_cmd
PMPERMIT_PIC... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup, find_packages
setup(
name='docutils-ast-writer',
description='AST Writer for docutils',
version='0.1.2',
author='jimo1001',
author_email='jimo1001@gmail.com',
license='MIT',
url='https://github.com/jimo1001/docutil... |
import os
assert os.path.exists("data/data1.txt")
assert os.path.exists("data/subdir/data2.txt")
# Fake trained model!
open("model.json", "w").close()
open("checkpoint.h5", "w").close()
|
# coding: utf-8
"""
Kubernetes
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
OpenAPI spec version: v1.15.7
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import six
class V1NodeDaem... |
from BonusAllocator import BonusAllocator
from IOHmmModel import IOHmmModel
import numpy as np
class QLearningAllocator(BonusAllocator):
def __init__(self, num_workers, discnt=0.99, len_seq=10, base_cost=5, bns=2, t=10, weights=None):
super(QLearningAllocator, self).__init__(num_workers, base_cost, bns, ... |
def validate_schema(schema):
def validate_decorator(func):
def validate_wrapper(*args, **kwargs):
data = schema().load(kwargs)
return func(*args, **data)
return validate_wrapper
return validate_decorator
|
from snowflake.connector.errors import Error
class SnowDDLExecuteError(Exception):
def __init__(self, snow_exc: Error, sql: str):
self.snow_exc = snow_exc
self.sql = sql
def verbose_message(self):
params = {
'message': self.snow_exc.raw_msg,
'errno': self.snow_... |
"""Test the SiteSage Emonitor config flow."""
from unittest.mock import MagicMock, patch
from aioemonitor.monitor import EmonitorNetwork, EmonitorStatus
import aiohttp
from homeassistant import config_entries
from homeassistant.components import dhcp
from homeassistant.components.emonitor.const import DOMAIN
from hom... |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... |
# Copyright (c) 2017, John Skinner
from os import getcwd
import logging
import typing
import subprocess
import re
import bson
from pathlib import Path
from operator import attrgetter
from functools import partial
import arvet.batch_analysis.job_system
from arvet.batch_analysis.task import Task
import arvet.batch_analys... |
## @file
# Create makefile for MS nmake and GNU make
#
# Copyright (c) 2007 - 2020, Intel Corporation. All rights reserved.<BR>
# Copyright (c) 2020, ARM Limited. All rights reserved.<BR>
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
## Import Modules
#
from __future__ import absolute_import
import Commo... |
# -*- coding: utf-8 -*-
# This code is part of Qiskit.
#
# (C) Copyright IBM 2020.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modif... |
from tensorflow.keras.applications.mobilenet_v2 import preprocess_input
from tensorflow.keras.preprocessing.image import img_to_array
from tensorflow.keras.models import load_model
from imutils.video import VideoStream
import cv2
import numpy as np
import imutils
import time
import os
def detect_glasses(frame, faceNe... |
def create_graph(adj_matrix_tmp, dictionary, attribute, val_to_drop,directed_type,delete_na_cols):
##################### data preprocessing(part II) ########################
# create graph from adjacency matrix with gender information, delete nodes without gender information, keep only the largest CC
# input:
# a... |
"""Handle the arguments"""
import argparse
def parse(args):
"""Use argparse to parse provided command-line arguments"""
|
import logging
import sys
from framework.transactions.context import TokuTransaction
from website.app import init_app
from website.models import NodeLog, PreprintService
from scripts import utils as script_utils
from modularodm import Q
from modularodm.exceptions import NoResultsFound
logger = logging.getLogger(__na... |
from __future__ import unicode_literals
from django.contrib.auth.models import User
from django.db import models
from django.utils.translation import ugettext_lazy as _
class Question(models.Model):
author = models.ForeignKey(verbose_name=_('Автор'), to=User)
title = models.CharField(verbose_name=_('Название'... |
# coding: utf-8
from __future__ import unicode_literals, absolute_import
import numpy as np
from .base import FilterTestCase
from os.path import abspath, join, dirname
STORAGE_PATH = abspath(join(dirname(__file__), 'fixtures'))
filter_data = {
'async': False,
'params': ({'regex': '[-]?(?:(?:[\\d]+\\.?[\\d]*)... |
""" This script will test the submodules used by the scattering module"""
import torch
import unittest
import numpy as np
from scatharm.filters_bank import gaussian_3d, solid_harmonic_filters_bank
from scatharm.scattering import SolidHarmonicScattering
from scatharm import utils as sl
gpu_flags = [False]
if torch.cud... |
"""
Prepare the destination folder for backup. Delete the pre existing files there.
"""
import os
import shutil
def readyDst(dst):
if os.path.isfile(dst):
os.remove(dst)
print("%s File deleted" %(os.path.basename(dst)))
elif os.path.isdir(dst):
shutil.rmtree(dst)
print("%s Dire... |
import numpy as np
class Rosenbrock:
def __init__(self, n):
self.n = n
def function_eval(self, x):
assert x.shape[0] == self.n
a = x[1:, :] - x[:-1, :]**2
b = 1 - x[:-1, :]
out = np.sum(100 * a**2 + b**2, axis=0)
return out
|
__author__ = 'patras'
from domain_springDoor import *
from timer import DURATION
from state import state
DURATION.TIME = {
'unlatch1': 5,
'unlatch2': 5,
'holdDoor': 2,
'passDoor': 3,
'releaseDoor': 2,
'closeDoors': 3,
'move': 10,
'take': 2,
'put': 2,
}
DURATION.COUNTER = {
'un... |
#!/usr/bin/env python3
# Copyright (c) 2014-2016 The Bitcoin Core developers
# Copyright (c) 2017 The Bull Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test longpolling with getblocktemplate."""
from test_fra... |
import argparse
import pandas as pd
import datashader as ds
import datashader.transfer_functions as tf
from datashader.utils import export_image
def create_plot(data, out, width):
"""Creates a figure of the ZVV transit network using ZVV's color scheme.
Args:
data: a csv file containing data usable fo... |
"""Stock Context Controller"""
__docformat__ = "numpy"
import argparse
import logging
import os
from datetime import datetime, timedelta
from typing import List
import financedatabase
import yfinance as yf
from prompt_toolkit.completion import NestedCompleter
from openbb_terminal import feature_flags as obbff
from o... |
import sys
from pathlib import Path
import discord.ext.test as dpytest
import pytest
from discord.ext import commands
from dotenv import load_dotenv
def get_extensions():
extensions = []
extensions.append("jishaku")
if sys.platform == "win32" or sys.platform == "cygwin":
dirpath = "\\"
else:
... |
import os
import logging
logger = logging.getLogger(__name__)
logger.setLevel(logging.DEBUG)
import tensorflow as tf
os.environ['KERAS_BACKEND'] = 'tensorflow'
import keras
from packaging import version
assert version.parse(keras.__version__) >= version.parse("2.2.0"), \
"Keras version too old for the autoencod... |
# -*- coding: utf-8 -*-
from __future__ import print_function
import argparse
import os
import stat
import sys
# find the import for catkin's python package - either from source space or from an installed underlay
if os.path.exists(os.path.join('/opt/ros/kinetic/share/catkin/cmake', 'catkinConfig.cmake.in')):
sys.... |
from django.contrib import admin
from django.contrib.auth.admin import GroupAdmin as BaseGroupAdmin
from django.contrib.auth.models import Group
from django.contrib.auth.admin import UserAdmin
from regions.models import StgLocation
from django.contrib.admin.models import LogEntry
from .models import CustomUser, CustomG... |
"""Fred: Train CIFAR10 with PyTorch.
Epoch: 0
[================================================================>] Step: 1s633ms | Tot: 1m49s | Loss: 1.797 | Acc: 33.956% (16978/50000) 391/391
[================================================================>] Step: 71ms | Tot: 9s672ms | Loss: 1.445 | Acc: 45.800% ... |
from pychromecast.controllers import BaseController
class PixelController(BaseController):
def __init__(self):
super(PixelController, self).__init__("urn:x-cast:de.ytvwld.pixelcast")
def receive_message(self, message, data):
print("Received message: {}".format(data))
return True
d... |
import numpy as np
import pymc3 as pm
import theano.tensor as tt
from sampled import sampled
SEED = 1
def test_sampled_one_model():
@sampled
def just_a_normal():
pm.Normal('x', mu=0, sd=1)
kwargs = {
'draws': 50,
'tune': 50,
'init': None
}
np.random.seed(SEED)
... |
import os
import tempfile
import moznetwork
from mozprocess import ProcessHandler
from mozprofile import FirefoxProfile
from mozrunner import FennecEmulatorRunner
from tools.serve.serve import make_hosts_file
from .base import (get_free_port,
cmd_arg,
browser_command)
from ..exe... |
import threading
from contextlib import contextmanager
import os
from os.path import dirname, abspath, join as pjoin
import shutil
from subprocess import check_call, check_output, STDOUT
import sys
from tempfile import mkdtemp
from . import compat
_in_proc_script = pjoin(dirname(abspath(__file__)), '_in_pr... |
# Generated by Django 2.1.1 on 2018-09-30 01:06
import datetime
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = []
operations = [
migrations.CreateModel(
name="Contact",
fields=[
(
... |
import requests
import json
from config import config
from api_client.url_helpers.internal_app_url import get_create_internal_app_from_blob_url, get_edit_assignment_url
from api_client.url_helpers.internal_app_url import get_retire_app_url, get_internal_app_assignment_url
from Logs.log_configuration import configure_l... |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
from .. import _utilities
import typing
# Export this package's modules as members:
from .activity import *
from .get_activity import *... |
# Solution of;
# Project Euler Problem 72: Counting fractions
# https://projecteuler.net/problem=72
#
# Consider the fraction, n/d, where n and d are positive integers. If n<d and
# HCF(n,d)=1, it is called a reduced proper fraction. If we list the set of
# reduced proper fractions for d ≤ 8 in ascending order of si... |
#
# 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... |
# coding=utf-8
# Copyright 2018 The Google AI Language Team 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 ... |
from cone.app import get_root
from cone.app import register_plugin_config
from cone.app import testing
from cone.app.browser.ajax import AjaxAction
from cone.app.browser.form import Form
from cone.app.browser.settings import settings_tab_content
from cone.app.browser.settings import SettingsBehavior
from cone.app.model... |
#!/usr/bin/env python3
# Copyright (c) 2014-2017 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Helpful routines for regression testing."""
from base64 import b64encode
from binascii import hexlify,... |
##Question 16
##Implement insertion sort in python. Don’t use Python’s built in sort or sorted.
##Make classes for a node, with pointers for next
##Assume your inputs will be sufficient for the memory you have.
##Example inputs
##>>> 11,127,56,2,1,5,7,9,11,65,12,24,76,87,123,65,8,32,86,123,67,1,67,92,72,39,49,12
##>>> ... |
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
# vim: set et sw=4 ts=4 sts=4 ff=unix fenc=utf8:
# Author: Binux<i@binux.me>
# http://binux.me
# Created on 2014-10-13 17:08:43
import re
import time
import json
from .sqlitebase import SQLiteMixin, SplitTableMixin
from pyspider.database.base.resultdb import Res... |
from adafruit_circuitplayground.express import cpx
while True:
if cpx.shake():
print("Shake detected!")
cpx.red_led = True
else:
cpx.red_led = False
|
#!/usr/bin/env 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 requir... |
#!/usr/bin/env python
import argparse
import numpy as np
import os, sys, shutil, subprocess, glob
import os.path
from numpy import pi
from scipy import *
def main(options):
problem=options.subshell
uval=float(options.uval)
jval=float(options.jval)
if (problem=='s'):
F0=uval
print(... |
#! /usr/bin/env python
#
# Author: Damian Eads
# Date: April 17, 2008
#
# Copyright (C) 2008 Damian Eads
#
# 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 copy... |
import pandas as pd
import numpy as np
import math
from functools import reduce
from scipy.stats.stats import pearsonr
from matplotlib import pyplot as plt
data_path=r'./SWI closing price.xlsx'
#columns_list=['801040.SWI','801180.SWI','801710.SWI']
data=pd.read_excel(data_path)
columns_list=list(data.head(0)... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import pytest
import sys
import pandas
import numpy as np
import modin.pandas as pd
from modin.pandas.utils import from_pandas, to_pandas
PY2 = False
if sys.version_info.major < 3:
PY2 = True
@pytest.fix... |
#!python
from time import *
port = 49999
class Graph:
def __init__ (self, x, y, width, color):
self.size = 0
self.xLoc = x
self.yLoc = y
self.width = width
self.color = color
self.done = 1
class Title:
def __init__ (self, y, t):
self.loc, self.text = y, t
class myScale:
def __init__ (self, pos, wi... |
# import galry.plot as plt
from galry import *
from galry.plot import PlotWidget
import numpy as np
import numpy.random as rdn
info_level()
widget = PlotWidget()
n = 1000
k = 3
X = np.linspace(-1., 1., n).reshape((1, -1))
X = np.tile(X, (k, 1))
Y = .1 * np.sin(20. * X)
Y += np.arange(k).reshape((-1, 1)) * .1
widge... |
from collections import OrderedDict
from django.test import TestCase
from mongoengine import Document, fields
from rest_framework.compat import unicode_repr
from rest_framework.fields import IntegerField
from rest_framework.serializers import Serializer
from rest_framework_mongoengine.fields import (
ComboReferen... |
from typing import List, Optional, Tuple
import bson
from hermit import shamir_share
from .interface import ShardWordUserInterface
class Shard(object):
"""Represents a single Shamir shard.
"""
@property
def encrypted_mnemonic(self):
"""
The encrypted mnemonic words representing this s... |
import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="dasm",
version="0.0.1",
author="Drazisil",
author_email="me@drazisil.com",
description="A small example package",
long_description=long_description,
long_description_content_type="... |
# -*- coding: utf-8 -*-
def main():
import sys
input = sys.stdin.readline
a, b, k = map(int, input().split())
size = 61
c = [[0 for _ in range(size)] for _ in range(size)]
c[0][0] = 1
# nCrを前計算
for i in range(60):
for j in range(i + 1):
c[i + 1][j] += c[i][j]
... |
#start 7 objectSwarmObserverTkBugs.py
import ObserverSwarmTk
observerSwarmTk = ObserverSwarmTk.ObserverSwarmTk()
# create objects
observerSwarmTk.buildObjects()
# create actions
observerSwarmTk.buildActions()
# run
observerSwarmTk.mainloop()
#finishing
observerSwarmTk.destroy()
|
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
'''
moonphase.py - Calculate Lunar Phase
Author: Sean B. Palmer, inamidst.com
Cf. http://en.wikipedia.org/wiki/Lunar_phase#Lunar_phase_calculation
'''
from comun import _
import math
import decimal
import datetime
dec = decimal.Decimal
class Moon(object):
def __i... |
# -*- coding: utf-8 -*-
from __future__ import annotations
from dataclasses import dataclass
from typing import Tuple
@dataclass
class Size:
"""A height and width in 2-dimensional space.
Attributes
----------
cx : int
The width component of the Size.
cy : int
The height componen... |
"""
WSGI file used for bottle interface.
"""
import sys
import os
from os.path import abspath, dirname
import bottle
import ctools.dbfile
import s3_gateway
import s3_reports
DBREADER_BASH_FILE = os.path.join( os.getenv('HOME'), 'dbreader.bash')
try:
dbreader = ctools.dbfile.DBMySQLAuth.FromEnv( DBREADER_BASH_... |
"""Base code for all OpenAI Gym environments of the Qube.
This base class defines the general behavior and variables of all Qube environments.
Furthermore, this class defines if a simulation or the hardware version of the Qube should be used by initialising the
specific corresponding Qube class at the variable `qube`... |
'''
A custom Keras layer to decode the raw SSD prediction output. Corresponds to the
`DetectionOutput` layer type in the original Caffe implementation of SSD.
Copyright (C) 2018 Pierluigi Ferrari
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the Li... |
import os
import sys
from telethon.sessions import StringSession
from telethon import TelegramClient
from var import Var
os.system("pip install pySmartDL")
os.system("pip install sqlalchemy==1.3.23")
from pylast import LastFMNetwork, md5
from logging import basicConfig, getLogger, INFO, DEBUG
from distutils.util import... |
#!/usr/bin/env python3
import sys
assert sys.version_info >= (3,9), "This script requires at least Python 3.9"
print("Hello, World!")
print("I would like to get to know you.")
n = input("What is your name? ")
if n == "Jason":
print("What do I need to do to get an A?")
elif n == "Bob":
print("I've got a bad feelin... |
#!/usr/bin/env python3
import argparse
import copy
from datetime import datetime
import json
import modulefinder
import os
import shutil
import signal
import subprocess
import sys
import tempfile
import torch
from torch.utils import cpp_extension
from torch.testing._internal.common_utils import TEST_WITH_ROCM, shell,... |
class Node:
def __init__(self, position: (), parent: ()):
self.position = position
self.parent = parent
self.g = 0
self.h = 0
self.f = 0
def __eq__(self, other):
return self.position == other.position
def __lt__(self, other):
return... |
# -*- coding: utf-8 -*-
# Copyright (c) 2013-2014 Simon Jagoe
# All rights reserved.
#
# This software may be modified and distributed under the terms
# of the 3-clause BSD license. See the LICENSE.txt file for details.
from __future__ import absolute_import, unicode_literals
import os
import shutil
import sys
import... |
from vobla.utils import api_spec_exists
from vobla.handlers import BaseHandler
from vobla.utils.mimetypes import get_mimetype_preview
@api_spec_exists
class MimetypePreview(BaseHandler):
async def get(self, mimetype):
"""
---
description: Get mimetype preview image
tags:
... |
# Author: Birnadin Erick
# Copyright © 2021. All rights are reserved by Birnadin Erick.
# This script can be used without any written acknowledgement from author for personal or commercial purpose.
#
|
from sandbox.ours.controllers.base import Controller
class RandomController(Controller):
def __init__(self, env):
self.env = env
super().__init__()
def get_action(self, state):
""" randomly sample an action uniformly from the action space """
return self.env.action_space.sample... |
[ ## this file was manually modified by jt
{
'functor' : {
'arity' : '1',
'call_types' : [],
'ret_arity' : '0',
'rturn' : {
'default' : 'typename boost::result_of<nt2::meta::floating(T)>::type',
},
'simd_types' : ['real_'],
'type_de... |
#!/usr/bin/env python3
#
## Licensed to the .NET Foundation under one or more agreements.
## The .NET Foundation licenses this file to you under the MIT license.
#
##
# Title : superpmi.py
#
# Notes:
#
# Script to orchestrate SuperPMI collections, replays, asm diffs, and SuperPMI
# data management. Note t... |
import logging
import requests
from redash.destinations import *
from redash.utils import json_dumps
class Mattermost(BaseDestination):
@classmethod
def configuration_schema(cls):
return {
"type": "object",
"properties": {
"url": {"type": "string", "title": "Ma... |
"""
Tests for FeaturizedSamples class
"""
import os
import tempfile
import shutil
import deepchem as dc
def test_unlabelled():
current_dir = os.path.dirname(os.path.abspath(__file__))
input_file = os.path.join(current_dir, "../../data/tests/no_labels.csv")
featurizer = dc.feat.CircularFingerprint(size=1024)
... |
from __future__ import absolute_import
import requests
from civis._utils import camel_to_snake
class CivisClientError(Exception):
def __init__(self, message, response):
self.status_code = response.status_code
self.error_message = message
def __str__(self):
return self.error_message
... |
# Copyright 2017 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
import json
import logging
import mock
import s... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.