text stringlengths 2 999k |
|---|
from datetime import datetime
# EJRV = example json receive valid
# EJMV = example json model valid
# ESJRV = example strong json receive valid
# ESJMV = example strong json model valid
# EJCERT = example json custom error response types
# EJCERF = example json custom error response fields
EJRV_001 = {
'uid': 1,
... |
import requests
import json
BASE = "http://127.0.0.1:5000/"
response = requests.get(BASE + "/c/")
print(f"DATA: {response.json()}")
with open("companies-data-serialize.json","w") as json_file:
json.dump(response.json(),json_file) |
"""
=============================================================
Spatial algorithms and data structures (:mod:`scipy.spatial`)
=============================================================
Nearest-neighbor Queries
========================
.. autosummary::
:toctree: generated/
KDTree - *Class* for efficient nea... |
print("Solution A",5%10+10<50 and 29>=29)
print("Solution B",7**2<=5//9%3 or 'bye'<'BYE')
print("Soultion C",5%10<8 and -25>1*8//5)
print("Solution D",7**2//4+5>8 or 5!=6)
print("Solution E",7/4<6 and 'I am fine' > 'I am not fine')
print("Solution F",10+6*2**2!=9//4-3 and 29>=29/9)
print("Solution G",'hello'*5>'h... |
'''
Author : @anushkrishnav
Built using : networkx since it is a gold standard for Python DAGs (and other graphs). You can create a networkx directed graph with a list of tuples that represent the graph edges:
'''
import networkx as nx
from matplotlib import pyplot as plt
class DAG:
def __init__(self):
... |
# -*- coding: utf-8 -*-
from setuptools import setup
short_description = 'Python library for interacting with the Amazon MWS API'
try:
from pypandoc import convert
long_description = convert("README.md", 'rst')
except (ImportError, OSError): # either pypandoc or pandoc isn't installed
long_description = ... |
from collections import OrderedDict
from utility.printable import Printable
# Inheritance Printable
class Transaction(Printable):
"""
A transaction which can be added to a block in the blockchain.
Attributes:
:sender: The sender of the coins.
:recipient: The recipient of the coins.
... |
#!/usr/bin/env python
# -*- encode: utf-8 -*-
#Copyright 2015 RAPP
#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 applicabl... |
import os
import sys
import pandas as pd
import pytest
import numpy as np
import api.define_alleles as Define_Alleles
from api.algorithm_instance import AlgorithmInstance
import api.recrudescence_utils as recrudescence_utils
from api.recrudescence_file_parser import RecrudescenceFileParser
# NOTE: Makes this reliant... |
"""
Command-line script to process text files
"""
import sys
import argparse
from typing import List
from pii_manager import VERSION
from pii_manager.api import process_file
def parse_args(args: List[str]) -> argparse.Namespace:
parser = argparse.ArgumentParser(
description=f"Perform PII processing on ... |
from .optimizer import DARTSOptimizer
from .searcher import Searcher
|
# -*- coding: utf-8 -*-
# Generated by Django 1.10 on 2017-05-23 02:22
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('beds', '0006_auto_20170520_1641'),
]
operations = [
migrations.CreateModel(
... |
# coding: utf-8
# Copyright (c) 2015 Fabian Barkhau <fabian.barkhau@gmail.com>
# License: MIT (see LICENSE file)
from gravur.common.abstractscrollview import AbstractScrollView
from gravur.contacts.contactpreview import ContactPreview
from gravur.utils import load_widget
@load_widget
class ContactScrollView(Abstrac... |
import numpy as np
import logging
logging.basicConfig(filename='spaselmm.log', level=logging.DEBUG)
###
# Input Arguments
###
# X: n x p input matrix, where n is the number of samples, and p is the number of variables. X cannot be sparse.
# Z: n x m covariate data matrix
# y: Vector of length n containing phenotype
... |
from django.urls import reverse
from rest_framework import status
from rest_framework.test import force_authenticate
from core.models import UserModel
from recycle.models import Location
from recycle.views.location import LocationDetailsAPIView
from tests.unittests.common import APIFactoryTestCase
class LocationDeta... |
from httprunner.loader import load_folder_files, load_test_file
from httprunner.make import format_pytest_with_black, make_testcase, make_testsuite
from loguru import logger
from sentry_sdk import capture_message
from httprunner.compat import ensure_cli_args, ensure_testcase_v3_api
import os
import pytest
from httprunn... |
__version__ = '1.3.3'
|
import os
from urllib.parse import urlparse
from flask import Blueprint, redirect, request, url_for
from flask_sp.saml.auth import AuthenticationManager
blueprint = Blueprint('books', __name__, url_prefix='/books')
IDP_HOSTNAME = os.environ.get('IDP_HOSTNAME', 'idp.hilbertteam.net')
IDP_ENTITYID = os.environ.get('... |
# ///////////////////////////////////////////////////////////////
#
# BY: WANDERSON M.PIMENTA
# PROJECT MADE WITH: Qt Designer and PySide6
# V: 1.0.0
#
# This project can be used freely for all uses, as long as they maintain the
# respective credits only in the Python scripts, any information in the visual
# interface ... |
import cvxopt
from cvxopt.base import matrix
import numpy as np
import utils
def cvxopt_solve_qp(P, q, G=None, h=None, A=None, b=None):
"""
Wrapper for CVXOPT solver:
min [ 1/2 (x^T P x) + q^T x ]
s.t G x <= h and A x = b
:return: ndarray solution
"""
args = [matrix(P), matrix... |
# Copyright 2020 Huawei Technologies Co., Ltd
#
# 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... |
#!/usr/bin/env python
"""
comparatorGenesWrapper.py
dent earl, dearl (a) soe ucsc edu
1 November 2011
Simple wrapper to perform an evaluation
using mafComparator and bed files for gene
annotations
"""
##################################################
# Copyright (C) 2009-2011 by
# Dent Earl (dearl@soe.ucsc.edu, den... |
#!/usr/bin/env python3
# Copyright © 2019 Intel Corporation
# 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
# to use, copy, modif... |
"""Primitive floating and fixed-point types.
A pfloat.float_t is an atomic type that is used to describe real numbers within a
complex data structure. This is used to describe the different components
of a floating-point number that are encoded according to the ieee-754 standard.
A float_t includes space for defining ... |
class Config:
def __init__(self):
self.de = None
self.population = None
self.problem = None
self.size = 0
self.dimensions = 0
self.f = 0.5
self.cr = 0.9
self.function_evaluations_budget = 0
self.evaluations_budget_left = self.function_evaluatio... |
# BSD 3-Clause License
#
# Copyright (c) 2017, Science and Technology Facilities Council and
# The University of Nottingham
# 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... |
from django.contrib.auth import get_user_model
from django.db import models
from .restaurant import Restaurant
class Vote(models.Model):
restaurant = models.ForeignKey(Restaurant, on_delete=models.CASCADE)
user = models.ForeignKey(get_user_model(), on_delete=models.CASCADE)
def __str__(self):
ret... |
# qubit number=5
# total number=56
import cirq
import qiskit
from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister
from qiskit import BasicAer, execute, transpile
from pprint import pprint
from qiskit.test.mock import FakeVigo
from math import log2,floor, sqrt, pi
import numpy as np
import networkx as ... |
import sys, os.path
import math
dir_nodo = (os.path.abspath(os.path.join(os.path.dirname(__file__), '..','..')) + '\\EXPRESION\\EXPRESION\\')
sys.path.append(dir_nodo)
ent_nodo = (os.path.abspath(os.path.join(os.path.dirname(__file__), '..','..')) + '\\ENTORNO\\')
sys.path.append(ent_nodo)
c3d_dir = (os.path.abspath... |
# Generated by Django 3.1.4 on 2020-12-10 23:34
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('paintings', '0008_auto_20201208_1905'),
]
operations = [
migrations.AddField(
model_name='painting',
name='price',
... |
"""Tests for distutils.unixccompiler."""
import sys
import unittest
from test.test_support import run_unittest
from distutils import sysconfig
from distutils.unixccompiler import UnixCCompiler
class UnixCCompilerTestCase(unittest.TestCase):
def setUp(self):
self._backup_platform = sys.platform... |
from System import *
from System.IO import *
from System.Windows import *
from clr import *
import System
import System.Windows
class $rootnamespace$: # namespace
class $safeitemrootname$:
"""type(Root) == System.Windows.Window"""
__slots__ = [ 'Root' ]
def __init__(sel... |
import py
import subprocess
import sys
import pytest
import _pytest
MODSET = [
x
for x in py.path.local(_pytest.__file__).dirpath().visit("*.py")
if x.purebasename != "__init__"
]
@pytest.mark.parametrize("modfile", MODSET, ids=lambda x: x.purebasename)
def test_fileimport(modfile):
# this test ensur... |
# Copyright 2018 Mathias Burger <mathias.burger@gmail.com>
#
# SPDX-License-Identifier: MIT
from typing import Callable
import gimp
from pgimp.gimp.parameter import get_json
def open_xcf(filename):
"""
:type filename: str
:rtype: gimp.Image
"""
return gimp.pdb.gimp_xcf_load(0, filename, filenam... |
# Copyright 2003 by Bartek Wilczynski. All rights reserved.
# This code is part of the Biopython distribution and governed by its
# license. Please see the LICENSE file that should have been included
# as part of this package.
"""
Classes for pparsing AlignAce and CompareACE files
"""
from Bio.ParserSupport import *... |
# Copyright [2019] [Microsoft 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 agr... |
#!/usr/bin/env python
"""
Validation
==========
"""
import numpy as np
import pandas as pd
from scipy.sparse import csr_matrix
from implicitmf._utils import _sparse_checker
def hold_out_entries(X, hold_out_size=0.2, seed=None):
"""
Generates a sparse array of training examples by masking a random subset of va... |
'''OpenGL extension ARB.get_proc_address
This module customises the behaviour of the
OpenGL.raw.GLX.ARB.get_proc_address to provide a more
Python-friendly API
The official definition of this extension is available here:
http://www.opengl.org/registry/specs/ARB/get_proc_address.txt
'''
from OpenGL import pl... |
"""Test variable lookup when stopped in inline functions."""
from __future__ import print_function
import os
import time
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
class InlinesTestCase(TestBase):
mydir = TestBase.compute_mydir(... |
from setuptools import setup, find_packages
with open('README.md') as f:
readme = f.read()
with open('LICENSE') as f:
license = f.read()
setup(
name='QSMResGAN',
version='2.0.0',
description='Implementation with TF 2.0',
long_description=readme,
author='Francesco Cognolato',
author_em... |
'''net_set.py imports functions from net_gargoyle.py to create a new gargoyle.db and nethash table then insert current state.'''
import net_gargoyle as netg
netg.createtable()
netg.interact()
netg.insertstat()
|
#!/usr/bin/env python3
import pytest
DOCKER_CMD = "docker run --rm -i devops-tools:latest"
# demonstrate that we can use go to get/build/run
GO_CMD = "set -e;go get github.com/go-training/helloworld;find / -type d -name helloworld -print;go install github.com/go-training/helloworld;find / -type f -name helloworld -pri... |
import json
from schematics import Model
from schematics.types import StringType, FloatType
from slim.utils.schematics_ext import JSONListType, JSONDictType, JSONType
def test_json_list():
class MyModel(Model):
a = JSONListType(StringType)
a = MyModel({'a': [1, 2, 3]})
a.validate()
b = MyM... |
# -*- encoding: utf-8 -*-
#
# Copyright © 2012 New Dream Network, LLC (DreamHost)
# Copyright © 2013 Intel corp.
# Copyright © 2013 eNovance
#
# Author: Yunhong Jiang <yunhong.jiang@intel.com>
# Julien Danjou <julien@danjou.info>
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not ... |
# -----------------------------------------------------------------------------
# Copyright (c) 2014--, The Qiita Development Team.
#
# Distributed under the terms of the BSD 3-clause License.
#
# The full license is in the file LICENSE, distributed with this software.
# ------------------------------------------------... |
from schemdraw import Drawing
from schemdraw import elements as elm
from .input import Input
def draw_void():
drawing = Drawing()
transistor = drawing.add(elm.transistors.JFetP().right().reverse())
drawing += elm.SourceV().at(transistor.drain).up().label('Vdd').reverse()
drawing += elm.Ground().lef... |
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
# codes for ggplot like backgroud
# http://messymind.net/making-matplotlib-look-like-ggplot/
# Or simply import seaborn
favorite_colors=["deepskyblue", "limegreen", "orangered", "cyan", "magenta",
"gold", "blueviolet", "dodgerblue"... |
from typing import Union, List, Optional
from pyspark.sql.types import StructType, StructField, StringType, ArrayType, DataType
# This file is auto-generated by generate_schema so do not edit manually
# noinspection PyPep8Naming
class ConceptMap_ElementSchema:
"""
A statement of relationships from one set of... |
"""Support for Leaf Spy."""
import asyncio
import hmac
import logging
from aiohttp.web import Response
import voluptuous as vol
from homeassistant.components.http.view import HomeAssistantView
from homeassistant.config_entries import SOURCE_IMPORT, ConfigEntry
from homeassistant.core import callback, HomeAssistant
f... |
#!/usr/bin/env python
# -*- coding:utf-8 -*-
from __future__ import division, absolute_import, print_function, unicode_literals
from typing import Optional, Union
import math
import torch
from torch import nn
from model.encoder_internal import BasePrefixAwareLayer, BaseLogitAdjustableLayer
from model.hashembed impor... |
# -*- coding: utf-8 -*-
from openprocurement.tender.core.utils import optendersresource
from openprocurement.tender.openua.views.contract import TenderUaAwardContractResource as TenderAwardContractResource
@optendersresource(
name="simple.defense:Tender Contracts",
collection_path="/tenders/{tender_id}/contra... |
'''
WorkerPool and WorkerBase for handling the common problems in managing
a multiprocess pool of workers that aren't done by multiprocessing.Pool,
including setup with per-process state, debugging by putting the worker
on the main thread, and correct handling of unexpected errors, and ctrl-C.
To use it,
1. Put the pe... |
# MiniLight Python : minimal global illumination renderer
#
# Harrison Ainsworth / HXA7241 and Juraj Sukop : 2007-2008, 2013.
# http://www.hxa.name/minilight
from math import sqrt
from vector3f import Vector3f, ZERO, ONE, MAX
from random import Random
import re
SEARCH = re.compile('(\(.+\))\s*(\(.+\))\s*(\(.+\))\... |
from agents.base_agent import BaseAgent
from random import shuffle
from os import getcwd
from utils import trans_table_utils as ttu
class PVAgentTrans(BaseAgent):
def __init__(self, color, heuristic, maximum_depth):
super().__init__(color)
self.heuristic = heuristic
self.maximum_depth = ma... |
"""The base entity for the scraper component."""
import logging
from abc import abstractmethod
from typing import Any
from homeassistant.core import callback
from homeassistant.helpers.entity import Entity
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator
from .const import CONF_ON_ERROR_VALU... |
# Copyright 2016-2018 CERN for the benefit of the ATLAS collaboration.
#
# 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... |
from django.urls import path
from . import views
urlpatterns = [
path('report/', views.report, name='report'),
path('report/graph-api/', views.dependency_graph_api, name='graph-api')
]
|
# coding: utf-8
from message.api import MessageService
from thrift.transport import TSocket
from thrift.transport import TTransport
from thrift.protocol import TBinaryProtocol
from thrift.server import TServer
import smtplib
from email.mime.text import MIMEText
from email.header import Header
sender = 'imoocd@163.com... |
import gym
import universe
import random
#reinforcement learning step
def determine_turn(turn, observation_n, j, total_sum, prev_total_sum, reward_n):
#for every 15 iterations, sum the total observations, and take the average
#if lower than 0, change the direction
#if we go 15+ iterations and get a reward each ste... |
#!/usr/bin/env python3
# Copyright (c) 2014-2017 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test resurrection of mined transactions when the blockchain is re-organized."""
from test_framework.te... |
# Made by Mr. - Version 0.3 by DrLecter
import sys
from com.l2jfrozen.gameserver.model.quest import State
from com.l2jfrozen.gameserver.model.quest import QuestState
from com.l2jfrozen.gameserver.model.quest.jython import QuestJython as JQuest
qn = "156_MillenniumLove"
RYLITHS_LETTER_ID = 1022
THEONS_DIARY_ID = 1023
... |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.4 on 2016-03-13 09:30
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('wagtailcore', '0023_alter_page_revision_... |
import torch
import torch.nn as nn
from _C import roi_align_forward
from _C import roi_align_backward
class _ROIAlign(torch.autograd.Function):
@staticmethod
def forward(ctx, input, rois, spatial_scale, output_size, sampling_ratio, aligned):
"""
Performs Region of Interest (RoI) Align operator ... |
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
from typing import Optional, Dict, Tuple, Union, Set
class AMString(object):
def __init__(self, string):
self.string = []
if isinstance(string, AMString):
# make a copy
self.string = [{ch: pos[ch] for ch in pos} for pos in st... |
# (c) 2005 Ian Bicking and contributors; written for Paste (http://pythonpaste.org)
# Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
"""Python 2<->3 compatibility module"""
import sys
def print_(template, *args, **kwargs):
template = str(template)
if args:
template ... |
# -*- coding: utf-8 -*-
'''
:codeauthor: :email:`Jochen Breuer <jbreuer@suse.de>`
'''
# Import Python Libs
from __future__ import absolute_import
from contextlib import contextmanager
# Import Salt Testing Libs
from tests.support.mixins import LoaderModuleMockMixin
from tests.support.unit import TestCase, skipIf... |
import os
import pandas as pd
import math
from tqdm import tqdm
def process_data(l, pd, name):
print(f"Processing {name} data...")
mean, std = pd.mean(axis = 1), pd.std(axis = 1)
for i in tqdm(range(len(pd.index))):
sum = 0
cnt = 0
for j in pd.iloc[i]:
if abs(j - ... |
# 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... |
from setuptools import setup
setup(name='Chatbot',
version='1.0',
description='External relations chatbot Utilities',
author='Mohammed Alnakhli',
author_email='2229683a@student.gla.ac.uk',
url='',
packages=['COMMONTOLS','COMMONTOLS.config', 'COMMONTOLS.functions'],
) |
from .sketch_model import (
get_client,
get_client_by_uuid,
get_user,
get_user_by_login,
get_user_id,
put_access_token,
get_access_token,
token_owner,
put_session,
pop_session,
get_session... |
import gateway.queue
numpy_sql = gateway.queue.NumpyFile(
channels = {65534},
start_delay = 0,
file_path = '/home/heta/Z/data/files/',
config_filepath = '/home/heta/Z/app/python/dogger/',
config_filename = 'conf.ini')
numpy_sql.run()
|
# Copyright (c) Facebook, Inc. and its affiliates.
#
# 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 ... |
############### Blackjack Project #####################
#Difficulty Normal 😎: Use all Hints below to complete the project.
#Difficulty Hard 🤔: Use only Hints 1, 2, 3 to complete the project.
#Difficulty Extra Hard 😭: Only use Hints 1 & 2 to complete the project.
#Difficulty Expert 🤯: Only use Hint 1 to complete th... |
# Copyright 2015 Mirantis 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... |
"""
Low level socket utilities.
Pyro - Python Remote Objects. Copyright by Irmen de Jong (irmen@razorvine.net).
"""
import os
import platform
import socket
import errno
import time
import select
import ipaddress
import weakref
from typing import Union, Optional, Tuple, Dict, Type, Any
try:
import ssl
except Impo... |
# -*- coding: utf-8 -*-
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('devilry_group', '0015_auto_20160111_1245'),
]
operations = [
migrations.AlterField(
model_name='feedbackset',
name='feedbackset_type',
... |
# -*- coding: utf-8 -*-
"""
Created on Fri Nov 20 10:18:04 2020
@author: Hugo
"""
import stim
import plots
import LIF
import numpy as np
import matplotlib.pyplot as plt
from tqdm import tqdm
import matplotlib
matplotlib.rcParams['pdf.fonttype'] = 42
matplotlib.rcParams['ps.fonttype'] = 42
# Parameters
## Simulati... |
import numpy as np
import networkx as nx
import scipy.sparse as sp
from sklearn import preprocessing
from .. import register_model
from ..base_model import BaseModel
@register_model("grarep")
class GraRep(BaseModel):
@staticmethod
def add_args(parser):
"""Add model-specific arguments to the parser."""... |
from __future__ import print_function, absolute_import, division # makes these scripts backward compatible with python 2.6 and 2.7
# Importing the base class
from time_integration_base_scheme import TimeIntegrationBaseScheme
# Importing tools
from co_simulation_tools import ValidateAndAssignDefaults
# Other imports... |
# -*- 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
#... |
from pycalphad import variables as v
from pycalphad.plot.binary.compsets import BinaryCompset, CompsetPair
from pycalphad.plot.binary.map import map_binary
from pycalphad.plot.binary.zpf_boundary_sets import TwoPhaseRegion, ZPFBoundarySets
from pycalphad.tests.fixtures import select_database, load_database
@select_da... |
#!/usr/bin/env python
#_*_coding:utf-8_*_
import argparse
import re
from codes import *
if __name__ == '__main__':
parser = argparse.ArgumentParser(usage="it's usage tip.",
description="Generating various numerical representation schemes for protein sequences")
parser.add_argument("--file", required=True,... |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft and contributors. 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 ... |
import json
import indy.anoncreds
import indy.blob_storage
import pytest
from asynctest import TestCase as AsyncTestCase, mock as async_mock
from ....config.injection_context import InjectionContext
from ....issuer.base import BaseIssuer, IssuerError
from ....issuer.indy import IndyIssuer
from ....ledger.base impor... |
# -*- 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
#... |
from .deque import *
from .rec_array import *
|
from ..resources.I18nResources import I18nLanguageListResponse, I18nRegionListResponse
from googleapiclient.discovery import Resource
class I18n:
def __init__(self, client: Resource) -> None:
self.client = client
def list_languages(self):
req = self.client.i18nLanguages().list(part='sn... |
from django.conf import settings
from django.db.models import Q
from django.shortcuts import get_object_or_404
from rest_framework import generics, serializers, status
from kitsune.products.models import Product, Topic
from kitsune.sumo.api_utils import GenericAPIException, LocaleNegotiationMixin
from kitsune.wiki.mo... |
from __future__ import unicode_literals
from moto.core.exceptions import RESTError
class RepositoryNotFoundException(RESTError):
code = 400
def __init__(self, repository_name, registry_id):
super(RepositoryNotFoundException, self).__init__(
error_type="RepositoryNotFoundException",
... |
import pybullet as p
import time
import pybullet_data
import math as m
import numpy as np
import matplotlib.pyplot as plt
physicsClient = p.connect(p.GUI)
p.setAdditionalSearchPath(pybullet_data.getDataPath())
p.setGravity(0,0,-10)
planeId = p.loadURDF("../plane/plane.urdf")
robotStartPos = [0,0,0.2]
robotStartOrient... |
import logging
from pylons.controllers.util import abort, redirect_to
from kwmo.lib.strings import message_codes_map
from kwmo.lib.base import BaseController, render
from kwmo.lib.uimessage import ui_warn
log = logging.getLogger(__name__)
class MessageController(BaseController):
# Show generic message and/or er... |
#
# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
# its licensors.
#
# For complete copyright and license terms please see the LICENSE at the root of this
# distribution (the "License"). All use of this software is governed by the License,
# or, if provided, by the license below or th... |
from __future__ import print_function
import math
import sys
import logging
logger = logging.getLogger('mortgage')
def get_current_rate(years):
logger.debug('Fetching current interest rate for %d years', years)
rate = 5.3 # Stub external service call
logger.debug('Service returned interest rate %f', rat... |
# 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 -*-
"""
Defines log curves.
:copyright: 2016 Agile Geoscience
:license: Apache 2.0
"""
from __future__ import division
import numpy as np
from scipy.interpolate import interp1d
import matplotlib.pyplot as plt
import matplotlib as mpl
from matplotlib.patches import PathPatch
import warnings
from... |
#
# Copyright (c) 2016-2021 Wind River Systems, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
from django.utils.translation import ugettext_lazy as _
import horizon
from openstack_dashboard.api import base
from openstack_dashboard.dashboards.admin import dashboard
class SoftwareManagement(horizon.Panel):
name ... |
"""
Collection of functions for manipulating colour representations.
Includes functions for reading from the robot's colour sensors.
"""
from ._colour import *
__all__ = [
"CS",
"random",
"randomHue",
"rgb",
"pick",
"hsv",
"hue",
"blend",
"readAllSensors",
"readSensor",
"sen... |
# -*- coding: utf-8 -*-
import unittest
from hotxlfp import Parser
class TestStatistical(unittest.TestCase):
def test_average(self):
p = Parser(debug=True)
ret = p.parse('AVERAGE(1)')
self.assertEqual(ret['result'], 1)
self.assertEqual(ret['error'], None)
# with an array
... |
# -*- 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 or... |
from typing import Optional, Callable, Union, List
from dataclasses import replace
from ...config_types import (
Falsifiable,
ScriptType,
ScriptStorage,
ScriptBool,
ScriptKeys,
AnkiModel,
AnkiTmpl,
ScriptInsertion,
ScriptText,
LabelText,
MetaScript,
ConcreteScript,
I... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.