content stringlengths 5 1.05M |
|---|
import sys
sys.path.append('icons')
sys.path.append('data')
sys.path.append('calc')
import matplotlib.pyplot as plt
import numpy as np
from sklearn import metrics
import os
from PIL import Image
import pandas as pd
import htool as ht
import input_processing as inp
import streamlit as st
from datetime import datetime... |
# -*- coding: utf-8 -*-
"""
Created on Mon Apr 19 19:39:26 2021
@author: maurol
"""
import json
import os
class CategoryMapper(object):
"""
map the integer of the categorical variables back to the orginal string
using the saved json file
"""
def __init__(self, path, feature):
self.path_j... |
from tests.support.asserts import assert_error, assert_success, assert_dialog_handled
from tests.support.fixtures import create_dialog
from tests.support.inline import inline
def read_global(session, name):
return session.execute_script("return %s;" % name)
def get_title(session):
return session.transport.s... |
import json
from django.urls import reverse
from django.contrib.auth import get_user_model
from django.test.utils import override_settings
from rest_framework.test import APIClient
from rest_framework import status
from rest_framework.test import APITestCase
from ..models import TemporaryToken
from ..factories impor... |
import yaml
from flask import Blueprint, request, jsonify
from base64 import b64decode, b64encode
import sys
sys.path.append("..")
import pandas as pd
from tasks.tasks import Task
from data.data import Data
from models.model import Model
import argparse
import yaml
import time
from pathlib import Path
import glob
i... |
# -*- codeing = utf-8 -*-
# @Time: 2022/2/2 9:42
# @Author: Coisini
# @File: testXwlt.py
# @Software: PyCharm
import xlwt
workbook = xlwt.Workbook(encoding="utf-8") # 创建workbook对象
worksheet = workbook.add_sheet("sheet1") # 创建工作表
worksheet.write(0, 0, "hello") # 写入数据,第一个参数是"行", 第二个参数是"列", 第三个参数内容
workbook.save("st... |
class DatasetSetup:
def __init__(self):
self.num_classes = None
self.size_bottom_out = None
def set_datasets_for_ssl(self, file_path, n_labeled, party_num):
pass
def get_transforms(self):
pass
def get_normalize_transform(self):
pass
def get_t... |
import struct
from network.bytebuffer import ByteBuffer
from network.bytebuffer import TypeSize
class CommandType(object):
MOVE = 0x00
PLAYER_LIST = 0x01
NEW_PLAYER = 0x02
LEAVE = 0x03
LOGIN_REQUEST = 0x04
LOGIN_RESULT = 0x05
JOIN = 0x06
INIT_PLAYER_INFO = 0x07
PLAYER_LIST_RESULT =... |
# Author: Jian Shi
import unittest
import numpy as np
from PySeismoSoil.class_ground_motion import Ground_Motion
from PySeismoSoil.class_Vs_profile import Vs_Profile
from PySeismoSoil.class_simulation_results import Simulation_Results
import PySeismoSoil.helper_site_response as sr
import os
from os.path import join... |
from django.apps import AppConfig
class HomefirstaidkitAppConfig(AppConfig):
name = 'HomeFirstAidKit_app'
|
''' figures.py
=========================
AIM: Provide several specific functions to save beautiful figures
INPUT: function depend
OUTPUT: function depend
CMD: To include: import resources.figures as figures
ISSUES: <none known>
REQUIRES: standard python libraries, specific libraries in resources/
REMARKS: in gene... |
from aces import Aces
class sub(Aces):
def submit(self):
opt=dict(
units="metal",
species="graphene",
method="greenkubo",
nodes=1,
procs=12,
queue="q1.1",
runTime=500000
,runner="negf"
)
app=dict(kpoints=[1,1,1],laty=2,latx=3,leadlat=[1,1,1],gamma_only=False,useMini=True,boxO... |
from picloud_client.picloud import SocketClient, HttpClient, PublishError
|
from PIL import Image
from os.path import getsize
from tkinter.filedialog import askopenfilename, asksaveasfilename
def compress():
file_path = askopenfilename(title="select image ")
img = Image.open(file_path)
print(f"Original size of image was : {getsize(file_path)} Bytes")
height, width = img.siz... |
tables = {
"BalanceSheet": "balance_sheets",
"Client": "clients",
"CollectiveRoomOccasionalPricing": "pricings_collective_occasional",
"CollectiveRoomRegularPricing": "pricings_collective_regular",
"Contract": "contracts",
"DailyBooking": "daily_bookings",
"Expense": "expenses",
"FlatRat... |
#!/usr/bin/env python3
"""
Author : alex <alex@localhost>
Date : 2021-01-31
Purpose: Rock the Casbah
"""
import argparse
import re
import string
import os
# --------------------------------------------------
def get_args():
"""Get command-line arguments"""
parser = argparse.ArgumentParser(
descrip... |
# Copyright 2006 Joe Wreschnig
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
import sys
if sys.version_info[0] != 2:
raise ImportError("No longer available with Python 3, use... |
from __future__ import print_function
import PyKDL as kdl
import urdf_parser_py.urdf as urdf
def treeFromFile(filename):
"""
Construct a PyKDL.Tree from an URDF file.
:param filename: URDF file path
"""
with open(filename) as urdfFile:
return treeFromUrdfModel(urdf.URDF.from_xml_string(urd... |
import time
from mlflow.entities import Metric
from tests.helper_functions import random_str, random_int
def _check(metric, key, value, timestamp, step):
assert type(metric) == Metric
assert metric.key == key
assert metric.value == value
assert metric.timestamp == timestamp
assert metric.step == ... |
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('prison', '0017_prison_private_estate'),
]
operations = [
migrations.CreateModel(
name='RemittanceEmail',
fields=[
('id... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from datetime import datetime
import os
import random
import sys
import threading
import numpy as np
import tensorflow as tf
tf.app.flags.DEFINE_integer('train_shards', 12,
'Number... |
"""Unit test for Sensor and ExposeSensor objects."""
import asyncio
import unittest
from xknx import XKNX
from xknx.devices import BinarySensor, ExposeSensor, Sensor
from xknx.dpt import DPTArray, DPTBinary
from xknx.telegram import GroupAddress, Telegram, TelegramDirection, TelegramType
class SensorExposeLoopTest(u... |
MAX_STEPS = 100 # set to None to allow infinite loops
adder = dict(a = 'jeqz 0 d b',
b = 'dec 0 c',
c = 'inc 2 a',
d = 'jeqz 1 g e',
e = 'dec 1 f',
f = 'inc 2 d',
g = 'halt')
adder['start'] = adder['a']
subtractor = dict(a = 'jeqz 1 e b',
... |
from .callbacks import create_models_with_nvtx_range # noqa: F401
from .models import * # noqa: F401, F403
|
from .tools import async_callback, singleton
from .mid_decorator import response_handle, auth_params, authenticator
|
import numpy as np
import pandas as pd
import collections
import os
import scipy.ndimage as ndimage
from scipy.ndimage import binary_dilation, filters
BBOX_LIST_FNAME = 'BBox_List_2017.csv'
VALID_FNAME = 'valid.txt'
CROP_DEL, RESCALE_FACTOR = 16., 4.
# class-id mapping
class_list = ['Atelectasis', 'Cardiomegaly', '... |
"""
Contains possible interactions with the Apollo Canned Values Module
"""
from apollo.client import Client
class CannedValuesClient(Client):
CLIENT_BASE = '/cannedValue/'
def add_value(self, value, metadata=""):
"""
Add a canned value
:type value: str
:param value: New cann... |
# =============================================================================== #
# #
# This file has been generated automatically!! Do not change this manually! #
# ... |
# Generated by Django 2.1.4 on 2019-07-10 22:35
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('api', '0008_auto_20190709_1613'),
]
operations = [
migrations.AlterField(
model_name='model_user',
name='can_edit',
... |
#!/usr/bin/env python
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from future import standard_library
standard_library.install_aliases()
from builtins import *
import logging
import os
import pkgutil
import sys
im... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import re
from ..base.captcha_service import CaptchaService
class CoinHive(CaptchaService):
__name__ = "CoinHive"
__type__ = "anticaptcha"
__version__ = "0.01"
__status__ = "testing"
__pyload_version__ = "0.5"
__description__ = "CoinHive captcha... |
from .aiohttp_telemetry_middleware import bot_telemetry_middleware
from .aiohttp_telemetry_processor import AiohttpTelemetryProcessor
__all__ = [
"bot_telemetry_middleware",
"AiohttpTelemetryProcessor",
]
|
import pypurl.purlutils as utils
class Purl:
""" Provides essential functionality to decompose any purl into components
or build a purl from passed parameters.
"""
def __init__(self):
self.type = ''
def purl_to_dict(self, purl):
return utils.parse_purl(purl, {})
def durl_to_... |
from django.test import TestCase, Client
from posts.models import User
class TestUser(TestCase):
def setUp(self):
self.client = Client()
self.user = User.objects.create_user(
username="test_user",
email="test_user@yatube.com",
password="test"
)
def ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# import necessary Python Packages
import torch
from torch import nn
device = torch.device("cpu")
def log_sum_exp(vec):
"""
log(sum(exp(x))) Function
"""
max_score = torch.max(vec, 0)[0].unsqueeze(0)
max_score_broadcast = max_score.expand(vec.size(1)... |
import numpy
with open('../data/advent_of_code_input_day_six.txt', mode='r') as input_file:
day6_data= input_file.read().split('\n\n')
running_count = 0
all_yes_count = 0
whole_group = 0
for index, line in enumerate(day6_data):
subset = day6_data[index].split()
day6_data[index] = day6_data[... |
from .reader import load_pretrained_model, load_dataset, _parse_url, _parse_config, _get_model_configs
from .installer import install_package, package_from_config
from .wrapper import PretrainedModel |
from django.contrib import admin
from . import models
admin.site.register(models.Author)
admin.site.register(models.FollowReq)
admin.site.register(models.Follower)
admin.site.register(models.Post)
admin.site.register(models.Comment)
admin.site.register(models.Like)
admin.site.register(models.Inbox)
admin.site.register... |
#!/usr/bin/env python
# encoding: utf-8
import unittest
from .test import TestCase
from . import SDK
class TestSDK(TestCase):
def test_instance(self):
sdk = SDK('whatever', 'whatever', 'mock://whatever')
self.assertEqual(sdk.platform().create_url('/foo', add_server=True), 'mock://whatever/restapi... |
specification_map = {
# RDF and OSLC attributes
'Specification_id': {'attribute': '_BaseResource__identifier', 'oslc_property': 'DCTERMS.identifier'},
'Title': {'attribute': '_BaseResource__title', 'oslc_property': 'DCTERMS.title'},
'Description': {'attribute': '_BaseResource__description', 'oslc_prope... |
# -*- coding:utf-8 -*-
# @project: PowerBert
# @filename: task_data_set
# @author: 刘聪NLP
# @zhihu: https://www.zhihu.com/people/LiuCongNLP
# @contact: logcongcong@gmail.com
# @time: 2021/9/5 10:02
"""
文件说明:
"""
import torch
import json
import os
from tqdm import tqdm
from torch.utils.data import Datase... |
import csv
import sys
import logging
import datetime
from collections import OrderedDict
_MINROWNUMBER = 50
def _get_subnetaddresses(config_parser, section, conntype, logger):
if conntype == "wifi":
client_subnetaddr = config_parser.get(section, "client_subnetaddr_wifi")
edgeserver_subnetaddr = c... |
from icemac.addressbook.i18n import _
from icemac.addressbook.interfaces import MIN_SUPPORTED_DATE
import z3c.layer.pagelet
import zope.interface
import zope.schema
class ICalendarLayer(z3c.layer.pagelet.IPageletBrowserLayer):
"""Calendar browser layer."""
class IDatetime(zope.interface.Interface):
"""Objec... |
import os
import logging
from logging.handlers import RotatingFileHandler
from pyftpdlib.authorizers import DummyAuthorizer
from pyftpdlib.handlers import FTPHandler
from pyftpdlib.servers import FTPServer
HOME_DIR = "/data"
BIND_ADDRESS = "0.0.0.0"
LISTEN_PORT = 21
PASSIVE_PORTS = list(range(21100, 21111))
LOG_PATH =... |
from rubika_bot.requests import send_message
from rubika_bot.models import Keypad, KeypadRow, Button
b1 = Button(id='100', type='Simple', button_text='Add Account')
b2 = Button(id='101', type='Simple', button_text='Edit Account')
b3 = Button(id='102', type='Simple', button_text='Remove Account')
keypad = Keypad(
r... |
# Generated by Django 3.1.1 on 2020-10-23 22:42
from django.conf import settings
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('gallery', '0003_auto_20201023_1930'),
]
operations = [
... |
"""Utility definitions."""
def load_yaml(path: str) -> dict:
import yaml
with open(path, mode='r') as f:
configuration = yaml.safe_load(f)
return configuration
def load_json(path: str) -> dict:
import ujson as json
with open(path, mode='r') as f:
configuration = json.load(f)
... |
# Generated by Django 2.1.5 on 2019-03-21 17:01
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('Users', '0005_auto_20190321_1145'),
]
operations = [
migrations.AlterField(
model_name='stock',
name='Ticker',
... |
from django.contrib import admin
from django.utils.html import format_html
from django.urls import reverse
from rangefilter.filter import DateRangeFilter
from apps.shipments.models import Shipment, Location, TransitState
from apps.jobs.models import AsyncJob
from .filter import StateFilter
from .historical import Bas... |
import sys
import os
import boto3
import click
import json
import datetime
import time
import traceback
from util import *
from tabulate import tabulate
from botocore.exceptions import ClientError
from botocore.exceptions import NoCredentialsError
|
import sys
sys.path.append("../code")
from global_vars import DATA_DIR
import os
import logging
from data.dataset import dump
from data.ace_preprocess import load_ace05, load_ace04
logging.basicConfig(filename='ann2json.log', level=logging.INFO)
if os.path.exists("ace2005/corpus") and not os.path.exists(DATA_DIR +... |
import subprocess
filename = 'testcases'
with open(filename,'r') as f:
lines = f.readlines()
for line in [line.strip() for line in lines]:
if(line.startswith('#')):
continue
if(len(line) == 0):
continue
print()
print('~Test case~')
print(line)
... |
import os
from twilio.rest import Client
# Auth credentials
# To set up environmental variables, see http://twil.io/secure
account_sid = os.environ['TWILIO_ACCOUNT_SID']
auth_token = os.environ['TWILIO_AUTH_TOKEN']
# Use Lookup API to get country code / MCC / MNC that corresponds
# to given phone number
phone_number ... |
#! /usr/bin/python
import hmac
import os.path, sys, time, mimetypes, xmlrpclib, pprint, base64
import urllib
from urllib import unquote, splittype, splithost
from config import config
pp = pprint.PrettyPrinter()
class UrllibTransport(xmlrpclib.Transport):
def set_proxy(self, proxy):
self.proxyurl = prox... |
class DBSession:
def close(self):
pass
class MySuperContextManager:
def __init__(self):
self.db = DBSession()
def __enter__(self):
return self.db
def __exit__(self, exc_type, exc_value, traceback):
self.db.close()
async def get_db():
with MySuperContextManager()... |
"""Add address fields to user
Revision ID: 4d1a5fb71db
Revises: bef47d0853
Create Date: 2015-10-10 16:56:57.670618
"""
# revision identifiers, used by Alembic.
revision = '4d1a5fb71db'
down_revision = 'bef47d0853'
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql
def upgrade():
... |
#!/usr/bin/env python2
from __future__ import absolute_import
from __future__ import division
import argparse
import string
import sys
import pwnlib
pwnlib.args.free_form = False
from pwn import *
from pwnlib.commandline import common
parser = common.parser_commands.add_parser(
'cyclic',
help = "Cyclic patt... |
"""Integration for Mattermost"""
from __future__ import unicode_literals
from django.utils.functional import cached_property
from rbintegrations.basechat.forms import BaseChatIntegrationConfigForm
from rbintegrations.basechat.integration import BaseChatIntegration
from rbintegrations.slack.integration import format_l... |
from __future__ import print_function
import torch
import torch.nn as nn
import torch.nn.functional as F
from math import *
import numpy as np
import copy
class CombinatorialClassifier(nn.Module):
partition_weight = None
def __init__(self, num_classes, num_partitionings, num_partitions, featu... |
""" @package forcebalance.amberio AMBER force field input/output.
This serves as a good template for writing future force matching I/O
modules for other programs because it's so simple.
@author Lee-Ping Wang
@date 01/2012
"""
from __future__ import division
from __future__ import print_function
from builtins import ... |
#!/usr/bin/env python
"""
Cleans up relative cross-notebook links by replacing them with .html
extension.
"""
import os
import re
from bs4 import BeautifulSoup
import warnings
# TODO: holoviews specific links e.g. to reference manual...doc & generalize
#BOKEH_REPLACEMENTS = {'cell.output_area.append_execute_result':... |
#!/usr/bin/env python
from __future__ import unicode_literals
import sys
import glob
import os
import time
import logging
from datetime import datetime
from slackclient import SlackClient
sys.dont_write_bytecode = True
class RtmBot(object):
def __init__(self, config):
'''
Params:
... |
import asyncio
from datetime import datetime, timedelta, timezone
from typing import Sequence
import structlog
from job_scheduler.api.models import Schedule
from job_scheduler.broker import RabbitMQBroker, ScheduleBroker
from job_scheduler.cache import RedisScheduleCache, ScheduleCache
from job_scheduler.config impor... |
from client import Client
from server import Server
from log.logger import Logger
import os
import sys
import argparse
import logging
class Peer:
"""
The Peer class starts a server-thread and n client-threads
where each client is subscribed to the server of another peer.
Each peer consists of one ser... |
from pyqtgraph.Qt import QtGui, QtCore
import numpy as np
import h5py
import pyqtgraph as pg
# create some HDF5 data in a 2-d array of X,Y pairs
with h5py.File('plot_2d_data.h5','w') as h5f:
data = h5f.create_dataset('data',shape=(100,2))
data[:,0] = np.arange(0.0,10.0,0.1) ## X data points
data[:,1] = np.... |
from datetime import datetime
from unittest import TestCase
import httpretty as httpretty
from attendance.Api import Api
from config import Config
class TestApi(TestCase):
@httpretty.activate
def test_get_employee_list_by_department_bad_response(self):
httpretty.register_uri(httpretty.POST, Config.... |
import py.test
from descent.parser import parse_grammar
from descent.ast import *
def single_rule_grammar(name, body):
return grammar([rule(name=reference(name), expr=body)])
parse_cases = [
("A <- 'a'", single_rule_grammar("A", string("a"))),
("A <- \"a\"", single_rule_grammar("A", string("a"))),
... |
#!/usr/bin/env python3
"""
juicylang - Juicy programming language written in Python using PLY
Author : Hamidreza Mahdavipanah
Version: 1.0.0
Repository: http://github.com/mahdavipanah/juicylang
License : MIT License
"""
from sys import exit, argv, stdin
from colorama import init as colorama_init, Fore
from src.juicyyac... |
from typing import Tuple
from hypothesis import given
from gon.base import Point
from tests.utils import implication
from . import strategies
@given(strategies.points)
def test_reflexivity(point: Point) -> None:
assert point == point
@given(strategies.points_pairs)
def test_symmetry(points_pair: Tuple[Point, ... |
"""Library metadata."""
MAJOR = 0
MINOR = 0
MICRO = 0
__author__ = "Kieran Ryan"
__copyright__ = f"Copyright 2021 {__author__}"
__description = "A sample Python library."
__license__ = "MIT"
__title__ = "pysamplelib"
__url__ = "https://github.com/kieran-ryan/python-library-template"
__version__ = f"{MAJOR}.{MINOR}.{M... |
import sublime
import sublime_plugin
from .lib.comment_settings import CommentSettings
from .lib.view_verifier import ViewVerifier
class MagicCommentInsertCommand(sublime_plugin.TextCommand):
def run(self, edit):
settings = sublime.load_settings("MagicComment.sublime-settings")
for raw_comment_se... |
import os
import sys
import logging
from _atiiaftt import ffi,lib
class FTUnit:
"""
Convenience class holding accepted units for the atiia functions.
Constants declared from 'ftconfig.c'.
"""
FORCE_LB=ffi.new("char[]","lb".encode("ascii"))
"""lb\\0"""
FORCE_KLB=ffi.new("char[]","klb".... |
#!/usr/local/bin/python
import sys, os, getopt, signal, time, re, sqlite3
import distutils.core
import xml.etree.cElementTree as ET
from bs4 import BeautifulSoup, NavigableString, Tag
# The categories that can be found in the ClassHierarchy/index.html file.
maincategories = {
"Class": [
re.compile("^.*class .+$",... |
# -*- coding: utf-8 -*-
#/*
# * Copyright (c) 2022 Renwei
# *
# * This is a free software; you can redistribute it and/or modify
# * it under the terms of the MIT license. See LICENSE for details.
# */
class t_print_progress_bar():
self_percentage = 0
self_total_process = 0
self_current_process = 0
de... |
if __name__ == "__main__":
'''
This if statement is needed for testing, to locate the modules needed
if we are running the file directly.
'''
import sys
from os import path
sys.path.append(path.dirname(path.dirname(path.abspath(__file__))))
from dalek import settings
from dalek impor... |
import io
import segno
def qrcode_data(text, imgtype="svg"):
qr = segno.make(text, error='Q')
buff = io.BytesIO()
qr.save(buff, scale=4, kind=imgtype)
return buff.getvalue()
|
from os import environ
from django.conf.urls import include, url
from django.views import generic
from rest_framework.documentation import include_docs_urls
urlpatterns = [
url(r'^$', generic.RedirectView.as_view(
url='/api/', permanent=False)),
url(r'^api/food/', include('rest_framework_discovery.url... |
"""
Flag and collect methods in your classes
"""
def factory(flag='_flagged', collection='_flagged'):
"""
Factory for creating class-decorator pair for method flagging and collection
Parameters
----------
flag:
name of attribute that ids decorated methods
collection:
name of a... |
# -*- coding: utf-8 -*-
"""
Created on Fri Dec 27 13:55:21 2019
@author: u0118077
"""
from psychopy import visual, event, core, monitors
from psychopy.hardware import joystick
# Make screen profile ----
widthPix = 2560 # screen width in px
heightPix = 2440 # screen height in px
monitorwidth = 60 # monitor width in... |
from math import factorial
def combinations(n: int, r: int) -> int:
return factorial(n) // (factorial(r) * factorial(n - r))
|
# coding: utf-8
"""
Server API
Reference for Server API (REST/Json)
OpenAPI spec version: 1.4.58
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import sys
import os
import re
# python 2 and python 3 compatibility library
from six i... |
import pathlib
from xml.dom import minidom
from camundatools.base_rest import BaseRest
class Definition(BaseRest):
base_url: str
silent: bool
def __init__(self, url=None, username=None, password=None, config_file="camundatools.cfg", silent=False):
super().__init__(silent=silent, config_file=con... |
import pyautogui
import time
from PIL import Image
from pathlib import Path
"""
Basic usage:
1. Find the variable called image_file (line below) and replace it with a valid path to an image
2. Start MS Paint in the background
3. Start this from the command line and within 5 seconds:
4. Put your mouse pointer in the t... |
# Generated by Django 3.2.4 on 2021-12-30 21:35
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('core', '0004_news_quote_text'),
]
operations = [
migrations.AlterModelOptions(
name='maincategory',... |
from .vector_field import vector_field
from .ftle import FTLE
from .fit_ppt import fit_ppt
|
from functools import wraps
import logging
import os
from typing import Any, Callable, TypeVar
from django.conf import settings
from django.utils.translation import ugettext as _
import stripe
from zerver.lib.exceptions import JsonableError
from zerver.lib.logging_util import log_to_file
from zerver.models import Rea... |
from jobs.acquisition.messageacquisition import MessageAcquisition
from general_types.virtual_classes import ObservableGeneric
from general_types.label_ogc import LabelObservationType
from utility.utility_catalog_cached import UtilityCatalogCached
from jobs.cache_redis import CachedComponents
import logging
import date... |
from rest_framework import viewsets
from tasks.models import Task
from .serializers import TaskSerializer
from django.db import transaction
from worker.simple_worker import WORKERS
from worker.simple_worker import task_add
from rest_framework.exceptions import APIException
import time
import copy
class TaskViewSet(... |
#-------------------------------- main.py file -----------------------------------------#
"""
Main file - entry point to the code. This file coordinates all other files and
implements all the functionality directly available to the user.
"""
# import statements
import numpy as np
import joblib
from pkg_resou... |
# Generated by Django 2.2.5 on 2019-09-14 23:34
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Location',
fields=[
('id', models.AutoField... |
import pytest
import unittest.mock as mock
from smqtk_descriptors import DescriptorElementFactory
from smqtk_indexing import NearestNeighborsIndex
from smqtk_relevancy.interfaces.rank_relevancy import RankRelevancyWithFeedback
from smqtk_iqr.iqr.iqr_session import IqrSession
from smqtk_descriptors.impls.descriptor_ele... |
#!/usr/bin/env python3
__author__ = 'Lindo Nkambule'
import hailtop.batch as hb
def scatter_interval_list(b: hb.batch.Batch, interval_list_file: hb.resource.ResourceFile, scatter_count: int = 50,
break_bands_at_multiples_of: int = 1000000, scatter_img: str = None, memory: int = 2,
... |
"""Author: Brandon Trabucco, Copyright 2019, MIT License"""
from multiarchy.launch import launch_local
from multiarchy.baselines.sac import sac, sac_variant
from gym.envs.mujoco.half_cheetah import HalfCheetahEnv
if __name__ == "__main__":
# parameters for the learning experiment
variant = dict(
ma... |
from urllib import request, error
class Download:
def __init__(self, url='', verbose=False, timeout=5):
self.url = url
self.verbose = verbose
self.html = ''
self.error = False
self.timeout = timeout
def download(self, user_agent='wswp', num_retries=2):
# self.h... |
from qtpy import QtCore
from qtpy.QtWidgets import (
QApplication,
QFrame,
QHBoxLayout,
QLabel,
QProgressBar,
QVBoxLayout,
QWidget,
)
class ProgressBar(QWidget):
"""QProgressBar with QLabels for description and ETA."""
def __init__(self, parent=None) -> None:
super().__ini... |
from pkg_resources import declare_namespace
from .default_proxy import DefaultProxy
declare_namespace(__name__)
__all__ = [
'DefaultProxy',
'create_proxy'
]
create_proxy = DefaultProxy.of
|
# coding=utf-8
# Copyright 2022 The Google Research 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 applicab... |
from random import randint
# Exercise 074 - Largest and Smallest Tuple Values
"""Create a program that will generate five random numbers
and put them in a tuple.After that, show the list of
generated numbers and also indicate the smallest and
largest value that are in the tuple.
"""
numbers = (
randint(1, 10... |
import time
import numpy as np
import tensorflow as tf
import tensorflow_probability as tfp
from tqdm import tqdm
from cont_evaluate import evaluate_policy
from algorithms.klac import ReplayBuffer, KLAC, apply_squashing_func
class BOPAHSingle(KLAC):
def __init__(self, state_dim, action_dim, max_action, kl_coef... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sys
from PyQt5 import QtGui
from PyQt5 import QtCore
from PyQt5 import QtWidgets
# from mainWindow import Ui_MainWindow
# from shineMainWindow import ShineMainWindow
# from brightMainWindow import BrightMainWindow
from src.windows.brightMainWindow import BrightMai... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.