content
stringlengths
5
1.05M
#-------------------changeable var below------------------- originPath = '' #-----where is the file,will effect the output file's location pat=''#-----where you store the data\minecraft\tags folder in version.jar typeli=['blocks','items','entity_types','fluids','game_events']#------what tags type you want to...
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals from django.core.paginator import Paginator from django.core.serializers.json import DjangoJSONEncoder from django.db.models import Q from django.http.response import HttpResponse, HttpResponseBadRequest from django.views.generic import Vi...
# Copyright (c) Microsoft Corporation. # Licensed under the MIT license. import os import sys sys.path.append("..") sys.path.append("../..") import graph def convert_graph(graph_filename, output_directory, arch): print("Processing %s..." % graph_filename) gr = graph.Graph.from_str(open(graph_filename, 'r').re...
from structlog import get_logger from good_spot.proxy.models import Proxy from good_spot.taskapp.celery import app log = get_logger() @app.task def run_periodic_reset_counter(): log.info('Ran reset counter of IP usage.') Proxy.objects.update(count=0)
from typing import Any, Iterable, List, Optional from packaging.version import Version from aiida import load_profile from aiida.common.folders import SandboxFolder from aiida.orm import load_node from aiida.tools.importexport import Archive, import_data from aiida_archive.interface import AiidaArchive from .export...
from __future__ import annotations import os from typing import Iterator, TypeVar, List, Type from tools37.files import DictInterface, DirView E = TypeVar('E', bound=DictInterface) class JsonFilesManager(DirView): def __init__(self, path: str, factory: Type[E]): super().__init__(path, force_create=True...
from bokeh.plotting import figure, show, output_notebook, output_file, save from bokeh.tile_providers import get_provider, Vendors # CARTODBPOSITRON # from bokeh.til # from sklearn.datasets import fetch_california_housing from bokeh.models import ColumnDataSource, HoverTool, ColorBar import numpy as np class Plots()...
# flake8: noqa from .loader import get_loader from . import text_classification
"""empty message Revision ID: 4df4248d2abe Revises: 38395b979b79 Create Date: 2021-07-11 20:10:55.356770 """ from alembic import op import sqlalchemy as sa from sqlalchemy.dialects import postgresql from sqlalchemy.dialects.postgresql import JSONB, ARRAY, TIMESTAMP from sqlalchemy.ext.mutable import MutableDict, Muta...
"""Library to contain 2d RFI flagging routines and other RFI related functions.""" import multiprocessing import concurrent.futures import numpy as np import numba from . import MAD_NORMAL def _as_min_dtype(value): """Convert a non-negative integer into a numpy scalar of the narrowest type will hold it. T...
import csv from glob import glob from collections import defaultdict class TableData: def __init__(self): self.datasetName = 'NACC' self.imageDir = '/data_2/NACC_ALL/npy/' self.content = defaultdict(dict) # dictionary of dictionary; {RID: {colname1: val1, colname2: val2, ...}} self...
# import matplotlib.pyplot as plt from matplotlib import pyplot from matplotlib.patches import Ellipse import matplotlib.transforms import numpy as np import pandas as pd import seaborn as sns from sklearn.manifold import TSNE from sklearn.preprocessing import StandardScaler from sklearn.decomposition import P...
import numpy as np def euclidean_distance(x, y): return np.sqrt(np.sum(np.square(x - y)))
from .pbt import *
from setuptools import setup setup( name = 'meerkat', packages = ['meerkat'], version = '0.3.3', description = 'A program for reciprocal space reconstruction', author = 'Arkadiy Simonov, Dmitry Logvinovich', author_email = 'aglietto@gmail.com', url = 'https://github.com/aglie/meerkat.git', # download_url...
n = int(input()) i = 1 two_pow = 0 while i<=n: if i==n: print("YES") two_pow = 1 break i*=2 if two_pow == 0: print("NO")
""" class BinaryTreeNode(object): def __init__(self, value): self.value = value self.left = None self.right = None def insert_left(self, value): self.left = BinaryTreeNode(value) return self.left def insert_right(self, value): self.right = BinaryTreeNode(v...
from flask_wtf import FlaskForm from wtforms.fields import SubmitField,StringField from wtforms import validators class Quotes_search_form(FlaskForm): legacy_quote_id = \ StringField( 'Quotes id', validators=[validators.length(min=1,max=20)]) submit = SubmitField('Search quotes')
from pyopenproject.api_connection.exceptions.request_exception import RequestError from pyopenproject.api_connection.requests.delete_request import DeleteRequest from pyopenproject.business.exception.business_error import BusinessError from pyopenproject.business.services.command.membership.membership_command import Me...
# from pyblt import * import random import gc import math import sys from collections import defaultdict, Counter import numpy as np import cProfile import subprocess class Search: def __init__(self, entries, goal,addressing): assert entries > 0 self.entries = entries self.goal = goal ...
from graphql.core.language.location import SourceLocation as L from graphql.core.validation.rules import UniqueInputFieldNames from utils import expect_passes_rule, expect_fails_rule def duplicate_field(name, l1, l2): return { 'message': UniqueInputFieldNames.duplicate_input_field_message(name), '...
import json import requests import logging payment_logger = logging.getLogger(__name__) class BalePayment: def __init__(self, bot_token, logger=None): self.bot_token = bot_token self.logger = logger if logger else payment_logger def send_invoice_with_payment_id(self, chat_id, title, descri...
#!/usr/bin/env python3 import datetime import re import random import time import parse from pytz import timezone parser = parse.CommandParser filename = "ips.txt" MAC_ADDRESS_R = re.compile( r""" ([0-9A-F]{1,2})[:-]? ([0-9A-F]{1,2})[:-]? ([0-9A-F]{1,2})[:-]? ([0-9A-F]{1,2})[:-]? ([0-9A-F]{...
# -*- coding: utf-8 -*- # Generated by Django 1.10.2 on 2017-03-01 19:44 from __future__ import unicode_literals from django.db import migrations import multiselectfield.db.fields class Migration(migrations.Migration): dependencies = [ ('local_groups', '0006_auto_20170301_1713'), ] operations =...
# -*- coding: utf-8 -*- # %% Imports import hashlib # %% Dicts OP_CODES = {172: "OP_CHECKSIG", 118: "OP_DUP", 169: "OP_HASH160", 136: "OP_EQUALVERIFY"} # %% General functions def tqdm_off(x): return x # %% Hashing functions def hash_SHA256(by): """ Use hashlib ...
import datetime import requests import json import gzip import os API_URL = "https://vitaldb.net/api/" access_token = None def receive(vrcode, bedname=None, dtstart=None, dtend=None): if isinstance(dtstart, datetime.datetime): dtstart = dtstart.timestamp() if isinstance(dtend, datetime.datetime): ...
print('=' * 40, 'Informe 3 reta para verificar se forma um triângulo ' + '=' * 40) r1 = float(input('Informe a 1° reta: ')) r2 = float(input('Informe a 2ª reta: ')) r3 = float(input('Informe a 3ª reta: ')) if r2 - r3 < r1 and r2 + r3 > r1 and r1 - r3 < r2 and r1 + r3 > r2 and r1 - r2 < r3 and r1 + r2 > r3: print('...
""" MIT License Copyright (c) 2018 AlessioNetti 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, merge, publish, ...
# Copyright (c) 2021, VRAI Labs and/or its affiliates. All rights reserved. # # This software is licensed under the Apache License, Version 2.0 (the # "License") as published by the Apache Software Foundation. # # You may not use this file except in compliance with the License. You may # obtain a copy of the License at...
from django.shortcuts import render from rest_framework.generics import GenericAPIView from rest_framework.response import Response from rest_framework.permissions import IsAuthenticated from apps.accounts.permissions import ProfileComplete from .serializers import ResourceSerializer, DownloadLinkSerializer from .m...
# Image preprocessing Part - 1 import os import numpy as np import pandas as pd import matplotlib.pyplot as plt from PIL import Image import cv2 # %matplotlib inline import warnings warnings.filterwarnings("ignore") import tensorflow as tf from tensorflow import keras from tensorflow.keras.utils import get_fi...
import argparse import logging import os import subprocess import warnings from collections import OrderedDict from pathlib import Path import h5py import numpy as np import utils.log as log_utils from third_party.davis import add_davis16_to_sys_path add_davis16_to_sys_path() from davis import cfg from davis.dataset...
from ..base import AST CLASS = "declarations.property" class ObjectValDef(AST): def __init__(self, name, value): super().__init__(CLASS, "object_val_def") self.name = name self.value = value self.children = [name, value]
from taichi.two_d import * from taichi.misc.util import * if __name__ == '__main__': resolution = [96, 54] simulator = FluidSimulator(simulator='liquid', simulation_width=resolution[0], simulation_height=resolution[1], delta_x=1.0 / min(resolution),...
import os script_dir = os.path.dirname(__file__) content_dir = os.path.join(script_dir, "mock_content")
import PythonQt from PythonQt import QtCore, QtGui import director.visualization as vis import director.vtkAll as vtk class ViewEventFilter(object): LEFT_DOUBLE_CLICK_EVENT = 'LEFT_DOUBLE_CLICK_EVENT' def __init__(self, view): self.view = view self.eventFilter = None self._leftMouseS...
IRC_COLOURS = ( 'ffffff', '000000', '00007f', '000093', 'ff0000', '7f0000', '9c009c', 'fc7f00', 'ffff00', '00fc00', '009393', '00ffff', '0000fc', 'ff00ff', '7f7f7f', 'd2d2d2') irc_cols = [] for i,col in enumerate(IRC_COLOURS): irc_cols.append('.irc%d { color: #%s; }' % (i,col)) irc_cols.append('.ircbg%d { background...
import os from typing import AsyncIterator, overload import flanautils from flanaapis.exceptions import PlaceNotFoundError from flanaapis.geolocation import google_maps, open_street_map from flanaapis.geolocation.models import Place TIMEZONE_API_KEY = os.environ['TIMEZONEDB_API_KEY'] TIMEZONE_BASE_ENDPOINT = 'https:...
# -*- coding: utf-8 -*- import argparse import logging import sys import traceback from .version import __version__ from .zap import process def main(): parser = argparse.ArgumentParser( formatter_class=argparse.ArgumentDefaultsHelpFormatter, description='ZAP (the Zurich Atmosphere Purge) is a h...
# Generated by Django 3.1.2 on 2021-02-09 14:56 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('mvp', '0017_auto_20210209_1317'), ] operations = [ migrations.RemoveField( model_name='recycleditems', name='collect...
"""Add fee to design table Revision ID: 0007 Revises: 0006 Create Date: 2019-05-30 09:58:01.563331 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '0007' down_revision = '0006' branch_labels = None depends_on = None def upgrade(): op.add_column('design', ...
from django.test import TestCase from dojo.tools.ccvs.parser import CCVSParser from dojo.models import Test class TestCCVSParser(TestCase): def test_ccvs_parser_has_no_finding(self): testfile = open("dojo/unittests/scans/ccvs/no_vuln.json") parser = CCVSParser() findings = parser.get_findi...
import torch import torch.nn.functional as F from torch.nn import Module, ModuleList, Dropout from torch import optim from graphgallery.nn.models import TorchKerasModel from graphgallery.nn.layers.th_layers import GraphConvolution class GCN(TorchKerasModel): def __init__(self, in_channels, out_channels, ...
from django.shortcuts import render,redirect,HttpResponse,get_object_or_404 from .models import TODO from django.contrib import messages from .forms import todo_form from django.contrib.auth.decorators import login_required # Create your views here. @login_required(login_url="user:login") def dashboard(request): ...
# -*- coding: utf-8 -*- ''' Created on 2019年03月02日 @author: Zhukun Luo Jiangxi university of finance and economics ''' import os import sys import numpy as np import matplotlib.pyplot as plt PATH = "/home/agnostic/Workspaces/MyEclipse CI/Spark-machine-learning/chapter04/data" from pyspark import SparkContext from pys...
#from setuptools import setup from distutils.core import setup setup( name = 'caterapp', packages=['caterapp'], version = '1.1', # Ideally should be same as your GitHub release tag varsion description='A TCP based file sharing application', author='Ravi Prakash', author_email='ravi.cs20@iiitmk...
import hashlib import tempfile from six.moves import StringIO import gzip import tarfile from zipfile import ZipFile from artemis.fileman.local_dir import get_artemis_data_path, make_dir, make_file_dir from artemis.general.should_be_builtins import bad_value import shutil import os from six.moves.urllib.request import ...
import sys import pytest sys.path.append("../lib/") import board as b test_tiles = ([12,13], [11,37],[22,11], [13,24], [13,48], [25,24]) print("Input: {}".format(test_tiles)) myboard = b.Board(4,4) myboard.setTiles(test_tiles)
from dataclasses import dataclass from dataclasses_json import dataclass_json
# Copyright 2018 Twitter, Inc. # Licensed under the Apache License, Version 2.0 # http://www.apache.org/licenses/LICENSE-2.0 """ This module contains methods for validating the performance predictions of the Caladrius Heron prophet traffic forecasting model.""" import os import sys import argparse import logging impo...
#********************************************************** #* CATEGORY SOFTWARE #* GROUP ERPNEXT/FRAPPE #* AUTHOR LANCE HAYNIE #********************************************************** #Copyright Haynie IPHC, LLC #Developed by Haynie Research & Development, LLC #Developed for Lance Haynie, LLC #Licensed under the Ap...
import logging import tensorflow as tf import os import sys from pathlib import Path from tensorflow import keras import matplotlib.pyplot as plt # from segelectri.loss_metrics.loss import FocalLoss, LovaszLoss, DiceLoss, BoundaryLoss # from segelectri.loss_metrics.metrics import MeanIou from tvm import relay,autotvm f...
from __future__ import absolute_import from collections import defaultdict import numpy as np import torch from torch.utils.data.sampler import ( Sampler, SequentialSampler, RandomSampler, SubsetRandomSampler, WeightedRandomSampler) class RandomIdentitySampler(Sampler): def __init__(self, ids, train_clas...
""" Classes to represent Bayesian networks. """ from toposort import toposort_flatten as flatten from misc import dict_to_string from scipy import rand, prod class BayesNet(object): """ Object to hold and evaluate probabilities for BayesNets described by cpts. """ def __init__(self, graph, cpt):...
"""This modules creates a continuous MLP policy network. A continuous MLP network can be used as policy method in different RL algorithms. It accepts an observation of the environment and predicts a continuous action. """ import tensorflow as tf from garage.tf.models import MLPModel from garage.tf.policies.policy imp...
# Copyright 2022 Quantapix 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 applicable l...
import datetime from supra.Utils.Classes import Angle, Position, Trajectory, Supracenter def strToBool(my_str): return (my_str.lower() == 'true') def tryFloat(statement): try: return float(statement) except: return None def tryInt(statement): try: return int(statement) ...
"""Unit tests for Object Calisthenics rule 2: Don't use the ELSE keyword.""" import astroid from pylint.testutils import CheckerTestCase, Message from checkers.no_else import NoElseChecker class TestNoElseChecker(CheckerTestCase): """Unit tests for the no-else checker.""" CHECKER_CLASS = NoElseChecker d...
import logging import json from uuid import uuid4 from apistar import App, Route, schema, http, environment from apistar.backends import SQLAlchemy from sqlalchemy import String from sqlalchemy.dialects.postgresql import UUID from sqlalchemy.ext.declarative.api import declarative_base from sqlalchemy.sql.schema import...
from scanner import * def main(): s = Scanner("file1.py") b = s.readtoken() i = s.readtoken() f = s.readtoken() str1 = s.readtoken() str2 = s.readtoken() t = s.readtoken() print("The type of",b,"is",type(b)) print("The type of",i,"is",type(i)) print("The type of",f,"is",type(f))...
import requests import property_reader as properties # to get all the servers def get_servers(authorization_header, ORG_ID, ENV_ID): url = properties.get('runtime_manager_url') + '/servers' headers_dict = { "authorization": authorization_header, "X-ANYPNT-ORG-ID": ORG_ID, "X-ANYPNT-EN...
#!/usr/bin/env python3 """Python program to shuffle a deck of card.""" # importing modules # import itertools import random # from pprint import pprint, pformat import smtplib from datetime import datetime from email.mime.multipart import MIMEMultipart from email.mime.text import MIMEText import numpy as np import fu...
import os import json # { 'filename': '28503151_5b5b7ec140_b.jpg', # 'regions': { # '0': { # 'region_attributes': {}, # 'shape_attributes': { # 'all_points_x': [...], # 'all_points_y': [...], # 'name': 'polygon'}}, # ... more regions ... # }...
import math from collections import OrderedDict from typing import Dict, List from typing import OrderedDict as OrderedDictType from typing import TypeVar _T1 = TypeVar("_T1") _T2 = TypeVar("_T2") def get_rarity_item(item: _T2, distribution: Dict[_T2, float]) -> float: if item in distribution: return distribut...
""" Created on Sat Nov 18 23:12:08 2017 @author: Utku Ozbulak - github.com/utkuozbulak """ import os import cv2 import numpy as np import torch from torch.optim import SGD from torchvision import models from net_viz.misc import preprocess_image, recreate_image class CNNLayerVisualization(object): """ P...
from Manteia.Dataset import Dataset ds=Dataset('Yahoo! Answers',test=True,desc=True) print('Train : ') print(ds.documents_train[:5]) print(ds.labels_train[:5]) print('Test : ') print(ds.documents_test[:5]) print(ds.labels_test[:5]) print('Description :') print(ds.description) print('List labels :') print(ds.list_l...
import os import sys import copy import re import logging from shutil import copyfile """ Managing Django Environment Variables http://www.wellfireinteractive.com/blog/easier-12-factor-django/ """ def get(key, default=None): """Retrieves env vars and makes Python boolean replacements""" val = os.environ.get(...
"""Creates a virtual environment for developing the library. Also installs the needed dependencies. """ import platform import subprocess from pathlib import Path from venv import EnvBuilder venv_dir = Path(".") / ".venv" if not platform.platform().startswith("Windows"): venv_python = venv_dir / "bin" / "python" ...
# Copyright 2014 Facebook, Inc. # You are hereby granted a non-exclusive, worldwide, royalty-free license to # use, copy, modify, and distribute this software in source code or binary # form for use in connection with the web services and APIs provided by # Facebook. # As with any software that integrates with the Fa...
import sys import subprocess from mpi4py import MPI corespernode = int(sys.argv[1]) comm = MPI.COMM_WORLD rank = MPI.COMM_WORLD.Get_rank() num_procs = MPI.COMM_WORLD.size if rank % corespernode == 0: subprocess.call(["./tools/freemem"]) print "[Python-land] Rank %d: DRAM freed." % rank subprocess.call(["n...
from telegram.ext import Updater import logging from telegram.ext import CommandHandler,CallbackQueryHandler,InlineQueryHandler from telegram.ext import MessageHandler, Filters from telegram import InlineQueryResultArticle,InputTextMessageContent,InlineKeyboardMarkup import gearman import json import re import requests...
class Solution: def isEqualTree(self, T, S) : if T is None and S is None : return True if T is None or S is None : return False if T.data != S.data : return False return self.isEqualTree(T.left, S.left) and self.isEq...
from __future__ import print_function import os import re import gzip import itertools import argparse import subprocess __author__ = 'Martin Aryee' # python ~/work/projects/umi/umitag.py --read1_in bcl/Undetermined_S0_L001_R1_001.fastq.gz --read2_in bcl/Undetermined_S0_L001_R2_001.fastq.gz --read1_out umi1.fastq.gz ...
#!/usr/bin/env python #-*- coding: utf-8 -*- import os import sys try: from setuptools import setup has_setuptools = True except ImportError: from distutils.core import setup has_setuptools = False from util import commands if sys.platform == "darwin": # Don't create resource files on OS X tar. ...
from toolkit import * if __name__ == '__main__': ls = [113, 167, 2017] for i in ls: print(i, root(i), phi(i - 1), len(root(i)))
import torch from torch import nn import torch.nn.functional as F class MLP(nn.Module): """ Very simple multi-layer perceptron (also called FFN)""" def __init__(self, input_dim, hidden_dim, output_dim, num_layers): super().__init__() self.num_layers = num_layers h = [hidden_dim] * (nu...
#!/usr/bin/env python import numpy as np import cv2 from edge_impulse_linux.runner import ImpulseRunner import math import psutil class ImageImpulseRunner(ImpulseRunner): def __init__(self, model_path: str): super(ImageImpulseRunner, self).__init__(model_path) self.closed = True self.label...
from PyQt5.QtWidgets import QLabel from PyQt5.QtCore import Qt import util # noinspection PyUnresolvedReferences class MusicPositionLabel(QLabel): def __init__(self, parent=None): super(MusicPositionLabel, self).__init__(parent) self.setGeometry(10, 50, 63, 15) self.setText("00:00") ...
import json from flask import make_response class JiaError(Exception): def __init__(self, code=500, message='Server error', data=None): self.code = code self.data = data super(JiaError, self).__init__(message) def to_response(self): return make_response(json.dumps({'message': self.message, ...
from .Parser import NumberNode, NOOPNode, NodeTypes import random def func_PEEK(visitor, *args): if args == (): # Return random return visitor.matrix.get(random.randint(0, 4), 0) else: # Return specific return visitor.matrix.get(args[0].value, 0) def func_DROP(visitor, *args): rows = visit...
from vega import * Int, Pointer, PointerOffset = Value('Int'), Value('Pointer'), Value('PointerOffset') Any = Sort('Any', [Int, Pointer, PointerOffset]) def symvar(name): return Variable(name, Any) def Reg(name): return symvar("Reg_{}".format(name)) def add(dst, src): return Implies( Not(Eq(dst,...
# Lint as: python2, python3 # Copyright 2019 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 l...
# coding=utf-8 # Copyright 2022 The Google Research Authors. # # 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 applicab...
import logging solver = logging.getLogger('solver') solver.setLevel(logging.DEBUG) solver.addHandler( logging.StreamHandler() )
# uncompyle6 version 2.9.10 # Python bytecode 2.7 (62211) # Decompiled from: Python 3.6.0b2 (default, Oct 11 2016, 05:27:10) # [GCC 6.2.0 20161005] # Embedded file name: Tkconstants.py NO = FALSE = OFF = 0 YES = TRUE = ON = 1 N = 'n' S = 's' W = 'w' E = 'e' NW = 'nw' SW = 'sw' NE = 'ne' SE = 'se' NS = 'ns' EW = 'ew' N...
# Imitation-learners. import torch from torch.utils.tensorboard import SummaryWriter import oatomobile.baselines.torch import oatomobile from oatomobile.envs import CARLAEnv from absl import app from absl import flags from absl import logging logging.set_verbosity(logging.DEBUG) FLAGS = flags.FLAGS flags.DEFINE_str...
#!usr/bin/env python from setuptools import find_packages, setup setup( name="clib", version="0.1.9", description="Neural Network module with chainer", url="https://github.com/Swall0w/clib", install_requires=['numpy', 'chainer', 'scikit-image'], license=license, packages=find_packages(excl...
# -*- coding: utf-8 -*- """ Created on Fri Aug 28 17:42:28 2020 @author: robson """ from bs4 import BeautifulSoup as bs from selenium import webdriver import pandas as pd from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as EC from selenium....
import subprocess import sys from docutils.parsers.rst import Directive def setup(app): app.add_directive('yt_showfields', ShowFields) setup.app = app setup.config = app.config setup.confdir = app.confdir retdict = dict( version='1.0', parallel_read_safe=True, parallel_...
""" Precomputes the filter for the onfly_boolean format """ from RecSearch import GetProgramLocation import argparse import ast import pandas as pd from RecSearch.DataInterfaces.Filters.onfly_boolean import IXFilterOnFly def main(data: str, filter_file: str, output_file: str): df = pd.read_csv(data, index_col=0) ...
import copy from collections import OrderedDict import numpy as np import torch from torch import nn from . import modules, utils class _BaseModel(nn.Module): """ Adds some base functionality to models that inherit this class. """ def __init__(self): super(_BaseModel, self).__setattr__('kwar...
# Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the LICENSE # file in the root directory of this source tree. from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_li...
import boto3 import botocore from botocore import UNSIGNED from botocore.client import Config import zipfile import sys import threading BUCKET_NAME = 'carnd-dataset-hohne' KEY = 'dataset_carnd_behavioral_cloning.zip' class ProgressPercentage(object): def __init__(self, filename): self._filename = filena...
import pytest from pydantic import BaseModel, Field from sitri.providers.contrib.yaml import YamlConfigProvider from sitri.settings.contrib.yaml import YamlSettings @pytest.fixture(scope="module") def path_to_yaml() -> str: return "tests/unit/settings/yaml/data.yaml" @pytest.fixture(scope="module") def yaml_co...
# -*- coding: utf-8 -*- """ Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available. Copyright (C) 2017-2021 THL A29 Limited, a Tencent company. All rights reserved. Licensed under the MIT License (the "License"); you may not use this file except in co...
import logging import acoustid import search.musicbrainz.musicbrainz_search as mb from musicfile.musicfile import MusicFile from utils.update_musicfile import update_musicfile # TODO use .env apikey = "xZI2oVLvE7" class AccoustIdNoMatch(Exception): def __init__(self, message=""): self._message = messag...
#!/usr/bin/env python3 from simtk.openmm.app import * from simtk.openmm import * from simtk.unit import * from sys import stdout, exit, stderr import getopt, os, time, random, math, traceback, io, sys, string import parmed as pmd import numpy as np sys.setrecursionlimit(int(1e6)) usage = '\nUsage: create_cg_protein_m...
import pytest import logging import struct import base64 import msgpack import nacl.signing import algosdk from . import txn_utils from . import ui_interaction from . import speculos from algosdk.future import transaction from Cryptodome.Hash import SHA256 OPERATION_UI_TEXT = ['NoOp', 'OptIn', 'CloseOut', 'ClearS...
from django.shortcuts import render from .models import Event from .serializers import EventSerializer from rest_framework import viewsets, permissions from rest_framework.decorators import api_view, permission_classes from rest_framework.response import Response # Create your views here. @api_view(["GET"]) @...
MODEL_HANDLE_MAP = { "efficientnetv2-s": "https://tfhub.dev/google/imagenet/efficientnet_v2_imagenet1k_s/feature_vector/2", "efficientnetv2-m": "https://tfhub.dev/google/imagenet/efficientnet_v2_imagenet1k_m/feature_vector/2", "efficientnetv2-l": "https://tfhub.dev/google/imagenet/efficientnet_v2_imagenet1k_l/fea...