text stringlengths 8.04k 46.5k |
|---|
"""
Cloud Regime Error Metrics (CREM).
Author: <NAME> (Metoffice, UK)
Project: ESA-CMUG
Description
Calculates the Cloud Regime Error Metric (CREM) following Williams and
Webb (2009, Clim. Dyn.)
Required diag_script_info attributes (diagnostics specific)
none
Optional diag_script_info attribu... |
#
# Copyright 2021 The FATE 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... |
# (c) 2016, <NAME> <<EMAIL>>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible i... |
""" Tools for working with osu!'s .osu file format """
# -*- coding: utf-8 -*-
import os
from enum import IntEnum
from enum import IntFlag
from enum import unique
from functools import cache
from functools import cached_property
from typing import Callable
from typing import NamedTuple
from typing import Optional
from... |
#!/usr/bin/env -S python3 -tt
# -*- coding: utf-8 -*-
#
# SPDX-License-Identifier: Apache-2.0
# Copyright 2020 - 2022 Pionix GmbH and Contributors to EVerest
#
"""
author: <EMAIL>
FIXME (aw): Module documentation.
"""
from . import __version__
from . import helpers
from datetime import datetime
from pathlib import Pa... |
from PySide2.QtCore import QSize, QPoint, QPointF, QLineF, QRect, QRectF, Qt, QMargins
from PySide2.QtGui import QPen, QBrush, QColor, QTransform, QCursor
from PySide2.QtWidgets import QGraphicsScene, QGraphicsItemGroup, QGraphicsItem, QMenu, QAction, QMessageBox
from models.constants import MimeType, SelectConnect, O... |
import importlib
import datetime
import argparse
import random
import uuid
import time
import os
import numpy as np
import torch
from metrics.metrics import confusion_matrix
import metrics.plot as plot
from metrics.utils import createdirs
from model.common import MLP, ResNet18
from model.prototypical.mem_scheme import... |
# -*- coding: utf-8 -*-
"""
Created on Mon May 25 22:33:04 2020
@author: kkrao
"""
import pandas as pd
from init import dir_data, lc_dict, color_dict, dir_root, short_lc
import seaborn as sns
import os
import numpy as np
import matplotlib.pyplot as plt
from scipy.stats import mannwhitneyu
from sklearn.ensemble impor... |
# Copyright 2020 Huawei Technologies Co., Ltd
#
# 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... |
"""
Find reachable nodes given a set of root nodes and properties
TODO: the --subj, --pred, and --obj options should perhaps be renamed to
--node1-column-name, --label-column-name, and --node2-column-name, with
the old options kept as synonyms.
TODO: the root file name should be parsed with parser.add_inp... |
import math, os, json, torch, datetime, random, copy, shutil, torchvision
# import sys
# sys.path.append('../..')
import torch.nn as nn
import torch.optim as Optim
import torch.nn.functional as F
import torch.utils.data as Data
import numpy as np
from collections import namedtuple
from tkinter import _flatten
import ... |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Utilities for reading or working with Camera geometry files
"""
import logging
import numpy as np
from astropy import units as u
from astropy.coordinates import Angle, SkyCoord
from astropy.table import Table
from astropy.utils import lazyproperty
fro... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Collection of some standard algorithms and the fully customizable CMA-ES as used in 'Evolving the Structure of
Evolution Strategies', all based on the same :func:`~baseAlgorithm` function.
"""
from __future__ import absolute_import, division, print_function, unicode_lit... |
import errno
import json
import logging
import os
import os.path
from collections import defaultdict, namedtuple
from contextlib import contextmanager
from datetime import datetime
from functools import partial
from itertools import groupby
import attr
from memoized import memoized
from sqlalchemy import (
Column,... |
import requests
from django.utils.dateparse import parse_datetime
from typing import List, Dict
from data_refinery_common.job_lookup import ProcessorPipeline, Downloaders
from data_refinery_common.logging import get_and_configure_logger
from data_refinery_common.models import (
Experiment,
ExperimentAnnotatio... |
# CSV2PO Python (csv2po.py) v1.0.0
# By <NAME> <<EMAIL>> (tomchen.org)
# MIT License
# Python 3.8+
import re
import glob
import os
import time
import random
import importlib.util
import gettext
import polib
from pathlib import Path
from pluralforms import pluralforms
import settings
__version__ = '1.0.0'
import sys... |
"""
Copyright 2018-2021 The Johns Hopkins University Applied Physics Laboratory.
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 a... |
# -*- coding: utf-8 -*-
# This file is part of QuTiP: Quantum Toolbox in Python.
#
# Copyright (c) 2014 and later, <NAME>
# 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.... |
"""Model classes for retaining FHIR data"""
from datetime import datetime
from html.parser import HTMLParser
import json
from flask import abort, current_app, url_for
from past.builtins import basestring
import requests
from sqlalchemy import UniqueConstraint, or_
from sqlalchemy.dialects.postgresql import ENUM, JSONB... |
"""Parametrizing conditional raising.
Different options for test IDs:
Indirect parametrization: https://docs.pytest.org/en/latest/example/parametrize.html
Markers: https://docs.pytest.org/en/6.2.x/example/markers.html
writing hooks: https://docs.pytest.org/en/latest/how-to/writing_hook_functions.html
pytest hooks: wri... |
import demistomock as demisto
from CommonServerPython import *
from CommonServerUserPython import *
import requests
import json
import traceback
from datetime import datetime, timedelta
import time
# Disable insecure warnings
requests.packages.urllib3.disable_warnings() # pylint: disable=no-member
# flake8: noqa
'... |
from pyinduct.examples.string_with_mass.utils import *
from pyinduct.core import integrate_function
from collections.abc import Iterable
import pyinduct as pi
def build_canonical_weak_formulation(obs_lbl, spatial_domain, u,
obs_err, name="system"):
r"""
Observer canonical ... |
# -*- coding: utf-8 -*-
"""
shepherd.datalog
~~~~~
Provides classes for storing and retrieving sampled IV data to/from
HDF5 files.
:copyright: (c) 2019 Networked Embedded Systems Lab, TU Dresden.
:license: MIT, see LICENSE for more details.
"""
import logging
import subprocess
import threading
import time
from typi... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Copyright (c) 2017-2019, <NAME>.
Title : EM Downpour Downloader
Author : <NAME>
Email : <EMAIL>
License : MIT
Version : 0.2
"""
# Future
from __future__ import print_function
# Built-ins
import os
import re
import sys
import json
import codec... |
import pandas as pd
import geonamescache
from itertools import product
states = ["AL", "AK", "AZ", "AR", "CA", "CO", "CT", "DC", "DE", "FL", "GA",
"HI", "ID", "IL", "IN", "IA", "KS", "KY", "LA", "ME", "MD",
"MA", "MI", "MN", "MS", "MO", "MT", "NE", "NV", "NH", "NJ",
"NM", "NY", "NC", "ND"... |
import inspect
from functools import wraps
from dagster import check
from dagster.core.errors import DagsterInvalidDefinitionError, DagsterInvariantViolationError
from ..decorator_utils import (
InvalidDecoratedFunctionInfo,
split_function_parameters,
validate_decorated_fn_non_positionals,
validate_de... |
import os
import tempfile
import tensorflow as tf
import zipfile
import cloudpickle
import numpy as np
import baselines.common.tf_util as U
from baselines.common.tf_util import load_variables, save_variables
from baselines import logger
from baselines.common.schedules import LinearSchedule
from baselines.common impor... |
"""Main ecoshard module."""
import datetime
import hashlib
import logging
import json
import os
import re
import requests
import shutil
import subprocess
import time
import urllib.request
import zipfile
from osgeo import gdal
import numpy
from .geoprocessing import geoprocessing
import retrying
impor... |
import os
import shlex
import shutil
import subprocess
import tempfile
from collections import defaultdict
from functools import partial
from io import StringIO
from operator import attrgetter
from unittest.mock import patch
import pytest
from pkgcore import const as pkgcore_const
from pkgcore.ebuild import atom, rest... |
#!/usr/bin/env python3
import curses
import curses.ascii
import re
import subprocess
import sys
import getopt
import os.path
import time
import collections
import signal
import threading
import getpass
import enum
import urllib.request
import urllib.parse
import http.client
import ftplib
# global parameters
ENDLESS... |
"""
interfaces.py
`FormsiteInterface` `FormsiteParams` and `FormsiteCredentials` classes are defined here.
Author: <NAME>
Documentation: https://github.com/strny0/formsite-utility
"""
from __future__ import annotations
import csv
import asyncio
from datetime import datetime as dt
from datetime import timedelta as td
f... |
# Copied from previous adaptations
import torch
import higher
from hessian_eigenthings import compute_hessian_eigenthings
from torch.autograd import Variable
def gradient(_outputs, _inputs, grad_outputs=None, retain_graph=None,
create_graph=False):
if torch.is_tensor(_inputs):
_inputs = [_inp... |
#! /usr/bin/env python
"""
Full-frame PCA algorithm for ADI, ADI+RDI and ADI+mSDI (IFS data) cubes.
"""
from __future__ import division, print_function
__author__ = '<NAME>'
__all__ = ['pca']
import numpy as np
from multiprocessing import cpu_count
from .svd import svd_wrapper
from ..preproc.derotation import _find... |
# container-service-extension
# Copyright (c) 2019 VMware, Inc. All Rights Reserved.
# SPDX-License-Identifier: BSD-2-Clause
"""Constants used only in the CSE server."""
from dataclasses import dataclass
from enum import Enum
from enum import unique
import requests
import semantic_version
# CSE SERVICE;
# keys for ... |
import os
import torch
torch.backends.cudnn.benchmark=True
import torch.utils.data as data
import torch.nn.functional as F
from torch.autograd import Variable
from tqdm import tqdm
from distutils.version import LooseVersion
import numpy as np
import cv2 as cv
import sys
sys.path.append(os.path.abspath('.'))
... |
# Copyright 2019 <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 obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... |
import csv
import dateutil.parser as date
import jinja2
import numpy as np
import os
import pathlib
import pandas as pd
import sqlite3 as sql
from fuzzywuzzy import fuzz
from pyne import nucname as nn
def get_cursor(file_name):
""" Connects and returns a cursor to an sqlite output file
Parameters
-------... |
# stdlib
import ast
from collections import OrderedDict
import copy
import inspect
from itertools import islice
import os
from pathlib import Path
import sys
from typing import Any
from typing import Callable
from typing import Dict
from typing import Iterator
from typing import List
from typing import Optional
from ty... |
#
# Copyright (c) 2016 Nordic Semiconductor ASA
# 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 co... |
#
# Node2Vec example
# Code modified from tensorflow models tutorial
# [link]
#
import datetime
import six
import os
import time
import pandas as pd
import numpy as np
from contextlib import contextmanager
import pickle
import tensorflow as tf
from sklearn import (model_selection, linear_model, multiclass,
... |
import numpy as np
from shapely import geometry
import sys
import os
import json
import glob
from convert import convert_videos
MIN_SCORE = -9999
MAX_TRACK_ID = 10000
class Joint:
def __init__(self):
self.count = 21
self.wrist = 0
self.thumb_k = 1
self.thumb_b = 2
self.th... |
# Copyright (c) 2021, TU Wien, Department of Geodesy and Geoinformation
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright notice,... |
import logging
import os
import sys
import threading
import SocketServer
import ssl
import socket
from . import *
from pyftpdlib.authorizers import DummyAuthorizer
from pyftpdlib.handlers import FTPHandler, TLS_FTPHandler
from pyftpdlib.filesystems import AbstractedFS
from pyftpdlib.servers import ThreadedFTPServe... |
"""
Validation
====================================
Classes for hyperparameter tuning, such as random search.
..
Copyright 2021, Neuraxio 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 Licen... |
import random
from app.survive import survival_choices
from app.survive import flood_fill
from app.survive import find_own_tail_path
from app.survive import find_other_snake_tail_path
from app.attack import attack_chase
from app.attack import attack_cutoff
from app.attack import attack_collide
from app.ea... |
import tensorflow as tf
import numpy as np
from ops import upsample, downsample, pixel_norm, minibatch_stddev, adaptive_instance_norm
class Conv2D(tf.keras.layers.Layer):
"""
Conv2D with option for equalized learning rate (from pggan paper)
"""
def __init__(self,
filters,
... |
from __future__ import unicode_literals
import sys
import json
import time
import hashlib
import logging
import traceback
from copy import deepcopy
from functools import wraps
from threading import local, RLock
from collections import defaultdict
import six
import cherrypy
from ws4py.websocket import WebSocket
from w... |
import math
from pymavlink import mavutil
from dronekit.observers import HasObservers
class Attitude(object):
"""
Attitude information.
An object of this type is returned by :py:attr:`Vehicle.attitude`.
.. _figure_attitude:
.. figure:: http://upload.wikimedia.org/wikipedia/commons/thumb/c/c1/... |
"""ASCam is an ASC time-domain simulator to test novel feedback-filter designs.
Produced by <NAME>
Collaborators <NAME> and <NAME> from Caltech provided all the insight and data for the ASC modeling.
version 1.0 (04/26/2020)
ASCam implements pitch dynamics with noise inputs from ISI-L and TOP NL/NP from damping OSEM... |
# Copyright 2018 Mycroft AI 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 writin... |
#!/usr/bin/python3
# -*- coding: utf-8 -*-
import pickle
import kajiki
import re
import os
import sys
import io
import copy
import json
import traceback
from contextlib import redirect_stdout
from Mamlambo.Core.Configuration import Configuration
from Mamlambo.Core.MamlamboException import MamlamboException
from Mamlamb... |
#!/usr/bin/python
# Classification (U)
"""Program: isse_guard_transfer.py
Description: Process and send pre-reviewed files in a "reviewed"
directory to an ISSE Guard system (which will send them to a specified
security enclave). Also process and package pre-approved documents and
send t... |
#usr/bin/python
import os
import time
import itertools
import string
import hashlib
import sys
import signal
import getopt
import random
import threading
import multiprocessing
from multiprocessing import Process
from ctypes import c_char_p
__version__ = '1.0.0'
info = """
Name : find-e... |
#!/usr/bin/python
# Copyright 2020 Makani Technologies 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 applicabl... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# ======================================================================
# Copyright 2016 <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
#
#... |
import numpy as np
import scipy.special as sp_spec
from scipy.optimize import minimize
from nest_elephant_tvb.Tvb.modify_tvb.Zerlaut import ZerlautAdaptationSecondOrder as model
def create_transfer_function(parameter,excitatory):
"""
create the transfer function from the model of Zerlaut adapted for inhibitory... |
import json
import random
import os
import numpy as np
import torch
from torch.utils.data import Dataset
from torch.utils.data import DataLoader
import copy
import math
import h5py
import models.Constants as Constants
from bisect import bisect_left
import torch.nn.functional as F
import pickle
from pandas.io.json impo... |
# vi: ts=4 sw=4
'''
:mod:`ophyd.control.areadetector.plugins` - areaDetector plugins
======================================================
.. module:: ophyd.control.areadetector.plugins
:synopsis: `areaDetector`_ plugin abstractions
.. _areaDetector: http://cars.uchicago.edu/software/epics/areaDetector.html
'''
... |
import numpy as np
import matplotlib.pylab as plot
from astropy.io import ascii,fits
from scipy import interpolate
import grb_catalogs
from BurstCube.LocSim.Detector import *
from BurstCube.LocSim.Spacecraft import *
from astropy.coordinates import SkyCoord
from astropy import units as u
from scipy.optimize import curv... |
from __future__ import absolute_import
"BASS_FX wrapper by <NAME>"""
import ctypes
import os
from . import pybass
from .paths import x86_path, x64_path
import libloader
bass_fx_module = libloader.load_library('bass_fx', x86_path=x86_path, x64_path=x64_path)
func_type = libloader.get_functype()
#Error c... |
# -*- coding: utf-8 -*-
"""
Created on Wed Nov 21 21:30:31 2018
@authors: <NAME> and <NAME>
"""
# sklearn library
from sklearn import datasets
from sklearn import decomposition
from sklearn.model_selection import StratifiedKFold
from sklearn.metrics import accuracy_score
from sklearn.preprocessing import OneHotEncod... |
"""
Original code from <NAME> for CS294 Deep Reinforcement Learning Spring 2017
Adapted for CS294-112 Fall 2017 by <NAME> and <NAME>
Adapted for CS294-112 Fall 2018 by <NAME> and <NAME>
Adapted for pytorch version by <NAME>
"""
import numpy as np
import torch
import gym
import logz
import scipy.signal
import os
import ... |
import abc
import asyncio
import concurrent.futures as concurrent
import inspect
import os
import pickle
import sys
import time
import traceback
import warnings
from contextlib import suppress
from adaptive.notebook_integration import in_ipynb, live_info, live_plot
try:
import ipyparallel
with_ipyparallel = ... |
from logging import error, warning
from unittest.loader import VALID_MODULE_NAME
from matplotlib.patches import Polygon
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from scipy.optimize import curve_fit
#from shapely.geometry import Poligon
from scipy.interpolate import make_interp_spli... |
from pathlib import Path
from json import loads, JSONDecodeError, dumps
from typing import Optional
from .exception import JMCDecodeJSONError, JMCFileNotFoundError, JMCSyntaxException, JMCSyntaxWarning, MinecraftSyntaxWarning
from .vanilla_command import COMMANDS as VANILLA_COMMANDS
from .tokenizer import Tokenizer, ... |
import streamlit as st
import torch
import pickle
import os
from pathlib import Path
import yaml
import time
from seal import Ciphertext, \
Decryptor, \
Encryptor, \
EncryptionParameters, \
Evaluator, \
IntegerEncoder, \
FractionalEncoder, \
KeyGenerator, \
MemoryPoolHandle, \
Plain... |
import warnings
import numpy as np
import pandas as pd
from powersimdata.design.compare.generation import calculate_plant_difference
from powersimdata.design.compare.transmission import (
calculate_branch_difference,
calculate_dcline_difference,
)
from powersimdata.design.investment import const
from powersim... |
import glob
import inspect as ins
from pprint import pprint
import sys, os, re
import logging
import jieba
import functools
# 配置logging
logging.basicConfig(
level=logging.INFO,
format='%(filename)s:%(lineno)d - %(message)s',
handlers=[
#logging.FileHandler("ke.log", mode="a"), # for logs write in ... |
from PySide2.QtCore import *
from PySide2.QtGui import *
from PySide2.QtWidgets import *
from UI import UI_Main,UI_Subject,UI_Input_Score,Ui_Errors
import os,sys,re,json,traceback,ctypes
#define subject code
KOREAN = 0
MATH = 1
ENGLISH = 2
HISTORY = 3
SEARCH_1 = 4
SEARCH_2 = 5
#define search subjects name
... |
import sys
import os
import time
from torchvision import transforms
import torch, torchaudio
import yarp
import numpy as np
from speechbrain.pretrained import EncoderClassifier
from project.voiceRecognition.speaker_embeddings import EmbeddingsHandler
from project.faceRecognition.utils import format_face_coord, face_al... |
# -*- coding: utf-8 -*-
#
# Copyright 2016 The Fabulous 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
#
# Unl... |
from pines_analysis_toolkit.utils import pines_dir_check, short_name_creator
from astropy import units as u
from astropy.coordinates import SkyCoord
from astropy.coordinates import EarthLocation, AltAz
from astropy.time import Time
from astropy.utils.data import clear_download_cache
from astropy.constants import R_ear... |
from scratchclient import ScratchSession, ScratchExceptions
from scratchhh.scratchhh import Scratch
from gevent.pywsgi import WSGIServer
from functools import update_wrapper
from datetime import timedelta
from dateutil import parser
from flask import *
import generator3
import requests
import pathlib
import f... |
# This file contains all the necessary functions for exploration.ipynb to run
# It mostly collects, cleans, and presents data
import pyspark as ps
from pyspark.sql.types import *
import pyspark.sql.functions as f
import pandas as pd
import matplotlib.pyplot as plt
from statsmodels.nonparametric.smoothers_lowess import... |
import h5py
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import bebi103
from czifile import CziFile
import tifffile
import av
from skimage.filters import gaussian
from skimage.segmentation import active_contour
from skimage.measure import grid_points_in_poly
import tqdm
from scipy.interp... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2013-2016 Red Hat, Inc.
#
# Authors:
# <NAME> <<EMAIL>>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your... |
"""
- Takes a device-related folder as input, or anyway a folder containing all MUD rejected-traffic pcaps
- Generates all flow-files per-pcap
- Derives comprehensive NetFlow CSV per-pcap
- Labels the CSV according to the IEEE IoT NIDS dataset, EZVIZ ground truth
- Merges all CSVs together
Use... |
# Copyright 2018 The Defense-GAN 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... |
#
# Common binary translation patches and hooks for all Robot Odyssey binaries.
# <NAME> <<EMAIL>>
#
import sbt86
# Default frame rate. This is somewhat faster and more consistent than the
# original experience would have been, but it seems good for gameplay. Much
# faster and it's hard to navigate and the puzzles r... |
"""Database related view functions."""
import re
import json
import textwrap
from io import StringIO
from Bio import SeqIO
from django.shortcuts import render, redirect, render_to_response
from django.core.files.storage import FileSystemStorage
from django.core.files.base import ContentFile
from django.views.decorato... |
# from hdfchain import HDFChain
# import glob
# from matplotlib import pyplot as plt
import h5py as h5
import numpy as np
import pickle
"""almost all of these functions take h5Files as data parameter"""
path = '/home/fongo/sync/bachelorarbeit/daten/sim/'
colblacklist = ['Event', 'SubEventStream', 'SubEvent', 'exists'... |
# coding=utf-8
"""
SPDX-license-identifier: Apache-2.0
Copyright (c) 2020 SmartMe.IO
Authors: <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/LICE... |
import torch
import torch.nn as nn
import numpy as np
from torch.nn import Sequential, Conv2d, Linear, ReLU, PReLU, LeakyReLU
from model_defs import Flatten
import torch.nn.functional as F
from itertools import chain
import logging
import os
logging.basicConfig(level=logging.INFO)
#logging.basicConfig(level=logging.DE... |
import random
import sys
import math
import pygame
from pygame.locals import *
import numpy as np
from keras.models import Sequential
from keras.layers import Dense, Activation
from keras.optimizers import SGD
START_MUTATION_RATE = 0.1
MIN_MUTATION_RATE = 0.05
MUTATION_STEP = 0.05
POPULATION_SIZE = 50... |
# encoding: utf-8
import pytest
from pprint import pformat
from ckan.lib.navl.dictization_functions import (
validate,
Invalid,
check_dict,
resolve_string_key,
DataError,
check_string_key,
filter_glob_match,
update_merge_dict,
update_merge_string_key,
flatten_schema,
get_al... |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... |
import os
import cabinetry
import pyhf
import uproot3
import numpy as np
import json
import logging
from plotting import plot
from plotting import stack
import inferno_config
logging.basicConfig(format="%(levelname)s - %(name)s - %(message)s")
#cabinetry.set_logging()
#
# Exclude zero bins to avoid problems with... |
# Copyright (C) 2014 Orange
# This software is distributed under the terms and conditions of the 'BSD
# 3-Clause' license which can be found in the 'LICENSE.txt' file in this package
# distribution or at 'http://opensource.org/licenses/BSD-3-Clause'.
"""Core openssl command and environment generation functions.
This... |
#!python
# Copyright (c) 2000-2021 HVR Software bv
################################################################################
#
# NAME
# hvrdefaultagent.py
#
# SYNOPSIS
# as agent
# python hvrdefaultagent.py mode loc chn
#
# DESCRIPTION
# < description >
#
# OPTIONS
#
# AGENT OPERATION
#
# ... |
from itertools import chain, combinations
import json
import pytest
from rpcx import *
rpcs = [
JSONRPCv1,
JSONRPCv2,
JSONRPCLoose,
]
batch_rpcs = [rpc for rpc in rpcs if rpc.allow_batches]
no_batch_rpcs = [rpc for rpc in rpcs if not rpc.allow_batches]
def assert_is_request_batch(item, n):
assert it... |
#!/usr/bin/env python
# coding: utf-8
import os
import time
import unittest
import k3fs
import k3proc
import k3thread
import k3ut
import k3num
dd = k3ut.dd
# k3fs/test/
this_base = os.path.dirname(__file__)
pyt = 'python'
class TestFS(unittest.TestCase):
def test_exceptions(self):
dd('present: ', k3... |
#!/usr/bin/env python
"""
Generates an AXI Stream switch with the specified number of ports
"""
from __future__ import print_function
import argparse
import math
from jinja2 import Template
def main():
parser = argparse.ArgumentParser(description=__doc__.strip())
parser.add_argument('-p', '--ports', type=in... |
from sklearn import svm
import multiprocessing
import numpy as np
import re, pickle
import enum, gzip
import warnings
def _compiled_regex(pattern, dotall=True):
flags = (re.MULTILINE | re.DOTALL) if dotall else re.MULTILINE
return re.compile(pattern, flags)
MARKERS = [
# Markers applicable to several la... |
from tkinter import *
from tkinter import ttk
import requests as req
from bs4 import BeautifulSoup
from collections import OrderedDict
import datetime
import socket
from urllib.request import urlopen, URLError, HTTPError
from tkinter import messagebox
import urllib.request
from PIL import ImageTk, Image
impo... |
"""
StyleMapGAN
Copyright (c) 2021-present NAVER Corp.
This work is licensed under the Creative Commons Attribution-NonCommercial
4.0 International License. To view a copy of this license, visit
http://creativecommons.org/licenses/by-nc/4.0/ or send a letter to
Creative Commons, PO Box 1866, Mountain View, CA 94042, U... |
from scipy.spatial import ConvexHull
import numpy as np
from scipy.integrate import simps
from scipy import signal
import antropy as ant
import scipy.stats
import nolds
from package import diffusion_stabilogram
from package import recurrence_quantification_analysis
from package import fractal_dimension
## NOTE: Record... |
#! /usr/bin/python
# -*- coding: utf-8 -*-
import os
import tensorlayerx as tlx
from tensorlayerx.files import utils
from tensorlayerx import logging
import numpy as np
from queue import Queue
from tensorlayerx.nn.initializers import *
if tlx.BACKEND == 'mindspore':
from mindspore.ops.operations import Assign
... |
# -*- coding: utf-8 -*-
"""
Copyright (c) 2019 <NAME>.
youtube-dlを使ってdiscord.pyで書かれたシンプルな音楽ボットです。
これは簡単な例ですが、音楽ボットは複雑で、完璧に動作するまで多くの時間と知識が必要です。
これを例として、あるいはあなた自身のボットのベースとして使い、好きなように拡張してください。もし、バグがあれば、私に知らせてください。
必要条件
Python 3.5以上
pip install -U discord.py pynacl youtube-dl
また、PATH環境変数にFFmpegがあるか、WindowsではボットのディレクトリにFFm... |
"""
Improved Semantic Representations From Tree-Structured Long Short-Term Memory Networks
https://arxiv.org/abs/1503.00075
"""
import time
import itertools
import networkx as nx
import numpy as np
import torch as th
import torch.nn as nn
import torch.nn.functional as F
from torch.nn import CrossEntropyLoss
import dgl
... |
import numpy as np
import tensorflow as tf
import torch as tc
import torch.nn as nn
import math
import helper_torch
import csv as csv
def weight_initialize(shape, layer, dist='tn', scale=0.1):
"""
Arguments:
shape -- array giving shape of output weight variable
var_name -- string naming weight... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.