text stringlengths 6.04k 39.5k |
|---|
#
# Copyright (c) 2018 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 to... |
from txtapi import readtxt
from wordapi import readword, transdoc
from pptapi import readppt, transppt
from pdfapi import readpdf
from dwgapi import readdxf
from rarapi import readrar
from knowledge import graph
import utils
import config
import ossconn
import uuid
import numpy as np
from model import FileInfo, ImageIn... |
"""
This module provide operations related to Aliyun table storage.
"""
import datetime
import os
import time
import json
from copy import deepcopy
from logging import getLogger, INFO, basicConfig
from pprint import pprint
from prettytable import PrettyTable
from tablestore import *
from tablestore import OTSClient, ... |
#!/usr/bin/env python
import datetime
import glob
import gzip
import hashlib
import json
import os
import subprocess
import requests
from logzero import logger
#BASEURL = 'http://localhost:5000'
ERROR_TIMER = 0
TOKENS = {
'AAA': '<PASSWORD>'
}
ANSIBLE_PROJECT_ID = u'573f79d02a8192902e20e34b'
SHIPPABLE_URL = ... |
from re import S
import unittest
from unittest.case import SkipTest
from coba.utilities import PackageChecker
from coba.learners import RandomLearner, EpsilonBanditLearner, VowpalLearner, UcbBanditLearner
class RandomLearner_Tests(unittest.TestCase):
def test_predict(self):
learner = RandomLearner()
... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Jul 20 23:05:42 2021
@author: Adrien
"""
#%% Imports
import streamlit as st
#import numpy as np
import pandas as pd
import ast
import seaborn as sns
import matplotlib
import matplotlib.pyplot as plt
from st_funct import *
#%% fuction for the third pag... |
#!/usr/bin/env python3
import bisect
import math
import numpy as np
from copy import deepcopy
from collections import OrderedDict
from typing import List
import rospy
import actionlib
import motion_control.bezier as bezier
from rospy import ROSException
from std_msgs.msg import String
from sensor_msgs.msg import Join... |
# This file is part of the Astrometry.net suite.
# Licensed under a 3-clause BSD style license - see LICENSE
from __future__ import print_function
import matplotlib.cm
import matplotlib.colors
import matplotlib.patches
import numpy as np
import pylab as plt
from matplotlib.ticker import FixedFormatter
import functools... |
# coding=utf-8
import datetime
import os
import requests
from apscheduler.schedulers.background import BackgroundScheduler
from flask import Flask, request
from gevent import pywsgi
from jpush import JPushFailure
from lunar_python import Lunar, Solar
from lunar_python.util import HolidayUtil
from requests import Respo... |
from collections import OrderedDict
import numpy as np
from gym.spaces import Dict
from rllab.spaces import Box
from rllab.misc import logger
from sandbox.ours.envs.sawyer.env_util import get_stat_in_paths, \
create_stats_ordered_dict, get_asset_full_path
from sandbox.ours.envs.sawyer.core.multitask_env import Mul... |
import argparse
from argparse import RawDescriptionHelpFormatter
from pathlib import Path
import os
import numpy as np
from scipy import fftpack, ndimage
from skimage.filters import threshold_otsu
import tifffile
import pywt
import multiprocessing
import tqdm
from pystripe import raw
supported_extensions = ['.tif', '... |
#!/usr/bin/env python3
import re
import time
import pytz
import psutil
import socket
import subprocess
import datetime as dt
import sys
try:
import apt
apt_disabled = False
except ImportError:
apt_disabled = True
## Set System ##
OS_DATA = {}
with open('/etc/os-release') as f:
for line in f.readline... |
"""Asynchronous Advantage Actor-Critic (A3C) algorithm for reinforcement learning."""
from deepchem.models import KerasModel
from deepchem.models.optimizers import Adam
import numpy as np
import tensorflow as tf
import collections
import copy
import multiprocessing
import os
import re
import threading
class A3CLossD... |
import ast
import builtins
import inspect
import sys
import types
from collections import OrderedDict
from functools import partial
from itertools import (chain,
islice,
product,
repeat)
from operator import (itemgetter,
ne)
from... |
# -*- coding: utf-8 -*-
'''
Twokenize -- a tokenizer designed for Twitter text in English and some other European languages.
This tokenizer code has gone through a long history:
(1) <NAME> wrote original version in Python, http://github.com/brendano/tweetmotif
TweetMotif: Exploratory Search and Topic Summarizati... |
# Copyright 2022 The HuggingFace Team. 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 applicabl... |
import numpy as np
import scipy
import torch
perm_dict = {
"xyz": [0, 1, 2, 0, 2],
"zyx": [2, 1, 0, 1, 3],
}
def coords3inds(coords, nz, ny, nx):
coords = coords.to(torch.int32)
# gperm = nx * ny * nz
# gperm1 = nx * ny
# gperm2 = nx
gperm = torch.tensor(nx * ny * nz, dtype=torch.int32, d... |
# maze example
import collections
import numpy as np
import matplotlib
from matplotlib import pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
import sys
from collections import defaultdict
import random
import torch
class Net(torch.nn.Module):
def __init__(self,input_size, hidden_size, output_size):
... |
#!/usr/bin/python
import sys, datetime, calendar, os, re, io
sys.path.append('database/')
sys.path.append('logic/')
import DiaryDatabaseWrapper, addTask, commonDiaryFunctions
def newBuild(argv):
"""
Generate a new build file.
"""
# Get/validate tags and dates
includeTagList, excludeTagList, dat... |
from logs import logDecorator as lD
import jsonref, pprint
import numpy as np
import matplotlib.pyplot as plt
import csv, json
from psycopg2.sql import SQL, Identifier, Literal
from lib.databaseIO import pgIO
from collections import Counter
from textwrap import wrap
from tqdm import tqdm
from multiprocessing impor... |
"""
miscellaneous functions and classes to work with Brainsight output
Author: <NAME>, M.D. [<EMAIL> / <EMAIL>]
"""
import pandas as pd
import numpy as np
from collections import defaultdict
import os
from .coordinates import Coords, FreesurferCoords
from datetime import datetime
import matplotlib.pyplot as plt
from .... |
from __future__ import absolute_import
from __future__ import print_function
import argparse
from collections import defaultdict
import json
import requests
from memoized import memoized_property
from .utils import humansize, get_arg_parser, get_config_from_args, check_connection, \
get_db_list, get_db_metadata, ... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2020, <NAME> (<EMAIL>)
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {
"metadata_version": "1.1",
"status": ... |
# -*- coding: utf-8 -*-
##############################################################################
# LMA: A Python Library for generating FT-spectra from
# Molecular Dynamics Trajectories.
#
# Copyright 2017-2018
# Ruhr-University-Bochum Institute of biophysics and the Author
#
# Author: <NAME>
#
... |
# -*- coding: utf-8 -*-
# 作者: inspurer(月小水长)
# 创建时间: 2020/11/1 17:38
# 运行环境 Python3.6+
# github https://github.com/inspurer
# qq邮箱 <EMAIL>
# 微信公众号 月小水长(ID: inspurer)
# 文件备注信息 todo
import requests
from lxml import etree
from collections import OrderedD... |
#!/usr/bin/env python3
"""
User impact in Social Networks: master thesis at BUT FIT, ac. year 2016/2017.
Author: <NAME>, <EMAIL>
Facebook downloader
"""
import sys, os, urllib.parse, json, re, copy, datetime, argparse
import requests
# How many bytes (approximately) a data file has (in bytes)
DATA_FILE_... |
"""Common settings and globals."""
from os.path import abspath, basename, dirname, join, normpath
from sys import path
from environ import Env
gettext = _ = lambda s: s
########## PATH CONFIGURATION
PACKAGE_PATH = dirname(dirname(abspath(__file__)))
PACKAGE_NAME = basename(PACKAGE_PATH)
PROJECT_PATH = dirname(PACKA... |
from unittest import TestCase
from os import environ
from itertools import combinations
class Generator(TestCase):
def check_list(self, lst):
self.assertIsInstance(lst, list)
self.assertGreater(len(lst), 0, "List contains no results")
for item in lst:
self.assertIsIns... |
import os
from flask_sqlalchemy import SQLAlchemy
from config_sample import config, interface
from oauth import OAuthSignIn
from flask import (Flask, g, render_template, flash, redirect, url_for,
abort)
from flask import request
from flask_bcrypt import check_password_hash
from flask_login import (Lo... |
"""fields to be used in the versioned schemas (may return shared raw nodes on `deserialize`"""
import datetime
import distutils.version
import logging
import pathlib
import typing
import marshmallow_union
import numpy
from marshmallow import ValidationError, fields as marshmallow_fields, Schema
from . import field_va... |
"""
This file contains helper functions for building the model and for loading model parameters.
These helper functions are built to mirror those in the official TensorFlow implementation.
"""
import re
import numpy as np
import pdb
from torch.nn.parameter import Parameter
# from nn.modules import Module
import math
... |
# Copyright (c) 2020 AIST.
#
# 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, publish, distribute, s... |
import csv
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
import csv
from planner.helperFunctions import euclidianDistance
def cmToInches(cm):
return cm / 2.54
class TrajectoryUtils:
def __init__(self, trajectoryDataFile=None, tentacleLength=0.1):
if trajectoryDataF... |
import json
import logging
from datetime import datetime
from http import HTTPStatus
import astutus.usb
import flask
import flask.logging
logger = logging.getLogger(__name__)
usb_page = flask.Blueprint('usb', __name__, template_folder='templates')
def get_alias_path_item_list():
aliases = astutus.usb.device_al... |
# -*- coding: utf-8 -*-
#
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
#
# pylint: disable= no-member, arguments-differ, invalid-name
#
# Chemistry utils in JTVAE
from collections import defaultdict
from scipy.sparse import csr_matrix
from scipy.sparse.csgr... |
from __future__ import absolute_import, division, print_function
from scitbx.rigid_body.proto.tst_joint_lib import exercise_sim
from scitbx.rigid_body.proto import joint_lib
from scitbx.rigid_body.proto.test_simulation import simulation
from scitbx.rigid_body.proto.test_utils import create_wells
from scitbx.rigid_body.... |
# Important librairies.
from PIL import Image
import glob
import numpy as np
import re
import matplotlib.pyplot as plt
from skimage import measure
import scipy.ndimage
import os
import cv2
import pickle
import copy
from tifffile import imsave
# ----------------------------------------------------------... |
# Run this app with `python app.py` and
# visit http://127.0.0.1:3000/ in your web browser.
import dash
from dash import dcc
from dash import html
from dash.dependencies import Output, Input, State
import plotly.express as px
import dash_bootstrap_components as dbc
import pandas as pd
import json
import re
import jobl... |
"""
Stat viewer app for Vainglorious Eye stats (reads the tracker's database)
"""
import os
import threading
from datetime import datetime
from cPickle import load, dump
import urlparse
import fnmatch
import re
import urllib
from mako.lookup import TemplateLookup
from waitforit import WaitForIt
from paste.urlparser im... |
# coding=utf-8
import datetime
import math
import excel_tools
import openpyxl
import openpyxl.writer.excel
import os
import redis
import tasks
from api import api
from app import app, db
from archive import ArchiveManager
from auth import auth
from flask import (flash, g, redirect, request, render_template,
... |
#!/usr/bin/env python2
"""Implement a version of SIMON (working memory task)
described in Morrison 2014 (doi: 10.3389/fnhum.2013.00897)"""
# SimonTask.py
# Created 12/16/14 by DJ based on ThresholdToneDetection.py
# Updated 1/5/15 by DJ - added logging, key options, cleaned up
from psychopy import core, visual, gui, ... |
import os
from collections import OrderedDict
import io
import logging
import regex as re
import time
SYNDELIM = '‣'
MNDELIM = '⁋'
logger = logging.getLogger(__name__)
logger.setLevel(logging.DEBUG)
file_handler = logging.FileHandler('filter.log', 'w')
formatter = logging.Formatter('%(message)s')
logger.addHandler(... |
# this file contains constants and info on atmospheric gases
#solar constant:
sol_const = 1361e0 # [W/m^2]
# solar radius
sol_radius = 6.955e8 # [m]
# 1 AU in meter
AU = 1.49597870700e11 # [m]
#proton mass
mu = 1.67262158e-27 # [kg]
# gas constant
R_gas = 8.314e0 # J/K/mol
R_Earth = 6371000e0 # m
sigma = 5.67e-8 # J m... |
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# -*- mode: Python -*-
'''
LJ Laser Server v0.8.2
Inspiration for a future WebUI icon menu :
https://codepen.io/AlbertFeynman/pen/mjXeMV
Laser server + webUI servers (ws + OSC)
- get point list to draw : /pl/lasernumber
- for report /lstt/lasernumber /lack/lasernumber /cap/... |
import math
import time
import torch.autograd
import torch.nn as nn
import dcp.utils as utils
from dcp.aux_classifier import AuxClassifier
from dcp.models.preresnet import PreBasicBlock
from dcp.models.resnet import BasicBlock, Bottleneck
class View(nn.Module):
"""
Reshape data from 4 dimensio... |
import glob
import os
import albumentations as A
import cv2
import numpy as np
import torch
import torch.nn as nn
import torch.optim as optim
import torchvision.transforms as transforms
from sklearn.utils import shuffle
from torch.autograd import Variable
from torch.utils.data import DataLoader
from torch.utils.tensor... |
"""
@author: <NAME>
This file is the Fourier Neural Operator for 2D problem such as the Navier-Stokes equation discussed in Section 5.3 in the [paper](https://arxiv.org/pdf/2010.08895.pdf),
which uses a recurrent structure to propagates in time.
"""
import os
from utilities3 import *
import torch
import numpy as np
i... |
# Copyright 2021 Google LLC
#
# 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, ... |
from flask import current_app, request
from flask.ext.restful import Resource
from flask.ext.discoverer import advertise
try:
from flask_login import current_user
except:
# If solr service is not shipped with adsws, this will fail and it is ok
pass
import json
from models import Limits
from sqlalchemy impor... |
import argparse, time, random, os
import numpy as np
import torch
import torch.nn as nn
from model.GIN.gin_all_fast import GIN
from model.GCN.gcn_all import GCN
from Temp.dataset import GINDataset
from utils.GIN.data_loader import GraphDataLoader, collate
from utils.scheduler import LinearSchedule
def set_... |
# uncompyle6 version 3.7.4
# Python bytecode 3.7 (3394)
# Decompiled from: Python 3.7.9 (tags/v3.7.9:13c94747c7, Aug 17 2020, 18:58:18) [MSC v.1900 64 bit (AMD64)]
# Embedded file name: T:\InGame\Gameplay\Scripts\Server\objects\base_interactions.py
# Compiled at: 2020-05-28 20:15:33
# Size of source mod 2**32: 34163 by... |
import fnmatch
import logging
import os
from django.conf import settings
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from django.db import models
from django.template.defaultfilters import slugify
from django.utils.translation import ugettext_lazy as _
from guardian.shortc... |
# JACSNET Evaluation
# Author: <NAME> 04.11.19
# get libraries
import sys
import numpy as np
import pandas as pd
import scipy
import csv
import matplotlib.pyplot as plt
import tensorflow as tf
import itertools
import librosa
import librosa.display
import keras
from keras.models import Model
from keras.layers import ... |
import matplotlib.pyplot as plt
_colors = { 'SAD': 'tab:orange',
r'SAD $\Delta E=0.001\epsilon$': 'tab:orange',
r'SAD $\Delta E=0.01\epsilon$': 'tab:orange',
r'SAD $\Delta E=0.1\epsilon$': 'tab:orange',
'WL': 'tab:green',
r'WL $E_{\min}=-133.53\epsilon$': 't... |
#!/usr/bin/env python3
"""
Import the top level tile interconnect information from Project X-Ray database
files.
The Project X-Ray specifies the connections between tiles and the connect
between tiles and their sites. prjxray_tile_import generates a VPR pb_type
that has the correct tile pin names to connect to the r... |
'''
[diagnostics_vars.py]
Handles data requirements specifications for visualization globAcc project simulation results. Note: spherical_polar coordinates only!
Author: <NAME>, <EMAIL>
'''
import numpy as np
exec(open("./diagnostics_header.py").read())
def identity (x):
return x
def SQR (x):
return x*x
# Acc... |
from Examples import metadata_manager_results as results_manager
from Source.genetic_algorithm.fitting_functions import f2_time_param_penalization
from Source.genetic_algorithm.fitting_functions import make_limits_dict, update_limit_dict
from Source import io_util as io
import matplotlib.pyplot as plt
import matplotlib... |
import pickle
from abc import ABC, abstractmethod
from io import BytesIO
from db_classes import PRG
from geo_utilities import *
class XmlParser(ABC):
def __init__(self, xml_path: str, tags_tuple: tuple, event_type: str) -> None:
self.xml_path = xml_path
self.tags_tuple = tags_tuple
self.e... |
from typing import List, Tuple
import numpy as np
import plotly.express as px
import plotly.graph_objects as go
import plotly.io as pio
from plotly.subplots import make_subplots
from scipy.io import loadmat
import os
import shutil
from urllib.request import urlopen
COLOR1 = 'steelblue'
def find_or_create_dir(dir_n... |
"""
Copyright © 2021-2022 The Johns Hopkins University Applied Physics Laboratory LLC
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 t... |
from keras.models import Model
from keras.layers import Input, concatenate, Conv2D, MaxPooling2D, Conv2DTranspose
from keras.layers import merge, UpSampling2D, Dropout, Cropping2D, BatchNormalization
from keras.initializers import RandomNormal, VarianceScaling
import numpy as np
from keras.layers.core import Laye... |
# -*- coding: utf8 -*-
__title__ = "FreeCAD Maya file importer"
__author__ = "<NAME>"
import sys, shlex, struct, FreeCAD, numpy
from importUtils import newObject, getShort, getInt
class GsmHeader():
def __init__(self):
self.length = 0x28
self.blockCount = 0
class GsmMySg():
def __init__(sel... |
"""
The Sims 4 Community Library is licensed under the Creative Commons Attribution 4.0 International public license (CC BY 4.0).
https://creativecommons.org/licenses/by/4.0/
https://creativecommons.org/licenses/by/4.0/legalcode
Copyright (c) COLONOLNUTTY
"""
import services
import build_buy
from interactions.interact... |
"""
Code like this
if x:
print(a)
else:
print(b)
print(c)
produces a decision tree like this:
...
|
V
,---is x true?--.
|yes no|
| |
V V
push print push print
... |
import json
from os import listdir, mkdir, pardir
from os.path import join, exists
from sys import stderr
import os, sys, inspect
from random import shuffle
import dynet as dy
import re
import numpy as np
from data_formats.tree_loader import load_from_export_format
from parser.string2int_mapper import String2IntegerMa... |
""" This script will test the submodules used by the scattering module"""
import os
import io
import numpy as np
import torch
import pytest
from kymatio import Scattering2D
from torch.autograd import gradcheck
from collections import namedtuple
devices = ['cpu']
if torch.cuda.is_available():
devices.append('cuda'... |
"""Particle filter state cache."""
import atexit
import logging
import h5py
import numpy as np
import os.path
import signal
import tempfile
def default(ctx, forecast_dates):
"""
Return the default (i.e., empty) cached state.
If no cache file is defined in ``ctx.params['hist']['cache_file']``, this
w... |
## attack.py -- generate audio adversarial examples
##
## Copyright (C) 2017, <NAME> <<EMAIL>>.
##
## This program is licenced under the BSD 2-Clause licence,
## contained in the LICENCE file in this directory.
import numpy as np
import tensorflow as tf
from shutil import copyfile
import scipy.io.wavfile as wav
import... |
import logging
import re
import sys
from pathlib import Path
from typing import Dict, Iterable, Iterator, List, Tuple
from urllib.parse import urlparse
from warnings import warn
import numpy as np
import pandas as pd
from ixmp.backend import ItemType
log = logging.getLogger(__name__)
# Globally accessible logger.
#... |
#!/usr/bin/env python3
from argparse import ArgumentParser
from dataclasses import dataclass, field
from itertools import islice
from typing import Dict, List, TypeVar
import ijson
import os
import re
import subprocess
import sys
import tempfile
TSC_MAX = (1 << 64) - 1
@dataclass
class DTraceArgument:
"""Descri... |
#!/usr/bin/python
#
# Copyright 2012 Red Hat, Inc.
# Portions Copyright (C) 2012,2013 <NAME> <<EMAIL>>
#
# 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.o... |
from typing import cast, BinaryIO, NamedTuple, Optional
import os
import sys
import json
import shutil
import struct
import pickle
import traceback
from enum import Enum
from dataclasses import dataclass, asdict
from fs import FSWorker
from emu import create_emulator, attach_emulator, Emulator
from spec_basis import... |
# pragma pylint: disable=missing-docstring,protected-access
# pragma pylint: disable=attribute-defined-outside-init,no-self-use
import pytest
from autoprotocol.container import Container, Well, WellGroup
from autoprotocol.instruction import Instruction
from autoprotocol.unit import Unit
class HasDummyContainers(objec... |
__all__ = [
"marg_gkde",
"marg_named",
"Marginal",
"MarginalNamed",
"MarginalGKDE",
"param_dist",
"valid_dist",
]
import copy
import warnings
from abc import ABC, abstractmethod
from numpy import zeros, array, Inf
from numpy import min as npmin
from numpy import max as npmax
from pandas imp... |
from bs4 import BeautifulSoup
from requests import get as rget
from sys import stderr
import re
import tkinter as tk
# Q.O.L variables
line_ending = '\n------------------------\n'
# email for bug reports / requests
email = '<EMAIL>'
year = '2020'
debug_lines = False
# parses the logic retrieved from the website
# Er... |
# Copyright 2020 Google LLC
#
# 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, ... |
import os
import glob
import zipfile
import shutil
import re
from html.parser import HTMLParser
from transliterate import translit
from functions.game_name_functions import *
if (os.getcwd().endswith('scripts')):
os.chdir('..')
from classes.scraper import *
from classes.database import *
h = HTMLParser()
def get_... |
try:
from django.db.models import Prefetch, F, Value, OuterRef, Subquery
except ImportError:
raise Exception('django must be installed')
import copy
from pyresource.executor import Executor
from pyresource.translator import ResourceTranslator
from pyresource.resolver import RequestResolver
from pyresource.exce... |
"""
A library to allow the sending of artists from threads to matplotlib.animation.FuncAnimation
During registration of the various X_Artits objects, the artists get registered by the
ArtistManager function. When an object gets out of scope, the artist gets deleted from
the list of artists.
"""
from abc import ABC, ab... |
from django.shortcuts import render, get_object_or_404
import io
from rest_framework.parsers import JSONParser
from rest_framework.renderers import JSONRenderer
from rest_framework.generics import ListAPIView, RetrieveUpdateDestroyAPIView, ListCreateAPIView
from django_filters.rest_framework import DjangoFilterBackend
... |
"""Bayesian estimation for two groups
This module implements Bayesian estimation for two groups, providing
complete distributions for effect size, group means and their
difference, standard deviations and their difference, and the
normality of the data.
Based on:
<NAME>. (2012) Bayesian estimation supersedes the t
... |
import pandas as pd
import numpy as np
from scipy import interpolate
from scipy.optimize import curve_fit, root_scalar
import json
try:
import matplotlib.pyplot as plt
except:
pass
from ._emulator import Emulator
def build_emulator(
file_PV_loops,
period,
file_EDPV = None,
cycle... |
#!/usr/bin/env python3
#
# Author:
# <NAME> (@skelsec)
#
import io
import enum
import logging
from minidump.common_structs import *
# https://msdn.microsoft.com/en-us/library/windows/desktop/ms680396(v=vs.85).aspx
class PROCESSOR_ARCHITECTURE(enum.Enum):
AMD64 = 9 #x64 (AMD or Intel)
ARM = 5 #ARM
IA64 = 6 #Intel ... |
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
import torch
import numpy as np
from ogb.lsc.pcqm4m_pyg import PygPCQM4MDataset
from rdkit import Chem
import rdkit.Chem.AllChem as AllChem
import joblib
import numpy as np
import math
from scipy.spatial.distance import cdist
# ===============... |
import mesh_to_sdf
import matplotlib.pyplot as plt
from drawnow import drawnow
import numpy as np
import argparse
import pickle
import trimesh
from klampt.io import resource
from scipy.spatial.transform.rotation import Rotation
import os
import sys
sys.path.append("./3rdparty/bop_toolkit")
sys.path.append("./3rdparty/b... |
#!/usr/bin/python
"""Use a trunnel input file to generate examples of that file for
fuzzing.
Here's the strategy:
First, sort all the types topologically so that we consider
every type before any type that depends on it.
Then, for we iterate over each type to make examples of it. We do
... |
import json
import pytest
import numpy as np
# relative imports
from mobidb_lite import MobidbLite
from mdblib.prediction import Prediction, States
from mdblib.consensus import Consensus, SimpleConsensus, MobidbLiteConsensus
# data imports
from mdbtest.test_data import *
def test_prediction_hascorrectlength():
sc... |
"""Templates for pose estimators, or posers."""
import asyncio
import numbers
import warnings
from ..util import utilz as u
class PoseEuler(object):
"""Struct containing all variables needed for instantaneous pose."""
__slots__ = [
"x",
"y",
"z",
"vel_x",
"vel_y",
... |
import signal
import os
import numpy as np
import json
import torch
from torch.autograd import Variable
from visdom import Visdom
from time import gmtime, strftime
viz = Visdom()
target_sample_index = 0
target_frame_index = 5
mean_images = {}
mean_cubes = {}
optical_flow = False
# ===================================... |
class AspectData:
def __init__(self):
self.leadership_plays = 0
self.leadership_wins = 0
self.leadership_win_percentage = 0
self.justice_plays = 0
self.justice_wins = 0
self.justice_win_percentage = 0
self.protection_plays = 0
self.protection_wins = 0
... |
import re
import math
import nltk
import data_reading
from nltk import word_tokenize
from nltk.corpus import stopwords
from nltk.stem import SnowballStemmer
from collections import Counter
WORD = re.compile(r'\w+')
VERB_TAGS = ['VB', 'VBD', 'VBG', 'VBN', 'VBP', 'VBZ']
def yes_no(question, question_t... |
# coding=utf-8
# Copyright 2018 The Google AI Language Team Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ... |
from os.path import isfile, basename, abspath, join, dirname
from pathlib import Path
import glob
import pandas as pd
import numpy as np
import geopandas as gpd
import xarray as xr
import dask
from shapely.geometry.base import GEOMETRY_TYPES
from shapely.geometry import box
import pyproj
import logging
from . import r... |
# -*- encoding: utf-8 -*-
"""
endpoint_user_login.py
"""
from solidata_api.api import *
log.debug(">>> api_auth ... creating api endpoints for USER_LOGIN")
### import mongo utils
from solidata_api._core.queries_db import mongo_users
### create namespace
ns = Namespace('login', description='User : login related e... |
from entity import *
# instruction centric modeling
# instruction centric checking
# parameterized model
"""
state
d w t : r
d w : L1 L1.fifo.head L1.fifo.tail lock (single)
d : L2 L2.fifo.head L2.fifo.tail lock (addr-> lock)
"""
# make sure you only read once
"""
state(d).L2.... |
import matplotlib.pyplot as plt
import gym
import time
from csv import writer
from stable_baselines3.common.type_aliases import GymObs, GymStepReturn
from typing import Union
import numpy as np
import os
from typing import Optional
from autoencoder import load_ae
import gym.wrappers
class AutoEncoderWrapper(gym.Wra... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Standard module
import json
import os
import sys
import time
from base64 import b64encode
from urllib.parse import urlparse, urlunparse
from pprint import pprint
from threading import Timer , Lock
import requests
import zeroconf
# Non standard modules (install with... |
from flask import Flask, render_template, request, redirect, jsonify
from flask import url_for, flash, make_response
from flask import session as login_session
from sqlalchemy import create_engine, asc
from sqlalchemy.orm import sessionmaker
from database_setup import Base, User, Genre, Movie
import random
import strin... |
""" Functions for generating bootstrapped error bars """
#***************************************************************************************************
# Copyright 2015, 2019 National Technology & Engineering Solutions of Sandia, LLC (NTESS).
# Under the terms of Contract DE-NA0003525 with NTESS, the U.S. Governm... |
import torch # NOQA
import copy
import ubelt as ub
import numpy as np
class TestResult(ub.NiceRepr):
def __init__(self, a, b):
self.records = a
self.recommended_lr = b
def __nice__(self):
return 'recommended_lr = {!r}'.format(self.recommended_lr)
def lr_range_test(harn, init_value=... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.