text stringlengths 2 999k |
|---|
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.constant.ParamConstants import *
class AlipayDataBillBalanceQueryModel(object):
def __init__(self):
self._bill_user_id = None
@property
def bill_user_id(self):
return self._bill_user_id
@bill_user_id.sett... |
from django.core.exceptions import ImproperlyConfigured
class SelectRelatedMixin(object):
"""
Mixin allows you to provide a tuple or list of related models to
perform a select_related on.
"""
select_related = None # Default related fields to none
def get_queryset(self):
if self.selec... |
from task2vec import Task2Vec
from models import get_model
import datasets
import task_similarity
import argparse
import torch
import torch.nn.functional as F
import torchvision.transforms as tt
from tqdm import tqdm
from synbols_utils import Synbols
def _similarity_matrix(attrs, epsilon = 1e-8):
norm = attrs.nor... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
gaetk2/tools/http.py - simple HTTP API wraping `requests`.
based on huTools.http (c) 2010-2014, 2016-2017.
Created by Maximillian Dornseif on 2017-06-26.
Copyright (c) 2010-2014, 2016-2017 HUDORA. MIT licnsed.
"""
from __future__ import unicode_literals
import loggin... |
import abc
import PyQt5.QtCore
from .observer import Observer
class BridgeProperty(PyQt5.QtCore.pyqtProperty):
def __init__(self, value, name='', type_=None, notify=None):
if type_ and notify:
super().__init__(type_, self.getter, self.setter, notify=notify)
self.value = valu... |
"""Provide an abstract test case class for yWriter import and export.
Import/export standard test routines used for regression tests.
For further information see https://github.com/peter88213/PyWriter
Published under the MIT License (https://opensource.org/licenses/mit-license.php)
"""
import os
from shutil i... |
import pytest
from snovault import UPGRADER
pytestmark = [pytest.mark.setone, pytest.mark.working]
@pytest.fixture
def file_1(award, lab):
return{
"schema_version": '1',
"award": award['@id'],
"lab": lab['@id'],
}
@pytest.fixture
def file_w_extra_1(award, lab):
return{
... |
import datetime
from functools import wraps
import os
import json
from pkg_resources import resource_filename
import astropy.constants as constants
from astropy.coordinates import SkyCoord
from astropy.extern.six.moves import StringIO
import astropy.table as at
import astropy.units as u
from bokeh.resources import INL... |
#!/usr/bin/env python2
#
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
from test_framework.mininode import *
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import *
import time
'''... |
#
# Copyright (C) 2010-2017 Samuel Abels
# The MIT License (MIT)
#
# 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,... |
# -*- coding: utf-8 -*-
# Copyright 2015 Objectif Libre
#
# 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 ... |
# -*- coding: utf-8 -*-
"""
Password generator to generate a password based on the specified pattern.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2018 - 2019 by rgb-24bit.
:license: MIT, see LICENSE for more details.
"""
from .__version__ import __version__, __... |
#!/usr/bin/env python2
# Copyright (c) 2014-2018 The Bitcoin Core developers
# Copyright (c) 2015-2018 The PIVX developers
# Copyright (c) 2018 The Tpc developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# Test -reindex w... |
# util/__init__.py
# Copyright (C) 2005-2014 the SQLAlchemy authors and contributors <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
from .compat import callable, cmp, reduce, \
threading, py3k, py33, py2k, jython... |
dataset_type = 'CityscapesVPSDataset'
data_root = 'data/cityscapes_vps/'
img_norm_cfg = dict(
mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True)
train_pipeline = [
dict(type='LoadRefImageFromFile'),
dict(type='LoadAnnotations', with_bbox=True, with_mask=True,
with_seg=True, wi... |
import asyncio
import re
import pytest
from dagster import (
AssetKey,
AssetMaterialization,
Failure,
Field,
InputDefinition,
Noneable,
Output,
OutputDefinition,
RetryRequested,
Selector,
build_solid_context,
composite_solid,
execute_solid,
pipeline,
resource... |
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import (
compat_urllib_parse_unquote,
compat_urllib_parse_unquote_plus,
)
from ..utils import (
clean_html,
ExtractorError,
)
class PlayvidIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?playvi... |
from glnext_compiler import glsl
import pytest
import numpy as np
def test_transform_input_output(instance):
task = instance.task()
transfrom = task.compute(
compute_count=8,
compute_shader=glsl('''
#version 450
#pragma shader_stage(compute)
layout (binding... |
# Copyright 2017 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... |
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for the I{hosts(5)}-based resolver, L{twisted.names.hosts}.
"""
from __future__ import division, absolute_import
from twisted.trial.unittest import SynchronousTestCase
from twisted.python.filepath import FilePath
from twisted.internet.... |
from wagtail.core.permission_policies.collections import (
CollectionOwnershipPermissionPolicy)
from wagtailvideos import get_video_model
from wagtailvideos.models import Video
permission_policy = CollectionOwnershipPermissionPolicy(
get_video_model(),
auth_model=Video,
owner_field_name='uploaded_by_u... |
from app import app, db
from app.models import User
from datetime import datetime
import os
import sys
print('Number of arguments:', len(sys.argv), 'arguments.')
print('Argument List:', str(sys.argv))
if len(sys.argv) == 3:
print('Let us proceed');
username = sys.argv[1];
password = sys.argv[2];
print... |
class misDatos:
def __init__(self,carne,nombre):
self.carne=carne
self.nombre=nombre
def dump(self):
return{
'carne': self.carne,
'nombre':self.nombre
} |
from insights.parsers import yum
from insights.parsers.yum import YumRepoList
from insights.parsers import SkipException, ParseException
from insights.tests import context_wrap
import doctest
import pytest
YUM_REPOLIST_CONTENT = """
Loaded plugins: product-id, search-disabled-repos, subscription-manager
repo id ... |
import unittest
from user import User
class TestUser(unittest.TestCase):
'''
Test class that defines test cases for user class behaviours
'''
new_user=User("Brian","12345")
def SetUp(self):
self.new_user = User ("Brian","12345")
def tearDown(self):
'''
Function that clear... |
"""Aggregates processed Land Registry Price Paid Data.
Filters standard entries (category type A), groups by property type and
administrative district, and computes the median price.
"""
import numpy
import pandas
from src import PROCESSED_DIR
PROCESSED_PP_DIR = PROCESSED_DIR / "price_paid_data"
AGGREGATED_PP_DIR = ... |
"""Recurrent architecture used for heart rate estimation from
ballistocardiographic signals.
The RNN features 3 layers with gated recurrent units (GRUs) to obtain a
single output value for an arbitrary lenght input stream.
`create` returns the compiled keras model implementation obtained with
`get`. By default, Adam... |
# Copyright 2022 The OFA-Sys Team.
# All rights reserved.
# This source code is licensed under the Apache 2.0 license
# found in the LICENSE file in the root directory.
import logging
import warnings
import torch
import numpy as np
from data import data_utils
from data.ofa_dataset import OFADataset
logger = loggin... |
from flask_wtf import FlaskForm as Form
from wtforms import PasswordField, StringField, ValidationError
from wtforms.validators import DataRequired, Email, Length, EqualTo, Regexp
import re
class DatasetForm(Form):
title = StringField('title', validators=[DataRequired()])
description = StringField('descriptio... |
#!/usr/bin/python
# coding=utf-8
import json
def formatter(_data, _meta):
"""
将数据转换成用于提交和评分的格式。
:param _data:
参考数据集中 [x]-[set]-with-answer.json 文件的格式,
用参赛系统给 [x]-[dev/test].json 中读出的对象列表添加 judge1 或/和 judge2 字段,
然后直接将添加了答案字段的三个任务dev集(或test集)中的所有数据全都放在一个 List 里,构成此参数。
:param _m... |
import logging
from typing import Type
from ray.rllib.agents.dqn import DQNTrainer, DEFAULT_CONFIG as \
DQN_DEFAULT_CONFIG
from ray.rllib.agents.dqn.r2d2_tf_policy import R2D2TFPolicy
from ray.rllib.agents.dqn.r2d2_torch_policy import R2D2TorchPolicy
from ray.rllib.agents.trainer import Trainer
from ray.rllib.poli... |
"""
EnOcean Component.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/EnOcean/
"""
import logging
import voluptuous as vol
from homeassistant.const import CONF_DEVICE
import homeassistant.helpers.config_validation as cv
REQUIREMENTS = ['enocean==0.31... |
message = "It was a bright cold day in April, and the clocks were striking thirteen."
count = {}
for character in message:
count.setdefault(character, 0)
count[character] += 1
print(count)
|
"""
Django settings for project.
Generated by 'django-admin startproject' using Django 2.2.4.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.2/ref/settings/
"""
import os
# Build p... |
# -*- coding: utf-8 -*-
# doctest: +ELLIPSIS
import collections
from functools import partial
from . import default_expire_time
def _parse_values(values):
(_values,) = values if len(values) == 1 else (None,)
if _values and type(_values) == type([]):
return _values
return values
class Container(... |
from __future__ import annotations
import json
import pickle
from copy import copy
from datetime import date, datetime
from pathlib import Path, PurePath
from typing import Any, ByteString, Callable, Mapping, Optional, Sequence
from typing import Tuple as Tup
from typing import Type, TypeVar, Union
import orjson
impo... |
# Copyright 1999-2021 Alibaba Group Holding 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 a... |
from es_pandas import es_traffic_pandas_csv
def push_to_csv(fileName, index):
# for i in range(1,17):
start = "now-17d"
end = "now"
es_traffic_pandas_csv(fileName, index, start, end)
if __name__ == "__main__":
ind = {
"total": "*",
"dhcp": "bro_dhcp",
"dns": "bro_dns",
"conn": "bro_conn",
"snmp... |
# Generated by Django 3.2.7 on 2021-11-15 03:45
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('ricerca_app', '0024_unitaorganizzativa_ds_mission'),
]
operations = [
migrations.RenameModel(
old_name='FunzioniUnitaOrganizzativa',
... |
# -*- coding: utf-8 -*-
from flask_wtf import Form
from wtforms import StringField, PasswordField, SelectField
from wtforms.validators import InputRequired, Length, ValidationError
class ConfigureWifiForm(Form):
ssid = StringField('Access Point', validators=[
InputRequired(),
Length(min=1, max=32... |
# -*- coding: utf-8 -*-
"""Module for :mod:`aiida_shell.engine.launchers`."""
from .shell_job import launch_shell_job
__all__ = ('launch_shell_job',)
|
from __future__ import absolute_import, print_function
import argparse
import contextlib
import re
import socket
import subprocess
import sys
import pytest
import requests
import bokeh.command.subcommands.serve as scserve
from bokeh.resources import DEFAULT_SERVER_PORT
def test_create():
import argparse
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2012-2021 SoftBank Robotics. All rights reserved.
# Use of this source code is governed by a BSD-style license (see the COPYING file).
""" QiBuild """
from __future__ import absolute_import
from __future__ import unicode_literals
from __future__ import print... |
from flask import render_template,redirect,url_for,flash,request
from flask_login import login_user,logout_user,login_required
from . import auth
from ..models import User
from .forms import RegistrationForm,LoginForm
from .. import db
from ..email import mail_message
@auth.route('/register',methods = ["GET","POST"])
... |
import logging
from flask import flash
from flask_admin._compat import string_types, iteritems
from flask_admin.babel import gettext, ngettext, lazy_gettext
from flask_admin.model import BaseModelView
from flask_admin.model.form import create_editable_list_form
from peewee import PrimaryKeyField, ForeignKeyField, Fi... |
import os
import multiprocessing
import unittest
from shutil import rmtree
import h5py
import numpy as np
from mobie.htm import add_images
from mobie.metadata import read_dataset_metadata
from mobie.validation import validate_view_metadata
class TestGridViews(unittest.TestCase):
test_folder = "./test_data"
r... |
''' A reproduction of `Will Burtin's historical visualization`_ of antibiotic
efficacies.
.. note::
This chart is reproduced as a demonstration of Bokeh's versatile graphics
capabilities, but there are better, simpler ways to present this data.
.. bokeh-example-metadata::
:sampledata: antibiotics
:api... |
# coding=utf-8
# Copyright 2020 Google T5 Authors and 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 requ... |
from abc import ABC, abstractproperty
from datetime import timedelta
from services.database.database import Database
from utils.utils import parse_date
class Filter(ABC, Database):
def __init__(self):
super().__init__()
@abstractproperty
def filtered_orders(self):
pass
class TophatterF... |
# -*- coding: utf-8 -*-
info = {
"name": "zh-Hans",
"date_order": "YMD",
"january": [
"一月",
"1月"
],
"february": [
"二月",
"2月"
],
"march": [
"三月",
"3月"
],
"april": [
"四月",
"4月"
],
"may": [
"五月",
"5月... |
import jax
import numpy as np
import numpy.random as random
import os
import tigerforecast
from tigerforecast.utils import generate_key
from tigerforecast.problems import Problem
from urllib.error import URLError
from urllib.request import urlretrieve
from pathlib import Path
import csv
class ExperimentS... |
from django.contrib import admin
from .models import Trip
@admin.register(Trip)
class TripAdmin(admin.ModelAdmin):
fields = (
'id', 'pick_up_address', 'drop_off_address', 'status',
'driver', 'rider',
'created', 'updated',
)
list_display = (
'id', 'pick_up_address', 'drop... |
# -*- coding: utf-8 -*-
#action and attention (Fdの制約なし)
#python ./learning/action.py '$folder' '$bun' '$trial' '$action
#Akira Taniguchi 2016/06/22-2017/04/12-2017/06/07
import cv2
import os
import sys
import collections
import itertools
import numpy as np
import scipy as sp
import matplotlib.pyplot as plt
from numpy.... |
import fault
import pytest
import magma as m
from pathlib import Path
from .common import pytest_sim_params
def pytest_generate_tests(metafunc):
pytest_sim_params(metafunc, 'system-verilog')
@pytest.mark.xfail(strict=True)
def test_error_task(target, simulator):
class error_task(m.Circuit):
io = m.I... |
#!/usr/bin/env python3
# -*- coding:utf-8 -*-
# Copyright (c) Megvii, Inc. and its affiliates.
import argparse
import random
import warnings
from loguru import logger
import os
import torch
import torch.backends.cudnn as cudnn
from yolox.core import Trainer, launch
from yolox.exp import get_exp
from yolox.utils impor... |
import jovialengine
from monster import Monster
from .modefight import ModeFight
from .modetalkwin3 import ModeTalkWin3
from .modetalkelse3 import ModeTalkElse3
from .modemenu import ModeMenu
class ModeMenu3(ModeMenu):
def _handleButton(self, prev_convo_key, index):
if prev_convo_key == "3aa":
... |
# -*- coding: utf-8 -*-
import numpy as np
from enum import Enum
from abc import ABC, abstractmethod
class TileContent(ABC):
def __init__(self):
self.header = None
self.body = None
def to_array(self):
self.sync()
header_arr = self.header.to_array()
body_arr = self.bod... |
# Copyright 2012 Nebula, 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 agree... |
from django.shortcuts import render
from django.shortcuts import redirect
from django.contrib.auth.models import User
from django.contrib.auth.forms import AuthenticationForm
from django.contrib.auth import logout
from django.contrib.auth import authenticate
from django.contrib.auth import login
from django.urls import... |
# Hook for pycryptodome extensions
hiddenimports = [
'Crypto.Cipher._raw_aes',
'Crypto.Cipher._raw_ctr',
'Crypto.Hash._SHA256',
'Crypto.Util._cpuid',
'Crypto.Util._strxor',
]
|
import matplotlib.pyplot as plt
from matplotlib.colors import LinearSegmentedColormap
import numpy as np
from get_voxel_index import get_voxel_index
from cdirect import cdirect
# Generate stopping power database
SP_water = np.loadtxt("data/SP_water.txt", 'float', '#', None, None, 8)
SP_bone = np.loadtxt("data/SP_bone.... |
# coding: utf-8
import pprint
import re
import six
from huaweicloudsdkcore.sdk_response import SdkResponse
class ListBatchTasksResponse(SdkResponse):
"""
Attributes:
openapi_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (di... |
from turtle import *
def compute_turn_angle(n):
return 180 - (180 * (n - 2)) / n
def draw_ngon(n, sidelength = 100):
for i in range(n):
forward(sidelength)
left(compute_turn_angle(n))
draw_ngon(7)
input()
|
# The isBadVersion API is already defined for you.
# @param version, an integer
# @return an integer
def isBadVersion(version): return True if version>=5 else False
class Solution:
def firstBadVersion(self, n):
"""
:type n: int
:rtype: int
"""
good_index = 0
bad_ind... |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import json
import warnings
import pulumi
import pulumi.runtime
from typing import Union
from .. import utilities, tables
class Group(... |
# encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
db.rename_column(orm.Section._meta.db_table, 'number_str', 'number')
def backwards(self, orm):
db.rename_colu... |
from flask_restx import Namespace, Resource
from mutalyzer_retriever.related import get_related
from .common import errors
ns = Namespace("/")
@ns.route("/related_references/<string:reference_id>")
class RelatedReferences(Resource):
@errors
def get(self, reference_id):
"""Retrieve related reference ... |
from django import forms
from django.contrib.auth.models import User
from django.contrib.contenttypes.models import ContentType
from django.forms.formsets import formset_factory
from django.forms.models import BaseInlineFormSet
from django.forms.models import ModelFormMetaclass, _get_foreign_key
from django.utils.trans... |
# -*- coding: utf-8 -*-
# Copyright (c) 2012-2022 Andrey Vlasovskikh
#
# 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, ... |
import os
import numpy as np
import pandas as pd
import seaborn as sb
from matplotlib import pyplot as plt
from observers import dynamics_traj_observer
from utils import RMS, log_multivariate_normal_likelihood, reshape_pt1, \
reshape_dim1, interpolate
sb.set_style('whitegrid')
# Some useful plotting functions ... |
import os
import sys
from typing import Dict, Set
import setuptools
is_py37_or_newer = sys.version_info >= (3, 7)
package_metadata: dict = {}
with open("./src/datahub/__init__.py") as fp:
exec(fp.read(), package_metadata)
def get_long_description():
root = os.path.dirname(__file__)
with open(os.path.j... |
import sys
from copy import deepcopy
from six import iteritems, string_types, integer_types
import os
import imp
from collections import Iterable, Sequence, Mapping, MutableMapping
import warnings
import numpy as np
import ctypes
import platform
import tempfile
from enum import Enum
from operator import itemgetter
if... |
from machine import I2C
import lcd
import time
from ustruct import unpack, unpack_from
from array import array
#I2C devices:[44, 118]
# i2c_bus = I2C(I2C.I2C0, freq=100*1000, scl=6, sda=7)
# i2c_devs_list = i2c_bus.scan()
# print("I2C devices:" + str(i2c_devs_list))
QMC6983_A1_D1 = 0
QMC6983_E1 ... |
"""The tests for the Google speech platform."""
import os
import shutil
from gtts import gTTSError
import pytest
from homeassistant.components.media_player.const import (
ATTR_MEDIA_CONTENT_ID,
DOMAIN as DOMAIN_MP,
SERVICE_PLAY_MEDIA,
)
import homeassistant.components.tts as tts
from homeassistant.config ... |
import csv
import json
import PySimpleGUI as sg
sg.theme("Dark Blue 5")
frame_layout = [
[sg.Text("Insert route title. "), sg.InputText(key="imp1", size=24)],
[sg.InputText(size=40), sg.FileBrowse(key=6)],
[sg.InputText(key=5, size=40), sg.SaveAs(key=7)],
[sg.Submit(), sg.Cancel()],
]
la... |
# Copyright (c) 2021 zfit
from .core.basepdf import BasePDF
from .models.basic import Exponential
from .models.conditional import ConditionalPDFV1
from .models.convolution import FFTConvPDFV1
from .models.dist_tfp import (Cauchy, Gauss, Poisson, TruncatedGauss, Uniform,
WrapDistribution)... |
# Copyright (c) 2018 NVIDIA Corporation
from __future__ import absolute_import, division, print_function
from __future__ import unicode_literals
import abc
import copy
import six
import tensorflow as tf
from open_seq2seq.optimizers.mp_wrapper import mp_regularizer_wrapper
from open_seq2seq.utils.utils import check_p... |
import matplotlib.pyplot as plt
import numpy as np
def mysinplot(f, fs, n):
x = np.linspace(-n/(2*f),n/(2*f),fs*n)
plt.stem(x,np.sin(2*np.pi*f*x))
plt.title('Sine Wave')
plt.xlabel('Time')
plt.ylabel('Amplitude')
plt.grid(True, which='both')
plt.show()
wave_frequency = int(input("Input Fre... |
#!/usr/bin/env python
import sys
try:
wave = float(sys.argv[1])
except:
print('Enter the wavelength in Angstroms on the command line.')
sys.exit(1) # 1 indicates failure
# sys.exit() is used to indicate success
freq = 3.0e8 / (wave / 1e10)
print('frequency (Hz) = %e' % freq)
|
'''Prompt user for confirmations based on file names, and keeps track of
previous choices.
'''
import tilutil.systemutils as su
class ConfirmManager:
'''Class to prompt user for file operation confirmations, and remember the
patterns for future prompts.
'''
def __init__(self):
self.ap... |
from lib.json_helper import decode_json
def handle_response(sock):
print('handle response')
response_pack = sock.recv(1024)
print('receiving response...')
response = response_pack
while True:
response_pack = sock.recv(1024)
response += response_pack
print('receiving respon... |
"""Tests for Fairing configuration options."""
import pytest
from unittest.mock import patch
import fairing.config as config
from fairing.preprocessors.base import BasePreProcessor
from fairing.preprocessors.converted_notebook import ConvertNotebookPreprocessor
from fairing.builders.append.append import AppendBuilde... |
# These tests are all based on the tutorial at http://killer-web-development.com/
# if registration is successful this may work but lets
# try and get user logged in first
from functional_tests import FunctionalTest, ROOT, USERS
import time
from selenium.webdriver.support.ui import WebDriverWait
class AnswerQuestion... |
import os
import sys
import pickle
import json
class Query:
def __init__(self, evidence=dict(), targets=list(), marginal_evidence=None, type='updating', name='query0', meta_evidence=None, meta_targets=None):
self.evidence = evidence
self.targets = targets
self.marginal_evidence = marginal_e... |
#! /usr/bin/env python
import os
import logging
import pathlib
from datetime import datetime
from os import path
from glob import glob
from tqdm import tqdm
import re
from itertools import repeat
import pandas as pd
import scipy.io as spio
import h5py
import numpy as np
import datajoint as dj
# import pdb
from pip... |
#### 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/wearables/base/shared_base_dress_poofysleeve_lower.iff"
result.attr... |
##
# Author: Tung Thanh Le
# ttungl@gmail.com
##
import random
import os
from collections import defaultdict, deque
import numpy as np
import matplotlib as mpl
import matplotlib
matplotlib.use('agg')
import matplotlib.pyplot as plt
import csv
from icn_gym import *
# from icn_gym import icn_routing_gym
# path = '/ho... |
__all__ = ['mysqlDB']
|
# Copyright 2013: 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 b... |
# Copyright 2017 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 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('questions', '0003_auto_20160711_0450'),
]
operations = [
migrations.RemoveField(
model_name='question',
... |
"""
Configuration settings for the iAHO data capture tool (DCT) developed for AFRO.
"""
from django.utils.translation import ugettext_lazy as _
import os
import dotenv
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
# Add .e... |
"""
=================
Creating a Reader
=================
**Suhas Somnath**
8/28/2020
This document illustrates an example of extracting data out of proprietary raw
data files, thereby describing how one would write a ``sidpy.Reader`` class.
The captured information would be populated into a / set of ``sidpy.Datase... |
#!/usr/bin/env python3
import subprocess
import os
import sys
import json
sys.path.append("../")
sys.path.append("../../system/lib/")
import json_parser
import pos
import cli
import api
import SCAN_DEV_BASIC
def check_result(out1, out2):
list1 = json.loads(out1)['Response']['result']['data']['devicelist']
list... |
import numpy as np
import scipy as sp
from scipy.optimize import leastsq
import matplotlib.pyplot as plt
def real_fun(x):
return np.sin(2*np.pi*x)
def fit_fun(p,x):
f = np.poly1d(p)
return f(x)
def res_fun(p,x,y_real):
ret = fit_fun(p, x)-y_real
return ret
def res_fun_addregular(p,x,y_real):
r... |
import logging
try:
import tensorflow as tf
import tensorflow.keras as k
except ImportError:
tf = None
from lenskit import util
from ..mf_common import MFPredictor
from ..bias import Bias
from .util import init_tf_rng, check_tensorflow
_log = logging.getLogger(__name__)
class BiasedMF(MFPredictor):
... |
from sklearn.model_selection import train_test_split
from sklearn.linear_model import LinearRegression
from sklearn.preprocessing import StandardScaler
import pandas as pd
X = df.drop('target', axis=1)
y = df.target
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=7)
# スケーリング
sc =... |
# This file was automatically generated by SWIG (http://www.swig.org).
# Version 4.0.2
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.
from sys import version_info as _swig_python_version_info
if _swig_python_version_info < (2, 7, 0):
raise Runtime... |
import importlib
import multiprocessing as mp
import os
def _setup_params():
names = os.environ.get("YEA_PARAM_NAMES")
values = os.environ.get("YEA_PARAM_VALUES")
if not names or not values:
return {}
names = names.split(",")
values = values.split(",")
params = dict(zip(names, values))... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.