text stringlengths 3.07k 22.1k |
|---|
import os
import itertools
from urlparse import urljoin
from .utils import force_str, force_unicode
__all__ = ('Storage')
def reraise(exception):
kwargs = {
'message': exception.message,
'wrapped_exception': exception
}
# cloudfiles and S3Boto exceptions have http compatible status code... |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import _utilities
__a... |
__authors__ = ["<NAME>", "<NAME>", "<NAME>"]
__copyright__ = "Copyright 2015, <NAME>"
__email__ = "<EMAIL>"
__license__ = "MIT"
import sys
import os
from os.path import join
from subprocess import call
from tempfile import mkdtemp
import hashlib
import urllib
from shutil import rmtree
from snakemake import snakemake
... |
"""
© Copyright 2021 Graphcore Ltd. All rights reserved.
© Copyright 2020, The Hugging Face Team, Licenced under the Apache License,Version 2.0
"""
"""
# Hugging Face: Fine-tuning a pretrained transformer
This tutorial demonstrates how to fine-tune a pretrained model from the Hugging
Face transformers library using ... |
"""
Module that provides retrying-at-a-particular-interval functionality.
"""
import random
from characteristic import Attribute, attributes
from effect import Delay, Effect, Func, sync_performer
from effect.retry import retry as effect_retry
from twisted.internet import defer
from twisted.python.failure import Fai... |
import time
from collections import deque
import torch
import numpy as np
from ... import mohex, hex
from . import json, analysis
from .. import common
from rebar import arrdict
from pavlov import stats, runs, logs
from logging import getLogger
import activelo
import pandas as pd
from functools import wraps
from contex... |
import logging
from os.path import dirname, join, realpath
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import astroplan as ap
from scipy.constants import c as c_light_ms
from tqdm import tqdm
from skimage import io
from skimage import transform as tf
from scipy.interpolate import interp1d
... |
import numpy as np
from .util import ensure_rng
def _hashable(x):
""" ensure that an point is hashable by a python dict """
return tuple(map(float, x))
class TargetSpace(object):
"""
Holds the param-space coordinates (X) and target values (Y)
Allows for constant-time appends while ensuring no du... |
#!/usr/bin/python3
import re
import lib.db as DB
import logging
import time
import json
from datetime import datetime, timedelta
from dateutil import parser as dt_parser
from lxml import etree
# Everything is presumed to be weekly and on the minute
# scale. We use this to do wrap around when necessary
MINUTES_PER_WEEK... |
from typing import Dict, Tuple
import networkx as nx
from networkx.classes import graph
import numpy as np
from functools import partial
from bokeh.plotting import from_networkx,figure
from bokeh.models import Circle
from bokeh.models import HoverTool
from bokeh.models import MultiLine
from bokeh.models import NodesAnd... |
import sys
import types
import textwrap
from collections import OrderedDict
from .bits import *
__all__ = ["bitstruct"]
class _bitstruct:
__slots__ = ()
@staticmethod
def _check_bits_(action, expected_width, value):
assert isinstance(value, bits)
if len(value) != expected_width:
... |
# -*- coding: utf-8 -*-
"""
Driver for the Keithley instruments
Manual for the KT2400 found in 'http://research.physics.illinois.edu/bezryadin/
labprotocol/Keithley2400Manual.pdf'
@author: <EMAIL>
"""
import numpy as np
from .generic_instruments import Instrument, INTF_PROLOGIX
def fake_iv_relation(
src_type,
... |
"""Module containing class `AstronomicalCalculator`."""
from pathlib import Path
import datetime
import pytz
from skyfield import almanac
from skyfield.api import Topos, load, load_file
_EPHEMERIS_FILE_PATH = Path(__file__).parent / 'data' / 'de421.bsp'
"""
Jet Propulsion Laboratory Development Ephemeris (JPL DE) ... |
# BSD 3-Clause License; see https://github.com/jpivarski/awkward-1.0/blob/master/LICENSE
import glob
import os
import platform
import subprocess
import sys
import distutils.util
import multiprocessing
import shutil
import setuptools
import setuptools.command.build_ext
import setuptools.command.install
from setuptool... |
# Copyright (c) 2018-2021, NVIDIA CORPORATION. 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 ... |
import certifi
import datetime
import json
import logging
import os
import posixpath
import threading
import urllib.request, urllib.parse, urllib.error
import urllib.parse
import socket
from time import mktime
from email.utils import formatdate
from http.server import HTTPServer
from http.server import SimpleHTTPReque... |
#!/usr/bin/env python3
import argparse
import logging
import sys
import os
import time
from multiprocessing import Process
from concurrent.futures import ThreadPoolExecutor
from pathlib import Path
from kube_env import setup_application_deployment, stop_kubernetes
from benchmark.benchmark import start_benchmark
import ... |
import datetime
from random import random
from time import sleep
import requests
import tensorflow.compat.v1 as tf
from geopy.geocoders import Nominatim
tf.disable_v2_behavior()
import json
import os
from time import time
from PIL import Image
import person_detector
from config import (JSON_LOGS_FOLDER, PROFILES_FILE, ... |
import os
import numpy as np
from random import choices
from radar_scenes.sequence import get_training_sequences, get_validation_sequences, Sequence
from radar_scenes.labels import ClassificationLabel
from radar_scenes.evaluation import per_point_predictions_to_json, PredictionFileSchemas
class SemSegNetwork:
"""... |
#!/usr/bin/python3
import asyncio
import csv
import httpx
import json
import os
import statistics
import sys
import tabulate
import time
import tsv
from catalog.catalog import Item
BROKER_RATE = 0.05
REPROCESSING_EFFICIENCY = 0.5
REPROCESSING_TAX_RATE = 0.05
SALES_TAX_RATE = 0.05
ESI_MARKET_HISTORY_URI = "https://es... |
import argparse
import glob
import os
import pickle
import sys
import time
from itertools import product
import matplotlib.pyplot as plt
import multiprocessing as mp
import numpy as np
import pandas as pd
import seaborn as sns
import statsmodels.nonparametric.api as smnp
import swifter
import utils
import graphs
N_P... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
##############################################################################
# #
# (C) 2014 Arulalan.T <<EMAIL>> #
# ... |
import torch
import torch.nn as nn
import torch.nn.functional as F
from .fixed_point_solver import NeuralFixedPoint
from .root_find_solver import NeuralRootFind
from .diffeq_solver import DiffeqSolver
class SPDEFunc0d(torch.nn.Module):
""" Modelling local operators F and G in (latent) SPDE (d_t - L)u = F(u)dt + G... |
import atexit
import collections
import datetime
import glob
import logging
import os
import signal
import threading
import time
from enum import Enum
from subprocess import Popen, PIPE
import requests
from mcadmin.config import CONFIG
from mcadmin.io.files.server_list import SERVER_LIST
_EULA_TXT = 'eula.txt'
_LOGG... |
# LocalMktdataSubscriptionExample.py
from __future__ import print_function
from __future__ import absolute_import
from optparse import OptionParser, OptionValueError
import os
import platform as plat
import sys
if sys.version_info >= (3, 8) and plat.system().lower() == "windows":
# pylint: disable=no-member
w... |
from oarepo_oai_pmh_harvester.decorators import rule
from oarepo_oai_pmh_harvester.transformer import OAITransformer
from oarepo_taxonomies.utils import get_taxonomy_json
@rule("nusl", "marcxml", "/998__/a", phase="pre")
def call_provider(el, **kwargs):
return provider(el, **kwargs) # pragma: no cover
def prov... |
import numpy as np
import torch
import torch.nn.functional as F
import torch.nn as nn
from pytorch.utils import flip, _ntuple, HardSigmoid, StochasticDropout, LayerNorm
class ST_round(torch.autograd.Function):
def __init__(self, gradient_factor=1.0):
super(ST_round, self).__init__()
self.gradien... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2013 <NAME>
#
# Everyone is permitted to copy and distribute verbatim or modified
# copies of this license document, and changing it is allowed as long
# as the name is changed.
#
# DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
# TERMS AND CONDITI... |
from typing import List, Dict, Callable, Union, Optional
import abc
import types
import logging
from functools import partial
from contextlib import ExitStack
from common_pyutil.functional import first, maybe_then
def partial_or_func_name(x: Callable, describe: bool = False):
return maybe_then(x, [partial, types.... |
#!/usr/bin/env python
import roslib
roslib.load_manifest('crazyflie_control')
import rospy
import sys
from geometry_msgs.msg import Vector3
from nav_msgs.msg import Odometry
from crazyflie_driver.msg import RPYT
import dynamic_reconfigure.server
from crazyflie_control.cfg import CrazyflieControlConfig
from math imp... |
## data folder: D:\work\project\ITA Refresh\Session4 Oil Prediction
# -*- coding: utf-8 -*-
from __future__ import print_function
import time
import warnings
import numpy as np
import time
import matplotlib.pyplot as plt
from numpy import newaxis
from keras.layers.core import Dense, Activation, Dropout
from keras.la... |
#
# Copyright 2021 (c) Microsoft Corporation
#
# MIT License
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this script and associated documentation files (the "script"), to deal
# in the script without restriction, including without limitation the rights
# to use, copy, modify, m... |
"""
MARS compiler backend - responsible for taking program events emitted by the
driver and converting them into code.
"""
import logging
from ..backend_utils import FunctionStack
from .common32 import Common32Backend
from .. import types
from ..util import mangle_label
LOGGER = logging.getLogger('spc.mars_mips')
cl... |
"""
McAfee Command Line AntiVirus Python Wrapper.
This module contains system independent code for executing and processing the
results of the McAfee Command Line AV Scanner. It is originally targetted to linux but should be
compatible with windows also with minimal modifications.
"""
import logging
import os
impo... |
"""
SC101 Baby Names Project
Adapted from <NAME>'s Baby Names assignment by
<NAME>.
FILE: Babygraphics.py
NAME: <NAME>
"""
import tkinter
import babynames
import babygraphicsgui as gui
FILENAMES = [
'data/full/baby-1900.txt', 'data/full/baby-1910.txt',
'data/full/baby-1920.txt', 'data/full/baby-1930.txt',
... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import logging
import re
from django.core.exceptions import ValidationError
from django.utils.translation import ugettext_lazy as _
from lck.dja... |
"""Python module for COVID-19 Survival-Convolution Death Model.
In this module we focus on predicting the number of deaths with a similar
approach to modeling the number of infections.
"""
from typing import Optional, Sequence, Text, Tuple
import numpy as np
import tensorflow as tf
import piecewise_linear_infection_mo... |
"""Training script.
usage: train.py [options]
options:
--inner_learning_rate=ilr Learning rate of inner loop [default: 1e-3]
--outer_learning_rate=olr Learning rate of outer loop [default: 1e-4]
--batch_size=bs Size of task to train with [default: 4]
--inner_epochs=ie Amount o... |
# -*- coding: utf-8 -*-
r"""
:mod:`ganground.metric.kernel` -- Kernel function definitions
=============================================================
.. module:: kernel
:platform: Unix
:synopsis: Helper functions for Maximum Mean Discrepancy, plus kernel
function definitions.
"""
from abc import abstra... |
import json
import jsonschema
import os
from nose.tools import assert_raises
from jsonschema.exceptions import ValidationError
dir_this = os.path.dirname(__file__)
schema_file = os.path.join(dir_this, '../resources/statements_schema.json')
with open(schema_file, 'r') as f:
schema = json.loads(f.read())
valid_agen... |
"""
Evaluates the performance on the UKP ASPECT Corpus with hierachical clustering.
Greedy hierachical clustering.
Merges two clusters if the pairwise mean cluster similarity is larger than a threshold.
Merges clusters with highest similarity first
Uses dev set to determine the threshold for supervised systems
"""
imp... |
import numpy as np
import tensorflow as tf
from tensorflow.keras.wrappers.scikit_learn import KerasClassifier
from tensorflow.keras.layers import Conv1D, Conv2D, Conv3D, MaxPool1D, \
MaxPool2D, MaxPool3D, Dense, Flatten, Dropout
from mil.errors.custom_exceptions import Dimensi... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import os
import numpy as np
import pandas as pd
import datetime as dt
import netCDF4 as cdf
import matplotlib.pyplot as plt
import matplotlib.ticker as mticker
import cartopy
cartopy.config['data_dir'] = '/data/project/cartopy/'
import cartopy.crs as ccrs
impor... |
from operator import add, sub, mul
def prune_min(t):
"""Prune the tree mutatively from the bottom up.
>>> t1 = Tree(6)
>>> prune_min(t1)
>>> t1
Tree(6)
>>> t2 = Tree(6, [Tree(3), Tree(4)])
>>> prune_min(t2)
>>> t2
Tree(6, [Tree(3)])
>>> t3 = Tree(6, [Tree(3, [Tree(1), Tree(2)])... |
#-*-coding:utf-8-*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import re
from absl import app as absl_app
from absl import flags
import tensorflow as tf # pylint: disable=g-bad-import-order
from resnet import resnet_model
from resnet impor... |
"""
Module with functions and methods for NEXUS files.
Parsing and writing of NEXUS files is currently done with a very simple,
string manipulation strategy.
"""
# TODO: allow to output taxa and character names between quotes, if necessary
# TODO: sort using assumptions (charset) if provided
# TODO: support comments ... |
"""
Utilities to aid unit testing L{eliot} and code that uses it.
"""
from __future__ import unicode_literals
from unittest import SkipTest
from functools import wraps
from pyrsistent import PClass, field
from six import text_type
from ._action import (
ACTION_STATUS_FIELD,
ACTION_TYPE_FIELD,
STARTED_ST... |
# train_networks.py
# For training CNNs and SDNs via IC-only and SDN-training strategies
# It trains and save the resulting models to an output directory specified in the main function
import os
# os.environ['CUDA_VISIBLE_DEVICES'] = '0'
import copy
import torch
import time
import os
import random
import numpy as np
f... |
"""
Evaluation Scripts
"""
from __future__ import absolute_import
from __future__ import division
from collections import namedtuple, OrderedDict
from network import mynn
import argparse
import logging
import os
import torch
import time
import numpy as np
from config import cfg, assert_and_infer_cfg
import network
imp... |
#!/usr/bin/env python3
####################
# Node
class DagrNode(object):
nodes_by_name = dict()
def __init__(self, name, parents=[], cmd=None):
self.name = name
self.parents = set(parents)
assert name not in DagrNode.nodes_by_name
DagrNode.nodes_by_name[name] = self
... |
"Data model implementation for the game."
from collections import namedtuple
from copy import deepcopy
from enum import IntEnum
def print_board(board):
print(" ", ' '.join(str(index) for index in range(8)))
for index, line in enumerate(board):
print(index, ' '.join(str(piece) for piece in line))
cla... |
from __future__ import absolute_import, division, print_function
import os
import sys
import pprint
import random
import socket
import docker
import logging
import time
import tempfile
cur_dir = os.path.dirname(os.path.abspath(__file__))
sys.path.insert(0, os.path.abspath("%s/../clipper_admin" % cur_dir))
from clipper_... |
# -*- coding: utf-8 -*-
"""
Created on Fri Jun 5 16:57:37 2020
@author: rkhat
"""
from tkinter import *
from tkinter import ttk, filedialog, messagebox
import pytesseract
import cv2
class ReadFileApp:
master=None
def __init__(self, master):
self.master=master
self.x_start, self.y_start,... |
from django_tables2 import RequestConfig
from django.shortcuts import render, redirect
from django.forms import modelformset_factory, inlineformset_factory
from django.views.decorators.csrf import csrf_protect, csrf_exempt
from django.contrib.auth.decorators import login_required
from .tables import PaymentTable
from .... |
#!/usr/bin/env python3
import os
import re
import json
import typing
import argparse
# region Global sets
# A set of category folder names in current sample viewer.
categories = {
'Maps',
'Layers',
'Features',
'Display information',
'Search',
'Edit data',
'Geometry',
'Route and direct... |
#!/usr/bin/env python
"""
Copyright (C) 2017 NVIDIA Corporation. All rights reserved.
Licensed under the CC BY-NC-ND 4.0 license (https://creativecommons.org/licenses/by-nc-nd/4.0/legalcode).
"""
'''
Takes a two, two way trainers and generates composed image to image translation
across four distributions
'''
import ... |
import xbmcgui
import xbmcplugin
import xbmcaddon
import simplejson as json
import hyperion_client
import pyxbmct
import socket
import routing
ADDON = xbmcaddon.Addon()
#ADDONNAME = ADDON.getAddonInfo('id')
plugin = routing.Plugin()
xbmcplugin.setContent(plugin.handle, 'files')
#path = os.path.dirname(os.path.real... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# C++ version Copyright (c) 2006-2007 <NAME> http://www.box2d.org
# Python version Copyright (c) 2010 kne / sirkne at gmail dot com
#
# This software is provided 'as-is', without any express or implied
# warranty. In no event will the authors be held liable for an... |
import torch
import torch.nn as nn
from torch import Tensor
"""
An implementation of CoordBDVAE that combines a Spatial Broadcast Decoder VAE with Coordinate Convolutional Layers.
Original author: <NAME>
Heavily modified by <NAME>
"""
class CoordConv(nn.Module):
"""
A Coordinate Convolutional Layer that use... |
from sklearn.neighbors import KernelDensity
from scipy import signal
import networkx as nx
import numpy as np
def ClusterPeak(List,sd):
sd = max(10,sd)
x=np.array(sorted(List))
y=[[i] for i in x]
kde = KernelDensity(kernel='gaussian', bandwidth=min(sd/2,100)).fit(y)
log_density = kde.score_samples(y)
... |
import os
import os.path
import sys
import random
import json
import tempfile
import shutil
from twisted.internet import reactor, defer
from twisted.trial import unittest
pd = os.path.dirname
this_dir = pd(os.path.abspath(__file__))
sys.path.append( pd(this_dir) )
sys.path.append( os.path.join(pd(this_dir), 'exampl... |
import torch
import sys
import os
import numpy as np
from abc import ABC
from transformers import BertTokenizer
import transformers
from typing import List
sys.path.append(os.path.join('..', 'stel'))
from set_for_global import set_global_seed, set_torch_device, set_logging, EVAL_BATCH_SIZE
BERT_MAX_WORDS = 250
# OPT... |
import os
import logging
import posixpath
import stat
from django.utils.http import urlquote
from seaserv import seafile_api
from seahub.base.models import UserStarredFiles
from seahub.base.templatetags.seahub_tags import email2nickname, email2contact_email
from seahub.settings import ENABLE_VIDEO_THUMBNAIL, THUMBNAI... |
'''
Refer to AdderNet code.
Efficient CUDA implementation for AdderNet training.
'''
import torch
import torch.nn as nn
# import adder_cuda
import numpy as np
from torch.autograd import Function
from .quantize import quantize, quantize_grad, QuantMeasure, calculate_qparams
import deepshift.ste as ste
from torch.utils.... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Neighborhood Profiler Script
<NAME>; Feb-April 2016
This script uses an mxd map template to query neighborhood information, places
that info into an HTML template, and finally kicks those HTML files out to PDF.
This script relies on up-to-date data that is managed man... |
"""Utility functions for dtoolcore."""
import os
import errno
import getpass
import hashlib
import json
import platform
import binascii
import base64
import datetime
import re
import socket
import logging
try:
from urlparse import urlparse, urlunparse
except ImportError:
from urllib.parse import urlparse, url... |
import sys
import copy
import logging
import warnings
import collections
from typing import Callable, Union, Any, Type, Dict, Tuple, Iterable
import torch
from torch import nn
from torch.optim.optimizer import Optimizer
from torch.nn.parallel import DataParallel, DistributedDataParallel
import argus
from argus import... |
import torch
from torch.nn import Linear, ReLU, LeakyReLU
from torch import nn
from torch.utils.data import Dataset, DataLoader
import os
from .utils import cal_num_bins
from torch.optim import lr_scheduler
import sys
class Semi_encoding_multiple(torch.nn.Module):
"""
Model for combined features
"""
de... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""First simple sklearn classifier"""
from __future__ import division # 1/2 == 0.5, as in Py3
from __future__ import absolute_import # avoid hiding global modules with locals
from __future__ import print_function # force use of print("hello")
from __future__ import unico... |
# -*- coding: utf-8 -*-
"""
Copyright [2009-2017] EMBL-European Bioinformatics Institute
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... |
"""Calculations to automatically select Tonnetz.
This is a script to provide all functions in order to automatically select
Tonnetz System and modify chords.
"""
import ast
from itertools import product
from Data_and_Dicts import dictOfTonnetze
import music21 as ms
def parsedFile(file):
"""Take a parsed file an... |
import torch
from mmdet3d.ops import SparseBasicBlock
from mmdet3d.ops import spconv as spconv
def test_SparseUNet():
from mmdet3d.models.middle_encoders.sparse_unet import SparseUNet
self = SparseUNet(in_channels=4, sparse_shape=[41, 1600, 1408])
# test encoder layers
assert len(self.encoder_layers... |
"""
Some basic inference functions adapted from my inferno module which should be available
here soon:
https://github.com/nealegibson/inferno
Really they are just rewritten versions of https://github.com/nealegibson/Infer
But there are many other options for optimisers/MCMCs/etc, and they should (in principle)
all do m... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue May 18 14:42:02 2020
@author: figueroa
"""
import sys
import numpy as np
import warnings
from sklearn.gaussian_process import GaussianProcessRegressor
from sklearn.gaussian_process.kernels import RBF, WhiteKernel, ConstantKernel as C
from scipy import l... |
'''This module manages the auxiliary vertical lines'''
from __future__ import absolute_import
from PyQt5 import QtWidgets as qtw
from PyQt5 import QtCore as qtc
from PyQt5 import QtGui as qtg
from ..design.auxVlines_design import Ui_MainWindow
from .aux_line import AuxLine
from ..validators import NumValidator... |
# -*- coding: utf-8 -*-
# Author: <NAME> <<EMAIL>>
import pickle
import os
import pytest
import numpy as np
from renormalizer.model import MolList, MolList2, ModelTranslator, Mol, Phonon
from renormalizer.mps import Mpo, Mps
from renormalizer.tests.parameter import mol_list, ph_phys_dim, omega_quantities
from renorm... |
"""
@author: <NAME>
"""
# REFERENCES:
# https://pymotw.com/2/asynchat/
# tuple unpacking https://stackoverflow.com/questions/1993727/expanding-tuples-into-arguments
# https://pymotw.com/2/asyncore/
import asyncore
import logging
import socket
import threading #would multiprocessing be better?
import time
packet_... |
import os
import numpy as np
import holoviews as hv
import pandas as pd
import logging
from bokeh.models import HoverTool
import holoviews as hv
import datashader as ds
from holoviews.operation.datashader import aggregate, datashade, dynspread
import colorcet as cc
import param
import parambokeh
from lsst.pipe.ta... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
'''
Workflow for getting subject info
presumes fmriprep has run, expects directories to exist for
both BIDS data and fmriprep output
'''
from __future__ import ... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import json
import os
import re
from datetime import datetime
from flask import abort, flash, redirect, render_template, request, url_for
from flask_login import current_user, login_required, login_user, logout_user
from subprocess import check_output
from twicorder imp... |
# -*- coding: utf-8 -*-
import gnupg
from flask import (
Blueprint,
Response,
abort,
current_app,
json,
redirect,
request,
send_from_directory,
url_for,
)
from ..ext import cache, db
from ..models import (
Architecture,
Build,
Description,
DisplayName,
Download,
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""objetos.py: Objetos e utilidades necessários para a implementação do algoritmo"""
__copyright__ = "Copyright (c) 2021 <NAME> & <NAME>. MIT. See attached LICENSE.txt file"
from math import sqrt
from copy import deepcopy
from sys import maxsize as int_inf
from typing i... |
import argparse
import os
import time
import datetime
import yaml
import tensorflow as tf
import numpy as np
import src.core as core
from src.retina_net import config_utils
from src.core import constants
from src.retina_net.builders import dataset_handler_builder
from src.retina_net.models.retinanet_model import Reti... |
import os
import sys
import json
import random
import numpy as np
import torch
from tqdm import tqdm, trange
from scipy.sparse import coo_matrix
from torch.utils.data import DataLoader, SequentialSampler, TensorDataset
import blink.candidate_ranking.utils as utils
from blink.common.params import BlinkParser
from blin... |
from pipeline import traversal_folder, run_IC3, parse_raw_output1, \
parse_raw_output2, parse_raw_output3, get_AC_rate, parse_raw_output4, test_IF_samples_abc, write_file_print
from rand_init_sampler import read_aig_latch
import time
import os
'''
Run Init2 to get IV/Frame, and also get the initial sample overlap ... |
import datetime
import os
import errno
import csv
import hashlib
import sys
import subprocess
import pickle
def get_datestamp():
t = datetime.datetime.now()
datestamp = '%d_%02d_%02d' % (t.year, t.month, t.day)
return datestamp
def get_timestamp(ts = None):
if ts == None:
t=datetime.datetime.n... |
"""
Copyright 2018 <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 writing, ... |
#!/usr/bin/env python
"""
Create incidents that group together multiple layers of annotations.
This is based on the createIncidentReportsFromEnhancements function from
EIDR-Connect, although some differences exist in the output structure,
and code related to manual curation (e.g. the accepted attribute)
is not included... |
# -*- coding: utf-8 -*-
# py2.7 and py3 compatibility imports
from __future__ import unicode_literals
import logging
import socket, requests, json
from collections import defaultdict
from django.db import models
from django.db.models.signals import post_save, post_delete
from django.dispatch import receiver
from djan... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import logging
import json
import uuid
from django.db import models
from django.conf import settings
from django.utils import timezone
from google.protobuf.descriptor import FieldDescriptor
logging.basicConfig()
LOGGER = logging.getLogger(__name__)
LOGGER.se... |
import os
import sys
import time
import traceback
import torch
from queue import Queue
import requests
from typing import List
from functools import partial
from ctools.utils import read_file, save_file, get_rank, get_world_size, get_data_decompressor, remove_file, broadcast
from .base_comm_learner import BaseCommLea... |
#!/usr/bin/env python3
"""Download podcast episodes from subscriptions in config file sections."""
__title__ = 'download-podcasts.py'
__version__ = '0.1.dev0'
__author__ = '<NAME> <<EMAIL>>'
__license__ = 'MIT, see LICENSE.txt'
__copyright__ = 'Copyright (c) 2020-2021 <NAME>'
import argparse
import asyncio
import co... |
#Filename : plankton.py
#written by <NAME>
#on
import csv
import numpy as np
from scipy import interpolate
def reader(filename):
"""reader reads the .csv file and returns the data as list"""
with open(filename, 'r') as fl:
reader = csv.reader(fl, dialect = 'excel')
data = list(reader)
... |
#!/usr/bin/env python3
"""
git_odoo
usage:
git_odoo checkout (<version>... | --dbname <dbname>)
git_odoo pull [--version <version> | --all]
git_odoo fetch
git_odoo list
options:
--dbname=<dbname> name of the database to use to select the right version to checkout
--version=<version> ... |
""" fiona.tool
Converts Shapefiles (etc) to GeoJSON.
"""
import json
import logging
import pprint
import sys
from six.moves import map
import fiona
def open_output(arg):
"""Returns an opened output stream."""
if arg == sys.stdout:
return arg
else:
return open(arg, 'w')
def make_ld_con... |
# -*- coding: utf-8 -*-
# python 2 support via python-future
from __future__ import absolute_import, division, print_function, unicode_literals
from builtins import bytes, dict, int, str
import atexit
import collections
import distutils.spawn
import importlib
import logging
import re
import shlex
import subprocess
im... |
import os
import json
import re
from nltk import word_tokenize
from nltk.translate.bleu_score import corpus_bleu
from tqdm import tqdm
from rouge import Rouge
from sumy.parsers.plaintext import PlaintextParser
from sumy.nlp.tokenizers import Tokenizer
from sumy.summarizers.text_rank import TextRankSummarizer
from sumy.... |
# Copyright (c) 2021. <NAME>
# Copyright (c) 2021. University of Edinburgh
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met: redistributions of source code must retain the above copyright
... |
#!/usr/bin/env python3
# coding: utf-8
#libraries
import keras
import tensorflow as tf
from keras import backend as K
import cv2
import os
import numpy as np
from keras.optimizers import Adam
from keras.models import model_from_json, load_model
from keras.layers import Input, Dense
from keras.models import Model,Seque... |
# Code generated by moonworm : https://github.com/bugout-dev/moonworm
# Moonworm version : 0.1.15
import argparse
import json
import os
from pathlib import Path
from typing import Any, Dict, List, Optional, Union
from brownie import Contract, network, project
from brownie.network.contract import ContractContainer
fro... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.