text stringlengths 1 927k |
|---|
# 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... |
# coding: utf-8
from esengine.bases.py3 import * # noqa
from dateutil import parser
from datetime import datetime
from six import string_types
from esengine.bases.field import BaseField
from esengine.exceptions import ValidationError, FieldTypeMismatch
from esengine.utils.validation import FieldValidator
__all__ = [
... |
import numpy
data = numpy.array(
[[968., 205.69, 120.6, -38.29, -81., -28.4, 33.12, 41.77],
[89.13, 224.38, 132.1, -56.46, -102.6, -36.72, 39.05, 47.77],
[-4.85, 58., 47.38, -62.13, -67.61, -21.83, 22.13, 23.34],
[-111.6, -23.74, -2.54, -36.53, -19.46, -1.74, 0.23, -3.56],
[-7... |
"""
A simple pre-processing file for converting raw OpenFOAM data to
PyTorch tensors. This makes reading the data by the neural network
signifcantly faster. Additionally, depending on the flow, spacial
averages can be taken to increase smoothness of R-S fields.
===
Distributed by: Notre Dame CICS (MIT Liscense)
- Asso... |
import numpy as np
import general_robotics_toolbox as rox
from scipy.optimize import lsq_linear
def update_ik_info3(robot_rox, T_desired, q_current): # inverse kinematics that uses Least Square solver
# R_d, p_d: Desired orientation and position
R_d = T_desired.R
p_d = T_desired.p
d_q = q_current
... |
# Copyright 2018-2021 Jakub Kuczys (https://github.com/jack1142)
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... |
#!/usr/bin/env python3.8
from user_class import Credentials
from user_class import User
def create_user(lock_owner, lock_key):
'''
function to create a new user
'''
new_user = User(lock_owner, lock_key)
return new_user
def save_user(data):
'''
function to save a new us... |
"""
Code borrowed from https://github.com/shubhtuls/toe/blob/master/data/base.py
Base data loading class.
Should output:
- img: B X 3 X H X W
- mask: B X H X W
- kp (optional): B X nKp X 2
- sfm_pose (optional): B X 7 (s, tr, q)
(kp, sfm_pose) correspond to image coordinates in [-1, 1]
"""
from __f... |
#! /usr/bin/env python3
import sys
from datetime import datetime
import mysql.connector
from mysql.connector import errorcode
DEF_SEC_OVERHEAD = 10
class EventDB(object):
db_targets = {}
def Connect(self, conf):
db_dsn = {
'user': conf['db_user'],
'password': conf['db_pass... |
from mythic_payloadtype_container.MythicCommandBase import *
from mythic_payloadtype_container.MythicRPC import *
import json
class ShellArguments(TaskArguments):
def __init__(self, command_line):
super().__init__(command_line)
self.args = {
"command": CommandParameter(
... |
from drf_yasg import openapi
from drf_yasg.utils import swagger_auto_schema
from rest_framework import mixins
from rest_framework.viewsets import GenericViewSet
from genui.accounts.serializers import FilterToUserMixIn
from genui.projects.serializers import FilterToProjectMixIn
from genui.models.genuimodels.bases impor... |
# -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'ImageURLContainer'
db.create_table(u'dashboard_imageurlco... |
# coding: utf-8
"""
UltraCart Rest API V2
UltraCart REST API Version 2 # noqa: E501
OpenAPI spec version: 2.0.0
Contact: support@ultracart.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class AutoOrderQueryBatch(obje... |
import unittest
from mock import Mock, call
from torchbearer.metrics import RunningMean, Metric, RunningMetric, Mean, Std, Var
import torch
class TestVar(unittest.TestCase):
def test_variance_dim(self):
var = Var('test', dim=0)
var.process(torch.Tensor([[1., 2.], [3., 4.]]))
var.process... |
import csv
import emoji
import numpy as np
emoji_dictionary = {"0": "\u2764\uFE0F", "1": ":baseball:", "2": ":smile:", "3": ":disappointed:", "4": ":fork_and_knife:"}
def read_glove_vecs(glove_file):
with open(glove_file, encoding="utf8") as f:
words = set()
word_to_vec_map = {}
for line i... |
from setuptools import setup, find_packages
with open("README.md", "r") as fh:
long_description = fh.read()
setup(name='benchbot_addons',
version='2.1.1',
author='Ben Talbot',
author_email='b.talbot@qut.edu.au',
description=
'The BenchBot Add-ons Manager for use with the BenchBot sof... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""The setup script."""
from setuptools import setup, find_packages
with open('README.rst') as readme_file:
readme = readme_file.read()
with open('HISTORY.rst') as history_file:
history = history_file.read()
with open('requirements.txt') as reqs_file:
reqs ... |
# Copyright 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.apache.org/licenses/LICENSE-2.0
#
# Unless requ... |
from flask import request, Response
import DbInteractions.userLogin as ul
import DbInteractions.dbhandler as dbh
import json
# Delete endpoint, takes in a login token, upon success it deletes row from user session table(logs user out). If success returns true, return a response of None.
def delete():
success = F... |
import unittest
from quarkchain.config import (
ConsensusType,
POWConfig,
ShardConfig,
RootConfig,
QuarkChainConfig,
)
class TestShardConfig(unittest.TestCase):
def testBasic(self):
config = QuarkChainConfig()
config.ROOT = RootConfig()
config.ROOT.CONSENSUS_TYPE = Con... |
"""
Craft only the skeleton of a menu for the following two examples
where the suite of code to execute should exist instead should be a comment saying what it would do.
Add the keyword word "pass" beneath each comment to avoid syntax errors
Remember to use keywords like: if, elif, else, and input
"""
# Enrollment Exa... |
from PIL import Image, ImageOps
import sys
import argparse
parser = argparse.ArgumentParser()
parser.add_argument("input", help="input image to be scaled")
parser.add_argument("factor", type=int, help="scaling factor")
args = parser.parse_args()
image_name = args.input
scale = args.factor
original_image = Image.open... |
# -*- coding: utf-8 -*-
#
# 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
#... |
"""
Joint PGI of Gravity + Magnetic on an Octree mesh using full petrophysical information
======================================================================================
This tutorial shows through a joint inversion of Gravity and Magnetic data on an
Octree mesh how to use the PGI framework introduced in Asti... |
# -*- encoding: utf-8 -*-
from autosklearn.constants import *
from autosklearn.pipeline.classification import SimpleClassificationPipeline
from autosklearn.pipeline.regression import SimpleRegressionPipeline
__all__ = [
'get_configuration_space',
'get_class',
]
def get_configuration_space(info,
... |
# Copyright 2018 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
__author__ = 'nicococo'
import numpy as np
from numba import autojit
class SvddPrimalSGD(object):
""" Primal subgradient descent solver for the support vector data description (SVDD).
Author: Nico Goernitz, TU Berlin, 2015
"""
PRECISION = 10**-3 # important: effects the threshold, support vector... |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2016-07-27 11:10
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('inventory', '0002_auto_20160727_1909'),
]
operations = [
migrations.AlterModelTable(... |
# -*- coding:utf-8 -*-
"""
Author:
Weichen Shen,wcshen1994@163.com
Reference:
[1] Liu Q, Yu F, Wu S, et al. A convolutional click prediction model[C]//Proceedings of the 24th ACM International on Conference on Information and Knowledge Management. ACM, 2015: 1743-1746.
(http://ir.ia.ac.cn/bitstream/173211... |
from .base import BaseOptions, BaseType
from .unmountedtype import UnmountedType
# For static type checking with Mypy
MYPY = False
if MYPY:
from .objecttype import ObjectType # NOQA
from typing import Iterable, Type # NOQA
class UnionOptions(BaseOptions):
types = () # type: Iterable[Type[ObjectType]]
... |
#!/usr/bin/env python3
import asyncio
import websockets
import json
import random
import time
import numpy as np
URI = "wss://api-proxy.auckland-cer.cloud.edu.au/dynamic_network_graph"
#URI = "ws://api-proxy.auckland-cer.cloud.edu.au:6789"
#URI = "ws://localhost:6789"
SESSION_ID = "STRESS_TEST"
connections = []
asyn... |
import ast
from core.models.Mongo import Mongo
from core.config import logger
from core.tools import wrap_response
from errors.exceptions import ExpertaBackendError
from experta import (AND, AS, EXISTS, FORALL, MATCH, NOT, OR, TEST, DefFacts,
KnowledgeEngine, Rule)
from experta.fieldconstraint impo... |
from _htnorm import hyperplane_truncated_mvnorm, structured_precision_mvnorm
__version__ = '2.0.0' |
# Copyright (C) 2018-2022 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import numpy as np
import pytest
from common.onnx_layer_test_class import OnnxRuntimeLayerTest
class TestMeanVarianceNormalization(OnnxRuntimeLayerTest):
def _prepare_input(self, inputs_dict):
for input in inputs_dict.keys... |
# _*_ coding:utf-8 _*_
'''
csv文件的合并和去重
主要是针对测试用例增加使用此脚本
'''
import pandas as pd
import glob
#输出文件
outputfile = '/Users/huaan720/Downloads/百度网盘/xmind2testcase-master/docs/case_csvfile/new.csv'
#合并csv的文件夹
csv_list = glob.glob('/Users/huaan720/Downloads/百度网盘/xmind2testcase-master/docs/case_csvfile/*.csv')
print(u'共发现%s个C... |
result = 0
a = 2 ** 31 - 1
p = 826
for i in range(127):
p = (p * 8505) % a
p = (p * 129749 + 12345) % a
b = p % 10000
result = b
with open("output1.txt", "w") as output:
output.write(str(result))
print(str(result)) |
import io
import os
from distutils.core import setup
from setuptools import find_packages
dir = os.path.dirname(__file__)
with io.open(os.path.join(dir, 'README.md'), encoding='utf-8') as f:
long_description = f.read()
setup(name='py_vollib_vectorized',
version='0.1.1',
description='A fast, vectoriz... |
from django.contrib import admin
from .models import Profile, Post
# Register your models here.
admin.site.register(Profile)
admin.site.register(Post) |
# coding: utf-8
# -----------------------------------------------------------------------------------
# <copyright company="Aspose">
# Copyright (c) 2018 Aspose.Slides for Cloud
# </copyright>
# <summary>
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associa... |
load(
"@io_bazel_rules_kotlin//kotlin:kotlin.bzl",
_kt_android_library = "kt_android_library",
_kt_js_import = "kt_js_import",
_kt_js_library = "kt_js_library",
_kt_jvm_import = "kt_jvm_import",
_kt_jvm_library = "kt_jvm_library",
_kt_jvm_test = "kt_jvm_test",
)
kt_android_library = _kt_and... |
#!/usr/bin/env python3
"""
image_matcher adjusts image contrast based on two image samples.
Copyright 2021, Mitch Chapman All rights reserved
"""
import numpy as np
class ChannelAdjuster:
def __init__(self, src_sample, target_sample, channel, vmin, vmax):
src = src_sample.astype(np.float64)
targ... |
import time
import dlib
import cv2
# Đọc ảnh đầu vào
image = cv2.imread('test_image/anhgai.jpg')
# Khai báo việc sử dụng các hàm của dlib
hog_face_detector = dlib.get_frontal_face_detector()
# Thực hiện xác định bằng HOG và SVM
start = time.time()
faces_hog = hog_face_detector(image, 1)
end = time.time()
print("Hog... |
from __future__ import division
import copy
import logging
import numbers
import os
import sys
import re
import math
#dict
class Banner(dict):
""" """
ordered_items = ['mgversion', 'mg5proccard', 'mgproccard', 'mgruncard',
'slha', 'mggenerationinfo', 'mgpythiacard', 'mgpgscard',
... |
import os
import uuid
import inspect
from distutils.version import LooseVersion
from setup_app import paths
from setup_app.utils import base
from setup_app.config import Config
from setup_app.utils.db_utils import dbUtils
from setup_app.utils.progress import jansProgress
from setup_app.utils.printVersion import get_w... |
###############################################################################
# WaterTAP Copyright (c) 2021, The Regents of the University of California,
# through Lawrence Berkeley National Laboratory, Oak Ridge National
# Laboratory, National Renewable Energy Laboratory, and National Energy
# Technology Laboratory ... |
import os
from h5py._hl.files import File
import numpy as np
import xml.etree.ElementTree as ET
import time
from scipy.linalg import dft
import numpy.matlib
import matplotlib.pyplot as plt
import matplotlib
from PyOCT import CAO
import re
import h5py
from scipy.linalg.misc import norm
from scipy.signal import f... |
import logging
import os
import uuid
from typing import Any, Dict, List, Optional, Union, cast
from great_expectations.util import get_sqlalchemy_inspector
try:
from typing import Final
except ImportError:
# Fallback for python < 3.8
from typing_extensions import Final
import click
from great_expectatio... |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import six
from six import iteritems, text_type
from six.moves import range
import time, _socket, poplib, imaplib, email, email.utils, datetime, chardet, re
from email_reply_parse... |
from haven import haven_utils as hu
import itertools, copy
EXP_GROUPS = {}
EXP_GROUPS['pascal_point_level'] = hu.cartesian_exp_group({
'batch_size': 1,
'num_channels':1,
'dataset': [
{'name':'pascal'}
... |
class OperatorNotFoundException(Exception):
pass
class FieldNotFoundException(Exception):
pass |
from django.db import models
from django.utils import timezone
class BaseQuerySet(models.QuerySet):
def restore(self):
self.update(deleted_at=None)
return self
def soft_delete(self):
self.update(deleted_at=timezone.now())
return self
class UserQuerySet(BaseQuerySet):
def... |
# Note: there is no way in Fusion style to prevent that the header text of the active row/column gets bold.
headerview_style = '''
QHeaderView {
border: 0px;
background: palette(dark);
padding: 0px;
margin: 0px;
}
QTableView QTableCornerButton::section {
background-color: palette(button);
borde... |
from django.conf.urls import url
from .views import (
RadioPlayAPIView, PlayerCommandAPIView, RadioListAPIView,
PlayerStatusAPIView, MP3PlaylistAPIView
)
urlpatterns = [
url(r'^player/status/$', PlayerStatusAPIView.as_view(), name='status'),
url(r'^player/command/$', PlayerCommandAPIView.as_view(), na... |
from pytest import raises
from notario import engine
from notario.exceptions import Invalid, SchemaError
from notario.validators import recursive, iterables, types
from notario.decorators import optional
from notario.tests import util
class TestEnforce(object):
def test_callable_failure_raises_invalid(self):
... |
# Copyright (C) 2019 The Raphielscape Company LLC.
#
# Licensed under the Raphielscape Public License, Version 1.c (the "License");
# you may not use this file except in compliance with the License.
#
""" Userbot module for kanging stickers or making new ones. Thanks @rupansh"""
import io
import math
import random
imp... |
import pyodbc
#####
'''
Instructions to install on Microsoft ODBC Driver for SQL Server on Linux
1. find Linux Distribution of your machine:
'cat /etc/issue'pyt
2. sudo su
3. curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add -
4. #Download appropriate package for the OS version
#Cho... |
"""Nox sessions."""
import shutil
import sys
from pathlib import Path
from random import randint
from textwrap import dedent
import nox
try:
from nox_poetry import Session
from nox_poetry import session
except ImportError:
message = f"""\
Nox failed to import the 'nox-poetry' package.
Please inst... |
# coding=utf8
# Copyright 2018 JDCLOUD.COM
#
# 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 ... |
from xml.etree import cElementTree as ElementTree
from django.conf import settings
from django.http import HttpResponseRedirect
from django.utils.six import text_type
from django.utils.six.moves.urllib.request import Request, urlopen
from .models import Transaction
def _get_setting(name):
return getattr(settings... |
# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserve.
#
#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... |
from time import sleep
import RPi.GPIO as GPIO
from utils.enums import DirectionX, DirectionY
PWM_FREQ = 100
MOTORS_IDS = ("RIGHT", "LEFT")
GPIO.setmode(GPIO.BOARD)
GPIO.setwarnings(False)
# Setup Pins for the motor controller (I'm using TB6612FNG H-Bridge)
GPIO.setup(12, GPIO.OUT) # PWMA
GPIO.setup(16, GPIO.OUT... |
"""Test local RabbitMQ service.
Tests marked with `docker` require access to working docker instance (socket or host). Make sure to disable them
on instances missing docker.
"""
import pytest
from ostorlab.runtimes.local.services import mq
@pytest.mark.docker
def testLocalRabbitMQStart_onOperationalConditions_rabb... |
"""
Copyright 2019 Goldman Sachs.
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 di... |
# Copyright 2015 Amazon.com, Inc. or its affiliates. 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. A copy of
# the License is located at
#
# https://aws.amazon.com/apache2.0/
#
# or in the "license" file accomp... |
# Copyright 2013-2020 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 PyTraitsui(PythonPackage):
"""The TraitsUI project contains a toolkit-independent GUI abstraction
layer, wh... |
from cStringIO import StringIO
import os
from string import punctuation
from urllib import unquote
from zipfile import ZipFile
from django.core.files.base import ContentFile
from django.core.files.storage import default_storage
from django.db import models
from django.utils.translation import ugettext_lazy as _
from ... |
from django.conf import settings
API_BOARD = {
'id': 1,
'name': 'Service A',
'locationId': 1,
'businessUnitId': 10,
'inactiveFlag': False,
'projectFlag': False
}
API_BOARD_LIST = [API_BOARD]
API_BOARD_STATUS_LIST = [
{
'id': 1,
'name': 'New',
'board': {
... |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Wed Apr 26 14:19:06 2017
@author: drsmith
"""
from ...lib.datasources import LOGBOOK_CREDENTIALS
def _get_logbook_credentials(self):
credentials = LOGBOOK_CREDENTIALS[self._name]
with open(credentials['loginfile'], 'r') as f:
f.readline() #... |
# -*- coding: utf-8 -*-
from matplotlib.patches import Patch
from matplotlib.pyplot import axis, legend
from ....Functions.init_fig import init_fig
from ....definitions import config_dict
ROTOR_COLOR = config_dict["PLOT"]["COLOR_DICT"]["ROTOR_COLOR"]
STATOR_COLOR = config_dict["PLOT"]["COLOR_DICT"]["STATOR_COLOR"]
... |
import pytest
import asyncio
from starkware.starknet.testing.starknet import Starknet
from utils import Signer
signer = Signer(123456789987654321)
@pytest.fixture(scope='module')
def event_loop():
return asyncio.new_event_loop()
@pytest.fixture(scope='module')
async def ownable_factory():
starknet = await ... |
#!/usr/bin/env vpython
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import fnmatch
import os
import sys
import tempfile
import unittest
import zipfile
sys.path.insert(
0, os.path.abspath(os.path.jo... |
# validando formato float, digito um número 4 e vai apresentar 4.0
n = float(input('Digite um valor: '))
print(n)
#como inserir um texto e se podemos transformar em numero, true ou false
n1 = input('Digite algo: ')
print(n1.isnumeric())
# como validar se é letra
n2 = input('Digite outra coisa: ')
print(n2.isalpha())
... |
# Copyright lowRISC contributors.
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
# SPDX-License-Identifier: Apache-2.0
import random
from typing import Dict, List, Tuple
class InitData:
'''Initialised data, written to the random binary to be loaded.'''
def __init__(self, values: D... |
from pathlib import Path
basename = "test_all_items_role"
html_filename = basename + ".html"
def test_base_name_in_html(app):
app.build()
html = Path(app.outdir / html_filename).read_text()
assert basename in html
def test_all_items_html_contains_value(app):
app.build()
html = Path(app.outdir / ... |
# Copyright 2011 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.apache.org/licenses/LICENSE-2.0
#
# Unless requ... |
import requests
import logging
logging.basicConfig(format='[PYTHON] %(levelname)s:%(message)s', level=logging.DEBUG)
class JSonTest:
def __init__(self):
self.status_code = 0
def getip(self):
resp = requests.get("http://ip.jsontest.com/")
self.status_code = resp.status_code
i... |
# coding: utf-8
"""
Layered Insight Scan
Layered Insight Scan performs static vulnerability analysis, license and package compliance. You can find out more about Scan at http://layeredinsight.com.
OpenAPI spec version: 0.9.4
Contact: help@layeredinsight.com
Generated by: https://github.com/swagg... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import json
import random
try:
from urlparse import urlparse
except ImportError: # For Python 3
from urllib.parse import urlparse
from .__burp__ import BURP
from . import database
from .utils import Format, FileNotFoundException, ConnectionException
fro... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from collections import defaultdict
import inspect
from textwrap import dedent
from typing import Dict, Text, List, Tuple, Type, Sequence, Any
import numpy as np # type... |
from typing import Dict
import math
import torch
from torch import nn
from fvcore.nn import sigmoid_focal_loss_jit
from detectron2.layers import ShapeSpec
# from adet.layers import conv_with_kaiming_uniform
# from adet.utils.comm import aligned_bilinear
from densepose.layers import conv_with_kaiming_uniform
from den... |
#!/usr/bin/python
#
#DFZ 11/15/2016: it's hard to control the chunk size read from the
# stream() interface, see run_mri_stream.output for a concrete idea.
#
#the following import block is for testing only
import dipy.core.gradients as dpg
import os.path as op
from dipy.segment.mask import median_otsu
import nibabel ... |
from __future__ import print_function
import sys
import csv
from datetime import datetime
from dateutil import parser
from googleapiclient.discovery import build
from reportlab.lib import colors
from reportlab.lib.pagesizes import letter
from reportlab.lib.styles import getSampleStyleSheet
from reportlab.lib.units im... |
power = {'BUSES': {'Area': 1.33155,
'Bus/Area': 1.33155,
'Bus/Gate Leakage': 0.00662954,
'Bus/Peak Dynamic': 0.0,
'Bus/Runtime Dynamic': 0.0,
'Bus/Subthreshold Leakage': 0.0691322,
'Bus/Subthreshold Leakage with power gating': 0.0259246,
'Gate... |
import json
import traceback
from datetime import datetime
from pathlib import Path
import aiohttp
import aredis
import asyncpg
import discord
from discord.ext import commands
from utils.custom_context import CustomContext
class QTBot(commands.Bot):
def __init__(self, config_file, *args, **kwargs):
self... |
import logging
from django.conf import settings
from django.utils.dateparse import parse_datetime
from django_filters.rest_framework import DjangoFilterBackend
from drf_yasg import openapi
from drf_yasg.utils import swagger_auto_schema
from eth_account.account import Account
from rest_framework import filters, status... |
#Faça um programa que receba dois números inteiros e gere os números inteiros que
# estão no intervalo compreendido por eles.
n1 = int(input("Digite um número inteiro: "))
n2 = int(input("Digite outro número inteiro: "))
for n in range((n1 +1),n2):
print(n) |
from foronoi.algorithm import Algorithm as Voronoi
from foronoi.graph.coordinate import Coordinate
from foronoi.graph.bounding_box import BoundingBox
from foronoi.graph.point import Point
from foronoi.graph.polygon import Polygon
from foronoi.visualization import Visualizer
from foronoi.observers.tree_observer import T... |
#
# Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved.
#
# NVIDIA CORPORATION and its licensors retain all intellectual property
# and proprietary rights in and to this software, related documentation
# and any modifications thereto. Any use, reproduction, disclosure or
# distribution of this software and r... |
# -*- coding: utf-8 -*-
#
# Copyright 2012 James Thornton (http://jamesthornton.com)
# BSD License (see LICENSE for details)
#
"""
Bulbs is a Python persistence framework for graph databases.
Bulbs is a Python client library for Neo4j Server and Rexster,
Rexster is a REST server that provides access t... |
n=int(input("Input a Number: "))
List=range(-1,n*n+9,2)
i=2
while List[i:]:List=sorted(set(List)-set(List[List[i]::List[i]]));i+=1
print(List[1:n+1]) |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Mar 18 11:01:22 2020
@author: twallema
Copyright (c) 2020 by T.W. Alleman, BIOMATH, Ghent University. All Rights Reserved.
"""
import numpy as np
import pandas as pd
from random import choices
import scipy
from scipy.integrate import odeint
import math... |
#!/usr/bin/env python
# -*- coding:utf-8 -*-
import urllib
import requests
from bs4 import BeautifulSoup
"""
https://wenku.baidu.com/browse/getrequest?doc_id=a1eec6289b6648d7c1c7468f&pn=22&rn=1&type=ppt&callback=bd__cbs__s5lw72
https://wenku.baidu.com/browse/getrequest?doc_id=a1eec6289b6648d7c1c7468f&pn=23&rn=1&type... |
try:
from twisted.internet.protocol import Factory, Protocol
from twisted.internet import defer
from twisted.internet.endpoints import TCP4ClientEndpoint
try: # Twisted >= 13.0 for IPv6 support
from twisted.internet.endpoints import HostnameEndpoint
except ImportError:
from twisted.i... |
# encoding: utf-8
"""Unit-test suite for the `pptx.opc.packuri` module."""
import pytest
from pptx.opc.packuri import PackURI
class DescribePackURI(object):
"""Unit-test suite for the `pptx.opc.packuri.PackURI` objects."""
def it_can_construct_from_relative_ref(self):
pack_uri = PackURI.from_rel_r... |
import matplotlib.pyplot as plt
import numpy as np
def format_plot(func):
def func_wrapper(*args):
func(*args)
plt.ylabel("Intensity [dBm]")
plt.xlabel("Wavelength [nm]")
plt.tight_layout()
plt.show()
return func
return func_wrapper
def format_ani_plot(func):... |
from __future__ import division
import warnings
from sympy import Abs, Rational, Float, S, Symbol, cos, pi, sqrt, oo
from sympy.functions.elementary.trigonometric import tan
from sympy.geometry import (Circle, Ellipse, GeometryError, Point, Point2D, Polygon, Ray, RegularPolygon, Segment, Triangle, are_similar,
... |
from django.db import models
from pygments.lexers import get_all_lexers
from pygments.styles import get_all_styles
from pygments.lexers import get_lexer_by_name
from pygments.formatters.html import HtmlFormatter
from pygments import highlight
LEXERS = [item for item in get_all_lexers() if item[1]]
LANGUAGE_CHOICES = s... |
# built-in
from pathlib import Path
# project
from dephell.commands import ProjectBuildCommand
from dephell.config import Config
def test_build_command(requirements_path, temp_path: Path):
(temp_path / 'project').mkdir()
(temp_path / 'project' / '__init__.py').touch()
metainfo_path = str(requirements_pa... |
from r_starargsonly import spam
spam()
spam(42)
spam("one", 2, "buckle my shoe") |
#
# 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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.