text stringlengths 2 999k |
|---|
#
# This is functionality implementation. It should be easily callable from inside
# other, bigger functions/pipelines.
#
# This file is not supposed to be executed. So no if __name__ == "__main__" here.
#
# It should not care about:
# - CL parsing
# - Basic validation (like file is not there)
# - No filenames availabl... |
from fastapi import FastAPI, Body, Header, File, Depends
from models.user import User
from models.author import Author
from models.book import Book
from models.jwt_user import JWTUser
from starlette.status import HTTP_201_CREATED
from starlette.responses import Response
from fastapi.security import OAuth2PasswordBearer... |
# coding: utf-8
"""
OpenAPI Petstore
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
... |
import torch.nn as nn
from ..core.primitives import AbstractPrimitive
class ConvBNReLU(AbstractPrimitive):
def __init__(self, C_in, C_out, kernel_size, stride=1, affine=False):
super().__init__(locals())
pad = 0 if stride == 1 and kernel_size == 1 else 1
self.op = nn.Sequential(
... |
from mysql.connector import connect
from sliceofpy.config import db_params as params
class Database():
''' Constructor '''
def __init__(self):
self.host = params['host']
self.user = params['user']
self.password = params['password']
self.database = params['database']
s... |
# -*- coding: utf-8 -*-
#
# hypersonic-simulation documentation build configuration file, created by
# sphinx-quickstart on Tue Jul 18 17:11:40 2017.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerat... |
#!/usr/bin/env python3
import asyncio, asyncssh
#Can be used for asynchronous remote shut down any number of linux machines in a network with same login credentials.
async def run_client(host, command):
# async with asyncssh.connect(host, username='username', password='password') as conn:
async with asyncssh.co... |
import time
def test_ui(selenium):
selenium.browser.get(selenium.url('/'))
{% if cookiecutter.cldf_module %}
time.sleep(1)
selenium.browser.get(selenium.url('/languages'))
time.sleep(3)
selenium.browser.get(selenium.url('/sources'))
{% endif %}
time.sleep(3)
|
import io
import hashlib
import logging
import os
import struct
import random
from collections import OrderedDict
from HintList import getHint, getHintGroup, Hint, hintExclusions
from Item import MakeEventItem
from Messages import update_message_by_id
from Search import Search
from TextBox import line_wrap
from Utils ... |
import MaxPlus
def main(data_block={}):
"""
Saves the scene from data_block["scene"].
return data_block
"""
_log = data_block["logger"]
_log.write(__name__)
_log.write("Saving scene...")
MaxPlus.FileManager.Save(data_block["scene"])
_log.write("Saved: {}".format(data_block["scen... |
# -*- coding: <utf-8> -*-
import sys
from simple_pvr.pvr_initializer import setup
from simple_pvr import RecordingPlanner
from simple_pvr.database_initializer import *
def main(argv=None):
db.create_all()
print "pvr initializer setup"
setup()
print "Server running on main thread"
from simple_pvr... |
import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="cytonic",
version="0.0.1",
author="mkualquiera",
author_email="ozjuanpa@gmail.com",
description="Flask/JS framework for calculator applications.",
long_description=long_description,
... |
# Copyright 2017 Alethea Katherine Flowers
#
# 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... |
n = int(input())
c = int(input())
ans = n//c
if n%c > 0: ans += 1
print(ans)
#one-line solution
#print(-(-n//c))
|
"""A setuptools based setup module.
See:
https://packaging.python.org/en/latest/distributing.html
https://github.com/pypa/sampleproject
"""
from six import raise_from
from os import path
from setuptools import setup, find_packages
here = path.abspath(path.dirname(__file__))
# *************** Dependencies *********
I... |
from invoke import Collection
from . import env
from . import git
from . import pre_deploy
from . import deploy
ns = Collection()
ns.add_collection(env)
ns.add_collection(git)
ns.add_collection(deploy)
ns.add_collection(pre_deploy)
|
# -*- coding: utf-8 -*-
# Copyright 2022 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... |
#! /usr/bin/env python
#Create weight rasters needed for multi-directional hillshade
import os, sys
import numpy as np
import gdal
from pygeotools.lib import iolib
az_list = (225, 270, 315, 360)
aspect_fn = sys.argv[1]
aspect_ds = gdal.Open(aspect_fn)
aspect = iolib.ds_getma(aspect_ds)
for az in az_list:
w_fn... |
'''Sequence to sequence example in Keras (character-level).
This script demonstrates how to implement a basic character-level
sequence-to-sequence model. We apply it to translating
short English sentences into short French sentences,
character-by-character. Note that it is fairly unusual to
do character-level machine ... |
import os
from flask import Flask
UPLOAD_FOLDER = './docs/uploads'
ALLOWED_EXTENSIONS = {'txt', 'pdf', 'png', 'jpg', 'jpeg', 'gif'}
def create_app(test_config=None):
from . import db
from . import auth
from . import docs
# create and configure the app
app = Flask(__name__, instance_relative_con... |
from bitcoin.rpc import JSONRPCError
from decimal import Decimal
from fixtures import * # noqa: F401,F403
from fixtures import TEST_NETWORK
from flaky import flaky # noqa: F401
from pyln.client import RpcError, Millisatoshi
from utils import (
only_one, wait_for, sync_blockheight, EXPERIMENTAL_FEATURES,
VALGR... |
import logging
import secrets
import time
import appcfg
import connexion
import redis
from amqpstorm import AMQPConnectionError
from flask_jwt_extended import JWTManager
from flask_mongoengine import MongoEngine
from flask_redis import FlaskRedis
from gatekeeper.models.users import User
from gatekeeper.util.flask imp... |
#MIT License
#Copyright (c) 2017 Tim Wentzlau
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publ... |
# -*- coding: utf-8 -*-
# Copyright (c) 2015, accurate systems and Contributors
# See license.txt
from __future__ import unicode_literals
import frappe
import unittest
# test_records = frappe.get_test_records('calculation')
class Testcalculation(unittest.TestCase):
pass
|
import datetime
import time
import pyspark
from pyspark.sql import *
import pyspark.sql.functions as Func
from pyspark.sql.types import *
import pyspark.mllib.clustering as clustering
from pyspark.ml.linalg import Vectors
sc = SparkContext(appName="Train-KMeans")
#Initialize SparkSession
spark = SparkSession.b... |
import hycohanz as hfss
# Remember: with the current library version, all the oAnsoftApp, oDesktop,
# oProject, oDesign and oEditor objects can be omitted
input('Press "Enter" to connect to HFSS.>')
[oAnsoftApp, oDesktop] = hfss.setup_interface()
input('Press "Enter" to create a new project.>')
oProject = hfss.new... |
# -*- coding:utf-8 -*-
# Copyright (C) 2020. Huawei Technologies Co., Ltd. All rights reserved.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the MIT License.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the ... |
# Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: http://doc.scrapy.org/topics/item-pipeline.html
from datetime import datetime
class ExamplePipeline(object):
def process_item(self, item, spider):
item["crawled"] = datetime.utcnow()
item["s... |
grito = soma = 0
while grito < 3:
entrada = str(input())
if entrada in "caw caw":
grito += 1
print(soma)
soma = 0
elif entrada in "--*":
soma += 1
elif entrada in "-*-":
soma += 2
elif entrada in "-**":
soma += 3
elif entrada in "*--":
soma... |
import numpy as np
# function to evaluate IOU between two boxes
def iou(bbox1, bbox2):
# shape of both tensor is (num_box, 4)
# value in format (xmin, ymin, xmax, ymax)
xmin_inter = np.maximum(bbox1[..., 0], bbox2[..., 0])
ymin_inter = np.maximum(bbox1[..., 1], bbox2[..., 1])
xmax_inter = n... |
# Copyright 2014 - Mirantis, 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 agree... |
import tweepy
from time import sleep
# Import in your Twitter application keys, tokens, and secrets.
# Make sure your credentials.py file lives in the same directory as this .py file.
from credentials import *
auth = tweepy.OAuthHandler(consumer_key, consumer_secret)
auth.set_access_token(access_token, ac... |
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
import grpc
import did_pb2 as did__pb2
class DidStub(object):
"""The did sidechain service definition.
"""
def __init__(self, channel):
"""Constructor.
Args:
channel: A grpc.Channel.
"""
self.Sign = channel.unary_unar... |
import unittest
import tempfile
import os
import numpy as np
import six
import caffe_double
from test_net import simple_net_file
class TestSolver(unittest.TestCase):
def setUp(self):
self.num_output = 13
net_f = simple_net_file(self.num_output)
f = tempfile.NamedTemporaryFile(mode='w+', d... |
class TimepieceDefaults(object):
TIMEPIECE_DEFAULT_LOCATION_SLUG = None
TIMEPIECE_PAID_LEAVE_PROJECTS = {}
TIMEPIECE_ACCOUNTING_EMAILS = []
TIMEPIECE_EMAILS_USE_HTTPS = True
TIMEPIECE_CLOCK_IN_OUT_DELTA_LIMIT = 12
|
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from train_utils import batchify_data, run_epoch, train_model, Flatten
import utils_multiMNIST as U
path_to_data_dir = '../Datasets/'
use_mini_dataset = True
batch_size = 64
nb_classes = 10
nb_epoch = 30
num_classes = 10
img_rows, im... |
from mastodon import Mastodon
from Zodiac import Zodiac
def announce(user_id, domain, zodiac):
if zodiac.bot_access_token is '' or zodiac.bot_access_token is None or zodiac.bot_base_url is '' or zodiac.bot_base_url is None:
return
bot = Mastodon(access_token=zodiac.bot_access_token, api_base_url=zodia... |
"""
master_config.py -- Contains parameters to configure an end-to-end ARPS-EnKF run
"""
import os
from datetime import datetime
import numpy as np
# Define needed directories and experiment names/tags
# Base project names and directories
scratch_base_dir = '/scratch/rice/d/dawson29'
depot_base_dir = '/depot/dawson29'... |
# pylint: disable=function-redefined
from typing import Dict, Union
from prompt_toolkit.application.current import get_app
from prompt_toolkit.buffer import Buffer, SelectionType, indent, unindent
from prompt_toolkit.completion import CompleteEvent
from prompt_toolkit.filters import (
Condition,
emacs_insert_m... |
from string import Template
from typing import Dict, List, Tuple, Optional
import discord
import pymongo
from bittensor import Balance
from tqdm import tqdm
from websocket import WebSocketException
from . import api, parse, validate, config
from .db import Database, DepositException, Tip, Transaction, WithdrawExcepti... |
import argparse
import glob
import numpy as np
import pandas as pd
import tensorflow as tf
from keras.preprocessing import sequence
from tensorflow.contrib import rnn
from sklearn.metrics import classification_report, precision_recall_fscore_support
from vectorizer import TokenizingEmbeddingVectorizer
def parse_... |
# Copyright The PyTorch Lightning team.
#
# 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 i... |
# Copyright 2019 The FastEstimator 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 appl... |
import numpy as np
from .transformations import rotation_matrix
from .constants import tol, log
from . import util
try:
from scipy.sparse import coo_matrix
except ImportError:
log.warning('scipy.sparse.coo_matrix unavailable')
def plane_transform(origin, normal):
'''
Given the origin and normal of ... |
import pytest
def test_tuples():
"""Tuples.
@see: https://www.w3schools.com/python/python_tuples.asp
@see: https://docs.python.org/3/tutorial/datastructures.html#tuples-and-sequences
A tuple is a collection which is ordered and unchangeable. In Python tuples are written with
round brackets.
... |
"""
Log all metrics and environment variables in benchmark/benchmark_results.csv
Plot learning curves of all the seed runs in the experiment
"""
import sys
import argparse
import os
from pathlib import Path
import pandas as pd
import yaml
import matplotlib.pyplot as plt
from stable_baselines3.common.results_plotter im... |
# coding: utf-8
import re
import six
from huaweicloudsdkcore.utils.http_utils import sanitize_for_serialization
class BatchDeleteVolumeTagsRequestBody:
"""
Attributes:
openapi_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (... |
# -*- coding: utf-8 -*-
__author__ = 'videns'
import re
from scanModules.linuxDetect import linuxDetect
class debBasedDetect(linuxDetect):
def __init__(self,sshPrefix):
self.supportedFamilies = ('debian','ubuntu', 'kali')
self.debCodenames = {'stretch':'9',
'jessie':'... |
import os
import configuration
import re
import requests
import math
from datetime import date
from dateutil.relativedelta import relativedelta
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from flask import flash, g, redirect, render_template, request, url_for, session
from itsdangerous i... |
"""Undocumented Module"""
__all__ = ['findClass', 'rebindClass', 'copyFuncs', 'replaceMessengerFunc', 'replaceTaskMgrFunc', 'replaceStateFunc', 'replaceCRFunc', 'replaceAIRFunc', 'replaceIvalFunc']
import types
import os
import sys
def findClass(className):
"""
Look in sys.modules dictionary for a module tha... |
import depthai as dai
import time
# Start defining a pipeline
pipeline = dai.Pipeline()
camRgb = pipeline.createColorCamera()
camRgb.setIspScale(2,3)
videoEnc = pipeline.create(dai.node.VideoEncoder)
videoEnc.setDefaultProfilePreset(30, dai.VideoEncoderProperties.Profile.MJPEG)
camRgb.video.link(videoEnc.input)
scr... |
from django.db import models
from django.utils.translation import ugettext_lazy as _
from . import settings
class Message(models.Model):
QUEUED = 'QUEUED'
SENT = 'SENT'
DEFERRED = 'DEFERRED'
FAILED = 'FAILED'
STATES = (
(QUEUED, _("Queued")),
(SENT, _("Sent")),
(DEFERRED, ... |
from .bus import Bus
from .message import Message
from .signature import Signature
from .agent import Agent
|
from mycroft import MycroftSkill, intent_handler
import subprocess
class BluetoothSpeakers(MycroftSkill):
def __init__(self):
MycroftSkill.__init__(self)
def initialize(self):
subprocess.Popen(['bash', self.root_dir + '/scripts/connect_bluetooth_speakers.sh'])
@intent_handler('con... |
# -*- coding: utf-8 -*-
"""
Created on Fri Jul 10 15:20:33 2020
@author: santi
"""
def save_gdf(data, file_name, geojson=False, shapefile=True):
import warnings
warnings.filterwarnings("ignore")
import zipfile
import os
geojson_path = file_name + '.geojson'
shape_path = file_n... |
# Copyright 2008-2015 Nokia Networks
# Copyright 2016- Robot Framework Foundation
#
# 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
... |
# usage: python summary.py <experiment directory>
import json
import os
import sys
from collections import defaultdict
import re
DISPLAYED_RSTAT_FIELDS = ["parks", "p_rx_ooo", "p_reorder_time"]
def percentile(latd, target):
# latd: ({microseconds: count}, number_dropped)
# target: percentile target, ie 0.99... |
# -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community
Edition) available.
Copyright (C) 2017-2021 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in co... |
#!/usr/bin/env python
#
# svnlook_tests.py: testing the 'svnlook' tool.
#
# Subversion is a tool for revision control.
# See http://subversion.apache.org for more information.
#
# ====================================================================
# Licensed to the Apache Software Foundation (ASF) under one
# ... |
from django.db import models
import datetime as dt
from django.contrib.auth.models import User
from django.dispatch import receiver
from django.db.models.signals import post_save
# Create your models here.
class Profile (models.Model):
user = models.OneToOneField(User, on_delete=models.CASCADE)
profile_picture... |
import logging
import sys
from flask import Flask, request, jsonify
import markov
logging.basicConfig(stream=sys.stdout, level=logging.DEBUG)
LOG = logging.getLogger('markov:main')
app = Flask(__name__)
@app.route('/gen', methods=['POST'])
def generate():
params = request.json
if 'dictionary' not in param... |
from py_imessage import imessage
from time import sleep
phone = "+66818726755"
if not imessage.check_compatibility(phone):
print("Not an iPhone.")
else:
print("Yes, he use iPhone.")
# guid = imessage.send(phone, "Hello World!")
#
# # Let the recipient read the message
# sleep(5)
# resp = imessage.status(guid... |
# qubit number=3
# total number=11
import numpy as np
from qiskit import QuantumCircuit, execute, Aer, QuantumRegister, ClassicalRegister, transpile, BasicAer, IBMQ
import networkx as nx
from qiskit.visualization import plot_histogram
from typing import *
from pprint import pprint
from math import log2
from collectio... |
from setuptools import setup, Extension
import sys
import platform
if platform.system() != 'Darwin':
print("The macos_display package can only be installed on macOS", file=sys.stderr)
sys.exit(1)
from os import path
this_directory = path.abspath(path.dirname(__file__))
with open(path.join(this_directory, 'RE... |
import configparser
import psycopg2
from sql_queries import copy_table_queries, insert_table_queries
def load_staging_tables(cur, conn):
"""
Populates the staging tables with CPOY from S3 buckets.
"""
for query in copy_table_queries:
cur.execute(query)
conn.commit()
def insert_tables... |
"""
Module: 'onewire' on esp32 1.10.0
"""
# MCU: (sysname='esp32', nodename='esp32', release='1.10.0', version='v1.10 on 2019-01-25', machine='ESP32 module with ESP32')
# Stubber: 1.2.0
class OneWire:
''
MATCH_ROM = 85
SEARCH_ROM = 240
SKIP_ROM = 204
def _search_rom():
pass
def crc8():... |
# -*- coding: utf-8 -*-
import asyncio
import os
from connections import RedisSettings
from cron import cron
async def say_hello(ctx, name) -> None:
await asyncio.sleep(30)
print(f"Hello {name}")
async def say_hi(ctx, name) -> None:
await asyncio.sleep(3)
print(f"Hi {name}")
async def startup(ct... |
"""
https://portswigger.net/web-security/access-control/lab-user-id-controlled-by-request-parameter-with-data-leakage-in-redirect
"""
import sys
import requests
from bs4 import BeautifulSoup
import re
site = sys.argv[1]
if 'https://' in site:
site = site.rstrip('/').lstrip('https://')
s = requests.Session()
url... |
#!/usr/bin/env python
# coding: utf-8
# In[1]:
import pandas as pd
from splinter import Browser
import time
browser = Browser('chrome','chromedriver')
def scrape():
title, paragraph = mars_news(browser)
data = {
"news_title": title,
"news_paragraph": paragraph,
"news_image": ma... |
# coding=utf-8
# ------------------------------------
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# ------------------------------------
from typing import ( # pylint: disable=unused-import
Union,
Optional,
Any,
List,
Dict,
TYPE_CHECKING
)
from azure.core.tracing.d... |
import abc
from collections import OrderedDict
from functools import reduce
from operator import mul
from frozendict import frozendict
from devito.tools import as_tuple, filter_ordered
__all__ = ['NullInterval', 'Interval', 'IntervalGroup', 'IterationSpace', 'DataSpace',
'Forward', 'Backward', 'Any']
cl... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import re
import common.validators
import django.core.validators
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='Page',
... |
import argparse
import copy
from typing import Optional
import scipy.sparse as sp
import numpy as np
import torch
import torch.nn.functional as F
from tqdm import tqdm
from cogdl.datasets import build_dataset
from cogdl.models import build_model
from cogdl.models.supervised_model import SupervisedHomogeneousNodeClass... |
import sys
import pygame
from pygame.sprite import Group
import json
from settings import Settings
from ship import Ship
from alien import Alien
import game_functions as gf
from game_stats import GameStats
from button import Button
from scoreboard import Scoreboard
def run_game():
pygame.init()
ai_settings =... |
from typing import Any
import discord
from redbot.core import commands
from redbot.core.bot import Red
from redbot.core.commands import NoParseOptional as Optional
from redbot.core.config import Config
from redbot.core.utils.chat_formatting import inline, pagify
FEED = "FEED"
class RSSNotifier(commands.Cog):
de... |
from enum import Enum
from collections import namedtuple
import json
import pickle
from datetime import datetime
import pathlib
import numpy as np
class Behavior(Enum):
WALK_FORW = 0
WALK_BACKW = 1
PUSH_BALL = 2
REST = 3
GROOM_FLEG = 4
GROOM_ANT = 5
NONE = 6
Experiment = namedtuple('Experi... |
def main():
codes_file = open('A3 Codes.txt', 'r')
validateCode(codes_file)
codes_file.close()
def validateCode(codes_file):
valid_codes = []
invalid_codes = []
invalid_restricted_codes = []
code = codes_file.readline().rstrip()
while code != '':
if len(code) >= 1... |
"""This module contains the collection of randomisation metrics to evaluate attribution-based explanations of neural network models."""
import random
import warnings
from typing import Callable, Dict, List, Union
import numpy as np
from tqdm import tqdm
from .base import Metric
from ..helpers import asserts
from ..he... |
import csv
from collections import defaultdict
import pandas as pd
import numpy as np
from random import shuffle
from xgboost import XGBClassifier
from sklearn.ensemble import RandomForestClassifier, GradientBoostingClassifier
from sklearn.linear_model import SGDClassifier
from sklearn.calibration import CalibratedClas... |
from pysatdata.utils.cdf_to_tplot import *
def readData_themis(files, usePyTplot, usePandas,
suffix, get_support_data,
varformat, varnames, notplot):
global time_ind, tvars
tvars = cdf_to_tplot(files, suffix=suffix, get_support_data=get_support_data,
... |
from ROOT import *
from math import log, acos
'''
### Creating training samples
##############################
f_sig = TFile("/vols/lhcb/palvare1/B2pphgamma/B2ppKgamma_MC/B2pphgamma_S21_v2.root")
t_sig_all = f_sig.Get("B2ppKgamma_Tuple/DecayTree")
f_bkg = TFile("/vols/lhcb/palvare1/B2pphgamma/B2ppKgamma/B2pphgamma_S2... |
# Copyright 2022 VMware, Inc.
# SPDX-License-Identifier: MIT
accessibility_result_api_types=['wave','crest']
accessibility_result_utility_types=['internal','opensource']
# a11y_task_default
accessibility_task_url_details_default = {
"uuid": None,
"user": None,
"result_t... |
from os import path
from setuptools import setup, find_packages
import sys
import versioneer
# NOTE: This file must remain Python 2 compatible for the foreseeable future,
# to ensure that we error out properly for people with outdated setuptools
# and/or pip.
min_version = (
3,
9,
)
if sys.version_info < min_... |
#!/usr/bin/env python
## Modification of vmtksurfacewriter
## Summary of changes: added mltiblockdataset writing capability
## Program: VMTK
## Module: $RCSfile: vmtksurfacewriter.py,v $
## Language: Python
## Date: $Date: 2006/07/27 08:27:40 $
## Version: $Revision: 1.13 $
## Copyright (c) Luca Antig... |
import clr
def process_input(func, input):
if isinstance(input, list): return [func(x) for x in input]
else: return func(input)
def WSSessionLoadDuration(wssess):
if wssess.__repr__() == 'WorksharingSession': return wssess.GetLoadDuration()
else: return None
OUT = process_input(WSSessionLoadDuration,IN[0]) |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
@date: 2018-Today
@author: jasper.bathmann@ufz.de
"""
from TreeOutputLib.TreeOutput import TreeOutput
import os
## Output class. This class creates one file per timestep at a defined
# location. A line containing time, position, desired geometric measures and
# des... |
# pylint: disable=too-few-public-methods
class DictParser:
def __init__(self, dictionary, label_extractor, extension_callback):
self.dict = dictionary
self.phrase = self.dict.trie
self.label_extractor = label_extractor
self.extension_callback = extension_callback
def parse(self, c):
extended = ... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
'分布式进程的练习'
__author__ = 'Jacklee'
# 将进程分布到不同的计算主体,通过网络进行通信
# Python提供了相应的模块managers
import sys, time, queue
from multiprocessing.managers import BaseManager
# 从BaseManager继承的QueueManager
class QueueManager(BaseManager):
pass
# 由于这个Queuemanager只从网络上获取Queue, 所以注册时只提供... |
__all__ = ["print_string"]
def print_string(s: str) -> str:
""" "Print a string as a GraphQL StringValue literal.
Replaces control characters and excluded characters (" U+0022 and \\ U+005C)
with escape sequences.
"""
return f'"{s.translate(escape_sequences)}"'
escape_sequences = {
0x00: "\... |
# Generated by Django 3.1.5 on 2021-04-21 16:48
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
('auth', '0012_alter_user_first_name_max_length'),
]
operations = [
migrations.CreateModel(
name='User',
... |
from __future__ import print_function
from nose.tools import eq_, ok_
import mock
import unittest
import serial
from pygatt.backends import BGAPIBackend
from pygatt.backends.bgapi.bgapi import (bgapi_address_to_hex,
MAX_CONNECTION_ATTEMPTS)
from pygatt.backends.bgapi.util imp... |
#!/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... |
# This is an example for sending message to a channel using its webhook URL.
# You can use this to send messages to a channel without using the bot.
import asyncio
import aiohttp
import nextcord
async def send_to_webhook(url, content):
# Create a new HTTP session and use it to create webhook object
async wi... |
#!/usr/bin/env python3
"""An example configuration file
"""
import sys
import os
# Assuming the cell order in the metadata tables are the same as those in the gene level matrices
# The output knn matrices follow such order as well
ka_smooth = 100
knn = 100
date = 201108
# # Configs
name = 'mop_smarter_cells_s... |
from django.urls import path
from Apps.Main.views import login, menu
from django.contrib.auth import views
urlpatterns = [
path(r'', login),
path('menu', menu),
path('login/',views.LoginView.as_view(template_name='Main/login.html')),
] |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# 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... |
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
import unittest
import torch
import onnxruntime_pybind11_state as torch_ort
import os
class OrtEPTests(unittest.TestCase):
def get_test_execution_provider_path(self):
return os.path.join('.', 'libtest_execution_provi... |
import tensorflow as tf
import model3 as M
import numpy as np
import resnet
import cv2
class FaceResNet(M.Model):
def initialize(self):
self.resnet = resnet.ResNet([64,64,128,256,512], [3, 4, 14, 3], 512)
def forward(self, x):
feat = self.resnet(x)
return feat
tf.keras.backend.set_learning_phase(True)
mo... |
from typing import NoReturn, Tuple, Any, Union, Optional, List, Callable, Dict
from timeatlas.abstract.abstract_base_generator import AbstractBaseGenerator
from timeatlas.time_series import TimeSeries
from timeatlas.time_series_dataset import TimeSeriesDataset
from timeatlas.config.constants import COMPONENT_VALUES
f... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.