text stringlengths 8.04k 46.5k |
|---|
import argparse
import random
import time
from collections import deque
from statistics import mean
import tensorboardX
import torch
import torch.autograd as autograd
import torch.nn as nn
import torch.optim as optim
from gym_minigrid.wrappers import *
import utils
from scripts.myvisualizeAgents import visualiseAndSa... |
'''
Training script for ImageNet
Copyright (c) <NAME>, 2017
'''
from __future__ import print_function
import argparse
import os
import random
import shutil
import time
import warnings
import torch
from torch.fx.graph_module import GraphModule
import torch.nn as nn
from torch.nn.modules import module
import torch.nn.p... |
import struct
def mutate(dict, *pairs):
for k, v in pairs:
dict[k] = v
return dict
def mask(width, shift):
return int("1"*width + "0"*shift, 2)
def signed(num, bits):
signed_type, unsigned_type = {
8: ("b", "B"),
16: ("h", "H"),
32: ("i", "I"),
64: ("q", "Q"... |
import pygame, enum, os, button, spritesheet, random
from pygame import draw
from pygame import sprite
# INITIALIZATION
#-----------------------------------------------------------------------------------------
pygame.init()
clock = pygame.time.Clock()
FPS = 60
game_over = 0
seconds_left = 20
timer = pygame.time.get... |
import pandas as pd
import csv
import certifi
import urllib3
import urllib
import wget
import base64
import glob
import io
import requests
import ftplib
import json
import gzip
import shutil
from Bio import Entrez, Medline, SeqIO
import os.path
import collections
import pprint
import obonet
import datetime
import loggi... |
# Python 3
# Model stacking
import time
import copy
import warnings
import pickle
import numpy as np
import pandas as pd
from joblib import dump, load
from collections import defaultdict
from sklearn.model_selection import ParameterGrid
"""
Package Description:
-------------------------------------------------------... |
"""
<NAME>
"""
import numpy as np
import pandas as pd
from gym import spaces
import matplotlib.pyplot as plt
from scipy import stats
from recsim import document
from recsim import user
from recsim.choice_model import MultinomialLogitChoiceModel,AbstractChoiceModel
from recsim.simulator import environment
from recsim... |
from django.shortcuts import render, redirect
from django.conf import settings
from django.http import HttpResponse, Http404, HttpResponseBadRequest, HttpResponseForbidden
from django.views.generic import View
from django.views.decorators.clickjacking import xframe_options_exempt
from django.contrib.admin.views.decorat... |
from __future__ import print_function
import sys
import os
import torch
import torch.nn as nn
import torch.optim as optim
import torch.backends.cudnn as cudnn
import torchvision.transforms as transforms
import torch.nn.init as init
import argparse
import numpy as np
from torch.autograd import Variable
import torch.util... |
# -*- coding: utf-8 -*-
"""
Created on Thu Aug 5 14:40:49 2021
@author: Administrator
"""
# -*- coding: utf-8 -*-
'''
制作:林庆文
参考代码:莫烦PYTHON 苏剑林bert4keras
'''
import tensorflow as tf
from tensorflow import keras
import tensorflow.keras.backend as K
class Layer(keras.layers.Layer):
def __init... |
#!/usr/bin/python
# -*- coding:utf-8 -*-
import os
import json
import operator
import logging
# from obscmd import compat
import threading
import shutil
from obscmd import multithreading as compat, globl
from obscmd.cmds.obs.obsutil import multiprocess_with_sleep, check_resp, multithreading_with_sleep, ObsCmdUtil, \... |
#################################################################################################################
# ewstools
# Description: Python package for computing, analysing and visualising
# early warning signals (EWS) in time-series data
# Author: <NAME>
# Web: http://www.math.uwaterloo.ca/~tbury/
# Code repo:... |
#!/usr/bin/env python
#
# texture.py - The Texture and Texture2D classes.
#
# Author: <NAME> <<EMAIL>>
#
"""This module provides the :class:`Texture` class, which is the base classes
for all other FSLeyes texture types. See also the :class:`.Texture2D` and
:class:`.Texture3D` classes.
"""
import logging
... |
import functools
import json
import logging
import re
import traceback
import urllib.parse
from apispec import yaml_utils
from flask import Blueprint, current_app, jsonify, make_response, request
from flask_babel import lazy_gettext as _
import jsonschema
from marshmallow import ValidationError
from marshmallow_sqlalc... |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
# -*- coding: utf-8 -*-
"""This module corresponds to the sdss directory in idlutils.
"""
import os
import re
import numpy as np
from astropy.io import fits
from astropy.utils.data import download_file
from . import PydlutilsException
from .spheregroup imp... |
import bpy
from mathutils import Vector
from ...utils import copy_bone, put_bone, org, align_bone_y_axis, align_bone_x_axis, align_bone_z_axis
from ...utils import strip_org, make_deformer_name, connected_children_names
from ...utils import create_chain_widget
from ...utils import make_mechanism_name, create_cube_widge... |
# step2.py
#
# Clear Climate Code, 2010-01-22
# <NAME>, Revision 2016-01-06
"""Python replacement for code/STEP2/*
This step performs a trend adjustment to those stations identified as
urban. An urban station must meet various criteria to have its trend
adjusted (there must be sufficient nearby rural stations and th... |
import argparse
import math
import os, sys
import random
import datetime
import time
from typing import List
import json
import numpy as np
from copy import deepcopy
import torch
import torch.nn as nn
import torch.nn.parallel
from torch.optim import lr_scheduler
import torch.backends.cudnn as cudnn
import torch.distri... |
from __future__ import absolute_import
import datetime as dt
from decimal import Decimal
import six
from six.moves import filter, map, range
from sqlalchemy import event
from sqlalchemy.ext.declarative import declared_attr
from sqlalchemy.ext.hybrid import hybrid_property
from sqlalchemy.event import listens_for
from s... |
"""Implement the patterns that Unit objects use."""
from __future__ import unicode_literals
from __future__ import absolute_import
from builtins import str
import re
import collections
from .options import ObjectWithOptions
from .exceptions import InvalidCallNumberStringError, SettingsError,\
... |
import copy
import glob
import math
import pickle
import random
from typing import Any, Optional, Dict, List, Union, Tuple, Collection, Sequence
import ai2thor.server
import numpy as np
from ai2thor.controller import Controller
from ai2thor.util import metrics
from utils.cache_utils import _str_to_pos, _pos_to_str
fr... |
# -*- coding: utf-8 -*-
# EPG, Daten von tvtoday.de
# URL-Schema: http://www.tvtoday.de/programm/standard/sender/%s.html %s=ID, z.B. ard oder ARD
# Datumsbereich: 12 Tage, Bsp. MO - FR
# Zeitbereich 5 Uhr - 5 Uhr Folgetag
# Einteilung (tvtoday.de): 5-11, 11-14, 14-18, 18-20, 20-00, 00-05 Uhr (hier nicht verwendet)
... |
# Copyright (c) 2016-2017 Intel Corporation
#
# 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... |
import gym
import time
import ctypes
import numpy as np
from collections import OrderedDict
from multiprocessing.context import Process
from multiprocessing import Array, Pipe, connection, Queue
from typing import Any, List, Tuple, Union, Callable, Optional
from tianshou.env.worker import EnvWorker
from tianshou.env.u... |
import copy
import numpy as np
import pytest
import torch
from mmdet.core import GeneralData, InstanceData
def _equal(a, b):
if isinstance(a, (torch.Tensor, np.ndarray)):
return (a == b).all()
else:
return a == b
def test_general_data():
# test init
meta_info = dict(
img_s... |
import numpy as np
import math
from struct import unpack_from
from tifinity.parser.errors import InvalidTiffError
ifdtype = {
1: (1, "read_bytes", "insert_bytes"), # byte - 1 byte
2: (1, "read_bytes", "insert_bytes"), # ascii - 1 byte
3: (2, "read_shorts", "insert_shorts"), ... |
import bpy
import os
import subprocess
import glob
from zipfile import ZipFile
from mathutils import Vector
from platform import system
from bpy_extras.io_utils import ExportHelper
from bpy.props import StringProperty, BoolProperty, EnumProperty
from bpy.types import Operator
##########################################... |
"""
Definition of the controller class for Q learning with
lazy action model.
"""
import pickle
import time
from os import path, mkdir
import tqdm
import numpy as np
import matplotlib.pyplot as plt
from tensorflow import keras
from cvxopt.solvers import qp
from cvxopt import matrix as cvxopt_matrix
class DnnRegressor... |
#!/usr/bin/env python
from __future__ import print_function, division
import itertools, time, copy
import collections, random
import os, pickle
import numba
import numpy as np
board_size = 15
show_q = False
class AIPlayer:
def __init__(self, name, model):
self.name = name
self.model = model
... |
#!/usr/bin/env python
# python 3 compatibility
from __future__ import print_function
import os.path
import sys
import shutil
import time
# stdlib imports
import abc
import textwrap
import glob
import os
import tempfile
# hack the path so that I can debug these functions if I need to
homedir = os.path.dirname(os.path... |
#!/usr/bin/python3
# -*- coding: utf-8 -*-
__author__ = '<NAME>'
VERSION = "0.96 (2021-09-05)"
"""
Simple python script that helps to move my chia plots from my plotter to
my nas. I wanted to use netcat as it was much faster on my 10GBe link than
rsync and the servers are secure so I wrote this script to manage that
... |
import random
import numpy as np
import copy
import sys
import pickle as pkl
import torch
from torch import nn
class BatchBucket():
def __init__(self, max_h, max_w, max_l, max_img_size, max_batch_size, feature_file, label_file, dictionary,
use_all=True):
self._max_img_size = max_img_size
... |
import json
import logging
from typing import Callable, Dict, List, Optional, Union
import bokeh
import hail as hl
import numpy as np
import pandas as pd
from bokeh.layouts import gridplot
from bokeh.models import (
BooleanFilter,
CDSView,
Column,
ColumnDataSource,
DataRange1d,
Div,
Grid,
... |
import asyncio
import datetime
import inspect
import logging
import random
import time
from typing import Any, Callable, Dict, List, Optional, Tuple, Union, cast
import pytz
import tzlocal
from tomodachi.helpers.crontab import get_next_datetime
from tomodachi.helpers.execution_context import (
decrease_execution_... |
import logging
import os
import numpy as np
import pandas as pd
from matplotlib import pyplot as plt
from matplotlib.backends.backend_pdf import PdfPages
from mspypeline.core import MSPInitializer
from mspypeline.core.MSPPlots import BasePlotter
from mspypeline.plotting_backend import matplotlib_plots
class MQReade... |
import os
import sqlite3 as db
import datetime
import socket
import numpy as np
import healpy as hp
import pandas as pd
import matplotlib.path as mplPath
from rubin_sim.utils import _hpid2RaDec, xyz_angular_radius, _buildTree, _xyz_from_ra_dec
from rubin_sim.site_models import FieldsDatabase
import rubin_sim
def smal... |
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
from matplotlib.collections import PatchCollection
import json
#Get the stating phase information
def getStartingPhases():
with open('/nojournal/bin/OptimizationResults.txt') as f:
first_line = f.readline()
return first_line
#Appendi... |
from collections import OrderedDict
import FreeCAD, FreeCADGui
from PySide import QtCore, QtGui
from .deps import with_metaclass
from .utils import getElementPos,objName,addIconToFCAD,guilogger as logger
from .proxy import ProxyType
from .FCADLogger import FCADLogger
class SelectionObserver:
def __init__(self):
... |
#!/usr/bin/env python
import argparse
import os
import sys
import logging
import git
import tempfile
import requests
import contextlib
import re
from .actions.check_for_download_hash import check_for_download_hash
from .actions.check_for_license import check_for_license
from .actions.check_for_deprecated_generators im... |
# ActivitySim
# See full license in LICENSE.txt.
import sys
import os
import logging
import yaml
import numpy as np
import pandas as pd
from activitysim.abm.models.util import tour_frequency as tf
from activitysim.core.util import reindex
logger = logging.getLogger(__name__)
logger.setLevel(logging.DEBUG)
# create... |
import matplotlib
matplotlib.use('Agg')
from dataloaders.visual_genome import VGDataLoader, VG
import numpy as np
from functools import reduce
import torch
from sklearn.metrics import accuracy_score
from config import ModelConfig
from lib.pytorch_misc import optimistic_restore
from lib.evaluation.sg_eval import BasicSc... |
import numpy as np
from scipy import interpolate
from scipy import optimize
import warnings
def calculate_smax(spin_C=False):
r"""Returns maximal saturation factor.
Args:
spin_C (float): unpaired spin concentration in units of Molar
Returns:
smax (float): maximal saturation factor
.... |
from typing import Optional, List, Sequence
import pandas as pd
import numpy as np
from scipy import stats
import sha_calc as sha_calc
from gmhazard_calc.im import IM, IMType, to_im_list, to_string_list
from gmhazard_calc import gm_data
from gmhazard_calc import site
from gmhazard_calc import constants
from gmhazard_... |
import time
from collections import OrderedDict, defaultdict
from functools import reduce, wraps
from inspect import signature
import matplotlib.pyplot as plt
from rfho import as_list
import tensorflow as tf
import rfho as rf
try:
from IPython.display import IFrame
import IPython
except ImportError:
pr... |
# -*- coding: utf-8 -*-
import json
from gsxws.core import GsxError
from datetime import datetime, timedelta
from django.http import QueryDict
from django.db.models import Q
from django.utils import timezone
from django.contrib import messages
from django.core.cache import cache
from django.http import HttpResponse... |
# coding: utf-8
from __future__ import print_function
import time
#import numpy as np
import autograd.numpy as np
import scipy.integrate
import model_learning
from controllers import FlatController, Observer
from model_learning import LinearLearner, TimeLearner
from plotters import DistPlotter, TrajPlotter, XPlotte... |
import json
import json
import logging
import math
import os
from collections import Counter
from itertools import product, chain
import jinja2
import networkx as nx
import numpy as np
import pandas as pd
from bokeh.colors import RGB
from bokeh.io import reset_output
from bokeh.models import ColumnDataSource, ColorBar... |
import fcntl
import struct
import os
import grpc
import tempfile
import time
import random
import subprocess
import string
import threading
import pytest
from rpc.controller.controller_client import ControllerClient
import common.cmd as cmd
from common.util import read_file, checksum_data
from common.frontend import... |
# ***** BEGIN GPL LICENSE BLOCK *****
#
#
# This program 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 2
# of the License, or (at your option) any later version.
#
# This program is distribute... |
from __future__ import print_function
import json
import sys
import re
import contextlib
import random
import string
import httpretty
import pytest
import uritemplate
import restnavigator.halnav as HN
from restnavigator.exc import HALNavigatorError, UnexpectedlyNotJSON
# pylint: disable-msg=E1101
@pytest.fixture... |
import torch
from torch import nn
import numpy as np
from collections import defaultdict
import polyscope as ps
def to_numpy_cpu(a):
if isinstance(a, torch.Tensor):
return a.detach().cpu().numpy()
elif isinstance(a, np.ndarray):
return a
else:
raise ValueError("Requiring Numpy or to... |
#!/usr/bin/env python3
"""
Convert structural variants in a VCF to CGH (CytoSure) format
"""
import argparse
import sys
import pandas as pd
import logging
import gzip
from collections import namedtuple, defaultdict
from io import StringIO
from lxml import etree
from cyvcf2 import VCF
from constants import *
__versio... |
#!/usr/bin/python2.7
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch import optim
import copy
import numpy as np
import cv2
class MultiStageModel(nn.Module):
def __init__(self, num_stages):
super(MultiStageModel, self).__init__()
# self.stage1 = SingleStageModel(num... |
## LSDMap_Subplots.py
##=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
## These functions are tools to deal with creating nice subplots from multiple
## rasters
##=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
## FJC
## 22/12/2016
##=-=-=-=-=-=-=-=-=-=-=-=-=... |
__author__ = "<NAME>"
__credits__ = ["<NAME>"]
__email__ = "<EMAIL>"
__affiliation__ = "Texas A&M University"
import pandas as pd
import xlsxwriter
import numpy as np
from DataFusion import DataFusion
import time
import datetime
from sklearn.model_selection import train_test_split
from sklearn.neighbors import KNeighb... |
#!/usr/bin/env python3.4
# Copyright 2018 The go-python Authors. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
"""
Write compile_data_test.go
"""
import sys
import ast
import subprocess
inp = [
# Constants
('''1''', "eval"),
(... |
import numpy as np
import sklearn
from sklearn.linear_model import Ridge, RidgeCV
from sklearn.kernel_ridge import KernelRidge
from sklearn.model_selection import GridSearchCV
from sklearn.base import RegressorMixin, BaseEstimator
from time import time
import scipy
from .hamiltonians import orbs_base, block_to_feat_ind... |
from riglib import bmi, plexon, source
from riglib.bmi import extractor
import numpy as np
from riglib.bmi import clda
from riglib.bmi import train
from riglib.bmi import state_space_models
import datetime
import matplotlib.pyplot as plt
class State(object):
'''For compatibility with other BMI decoding implementa... |
# -*- python -*-
# This software was produced by NIST, an agency of the U.S. government,
# and by statute is not subject to copyright in the United States.
# Recipients of this software assume all responsibilities associated
# with its operation, modification and maintenance. However, to
# facilitate maintenance we as... |
import numpy as np
import os
import sys
import ntpath
import time
from . import util
from . import html
from scipy.misc import imresize
from config import *
import cv2
import imageio
import torch
import torchvision.transforms as transforms
import projections.operations as operations
if sys.version_info[0] == 2:
V... |
# Este arquivo contém as funções usadas para ajustar as curvas PV
# e outras funções úteis
############################################################### BIBLIOTECAS:
import numpy as np # para fazer contas e mexer com matrizes
import pandas as pd # para montar DataFrames (tabelas de bancos de dados)
f... |
import torch
import tables
import os
import pickle
import numpy as np
import math
import datetime
import torchvision
import cv2
import glob
from pathlib import Path
def CheckPaths(paths,dataset_name):
assert paths['path_to_superpoint_checkpoint']!=None , "Path missing!! Update 'path_to_superpoint_checkpoint' on... |
from http.server import HTTPServer, BaseHTTPRequestHandler
import cgi
from datetime import datetime
import hashlib
import json
import numpy as np
from biobert_ner.run_ner import BioBERT, FLAGS
from convert import pubtator2dict_list, pubtator_biocxml2dict_list, \
get_pub_annotation, get_pubtator
from normalize impo... |
# 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... |
# create by <NAME>, minor adjusted by <NAME>
import warnings
import numpy as np
import scipy.sparse as sp
from scipy.optimize import fsolve
from scipy.spatial.distance import pdist
from scipy.linalg import eig
from scipy.integrate import odeint
from sklearn.neighbors import NearestNeighbors
from .scVectorField import ... |
from builtin_interfaces.msg import Duration
from ros2pkg.api import get_prefix_path
from geometry_msgs.msg import Pose
from std_srvs.srv import Empty
from std_msgs.msg import String
from gazebo_msgs.msg import ContactState, ModelState
from gazebo_msgs.srv import DeleteEntity
from control_msgs.msg import JointTrajectory... |
"""
Some codes from https://github.com/Newmu/dcgan_code
"""
from __future__ import division
import math
import json
import random
import pprint
import scipy.misc
import os
import numpy as np
from time import gmtime, strftime
from six.moves import xrange
from glob import glob
import tensorflow as tf
imp... |
from .policies import hard_limit, greedy_epsilon, choose_randomly
from .policies import _get_max_dict_val
import operator
from copy import deepcopy
from gym.spaces.box import Box, Space
import numpy as np
import random
from .discretizers import Discretizer, Box_Discretizer
def policy_changed(dict1, dict2):
''' ... |
from dash import Input, Output, State, dcc, html, callback, MATCH, ALL, ALLSMALLER, dash
from dataclasses import dataclass, asdict
import pandas as pd
from dacite import from_dict
from dash_extensions.snippets import get_triggered
from dash_extensions import Download
from typing import Optional, List, Union, Any
import... |
# -*- coding: utf-8 -*-
"""
Created on Thu May 13 13:43:45 2021
@author: Hatlab_3
"""
import numpy as np
import matplotlib.pyplot as plt
import sympy as sp
from data_processing.models.SNAIL_supporting_modules.Participation_and_Alpha_Fitter import slider_fit
from data_processing.fitting.QFit import fit, plotRes
from s... |
"""Contains ligand-specific objects and functions."""
from collections import Counter
from . import gtop
from . import pdb
from .interactions import Interaction, get_interaction_by_id
from .exceptions import NoSuchLigandError
from .shared import DatabaseLink, strip_html
def get_ligand_by_id(ligand_id):
"""Returns... |
"""PyLabware device controllers."""
import copy
import logging
import threading
from abc import abstractmethod, ABC
from functools import wraps
import queue
from time import sleep
from typing import Optional, Union, Callable, Any, List, Dict, Tuple
from .connections import (HTTPConnection, SerialConnection, TCPIPConn... |
import os
import sys
import math
keySize = dict(SIZE_128=16, SIZE_192=24, SIZE_256=32)
debug=1;
# Rijndael S-box
sbox = [0x63, 0x7c, 0x77, 0x7b, 0xf2, 0x6b, 0x6f, 0xc5, 0x30, 0x01, 0x67,
0x2b, 0xfe, 0xd7, 0xab, 0x76, 0xca, 0x82, 0xc9, 0x7d, 0xfa, 0x59,
0x47, 0xf0, 0xad, 0xd4, 0xa2, 0xaf, 0x9c, 0xa4, ... |
import os
import dabest
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
from scipy.stats import pearsonr
from task import SequenceLearning
from utils.params import P
from utils.constants import TZ_COND_DICT
from utils.io import build_log_path, pickle_load_dict, \
get_test_data_dir, get_test... |
from django.shortcuts import render, redirect, Http404, get_object_or_404
from django.http import HttpResponse, HttpResponseRedirect, JsonResponse
from django.contrib.auth.decorators import login_required
from django.contrib.auth.mixins import LoginRequiredMixin
from django.db import transaction
from django.views ... |
#2次元Poisson方程式を、有限要素法で解く
#偏微分方程式: ∇・[p(x,y)∇u(x,y)] = f(x,y) (in Ω)
#境界条件: u(x,y)=alpha (on Γ1), du(x,y)/dx=beta (on Γ2)
import time #時刻を扱うライブラリ
import numpy as np #数値計算用
import scipy.spatial #ドロネー分割
import scipy.linalg #SciPyの線形計算ソルバー
import scipy.sparse #圧縮行列の処理
import scipy.sparse.linalg #圧縮行列用ソルバー
import ... |
#!/usr/bin/env python
"""
Literate Programming / Language of Babel style
Edit: We support this now not only from emacs but also from normal mkdocs markdown.
See the documentation.
Old emacs centric docs follow:
Org Mode / Mkdocs Helper Script.
Usage: See e.g. repos/lc/docs/.../getting_started.org
Basics:
I... |
#!/usr/bin/env python
'''
Uses SURF to match two images.
Based on the sample code from opencv:
samples/python2/find_obj.py
Example:
matcher = Matcher()
for i in range(8):
matcher.add_baseline_image(%imagepath%)
match_key, cnt = matcher.match_image_info(%imagepath%)
is_match = matcher.match_i... |
#!/usr/bin/env python3
import argparse
import json
import sys
from os import path
location_types = dict()
type_at_location = dict()
tiletype_names = dict()
gfx_wire_ids = dict()
gfx_wire_names = list()
parser = argparse.ArgumentParser(description="import ECP5 routing and bels from Project Trellis")
parser.add_argumen... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
ALEXA Wide Gamut RGB Colourspace
================================
Defines the *ALEXA Wide Gamut RGB* colourspace:
- :attr:`ALEXA_WIDE_GAMUT_RGB_COLOURSPACE`.
See Also
--------
`RGB Colourspaces IPython Notebook
<http://nbviewer.ipython.org/github/colour-science/co... |
# -*- encoding: utf-8 -*-
#
# Copyright 2013 Hewlett-Packard Development Company, L.P.
#
# 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
#
# ... |
#!/usr/bin/env python
# coding: utf-8
import dash
from dash.exceptions import PreventUpdate
from dash.dependencies import Input, Output, State
import dash_html_components as html
import dash_core_components as dcc
from dash_canvas import DashCanvas
import os
from dash_canvas.utils import (array_to_data_url, pa... |
import os
from .data import BertDataBunch, InputExample, InputFeatures
from .modeling import BertForMultiLabelSequenceClassification
from torch.optim.lr_scheduler import _LRScheduler, Optimizer
from pytorch_transformers import AdamW, ConstantLRSchedule
from tensorboardX import SummaryWriter
from pytorch_transformers ... |
"""
F4PGA Build System
This tool allows for building FPGA targets (such as bitstreams) for any supported platform with just one simple command
and a project file.
The idea is that F4PGA wraps all the tools needed by different platforms in "modules", which define inputs/outputs and
various parameters.
This allows F4PG... |
from jax.config import config
config.update("jax_enable_x64", True)
import jax.numpy as jnp
from jax import jit, grad, vmap
from jax import random
from jax import lax
from jax import custom_vjp
from jax.ops import index, index_update
from jax.flatten_util import ravel_pytree
from functools import partial
from slicere... |
#!/usr/bin/env python
# encoding: utf-8
"""
This is the bootstrap that installs required code at runtime
and runs the tool for the job.
The bootstrap is also responsible for communicating with the
slave daemon on the host (this is assumed to be running in
a virtual machine guest).
"""
from __future__ import absol... |
# table_base.py - Key classes and methods for pretty print text table.
# Copyright (C) 2012 Free Software Foundation, Inc.
# Author: <NAME>
# Package: SublimeTableEditor
# Homepage: https://github.com/vkocubinsky/SublimeTableEditor
# This file is part of SublimeTableEditor.
# SublimeTableEditor is free software: y... |
from django.shortcuts import render
from django.conf import settings
from django.core.files.storage import FileSystemStorage
from rest_framework import viewsets
from django.http import HttpResponseRedirect
from django.shortcuts import render
from .forms import UploadFileForm
from .models import *
from .serializers impo... |
from melee import enums, stages
from melee.enums import Action, Character
import csv
from struct import *
import binascii
import os
import socket
import math
import time
from collections import defaultdict
"""Represents the state of a running game of Melee at a given moment in time"""
class GameState:
frame = 0
... |
'''
A lot of this code has been copied and inspired from the AllenNLP code base.
Reference:
https://github.com/allenai/allennlp/blob/main/scripts/py2md.py
'''
import argparse
from collections import OrderedDict
import dataclasses
from enum import Enum
import logging
from multiprocessing import Pool, cpu_count
import os... |
from __future__ import division
from __future__ import print_function
from __future__ import absolute_import
from __future__ import unicode_literals
import time
import numpy as np
import os
import defenses
import data_utils as data
import cvxpy as cvx
import tensorflow as tf
import random
def poison_with_influence_... |
import weakref
from AppKit import NSView, NSGraphicsContext, NSColor, NSAffineTransform, NSMenu, NSPoint, NSRectFill, \
NSRectFillUsingOperation, NSPointInRect, NSCompositeSourceOver, NSMenuItem
import vanilla
from objc import python_method
from defconAppKit.controls.placardScrollView import PlacardScrollView, Plac... |
#!/usr/bin/env python3
#
# Copyright (c) 2022 <NAME>
#
# MIT License - See LICENSE file accompanying this package.
#
"""Command-line interface for secret_kv package"""
import base64
from typing import Optional, Sequence, List, Union, Dict, TextIO
import os
import sys
import argparse
import argcomplete # type: ignor... |
import yaml
import heapq
import datetime
import sys
# Script constants
if len(sys.argv) > 1 and sys.argv[1] =='--local':
BASE = r"file:///home/evan/Sync/Documents/www/elmo/"
else:
BASE = r"//web.evanchen.cc/elmo/"
YEAR_NEXT = datetime.datetime.today().year
YEAR_PREV = YEAR_NEXT - 1
YEARS = range(2012, YEAR_NEXT+1)
w... |
from flask import Flask, redirect, request, url_for,render_template
from application import app, db
from application.models import Products,Orders,Customers #,SummaryOrder,OrdersSummary,ItemTable,OrdersTable,,CustomersTable
import sqlalchemy as sql
import pandas as pd
from datetime import datetime
@app.route('/')
def ... |
#! /usr/bin/env python
import os
import sys
import logging
import re
import datetime
import copy
try:
import cPickle as pickle
except ImportError:
import pickle
import gekgo_util
from gekgo_util import RunLogger
_LOG = RunLogger(name=__file__,
log_to_stderr=True,
log_to_file=False)
def my_st... |
from collections import namedtuple
from contextlib import contextmanager
import itertools
from objects.definition import Definition
from objects.slots import get_slot_type_for_bone_name_hash, SlotType, RuntimeSlot
from sims4.collections import ListSet, AttributeDict
from sims4.repr_utils import standard_repr
from sims4... |
"""
author: <NAME> & <NAME>
code to generate synthetic data from stock-model SDEs
"""
# ==============================================================================
from math import sqrt, exp
import numpy as np
import matplotlib.pyplot as plt
import copy, os
# =====================================================... |
"""
Copyright (C) 2017 NVIDIA Corporation. All rights reserved.
Licensed under the CC BY-NC-ND 4.0 license (https://creativecommons.org/licenses/by-nc-nd/4.0/legalcode).
"""
import torch
import torch.nn as nn
import torch.nn.parallel
import torch.utils.data
from torch.autograd import Variable
import math
from torch.... |
#!py -3
import math
import os
import sqlite3
import sys
import time
from configparser import ConfigParser
try:
from tk import filedialog
except:
from tkinter import filedialog
import hashlib
from dateutil import parser
from datetime import datetime
import json
import threading
import http.server
import sockets... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.