text stringlengths 3.07k 22.1k |
|---|
from flask import Flask, render_template, request, jsonify, abort
from firebase import Firebase
from random import randint
from datetime import datetime
#added some more libs
# import base64
# import numpy as np
# import io
# # from PIL import Image
# import tensorflow as tf
# from tensorflow import keras
# from tkint... |
import codecs
import os
import struct
from enum import Enum
from cryptography.hazmat.primitives import padding, hashes
from cryptography.hazmat.primitives.ciphers import algorithms, modes, Cipher
import attr
import six
from aliyun_encryption_sdk import to_bytes
from aliyun_encryption_sdk.constants import SDK_VERSION,... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
import os
import platform
import shutil
import sys
sys.path.append('bin')
from autojump_argparse import ArgumentParser # noqa
SUPPORTED_SHELLS = ('bash', 'zsh', 'fish', 'tcsh')
def cp(src, dest, dryrun=False):
print('copying f... |
import random
import time
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
# Create a Dataframe
df = pd.DataFrame({'Algoritms':["Bubble Sort","Selection Sort","Insertion Sort","Quick Sort","Merge Sort"]},index:=None)
samples = [100,200,500,1000,5000] #create an array with different sample s... |
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... |
"""Data loading for SVMRank-style data sets."""
from typing import Callable
from typing import List
from typing import Optional
from typing import Union
import numpy as _np
import torch as _torch
import logging
from scipy.sparse import coo_matrix as _coo_matrix
from sklearn.datasets import load_svmlight_file as _load... |
from matplotlib import animation, pyplot as plt
from django.http import HttpResponse
from app.models import Game
def visualization_view(request, object_id):
game = Game.objects.filter(id=object_id).first()
if not game:
return HttpResponse(f"Can't find game with id {object_id}.")
if (
gam... |
'''
@ <NAME> (EklipZ) eklipz.io - tdrake0x45 at gmail)
April 2017
Generals.io Automated Client - https://github.com/harrischristiansen/generals-bot
EklipZ bot - Tries to play generals lol
'''
import logging
import random
from copy import deepcopy
import time
import json
from ArmyAnalyzer import *
from collections ... |
# Credits (inspired & adapted from) @ https://github.com/lcswillems/torch-rl
import torch
from typing import Tuple
import numpy as np
from utils.dictlist import DictList
from .base import AgentBase
class SimulateDict:
def __init__(self, obj):
self._obj = obj
def __getitem__(self, item):
ret... |
# https://stackoverflow.com/questions/10253826/path-issue-with-pytest-importerror-no-module-named-yadayadayada
import sys, os
myPath = os.path.dirname(os.path.abspath(__file__))
sys.path.insert(0, myPath + '/./deck/')
sys.path.insert(1, myPath + '/./player/')
import re
from deck import Deck
from player import User, De... |
import pathlib
import os
import csv
"""
This script uses a csv of card recipients and their data as well as custom map files for each person to produce
two files per person: one file contains the map file and the other contains the card text and the arc connecting
the source location to the card destination. The custo... |
#!/usr/bin/python
# -------------------------------------------------------------------------- #
# Copyright 2016-2018 #
# #
# Portions copyright OpenNebula Project (OpenNebula.org), CG12 L... |
from enum import Enum
import re
import sqlite3
from textwrap import dedent
from typing import Tuple, List
VERSION = "0.3.0"
color_pattern = re.compile(
r"\[(?P<color>#[0-9a-fA-F]{6})\](?P<body>[^\[]*?)\[/(?:#[0-9a-fA-F]{6})?\]"
)
def format_time(seconds: int) -> str:
return f"{seconds // 60}:{seconds % 60:0... |
#!/usr/bin/env python3
#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
# DESCRIPTION:
# Python modbus driver to get and store Eastron SDM120CT meter data into a CSV file
#
# CALL SAMPLE:
# see this_file.py -h
#
# DOCS
# see ../../docs director... |
import re
import sys
import numpy as np
import pkg_resources
import math
from PyQt5 import uic, QtGui, QtCore
from matplotlib.figure import Figure
from isstools.widgets import (widget_general_info, widget_trajectory_manager, widget_processing, widget_batch_mode,
widget_run, widget_beaml... |
import sys
import time
import datetime
import requests
import json
import urllib3
import click
print("Libraries are imported")
urllib3.disable_warnings()
class Interface():
def __init__(self, name):
'''
This class is representative of physical interfaces of dc switches
'''
self.na... |
import argparse
import joblib
import numpy as np
import pandas as pd
from sklearn.metrics import (balanced_accuracy_score, classification_report,
f1_score, precision_score, recall_score,
roc_auc_score, roc_curve)
from tqdm import tqdm
from utils import _get_su... |
#----------------------------------------------------------------------
# Name: wx.lib.dialogs
# Purpose: ScrolledMessageDialog, MultipleChoiceDialog and
# function wrappers for the common dialogs by <NAME>.
#
# Author: Various
#
# Created: 3-January-2002
# RCS-ID: $Id: dialogs.py ... |
from ..extension_loader.snapshot import SNAPSHOT_TAKERS
from ..extension_loader.extension_loader import EXTENSION_LOADER
from .slash_command import SYNC_ID_NON_GLOBAL
from .slasher import Slasher
from .utils import RUNTIME_SYNC_HOOKS
def take_slasher_snapshot(client):
"""
Collects all the command changes fro... |
from collections import OrderedDict
try:
from unittest import mock
except ImportError:
import mock
import pytest
from graphql.execution.executors.sync import SyncExecutor
from graphql_ws import base, base_sync, constants
@pytest.fixture
def cc():
cc = base.BaseConnectionContext(ws=None)
cc.operatio... |
"""
FOTA update tool which is called from the dispatcher during installation
Copyright (C) 2017-2022 Intel Corporation
SPDX-License-Identifier: Apache-2.0
"""
import logging
from abc import ABC, abstractmethod
from typing import Tuple, Dict
from datetime import datetime
from inbm_lib import wmi
from dis... |
import datetime
import glob
import os
import operator
import pytest
import numpy as np
from functools import reduce
from numpy import nan
from osgeo import gdal
from test import DATA_DIR, TEST_DIR, pushd
from RAiDER.constants import Zenith, _ZMIN, _ZREF
from RAiDER.processWM import prepareWeatherModel
from RAiDER.mo... |
# !/usr/bin/python3.6
# -*- coding: utf-8 -*-
# @author breeze
import threading
import argparse
import multiprocessing
import time
from multiprocessing import Queue, Pool
import face_recognition
import pandas as pd
import win32com.client
import cv2
import encoding_images
from app_utils import *
# This is a demo of ru... |
from flourish import Flourish
from flourish.generators.base import SourceGenerator
from flourish.source import SourceFile
import pytest
class TestFlourishPaths:
@classmethod
def setup_class(cls):
with pytest.warns(None) as warnings:
cls.flourish = Flourish('tests/source')
def test_ho... |
import argparse
import gym
import numpy as np
import os
import torch
import BCQ
import BEAR
import utils
def train_PQL_BEAR(state_dim, action_dim, max_action, device, args):
print("Training BEARState\n")
log_name = f"{args.dataset}_{args.seed}"
# Initialize policy
policy = BEAR.BEAR(2, state_dim, acti... |
# $Id$
import weakref as _weakref
import Queue as _Queue
import thread as _thread
import time as _time
import atexit as _atexit
_log_level = 0
_log_name = "/tmp/dbpool.log"
_log_file = None
_log_lock = _thread.allocate_lock()
apilevel = "2.0"
threadsafety = 2
_dbmod = None
_lock = _thread.allocate_lock()
_refs = {... |
"""
Description for rttm files copied from kaldi chime6 receipt
`steps/segmentation/convert_utt2spk_and_segments_to_rttm.py`:
Each line in an rttm file contains the following values:
<type> <file-id> <channel-id> <begin-time> \
<duration> <ortho> <stype> <name> <conf>
<type> = SPEAKER for each... |
# --- built in ---
import os
import sys
import time
import math
import logging
import functools
# --- 3rd party ---
import numpy as np
import tensorflow as tf
# --- my module ---
__all__ = [
'ToyMLP',
'Energy',
'Trainer',
]
# --- primitives ---
class ToyMLP(tf.keras.Model):
def __init__(
se... |
# encoding: utf-8
# butterfly.py
# TODO fix documentation
import numpy as np
from math import sqrt
from numba import jit
from scipy.linalg import block_diag
from scipy.stats import chi
from .basics import get_D, radius, rnsimp
NQ = 3
@jit(nopython=True)
def butterfly_generating_vector(n):
'''
Generates... |
import xml.etree.ElementTree as ET
from django.contrib.auth.models import User
from django.core.exceptions import ObjectDoesNotExist
from django.http import HttpResponse
from rdkit import Chem
from rdkit.Chem import AllChem, Draw, Atom, rdFMCS, rdDepictor
import re
from rdkit.Chem.Draw.MolDrawing import DrawingOptions... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue May 25 11:41:02 2021
@author: ike
"""
import numpy as np
import pandas as pd
from ..utils.csvreader import CSVReader
from ..utils.csvcolumns import STIM
voltage=2.437588
def count_frames(
filename, threshold=1, volCol="AIN4", fCol="frames... |
'''
This contains a number of methods and functions to calculate the iRep metric
https://github.com/christophertbrown/iRep
https://www.nature.com/articles/nbt.3704
'''
import os
import sys
import glob
import scipy
import lmfit
import scipy.signal
import numpy as np
import pandas as pd
import seaborn as sns
from Bio... |
# losernator
# License-Identifier: MIT
# 2022/05/03
import time
import board
import digitalio
import analogio
import usb_hid
import neopixel
from hid_gamepad import Gamepad
from rainbowio import colorwheel
from configs import config
gp = Gamepad(usb_hid.devices)
# Buttons
turbo_speed = config.get('turbo_speed')
turbo... |
import numpy as np
import torch.optim as optim
import networks.networks as net
from networks.gtsrb import *
from networks.svhn import *
import torchvision as tv
from torchvision import transforms
from torch.utils.data import DataLoader
from data.idadataloader import DoubleDataset
from config import get_transform
from d... |
"""Support for interface with a ArrisDCX960 Settopbox."""
import logging
import random
import voluptuous as vol
import time
import homeassistant.helpers.config_validation as cv
from homeassistant.components.media_player import MediaPlayerEntity, BrowseMedia
from homeassistant.config_entries import ConfigEntry
from hom... |
# -*- coding: utf-8 -*-
"""Utilities for running REST API."""
from __future__ import print_function
import json
from sys import version_info
from functools import wraps
from collections import Iterable, OrderedDict
from werkzeug.wrappers import Request, Response
from werkzeug.datastructures import Headers
from werkze... |
# Copyright 2022 MosaicML Composer authors
# SPDX-License-Identifier: Apache-2.0
"""Hyperparameters for callbacks."""
from __future__ import annotations
import abc
import textwrap
from dataclasses import asdict, dataclass
from typing import Optional, Union
import yahp as hp
from composer.callbacks.checkpoint_saver ... |
# -*- coding: utf-8 -*-
## \package ui.checklist
# MIT licensing
# See: docs/LICENSE.txt
import wx
from dbr.language import GT
from dbr.log import Logger
from globals.ident import btnid
from globals.ident import pnlid
from globals.strings import GS
from globals.strings import TextIsEmpty
from ui.button impo... |
import cv2
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.image as mping
import time
import imutils
import os
focalLength = None
def load_custom_names():
"load names of custom text file"
# create epmty list
class_list = []
# open coco txt file
with open("./object_detection... |
"""
Description: A python 2.7 implementation of gcForest proposed in [1]. A demo implementation of gcForest library as well as some demo client scripts to demostrate how to use the code. The implementation is flexible enough for modifying the model or
fit your own datasets.
Reference: [1] <NAME> and <NAME>. Deep Fores... |
#!/usr/bin/env python
# coding: utf-8
# <b> Run below cells from the folder that contains ads16_dataset/ unzipped </b>
# In[1]:
import pandas as pd
import glob
import pathlib
import re
# In[2]:
pd.set_option('display.max_colwidth', -1)
# In[3]:
# Global constants
g_userPart1PathPrefix = "./ads16-dataset/ADS... |
# Copyright 2016, Ericsson AB
#
# 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 ag... |
#!/usr/bin/env python
# Copyright (2013) JDSU T&M Pte Ltd. All rights reserved.
"""
This script calls the PI XML-API to get the card and port status of the PI hardware
and writes the result to a temporary file. The IWF reads the result and set the
IWF/traffic-hardware config parameter, which is read by the Job-manag... |
from finetuna.ml_potentials.ocpd_calc import OCPDCalc
import torch
from torch import nn
import torch.nn.functional as F
import numpy as np
import copy
from multiprocessing import Pool
from ase.atoms import Atoms
class OCPDNNCalc(OCPDCalc):
implemented_properties = ["energy", "forces", "stds"]
def __init__(
... |
"""
Usefull functions for loading files etc.
-AN
"""
import os
import pickle
import zipfile, lzma
import numpy as np
import matplotlib.pyplot as plt
from collections import OrderedDict
# saves dict to csv using keys as headers
def saveToCSV(savedict, filename = "", path = ""):
try:
#print(sav... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
MagnetCommunication.py
Author: <NAME>
Created on Mon Dec 18 15:35:21 2017
Last Edited: 06.12.2018
Python Version: 3.6.5
4G Magnet Power Supply
Class for sending commands to 4G Magnet Power Supply
IMPORTANT: Magnet has to be in remote mode, can only
be set locally
... |
#from django.utils.translation import ugettext as _
import datetime
from django.db import models
from django.db.models import Q
from django.contrib.auth.models import User
from model_utils.models import TimeStampedModel
from django.utils.timezone import now
from model_utils import Choices
from django.utils import t... |
from __future__ import division
import numpy as np
from collections import namedtuple
import bilby
from bilby.gw import conversion
import os
import gwpopulation
MassContainer = namedtuple('MassContainer', ['primary_masses', 'secondary_masses',
'mass_ratios', 'total_masses... |
import sys
import types
import _dk_core as core
# def enum(*sequential, **named):
# enums = dict(zip(sequential, range(len(sequential))), **named)
# return type('Enum', (), enums)
def enum(*seq, begin=0, prefix='Enum_'):
from collections import namedtuple
t = namedtuple(prefix + core.uuidgen().replace... |
import datetime
import itertools
from typing import NamedTuple, List
import structlog
from web3.datastructures import AttributeDict
from monitor.db import AlreadyExists
from monitor import blocksel
class BlockFetcherStateV1(NamedTuple):
head: AttributeDict
current_branch: List[AttributeDict]
initial_blo... |
from django.contrib.auth.models import User
from django.db import models, transaction
# Create your models here.
# add dates of review, signed date, who signed, grant agreement - need flexibilty in types of dates that are added
from django.db.models import Sum
from django.utils.datetime_safe import datetime
from simple... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# code for python2.7
#
#
import rospy
import serial
import time
import signal
import sys
import math
import tf
from nav_msgs.msg import Odometry
from whipbot.msg import Posture_angle
from kondo_b3mservo_rosdriver.msg import Multi_servo_info
# variables to store timings o... |
from itertools import islice
from itertools import islice
import matplotlib.pyplot as plt
import numpy as np
import torch
from torch.autograd import Variable
from torch import utils
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
import os
import pickle
from torchvision import datasets... |
# coding: utf-8
import numpy as np
import argparse
import torch
import os
from shutil import rmtree
import torch.nn as nn
import torch.nn.functional as F
from torch.distributions import Bernoulli
from copy import deepcopy
from envs import IPD
# from torch.utils.tensorboard import SummaryWriter
from tensorboardX import... |
# Shim module that makes asn1crypto aware of OIDs relevant for EdDSA support
# Will be removed once asn1crypto supports these OIDs natively
from asn1crypto import algos, core, keys, cms, x509
from asn1crypto._errors import unwrap
PRIVATE_KEY_SPECS = {
'rsa': keys.RSAPrivateKey,
'rsassa_pss': keys.RSAPrivateK... |
# SPDX-License-Identifier: BSD-2-Clause
import re
import pathlib
import asyncio
import platform
import discord
import toml
import appdirs
if platform.system() == "OpenBSD":
import openbsd
import commands
from text_transform import process_text
async def safely_replace_substr(text, substr, new_substr):
""" ... |
from django.conf.urls import url
from django.contrib import messages
from jet.dashboard import dashboard
from django.shortcuts import render, redirect
from django.http import HttpResponse
from django.views.decorators.csrf import csrf_exempt
from django.http import HttpRequest
from django.http import JsonResponse
from d... |
"""
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 rights
to use, copy, modify, merge, publish, distri... |
from __future__ import annotations
import typing
import toolstr
from . import cpmm_spec
from . import cpmm_trade
def print_pool_summary(
x_reserves: int | float,
y_reserves: int | float,
lp_total_supply: int | float | None = None,
x_name: str | None = None,
y_name: str | None = None,
fee_ra... |
from __future__ import unicode_literals
import atexit
import logging
import os
import re
import subprocess
from copy import copy
from os.path import join
from subprocess import list2cmdline
from humanfriendly import format_size, parse_size
from pickle_blosc import pickle, unpickle
from pickle_mixin import SlotPickleM... |
import re
from df_engine.core import Actor, Context
from langcodes import normalize_characters
from torch import norm, normal
from scenario.qcfg import g
from nltk import grammar, parse
import re
from lxml import etree
import urllib.request, gzip, io
import scenario.config as config
# Create the CFG grammar from a st... |
"""
These tests are the test fits that come with C mpfit
"""
import mpyfit
import unittest
import numpy
class LinearFunction( unittest.TestCase):
@staticmethod
def func(p, args):
x, y, error = args
return (y - p[0] - p[1]*x)/error
def test_fit(self):
x = numpy.array([-1.7237128E... |
#!/usr/bin/python3
import re
import math
from os import system, name
import operator
# At this point I'm just making a math interpeter
# import the readline module for arrow functionality if it exists
try:
import readline
readline.set_history_length(100)
except ImportError:
pass
STATS_GRAPH = False
c... |
from keras.layers import Input, Dense, Flatten, Concatenate, Conv2D, Dropout
from keras.losses import mean_squared_error
from keras.models import Model, clone_model, load_model
from keras.optimizers import SGD, Adam, RMSprop
import numpy as np
class RandomAgent(object):
def __init__(self, color=1):
self.... |
# -*- coding: utf-8 -*-
#
# 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 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope th... |
from enum import Enum
from typing import Optional, Iterable, Callable, Union
try: # Assume we're a sub-module in a package.
from utils import arguments as arg
from interfaces import ContextInterface, ConnType
from streams.abstract.wrapper_stream import WrapperStream
from fields.abstract_field import A... |
from http.server import BaseHTTPRequestHandler
import os
import subprocess
import time
from typing import ClassVar, Dict, List, Optional, Tuple
from onceml.components.base import BaseComponent, BaseExecutor
from onceml.orchestration.Workflow.types import PodContainer
from onceml.types.artifact import Artifact
from once... |
"""Components for displaying taxon info"""
import webbrowser
from collections import deque
from logging import getLogger
from typing import Iterator
from pyinaturalist import Taxon
from PySide6.QtCore import QEvent, Qt, QThread, Signal
from PySide6.QtWidgets import QGroupBox, QPushButton
from naturtag.app.style impor... |
# BSD 3-Clause License
#
# Copyright (c) 2021, <NAME>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list o... |
import numpy as np
import matplotlib
matplotlib.use('agg')
from matplotlib import pyplot as plt
from matplotlib import dates as md
from sklearn.linear_model import LinearRegression
from sklearn.svm import SVR
from sklearn.preprocessing import normalize, scale
import sklearn.metrics as metrics
import pickle
import stat_... |
import chainer
import chainer.functions as F
import numpy as np
import argparse
from chainer import cuda, serializers
from pathlib import Path
from model import Generator, Discriminator, VGG, SAGenerator, SAGeneratorWithGuide
from utils import set_optimizer
from dataset import DataLoader, RefineDataset
from evaluation... |
# Copyright (c) 2017 <NAME>
#
# SPDX-License-Identifier: BSD-3-Clause
# The BSD-3-Clause license for this file can be found in the LICENSE file included with this distribution
# or at https://spdx.org/licenses/BSD-3-Clause.html#licenseText
import os
import logging
import collections
from time import time
f... |
from base_component import *
import os
import xml.etree.ElementTree as ET
class ParseV4L2Headers(Component):
"""
Component which parses the v4l2 headers to get ioctl function pointer structure members.
"""
def __init__(self, value_dict):
c2xml_path = None
kernel_src_dir = None
... |
from __future__ import annotations
import vtk
from custom_types import *
from ui import ui_utils
import constants
import vtk.util.numpy_support as numpy_support
class GaussianData:
def make_symmetric(self, other: GaussianData):
# reflection = np.eye(3)
# reflection[0, 0] = -1
# self.total... |
#!/usr/bin/env python3
# unifiers_lia.py ---
#
# Filename: unifiers_lia.py
# Author: <NAME>
# Created: Mon, 06 Jun 2016 19:41:46 -0400
#
#
# Copyright (c) 2015, <NAME>, University of Pennsylvania
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted ... |
# Copyright 2017 The TensorFlow 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 applica... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
(c) 06/13/18 <NAME> || http://faircloth-lab.org/
All rights reserved.
This code is distributed under a 3-clause BSD license. Please see
LICENSE.txt for more information.
Created on Jun 13, 2018 at 09:50:25.
"""
import os
import sys
import argparse
import configparse... |
import pandas as pd
import json
import spacy
import regex as re
from gensim.models.phrases import Phrases, Phraser
import multiprocessing
from gensim.models import Word2Vec
from time import time
# Setting up the loggings to monitor gensim
import logging
logging.basicConfig(format="%(levelname)s - %(asctime)s: %(mess... |
"""Create carbon regression scenarios."""
import argparse
import logging
import multiprocessing
import os
import subprocess
import sys
from osgeo import gdal
import pygeoprocessing
import numpy
import taskgraph
gdal.SetCacheMax(2**27)
logging.basicConfig(
level=logging.DEBUG,
format=(
'%(asctime)s (%... |
from torch.utils.tensorboard import SummaryWriter
import os, glob
from utils import dict_send_to
from tqdm import tqdm
import time, datetime
import argparse
import json
import traceback
from hyperparams import hparams as hp
import torch
from concurrent.futures import ProcessPoolExecutor
from utils.transcribe import tra... |
import os
import glob
import json
import datetime as dt
import pandas as pd
from flask import (
Blueprint,
jsonify,
request,
url_for,
redirect,
render_template,
send_from_directory,
flash,
)
from werkzeug import secure_filename
from .table_builder import create_data, search_page_table... |
# from pudb.remote import set_trace as st
# from remote_pdb import RemotePdb
# from ipdb import set_trace as st
# from pdb import set_trace as st
# from web_pdb import set_trace as st
import io
import os
import requests
import json
from pdf2image import convert_from_path
from typing import List
import boto3
from googl... |
# Copyright (c) 2016-2020, <NAME>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of conditions and the... |
#!/usr/bin/env python
#
# Copyright 2015 British Broadcasting 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 requ... |
import json
import os
import shutil
import stat
import tarfile
import urllib
import subprocess
import docker
from requirementslib import Requirement
from tqdm import tqdm
from .release import get_release
class NoReleaseCandidate(Exception):
def __init__(self, requirement):
super(NoReleaseCandidate, sel... |
import pickle
import os
import numpy as np
import torch
import warnings
from tqdm import tqdm
from Metrics import evaluateTracking
from dataset.dataLoader import Data_Loader_MOT
from network.tubetk import TubeTK
from post_processing.tube_nms import multiclass_nms
from apex import amp
import argparse
import multiprocess... |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from .. import _utilitie... |
import logging
import warnings
from contextlib import contextmanager, suppress
from typing import Dict, List, Optional, Type, Union
from weakref import WeakSet
from mesonic.backend import start_backend
from mesonic.backend.bases import B, Backend, EventHandler, Manager
from mesonic.events import Event
from mesonic.pla... |
"""
Reader for OVERFLOW test data.
"""
from openmdao.lib.datatypes.domain import Vector, read_plot3d_grid
from openmdao.util.log import NullLogger
from openmdao.util.stream import Stream
def read_q(grid_file, q_file, multiblock=True, blanking=False, logger=None):
"""
Read grid and solution files.
Returns... |
import pandas as pd
import time
import random
import numpy as np
from datetime import timedelta
from datetime import datetime
import MAUC
import argparse
parser = argparse.ArgumentParser(usage='python3 evalOneSubmission.py',
description=r'''
TADPOLE Evaluation Script:
The program computes the following matrics:
... |
#! /usr/bin/python3
#
# Copyright (c) 2017 Intel Corporation
#
# SPDX-License-Identifier: Apache-2.0
#
"""
Create and remove network tunnels to the target via the server
--------------------------------------------------------------
"""
import pprint
from . import msgid_c
import commonl
from . import tc
class tunne... |
from __future__ import annotations
from typing import *
from dataclasses import dataclass, field, replace
from collections import defaultdict
from contextlib import contextmanager
from flask import jsonify, request
from flask.wrappers import Response
from sorcery import spell, no_spells # type: ignore
import abc
impor... |
import json
import boto3
from datetime import datetime
from base_wrapper import BaseWrapper
import time
import os
region = os.environ['AWS_REGION']
def get_code_path():
return "/" + "/".join(__file__.split('/')[:-1])
class GlueWrapper(BaseWrapper):
"""
This class handles all anonymization for tabular d... |
#!/usr/bin/env python3
# -*- CoDing: utf-8 -*-
"""
Created on May 22 2019
Last Update May 22 2019
@author: simonvanvliet
Department of Zoology
University of Britisch Columbia
<EMAIL>
This recreates the data and figure for figure 2
By default data is loaded unless parameters have changes, to rerun model set override_... |
'''
Module handles mapping input files of varying types (tif, bag) to conventions
implemented within mdes-grid-checks such as the mapping of band numbers
to what they represent
'''
from enum import Enum
from osgeo import gdal
from typing import Tuple, List, Type
import os
import os.path
from pathlib import Path
from ... |
from helita.sim import rh15d
import matplotlib.pyplot as plt
import numpy as np
import os
import warnings # ignore tedious warnings
warnings.filterwarnings("ignore")
##############################################################
def load_rh_data(folder, print_attributes=False):
# reset IPython kernel
tr... |
import cv2
from settings import *
from src.solving_objects.MyHoughLines import *
from src.solving_objects.MyHoughPLines import *
def line_intersection(my_line1, my_line2):
line1 = [[my_line1[0], my_line1[1]], [my_line1[2], my_line1[3]]]
line2 = [[my_line2[0], my_line2[1]], [my_line2[2], my_line2[3]]]
xdi... |
import torch
import torch.nn as nn
from enum import Enum
from numpy import pi
from . import util
class Metric(Enum):
HESSIAN = 1
SOFTABS = 2
JACOBIAN_DIAG = 3
def collect_gradients(log_prob, params):
if isinstance(log_prob, tuple):
log_prob[0].backward()
params_list = list(log_prob[1... |
import random
from abc import abstractmethod
import math
from sklearn.cluster import KMeans
import numpy as np
import matplotlib.pyplot as plt
def euclidian_distance(a, b):
"""
Calculating Euclidian distance between 2 vectors
:param a: 1st vector
:param b: 2nd vector
:return:
"""
assert l... |
import sys
from itertools import product
types = {
# id Type avx branch leaf buffer
0: ("dyn", "false", 8, 8192, 0),
1: ("leaf", "false", 8, 8192, 0),
2: ("leaf", "false", 8, 8192, 8)
}
branches = [8, 16, 32, 64, 128]
leaves = [2**12, 2**13, 2**14]
buffer = [8, 16, 32]
avx = ["true", "false"]
f... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.