text stringlengths 3.07k 22.1k |
|---|
import sublime
import sublime_plugin
from subprocess import check_output
from time import time
import os
ANCHOR_HOOK = "<&> "
last_saved = time() * 1000
class InitCommand(sublime_plugin.TextCommand):
def run(self, edit):
v = self.view
# Get current working directory
cwd = os.path.dirname(v.file_name(... |
"""
Cells Demo Automated Testing Configuration
------------------------------------------
This file contains pytest fixtures that will
permit automated testing of the various
CellsDemo classes and files.
See:
https://docs.pytest.org/en/latest/fixture.html
for a more detailed description of this pattern.
"""
import pyte... |
# ----------------------------------------------
# --- Author : <NAME>
# --- Mail : <EMAIL>
# --- Date : 27th January 2018
# ----------------------------------------------
import numpy as np
import os
import six.moves.urllib as urllib
import sys
import tarfile
import tensorflow as tf
import... |
from cognite.client.data_classes._base import *
class TransformationDestination:
"""TransformationDestination has static methods to define the target resource type of a transformation
Args:
type (str): Used as data type identifier on transformation creation/retrieval.
"""
def __init__(self, ... |
"""
Implementation of Matrix Transfer approach to calculating transmission, reflection, and absorption.
Many ideas were taken from <NAME> implementation in the tmm package
https://github.com/sbyrnes321/tmm/blob/master/tmm_core.py (used under terms of MIT license)
The current implementation allows for multidimensional... |
import json
import html
import sys
import re
import urllib.parse
from urllib.parse import unquote
from time import sleep
from typing import Dict, List
from bs4 import BeautifulSoup
from requests import get
# This scripts extracts a list of product items dicts
# It is used by tweet.py to generate a corpus
# It only ne... |
"""
problog.cycles - Cycle-breaking
-------------------------------
Cycle breaking in propositional formulae.
..
Part of the ProbLog distribution.
Copyright 2015 <NAME>, DTAI Research Group
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance... |
from flask import render_template,request,redirect,url_for,abort,flash
from flask_login import login_required,current_user
from flask.views import View,MethodView
from . import main
from ..models import *
from .forms import *
from .. import db,photos
from app.email import mail_message
class IndexView(View):
def __... |
"""ILI9341 LCD/Touch module."""
from time import sleep
from math import cos, sin, pi, radians
from sys import implementation
import ustruct
import utime
import gc
import framebuf
def color565(r, g, b):
"""Return RGB565 color value.
Args:
r (int): Red value.
g (int): Green value.
b (int)... |
'''
Diagnosing Colorectal Polyps in the Wild with Capsule Networks (D-Caps)
Original Paper by <NAME>, <NAME>, <NAME>, <NAME>, and <NAME>
Paper published at ISBI 2020: arXiv version (https://arxiv.org/abs/2001.03305)
Code written by: <NAME>
If you use significant portions of this code or the ideas from our paper, please... |
import sys
from PyQt5 import QtCore, QtGui, QtWidgets
import matplotlib
matplotlib.use('QT5Agg')
from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as FigureCanvas
import matplotlib.pyplot as plt
from crystal_math import get_band_coordinates
from gui import PolePlot
class AddBandDialog(QtWidgets.QDialo... |
import getopt
import re
import sys
import threading
import socket
import time
import nacl.encoding
import nacl.signing
import nacl.utils
import core
from chains import DDosChain, DDosTransaction, DDosData
from utils import keystore, set_debug
from gui import ddos_gui_loop
def parse_args(argv):
""" Parse command... |
from datetime import datetime
from io import StringIO, SEEK_SET
from psycopg2.extras import execute_values
from s64da_benchmark_toolkit.dbconn import DBConn
from benchmarks.htap.lib.helpers import (
Random, OLTPText, OLAPText, NATIONS, REGIONS, TimestampGenerator, StringIteratorIO,
DIST_PER_WARE, CUS... |
# coding: utf-8
"""Logging tools, built upon those from the logging standard library."""
import logging
import functools
import inspect
import os
from yaptools import check_type_validity
LOGGING_LEVELS = {
'debug': logging.DEBUG, 'info': logging.INFO,
'warning': logging.WARNING, 'warn': logging.WARN,
'... |
import datetime
from typing import List
from flask import Blueprint, jsonify, request
from flask import g
from app.extensions import auth, db
from app.utils import bad_request, Error
from app.models import LoginModel, UserModel
user_api = Blueprint('user_api', __name__)
@user_api.route('/api/v1/users', methods=['P... |
from flask import Blueprint, request, make_response, render_template, redirect, url_for, g, flash
import datetime
import re
from ...internals.database.database import get_cursor
from ...lib.post import get_post, is_post_flagged, get_next_post_id, get_previous_post_id, get_recent_posts_for_listing, get_total_pos... |
## Copyright (c) 2019 AT&T Intellectual Property. All rights reserved.
## routines for analyzing data
import pickle
from sbom_helpers import mypprint
from sbom_helpers import get_gdbpath
from sbom_helpers import get_datelist
from sbom_helpers import validate_file_access
from sbom_helpers import file_to_data
from sbom... |
import os
import time
import argparse
# third party
import cv2
import numpy as np
import face_recognition
from imutils import paths
# local module
from yolo import objectapi
# global variable
DATA_DIR = './dataset/images'
NAME = 0
DEPAT = 1
JOB = 2
INTRO = 3
INFO = {
'jiang': ['江纬','AILab','研究员','day day up'],... |
import numpy as np
import random
from kmc.rates import *
from kmc.particles import *
from kmc.system import System
from kmc.bimolecular import *
import sys
import warnings
import os
import copy
import matplotlib.pyplot as plt
from matplotlib import animation
#from joblib import Parallel, delayed
from mpl_toolkits.mplot... |
import os
import shutil
import sys
import errno
from argparse import ArgumentParser
from glob import glob
from multiprocessing import Pool
from os.path import abspath, basename, join
from subprocess import run, PIPE
from tempfile import NamedTemporaryFile, TemporaryDirectory
from typing import Iterable
from Bio impor... |
import os
import argparse
import copy
import json
import torch
import numpy as np
from flextensor.model import WalkerGroup, PerformanceModel, rank_loss
from flextensor.task import TASK_TABLE, Task
from flextensor.scheduler import flatten_graph, Config
from flextensor.space import generate_space_intra_op, generate_space... |
"""
These are unit tests
"""
import numpy as np
import re
flatten = lambda l: [item for sublist in l for item in sublist]
"""
These are not tests per say but useful illustrations
"""
def allele_01(genename):
"""
>>> allele_01('TRBV19*02')
'TRBV19*01'
"""
g,a = re.match(pattern = '(.*)([0-9])$', string= genename)... |
""" A collection of functions to fetch info from tinychat's API. """
import time
import random
import webbrowser
from xml.dom.minidom import parseString
import web_request
import os
def get_roomconfig_xml(room, roompass=None, proxy=None):
"""
Finds room configuration for a given room name.
:param room: s... |
from __future__ import print_function, division
# from config.settings import mkdir
import os
import random as rn
import numpy as np
from torch.utils.data import Dataset
import random
import matplotlib.pyplot as plt
from os import listdir
import pickle
# https://github.com/gorchard/event-Python/tree/78dd3b0a7fc508d55... |
"""
Healthscapes Geolytics Module
... |
#!/usr/bin/env python
# coding: utf-8
from __future__ import print_function
from __future__ import absolute_import
import os
import tct
import sys
import six
params = tct.readjson(sys.argv[1])
binabspath = sys.argv[2]
facts = tct.readjson(params['factsfile'])
milestones = tct.readjson(params['milestonesfile'])
result... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Jul 4 08:59:45 2017
@author: jmmauricio
"""
import numpy as np
import numba
import matplotlib.pyplot as plt
import sympy as sym
#plt.style.use('presentation')
# [1] <NAME>, <NAME>, and <NAME>,
# “Dynamic phasor modeling of the doubly-fed induction ... |
from .commands import (
CHANGE_MODE,
CUSTOM_MODE,
CUSTOM_MODE_TERMINATOR_1,
CUSTOM_MODE_TERMINATOR_2,
RESPONSE_LEN_CHANGE_MODE,
RESPONSE_LEN_CUSTOM_MODE,
)
from .utils import speed2slowness
__all__ = [
'RAINBOW_CROSSFADE',
'RED_GRADUALLY',
'GREEN_GRADUALLY',
'BLUE_GRADUALLY',
... |
from collections import namedtuple
from dataclasses import dataclass
from functools import cached_property, reduce
import math
# import sys
ABS_TOL = 0.01
def isclose(a, b):
return math.isclose(a, b, abs_tol=ABS_TOL)
Point = namedtuple("Point", ["x", "y"])
@dataclass(repr=False, eq=False, order=False, froze... |
import asyncio
import discord
import requests
import youtube_dl
from features import *
from settings import *
client = discord.Client()
@client.event
async def on_ready():
print('Logged in...')
print('Username: ' + str(client.user.name))
print('Client ID: ' + str(client.user.id))
print('Invite URL: '... |
import sys
import os
import time
import cv2
import threading
import numpy as np
import signal
import json
from ImageConvert import *
import arducam_config_parser
import ArducamSDK
global cfg,handle,running,Width,Heigth,save_flag,color_mode,save_raw
running = True
save_flag = False
save_raw = False
cfg = {}
handle = {... |
import os
import collections
import itertools
import shutil
import sfs.file_system as fs
import sfs.log_utils as log
# Constants
constants = {
'SFS_DIR': 'sfs',
'SFS_META_FILE': 'meta',
'COLLECTION_DIR': 'cols',
'COLLECTION_STATS_DIR': 'stats',
'SFS_FILE_EXTENSION': '.sfs',
}
# Tuple of altered ... |
# Copyright 2018--2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You may not
# use this file except in compliance with the License. A copy of the License
# is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" fi... |
from fastapi import APIRouter, Depends, File, UploadFile, HTTPException, Header, status
from typing import List, Union
import os
from sqlalchemy.exc import SQLAlchemyError
from sqlalchemy.orm import Session
from app.database import crud
from app.database.conn import get_db, get_s3
from app.config.config import BUCKET_N... |
#!/usr/bin/env python
# This file contains functions to ensure the proper behavior of the MIP models.
# Most functions compare binar
import numpy as np
from warnings import warn
from ada.Loggermixin import *
# use self.logger from Loggermixin within classes
# use h_logger outside classes
h_logger=Loggermixin.get_def... |
""" Tests for coordinate transforms """
import pytest
import numpy as np
import spharpy.samplings as samplings
from spharpy.samplings import spherical_voronoi
def test_sph2cart():
rad, theta, phi = 1, np.pi/2, 0
x, y, z = samplings.sph2cart(rad, theta, phi)
(1, 0, 0) == pytest.approx((x, y, z), abs=2e-16,... |
import numpy as np
import math as m
from prettytable import PrettyTable
import matplotlib.pyplot as mpl
# -------------------------------|ATENÇÃO|-------------------------------#
# Estou usando uma biblioteca chamada: "Prettytable", para deixar a #
# tabela com uma aparência bonita. ... |
# Copyright (c) 2017-2019, <NAME>
# Copyright (c) 2014-2018, iocage
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted providing that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# noti... |
#!../ve/bin/python
from __future__ import with_statement
import os
import re
import sys
import time
import email
import shutil
import markdown
import codecs
from docutils import core
from textwrap import dedent
from lxml.etree import tostring
from smartypants import smartyPants
from lxml.builder import ElementMaker
... |
# -*- coding: utf-8 -*-
'''
perceptron algorithm
to minimize misclassification error
SVM (support vector machine)
maxmize the margin (margin is defined as the distance between the separating hyperplane, and the training samples that are closest to this hyperplane)
'''
from sklearn import datasets
from sklearn... |
#!/usr/bin/env python3
# SPDX-FileCopyrightText: 2018-2019 <NAME> <<EMAIL>>
#
# SPDX-License-Identifier: MIT
#
# * Requirements:
# - pyside2
# - dbus-python
#
import argparse
import sys
from PySide2.QtGui import QKeySequence
import dbus
# TODO: manually syncing key bindings? sucks!
# split this into a d... |
import sys
sys.path.append('../')
sys.path.append('../..')
import json
from datetime import datetime
from bson import json_util
import psutil
from mongo_connect import Connect
from ground_truth_working_copy import updateWorkingCopy
import entity_recognition_calls as ServiceCalls
import unknown_words
updateWorkingCopy(... |
import itertools
class RegionV2():
def __init__(self, x_start, x_end, y_start, y_end, z_start, z_end, is_on):
self.x_start = x_start
self.x_end = x_end
self.y_start = y_start
self.y_end = y_end
self.z_start = z_start
self.z_end = z_end
self.is_on = is_on
... |
import numpy as np
import os
from os import makedirs
from os.path import split, join, splitext, exists, isfile
class peak(object):
def __init__(self,z,f,baseLine = None,model = None,id=''):
self.z = z
self.f = f
self.model = model
self.fit = None
self.id = id
... |
from forces import PR_drag, gravity, gravity_gr, magdrag
from CONFIG import *
#Get acceeration#
def get_acc(x,y,z,vx,vy,vz,M, R, m_e, r_e, B, TEMP, omega, inc, n_step, dt):
"""
Ry Cutter 2020
--------------
Will be used by the integrator to get the acceleration
Will need to know what forces are bei... |
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2018-2021 <NAME> (The Compiler) <<EMAIL>>
#
# This file is part of qutebrowser.
#
# qutebrowser 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, e... |
# Copyright 2021 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
import torch
from torch import nn, Tensor
from torch.nn import functional as F
from torchvision.ops import boxes as box_ops
from torchvision.models.detection import _utils as det_utils
from typing import Dict, List, Tuple
from collections import OrderedDict
class SSD300VGG16FeatureExtractor:
"""Class for extracti... |
"""Swap ANA enabled Nexus on ANA enabled host feature tests."""
import http
from time import sleep
from pytest_bdd import (
given,
scenario,
then,
when,
)
import pytest
import subprocess
from common.deployer import Deployer
from common.apiclient import ApiClient
from common.docker import Docker
from c... |
assert __name__ == '__main__'
from os import sys, path
simfempypath = path.dirname(path.dirname(path.dirname(path.abspath(__file__))))
sys.path.append(simfempypath)
import simfempy.applications
import pygmsh
import numpy as np
import scipy.interpolate
import matplotlib.pyplot as plt
from simfempy.tools import npext
fr... |
import numba
import numpy as np
from .fitter import Fitter
from math import log
@numba.jit(nopython=True)
def _fit(ts, ms, vs, ns, xs, h, I, A, Q, m_p, P_p, m_f, P_f, m_s, P_s):
# Forward pass (Kalman filter).
for i in range(len(ts)):
if i > 0:
m_p[i] = np.dot(A[i-1], m_f[i-1])
... |
from config import config
from data_gen import data, xdata, load_from_features
from keras.models import load_model
from keras import backend as K
import efficientnet.keras
import math
import pickle
from uuid import uuid4, UUID
from clinical_data_models import features_data
from db import Result, XResult
from sklearn.... |
from collections import defaultdict
import operator
from six import string_types as basestring
from ...utils import groupby
from ...structure import (
named_structures, Monosaccharide, Substituent,
Anomer, Stem, RingType,
SuperClass, Configuration)
from ...algorithms.similarity import (monosaccharide_simi... |
from tkinter import *
from PIL import ImageTk,Image
from html.parser import HTMLParser
from bs4 import BeautifulSoup
import tkinter.ttk as ttk
import urllib
import math
from html_request import *
from moviepy.editor import *
from mediaplayer import Player
import vlc
import sys
import getStreamFile.getStreamFile
from... |
"""BLP-specific exceptions."""
import collections
from typing import List, Sequence
import numpy as np
from .utilities.basics import Array, Error, format_number
class _MultipleReversionError(Error):
"""Reversion of problematic elements."""
_bad: int
_total: int
def __init__(self, bad_indices: Arr... |
import os
import numpy as np
import torch
from torch.utils.data import Dataset, DataLoader
from torchvision.transforms import ToPILImage, RandomCrop, RandomHorizontalFlip, ToTensor, Normalize, Compose
from abc import ABC, abstractmethod
from autokeras.constant import Constant
from autokeras.utils import read_csv_file, ... |
# Copyright 2011 <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, softw... |
import os.path
from pathlib import Path
from ctypes import *
from sys import platform
from numpy.ctypeslib import ndpointer
import numpy as np
from PIL import Image
try:
import eyeRendererHelperFunctions as eyeTools
except Exception as e:
print("Error importing eyeTools:", e)
print("This is most likely because ... |
import random
import torch
import re
from pytorch_pretrained_bert.tokenization import BertTokenizer
# https://github.com/huggingface/pytorch-pretrained-BERT/blob/master/examples/extract_features.py
class InputExample(object):
def __init__(self, unique_id, text_a, text_b):
self.unique_id = unique_id
self.text_a =... |
# Train the Style Transfer Net
from __future__ import print_function
import numpy as np
import sys
import os
import argparse
from PIL import Image
import tensorflow as tf
import settings
import dataprep
import modelprep
from style_transfer_net import StyleTransferNet_adv
from utils import get_scope... |
import random
import cv2
import numpy as np
import torch
import torch.utils.data as data
from PIL import Image
from torchvision import transforms
from dataloader import dataset_utils
class BaseDataset(data.Dataset):
def __init__(self, sequence):
self.sequence = sequence
self.transform = transfor... |
# python3.7
"""Contains utility functions for image processing.
The module is primarily built on `cv2`. But, differently, we assume all colorful
images are with `RGB` channel order by default. Also, we assume all gray-scale
images to be with shape [height, width, 1].
"""
import os
import cv2
import numpy as np
from ... |
from bayes_filter.filters import FreeTransitionSAEM
import tensorflow as tf
import tensorflow_probability as tfp
import os
from bayes_filter.misc import load_array_file
from bayes_filter import float_type
import sys
from bayes_filter.feeds import IndexFeed,TimeFeed,CoordinateFeed, DataFeed, init_feed, ContinueFeed
from... |
'''
Created on 04.07.2013
@author: Mark
'''
# # Imports
import logging
import numpy as np
import matplotlib
matplotlib.use('TkAgg')
import matplotlib.pyplot as plt
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg
# Tkinter
import tkinter as tk
from tkinter import ttk
# PySerial
import serial
import ... |
import tensorflow as tf
from lib_yolo import layers, data
def img_size_and_priors_if_crop(config): # TODO fn name is not very descriptive
img_size = config['crop_img_size'] if config['crop'] else config['full_img_size']
priors = config['priors']
if config['crop']:
# priors are always defined fo... |
#!/usr/bin/env python3
"""
Usage:
train.py [options] SAVE_FOLDER TRAIN_DATA_PATH VALID_DATA_PATH TEST_DATA_PATH
train.py [options] [SAVE_FOLDER]
*_DATA_PATH arguments may either accept (1) directory filled with .jsonl.gz files that we use as data,
or a (2) plain text file containing a list of such directories ... |
import logging
import os
import sys
from argparse import ArgumentParser
import getrealty
config = getrealty.settings.config
logger = logging.getLogger(__name__)
def generate_argparser():
parser = ArgumentParser(description='Let\'s get some CAD data!')
# parser.add_argument('integers', metavar='N', type=int... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from collections import OrderedDict
from enum import Enum
from PyQt5.QtWidgets import *
from PyQt5.QtCore import *
from PyQt5.QtGui import *
from Model.DbTableModel.BaseModel import DurationType
from Model.TreeViewModel import RecordGroupTreeModel
from Model.Utility import... |
import random
import var
import carddata as cd
import herodata as hd
import start
def battle_init():
var.Battle.field = [None, None, None, None, None, None, None, None, None, None, None, None, None, None]
var.Battle.field[0] = {'ID' : 1000, 'name' : 'Hero', 'type' : 'hero', 'element' : 'normal', 'rarity' : 'b... |
""" HDF5 B-Trees and contents. """
from collections import OrderedDict
import struct
import zlib
import numpy as np
from .core import _padded_size
from .core import _unpack_struct_from_file
from .core import Reference
class BTree(object):
"""
HDF5 version 1 B-Tree.
"""
def __init__(self, fh, offse... |
'''
Created on May 9, 2019
@author: <NAME>
'''
import sys
sys.path.append('../')
import argparse
import os.path
import time
import logging
import tensorflow as tf
import numpy as np
from RONet_model import RONet
from common.load_DIV2K import Dataloader
logging.basicConfig(level=logging.INFO)
logger = logging.getL... |
import os
import torch
from pdf2word.test import pdf_is_text, extract_pdf_text
import cv2
import requests
import base64
#
import numpy as np
import docx
from docx.shared import RGBColor, Inches, Pt
from docx.enum.text import WD_PARAGRAPH_ALIGNMENT, WD_BREAK
from PIL import Image
import fitz
from docx.oxml.ns import qn... |
"""
This script benchmarks the tfds / accumulator-batched implementation and tf2-gnn.
In addition to graph-tfds, this requires the following packages:
* [accumulator-batching](https://github.com/jackd/accumulator-batching)
* [tf2-gnn](https://github.com/microsoft/tf2-gnn)
* [absl-py](https://github.com/abseil/abseil-... |
import abc
import asyncio
import logging
import os
from collections import deque
from typing import ( # flake8: noqa
Any,
Awaitable,
Callable,
Deque,
List,
Optional,
Tuple,
Type,
)
import aiohttp
import thriftpy2
from aiohttp import hdrs
from aiohttp.client_exceptions import ClientErro... |
"""Fred: Train CIFAR10 with PyTorch.
Epoch: 0
[================================================================>] Step: 1s633ms | Tot: 1m49s | Loss: 1.797 | Acc: 33.956% (16978/50000) 391/391
[================================================================>] Step: 71ms | Tot: 9s672ms | Loss: 1.445 | Acc: 45.800% ... |
import cv2
import time
from modules import handtrackingmodule as htm
import math
import urllib
def main():
cam_width, cam_height = 640, 480
cap = cv2.VideoCapture("http://192.168.1.68:81/stream")
cap.set(3, cam_width)
cap.set(4, cam_height)
tracker = htm.HandTracker()
pr_time = 0
cur_tim... |
import random
from django.contrib.auth.models import User
from django.contrib.contenttypes.fields import GenericForeignKey
from django.contrib.contenttypes.models import ContentType
from django.db import models
from tinymce.models import HTMLField
from django.contrib.admin.options import get_content_type_for_model
from... |
"Encoder and Decoder modules for NHA and ODE baselines"
import torch
from torch.distributions import Independent, Normal, Categorical
import torch.nn as nn
from src.odeint import jagged_fixed_odeint
from time import time
from copy import deepcopy
################ MODEL WRAPPERS ##################
class AugmentedNeur... |
# uncompyle6 version 3.7.4
# Python bytecode 3.7 (3394)
# Decompiled from: Python 3.7.9 (tags/v3.7.9:13c94747c7, Aug 17 2020, 18:58:18) [MSC v.1900 64 bit (AMD64)]
# Embedded file name: T:\InGame\Gameplay\Scripts\Server\routing\object_routing\object_routing_behavior_actions.py
# Compiled at: 2020-04-14 00:05:30
# Size ... |
import logging
import re
from io import StringIO
from urllib.parse import urlencode
from django.contrib.postgres.aggregates.general import StringAgg
from django.http.response import Http404, StreamingHttpResponse, HttpResponseRedirect
from django.urls import reverse
from django.utils.decorators import method_decorator... |
import torch
from torch.optim.optimizer import Optimizer
from . import misc
from .base import ODEFuncBase
class SNOptAdjointCollector():
def __init__(self, odefunc):
""" SNOpt collector during adjoint process.
Args:
odefunc (ODEFuncBase): the (possibly wrapped) Neural ODE
"""... |
#!/usr/bin/env python3
#
# Class
#
"""Module to implement DDT support in the CCPP Framework.
VarDDT is a class to hold all information on a CCPP DDT metadata variable
"""
# Python library imports
import logging
# CCPP framework imports
from parse_tools import ParseInternalError, CCPPError, context_string
from meta... |
from functools import partial
from typing import Callable, List, Optional, Union
from fastai.core import to_gpu
from fastai.dataset import ModelData
from torch import optim
from torchtext.data import Dataset, Field
from quicknlp.data.torchtext_data_loaders import DialogueTTDataLoader
from quicknlp.models import CVAE,... |
# Copyright 2021, 2022 IBM Corp.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writin... |
import argparse
import torch
import torch.nn as nn
import torch.optim as optim
from copy_memory.utils import data_generator
from copy_memory.model import TCN
import time
import hyperopt
from hyperopt import fmin, tpe, hp
import numpy as np
parser = argparse.ArgumentParser(description='Sequence Modeling - Copying Me... |
import torch
import torch.nn as nn
import torch.optim as optim
import numpy as np
from PIL import Image
import cv2 #opencv
import sys
import io
import time
import pandas as pd
import numpy as np
from IPython.display import clear_output
from random import randint
import os
from selenium import webdriver
from selenium... |
from http.cookiejar import Cookie
import subprocess
import sys
from PyQt5 import QtWidgets
from PyQt5 import QtGui
from PyQt5.QtCore import QThread, QUrl
from PyQt5.QtWebEngineWidgets import QWebEngineView, QWebEngineScript
from PyQt5.QtNetwork import QNetworkCookie
from onlinejudge_workaround_for_conflict import dis... |
"""Tests for clustering-based STRIPS operator learning.
Note that most of the coverage is provided by
test_nsrt_learning_approach.py, which runs end-to-end tests of the
algorithms on actual domains.
"""
from predicators.src import utils
from predicators.src.nsrt_learning.strips_learning import \
learn_strips_oper... |
from tkinter import Tk
from tkinter import Label
from tkinter import OptionMenu
from tkinter import Button
from tkinter import Radiobutton
from tkinter import StringVar
from tkinter import LabelFrame
from tkinter import Entry
from Fonction import sauvDonnee, testLigne, testSfc
from tkinter import messagebox
f... |
import asyncio, ipaddress, re, time
from collections import OrderedDict
from datetime import datetime, timedelta
from typing import Dict, List, Optional, Set, Tuple
from typing import OrderedDict as TOrderedDict
from irctokens import build, Line
from ircrobots import Bot as BaseBot
from ircrobots import S... |
from ctypes import *
from ..constants import EI_NIDENT
# Obtained from /usr/lib/elf.h
# Type for a 16-bit quantity.
Elf32_Half = c_uint16
Elf64_Half = c_uint16
# Types for signed and unsigned 32-bit quantities.
Elf32_Word = c_uint32
Elf32_Sword = c_int32
Elf64_Word = c_uint32
Elf64_Sword = c_int32
# Types... |
# Generate new graph as an Icosahedral
if False:
graph_name = "Icosahedral"
g = igraph.Graph.Famous(graph_name)
else:
n, p = 20, 0.15
g = igraph.Graph.Erdos_Renyi(n, p)
## number of vertices in the graph
nvertices = g.vcount()
def rinit(g):
"""greedy initialization of graph coloring. Adds a new ... |
# -*- coding: utf-8 -*-
import queue
import time
from typing import Dict
from mantarray_desktop_app import create_magnetometer_config_dict
from mantarray_desktop_app import DEFAULT_MAGNETOMETER_CONFIG
from mantarray_desktop_app import DEFAULT_SAMPLING_PERIOD
from mantarray_desktop_app import MantarrayMcSimulator
from ... |
from darkflow.net.build import TFNet
from darkflow.cli import cliHandler
import json
import requests
import cv2
import os
import sys
import pytest
#NOTE: This file is designed to be run in the TravisCI environment. If you want to run it locally set the environment variable TRAVIS_BUILD_DIR to the base
# directory... |
import re
import zlib
import gzip
import struct
import socket
from datetime import datetime, timedelta
import requests
from ybk.log import quote_log as log
from ybk.models import Quote, Collection
from ybk.settings import SITES, get_conf
session = requests.Session()
session.headers = {
'User-Agent': 'Mozilla/5.0... |
import hetu as ht
import yaml
import socket
import psutil
from .context import DeviceGroup
from .gpu_ops.Variable import PlaceholderOp
class DistConfig(object):
def __init__(self, file=None, num_local_servers=0, num_local_workers=1):
if file is None:
assert num_local_workers > 0, \
... |
from flask import (
render_template, redirect, make_response, request)
from flask.ext.appbuilder.models.sqla.interface import SQLAInterface
from flask.ext.appbuilder import ModelView
from flask.ext.appbuilder.baseviews import expose_api
from flask.ext.appbuilder.actions import action
from app import appbuilder, db
... |
import streamlit as st
import numpy as np
import pandas as pd
import altair as alt
from cohort import CohortTable
# Common functions
color = '#800000ff'
def bar_chart(df_melted, y_axis, title):
chart = alt.Chart(df_melted).mark_bar(color=color, size=40).encode(
x = alt.X('Year:Q', axis=alt.Axis(tickCount=f... |
import copy
import os
import sys
from threading import BrokenBarrierError
import time
from multiprocess.context import AuthenticationError, TimeoutError
from multiprocess.managers import BaseProxy, NamespaceProxy, State
import numpy as np
import pytest
from catkit.emulators.npoint_tiptilt import SimNPointLC400
from ... |
import asyncio
from concurrent.futures import ProcessPoolExecutor, ThreadPoolExecutor
import json
import logging
import multiprocessing
import os
import time
import youtube_audio_matcher as yam
# TODO: add max threads/max processes/max queue size arguments
# TODO: summary of results (successful downloads, fingerprint... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.