text stringlengths 3.07k 22.1k |
|---|
#!/usr/bin/env python
#
# Copyright (C) 2013-2016 DNAnexus, Inc.
#
# This file is part of dx-toolkit (DNAnexus platform client libraries).
#
# 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 a... |
import os
import pathlib
import tqdm
import cv2 as cv
import numpy as np
import tensorflow as tf
from tensorflow.keras import *
import matplotlib.pyplot as plt
import tensorflow.keras as keras
import utils
def return_inputs(inputs):
"""Returns the output value according to the input type, used for ... |
#!/usr/bin/env python
# coding: utf-8
from dataclasses import dataclass
import numpy as np
# initially in a biaxial weave intersection sites are encoded numerically:
# 1 = warp is absent
# 2 = weft is absent
# 3 = both threads are absent
# 4 = weft is on top
# 5 = warp is on top
# this dictionary translates these... |
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
# Copyright 2020-2021 <NAME>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#... |
#!/usr/bin7env python
import numpy as np
import itertools
from modshogun import Factor, TableFactorType, FactorGraph
from modshogun import FactorGraphObservation, FactorGraphLabels, FactorGraphFeatures
from modshogun import FactorGraphModel, GRAPH_CUT
from modshogun import GraphCut
from modshogun import StochasticSOS... |
# -*- coding: utf-8 -*-
"""
Created on Fri Jan 28 20:32:25 2022
@author: brili
"""
import cv2
from time import time
import numpy as np
import sys
import os
curr_dir = os.path.dirname(os.path.abspath(__file__))
trt_main_complete_path = os.path.join(curr_dir, '..', '..', 'understand_trt_complete', 'tensorrt_expl_compl... |
import asyncio
import certifi
import json
import os
import platform
import subprocess
from enum import IntEnum
from azure.iot.device import X509
from azure.iot.device import Message, MethodResponse
from azure.iot.device.aio import IoTHubDeviceClient
from azure.iot.device.aio import ProvisioningDeviceClient
... |
import os
import shutil
import json
import stat
import pathlib
import multiprocessing
import itertools
import pathlib
import re
import fnmatch
from urllib.parse import urlparse
from functools import lru_cache
from pbpy import pblog
from pbpy import pbconfig
from pbpy import pbtools
missing_version = "not installed"
... |
#!/usr/bin/env python
from __future__ import print_function
import argparse
import csv
import errno
import json
import logging
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import multiprocessing as mp
import numpy as np
import os
from PIL import Image
import shutil
import subprocess
#######... |
import os
import logging
import cv2
import numpy as np
import json
from typing import List, Tuple, Dict
from functools import lru_cache
from openpilot.models.lane_detect.base_lines import LanesBase
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)
class TrainLanesCULane:
"""Const... |
import os
import sys
import os.path
from optparse import make_option
from fabricate import main, run, shell, autoclean
# Core Executables
# ================
# We satisfy dependencies using local tarballs, to ensure that we can build
# without a network connection. They're kept in our repo in ./vendor.
ASPEN_DEPS = [
... |
from aioify import aioify
from discord.ext import commands, tasks
import aiohttp
import aiosqlite
import asyncio
import discord
import json
import os
class Events(commands.Cog):
def __init__(self, bot):
self.bot = bot
self.os = aioify(os, name='os')
self.utils = self.bot.get_cog('Utils')
self.auto_clean_db.s... |
#!/usr/bin/env python
from __future__ import print_function
import sys
import math
import cPickle
from os.path import split
from PIL import Image, ImageDraw, ImageFont
from coverage import coverage
cov = coverage()
cov.load()
total_statements = 0
total_missing = 0
total_files = 0
total_covered = 0
coverage_data = ... |
# -*- coding: utf-8 -*-
"""
====================================================================
Compute statistics from companies's data after complete and check it
====================================================================
Coding Rules:
- Snake case for variables.
- Only argument is configuration file.
- ... |
# Copyright 2021 AI Redefined Inc. <<EMAIL>>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed ... |
#! python
###############################################################################
# Copyright (c) 2011-2013, Pacific Biosciences of California, Inc.
#
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following condition... |
from __future__ import annotations
from datetime import date
# This is a globally used dict that binds Item classes to their names.
# It should remain empty, as the classes register themselves here.
classByString = {}
class Blueprint(object):
"""Blueprint is an abstraction of a property that an Item might have.
... |
# -*- coding: utf-8 -*-
"""
@author: <NAME>
"""
import pandas as pd, numpy as np, yfinance as yf
pd.options.mode.chained_assignment = None
N = 14 # Number of Periods for Indicator Parameters
N1 = 8 # Fast Period for MACD
## Pre COVID Backtest
# start_date = '2016-01-01'
# end_date = '2019-12-31'
# durati... |
import multiprocessing
import os
import cv2 as cv
import numpy as np
import tensorflow as tf
from tensorflow.python.client import device_lib
from config import grid_h, grid_w
def ensure_folder(folder):
if not os.path.exists(folder):
os.makedirs(folder)
# getting the number of GPUs
def get_available_gp... |
"""
DEPRECATED: These classes were designed earlier on to assist in running tests, however you should now use the "mock" module instead.
The mock module provides powerful tools for patching classes and methods without having to access the mocked object directly.
This allows us to avoid designing ways to pass mock objec... |
import numpy as np
#Xtrain = np.load('Xpre.npy')[:100]#, dtype='float32', mode='r', shape=(6400, 128, 128, 3))[:100]#np.load('cityXi.npz')['x_train']
#Ytrain = np.load('Ypre.npy')[:100]#, dtype='uint8', mode='r', shape=(6400, 128, 128, 20))[:100]#np.load('cityYi.npz')['y_train']
#Xvalid = np.load('Xvalid.npy')[:100]#, ... |
# Imports
import os
import re
import sys
import requests
import json
import time
from pathlib import Path
from bs4 import BeautifulSoup
call_api = True
def read_to_line_end(input_str, pos):
"""Builds a string from a position to the end of the line
and returns the result.
Parameters
----------
inp... |
#!/usr/bin/env python3
from argparse import ArgumentParser
import os.path
import sys
scripts_path = os.path.dirname(os.path.realpath(__file__))
bb_lib_path = os.path.abspath(scripts_path + '/../../poky/bitbake/lib')
sys.path = sys.path + [bb_lib_path]
import bb.fetch2
import bb.tinfoil
PRINT_PROGRESS = True
SKIP_B... |
import argparse
import logging
import os
import time
import sys
import apex.amp as amp
import numpy as np
import torch
import torch.nn as nn
import torch.backends.cudnn as cudnn
import torch.nn.functional as F
import torchvision.models as models
from preact_resnet import PreActResNet18
from utils import *
# IMPORT W... |
import json
import logging
import pickle
from pathlib import Path
import numpy as np
import torch
from yolo import boundingbox
class Config(object):
"""
"""
__slots__ = (
"net_config",
"net_weight",
"version",
"train_root",
"val_root",
"trainval_root",
... |
import pytest
import os
import fnmatch
import tarfile
import numpy as np
import dask
from contextlib import contextmanager
import py
import tempfile
import hashlib
try:
import urllib.request as req
except ImportError:
# urllib in python2 has different structure
import urllib as req
from xmitgcm.file_utils ... |
"""Rudimentary versioning system for Google App Engine and Cloud Datastore."""
from datetime import datetime
from google.appengine.ext import db
from catnado.properties.key_property import KeyProperty
from catnado.properties.pickle_property import PickleProperty
ERROR_MISSING_VERSION_UNIFIER = 'Missing VersionUnif... |
# Recipe planning
from gym_cooking.recipe_planner.stripsworld import STRIPSWorld
import gym_cooking.recipe_planner.utils as recipe_utils
from gym_cooking.recipe_planner.utils import *
# Delegation planning
from gym_cooking.delegation_planner.bayesian_delegator import BayesianDelegator
# Navigation planner
from gym_co... |
from typing import Dict, List, Optional, TypedDict
import numpy as np
from PIL import Image
from torch import optim
from torch import nn
from tqdm import tqdm
from . import image_utils as imu
from . import basic_utils as bu
from . import funcs as fn
from . import model_utils as mu
from . import denoising_utils as du
... |
# 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... |
"""Unit tests for the keyword only argument specified in PEP 3102."""
__author__ = '<NAME>'
__email__ = 'seo<EMAIL> at <EMAIL> dot <EMAIL>'
import unittest
def posonly_sum(pos_arg1, *arg, **kwarg):
return pos_arg1 + sum(arg) + sum(kwarg.values())
def keywordonly_sum(*, k1=0, k2):
return k1 + k2
def keywor... |
import tensorflow as tf
from tensorflow.python.keras import activations
from tensorflow.python.keras import initializers
from tensorflow.python.keras import regularizers
from tensorflow.python.keras import constraints
from tensorflow.python.keras import backend as K
from tensorflow.python.framework import tensor_shape... |
# container-service-extension
# Copyright (c) 2021 VMware, Inc. All Rights Reserved.
# SPDX-License-Identifier: BSD-2-Clause
import re
import pyvcloud.vcd.client as vcd_client
from pyvcloud.vcd.exceptions import EntityNotFoundException
import pyvcloud.vcd.gateway as vcd_gateway
from pyvcloud.vcd.vdc import VDC
import... |
"""distutils/setuptools extension."""
# python
import os
import os.path
import sys
import subprocess
import glob
import re
import shlex
# (from sklearn) import setuptools before because it monkey-patches distutils
from setuptools import Extension as stExtension
import distutils
from distutils import ccompiler, unixcc... |
# -*- coding: utf-8 -*-
import os
import time
from logging import getLogger
import numpy as np
import pandas as pd
from PIL import Image as PILImage
from ..bundle import *
from ..container import *
from ..elements import *
from ..components import *
__all__ = [
'demo_report', 'demo_loss_accuracy_curve',
]
def ... |
"""Little script to save weights from saved model.
Author: <NAME>
"""
from keras.models import load_model
from cbrain.imports import *
from keras.utils.generic_utils import get_custom_objects
metrics_dict = dict([(f.__name__, f) for f in all_metrics])
get_custom_objects().update(metrics_dict)
import h5py
import os, s... |
#!/usr/bin/env python
#==============================================================================
#
# FILE: IO.py
#
# USAGE: import IO (from hib.py)
#
# DESCRIPTION: graphing and file i/o routines.
#
# UPDATES: 170213: added subset() function
# 170214: added getfold... |
from django import forms
from django.forms import ModelForm, ValidationError, ClearableFileInput
from django.http import HttpResponseRedirect
from django.template.response import TemplateResponse
from django.contrib.auth import views as auth_view
from django.contrib.auth.forms import AuthenticationForm, PasswordResetFo... |
from .core.typing import Any, Dict, List, Optional, Iterator, Tuple
from .core.settings import Settings
from .core.workspace import ProjectFolders
from .core.configurations import create_window_configs
from .core.sessions import Session
# from .core.windows import nop
from .core.types import config_supports_language_id... |
# BSD-3-Clause License
#
# Copyright 2017 Orange
#
# 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 followi... |
import time, urllib, yaml, datetime, logging, json
import requests
import schedule
from pytz import timezone
from pathlib import Path
from models import Show, Movie, Track
from utils import aprint, DATA_PATH
config_file = Path(DATA_PATH + '/config.yml')
def get_datetime(datetime_str):
return datetime.datetime.str... |
# This file is part of the Ingram Micro CloudBlue Connect SDK.
# Copyright (c) 2019 Ingram Micro. All Rights Reserved.
# Developed following the instructions here:
# https://support.sonatype.com/hc/en-us/articles/213465868?_ga=2.230043868.1594253912.1579542012-1885361292.1578410493
import os
import time
from xml.etre... |
# This iterates though the raw HTML files downloaded from
# Classie-Evals parses them into JSON files
from bs4 import BeautifulSoup
import re
import json
import os
def main():
fileName = 'Parsed Data/courseData '
fileType = '.json'
batchSize = 500
writeFile = open(fileName + '0' + fileType, 'w+')
for num, read... |
# -*- coding:utf-8 -*-
__author__ = 'Randolph'
import os
import multiprocessing
import gensim
import logging
import json
import numpy as np
from pylab import *
from gensim.models import word2vec
TEXT_DIR = '../data/content.txt'
METADATA_DIR = '../data/metadata.tsv'
def logger_fn(name, file, level=logging.INFO):
... |
import nussl
from torch import nn
import torch
from .... import AudioSignal
class FilterBank(nn.Module):
"""
Base class for implementing short-time filter-bank style transformations
of an audio signal.
This class accepts two different tensors, as there are two modes it can
be called in:
... |
import bw2data as bd
import numpy as np
from scipy.stats import norm
import stats_arrays as sa
# Local files
from .constants import air_molecular_weight, atmosphere_total_mass, substances_data
def get_uncertain_flows(time_horizon=100, verbose=False):
method = ('IPCC 2013', 'climate change', 'GWP {}a'.format(t... |
import pandas as pd
import seaborn as sns
import numpy as np
import matplotlib.colors as colors
import matplotlib.patheffects as path_effects
from mpl_toolkits.axes_grid1.inset_locator import inset_axes
from mpl_toolkits.axes_grid1 import make_axes_locatable
from mapclassify import FisherJenks
from aves.visualization.c... |
import logging
import os
from typing import NamedTuple, Optional
import numpy as np
from delft.sequenceLabelling.evaluation import (
f1_score,
accuracy_score,
precision_score,
recall_score
)
from delft.sequenceLabelling.trainer import Trainer as _Trainer
from delft.sequenceLabelling.trainer import Sc... |
import time
import typing
from functools import wraps
from typing import Optional, Union, Callable
if typing.TYPE_CHECKING:
from jina.logging.logger import JinaLogger
from jina import __windows__
from jina.helper import get_readable_size, get_readable_time, colored, get_rich_console
from rich.progress import (
... |
from mapping_classes import MapperClass, InputClassCSVRealization, OutputClassCSVRealization, \
build_input_output_mapper, RunMapperAgainstSingleInputRealization
import time
import csv
import os
import json
import logging
import re
import datetime
import sys
import pytz
from dateutil.parser import parse
class Lef... |
# msp430 instruction table
import utils
import msp_instr as instr
import msp_addr as addr
import msp_fmt1
import msp_fmt2
import msp_jump
fmt1_name = 'fmt1'
fmt1 = {
'fields' : {
'rdst' : (0, 3, ),
'as' : (4, 5, ),
'bw' : (6, 6, ),
'ad' : (7, 7, ),
'rsrc' : (8, 1... |
# (c) <NAME>. GPL licensed, see LICENSE.rst.
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import unicode_literals
import numpy as np
import logging
try:
import pyproj
except ImportError:
pyproj = None
try:
from osgeo import osr
except ImportError:
osr = None
try:
... |
import json
import os
import requests
from django.contrib.auth.hashers import check_password, make_password
from django.core import signing
from .find_error import Data, correct_statis, error_statis
from .models import *
from .utils import *
'''
目前是把所有的接口都放在这
但是为了方便管理和维护,以及更好的逻辑
可以多弄几个app 使每个app的功能更加细化
当然要记得同时更改前端请求... |
# -*- encoding:utf-8 -*-
"""
交易可视化模块
"""
from __future__ import print_function
from __future__ import absolute_import
from __future__ import division
import copy
import logging
import matplotlib.pyplot as plt
import numpy as np
import seaborn as sns
from ..CoreBu import ABuEnv
from ..UtilBu import ABuDateUtil
f... |
import torch
import numpy as np
import networkx as nx
import torch.nn.functional as F
from collections import Counter
from autodesk_colab_KG import load_data
from torch_geometric.data import DataLoader, Data
from sklearn.model_selection import train_test_split
def get_vocab():
graphs = load_data('../data/autodesk... |
import requests
import json
from bs4 import BeautifulSoup
# Code for acquiring tuple below.
def get_course_codes():
page = requests.get('https://www.sis.itu.edu.tr/TR/ogrenci/lisans/onsartlar/onsartlar.php')
soup = BeautifulSoup(page.text, 'html.parser')
options = soup.find_all('option')
course_codes ... |
import argparse
# import logging
import math
import time
from functools import partial, reduce
import jax
import jax.numpy as jnp
from e3nn_jax import FunctionalFullyConnectedTensorProduct, Irreps, IrrepsData
# logging.basicConfig(level=logging.DEBUG)
# https://stackoverflow.com/a/15008806/1008938
def t_or_f(arg):
... |
from __future__ import division
import logging
import numpy as np
from bokeh.models.widgets import Slider
from bokeh.models import ColumnDataSource, PrintfTickFormatter
from bokeh.plotting import Figure
from bokeh.io import curdoc
from bokeh.layouts import column
import mandel
import mandel_colormap
import mandelbro... |
from __future__ import absolute_import
from sc2reader.exceptions import ParseError, ReadError
from sc2reader.objects import *
from sc2reader.parsers import *
from sc2reader.utils import AttributeDict, LITTLE_ENDIAN
class InitDataReader(object):
def __call__(self,buffer, replay):
# The first block of the r... |
#!/usr/bin/env python3
import os
import re
import requests
import time
import yaml
from collections import OrderedDict
from colorama import Fore
from fnmatch import fnmatch
from graphlib import CycleError, TopologicalSorter
from runfile.code_block import CodeBlock
from runfile.exceptions import TargetNotFoundError, \
... |
from django.conf import settings
from django.db import transaction
from django.utils.translation import ugettext_lazy as _
from django.utils import timezone
from .models import (
Account, Card, Purchase, PurchaseItem, WalletLogEntry
)
from utils.exceptions import InvalidTransition
from foobar.wallet import api as w... |
from math import pi, sqrt
from scipy.special import dawsn
import numpy as np
def is_PD(A):
try:
np.linalg.cholesky(A)
return True
except np.linalg.LinAlgError:
return False
# Find the nearest positive-definite matrix
def nearest_PD(A):
# based on
# <NAME... |
#!/usr/bin/env python
#
# Anomaly detection using tensorflow and tshark
# Supervised learning using neural network classifier
#
# Copyright 2020, H21 lab, <NAME>
# All the content and resources have been provided in the hope that it will be useful.
# Author do not take responsibility for any misapplication of it.
#
# ... |
""" A set of probabilistic, lexicon-building algorithms for word segmentation """
from numpy import log2
from wordseg import utils
from segmenter.model import Model
from segmenter.lexicon import Lexicon
from segmenter.phonestats import PhoneStats
from segmenter.phonesequence import PhoneSequence
MODEL_TYPES = ["lm"... |
import os
import sys
import itertools
import numpy as np
import pandas as pd
import scipy.stats as stats
from goatools.obo_parser import GODag
def corr(x, y):
"""
Calculate Corr for x vs y.
Robust to NaNs and infs, returns nans if input doesn't contain values
:param x: input x
:param y: input y
... |
from functools import partial
from typing import Callable
import google_benchmark as benchmark
import jax
import jax.numpy as jnp
from absl import flags
from jax.config import config
from spax.linalg import eigh_jvp
from spax.linalg import subspace_iteration as si
from spax.types import ArrayOrFun
from grax.graph_uti... |
import random
import numpy as np
import torch
from PIL import Image
from torch.utils.data import DataLoader
from torch.utils.data.sampler import SubsetRandomSampler
from torch.utils.data import Sampler
from torchvision import datasets, transforms
import collections
class SubsetRandomSampler(Sampler):
r"""Samples ... |
# Copyright 2009-2017 <NAME>.
# This program is distributed under the MIT license.
'''Defines various tools related to importing.'''
import sys
import os.path
import imp
import zipimport
import functools
try:
import pathlib
except:
from combi._python_toolbox.third_party import pathlib
from combi._python_too... |
from django.shortcuts import render, redirect
from django.http import JsonResponse
import json
import datetime
from django.contrib.auth import authenticate, login, logout
from django.contrib import messages
from django.core.mail import send_mail
from django.contrib.auth.forms import UserCreationForm
from django.conf ... |
'''
This example of a COACH algorithm integrated with HIPPO Gym has been adapted from
code provided by <NAME> of the Intelligent Robot Learning Laboratory.
Note to use this code with the default setup simply rename this file to agent.py
'''
import gym
import time
import numpy as np
import itertools
#This is the code... |
#! /usr/bin/env python3
import atexit
import os
import shutil
import subprocess
import tempfile
import time
import unittest
from bitcoinrpc.authproxy import AuthServiceProxy, JSONRPCException
from hwilib.commands import process_commands
def start_bitcoind(bitcoind_path):
datadir = tempfile.mkdtemp()
bitcoind... |
"""Test bench for the Verilog module 'nt_gen_rate_ctrl'."""
# The MIT License
#
# Copyright (c) 2017-2019 by the author(s)
#
# 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 restrictio... |
import numpy as np
import cv2
import os
import subprocess
import glob
import tensorflow as tf
from options.test_options import TestOptions
from net.model import Blindinpaint_model
from util.util import generate_mask_rect, generate_mask_stroke
import time
os.environ['CUDA_VISIBLE_DEVICES'] = str(np.argmax([int(x.split... |
from __future__ import absolute_import
from __future__ import print_function
import os
import sys
import keras
import wandb
from wandb.keras import WandbCallback
from collections import Counter
import json
import numpy as np
import utils as ut
np.seterr(all='raise')
sys.path.append('../tool')
import toolkits
# ===... |
import pickle
from scipy.sparse import dok_matrix
from gensim.corpora import Dictionary
from keras.models import Sequential
from keras.layers import Dense
from keras.regularizers import l2
import shorttext.utils.kerasmodel_io as kerasio
from shorttext.utils import tokenize
from shorttext.utils import gensim_corpora ... |
#!/usr/bin/env python3
"""
---===[ imagej_rois_to_nifti: radiomics-tools ]===---
Created on June 27, 2021
Copyright 2021 - <NAME> and <NAME>
Converts a stack of DICOM images and Rasterizes a sequence of ImageJ-drawn contours for a stack of 2D DICOM images. The corresponding stack of 2D masks
is saved as a NIfTI1 .n... |
import django_excel as excel
from django.shortcuts import render, redirect
from .models import ScoreSheet, Mouse, User, MouseSet
from django.http import HttpResponseRedirect, HttpResponse, HttpResponseBadRequest
from django import forms
from .serializers import slugify
import pyexcel as pe
import pyexcel.constants as c... |
import numpy as np
import matplotlib.pyplot as plt
from ipywidgets import interact
import ipywidgets as widgets
from sklearn.model_selection import learning_curve
from sklearn.model_selection import ShuffleSplit
from skimage.filters import gaussian
import matplotlib.patches as patches
def convert_view(img):
# Feat... |
"""
Copyright (C) Cortic Technology Corp. - All Rights Reserved
Written by <NAME> <<EMAIL>>, 2021
Implementation reference:
https://github.com/luxonis/depthai-experiments/tree/master/gen2-gaze-estimation
"""
from curt.modules.vision.oakd_processing_worker import OAKDProcessingWorker
from curt.modules.vision.util... |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from fairseq.models.nat import NATransformerModelBase
from fairseq.models import register_model, register_model_architecture
from fairseq imp... |
# -*- coding: utf-8 -*-
"""
Created on Wed Jun 9 15:53:52 2021
@author: jhui
"""
import pyodbc
import pandas as pd
import numpy as np
import jellyfish
import time
import threading
import queue
import urllib
from sqlalchemy import create_engine
# Import data from sql
# Parameters
server = 'vhkpdsq... |
from functools import total_ordering
from django.db.models import signals
from django.db.models.fields import BLANK_CHOICE_DASH
from django.conf import settings
from django.forms import fields as form_fields
from django.db.models.options import Options
from django.core.exceptions import ValidationError
from neomodel ... |
import pymodm.errors
from flask import Flask, request, jsonify
from pymodm import connect, MongoModel, fields
import ssl
import base64
import ssl
import pymongo
import pandas as pd
from ecg_analysis import read_csv
import io
import matplotlib.image as mpimg
from matplotlib import pyplot as plt
# from skimage.io import ... |
# -*- coding: utf-8 -*-
# @Time : 2019/3/20 13:21
# @Author : LunaFire
# @Email : <EMAIL>
# @File : facerecognition.py
import os
import cv2
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.patches as patches
from sklearn.preprocessing import LabelEncoder
from sklearn.neighbors import KNei... |
import os
import time
import argparse
import json
import torch
from torch.utils.data import DataLoader
from model.tacotron import Tacotron, TacotronLoss
from model.tacotron2 import Tacotron2, Tacotron2Loss
from utils.dataset import TextMelDataset, TextMelCollate
from utils.logger import TacotronLogger
from utils.util... |
###
# (C) Copyright (2012-2017) Hewlett Packard Enterprise Development LP
#
# 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 u... |
#!/usr/bin/env python
# Using Python 2
"""
This GUI code can send the following commands to the Pod.
All commands are prefaced by 35 's' characters... for reasons
- E-brake
'stop'
[- Reset Board
'reset'] -> Deprecated
- Set Time
'time' 'n' n being time in seconds
- Send Command
'cmd' 's' s being a ... |
#!/usr/bin/python
# -*- coding: UTF-8 -*-
import os
import platform
import socket
import string
import struct
import sys
import time
import random
import datetime
# 依照source格式生成随机数据
source = "begin_time='2016-11-30 13:36:34' end_time='2016-11-30 13:36:36' alive_time=2 src_mac=265F10E90700 " \
"dst_mac=6BB5... |
#!/usr/bin/env python
#
# 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 RethinkDB_Queries as r
import CSV_Download as d
import CSV_Read as csv
import json
from math import cos, asin, sqrt, pi
import rethinkdb as rdb
from flask import Flask, g, render_template, make_response, request, redirect, url_for, jsonify
from flask_socketio import SocketIO, send, emit
from threading import Th... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
This file implements all the template features that are expressible with Python native types.
The validation scheme is the following:
- str: string
- int: integer
- float: float
- bool: boolean
- list: array
- dict: sub-object
- set of types... |
from pipeline import util
import logging
from osgeo import gdal, ogr
import os
import dotenv
from azure.storage.blob.aio import ContainerClient
import itertools
from tqdm import tqdm
from urllib.parse import urlparse
dotenv.load_dotenv()
gdal.UseExceptions()
#sas_url='https://undpngddlsgeohubdev01.blob.core.windows.ne... |
#!/usr/bin/env python3
#
# SPDX-FileCopyrightText: 2020 <NAME>
# SPDX-License-Identifier: GPL-3.0-or-later
#
# Show the translation progress for each language in Forecastie. All languages
# are compared to English which is considered the original language of the
# program.
#
# Each translatable string is put in one of ... |
"""The module mapping provides facilities for mapping the cosmological
constants and functions used by one body of code to another. This is done by
defining one of the codes (pyccl) as being the 'standard', and for all other
supported code, providing functions from_ccl and to_ccl.
The supported codes include:
pycc... |
"""
Phase-shifting VU factorization.
.. moduleauthor:: <NAME> <<EMAIL>>
"""
import numpy as np
from typing import List, Tuple
def vu_factorization(matrix_I: np.ndarray, error_accuracy: float=1e-3,
max_iters: int=20,
verbose: bool=False, verbose_step: int=5) -> Tuple[np.nda... |
import numpy as np
import pymol
import torch
import wandb
from prody import calcTransformation
from protein_transformer.protein.Sequence import ONE_TO_THREE_LETTER_MAP
import protein_transformer
from protein_transformer.losses import inverse_trig_transform
from protein_transformer.losses import angles_to_coords
from p... |
from os import walk
import pandas as pd
import numpy as np
foldn = '9'
cols = ['toxic', 'severe_toxic', 'obscene', 'threat', 'insult', 'identity_hate']
f = []
for (dirpath, dirnames, filenames) in walk('../blend/'):
f.extend(filenames)
break
ff = []
for (dirpath, dirnames, filenames) in walk('... |
import config
import features
import colorama
import sys
import os
import json
from datetime import datetime
from mutagen.easyid3 import EasyID3
np = features.get_norm_path
colorama.init()
c_reset = colorama.Style.RESET_ALL
c_red = colorama.Fore.RED
c_green = colorama.Fore.GREEN
c_bright = colorama.Style.BRIGHT
c_dim... |
"""
Design reference
https://github.com/openai/baselines/blob/master/baselines/deepq/replay_buffer.py
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow as tf
import numpy as np
class Table:
""" Base table class to store data in tf.V... |
# -*- coding: utf-8 -*-
import os
import sys
import time
import setproctitle
import torch
from torch.nn.utils import clip_grad_norm_
from tqdm import tqdm
base_dir = os.path.dirname(__file__)
sys.path.append(base_dir)
from gmodels.model import Model
from gmodels.adagrad_custom import AdagradCustom
from gutils.batche... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.