text stringlengths 3.07k 22.1k |
|---|
import torch
from torch import nn
from torch.nn import Parameter
jit_scripts = {}
class StochasticModule(torch.nn.Module):
def __init__(self, *args, **kwargs):
super(StochasticModule, self).__init__(*args, **kwargs)
class BDropout(StochasticModule):
"""
Extends the base Dropout layer by ad... |
import sys
import re
from pathlib import Path
import logging
from typing import Optional, Union
import pandas as pd
logger = logging.getLogger(__name__)
class GradsCtl(object):
def __init__(self):
self.dset = None # data file path
self.dset_template = False
self.title = ''
sel... |
'''some useful functions while working with shell'''
from __future__ import print_function
from cloudmesh.user.cm_user import cm_user
import json
from cloudmesh_common.tables import array_dict_table_printer, dict_key_list_table_printer
from cloudmesh_base.util import banner
import csv
from cmd3.console import Console
i... |
import json
import pytest
from lxml import etree
import numpy as np
import xarray as xr
import pandas as pd
import finch
import finch.processes
from finch.processes.wps_xclim_indices import XclimIndicatorBase
from finch.processes.wps_base import make_xclim_indicator_process
from . utils import execute_process, wps_inp... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import argparse
import io
import os
import pathlib
import random
import shutil
import typing
from datetime import datetime
from os.path import join
import sqlite3
from PyPDF2 import PdfFileReader, PdfFileWriter
from PyPDF2.generic import Destination
#####################... |
import pyPLUTO as pp
import numpy as np
import matplotlib.pyplot as plt
import os, shutil, sys
from multiprocessing import Pool
# Value of theta and m
# TODO : Extract this directly from the run
gamma = 5.0/3.0
theta = 10.0
m = 1.0
def create_directory(path):
'''
Creates given directory.
Removes exist... |
from typing import List, Union
import torch.utils.data
import numpy
from torch.optim.optimizer import Optimizer
import torch
import torchvision
from .utils.data import new_dataset
from .utils.toolkit import *
import warnings
import time
def fit(model: torch.nn.Module = None,
train_dataset: torch.utils.data.Da... |
from pathlib import Path
import pandas as pd
import logging
import click
import datetime
from imgdb.utils import Tcolors, unzip, pickler
from imgdb.config import Config
from imgdb.imdb_poster_fetcher import imdb_download_poster
import re
def datasets_updater(freq):
"""This functions downloads Imdb's datasets and ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Created by pat on 4/9/18
"""
.. currentmodule:: modeldoc.py
.. moduleauthor:: <NAME> <<EMAIL>>
This module contains a Sphinx extension that can be used to generate specialized
documentation for model classes.
"""
import logging
import uuid
from typing import Any, cast, ... |
# Copyright (c) 2022 by <NAME>
# Copyright (c) 2012 - 2021, Udacity, Inc.
# All rights reserved.
# This file is part of the computer vision course project submission of Udacity's Self-driving
# Cars Nanodegree Program. It has been developed based on the starter code provided by Udacity
# on https://github.com/udacity/n... |
""" Contains all the logic """
from enum import Enum
# R1 R2
# --[======]-----[======]--
# | | |
# V_in V_out GND
# V_out / V_in = R2 / (R1 + R2)
# resistor_ratio = R1 / R2
class RatioType(Enum):
""" Allows distinguishing between resistor ratios ... |
# Copyright 2016 VMware, Inc.
# All Rights Reserved
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by a... |
# Copyright 2016 Huawei, Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... |
# coding=utf-8
"""
Generates Project Structure
"""
import logging
import os
from os import path
import pickle
import shutil
import subprocess
import tempfile
import toposort
from pgdumplib import directory, toc
from pg_lifecycle import common
LOGGER = logging.getLogger(__name__)
class Generate:
"""Generate Pr... |
import os
import gc
import xnas.core.checkpoint as checkpoint
import xnas.core.config as config
import xnas.core.logging as logging
import xnas.core.meters as meters
from xnas.core.builders import build_space
from xnas.core.config import cfg
from xnas.core.trainer import setup_env, test_epoch
from xnas.datasets.loader... |
from sqlalchemy import *
import sqlalchemy.schema
import uuid
from sqlalchemy.sql import select
from migrate import *
import migrate.changeset
from migrate.changeset.constraint import ForeignKeyConstraint, PrimaryKeyConstraint
metadata = MetaData()
def make_uuid():
return unicode(uuid.uuid4())
## Tables and col... |
import itertools
#from tqdm import tqdm
from collections import Counter
#from arrs import *
import numpy as np
#import random
import math
#import ctypes
from sympy import primefactors, sieve
from sympy.ntheory import qs
from tqdm import tqdm
sieve._reset() # this line for doctest only
sieve.extend_to_no(40_000)
pri... |
# The MIT License (MIT)
#
# Copyright (c) 2018 <NAME>
#
# 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, me... |
import sys
import os
from os.path import expanduser
from PyQt5.QtWidgets import *
from PyQt5.QtMultimedia import *
from PyQt5.QtCore import *
from PyQt5.QtGui import *
from PyQt5.uic import loadUiType
import time
scriptDir = os.path.dirname(os.path.realpath(__file__))
SCREEN,_ = loadUiType(os.path.join(os... |
# import numpy as np
import jax.numpy as np
from jax import jacfwd
from jax.ops import index_update
def C_b_v(angles):
"""
:param angles: Euler angles, np.ndarray, shape: (3,1)
:return: transition matrix from b-frame to v-frame, np.ndarray, shape: (3,3)
"""
phi, theta, psi = angles.flatten()
... |
import os
import json
import shutil
import tempfile
import contextlib
import functools
from collections import OrderedDict
import numpy as np
import h5py
from quilted.h5blockstore import H5BlockStore
@contextlib.contextmanager
def autocleaned_tmpdir():
tmpdir = tempfile.mkdtemp()
yield tmpdir
shutil.rmtr... |
"""
meffil_functions.py
===================
Contains a few R functions that interact with meffil and minfi.
"""
import rpy2.robjects as robjects
def load_detection_p_values_beadnum(qc_list, n_cores):
"""Return list of detection p-value matrix and bead number matrix.
Parameters
----------
qc_list
... |
import torch
import torch.nn.functional as F
from torch.autograd import Variable
import numpy as np
from PIL import Image
import matplotlib.cm as Pltcolormap
from . import utils
class GradCAM:
"""
Gradient-weighted Class Activation Mapping (Grad-CAM)
Get a coarse heatmap of activation highlighting import... |
import numpy as np
from optlang import Constraint
from scipy import stats
from ..util.constraints import *
from ..util.linalg_fun import *
from ..util.thermo_constants import *
def generate_n_sphere_sample(n_variables):
"""Generates unit n-sphere sample. Works by picking random sample from normal distribution an... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import numpy as np
import os
import xarray as xr
from ooi_data_explorations.common import inputs, m2m_collect, m2m_request, get_deployment_dates, \
get_vocabulary, dt64_epoch, update_dataset, ENCODINGS
from ooi_data_explorations.uncabled.process_phsen import ATTRS, qua... |
import os
import sys
import numpy as np
from pycocotools import mask as maskUtils
import imgaug
import skimage
from matplotlib import pyplot as plt
import cv2
import time
from pycocotools.cocoeval import COCOeval
from pycocotools.coco import COCO
ROOT_DIR = os.path.abspath("../")
# Import Mask RCNN
sys.path.append(... |
import enum
VERSION_MAJOR = 3
VERSION_MINOR = 2
VERSION_REVISION = 1
FOCUSED = 0x00020001
ICONIFIED = 0x00020002
RESIZABLE = 0x00020003
VISIBLE = 0x00020004
DECORATED = 0x00020005
AUTO_ICONIFY = 0x00020006
FLOATING = 0x00020007
MAXIMIZED = 0x00020008
RED_BITS = 0x00021001
GREEN_BITS = 0x00021002
BLUE_BITS = 0x000210... |
import itertools
import pytest
from alphago.games import NoughtsAndCrosses, UltimateNoughtsAndCrosses
from alphago.games.noughts_and_crosses import (GameState, Action, UltimateAction,
UltimateGameState)
class TestBasic3x3NoughtsAndCrosses:
terminal_state = GameStat... |
#!/usr/bin/python
# Get a list of error terms from the Vale rules and generate a correspoding asiidoc reference.
import glob
import os
import re
import shutil
import wget, zipfile
import git
import yaml
import json
import sys
def main():
try:
#initialize some variables
git_repo = git.Repo(os.pa... |
from flask import Flask, flash, request, session
from flask.templating import render_template
from werkzeug.utils import redirect, secure_filename
import bcrypt
from functions.users import check_existing_user, add_new_user, check_user_credentials
from functions.scheduler import add_medicine, fetch_user_schedule, card, ... |
# Chapter 4
# 60 sec/min * 60 min/hr * 24 hr/day
# seconds_per_day = 86400
seconds_per_day = 86400 # 60 sec/min * 60 min/hr * 24 hr/day
# Continue Lines with \
alphabet = 'abcdefg' + \
'hijklmnop' + \
'qrstuv' + \
'wxyz'
print(alphabet)
# Compare with if, elif, and else
disaster = True
if disaster:
p... |
from typing import Tuple
import email
from unittest.mock import patch, Mock, MagicMock
import pytest
from faker import Faker
import doubleratchet.header
from xeddsa.implementations.xeddsa25519 import XEdDSA25519, XEdDSA
from src.tom import Endpoint
from src.tom._mailbox.packet import PlainPacket, SecurePacket
from src.... |
"""Generate plots for the annotations of the blame verifier."""
import abc
import logging
import typing as tp
import matplotlib.pyplot as plt
import matplotlib.ticker as mtick
import numpy as np
import pandas as pd
from matplotlib import style
from sklearn import preprocessing
import varats.paper_mgmt.paper_config as... |
from enum import Enum
from arjuna.configure.impl.container import ConfigContainer
from arjuna.tpi.enums import ArjunaOption, BrowserName
class _ConfigBuilder:
def __init__(self, test_session, config_map, conf_trace, code_mode):
self.__code_mode = code_mode
self.__test_session = test_session
... |
# -*- coding: utf-8 -*-
import sys
import time
import json
import base_64
import hashlib
import requests
import traceback
# ---------------------
PROTOCAL_MAPPING = {
"ICMP": "1",
"TCP": "6",
"UDP": "17",
}
def http_request(method, url, headers=None, params=None, data=None, timeout=10, verify=False,
... |
"""
Primer demo para pysud.
Demuestra uso de eventos locales creados por el usuario.
Demuestra uso de variables definidas por el usuario.
"""
import pysud_gm as gameMgr
import pysud_events as ev
import pysud
# EVENTOS DEFINIDOS POR UN USUARIO:
class EventBotiquin(ev.CommandEvent):
def on_success(self, game):
... |
import cv2
import os
import numpy as np
import av
from torchvision.transforms import Compose, Resize, ToTensor
from PIL import Image
import matplotlib.pyplot as plt
import torch
from torch.utils.data import DataLoader
from dataset import MaskDataset, get_img_files, get_img_files_eval
from nets.MobileNetV2_unet import M... |
import pyqtgraph as pg
from pyqtgraph import GraphicsLayoutWidget
from Utilities.IO import IOHelper
from PyQt5.QtCore import *
from PyQt5.QtWidgets import *
from Utilities.Helper import settings
from pathlib import Path
import numpy as np
from PIL import Image
import datetime
from queue import Queue
from PyQt5 import Q... |
import liquepy as lq
import numpy as np
import eqsig
import pysra
import sfsimodels as sm
class EqlinStockwellAnalysis(object):
def __init__(self, soil_profile, in_sig, rus=None, wave_field='outcrop', store='surface', gibbs=0, t_inc=1.0, t_win=3.0, strain_at_incs=True, strain_ratio=0.9):
"""
Equi... |
import io
from tqdm.auto import tqdm # custom progress bar
import json
import os
from typing import List
from thesis.config.datasets import S2orcConfig
from thesis.config.execution import LogConfig
from thesis.config.base import fingerprints
from thesis.utils.cache import _caching, no_caching
import logging
def r... |
"""RNN pixelwise
"""
from typing import Optional, Union
import argparse
import ast
import timm
import torch
import torchvision
import segmentation_models_pytorch as smp
from torch import nn
from earthnet_models_pytorch.utils import str2bool
Activations = {"relu": nn.ReLU, "leaky_relu": nn.LeakyReLU, "elu": nn.... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# -------------------------------------------------------------------
# Copyright (c) 2010-2020 <NAME>
# This file is part of the extensive automation project
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser Ge... |
#=============================================================================#
# #
# <NAME> #
# CS 3150 #
# ... |
import torch
from torch import nn
from onconet.models.inflate import inflate_model
from onconet.models.blocks.factory import get_block
import pdb
MODEL_REGISTRY = {}
STRIPPING_ERR = 'Trying to strip the model although last layer is not FC.'
NO_MODEL_ERR = 'Model {} not in MODEL_REGISTRY! Available models are {} '
NO_... |
import configparser
import platform
from zipfile import ZipFile
from configparser import ConfigParser
import shutil
import os
import time
import sys
import tempfile
import remonstrate_utils
import subprocess
from pathlib import Path
# This is not part of the stdlib
try:
import requests
except ImportError:
sys.... |
import gc
import numpy as np
import pandas as pd
def drop_duplicates_pharma(df):
"""
df: long-format dataframe of a patient
varref: variable reference table that contain the mean and standard deviation of values for a subset of variables
"""
df_dup = df[df.duplicated(["givenat", "pharmaid", "infu... |
import numpy as np, cv2, os, copy, math, ctypes
Latency, Pressed, SCALE = 300, None, 10.0
user32 = ctypes.windll.user32; user32.SetProcessDPIAware()
Width, Height = user32.GetSystemMetrics(0), user32.GetSystemMetrics(1); print(type(Width), Width, type(Height), Height)
def address_fix(address):
if address... |
from cincanregistry import VersionInfo, VersionType
from cincanregistry.checkers import UpstreamChecker
from datetime import datetime
from unittest import mock
import pytest
import json
from cincanregistry.utils import format_time
from .fake_instances import (
FAKE_VERSION_INFO_NO_CHECKER,
FAKE_VERSION_INFO_WIT... |
import io
from PIL import Image, ImageDraw, ImageFont
from fastapi.param_functions import File
from app.models.schemas.words import (
WordOutWithIdDate
)
from app.resources import strings
from typing import List
# import datetime as dt
from O365 import calendar
import textwrap
""" Return byte buffer if output=='_... |
# 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 ... |
import matplotlib.pyplot as plt
import datetime
from scipy.stats import *
from dis_mdp.mdp import *
import time
t2n = lambda hh, mm: hh * 60 + mm
def assign_pdf_abs(states, sid, sid_out, tid, time_span_left, time_span_middle, time_span_right, pdf_scale):
outcome_list = list()
r = 1.0
for j in range(time_... |
# @Date : 2019-10-22
# @Author : <NAME>
import os
import numpy as np
import math
import torch
import torch.nn as nn
from torchvision.utils import make_grid
from imageio import imsave
from tqdm import tqdm
from copy import deepcopy
import logging
from utils.inception_score import get_inception_score
from utils.fid... |
import logging
import os
import re
from threading import Thread, currentThread
import time
import traceback
import json
import sys
# logging util function
def log_uncaught_exception(e, logger=None, context=None):
if logger is None:
logger = logging.getLogger('default')
if context is None:
cont... |
from monopoly_backend import *
from lambda_stuff import *
board = None
started = False
def lambda_handler(event, context):
if event['request']['type'] == "LaunchRequest":
return on_launch(event, context)
elif event['request']['type'] == "IntentRequest":
return intent_router(event, context,)
... |
##Collect data:
'''
#SMI: 2021/10/30
SAF: 308214 Standard Beamline 12-ID proposal: (CFN, 307961)
create proposal: proposal_id( '2021_3', '307961_Dinca' ) #create the proposal id and folder
%run -i /home/xf12id/.ipython/profile_collection/startup/users/30-user-Dinca2021C2B.py
RE( shopen() ) # to... |
import numpy
import csb.test as test
from csb.numeric import log
from csb.statistics.pdf.parameterized import ParameterizedDensity
from csb.statistics.pdf.parameterized import ParameterValueError, ParameterizationError
from csb.statistics.pdf.parameterized import AbstractParameter, Parameter, NonVirtualParameter
c... |
# Copyright (c) The PyAMF Project.
# See LICENSE.txt for details.
"""
Google App Engine adapter module.
Sets up basic type mapping and class mappings for using the Datastore API
in Google App Engine.
@see: U{Datastore API on Google App Engine<http://
code.google.com/appengine/docs/python/datastore>}
@since: 0.3.... |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
#
# GUI module generated by PAGE version 4.20
# in conjunction with Tcl version 8.6
# Feb 20, 2019 02:41:59 PM -0300 platform: Windows NT
"""
Created on Mon Feb 18 10:08:04 2019
@author: <NAME>
"""
import sys
try:
import Tkinter as tk
except ImportError:
im... |
"""
Sumatra Server
:copyright: Copyright 2010-2020 <NAME>
:license: BSD 2-clause, see COPYING for details.
"""
import json
from django.http import (
HttpResponse,
JsonResponse,
HttpResponseBadRequest, # 400
HttpResponseForbidden, # 403
HttpResponseNotFound, # 404
HttpResponseNotAllowed, #... |
from contextlib import contextmanager
import os
from math import sqrt
from fontTools.pens.basePen import BasePen
from fontTools.pens.recordingPen import RecordingPen
from fontTools.ttLib.tables.otTables import CompositeMode, ExtendMode
import cairo
from .base import Canvas, Surface
from .sweepGradient import buildSweep... |
import torch
import torch.nn.functional as F
import argparse
import cv2
import numpy as np
from glob import glob
import copy
num_classes = 2
img_height, img_width = 96, 96
channel = 3
GPU = False
torch.manual_seed(0)
class MobileNet_v1(torch.nn.Module):
def __init__(self):
class MobileNetBlock(torch.nn.... |
import argparse
import numpy as np
from pathlib import Path
import cv2
from model import get_model
from noise_model import get_noise_model
import sys
import tensorflow as tf
from tensorflow.python.framework.convert_to_constants import convert_variables_to_constants_v2
import tensorflow_datasets as tfds
def get_args()... |
"""
A module of parallel lists and associated skeletons
class PList: parallel lists.
"""
import functools
from collections import defaultdict
from operator import add, concat
from typing import Optional, Tuple, Sequence, Generic # pylint: disable=unused-import
from typing import TypeVar, Callable # pylint: disable=u... |
# Lint as: python3
# Copyright 2021 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 ... |
# Player
import pygame
import math
import Color
import Ship
import Creature
import DrawINFO
from Vex import Vex
from RPGStats import RPGStats
from ParticleEngine import Emitter
from Planets import Planets
from Asteroid import Asteroid
class Player:
sensorPoints = []
sensorEdges = []
... |
# cache-extractor.py
#
import os
import time
import hashlib
import binascii
import zlib
import json
from urllib.parse import urlparse
from datetime import datetime
from bs4 import BeautifulSoup as bs
md5 = hashlib.md5()
# set cache_dir from which to extract files
# cache_dir = "./data/squid3"
cache_dir = "/var/spool... |
# Electrum - lightweight Bitcoin client
# Copyright (C) 2015 <NAME>
#
# 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, co... |
import numpy as np
import cv2
import os
import sys
sys.path.insert(0, os.getcwd())
import os.path as osp
import matplotlib.pyplot as plt
from matplotlib.patches import Rectangle, Circle
from tools.auto_anno_movie import AnnoationBase, AnnoationSub, get_landmark_annotation, get_face_annotation, LANDMARKS
from easydict i... |
import re
import time
import click
import requests
from bs4 import BeautifulSoup
from bs4.element import Tag
WIKI_ROOT = 'https://en.wikipedia.org'
WIKI_URL = WIKI_ROOT + '/wiki/Special:Random'
REQUEST_TIMEOUT = 1
REQUEST_DELAY = 0.5
EARLY_STOPS = set(['Science', 'Geography', 'Knowledge', 'Fact', 'Switzerland',
... |
# Copyright 2015 Mirantis, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... |
# python irc bot
# based on a tutorial from: https://linuxacademy.com/blog/linux-academy/creating-an-irc-bot-with-python3/
import socket
import time
import datetime
# my files
# import getweather
import getdate
import getfortune
import gettitle
import getskdtheme
import random
import getmessages
import getartprompt
fr... |
#!/usr/bin/env python3
import argparse
import json
import re
import os
from jinja2 import Template
from collections import defaultdict
def get_args():
parser = argparse.ArgumentParser(description="")
parser.add_argument('-t',dest="template",type=str,required=True,help='HTML template for Jinja2')
parser.ad... |
# -*- coding: utf-8 -*-
# Copyright (c) 2015-2016 Tigera, Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unle... |
# -*- coding: utf-8 -*-
"""
Created on Wed Jun 19 12:01:47 2019
@author: WT
"""
import pickle
import os
import torch
import pandas as pd
from torch.autograd import Variable
from nltk.translate import bleu_score
from torchnlp.metrics import get_moses_multi_bleu
from .models.Transformer.Transformer import create_masks
f... |
from __future__ import division
from __future__ import print_function
from builtins import range
from past.utils import old_div
from builtins import object
from common import *
from jsonrpc import DataSource
import deduplication
import boar_exceptions
from copy import copy
""" A recipe has the following format:
{
... |
import datetime
import pytz
from django.urls import reverse
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.support.wait import WebDriverWait
from wkz import configuration, models
def test_all_sports_page_accessible(live_server, we... |
#!/usr/bin/env python3
##############################################################################
# EVOLIFE http://evolife.telecom-paris.fr <NAME> #
# Telecom Paris 2021 www.dessalles.fr #
# ------------------------------------------------------------------------... |
##############################################################################
#
# Copyright (c) 2001 Zope Foundation and Contributors.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS I... |
import inspect
from distutils.util import strtobool
from typing import *
from PyQt6.QtCore import QEvent, Qt, pyqtSignal
from PyQt6.QtWidgets import (QCheckBox, QComboBox, QDateEdit, QLineEdit,
QRadioButton, QSlider, QSpinBox, QTextEdit)
from smseventlog import dt
from smseventlog import ... |
"""
Generate the potential task instances for
formal/informal dimension
complex/simple dimension
Generate the task instances for
number substitution characteristic
contraction characteristic
Take Subsample of potential tasks
"""
import logging
import sys
import os
import p... |
# coding=utf-8
# Copyright 2018 The Google AI Language Team 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 ... |
#!/usr/bin/env python3
# ------------------------------------------------------------------
#
# Description: unified config for herbstluftwm autostart
# Created by: <NAME> <<EMAIL>)
#
# Source
# https://github.com/epsi-rns/dotfiles/tree/master/herbstluftwm/python
#
# Blog
# http://epsi-rns.githu... |
import argparse
import numpy as np
import os
import sys
from time import sleep
import pandas as pd
# running on Mac for testing
if 'darwin' in sys.platform:
from fake_rpi.RPi import GPIO as GPIO
import matplotlib.pyplot as plt
import mpl_toolkits.mplot3d.axes3d as p3
from matplotlib import animation
... |
from typing import List, Tuple, Union, Dict
import torch
import torch.nn as nn
from torch.utils.data import DataLoader
import torch_optimizer
import numpy as np
import os
from tqdm import tqdm
os.environ["CUDA_VISIBLE_DEVICES"] = "0"
from ecg_classification import *
from wettbewerb import load_references
def predi... |
import importlib
import datetime
import argparse
import random
import uuid
import time
import os
import numpy as np
import torch
from torch.autograd import Variable
from metrics.metrics import confusion_matrix
import matplotlib.pyplot as plt
from main import load_datasets
# Import saliency methods
#from fullgrad_sa... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Jun 12 16:51:04 2017
@author: tonyd
Updated 05Oct2020 by stephg
"""
import vcf
import sys
import getopt
import math
usage = 'clinvarSummary.py -r <region> -b <binLength> -p <regionParts> -m <annotationMode>'
theArgs = {'binLength': int(0), 'regionPar... |
from simulator.utils.basic_utils import *
import numpy as np
import pandas as pd
from operator import itemgetter
from itertools import groupby
def rmse(x, y):
x, y = new_array(x), new_array(y)
return np.sqrt(np.mean((x-y)**2))
def row_norm(mat):
""" Compute the norm of a set of vectors, each of which is t... |
#!/usr/bin/env python
import argparse
# import datetime
import os
import sys
# import shlex
# import subprocess
# import pickle
import torch
import yaml
import torch.nn as nn
from datasets.gdi_vis import GDI, Massvis
import models
from trainer import Trainer
import utils
device = torch.device("cuda:1")
def to_dev... |
import numpy as np
import segyio
import pyvds
VDS_FILE = 'test_data/small.vds'
SGY_FILE = 'test_data/small.sgy'
def compare_inline_ordinal(vds_filename, sgy_filename, lines_to_test, tolerance):
with pyvds.open(vds_filename) as vdsfile:
with segyio.open(sgy_filename) as segyfile:
for line_ordi... |
import asyncio
import random
import discord
from discord.ext import commands
import yaml
with open('config.yaml') as config_file:
config = yaml.load(config_file, Loader=yaml.FullLoader)
class TicTacToe():
def __init__(self):
# Emotes Section
self.white_page = config['white_page']
self... |
"""
Functions for making a consistent dataset with fixed and free variables as is expected in our dataset.
"""
import logging
import sys
from itertools import chain
from pathlib import Path
import numpy as np
import pandas as pd
import sympy
from src.util import get_free_fluxes
RT = 0.008314 * 298.15
logger = loggi... |
# KicadModTree is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# KicadModTree is distributed in the hope that it will be useful,
# bu... |
import logging
import uuid
from datetime import datetime
from typing import List, Sequence, Set, cast
import grpc
import sqlalchemy.orm
from common.constants import PAGINATION_LIMIT, Currency
from common.utils.datetime import datetime_to_protobuf, protobuf_to_datetime
from common.utils.uuid import bytes_to_uuid
from g... |
from typing import List, Tuple, Optional
import os
import numpy as np
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import matplotlib.ticker as ticker
from matplotlib import cm
import matplotlib.colors as mplcolors
from ramachandran.io import read_residue_torsion_collection_from_file
def get... |
#*****************************************************************************#
#* Copyright (c) 2004-2008, SRI International. *#
#* All rights reserved. *#
#* ... |
#! /bin/env python
## basic shim to load up neuroglancer in a browser:
import neuroglancer
import logging
from time import sleep
import redis
import os
import json
import graphviz
hosturl = os.environ['HOSTURL']
kv = redis.Redis(host="redis", decode_responses=True) # container simply named redis
logging.basicConf... |
# -*- coding: utf-8 -*-
"""
Created on Tue May 26 07:49:48 2020
@author: X202722
"""
def make_parameter_BPT_fit (T_sim, T_exp, method, na, M):
import numpy as np
# fit if possible BPT guess to
#nannoolal
if method == 0:
a = 0.6583
b= 1.6868
c= 84.3395
... |
import os
import curses
import numpy as np
from pathlib import Path
ROOT = Path("terminal_dungeon")
WALL_DIR = ROOT / "wall_textures"
SPRITE_DIR = ROOT / "sprite_textures"
def clamp(mi, val, ma):
return max(min(ma, val), mi)
class Renderer:
"""
Graphic engine. Casts rays. Casts sprites. Kicks ass.
... |
import numpy as np
import torch
from torch.utils.tensorboard import SummaryWriter
from torch.utils.data import DataLoader
from ProcessData.TrainingLoss import TrainingLoss
from ProcessData.Utils import getX_full
from typing import Tuple
from HighFrequency.HighFrequency import HighFrequency
from HighFrequency.Discrim... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os.path
import sys
from ipaddress import ip_address
from urllib.parse import urlsplit
sys.path.append(os.path.join(os.path.dirname(__file__), '.'))
import time
from PyQt5.QtCore import QObject, pyqtSignal
from constants import user_dir, log_File, masterno... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.