text stringlengths 8.04k 46.5k |
|---|
#! /usr/bin/env python
import os
import copy
ResList=['ALA','CYS','ASP','GLU','PHE','GLY','HSD','HSE','HSP','ILE','LYS','LEU','MET','ASN','PRO','GLN','ARG','SER','THR','VAL','TRP','TYR']
Conv321={'ALA':'A','CYS':'C','ASP':'D','GLU':'E','PHE':'F','GLY':'G','HSD':'H','HSE':'B','HSP':'J','ILE':'I','LYS':'K','LEU':'L','M... |
'''
################################################################
# Data - h5py
# @ Modern Deep Network Toolkits for Tensorflow-Keras
# <NAME> @ <EMAIL>
# Requirements: (Pay attention to version)
# python 3.6+
# tensorflow r1.13+
# Use generator to wrap the h5py.
# Warning:
# The standard tf dataset is proved ... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
# Create your views here.
import json
import datetime
import requests
from requests.auth import HTTPBasicAuth
# Django utils
from django.shortcuts import render,redirect
from django.views.generic import View, CreateView, ListView, DetailView, UpdateView
fr... |
"""
| ubirch-ubirch interface to the G+D SIM Card Application (TLSAUthApp).
|
| This interface wraps the required AT commands necessary to access the
| ubirch-ubirch functionality. To use the application the SIM card interface
| must support the "AT+CSIM" command ([2] 8.17 Generic SIM access +CSIM, p121).
|
| [1] Custo... |
# -*- coding: utf-8 -*-
"""
Created on Mon Apr 22 15:39:27 2019
@author: Lee
"""
import numpy
"""Need to figure out the correct_arguments script"""
def correct_arguments(args):
"""
Goal is to convert the geometry file argument to working syntax: Single quote, back slash
Args:
... |
#!/usr/bin/env python
################################################################################
#
# print_dependencies.py
#
#
# Copyright (c) 10/9/2009 <NAME>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Softw... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# region Description
"""
arp_fuzz.py: ARP fuzzing script
Author: <NAME>
License: MIT
Copyright 2020, Raw-packet Project
"""
# endregion
# region Import
from sys import path
from os.path import dirname, abspath
from argparse import ArgumentParser
from socket import socket... |
import os
import shutil
from django.shortcuts import render, get_object_or_404, redirect
from django.http import FileResponse
from django.conf import settings
from django.contrib import messages
from gyoiboard.tasks import executation
from atd.models import Target, ScanResult, ExtScanResult, \
ExtScanResultEvasio... |
import os, sys, pdb, time, gzip, pickle, math, re
from pprint import pprint
from collections import OrderedDict as odict
from copy import copy
import torch, osqp
import matplotlib.pyplot as plt, line_profiler as lp, cvxpy as cp, numpy as np
import scipy.sparse as sp, scipy.sparse.linalg as spla
from matplotlib.patches... |
#!/usr/bin/env python
#
#SubBrute v2.0
#A (very) fast subdomain spider.
#
#Maintained by rook
#Contributors:
#JordanMilne, KxCode, rc0r, memoryprint, ppaulojr
#
import dnslib
import re
import optparse
import os
import signal
import time
import sys
import uuid
import random
import ctypes
import json
import socket
impo... |
# standard library imports
import os
import sys
import argparse
import time
# package imports
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
import pandas as pd
from sklearn.metrics import roc_auc_score
# local imports
import util as util
from data import load_dataset
import models as models... |
import BF_v2
import search_filter
import pickle
from bitarray import bitarray
import os
import matplotlib.pyplot as plt
import seaborn as sns
from collections import Counter
from Bio import SeqIO, SeqRecord, Seq
import csv
import Classifier
from OXA_Table import OXATable
#from Bio.Seq import Seq
# Help-Script to gener... |
import numpy as np
import scipy.spatial
from attr import attrs, attrib, evolve
from .util import as_array, has_shape
from .geom import ngon_vertex_order, PolarPosition
from .layout import Channel
from ..options import OptionsHandler
from . import bs2051
class RegionHandler(object):
"""An interface for objects tha... |
"""Command line interface."""
# Standard library
import os
import sys
from pathlib import Path
from typing import Dict
from typing import List
from typing import Optional
from typing import Sequence
from typing import Tuple
from typing import Union
# Third-party
import click
from click import Context
# Local
from . i... |
#!/usr/bin/env python
####################
# Required Modules #
####################
# Generic/Built-in
import json
import os
import time
from collections import Counter
from typing import Dict, List, Any, Tuple
# Libs
import streamlit as st
import streamlit.components.v1 as components
# Custom
from config import ... |
# -*- coding: utf-8 -*-
"""
Base CLI commands for all objects.
Model-specific objects and argument parsers will be defined in subclasses or by
way of factory methods.
"""
from __future__ import unicode_literals
from __future__ import absolute_import
from __future__ import print_function
import click
import datetime
... |
import numpy as np
import tensorflow as tf
import time
from IPython import display
import datetime
import os
import logging
class Reconstruct_R1M(tf.keras.layers.Layer):
def __init__(self, filters, name='RR'):
super(Reconstruct_R1M, self).__init__(name=name)
self.num_outputs = filters
def bui... |
import streamlit as st
import pandas as pd
import seaborn as sns
import numpy as np
from matplotlib import pyplot as plt
from sklearn.neighbors import NearestNeighbors
import random
import missingno as msno
import ppscore as pps
from sklearn.neighbors import NearestNeighbors
from sklearn.preprocessing import StandardSc... |
# The MIT License (MIT)
#
# Copyright (c) 2014-2017 <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, modif... |
from typing import List
from fastapi import FastAPI, File, UploadFile, Form, Response, Path
from utils import save_as_temp, convert_office_to_pdf, pdf_2_pages, augmentation
from fpdf import FPDF
import datetime
import fitz
import camelot
import subprocess
import re
from PIL import Image, ImageOps, ImageDraw
import rand... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"Merge meteogram files"
import re
import glob
import functools
import itertools
from collections import OrderedDict, defaultdict, namedtuple
import netCDF4
import numpy as np
import pandas as pd
var_signature = namedtuple('var_signature', 'name dtype dimensions')
time... |
import copy
import logging
import os
import pickle
import shutil
import numpy as np
import pandas as pd
import torch
import torch.nn as nn
from algorithms.mDSDI.src.dataloaders import dataloader_factory
from algorithms.mDSDI.src.models import model_factory
from torch.utils.data import DataLoader
from torch.utils.tenso... |
"""
Implementation of the curious variant of the Advantage Actor-Critic algorithm.
"""
import time
import numpy as np
import tensorflow as tf
from tensorflow.contrib import slim
from algorithms.algo_utils import RunningMeanStd, EPS, extract_keys
from algorithms.baselines.a2c.agent_a2c import AgentA2C
from algorithms... |
""" Test harness """
import os
from random import sample
import numpy as np
import sys
import pytest
from ukcensusapi import Nomisweb as Api_EW, NRScotland as Api_SC, NISRA as Api_NI, Query as Census
CACHE_DIR = "/tmp/UKCensusAPI"
@pytest.fixture(scope='session')
def api_ew(): return Api_EW.Nomisweb(CACHE_DIR, verb... |
import pygame, random, time
import gym
from gym import spaces
import numpy as np
'''
Функция получения выжившей популяции
Входные параметры:
- popul - наша популяция
- val - текущие значения
- nsurv - количество выживших
- reverse - указываем требуемую операцию по... |
import ast
import collections
import imblearn
import numpy as np
import pandas
import pickle
import scipy
import sklearn
import skrebate
import sys
import time
import warnings
import xgboost
from asteval import Interpreter, make_symbol_table
from pathlib import Path
from scipy.io import mmread
from sklearn import (
... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
from datetime import datetime
import matplotlib
import numpy as np
import scipy.stats as stats
import yaml
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import time
from tensorflow import g... |
"""The `diagnostic_output` module contains methods and classes for
working with MIKE FM DA diagnostic outputs.
The entrance point is always the `read_diagnostic()` method which
will return a specialized object depending on the type of diagnostic output.
The returned object will be of type:
See also
--------
Measur... |
# Copyright Notice:
# Copyright 2020 DMTF. All rights reserved.
# License: BSD 3-Clause License. For full text see link:
# https://github.com/DMTF/Redfish-Protocol-Validator/blob/master/LICENSE.md
from aenum import Enum, auto
SSDP_ALL = 'ssdp:all'
SSDP_REDFISH = 'urn:dmtf-org:service:redfish-rest:1'
class NoVa... |
# -*- coding: utf-8 -*-
"""
This code is derived from Keras examples/mnist_acgan.py.
Train an Auxiliary Classifier Generative Adversarial Network (ACGAN) on the
MNIST dataset. See https://arxiv.org/abs/1610.09585 for more details.
"""
from __future__ import print_function
from collections import defaultdict
try:
... |
##########################################################################################################################
# #
# What follows are options of the PP-STM ... |
import time
def prefixes(word):
"A list of the initial sequences of a word, not including the complete word."
return [word[:i] for i in range(len(word))]
def readwordlist(filename):
file = open(filename)
text = file.read().upper()
wordset = set(word for word in text.splitlines())
prefixset = s... |
#!/usr/bin/python3
# -*- coding: utf-8 -*-
#
# Purpose: Core class structures for JHU CSSE's Time Series Data Files
#
import numpy as np
import shapefile
from datetime import datetime
from datetime import timedelta
import pickle
class Error(Exception):
"""Base class for exceptions in this module."""
pas... |
from abis_and_keys import *
from constants import *
from lstm_predictor import prediction_plot
import pandas as pd
#import os
import yfinance as yf
import numpy as np
import requests
import json
from datetime import datetime
from threading import Timer
import ipywidgets as widgets
from IPython.display import display
im... |
import warnings
from collections import OrderedDict, Counter
from importlib import import_module
from urllib import parse
import coreapi
import coreschema
import uritemplate
from django.conf import settings
from django.core.exceptions import PermissionDenied
from django.db import models
from django.forms.forms import ... |
# The MIT License (MIT)
#
# Copyright (c) 2018 UMONS
#
# 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, m... |
'''
# File: FedPos.py
# Project: strategies
# Created Date: 2022-04-21 9:38
# Author: <NAME> <EMAIL>
# -----
# Last Modified: 2022-04-28 4:25
# Modified By: <NAME> <EMAIL>
#
# This code is published under the MIT License.
# -----
# HISTORY:
# Date By Comments
# ---------- --- -----------------------------------... |
"""Unittests for the GABC PEG grammar
Author: <NAME>
Date: 27 December 2019
TODO
* Test advanced music: code
* Test advanced music: choral_sign
* Test advanced music: translation
"""
import unittest
from arpeggio import NoMatch
from chant21.gabc import ParserGABC
class TestFile(unittest.TestCase):
de... |
# This files creates all the needed data structures that relab needs
# User gives the option for training and testing mode
import numpy as np
import os
import xml.etree.ElementTree as ET
from numpy import linalg as LA
import matplotlib.pyplot as plt
import cv2
from faster_rcnn import network
from faster_rcnn.faster_rc... |
import argparse
import datetime
import logging
import logging.handlers
import os
import re
import shlex
import shutil
import subprocess
import sys
from configparser import ConfigParser
from copy import deepcopy
from getpass import getpass
from pathlib import Path
from xml.etree import cElementTree as ET
import aws_goo... |
import time
from math import sqrt, tan, sin, cos, pi, ceil, floor, acos, atan, asin, degrees, radians, log, atan2, acos, asin
import random
import numpy
from pymclevel import alphaMaterials, MCSchematic, MCLevel, BoundingBox
from mcplatform import *
import Queue
import utilityFunctions
from helper import *
f... |
# Main Program
# 29.04.20 DGM: Program's opening
'''
ATTENTION to use this program:
- you might want to overwrite in Globals Initialization:
+ client_id = <your ID>
+ client_secret = <your ID Key>
YOU CAN ALSO: create a json file named: 'credentials.json' on the same folder and wr... |
import argparse
from collections import deque
from decimal import Decimal
from functools import wraps
from io import StringIO
from itertools import islice
from string import digits
from sys import stdin, stdout, stderr, argv
import re
from .utils import * ### @import
CURR_PLATFORM = 'local' ### @replace 'local', form... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Mar 16 2022 at 15:37
@author: sdaniel
"""
import numpy as np
import math
import csv
def input_data(name_W, name_AP, name_BP, name_T):
"""
Generates the different input data in the correct format from .csv files.
:param name_W: Name of th... |
from __future__ import annotations
from typing import Any, Tuple, Union, Optional, Final
from pydantic.error_wrappers import ValidationError
from pydantic.typing import NoneType
from amocrm.v4.models.amoCRM_M import AmoRequestPatchContact, AmoRequestPostContact, AmoResponceGet, AmoResponcePostError, \
... |
"""
An implementation of the scheme of
Shen and Yang, SIAM J. Numer. Anal., 2015.
Binary electrohydrodynamics solved using a partial splitting approach and
linearisation.
The problem is split between the following subproblems.
* PF: Solved with stabilization and a modified phase field potential.
* EC: Improvised. ... |
# Copyright (c) 2019-2021 <NAME>
# License: MIT License
from typing import TYPE_CHECKING, Optional
import copy
from ezdxf.lldxf import validator
from ezdxf.math import NULLVEC, Vec3, Z_AXIS, OCS
from ezdxf.lldxf.attributes import (
DXFAttr,
DXFAttributes,
DefSubclass,
XType,
RETURN_DEFAULT,
grou... |
import numpy as np
from src.anamator.basic_func import *
from src.anamator.objects import *
F4K = (3840, 2160)
RADIUS_FOO = PredefinedSettings.radius_func_creator(24, 16)
CIRCLES_THIC = 8
PADDING = 200
def doubling_vectors(filename):
def frame_generator(*t):
vectors = [[(0, 0), (1, 2)],
... |
import json
import os
import pathlib
from binascii import unhexlify
from typing import List, Type, Union, Optional, Tuple
from pytest import skip
from cose.attributes.algorithms import CoseAlgorithms, CoseEllipticCurves
from cose.attributes.headers import CoseHeaderKeys
from cose.keys.cosekey import KTY, CoseKey, Key... |
#!/usr/bin/env python3
# Copyright (c) 2020-2021
# <NAME> <<EMAIL>>, <NAME> <<EMAIL>>
#
# MIT License
#
# 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... |
import math
import sys
import cv2
import numpy as np
from threading import Thread
from ndu_gate_camera.api.ndu_camera_runner import NDUCameraRunner
from ndu_gate_camera.utility import constants, geometry_helper, image_helper, string_helper
from filterpy.kalman import KalmanFilter
from scipy.optimize import linear_s... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Sign releases on github, make/upload ppa to launchpad.net
NOTE on ppa: To build a ppa you may need to install some more packages.
On ubuntu:
sudo apt-get install devscripts libssl-dev python3-dev \
debhelper python3-setuptools dh-python
NOTE on apk sig... |
# This file is part of beets.
# Copyright 2011, <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, ... |
#NVDAObjects/IAccessible/ia2TextMozilla.py
#A part of NonVisual Desktop Access (NVDA)
#This file is covered by the GNU General Public License.
#See the file COPYING for more details.
#Copyright (C) 2015-2017 NV Access Limited
"""Support for the IAccessible2 rich text model first implemented by Mozilla.
This is ... |
import pytest
import tequila.quantumchemistry as qc
import numpy
import os, glob
import tequila.simulators.simulator_api
from tequila.objective import ExpectationValue
from tequila.quantumchemistry.encodings import known_encodings
from tequila.simulators.simulator_api import simulate
HAS_PYSCF = "pyscf" in qc.INSTALL... |
# Copyright 2013 UnitedStack 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... |
# -*- coding: utf-8 -*-
#
# Outsourced plotting class methods from respective parent classes
#
# Builtin/3rd party package imports
import numpy as np
import os
# Local imports
from syncopy.shared.errors import SPYValueError, SPYTypeError, SPYWarning
from syncopy.plotting.spy_plotting import (pltConfig, _layout_sub... |
"""
Easiest continuous control task to learn from pixels, a top-down racing
environment.
Discrete control is reasonable in this environment as well, on/off
discretization is fine.
State consists of STATE_W x STATE_H pixels.
The reward is -0.1 every frame and +1000/N for every track tile visited, where
N is the total ... |
#!/usr/bin/env python3
import scoring
from random import seed
from random import randint
from enum import Enum
#Finish dict of cards
CARD_NAMES = ['AS', 'KS', 'QS', 'JS', '10S', '9S', '8S', '7S', '6S', '5S', '4S', '3S', '2S',
'AH', 'KH', 'QH', 'JH', '10H', '9H', '8H', '7H', '6H', '5H', '4H', '3H', '2H',... |
# coding=utf-8
#
# This file is part of Hypothesis, which may be found at
# https://github.com/HypothesisWorks/hypothesis-python
#
# Most of this work is copyright (C) 2013-2018 <NAME>
# (<EMAIL>), but it contains contributions by others. See
# CONTRIBUTING.rst for a full list of people who may hold copyright, and
# co... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# iboss-2
# filename: iboss.py
# author: - <NAME>
#
# modified:
# - 2012 11 27 - <NAME>
"""defines data structures for iboss project"""
Version="1.6" #catalog version
newVersion="1.7" #next catalog version
from copy import copy
import numpy as np
import xml.etree.Ele... |
# Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
import numpy as np
import pandas as pd
import math
import trainers.topKMetrics as topk
import smbclient as smbc
import tensorflow as tf
import tensorflow_recommenders as tfrs
import git
from datetime import datetime
from src.AAUfilename import getAAUfilename
from getpass import getpass
from src.benchmarkLogger import b... |
## @ StitchIfwi.py
# This is a python stitching script for Slim Bootloader CMLV build
#
# Copyright (c) 2020, Intel Corporation. All rights reserved. <BR>
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
##
import sys
import os
import re
import struct
import argparse
import zipfile
import shutil
import... |
# ===============================================================================
# Copyright 2011 <NAME>
#
# 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/... |
import argparse
import os
import time
import shutil
import paddle.fluid.io as io
import paddle
import paddle.fluid as fluid
from dataset import TSNDataSet
from models import TSN
from collections import OrderedDict
from transforms import *
from opts import parser
import sys
best_prec1 = 0
os.environ['CPU_NUM']="2"
de... |
"""Run dome control on a raspberry pi GPIO."""
import math
import sys
import os
import threading
import time
import warnings
import logging
import yaml
from contextlib import suppress
import astropy.units as u
from astropy.coordinates import Angle, Longitude
from gpiozero import Device, DigitalInputDevice, DigitalOu... |
import json
import os
import pickle
import random
from abc import ABC, abstractmethod
from argparse import ArgumentParser, Namespace
from collections import deque
from dataclasses import dataclass
from datetime import datetime
from glob import glob
from typing import Callable, Dict, List, Optional, Tuple, Union
import... |
from ctypes import cdll
from ctypes import Structure
from ctypes import POINTER, pointer
from ctypes import c_int, c_uint, c_uint8, c_uint16, c_uint32, c_int32
from ctypes import c_char_p
from ctypes import c_size_t
from ctypes import c_bool
from ctypes import create_string_buffer
#LEB128
class Leb128(Structure):
... |
# mypy: ignore-errors
"""
An abstract interpreter (or cost model) for Knossos.
Given an expression.Expression object, computes the resulting value and cost of
computation. It is an *abstract* interpreter because it abstracts vector/tensor
values by throwing away element values and keeping only shape and type informati... |
# 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 u... |
import datetime
import tensorflow as tf
import numpy as np
import logging
import os
import shutil
from collections import defaultdict
from pathlib import Path
from typing import (
List,
Text,
Dict,
Tuple,
Union,
Optional,
Callable,
TYPE_CHECKING,
Any,
)
from tqdm import tqdm
from r... |
from __future__ import division
# DDCF (Windows)
# Dynamic DNS Client for CloudFlare
# Released under the MIT license.
# By: <NAME>. <<EMAIL>>
# r7 (2013-20-04)
# This program requires Python 2, and is tested and built on 2.7.2 (It should work with >2.6)
# It will NOT work on Python 3.
# If your path to the Python exe... |
#!/usr/bin/env python3
# Copyright (c) 2010 ArtForz -- public domain half-a-node
# Copyright (c) 2012 <NAME>
# Copyright (c) 2010-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Bitcoin Object Py... |
"""
treemixin.py
This module provides three mixin classes that can be used with tree
controls:
- VirtualTree is a class that, when mixed in with a tree control,
makes the tree control virtual, similar to a ListCtrl in virtual mode.
A virtual tree control builds the tree itself by means of callbacks,
so the p... |
from .finder.core import FinderFactory
from .parser import DoxygenParserFactory
from .renderer import DoxygenToRstRendererFactory
from .renderer.base import RenderContext
from .renderer.filter import FilterFactory
from .renderer.target import TargetHandlerFactory
from .renderer.mask import MaskFactory, NullMaskFactory... |
# # #
# Current implementation of the cru ts31 (ts32) delta downscaling procedure
#
# Author: <NAME> (<EMAIL>)
# # #
import numpy as np
def write_gtiff( output_arr, template_meta, output_filename, compress=True ):
'''
DESCRIPTION:
------------
output a GeoTiff given a numpy ndarray, rasterio-style
metadata dictio... |
import os
import cv2
import shutil
import numpy as np
from time import time
import tensorflow as tf
from tensorflow.keras import layers
import tensorflow_probability as tfp
from utils import *
from models import generator, latent_generator, posterior
import operators as inv_probs
from logdetJ import wrapper_logdet
... |
import argparse
import torch.utils.data as data
from pycocotools.coco import COCO
from PIL import Image
import csv
import os
import pickle
import torch
import xml.etree.ElementTree as ET
import re
from lxml import etree
import pandas
from scipy.io import loadmat
import random
import torchvision.transforms as transforms... |
# Copyright (c) 2018-2021, Texas Instruments
# All Rights Reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice, this
# list of condition... |
import base64
import binascii
from datetime import timedelta
from django.conf import settings
from django.contrib.auth import user_logged_in
from django.contrib.auth.hashers import is_password_usable
from django.core.cache import cache
from django.core.mail import EmailMessage
from django.http import Http404
from djan... |
# Copyright 2013 Hewlett-Packard Development Company, L.P.
# 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... |
import collections
from fax import math
import jax
import jax.numpy as jnp
from jax import tree_util, jacfwd, random, grad, jvp
from jax.scipy.sparse import linalg
from jax.scipy import linalg as scipy_linalg
from functools import partial
from jax.config import config
config.update("jax_enable_x64", True)
BregmanPoten... |
#!/usr/bin/env python
# Copyright 2014 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.
import argparse
import bz2
import datetime
import gzip
import inspect
import logging
import logging.handlers
import multiprocessing
imp... |
import os
import json
import datetime
import itertools
from distutils.version import LooseVersion
import requests
from bs4 import BeautifulSoup
from django.shortcuts import render
from django.http import HttpResponse
from django.views.decorators.csrf import csrf_exempt
from django.core.paginator import Paginator, Page... |
import tensorflow as tf, mc, config, engine, pdb, random, pickle, os, NNfunctions, numpy, datetime, sys
from tqdm import tqdm
from head2Head import head2Head
from keras.utils import np_utils
class gameSet(): # class used to track training game results
def __init__(self):
self.gameBoards = [] # contains board-move p... |
"""
GraN-DAG
Copyright © 2019 <NAME>, <NAME>, <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, merge, publ... |
import os
import pickle as pkl
from tqdm import tqdm
import numpy as np
from scipy import stats
import matplotlib.pyplot as plt
import pandas as pd
import ujson as json
import nltk
from nltk.tokenize import word_tokenize
from time import time
np.random.seed(int(time()))
SPACE = ' '
def stat_length(seq_length):
... |
# Copyright 1999-2021 Alibaba Group Holding 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 or a... |
"""
The MIT License
Copyright (c) 2008 <NAME>
2014 <NAME>, <EMAIL>
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 us... |
import os
import pandas as pd
import numpy as np
import numpy.random as rd
import torch
class StockTradingEnv:
def __init__(self, cwd='./envs/FinRL', gamma=0.99,
max_stock=1e2, initial_capital=1e6, buy_cost_pct=1e-3, sell_cost_pct=1e-3,
start_date='2008-03-19', end_date... |
import asyncio
from enum import Enum
import pyautogui
from common import (
ROOM_WIDTH_IN_TILES,
ROOM_HEIGHT_IN_TILES,
TILE_SIZE,
)
from room_simulator import ElementType, Direction
from .consts import ROOM_ORIGIN_X, ROOM_ORIGIN_Y
from .util import get_drod_window, extract_room, extract_minimap
from util i... |
from __future__ import absolute_import, division, print_function, unicode_literals
import argparse
import logging
import os
import pickle
from io import open
os.environ['CUDA_VISIBLE_DEVICES'] = "0"
mlm_cvg_hack = 10
import numpy as np
import torch
from torch.nn import CrossEntropyLoss
from torch.utils.data import D... |
# ----- <About> ----- #
# Author: <NAME>
# Email: <EMAIL>
# Date: 7-21-21
# Meshtastic PyGUI
# Thank you to all the members of meshtastic that make this project possible
#
# ----- <Imports> ----- #
import PySimpleGUI as sg
import os
import requests
import meshtastic
import subprocess
import time
from pubsub... |
from __future__ import print_function
import datetime
import json
import logging
import os
import re
import sys
from contextlib import contextmanager
from queue import Queue
from typing import Union, Any
import demisto_client.demisto_api
import pytz
import requests
import urllib3
from google.api_core.exceptions impor... |
#############################################################################
# prepare_dataset.py: return dataset according to the task
# ref: huggingface/transformers/examples/run_glue.py
# monologg/KoELECTRA/blob/master/finetune/processor/seq_cls.py
# 현재 5e-05 -> 04로 바꾼 상태
######################################... |
"""
Streamlit Cheat Sheet
App to summarise streamlit docs v0.81.0 for quick reference
There is also an accompanying png version
https://github.com/daniellewisDL/streamlit-cheat-sheet
v0.71.0 November 2020 <NAME> and <NAME>
"""
import streamlit as st
from pathlib import Path
import base64
# --- for simulat... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2012-2013 Edgewall Software
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://trac.edgewall.org/wiki/TracLicense.
#
# This software consi... |
"""
Tests for numba.types.
"""
from __future__ import print_function, absolute_import
from collections import namedtuple
import gc
try:
import cPickle as pickle
except ImportError:
import pickle
import weakref
import numpy as np
from numba import unittest_support as unittest
from numba.utils import IS_PY3
f... |
#!/usr/bin/env python3
# coding: utf-8
# Copyright 2019 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 ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.