text stringlengths 2 999k |
|---|
from gym.spaces import Box
from ray.rllib.agents.dqn.distributional_q_tf_model import \
DistributionalQTFModel
from ray.rllib.agents.dqn.dqn_torch_model import \
DQNTorchModel
from ray.rllib.models.tf.fcnet import FullyConnectedNetwork
from ray.rllib.models.torch.fcnet import FullyConnectedNetwork as TorchFC
f... |
# Copyright(C) 1999-2020 National Technology & Engineering Solutions
# of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with
# NTESS, the U.S. Government retains certain rights in this software.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provide... |
from .socket import socket
from .silent_log import dont_print
from .spy_log import Spy_Log
from .time import Time
from .connection import Connection
from .game import *
|
# Generated by Django 2.1.1 on 2018-09-30 01:34
from django.db import migrations
from django.utils import timezone
def forward(apps, schema_editor):
Operative = apps.get_model('operative', 'Operative')
Order = apps.get_model('consumer', 'Order')
# create placeholder operative
operative = Operative.o... |
from oauthlib.oauth2 import WebApplicationClient
from myapp.config import GOOGLE_CLIENT_ID
client = WebApplicationClient(GOOGLE_CLIENT_ID)
|
# -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2015-2020 CERN.
#
# Invenio is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
"""Sphinx configuration."""
import os
import sphinx.environment
from docutils.utils... |
import os
import glob
paths = [
#"./data/thumbnails/*.png",
#"./data/video/*.mp4",
"./data/audio/*.mp3",
".data/video/tmp_video/*.mp4",
"./*.mp4"
]
def cleanup(context):
for path in paths:
files = glob.glob(path)
for f in files:
os.remove(f)
|
# Copyright 2021 Splunk 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 to in writing, soft... |
def extract陽光的夏天(item):
"""
Parser for '陽光的夏天'
"""
vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title'])
if not (chp or vol) or 'preview' in item['title'].lower():
return None
if 'WATTT' in item['tags']:
return buildReleaseMessageWithType(item, 'WATTT', vol, chp, frag=frag, postfix=postfix... |
import torch
print(torch.__version__)
print(torch.cuda.is_available())
import cv2
|
import _plotly_utils.basevalidators
class DthetaValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(self, plotly_name="dtheta", parent_name="scatterpolargl", **kwargs):
super(DthetaValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
[ pybrl ]
Antonis Katzourakis - @ant0nisktz - antonis.cc
LICENSE:
Braille Grade 2 Translation in Python
Copyright (C) 2016 Antonis Katzourakis
This program is free software: you can redistribute it and/or modify
it under the terms o... |
"""Pytest conftest module
In this file you will find all **fixtures** that you are used while running
mgear tests.
Github Actions workflow will run Pytest but because their clusters will not have
Autodesk Maya install / neither PyMel, most of the tests will be skip.
In order to ensure all tests are correctly execute... |
from flask.ext.wtf import Form
from wtforms import TextField, TextAreaField, SubmitField, PasswordField, SelectField
from wtforms.validators import DataRequired
import random
class LoginForm(Form):
"""Form class for user login."""
name = TextField('Username', validators=[DataRequired()])
# remember_me = Bo... |
# -*- coding: latin-1 -*-
"""
Created on Thu Mar 10 17:41:37 2016
@author: Celestin
"""
from Kaafhet.Inter import *
TEAM_ENEMY = WHILD
def once():
global TEAM_ENEMY
if gro.team == TEAM_1:
TEAM_ENEMY = TEAM_2
elif gro.team == TEAM_2:
TEAM_ENEMY = TEAM_1
def loop(turn):
if gro.waffle ... |
import re
from typing import Any, Callable, Dict, List, Optional, Union
from pydantic import BaseModel, validator
from pydash.objects import get
from cfripper.model.enums import RuleMode, RuleRisk
def param_resolver(f):
def wrap(*args, **kwargs):
return f(*(arg(kwargs) for arg in args), **kwargs)
r... |
#### encoding: cp1255 ####
import urllib2
import re
import logging
logger = logging.getLogger("open-knesset.parse_committee_members")
from mks.models import Member
from committees.models import Committee
from django.core.management.base import BaseCommand
class Command(BaseCommand):
args = ''
help = 'Parses... |
from .model import ResidualDenseBlock, ResidualResidualDenseBlock, Discriminator, Generator, ContentLoss
from .dataset import ImageDataset, LMDBDataset |
'''
predicting the stock prices with the help of reinforcement learning
this tutorial goes in step by step procedure and uses q learning
data used: from yahoo finance
author : Bharath Kumar (bharathjatoth.github.io)
Step 1 : import all the libraries which are used by the algo
'''
import keras
import numpy as np
from ke... |
from PyQt5.QtCore import *
from PyQt5.QtWidgets import *
from PyQt5.QtGui import *
from yue.core.explorer.source import DirectorySource
from yue.core.settings import Settings
from yue.qtcommon.explorer.display import ExplorerModel
from yue.qtcommon.explorer.filetable import ExplorerFileTable
from yue.qtcommon.Resourc... |
from django.core.urlresolvers import reverse
from django.http import Http404
from django.shortcuts import render, redirect
from django.views.generic import DetailView, ListView, RedirectView, UpdateView, TemplateView
from coworker.place.models import Place
from coworker.place.forms import PlaceModelForm
from .mixins i... |
# dodo.py
import ast
import asyncio
import contextlib
import dataclasses
import datetime
import functools
import io
import itertools
import json
import os
import pathlib
import re
import shutil
import sys
import textwrap
import typing
import aiofiles
import flit
import git
import packaging.requirements
import pathspec... |
# coding: utf-8
"""
Scubawhere API Documentation
This is the documentation for scubawhere's RMS API. This API is only to be used by authorized parties with valid auth tokens. [Learn about scubawhere](http://www.scubawhere.com) to become an authorized consumer of our API
OpenAPI spec version: 1.0.0
... |
# launcher for various helpful functions found in the settings.xml area
import sys
import xbmc
import xbmcgui
import xbmcvfs
import resources.lib.utils as utils
from resources.lib.authorizers import DropboxAuthorizer
from resources.lib.advanced_editor import AdvancedBackupEditor
def authorize_cloud(cloudProvider):
... |
import torch
from .base_model import BaseModel
class Classifier(BaseModel):
def __init__(self, model, **kwargs):
super(Classifier, self).__init__(**kwargs)
self.model = model
self.model_name = self.model.name
if self.optimizer is not None:
self.optimizer = self.optimizer... |
"""
This module deals with loading features from a dataset.
It will calculate extra features such as the worm length.
"""
from typing import Dict, Tuple
import numpy as np
class Features(object):
def __init__(self, raw_features: dict):
_validate_features(raw_features)
self.skeletons = raw_fea... |
#!/usr/bin/env python3
from pathlib import Path
import argparse
import re
import toml
def get_args():
"""Set up CLI args"""
parser = argparse.ArgumentParser()
parser.add_argument(
"--major",
type=int,
nargs="*",
help="Major version bump. Empty flag will auto bump current v... |
from django.contrib import admin
from transparencyjobs.jobs.models import JobListing
class JobListingAdmin(admin.ModelAdmin):
list_display = ('is_filled','position_type','position','organization','date_published','is_expired')
list_display_links = ('position',)
list_filter = ('position_type','is_filled')
... |
# -*- coding: utf-8 -*-
from os.path import join, dirname
from setuptools import setup, find_packages
VERSION = (7, 1, 0)
__version__ = VERSION
__versionstr__ = '.'.join(map(str, VERSION))
f = open(join(dirname(__file__), 'README'))
long_description = f.read().strip()
f.close()
install_requires = [
'six',
'p... |
# -*- 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
#... |
# 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, ... |
# -*- coding: utf-8 -*-
"""See paper:
[Saad and Schultz, GMRES: A GENERALIZED MINIMAL RESIDUAL ALGORITHM FOR SOLVING NON-SYMMETRIC LINEAR SYSTEMS,
SIAM J. ScI. STAT. COMPUT., 1986]
"""
from tools.linear_algebra.preconditioners.allocator import PreconditionerAllocator
from screws.miscellaneous.timer import MyTimer
... |
import pickle
import numpy as np
import random
import os
import csv
positive_case_list = []
negative_case_list_covid = []
negative_case_list_xray = []
formal_covid_dict = pickle.load(open('./data_preprocess/formal_covid_dict.pkl','rb'))
for key, value in formal_covid_dict.items():
for image_name, info in value['im... |
from sklearn.base import BaseEstimator, TransformerMixin # type: ignore
from typing import List, Any
import pandas as pd
class MinZeroTransform(BaseEstimator, TransformerMixin):
"""
Transforms X to X-X.min(), so that the minimum is shifted to 0.
X.min() is learned in the fit.
"""
def transform(self... |
"""After analysis with WiFeS, this suite of routines can extract a star optimally
and calculate its radial velocity.
WARNING - this code is still not properly documented or complete. Any contributions
welcome!
example lines of code...
Executing from the code directory, e.g. with Margaret's output directory:
rv_proce... |
#!/usr/bin/env python
# Copyright 2014-2020 The PySCF Developers. 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
#
# U... |
"""
Builtin colormaps, colormap handling utilities, and the `ScalarMappable` mixin.
.. seealso::
:doc:`/gallery/color/colormap_reference` for a list of builtin colormaps.
:doc:`/tutorials/colors/colormap-manipulation` for examples of how to
make colormaps.
:doc:`/tutorials/colors/colormaps` an in-depth disc... |
"""Routines and classes for estimation of observables."""
from __future__ import print_function
import copy
import h5py
import numpy
import os
import scipy.linalg
import time
import warnings
from pauxy.estimators.back_propagation import BackPropagation
from pauxy.estimators.mixed import Mixed
from pauxy.estimators.it... |
"""
Copyright (C) 2017-2020 Intel 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 agreed to i... |
from win32api import GetSystemMetrics
from math import sqrt
import numpy as np
import imutils
import cv2
class Obj:
def __init__(self, tup_coor, coor, area, peri, center):
self.tup_coor = tup_coor
self.coor = coor
self.area = area
self.peri = peri
self.center = center
# ... |
# -*- coding: utf-8 -*-
"""
@Time : 16/11/2021 下午9:28
@Auth : Mars
@File :info.py
@IDE :PyCharm
"""
import pygame as pg
import pygame.font
from .. import const_var as cst
from . import coin
from .. import setup, tools
pygame.font.init()
class Info:
'''
这个Info类主要用于实现一些信息的显示和更新
'''
def __init__(self,... |
# coding: utf-8
import pprint
import re
import six
from huaweicloudsdkcore.sdk_response import SdkResponse
class CreatePoolResponse(SdkResponse):
"""
Attributes:
openapi_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict):... |
from __future__ import division
from math import sqrt as sqrt
from itertools import product as product
import torch
class PriorBox(object):
"""Compute priorbox coordinates in center-offset form for each source
feature map.
"""
def __init__(self, args, cfg):
super(PriorBox, self).__init__()
... |
import json
import requests
import numpy
properties = {}
with open("country_data.json") as f:
data = json.load(f)
for c in data:
for k in c["claims"].keys():
if k not in properties:
properties[k] = {"count": 0, "datatypes": [], "values": [], "all": []}
propertie... |
from django.contrib import admin
from django.contrib.auth import admin as auth_admin
from django.contrib.auth import get_user_model
from rookie.users.forms import UserChangeForm, UserCreationForm
User = get_user_model()
@admin.register(User)
class UserAdmin(auth_admin.UserAdmin):
form = UserChangeForm
add_f... |
import glob
import requests
def postSensorData( influxDbAddress, database, data ):
url = influxDbAddress + "/write?db="+database
r = requests.post(url, data)
if (r.status_code > 200 and r.status_code < 300):
print "sensordata posted successfully"
else:
print "statuscode: " + str(... |
import unittest
import tempfile
import json
import numpy as np
import pandas as pd
import os
from numpy.testing import assert_almost_equal
from sklearn import datasets
from supervised.algorithms.decision_tree import (
DecisionTreeAlgorithm,
DecisionTreeRegressorAlgorithm,
)
from supervised.utils.metric import ... |
#!/usr/bin/python
# coding=utf-8
# Copyright 2012-2014 MongoDB, 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 appl... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 5/15/20 4:49 PM
# @File : grover.py
# qubit number=4
# total number=16
import cirq
import cirq.google as cg
from typing import Optional
import sys
from math import log2
import numpy as np
class Opty(cirq.PointOptimizer):
def optimization_at(
... |
class Sip2Wrapper:
""" A wrapper for the Sip2 class that makes sip requests more convenient.
Concept:
- All request/response pairs from the Sip2 class are wrapped into one
method. The wrapped pairs are prefixed with sip_ followed by Sip2 class
(and protocol definition manual) name.
- re... |
# ___ _ ___ ___ _ |
# / _ \ __| |_ ___| _ \/ __| | | Create 8-bit-like games!
# | (_) / _| _/ _ \ _/ (_ |_| | Author: Death_Miner
# \___/\__|\__\___/_| \___(_) | Version: 0.4.0
# |
#
# @ octopg/version.py => Version of this octopg!
octopg_ver = "0.4.0"
octop... |
import pytest
from simpy.core import Environment
from common.collector import DataCollector
@pytest.fixture()
def env() -> Environment:
return Environment()
@pytest.fixture()
def dc() -> DataCollector:
return DataCollector()
|
#### 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 = Building()
result.template = "object/building/poi/shared_tatooine_slaver_large4.iff"
result.attribute_template_id... |
def is_palindrome_v3(s):
""" (str) -> bool
Return True if and only if s is a palindrome.
>>> is_palindrome_v3('noon')
True
>>> is_palindrome_v3('racecar')
True
>>> is_palindrome_v3('dented')
False
>>> is_palindrome_v3('')
True
>>> is_palindrome_v3(' ')
True
"""
... |
"""
Misc. general utility functions, not tied to Kubespawner directly
"""
import os
import yaml
from tornado.httpclient import HTTPRequest
def request_maker():
"""
Return a k8s api aware HTTPRequest factory that autodiscovers connection info
"""
if os.path.exists('/var/run/secrets/kubernetes.io/servi... |
class Document(object):
def __init__(self, table_parser):
self.table_parser = table_parser
self.document = None
def create(self, sql):
table = self.table_parser.parse_table(sql)
table_metadata = self.table_parser.parse_table_metadata(sql)
fields = self.table_parser.parse... |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2013 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.apach... |
"""bubbles URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.0/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based... |
# Copyright 2013 IBM 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 ... |
from collections import OrderedDict
from .attributetable import AttributeTable
from .method import Method
from .constantpool import ConstantType
__all__ = ['MethodTable']
class MethodTable(OrderedDict):
def __init__(self, parent):
OrderedDict.__init__(self)
self._parent = parent
self.re... |
# Copyright 2020 Xilinx 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 to in writing, ... |
# Copyright (c) 2018 Cloudify Platform Ltd. 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 ap... |
'''
Copyright 2022 Airbus SA
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
dist... |
# Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS file in the same directory.
"""
Utilities for downloadi... |
# Generated by Django 2.2.5 on 2019-09-13 09:01
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('user_profile', '0005_auto_20190912_1306'),
]
operations = [
migrations.AlterField(
model_name='profile',
name='name'... |
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: tensorflow/core/framework/tensor.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf im... |
import logging
from mmcv.runner import Runner as _Runner
class Runner(_Runner):
def __init__(self,
model,
batch_processor,
optimizer=None,
work_dir=None,
log_level=logging.INFO,
logger=None,
iter... |
log_level = 'INFO'
load_from = None
resume_from = None
dist_params = dict(backend='nccl')
workflow = [('train', 1)]
checkpoint_config = dict(interval=10)
evaluation = dict(interval=10, metric='mAP', key_indicator='AP')
optimizer = dict(
type='Adam',
lr=5e-4,
)
optimizer_config = dict(grad_clip=None)
# learning... |
'''
Descripttion: Automatically generated file comment
version:
Author: Wesley
Date: 2021-07-27 09:53:43
LastEditors: Wesley
LastEditTime: 2021-08-13 15:35:25
'''
from ctypes import cdll, c_char_p
from .PlatformHelper import PlatformHelper as ph
from wtpy.WtUtilDefs import singleton
import os
@singleton
... |
# Copyright 2019 Open Source Robotics Foundation, 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... |
"""Config-driven font project builder.
This utility wraps fontmake and a number of post-processing fixes to
build variable, static OTF, static TTF and webfonts from Glyphs,
Designspace/UFO or UFO sources.
It should be instantiated with a configuration file, typically ``config.yaml``,
which looks like this::
sour... |
try:
from scape.modules.sql_helper import SESSION, BASE
except ImportError:
raise AttributeError
import threading
from sqlalchemy import Integer, Column, String, UnicodeText, func, distinct, Boolean
DEF_COUNT = 0
DEF_LIMIT = 0
DEF_OBJ = (None, DEF_COUNT, DEF_LIMIT)
class FloodControl(BASE):
__tablename__... |
import numpy as np
import cv2
import glob
import math
def f_sorted(files_, id_sys):
symbol = '\\' if id_sys == 0 else '/'
ids = []
for f in files_:
parts = f.split(symbol)
name_i = parts[len(parts) - 1]
ids.append(name_i.split('.')[0].split('_')[-1])
ids_1 = list(map(int, ids))... |
from collections import Counter
# noinspection PyUnusedLocal
# skus = unicode string
def checkout(skus):
skuCounter = Counter(skus)
# Performs side effects on the skuCounter :(
price, skuCounter = do_buy_any_deal(skuCounter.copy())
for c in skuCounter:
if c not in "ABCDEFGHIJKLMNOPQRSTUVW... |
"""
gauss.py
Created by Jared J. Thomas, Jul. 2016.
Brigham Young University
"""
from openmdao.api import IndepVarComp, Group
from gaussianwake.gaussianwake import GaussianWake
import numpy as np
def add_gauss_params_IndepVarComps(openmdao_object, nRotorPoints=1):
# openmdao_object.add('bp0', IndepVarComp('mode... |
class BrandNotFound(Exception):
pass
|
#!/usr/bin/env python3
'''
A Diff/TS Driver
Copyright 2012-2021 Codinuum Software Lab <https://codinuum.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/... |
# Copyright 2020 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 2011 Nicholas Bray
#
# 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... |
from torch import nn
class posFFN1d(nn.Module):
def __init__(self, d_hid, d_inner_hid, window=1, dropout=0.1):
super().__init__()
self.w_1 = nn.Conv1d(d_hid, d_inner_hid, kernel_size=window)
self.relu = nn.ReLU()
self.w_2 = nn.Conv1d(d_inner_hid, d_hid, kernel_size=window)
... |
from rest_framework import serializers
from rest_framework_jwt.settings import api_settings
from django.contrib.auth.models import User
class UserSerializer(serializers.ModelSerializer):
class Meta:
model = User
fields = ('username', 'first_name', 'last_name')
class UserSerializerWithToken(seri... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Contains tests for accessing environment variables as a float.
import pytest
from djangokeys.core.djangokeys import DjangoKeys
from djangokeys.exceptions import EnvironmentVariableNotFound
from djangokeys.exceptions import ValueIsEmpty
from djangokeys.exceptions impor... |
# -*- coding: utf-8 -*-
'''
Azure Cloud Module
==================
.. versionadded:: 2016.11.0
The Azure cloud module is used to control access to Microsoft Azure
:depends:
* `Microsoft Azure SDK for Python <https://pypi.python.org/pypi/azure>`_ >= 2.0rc5
* `Microsoft Azure Storage SDK for Python <https://pyp... |
import argparse
import os
import sys
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
import torch
import torch.nn as nn
from models.rnn import IDP_test_rnn
from models.transformer import IDP_compare_Transformer
from idp_methods.utils import *
parser = argparse.ArgumentParser()
parser.add_... |
# Copyright 2017 ProjectQ-Framework (www.projectq.ch)
#
# 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 app... |
#!/usr/bin/env python3
from collections import namedtuple
class MapStack():
def __init__(self):
self.map = [{}]
def __getitem__(self, name):
for x in reversed(self.map):
if name in x:
return x[name]
raise KeyError()
def __contains__(self, name):
... |
"""
TODO:
make choosable graphics NOT gravity[0], time[0]
"""
import matplotlib.pyplot as plt
import pandas as pd
import array, math
from tkinter import *
sensitivity = 200
height = 2.0 # meters
time = [0.61, 0.622, 0.6423, 0.6323]
pressure = [1, 0.9, 0.81, 0.3]
exnum = ['Deney 1:', 'Deney 2:', 'Deney ... |
from enum import Enum
from typing import Any, Dict, List, Optional
from rest_framework import serializers
from rest_framework.exceptions import NotFound, ValidationError
from web3.exceptions import BadFunctionCallOutput
from gnosis.eth import EthereumClientProvider
from gnosis.eth.django.serializers import (EthereumA... |
# -*- coding: utf-8 -*-
from ogs5py import OGS
model = OGS(
task_root='1d_isofrac_root',
task_id='1d_isofrac',
output_dir='out',
)
model.msh.read_file('1d_isofrac.msh')
model.gli.read_file('1d_isofrac.gli')
model.pcs.add_block(
main_key='PROCESS',
PCS_TYPE='GROUNDWATER_FLOW',
NUM_TYPE='NEW',
)
... |
# -*- coding: utf-8 -*-
"""
Created on Sat Sep 26 15:20:14 2015
@author: elad
"""
from scipy.misc import imread
import numpy as np
import matplotlib.pyplot as plt
import cv2
from PIL import Image
import pytesseract
def four_point_transform(image, pts, dst=None):
# obtain a consistent order of the points and unpac... |
import numpy as np
from fconcrete.helpers import to_unit
class Load:
"""
Class that defines a load.
"""
def __init__(self, force, momentum, x_begin, x_end, q=0, order=0, displacement=0):
force = to_unit(force, "kN")
momentum = to_unit(momentum, "kNcm")
x_begin = to... |
# Resource object code (Python 3)
# Created by: object code
# Created by: The Resource Compiler for Qt version 6.0.2
# WARNING! All changes made in this file will be lost!
from PySide6 import QtCore
qt_resource_data = b"\
\x00\x00\x06\x99\
\x89\
PNG\x0d\x0a\x1a\x0a\x00\x00\x00\x0dIHDR\x00\
\x00\x00(\x00\x00\x00(\x08\... |
#!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
r"""
Multi-Task GP models.
References
.. [Doucet2010sampl]
A. Doucet. A Note on Efficient Conditional Simulatio... |
# Claptrap class
# This class runs a simulation of Claptrap using pinocchio, given a controller as input.
# A controller is defined by the following signature:
# def controller(t, q, v):
# return tau
import pinocchio as pnc
import numpy as np
import scipy.integrate
import tqdm
import pkg_resources
import os
from ..... |
# 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... |
# -*- coding: utf-8 -*-
default_app_config = 'spirit.topic.notification.apps.SpiritTopicNotificationConfig'
|
import unittest
from unittest.mock import Mock
from data_repo_client import RepositoryApi
from dagster_utils.contrib.data_repo.jobs import poll_job, JobFailureException, JobTimeoutException
from dagster_utils.contrib.data_repo.typing import JobId
class PollJobTestCase(unittest.TestCase):
def setUp(self):
... |
import recipy
import importlib
subset = importlib.import_module('.data.01_subset-data-GBP', 'src')
plotwines = importlib.import_module('.visualization.02_visualize-wines', 'src')
country_sub = importlib.import_module('.data.03_country-subset', 'src')
raw_data = "data/raw/winemag-data-130k-v2.csv"
country = "Chile"... |
size = [10, 10]
res = [0.25, 0.25]
start = [0.5, 8]
end = [7, 0.5]
bound = [[0, size[0]], [0, size[1]]] |
VERSION = (0, 9, 3, 'final')
__version__ = VERSION # alias
def get_version():
version = '%s.%s' % (VERSION[0], VERSION[1])
if VERSION[2]:
version = '%s.%s' % (version, VERSION[2])
if VERSION[3:] == ('alpha', 0):
version = '%s pre-alpha' % version
else:
if VERSION[3] != 'final'... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.