text stringlengths 3.07k 22.1k |
|---|
# 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 app... |
# general libraries
import time
from datetime import datetime
import pandas as pd
# crawling libraries
import urllib.request
from urllib.error import URLError, HTTPError, ContentTooShortError
import itertools
# scraping libraries
from bs4 import BeautifulSoup
from lxml.html import fromstring, tostring
im... |
from datetime import datetime,timedelta
import numpy as np
import json
from urllib.request import urlopen
from html.parser import HTMLParser
import os
# -----------------------------------------------
# General
# -----------------------------------------------
def get_dir(dirname,json_file='input/dirs.json'):
with... |
# Copyright 2013 OpenStack Foundation
# 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 requ... |
import logging
import subprocess
import uuid
import boto3
import os
import json
import sys
import math
import PIL.Image as Image
from botocore.exceptions import ClientError
s3 = boto3.client('s3')
rek = boto3.client('rekognition')
sqs = boto3.client('sqs')
dynamoDBTableName = "metaData"
dynamodb = boto3.resource("dy... |
import argparse
import json
import sys
import Image
from instance import *
from rich.progress import track
import PixivAPI
import complex_image
def update():
download_test = False
response = PixivAPI.get("https://raw.githubusercontent.com/Elaina-Alex/pixiv_crawler/main/update.json")
if not os... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#from __future__ import division, with_statement
'''
Copyright 2013, 陈同 (<EMAIL>).
===========================================================
'''
__author__ = 'chentong & ct586[9]'
__author_email__ = '<EMAIL>'
#=========================================================
de... |
"""Command to assist with reporting DeviantArt users for spam."""
from itertools import combinations
import cli_ui
import daeclipse
def spammer(
username: str,
):
"""Return information and output for spam report helpdesk ticket creation.
Args:
username (str): DeviantArt username to query.
... |
# coding=utf-8
# Copyright 2018 The Google AI Language Team 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 ... |
"""
Multi object tracking results and ground truth
- conversion,
- evaluation,
- visualization.
For more help run this file as a script with --help parameter.
PyCharm debugger could have problems debugging inside this module due to a bug:
https://stackoverflow.com/questions/47988936/debug-properly-with-pycharm-modul... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
import sublime_plugin
import sublime
import sys
import subprocess
import json
PY2 = sys.version_info < (3, 0)
if not PY2: basestring = str
helper = None
mozc_mode_line = ""
mozc_input_mode_line = ""
mozc_highlight_style = ""
mozc_use... |
#!/usr/bin/env python3
import os
import json
import bitcoin
from bitcoin.wallet import P2PKHBitcoinAddress
from bitcoin.core import x
from bitcoin.core import CoreMainParams
from datetime import datetime, timezone
from os import listdir
from os.path import isfile, join
jsonfiles = [f for f in listdir('/var/www/html/js... |
# Copyright (c) 2018, NVIDIA CORPORATION. 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, this list of c... |
import warnings
warnings.simplefilter("ignore", UserWarning)
import pandas as pd
import dill as pickle
import functools
import os
from sklearn.feature_selection import f_regression, mutual_info_regression
from sklearn.mixture import BayesianGaussianMixture as GMM
from scipy.stats import spearmanr, pearsonr
import scipy... |
# Copyright (c) 2016-2020, <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 of conditions and the ... |
# -*- coding: utf-8 -*-
#
# Copyright 2009, 2010 <NAME>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... |
#!/usr/bin/env python
from __future__ import print_function
import sys
import datetime
from os import (sysconf, listdir, rename)
from os.path import (basename, dirname, exists,
isfile, realpath, join as path_join)
from re import (match as re_match,
sub as re_sub)
from fnmatch impor... |
from time import sleep
from math import isnan
import time
import sys
import datetime
import subprocess
import sys
import os
from subprocess import PIPE, Popen
import traceback
import math
import base64
import json
from time import gmtime, strftime
import random, string
import psutil
import base64
import uuid
import soc... |
# -*- coding: utf-8 -*-
# Created on Thu Dec 5 16:49:20 2019
# @author: arthurd
"""
FoRoute Module.
Visualize Map Matching routes on HTML maps.
"""
from matplotlib import collections as mc
import matplotlib.pyplot as plt
import osmnx as ox
import webbrowser
import folium
import numpy as np
import noiseplanet.matc... |
#!/usr/bin/env python
# modules
# ROS stuff and multithreading
import rospy
from geometry_msgs.msg import Twist, Pose2D, PoseStamped
from sensor_msgs.msg import JointState
from nav_msgs.msg import Odometry, Path
from std_msgs.msg import Float32MultiArray
import tf
import numpy as np
import sys
from dynamic_reconfigure... |
import os, re, csv, requests, json
import numpy as np
import pandas as pd
from flags import CONST
from enum import Enum
from tqdm import trange
from bs4 import BeautifulSoup
from util import downloadByURL, downloadIfNotExist
class KEYS(Enum):
# -1 : 아직 라벨링 안함 (default)
# 0 : 개발과 관련없는 문서
# 1 : 개발과 관련있는 문서... |
"""
Module for testing the model_selection.search module.
"""
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import os
import numpy as np
import pytest
from surprise import Dataset
from surprise import Reader
from surprise import SVD
from surprise.model_s... |
""" Train a network."""
import logging
import argparse
# This is a weird hack to avoid Intel MKL issues on the cluster when this is called as a subprocess of a process that has itself initialized PyTorch.
# Since numpy gets imported later anyway for dataset stuff, this shouldn't affect performance.
import numpy as np ... |
"""
mark domains/boundaries with dolfin MeshFunctions
"""
"""
ueberlegungen bzgl. abstraktion:
subdomain numbers werden gebraucht fuer:
-) bilinearformen (masse) --> als tupel
-> jede variable in (v,ionen,wasser) ist mit einem tupel \subset (0,1,2,..) assoziiert
-> diese assoziation ist eine geometrische eigens... |
import io
import cv2
import tensorflow as tf
import numpy as np
import matplotlib.pyplot as plt
from estimation.coordinates import get_coordinates
from estimation.connections import get_connections
from estimation.estimators import estimate
from estimation.renderers import draw
from train_config import *
# find connec... |
import json
from multiprocessing import Pool
from random import randint
from typing import List, Dict, Callable, Any
import numpy as np
import os
from tqdm import tqdm
from pietoolbelt.datasets.common import BasicDataset
from pietoolbelt.pipeline.abstract_step import AbstractStep, DatasetInPipeline, AbstractStepDirR... |
#!/usr/bin/python3
import numpy as np
from matrixll import matrixll
class MLNTopology():
INDEX_INT_TYPE = int
def __init__(self):
# alt: tuple(int), xor, np.array(int), xor: simply an int !
self.layers_shape = [] # : List[int]
# nominal coord system dimensions: e.g. (x,y,ch) (theta,... |
"""
SC101 Baby Names Project
Adapted from <NAME>'s Baby Names assignment by
<NAME>.
YOUR DESCRIPTION HERE
"""
import tkinter
import babynames
import babygraphicsgui as gui
FILENAMES = [
'data/full/baby-1900.txt', 'data/full/baby-1910.txt',
'data/full/baby-1920.txt', 'data/full/baby-1930.txt',
'data/full/... |
"""Shared command functions."""
from __future__ import absolute_import, division, print_function
import difflib
import logging
import os
import sys
from functools import update_wrapper
import click
from pkg_resources import iter_entry_points
from drifter.providers import get_providers
def validate_name(ctx, name)... |
import math
import numpy as np
from random import randint, seed
from copy import deepcopy
from typing import List
from EvaluationUtils.vision_metrics import CVMetrics
from Animator.consolidation_api import CharacterBoundingBox
from Animator.utils import serialize_pickle, deserialize_pickle
seed(1234567)
class Tripl... |
import bleach
from django.conf import settings
from django.contrib.postgres.fields import ArrayField
from django.db import models
from django.db.models import Q
from django.utils.text import Truncator
from loguru import logger
import maya
from feedzero.core.models import SlugifiedMixin
class FeedManager(models.Manag... |
import numpy as np
from pysc2.lib import actions
import tensorflow as tf
def compute_trajectory_loss ( y_true, y_pred ):
combinedLoss = tf.reduce_mean(y_true) - 0 * tf.reduce_mean(y_pred[-1])
return combinedLoss
class Agent():
def __init__(self, envParams ):
self.welcomeStr = 'PLACEHOLDER-AGENT'
... |
#!/usr/bin/env python
"""
Created on March 1, 2016
@author: <NAME>, <EMAIL>, <NAME>, University of Chicago
Use ./CalcP.py -h to see usage
Credit for the arbfit code goes to Nablaquabla
"""
import numpy as np
import matplotlib.pylab as plt
from mpfit import mpfit
VERSION="0.9"
from scipy.stats import kendalltau
from... |
import copy
class TreeNode(object):
def __init__(self, tree, parent, title, string):
self.tree = tree
self.title = title
self.parent = parent
self.string = string
self.children = []
self.adoptive_parents = []
if self in self.tree:
raise ValueErro... |
# ######################################################################
# Copyright (c) 2014, Brookhaven Science Associates, Brookhaven #
# National Laboratory. All rights reserved. #
# #
# Redistribution and use in ... |
import pandas as pd
from rdkit import Chem
import numpy as np
import json
from gensim.models import Word2Vec
from gensim.test.utils import get_tmpfile
from gensim.models import KeyedVectors
from sklearn.manifold import TSNE
import matplotlib.pyplot as plt
import seaborn as sns
import networkx as nx
import re
""" Load ... |
"""This module contains several handy functions primarily meant for internal use."""
from __future__ import division
from datetime import date, datetime, time, timedelta, tzinfo
from calendar import timegm
import re
from pytz import timezone, utc
import six
try:
from inspect import signature
except ImportError: ... |
#!/usr/bin/python3
import collections
import contextlib
import itertools
import logging
import math
import os.path
import re
import json
import sys
import types
from typing import Iterable, List, Tuple
import matplotlib
import numpy as np
from absl import app, flags
import scipy.stats
FLAGS = flags.FLAGS
flags.DEFIN... |
from app import webapp, mysql
from flask import render_template, request, flash, redirect, jsonify, make_response, session, url_for
from .const import ErrorMessages
import os, cv2, json
import MySQLdb.cursors
from werkzeug.security import generate_password_hash, check_password_hash
import pymysql
import boto3
import r... |
from aiida_nanotech_empa.workflows.gaussian import common
from aiida_nanotech_empa.utils import common_utils
from aiida.engine import WorkChain, calcfunction, ExitCode
from aiida.orm import Int, Str, Code, Dict
from aiida.orm import StructureData, RemoteData
from aiida.plugins import WorkflowFactory
GaussianBaseWork... |
# stdlib
from typing import Optional
# third party
from google.protobuf.reflection import GeneratedProtocolMessageType
from nacl.signing import VerifyKey
# syft relative
from .....decorators.syft_decorator_impl import syft_decorator
from .....logger import critical
from .....logger import debug
from .....logger impor... |
import math
import array
import random
import numpy as np
from deap import base
from deap import creator
from deap import tools
from deap.benchmarks.tools import diversity, convergence, hypervolume
class PSO():
def __init__(self, dim, boundary, population=5, gen=1000, minimization=True, func=None):
# POT... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
__author__ = 'Justin'
__mtime__ = '2018-06-02'
"""
import numpy as np
from skimage import color, morphology
from skimage.morphology import square
import os
import pandas as pd
def get_seeds(MaskLow, lowScale, highScale, patch_size_high, spacingHigh, margin = -8):
... |
# -*- coding: utf-8 -*-
'''
Standard Dynamic Energy Budget model
'''
import numpy as np
import pandas as pd
import scipy.integrate as sid
import lmfit
import matplotlib.pyplot as plt
import seaborn as sns
import corner
from tqdm import tqdm
from collections import namedtuple
from lossfunc import symmetric_loss_functio... |
import numpy as np
from itertools import chain, islice, product, repeat, cycle, izip
from fos.actor.surf import CommonSurfaceGroup, IlluminatedSurfaceGroup
from fos.core.world import World
from fos.lib.pyglet.gl import *
from fos.lib.pyglet.graphics import Batch
from fos.core.actor import Actor
from fos.geometry.ve... |
import torch
import torch.nn as nn
from collections import OrderedDict
import numpy as np
from .. import util
class LinearBlock(nn.Module):
def __init__(self, linear_dim, output_dim, init_type='std'):
super().__init__()
modules = []
for i in range(8):
if i == 0:
... |
import itertools
import os
import shutil
from os import path
import pytest
import pytorch_testing_utils as ptu
import torch
from torch import nn
from pystiche import data
from pystiche.image import read_image, write_image
def test_DownloadableImage_generate_file(subtests, test_image_url):
titles = (None, "girl... |
from threading import Lock
from flask import Flask, render_template, session, request, \
copy_current_request_context
from flask_socketio import SocketIO, emit, join_room, leave_room, \
close_room, rooms, disconnect
from keras.models import load_model
import tensorflow as tf
import numpy as np
from vggish_input... |
import pytest
import numpy as np
import sys
if (sys.version_info > (3, 0)):
from io import StringIO
else:
from StringIO import StringIO
from keras_contrib import callbacks
from keras.models import Sequential, Model
from keras.layers import Input, Dense, Conv2D, Flatten, Activation
from keras import backend as... |
# -*- coding: utf-8 -*-
"""Unit tests for classifier base class functionality."""
__author__ = ["mloning", "fkiraly", "TonyBagnall", "MatthewMiddlehurst"]
import numpy as np
import pandas as pd
import pytest
from sktime.classification.base import (
BaseClassifier,
_check_classifier_input,
_internal_conve... |
from pommerman.constants import Action
import numpy as np
class DataAugmentor():
"""
A class that creates new valid state transitions based on the input
transition.
"""
def __init__(self) -> None:
pass
def augment(self, obs: dict, action: Action, reward: float, nobs: dict, d... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Shortest path using Google's ortools TSP solver
"""
import os
import sys
import argparse
import pandas as pd
import numpy as np
from random import randint
from ortools.constraint_solver import pywrapcp
# You need to import routing_enums_pb2 after pywrapcp!
from ort... |
#
# This file is part of GEO Knowledge Hub Package Loader.
# Copyright (C) 2021 GEO Secretariat.
#
# GEO Knowledge Hub Package Loader is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
#
"""Command-Line Interface for GEO Knowledge Hub Pac... |
import torch
from torch import nn
from .utils import EarlyStopping, appendabledict, \
calculate_multiclass_accuracy, calculate_multiclass_f1_score,\
append_suffix, compute_dict_average
from copy import deepcopy
import numpy as np
from torch.utils.data import RandomSampler, BatchSampler
from .categorization imp... |
import argparse
import json
import os
from os import listdir
from os.path import isfile
import shutil
from genson import SchemaBuilder
from enum import Enum
import copy
import flatdict
import pandas as pd
import numpy as np
from collections import OrderedDict
from functools import reduce # forward compatibility for Py... |
from math import pi, cos, sin
from numpy.random.mtrand import uniform
from pydesim import Model
from pycsmaca.simulations.modules import RandomSource, Queue, Transmitter, \
Receiver, Radio, ConnectionManager, WirelessInterface, SaturatedQueue
from pycsmaca.simulations.modules.app_layer import ControlledSource
fro... |
import tensorflow as tf
import numpy as np
K = tf.keras.backend
Optimizer = tf.keras.optimizers.Optimizer
callbacks = tf.keras.callbacks
backend = tf.keras.backend
class AdamW(Optimizer):
def __init__(self, learning_rate=0.001, beta_1=0.9, beta_2=0.999,
amsgrad=False, batch_size=32, total_iterat... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""gui.py
A GUI for the Arduino Due pulsebox.
<NAME> <<EMAIL>>
2021 Quantum Optics Lab Olomouc
"""
import csv
import gi
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk, Gio
import os
import pulsebox.config as pcfg
import pulsebox.events as pev
import p... |
import logging
import os
import pickle
import sys
from functools import partial
from os.path import join, exists, basename, dirname
try:
from typing import Dict
except:
pass
try:
import notify2 as notify
notify.init('Youtube Playlist')
except:
pass
import unicodedata
from youtube_dl import Youtube... |
from webapp import db, login_manager
from datetime import datetime
from werkzeug.security import generate_password_hash, check_password_hash
from flask_login import UserMixin # is_authenticated is_loggedin usw...
@login_manager.user_loader # if user is authenticated, then....
def load_user(user_id):
return Us... |
# Copyright 2018-2021 Xanadu Quantum Technologies 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... |
# -*- coding: utf-8 -*- #
# Copyright 2019 Google LLC. 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 requir... |
from .common import XboxPatch, PatchType
#-----------------------------------------------------------------------------
# M8+ Patch Definitions
#-----------------------------------------------------------------------------
class Patch_HddStartVerify(XboxPatch):
TYPE = PatchType.INLINE
HOOK_ADDRESS = 0x800243A... |
#!/usr/bin/env python
"""
@file createVehTypeDistribution.py
@author <NAME> (Technische Universitaet Braunschweig, Institut fuer Verkehr und Stadtbauwesen)
@author <NAME>
@author <NAME>
@date 2016-06-09
@version $Id$
Creates a vehicle type distribution with a number of representative car-following parameter ... |
#This script accepts a list of urls, applies tuning, & removes redundancies, and outputs the normalized list
import sys, getopt
import os.path
import configparser
import re
#check for duplicates, duplicates with a tailing / and blank entries
def readFromScreen():
print("Enter/Paste URLS, to finish, from a new lin... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Oct 19 13:33:32 2017
@author: saintlyvi
"""
import pandas as pd
import numpy as np
import os
from math import ceil
import colorlover as cl
import plotly.offline as offline
import plotly.graph_objs as go
import plotly as py
offline.init_notebook_mo... |
# Original file: se.py:
#
# Copyright (c) 2012-2013 ARM Limited
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware imple... |
#!/usr/bin/env python3
from collections import OrderedDict
from cimodel.data.pytorch_build_data import TopLevelNode, CONFIG_TREE_DATA
import cimodel.data.dimensions as dimensions
import cimodel.lib.conf_tree as conf_tree
import cimodel.lib.miniutils as miniutils
import cimodel.lib.visualization as visualization
from... |
# Copyright 2020 Pax Syriana Foundation. Licensed under the Apache License, Version 2.0
#
#
import datetime as dt
import os
import traceback
from flask import Blueprint
from flask import current_app
from flask import flash
from flask_babel import lazy_gettext as _l
from flask_login import current_user
from flask_lo... |
import asyncio
import datetime
from io import BytesIO
import logging
import os
import re
import sys
import grpc
from . import service_pb2
from . import service_pb2_grpc
from .grpc_asyncio import AsyncioExecutor
from ..nodes import NodeManager, NodeExpired, AnonymousNodeDisabled
from .. import nodes
fro... |
# -*- coding: utf-8 -*-
"""This module provides the base classes for pyflamestk."""
__author__ = "<NAME>"
__copyright__ = "Copyright (C) 2016,2017"
__license__ = "Simplified BSD License"
__version__ = "1.0"
import copy, subprocess
import numpy as np
class Atom(object):
"""description of an atom"""
def __init_... |
import os
import subprocess as sp
import time
from pathlib import Path
import discord
from discord import embeds
from discord.ext import commands
async def create_paginator(bot, ctx, pages):
msg = await ctx.send(embed=pages[0])
for reaction in ["⏮️", "◀️", "⏹️", "▶️", "⏭️"]:
await msg.add_reaction(r... |
import argparse
import concurrent.futures
import contextlib
import platform
import shlex
import subprocess
from pathlib import Path
from typing import Any
from typing import Callable
from typing import List
from typing import TYPE_CHECKING
from typing import TypeVar
if TYPE_CHECKING:
from typing import NoReturn
im... |
import numpy as np
def Ent_MS_Plus20201001(x, tau, m, r):
"""
(RCMSE, CMSE, MSE, MSFE) = RCMS_Ent( x, tau, m, r )
inputs - x, single column time seres
- tau, greatest scale factor
- m, length of vectors to be compared
- R, radius for accepting matches (as a proportion of th... |
from calendar import monthrange
from datetime import date
from flask import abort, Blueprint, flash, Markup, redirect, render_template, request, session, url_for
from sqlalchemy.orm.exc import NoResultFound
from app import app, db
from app.users.decorators import login_required
from .forms import TicketSearchForm, Ti... |
#!/usr/bin/env python
# Following along with: https://www.learnopencv.com/pytorch-for-beginners-semantic-segmentation-using-torchvision/
# Generated by https://traingenerator.jrieke.com/
# Before running, install required packages:
# pip install numpy torch torchvision pytorch-ignite
from pathlib import Path
import ... |
# Copyright (c) 2021, Frappe Technologies and contributors
# For license information, please see license.txt
from json.encoder import JSONEncoder
import datetime
import requests
from datetime import timedelta
from dateutil import parser
import frappe
from frappe import _
from frappe.model.document import Document
fro... |
#!/usr/bin/env python
import cv2
from matplotlib.widgets import Cursor
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
import subprocess
import random
import matplotlib.patches as patches
coefficient = 1.5 # modify for your resolution, e.g. 1280 to 1920 is x1.5, 1920 to 1920 is x1.0
click_data = []
... |
# 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, software
# distr... |
# coding: utf-8
import logging
import re
import urllib
from django.contrib.auth.mixins import LoginRequiredMixin
from django.http import JsonResponse
from django.views import generic
from django.shortcuts import render, redirect, get_object_or_404
from django.urls import reverse
from django.db.models import QuerySet
... |
# -*- coding: utf-8 -*-
import os
import asyncio
import pickle
from copy import deepcopy
from typing import Any, Optional, Union
from grpc.aio import ServicerContext
from recc.argparse.config.task_config import TaskConfig
from recc.argparse.default_namespace import get_default_task_config
from recc.argparse.injection_... |
#!/usr/bin/env python
"""
Custom functions for identifiability analysis to calculate
and plot confidence intervals based on a profile-likelihood analysis. Adapted
from lmfit, with custom functions to select the range for parameter scanning and
for plotting the profile likelihood.
"""
from collections import Ordere... |
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
import numpy as np
import pdb
class Model(nn.Module):
r"""Spatial temporal graph convolutional networks.
Args:
in_channels (int): Number of channels in the input data
num_class (int): Number... |
import numpy as np
from scipy.signal import stft, istft
from scipy.io import wavfile
from Crypto.Cipher import AES
from Crypto.PublicKey import RSA
from Crypto.Signature import pkcs1_15
from Crypto.Hash import SHA256
from Crypto.Util.Padding import pad, unpad
from Crypto.Util.strxor import strxor
import random
import s... |
#coding: utf-8
import re
from django.db.models import Q
from django.db import models
from django.conf import settings
from django.core import validators
from accounts.localflavor.br.br_states import STATE_CHOICES
from django.contrib.auth.models import (AbstractBaseUser, PermissionsMixin, UserManager)
cl... |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import... |
from __future__ import annotations
import itertools
import logging
import math
import re
from collections import Counter
from itertools import combinations, starmap
from typing import Dict, Iterable, List, TextIO, Tuple
import networkx as nx
import numpy as np
import numpy.typing as npt
from networkx.drawing.nx_pydot... |
# Copyright lowRISC contributors.
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
# SPDX-License-Identifier: Apache-2.0
r"""Contains life cycle state encoding class which is
used to generate new life cycle encodings.
"""
import logging as log
import random
from collections import OrderedDict
... |
import sys
import os
import warnings
import importlib
from importlib.util import find_spec
def import_module(name, package=None):
return importlib.import_module(name, package=package)
def import_string(import_name, package=None, *, silent=False):
"""Imports an object or module based on a string.
"""
try:
ret... |
'''Functions to calculate substrate thermal noise
'''
from __future__ import division, print_function
import numpy as np
from numpy import exp, inf, pi, sqrt
import scipy.special
import scipy.integrate
from .. import const
from ..const import BESSEL_ZEROS as zeta
from ..const import J0M as j0m
def substrate_thermor... |
# Sample code from the TorchVision 0.3 Object Detection Finetuning Tutorial
# http://pytorch.org/tutorials/intermediate/torchvision_tutorial.html
import os
import numpy as np
import torch
import random
import json
import argparse
from PIL import Image
import cv2
from alfworld.agents.detector.engine import train_one_... |
import arabic_reshaper
import itertools
import math
import matplotlib.pyplot as plt
import numpy as np
import os
import seaborn as sns
import sys
import warnings
from bidi.algorithm import get_display
from matplotlib import rc
from matplotlib.backends import backend_gtk3
from iran_stock import get_iran_stock_network
... |
'''
Merge a set of SAM files.
The selection rule is Alignment Score (AS) > Mapping Quality (MAPQ)
If a read is aligned with same AS and same MAPQ in the provided SAM files,
it is assigned based on user-provided tie-breaking rule:
(1) always use first SAM record
(2) always use second SAM record
(3) randoml... |
import numpy as np
import pandas as pd
import re
import datetime
from datetime import datetime, timedelta
import pandas as pd
import plotly.express as px
import plotly.graph_objects as go
# dplyr-style for python
from dppd import dppd
dp, X = dppd()
import itertools
_DEFAULT_TIME_SCALE = 12 * 3 * 31 # 36 months
... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from queue import Queue
from pathlib2 import Path
from threading import Thread
from functools import partial
import cv2
import numpy as np
from data.augmentations import AugmentationBase, Resize
class Prod... |
from abc import ABC, abstractmethod
from PIL import Image, ImageTk
from riem.debug import Debug, DebugChannel
from riem.graphics import Align, Graphics, ImageLoader, Menu
from riem.input import Action, Controller, Keyboard
from riem.library import ArrayList, Dimensions, Point
from riem.version import __version__
from t... |
#!/usr/bin/env python
import sys, os
import pandas as pd
import numpy as np
from scipy import stats as sts
import statsmodels.api as sm
import statsmodels.formula.api as smf
from statsmodels.stats.multitest import fdrcorrection
def paule_mandel_tau(eff, var_eff, tau2_start=0, atol=1e-5, maxiter=50):
tau2 = tau2_s... |
##################################################
# Copyright (c) <NAME> [GitHub D-X-Y], 2020 #
###################################################################
# BOHB: Robust and Efficient Hyperparameter Optimization at Scale #
# required to install hpbandster ##################################
# pip install hpban... |
import argparse
import time
import numpy as np
import networkx as nx
import json
from sklearn.utils import check_random_state
import zmq
from . import agglo, agglo2, features, classify, evaluate as ev
# constants
# labels for machine learning libs
MERGE_LABEL = 0
SEPAR_LABEL = 1
class Solver:
"""ZMQ-based inter... |
import datetime
from flask import Flask
from flask import g
from flask import redirect
from flask import request
from flask import session
from flask import url_for, abort, render_template, flash
from functools import wraps
from hashlib import md5
import peewee # Let's be explicit
from peewee import *
import json
fro... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.