text stringlengths 3.07k 22.1k |
|---|
# Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany
#
# 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://w... |
#!/usr/bin/env python3
import gym
import numpy as np
import tensorflow as tf
import random
NOISE_DECAY = 0.99999
NOISE_MIN = 0.001
NAME = 'DDPG'#dont care phi
LOAD = False
BATCH_SIZE = 128
MEMORY_CAPACITY = int(1e6)
class ReplayBuffer(object):
def __init__(self, capacity):
self.buffer = []
self.c... |
from sys import argv
import json
import csv
import os
import re
import tqdm
from config import SHOULD_PRINT
from utils import is_external_failure
from utils import is_external_failure_outputerror
import keywords
from query import search_strings
from query import search
from transform import transform
keywords.read_file... |
# -*- coding: utf-8 -*-
import math
import numpy as np
from six import moves
from chainer import cuda, Variable, initializers, link, function
from chainer.utils import conv, type_check
from chainer.functions.connection import convolution_2d
if cuda.cudnn_enabled:
cudnn = cuda.cudnn
libcudnn = cuda.cudnn.cudnn
_cudn... |
#!/usr/bin/python
# $LicenseInfo:firstyear=2010&license=mit$
# Copyright (c) 2010, Linden Research, Inc.
#
# 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 with... |
from .attention import MultiHeadAttention
import torch.nn as nn
import torch
# ref: Transformerのデータの流れを追ってみる
# https://qiita.com/FuwaraMiyasaki/items/239f3528053889847825
# no need to understand Japanese, just read the detail from image_2
# heavily borrow from:
# https://github.com/AladdinPerzon/Machine-Learning-Col... |
# /usr/bin/env python3
import argparse
import multiprocessing
import torch
"""
Configuration file
"""
def model_config(parser):
parser.add_argument('--vocab_size', type=int, default=0)
parser.add_argument('--wemb_dim', type=int, default=300)
parser.add_argument('--covec_on', action='stor... |
#!/usr/bin/env python
# Copyright 2016 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.
"""A Windows-only end-to-end integration test for Kasko and SyzyAsan.
This test ensures that the interface between SyzyAsan, Kasko and... |
import requests
import flask
import yfinance as yf
from pandas_datareader import data as pdr
import dash_table
import pandas as pd
import dash_core_components as dcc
import dash_html_components as html
import dash_bootstrap_components as dbc
from dash.dependencies import Input, Output
from datetime import datetime as d... |
# -*- coding: utf-8 -*-
r"""
Intersection graphs
The methods defined here appear in :mod:`sage.graphs.graph_generators`.
"""
###########################################################################
#
# Copyright (C) 2006 <NAME> <<EMAIL>>
# and <NAME>
# Copyright (C)... |
#
# Copyright 2019 <NAME>, <NAME>, <NAME>,
# <NAME>, <NAME>, <NAME>, <NAME>,
# <NAME>, <NAME>, <NAME>, <NAME>,
# <NAME>, <NAME>, <NAME>, <NAME>, <NAME>
#
# This file is part of acados.
#
# The 2-Clause BSD License
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provi... |
#!/usr/bin/env python3
# coding: utf-8
'''
Auto Encoder Neural Networks
'''
__author__ = 'IriKa'
import tensorflow as tf
from tensorflow.python.training.moving_averages import assign_moving_average
import tools
def codec(imgs, filter, is_encode,
stddev=5e-2,
name=None,
new_size=None,
... |
"""
|||||||||||||||||||||||||||||||||||||||||||||||||
||| ||| ||| ||||||||| ||||||
||| |||||||| ||||| ||| ||||||||| |||||||||||
||| |||||||| ||||| ||| ||||||||| |||||||||||
||| |||||||| ||| ||||||||| |||||||||||
||| |||||||| ||||| ||| ||||||||| ||||... |
# Copyright 2015 The LUCI Authors. All rights reserved.
# Use of this source code is governed under the Apache License, Version 2.0
# that can be found in the LICENSE file.
"""Cron jobs for processing lease requests."""
import datetime
import logging
import time
from google.appengine.api import taskqueue
from google... |
import numpy as np
import picos as pic
from numpy.linalg import inv, cholesky
import logging
from betl.synthesis.syntheziser import LQRSyntheziser, NoControllerFound, NumericalProblem
# 'synthesis_settings': {
# # Sets the confidence interval on the posterior system distribution which we consider for con... |
from math import isnan
from typing import List
from tests.bind_tests.hints import (BoundBeachLineKey,
BoundBeachLineValue,
BoundBigFloat,
BoundBigInt,
BoundBuilder,
... |
# -*- coding: utf-8 -*-
"""
Source: https://github.com/awesto/django-shop/blob/c5fcbc543096ce09fd2320d24c5a100a53a3eb4b/shop/admin/delivery.py
"""
from __future__ import unicode_literals
from django.conf.urls import url
from django.contrib import admin
from django.core.urlresolvers import reverse
from django.db.models... |
import numpy as np
from os.path import join
import cv2
import kdtree as KDT
import os
import glob
import time
def hsv_to_rgb(h, s, v):
if s == 0.0:
return v, v, v
i = int(h * 6.0)
f = (h * 6.0) - i
p = v * (1.0 - s)
q = v * (1.0 - s * f)
t = v * (1.0 - s * (1.0 - f))
i = i % 6... |
from pymel import core as pm
import flottitools.utils.namespaceutils as nsutils
import flottitools.utils.transformutils as xformutils
# joint label side
LABEL_SIDE_CENTER = 0
LABEL_SIDE_LEFT = 1
LABEL_SIDE_RIGHT = 2
LABEL_SIDE_NONE = 3
# joint label names
LABEL_STR_NONE = 'None'
LABEL_STR_ROOT = 'Root'
LABEL_STR_HIP... |
# bases functions supporting Brie
import os
import subprocess
import numpy as np
from .sam_utils import load_samfile
from .bias_utils import BiasFile, FastaFile
from .tran_utils import TranUnits, TranSplice
def get_count_matrix(g, g_idx, sam_files, bias_mode, ref_file,
bias_file, FLmean, FLst... |
from collections import defaultdict
from time import perf_counter as clock
from warnings import filterwarnings
import numpy
import dask
from dask import array as da
from dask.dataframe.shuffle import shuffle
from dask.distributed import Client, performance_report, wait
from dask.utils import format_bytes, format_time... |
#!/usr/bin/env python3
import click
from dotenv import load_dotenv
import sys
import json
try:
import igneous
except ModuleNotFoundError:
# Try to see if we are in a dev layout:
sys.path.append("..")
import igneous
def empty(x):
return x is None or len(x) == 0
PRINT_REQUEST = False
def json_... |
from visual import *
import itertools
title = "VPython: Draw a cuboid"
scene.title = title
print( "%s\n" % title )
msg = """
Drag with right mousebutton to rotate view.
Drag up+down with middle mousebutton to zoom.
Left mouseclick to show info.
Press x,X, y,Y, z,Z to rotate the box in single steps.
Press b, c,o,m t... |
import torch
import torchvision.transforms as transforms
import torch.nn.functional as F
import torchvision.transforms.functional as tf
from .verification import evaluate
from datetime import datetime
import matplotlib.pyplot as plt
plt.switch_backend('agg')
import numpy as np
from PIL import Image
import bcolz
import... |
"""
***********
Annotations
***********
Annotations are arbitrary metadata attached to Synapse entities. They can be
accessed like ordinary object properties or like dictionary keys::
entity.my_annotation = 'This is one way to do it'
entity['other_annotation'] = 'This is another'
Annotations can be given in ... |
import numpy as np
import pandas as pd
import pytest
import woodwork as ww
from evalml.automl import get_default_primary_search_objective
from evalml.data_checks import (
AutoMLDataChecks,
DataCheck,
DataCheckError,
DataCheckMessageCode,
DataChecks,
DataCheckWarning,
DefaultDataChecks,
... |
import collections
import geopandas as gpd
import networkx as nx
import pandas as pd
from shapely.geometry import LineString, Point, Polygon
from syspy.spatial.graph import network as networktools
from syspy.transitfeed import feed_links
from tqdm import tqdm
def label_links(links, node_prefixe):
links = links.c... |
from django.db import models, transaction
from django.urls import reverse
from apps.group.caches import cache_bust, make_key, make_key_many
from apps.group.exceptions import GroupError, GroupMembershipError
from apps.group.signals import group_created
# Create your managers here.
class GroupManager(models.M... |
from __future__ import print_function
from psychopy import event, sound, visual
import numpy as np
import string, math
from copy import deepcopy
import random, os
def drawResponses(responses,respStim,numCharsWanted,drawBlanks):
'''Draw the letters the user has entered
drawBlanks is whether to show empty spaces... |
import weakref
import datetime
from . import fmForm
from . import fmPopup
from . import wgtitlefield
from . import wgannotatetextbox
from . import wgmultiline
from . import wgselectone
from . import wgmultiselect
from . import wgeditmultiline
from . import wgcheckbox
from . import wgfilenamecombo
from . import wgdatec... |
# -*- coding: utf-8 -*-
#
# 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
#... |
import os
from typing import List, Dict, Tuple
import torchaudio
from torchaudio.datasets.utils import download_url, extract_archive, unicode_csv_reader
from torch import Tensor
from torch.utils.data import Dataset
# Default TSV should be one of
# dev.tsv
# invalidated.tsv
# other.tsv
# test.tsv
# train.tsv
# validat... |
################################################################################
# NOTICES #
################################################################################
## Copyright (c) 2020 Wind River Systems, Inc.
##
## Licensed under the Apac... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# This file is part of the
# SnakeJazz Project (https://github.com/mchalela/SnakeJazz/).
# Copyright (c) 2020, <NAME>
# License: MIT
# Full Text: https://github.com/mchalela/SnakeJazz/blob/master/LICENSE
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~... |
import os
import sys
import random
import logging
from datetime import date
import textwrap
import re
import unicodedata
from lxml import html
import requests
import click
import colorama
#Some User Agents
user_agent=[
'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.6) Gecko/20091201 Firefox/3.5.6',
... |
import os.path
from abc import ABC
from datetime import datetime
import numpy as np
import polars as pl
import xmlschema
class _BroXml(ABC):
def __init__(self, path: str = None, string: str = None):
"""
Parser of xml files.
Parameters
----------
path
Path to t... |
import os
import datetime
import pickle
import geopandas as gp
import pandas as pd
import numpy as np
from shapely.geometry import Point
from tqdm import tqdm
from jinja2 import Template
import matplotlib.pyplot as plt
import covidtracker as ct
class ProvinceFinder(object):
def __init__(self):
self.to_prov... |
# -*- coding: utf-8 -*-
"""
Created on Tue Jul 28 02:13:24 2015
@author: hoseung
"""
import numpy as np
def extract_halos_within(halos, ind_center, scale=1.0, Mcut=1e5):
import numpy as np
import utils.sampling as smp
'''
Returns indices of halos within SCALE * Rvir of the central halo.
def extr... |
import asyncio
from flask import (
abort,
Blueprint,
Response,
render_template,
request,
current_app as app,
)
# local imports
from fetch_data import (
fetch_data,
fetch_data_api,
fetch_wcs_point_data,
fetch_bbox_netcdf,
summarize_within_poly,
)
from generate_requests import... |
import torch
from torch import nn
import torch.nn.functional as F
from pcdet.models.dense_heads.fusion_modules import DCNFusionV3
from pcdet.models.dense_heads.utils import Sequential, kaiming_init
class AttnSepHead(nn.Module):
def __init__(self, base_ch, feat_ch, heads, key_ch, value_ch, init_bias=-2.19, **kwar... |
# -*- coding: utf-8 -*-
#-----------------------------------------------------------------------------
# Copyright (c) 2005-2021, PyInstaller Development Team.
#
# Distributed under the terms of the GNU General Public License (version 2
# or later) with exception for distributing the bootloader.
#
# The full license is... |
import glob
import os
from networkx.readwrite import json_graph
import json
import networkx as nx
import pandas as pd
from subs2network.utils import add_prefix_to_dict_keys
from subs2network.imdb_dataset import imdb_data
from subs2network.consts import MOVIE_YEAR
def get_node_features(g):
closeness = nx.closenes... |
#!/usr/bin/env python
# Contact: <NAME>
# <EMAIL>
# hmm.py
'''
This module serves as a collection for two of the HMMs built for modeling nanopore protein data.
HMMs must be written using Yet Another Hidden Markov Model (yahmm) package. When adding a new
HMM to the list, please follow the pattern set u... |
"""
Author: <NAME>
License: MIT
Copyright: 2018-2019
"""
import torch
import sys
sys.path.insert(0, "./..")
import os.path
from scipy import misc
from data.base_dataset import BaseDataset, get_transform
from data.image_folder import make_dataset
from PIL import Image
from PIL import ImageFilter
from pdb import set_trac... |
# Copyright 2014-2017 Insight Software Consortium.
# Copyright 2004-2009 <NAME>.
# Distributed under the Boost Software License, Version 1.0.
# See http://www.boost.org/LICENSE_1_0.txt
import re
from .. import utils
from .. import declarations
from ..declarations import type_traits
class default_argument_patcher_t(o... |
from __future__ import annotations
from abc import ABC, abstractmethod
import jax.numpy as jnp
import jax.random as random
import numpy as np
import numpyro
import numpyro.distributions as dist
from numpyro.infer import MCMC, NUTS
from typing import Any, Dict, Optional
def get_empirical_bayes_estimates(df_emp, prio... |
# -*- coding: utf-8 -*-
"""
Dynamic TOC -- BTOC
========================
Author: <NAME> (<EMAIL>)
"""
import os
import shutil
import logging
import copy
from bs4 import BeautifulSoup
from jinja2 import Template
from pelican import signals, contents
from pelican.generators import ArticlesGenerator, PagesGenerator
impo... |
""" Generic search functions that can be used to find data in
the object store
"""
__all__ = [
"get_data",
"daterange_to_string",
"daterange_to_string",
"search",
"lookup_gas_datasources",
"lookup_footprint_datasources",
]
def search(
locations,
species=None,
inlet=None,
i... |
#!/usr/bin/python
#
# Copyright: Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Dec 12 04:30:00 2021
@author: travis
"""
import argparse
from bs4 import BeautifulSoup
import csv
import datetime
from dateutil.parser import parse
import os
import pandas as pd
import pytz
from re import search
import re
import requests
import sys
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
post.py parses post sources from the ./_post directory.
"""
__author__ = "<NAME> (<EMAIL>)"
__date__ = "Mon Feb 2 21:21:04 2009"
import os
import datetime
import re
import operator
import urlparse
import hashlib
import codecs
import pytz
import yaml
import loggin... |
import math
import sys
import os
import os.path as osp
import argparse
import torch
import torch.nn.functional as F
import torch.nn as nn
from torch.autograd import Variable
import networkx as nx
import numpy as np
import pandas as pd
import seaborn as sns
from torch_geometric.datasets import Planetoid
import torch... |
"""
Game Of Life
Author : <NAME>
Description : Simple Conway's Game Of life
Features :
Two modes :
Randomly initialized world
Hand initialized world
"""
import time
import pygame
import random
import sys
import numpy as np
import copy
from tkinter import filedialog
from tkinter import *
# De... |
# 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
# d... |
import sys
import numpy as np
def histogram_match(image, reference):
if 'skimage.exposure' not in sys.modules:
from skimage.exposure import match_histograms
'''Returns image modified to match reference's histogram'''
return match_histograms(image, reference, multichannel=False)
def _build_gaussian... |
import boto3
import decimal
import json
from botocore.exceptions import ClientError
# Helper class to convert a DynamoDB item to JSON.
class DecimalEncoder(json.JSONEncoder):
def default(self, o):
if isinstance(o, decimal.Decimal):
if o % 1 > 0:
return float(o)
else... |
import gym
import gym_pomdps
from gym_pomdps.wrappers.fomdp import AutoresettingBatchPOMDP
import numpy as np
from rlpyt.envs.base import Env, EnvStep
from rlpyt.spaces.gym_wrapper import GymSpaceWrapper
from rlpyt.spaces.int_box import IntBox
from collections import namedtuple
env_list = gym_pomdps.env_list
EnvInfo ... |
# Copyright 2020, The TensorFlow 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 applicable law or agreed t... |
# -*- coding: UTF-8 -*-
import platform
if platform.python_version() < '2.7':
import unittest2 as unittest
else:
import unittest
if platform.python_version() < '3.0':
import __builtin__
else:
import builtins as __builtin__
import helpers
from term2048 import board
Board = board.Board
# PY3 compat
t... |
"""This module takes care of the data model used by microscopemetrics.
It creates a few classes representing input data and output data
"""
from abc import ABC
from dataclasses import field
from pydantic.dataclasses import dataclass
from pydantic import validator, BaseConfig, create_model
from pydantic.color import Col... |
"""
Automagically import missing modules in IPython.
To activate, pip-install and append the output of `python -m ipython_autoimport`
to `~/.ipython/profile_default/ipython_config.py`.
"""
import ast
import builtins
import functools
import importlib
import os
import re
import sympy
import sys
import token
from types ... |
#!/usr/bin/python3
"""
Generate Makefile dependencies of a Python program given as file $1.
WARNING: Do *NOT* use this on untrusted input, as it runs the code of $1
in some cases (whenever it detects INPUT= at the beginning of a line).
The expectation is that this script will be run with input on some filename
`BBB.p... |
"""
command_execution is a module designed to make cli scripting a bit easier.
It attempts to cover both syncronous and asyncronus(asyncio) aproches as
well as accessing output while the command is still running.
"""
from typing import NamedTuple, List, Optional
import subprocess, shlex, glob
import asynci... |
"""
Simple test suite for acora.
"""
import acora
if acora.BytesAcora is acora.PyAcora or acora.UnicodeAcora is acora.PyAcora:
print("WARNING: '_acora' C extension not imported, only testing Python implementation")
import re
import sys
import unittest
import codecs
import string
# compat stuff ...
try:
uni... |
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import logging
import os
import pathlib
import random
import time
from typing import Dict, List, Type
import hydra
import numpy as np
import... |
#!/usr/bin/env python3
# Copyright (c) 2019, <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. Redistributions of source code must retain the above copyright
# notice, this list ... |
import ctypes
from subprocess import call
import os
import platform
import subprocess
import numpy as np
import sys
class Simulation_data:
"""
Contains results of the simulator
"""
def __init__(self,panoc_time,optimal_input):
"""
crate simulation data
Parameters
--------... |
import warnings
import functools
from collections import Counter
def deprecated(func):
"""This is a decorator which can be used to mark functions
as deprecated. It will result in a warning being emitted
when the function is used."""
@functools.wraps(func)
def new_func(*args, **kwargs):
warnings.simplefilter('a... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# king_phisher/ssh_forward.py
#
# 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, this... |
from collections import OrderedDict
from dataclasses import dataclass, field
import numpy as np
import pandas as pd
import logging
import inspect
import torch
import math
import types
from neuralprophet import utils_torch, utils, df_utils
log = logging.getLogger("NP.config")
def from_kwargs(cls, kwargs):
return... |
#
# Copyright (C) 2017 Intel Corporation
#
# SPDX-License-Identifier: MIT
#
import os
import time
import glob
import sys
import importlib
import signal
from shutil import copyfile
from random import choice
import oeqa
import oe
from oeqa.core.context import OETestContext, OETestContextExecutor
from oeqa.core.excepti... |
# MIT License
# Copyright (c) 2022 <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, modify, merge, publis... |
# -*- coding: utf-8 -*-
"""Routines for editing tags in a LilyPond header
"""
from datetime import date
import logging
import os
import re
from string import Template
import sqlite3
import tempfile
from clint.textui import prompt, validators, colored, puts
import mupub
_HEADER_PAT = re.compile(r'\\header')
_MU_TAGS =... |
#!/usr/bin/env mayapy
#
# Copyright 2021 Autodesk
#
# 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... |
"""Functions for signing notebooks"""
#-----------------------------------------------------------------------------
# Copyright (C) 2014, The IPython Development Team
#
# Distributed under the terms of the BSD License. The full license is in
# the file COPYING, distributed as part of this software.
#--------------... |
import os.path
import math
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.nn import CrossEntropyLoss
from torch.nn import CosineEmbeddingLoss
import numpy as np
from transformers import *
def _gelu(x):
""" Original Implementation of the gelu activation function in Google Bert repo ... |
# -*- coding: utf-8 -*-
"""
Created on Sat Feb 14 14:49:22 2015
@author: hoseung
PURPOSE:
halo mass evolution catalog for Jinsu's phase space diagram study.
OUTPUT:
Consists of 10 columns, for each galaxy in each snapshot.
# ID x y z vx vy vz Rvir Mvir Mass
((nnouts*ngal) x ncolumns... |
import numpy as np
import cv2
import random
'''
Board class.
Board data:
1=white, -1=black, 0=empty
first dim is column , 2nd is row:
pieces[1][7] is the square in column 2,
at the opposite end of the board in row 8.
Squares are stored and manipulated as (x,y) tuples.
x is the column, y is the row.
'''
... |
from greenlet import greenlet
from cengal.time_management.timer import Timer
from typing import Dict, Tuple, List, Callable, Any, Optional, Type
class Counter:
def __init__(self):
self._index = -1 # type: int
def get(self) -> int:
self._index += 1
return self._index
class Iterable:... |
import numpy
class Matrix:
matrix = []
rows = 0
cols = 0
# Error Tolerance for FLoating Points:
# if abs( matrix[i, j] ) < epsilon then value = zero
epsilon = 1e-14
def __init__(self, array):
if isinstance(array, numpy.ndarray):
if array.ndim == 2: # If 2D
... |
#!/usr/bin/env python
# coding=utf-8
"""
Data preprocessing functions
| Option | Description |
| ------ | ----------- |
| title | prep.py |
| authors | <NAME>, <NAME>, <NAME> |
| date | 2020-03-18 |
"""
import numpy as np
import copy
import matplotlib.pyplot as plt
import mne
from autor... |
"""
Content Provider: Jamendo
ETL Process: Use the API to identify all CC-licensed audio.
Output: TSV file containing the audio meta-data.
Notes: https://api.jamendo.com/v3.0/tracks/
35,000 requests per month for non-commercial apps
... |
# coding=utf-8
# Copyright 2019 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... |
from typing import Tuple, Dict
import numpy as np
import scipy.optimize
from nanoepiseg.emissions import EmissionLikelihoodFunction
def arraylogexpsum(x):
ret = x[0]
for i in range(1, len(x)):
ret = logaddexp(ret, x[i])
return ret # if ret > -256 else -512
def logaddexp(a, b):
ret = np.lo... |
#!/usr/bin/env python3
# #!/usr/bin/python3
import getopt
import numpy as np
import os
import sys
from os.path import isfile, join, dirname
from scipy import interpolate
import matplotlib.pyplot as plt
from matplotlib import gridspec
import pystella.rf.rad_func as rf
from pystella.model.stella import Stella
from pys... |
from itertools import chain
from collections import OrderedDict
import copy
import numpy as np
import torch
import torch.nn as nn
import torch as F
import torch.optim as optim
from torch.optim import lr_scheduler
from torch.utils.data import DataLoader
from torch.autograd import Variable
from .mlp import Embedding
fr... |
import nnlibrary as nn
from models import *
import data_utils5 as data_utils
import numpy as np
import random
def validation_data_set(lm): # lm is a language model
return lm.validation_proof_steps
def test_data_set(lm):
return lm.test_proof_steps
def training_data_set(lm):
np.random.seed()
return np... |
"""
Modified from StarDist `matching.py`
https://github.com/stardist/stardist/blob/master/stardist/matching.py
"""
from skimage.measure import regionprops
from skimage.draw import polygon
import numpy as np
from scipy.ndimage.measurements import find_objects
from scipy.ndimage.morphology import distance_transform_edt,... |
#!/usr/bin/env python
##
## Copyright (c) 2018 <NAME>.
##
## This file is part of sensorimotor-contingencies
## (see https://github.com/GOAL-Robots/CNRUPD_010618_sensorimotorcontingencies).
##
## Permission is hereby granted, free of charge, to any person obtaining a copy
## of this software and associated documenta... |
"""
Callable objects that generate numbers according to different distributions.
"""
__version__='$Revision: 8943 $'
import random
import operator
from math import e,pi
import param
class NumberGenerator(param.Parameterized):
"""
Abstract base class for any object that when called produces a number.
P... |
"""
author: <NAME> and <NAME>
"""
import numpy as np
import torch.nn as nn
from torch.fft import fft2, fftshift, ifft2, ifftshift
from util.utils import *
import torch.nn.functional as F
from config import getConfig
from modules.conv_modules import BasicConv2d, DWConv, DWSConv
cfg = getConfig()
class F... |
######################################################################
#
# File: b2sdk/sync/policy.py
#
# Copyright 2019 Backblaze Inc. All Rights Reserved.
#
# License https://www.backblaze.com/using_b2_code.html
#
######################################################################
from abc import ABCMeta, abstrac... |
#!/usr/bin/python
#
# Copyright 2010 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 b... |
# -*- coding: utf-8 -*-
""" Module which handles the commenting features """
import random
import emoji
from .time_util import sleep
from .util import update_activity
from .util import add_user_to_blacklist
from .util import click_element
from .util import get_action_delay
from .util import explicit_wait
from .util i... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2020/1/28 14:07
# @Author : ywl
# @Email : <EMAIL>
# @File : commit-msg.py.py
import os
import sys
import re
import json
crc_list = (
0x0000, 0x1021, 0x2042, 0x3063, 0x4084, 0x50a5, 0x60c6, 0x70e7,
0x8108, 0x9129, 0xa14a, 0xb16b,... |
# - * - encoding : utf - 8 - * -
# pylint: disable=fixme, line-too-long
"""
Matrix factorization solver.
:copyright: 2017-2019 H2O.ai, Inc.
:license: Apache License Version 2.0 (see LICENSE for details)
"""
import numpy as np
import scipy
import scipy.sparse
def _get_sparse_matrixes(X):
'''Create csc, csr and ... |
#!/usr/bin/env python3
import argparse
import collections
import hashlib
import itertools
import os
import re
import sys
import statistics
import subprocess
import tempfile
import time
import pprint
import json
from collections import namedtuple
# Argument parser
parser = argparse.ArgumentParser(description="""
C... |
#!/usr/bin/env python
from __future__ import print_function
r"""This script can launch any eval experiments from the paper.
This is a script. Run with python, not bazel.
Usage:
./single_task/run_eval_tasks.py \
--exp EXP --desc DESC [--tuning_tasks] [--iclr_tasks] [--task TASK] \
[--tasks TASK1 TAS... |
from datetime import datetime, timezone
from http import HTTPStatus
from json import dumps, load
from logging import getLogger
from os import environ
from unittest.mock import MagicMock, patch
from mypy_boto3_events import EventBridgeClient
from mypy_boto3_lambda import LambdaClient
from mypy_boto3_sns.type_defs impor... |
import argparse
import os
import queue
import multiprocessing as mp
# import SharedArray as sa
import numpy as np
from copy import deepcopy
from time import time
from pprint import pprint
from utils.data_manipulators import *
from evolution.operators import *
from to.probabilistic_model import ProbabilisticModel
fr... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.