text stringlengths 2 999k |
|---|
#imported from ppe-remix by @heyworld & @DeletedUser420
from asyncio import sleep
from random import choice, getrandbits, randint
import re
from re import sub
import random
from os import execl
import time
from telethon import events
from userbot import bot
from collections import deque
import requests
import sys
impor... |
# coding: utf-8
"""
Portainer API
Portainer API is an HTTP API served by Portainer. It is used by the Portainer UI and everything you can do with the UI can be done using the HTTP API. Examples are available at https://gist.github.com/deviantony/77026d402366b4b43fa5918d41bc42f8 You can find out more about Por... |
# -*- coding: utf-8 -*-
import sys
import unittest
import idx2numpy
import contextlib
import numpy as np
import os
import struct
try:
from StringIO import StringIO as BytesIO # for python 2.5
except ImportError:
from io import BytesIO
# unittest in Python 2.6 and lower doesn't have assertSequenceEqual metho... |
from dearpygui.dearpygui import *
def theme_callback(sender, data):
set_theme(sender)
add_menu_bar("MenuBar")
add_menu("Themes")
add_menu_item("Dark", callback=theme_callback)
add_menu_item("Light", callback=theme_callback)
add_menu_item("Classic", callback=theme_callback)
add_menu_item("Dark 2", callback=theme_... |
#!/usr/bin/env python3
# @Author : Yang Liu
# @FileName : meth_stats_tool.py
# @Software : NANOME project
# @Organization : JAX Li Lab
# @Website : https://github.com/TheJacksonLaboratory/nanome
"""
Tool for pre-processing results
"""
import argparse
import glob
import gzip
import sys
from collections import defaul... |
#
# 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 (c) 2018 Cisco and/or its affiliates.
#
# 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 v... |
#!/usr/bin/env python
"""
Contains class ModelPipeline, which loads in a dataset, splits it, trains a model, and generates predictions and output
metrics for that model. Works for a variety of featurizers, splitters and other parameters on a generic dataset
"""
import json
import logging
import os
import io
import sy... |
# -*- coding: utf-8 -*-
"""
(SHORT NAME EXPLANATION)
>>>DOCTEST COMMANDS
(THE TEST ANSWER)
@author: Yi Zhang. Created on Mon Jul 10 20:12:27 2017
Department of Aerodynamics
Faculty of Aerospace Engineering
TU Delft
#SUMMARY----------------
#INPUTS-----------------
#ESSEN... |
from jira.client import JIRA
import yaml
import getpass
class IssuesToLatex:
def __init__(self):
with open('issues_to_latex_config.yaml') as f:
data = yaml.safe_load(f)
self._username = data['login']['username']
self._password = data['login'].get('password')
if not self... |
import sounddevice as sd
import numpy as np
import timeit
import tensorflow.compat.v1 as tf
# Parameters
debug_time = 0
debug_acc = 0
word_threshold = 10.0
rec_duration = 0.020
sample_rate = 16000
num_channels = 1
# Load the TFLite model and allocate tensors.
interpreter = tf.lite.Interpreter(model_path="models2/crn... |
#!/usr/bin/env python3
from aws_cdk import core
from os import getenv
from configparser import ConfigParser
from jenkins.network import Network
from jenkins.ecs import ECSCluster
from jenkins.jenkins_master import JenkinsMaster
from jenkins.jenkins_worker import JenkinsWorker
config = ConfigParser()
config.read('conf... |
#!/usr/bin/env python3
# Test what the broker does if receiving a PUBREC in response to a QoS 1 PUBLISH.
from mosq_test_helper import *
rc = 1
keepalive = 60
connect_packet = mosq_test.gen_connect("subpub-qos1-test", keepalive=keepalive)
connack_packet = mosq_test.gen_connack(rc=0)
mid = 1
subscribe_packet = mosq_... |
import urllib
from .sd_card_device import SDCardDevice
from ..util.xpub import get_xpub_fingerprint
from ..helpers import to_ascii20
from embit.psbt import PSBT, DerivationPath
from embit import bip32
from binascii import b2a_base64, a2b_base64
from collections import OrderedDict
CC_TYPES = {"legacy": "BIP45", "p2sh-s... |
# 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 numpy as np
def calc_pad_dims_2D(X_shape, out_dim, kernel_shape, stride):
if not isinstance(X_shape, tuple):
raise ValueError("`X_shape` must be of type tuple")
if not isinstance(out_dim, tuple):
raise ValueError("`out_dim` must be of type tuple")
if not isinstance(kernel_shape, t... |
from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class Stream(_BaseTraceHierarchyType):
# class properties
# --------------------
_parent_path_str = "mesh3d"
_path_str = "mesh3d.stream"
_valid_props = {"maxpoints", "token"}
# maxpoints
... |
import numpy as np
from sklearn.cluster import KMeans
import torch
import torch.nn as nn
from torch.utils.data.dataloader import DataLoader, default_collate
from typing import Tuple, Callable, Optional, Union
from tqdm import tqdm
from ptdec.utils import target_distribution, cluster_accuracy
def train(
dataset: ... |
from dataclasses import dataclass, field
from typing import List, Tuple
from simple_parsing import ArgumentParser
from simple_parsing.helpers import list_field
@dataclass
class Example():
some_integers: List[int] = field(default_factory=list) # This is a list of integers (empty by default)
"""This list is em... |
#!/usr/bin/env python
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Verifies that setting SDKROOT works.
"""
import TestGyp
import os
import subprocess
import sys
if sys.platform == 'darwin':
print ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# from __future__ import absolute_import, division, print_function
import locale
import matplotlib as mpl
import numpy as np
import random
from matplotlib.projections.polar import PolarAxes
from numpy.lib.twodim_base import histogram2d
import matplotlib.pyplot as plt
from... |
import string
from geopy.extra.rate_limiter import RateLimiter
from geopy.geocoders import Nominatim
import folium
import operator
def maps():
def color_creator(number):
if number > 100:
if number > 300:
return 'black'
return 'brown'
if number < 20:
... |
"""
Launchpad represents a small factory and a distinct abstract for defining
actionable items. This is particularly useful when creating libraries of
tools or processes which need to be exposed and invokable.
Each action contains general details such as name, description etc as well
as some richer functionality to in... |
### Errors ###################################################################
class ZincError(object):
def __init__(self, code, message):
self.code = code
self.message = message
# TODO: might be worst python ever
class ZincErrors(object):
OK = ZincError(0, "OK")
INCORRECT_SHA = ZincError... |
import os
import subprocess
import pptx
from pptx.chart.data import ChartData
from pptx.enum.chart import XL_CHART_TYPE
from pptx.util import Inches
import pdfrw
from pd2ppt import df_to_table
import pandas as pd
def load_excel_files():
df_times = pd.read_excel("input_data/project_hours.xlsx")
df_expense... |
# -----------------------------------------------------------------------------
# Copyright (c) 2013-2020, PyInstaller Development Team.
#
# Distributed under the terms of the GNU General Public License (version 2
# or later) with exception for distributing the bootloader.
#
# The full license is in the file COPYING.tx... |
"""
A demo for training Sequential Variational Autoencoders.
python -m dedo.run_svae --logdir=~/local/dedo --num_envs 12 --unsup_algo VAE
tensorboard --logdir=/tmp/dedo --bind_all --port 6006
--unsup_algo choices are: VAE, SVAE, PRED
Note: this code is for research i.e. quick experimentation; it has minimal
comment... |
from typing import Tuple
import matplotlib.pyplot as plt
import numpy as np
from sklearn import datasets
from sklearn import svm, metrics
from decision_trees.datasets.dataset_base import DatasetBase
def sample_from_scikit():
# The digits dataset
digits = datasets.load_digits()
# The data that we are int... |
#
# Copyright (c) 2011-2014 Exxeleron GmbH
#
# 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 ... |
# 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 ... |
import math
import numbers
import random
import warnings
from collections.abc import Sequence
from typing import Tuple, List, Optional
import numpy as np
import torch
from PIL import Image
from torch import Tensor
try:
import accimage
except ImportError:
accimage = None
from . import functional as F
__all_... |
# -*- test-case-name: twisted.names.test.test_dns -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
DNS protocol implementation.
Future Plans:
- Get rid of some toplevels, maybe.
"""
from __future__ import division, absolute_import
__all__ = [
'IEncodable', 'IRecord',
'A',... |
"""Add username session setting
Revision ID: 33d56e6de360
Revises: c1197ef009a5
Create Date: 2019-06-23 12:27:16.186611
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '33d56e6de360'
down_revision = 'c1197ef009a5'
branch_labels = None
depends_on = None
def up... |
from haystack.preprocessor.cleaning import clean_wiki_text
from haystack.preprocessor.utils import convert_files_to_dicts, fetch_archive_from_http
from haystack.reader.farm import FARMReader
from haystack.reader.transformers import TransformersReader
from haystack.utils import print_answers
from haystack.document_store... |
# Generated by Django 3.2.7 on 2021-10-14 18:42
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("unit", "0010_unittheoryelement_order_number"),
]
operations = [
migrations.AddField(
model_name="unitexerciseelement",
... |
from models import *
from utils.utils import *
import numpy as np
from copy import deepcopy
from test import test
from terminaltables import AsciiTable
import time
from utils.prune_utils import *
import argparse
from utils.compute_flops import print_model_param_flops, print_model_param_nums
if __name__ == '__main__':... |
from sklearn.model_selection import GridSearchCV
from sklearn.neighbors import KNeighborsClassifier
from sklearn.tree import DecisionTreeClassifier
from sklearn.ensemble import RandomForestClassifier
from sklearn.neural_network import MLPClassifier
from sklearn.ensemble import VotingClassifier
from sklearn.svm import S... |
# Copyright 2015 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... |
# coding: utf-8
#
# Copyright 2022 :Barry-Thomas-Paul: Moss
#
# Licensed under the Apache License, Version 2.0 (the "License")
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http: // www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... |
import traceback, os, stat, time
from paramiko.client import SSHClient, AutoAddPolicy
from paramiko import AuthenticationException
from paramiko.ssh_exception import NoValidConnectionsError
class sshShell:
def __init__(self, name, addr, usr, pwd, pk = None, kf = None, encoding= 'utf-8'):
self.name, self.us... |
from django.shortcuts import render
# Create your views here.
def manpower_reports(request):
return render (request, 'manpower_reports.html') |
"""Problem 2.
Author: Lucas David -- <ld492@drexel.edu>
"""
import matplotlib.pyplot as plt
import numpy as np
from algorithms.linear_estimator import Perceptron
from mpl_toolkits.mplot3d import Axes3D
from scipy.io import loadmat
from sklearn.metrics import accuracy_score
Axes3D
def a(X, y):
fig = plt.figure(... |
import pymol
from pymol import cmd, util
from sys import argv
# usage: pymol -cq script_name.py -- path/to/fragments/
path = argv[1:][0]
print(f"Using path: {path} for structures")
# Set some nice CB friendly colours
cmd.set_color("cb_orange", [0.96, 0.41, 0.23])
# Add filter (ambient) and other misc settings
cmd.s... |
"""
Desafio 005
Problema: Faça um programa que leia um número inteiro e mostre na tela
o seu sucessor e antecessor.
Resolução do problema:
"""
num = int(input('Informe um valor: '))
sucessor = num + 1
antecessor = num - 1
print('Antecessor: {}\nInformado: {}\nSucessor: {}' .format(antecessor, num, sucessor... |
"""An interface for extending pandas with custom arrays.
.. warning::
This is an experimental API and subject to breaking changes
without warning.
"""
import operator
from typing import Any, Callable, Optional, Sequence, Tuple, Union
import numpy as np
from pandas.compat import PY3, set_function_name
from pan... |
from __future__ import unicode_literals
from collections import OrderedDict
import pytz
from django.conf import settings
from django.contrib.contenttypes.models import ContentType
from django.core.exceptions import ObjectDoesNotExist
from django.db.models import ManyToManyField
from django.http import Http404
from re... |
# -*- coding: utf-8 -*-
from .mnist import Mnist |
def prime_check(n):
if n <= 1: return False
if n == 2: return True
i = 2
while i * i <= n:
if n % i == 0:
return False
i += 1
return True |
#!/usr/bin/env python
"""
Create a directed graph, allowing multiple edges and self loops, from
a unix mailbox. The nodes are email addresses with links
that point from the sender to the recievers. The edge data
is a Python email.Message object which contains all of
the email message data.
This example shows the po... |
"""
Setuptools script for pwatch
"""
from setuptools import setup, find_packages
def readme():
"""
Extracts readme contents
"""
with open('README.md') as f:
return f.read()
def requirements():
"""
Extacts requirements.txt contents
"""
with open('requirements.txt') as f:
... |
from pyobjus import autoclass, dereference
from pyobjus.dylib_manager import load_dylib
load_dylib('testlib.dylib', usr_path=False)
Car = autoclass('Car')
car = Car.alloc().init()
# In pyobjus you can use properties in the same way as in native objective c
# So if we have property defined on this way:
# @property (as... |
"""
Support for Eight Sleep sensors.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/sensor.eight_sleep/
"""
import logging
import asyncio
from homeassistant.components.eight_sleep import (
DATA_EIGHT, EightSleepHeatEntity, EightSleepUserEntity,
... |
#
# Copyright (c) 2014, Arista Networks, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# Redistributions of source code must retain the above copyright notice,
# this list of condit... |
from day21.part1 import parse, reduce_allergens
def solve(recipes):
allergens = reduce_allergens(recipes)
solved = set()
while len(solved) < len(allergens):
for allergen in allergens:
if len(allergens[allergen]) == 1:
solved.add(list(allergens[allergen])[0])
... |
from enum import IntEnum
class LEDState(IntEnum):
Off = 0
On = 1 |
# Copyright 2018 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 numpy as np
def mse(mu, algo, *params):
"""Runs the algorithm on the data over n iterations
and computes the mean squared error.
Args:
mu (float or numpy array): the true answer
algo (function): algorithm to run on the data
*params: algo function params
"""
n = 100_000
... |
# -*- coding: utf-8 -*-
"""
Created on Wed Aug 16 10:53:19 2017
@author: Diego L.Guarin -- diego_guarin at meei.harvard.edu
"""
import cv2
import numpy as np
from scipy.spatial.distance import cdist
from PyQt5 import QtWidgets
from PyQt5 import QtGui
from PyQt5 import QtCore
from utilities import mark_picture #thi... |
default_prefix = '((${ARCH_NAME}*)cpu)->'
prefixes = {
'PC': 'cpu->',
#'X': '*((${ARCH_NAME}*)cpu)->',
#'R': '*((${ARCH_NAME}*)cpu)->'
}
rename_static = {
'PC': 'ic.current_address_'
}
rename_dynamic = {
'PC': 'cpu->instructionPointer'
}
exception_mapping = {
(0, 0): 'ETISS_RETURNCODE_IBUS_READ_ERROR',
(0, 2)... |
# Copyright 2014 Google Inc. 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 ag... |
r"""
Functor construction for all spaces
AUTHORS:
- Jonas Jermann (2013): initial version
"""
#*****************************************************************************
# Copyright (C) 2013-2014 Jonas Jermann <jjermann2@gmail.com>
#
# Distributed under the terms of the GNU General Public License (GPL)
# ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2017 Red Hat, 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... |
import math
c = input().strip()
if c == 'S':
m = int(input())
q = 1
r = 0
t = 1
k = 1
n = 3
x = 3
i = 0
p = ""
while i < m:
if 4*q + r - t < n*t:
p = p + str(n)
i = i + 1
a = 10*(r - n*t)
n = 10*(3*q + r)//t - 10*n
q = 10*q
r = a
... |
from enum import Enum
__all__ = ['Category', 'Diffculty', 'Type']
class Category(Enum):
General = 9
Books = 10
Film = 11
Music = 12
Musicals_Theatres = 13
Tv = 14
Video_Games = 15
Board_Games = 16
Nature = 17
Computers = 18
Maths = 19
Mythology = 20
Sports = 21
... |
import jinja2
import sys
import os
import json
# command line for use: python create_enablement_tosca.py '{"app_image_repo": "http://cloudrepo.com:8080","app_image_file": "/files/wheresmychargepoint.iso","app_state_data": "data_url.com","app_public_url": "wheresmychargepoint.com"}'
# command line for use: python creat... |
from django.contrib.auth import get_user_model
from rest_framework import status
from coupons.tests.base import BasicTest
class RedeemedDeleteTests(BasicTest):
def setUp(self):
u = get_user_model()
u.objects.create_superuser('admin', 'john@snow.com', self.PW)
self.user = u.objects.create... |
from motd_plugin import MOTDPlugin
|
from Node import Node
class Stack:
def __init__(self):
self.top = None
def empty(self):
return self.top is None
def peek(self):
return self.top.data if self.top else -1
def push(self, data):
node = Node(data)
if self.top:
node.next = self.top
... |
from abstract.expresion import *
from tools.tabla_tipos import *
from abstract.retorno import *
class tableId(expresion):
def __init__(self, valor, line, column, tipo, num_nodo):
super().__init__(line, column)
self.valor = valor
self.tipo = tipo
#Nodo AST
self.nodo = nodo... |
# =======================================================================
# Distributed under the MIT License.
# (See accompanying file LICENSE or copy at
# http://opensource.org/licenses/MIT)
# =======================================================================
"""current idd"""
# import witheppy.iddv800 as id... |
# -*- coding: utf-8 -*-
from django.core.exceptions import ValidationError
from django.db.utils import IntegrityError
from typing import Optional
from zerver.lib.actions import do_change_is_admin, \
do_change_realm_domain, do_create_realm, \
do_remove_realm_domain
from zerver.lib.domains import validate_domai... |
from __init__ import create_app
#create app thru app factory pattern
app = create_app()
if __name__ == "__main__":
app.run()
|
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Holiday zones, municipality classes in the Netherlands; module for importing.
Function:
- build_municipality_csv()
- get_municipality_data()
- select_cases_region()
Created on Sat Nov 7 16:08:51 2020 @hk_nien
Note: changes as of 2021-01-07:
'Haaren', # disapp... |
import numpy as np
def TD0(get_episode,policy, initial_v, gamma, alpha,num_episodes = 1):
# This function implements TD(0).
# get_episode: function to generate an episode
# policy: the policy to be evaluated
# initial_v: initial estimate for value function
# gamma: discount factor
# alpha: learning rate
# num_episode... |
#!/usr/bin/python
# Copyright 2015 Huawei Devices USA Inc. 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 r... |
"""This module contains the meta information of ApeInjectStimuli ExternalMethod."""
from ..ucscoremeta import MethodMeta, MethodPropertyMeta
method_meta = MethodMeta("ApeInjectStimuli", "apeInjectStimuli", "Version142b")
prop_meta = {
"cookie": MethodPropertyMeta("Cookie", "cookie", "Xs:string", "Version142b", "... |
#!/usr/bin/env python
# -*- encoding: UTF-8 -*-
"""
Provides a Python class that maps values to/from a JSON file
"""
from __future__ import absolute_import
import json
import os.path
import sys
from collections import OrderedDict
from copy import deepcopy
from tempfile import mktemp
import pyAesCrypt
__all__ = ["Jso... |
# -*- coding: utf-8 -*-
"""
Created by Francisco Bravo Sanchez July 2021
This scripts reads the NIPS4B wav files and splits them according to the
csv annotations from NIPS4Bplus (Morfi V, Bas Y, Pamula H, Glotin H,
Stowell D. 2019. NIPS4Bplus: a richly annotated birdsong audio dataset.
PeerJ Comput. Sci. 5:e223... |
# -*- coding: utf-8 -*-
from nltk.corpus import brown
import sklearn
import tensorflow as tf
import numpy as np
import numpy.random as random
import itertools
random.seed(42)
## Install data by running the following code:
#import nltk
#nltk.download('brown')
#nltk.download('universal_tagset')
def prepare_data(left... |
# -*- coding: utf-8 -*-
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
"""
Base module variables
"""
from ._version import get_versions
__version__ = get_versions()['version']
del get_versions
__author__ = 'The CRN developers'
__copyright__ = ('Copyri... |
# 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 or agreed to in w... |
from __future__ import print_function
__author__ = 'Leanne Whitmore and Lucy Chian'
__email__ = 'lwhitmo@sandia.gov'
__description__ = 'Interface for database of FBA models and compounds within SBML files'
import sqlite3
import time
def test_db_4_error(conn, cnx, query, db, count):
count+=1
while count < 15:
... |
import os
from collections import defaultdict
import numpy as np
from yt.frontends.chombo.io import parse_orion_sinks
from yt.funcs import mylog
from yt.geometry.selection_routines import GridSelector
from yt.utilities.io_handler import BaseIOHandler
def _remove_raw(all_fields, raw_fields):
centered_fields = se... |
# The MIT License (MIT)
#
# Copyright (c) 2021 Jonah Yolles-Murphy (TG-Techie)
#
# 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
#... |
from chainer.functions.array import broadcast
from chainer.functions.array import concat
from chainer.functions.array import reshape
from chainer.functions.array import select_item
from chainer.functions.array import split_axis
from chainer.functions.connection import embed_id
from chainer.functions.math import logsume... |
"""Contains classes used to manage the reflections used during refinement,
principally ReflectionManager."""
from __future__ import absolute_import, division, print_function
import logging
import math
import random
import warnings
import libtbx
from libtbx.phil import parse
from scitbx import matrix
from scitbx.math ... |
"""
Copyright (c) 2022 Huawei Technologies Co.,Ltd.
openGauss is licensed under Mulan PSL v2.
You can use this software according to the terms and conditions of the Mulan PSL v2.
You may obtain a copy of Mulan PSL v2 at:
http://license.coscl.org.cn/MulanPSL2
THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, W... |
# noinspection PyPackageRequirements
import re
from telegram.ext import BaseFilter
class AnimatedSticker(BaseFilter):
def filter(self, message):
if message.sticker and message.sticker.is_animated:
return True
class StaticSticker(BaseFilter):
def filter(self, message):
if message... |
import math
from eulerlib import pentagonalNum, isPentagonalNum, timedRun
#TODO: There has to be a much faster method for this!
def euler44():
for i in range(1, 3000):
for j in range(i, 3000):
a = pentagonalNum(i)
b = pentagonalNum(j)
if isPentagonalNum(a+b) and isPentag... |
import typing
from abaqusConstants import *
class ContactDamping:
"""The ContactDamping object specifies damping for a contact interaction property.
Attributes
----------
definition: SymbolicConstant
A SymbolicConstant specifying the method used to define the damping. Possible values are
... |
import numpy as np
import re
import itertools
from collections import Counter
from collections import defaultdict
import os
import pandas as pd
import pickle
def clean_str(string): #清洗数据
"""
Tokenization/string cleaning for all datasets except for SST.
Original taken from https://github.com/yoonkim/CNN_se... |
from django.apps import AppConfig
class ConvConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'conv'
|
# Generated by Django 3.1.4 on 2021-01-07 22:46
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Ratings',
fields=[
('id', models.AutoField(... |
#### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Tangible()
result.template = "object/tangible/medicine/crafted/shared_medpack_enhance_action_d.iff"
result.attrib... |
import numpy as np
from scipy.integrate import quad
import matplotlib.pyplot as plt
plt.figure(figsize=(32.0, 6.0))
def f(x):
return 1 - np.sqrt(1 - x ** 2)
SAMPLE_SIZE = 1000
Ef = quad(lambda x: f(x), 0, 1)[0]
Varf = quad(lambda x: (f(x) - Ef) ** 2, 0, 1)[0]
rand_x = np.random.rand(SAMPLE_SIZE)
rand_y = f(ran... |
#
# from src/zeta.c
#
# double zeta(double) to riemannZeta
#
from zeta import riemannZeta
zeta = riemannZeta()
for x in range(-4, 1):
print("zeta({0:2}) : {1:.15f}".format(x, zeta(x)))
print()
for x in range(2, 21):
print("zeta({0:2}) : {1:.15f}".format(x, zeta(x)))
|
# -*- coding: utf-8 -*-
# Learn more: https://github.com/kennethreitz/setup.py
from setuptools import setup, find_packages
readme = """
# Description
**pyuvm** implements the most often-used parts of the UVM while taking advantage of the fact that Python does not have strict typing and does not require parameteri... |
import datetime
import os
import re
import textwrap
import time
import binascii
import requests
from laim import Laim, before_log, log
from requests.adapters import HTTPAdapter
from requests.packages.urllib3.util.retry import Retry
PACKAGE_SPEC_RE = re.compile(r'^(?P<package>.+) \((?P<version>.+)\) (?P<distributions... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
__version__ = "0.0.1"
__author__ = "Björn Johansson"
__email__ = "bjorn_johansson@bio.uminho.pt"
from ._version import get_versions
__version__ = get_versions()['version']
del get_versions
|
from typing import Dict, List, Tuple
from uuid import UUID
from fastapi import APIRouter, Query
import cao_common_pb2
import cao_world_pb2
import cao_world_pb2_grpc
import cao_users_pb2_grpc
from google.protobuf.json_format import MessageToDict
from ..queen import queen_channel
router = APIRouter(prefix="/world", ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.