text stringlengths 3.07k 22.1k |
|---|
import math
from future.utils import with_metaclass
class EventRegistry(object):
Events = {}
MetaEvents = {}
def register_event(cls, event, bases):
if (Event in bases) or (NoteEvent in bases):
assert event.statusmsg not in cls.Events, \
"Event %s already reg... |
# -*- coding: utf-8 -*-
import sys
import numpy as np
import os
from keras.models import model_from_json
from keras.engine.topology import Layer
import theano.tensor as T
from keras import backend as K
from keras.constraints import maxnorm
from keras.models import Model
from keras.layers import Activation, Dense, Dro... |
# Copyright 2018 DeepMind Technologies Limited. 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 ... |
import os
import re
import glob
import time
import logging
import itertools
import requests
import shutil
from pathlib import Path
from datetime import datetime
from tqdm import tqdm
from bs4 import BeautifulSoup
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.common.... |
"""Tests for Bladerunner's progressbar module."""
import os
import pytest
from mock import call
from mock import Mock
from mock import patch
from bladerunner import progressbar
from bladerunner.progressbar import ProgressBar
try:
import termios
except ImportError:
pass
def test_setup(capfd):
"""Ensure... |
# SPDX-FileCopyrightText: 2021 <NAME>
#
# SPDX-License-Identifier: Apache-2.0
import abc
import collections
import functools
import inspect
import itertools
import types
import typing
from typing import Callable, Iterable, Iterator, Mapping, Union
__version__ = '1.5'
"""
Copyright 2021 <NAME>
https://github.com/coad... |
import logging
from typing import Dict
import re
from telegram import ReplyKeyboardMarkup, Update, ReplyKeyboardRemove
from telegram.ext import (
Updater,
CommandHandler,
MessageHandler,
Filters,
ConversationHandler,
CallbackContext,
)
# Enable logging
logging.basicConfig(
format='%(asctime... |
import adsk.core
import os, json
from json import encoder
from .BaseLogger import logger
from .Statics import *
# set format of float values
encoder.FLOAT_REPR = lambda o: format(o, '.6f')
defaultConfiguration = {} # contains the default configuration
projectConfiguration = {} # changed parameter... |
# Copyright 2020 Google 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.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... |
#!/usr/bin/env python3
import csv
from dataclasses import dataclass
from functools import total_ordering
import pathlib
import json
import random
from . import logging
LOG = logging.get_logger(__name__)
LOG.setLevel("DEBUG")
CONFIG_PATH = pathlib.Path("config")
@dataclass
class Planet:
name: str
resources... |
#!/usr/bin/python
# Copyright 2018 Google 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.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ... |
'''Matrix module
This module contains all class relative to Matrices.
In graphic computing, matrices is a key to manipulate object in
space. I recommand you to read this article to understand what is
the main goal of matrices:
http://www.codinglabs.net/article_world_view_projection_matrix.aspx
'''
import numpy as np
... |
# 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 appli... |
import json
from collections import Counter
import sys
from tqdm import tqdm
from search.search import bulk_text_query
from utils.lcs import LCSubStr
from utils.io import load_json_file
from utils.general import chunks, make_context
from utils.corenlp import bulk_tokenize
from scripts.gen_hop1 import CompositeLCS, ... |
import os.path
import charliecloud as ch
## Globals ##
DEFAULT_CONFIGS = {
# General notes:
#
# 1. Semantics of these configurations. (Character limits are to support
# tidy code and message formatting.)
#
# a. This is a dictionary of configurations, which themselves are
# dictiona... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright 2020 Tier IV, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless re... |
#!/bin/env python
# -*- coding: utf-8 -*-
import sys
import os
import os.path
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
sys.path.append(os.path.dirname(os.path.abspath(__file__)) + '/vendor/')
import re
import uuid
import time
import random
import string
import hashlib
import urllib
import copy
from... |
# -*- coding: utf-8 -*-
"""The task manager."""
from __future__ import unicode_literals
import collections
import heapq
import logging
import threading
import time
from dfvfs.lib import definitions as dfvfs_definitions
from plaso.containers import tasks
from plaso.engine import processing_status
class _PendingMer... |
import sys
import datetime
import json
from pathlib import Path
import os
import subprocess
import dpkt
from dpkt.utils import mac_to_str, inet_to_str
event_duration = 1000000
WRITES_CSV = False
csv_file = None
json_file = None
cwd = Path(__file__).parent
def open_chrome_tracing():
import we... |
import shutil
from collections import namedtuple
import itertools
import time
import argparse
import numpy as np
from PIL import ImageFont, Image, ImageDraw, ImageEnhance
from colorama import Fore, init, Back, Style
from numba import njit
init()
Color = namedtuple('Color', ['name', 'fore', 'back'])
colours = [
... |
# coding=utf-8
# Copyright 2022 The TensorFlow GAN 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 applicabl... |
#!python3
"""
Modules for working with csv inputs and manipulating them
"""
import os
import shutil
import yaml
import csv
import pandas as pd
def process_config(settings_file, campus):
"""Returns a dict of simple keyword configurations based on what
was in the yaml file and the specific camp... |
# coding=utf-8
# Copyright 2020 The HuggingFace Datasets Authors and the current dataset script contributor.
#
# 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/lice... |
'''
Copyright 2017, Fujitsu Network Communications, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in w... |
# -*- coding: utf-8 -*-
from datetime import timedelta
from functools import partial
from random import randint
from pyramid.security import Allow
from schematics.exceptions import ValidationError
from schematics.transforms import whitelist
from schematics.types import (
StringType,
IntType,
MD5Type,
B... |
import uuid
from collections.abc import MutableSequence
from django import forms
from django.core.exceptions import ValidationError
from django.forms.utils import ErrorList
from django.utils.functional import cached_property
from django.utils.html import format_html, format_html_join
from django.utils.translation impo... |
import typing
from collections import ChainMap
from lxml import etree
from gmso.utils.ff_utils import (validate,
parse_ff_metadata,
parse_ff_atomtypes,
parse_ff_connection_types)
def _group_by_expression(potential_typ... |
import argparse, logging, multiprocessing, re
from bfio import BioReader,BioWriter
import numpy as np
from concurrent.futures import ThreadPoolExecutor
from pathlib import Path
STITCH_VARS = ['file','correlation','posX','posY','gridX','gridY'] # image stitching values
STITCH_LINE = "file: {}; corr: {}; position: ({}, ... |
import numpy as np
import plotly as py
import plotly.graph_objs as go
import random
import dash_core_components as dcc
import dash_html_components as html
import dash_bootstrap_components as dbc
import datetime as dt
from typing import Dict
def plotly_wordcloud(words: Dict[str, int]):
lower, upper = 15, 45
f... |
'''Module to plot '''
import networkx as nx
import numpy as np
import matplotlib.pyplot as plt
import scipy.sparse as scp
from mpl_toolkits.mplot3d import Axes3D
import matplotlib as mpl
import numpy as np
import os, sqlite3, pickle, sys, gzip, shutil, time
import os.path as osp
from pandas import read_sql, concat
fro... |
from sklearn.base import BaseEstimator
from sklearn.exceptions import NotFittedError
import warnings
from sklearn.feature_selection import SelectorMixin
from sklearn.utils import check_random_state
from sklearn.utils.validation import check_is_fitted
from fri.compute import RelevanceBoundsIntervals
from fri.model.b... |
import numpy as np
from dynamol import data
import scipy.constants as sc
from functools import reduce
class Particle:
def __init__(self, r=[], v=[], a=[], m=None, dim=3):
"""Clase base de uma partícula
Args:
r (3D/2D array): posição
v (3D/2D array): velocidade
... |
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
# -*- coding: utf-8 -*-
""" mysqldb connect package Pedoo """
import random
import time
try:
import MySQLdb
except ImportError:
import pymysql as MySQLdb
MYSQL_CONFIG = {
"host": "127.0.0.1",
"user": "root",
"passwd": "",
"db": "schema",
"charset": "utf-8"
}
class MySQLConnect(object):
... |
# Copyright 2016 The TensorFlow 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 applica... |
# Copyright (c) 2019 Riverbed Technology, Inc.
#
# This software is licensed under the terms and conditions of the MIT License
# accompanying the software ("License"). This software is distributed "AS IS"
# as set forth in the License.
"""
The Host Group module provides an interface for manipulating host group types
... |
from deephaven import learn
from deephaven.TableTools import readCsv
import jpy
import torch
import torchsummary
import torch.nn as nn
from torch.optim import SGD
from numpy import argmax
from numpy import vstack
from sklearn.metrics import accuracy_score
# set seed for reproducibility
torch.manual_seed(173061683891... |
from __future__ import division
import os
import mmap
from androguard.gui.BinViewMode import BinViewMode
from androguard.gui.HexViewMode import HexViewMode
from androguard.gui.DisasmViewMode import DisasmViewMode
from androguard.gui.SourceViewMode import SourceViewMode
import logging
log = logging.getLogger("androgu... |
"""Main module
# TODO's:
- For mappings, I believe Amin will be providing us to .parquet files. We can read with pandas:
--https://pandas.pydata.org/docs/reference/api/pandas.read_parquet.html
Resources
- Validate URL (for testing POSTs without it actually taking effect): https://unite.nih.gov/actions/api/actions/vali... |
#! /usr/bin/python3
#
# Copyright (c) 2017 Intel Corporation
#
# SPDX-License-Identifier: Apache-2.0
#
"""
Copy files from and to the server's user storage area
-----------------------------------------------------
"""
import bisect
import contextlib
import json
import hashlib
import io
import pprint
import tabulate... |
"""
PyTorch interface for computing KID.
"""
import os
import random
import time
import numpy as np
import tensorflow as tf
import torch
from torch_mimicry.datasets.image_loader import get_dataset_images
from torch_mimicry.metrics.inception_model import inception_utils
from torch_mimicry.metrics.kid import kid_utils
... |
# -*- coding: utf-8 -*-
# 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, softw... |
"""
Entry point for running the visualisation
"""
from textwrap import dedent
import time
import logging
import os
from getopt import gnu_getopt, GetoptError
import sys
import numpy as np
from scipy.ndimage.filters import gaussian_filter1d
import config
import microphone
import dsp
import led
LOGGER = logging.get... |
import torch
from torch import nn
__all__ = ['iresnet18', 'iresnet34', 'iresnet50', 'iresnet100', 'iresnet200']
def conv3x3(in_planes, out_planes, stride=1, groups=1, dilation=1):
"""3x3 convolution with padding"""
return nn.Conv2d(in_planes,
out_planes,
kernel_size=... |
from datetime import date
from decimal import Decimal
from django.utils.timezone import now
from django.dispatch import receiver
from django.urls import resolve, reverse
from django.utils.translation import gettext_lazy as _, gettext_noop
from django_scopes import scopes_disabled
from i18nfield.strings import LazyI18nS... |
from urllib.parse import urljoin, quote
from .utils import to_url_param
def _maybe(val, func=to_url_param):
if val is not None:
return func(val)
return None
API_BASE_URL = "https://statsapi.web.nhl.com"
class NHLAPI:
"""
Initialize this class with the client you wish to use. It works trans... |
import dataclasses as _dc
import typing
from contextlib import contextmanager
from typing import (
Any,
Callable,
ClassVar,
Dict,
NamedTuple,
Optional,
Type,
TypeVar,
cast,
)
import toolz as tz
import typing_extensions as _te
from .event import EmitterGroup
ON_SET = "_on_{name}_se... |
from __future__ import print_function
# Import the necessary Python modules
import sys
import math
import numpy as np
import time
# rospy - ROS Python API
import rospy
# baxter_interface - Baxter Python API
import baxter_interface
#Message carrying location of target
from geometry_msgs.msg import Point
from std_msg... |
# backlogtodo test a probabilistic means of comparing players that does not use rating_algorithms algo
# lower tau prevents volatitliy from changing a lot. It's a baseline volatiity added to prevent convergence to zero by
# the standard deviation
# for elo the toggleable parameter can be the length of the rating period... |
import os, sys
import gym
import eplus_env
import warnings
warnings.filterwarnings("ignore", category=UserWarning)
import argparse
import numpy as np
import pandas as pd
import copy
import pickle
import pdb
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.utils.data as data
import tor... |
# importing Excell files
import csv
# Product class containing its name and price
class Product:
def __init__(self, name, price=0):
self.name = name
self.price = price
# repr function is used to return product name and price
def __repr__(self):
return f'PRODUCT NAME: {self.name} P... |
import glob
import json
from pathlib import Path
import pandas as pd
import numpy as np
import os
import numpy as np
import pandas as pd
from itertools import groupby
CAP = 1500
SEED = 1234
np.random.seed(SEED)
class dataset:
def write_unique_ids(self, out_file):
"""
Write the unique IDs to a fil... |
# ------------------------------------------------------------------------
# Copyright (c) Hitachi, Ltd. All Rights Reserved.
# Licensed under the Apache License, Version 2.0 [see LICENSE for details]
# ------------------------------------------------------------------------
from scipy.optimize import linear_sum_assign... |
# General information about the project.
project = u'Approximate Engineering - Input'
copyright = u'2017, 2018, 2019, 2020 <NAME>'
author = u'<NAME>'
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built docume... |
import sys
import os
exp_path = os.path.dirname(os.path.abspath(__file__))
print(exp_path)
project_path = os.path.abspath(os.path.join(exp_path, ".."))
sys.path.insert(0, project_path)
print(sys.path)
import src.mdp as mdp
import numpy as np
import src.machine_teaching as machine_teaching
import src.utils as utils
fro... |
# -*- coding: utf-8 -*-
"""Tracker REITs (Real Estate Investment Trust) investments."""
import datetime
import os
from concurrent.futures import ProcessPoolExecutor
import numpy as np
import pandas as pd
import requests
import requests_cache
from .portutils import NUM_PROCESS, Singleton, UnitsTransactions
# Cac... |
# Copyright 2017 Amazon.com, Inc. or its affiliates. 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 located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompa... |
import os
import subprocess
import tarfile
from pathlib import Path
from warnings import warn
import pandas as pd
import parse
file_pattern = "e{usr_nr:3d}{exp_nr:3d}{type:1}{date}"
efile_pattern = "e{usr_nr:3d}{exp_nr:3d}{type:1}_c{code:3d}_{date}"
date_patterns = ["%Y", "%Y%m", "%Y%m%d", "%Y%m%d", "%Y%m%d%H", "%Y%... |
# -*- coding: utf-8 -*-
#
# Copyright © 2015 <NAME> <<EMAIL>>
# Distributed under terms of the MIT license.
"""
Intersect SV called by PE/SR-based algorithms.
Paired-end and split-read callers provide a reasonably precise estimation of
an SV breakpoint. This program identifies variant calls that fall within
the expec... |
import json
import os
import re
from datetime import datetime, timedelta
from pathlib import Path
VACC_PRODUCT_NAMES = {
"pf": "COVID-19 mRNA Vac BNT162b2 30mcg/0.3ml conc for susp for inj multidose vials (Pfizer-BioNTech)",
"az": "COVID-19 Vac AstraZeneca (ChAdOx1 S recomb) 5x10000000000 viral particles/0.5m... |
import math
from controller.datamanager import DataManager
from enum import Enum
from model.task_status import TaskStatus
from config.config import clear, storage_path
from model.task import Task
import datetime
from termcolor import colored
TASKS_ON_PAGE = 10
class TaskMenuType(Enum):
ALL = 0
UNCOMPLETED = ... |
from time import time, ctime
from random import seed, randint
start_time = time()
def timestamp(msg=""):
current = time()
diff = current - start_time
print(" : ".join([str(diff), str(ctime(current)), msg]))
timestamp("Importing modules")
from sys import argv, exit
from networkx import number_of_nodes, dra... |
import click
import boto3
from termcolor import colored
from s3_restore import *
from s3_purge import *
from s3_permission import *
from s3_permission_v2 import *
from s3_tail import *
from s3_encryption import *
from __init__ import *
@click.group()
@click.version_option()
def cli():
"""This is your s3 friend(bro... |
import os
from PIL import Image
from lib.detect import detect
import numpy as np
from tqdm import tqdm
import cv2
from lib.detect import resize_img,load_pil,adjust_ratio,restore_polys,plot_boxes
import torch
import lanms
import shapely
from shapely.geometry import Polygon
from lib.swt import SWT
def get_negative_samp... |
import os
import torch
import taylor_expansion
from tqdm import tqdm
class RNNModel(torch.nn.Module):
def __init__(self, input_channels: int, hidden_channels: int, output_channels: int, non_linearity: str = 'tanh',
device=torch.device("cpu")):
"""Feedforward RNN, that can be penalized ... |
"""Utility functions for PyTorch algorithms.
A collection of common functions that are used by Pytorch algos.
This collection of functions can be used to manage the following:
- Pytorch GPU usage
- setting the default Pytorch GPU
- converting Tensors to GPU Tensors
- Converting Tensors int... |
"""BeliefPropagator class."""
import numpy as np
from .Inference import Inference
class BeliefPropagator(Inference):
"""
Object that can run belief propagation on a MarkovNet. Uses native python loops to compute message passing, so
it can be slow. This class is mostly useful for reference, since the loop... |
import numpy as np
import pickle as pkl
import networkx as nx
import torch
import scipy.sparse as sp
from scipy.sparse.linalg.eigen.arpack import eigsh
import sys
import os
sys.path.append('%s/../common/functions' % os.path.dirname(os.path.realpath(__file__)))
sys.path.append('%s/../common' % os.path.dirname(os.path.r... |
from __future__ import annotations
from abc import abstractmethod
from enum import Enum
from typing import Union
EARTH_MASS = 5.972e24
SOLAR_MASS = 1.98847e30
TerraformState = Enum("TerraformState", "Terraformable Terraforming Terraformed NotTerraformable")
StarClass = Enum("StarClass", "O B A F G K M L T Y TTS AeBe... |
"""
pyggel.scene
This library (PYGGEL) is licensed under the LGPL by <NAME> and PYGGEL contributors.
The scene module contains classes used to represent an entire group of renderable objects.
"""
from pyggel.include import *
from pyggel import camera, view, misc
from pyggel.light import all_lights
from pyggel.data im... |
# Copyright 2019 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
#!/usr/bin/python
'''The classes in this module implement a Go board. Given a grid, the board lets you add and remove stones and group connected stones. There is no rule checking done by the board itself - this is taken care of in the rules module.
This module defines some constants which are used to distinguish the n... |
"""
DerivedQuantities.py
Author: <NAME>
Affiliation: University of Colorado at Boulder
Created on: Thu Feb 12 14:13:19 MST 2015
Description:
"""
import re, time
import numpy as np
from ..physics import Cosmology
from collections import namedtuple
from ..physics.Constants import nu_0_mhz
def total_heat(data):
... |
#!/usr/bin/env python
#MIT License
#Copyright (c) 2017 <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, including without limitation the rights
#to use, copy, modif... |
import torch
from torch import nn
import torch.nn.functional as F
def init_layer(layer):
nn.init.xavier_uniform_(layer.weight)
if hasattr(layer, "bias"):
if layer.bias is not None:
layer.bias.data.fill_(0.)
def init_bn(bn):
bn.bias.data.fill_(0.)
bn.weight.data.fill_(1.0)
def int... |
import collections
import itertools
#WinStructType = collections.namedtuple('WinStructType', ['name'])
#Ptr = collections.namedtuple('Ptr', [''])
class BitFieldValue(object):
def __init__(self, nb_bits):
assert isinstance(nb_bits, int)
self.nb_bits = nb_bits
def __int__(self):
retur... |
#Copyright ReportLab Europe Ltd. 2000-2017
#see license.txt for license details
#history https://hg.reportlab.com/hg-public/reportlab/log/tip/src/reportlab/lib/validators.py
__version__='3.5.33'
__doc__="""Standard verifying functions used by attrmap."""
import sys, codecs
from reportlab.lib.utils import isSeq, isByte... |
"""
Create a NeXus file for serial crystallography datasets collected on I24 Eiger 2X 9M detector.
"""
import sys
# import json
import glob
import h5py
import logging
import numpy as np
from typing import List
from pathlib import Path
from collections import namedtuple
from .I24_Eiger_params import (
goniomete... |
#!/usr/bin/python
# Copyright (c) 2020, 2021 Oracle and/or its affiliates.
# This software is made available to you under the terms of the GPL 3.0 license or the Apache 2.0 license.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Apache License v2.0
# See LICENSE.TXT for d... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import time
from six.moves import xrange
from pprint import pprint
import h5py
import tensorflow as tf
import tensorflow.contrib.slim as slim
from input_ops import create_input_ops
from util import ... |
#! /usr/bin/env python
"""This module implements methods for generating consensus trees from a list of trees"""
import warnings
from collections import defaultdict
from itertools import product
from cogent3 import make_tree
from cogent3.core.tree import TreeBuilder
from cogent3.util.misc import extend_docstring_from
... |
#
# Copyright (c) 2018 nexB Inc. and others. All rights reserved.
# http://nexb.com and https://github.com/nexB/scancode-toolkit/
# The ScanCode software is licensed under the Apache License version 2.0.
# Data generated with ScanCode require an acknowledgment.
# ScanCode is a trademark of nexB Inc.
#
# You may not use... |
#!/usr/bin/env python
"""
Evaluation of conformal predictors.
"""
# Authors: <NAME>
# TODO: cross_val_score/run_experiment should possibly allow multiple to be evaluated on identical folding
from __future__ import division
from cqr.nonconformist_base import RegressorMixin, ClassifierMixin
import sys
import numpy ... |
import logging
import numpy as np
from .geometry import get_loc_from_timelist
def plot_results(
beampowers: np.ndarray,
settings: dict,
start_time: "obspy.UTCDateTime",
grid_lon_coords: np.ndarray,
grid_lat_coords: np.ndarray,
station_locations: np.ndarray,
plot_identifier: str = "empty"... |
#!/usr/bin/env python3
import os, sys, time
from collections import defaultdict
import glob
import numpy as np
from scipy import stats
import locale
##locale.setlocale(locale.LC_ALL, 'en_US') ## failed in google cloud
import tensorflow as tf
batch_size = 4096
cov_thrd = 5
def readBed(bedfile, t_chr=None, t_star... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
'''Evaluate model performance by comparing quant and pred results.
NOTE: The input file is typlically the output from scripts/plot/manhattan_plot.py.
TODO:
Plan to modify the script to use predicted results instead. If so, have to
refer script scripts/plot/manhat... |
# coding=utf-8
import inspect
from unittest import TestCase
from nose.tools import assert_equal
from nose.plugins.skip import SkipTest
from .parameterized import (
PY3, PY2, parameterized, param, parameterized_argument_value_pairs,
short_repr,
)
def assert_contains(haystack, needle):
if needle not in hay... |
__all__ = ["Capabilities", \
"Switches"]
from browser.status import *
from base.bind import Bind
from base.log import VLOG
class Switches(object):
def __init__(self):
self.switch_map = {}
def SetSwitch(self, name, value=""):
self.switch_map[name] = value
# In case of same key, |switches| w... |
import json
import numpy as np
import sys
import os
from shapely.geometry import Polygon, Point
from qgis.PyQt.QtCore import QVariant
from time import time
sys.path.append(r'A:\Architektura prace\IAAC 3.S Studio\github_repositories\urban_datasets')
from utils import *
city = 'melbourne'
BASE_PATH = 'A:\Architektura ... |
import os
import shutil
import tempfile
import unittest
from nose.plugins.attrib import attr
import yt
from yt.data_objects.profiles import create_profile
from yt.testing import (
ANSWER_TEST_TAG,
assert_allclose_units,
assert_array_almost_equal,
fake_random_ds,
)
from yt.utilities.answer_testing.fram... |
# -*- coding: utf-8 -*-
# Copyright (C) 2016, the Pyzo development team
# Author: <NAME>
#
# Pyzo is distributed under the terms of the 2-Clause BSD License.
# The full license can be found in 'license.txt'.
"""
Tool that can view qt help files via the qthelp engine.
Run make_docs.sh from:
https://bitbucket.org/winde... |
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distri... |
# Copyright 2004-2008 <NAME>.
# Distributed under the Boost Software License, Version 1.0. (See
# accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
"""defines few unrelated algorithms, that works on declarations"""
import types
def declaration_path( decl, with_defaults=True ):
... |
from ocs import ocs_agent, site_config, client_t, ocs_feed
import time
import threading
import os
import txaio
from os import environ
import numpy as np
from autobahn.wamp.exception import ApplicationError
from twisted.internet.defer import inlineCallbacks
from autobahn.twisted.util import sleep as dsleep
# For loggi... |
"""
This module handles the pipeline of training models, from instantiating
the models and calling the data loading methods, to supervising the
training, saving results to disk as necessary.
"""
import argparse
import importlib
from pathlib import Path
import sys
from keras.callbacks import ModelCheckpoint
from keras.m... |
import json
import os
import warnings
from dataclasses import dataclass
from typing import Any, List, Optional
from fedot.core.repository.dataset_types import DataTypesEnum
from fedot.core.repository.json_evaluation import eval_field_str, eval_strategy_str, read_field
from fedot.core.repository.tasks import Task, Task... |
import copy
from functools import partial
import numpy as np
import torch
import nndct_shared.quantization as nndct_quant
import pytorch_nndct.parse.torch_op_def as torch_op_def
import pytorch_nndct.utils.tensor_utils as py_tensor_utils
from nndct_shared.base import NNDCT_OP
from nndct_shared.utils import NndctScreen... |
import glob
import os
import click
import shutil
import stat
import subprocess
import yaml
from pydockerize.config import Config
class Initializer:
def __init__(self, project_dir, env_name=None):
self.project_dir = os.path.realpath(os.path.expanduser(project_dir))
if env_name is None:
... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Functions to handle geographical points
These functions are used to allow taup models to process input data with
source and receiver locations given as latitudes and longitudes. The functions
are set up to handle an elliptical planet model, but we do not have elliptic... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2003-2009 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.org/wiki/TracLicense.
#
# This software consi... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.