text stringlengths 2 999k |
|---|
#% preparation
close(mstring('all'))
clear(mstring('all'))
clc()
#% choose sky & guide
sky = im2double(imread(mstring('sky.jpg')))
guide = im2double(imread(mstring('guide/guide10.jpg')))
#% input
input1 = im2double(imread(mstring('input/input1.jpg')))
input2 = im2double(imread(mstring('input/input2.jpg')))
... |
from __future__ import with_statement
import os
import shutil
from managevcs import VCSError, get_repo, get_backend
from managevcs.backends.hg import MercurialRepository
from managevcs.utils.compat import unittest
from managevcs.tests.conf import TEST_HG_REPO, TEST_GIT_REPO, TEST_TMP_PATH
class VCSTest(unittest.Te... |
# This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
from __future__ import absolute_import, division, print_function
from cryptography import utils
from cryptography_patched.hazmat.primitive... |
from Helper.InputOutput.narx_helper_methods import *
from Model.InputOutput.narx_model import NARX
from sklearn.preprocessing import MinMaxScaler
CURRENT_TIME = time.strftime("%Y%m%d_%H%M%S")
NARX_SAVE_LOC = 'train/servomotor/'
NARX_LOAD_LOC = NARX_SAVE_LOC + 'narx_td15_n10'
NARX_LOAD_DATA = 'narx_model_100.ph'
TRAIN... |
from concepts.binary_search_tree import BinarySearchTree
from concepts.binary_tree import Node
root = Node(25)
tree = BinarySearchTree()
tree.add_item(25)
tree.add_item(25)
tree.add_item(15)
tree.add_item(50)
tree.add_item(10)
tree.add_item(22)
tree.add_item(35)
tree.add_item(70)
tree.add_item(4)
tree.add_item(12)
t... |
import pytest
from oauth.services.github import GithubOAuthService
@pytest.mark.parametrize(
"trigger_config, domain, api_endpoint, is_enterprise",
[
(
{
"CLIENT_ID": "someclientid",
"CLIENT_SECRET": "someclientsecret",
"API_ENDPOINT": "http... |
"""
SPDX-License-Identifier: BSD-4-Clause-Clear
Copyright (c) 2018-2019 Qualcomm Technologies, Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted (subject to the
limitations in the disclaimer below) provided that the following conditions are ... |
import torch
import torch.nn as nn
from models.aggregators.aggregator import PredictionAggregator
from typing import Dict, Tuple
class GlobalAttention(PredictionAggregator):
"""
Aggregate context encoding using scaled dot product attention. Query obtained using target agent encoding,
Keys and values obtai... |
import pytest
from blockkit.elements import (
Button,
ChannelsSelect,
Checkboxes,
ConversationsSelect,
DatePicker,
ExternalSelect,
Image,
MultiChannelsSelect,
MultiConversationsSelect,
MultiExternalSelect,
MultiStaticSelect,
MultiUsersSelect,
Overflow,
PlainTextIn... |
"""This module contains the backend for Linear Regression models
Work in progress
"""
import numpy as np
import chaospy
from profit.sur import Surrogate
from profit.defaults import fit_linear_regression as defaults, fit as base_defaults
class LinearRegression(Surrogate):
"""Base class for all Linear Regression ... |
# Copyright 2011-2013 Colin Scott
# Copyright 2012-2013 Sam Whitlock
# Copyright 2011-2013 Andreas Wundsam
# Copyright 2012-2012 Kyriakos Zarifis
#
# 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 ... |
# PyTorch StudioGAN: https://github.com/POSTECH-CVLab/PyTorch-StudioGAN
# The MIT License (MIT)
# See license file or visit https://github.com/POSTECH-CVLab/PyTorch-StudioGAN for details
# src/metrics/prdc_trained.py
from tqdm import tqdm
import math
import torch
import numpy as np
import prdc
import utils.sample a... |
import decimal
import numbers
import random
import sys
import numpy as np
import pandas as pd
from pandas.core.arrays import (ExtensionArray,
ExtensionScalarOpsMixin)
from pandas.core.dtypes.base import ExtensionDtype
class DecimalDtype(ExtensionDtype):
type = decimal.Decimal
... |
# Copyright 2019 Google LLC
#
# 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 writing, s... |
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from update import BasicUpdateBlock, SmallUpdateBlock
from extractor import BasicEncoder, SmallEncoder
from corr import CorrBlock, AlternateCorrBlock
from utils.utils import bilinear_sampler, coords_grid, upflow8
from utils.warp_util... |
from unittest import mock
from django.utils import timezone
from freezegun import freeze_time
from rest_framework import test
from waldur_mastermind.common.utils import parse_datetime
from waldur_mastermind.invoices import models as invoices_models
from waldur_mastermind.marketplace import callbacks
from waldur_maste... |
"""
azure_utils - logger/tests/__init__.py
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the MIT License.
"""
|
#!/usr/bin/env python2
#
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
from .mininode import *
from .blockstore import BlockStore, TxStore
from .util import p2p_port
'''
This is a tool for comparing two or more crowdclass... |
import unittest
import numpy as np
from mil.models import AttentionDeepPoolingMil
from mil.utils.padding import Padding
class TestAttentionDeepPoolingMil(unittest.TestCase):
def setUp(self):
self.training_bag = np.random.normal(0, 1, (30, 3, 28, 28, 1))
self.training_label = np.ze... |
import pytest
from web3.exceptions import (
ValidationError,
)
@pytest.fixture(autouse=True)
def wait_for_first_block(web3, wait_for_block):
wait_for_block(web3)
@pytest.fixture()
def math_contract(web3,
MATH_ABI,
MATH_CODE,
MATH_RUNTIME,
... |
# Copyright 2017 Istio 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... |
from django.urls import path
from . import views
urlpatterns = [
path('', views.catalog, name='index'),
path('books', views.BookListView.as_view(), name='books'),
path('books/<int:pk>', views.BookDetailView.as_view(), name='book-detail'),
path('authors', views.AuthorListView.as_view(), name='authors'),
path(... |
from typing import cast
from py_ecc import optimized_bls12_381 as bls12_381
from py_ecc.bls.constants import POW_2_382
from py_ecc.bls.typing import G1Uncompressed, G2Uncompressed
from py_ecc.fields import optimized_bls12_381_FQ as FQ
from py_ecc.fields import optimized_bls12_381_FQ2 as FQ2
from pytezos.michelson.mic... |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright 2011, Chris Behrens <cbehrens@codestud.com>
# 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
#
# ... |
#!/usr/bin/python
from __future__ import print_function
import sys,json
import requests,re
from multiprocessing import Pool
import urllib.request
def hiturl(questionserial):
question = questionserial[0]
serial = questionserial[1]['uid']
try:
print(question)
question = re.sub(r"[^a-zA-Z0-9]... |
# -*- coding: utf-8 -*-
# Copyright (c) Facebook, Inc. and its affiliates.
import datetime
import itertools
import logging
import os
import tempfile
import time
from collections import Counter
import torch
from fvcore.common.checkpoint import PeriodicCheckpointer as _PeriodicCheckpointer
from fvcore.common.param_sched... |
"""galaxy_reviews_29643 URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.2/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home'... |
import requests
try:
from urllib.parse import urlencode, urljoin
except ImportError:
from urllib import urlencode
from urlparse import urljoin
class BaseGraphRequestHandler:
"""Base request handler of facebook graph API, all Account and Media handlers
are inherit this class to read and retrieve d... |
from flask import Flask
app = Flask(__name__)
@app.route('/')
def hello_world():
return 'У меня получилось!!'
if __name__ == '__main__':
app.run(debug=True, host='0.0.0.0')
|
import unicodedata
try:
import sentencepiece as spm
except ImportError:
spm = None
#from ..config import ConfigError
#from ..utils import contains_all
SPIECE_UNDERLINE = '\N{LOWER ONE EIGHTH BLOCK}'
SEG_ID_A = 0
SEG_ID_B = 1
SEG_ID_CLS = 2
SEG_ID_SEP = 3
SEG_ID_PAD = 4
special_symbols = {
"<unk>": 0,
... |
#!/usr/bin/env python
import json
from django.contrib.auth.decorators import login_required, permission_required
from django.core.urlresolvers import reverse
from django.http import HttpResponse, HttpResponseRedirect
from django.shortcuts import get_object_or_404, render
from django.views.decorators.http import requ... |
# -*- coding:utf-8 -*-
from flask import render_template
from werkzeug.exceptions import (
HTTPException, InternalServerError, RequestTimeout,
)
def register(app):
""" 在传输过来的app中添加错误句柄 """
@app.errorhandler(400)
@app.errorhandler(404)
@app.errorhandler(500)
def handle_error(e):
if no... |
import os
import hydra
import torch
import logging
import torch.nn as nn
from torch import optim
from hydra import utils
import matplotlib.pyplot as plt
from torch.utils.data import DataLoader
from torch.utils.tensorboard import SummaryWriter
# self
import sys
sys.path.append(os.path.abspath(os.path.join(os.path.dirna... |
# 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! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import... |
from django.urls import path
from rest_framework.routers import DefaultRouter
from .views import LikeDislikeView
app_name = 'actions'
router = DefaultRouter()
urlpatterns = [
path('actions/', LikeDislikeView.as_view(), name='like_dislike'),
]
urlpatterns += router.urls
|
from django.contrib import admin
# Register your models here.
from .forms import LectureAdminForm
from .models import Course, Lecture, MyCourses
admin.site.register(MyCourses)
class LectureInline(admin.TabularInline):
model = Lecture
form = LectureAdminForm
prepopulated_fields = {"slug": ("title",)}
... |
# -*- coding: utf-8 -*-
import click
import logging
import pandas as pd
import numpy as np
import re
from dotenv import find_dotenv, load_dotenv
from nltk.tokenize import word_tokenize
from pathlib import Path
from tqdm import tqdm
tqdm.pandas(desc="Tokenization")
code_exp = re.compile(r"<pre[^>]*>.+?</pre>", re.DOTA... |
# -*- coding: utf-8 -*-
"""Imports for the encoding manager."""
from dfvfs.encoding import base16_decoder
from dfvfs.encoding import base32_decoder
from dfvfs.encoding import base64_decoder
|
from collections import Counter
import gensim
import pickle
import os
class ManuscriptParser(object):
def __init__(self, dirname):
self.dirname = dirname
def __iter__(self):
for fname in os.listdir(self.dirname):
for line in open(os.path.join(self.dirname, fname)):
... |
"""Support for Nest Thermostat binary sensors."""
from itertools import chain
import logging
from homeassistant.components.binary_sensor import (
BinarySensorDeviceClass,
BinarySensorEntity,
)
from homeassistant.const import CONF_BINARY_SENSORS, CONF_MONITORED_CONDITIONS
from . import NestSensorDevice
from .c... |
import os
from flask import Flask, jsonify, request
app = Flask(__name__)
from EntityParser import EntityParser
nlp = EntityParser()
@app.route('/')
def homepage():
return 'Entity Extraction Service'
@app.route('/private/entityExtraction')
def extract_entities():
text = request.args.get('text')
lang ... |
# Generated by Django 2.2.7 on 2019-11-25 06:17
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('exam', '0001_initial'),
]
operations = [
migrations.RenameField(
model_name='exam',
old_name='name',
new... |
import requests
def version():
return requests.__version__
|
from __future__ import absolute_import
# Copyright (c) 2010-2017 openpyxl
"""Write worksheets to xml representations in an optimized way"""
import atexit
from inspect import isgenerator
import os
from tempfile import NamedTemporaryFile
from zipfile import ZipFile, ZIP_DEFLATED
from openpyxl.cell import Cell, WriteO... |
import unittest
import rtamt
class TestIASTLSpecDenseTimeOnlineEvaluation(unittest.TestCase):
def __init__(self, *args, **kwargs):
super(TestIASTLSpecDenseTimeOnlineEvaluation, self).__init__(*args, **kwargs)
def test_output_robustness(self):
spec = rtamt.STLDenseTimeSpecification(semantics=r... |
from flask_restplus import Namespace, Resource
from flask_restplus import fields
from flask_restplus import inputs
import sqlalchemy
import flask
from utils import sql_query_generator, log_query
from model.models import db
api = Namespace('pair', description='Operations to perform queries on key-value metadata pairs')... |
"""Provides device triggers for Select."""
from __future__ import annotations
from typing import Any
import voluptuous as vol
from homeassistant.components.automation import (
AutomationActionType,
AutomationTriggerInfo,
)
from homeassistant.components.device_automation import DEVICE_TRIGGER_BASE_SCHEMA
from... |
# pv display for Pi0 using python3 and PySimpleGUI
import time
from time import ctime
from datetime import datetime
import pytz
import json
import paho.mqtt.client as mqtt
import threading
PVB_Vin = ' 00.0'
PVB_Vout = ' 00.0'
PVB_Iin = ' 00.00'
PVB_Iout = ' 00.00'
S2_temp = ' 00.0'
S2_hum = ' 00.0'
S2_atmp = ' 0000.0... |
import py, re
import sys, os, math, weakref
from cffi import FFI, VerificationError, VerificationMissing, model, FFIError
from testing.support import *
lib_m = ['m']
if sys.platform == 'win32':
#there is a small chance this fails on Mingw via environ $CC
import distutils.ccompiler
if distutils.ccompiler.g... |
from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^$', views.indexPage, name='index'),
url(r'^home/', views.homePage, name='home'),
url(r'^browse/', views.browsePage, name='browse'),
url(r'^search/', views.searchPage, name='search'),
url(r'^testimonial/(?P<id>[0-9]+)', view... |
# librarians dashboard contract structure
# list={
# 'computers':[{
#
# }]
# 'students':[{
#
# }]
# 'mentors':[{
#
# }]
# }
# Create your views here.
|
# Licensed under a 3-clause BSD style license - see LICENSE.rst
# -*- coding: utf-8 -*-
"""
====================
desitarget.skyfibers
====================
Module to assign sky fibers at the pixel-level for target selection
"""
import os
import sys
import numpy as np
import fitsio
from astropy.wcs import WCS
from time ... |
"""
Linux swap file.
Documentation: Linux kernel source code, files:
- mm/swapfile.c
- include/linux/swap.h
Author: Victor Stinner
Creation date: 25 december 2006 (christmas ;-))
"""
from hachoir.parser import Parser
from hachoir.field import (ParserError, GenericVector,
UInt32, String,
... |
# -*- coding: utf-8 -*-
# Authors: Teon Brooks <teon.brooks@gmail.com>
# Martin Billinger <martin.billinger@tugraz.at>
# Alan Leggitt <alan.leggitt@ucsf.edu>
# Alexandre Barachant <alexandre.barachant@gmail.com>
# Stefan Appelhoff <stefan.appelhoff@mailbox.org>
# Joan Massic... |
from __future__ import print_function
import time
import socket
import Pyro4
import pyupm_grove as grove
import pyupm_servo as servo
import pyupm_th02 as th02
import pyupm_i2clcd as lcd
import pyupm_guvas12d as upmUV
import pyupm_biss0001 as upmMotion
import pyupm_rotaryencoder as upmRotaryEncoder
import pyupm_grovespe... |
import typing
class ReadStdin:
def __call__(
self,
) -> bytes:
return next(self.__chunks)
def __init__(
self,
) -> typing.NoReturn:
import sys
self.__buf = (
sys.stdin.buffer
)
self.__chunks = (
self.__read_chunks()
)
def int(
self,
) -> int:
return ... |
from .Basic import *
from .Errors import *
from .main import * |
# Copyright (c) 2021, Frappe Technologies and contributors
# License: MIT. See LICENSE
import hashlib
import frappe
from frappe import _
from frappe.model.document import Document
from frappe.query_builder import DocType
from frappe.utils import cint, now_datetime
class TransactionLog(Document):
def before_insert(... |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'main.ui'
#
# Created by: PyQt5 UI code generator 5.15.6
#
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
# run again. Do not edit this file unless you know what you are doing.
from PyQt5 import QtCore, QtWidge... |
#!/usr/bin/env python
import webapp2
from google.appengine.api import app_identity
from google.appengine.api import mail
from conference import ConferenceApi
class SetAnnouncementHandler(webapp2.RequestHandler):
def get(self):
"""Set Announcement in Memcache."""
ConferenceApi._cacheAnnouncement()
... |
import copy
import warnings
import numpy as np
import torch
from mmcv import ConfigDict
from mmcv.ops import nms
from ..bbox import bbox_mapping_back
def merge_aug_proposals(aug_proposals, img_metas, cfg):
"""Merge augmented proposals (multiscale, flip, etc.)
Args:
aug_proposals (list[Tensor]): pro... |
import collections
from collections import defaultdict
import sys
import json
import random
from jsmin import jsmin
from io import StringIO
import numpy as np
import copy
import importlib
sys.path.insert(0, '/n/groups/htem/Segmentation/shared-dev/cb2_segmentation/segway.graph.tmn7')
from segway.graph.synapse_graph imp... |
import time
from sympycore import Polyhedron, Matrix, mpq
def test_LP_solve_Chateau_ETH_Production():
constraints = '''\
3*x1+4*x2+2*x3==MAX
2*x1<=4
x1+2*x3<=8
3*x2+x3<=6
'''
p = Polyhedron(*constraints.split('\n'))
#p.show()
names, D = p.get_LP()
Dwork = D[:]
xopt, vopt = Dwork.LP_solve(over... |
# Adapted from code from the book "Deep Reinforcement Learning" by Maxim Lapan
import numpy as np
import torch
from lib import environ
def validation_run(env, net, episodes=100, device="cpu", epsilon=0.02, comission=0.1):
stats = {
"episode_reward": [],
"episode_steps": [],
"order_profits... |
#!/usr/bin/python
#
# This file is part of Ansible
#
# Ansible 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 3 of the License, or
# (at your option) any later version.
#
# Ansible is distribut... |
# -*- coding: utf-8 -*-
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support.ui import Select
from selenium.common.exceptions import NoSuchElementException
from selenium.common.exceptions import NoAlertPresentException... |
'''
Created on October 15, 2012
@author: michel
'''
class ExceptionReport():
index = 0
exceptions = []
def add(self, exception):
self.exceptions.append(exception)
def __len__(self):
return len(self.exceptions)
def __iter__(self):
self.index = 0
return... |
#!/usr/bin/python
import glob
import multiprocessing
import os
import shutil
import subprocess
import sys
from argparse import ArgumentParser
from threading import Timer
import itertools
def get_immediate_subdirectories(a_dir):
return [(os.path.join(a_dir, name)) for name in os.listdir(a_dir)
if os.pat... |
import FWCore.ParameterSet.Config as cms
from IOMC.EventVertexGenerators.VtxSmearedParameters_cfi import Early10TeVX322Y500VtxSmearingParameters,VtxSmearedCommon
VtxSmeared = cms.EDProducer("BetafuncEvtVtxGenerator",
Early10TeVX322Y500VtxSmearingParameters,
VtxSmearedCommon
)
|
from .slugify import *
__author__ = 'Val Neekman @ Neekware Inc. [@vneekman]'
__description__ = 'A Python slugify application that also handles Unicode'
__version__ = '1.2.4'
|
import torch
import torch.nn as nn
from torchvision import models
from torch.utils.data import DataLoader
from model import *
import csv
from torchvision import transforms, utils
import pandas as pd
import cv2
from torch.utils.data import Dataset
class VideoDataset(Dataset):
"""Dataset Class for Loading Drun... |
from django.apps import AppConfig
class AnnotateConfig(AppConfig):
name = 'annotate'
# it just imports the signal file when the app is ready
def ready(self):
import annotate.signals
|
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('users', '0012_editor_wp_valid'),
]
operations = [
migrations.AlterField(
model_name='editor',
name='... |
"""Tests for the Start.ca sensor platform."""
import asyncio
from homeassistant.bootstrap import async_setup_component
from homeassistant.components.startca.sensor import StartcaData
from homeassistant.helpers.aiohttp_client import async_get_clientsession
@asyncio.coroutine
def test_capped_setup(hass, aioclient_mock)... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.apps import AppConfig
class AdministratorConfig(AppConfig):
name = 'administrator'
|
class DatasetUtilInterface():
def int64_feature(value):
raise NotImplementedError
def int64_list_feature(value):
raise NotImplementedError
def bytes_feature(value):
raise NotImplementedError
def bytes_list_feature(value):
raise NotImplementedError
def float_list... |
import os
from scipy import stats, ndimage
import numpy as np
from genEM3.data.wkwdata import WkwData
FILTER_KERNELS = {
'3d_gauss_sandwich_9': np.array([
[[-0.025, -0.05, -0.025],
[-0.05, -0.2, -0.05],
[-0.025, -0.05, -0.025]],
[[0.125, 0.25, 0.125],
[0.25, 0.5, 0.25],
... |
"""Fetch App Details from Playstore.
.app <app_name> to fetch app details.
.appr <app_name> to fetch app details with Xpl0iter request link."""
import requests
import bs4
import re
from telethon import *
from userbot import CMD_HELP
from userbot.events import register
@borg.on(events.NewMessage(pattern='.app... |
"""
Django settings for app project.
Generated by 'django-admin startproject' using Django 2.1.13.
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 os
# Bu... |
import sqlite3
db = sqlite3.connect("myshop.db")
cursor = db.cursor()
val = [(6, "Trevor","Adams","25 Django Street","Dublin","CE3 5YU","04567 468777"),(7, "Tim","Doo","5 Django Street","Dublin","CE3 5YU","04567 468700"),(8, "Marry","Ann","7 Django Street","Dublin","CE3 5YU","04567 468700")]
for t in val:
curso... |
"""Config loading and validation"""
from pathlib import Path
import configobj
from validate import Validator
# TODO: use ResourceManager API as recommended in
# https://setuptools.pypa.io/en/latest/userguide/datafiles.html
CONFIG_DIR = Path(__file__).parent
def load_config(config_path=None, configspec_path=None, do... |
import django_tables2 as tables
from django_tables2.utils import Accessor
from nautobot.utilities.tables import BaseTable, BooleanColumn
from nautobot.dcim.models import ConsolePort, Interface, PowerPort
from .cables import CableTable
from .devices import (
ConsolePortTable,
ConsoleServerPortTable,
DeviceB... |
# ------------------------------------
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# ------------------------------------
import asyncio
import functools
import logging
import json
from azure.core.exceptions import ResourceExistsError
from azure.core.pipeline.policies import SansIOHTTPPoli... |
import torch
from torch.autograd import Variable
import time
import os
import sys
from apex import amp
from utils import AverageMeter, calculate_accuracy
import numpy as np
def train_epoch(epoch, data_loader, model, criterion, optimizer, opt,
epoch_logger, batch_logger):
print('train at epoch {}'.... |
import discord
import urllib, urllib.request
from xml.dom import minidom
from discord.ext import commands
class arxiv(commands.Cog):
def __init__(self, client):
self.client = client
#Gets the top search result from arXiv API and displays the paper along with related details (including summary) i... |
#@title Genre Info
#@author Aaron Jauregui
#@description Given a genre, will print artists with genre
#@input None
#@output Prints info on genre (artists)
import os
import json
import sys
YOUR_PATH = os.path.dirname(os.getcwd())
def getArtists(target):
inFile = os.path.... |
#!/usr/bin/env python3
VERSION = " v1.09"
VERSION_DATE =" Apr.2020 - Apr.2021"
print("Arduboy Uploader GUI/FX activator/flasher" + VERSION + VERSION_DATE + " by Mr.Blinky running\n")
from tkinter import filedialog
from tkinter import *
from tkinter.ttk import *
from threading import Thread
from tkinter import... |
# -*- coding: utf-8 -*-
"""
Spyder Editor
This is a temporary script file.
"""
import cv2
import numpy as np
import time
import serial # may need to do install?
import serial.tools.list_ports # get open com port
# forward: 72
# down: 80
# right: 77
# left: 75
#opens serial port
def openSerial():
openP... |
import pytest
from urllib import request
from zipfile import ZipFile
states = {}
@pytest.fixture(scope='session')
def r128_test_data(tmp_path_factory):
'''Download and extract the test WAV files.'''
# The latest data can be found here:
# https://tech.ebu.ch/publications/ebu_loudness_test_set
# I u... |
# Lint as: python3
# Copyright 2019 Google LLC
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... |
from typing import Set
from clutch.method.method import MethodNamespace
from clutch.network.rpc.message import Response, Request
from clutch.schema.request.session.accessor import SessionAccessorArgumentsRequest
from clutch.schema.request.session.mutator import SessionMutatorArgumentsRequest
from clutch.schema.user.me... |
# -*- coding: utf-8 -*-
{
'name': "钉钉办公-智能人事",
'summary': """钉钉办公-智能人事""",
'description': """ 智能人事相关的接口需要企业开通了钉钉官方的“智能人事”应用之后才可以调用。您可以在手机端工作台打开应用中心,搜索智能人事,然后开通应用 """,
'author': "SuXueFeng",
'website': "https://www.sxfblog.com",
'category': 'dingding',
'version': '1.0',
'depends': ['base'... |
# coding=UTF-8
'''Helper functions
Consists of functions to typically be used within templates, but also
available to Controllers. This module is available to templates as 'h'.
'''
import email.utils
import datetime
import logging
import re
import urllib
import pprint
import copy
import urlparse
from urllib import ur... |
# this script is for testing for gpu
import tensorflow as tf
from tensorflow.python.client import device_lib
print(tf.test.is_built_with_cuda())
print(device_lib.list_local_devices())
print(tf.config.experimental.list_physical_devices('GPU'))
|
import math
import os
import pickle
import time
import cv2 as cv
import numpy as np
import torch
from PIL import Image
from flask import request
from scipy.stats import norm
from torchvision import transforms
from werkzeug.utils import secure_filename
import ps_demo as ps
from config import device, STATIC_DIR, UPLOAD... |
# Copyright The IETF Trust 2021, 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... |
# -*- coding: utf-8 -*-
import os
from .context import saltpay_python
import unittest
import pytest
from random import randint
CurrencyClass = saltpay_python.currencies.ISO4217
@pytest.mark.currencies
def test_can_init_currency():
assert CurrencyClass("ISK").value == "ISK"
@pytest.mark.currencies
def tes... |
import PIL.Image as Image
import os
import glob
import math
names = {}
seq = {}
def short(name):
p = name.split('_')
if len(name)>7:
if len(p)>1:
c = p[0]
else:
c = name.split('-')[0]
else:
c = name
s = seq.get(c,0)
if s==0:
names[c] = name
... |
import cv2
from tkinter import *
from tkinter import ttk, messagebox
from rpm import motor_rmp
from tip import tip
class visualize():
def __init__(self):
self.window = Tk()
self.window.title("Fuzzy Neural Network Systems")
self.window.geometry('800x950')
self.tab_control = ttk.N... |
# Copyright (c) 2020 PaddlePaddle 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 appli... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.