text stringlengths 6.04k 39.5k |
|---|
import os
import sys
import json
import yaml
import LAMP
import logging
import argparse
import pandas as pd
from pprint import pprint
from inspect import getargspec
import compress_pickle as pickle
import tarfile
import re
#from .raw import sensors_results, cognitive_games_results, surveys_results # FIXME REMOVE LATER
... |
# -*- coding: utf-8 -*-
"""
Copyright 2018 NAVER Corp.
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, pub... |
import math
import find_homography_distance
from tabulate import tabulate
import scipy.io
import os
import operator
import numpy as np
import ast
results = {}
template = set()
test = set()
##################
# MATRIX DO CONCORRENTE
###################
#test = ('adidas_test90', 'adidas_test210', 'Cocacola_test30', '... |
"""Runs benchmarks for TF Models."""
from __future__ import print_function
import argparse
import datetime
import os
import time
from six.moves import range
import yaml
from test_runners.common import cluster_local
from test_runners.common import util
import test_runners.tf_models.reporting as reporting
class TestR... |
# Lyes @2022
# The data could be found in http://keddiyan.com/files/PowerForecast.html
# and <NAME> and <NAME>, ‘‘Predicting residential energy consumption using CNN–LSTM neural networks,’’ Energy, vol. 182, pp. 72–81, Sep. 2019.
# https://towardsdatascience.com/the-time-series-transformer-2a521a0efad3
import numpy... |
"""
Likelihood module to evaluate the joint likelihood of a set of tomographic 3x2pt power spectra on the full sky
using a multivariate Gaussian likelihood.
The main functions are setup, which should be called once per analysis, and execute, which is called for every new
point in parameter space.
"""
import os.path
i... |
#!/usr/bin/env python3
from threading import Timer
from datetime import datetime
import subprocess
import os
import sys
sys.path.append("../lib/")
import json
import json_parser
import pos
import pos_util
import cli
import pos_constant
import time
POS_ROOT = '../../../'
ARRAYNAME = "POSArray"
#SECONDS FOR A MINUTE
#... |
import io
import json
import logging
import mimetypes
import os
import tempfile
import uuid
from datetime import datetime
from distutils.util import strtobool
from os import getenv
from common_utils_py.did import did_to_id, convert_to_bytes
from common_utils_py.utils.crypto import ecdsa_decryption, rsa_decryption_aes
... |
import logging
from uuid import UUID
import openpathsampling.engines as peng
from openpathsampling.netcdfplus import ObjectStore, \
NetCDFPlus, LoaderProxy
from .snapshot_feature import FeatureSnapshotStore
from .snapshot_value import SnapshotValueStore
import sys
if sys.version_info > (3, ):
unicode = str
... |
# -*- coding: utf-8 -*-
'''
Capsules for Object Segmentation (SegCaps)
Original Paper: https://arxiv.org/abs/1804.04241
Code written by: <NAME>
If you use significant portions of this code or the ideas from our paper, please cite it :)
If you have any questions, please email me at <EMAIL>.
This file contains the defin... |
import sys
import numpy as np
from scipy.stats import gamma
from utils import ilogit
from scipy.stats import invwishart, poisson, multivariate_normal as mvn
from elliptical_slice import elliptical_slice
def posterior_ess_helper(x):
(y, present,
grid, weights, c,
mu, beta, chol,
nburn, nsamples, nthi... |
"""
Created on Jan 10, 2014
@author: sean
"""
from __future__ import print_function, unicode_literals, absolute_import
import sys
import struct
from pprint import pprint
from .errors import RPMError
tags = {
"headerimage": 61,
"headersignatures": 62,
"headerimmutable": 63,
"headerregions": 64,
"si... |
#------------------------------------------------------------------------------#
# fortnet-python: Python Tools for the Fortnet Software Package #
# Copyright (C) 2021 - 2022 <NAME> #
# #
# See th... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2014 Adafruit Industries
# Author: <NAME>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, incl... |
"""
Matplotlib Exporter
===================
This submodule contains tools for crawling a matplotlib figure and exporting
relevant pieces to a renderer.
Copyright (c) 2014, mpld3
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, # noqa
are permitted provid... |
import openslide
import cv2
import sys
import time
import math
import numpy as np
import os
import random
import shutil
import csv
from sklearn.metrics import roc_auc_score
from xml.etree.ElementTree import parse
from PIL import Image
from multiprocessing import Process
from user_define import config as cf
from user_d... |
# Loader for the SemanticKITTI dataset
# http://www.semantic-kitti.org/
import torch
import numpy as np
from numpy.linalg import inv
import os,sys,inspect
current_dir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
parent_dir = os.path.dirname(current_dir)
sys.path.insert(0, parent_dir)
... |
from recordtype import recordtype
import numpy as np
import json
misfit_windows = recordtype("misfit_windows", [
"channel", "phase", "misfit", "length", "amplitude", "gcarc", "azimuth", "azimuth_weight"])
def extract_information(json_dict):
p_z = []
p_r = []
s_z = []
s_r =... |
import pandas as pd
from .functions import sort_strings
class FeatureNotSupported(Exception):
"""Not supported Feature type."""
pass
class BaseFeature(object):
"""Base Feature class that every other Feature Class should inherit from.
"""
feature_type = None
"""
feature_type: should be o... |
"""Hardware interfaces for key- and button-presses and mouse clicks"""
# Authors: <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
#
# License: BSD (3-clause)
from functools import partial
import numpy as np
from ._utils import wait_secs, clock, string_types
from ... |
"""A collection of functions to parse STEM input and output files"""
from __future__ import division
import os.path
from glob import glob
import re
import numpy as np
import pandas as pd
import datetime
from netCDF4 import Dataset
# --------------------------------------------------
# helper classes, functions
clas... |
import glob
import random
import numpy as np
import pandas as pd
from sklearn import preprocessing
import torch
from torch.utils.data.sampler import Sampler
from torch.utils.data import DataLoader,Dataset
import torch.nn as nn
min_max_scaler = preprocessing.MinMaxScaler()
class GTExTaskMem(object):
# This class i... |
# -*- coding: utf-8 -*-
"""
site.py
~~~~~~~
Flask main app
:copyright: (c) 2015 by <NAME>.
:license: BSD, see LICENSE for more details.
"""
import os
import datetime
from urlparse import urljoin
from collections import Counter, OrderedDict
from flask import Flask
from flask_frozen import Freezer
from werkzeug.... |
"""
module for mathematical modeling
"""
from typing import *
import numpy as np
import pandas as pd
from scipy import stats
from sklearn.base import BaseEstimator
from sklearn.pipeline import Pipeline
from sklearn.preprocessing import MinMaxScaler
from sklearn.model_selection import GridSearchCV
## for show_tree
fr... |
import datetime
import os
import random
import signal
import string
import sys
import time
from functools import partial
from multiprocessing import Process, cpu_count
from multiprocessing.managers import SyncManager, DictProxy
from socket import getfqdn
from types import FunctionType
import collections
if sys.version... |
# -*- coding: utf-8 -*-
#############################################################################
# SRWLIB Example: Simulating experiments with CRL
# v 0.02
#############################################################################
from __future__ import print_function #Python 2.7 compatibility
import os
import... |
###############################################################################
#
# The MIT License (MIT)
#
# Copyright (c) Crossbar.io Technologies GmbH
#
# 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 ... |
#!/usr/bin/env python3
# Copyright © 2019 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 applicab... |
import torch.nn.functional as F
from torch.nn import DataParallel
from torch.nn.parallel import DistributedDataParallel as DDP
import torch.distributed as dist
import torch.multiprocessing as mp
from torch.optim.lr_scheduler import MultiStepLR,StepLR
import torch
import numpy as np
import os
import time
import sys
impo... |
# -*- coding: utf-8 -*-
#
# Copyright 2021 <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.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... |
# Copyright 2020 Toyota Research Institute. All rights reserved.
import uuid
import copy
import functools
import numpy as np
import cv2
from maad.configs.args_file import parse_arguments
from maad.experiments.maad_experiments import MAADExperiment
from maad.model.gaze_transform import GazeTransform
from maad.model.g... |
#Author: AlexFang, <EMAIL>.
import pandas as pd
import numpy as np
import time
from captcha.image import ImageCaptcha
import numpy as np
from PIL import Image
import sys
import tensorflow as tf
import os
os.environ['CUDA_VISIBLE_DEVICES'] = '1'
import random
from Alexnet import Network
import matplotlib.py... |
import sys, random, time, pygame
from pygame.locals import *
from pygame import Rect
pygame.init()
screen = pygame.display.set_mode((900,600))
pygame.display.set_caption("Demo")
def draw_map(screen):
screen.blit(bac,(0,0))
for i in range(20):
for j in range(30):
screen.blit(map_dict[map[i]... |
"""OpenCL target independent of PyOpenCL."""
from __future__ import division, absolute_import
__copyright__ = "Copyright (C) 2015 <NAME>"
__license__ = """
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the... |
# coding: utf-8
# Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
"""
This is an implementation of the MD5 hash function, as specified by
RFC 1321, in pure Python.
This code is a modified version of
https://github.com/doegox/python-cryptoplus/blob/master/src/CryptoPlus/Hash/pymd5.py
by <N... |
# -*- coding: utf-8 -*-
# Pretty ~ Useful ~ Python
from collections import Counter
from math import acos
from math import factorial
from math import pi
from math import sqrt
from operator import add
from operator import floordiv
from operator import methodcaller
from operator import sub
from operator import truediv
fro... |
# Copyright 2021 <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,... |
#This is the file that we will use to parse the Batter, Pitcher, and Salary data
#Dictionary with key: Player and value: Dictionary containing key:Team and value: stats
import math
import numpy as np
import matplotlib.pyplot as plt
from sklearn import datasets, linear_model
from sklearn.linear_model import LinearReg... |
"""
Code to train a CycleGAN to remove strikethrough from a struck-through word.
"""
import itertools
import logging
import time
from pathlib import Path
from typing import Tuple, Dict, Any, List
import numpy as np
import torch
from torch import nn
from torch.utils.data import DataLoader
from torchvision.utils import ... |
#!/usr/bin/env python
# coding: utf-8
# In[41]:
from pyspark import SparkContext
from pyspark.sql import SQLContext
from pyspark.sql import SparkSession
from pyspark.sql.types import *
from pyspark.sql.functions import udf
from pyspark.ml.stat import Correlation
from pyspark.ml.linalg import Vectors
import numpy as ... |
## Author: <NAME>
## License: GPL v3
## Copyright 2017 <NAME> <azez.khan__AT__gmail.com>
from django.shortcuts import render, get_object_or_404, redirect
from django.http import HttpResponse, HttpResponseRedirect
from django.http import JsonResponse
from django.core.paginator import Paginator, EmptyPage, PageNotAnInte... |
import math
import sys
import pandas as pd
from decison_tree import decision_btree
from file_healper import file_operation
"""
this program trains a model using decision tree and generates a new program which
uses that model to make classification of data
@author <NAME>
"""
def generate... |
from django.urls import reverse_lazy, reverse
from django.shortcuts import render, get_object_or_404, redirect
from django.utils import timezone
from django.views.generic import (View,TemplateView, ListView, DetailView, CreateView, UpdateView, DeleteView)
from web.forms import DocumentForm
import numpy as np
import pan... |
from rest_framework.parsers import JSONParser
from scheduler.models import *
from scheduler.serializers import *
from rest_framework.views import APIView
from rest_framework.response import Response
from django.http import HttpResponse, Http404
from rest_framework import status
from django.db.models.query import QueryS... |
import logging
from abc import ABC, abstractmethod
from typing import Tuple, Sequence, Optional, Union, List, Iterator
import numpy as np
import pandas as pd
import sklearn.preprocessing
import torch
from torch.autograd import Variable
from .. import normalisation
from ..data import DataFrameSplitter, DataFrameSplitt... |
from datetime import date, timedelta
from . import data
import pandas as pd
import numpy as np
### Solvency Ratios
def debtToEquity(ticker, timeFrame):
years = list(data.getLongTermDebt(ticker, timeFrame).keys())
debt = list(data.getLongTermDebt(ticker, timeFrame).values())
equity = list(data.ge... |
#
# edges.py
#
# <NAME> Javamata LLC
#
import functools
import inspect
from functools import partial
from django.core import checks, exceptions
from django.db.models.utils import make_model_tuple
from django.db.models.fields.related import RelatedField, ForeignObjectRel
from django.db.models.fields.re... |
import pymssql
import boto3
import uuid
from sqlalchemy.orm import declarative_base
from sqlalchemy.schema import Sequence
from sqlalchemy import Column, String, DateTime, Integer, Float, Date, MetaData
from sqlalchemy import create_engine
from sqlalchemy.orm import Session
from sqlalchemy.sql import select
from sqlal... |
#!/usr/bin/env python
# Copyright 2017 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import contextlib
import copy
import difflib
import glob
import itertools
import logging
import os
import unittest
import re
import shu... |
# This module is to parse the gtf file, whoes format can be found at:
# www.ensembl.org/info/website/upload/gff.html
# Note: here we need the order of feature lines like this: gene --> transcript
# --> exon 1 --> exon 2 ..., which is not required for the gtf format. But this
# assumption is usually right for the gtf f... |
from __future__ import division
import os
import time
import math
from glob import glob
import tensorflow as tf
import numpy as np
from six.moves import xrange
from ops import *
from utils import *
import csgan.Data_Provider as csdp
def conv_out_size_same(size, stride):
return int (math.ceil (float (size) / float ... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import time
import tqdm
import random
import matplotlib.pyplot as plt
import numpy as np
import tensorflow as tf
from tf_agents.drivers import dynamic_step_driver
from tf_agents.eval import metric_utils
from ... |
#!/usr/bin/env python3
# -*- encoding: utf-8 -*-
"""
Molecular symmetry point group and irreducible representation objects.
Examples
--------
>>> d2h = D2h()
>>> print(repr(d2h))
D2h()
>>> print(d2h.b2g * d2h.b1u)
b3u
>>> print(d2h.b2g**2)
ag
>>> print(repr(d2h.b1g))
IrreducibleR... |
import shutil
import os
import tempfile
import cv2
import seaborn as sns
from detectron2.data import MetadataCatalog
from detectron2.structures import BoxMode
from detectron2.utils.visualizer import Visualizer
from PIL import Image
import numpy as np
from glob import glob
from copy import deepcopy
from gibson2.render.... |
import discord
from discord.ext import commands
import motor.motor_asyncio
import pymongo
import names
from fuzzywuzzy import process as fwproc
import os
import typing
import enum
import random
import datetime
import hashlib
import traceback
import asyncio
TOKEN = os.getenv('DISCORD_TOKEN')
intents = discord.Intents... |
import argparse
from itertools import islice
import torch
import torch.nn as nn
import torch.optim as optim
from torch.utils.data import DataLoader
from torch.nn import functional as F
import random
import math
import os
import time
from BatchIter import BatchIter
import numpy as np
from Corpus import Corpus
base_pat... |
#!/usr/bin/env python
import os
from datetime import datetime
import time
import tensorflow as tf
import numpy as np
import sys
import select
from IPython import embed
from StringIO import StringIO
import matplotlib.pyplot as plt
import cifar100
import resnet_split as resnet
# Dataset Configuration
tf.app.flags.DE... |
# Author: <NAME>
# Data: 2020-01-05
# Function: Transform the label network to make it suitable for algorithm training
#-------------------------- import package --------------------------#
import multiprocessing
import random
import os
import time
import pickle as pkl
import networkx as nx
import numpy ... |
#copyright (c) 2021-present, <NAME>@Deep Vision Group
import numpy as np
import torch
from torch import nn
from torch.nn import functional as F
from layers.modules.classify_loss import CrossEntropyLoss
from layers.modules.python_func import create_pairwise_conv_kernel
def adjust_smooth_l1_loss(y_pred, theta=0.1):
... |
import argparse
import os
import shutil
import time
import torch
import torch.nn as nn
import torch.nn.parallel
import torch.backends.cudnn as cudnn
import torch.optim
import torch.utils.data
import torchvision.transforms as transforms
import torchvision.datasets as datasets
import csv
import sys
import importlib
im... |
import time
import numpy as np
from typing import Literal, Optional
from DF8Converter import convert
def ROM(filename: Optional[str]='ROM'):
ROM = []
with open(filename) as file:
contents = file.read().replace(' ', '').replace('\n', '')
for i in range(256):
ROM.append(contents[i*16:i*16+16... |
"""
The field classes to represent a WASM program.
"""
from io import BytesIO
from struct import pack as spack
from . import OPCODES
LANG_TYPES = {
'i32': b'\x7f',
'i64': b'\x7e',
'f32': b'\x7d',
'f64': b'\x7c',
'anyfunc': b'\x70',
'func': b'\x60',
'emptyblock': b'\x40', # pseudo type f... |
import sys, os
import time
import json
import pickle
import argparse
from tqdm import tqdm
import numpy as np
import torch
import torch.nn as nn
from torch.optim import Adam
import torch.utils.data as utils
# from models.SELDNet import Seldnet_vanilla, Seldnet_augmented
from SEDNet import Sednet_vanilla, Sednet_augment... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu May 31 17:15:07 2018
@author: antony
"""
import matplotlib
import os
#matplotlib.use('agg')
import matplotlib.pyplot as plt
import seaborn as sns
import numpy as np
import matplotlib_venn as mpv
import math
import scipy.stats
ALPHA = 0.8
MARKER_SIZE = ... |
# a1.py
from search import *
import time
import random
import numpy as np
import csv
puzzle_results = []
single_result = []
"""returns a new instance of an EightPuzzle problem with a random initial state that is solvable.
Note that EightPuzzle has a method called check_solvability that you should use to help ens... |
# coding=utf-8
from django import forms
from django.contrib.auth.models import User
from django.contrib.contenttypes.models import ContentType
from django.db.models.signals import post_save
from django.dispatch import receiver
from django.utils import timezone
from modules.dict_table.models import *
from modules.dict... |
#!/usr/bin/env python3
# coding: utf-8
# SPDX-License-Identifier: Apache-2.0
# Copyright 2020 AntiCompositeNumber
# 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/l... |
# -*- Python -*-
# license
# license.
# ======================================================================
import logging; module_logger = logging.getLogger(__name__)
from pathlib import Path
import sys, re, time as time_m, operator, subprocess
from acmacs_base import email, htcondor
from . import maker_base
# --... |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# Copyright © 2020 qizai <<EMAIL>>
#
# Distributed under terms of the MIT license.
"""
This script will take the bedgraph file as input, and process it to create the output
binning intensity.
"""
import os
from pyBedGraph import BedGraph
import numpy ... |
import hashlib
import json
import os
import sys
import tempfile
import zipfile
import dcoscli
import docopt
import pkg_resources
from dcos import (cmds, emitting, errors, http, marathon, options, package,
subcommand, util)
from dcos.errors import DCOSException
from dcoscli import tables
from dcoscli.... |
import re
import os
import pickle
import concurrent.futures
import logging
from collections import OrderedDict
from contextlib import contextmanager
from datetime import datetime
import numpy as np
import pandas as pd
from AnyQt.QtWidgets import (
QApplication, QDateTimeEdit, QLabel, QCheckBox,
qApp,
)
from A... |
# Copyright (c) 2021 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 applic... |
from functools import partial
import sympy as sym
import torch
import torch.nn as nn
from torch.nn.init import xavier_uniform_, constant_
import numpy as np
from nff.utils import bessel_basis, real_sph_harm
zeros_initializer = partial(constant_, val=0.0)
DEFAULT_DROPOUT_RATE = 0.0
EPS = 1e-15
def gaussian_smearing(... |
import wx
import sys, os
import win
import formatter
import serial
import serial.tools.list_ports
import threading
import logging
import matplotlib
import matplotlib.pyplot as plt
import socket
import time
s_serialPort = serial.Serial()
s_recvInterval = 0.05
s_plotInterval = 0.05
s_recvStatusFieldIndex = 0
s_sendStat... |
'''#!/usr/bin/env python'''
import wx
import sys,os
from datetime import date
import wx.grid as gridlib
import fileinput
def getLinesFromFile(filename):
count = 0
for lines in fileinput.input(filename):
count += 1
print(count)
return count
class csvDisplayPanel(wx.Pan... |
# Copyright 2018 TomorrowData Srl
#
# 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... |
#
# 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... |
import ast
import datetime
import hashlib
import json
import os
import secrets
from urllib.parse import urlencode
from django.apps import apps
from django.conf import settings
from django.contrib.auth import get_user_model
from django.core import exceptions
from django.core.handlers.wsgi import WSGIRequest
from django... |
import importlib
import os.path
import shutil
import subprocess
import sys
import tempfile
import time
import webbrowser
from contextlib import suppress
from pathlib import Path
from jinja2 import Template
from sphinx_performance.utils import console
NEED_CONFIG_DEFAULT = ['pages', 'folders', 'depth']
GLOBAL_PAGE_C... |
'''Simple test script
'''
import sys
import argparse
import numpy as np
import numpy.random
import pandas as pd
import logging
import pickle
from infection.propagator import BeakerPropagator
from infection.goo import Goo
from infection.bacteria import Bacteria, ExtracellEnvironment
from core.naturallaw import ObjectM... |
#!/usr/bin/env python
# coding: utf-8
import pandas as pd
import MySQLdb
import MeCab
import re
import requests
from bs4 import BeautifulSoup
import tweepy
import json
from tqdm.auto import tqdm
import time
from sentence_transformers import SentenceTransformer
import xgboost as xgb
import pickle
from datetime import ... |
import time
import random
import pokerhands
from operator import attrgetter
import time
import pokerstrat
import server
from threading import Thread
from websocket_server import WebsocketServer
#card class
class Card:
RANKS=['2','3','4','5','6','7','8','9','10','J', 'Q', 'K', 'A']
SUITS=['h', 'c', 's', 'd... |
"""Routines for creating compact signatures of NWB files, for testing.
The idea of a signature is that it's small enough to store in version control,
yet detailed enough to tell if you've changed an NWB file's content from the
reference version.
"""
import argparse
import collections
import difflib
import numbers
imp... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
An implementation of a red–black tree as it is described in
Cormen, Leiserson, Rivest, Stein 2nd edition pg 273.
A the height of a red-black tree is never bigger than
2*log_2(n+1). This is achived with these properties:
RB1) Every node is either r... |
import streamlit as st
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
import shap
import plotly.graph_objects as go
import plotly_express as px
from sklearn.model_selection import train_test_split
from sklearn import metrics
from sklearn.metrics import precision_recall_curve, roc_cur... |
import argparse
import itertools
import json
import multiprocessing
import numpy as np
import pathlib
import sys
import typing
import tifffile
import tqdm
from scipy import ndimage
from ..stitch import StitchSrcVolume
from .dandi_metadata import get_chunk_transform_offsets
def parse_args(args=sys.argv[1:]):
par... |
import os
import json
import torch
from torch.utils.data import Dataset
import numpy as np
import re
import xml.etree.ElementTree
from speaksee.data import field, Example, PairedDataset, COCO
from speaksee.utils import nostdout
from itertools import groupby
import pickle as pkl
from inspect import isgenerator
import h5... |
# basic building blocks
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.nn.utils.spectral_norm as spectral_norm
import torchvision
import util.util as util
from semia.base_network import BaseNetwork
def find_network_using_name(target_network_name, filename):
target_class_name = t... |
"""
.. Necessary to reject for documentation building
* Copyright 2019 TIBCO Software Inc. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"); You may not use this file except
* in compliance with the License.
* A copy of the License is included in the distribution package with... |
# coding: utf-8
import numpy as np
import pandas as pd
import time
from scipy.linalg import block_diag
from sklearn.metrics import mean_squared_error
from .bspline import Bspline
from .utils import mm, check_constraint, check_constraint_dim1
from .utils import check_constraint_dim2, check_constraint_full_model
class... |
import argparse
import ast
import webbrowser
from argparse import ArgumentParser, RawTextHelpFormatter
import math
import re
from collections import namedtuple
from datetime import datetime, timedelta
from urllib.request import urlopen
from xml.etree import ElementTree
import unicodedata
TABLE_TEMPLATE = '''
<table>
... |
# Copyright 2021 STC-Innovation LTD (Author: <NAME>)
import numpy as np
import torch
from queue import PriorityQueue
import time
import logging
import random
from collections import defaultdict
logger = logging.getLogger(__name__)
# my lats type = [(word_id, state_from, state_to), ...]
WORD_ID = 0
STATE_FROM = 1
STAT... |
# dipolarkernel.py - Dipolar kernel operator
# -----------------------------------------------
# This file is a part of DeerLab. License is MIT (see LICENSE.md).
# Copyright(c) 2019-2021: <NAME>, <NAME> and other contributors.
# Numpy + SciPy
import numpy as np
from numpy import pi,inf
import scipy.integrate
from scip... |
# Copyright (c) 2018-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
#
# Adapted from fairseq-py
from logging import getLogger
import math
import torch
import torch.nn as nn
import torch.nn.functi... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2006 Edgewall Software
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://trac.edgewall.com/license.html.
#
# This software consi... |
from .config import g_config, EXTRA_META, IMG_ATTRS_LI, IMG_DATE_FMT, MAKE_MODEL_FMT
from .log import log
from .util import rgb_to_hex, extract_date
from .vhash import vis_hash, VHASHES
from PIL import Image
from PIL.ExifTags import TAGS
from PIL.ImageOps import exif_transpose
from base64 import b64encode
from bs4 imp... |
import os
import math
import nest
import numpy as np
from random import normalvariate
from collections import defaultdict
import re
syn_outdegree = 27
nrns_in_group = 40
class Parameters:
__slots__ = ['tests', 'steps', 'cms', 'EES', 'inh', 'ped', 'ht5', 'save_all', 'step_cycle',
'resolution', 'T_sim',... |
# -*- coding: utf-8 -*-
#%%
import PyPDF2
import copy
import os
from PIL import Image
from io import BytesIO
import struct
import numpy as np
#%%
###
# PDF file image extractor
# Author: <NAME> (jangbi882 at gmail.com)
# License: GPL2
# Referenced source: https://stackoverflow.com/questions/2693820/extract-images-fr... |
# -*- coding: utf-8 -*-
from datetime import *
from django.db import models
from django.contrib import admin, messages
from django.utils.translation import ugettext as _
from koalixcrm.crm.const.purpose import *
from koalixcrm.global_support_functions import xstr
from koalixcrm.crm.contact.phone_address import PhoneAd... |
""" The basic Service class upon which all the specific services are built. """
import json
import logging
from typing import Callable
from typing import Optional
from typing import Union
from urllib.parse import urlparse
from cryptojwt.jwt import JWT
from cryptojwt.utils import qualified_name
from idpyoidc.client.ex... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.