text stringlengths 6.04k 39.5k |
|---|
# -------------------------------------------------------------------------------
# Name: pyKal
# Purpose:
#
# Author: klasch5town
#
# Created: 02.01.2022
# Copyright: (c) klasch5town 2022
# Licence: MIT
# -------------------------------------------------------------------------------
import sys, os, os.path, d... |
# Python Mini-Tutorial - Decision Tree Classifier
#
# For questions please contact: <EMAIL>
#
# In this tutorial we're going to:
# 1) read zenon archive data into a pandas dataframe using pyZAN
# 2) visualize the data using seaborn
# 3) make some simple calculations and statistics with that data
# 4) bring the ... |
#! /usr/bin/python
"""
ALL UNITS ARE MILLIMETERS
The tray will be specified by the dimensions of each row & column,
provided as two arrays. If your bin is going to look like this:
----------------------------------
| | | |
60mm | ... |
import gym
import numpy as np
import scipy.stats as ss
from copy import deepcopy
from multiprocessing import Pool
class Adam:
def __init__(self, params, stepsize, epsilon=1e-08, beta1=0.99, beta2=0.999):
self.t = 0
self.beta1 = beta1
self.beta2 = beta2
self.params = params
... |
#
# Python script to run shadow3. Created automatically with ShadowTools.make_python_script_from_list().
#
import Shadow
import numpy
import os
from shutil import copyfile
def getshonecol_from_file(filename,column,nolost=False):
tmp = Shadow.Beam()
tmp.load(filename)
p_a = tmp.getshonecol(column,nolost=nol... |
import copy
from logging import getLogger
from os.path import abspath, dirname, join, pardir
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import seaborn as sns
from loren_frank_data_processing import (Animal, get_all_multiunit_indicators,
get_all_spike... |
# enginedetect.py - a dirty hacky script to detect game engines
# By Yellowberry
# https://github.com/YellowberryHN/enginedetect
import os, sys, mmap, struct, array, json, zipfile, argparse, platform, gc
args = {"engine": "", "dir": "", "game": "", "verbose": 0}
if __name__=="__main__":
if platform.system() != "Win... |
import os
import math
import datetime
import sys
import warnings
from collections import defaultdict
import numpy as np
import time
import torch
import torch.nn as nn
from torch.nn.functional import softmax
from torch.nn.parallel.data_parallel import DataParallel
from torch.optim import Adam, SGD
from torch.optim.lr_... |
#!/usr/bin/env python
"""Merge blocks of data into a single hdf5 dataset.
example splitting of the full dataset: old
python $scriptdir/convert/EM_stack2stack.py \
$datadir/${dataset}.h5 \
$datadir/datastem.h5 \
-f 'stack' -g 'stack' -s 20 20 20 -i zyx -l zyx -p datastem
TODO:
splitting of the full dataset: proposed n... |
#------------------------------------------------------------------------------
# Copyright (c) 2010, <NAME>
# All rights reserved. See LICENSE.txt.
#------------------------------------------------------------------------------
from fwrap import pyf_iface as pyf
from fwrap import constants
def _arg_name_mangler(name... |
# -*- coding: utf-8 -*-
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as functional
from torch.optim import Adam
from torch.utils.data import DataLoader
from torch.nn.utils.rnn import pack_padded_sequence as pack
from torch.nn.utils.rnn import pad_packed_sequence as unpack
fr... |
#!/bin/env python
# SBATCH --job-name=beammap
# SBATCH --nodes=1
# SBATCH --cpus-per-task=8
# SBATCH --mem=63GB
# SBATCH --output=slurm-%A_%a.out
# SBATCH --error=slurm-%A_%a.err
# SBATCH --array=0
# Launch with :
# > sbatch beammap_iterativeraster.py [output_dir]
# Or
# > sbatch --array=0-19 beammap_iterativeraster.p... |
from tkinter import *
import tkinter.messagebox as tmsg
from math import sqrt, pi, ceil
class Otherformulas:
def formulaname(self):
pass
class Cotter:
@staticmethod
def putvalue(line, x, y):
l12 = Label(f6, text=line, fg="black", font=("REVAMPED", 10, "bold"))
l12.place(x=x, y=y)... |
from copy import deepcopy
from itertools import chain
from operator import contains
from pathlib import Path
from frictionless import Resource
from glom import glom, Iter, T
from glom.matching import MatchError
import numpy as np
import pandas as pd
import pytest
from friendly_data.converters import _schema, _source_... |
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
# https://github.com/shelhamer/fcn.berkeleyvision.org/blob/master/surgery.py
def get_upsample_filter(size):
"""Make a 2D bilinear kernel suitable for upsampling"""
factor = (size + 1) // 2
if size % 2 == 1:
cente... |
# -*- coding: utf-8 -*-
"""Non-graphical part of the DFTB+ step in a SEAMM flowchart
"""
import copy
import logging
from pathlib import Path
import pprint
import subprocess
import traceback
import pandas
import dftbplus_step
from .dftbplus import deep_merge, dict_to_hsd, parse_gen_file
from molsystem.elements impo... |
# -*- coding: utf-8 -*-
# ---
# jupyter:
# jupytext:
# formats: ipynb,py:percent
# text_representation:
# extension: .py
# format_name: percent
# format_version: '1.3'
# jupytext_version: 1.11.1
# kernelspec:
# display_name: Python 3
# language: python
# name: python3
# -... |
from krun.util import (format_raw_exec_results, log_and_mail, fatal,
check_and_parse_execution_results, run_shell_cmd,
get_git_version, ExecutionFailed,
get_session_info, run_shell_cmd_list, FatalKrunError,
stash_envlog, dump_in... |
# -*- coding: utf-8 -*-
"""
Created on Thu Jun 22 13:46:04 2017
@author: B
Architecture from Jadeberg et al. 2016
Contrastive loss from Hadsell et al. 2006
train on vml
test on vml
equal pairs
train until max map
mAP with query itself
mAP without query itself
"""
from __future__ import absolute_import
f... |
import time
from unittest import TestCase
from datetime import datetime
from dateutil import parser as dt_parser
import pytz
import uuid
from urllib import urlencode
import mock
from deform import ValidationFailure
from pyramid import testing
from pyramid_beaker import set_cache_regions_from_settings
from unicore.hu... |
# DiGN module
#
# Last updated: Dec 29 2021
import numpy as np
import matplotlib.pyplot as plt
import random
import torch
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F
from resnet import ResNet18, ResNet18Wide, ResNet18_64, ResNet18Wide_64
from densenet import DenseNet121
from ima... |
import ipdb
import torch
import railrl.torch.pytorch_util as ptu
from railrl.torch.core import eval_np
import numpy as np
from visual_mpc.policy.policy import Policy
from torch import nn
import os
from visual_mpc.policy.data_augs import random_crop, random_convolution, random_color_jitter
from rlkit.torch.conv_networks... |
# -*- coding: utf-8 -*-
import numpy as np
try:
from skimage.registration import phase_cross_correlation
except ImportError:
print('Warning: scikit-image not up-to-date')
from skimage.feature import register_translation as phase_cross_correlation
from skimage.transform.pyramids import pyramid_reduce
from... |
from collections import Counter
import csv
import os
import pathlib
import pytest
import utils.solo_models
@pytest.fixture(scope="session", autouse=True)
def set_model_data_file_templates():
if not '/tests' in utils.solo_models.DATA_DIR:
utils.solo_models.DATA_DIR = utils.solo_models.DATA_DIR.replace('/d... |
#!/usr/bin/python
# coding: utf-8
# Author: <NAME>
# Date: 2019-12-23
# Plot forward and reverse blast results and reciprocal blast best hits results
# and then do id mapping for the protein id obtained from my processed data and the protein id obtained from that Cell paper
import os
import json
import numpy as np... |
from __future__ import absolute_import, division, print_function, unicode_literals
from six.moves import range, cStringIO
import six
import operator
import atexit
import sys
import re
import itertools as it
from collections import defaultdict
__all__ = [
'profile',
'profile_now',
'IS_PROFILING',
]
if '--p... |
"""
Output destinations are streamed one by one.
Computes destination one-time address, amount key, range proof + HMAC, out_pk, ecdh_info.
"""
import gc
from trezor import utils
from .state import State
from apps.monero import signing
from apps.monero.layout import confirms
from apps.monero.signing import offloading... |
import unittest
import urllib, urllib2
import requests
import json
#baseurl = "https://casso-1339.appspot.com"
baseurl = "http://localhost:8080"
tempdeviceid = ""
def getStatusCode(url):
response = urllib.urlopen(baseurl + url)
return response.getcode()
def getResponseMessage(url):
response = urllib.urlopen(baseu... |
from Instrucciones.Instruccion import Instruccion
from Instrucciones.AtrColumna import AtributosColumna
from storageManager import jsonMode as DBMS
from Entorno.Entorno import Entorno
from Entorno.Simbolo import Simbolo
from Entorno.TipoSimbolo import TipoSimbolo
from Expresion.variablesestaticas import variables
from ... |
from __future__ import annotations
import datetime
import json
from http import HTTPStatus
from typing import Union, List, Generic, TypeVar, Type, Callable, Dict, TYPE_CHECKING, Optional
from ravendb import constants
from ravendb.documents.queries.facets.misc import FacetResult
from ravendb.documents.queries.index_qu... |
#!/usr/bin/env python3
from typing import Any, Deque, Dict, Optional, Set, Type, Union
import dataclasses
import json
import os
import pathlib
import re
from collections import deque
from contextvars import ContextVar
from functools import total_ordering
import trio
import trio_asyncio
import watchgod
from . impor... |
import numpy as np
import cv2
import tifffile as tf
import os
import scipy.ndimage as ni
import matplotlib.pyplot as plt
from skimage.measure import label as sk_label
from skimage.measure import regionprops
def split_bin(arr,downsample=0.5,split=True):
'''Spatially downsample an image (loaded as arra... |
from OpenGL.GL import *
from OpenGL.GLU import *
from OpenGL.GLUT import *
# from PPT3D.glfw import *
# from win32api import GetSystemMetrics
import sys
from Simulator.PPT3D.settings import Settings
from Simulator.PPT3D.renderer import Renderer
from Simulator.PPT3D.templates import Templates
from Simulator.PPT3D.base_l... |
import os
import glob
import struct
import itertools
import numpy as np
from copy import deepcopy
from collections import namedtuple
import xml.etree.ElementTree as ET
from numpy.lib.stride_tricks import as_strided
import tarfile
# our stuff
import tsutils
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Classes
# ~~~~... |
import random
from pyverse import Pyverse
from re import finditer
from typing import Union, Optional, List, Dict, Set, Tuple, Any
from django.db.models.query import QuerySet
from poems.models import Verse, AssonantRhyme, ConsonantRhyme
from django.http import Http404
WordSetType = Dict[str, Dict[str, QuerySet[Verse]]... |
# -*- coding: utf-8 -*-
"""A corpus wrangler for Wikimedia.
A set of classes to track, download, and parse Wikimedia dumps.
Typical usage example:
from corpus_wrangler import wikimedia as ww
wiki_ct = ww.CorporaTracker()
wiki_article_sets = wiki_ct.get()
add filter
add tokenizer
add clea... |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# __author__ = "JrXnm"
# Date: 18-10-12
import socket
import threading
import datetime
from hashlib import md5
import time
from utils.log import Log
from utils.io import save_info, log_save, server_log
import traceback
import optparse
import re
import string
import random
... |
"""
Copyright(c) 2017 Intel Corporation.
License: MIT
https://github.com/movidius/ncappzoo
Copyright(c) 2018 JellyWare Inc.
License: MIT
https://github.com/electricbaka/movidius-ncs
Copyright (c) 2013 <NAME> (http://dbader.org)
License: MIT
https://github.com/dbader/schedule
Copyright(c) 2019 <NAME>
License: MIT
htt... |
'''
Harness Toolset
Copyright (c) 2015 <NAME>
Contact:
@RGKelley5
RK5DEVMAIL[A T]gmail[D O T]com
www.frogstarworldc.com
License: MIT
'''
import sys
import cmd
import os
import json
import glob
import configparser
import asyncio
from harness.core import global_vars
from threading import Lock
from qu... |
import anndata as ad
import scanpy as sc
import squidpy as sq
from squidpy._constants._constants import CoordType
import numpy as np
from scipy.sparse import spmatrix
from scipy.interpolate import griddata
import pandas as pd
from PIL import Image
from matplotlib import colors
from sklearn.cluster import KMeans
fr... |
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import setup_bmss as lab
import BMSS.models.ia_results as ir
import BMSS.models.model_handler as mh
import BMSS.models.settings_handler as sh
import BMSS.models.setup_cf as sc
import BMSS.mo... |
# Bep Marketplace ELE
# Copyright (c) 2016-2021 Kolibri Solutions
# License: See LICENSE file or https://github.com/KolibriSolutions/BepMarketplace/blob/master/LICENSE
#
import logging
import re
from datetime import datetime
from django import forms
from django.conf import settings
from django.contrib.auth.models i... |
import random
import timeit
#region teacher
"""
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Teachers part
----------------... |
import sys
import os
import cv2
import numpy as np
import skimage.measure
import math
PATH_VIDEO_INPUT = '/media/hdd/aron/rats/Exp_2019_03_22_retrograd_study_20190415_160817.avi'
PATH_VIDEO_A_OUTPUT = None #'/home/vavsaai/databases/rats/rat_sepbg_a.avi' # str or None
PATH_VIDEO_E_OUTPUT = None #'/home/vavsaai/datab... |
from __future__ import unicode_literals
import datetime
try: # Python < 3
import httplib as http_client
import urlparse as urllib_parse
from urllib import urlencode
str_types = (unicode, str)
except ImportError: # Python >= 3
import http.client as http_client
import urllib.parse as urllib_parse... |
from __future__ import annotations
from abc import ABC, abstractmethod
from typing import Callable
import numpy as np
from household_contact_tracing.network import Network, Node, Household, EdgeType, TestType
from household_contact_tracing.parameterised import Parameterised
class IncrementTracing(ABC, Parameterised)... |
from __future__ import print_function
# Plugins Config
from xml.etree.cElementTree import parse as cet_parse
from os import path as os_path
from AutoTimerConfiguration import parseConfig, buildConfig
from Tools.IO import saveFile
# Navigation (RecordTimer)
import NavigationInstance
# Timer
from ServiceReference impo... |
import subprocess
import math
import datetime
import os
import sys
import json
import errno
import os
import tempfile
import subprocess
from evaluate_ate import EvaluateATE
import _util
import csv
from os import listdir
from os.path import isfile, join
_RESULTS_DIR = ''
_RES_COUNTER = 0
def _time():
return da... |
#!/usr/bin/python3.8
import argparse
import time
import json
import glob
import os
import subprocess
import shutil
import csv
import sys
import random
from pprint import pprint
from typing import List, Dict
from dataclasses import asdict, dataclass, field, fields, is_dataclass
ROOT_DIR = os.getcwd()
INFER_DIR = f'{os.... |
# coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import (
compat_parse_qs,
compat_urlparse,
)
from ..utils import (
ExtractorError,
int_or_none,
float_or_none,
parse_iso8601,
smuggle_url,
str_or_none,
strip_jsonp,
... |
"""
core/shell_native.py -- Subset of core/shell.py that we translate to C++.
TODO: consolidate with core/shell.py.
"""
from __future__ import print_function
import time as time_
from _devbuild.gen import arg_types
from _devbuild.gen.option_asdl import builtin_i
from _devbuild.gen.runtime_asdl import cmd_value
from ... |
import cgi
import os
from flask import Flask, render_template, abort, url_for, request, flash, session, redirect
from flaskext.markdown import Markdown
from models.mdx_github_gists import GitHubGistExtension
from models.mdx_strike import StrikeExtension
from models.mdx_quote import QuoteExtension
from models.mdx_code_... |
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
import copy
import pathlib
from typing import Dict, List, Union
import pandas as pd
from datetime import timedelta
import numpy as np
from .decision import Order
from ..data.data import D
class BasePosition:
"""
The Position want to ... |
# -*- coding: utf8 -*-
# -----------------------------------------------------------------------------
# Author : <NAME> (Kris) <EMAIL>
# File : commands.py
# Create : 2017-09-25 23:09:15
# Editor : sublime text3, tab size (4)
# -----------------------------------------------------------------------------
#`protect
... |
from unittest import TestCase
import datetime
import mock
from fitbit import Fitbit
from fitbit.exceptions import DeleteError
URLBASE = "%s/%s/user" % (Fitbit.API_ENDPOINT, Fitbit.API_VERSION)
class TestBase(TestCase):
def setUp(self):
self.fb = Fitbit(consumer_key='x', consumer_secret='y')
def comm... |
import discord
import typing
import asyncio
from discord.ext import commands
from CustomTools import ignore_check as ic
from CustomTools import prefix
class Help(commands.Cog):
"""
A class of help command for hana bot.
Attributes:
bot (commands.Bot): bot reference
indicate (list): emote f... |
#!/usr/bin/env python3
#Author: <NAME>
import os, sys, glob
import argparse
import configparser
import datetime
import numpy as np
import shelve
# suppress matplotlib DEBUG message
from matplotlib.path import Path as Path
import logging
mpl_logger = logging.getLogger('matplotlib')
mpl_logger.setLevel(logging.WARNING... |
from __future__ import absolute_import
from sympy.codegen import Assignment
from sympy.codegen.ast import none
from sympy.codegen.matrix_nodes import MatrixSolve
from sympy.core import Expr, Mod, symbols, Eq, Le, Gt, zoo, oo, Rational, Pow
from sympy.core.numbers import pi
from sympy.core.singleton import S
from sympy... |
"""Support for aggregation-based AMG."""
from __future__ import absolute_import
import numpy as np
from warnings import warn
from scipy.sparse import csr_matrix, isspmatrix_csr, isspmatrix_bsr,\
SparseEfficiencyWarning
from pyamg.multilevel import multilevel_solver
from pyamg.relaxation.smoothing import change_s... |
"""Utilities for calculating and reporting statistics about types."""
import os
from collections import Counter
from contextlib import contextmanager
import typing
from typing import Dict, List, cast, Optional, Union, Iterator
from typing_extensions import Final
from mypy.traverser import TraverserVisitor
from mypy.... |
# Copyright 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 to in wri... |
from __future__ import print_function
import os
import numpy as np
import json
import subprocess
from collections import namedtuple
from pyxdsm import __version__ as pyxdsm_version
OPT = "Optimization"
SUBOPT = "SubOptimization"
SOLVER = "MDA"
DOE = "DOE"
IFUNC = "ImplicitFunction"
FUNC = "Function"
GROUP = "Group"
I... |
# -*- coding: utf-8 -*-
# Copyright 2020 <NAME> (@dathudeptrai)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... |
# ___________________________________________________________________________
#
# Prescient
# Copyright 2020 National Technology & Engineering Solutions of Sandia, LLC
# (NTESS). Under the terms of Contract DE-NA0003525 with NTESS, the U.S.
# Government retains certain rights in this software.
# This software is ... |
"""
integration testing module for tunable coupler element
and line specific chain of signal generation.
"""
# System imports
import copy
import pickle
import pytest
import numpy as np
# Main C3 objects
from c3.c3objs import Quantity as Qty
from c3.parametermap import ParameterMap as PMap
from c3.experiment import Ex... |
# -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making BK-BASE 蓝鲸基础平台 available.
Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
BK-BASE 蓝鲸基础平台 is licensed under the MIT License.
License for BK-BASE 蓝鲸基础平台:
------------------------------------------... |
import copy
import json
import logging
import os
import re
import time
from datetime import datetime
from enum import Enum
import yt_dlp
from le_utils.constants import languages
from . import proxy
from . import utils
LOGGER = logging.getLogger("YouTubeResource")
LOGGER.setLevel(logging.DEBUG)
NON_NETWORK_ERRORS ... |
import os
import random
import sys
import logging
import re
from junit_xml import TestSuite, TestCase
from multiprocessing import Pool
from datetime import datetime
import boto3
import pytest
from botocore.config import Config
from invoke import run
from invoke.context import Context
from test_utils import eks as ek... |
import os
import subprocess
from conda_concourse_ci import execute
import conda_concourse_ci
from conda_concourse_ci.utils import HashableDict
import pytest
import yaml
from .utils import test_data_dir, graph_data_dir, test_config_dir
def test_collect_tasks(mocker, testing_conda_resolve, testing_graph):
mocker... |
import time
import logging
from skimage import morphology
import numpy as np
import matplotlib.pyplot as plt
from collections import OrderedDict
import os, sys
# Local files
import geometry_util as gu
from h5files import GeometryFile
# Voxel labels
INDS = OrderedDict()
INDS["cyt"] = 0
INDS["cleft"] = 1
INDS["jsr"] =... |
# Copyright (c) 2008-2015 MetPy Developers.
# Distributed under the terms of the BSD 3-Clause License.
# SPDX-License-Identifier: BSD-3-Clause
import logging
import re
from datetime import datetime
try:
from enum import Enum
except ImportError:
from enum34 import Enum
from itertools import repeat
import numpy... |
#
# This source file is part of the EdgeDB open source project.
#
# Copyright 2008-present MagicStack Inc. and the EdgeDB 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... |
"""
This file contains parsers and functions that call on other functionality defined
in the rest of mako's scripts directory.
The command line interface is intended to be called sequentially;
files are written to disk as intermediates,
while a settings file is used to transfer logs and other information
between the mo... |
import codecs
import logging
import os
import sys
from collections import namedtuple
import six
import yaml
from .errors import CircularReference
from .errors import ComposeFileNotFound
from .errors import ConfigurationError
from .interpolation import interpolate_environment_variables
from .validation import validate... |
"""
Copyright (c) 2020 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 in wri... |
from datetime import datetime, timezone
from django.db import models
from common.services.coinquery import get_client as get_coinquery_client
from common.utils.networks import SUPPORTED_NETWORK_CHOICES, ETH, ATOM, BNB, XRP, EOS, FIO, RUNE, KAVA, SCRT, OSMO
from common.utils.bip32 import derive_addresses, derive_ether... |
#
# This file is part of Magnum.
#
# Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019
# <NAME> <<EMAIL>>
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the S... |
from flask import Flask, flash, redirect, render_template, request, url_for
from flask_wtf import Form, FlaskForm
from wtforms import Form, TextField, TextAreaField, validators, StringField, SubmitField, SelectField, IntegerField
from flask_wtf.file import FileField, FileAllowed, FileRequired
from werkzeug import secur... |
#!/usr/bin/env python3
# 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... |
# Copyright (c) 2014 NetApp, Inc
# Copyright (c) 2014 <NAME>
# Copyright (c) 2015 <NAME>
# Copyright (c) 2015 <NAME>
# Copyright (c) 2015 <NAME>
# 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 ob... |
#!/usr/bin/env python
# coding: utf-8
# In[1]:
from contextlib import contextmanager
from io import StringIO
import sys
sys.path.append("../")
import rfr_model # noqa: E402
import pandas as pd # noqa: E402
import numpy as np # noqa: E402
import pandas.api.types as ptypes # noqa: E402
from sklearn.ensemble import... |
# Copyright 2018 MLBenchmark Group. 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 applicable l... |
import collections
import configparser
import inspect
import itertools
import logging
import os
import re
import sys
import time as ttime
import warnings
from . import containers
from .backends import BACKENDS, DEFAULT_BACKEND
from .backends.core import _Backend
from .errors import DatabaseError, EntryError, SearchErr... |
# Copyright 2016-2020 Blue Marble Analytics 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 ag... |
#!/usr/bin/python
# license:BSD-3-Clause
# copyright-holders:<NAME>
from __future__ import print_function
import io
import re
import sys
DASM_ARGS = {
"c": ("%s", "get_memadr(opcode, 'c')"),
"d": ("%s", "get_memadr(opcode, 'd')"),
"i": ("%02x", "opcode & 0xff"),
}
TYPES = {
"": None,
"d": No... |
import plotly.graph_objects as go
import base64
import plotly.io as pio
import pdfkit
from domonic.html import div, h3, h1, p, img, table, td, tr, thead, tbody, span, ul, li
def get_full_html(htmlbody):
return "<!DOCTYPE html><html><body><head>{}</head>{}</body></html>".format(
get_css(), htmlbody
)
... |
# Copyright 2019 TerraPower, 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 writi... |
""" Routines to get subject <num>'s data. """
import os
import pandas
import numpy as np
import fmri
import roi
from similarity.category import prototype2d
def get_trials():
""" Return trials for taskA and B (combined) in trial-time
(equivilant to 3 TRs). """
return [1,1,4,4,6,0,4,2,4,1,0,0,0,0,5,4... |
"""
Interactive flow that prompts that users for pipeline template (cookiecutter template) and used it to generate
pipeline configuration file
"""
import json
import logging
import os
from json import JSONDecodeError
from pathlib import Path
from textwrap import dedent
from typing import Dict, List, Tuple
import click... |
import torch
import torch.optim as optim
import argparse
import numpy as np
import time
from tensorboardX import SummaryWriter
from collections import deque
from torch.multiprocessing import Process
from torch.multiprocessing import Manager
import torch.multiprocessing as mp
import matplotlib
matplotlib.... |
#!/usr/bin/env python
"""
A module to perform diffusion analyses (e.g. calculating diffusivity from
mean square displacements etc.). If you use this module, please consider
citing the following papers::
<NAME>., <NAME>., <NAME>., <NAME>., <NAME>., & <NAME>.
(2013). Phase stability, electrochemical stability a... |
"""
Copyright (c) 2016-2020 The scikit-optimize developers.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of cond... |
import collections
import itertools
import psutil
import re
from blessed import Terminal
from collections import defaultdict
from datetime import datetime
from time import time
from types import SimpleNamespace
from typing import Dict, Iterable, Union, Any, List, Optional
import rich
import wandb
import torch.distrib... |
#!/usr/bin/env python3
# vim: filetype=python ts=2 sw=2 sts=2 et :
"""
Optimizer, written as a data miner. Break the data up into regions
of 'bad' and 'better'. 'Interesting' things occur at very different
frequencies in 'bad' and 'better'. Find interesting bits. Combine
them. Repeat. Nearly all this processing takes ... |
# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... |
import logging
import pprint
from pprint import pformat
from typing import Dict, List, Optional, Tuple
import hail as hl
import pandas as pd
import pyspark.sql
from pyspark.ml import Pipeline
from pyspark.ml.classification import RandomForestClassifier, json
from pyspark.ml.feature import IndexToString, StringIndexer,... |
from os.path import os
import json
import socket as socket_module
import sys
import threading
import traceback
try:
import queue
except ImportError:
import Queue as queue
__file__ = os.path.abspath(__file__)
if __file__.endswith((".pyc", ".pyo")):
__file__ = __file__[:-1]
LOG_FORMAT = "ROBOT: %(asctime)s... |
"""This module contains everything to display a model on a screen."""
from __future__ import annotations
from typing import Collection, Iterable
import cairo
from gi.repository import Gdk, GLib, GObject, Gtk
from gaphas.decorators import g_async
from gaphas.geometry import Rect, Rectangle
from gaphas.item import Ite... |
"""
Utilty functions for SPT project
Description:
This file provides various functionality for analysis of time-lapse data
in the format of tif stacks. Conversion, extraction and analysis of raw data
is enabled by computer vision, image processing, and data format libraries.
Functions included:
convert_ND2() :... |
# Generated by pypy/tool/import_cffi.py
import py, sys
import _cffi_backend as _cffi1_backend
def test_ffi_new():
ffi = _cffi1_backend.FFI()
p = ffi.new("int *")
p[0] = -42
assert p[0] == -42
assert type(ffi) is ffi.__class__ is _cffi1_backend.FFI
def test_ffi_subclass():
class FOO(_cffi1_bac... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.