text stringlengths 3.07k 22.1k |
|---|
import os
import sys
import time
import h5py
import pickle
import argparse
import numpy as np
from build_timit import TimitDictionary, TimitDataLoader
from prep_data import preprocess_data
import torch
from torch.utils.data import DataLoader, TensorDataset
from torch.autograd import Variable
from torch.optim.lr_sched... |
#!/usr/bin/env python
#############################################################################
##
# This file is part of Taurus
##
# http://taurus-scada.org
##
# Copyright 2011 CELLS / ALBA Synchrotron, Bellaterra, Spain
##
# Taurus is free software: you can redistribute it and/or modify
# it under the terms of t... |
# Minimal INTEL assembler expression calculator
import ply.yacc as yacc
import copy
from ..smtlib import Operators
# Lexer
# ------------------------------------------------------------
# calclex.py
#
# tokenizer for a simple expression evaluator for
# numbers and +,-,*,/
# --------------------------------------------... |
"""A rota reader for the multi_rota
- generates a icalendar files for each person"""
# _________________________________ IMPORTS _________________________________
from icalendar import Calendar, Event
import uuid
from datetime import date, datetime, time, timedelta
from collections import defaultdict
import pytz
... |
#!/usr/bin/env python3
"""test methods of Challenge class
"""
import logging
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import *
from test_framework.key import CPubKey
from guardnode.challenge import Challenge, asset_in_block
# args object to pass into Challenge instance... |
import logging
import traceback
from datetime import datetime, timedelta, date
from collections import OrderedDict
from django.db import models
from django.db.models import Q
from django.conf import settings
from django.utils.timezone import localtime, now
from django.contrib.auth.models import User
from django.db.m... |
from typing import Optional, List, Union
from hisim.simulator import SimulationParameters
from hisim.components import occupancy
from hisim.components import price_signal
from hisim.components import weather
from hisim.components import pvs
from hisim.components import smart_device
from hisim.components import building... |
from __future__ import division, absolute_import, print_function
import numpy as np
try:
from scipy.spatial import cKDTree, KDTree, SphericalVoronoi, distance
except ImportError:
pass
from .common import Benchmark
class Build(Benchmark):
params = [
[(3,10000,1000), (8,10000,1000), (16,10000,100... |
from utils import pushd
import os
from random import randint
import shutil
import logging
import random
import string
from fallocate import fallocate, FALLOC_FL_PUNCH_HOLE, FALLOC_FL_KEEP_SIZE
from utils import Size, Unit
import xattr
"""
Generate and distribute target files(regular, symlink, directory), link files.
F... |
from neuron import h, rxd
import time
h.load_file('stdrun.hoc')
from matplotlib import pyplot as plt
mM = 1
msec = 1
nM = 1e-6 * mM
sec = 1e3 * msec
minute = 60 * sec
hour = 60 * minute
h.dt = 1*minute
#def run_sim():
def declare_parameters(**kwargs):
'''enables clean declaration of parameters in t... |
#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
"""Wrapper to train and test a video classification model."""
import argparse
import sys
import torch
import slowfast.utils.checkpoint as cu
import slowfast.utils.multiprocessing as mpu
from slowfast.config.defaults import... |
#!/usr/bin/env python
import sys
import os
import math
import numpy
from rdkit import Chem, DataStructs
from rdkit.Chem import rdMolDescriptors as rdmd
from sklearn.cluster import MiniBatchKMeans
import pandas as pd
from tqdm import tqdm
import time
import numpy as np
from scipy.spatial.distance import cdist
from... |
# !/usr/bin/env python
# coding=utf-8
"""
Calculates the proton dissociation constant (PKA) for the given free energy
data for a set of coordinates.
* Input is rad_PMF (use corr col (3))
** Plan for standard WHAM, too.
* Find local max (inc, then dec) (two back) (middle val is tgt);
in the algorithm below, I will c... |
# Copyright 2014-2016 OpenMarket Ltd
# Copyright 2020 The Matrix.org Foundation C.I.C.
#
# 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
#
# U... |
"""Import data from the EIT-systems built at the Research Center Jülich (FZJ).
As there is an increasing number of slightly different file formats in use,
this module acts as an selector for the appropriate import functions.
"""
import functools
import os
import numpy as np
import pandas as pd
import scipy.io as sio
... |
import torch
import torch.nn
import torch.nn.functional as F
import torchvision
import torchvision.transforms as transforms
from torch.utils.data import Dataset
import torchvision.transforms.functional as TF
import numpy as np
import matplotlib.pyplot as plt
import random
from tqdm import tqdm
import os
import os.path... |
import dataclasses
from typing import List, Optional, Tuple
import nltk
from nltk.corpus.reader.bracket_parse import BracketParseCorpusReader
import tokenizations
import torch
from benepar import ptb_unescape
from benepar.parse_base import BaseInputExample
import transliterate
@dataclasses.dataclass
class ParsingEx... |
import tensorflow as tf
from tensorflow.python.util import nest
from las.ops import lstm_cell
from las.ops import pyramidal_bilstm
__all__ = [
'listener',
'speller',
]
"""Reference: https://github.com/tensorflow/nmt/blob/master/nmt/gnmt_model.py"""
class AttentionMultiCell(tf.nn.rnn_cell.MultiRNNCell):
... |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Tue Apr 21 23:31:01 2020
@author: <NAME>
"""
import numpy as np
import numpy.lib.recfunctions as recfunctions
def dateTimeFunction(datetime, hour_offset):
year=''
month=''
date=''
hour=''
year=datetime[0:4]
month=datetime[4:6]
d... |
try:
from .tools import read_wrfinfo
from .geometry import featureset_to_coords, simplify_coords, lonlat_to_merc
except:
from tools import read_wrfinfo
from geometry import featureset_to_coords, simplify_coords, lonlat_to_merc
from datetime import datetime,timedelta,timezone
import arcgis
import pickl... |
# -*- coding: utf-8 -*-
__author__ = "<NAME> <<EMAIL>>"
__date__ = "$27.11.2014 18:05:15$"
# Copyright 2009-2021 WWPASS 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... |
"""
# *****************************************************************
# (C) Copyright IBM Corp. 2020, 2021. 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... |
# given list of target seqs (col. headed 'Seqs' in CSV),
# config containing: constant pad positions to remove from both ends, required len. of oligo, number of pools,
# get DF with columns:
# pool_id: name of pool
# seq_id: name of this sequence within the pool
# oligo_f: 'fwd' oligo to synthesize
# oligo_r: 'rev' o... |
"""
Simulates the Fish Dish board with a GUI interface for Windows
"""
import Tkinter as tk
import threading
import simGPIO
from PIL import ImageTk, Image
_debug = False
ON = 1
OFF = 0
class RepeatingTimer():
""" A Timer class that does not stop, unless you want it to.
Used to call repeating functions a... |
# -*- coding: utf-8 -*-
'''
Functions+ IDA Pro plugin -- alternative version of functions window.
Splits functions names and groups by namespaces.
'''
import re
from collections import OrderedDict
# import cProfile
# import pstats
# import StringIO
import idaapi
import idc
import idautils
from ... |
import compileall
import PyCompilePackager.Core.Utility as UTL
import os
from pathlib import Path
from shutil import copy, copyfile, rmtree
from distutils.dir_util import copy_tree
import fnmatch
import zipapp
def Shell(s):
import subprocess
return subprocess.check_output(s,shell=True)
def RemovePyCaches(src... |
import enum
import os
from abc import ABC
from abc import abstractmethod
from typing import Dict
from typing import Iterable
from typing import List
from typing import Union
from mwm.feature_types import readable_type
# See coding/string_utf8_multilang.cpp to synchronize languages.
LANGS = (
"default",
"en",
... |
import matplotlib as mpl
mpl.use('Agg')
import matplotlib.pylab as plt
import numpy as np
from pySDC.implementations.collocation_classes.gauss_radau_right import CollGaussRadau_Right
from pySDC.core.Hooks import hooks
from pySDC.helpers.stats_helper import filter_stats, sort_stats
from pySDC.implementations.problem_... |
# -*- coding: utf-8 -*-
"""
Implement S3 Backed Binary and Unicode Attribute.
Since the content of big Binary or Unicode are not stored in DynamoDB, we
cannot use custom attriubte ``pynamodb.attributes.Attribute`` to implement it.
"""
import os
import zlib
from base64 import b64encode, b64decode
from pynamodb.model... |
import os.path
import sys
import keras
sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
from keras.preprocessing.text import Tokenizer
from keras.preprocessing.sequence import pad_sequences
import numpy as np
from gensim.models import KeyedVectors
from gensim.models import FastText
import pickle
import... |
import numpy as np
import cv2
from .vtools import eprint
from typing import List, Dict, Tuple
####################################################################################################
########################################## BEGIN vContour ##########################################
class vContour(np.ndar... |
# Copyright <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/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
... |
# -*- coding: utf-8 -*-
"""
Classses and functions used to define arbitrary aircraft topologies in
Airconics, inspired by the GPLearn API
Created on Fri Apr 15 12:24:32 2016
@author: pchambers
"""
from .base import AirconicsCollection
from .liftingsurface import LiftingSurface
from .fuselage_oml import Fuselage
from ... |
# Copyright 2016 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 or at
# https://developers.google.com/open-source/licenses/bsd
"""Classes and functions that implement command-line-like issue updates."""
from __future__ imp... |
import pygame
import math
import random
from pygame.locals import *
def main():
"""Main game execution
"""
game_init() # initializing game
load_resources() # loading game resources
game_loop() # looping through game
def game_init():
"""Initializing game
"""
# initializing global variab... |
import multiprocessing as mp
from multiprocessing import Process
import timeit, resource
import sys, itertools, os, time, traceback
from partition_baseline_main import do_main
try:
from contextlib import redirect_stdout
except:
# Back port for Python 2.7x
# See: https://stackoverflow.com/questions/44226221... |
#
# Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending
#
import functools
import math
import time
import unittest
import numpy
import numpy as np
import pandas as pd
from deephaven2 import dtypes
from deephaven2.constants import *
from deephaven2.dtypes import DateTime
from deephaven2.time import now
fr... |
# *****************************************************************************
# Copyright (c) 2020, Intel Corporation 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 sou... |
""" test automol.varecof_io.writer.prep
"""
import automol
import varecof_io.writer
# C2H6 + H,OH, CH3
CH3CH2_ZMA = (
('C', (None, None, None), (None, None, None),
(None, None, None)),
('C', (0, None, None), ('R1', None, None),
(2.8034554750087315, None, None)),
('H', (0, 1, None), ('R2', 'A2',... |
import argparse
import os
import subprocess
import textwrap
from typing import Set
import webbrowser
from bead import tech
from bead.box import UnionBox
from ..common import OPTIONAL_ENV, die
from ..cmdparse import Command
from .io import read_beads, write_beads
from .sketch import Sketch
from . import sketch as web_... |
"""Definitions and operations for homogeneous vectors in 3D with broadcasting.
Transformation matrices are applied on the right i.e. we use row vectors.
# History:
## 2018-07-13
Originally (pre July 13 2018), all points/vectors were 2D arrays, with coordinates running of the first dimension. This
is equivalent to ... |
import argparse
from pathlib import Path
import torch
import wandb # Quit early if user doesn't have wandb installed.
from torch.nn.utils import clip_grad_norm_
from torch.optim import AdamW
from torch.optim.lr_scheduler import ReduceLROnPlateau
from torch.utils.data import DataLoader
from dalle_pytorch import OpenA... |
from kubernetes import client, config
import sys
import subprocess
import yaml
import json
import time
import requests
from ctl import *
import logging
class Helper():
def __init__(self, synopsysctl_version="latest", synopsysctl_path=None, kubectl_path=None, oc_path=None):
self.synopsysctl_version = synop... |
from sympy import Wild
import itertools
from .Math import isZero, expand
from .Symbols import mMul
from .Trace import trace, sortYukTrace
class TensorDic(dict):
def __new__(self, *args, **kwargs):
return dict.__new__(self)
def __init__(self, *args, **kwargs):
self.args = args
self.k... |
import json
import re
import pickle
import pandas as pd
def createTrainingFile(inputdict,
headersToUse,
outfile,
filterset=None,
filterReverse=False,
cleanupCSVLabels=[],
labelsfie... |
r"""
Module for representing quantum states.
The :class:`~.BaseState`-class is intended to be subclassed for different types of states,
e.g. qubit states, qudit states, fock states etc.
The :class:`~.State`-class is then a sum of :class:`~.BaseState`s and is not
intended to be subclassed but rather agnostic to the ex... |
#
# Copyright 2011 Red Hat, Inc.
#
# 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 asyncio
import sys
import re
from tempfile import gettempdir
import concurrent.futures as cf
from .helpers import create_pyscript, read_and_display, save
import logging
logger = logging.getLogger("pydra.worker")
class Worker:
def __init__(self, loop=None):
logger.debug(f"Initializing {self.__cl... |
#! /usr/bin/python3
import sys,os
import cProfile
import traceback
def main():
Fname = sys.argv[1]
run_lexer(Fname,'lex.out')
class DbClass:
def __init__(self):
self.state='idle'
self.Token=''
self.Queue=[]
def run_lexer(Fname,Ofname):
global Db
Db=DbClass()
try:
... |
#!/usr/bin/env python
# #############################
# # GO stone camera detection #
# #############################
#
# Licensed under MIT License (MIT)
#
# Copyright (c) 2018 <NAME> | <EMAIL>
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this soft... |
#!/usr/bin/env python
import tweepy
import time
import sys
import os
import random
import gspread
import logging
from configobj import ConfigObj
from subprocess import call
def find_col_or_none(name, wks):
"""A short function which returns None or the column cell. """
logger = logging.getLogger(__name__)
... |
from collections import defaultdict
from numpy import cross, allclose
from numpy.linalg import norm # type: ignore
from pyNastran.converters.cart3d.cart3d import Cart3D
from pyNastran.bdf.field_writer_8 import print_card_8
def run_quad_extraction(cart3d_triq_filename):
"""tests getting the normal groups"""
c... |
from tkinter import *
import tkinter as tk
root = tk.Tk()
canvas = tk.Canvas(root, width=200, height=200, borderwidth=0, highlightthickness=0, bg="black")
canvas.grid()
class No :
def __init__(self,nome,peso,canva, x, y):
self.canva = canva
self.nome = nome
self.peso = peso
self.are... |
import json
import torch
import torch.nn as nn
from models.neural_renderer import get_swapped_indices
from pytorch_msssim import SSIM
from torchvision.utils import save_image
class Trainer():
"""Class used to train neural renderers.
Args:
device (torch.device): Device to train model on.
model... |
# datatypes.py
from typing import Dict, Any
class User:
uuid: str
def __init__(self, uuid):
self.uuid = uuid
class Acls:
def __init__(self, version, user, deny_first=True):
self.deny_first = deny_first
self.inherits = {}
self.acls = []
def to_dict(self):
r = {}
if self.deny_first:
order = '... |
"""Logic for the application settings UI"""
import logging
import json
from qtpy.QtWidgets import QDialog
from qtpy.QtCore import Slot, QAbstractItemModel, QModelIndex, Qt
from friendlypics2.misc.gui_helpers import load_ui
# TODO: fix pylint warnings with this class - it's only used internally by the model below
class... |
# Copyright (c) MONAI Consortium
# 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, so... |
#!/usr/bin/python
# This file is part of Ansible
#
# Ansible 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.
#
# Ansible is distributed... |
# Python script for summarizing control file information into CSV tables for recording in the modeling log
# Last updated on 01/24/21 by SJP
# Step 1 - copy this script for use into your review folder
# Step 2 - set the ..\\DOMAIN\\model folder, the ..\\DOMAIN\\run folder, and the ..\\DOMAIN\\review folder
# Step 3 - ... |
"""eparole - Interface to DSL's ePAROLE dataset.
Usage:
dasem [options] word-to-lemma <word>
Options:
--debug Debug messages.
-h --help Help message
--ie=encoding Input encoding [default: utf-8]
--oe=encoding Output encoding [default: utf-8]
-o --output=<file> Output filen... |
import os
import yaml
import copy
from generators import ecs_helpers
# This script has a few entrypoints. The code related to each entrypoint is grouped
# together between comments.
#
# load_schemas()
# yml file load (ECS or custom) + cleanup of field set attributes.
# merge_schema_fields()
# Merge ECS field sets ... |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** 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 _utilities
fro... |
#######################################################################
# Copyright (C) 2017 <NAME>(<EMAIL>) #
# Permission given to modify the code as long as you keep this #
# declaration at the top #
##############################################################... |
import os
import cv2
import numpy as np
import pandas as pd
import multiprocessing
from saliency_update import *
def rotate_img(img, iteration = 1):
#0: remain same, +n: rotate left in 90*n degree, -n: rotate right in 90*n degree (some part of img is sliced off)
if len(img.shape) == 3:
height, width, _... |
import config
import os, sys, re
import datetime as dt
MODULE = os.getcwd().split('/')[-1]
## base object graph node class = Marvin Minsky's Frame
class Object:
def __init__(self, V):
if isinstance(V, Object): V = V.value
## scalar value: name, string, number,..
self.value = V
## ... |
#!/usr/bin/env python3
import time
import collections
import numpy as np
import matplotlib.pyplot as plt
import cv2 as cv
import pyrealsense2 as rs
import open3d
from rigid_transform import rigid_transform_3D
#np.seterr(all='raise')
np.set_printoptions(precision=3)
np.set_printoptions(suppress=True)
colormap = np... |
import argparse
import numpy as np
import numpy.random as npr
import scipy
import os
import seaborn as sns
import matplotlib.pyplot as plt
import time
import random
from load_data import DSprites, Cars3D, MPI3D, SmallNORB
import pandas as pd
from utils import uniformize, IRS_score, betatc_compute_total_correlation, D... |
import os
import streamlit.components.v1 as components
from PIL import Image
import numpy as np
_RELEASE = True
if not _RELEASE:
_component_func = components.declare_component(
"st_cropper",
url="http://localhost:3000",
)
else:
parent_dir = os.path.dirname(os.path.abspath(__file__))
bu... |
from app.utilities import utils
from app.data.item_components import ItemComponent
from app.data.components import Type
from app.engine import action
from app.engine import item_system, item_funcs, skill_system, equations
from app.engine.game_state import game
class Heal(ItemComponent):
nid = 'heal'
... |
from plotly.offline import download_plotlyjs, init_notebook_mode, plot, iplot
import plotly.graph_objs as go
import plotly.io as pio
import plotly
import csv
import copy
import os
import pandas as pd
import numpy as np
from numpy import inf
from difflib import get_close_matches
import re
def sunburst(data_loader):
... |
__author__ = "<NAME>"
__copyright__ = "Copyright (c) 2020 <NAME>"
__license__ = "MIT License"
import sys
import os
import random
import time
import click
import boto3
import botocore
from . import _session
from . import hanga_constants as const
from . import hanga_util as util
from . import upload_object
def deploy... |
# scraping new sites for new articles.
# notice that this uses multi threading and multi processing to efficiently scrape multiple websites at the same time, while being resourceful (not consuming too much RAM/CPU).
# if you run this script the very first time, it will scrape and analyze all websites and record w... |
"""Generate and catch built-in exceptions."""
# ignore some coding flaws
# pylint: disable=broad-except
# pylint: disable=deprecated-method
# pylint: disable=exec-used
# pylint: disable=undefined-variable
# pylint: disable=unused-variable
import codecs
import gc
import idlelib.rpc
import importlib
import multiprocess... |
"""
The ``Parser`` tries to convert the available Python code in an easy to read
format, something like an abstract syntax tree. The classes who represent this
tree, are sitting in the :mod:`jedi.parser.tree` module.
The Python module ``tokenize`` is a very important part in the ``Parser``,
because it splits the code ... |
import logging
import inspect
import os
from collections import defaultdict
from scruffy.plugin import Plugin
import voltron
log = logging.getLogger('plugin')
class PluginManager(object):
"""
Collects and validates API, debugger and view plugins. Provides methods to
access and search the plugin collecti... |
""" Custom loggers that allows to store logs in DB and Elastic """
from __future__ import unicode_literals
from collections import defaultdict
import datetime
import decimal
import importlib
import logging
import types
import uuid
from django.apps import apps
from django.contrib.contenttypes import models as ct_mode... |
from __future__ import print_function
from time import time
import torch.nn.functional as F
from torch.autograd import Variable
from tqdm import tqdm
from torchvision import transforms
import lmdb, six
from torch.utils import data
from PIL import Image
import os
import sys
import numpy as np
import tensorflow as tf
im... |
#wikipedi sayfası var mı yok mu hangi ekler geliyor onu da yapcam gerçek bir kelime olup olmadığına bakcak sonra gerçek kelimeyse ingilizcesini yazcak gerçek kelimeyse sözlük anlamını yazcak etimolojisini falan yazcak
# harfleri rastgele karıştırıp rastgele bir cümle oluşturmak
#şapkalı harfler
#google translate girip... |
# This code is part of Qiskit.
#
# (C) Copyright IBM 2017, 2019.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivat... |
from django.shortcuts import render, get_object_or_404
from django.contrib.auth.mixins import LoginRequiredMixin, UserPassesTestMixin
from django.contrib.auth.models import User
from django.http import HttpResponse, JsonResponse, FileResponse
from django.urls import reverse
import io
from reportlab.pdfgen import canva... |
bl_info = {
'name': 'SX Batcher',
'author': '<NAME> / Secret Exit Ltd.',
'version': (1, 2, 2),
'blender': (2, 80, 0),
'location': 'View3D',
'description': 'Asset catalogue management tool',
'doc_url': 'https://www.notion.so/secretexit/SX-Batcher-for-Blender-Documentation-f059e9e8f2694fc99207... |
import copy
import json
import os
import torch
import pickle
import urllib
import tarfile
from pprint import pprint
import random
from itertools import chain
import numpy as np
import torch
from torch.utils.data import TensorDataset, DataLoader, RandomSampler, SequentialSampler
from torch.utils.data.distributed import... |
#
# voice-skill-sdk
#
# (C) 2020, Deutsche Telekom AG
#
# This file is distributed under the terms of the MIT license.
# For details see the file LICENSE in the top directory.
#
#
import unittest
from types import SimpleNamespace
from unittest.mock import patch
import bottle
from bottle import HTTPResponse
from skill... |
#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from abc import ABC, abstractmethod
from dataclasses import dataclass, field
from mephisto.abstractions.blueprint import... |
# %%
import numpy as np
import pandas as pd
import scipy as sp
import scipy.optimize
from scipy.optimize import leastsq
import git
# Find home directory for repo
repo = git.Repo("./", search_parent_directories=True)
homedir = repo.working_dir
# Import plotting features
import matplotlib.pyplot as plt
import matplot... |
import math
import torch
import torch.nn as nn
import torch.nn.init as init
import torch.nn.functional as F
class Fire(nn.Module):
def __init__(self, inplanes, squeeze_planes,
expand1x1_planes, expand3x3_planes):
super(Fire, self).__init__()
self.inplanes = inplanes
self.s... |
import json
import glob
import pickle as pkl
import numpy as np
import matplotlib.pyplot as plt
import scipy.io
from sklearn import svm, tree
from sklearn.metrics import precision_recall_fscore_support
from sklearn.preprocessing import normalize, scale
from scipy.cluster.vq import whiten
from sklearn.manifold import TS... |
from collections import defaultdict
from copy import deepcopy
import lazy_dataset
import numpy as np
import samplerate
import soundfile
from cached_property import cached_property
from lazy_dataset.database import JsonDatabase
from sins.database.utils import annotate, add_audio_paths
from sins.paths import jsons_dir
... |
"""Pytorch Densenet implementation w/ tweaks
This file is a copy of https://github.com/pytorch/vision 'densenet.py' (BSD-3-Clause) with
fixed kwargs passthrough and addition of dynamic global avg/max pool.
"""
import re
from collections import OrderedDict
import torch
import torch.nn as nn
import torch.nn.functional a... |
"""
1D plotting routines
"""
from matplotlib import pyplot as pp
import h5py
import argparse
import numpy as np
import os
def plot_1d_loss_err(surf_file, xmin=-1.0, xmax=1.0, loss_max=5, log=False, show=False):
print('------------------------------------------------------------------')
print('plot_1d_loss... |
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... |
import numpy as np
from ..activation import activation_detection, drivative_of_activation
from ..metrics import get_loss_func
from ..scheduling import learning_scheduling
from ..utility_functions import progress_bar
class Network:
VALIDATION_LOSS = "val_loss"
TRAIN_LOSS = "train_loss"
WEIGHT_HOLDER = "WEI... |
"""
Copyright (c) Contributors to the Open 3D Engine Project.
For complete copyright and license terms please see the LICENSE at the root of this distribution.
SPDX-License-Identifier: Apache-2.0 OR MIT
Does in-depth component tests for a new level setup, as well as tests for the Atom renderer Light component.
Utiliz... |
import os
import matplotlib.pyplot as plt
import numpy as np
import scipy.integrate
from scipy.fftpack import fft
import SBCcode
from SBCcode.Tools import SBCtools
class SiPMTrigger(object):
def __init__(self, trig=0):
self.trig=trig
class SiPMPlotter(object):
def __init__(self, pmt_data, left=None... |
# Copyright 2012 NEC 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 ag... |
# -*- coding: utf-8 -*-
# Author: <NAME> <<EMAIL>>, <<EMAIL>>
# License: Apache-2.0 license
# Copyright (c) SJTU. ALL Rights Reserved.
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow as tf
import numpy as np
def box2gaussian(boxes1, box... |
# Custom code to visualize real time video using OpenCV
import os
import sys
import time
import threading
from multiprocessing import Process, Queue
import queue
import logging
import signal
# for debug
import objgraph
from . import CamAiMessage
__version__ = '1.0'
# Logging Setup
logger = logging.getLogger(__name_... |
# Objective: retrieve the ask and bid for Booster Packs.
import json
import time
import requests
from market_listing import get_item_nameid, get_item_nameid_batch
from personal_info import get_cookie_dict, update_and_save_cookie_to_disk_if_values_changed
from utils import get_market_order_file_name, get_cushioned_co... |
import io
import os
import sys
import picamera
import logging
import socketserver
import urllib
import json
import math
import time
import threading
import engineio
import socketio
import eventlet
import platform
from threading import Condition
from http import server
SOCKETIO_ROLE = "server"
# SOCKETIO_SERVER_ADDRES... |
import re
import bisect
import tags
from md import html
from inline import LINK_RE, PAGE_RE, INLINE_EXPR_RE
def forge_line(modifiers, line):
for modifier in modifiers:
line = modifier(line)
return line
class Block(object):
def __init__(self, inline):
self.inline = inline
def build(... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.