text stringlengths 1 927k |
|---|
#!/usr/bin/env python3
import os
from dothttp import Config
from dothttp.request_base import RequestCompiler
def run_model():
"""
main use case is to check benchmarks for loading from file to textx model
modifying http.tx would increase or lower performance.
"""
filename = os.path.join(os... |
import pygame
from pygame.locals import *
from _thread import *
import os
import random
import socket
import json
import math
from gamelogic import objects, world, common
SOCK_COUNT = 2
pygame.init()
W, H = 800, 437
win = pygame.display.set_mode((W, H))
pygame.display.set_caption("Projekt Kyyber 2021 Client")
bg_o... |
"""Utility functions for the pyaz generated code to use."""
import json
import logging
import shlex
import shutil
import subprocess
from typing import Dict
def _call_az(command: str, parameters: Dict) -> object:
"""
Call an az command (supplied as a string, and parameters as dictionary).
Calls az cli vi... |
#!/usr/bin/env python
#
# Electrum - lightweight Bitcoin client
# Copyright (C) 2015 Thomas Voegtlin
#
# 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... |
from concurrent.futures import ThreadPoolExecutor
from tornado.concurrent import run_on_executor
from API.handlers import APIHandler
from API.schema import api
import errors
from social.social_factory import SOCIAL_NETWORKS
class SocialAPI(APIHandler):
"""REST interface related to social networks
"""
execu... |
# -*- coding: utf-8 -*-
#
# Configuration file for the Sphinx documentation builder.
#
# This file does only contain a selection of the most common options. For a
# full list see the documentation:
# http://www.sphinx-doc.org/en/stable/config
import os
import sys
# -- Path setup --------------------------------------... |
# Copyright 2020, The TensorFlow Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed t... |
import numpy as np
import tempfile
def snap2model_parser(path_snapshot, path_model=None):
"""convert snapshot to model
:param path_snapshot: str
:param path_model: str, default None
:return: file descriptor (path_model is None) or None (otherwise)
"""
snapshot = np.load(path_snapshot)
mo... |
from .lib.symengine_wrapper import (
have_mpfr, have_mpc, have_flint, have_piranha, have_llvm,
I, E, pi, oo, zoo, nan, Symbol, Dummy, S, sympify, SympifyError,
Integer, Rational, Float, Number, RealNumber, RealDouble, ComplexDouble,
add, Add, Mul, Pow, function_symbol,
Max, Min, DenseMatrix, Matrix,... |
#
# Copyright (C) 2019 Databricks, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... |
# Sample program illustrating programmer-defined functions
# along with code that calls the functions
#
# The 'cube_root' function uses a 'return' statement. Its
# only job is to calculate and "return" the cube root of a
# number. It does not print anything. Notice that statements
# that "call" the 'cube_root' funct... |
import cv2
def SIFT(imgname1, imgname2):
sift = cv2.xfeatures2d.SIFT_create()
img1 = cv2.imread(imgname1)
img2 = cv2.imread(imgname2)
kp1, des1 = sift.detectAndCompute(img1, None)
kp2, des2 = sift.detectAndCompute(img2, None)
FLANN_INDEX_KDTREE = 0
index_params = dict(algorithm=FLANN_IND... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import torch
import torch.nn as nn
import time
import pickle
import numpy as np
import config
import constants
from config import args
from utils import batch_rodrigues, rotation_matrix_to_angle_axis
def ba... |
#
# 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, software
# distributed under... |
from Assembler.Assembler2s import *
from Base.EDAOBase import *
import Instruction.ActionOpTableEDAO as edao
import BattleMonsterStatus as MSFile
INVALID_ACTION_OFFSET = 0xFFFF
EMPTY_ACTION = INVALID_ACTION_OFFSET
class CharacterPositionFactor:
def __init__(self, fs = None):
if fs == None:
... |
import base64
import logging
import re
from html import unescape as html_unescape
from streamlink.plugin import Plugin, pluginmatcher
from streamlink.plugin.api import validate
from streamlink.stream import HTTPStream
from streamlink.utils.parse import parse_json
log = logging.getLogger(__name__)
@pluginmatcher(re.... |
# encoding: utf-8
from __future__ import absolute_import
import json
import logging
import salt.ext.six as six
import salt.netapi
logger = logging.getLogger(__name__)
class SaltInfo(object):
'''
Class to handle processing and publishing of "real time" Salt upates.
'''
def __init__(self, handler):
... |
import asyncio
from blspy import G2Element
from clvm_tools import binutils
from equality.consensus.block_rewards import calculate_base_farmer_reward, calculate_pool_reward
from equality.rpc.full_node_rpc_client import FullNodeRpcClient
from equality.types.blockchain_format.program import Program
from equality.types.c... |
from src.views.tests import BaseTest
class TestDeleteDevice(BaseTest):
"""Tests to delete device from the list."""
def test_delete_device(self):
self.register_device()
res = self.test_app.delete('/device/{id}'.format(id=1))
self.assertEqual(res.status_code, 204)
def test_delete_n... |
from abc import ABC, abstractmethod
from sherlockpipe.star.starinfo import StarInfo
class SearchZone(ABC):
"""
Abstract class to be implemented for calculating minimum and maximum search periods for an input star.
"""
def __init__(self):
pass
@abstractmethod
def calculate_period_rang... |
# --------------------------------------------------------------------------
# Source file provided under Apache License, Version 2.0, January 2004,
# http://www.apache.org/licenses/
# (c) Copyright IBM Corp. 2015, 2016
# --------------------------------------------------------------------------
# gendoc: ignore
from... |
from copy import deepcopy
from simple_api.django_object.actions import DetailAction, ListAction, CreateAction, UpdateAction, DeleteAction
from simple_api.django_object.datatypes import create_associated_list_type
from simple_api.django_object.filters import generate_filters
from simple_api.django_object.converter impo... |
# Copyright (c) 2018 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 app... |
import inspect
from mapillary_tools.process_user_properties import process_user_properties
from mapillary_tools.process_import_meta_properties import process_import_meta_properties
from mapillary_tools.process_geotag_properties import process_geotag_properties
from mapillary_tools.process_sequence_properties import pro... |
import numpy as np
from cell_place_gym.native.acp_placement import *
class acp_placement_state (object):
def __init__ (self, place):
self.place = place
self.design = place.design
l_inst_count = len (self.design.instances)
# Non-Placed Nets Matrix
self.c_matrix = np.z... |
import urllib
import re
import subprocess
import time
import sys
urls="https://old.reddit.com/r/dankmemes/"
i=0
num = input("How many pages would you like to download(25 memes per page)?")
if num<1:
sys.exit("Number of pages should be > 0")
else :
while i<num:
these_regex="data-url=\"(.+?)\""
... |
"""Entity representing a Sonos player."""
from __future__ import annotations
import logging
from pysonos.core import SoCo
import homeassistant.helpers.device_registry as dr
from homeassistant.helpers.dispatcher import (
async_dispatcher_connect,
async_dispatcher_send,
)
from homeassistant.helpers.entity impo... |
"""Test that not-in-loop is detected properly."""
# pylint: disable=missing-docstring, invalid-name, too-few-public-methods
# pylint: disable=useless-else-on-loop, using-constant-test, useless-object-inheritance
# pylint: disable=no-else-continue
while True:
def ala():
continue # [not-in-loop]
while True:... |
# Generated by Django 3.0.8 on 2020-08-05 09:33
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('wagtail_localize', '0003_delete_translation_sources'),
]
operations = [
migrat... |
# Copyright (c) 2016 Ansible, Inc.
# All Rights Reserved.
from copy import deepcopy
import datetime
import logging
import json
from django.db import models
from django.conf import settings
from django.core.mail.message import EmailMessage
from django.db import connection
from django.utils.translation import ugettext_... |
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "wisdom.settings")
try:
from django.core.management import execute_from_command_line
except ImportError:
# The above import may fail for some other reason. Ensure that the
... |
# -*- coding: utf-8 -*-
"""
Created on Sun Jun 7 17:58:57 2020
@author: adria.bove
"""
from BBDD import BBDD
import analytics
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
import datetime as dt
class consumption:
def __init__(self, nom):
self.nom_BBDD=nom
def forecaster... |
#!/usr/bin/env python
"""
Koala Bot Base Cog code and additional base cog functions
Commented using reStructuredText (reST)
"""
# Futures
# Built-in/Generic Imports
import os
import time
import re
import aiohttp
import logging
from concurrent.futures import ThreadPoolExecutor
logging.basicConfig(filename='TwitchAle... |
# 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, software
# distributed under t... |
from OpenGL.GL import *
from OpenGL.GLUT import *
from OpenGL.GLU import *
import sys
from math import *
import time
ESCAPE = '\033'
class Camera(object):
"""docstring for Camera"""
def __init__(self):
self.lock_x = 0
self.lock_y = 0
self.lock_z = 0
self.distance = 300
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Discover the largest product of five consecutive digits
in the 1000-digit number.
"""
def pe8(fname="../../res/pe8.txt", n=5):
"""
Discover the largest product of five consecutive digits
in the 1000-digit number.
>>> pe8()
40824
"""
with op... |
from openpyxl import Workbook
from openpyxl.utils import get_column_letter
from openpyxl.styles import PatternFill
from PIL import Image
class ExcelPixelator:
def __init__(self, input_path, output_path, file_name, cell_size, pixel_size):
self.image = Image.open(input_path).convert('RGB')
self.outp... |
import superimport
import itertools
import matplotlib.pyplot as plt
import numpy as np
from scipy.linalg import eigh
from sklearn.cluster import KMeans
from sklearn.metrics.pairwise import rbf_kernel
import pyprobml_utils as pml
plt.style.use('classic')
def spectral_clustering_demo():
np.random.seed(0)
num_c... |
#!/usr/bin/env python
"""
Created on Fri Jun 19 10:46:32 2015
@author: ruizca
"""
import argparse
import logging
import subprocess
from itertools import count
from pathlib import Path
from astropy.coordinates.sky_coordinate import SkyCoord
from astropy.table import Table
from astropy.units import UnitTypeError
from ... |
import pytest
from calc_class import Calculator
# 상수
NUMBER_1 = 3.0
NUMBER_2 = 2.0
# Fixtures
@pytest.fixture
def calculator():
return Calculator()
def verify_answer(expected, answer, last_answer):
assert expected == answer
assert expected == last_answer
# ======Test Cases 시작======
def test_last_answer... |
#
# Copyright (c) 2008-2016 Citrix Systems, 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 l... |
import time
# from dlgo.agent import naive
from dlgo.agent import naive
from dlgo import gotypes
from dlgo import goboard_slow as goboard
from dlgo.utils import print_board, print_move
def main():
board_size = 9
game = goboard.GameState.new_game(board_size)
bots = {
gotypes.Player.black: naive.Ra... |
load("@bazel_gazelle//:deps.bzl", "go_repository")
def go_deps():
go_repository(
name = "ag_pack_amqp",
build_file_proto_mode = "disable",
importpath = "pack.ag/amqp",
sum = "h1:cuNDWLUTbKRtEZwhB0WQBXf9pGbm87pUBXQhvcFxBWg=",
version = "v0.11.2",
)
go_repository(
... |
# 7018
# ^([a-zA-Z](?:(?:(?:\w[\.\_]?)*)\w)+)([a-zA-Z0-9])$
# EXPONENT
# nums:5
# EXPONENT AttackString:"a"+"_"*32+"!1 __EOA(iii)"
import re2 as re
from time import perf_counter
regex = """^([a-zA-Z](?:(?:(?:\w[\.\_]?)*)\w)+)([a-zA-Z0-9])$"""
REGEX = re.compile(regex)
for i in range(0, 150000):
ATTACK = "a" + "_"... |
# Copyright 2013 OpenStack 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
#
# Unless required by applicable law ... |
from checkov.common.models.enums import CheckResult, CheckCategories
from checkov.terraform.checks.resource.base_resource_check import BaseResourceCheck
class PasswordPolicyExpiration(BaseResourceCheck):
def __init__(self):
name = "Ensure IAM password policy expires passwords within 90 days or less"
... |
from dagster.api.snapshot_execution_plan import sync_get_external_execution_plan
from dagster.core.snap.execution_plan_snapshot import ExecutionPlanSnapshot
from .utils import get_foo_pipeline_handle
def test_execution_plan_snapshot_api():
pipeline_handle = get_foo_pipeline_handle()
execution_plan_snapshot ... |
#必要なライブラリをインポート
import numpy as np
import pandas as pd
import xgboost as xgb
from sklearn.preprocessing import LabelEncoder
#numpyのリスト表示制限を解除しておく
np.set_printoptions(threshold=np.inf)
#既に学習データとREDP関数を用いてAIが作成されているものとする
#model = RERL(df_l)
#住所と路線と間取りはラベルエンコーディングの都合により学習データ/テストデータにあったものしか使えない為、予め確保しておいた使える要素を表示させる
... |
#!/usr/bin/env python3
"""Filter bed-12 file.
Remove:
- incomplete annotations
- genes without CDS
"""
import argparse
import sys
import re
from collections import Counter
try:
from modules.common import die
from modules.common import eprint
except ImportError:
from common import die
from commom impor... |
# 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 may ... |
#!/usr/bin/env python3
# Purpose: Create qdec table
import pandas as pd
import numpy as np
import glob
import os.path as op
import os
data_csv = op.join(os.environ['TABULAR_DATA_DIR'],'data.csv')
output_file = op.join(os.environ['QDEC_DATA_DIR'],'qdec.table.dat')
fs_dir = "/cluster/projects/p23/data/open_datasets/u... |
import numpy as np
import pandas as pd
from carbontracker.tracker import CarbonTracker
from tensorflow.keras.callbacks import Callback
from utime.utils import get_memory_usage
from mpunet.utils import highlighted
from mpunet.logging import ScreenLogger
from collections import defaultdict
from datetime import timedelta
... |
# Copyright (c) 2013 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 agreed to in writi... |
from transformers import AlbertTokenizerFast, RobertaTokenizerFast, DistilBertTokenizerFast
from piqa.model.tokenizers_base import BaseTokenizerPIQA
class PIQATokenizer(object):
tokenizer_mapping = dict()
@classmethod
def register(cls, *args):
def decorator(fn):
for arg in args:
... |
from django.urls import path
from . import views
from files import views as files
from finances import views as finances
from others import views as others
from operations import views as operations
urlpatterns = [
path('clients/<int:client_id>/pay-reg-fee', views.pay_reg_fee, name='pay-reg-fee'),
path('clie... |
#!/usr/bin/env python3 -tt
import hashlib
import hmac
from pyasn1.type import univ, char, useful, tag
from pyasn1.codec.ber import encoder, decoder
import datetime
import base64
import sys
#REF: http://tools.ietf.org/id/draft-brezak-win2k-krb-rc4-hmac-03.txt
#T = 1 for TS-ENC-TS in the AS-Request
#T = 8 for the AS-... |
from config.SourceUrl import getUrl
from ip.Ip2Db import insert
import threading
import requests
from Log import log
header = {
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36'
}
def acquireIp():
aUrl = getUrl()
log.info('获... |
# new update
import pickle
import os
import numpy as np
from sklearn.datasets import load_diabetes
from sklearn.linear_model import Ridge
from sklearn.metrics import mean_squared_error
from sklearn.model_selection import train_test_split
from azureml.core.run import Run
from utils import mylib
os.makedirs('./outputs... |
# -*- encoding: utf-8 -*-
import os
from argparse import FileType
from django.core.management import BaseCommand
from ewaluacja2021.reports import load_data, rekordy
from ewaluacja2021.util import autor2fn
from ewaluacja2021.xlsy import AutorskiXLSX, CalosciowyXLSX
from bpp.models import Autor
from bpp.util import p... |
from setuptools import setup
from pycoinmon.metadata import Metadata
metadata = Metadata()
setup(
name = 'pycoinmon',
packages = ['pycoinmon'],
version = metadata.get_version(),
license = 'MIT',
description = 'Python Port Based on COINMON',
url = 'https://github.com/RDCH106/pycoinmon',
key... |
from enum import Enum
class Card:
card_type = None
territory_name = ''
def __init__(self, territory_name, card_type):
self.territory_name = territory_name
self.card_type = card_type
def __str__(self):
return f'Card of {self.territory_name} with {self.card_type} type'
class ... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function
# LIBTBX_SET_DISPATCHER_NAME cctbx.development.ntc_validation
from iotbx.cli_parser import run_program
from mmtbx.programs.ntc_validation import Program
# ==========================================================================... |
"""
Rhino Python Script Tutorial
Exercise 07
Let's reorganize the previous code to store the coordinates of our points in a list.
This list is called an array.
The following lesson explains why this is useful.
"""
import rhinoscriptsyntax as rs
import math
def Main():
n = 50
radius_0 = 3
poin... |
"""Manages cached post data."""
import math
import collections
import logging
import ujson as json
from toolz import partition_all
from hive.db.adapter import Db
from hive.utils.post import post_basic, post_legacy, post_payout, post_stats
from hive.utils.timer import Timer
from hive.indexer.accounts import Accounts
... |
import math
def update_position(posr, posc, dirties):
nearest_dirt = []
for i in range(len(dirties)):
# Euclidean distance
result = math.sqrt(((dirties[i][0] - posr) ** 2) + ((dirties[i][1] - posc) ** 2))
nearest_dirt.append(result)
return [x for (y,x) in sorted(zip(nearest_dirt,dir... |
import tensorflow as tf
import tensorflow.contrib.slim as slim
#import tensorflow.nn as slim
import numpy as np
from helpers import *
class AC_Network():
def __init__(self,s_size,a_size,scope,trainer,s_shape):
with tf.variable_scope(scope):
#Input and visual encoding layers
self.inp... |
# Copyright 2018-2019 QuantumBlack Visual Analytics Limited
#
# 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
#
# THE SOFTWARE IS PROVIDED "AS IS"... |
import os
import time
from munch import munchify
from ray import tune
from ..core.recommender import Recommender
from ..models.userKNN import UserKNNEngine
from ..utils.monitor import Monitor
def tune_train(config):
"""Train the model with a hyper-parameter tuner (ray).
Args:
config (dict): All the... |
from typing import Dict
import pandas as pd
from feast import RedshiftSource
from feast.data_source import DataSource
from feast.infra.offline_stores.redshift import RedshiftOfflineStoreConfig
from feast.infra.utils import aws_utils
from feast.repo_config import FeastConfigBaseModel
from tests.integration.feature_rep... |
# The following comment should be removed at some point in the future.
# mypy: disallow-untyped-defs=False
import codecs
import os
import sys
from setuptools import find_packages, setup
def read(rel_path):
here = os.path.abspath(os.path.dirname(__file__))
# intentionally *not* adding an encoding option to o... |
class message_data:
device_id = ""
message = ""
def get_Data(self):
return {
"deviceID": self.device_id,
"message": self.message
} |
"""Test the arraymodule.
Roger E. Masse
"""
import unittest
from test import support
from test.support import _2G
import weakref
import pickle
import operator
import struct
import sys
import array
from array import _array_reconstructor as array_reconstructor
sizeof_wchar = array.array('u').itemsize
class ArrayS... |
# -*- coding: utf-8 -*-
import uuid
from django.db import models
class TimeStampedModelMixin(models.Model):
"""Timestamp extra field.
An abstract base class model that provides self updating 'created' and 'modified' fields
https://docs.djangoproject.com/en/2.1/ref/models/fields/#django.db.models.DateFie... |
# coding=utf-8
# Copyright 2021 The Meta-Dataset Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... |
__logo__ = """
NikeBot
"""
__title__ = 'nikebotandroid'
__description__ = 'A retail automation bot for the Nike mobile app'
__url__ = 'https: // github.com/olegaobini/NikeBot'
__version__ = '0.0.1'
__debug_mode__ = False
__author__ = 'Olega Obini'
__author_email__ = 'obiniolega@gmail.com'
__license__ = 'MIT'
__copyrigh... |
#
# 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... |
# Copyright 2021 Sean Robertson
#
# 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... |
import os
import re
import imageio
from glob import glob
from PIL import Image
SAVE_FORMAT = 'gif'
video_name = 'ants1'
image_folder = os.path.join(os.getcwd(), 'demo/demo_images/')
#images = [img for img in os.listdir(image_folder) if img.endswith(".jpg")]
#images.sort(key=lambda var:[int(x) if x.isdigit() else ... |
"""Utilities for capturing the history of commands used to produce a given output"""
from .cmdline_provenance import new_log
from .cmdline_provenance import read_log
from .cmdline_provenance import write_log
__all__ = [new_log, read_log, write_log] |
"""Support for TMB (Transports Metropolitans de Barcelona) Barcelona public transport."""
from datetime import timedelta
import logging
from requests import HTTPError
from tmb import IBus
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.const import ATTR_ATTRIBUT... |
from PyQt5.QtCore import Qt
from PyQt5.QtWidgets import (QApplication, QWidget, QHBoxLayout, QVBoxLayout, QGroupBox, QButtonGroup, QRadioButton, QPushButton, QLabel)
from random import shuffle,randint
class Question():
def __init__(self,question,right_answer,wrong1,wrong2 ,wrong3):
self.right_a... |
# Copyright (C) 2018-2022 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import unittest
import numpy as np
from generator import generator, generate
from openvino.tools.mo.ops.dft import FFTBase
from openvino.tools.mo.front.common.partial_infer.utils import int64_array
@generator
class DFTSignalSizeCanon... |
# -*- coding: utf-8 -*-
# @Author: lidong
# @Date: 2018-03-20 18:01:52
# @Last Modified by: yulidong
# @Last Modified time: 2018-11-06 20:45:11
import torch
import numpy as np
import torch.nn as nn
import math
from math import ceil
from torch.autograd import Variable
from rsden.cluster_loss import *
from rsden imp... |
from datetime import datetime
import random
import json
import arrow
import feedparser
from rfeed import Feed, Item
# returns the feed string given the JSON object
def generate_feed(link_data: list[dict], rss_link: str) -> str:
data = []
for link in link_data:
feed = feedparser.parse(list(link.keys(... |
"""Dependency injector declarative container unit tests."""
import collections
import unittest
from dependency_injector import (
containers,
providers,
errors,
)
class ContainerA(containers.DeclarativeContainer):
p11 = providers.Provider()
p12 = providers.Provider()
class ContainerB(ContainerA... |
# 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! ***
# Export this package's modules as members:
from .hub import *
from .authorization_rule import *
from .namespace import *
from .get_hub... |
Desc = cellDescClass("ADDFXL")
Desc.properties["cell_footprint"] = "addf"
Desc.properties["area"] = "69.854400"
Desc.properties["cell_leakage_power"] = "3632.360760"
Desc.pinOrder = ['A', 'B', 'CI', 'CO', 'S']
Desc.add_arc("A","S","combi")
Desc.add_arc("B","S","combi")
Desc.add_arc("CI","S","combi")
Desc.add_arc("A","C... |
# !/uer/bin/env python3
# coding=utf-8
import datetime
import logging
import functools
import os
import traceback
import inspect
if "logs" in os.listdir('../'):
pass
else:
os.mkdir('../logs')
now = datetime.datetime.now().strftime('%Y-%m-%d_%H_%M_%S')
_log_fp = "../logs/" + now + ".log"
logging.basicConfig(lev... |
#!/usr/bin/env python3
# Copyright (c) 2019 The Particl Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
from test_framework.test_particl import GhostTestFramework
class SegwitScriptsTest(GhostTestFramework):
... |
# -*- coding: utf-8 -*-
'''
feedgen.ext.dc
~~~~~~~~~~~~~~~~~~~
Extends the FeedGenerator to add Dubline Core Elements to the feeds.
Descriptions partly taken from
http://dublincore.org/documents/dcmi-terms/#elements-coverage
:copyright: 2013-2017, Lars Kiesow <lkiesow@uos.de>
:license: F... |
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
class Opendx(AutotoolsPackage):
"""Open Visualization Data Explorer."""
homepage = "https://github.com/Mwoolsey/... |
import gzip
import io
import shutil
import pytest
from hatanaka import compress, compress_on_disk, decompress, decompress_on_disk
from .conftest import clean, compress_pairs, decompress_pairs, get_data_path
@pytest.mark.parametrize(
'input_suffix, expected_suffix',
decompress_pairs
)
def test_decompress(tmp... |
# routines for calibrating/comparing effective temperatures with photometric sample
from apogee.utils import apload
from apogee.utils import apselect
from astropy.io import fits, ascii
from tools import match
from tools import plots
from tools import fit
from apogee.utils import bitmask
from apogee.aspcap import err
i... |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... |
import pytest
from api.base.settings.defaults import API_BASE
from api_tests.preprints.filters.test_filters import PreprintsListFilteringMixin
from api_tests.preprints.views.test_preprint_list_mixin import PreprintIsPublishedListMixin, PreprintIsValidListMixin
from osf_tests.factories import (
ProjectFactory,
... |
"""
PySyft Duet (WebRTC)
This class aims to implement the PySyft Duet concept by using WebRTC protocol as a
connection channel in order to allow two different users to establish a direct
connection with high-quality Real-time Communication using private addresses.
The most common example showing how it can be used is... |
"""
Copyright (C) 2018-2021 Intel Corporation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to i... |
#!/usr/bin/env python
#
# Public Domain 2014-present MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
#
# Anyone is free to copy, modify, publish, use, compile, sell, or
# distribute this software, either in source code form or as a com... |
#!/usr/bin/env python
"""
* *******************************************************
* Copyright (c) VMware, Inc. 2020. All Rights Reserved.
* SPDX-License-Identifier: MIT
* *******************************************************
*
* DISCLAIMER. THIS PROGRAM IS PROVIDED TO YOU "AS IS" WITHOUT
* WARRANTIES OR CONDITIONS... |
from setuptools import setup
with open("README.rst", "r") as fh:
long_description = fh.read().replace(".. include:: toc.rst\n\n", "")
# The lines below are parsed by `docs/conf.py`.
name = "fe25519"
version = "1.2.0"
setup(
name=name,
version=version,
packages=[name,],
install_requires=[
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.