text stringlengths 3.07k 22.1k |
|---|
# Copyright 1999-2020 Alibaba Group Holding Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... |
# Copyright 2017--2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You may not
# use this file except in compliance with the License. A copy of the License
# is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" fi... |
# Copyright The PyTorch Lightning team.
#
# 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 i... |
# coding: utf-8
# python 3.5
import sys
import os
sys.path.append('/Users/ooki/git/research_dr/python/MLEM2')
sys.path.append(os.path.dirname(os.path.abspath("__file__"))+'/../MLEM2')
from sklearn.metrics import accuracy_score
import copy
import importlib
import mlem2
import LERS
importlib.reload(mlem2)
importlib.rel... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
""" Visualize MD trajectories using Pymol and Bokeh """
from __future__ import print_function
import os
import sys
import random
import argparse
import warnings
import subprocess
import numpy as np
from xmlrpclib import ServerProxy
from MDAnalysis import Universe
from b... |
# Copyright 2022 <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 law or agreed to in writin... |
from __future__ import annotations
import json
from os.path import dirname
from typing import Any, Dict
import structlog
from dotted.collection import DottedCollection, DottedDict
from labster.domain.models.config import Config
from labster.extensions import db
"""
- adding new constants: add their type in TYPES a... |
#!/usr/bin/env python3
import zmq, sys, time, copy, re, json, argparse
import xml.dom.minidom
from xml.dom.minidom import parse, parseString
# Include UAV modules for collision avoidance (https://github.com/JTEnglish/UAVHeading-CollisionAvoidance)
import sys
sys.path.append('/home/jenglish/research/UAVHeading-Collisi... |
# TranQL.py
#
# TranQL is a query language for heterogenous federated knowledge sources.
#
# The NCATS Data Translator program investigates the creation
# of a data and computational engine to accelerate biomedical
# insight.
#
# It aims to do this through the design and large scale computational
# in... |
"""
This module is responsible for the import of the data parsed from the UNIPROT text file
"""
from bioflow.configs import main_configs
from bioflow.utils.log_behavior import get_logger
from bioflow.bio_db_parsers.geneOntologyParser import GOTermsParser
from bioflow.bio_db_parsers.uniprotParser import UniProtParser
fr... |
from layers import *
##################################################################################
# Generator Networks
##################################################################################
class Generator(tf.keras.Model):
def __init__(self, g_params, **kwargs):
super(Generator, self... |
# -*- coding: utf-8 -*-
"""
Created on Mon Aug 24 20:08:58 2020
@author: cm
"""
import math
import types
import collections
from operator import mul
from pygtrie import Trie
from functools import reduce
from hellonlp.ChineseWordSegmentation.utils import calcul_word_frequence
from hellonlp.ChineseWordS... |
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
import os
from typing import Any, Dict, Generator, Optional, cast
import pytest
import pytorch_lightning as pl
import torch
import torch.nn.functional as F
from _pytest.fixtures import SubRequest
from _pytest.monkeypatch imp... |
import sys
import collections
import shutil
import re
import pickle
import subprocess as sp
import warnings
import difflib
from pathlib import Path
from typing import Iterable, List, Union, Dict, Tuple, Optional, Sequence
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import matplotlib.ticker ... |
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
from django.shortcuts import render
from Virus_s import models
import json
import ssl
import time
import heapq
import re
from django.db.models import Max
ssl._create_default_https_context = ssl._create_unverified_context
# Create your views here.
def index(request):
# 确诊人数
table_province = models.City.objects.f... |
#!/usr/bin/env python3
import decimal
import mock
import wallycore as wally
import garecovery.bitcoin_config
from gaservices.utils import gaconstants, txutil
from garecovery.clargs import DEFAULT_OFILE, DEFAULT_SUBACCOUNT_SEARCH_DEPTH
from .util import (AuthServiceProxy, datafile, get_output, get_output_ex, parse_csv... |
#!/usr/bin/env python3
"""
Defines various package-level constants and helper functions.
"""
import argparse
import os
import shutil
import sys
from pathlib import Path
from typing import Set, Union
from rich.console import Console
from rich.text import Text
from rich.theme import Theme
from natsort import natsorted,... |
import numpy as np
import pydicom as dicom
import os
from glob import glob
import scipy.ndimage
import re
import sys
from tqdm import tqdm
from itertools import chain
from skimage.io import imread, imshow, imread_collection, concatenate_images
import matplotlib.pyplot as plt
plt.style.use('seaborn-poster')
import rando... |
# -*- coding: utf-8 -*-
"""Various utilities for dealing with syntax trees.
Include base classes to implement a visitor pattern.
"""
from .tree import BaseOperation, OrOperation, AndOperation
def camel_to_lower(name):
return "".join(
"_" + w.lower() if w.isupper() else w.lower()
for w in name).l... |
###############################################################################
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
###############################################################################
imp... |
import sys
import numpy as np
from .SimulationCBSA import SimulationCBSA
def extend_matrix_toroid(S,n,diffusion=True):
frac,_ = np.modf(np.sqrt(n))
if n<2 or frac>0:
sys.exit("ERROR: expansion number must be equal or greater than 2 and have exact square root. Got: "+str(n))
exS = S
n2 = n
n... |
import cryptocompare as cc
import json
import argparse
import sys
import os
from prettytable import PrettyTable
parser = argparse.ArgumentParser(description="Track your crypto currencies portfolio in the terminal")
parser.add_argument("-a", "--add", help="Crypto currency to add to portfolio")
parser.add_argument("--am... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from typing import Dict, Set, Optional
from hwt.code import Or, Switch
from hwt.math import log2ceil
from hwt.code_utils import rename_signal
from hwt.interfaces.std import Handshaked
from hwt.interfaces.utils import addClkRstn, propagateClkRstn
from hwt.synthesizer.hObj... |
import os
from abc import ABC, abstractmethod
from tqdm.autonotebook import tqdm
from ._util import is_module_available, get_module_or_attr
from .crn_utils import get_line_representation
from .downloads import download_file_from_google_drive
from .pcrn_utils import load_stats, noisyfy_backoff_homophones
from .wrn_uti... |
import numpy as np
from mpl_toolkits.mplot3d import Axes3D
from scipy.spatial.transform import Rotation as R
def angle_between_segments(prev_joint, joint, next_joint, rot_axis):
v1 = prev_joint - joint
v2 = next_joint - joint
#print(v1)
#print(v2)
try:
cos_angle = np.dot(v1, v2) / (np.linal... |
import requests
import pprint
import time
pp = pprint.PrettyPrinter(indent = 4)
url = 'https://graphql.anilist.co'
def anime_title(eng, rom):
if eng:
return (f'{eng}\n({rom})')
else:
return rom
def anime_query(search, curr_page, per_page = 5):
query = '''
query($search : String, $curr_page :... |
################################################################################
# The Pyretic Project #
# frenetic-lang.org/pyretic #
# author: <NAME> (<EMAIL>) #
# author: <NAME> ... |
# -*- coding: utf-8 -*-
# Define here the models for your spider middleware
#
# See documentation in:
# https://doc.scrapy.org/en/latest/topics/spider-middleware.html
import json
from datetime import datetime, timezone
from urllib.request import pathname2url
from scrapy import Request
from scrapy.http import Respons... |
# -*- coding: utf-8 -*-
"""Main plugin file - Handles the various routes"""
__author__ = "fraser"
import logging
import routing
import xbmc
import xbmcaddon
import xbmcplugin
from xbmcgui import ListItem
from resources.lib import kodilogging
from resources.lib import kodiutils as ku
from resources.lib import searc... |
import datetime
import io
import json
from jsonschema import validate
from jsonschema.exceptions import ValidationError as JSONValidationError
import os
import sys
import traceback
from girder.api.rest import Resource, setResponseHeader, setContentDisposition
from girder.api import access, rest
from girder.constants i... |
# -*- coding: UTF-8 -*-
'''=================================================
@Author :zhenyu.yang
@Date :2020/11/5 11:37 AM
=================================================='''
import sys
sys.path.append('./')
sys.path.insert(0,'/data/zhenyu.yang/modules')
import cv2
import json
import numpy as np
import random
i... |
import logging
import typing
import re
from typing import Any
import pandas as pd
from pandas_schema import Column, Schema
from pandas_schema.validation import LeadingWhitespaceValidation, TrailingWhitespaceValidation, _SeriesValidation, \
_BaseValidation, MatchesPatternValidation
from sdrf_pipelines.sdrf import ... |
"""
Module with handling the parcellation of different cortical atlases.
"""
__all__ = ['read_freesurfer_atlas', 'freesurfer_roi_labels']
import os
import os.path
from os.path import isdir
from pathlib import Path
import nibabel as nib
import numpy as np
from graynet import config_graynet as cfg
from graynet.utils... |
# -*- coding: utf-8 -*-
import csv
import os
import shutil
from collections import defaultdict
from enum import Enum
from camsa.core.data_structures import AssemblyPoint, APFieldOutExtractorConverter, Sequence
def get_fn_relations_for_column_names(fieldnames, aliases):
canonical_field_names = [aliases.get(name.l... |
#!/usr/bin/env python3.7
"""
Mastering Object-Oriented Python 2e
Code Examples for Mastering Object-Oriented Python 2nd Edition
Chapter 18. Example 1.
"""
import os
# Command-line parsing
# =======================
import argparse
import sys
import logging
from typing import List, Optional
__version__ = "2e"
def... |
#!/usr/bin/env python2
# SPDX-License-Identifier: MIT
import os
import sys
import re
import dbg
import utils
import pprint
LIST_TYPE = ["CONDITION", "LOG_CALL", "LOG_STORE"]
def _parse_typed_arg(targ):
end_type = None
i = 0
for i in utils.to_zero(len(targ)):
if targ[i] == ' ':
end_typ... |
# Copyright 2018-2022 The Kubeflow 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 ... |
# Copyright 2020 <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 law or agreed to ... |
import math
import mindspore.nn as nn
import mindspore.ops as ops
from mindspore.ops import constexpr
from mindspore.common.initializer import initializer, Normal, Uniform, HeUniform, _calculate_fan_in_and_fan_out
@constexpr
def compute_kernel_size(inp_shape, output_size):
kernel_width, kernel_height = inp_shape[2... |
import numpy as np
import pytest
from scipy import stats
from astropy import units
from astropy.cosmology import FlatLambdaCDM
def test_angular_size():
""" Test a FlatLambdaCDM cosmology with omega_matter = 1"""
from skypy.galaxies import morphology
cosmology = FlatLambdaCDM(Om0=1.0, H0=70.0)
# T... |
# -*- coding: utf-8 -*-
"""Implementation of the ``variant_export`` step.
The ``variant_export`` step takes as the input the results of the ``variant_calling`` step and
uses ``varfish-annotator-cli annotate`` commmand to create files fit for import into VarFish
Server.
==========
Stability
==========
TODO
=========... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2021, Ansible Project
# Copyright: (c) 2021, VMware, Inc. All Rights Reserved.
# 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
D... |
# Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... |
import pygame, random, sys
from pygame.locals import *
# Using Python 3.8.5 and pygame==2.0.0.dev12
def update_score(score, high_score):
if score > high_score:
high_score = score
return high_score
def check_collision(rect_1, rect_2):
if rect_1.colliderect(rect_2):
return Tru... |
"""Pipeline primitive
"""
import asyncio
from datetime import datetime
import json
import logging
from hashlib import sha1
from itertools import chain
from typing import Dict, List, Optional, Union, AsyncIterator, Any
from baseline.utils import listify
from mead.utils import order_json
from odin.core import create_grap... |
"Moment retrieval evaluation in a single & corpus video(s)"
from itertools import product
import numpy as np
import torch
from np_segments_ops import torch_iou
IOU_THRESHOLDS = (0.5, 0.7)
TOPK = (1, 5)
DEFAULT_TOPK_AND_IOUTHRESHOLDS = tuple(product(TOPK, IOU_THRESHOLDS))
def iou(gt, pred):
"Taken from @LisaAnn... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# (c) University of St Andrews 2022
# (c) University of Strathclyde 2022
# (c) James Hutton Institute 2022
# Author:
# <NAME>
# Contact
# <EMAIL>
# <NAME>,
# Biomolecular Sciences Building,
# University of St Andrews,
# North Haugh Campus,
# St Andrews,
#... |
from tensorflow.keras import layers
from tensorflow import keras
from keras.preprocessing.image import load_img
from keras import backend as K
import matplotlib.pyplot as plt
import tensorflow_addons as tfa
import tensorflow as tf
import numpy as np
import pickle
import struct
import os
DATA_DIR = './data/'
MODEL_DIR... |
# -*- coding: utf-8 -*-
"""
Created on Thu Jun 11 10:46:58 2020
@author: dlrgh
"""
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun May 31 17:01:21 2020
@author: ihsong
"""
import cv2
import numpy as np
from matplotlib import pyplot as plt
from easydict import EasyDict
import ... |
# coding: utf-8
# Copyright (c) Max-Planck-Institut für Eisenforschung GmbH - Computational Materials Design (CM) Department
# Distributed under the terms of "New BSD License", see the LICENSE file.
from __future__ import print_function
from pyiron_contrib.protocol.generic import Vertex, PrimitiveVertex, CompoundVerte... |
# ----------------------------------------------------------------------------
# pyglet
# Copyright (c) 2006-2008 <NAME>
# Copyright (c) 2008-2020 pyglet contributors
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following c... |
"""
Support for WUnderground weather service.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/sensor.wunderground/
"""
from datetime import timedelta
import logging
import re
import requests
import voluptuous as vol
from homeassistant.components.sensor ... |
import matplotlib.patches as mpatches
import matplotlib as mpl
import matplotlib.pyplot as plt
import torch
import numpy as np
from torch.optim import *
from kme.data.utils import get_loaders, get_loader_dataset
from kme.models.utils import build_kme_net, count_parameters
from kme.tools.checkpoint import load_checkpoin... |
#!/usr/bin/python3
"""The python-broadlink library."""
import socket
from typing import Generator, List, Union, Tuple
from .alarm import S1C
from .climate import hysen
from .cover import dooya
from .device import device, scan
from .exceptions import exception
from .light import lb1
from .remote import rm, rm4
from .se... |
# -*- coding: utf-8 -*-
# ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# ... |
"""Analysis module for Databench."""
import os
import json
import time
import gevent
import logging
import zipstream
import subprocess
import geventwebsocket
import zmq.green as zmq
from flask import Blueprint, render_template, Response
class Analysis(object):
"""Databench's analysis class.
This contains th... |
# Copyright (c) 2016-2018, F5 Networks, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed ... |
#!/usr/bin/env python3
import os.path
import tensorflow as tf
#from tensorflow_estimator import estimator
import time
import datetime
import helper
import warnings
from distutils.version import LooseVersion
import project_tests as tests
from tensorflow.python.client import device_lib
import matplotlib.pyplot as plt
# ... |
# pylint: disable=unused-argument,too-many-locals
"""
Test the base classes and their utility functions.
"""
import numpy as np
import numpy.testing as npt
import pytest
from ..base.utils import check_fit_input
from ..base.base_classes import (
BaseGridder,
get_dims,
get_data_names,
get_instance_region... |
# !/usr/bin/env python
# -*- coding:utf-8 -*-
# author : zerodel
# Readme:
#
import os
import pysrc.body.logger
__doc__ = '''
'''
__author__ = 'zerodel'
_logger = pysrc.body.logger.default_logger("opt_check")
_description_template_default = """
[{working}]
# this section [{working}] contains following options:
#... |
#!/usr/bin/python3
import os
import sys
import json #for debug
import numpy as np
from xml.etree import ElementTree
from datetime import datetime
from contextlib import contextmanager
# BEGINN installation process
@contextmanager
def suppress_stdout():
with open(os.devnull, "w") as dev... |
import json
import tensorflow as tf
class ConvLSTMCell(tf.nn.rnn_cell.RNNCell):
"""Convolutional LSTM (Long short-term memory unit) recurrent network cell.
The class uses optional peep-hole connections, optional cell-clipping,
optional normalization layer, and an optional recurrent dropout layer.
Ba... |
from datetime import datetime
from quart import g, jsonify, request
from http import HTTPStatus
from lnurl.exceptions import InvalidUrl as LnurlInvalidUrl
import shortuuid # type: ignore
from lnbits.core.crud import get_user
from lnbits.core.services import pay_invoice
from lnbits.decorators import api_check_wallet_k... |
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
import re
import os
import html
DE_MAURO_PATH = '/Users/fedja/scratch/CORPORA/DE_MAURO/'
CERCA_ALPHA = DE_MAURO_PATH + 'cerca_alpha'
PAROLE_DIZIONARIO = DE_MAURO_PATH + 'dizionario.internazionale.it/parola'
LETTERS_DIR = DE_MAURO_PATH + 'dizionario.internazionale.it/le... |
#!/usr/bin/env python3
import sys
import struct
import binascii
from .elf import *
from .helpers import *
#typedef struct {
# Elf32_Addr r_offset;
# Elf32_Word r_info;
#} Elf32_Rel;
def tag_elf32_rel(fp, machine:E_MACHINE=None):
tag(fp, 8, 'Elf32_Rel', 1)
#r_offset = uint32(fp, 1)
... |
# import os
# import hashlib
# from Crypto.Cipher import DES as DES_Pro
# from Crypto import Random
# from Padding import pad, unpad
from CryptologyProj import *
from tkinter import *
from tkinter import ttk
global hashfunc, symmetic_func,sym_key_length,crypted_obj,sym_mode,seed, key,\
ps, pr,ps1,pr1,stringEncRes... |
#!/usr/bin/env python3
import argparse
import numpy as np
from pathlib import Path
import pandas as pd
import artistools as at
import artistools.estimators
import artistools.lightcurve
def write_spectra(modelpath, model_id, selected_timesteps, outfile):
spec_data = np.loadtxt(Path(modelpath, "spec.out"))
... |
# Importing the necessary modules.
import projectq
from projectq.ops import H,X,Y,Z,T,Tdagger,S,Sdagger,CNOT,Measure,All,Rx,Ry,Rz,SqrtX,Swap
import numpy as np
import copy
from constants import *
from deap import creator, base, tools
from candidate import Candidate
from constants import *
from evolution import crossove... |
import os
from autode.reactions import reaction
from autode.reactions import reaction_types
from autode.transition_states.transition_state import TransitionState
from autode.bond_rearrangement import BondRearrangement
from autode.species import Reactant, Product
from autode.transition_states.ts_guess import TSguess
fro... |
import pytest
import torch
import torch.distributed as dist
import ignite.distributed as idist
from ignite.distributed.utils import sync
from ignite.engine import Engine, Events
def _sanity_check():
from ignite.distributed.utils import _model
assert _model.get_world_size() == _model.get_nnodes() * _model.ge... |
'''
Class for setting motors directly from GCS
Copyright (C) <NAME> 2021
MIT License
'''
import tkinter as tk
from math import sqrt
from dialog import Dialog
from resources import resource_path
class MotorScale(object):
def __init__(self, dialog, x,
index=0, label='Motor', minval=0, maxval=10... |
# Author : <NAME>
# imports
import math
from matplotlib.figure import Figure
from matplotlib.backends.backend_tkagg import (FigureCanvasTkAgg, NavigationToolbar2Tk)
from matplotlib.pyplot import fill, text
import numpy as np
from tkinter import *
import matplotlib
from random_walk import RandomWalk, RandomWalk2D
from ... |
from typing import Hashable, Optional
import dask.array as da
import numpy as np
from numba import njit
from numpy import ndarray
from xarray import Dataset
from sgkit import variables
from sgkit.stats.aggregation import count_genotypes
from sgkit.utils import conditional_merge_datasets, create_dataset
def hardy_we... |
# -*- coding: utf-8 -*-
#BEGIN_HEADER
import logging
import os
import time
import shutil
import uuid
import subprocess
import sys
from installed_clients.KBaseReportClient import KBaseReport
from installed_clients.DataFileUtilClient import DataFileUtil
from .util.config import Var, reset_Var
from .util.dprint import ... |
# -*- coding: utf-8 -*-
import torch
import torch.nn as nn
import torch.nn.functional as F
import numpy as np
import transformers
class BioClinicalBERT_FT(nn.Module):
# Model which only uses text part
def __init__(self, BioBert, BioBertConfig, device):
super(BioClinicalBERT_FT, self).__init__()
... |
from functools import partial
import numpy as np
import pytest
from guacamol.score_modifier import LinearModifier, SquaredModifier, AbsoluteScoreModifier, GaussianModifier, \
MinGaussianModifier, MaxGaussianModifier, ThresholdedLinearModifier, ClippedScoreModifier, \
SmoothClippedScoreModifier, ChainedModifie... |
# test_ignore.py -- Tests for ignore files.
# Copyright (C) 2017 <NAME> <<EMAIL>>
#
# Dulwich is dual-licensed under the Apache License, Version 2.0 and the GNU
# General Public License as public by the Free Software Foundation; version 2.0
# or (at your option) any later version. You can redistribute it and/or
# modif... |
from itertools import chain
from django.contrib.auth.decorators import login_required, user_passes_test
from django.contrib.auth.models import Group, User
from django.core.mail import send_mail
from django.shortcuts import render
from django.urls import reverse
from chiffee.filters import PurchaseFilter
from .models ... |
import numpy as np
from nltk.corpus import stopwords
from bs4 import BeautifulSoup
import pickle
import re
from keras.layers import Dense, Input, LSTM, Embedding, Dropout,Bidirectional,GRU,dot
from keras.layers.core import Lambda
from keras.layers.merge import concatenate, multiply,subtract
from keras.layers.normaliza... |
from dataIO import fileIO
import sys, os, subprocess, re, time
try:
import pip
except ImportError:
pip = None
try:
import tweepy
except ImportError:
tweepy = None
REQS_DIR = "lib"
sys.path.insert(0, REQS_DIR)
IS_WINDOWS = os.name == "nt"
PYTHON_OK = sys.version_info >= (3, 5)
REQS_TXT = "requirements.t... |
#
# Copyright (c) 2021 Airbyte, Inc., all rights reserved.
#
import json
import boto3
from airbyte_cdk.destinations import Destination
from botocore.exceptions import ClientError
from retrying import retry
from .config_reader import AuthMode, ConnectorConfig
class AwsHandler:
COLUMNS_MAPPING = {"number": "floa... |
"""
Copyright (c) 2020-2021, Chubu University and Firmlogics
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of co... |
import time
import copy
import socket
import select
import traceback
from threading import Thread, Lock
import sys
import argparse
import random
import datetime as dt
import orion5
import orion5.utils as utils
def write_debug(tag, message):
timestamp = dt.datetime.now().strftime("%x-%X")
wit... |
# Copyright (c) 2020, <NAME>, Honda Research Institute Europe GmbH, and
# Technical University of Darmstadt.
# 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 mus... |
from context import nim
def test_state():
environment = nim.Environment([3, 2, 0], 1, 3)
expected_environment = ((2, 3), 1, 3)
assert environment.state() == expected_environment
environment = nim.Environment([2, 3, 1], 1, 3)
expected_environment = ((1, 2, 3), 1, 3)
assert environment.state() =... |
# 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 applic... |
import logging
import multiprocessing
from queue import Full, Empty
from time import time
from unittest import TestCase
import ctypes
from faster_fifo import Queue
ch = logging.StreamHandler()
ch.setLevel(logging.DEBUG)
fmt = logging.Formatter('[%(asctime)s][%(process)05d] %(message)s')
ch.setFormatter(fmt)
log = l... |
# -*- coding: utf-8 -*-
"""
Authors: <NAME> and <NAME>
UNESCO-IHE 2016
Contact: <EMAIL>
<EMAIL>
Repository: https://github.com/wateraccounting/watools
Module: Collect/ETmonitor
Restrictions:
The data and this python file may not be distributed to others without
permission of the WA+ team due data res... |
# Copyright 2018 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... |
# ActivitySim
# See full license in LICENSE.txt.
import argparse
import os
import yaml
import sys
import logging
from activitysim.core import inject
logger = logging.getLogger(__name__)
"""
default injectables
"""
@inject.injectable(cache=True)
def locutor():
# when multiprocessing, sometimes you only want... |
"""
INF 552 Homework 6
Hidden Markov Model(HMM) and Viterbi Algorithm
Group Members: <NAME> (zhan198), <NAME> (minyihua), <NAME> (jeffyjac)
Date: 4/15/2018
Python 3.6
"""
import math
import numpy as np
grid_world= []
tower_location = []
noisy_distances = []
states =[]
transition_matrix = []
initial_probability =[]
s... |
"""Style Net w/ tests for Video Style Net.
Video Style Net requires OpenCV 3.0.0+ w/ Contrib for Python to be installed.
Creative Applications of Deep Learning w/ Tensorflow.
Kadenze, Inc.
Copyright <NAME>, June 2016.
"""
from __future__ import print_function
import tensorflow as tf
import numpy as np
import matplotl... |
# -*- coding: utf-8 -*-
# Author: <NAME>
# License: 3-clause BSD
"""
Binder utility functions
========================
Integration with Binder is on an experimental stage. Note that this API may
change in the future.
.. warning::
Binder is still beta technology, so there may be instability in the
experience of... |
#!/usr/bin/env python
# -*- coding:utf-8 -*-
from __future__ import print_function
from __future__ import division
import os
import sys
import cv2
import numpy as np
import uuid
spliter_dir =os.path.dirname(os.path.abspath(__file__))
home_dir= os.path.dirname(spliter_dir)
sys.path.append(home_dir)
sys... |
'''To do:
1) Encode spatial and sequence using ConvLSTM
2) Encode attention of previous sequences
3) Also see http://athena.ecs.csus.edu/~millerk/
https://web.stanford.edu/class/cs224n/reports/2760496.pdf
'''
train_file_path = "data_stance/combined_train_stance.csv"
test_file_path = "data_stance/combined_test_stance... |
import ase.db
import warnings
import numpy
import matplotlib.pyplot as plt
from ase.data import covalent_radii
from scipy.stats import linregress
from scipy.optimize import curve_fit
import os, os.path
from scipy.constants import pi, epsilon_0
from gpaw_data import get_data
import scipy
import csv
"""
Extract the alph... |
import os
import argparse
import glob
from PIL import Image
import numpy as np
import matplotlib
matplotlib.use('agg')
import matplotlib.pyplot as plt
from sklearn.datasets import make_circles
import torch
import torch.nn as nn
import torch.optim as optim
parser = argparse.ArgumentParser()
parser.add_argument('--adjo... |
from collections import defaultdict
import vg
import math as m
import numpy as np
import random
import pandas as pd
np.seterr(divide='ignore', invalid='ignore')
# -------------------------------------------------------------------------------------------------------------
# Target Sequence: [C1P1, C2P2] OR [C1P1, P2... |
""" Utilities to express rows of data with Karps.
"""
import pandas as pd
from .proto import types_pb2
from .proto import row_pb2
from .types import *
__all__ = ['CellWithType', 'as_cell', 'as_python_object', 'as_pandas_object']
class CellWithType(object):
""" A cell of data, with its type information.
This is ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.