text stringlengths 3.07k 22.1k |
|---|
from application import CONFIG, app
from .models import *
from flask_login import login_user, logout_user
import bcrypt
import re
import sendgrid
from sendgrid.helpers.mail import *
import time
import requests
import json
from itsdangerous import URLSafeTimedSerializer
AuthenticationError = Exception("AuthenticationEr... |
from . import models
def int_to_tuple(rgbint):
if rgbint == -1:
return None
else:
return (rgbint // 256 // 256 % 256, rgbint // 256 % 256, rgbint % 256)
def parse_special(item):
_type = int(item["t"])
_coordinates = (float(item["p0"]), float(item["p1"]))
# BUILDING BLOCKS
if ... |
from bs4 import BeautifulSoup as soup
from bz2 import BZ2File
from collections import Counter
from copy import deepcopy
from datetime import datetime as dt, timedelta
from dateutil.parser import parse as parse_date
from etk.extractors.date_extractor import DateExtractor
from etk.extractors.spacy_ner_extractor import Sp... |
#!/usr/bin/env python
# -*- coding:utf-8 -*-
import re
from xbmcswift2 import Plugin
import requests
from bs4 import BeautifulSoup
import xbmcgui
import base64
import json
import urllib2
import sys
import HTMLParser
import re
def get_real_url(url):
rs = requests.get(url,headers=headers,timeout=2)
return rs.url... |
# This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by Ansible
# still belong to the author of the module, and may assign their own license
# to the complete wo... |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from functools import partial
from astropy.table import Table
import numpy as np
import pytest
import requests
from mica.archive.cda import (get_archive_file_list, get_ocat_local,
get_ocat_web, get_proposal_abstract)
from mi... |
# Copyright 2021 Jetperch 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,... |
# -*- coding: utf-8 -*-
#------------------------------------------------------------------------------
# file: $Id$
# auth: metagriffin <<EMAIL>>
# date: 2015/11/12
# copy: (C) Copyright 2015-EOT metagriffin -- see LICENSE.txt
#------------------------------------------------------------------------------
# This softw... |
#!/usr/bin/python
# Copyright 2016 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Convert GN Xcode projects to platform and configuration independent targets.
GN generates Xcode projects that build one configuration o... |
# coding: utf-8
# Copyright 2018 The LUCI Authors. All rights reserved.
# Use of this source code is governed under the Apache License, Version 2.0
# that can be found in the LICENSE file.
"""Common code to stream (and backfill) rows to BigQuery."""
import datetime
import logging
from google.appengine.api import app... |
#!/usr/bin/env python
# coding: utf-8
"""
Run from command line:
python z_generator.py --dataset_dir ../nsynth_dataset --model_dir_name z_gen
"""
import tensorflow as tf
import click
from tensorflow.keras.layers import Input, concatenate, Conv1D, MaxPool1D, UpSampling1D
from tensorflow.keras.layers import BatchN... |
# Copyright (c) 2022 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... |
#!/usr/bin/env python3
# Copyright 2014-2018 PUNCH Cyber Analytics Group
#
# 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
#
# Un... |
#!/usr/bin/env python
#
# Copyright 2018 - The Android Open Source Project
#
# 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... |
import time
import pandas as pd
CITY_DATA = {'chicago': 'chicago.csv',
'new york city': 'new_york_city.csv',
'washington': 'washington.csv'}
MONTH = {1: 'january',
2: 'february',
3: 'march',
4: 'april',
5: 'may',
6: 'june',
7: 'july',
... |
from collections.abc import Iterator
import os
import pathlib
class Reader(Iterator):
def __init__(self, file=None):
if file is not None:
self.set_file(file)
else:
self.file = None
self.reset()
def set_file(self, file):
if isinstance(file, pathlib.... |
import numpy as np
from scipy.linalg import sqrtm
from sklearn.preprocessing import normalize
def retrofit_linear(X, in_edges, out_edges, n_iter=10, alpha=None, beta=None,
tol=1e-2, lr=1.0, lr_decay=0.9, lam=1e-5, verbose=False,
A=None, orthogonal=True):
""" Retrofit accordi... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import numpy as np
import tkinter as tk
from PIL import Image, ImageTk
from urllib.request import urlopen
from base64 import encodebytes
from functools import partial
from itertools import product
#plt.close('all')
##### Functions ######################################... |
import json
import os
from detectron2.data import DatasetCatalog, MetadataCatalog
from detectron2.structures import BoxMode
from adet.data.video_data.yvos_annot import categories
from detectron2.data.datasets import register_coco_instances
#TODO: save dataset in coco dictionary with this function later
from de... |
from pathlib import Path
import re
import json
import shutil
from typing import Optional
path = Path(__file__).parent.absolute()
CORE_PATH = path / r'data\waitatick\functions\core\_'
API_PATH = path / r'data\waitatick\functions\api'
TAG_PATH = path / r'data\waitatick\tags\functions\callback'
INIT_TAG_PATH ... |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
import logging, os
import h5py
import glob
import numpy as np
import io3d.datareader as DR
import io3d.datawriter as DW
import argparse
import pandas as pd
import imtools.misc as misc
logger = logging.getLogger(__name__)
def sliver_preparation(datadir... |
import contextlib
import os
from typing import Dict
import docker
import docker.errors
import requests
from pyjackson.core import Comparable
from pyjackson.decorators import type_field
from ebonite.core.objects import Image, RuntimeEnvironment, RuntimeInstance
from ebonite.ext.docker.utils import create_docker_client... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
__all__ = ["Job"]
import json
import re
from traceback import format_exc
try:
# Python 3
from urllib.parse import urlparse
except ImportError:
# Python 2
from urlparse import urlparse
import ... |
#visualization_and_clustering.py
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from sklearn import metrics
import sklearn
from sklearn.preprocessing import LabelEncoder
from sklearn.feature_selection import chi2
import seaborn as sns
from sklearn.decomposition import PCA, IncrementalPCA, NMF
fr... |
import pandas as pd
import re
from msda import mapping
import numpy as np
from msda import batch_normalization as bn
import os
resource_path = os.path.join(os.path.dirname(os.path.abspath(__file__)),
'resources')
df_map = pd.read_csv(os.path.join(resource_path, 'Uniprot_sec_to_prim.csv'),
... |
import jax.numpy as jnp
from jax import grad, vmap, hessian, jit
from jax.config import config;
config.update("jax_enable_x64", True)
# numpy
import numpy as onp
from numpy import random
import argparse
import logging
import datetime
from time import time
import os
# solving -grad(a*grad u) + alpha u^m = f on tor... |
# If user changes their answer, create new answer record, or modify existing record?
# Modify, because we don't want too many unused records.
# New record, because user should be able to change their answer anytime, even if other people voted for it.
# This implies that answer record is independent of... |
import logging
import os
import re
from datetime import timedelta
import pytest
from pydantic import BaseModel, validator
from redis.asyncio import ConnectionError, ResponseError
import arq.typing
import arq.utils
from arq.connections import RedisSettings, log_redis_info
from .conftest import SetEnv
def test_setti... |
#!/usr/bin/python3
import pygame as pg
from random import choice
from var import get_template
cell_size = 8
window_size = (640, 640)
pg.init()
class Cell(pg.sprite.Sprite):
def __init__(self, x, y, alive):
pg.sprite.Sprite.__init__(self)
self.alive = alive
self.x = x
self.y = y... |
import tkinter as tki
import tkinter.font as tkf
import tkinter.ttk as ttk
import client.asset.font as fontMod
import client.frame.base as baseMod
import client.frame.stack as stackMod
import client.client as clientMod
import tkinter.messagebox as msgMod
import typing as typ
import traceback
import threading
import tim... |
# -*- mode: python; coding: utf-8 -*-
# Copyright 2012, 2016, 2018 <NAME> <<EMAIL>> and collaborators.
# Licensed under the MIT License.
# NB. This is super-redundant with msphotom but it seems impractical
# to combine them.
"""High-resolution point-source spectra from visibilities
CASA doesn't yet have a task to do... |
import matplotlib.pyplot as plt # crea una figura, o lineas en un area y pone labes
import matplotlib.image as mpimg # carga la info de la data (solo funciona en formato .png)
from scipy import ndimage # paquete que contiene procesamientos de imagenes multi-dimencion... |
# MIT License
# Copyright (c) 2020 <NAME>
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish... |
# coding=utf-8
# Copyright 2022 The Uncertainty Baselines 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 ap... |
from django.http import HttpResponse
from django.views.generic import View
from django import forms as f
from lxml import etree
import pprint
import json
import re
from terrapyn.ows import parsing
def get_filter_params(ciargs):
"""filters can either be specified as JSON or they can be specified as keyword args p... |
'''
@author: <NAME> (jakpra)
@copyright: Copyright 2020, <NAME>
@license: Apache 2.0
'''
from os import PathLike
from typing import Dict, Optional, List, Any, Union, Iterable
from collections import OrderedDict, Counter
import re
import numpy
import torch
import torch.cuda as cuda
from allennlp.comm... |
from keras.models import Model
from keras.layers import Input, Conv2D, Conv2DTranspose, MaxPooling2D, Dropout, Concatenate, Activation
from keras.layers.core import Reshape, Lambda
from keras.optimizers import Adam
from keras import backend as K
from keras.layers.normalization import BatchNormalization
from DRclasses i... |
import sys
import os
import argparse
import multiprocessing as mp
from aligner.utils import get_available_acoustic_languages, get_available_g2p_languages, get_available_dict_languages
from aligner.command_line.align import run_align_corpus
from aligner.command_line.train_and_align import run_train_corpus
from aligner.... |
# -*- coding: utf-8 -*-
"""
Created on Fri Dec 20 22:44:26 2019
@author: DELL
"""
import os
import numpy as np
import pickle
import cv2
import argparse
labelmap = (
'带电芯充电宝',
'不带电芯充电宝',
)
parser = argparse.ArgumentParser(
description='Single Shot MultiBox Detector Training With Pytorch')
... |
from urllib.request import urlopen
from tkinter import *
from tkinter import messagebox
from urllib.request import urlopen
from zipfile import ZipFile
def serch():
if display.get() == "":
messagebox.showinfo("Warnning", "enter a keyword for serch")
else:
print_text.set("Fetching data .... ")
... |
# Copyright (C) 2016 Nippon Telegraph and Telephone Corporation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... |
# Python standard libraries
import json
import os
import sqlite3
# Third-party libraries
from flask import Flask, render_template, redirect, request, url_for
from flask_login import (
LoginManager,
current_user,
login_required,
login_user,
logout_user,
)
from oauthlib.oauth2 import We... |
# Copyright (c) 2011 OpenStack, 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... |
#! /usr/bin/env python
import copy
from copy import deepcopy
import rospy
import threading
import quaternion
import numpy as np
from geometry_msgs.msg import Point
from visualization_msgs.msg import *
#from interactive_markers.interactive_marker_server import *
from franka_interface import ArmInterface
from panda_robot... |
import string
from asyncio import sleep
from datetime import datetime, timezone
from re import U
import cogs.utils.logs as logger
import cogs.utils.context as context
import discord
from cogs.monitors.report import report_spam, report_raid
from data.case import Case
from discord.ext import commands
from expiringdict i... |
import mxnet as mx
import numpy as np
from ..processing.generate_anchor import generate_anchors
def check_equal(lst, errstr='check_equal'):
assert len(set(lst)) <= 1, '%s:%s' % (errstr, lst)
class RPNIoULossOperator(mx.operator.CustomOp):
def __init__(self, feature_stride, scales, ratios, grad_scale):
... |
# Autores: <NAME>, <NAME> & <NAME> | 2021
# AFD e um acronimo para Automato Finito Deterministico
from parseInput import parseAfd, parseNodes, parse_pairs
from node import AFDNode
from pair import Pair
class AFD:
def __init__(self, file_path):
parsed_file = parseAfd(file_path)
if not parsed_file:
... |
# 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... |
"""
Postprocess the SIMBA and VELOCIraptor outputs into new files that describe
the particles contained in each halo by _position in the file_ rather than
particle ID.
"""
import numpy as np
import h5py
from typing import Tuple
from helper import *
class InputError(Exception):
"""Exception raised for errors in... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
r"""
This bot automatically fills in empty image pages.
Parameters:
-summary Extra message to add to the edit summary.
Example:
python3 pwb.py qc_titles '-summary:extra message'
"""
#
# © <NAME>, 2019
# Written for Questionable Content Wiki
#
# Distributed under... |
from os import path, environ, walk
import subprocess
import requests
import sys
from tempfile import NamedTemporaryFile
import pyodbc
import logging
import backoff
import semihour
logging.basicConfig(level=logging.INFO)
CONDUCTOR_PWD = path.dirname(path.abspath(__file__))
SQL_SERVER_URL = environ.get('SQL_SERVER_URL... |
from __future__ import print_function
import os
import shutil
import time
import stacked_dae as SDAE
from os.path import join as pjoin
import numpy as np
import pandas as pd
from tools.config import FLAGS, home_out
from tools.start_tensorboard import start_tb
from tools.data_handler import load_data, load_linarsson_... |
"""Wrappers for cosmos(mongo api).
All mongo logic - searching, insering and updating is hidden right here.
Another important thing in this module is caching of a mongo connection. Every
time there is new connection request (this is actually throttled to 20
seconds), we try one simple command at first, so if connecti... |
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
import seaborn as sns
sns.set()
# Handling Nan values
def handel_nan(DATA, Median=False):
"""[summary]
DESCRIPTION :-
1. If no. of nan > 50% in a column it will remove that column.
2. int type coumn will be ... |
import torch as th
import torch.autograd
import numpy as np
class NormalizeGradients(th.autograd.Function):
@staticmethod
def forward(ctx, input):
return input
@staticmethod
def backward(ctx, grad_out):
return grad_out.div(th.norm(grad_out, 1) + 1e-12)
class ContentLoss(th.nn.Modul... |
"""Point cloud library for Noisemaker. Used for Voronoi and DLA functions."""
import math
import random
from noisemaker.constants import PointDistribution, ValueMask
import noisemaker.masks as masks
import noisemaker.simplex as simplex
def point_cloud(freq, distrib=PointDistribution.random, shape=None, corners=Fal... |
#!/usr/bin/env python
#
# Author: <NAME> <<EMAIL>>
#
import time
import ctypes
import tempfile
import numpy
import h5py
from pyscf import lib
from pyscf.lib import logger
from pyscf import ao2mo
from pyscf.cc import ccsd
from pyscf.cc import _ccsd
from pyscf.cc.ccsd_t_lambda_slow import p6_, r6_
from pyscf.cc import c... |
# -*- coding: utf-8 -*-
"""Color routines."""
#------------------------------------------------------------------------------
# Imports
#------------------------------------------------------------------------------
import colorcet as cc
import logging
from phylib.utils import Bunch
from phylib.io.array import _ind... |
# -*- coding: utf-8 -*-
from ossreport.proto.proto import Risk, Level, Component, File
class BuilderException(Exception):
def __init__(self, info):
super().__init__(self)
self._info = info
def __str__(self):
return self._info
class Builder(object):
_COMPONENT_SEP = ","
_VUL... |
"""Main module."""
# from nldi_xstool.cli import xsatendpts
import sys
from typing import Any
from typing import List
from typing import Optional
from typing import Tuple
import geopandas as gpd
import numpy as np
import pandas as pd
import py3dep
import requests
from pynhd import NLDI
from shapely.geometry import Lin... |
# To use this code, make sure you
#
# import json
#
# and then, to convert JSON from a string, do
#
# result = exchanges_info_from_dict(json.loads(json_string))
from dataclasses import dataclass
from typing import Optional, Any, List, Dict, TypeVar, Type, Callable, cast
from cryptocompsdk.general.parse import... |
import classes
import sys
import random
import playNDE
"""
AI move selector for NDE. Move evaluation by maximizing weights.
"""
def getMovablePieces(pieceList): # similar to choosePiece function in playNDE but finding moves starts evaluation
piecesToPick = [] # a list of pieces to evaluate moves for
dice = [1... |
# 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, ... |
import json
import logging
from urlparse import urlunparse, urlparse
import treq
from twisted.internet.defer import inlineCallbacks, CancelledError
from twisted.web.client import ResponseFailed, RequestTransmissionFailed
from twisted.internet.error import (
ConnectingCancelledError, ConnectionDone, ConnectionRefu... |
"""
Module: libpcp.dft
Author: <NAME>, International Audio Laboratories Erlangen
License: The MIT license, https://opensource.org/licenses/MIT
This file is part of the PCP Notebooks (https://www.audiolabs-erlangen.de/PCP)
"""
import numpy as np
from matplotlib import pyplot as plt
import libpcp.signal
def plot_inner... |
#!/usr/bin/env python
import json
from lulu.common import (
match1,
url_info,
print_info,
get_content,
download_urls,
playlist_not_supported,
)
__all__ = ['flickr_download_main']
site_info = 'flickr.com'
pattern_url_photoset = (
r'https?://www\.flickr\.com/photos/.+/(?:(?:sets)|(?:albu... |
#
# This file is part of pretix (Community Edition).
#
# Copyright (C) 2014-2020 <NAME> and contributors
# Copyright (C) 2020-2021 rami.io GmbH and contributors
#
# This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General
# Public License as published by the Free... |
# -*- coding: utf-8 -*-
"""Tests for imfusion.insertions.util module."""
# pylint: disable=wildcard-import,redefined-builtin,unused-wildcard-import
from __future__ import absolute_import, division, print_function
from builtins import *
# pylint: enable=wildcard-import,redefined-builtin,unused-wildcard-import
import p... |
#-----------------------------------------------
# built in function used
# split, print, open, readline, close, lower
# built in datatype used
# int, str, tuple
#-----------------------------------------------
#----------------------------
# Singly linked list node
#----------------------------
class LinkedListNod... |
"""
A smarter {% if %} tag for django templates.
While retaining current Django functionality, it also handles equality,
greater than and less than operators. Some common case examples::
{% if articles|length >= 5 %}...{% endif %}
{% if "ifnotequal tag" != "beautiful" %}...{% endif %}
"""
import unit... |
import pytest
from saq.modules.sandbox import *
@pytest.mark.unit
def test_contacted_host():
c1 = ContactedHost(ip='192.168.1.1', port='80')
c2 = ContactedHost(ip='192.168.1.1', port='80', protocol='TCP', associated_domains=['localhost.localdomain'])
assert c1 == c2
assert c1.json == {
'ip':... |
# -*- coding: utf-8 -*- #
# Copyright 2020 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... |
#!/usr/bin/env python
#Copyright (C) 2011 by <NAME>
#
#Released under the MIT license, see LICENSE.txt
#!/usr/bin/env python
"""Create the multi_cactus xml and directory structure from a workflow template
"""
import os
import xml.etree.ElementTree as ET
import copy
from operator import itemgetter
from cactus.progr... |
# -*- coding: utf-8 -*-
import collections
import chainer
import chainer.functions as F
import chainer.links as L
class BasicBlock(chainer.Chain):
def __init__(self, in_ch, out_ch, stride):
super(BasicBlock, self).__init__()
reduction = 0.5
self.stride = stride
self.in_ch = in_c... |
# 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... |
from __future__ import absolute_import
from torchvision.transforms import *
import random
import math
import numpy as np
from PIL import Image, ImageEnhance, ImageOps, ImageFilter
class RectScale(object):
def __init__(self, height, width, interpolation=Image.BILINEAR):
self.height = height
self.w... |
# coding: utf-8
# --------------------------------------------------------
# Tensorflow Faster R-CNN
# Licensed under The MIT License [see LICENSE for details]
# Written by <NAME>, <NAME>, based on code from <NAME>
# --------------------------------------------------------
from __future__ import absolute_import
from __... |
import os
import unittest
from subprocess import call, check_call, check_output
import pytest
from .testutils import MixInGitReposPerMethod, MixInGitReposPerClass
from .test_git_tools import commitchange
from git_blackhole import make_run, trash_commitish, trashinfo, gettrashes, \
git_json_commit, cli_init, cli_t... |
import time
import datetime
import pytz
import pandas as pd
import numpy as np
import xbos_services_getter as xsg
from .local_thermal_model.ThermalModel import ThermalModel
def check_data_zones(zones, data_dict, start, end, window, check_nan=True):
for zone in zones:
if zone not in data_dict:
... |
import torch
import numpy as np
import typing
__all__ = ['UniformSimulatedAnnealing', 'GaussianSimulatedAnnealing']
#NOTE: modified from https://github.com/jramapuram/SimulatedAnnealing
class UniformSampler(object):
def __init__(self,
minval: float,
maxval: float,
dtype: str='float',
... |
# encoding=utf8
from __future__ import unicode_literals
from ..conftest import import_members, import_energy_meters, import_bookings
import datetime
def setUp():
import_members()
import_energy_meters()
import_bookings()
def test_meter_has_values_for_each_year(database):
from ..electricity import Ele... |
# -*- coding: utf-8 -*-
# samplers.py
# MIT License
# Copyright (c) 2017 <NAME>
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the right... |
#!/usr/bin/env python
"""Tests alternate OBOReader."""
import os
import sys
import timeit
import datetime
from goatools.obo_parser import GODag
from goatools.gosubdag.gosubdag import GoSubDag
from goatools.gosubdag.rpt.write_hierarchy import WrHierGO
#################################################################... |
from .entities import *
import msgpack
from .httpd import Route
import asyncio
from .errors import *
class MemberIterator:
def __init__(self, client, guild, limit=None, after=None):
self.client = client
self.guild = guild
self.limit = limit or 1000
self.after = after or Snowflake("... |
from typing import Any, Callable, List, Optional, Tuple, Union
import torch
from torch import Tensor
from torchaudio._internal import (
module_utils as _mod_utils,
misc_ops as _misc_ops,
)
from torchaudio.utils.sox_utils import list_effects
if _mod_utils.is_module_available('torchaudio._torchaudio'):
fr... |
import tensorflow as tf
from tflearn.layers.conv import global_avg_pool
from tensorflow.contrib.layers import batch_norm, flatten
from tensorflow.contrib.framework import arg_scope
import numpy as np
from ops import *
########################################
############hyper parameters############
####################... |
# Copyright 2015 Ufora Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... |
import json
import logging
import os
from datetime import timedelta
from functools import partial
from pprint import pformat
from urllib.parse import urlparse
from pathlib import Path
from tempfile import TemporaryDirectory
from typing import Callable, Iterable, List
import airflow
from airflow.operators.trigger_dagru... |
"""more ytk tables
Revision ID: 61649bf931f1
Revises: 87e20657e329
Create Date: 2017-03-05 16:57:34.027388
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '<KEY>'
down_revision = '87e20657e329'
branch_labels = None
depends_on = None
def upgrade():
# ### c... |
import math
import torch
import torch.nn as nn
from model import common
url = {
'r16f64x2': 'https://cv.snu.ac.kr/research/EDSR/models/edsr_baseline_x2-1bc95232.pt',
'r16f64x3': 'https://cv.snu.ac.kr/research/EDSR/models/edsr_baseline_x3-abf2a44e.pt',
'r16f64x4': 'https://cv.snu.ac.kr/research/EDSR/models/... |
import tensorflow_datasets as tfds
import larq as lq
import tensorflow as tf
import tensorflow.keras as keras
import larq_zoo as lqz
from urllib.request import urlopen
from PIL import Image
import numpy as np
import pandas as pd
import time
from fullRenorm import *
from fullestRenorm import *
from remadeQuicknet impo... |
import math
import numpy as np
import torch
import torch.nn.functional as F
from PIL import Image
def pixel_to_camera(uv_tensor, kk, z_met):
"""
Convert a tensor in pixel coordinate to absolute camera coordinates
It accepts lists or torch/numpy tensors of (m, 2) or (m, x, 2)
where x is the number of ... |
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# 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 ... |
import csv
import io
import json
import pytz
from django.contrib import messages
from django.contrib.auth import get_user_model, login, logout
from django.core.exceptions import PermissionDenied
from django.http import HttpResponse
from django.shortcuts import render, redirect, reverse
from django.urls import reverse_... |
import numpy as np
import pytest
import nengo
from nengo.exceptions import SimulationError, ValidationError
from nengo.rc import rc
def test_time(Simulator, allclose):
with nengo.Network() as model:
u = nengo.Node(output=lambda t: t)
up = nengo.Probe(u)
with Simulator(model) as sim:
... |
'''
Copyright 2019, Institute for Systems Biology
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 wr... |
#!/usr/bin/env python
import sys
import xml.etree.ElementTree as ET
from itertools import chain
from collections import defaultdict, Counter
from logging import info, warning, error
# Normalization attribute constants
NORM_ATTR_PREFIX = 'norm_'
CONF_ATTR_SUFFIX = '_conf'
def _generate_unique(prefix):
"""Retur... |
import random
import sys
import time
import networkx as nx
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
from copy import copy
import itertools
from collections import deque
import pandas as pd
from tqdm import tqdm
def coalition_keys_to_str(c):
c_list = [c_t + 1 for c_t in c]
r = ... |
from collections import deque
from datetime import datetime
"""
I converted my original input into binary by replacing "#" with 1 and "," to 0.
It made comparing easier by leveraging the built-in int function with base 2.
It also made finding the number of plants easy.
"""
def no_game_no_life(seed, rules, iteratio... |
#Copyright (c) 2020 <NAME>, <NAME>, <NAME>, and <NAME>
#Permission is hereby granted, free of charge, to any person obtaining a copy of
#this software and associated documentation files (the "Software"), to deal in
#the Software without restriction, including without limitation the rights to
#use, copy, modify, merge,... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.