text stringlengths 2 999k |
|---|
# encoding: utf-8
import collections
import copy
import io
import itertools
import json
import os.path
import re
import string
from datetime import datetime
from httprunner import exceptions, logger
from httprunner.compat import basestring, bytes, is_py2
from httprunner.exceptions import ParamsError
absolute_http_ur... |
# 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 use ... |
from django.contrib.auth.decorators import login_required
from django.core.paginator import Paginator
from django.http import HttpRequest, HttpResponse
from django.shortcuts import render
from jobs.api.views import ProjectsJobsViewSet
from jobs.models import JobMethod, JobStatus
@login_required
def list(request: Htt... |
import os
import sys
import random
import cPickle
import tkFileDialog
import tkSimpleDialog
import tkMessageBox
import tkColorChooser
import Tkinter
import StringIO
from Tkinter import *
from winreg import *
# Check on DEFAULT_IMAGE data.
DEFAULT_IMAGE = 'GIF89a \x00 \x00\xf7\x00\x00\x00\x00\x00\x80\x00\x00\x00\x80\x... |
# =============================================================================
# Copyright 2020 NVIDIA. 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://ww... |
from . import EditProfile, CreateProfile |
from typing import Set, Dict, Any
import random
from . import RandomPolicy
class QTablePolicy:
def __init__(self, initial_value_estimate: float = 0.0):
self.q_table: Dict[Any, Dict[Any, float]] = dict()
self.initial_value_estimate: float = initial_value_estimate
def is_new_state(self, state)... |
#!/usr/bin/env python
#
# 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
# "... |
import math
from typing import Any
import numpy as np
import torch
from pytorch_lightning import LightningDataModule
from torch.utils.data import DataLoader, Dataset
from pl_bolts.utils import _SKLEARN_AVAILABLE
from pl_bolts.utils.warnings import warn_missing_pkg
if _SKLEARN_AVAILABLE:
from sklearn.utils import... |
# -*- encoding: utf-8 -*-
""" Corporation blueprint task """
from sqlalchemy.exc import SQLAlchemyError
from lazyblacksmith.extension.esipy import esiclient
from lazyblacksmith.extension.esipy.operations import (
get_characters, get_characters_roles, get_corporations_blueprints)
from lazyblacksmith.models import B... |
import logging
import re
from Bio.Alphabet.IUPAC import IUPACAmbiguousDNA
from eva_cttv_pipeline.clinvar_xml_io.clinvar_xml_io.hgvs_variant import HgvsVariant, SequenceType
logging.basicConfig()
logger = logging.getLogger(__name__)
logger.setLevel(logging.INFO)
# Human-readable description notation. This pattern is... |
import pathlib
from setuptools import setup
# The directory containing this file
HERE = pathlib.Path(__file__).parent
# The text of the README file
README = (HERE / "README.md").read_text()
# Required package
REQUIRED = ['pandas', 'numpy', 'py4cytoscape',
'seaborn', 'more-itertools', 'argparse']
# This... |
#!/usr/local/bin/python
# coding: utf-8
# Copyright (C) 2011-2012 FeatureSpaceTree Project
#
# 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
... |
import json
from typing import Callable
from uk_covid19 import Cov19API
cov_data = {}
with open("config.json", encoding="utf-8") as json_data_file:
cov_data = json.load(json_data_file)
location_data = cov_data.get("location")
location_type_data = cov_data.get("location_type")
def parse_csv_data(csv_filen... |
from django.conf import settings
from django.dispatch import Signal
from django.http import HttpResponseRedirect
from ..base_client import FrameworkIntegration, RemoteApp
from ..requests_client import OAuth1Session, OAuth2Session
token_update = Signal()
class DjangoIntegration(FrameworkIntegration):
oauth1_clie... |
# being a bit too dynamic
# pylint: disable=E1101
from itertools import izip
import datetime
import warnings
import re
from contextlib import contextmanager
import numpy as np
from pandas.util.decorators import cache_readonly
import pandas.core.common as com
from pandas.core.index import MultiIndex
from pandas.core.s... |
import shutil
import logging
import os
import sys
import errno
import boto3
from configobj import ConfigObj, ConfigObjError
from collections import defaultdict
try:
basestring
except NameError:
basestring = str
LOGGER = logging.getLogger(__name__)
class AWSConfig(object):
def __init__(self, aws_access... |
""" Retreives configuration from the config file
"""
from json import loads
from requests import get
from configparser import ConfigParser, ParsingError
from modules.exceptions import ConfigError
## DiscordIds
discord_ids = {
"lobby" : 0,
"register" : 0,
"matches" : list(),
"results" : 0,
"rules"... |
from steamctl import __appname__, __version__
from types import FunctionType
from collections import OrderedDict
import sys
import argparse
import argcomplete
epilog = """\
Tab Completion
Additional steps are needed to activate bash tab completion.
See https://argcomplete.readthedocs.io/en/latest/#global-com... |
################################# LICENSE ##################################
# Copyright (c) 2009, South African Astronomical Observatory (SAAO) #
# All rights reserved. #
# #
# Redistribu... |
# by:koala @mixiologist
# Lord Userbot
from telethon.events import ChatAction
from userbot import DEVS, bot
from userbot.events import register
from userbot.utils import get_user_from_event, ayiin_cmd
# Ported For Lord-Userbot by liualvinas/Alvin
@bot.on(ChatAction)
async def handler(tele):
if not tele.user_jo... |
'''
Task 2.
Представлен список чисел. Необходимо вывести элементы исходного списка, значения которых больше предыдущего элемента.
Подсказка: элементы, удовлетворяющие условию, оформить в виде списка. Для формирования списка использовать генератор.
Пример исходного списка: [300, 2, 12, 44, 1, 1, 4, 10, 7, 1, 78, 123,... |
__author__ = 'Thomas Rueckstiess, ruecksti@in.tum.de'
from pybrain.rl.learners.learner import ExploringLearner, DataSetLearner, EpisodicLearner
from pybrain.rl.explorers.discrete.egreedy import EpsilonGreedyExplorer
class ValueBasedLearner(ExploringLearner, DataSetLearner, EpisodicLearner):
""" An RL algo... |
import os
import pymel.core as pc
import ngSkinTools.importExport
import mgear
basename = os.path.basename(pc.sceneName())
filename = os.path.splitext(basename)[0]
directory = os.path.dirname(pc.sceneName())
# Find "{current file name}/ngskintools"
json_files = []
path = os.path.join(directory, filenam... |
from .StateBase import StateBase
import sys
import binascii
from neo.Fixed8 import Fixed8
from neo.IO.BinaryReader import BinaryReader
from neo.IO.BinaryWriter import BinaryWriter
from neo.IO.MemoryStream import MemoryStream, StreamManager
from neo.Core.AssetType import AssetType
from neo.UInt160 import UInt160
from n... |
#!/usr/bin/python
try:
from Queue import Queue
except ImportError: # Python 3
from queue import Queue
import random
from graphtheory.structures.edges import Edge
class Graph(dict):
"""The class defining a graph.
Nodes can be numbers, strings, or any hashable objects.
We would like to comp... |
# Copyright 2015-2017 ProfitBricks GmbH
#
# 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 ..._fgsm import FGSM, FGM
from ..._pgd import PGD
from . import _plot_settings
import torch.nn as nn
import torch
import matplotlib.pyplot as plt
"""
Adversarial Evaluation functions for Pytorch neural models
"""
from tqdm import tqdm
from mpl_toolkits import mplot3d
import numpy as np
import matplotlib
from tq... |
class RuledFace(Face,IDisposable):
""" A ruled face of a 3d solid or open shell. """
def Dispose(self):
""" Dispose(self: APIObject,A_0: bool) """
pass
def ReleaseManagedResources(self,*args):
""" ReleaseManagedResources(self: APIObject) """
pass
def ReleaseUnmanagedResources(self,*args):
""" Rel... |
"""
Given a linked list, reverse the nodes of a linked list k at a time and return its modified list.
If the number of nodes is not a multiple of k then left-out nodes in the end should remain as it is.
You may not alter the values in the nodes, only nodes itself may be changed.
Only constant memory is allowe... |
#-----------------------------------------------------------------------------
# Copyright (c) 2005-2019, PyInstaller Development Team.
#
# Distributed under the terms of the GNU General Public License with exception
# for distributing bootloader.
#
# The full license is in the file COPYING.txt, distributed with this s... |
"""
sphinx.domains.python
~~~~~~~~~~~~~~~~~~~~~
The Python domain.
:copyright: Copyright 2007-2020 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import builtins
import inspect
import re
import sys
import typing
import warnings
from inspect import Parameter
from typi... |
# Copyright (c) 2012 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.
{
'includes': [
'gtest.gypi',
],
'targets': [
{
'target_name': 'gtest',
'toolsets': ['host', 'target'],
'type': 'static_l... |
#Defines the Enum class that's used to drive the CredentialInfo enum
class Enum(set):
def __getattr__(self, name):
if name in self:
return name
raise AttributeError
#Implementation of Enum that lets you request this info from the get_credential_info method in the credentials.Cred... |
# https://leetcode.com/problems/intersection-of-two-arrays-ii/
class Solution:
def intersect(nums1, nums2):
insertion_list = []
# insertion_list = [i for i in nums1 if i in nums2 and (j+1)>=len(nums2)]
for i in set(nums1):
if i in nums2:
n = min(nums1.count(i), n... |
from utils import video_manager
__author__ = 'filip@naiser.cz'
import scipy.io as sio
import matplotlib.pyplot as plt
import numpy as np
import math
def x(trx, id):
return trx[0][id].x[0]
def y(trx, id):
return trx[0][id].y[0]
def y_flip(trx, id, im_height):
return im_height - trx[0][id].y[0]
def th(... |
from flask import Flask
from threading import Thread
app = Flask('')
@app.route('/')
def home():
return "Hello I am online"
def run():
app.run(host='0.0.0.0', port=8080)
def keep_alive():
t= Thread(target=run)
t.start() |
# ----------------------------------------------------------------------------
# pymunk
# Copyright (c) 2007-2020 Victor Blomqvist
#
# 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 re... |
__author__ = 'tester'
import mysql.connector
from model.group import Group
from model.contact import Contact
from model.cont_in_group import Cont_in_Groups
class dbFixture:
def __init__(self, host, name, user, password):
self.host = host
self.name = name
self.user = user
self.pass... |
# Copyright 2016 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applic... |
# Copyright 2019-2021 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... |
import logging, os
import pandas as pd
from sklearn.externals import joblib
pd.options.display.max_rows = 999
pd.options.display.max_columns = 999
FILE_TRAIN='/home/ubuntu/santander/data/train_ver2.csv'
FILE_TEST='/home/ubuntu/santander/data/test_ver2.csv'
FILE_DF='dataframe.hdf5'
FILE_DF_CLEAN='dataframe_clean.hdf5'... |
#!/usr/bin/env python2
# Copyright (c) 2014-2015 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
# Exercise the listtransactions API
from test_framework.test_framework import UtabitTestFramework
from t... |
class BaseExchangeRoomService(object):
def __init__(self, service):
self.service = service
class BaseExchangeRoomItem(object):
_id = None
_change_key = None
_service = None
|
import os
import pytest
from MOPbx.src.mopbx import main, clean_pbx, remove_empty_translation_files, remove_translation_files_without_source, _reset_caches
"""
INFO: these tests have to be run from the `tests` directory, otherwise the paths checked in the tests wont match as expected
"""
# helper globals
test_mode = ... |
"""Tests for spiketools.utils.checks"""
import warnings
from pytest import warns
from spiketools.utils.checks import *
###################################################################################################
#################################################################################################... |
from django.contrib import admin
from .models import *
admin.site.register(sins)
admin.site.register(goods)
# Register your models here.
|
import n2v
import numpy as np
import psi4
import pytest
psi4.set_options({"save_jk" : True})
psi4.set_memory(int(2.50e9))
@pytest.fixture
def wfn():
Ne = psi4.geometry(
"""
0 1
Ne
noreorient
nocom
units bohr
symmetry c1
""" )
psi4.set_options({"reference" : "rhf"})
wfn ... |
# coding: utf-8
"""
Seido User REST API
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: 2.4.8
Generated by: https://openapi-generator.tech
"""
import six
class OpenApiException(Exception)... |
from zope.interface import Interface
from guillotina_volto.directives import fieldset_field
from guillotina_volto.fields import RichTextField
class IRichText(Interface):
fieldset_field("text", "default")
text = RichTextField(
title="RichText field",
required=False
)
|
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.constant.ParamConstants import *
class AnttechOceanbaseMegagameTaskSyncModel(object):
def __init__(self):
self._fail_msg = None
self._id = None
self._machine_score = None
self._task_status = None
@... |
import dash
import dash_labs as dl
import numpy as np
import dash_core_components as dcc
import plotly.express as px
app = dash.Dash(__name__, plugins=[dl.plugins.FlexibleCallbacks()])
import dash_bootstrap_components as dbc
tpl = dl.templates.DbcRow(title="Manual Update", theme=dbc.themes.SOLAR)
@app.callback(
... |
"""
Test for molecule module
"""
import pytest
import molecool
def test_molecule_mass():
symbols = ['C', 'H', 'H', 'H', 'H']
calculated_mass = molecool.calculate_molecular_mass(symbols)
actual_mass = 16.04
assert pytest.approx(actual_mass, abs=1e-2) == calculated_mass
|
__all__ = ['BodyHeadModel']
"""
# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
from fastiqa.models._body_head import *
from fastiqa.models.resnet_3d import *
from fastai.vision.all import *
BodyHeadModel.compare_paramters(
backbones = {
'ResNet-18' : resnet18,
'Re... |
# -*- coding: utf-8 -*-
import logging
log = logging.getLogger(__name__)
# files have "#SYNC_VIP" to find where have migrations
def old_to_new(vip_request):
from networkapi.ambiente.models import EnvironmentVip
from networkapi.api_vip_request.models import VipRequest, VipRequestDSCP, VipRequestOptionVip, ... |
import os
import random
import torch
import torchvision
from fl_dp.models import MnistMLP
from fl_dp.strategies import LaplaceDpFed
from fl_dp.train import DpFedStep, LaplaceMechanismStep
from pairwise_noises import PairwiseNoises
class FedClient:
# Public parameters of the system. Received during initialization... |
from configs import paths_config
import dlib
import glob
import os
from tqdm import tqdm
from utils.alignment import align_face
def pre_process_images(raw_images_path):
current_directory = os.getcwd()
IMAGE_SIZE = 256
predictor = dlib.shape_predictor(paths_config.dlib)
os.chdir(raw_images_path)
i... |
import logging
import re
from xeda.flows.flow import Flow
_logger = logging.getLogger()
class LWC:
@classmethod
def variant(cls, design_settings):
design_name = design_settings['name']
lwc_settings = design_settings.get('lwc', {})
lwc_variant = lwc_settings.get('variant')
if no... |
"""
Provides an interface for performing speedtests.
Classses:
TestError
Functions:
run_test( timeout ) -> Mapping
Constants:
DEFAULT_TIMEOUT - Default timeout for a test
"""
import json
import subprocess
from typing import Iterable, Mapping, Optional
DEFAULT_TIMEOUT: float = 10 * 60 # Default amoun... |
from collections import deque
import random
import tensorflow as tf
from tensorflow.keras.optimizers import Adam
import numpy as np
from .models import lstm_model
class DQNAgent:
def __init__(self, model_path=None, lr=1e-4, state_size=100,
action_size=130):
self.state_size = state_size
... |
# The MIT License (MIT)
#
# Copyright (c) 2020 CNRS
#
# 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, modify, merg... |
"""
Copyright (c) 2018, University of Oxford, Rama Cont and ETH Zurich, Marvin S. Mueller
calibration.py
Contains objects and functions for calibration of the LOB models.
To calibrate dynamics to a given time series of data on bid and ask side, data_bid and data_ask, with time stamps time_stamps which is uniform wit... |
import datetime
import json
from decimal import Decimal
from unittest.mock import patch
import pytest
from django.core import serializers
from django.urls import reverse
from prices import Money, TaxedMoney, TaxedMoneyRange
from saleor.checkout import utils
from saleor.checkout.models import Cart
from saleor.checkout... |
import random
import taichi as ti
@ti.data_oriented
class MPMSolver:
def __init__(self, res):
dim = len(res)
self.dx = 1 / res[0]
self.inv_dx = 1.0 / self.dx
self.pid = ti.field(ti.i32)
self.x = ti.Vector.field(dim, dtype=ti.f32)
self.grid_m = ti.field(dtype=ti.f32... |
from .mantid_scipp_comparison import MantidScippComparison
from ..mantid_helper import mantid_is_available
import pytest
import scippneutron.mantid as converter
import scippneutron as sn
import scipp as sc
import enum
class Emode(enum.Enum):
Elastic = 0
Direct = 1
class Comparison(MantidScippComparison):
... |
#!/bin/env
# -*- coding: utf-8 -*-
import re
import os
import json
from snownlp import SnowNLP
from bs4 import BeautifulSoup
def save_new_json(str):
out_file = open("ret_summary.txt", 'a')
out_file.write(str)
out_file.write("\n")
out_file.close()
def get_summary(content):
soup = BeautifulSoup(co... |
def __load():
import imp, os, sys
ext = 'sklearn/utils/fast_dict.so'
for path in sys.path:
if not path.endswith('lib-dynload'):
continue
ext_path = os.path.join(path, ext)
if os.path.exists(ext_path):
mod = imp.load_dynamic(__name__, ext_path)
bre... |
import _plotly_utils.basevalidators
class FillcolorValidator(_plotly_utils.basevalidators.ColorValidator):
def __init__(
self, plotly_name='fillcolor', parent_name='violin.box', **kwargs
):
super(FillcolorValidator, self).__init__(
plotly_name=plotly_name,
parent_name=... |
# -*- coding: utf-8 -*-
from operator import attrgetter
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType
from pyangbind.lib.yangtypes import RestrictedClassType
from pyangbind.lib.yangtypes import TypedListType
from pyangbind.lib.yangtypes import YANGBool
from pyangbind.lib.yangtypes import YANGListTy... |
"""A set of model-agnostic losses implementing uniform API.
Implemented losses:
VIMCO loss
https://arxiv.org/abs/1602.06725
All three Reweighted Wake-Sleep losses: PWake, QWake, QSleep,
https://arxiv.org/abs/1406.2751
COMING SOON:
Reparametrized ELBO for continuous latent variables.
inf_ne... |
from django.test import TestCase
from document_catalogue import plugins
class FrameworkTests(TestCase):
"""
Test basic behaviours for Plugin Micro-Framework
"""
class TestPluginManager(plugins.PluginManager):
def __init__(self):
self.counter = 0
def count(self):
... |
#!/usr/bin/env python
"""
Listens for messages from ingest to create a staging area, post back the credentials for uploading
files to the staging area
"""
from ingest.api.ingestapi import IngestApi
from ingest.api.stagingapi import StagingApi
__author__ = "jupp"
__license__ = "Apache 2.0"
__date__ = "15/09/2017"
imp... |
import pytest
from flaskr.db import get_db
def test_index(client, auth):
response = client.get('/')
assert b'Login' in response.data
assert b'Register' in response.data
auth.login()
response = client.get('/')
assert b'Logout' in response.data
assert b'test title' in response.data
asser... |
import hashlib
import hmac
import logging
import time
from json.decoder import JSONDecodeError
from typing import TYPE_CHECKING, Dict, List, Optional, Tuple, Union
from urllib.parse import urlencode
import requests
from rotkehlchen.assets.asset import Asset
from rotkehlchen.constants.assets import A_BTC
from rotkehlc... |
from dash import Dash
import dash_core_components as dcc
import dash_html_components as html
from dash.dependencies import Input, Output, State
app = Dash(__name__)
app.layout = html.Div([
html.Label('Text 1: '),
dcc.Input(id='input-1-submit', type='text', placeholder='Enter name'),
... |
"""Test different accessory types: Sensors."""
from homeassistant.components.homekit import get_accessory
from homeassistant.components.homekit.const import (
PROP_CELSIUS,
THRESHOLD_CO,
THRESHOLD_CO2,
)
from homeassistant.components.homekit.type_sensors import (
BINARY_SENSOR_SERVICE_MAP,
AirQualit... |
# -*- coding: utf-8 -*-
from mail.models import Message
from django.contrib import admin
class MessageAdmin(admin.ModelAdmin):
list_display = ('sender', 'title')
filter_horizontal = ('recipients', 'recipients_user', 'recipients_group', 'recipients_course', 'recipients_status')
admin.site.register(Message, ... |
import math
import ccxt
import pandas
class Feda:
def __init__(self, fileName:str, pair:str, days:int, exchange:str='binanceFutures'):
self.fileName = fileName
self.pair = pair
self.days = days
self.exchange = exchange
self._checkExchange()
def _checkExchange(self):
... |
"""Add User table
Revision ID: 6cd70f62a2ba
Revises: 21b0ee7f2563
Create Date: 2021-01-22 11:28:18.179437
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = "6cd70f62a2ba"
down_revision = "21b0ee7f2563"
branch_labels = None
depends_on = None
def upgrade():
#... |
# Configuration file for ipython.
#------------------------------------------------------------------------------
# InteractiveShellApp(Configurable) configuration
#------------------------------------------------------------------------------
## A Mixin for applications that start InteractiveShell instances.
#
# ... |
dic = {'a': 12, 'b': 15, 'c': 3}
def find(x):
k = dic.keys()
print(k.__contains__(x))
find('ba') |
#!/usr/bin/env python
# -- Content-Encoding: UTF-8 --
"""
COHORTE Python bootstrap constants
:author: Thomas Calmant
:license: Apache Software License 2.0
..
Copyright 2014 isandlaTech
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the... |
"""
Support for Hue lights.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/light.hue/
"""
import json
import logging
import os
import random
import socket
from datetime import timedelta
import voluptuous as vol
import homeassistant.util as util
import ... |
# 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 warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from . import ... |
#!C:\Users\ronle\Desktop\ITC\course\Data_science_project\covid_tweets\deployment\venv\Scripts\python.exe
# When the django-admin.py deprecation ends, remove this script.
import warnings
from django.core import management
try:
from django.utils.deprecation import RemovedInDjango40Warning
except ImportError:
ra... |
""" Working with calendars
The calendar module contains different classes that you can use to create calendars.
A text based calendar # 11
# A HTML based calendar # 32
Part 2: # 50
Part 3: # 120
"""
import calendar
# A text based calendar
# cal = calendar.TextCalendar(calendar.SUNDAY) # SUNDAY i... |
from moco_wrapper.util.response import JsonResponse, EmptyResponse, ListingResponse
from .. import IntegrationTest
class TestUserHoliday(IntegrationTest):
def get_user(self):
with self.recorder.use_cassette("TestUserHoliday.get_user"):
user = self.moco.User.getlist().items[0]
retur... |
import zen
import numpy
import unicodedata
import sys
sys.path.append('../zend3js/')
import d3js
import csv
import progressbar
import numpy.linalg as la
import matplotlib.pyplot as plt
from scipy.linalg import solve
f=open('Dataset.csv')
csv_f=csv.reader(f)
row=[r for r in csv_f]
##print (len(row))
... |
#
# Copyright (c) nexB Inc. and others. All rights reserved.
# ScanCode is a trademark of nexB Inc.
# SPDX-License-Identifier: Apache-2.0
# See http://www.apache.org/licenses/LICENSE-2.0 for the license text.
# See https://github.com/nexB/scancode-toolkit for support or download.
# See https://aboutcode.org for more in... |
#!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'locallibrary.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
... |
"""
Django settings for myblog project.
Generated by 'django-admin startproject' using Django 3.1.7.
For more information on this file, see
https://docs.djangoproject.com/en/3.1/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.1/ref/settings/
"""
import os
fro... |
import torch.cuda
from mlagents_envs.base_env import ActionTuple
from mlagents_envs.environment import UnityEnvironment
import NN
MODEL_NAME = "3dBall1.18.25.19.pt"
path = 'models/' + MODEL_NAME
env = UnityEnvironment(file_name=None, seed=1, side_channels=[])
env.reset()
behaivor_name = next(iter(env.beha... |
from src.domain.user import User
def test_register():
user = User.register(
username="test", email="email@example.com", password="testpassword"
)
assert not user.is_superuser
assert not user.email_verified
def test_create_superuser():
user = User.create_superuser(
username="test"... |
#!/usr/bin/python3
import tkinter
import serial
import time
import datetime
import sys
import matplotlib
#matplotlib.use("TkAgg")
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg, NavigationToolbar2TkAgg
from matplotlib.figure import Figure
import matplotlib.animation as animation
from matplotlib import... |
###=====================================================================
### Calculate centroid for atomA orbited by atomB
### ORTHONORMAL DATA TO ANALYSE
from rmc6f_analyse_function_caller import orthonormal_positions
import numpy as np
###=====================================================================
def di... |
import sys
from functools import reduce
from operator import mul
from typing import Iterator, Tuple
def traverse_map_and_count_trees(map_: str, *, x_step: int, y_step: int) -> int:
lines = map_.splitlines()
def coordinates() -> Iterator[Tuple[int, int]]:
x, y = 0, 0
while y < len(lines) - y_s... |
import torch.nn as nn
import math
import torch.utils.model_zoo as model_zoo
from models.modeling.sync_batchnorm.batchnorm import SynchronizedBatchNorm2d
webroot = 'http://dl.yf.io/drn/'
model_urls = {
'resnet50': 'https://download.pytorch.org/models/resnet50-19c8e357.pth',
'drn-c-26': webroot + 'drn_c_26-dded... |
from tornalet_info import *
import greenlet
import tornado.web
import tornado.ioloop
import tornado.httpclient
import time
import functools
def tornalet(method):
""" Decorator for handler's method to enable tornalet. """
@functools.wraps(method)
@tornado.web.asynchronous
def wrapper(self, *kargs, **k... |
# encoding: utf-8
import mock
import json
import pytest
import six
import ckan.tests.helpers as helpers
import ckan.tests.factories as factories
class TestDatastoreDump(object):
@pytest.mark.ckan_config("ckan.plugins", "datastore")
@pytest.mark.usefixtures("clean_datastore", "with_plugins")
def test_dump... |
from imports import *
def get_batched_dataset(filenames):
option_no_order = tf.data.Options()
option_no_order.experimental_deterministic = True
dataset = tf.data.Dataset.list_files(filenames)
dataset = dataset.with_options(option_no_order)
dataset = dataset.interleave(tf.data.TFRecordDataset, c... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.