text stringlengths 2 999k |
|---|
from Hinkskalle import registry, rebar, authenticator, db
from Hinkskalle.util.auth.token import Scopes
from flask_rebar import RequestSchema, ResponseSchema, errors
from marshmallow import fields, Schema
from sqlalchemy.orm.exc import NoResultFound
from sqlalchemy.exc import IntegrityError
from sqlalchemy import or_, ... |
"""
All of the individual dataset entry types are defined here.
"""
from typing import Any, Dict, List, Optional, Tuple
import numpy as np
import openff.toolkit.topology as off
import qcelemental as qcel
from pydantic import Field, validator
from simtk import unit
from openff.qcsubmit.common_structures import (
... |
from .git_changes import * # noqa
|
# -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Copyright 2015-2018 by ExopyHqcLegacy Authors, see AUTHORS for more details.
#
# Distributed under the terms of the BSD license.
#
# The full license is in the file LICENCE, distributed with this software.
# ------... |
"""Models for the users app"""
from django.db import models
from django.db.models import Q
from profiles.models import Profile
class Tecnology(models.Model):
pass
class Location(models.Model):
pass
class User(models.Model):
"Model for an user"
username = models.EmailField(
unique=True,
... |
from autoPyTorch.utils.config.config_option import ConfigOption, to_bool
from autoPyTorch.utils.config.config_file_parser import ConfigFileParser
from autoPyTorch.pipeline.base.pipeline_node import PipelineNode
class SetAutoNetConfig(PipelineNode):
def fit(self, pipeline_config, autonet, autonet_config_file, dat... |
dataset_type = 'FilamentousDataset'
data_root = '/home/data/refined/deep-microscopy/train-data/final/'
img_norm_cfg = dict(
mean=[102.9801, 115.9465, 122.7717], std=[1.0, 1.0, 1.0], to_rgb=False)
train_pipeline = [
dict(type='LoadImageFromFile'),
dict(type='LoadAnnotations', with_bbox=True),
dict(type='... |
#!/usr/bin/env python
# boxlet.py - Boxlet class and utilities
# %%
import matplotlib.pyplot as plt
import random
from collections import namedtuple, defaultdict
from dataclasses import dataclass
from typing import List, Optional, Tuple, Union
from itertools import product
from aray.types import Point, Quad
from aray... |
"""empty message
Revision ID: 44b4fd37b54e
Revises: 293c6eae1bb7
Create Date: 2015-12-01 09:12:21.569936
"""
# revision identifiers, used by Alembic.
revision = '44b4fd37b54e'
down_revision = '293c6eae1bb7'
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql
def upgrade():
### ... |
import unittest
from ay.Point import Point
class UtilsTests(unittest.TestCase):
def test_proj(self):
mid = Point.mid(Point(100,100), Point(200,200))
self.assertEqual(Point(150,150), mid) |
# Copyright (c) 2017-present, Facebook, 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... |
"""Script to reproduce Fig. 6 of Connor et al. 2017.
Plot N(>S) over log S (S being the flux density) for various spectral indices.
"""
import copy
import numpy as np
import math
import matplotlib.pyplot as plt
from scipy.signal import savgol_filter
from frbpoppy import CosmicPopulation, Survey, SurveyPopulation, unp... |
"""
MIT License
Copyright (c) 2020 Dominik Kopczynski - dominik.kopczynski {at} isas.de
Nils Hoffmann - nils.hoffmann {at} isas.de
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 ... |
from PYB11Generator import *
class Vector3d:
"The PolyClipper (x,y,z) geometric vector type"
#---------------------------------------------------------------------------
# Constructors
#---------------------------------------------------------------------------
def pyinit0(self):
"Default ... |
import json
class Timeout(Exception):
"""
Used when a timeout occurs.
"""
pass
class HTTPException(Exception):
def __init__(self, response, *args, **kwargs):
try:
errors = json.loads(response.content.decode('utf8'))['errors']
message = '\n'.join([error['message'] f... |
import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="roost",
version="0.0.1",
author="Rhys Goodall",
author_email="reag2@cam.ac.uk",
description="Representation Learning from Stoichiometry",
long_description=long_description,
long_de... |
import numpy as np
import tensorflow as tf
import cv2
import model
import input_data
BATCH_SIZE = 1
N_CLASSES = 4
IMG_SIZE = 224
X = tf.placeholder(tf.float32, shape=[IMG_SIZE, IMG_SIZE, 3])
def get_one_image(filepath):
"""Read image to train.
Args:
filepath: raw_data dir.
Returns:
i... |
"""
Module which contain all data needed to calculate fingerprints/descriptors
parameters. Contain internal codes, names, molstring and header getters.
"""
import os
import pickle
import keras
import numpy as np
import tensorflow
from keras.models import load_model
from rdkit import Chem
from rdkit.Avalon.pyAvalonTool... |
from django.urls import path, include
from rest_framework.routers import DefaultRouter
from album import views
router = DefaultRouter()
router.register('tags', views.TagViewSet)
router.register('artists', views.ArtistViewSet)
app_name = 'album'
urlpatterns = [
path('', include(router.urls)),
]
|
import heapq
class Solution:
def eatenApples(self, apples: [int], days: [int]) -> int:
n = len(apples)
max_days = 0
h = []
for i in range(n):
max_days = max(max_days, i+days[i])
heapq.heappush(h, (i+days[i], i, apples[i]))
ans, min_rot, jeat = 0, 0, -... |
"""
Functions to work with MessagePack
"""
# Import Python libs
import logging
log = logging.getLogger(__name__)
# Import 3rd party libs
HAS_MSGPACK = False
try:
import msgpack
# There is a serialization issue on ARM and potentially other platforms for some msgpack bindings, check for it
if (
m... |
#!/usr/bin/env python
"""
Test flight condition functionality.
Author: Matthew C. Jones
Email: matt.c.jones.aoe@gmail.com
:copyright: 2021 Matthew C. Jones
:license: MIT License, see LICENSE for more details.
"""
# flake8: noqa E203
import pytest
import re
from shlex import split
from subprocess import run
from n... |
#%%
import os
import csv
path = os.path.join("Resources","budget_data.csv")
months = []
revenue = []
with open(path,newline="") as infile:
csv = csv.reader(infile ,delimiter = ",")
next(csv)
for row in csv :
months.append(row[0])
revenue.append(int(row[1]))
# Initialize Variables
count... |
import os
import sys
import time
import yaml
import tkinter as tk
import tkinter.font as tk_font
import re
from tkinter import (filedialog, messagebox, ttk)
from quiet_syntax_highlighting import SyntaxHighlighting
from quiet_menubar import Menu, Menubar
from quiet_statusbar import Statusbar
from quiet_linenumbers imp... |
#
# Copyright 2016 The BigDL 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 to in ... |
class file:
def __init__(self, dir: str, description: str = "", permission = -1):
self.dir = dir
self.description = description
self.permission = permission
def get_dir(self):
return self.dir
def get_description(self):
return self.description
def get_permission... |
class AlgorithmArnProvider:
@staticmethod
def get_algorithm_arn(current_region):
mapping = {
"ap-northeast-1" : "arn:aws:sagemaker:ap-northeast-1:977537786026:algorithm/autogluon-tabular-v2-a11d018f6028f8192e60553704ee3d97",
"ap-northeast-2" : "arn:aws:sagemaker:ap-... |
'''
P2 test (LGalaxies mocks) using provabgs model
'''
import os, sys
import pickle
import numpy as np
from functools import partial
from multiprocessing.pool import Pool
# --- gqp_mc ---
from gqp_mc import util as UT
# --- provabgs ---
from provabgs import infer as Infer
from provabgs import models as Models
##... |
# -*- coding:utf-8 -*-
class calc2:
'''
計算を行うクラスです
'''
def mul_(a, b):
'''
掛け算を行う
Parameters
----------
a: float
b: float
Returns
-------
mul_: float
'''
mul_ = a * b
return mul_
def div_(a, b):
... |
#
# 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 us... |
# This file helps to compute a version number in source trees obtained from
# git-archive tarball (such as those provided by githubs download-from-tag
# feature). Distribution tarballs (built by setup.py sdist) and build
# directories (produced by setup.py build) will contain a much shorter file
# that just contains t... |
INTRODUCTION = '''
# COVID-19
O objetivo deste projeto é iniciar uma força tarefa conjunta da comunidade científica e tecnológica a fim de criar modelos de previsão de infectados (e talvez outras métricas) pelo COVID-19, focando no Brasil. O projeto é público e pode ser usado por todos.
Acesse [este link](https://gith... |
import numpy as np
from utils import read_data
from rdkit import Chem, DataStructs
from rdkit.Chem import AllChem
from sklearn.svm import SVC
from sklearn.metrics import roc_auc_score
tox_type = 'nr-ahr'
smiles, label = read_data(tox_type)
# 1. Get molecular fingerprints of each molecules
# 2. Split the dataset to ... |
"""
=======================================
Visualizing the stock market structure
=======================================
This example employs several unsupervised learning techniques to extract
the stock market structure from variations in historical quotes.
The quantity that we use is the daily variation in quote ... |
#
# SPDX-License-Identifier: MIT
#
import os
import shutil
import oeqa.utils.ftools as ftools
from oeqa.utils.commands import runCmd, bitbake, get_bb_var, get_test_layer
from oeqa.selftest.cases.sstate import SStateBase
class RebuildFromSState(SStateBase):
@classmethod
def setUpClass(self):
super(R... |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import logging
from ast import literal_eval
from odoo import api, fields, models, _
from odoo.exceptions import UserError
from odoo.osv import expression
from odoo.tools.misc import ustr
from odoo.addons.base.models.i... |
# coding: utf-8
import logging
import threading
from typing import Callable
from il2fb.commons.events import Event, EventParsingException
from il2fb.commons.structures import BaseStructure
from il2fb.ds.airbridge.typing import EventHandler
from il2fb.ds.airbridge.typing import StringOrNoneProducer, StringHandler
... |
import ocl
import camvtk
import time
import vtk
import datetime
import math
def generateRange(zmin,zmax,zNmax):
dz = (float(zmax)-float(zmin))/(zNmax-1)
zvals=[]
for n in xrange(0,zNmax):
zvals.append(zmin+n*dz)
return zvals
if __name__ == "__main__":
print ocl.revision()
myscre... |
from django.conf.urls import url
from events.views import RegisterEvent
urlpatterns = [
url(r'^(?P<event_id>[-\w]+)/register/', view=RegisterEvent.as_view(), name='register_event'),
]
|
# coding: utf-8
"""
Isilon SDK
Isilon SDK - Language bindings for the OneFS API # noqa: E501
OpenAPI spec version: 8
Contact: sdk@isilon.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import unittest
import isi_sdk_8_2_1
from i... |
import argparse
import json
import os
from tqdm import tqdm
from tokenizations.bpe_tokenizer import get_encoder
from multiprocessing import Pool
def build_files(data_path, tokenized_data_path, num_pieces, full_tokenizer, min_length):
with open(data_path, 'r', encoding='utf8') as f:
print('reading lines')
... |
import tensorflow as tf
NUM_CLASSES = 1000
def fire_module(x,inp,sp,e11p,e33p):
with tf.variable_scope("fire"):
with tf.variable_scope("squeeze"):
W = tf.get_variable("weights",shape=[1,1,inp,sp])
b = tf.get_variable("bias",shape=[sp])
s = tf.nn.conv2d(x,W,[1,1,1,1],"VA... |
# Tencent is pleased to support the open source community by making ncnn available.
#
# Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
#
# Licensed under the BSD 3-Clause License (the "License"); you may not use this file except
# in compliance with the License. You may obtain a copy of the... |
import six
if six.PY3:
long = int # pragma: PY3
else:
long = long # pragma: PY2
def b(arg):
"""Convert `arg` to bytes."""
if isinstance(arg, six.text_type):
arg = arg.encode("latin-1")
return arg
def u(arg):
"""Convert `arg` to text."""
if isinstance(arg, six.binary_type):
... |
#
# Autogenerated by Frugal Compiler (3.4.7)
#
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
#
import sys
import traceback
from thrift.Thrift import TApplicationException
from thrift.Thrift import TMessageType
from thrift.Thrift import TType
from tornado import gen
from frugal.exceptions import... |
class Fight(object):
def __init__(self, good, bad):
print("FIGHT!!!")
print(
", ".join((i.name for i in good)) + " v " + ", ".join((i.name for i in bad))
)
print()
self.gChars = good
self.bChars = bad
i = 0
while len(self.gChars) != 0 and l... |
#
# Copyright 2021 Budapest Quantum Computing Group
#
# 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... |
import uuid
from django.db import models
class UserWeight(models.Model):
id = models.UUIDField(primary_key=True, editable=False, default=uuid.uuid4)
user_id = models.IntegerField()
day = models.DateField()
weight = models.FloatField()
class Meta:
managed = False
db_table = 'user_... |
# Unless explicitly stated otherwise all files in this repository are licensed
# under the Apache License Version 2.0.
# This product includes software developed at Datadog (https://www.datadoghq.com/).
# Copyright 2018 Datadog, Inc.
from .process import Process
from .__about__ import __version__
__all__ = [
'__... |
#!/usr/bin/env python
import os, sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "inventory.settings")
# Add the lib/ directory to the system path
sys.path.append("lib")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)... |
# Copyright 2021, Kay Hayen, mailto:kay.hayen@gmail.com
#
# Part of "Nuitka", an optimizing Python compiler that is compatible and
# integrates with CPython, but also works on its own.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in complianc... |
# Generated by Django 4.0.2 on 2022-02-11 18:17
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('users', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='user',
name='is_staff',
field... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import asyncio
import unittest
import qqbot
from qqbot.core.exception.error import (
AuthenticationFailedError,
SequenceNumberError,
ServerError,
)
from qqbot.core.util import logging
from qqbot.model.api_permission import (
APIPermissionDemandIdentify,
... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from compas.geometry._primitives import Vector
from compas.geometry._primitives import Frame
from compas.geometry import subtract_vectors
__all__ = ['Box']
class Box(object):
"""A box is defined by a fr... |
# Copyright (c) 2020 Vishnu J. Seesahai
# Use of this source code is governed by an MIT
# license that can be found in the LICENSE file.
import subprocess, os, sys, json, threading, signal, traceback, rpcworker
from PyQt5.QtCore import *
from PyQt5 import QtWidgets
#from resource import resource_path
from rpcworker im... |
from flask import request
from flask_apispec import MethodResource
from flask_apispec import doc
from flask_jwt_extended import jwt_required
from flask_restful import Resource
from sqlalchemy import func, or_
from db.db import DB
from decorator.catch_exception import catch_exception
from decorator.log_request import l... |
from ._ysrc import YsrcValidator
from ._ycalendar import YcalendarValidator
from ._yaxis import YAxisValidator
from ._y0 import Y0Validator
from ._y import YValidator
from ._xsrc import XsrcValidator
from ._xcalendar import XcalendarValidator
from ._xaxis import XAxisValidator
from ._x0 import X0Validator
from ._x impo... |
from math import floor
import random
from random import Random
import copy
from datetime import datetime
from time import sleep
from threading import Lock
from shared.ThreadManager import ThreadManager
from shared.LogParser import LogParser
from shared.utils import get_rnd, get_time, get_rnd_seed
from shared.RedisMan... |
# coding: utf-8
import pprint
import re
import six
from huaweicloudsdkcore.sdk_response import SdkResponse
class ShowAuditlogPolicyResponse(SdkResponse):
"""
Attributes:
openapi_types (dict): The key is attribute name
and the value is attribute type.
attribute_map... |
# coding: utf-8
import pprint
import re
import six
class ListPortsRequest:
"""
Attributes:
openapi_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the value i... |
from rest_framework import filters, permissions, status, viewsets
from rest_framework.decorators import api_view, detail_route, list_route
from rest_framework.response import Response
from rest_framework.reverse import reverse
from .models import CreditCard, Expense, Income, Investment, Overdraft, TaxBracket, Type, Use... |
#!/usr/bin/python3
# coding=utf-8
# pylint: disable=I0011,E0401,W0702,W0703
# Copyright 2019 getcarrier.io
#
# 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... |
import logging
import re
import struct
from collections import OrderedDict, defaultdict, namedtuple
from requests.exceptions import ChunkedEncodingError, ConnectionError, ContentDecodingError
from streamlink.compat import str, urlparse
from streamlink.exceptions import StreamError
from streamlink.stream.ffmpegmux imp... |
"""
This script runs the FlaskDeepServer application using a development server.
"""
from os import environ
from FlaskDeepServer import app
import logging
if __name__ == '__main__':
logging.basicConfig(level=logging.DEBUG,
format='%(asctime)s %(filename)s[line:%(lineno)d] %(levelname)s %(message)s... |
#!/usr/bin/env python
# coding: utf-8
"""Controllers for HebPhonics."""
# native
import os
from inspect import cleandoc
# lib
from flask import jsonify, render_template, request
from sqlalchemy.sql import and_, or_
from sqlalchemy.sql.expression import desc, false, func
from markdown import markdown
# pkg
from .. im... |
import os
import pytest
# import re
import testinfra.utils.ansible_runner
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
@pytest.mark.parametrize('pkg', [
'curl',
'sshpass',
])
def test_pkg(host, pkg):
package = host.package(pkg)
... |
import requests
import threading
import re
enableips = []
class IsEnable(threading.Thread):
def __init__(self, ip):
super(IsEnable, self).__init__()
self.ip = ip
self.proxies = {
'http': 'http://%s' % ip
}
def run(self):
global enableips
try:
... |
from math import sqrt
import torch
import torch.nn.functional as F
from torch.autograd import Variable
from torch.utils import data as data
from torchvision import transforms as transforms
from data.datasets import MNIST_truncated, FEMNIST, FashionMNIST_truncated, SVHN_custom, CIFAR10_truncated, Generated
... |
from .EasyKernelBalancing import KernelBalancing
|
"""
Tests for the threading module.
"""
import test.support
from test.support import (verbose, import_module, cpython_only,
requires_type_collecting)
from test.support.script_helper import assert_python_ok, assert_python_failure
import random
import sys
import _thread
import threading
import... |
'''
To be run from root folder as misc/corpus_freq.py
Generates the biases from given corpus and places in data folder
uses spacy backend.
to setup:
pip install -U spacy[cuda92]
python -m spacy download en
'''
import json
import numpy as np
import sng_parser
import codecs
from tqdm import tqdm
VG_SGG_DICT_FN = "da... |
import uuid
import discord
from discord.ext import commands
from discord_slash import cog_ext, ComponentContext
from bot import my_database
from tabulate import tabulate
from customEmbed import LadEmbed
from xp_calculator import XpCalculator
from discord_slash.utils import manage_components
from discord_slash.model im... |
# -*- coding: utf-8 -*-
""" Python test discovery, setup and run of test functions. """
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import collections
import fnmatch
import inspect
import os
import sys
import warnings
from functools import partial
from t... |
from dataclasses import dataclass
from typing import Any, Iterable, Sequence
import tensorflow as tf
from ...annotations import Range
from ...utils.typeshed import StrPath
from ..translation_engine import TranslationEngine
from ..translation_result import TranslationResult
from ..translation_result_builder import Tra... |
import calendar
import datetime
import mock
import pytz
from testify import setup, run, assert_equal, TestCase
from testify import assert_gte, assert_lte, assert_gt, assert_lt
from testify import setup_teardown
from tests import testingutils
from tron import scheduler
from tron.config import schedule_parse, config_ut... |
#!/usr/bin/env python
#coding:utf-8
import PFoE
import rospy
import os
import random
import math
import sys
from raspimouse_ros.msg import LightSensorValues
from gazebo_msgs.msg import ModelStates
from geometry_msgs.msg import Twist
def sensors_callback(message):
rospy.loginfo("message:%s",message)
rf = mess... |
# Copyright 2015 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 ... |
import time
import json
import orjson
import rapidjson
import ujson
import simplejson
import hyperjson
import simdjson
num = 10**6
m = {
"timestamp": 1556283673.1523004,
"task_uuid": "0ed1a1c3-050c-4fb9-9426-a7e72d0acfc7",
"task_level": [1, 2, 1],
"action_status": "started",
"action_type": "main",... |
"""
A wrapper around the 32-bit Windows `kernel32.dll
<https://www.geoffchappell.com/studies/windows/win32/kernel32/api/>`_ library.
Example of a server that loads a 32-bit Windows library, `kernel32.dll <kernel_>`_,
in a 32-bit Python interpreter to host the library. The corresponding :mod:`~.kernel64`
module can be ... |
# Generated by Django 3.1.3 on 2020-12-27 11:39
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('users', '0002_auto_20201... |
"""
Scripts specific to dealing with motion, in particular motion retargeting of mixamo data. Relies on Blender
2.79 API.
"""
import bpy
import logging
import re
LOG = logging.getLogger(__name__)
def detect_bone_prefix(bones):
"""
Mixamo data tends to prefix bone names with character names or other prefixes.... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2018, Michael Chigaev.
#
# F1bw is free software; you can redistribute it and/or modify
# it under the terms of the 3-Clause BSD License; see LICENSE.txt
# file for more details.
#
#
# Developers, install with:
# pip install -r requirements.txt
# python setup.py develop
#... |
import unittest
import StringIO
from seekstream import SeekableStream
class Test(unittest.TestCase):
def setUp(self):
self.text = "01234567890\ntwo\nthree"
f = StringIO.StringIO(self.text)
f.secret_seek = f.seek
f.secret_tell = f.tell
f.seek = lambda: None
f.tell = l... |
base_dir = '/storage/work/tks5206/' # Change to your base folder
height = 180
width = 180
batch_size = 32
max_epochs = 5
base_model = 'vgg16'
|
# coding: utf-8
import pprint
import re
import six
from huaweicloudsdkcore.sdk_response import SdkResponse
class DeleteApplicationConfigurationResponse(SdkResponse):
"""
Attributes:
openapi_types (dict): The key is attribute name
and the value is attribute type.
a... |
from app import db
from hashlib import md5
class User(db.Model):
""" Classe da tabela de usuários
"""
__tablename__ = "users"
user_id = db.Column(db.Integer, primary_key=True)
username = db.Column(db.String, unique=True)
password = db.Column(db.String)
email = db.Column(db.String, unique... |
# coding=utf-8
# Copyright Studio Ousia and The HuggingFace Inc. 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 b... |
"""
This is our testing framework.
Goals:
* it should be compatible with py.test and operate very similarly
(or identically)
* doesn't require any external dependencies
* preferably all the functionality should be in this file only
* no magic, just import the test file and execute the test functions, that's it
* po... |
#!/usr/bin/venv python3
'email-examples.py - demo creation of email messages'
from email.mime.image import MIMEImage
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from smtplib import SMTP
# multipart alternative: text and html
def make_mpa_msg():
email = MIMEMultipart('alter... |
# 트라이를 저장할 노드 선언
class TrieNode:
def __init__(self):
self.word = False
self.children = {}
# 트라이 연산을 구현할 클래스 선언
class Trie:
def __init__(self):
self.root = TrieNode()
def insert(self, word):
node = self.root
for char in word:
i... |
# Generated by Django 3.1.13 on 2021-07-16 16:28
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("nautobot_version_control", "0002_branchmeta"),
]
operations = [
migrations.CreateModel(
name="Conflicts",
fields=[
... |
class LineSearch:
def __init__(self,
f,
max_f_eval=1000,
m1=0.01,
a_start=1,
tau=0.9,
min_a=1e-16):
"""
:param f: the objective function.
:param max_f_eval: (integer scalar, optio... |
#!/usr/bin/env python3
"""
Exercise 13.4 from Serre "Linear Representations of Finite Groups ", 1977.
"""
import sys, os
import numpy
from element import Linear, Z, Q
from action import mulclose
M = Linear(4, Q)
def quaternion(a, b, c, d):
# build matrix representation of quaternion
A = M.get([
[... |
import re
from flask import Flask
from flask import render_template
from flask import url_for
from flask import request
from twilio import twiml
from twilio.util import TwilioCapability
from translate import Translator
# Declare and configure application
app = Flask(__name__, static_url_path='/static')
app.config.f... |
import discord
from discord.ext import commands
from core.classes import Cog_Extension
import asyncio, time, datetime, pytz, random
import json
with open("config.json", mode="r", encoding="utf8") as jfile:
conf = json.load(jfile)
class Game(Cog_Extension):
@commands.command()
async def nitro(self, ct... |
# Copyright 2012 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. Citrix Systems, Inc.
# reserves all rights not expressly granted by the License.
# You may obtain a copy of the License at http://www.apache.org/lic... |
import re
import requests
import six
import urllib3
from ipa_command_args_options import IPA_COMMAND_ARGS_OPTIONS
from st2common.runners.base_action import Action
urllib3.disable_warnings()
requests.packages.urllib3.disable_warnings() # pylint: disable=no-member
CONNECTION_OPTIONS = [
'server',
'username',
... |
import json
from io import TextIOWrapper, UnsupportedOperation
from json import JSONDecodeError
import os
class Config:
def __init__(self, log):
self.log = log
if not os.path.exists("config.json"):
self.log("config.json not found, creating new one")
with open("config.json",... |
import json
import logging
import os
import shutil
from collections import OrderedDict
import pytest
from dvc.exceptions import (
MetricDoesNotExistError,
NoMetricsFoundError,
NoMetricsParsedError,
OverlappingOutputPathsError,
)
from dvc.main import main
from dvc.path_info import PathInfo
from dvc.rep... |
import matplotlib.pyplot as plt
import numpy as np
plt.axis([0,4,0,2])
plt.xlabel("τ")
X = np.linspace(np.pi/6, np.pi, 256, endpoint = True)
A = 0.5*np.cos(3 * X) + 1
plt.plot(X,A)
plt.plot([1.5,3.5],[0.2,1])
plt.text(2.2,1.5,"f(τ)",fontsize = 15)
plt.text(3.5,1.1,"h(t-τ)",fontsize = 15)
plt.show()
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.