text stringlengths 6.04k 39.5k |
|---|
# -*- coding: utf-8 -*-
# @Author: <NAME> <valle>
# @Date: 28-Aug-2017
# @Email: <EMAIL>
# @Filename: views.py
# @Last modified by: valle
# @Last modified time: 02-Mar-2018
# @License: Apache license vesion 2.0
from django.conf import settings
from django.forms.models import model_to_dict
from django.db.models i... |
# Copyright The IETF Trust 2019, All Rights Reserved
# Copyright 2015 Cisco and its affiliates
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2... |
"""
Benchmark for ImageJ plugin - bUnwarpJ
see: http://imagej.net/BUnwarpJ
INSTALLATION:
1. Enter the application folder in this project
>> cd <BIRL>/applications
2. Download Fiji - https://fiji.sc/
>> wget https://downloads.imagej.net/fiji/latest/fiji-linux64.zip
3. Extract the downloaded application
>> u... |
# <NAME>
# CSC 110
# Fall 2015
def getChoice():
# Displays all of the possible functions to the user
# and asks the user for their choice. This is done until the
# correct input is entered in by the user (i.e. an integer
# beteen 1 - 8)
print("")
print(" Please specify your search criteria so ... |
# -*-coding:utf-8-*-
# -*-coding:utf-8-*-
import sys
import os
sys.path.append(os.path.abspath(os.path.join(__file__, "..", "..")))
import os
import json
import warnings
import random
from functools import partial
import numpy as np
import paddle
import paddle.nn.functional as F
from paddlenlp.data import Stack, Tupl... |
"""Integer optimization of livestock and water services."""
import os
import sys
import shutil
from osgeo import gdal
import re
import pandas
import numpy as np
import pygeoprocessing.geoprocessing
import marginal_value as mv
def integer_optim_Peru(objective_list, suf):
"""Calculate optimal intervention portfol... |
"""Util functions for CIFAR10/100."""
from collections import OrderedDict
from pathlib import Path
from typing import Callable, Dict, List, Optional, Tuple
import matplotlib.pyplot as plt
import numpy as np
import numpy.typing as npt
import torch
from flwr.common.parameter import weights_to_parameters
from flwr.common... |
import os
import sys
import tensorflow as tf
import numpy as np
import tf_util
from pointnet_util import pointnet_sa_module, pointnet_fp_module
def placeholder_inputs(batch_size, num_point, num_frame):
pointclouds_pl = tf.placeholder(tf.float32, shape=(batch_size, num_point, 3))
pc_target_pl = tf.placeholder(t... |
from db import paients_calculated,paients_merged,paients_info
from logger import logger
from datetime import datetime
from setting import names, nu_per_ml,protein_per_ml, weight_dict
from pygrowup import Calculator, helpers
import re
import csv
import os
_0=0
def main():
'main entry'
start = datetime.now()
... |
#!/usr/bin/env python
import csv
import sys
import os
import time
# this is the index, each row repressents a different genotypic outcome
# I run each outcome against the freq of A going from 0 to 100.
# I create a dictionary that holds the allele 1 and allele 2 totols for
# each genotype (row) and each frequency (0-1... |
from molSimplify.Scripts.cellbuilder_tools import *
from molSimplify.Classes import mol3D
from molSimplify.Informatics.autocorrelation import*
from molSimplify.Informatics.misc_descriptors import*
from molSimplify.Informatics.graph_analyze import*
from molSimplify.Informatics.RACassemble import *
import os
import numpy... |
import asyncio
import datetime
import logging
import atexit
from botocore.exceptions import ClientError
from .dynamodb import DynamoDB
from .boto_exceptions import RETRY_EXCEPTIONS
from .kinesis_consumer_manager import consumerManager
log = logging.getLogger(__name__.split('.')[-2])
class ReaderExitException(Except... |
import numpy as np
from interp import *
import matplotlib.pyplot as plt
import sys
import math
from finite_differences_x import *
from read_EFIT import read_EFIT
#Created by <NAME> 11/02/2020
#Last edited by <NAME> 03/29/2020
#Supported by scripts in IFS
def read_pfile(p_file_name):
f=open(p_file_name,'r')
... |
from tkinter import *
from random import randint
from tkinter import messagebox as msg
import os
import pygame
import csv
import sys
#import numpy as np
sys.stdout = open("exec_log\\stdout.txt",'w')
sys.stderr = open("exec_log\\stderr.txt","w")
def Game(mode):
print('Its Game mode <',mode,'>')
i... |
#!/usr/bin/env python3
""" ********************************************************
Project: nita-yaml-to-excel
Version: 21.7
Copyright (c) Juniper Networks, Inc., 2021. All rights reserved.
Notice and Disclaimer: This code is licensed to you under the Apache 2.0 License (the "License"). You may not use this code e... |
import torch
import torchvision.transforms as transforms
import numpy as np
import cv2
from utils.ddfa import ToTensor, Normalize, str2bool
import scipy.io as sio
from utils.inference import get_suffix, parse_roi_box_from_landmark, crop_img, predict_68pts, dump_to_ply, dump_vertex, \
draw_landmarks, predict_dense, ... |
import cv2
import numpy as np
import tensorflow as tf
from tensorflow.contrib.layers import flatten
import datetime
import os
import csv
import sklearn
from sklearn.model_selection import train_test_split
from sklearn.utils import shuffle
import pickle
import random
import argparse
def prepare_data():
# read csv... |
#!/usr/bin/env python
"""
Copyright (c) 2016, <NAME>
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions an... |
# Generated from C:\Temp\QueryParser\Grammars\BuildEnvironment\..\QueryParser.g4 by ANTLR 4.7
# encoding: utf-8
from __future__ import print_function
from antlr4 import *
from io import StringIO
import sys
def serializedATN():
with StringIO() as buf:
buf.write(u"\3\u608b\ua72a\u8133\ub9ed\u417c\u3... |
# Author: <NAME>
import sys
from decouple import config
sys.path.insert(0, config("ROOT_DIR"))
from application.utils.basic import *
from application.utils import general
from application.Connections import Connection
from predict_location.predictor import Predictor # for location
def getLocalInfluencers(topic_id, ... |
import torch
from torch import nn
from ..layers.pooling import PoolingLayer
from ..layers.layers import LinearAggregationLayer, CharEncoder
from ..utils.torch import to_var, pack_forward
class CharEmbeddingLayer(nn.Module):
def __init__(self, embeddings, use_cuda=True):
super(CharEmbeddingLayer, self).... |
"""Tests for the opmodel module."""
import decimal
import doctest
import itertools
import math
import unittest
from hypothesis import given, example, settings, assume # unlimited, HealthCheck
# useful hypothesis decorator
# @example(arg0=..., arg1=..., ...)
# @settings(max_examples=10000, deadline=None)
from hypothes... |
import torch
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F
from torch.autograd import Variable
import random, math, os, time
import numpy as np
import pandas as pd
from sklearn.preprocessing import MinMaxScaler
import matplotlib.pyplot as plt
import matplotlib.ticker as ticker
from... |
# -*- coding: utf-8 -*-
"""
Created on Fri Jul 26 07:55:52 2019
@author: buriona
"""
import sys
import logging
import json
import pandas as pd
import numpy as np
from pathlib import Path
import plotly
from os import makedirs, path
from calendar import monthrange
from datetime import datetime as dt
from dateutil.relat... |
"""
The following file creates and executes models with SEIR structures. It
then graphs the results and presents the models' underlying compartmental
structure.
Although the structure of these models are simple and widely accepted, the
specific parameter values are taken from the following text: "An Introduction
to I... |
#
# Copyright (c) 2015 nexB Inc. and others. All rights reserved.
# http://nexb.com and https://github.com/nexB/scancode-toolkit/
# The ScanCode software is licensed under the Apache License version 2.0.
# Data generated with ScanCode require an acknowledgment.
# ScanCode is a trademark of nexB Inc.
#
# You may not use... |
import math
from typing import Dict, Optional, Tuple
import numpy as np
import torch
import torch.nn as nn
from torch import Tensor
from torch_utils import misc, persistence
from .layers import EqLRConv1d, FullyConnectedLayer
def construct_frequencies(num_freqs: int, min_period_len: int, max_period_len: int) -> Te... |
#!/usr/bin/python3
#
# prom.py - create a user for Prometheus remote write
#
#
from __future__ import print_function
import argparse, os, sys, json, random, time
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '../common')))
from mdtsdb import Mdtsdb
import utils
from utils import (new_use... |
from __future__ import print_function
import numpy as np
import chainer
from chainer import optimizers
import chainer.functions as F
import chainer.links as L
import matplotlib.pyplot as plt
import time
###### ASCIII IMPORT ######
filename_titleshigh = 'titlesASCII_high_DictComp.txt' # Top 25% cited titles - better q... |
#
# Copyright 2021 Espressif Systems (Shanghai) 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 sys
from os import PathLike
from typing import List, Optional, Union, Mapping, Dict, IO
from pathlib import Path
from urllib.parse import urlencode
from vespa.package import (
ModelConfig,
Task,
OnnxModel,
QueryTypeField,
Field,
Function,
RankProfile,
)
from vespa.json_serialization ... |
#!/usr/bin/env python
# pyOCD debugger
# Copyright (c) 2018 Arm Limited
# SPDX-License-Identifier: Apache-2.0
#
# 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/li... |
import math
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.nn.modules.utils import _triple
from network.model.graph_front.graphFront import _graphFront
from network.model.tgcn.gcn import ConvTemporalGraphical
from network.model.roi_align.modules.roi_align import RoIAlignAvg
class Spat... |
import argparse
import glob
import re
import sys
from typing import List
print_columns = ["name", "total_synthesis_time"]
regel_columns = ["regel_time", "regel_timeout", "regel_sketch", "regel_solution"]
all_columns = ["name", "enumerator", "timed_out", "total_synthesis_time", "regex_synthesis_time",
... |
import vtk
import numpy as np
from lib.simpleFunctions import simpleObjects as sO
import matplotlib.pyplot as plt
from matplotlib import colors as cl
import os, json
from datetime import datetime as dt
# ---------------------------------------------------------
# Global variables are always bad. However, there
# appe... |
#!/usr/bin/env python3
"""
File name: netsim.py
Author: <NAME>
email: <EMAIL>
Date created: 02/09/2017 (DD/MM/YYYY)
Python Version: 3.5
Description:
Core module which generates the physical network of sticks which is used to
produce the electrical network. The total physical and electric... |
import sc2
from sc2 import run_game, maps, Race, Difficulty
from sc2.player import Bot, Computer
from sc2.constants import NEXUS, PROBE, PYLON, ASSIMILATOR, GATEWAY, CYBERNETICSCORE
from sc2.constants import STALKER, STARGATE, VOIDRAY, OBSERVER, ROBOTICSFACILITY
from sc2.position import Point2
from datetime import dat... |
from __future__ import print_function
import argparse
import os
import shutil
import time
import random
import numpy as np
import torch
import torch.nn as nn
import torch.nn.parallel
import torch.backends.cudnn as cudnn
import torch.optim as optim
import torch.utils.data as data
import torchvision.transforms as tran... |
"""
@Project : Imylu
@Module : decision_regression.py
@Author : Deco [<EMAIL>]
@Created : 8/22/18 4:29 PM
@Desc :
"""
import copy
# from collections import Iterable
from typing import List, TypeVar, Tuple, Union, Iterable
import numpy as np
from work5.load_bike_data import load_bike_sharing_data
from ... |
"""
Differentiable Programming Quantum Control
Example: Preparation of GHZ states in a spin chain
"""
import os, sys
sys.path.append('..')
# import common parameters
import parameters_spinchain
import numpy as np
import qutip as qu
import argparse
import pickle # to store and visualize output
import time
imp... |
# Copyright (c) 2018-2020 MobileCoin Inc.
import qrcode
import sys
import os.path
import traceback
import json
import time
import re
import grpc
import cmd
from mob_client import mob_client
def mob_command(func):
""" Decorator to handle possible errors
"""
def wrapper(session, *args, **kwargs):
... |
"""
Support SmartMi acpartner.
For more details about this platform, please refer to the documentation
https://home-assistant.io/components/demo/
"""
import logging
import asyncio
from datetime import timedelta
import voluptuous as vol
from homeassistant.core import callback
from homeassistant.components.climate impo... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function
from six.moves import reduce
import fractions
import ibeis
import numpy as np
#import plottool as pt
import random
import scipy as sp
import utool as ut
from six.moves import builtins
import six
(print, rrr, profile) = ut.inject2(_... |
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
import datetime, logging
import operator
import os
import webbrowser
import zipfile
from pathlib import PurePath
from PyQt5.QtCore import QAbstractTableModel, Qt
from PyQt5.QtGui import QFont
from PyQt5.QtWidgets import QFrame, QPushButton, QHBoxLayout, QVBoxLayout, QLa... |
from datetime import datetime
from gemini.classes.Order import Order
# from gemini.orderwebsocketclient import OrderEventsWS
from gemini.restclient import Client
import time
import sys
import gemini.tracker as tracker
import gemini.interface as interface
import os
import threading
import gemini.logger
import logging
i... |
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the... |
"""
Script que gerencia um inventário de máquinas no SCVMM, com base
em um arquivo YAML.
"""
import re
import string
import os
import argparse
from distutils.util import strtobool
import configargparse
from ruamel.yaml import YAML, scanner
from vmm_manager.infra.servidor_acesso import ServidorAcesso
from vmm_manager.in... |
import torch
from torch.autograd import Variable
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
import numpy as np
import random as rd
from configure import args
import os
# 加载word embedding table
def load_word_embedding_table():
# # vec : [ 0.198994, 0.219711, -0.19... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
@author: <NAME>
YEARS: 2019 - 2021
CMIP6 model analysis
This script is used to calculate the area averaged sea surface temperature
Globally and south of 35S
The averaging period is the last 30 years of the 150 years long simulations
For piControl, the time period is s... |
'''The gradient for steepest direction, i.e. <Cm, d/dm(-log(posterior))>
is equal to Adjoint(G).(g(m) - d_obs) + (m - m_prior) = Cm.G^t.Cd^-1 .( g(m) - d_obs ) + (m - m_prior)'''
from ionotomo.geometry.tri_cubic import bisection
import numpy as np
from scipy.integrate import simps
import dask.array as da
from... |
import sys
import hashlib as hl
import math
import matplotlib.pyplot as plot
# debug flag
debug = 1
# Global Var
nextPageNum = 1 # next available page, starting from 1, 0 reserved for Super Page
rowid = 0 # rowid counter
indexType = 9999
global inDB_file
global indexFile_file
# Global Counter
buckets_count = 0
reg... |
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import warnings
from functools import wraps
from scipy.spatial.distance import pdist
from sklearn.metrics import silhouette_score, classification_report, roc_curve, auc
from sklearn.linear_model import LogisticRegression
from sklearn.ensemble import... |
#!/usr/bin/env python
import os
import shutil
import pickle
import numpy as np
import copy
import json
import cmiles
from openeye import oechem
from forcebalance.molecule import Molecule
from openforcefield.typing.engines.smirnoff import ForceField
from simtk.openmm import app, unit
import qcportal as ptl
client ... |
import configparser
from pathlib import Path
from typing import (
Dict,
Mapping,
NamedTuple,
NewType,
Optional,
Sequence,
Tuple,
TypeVar,
)
from afancontrol.arduino import (
DEFAULT_BAUDRATE,
DEFAULT_STATUS_TTL,
ArduinoConnection,
ArduinoName,
ArduinoPin,
Arduino... |
import numpy as np
BOARD_SIZE = 8
UNIT_TYPE = 4
INPUT_LAYER = UNIT_TYPE + 1
POS_SIZE = (BOARD_SIZE ** 2) // 2
KEY_SIZE = POS_SIZE ** 2
V2C = {
0: '.',
1: 'x',
2: 'X',
-1: 'o',
-2: 'O',
}
KEY_ROT180 = [(BOARD_SIZE - y - 1) * BOARD_SIZE + (BOARD_SIZE - x - 1) for y in range(BOARD_SIZE) for x in ... |
#!/usr/bin/env python3
# Copyright 2021 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.
"""Creates a table of unwind information in Android Chrome's bespoke format."""
import abc
import ctypes
import enum
import re
from ty... |
import os
import matplotlib.pyplot as plt
LABEL_SIZE = 24
TICK_SIZE = 24
LEGEND_SIZE = 24
MARK_SIZE = 18
ppscanno_knl_folder = '/home/yche/mnt/luocpu8/nfsshare/share/python_experiments/ppSCANNO_knl'
ppscan_knl_folder = '/home/yche/mnt/luocpu8/nfsshare/share/python_experiments/scalability_simd_paper2'
thread_num_knl =... |
# -*- coding: utf-8 -*-
from numpy import sin, cos, sqrt, arctan2, pi
from typing import Optional, Union
import numba as nb
import numpy as np
from ._coeffs import get_coeffs, malloc_coeffs, SH
from ..jited import geodetic2geocentric as _geodetic2geocentric_scalar
from .._debug import typechecked
FACT = 180.0 / pi... |
from collections import OrderedDict, namedtuple
from string import whitespace
import pdb
import sys
ADD = 'ADD'
SUB = 'SUB'
MUL = 'MUL'
INT_DIV = 'INT_DIV'
REAL_DIV = 'REAL_DIV'
DOT = 'DOT'
SEMI = 'SEMI'
COLON = 'COLON'
COMMA = 'COMMA'
PROGRAM = 'PROGRAM'
... |
# Title: ADConversion.py
# Purpose: Convert values from csvde output from Active Directory
import os
import sys
import csv
import binascii
from datetime import datetime, timedelta
import fileinput
csv.field_size_limit(1000000000)
options = {'512' : 'Enabled',
'514' : 'Disabled',
'528' : 'Enable... |
import pandas as pd
import math
import numpy as np
import matplotlib.pyplot as plt
from dtwalign import dtw
def RMS(tmp):
return np.sqrt((np.square(tmp[0]))+(np.square(tmp[1]))+(np.square(tmp[2])))
def CalRMS(X,Y,Z):
arrtmp = []
for i in range(len(X)):
a = X[i]
b = Y[i]
c = Z[i]
... |
#Ligthning data module
from . import __file__
from skimage import io
from distributed import as_completed
from PIL import Image
import glob
import geopandas as gpd
import numpy as np
import os
import pandas as pd
from pytorch_lightning import LightningDataModule
from src import generate
from src import CHM
from shapely... |
import copy
import numpy as np
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
import torch
import torch.autograd as autograd
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from .grad_utils import *
from collections import deque
import logging
class DDPG... |
import warnings
warnings.simplefilter('ignore', category=[DeprecationWarning, FutureWarning])
import numpy as np
import time
from sklearn.gaussian_process import GaussianProcessRegressor
from sklearn.gaussian_process.kernels import RBF, WhiteKernel, ConstantKernel as C
from sklearn.model_selection import train_test_... |
from datetime import datetime, timedelta
from io import BytesIO
import json
from datetime import datetime, timedelta
import pytest
from unittest.mock import patch
from flask import current_app, g
from computable.helpers.transaction import call, transact
from computable.contracts.constants import PLURALITY
from tests.he... |
from dataclasses import dataclass
from typing import List, Union
import numpy as np
import pytest
from pytest_cases import cases_data, THIS_MODULE
from eddington import (
constant,
exponential,
hyperbolic,
linear,
parabolic,
polynom,
cos,
sin,
straight_power,
inverse_power,
... |
# deafrica_classificationtools.py
'''
Description: This file contains a set of python functions for applying
machine learning classifiying remote sensing data from Digital Earth
Africa
License: The code in this notebook is licensed under the Apache License,
Version 2.0 (https://www.apache.org/licenses/LICENSE-2.0).... |
# Leo colorizer control file for interlis mode.
# This file is in the public domain.
# Properties for interlis mode.
properties = {
"blockComment": "!!",
"commentEnd": "*/",
"commentStart": "/*",
}
# Attributes dict for interlis_main ruleset.
interlis_main_attributes_dict = {
"default": "n... |
import argparse
#-----------------------------
# Command Line Options
#-----------------------------
description = "Create real-time maps of the magnetic field across the US."
parser = argparse.ArgumentParser(description=description)
parser.add_argument('--outdir', action='store',
required=False, ... |
"""
Functions to find the pipeline inputs and communicate with the SM server
"""
import logging
import sys
from dataclasses import dataclass
from typing import List, Dict, Optional, Set, Collection
import pandas as pd
from hailtop.batch import Batch
from hailtop.batch.job import Job
from sample_metadata.apis import ... |
#!/usr/bin/env python3
################################################################################
# Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),... |
import mayavi.mlab as mlab
import numpy as np
import torch
from pcdet.ops.iou3d_nms.iou3d_nms_utils import boxes_iou3d_gpu
box_colormap = [
[1, 1, 1],
[0, 1, 0],
[0, 1, 1],
[1, 1, 0],
]
iou_threshold = [1, 0.7, 0.5, 0.5]
def check_numpy_to_torch(x):
if isinstance(x, np.ndarray):
return to... |
"""
Code adapted from JMEE
"""
import os
cwd = os.getcwd()
import sys
from pathlib import Path
sys.path.append(os.path.join(Path(os.getcwd()).parent, "OnlineAlignment"))
import torch
import torch.nn as nn
from torch.nn import init
import torch.nn.functional as F
import numpy as np
from CRF import *
from pytorch_pretra... |
#!/usr/bin/env python3
# mc_chain_sw_module.py
#------------------------------------------------------------------------------------------------#
# This software was written in 2016/17 #
# by <NAME> <<EMAIL>>/<<EMAIL>> #
# and <NAME> <<EM... |
import logging
import os
import shutil
import subprocess
import tempfile
import xml.etree.ElementTree
"""All files in these directories will be included in a bsa."""
BSA_INCLUDE_DIRS = ["grass", "interface", "lodsettings", "meshes", "music",
"textures", "scripts", "seq", "sound", "strings"]
"""All ... |
import os
from typing import Union, List
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import matplotlib as mpl
import matplotlib.colors as colors
import matplotlib.cm as cm
from scipy.io import netcdf
from lrgwd.utils.io import from_pickle
LAST_PLEVEL = 33 #26 18
LOWEST_PLEVEL = 2
FEAT = "u... |
from collections import deque
import sys
import math
import heapq
import random
import itertools
def gs():
return sys.stdin.readline()
def gd():
return float(sys.stdin.readline())
def gi():
return int(sys.stdin.readline())
def gia():
return list(map(int, sys.stdin.readline().split()))
def gsa(... |
#!/usr/bin/env python
# coding: utf-8
# # Developing an AI application
#
# Going forward, AI algorithms will be incorporated into more and more everyday applications. For example, you might want to include an image classifier in a smart phone app. To do this, you'd use a deep learning model trained on hundreds of tho... |
#Author: <NAME>
#Assemble 3x3 bitmask tileset using a smaller template.
#Tool page: https://github.com/HeartoLazor/autotile_generator
#Based on GodotAutotileAssembler from lunarfyre7 (https://github.com/lunarfyre7/GodotAutotileAssembler)
#Developed and tested in python 3.x
#Requirements:
# pillow python library (pip in... |
# -*- coding:utf-8 -*-
# __author__=''
from AutoSummarization.models.entities import Deeplearning
from AutoSummarization.controllers import session_scope
import mxnet as mx
from mxnet import autograd, gluon, nd
from mxnet.gluon import nn, rnn, Block
from mxnet.contrib import text
import time
from io import open
import ... |
import numpy as np
import pyautogui as pg
from scipy.sparse import csr_matrix
from scipy.signal import convolve2d
pg.PAUSE = 0
pg.FAILSAFE = True
_width, _height = pg.size()
## put hero in the center of the camera
#def center_hero():
# tmp = pg.PAUSE
# pg.PAUSE = 0
# for i in range(570, 820, 60):
# pg.click(x=... |
import asyncio
import functools
import logging
import socket
from collections import namedtuple
__version__ = '0.0.1'
Limits = namedtuple('Limits', 'read_high read_low write_high write_low')
logger = logging.getLogger(__package__)
_DEFAULT_LIMITS = Limits(2 ** 16, 2 ** 14, 2 ** 16, 2 ** 14)
async def open_con... |
# Copyright (c) 2019 UniMoRe, <NAME>
import torch
import torch.nn as nn
# In order for the baselines to be launched with the same logic as quantized
# models, an empty quantization scheme and an empty thermostat schedule need
# to be configured.
# Use the following templates for the `net` and `thermostat` configurat... |
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import sys
from sklearn.datasets import fetch_mldata
from sklearn.decomposition import PCA
from sklearn.manifold import TSNE
from mpl_toolkits.mplot3d import Axes3D
import seaborn as sb
from matplotlib.lines import Line2D
import time as time
from sk... |
"""
An opinionated HTTP client for consuming PerformLine internal APIs.
"""
from __future__ import absolute_import
from six import string_types
import logging
import requests
import requests_mock
import requests.exceptions
import time
import re
from datetime import datetime
import yaml
import uuid
from .responses impor... |
__author__ = "<NAME>"
__version__ = "0.1.0"
__license__ = "MIT"
import os
import unittest
from io import StringIO
from simstat import Conf, Stat, MultiStat
from utils import TestDirectory
def make_simple_stat(**kwargs):
stat = Stat(Conf(par1=42, par2="hello"))
for k, v in kwargs.items():
stat.change_... |
#!/usr/local/bin/python3
import re
import sys
import os.path
re_beg_mma_environ = re.compile (r'^\s*\\begin{mathematica}')
re_end_mma_environ = re.compile (r'^\s*\\end{mathematica}')
re_beg_mma_verbatim = re.compile (r'^\s*\\MmaSetup{(.*?)action=verbatim')
re_end_mma_verbatim = re.compile (... |
""" Test the file recognizer capabilities.
"""
from __future__ import print_function
import gzip
import os
import shutil
import socket
import sys
import nose
from grin import FileRecognizer, ints2bytes, GZIP_MAGIC
def empty_file(filename, open=open):
f = open(filename, 'wb')
f.close()
def binary_file(filen... |
"""Module to attack substitution cipher texts.
This module uses a word patter matching method to guess probable key used to cipher
a text using substitution algorithm.
You should be aware that to be successful charset used for attack should be the
same used to cipher. Besides, this module tries to guess if deciphered... |
from .point_pillars import PointPillars
from ..registry import DETECTORS
import torch
from torch import nn
@DETECTORS.register_module
class PolarStream(PointPillars):
"""
PolarStream model for simultaneous object detection, semantic segmentation and panoptic segmentation.
Compatible with polar and cartesi... |
#!/usr/bin/env python
# This script has been built on top of https://github.com/huggingface/transformers/blob/0d1f67e651220bffef1441fa7589620e426ba958/examples/pytorch/token-classification/run_ner.py
# Copyright claim from original source:
# coding=utf-8
# Copyright 2020 The HuggingFace Team All rights reserved.
#
# L... |
"""
@author: <NAME>
@since: 21/08/2016
@modified:
A BST implementation supporting
- insert = O(h)
- remove = O(h)
- look up = O(h)
- get min = O(h)
- get max = O(h)
assuming left < key =< right
Time Complexity:
- best case, avg case = O(log n) as in inserting, removing, looking up, finding min/max we needed to ... |
"""A script to select the mixture property data points to include
in the expanded test set.
"""
import functools
import json
import logging
import os
from collections import defaultdict
from math import sqrt
from multiprocessing.pool import Pool
from tempfile import TemporaryDirectory
import numpy
import pandas
from e... |
"""The AnyToAnyConvolutionBase class and associated tooling."""
import abc
from typing import Any, Callable, Mapping, Optional
import tensorflow as tf
from tensorflow_gnn.graph import graph_constants as const
from tensorflow_gnn.graph import graph_tensor as gt
from tensorflow_gnn.graph import graph_tensor_ops as ops... |
import os
import shutil
import textwrap
import numpy as np
from rdkit import Chem
from .calculator import Calculator, CalculatorError
from elementary_step_om.xyz2mol_local import xyz2AC_vdW
from elementary_step_om.io import io_xtb
from elementary_step_om.chem import Reaction
def get_xtb_version(xtb_path):
""" "... |
from numbers import Real, Integral
import numpy as np
from python2latex import FloatingTable, FloatingEnvironmentMixin
from python2latex import TexEnvironment, TexCommand, build, bold, italic
"""
TODO:
- Remove as_float_env?
- Add col_space params
"""
class Table(FloatingEnvironmentMixin, super_class=FloatingTable):... |
import numpy as np
from PyQt5.QtGui import *
from PyQt5.QtCore import *
from PyQt5.QtWidgets import *
from grasp import GraspRect, GraspRectBuilder
class PainterGen(object):
def __init__(self):
self.origin = QPointF(0., 0.)
self.scale = 1.
# self.base_scale = 1.
# def setBaseScale(s... |
import addnn
import addnn.controller.controller
import addnn.grpc
import addnn.profile
import addnn.serve.cli
import addnn.util.controller
import click
import csv
import google.protobuf.json_format
import grpc
import multiprocessing
import os
import pickle
import random
import torch
import time
from abc import ABC, abs... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Feb 10 11:25:47 2020
Create options object
@author: shaama
Cleaning up from the previous version and removing error calculation for ZPE and deltaG from
this file
"""
import numpy as np
import numpy.ma as ma
from vmc import vmc
import pandas as pd
from ... |
#!/usr/bin/env python3
import unittest
from planet import Direction, Planet
class ExampleTestPlanet(unittest.TestCase):
def setUp(self):
"""
Instantiates the planet data structure and fills it with paths
+--+
| |
+-0,3------+
| |
0,2-----2,2 (t... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.