text
stringlengths
3.07k
22.1k
import os import sys os.chdir(sys.path[0]) from gpiozero import Button from signal import pause from sendkeys import KeycodeSender from Adafruit_SSD1306 import SSD1306_128_64 as OLED from PIL import Image from PIL import ImageDraw from PIL import ImageFont class Display(): def __init__(self): self.Displ...
import logging import arrow import re from requests.exceptions import HTTPError import settings import github_api as gh from lib.db.models import Comment, User, ActiveIssueCommands, Issue from lib.db.models import RunTimes, InactiveIssueCommands ''' Command Syntax /vote close closes issue when no nay reactions on th...
import django import sys import os import traceback import requests # to get image from the web import shutil # to save it locally from datetime import datetime from twilio.rest import Client from django.conf import settings from django.http import HttpResponse, HttpResponseForbidden from django.views.decorators.csr...
# models.py - define model architectures. import torch import torchvision import math from torch import nn from torch.nn import init class Net(nn.Module): def __init__(self, upscale_factor): super(Net, self).__init__() self.relu = nn.ReLU() self.conv1 = nn.Conv2d(1, 64, (5, 5), (1, 1), (2, 2)) self.conv2...
#Python native from pathlib import Path #Load Keras import keras #Load the Sequential Keras NN model from keras.models import Sequential #Load the dropout and flatten libraries and fully connected layer from keras.layers import Dense, Dropout, Activation, LeakyReLU #Optimizers from keras.optimizers import Adam #Custom ...
#!/bin/env python3 # Author: dfguan9 # Contact: <EMAIL> # Insitute: Zoology Institute, CAS # Date: 2020-08-14 # Function: parse an assembly summary json file to obtain the assembly information and print to a file in table delimited format import sys, json, argparse, requests, time import re def load_tax_tree(treepat...
#!/usr/bin/env python3 import sys, os, time sys.dont_write_bytecode = True os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2' from datetime import datetime, timedelta import tensorflow as tf import numpy as np import pandas as pd import gym import retro import retro_contest.local from policy import Policy from actor import Ac...
from time import sleep from typing import List from scheduler.fcfs_scheduler import FirstComeFirstServedScheduler from scheduler.round_robin_scheduler import RoundRobinScheduler from scheduler.srt_scheduler import ShortestRemainingTimeScheduler from scheduler.scheduler import Scheduler from scheduler.process import P...
import vcf from django.http import HttpResponse from django.core.files import File import xlsxwriter import os from .vcf_functions import getBasePath, save_binary, getFilePath, parse_fasta import subprocess import collections from pytera.settings import BASE_DIR # PYTERA_PATH = str(os.getenv('PYTERA_PATH')) PYTERA_PAT...
import os import sys import torch import argparse import numpy as np from modules import utils from train import train from data import VideoDataset from torchvision import transforms import data.transforms as vtf from models.retinanet import build_retinanet from gen_dets import gen_dets, eval_framewise_dets from tube...
# # Copyright (c) 2019. JetBrains s.r.o. # Use of this source code is governed by the MIT license that can be found in the LICENSE file. # import json __all__ = ['aes', 'layer'] def aes(x=None, y=None, **other): """ Define aesthetic mappings Parameters ---------- x, y, ... : List of name value p...
# Copyright 2021 DeepMind Technologies Limited. 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 ...
# This is skeleton for labelord module # MI-PYT, task 1 (requests+click) # File: labelord.py # TODO: create requirements.txt and install import click import requests import configparser import json # PRIVATE FUNCTIONS def request(url, session): r = session.get(url) if r.status_code == 404: click.ech...
import numpy as np import pandas as pd import matplotlib.pyplot as plt data_path = 'Bike-Sharing-Dataset/hour.csv' rides = pd.read_csv(data_path) dummy_fields = ['season', 'weathersit', 'mnth', 'hr', 'weekday'] for each in dummy_fields: dummies = pd.get_dummies(rides[each], prefix=each, drop_first=False) ride...
# This is based upon https://github.com/Aplopio/haystack-queryparser with local customizations import re import operator from datetime import datetime, timedelta from haystack.query import SQ from django.conf import settings HAYSTACK_DEFAULT_OPERATOR = getattr(settings, 'HAYSTACK_DEFAULT_OPERATOR', 'AND') class Ma...
# coding: utf-8 """ description: Statsmodels model validation functions author: <NAME> """ __all__ = [ 'residual_plot', 'qq_plot', 'scale_location_plot', 'leverage_plot', 'plot_coefficients', 'plot_logit_marginal_effects' ] import numpy as np import pandas as pd import matplotlib as m...
import os import logging import types from prf.utils import snake2camel, maybe_dotted log = logging.getLogger(__name__) DEFAULT_ID_NAME = 'id' class Actions(object): index = '_index' show = '_show' create = '_create' update = '_update' patch = '_patch' delete = '_delete' delete_many = '_d...
import datetime from random import choice from math import log, sqrt import sys class Board(object): # 1 for opponent # -1 for me def start(self): return tuple([tuple([0 for _ in range(9)]) for _ in range(10)]) def current_player(self, state): total = 0 for row in state[0:9]: ...
#!/usr/bin/env python # import tempfile import caffe from caffe import layers as L import os import argparse import layer_tools as LT from caffe_config import CaffeConfig import pprint from to_string import to_string RPN="rpn" FAST_RCNN="fast_rcnn" class NetworkConfig(CaffeConfig): def __init__(self, network_type...
import os.path import datetime import os import babel import babel.numbers import utils import excel_handler class GoalItem: def __init__(self, earliest, last): self.earliest = earliest self.last = last class TimeItem: def __init__(self, date, time): str = date + " " + time ...
#!/usr/bin/env python # Copyright BigchainDB GmbH and BigchainDB contributors # SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0) # Code is Apache-2.0 and docs are CC-BY-4.0 import json import base58 from pytest import mark, raises from requests.utils import default_headers from sha3 import sha3_256 from cryptocon...
""" Main program to run the detection """ from argparse import ArgumentParser import cv2 import mediapipe as mp import numpy as np # for TCP connection with unity import socket from collections import deque from platform import system # face detection and facial landmark from facial_landmark import Fa...
import RPi.GPIO as GPIO import os import threading import emoji import json import dropbox from telegram.ext import CommandHandler, Updater, MessageHandler, Filters import time import datetime import argparse import warnings from pyimagetemp.tempimage import TempImage from picamera.array import PiRGBArray from picamer...
# Copyright 2016 Intel Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wri...
#---------------------------------------------------------------------------- # # module: opusutil # # General purpose OPUS-Python functions # # 01/20/05 52348 Sherbert Remove "MSG_DEGUG" to obviate its use # 12/15/05 54226 Sontag Added UsingLvl() and __all_valid_levels #-----------------------------------------...
import dynet as dy import numpy as np def orthonormal_initializer(output_size, input_size): """ adopted from <NAME> https://github.com/tdozat/Parser/blob/master/lib/linalg.py """ # print (output_size, input_size) I = np.eye(output_size) lr = .1 eps = .05/(output_size + input_size) succ...
import json import os import socket import uuid from os import listdir from os.path import isdir, isfile, basename, join from typing import Any from bson import ObjectId from pymongo import MongoClient from pymongo.errors import OperationFailure, PyMongoError from balticlsc.computation_module.baltic_lsc.data_handle imp...
import glob import os import re import shutil import warnings import zipfile from collections import Counter from functools import partial from itertools import chain from typing import Optional, Union from urllib.request import urlretrieve import numpy as np import pandas as pd import tensorflow as tf from six import...
""" main script to interface automl/efficientdet """ import os import sys import json import shutil from datetime import datetime from os.path import expanduser # Append submodule path to python search path sys.path.append(os.path.join(os.getcwd(), 'freeze')) sys.path.append(os.path.join(os.getcwd(), 'tfrmod')) sys.pa...
import json from aiohttp import web from aiorpcx import RPCError from functools import reduce from decimal import Decimal from electrumx.lib.hash import hash_to_hex_str import electrumx.lib.util as util BAD_REQUEST = 1 MAX_TX_QUERY = 50 class HttpHandler(object): def __init__(self, session_mgr, db, mempool, pee...
import torch import cv2 import numpy as np import scipy import lap from scipy.spatial.distance import cdist from cython_bbox import bbox_overlaps as bbox_ious from tracking_utils import kalman_filter import time from data import cfg import pycocotools from layers.box_utils import mask_iou coco_ambiguous_class = np.ar...
from typing import Tuple import numpy as np def extract_mat_components(mat: np.ndarray) -> Tuple[np.ndarray, np.ndarray, np.ndarray, np.ndarray, np.ndarray, np.ndarray, np.ndarray, np.ndarray, np.ndarray, np.ndarray]: """Return a mask indicating with frames hav...
# 대신증권 API # 해외선물 주문 예제 # 플러스를 이용하여 해외선물 매수/매도 주문 하는 예제입니다. # ■ 사용된 플러스 객체 # CpForeDib.OvFutMst - 해외선물 현재가 조회 # CpForeTrade.OvFutOrder - 해외선물 주문 # CpForeDib.OvFutCur - [실시간] 해외선물 체결 시세 # CpForeDib.OvFutBid - [실시간]해외선물 5차호가 시세 # 매수 주문은 1차 매수호가로, 매도 주문은 1차 매도호가를 이용하고 # 주문 종목은 에디트에 입력된 종목코드를 기준으로 1주 주문 합니다...
import pytest import prophy @pytest.fixture(scope='session') def X(): class X(prophy.with_metaclass(prophy.struct_generator, prophy.struct_packed)): _descriptor = [("x", prophy.u32)] return X @pytest.fixture(scope='session') def FixedScalarArray(): class FixedScalarArray(prophy.with_metaclass(...
#!/usr/bin/env python2 # pylint: disable=missing-docstring,invalid-name,redefined-outer-name # XXX: Refactor to a comand line tool and remove pylint disable """Create gene expression profiles.""" from __future__ import absolute_import, division, print_function import argparse import logging import math import os impor...
# -*- coding: utf-8 -*- """ Program: ghost_box Created: Apr 2020 @author: <NAME> (RRCC) <EMAIL> """ ### IMPORTS import random import math as m import numpy as np import matplotlib.pyplot as plt import matplotlib.animation as animation from matplotlib.ticker import AutoMinorLocator from matplotl...
#Integrantes: #<NAME>. #<NAME>. from tkinter import * from PIL import ImageTk, Image from threading import Semaphore, Thread, current_thread from time import sleep import random #Se crea el la venta principal de ejecución del gráfico. ventana = Tk() #Se declaran las variables para poder obtener los valores de los cu...
import numpy as np from nengo.builder import Builder, Operator, Signal from nengo.builder.operator import Reset from nengo.learning_rules import LearningRuleType from nengo.synapses import SynapseParam, Lowpass from nengo.version import version_info __all__ = ['RLS'] class RLS(LearningRuleType): """Recursive le...
""" Provides models to represent Patients and the concrete information we have about them. """ from textwrap import dedent from django.db import connection from django.db.models import ( Model, CASCADE, ForeignKey, ManyToManyField, BigIntegerField, BooleanField, CharField, DateField, DateTimeField, FloatFie...
import logging import typing import glob, os import json from typing import Optional, Text from rasa.shared.utils.cli import print_info, print_success from rasa.shared.nlu.interpreter import RegexInterpreter from rasa.shared.constants import INTENT_MESSAGE_PREFIX from rasa.nlu.model import Interpreter, Metadata from r...
import requests import json import dateutil.parser from typing import List, Dict, Union from bs4 import BeautifulSoup, element # type: ignore from ..errors import FormatError from ..utils import assert_equal_sets TimeSeriesItem = Dict[str, Union[str, int]] TimeSeries = List[TimeSeriesItem] UnformattedSeriesItem = Dict...
""" Training step for the paper: four labels + Ak + C + N """ import numpy as np import glob import matplotlib.pyplot as plt import sys import pyfits #sys.path.insert(0, '/home/annaho/aida41040/annaho/TheCannon/TheCannon') #sys.path.insert(0, '/home/annaho/aida41040/annaho/TheCannon') from TheCannon import dataset fro...
from cbuild.core import paths, logger, chroot import configparser import platform import pathlib import shlex import os import sys # recognized hardening options hardening_fields = { "fortify": True, "pie": True, "relro": True, "ssp": True, # this should really be compiler default "scp": False, # ...
import pytest import tensorflow as tf from tfsnippet.utils import auto_reuse_variables, instance_reuse, global_reuse class AutoReuseVariablesTestCase(tf.test.TestCase): def _check_vs(self, get_var_name, vs_name, vs_scope, var_name, op_name): vs = tf.get_variable_scope() self.assertEqual(vs.name,...
# Copyright (c) 2019, <NAME>, Durham University # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
"""Post regression utilities""" from dataclasses import dataclass import numpy as np import matplotlib.pyplot as plt from sklearn.utils import resample @dataclass class PredictionResults: """ Class which stores model predictions, based on block cross-validation """ pred: list # List of out of sa...
# Copyright (c) Facebook, Inc. and its affiliates. # Copyright (c) 2020, <NAME> (@e-bug). # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import os import sys import json import yaml import random import logging import argparse from io import...
from optimism.JaxConfig import * from optimism import ReadMesh from optimism.material import Neohookean from optimism.material import LinearElastic from optimism import EquationSolver from optimism.SparseCholesky import SparseCholesky as Cholesky from optimism import SparseMatrixAssembler from optimism import Functio...
# -*- coding:utf8 -*- """ @Author: Zhirui(<NAME> @Date: 2021/5/1 下午11:36 """ import os import pandas as pd import numpy as np import matplotlib.pyplot as plt import plotly import plotly.graph_objects as go from plotly import tools from plotly.subplots import make_subplots from plotly.offline import iplot, init_noteb...
#!/usr/bin/python # -*- coding: utf-8 -*- import curses import time import linecache import os import re import sys def get_iface_type(iface): syspath = '/sys/class/net/' + iface # strategy 1: use /sys/class/net/IFACE/uevent with open(syspath + '/uevent') as f: uevent = f.read() regex = r...
from __future__ import absolute_import from __future__ import division from __future__ import print_function import os import json import argparse import cv2 import numpy as np import time import torch from external.nms import soft_nms from utils.logger import Logger from config import Config from dataset.coco impor...
#!/usr/bin/env python3 import os import sys import argparse import logging from barcode import Barcode, BarcodeTag, BarcodeStat from fastq import FastqReader, FastqRecord, FastqFileStat import util from fitness import BarseqLayout, Fitness class Context: BARCODE_STAT_FNAME_SUFFIX = '.bstat.tsv' FSCORE_BASE_F...
""" Description: Create the PySAL logo with TeX/TikZ, then create favicons at specified resolutions with ImageTricks. The original logo design was based on Figure 1 from Rey and Anselin (2007). Examples are given within `create_logo()` and `create_favicon()`. Further examples can be found in `PySAL...
from pathlib import Path import json import random import os import subprocess import math import shutil import numpy as np import torch from torch.nn import CrossEntropyLoss from torch.optim import SGD, lr_scheduler import torch.multiprocessing as mp import torch.distributed as dist from torch.backends import cudnn im...
#!/usr/bin/env python import multiprocessing import time import pygtk pygtk.require('2.0') import gtk import math import serial if __name__ == "__main__": ser = serial.Serial('COM3', 9600) # Convenience functions import sys class DMXWidgets: def chanval(self, chan, val): if self.dmxoff is...
# # Part of hdlpy. # Copyright (c) 2021, <NAME> # # Permission to use, copy, modify, and/or distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DI...
from collections import defaultdict import openpyxl from django.urls import reverse from django.utils.translation import ugettext as _ from lxml import etree from corehq.apps.app_manager.views.media_utils import interpolate_media_path from corehq.apps.translations.app_translations.download import get_bulk_app_single...
import PIL.Image import PIL.ImageFont import PIL.ImageDraw from io import BytesIO import requests from datetime import datetime from random import choice from utils import arrays, integers, images, times import asyncio from os.path import isfile import logging import traceback from data import fnbr FONT = "assets/bur...
# Copyright 2020 <NAME>, <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, ...
import argparse import logging import os import shutil import sys import tempfile from typing import TYPE_CHECKING from absl import flags from haoda import util from haoda.backend import xilinx as backend from soda.codegen.xilinx import header from soda.codegen.xilinx import hls_kernel as kernel from soda.codegen.xil...
from bs4 import BeautifulSoup from time_tools import date_fixer, timestamp_short from pathlib import Path import csv import os import shutil import configparser from msgbox import MsgBox def ebay_active(config_file): """ Extract eBay active listing data from saved HTML and export to CSV. """ config =...
# python3 """class State wraps a tensor as underlying representation.""" import cmath import math import random from typing import List, Optional import numpy as np from src.lib import helper from src.lib import tensor class State(tensor.Tensor): """class State represents single and multi-qubit states.""" def...
import tidypolars as tp from tidypolars import col import math def test_abs(): """Can get absolute value""" df = tp.Tibble(x = range(-3, 0)) actual = df.mutate(abs_x = tp.abs('x'), abs_col_x = tp.abs(col('x'))) expected = tp.Tibble(x = range(-3, 0), abs_x = range(3, 0, -1), abs_col_x = range(3, 0, -1))...
from __future__ import annotations import math from queue import LifoQueue, Queue from typing import Iterable, Tuple, List, Any, Optional, Callable # Basic types Action = Any State = Any GoalTestFn = Callable[[State], bool] SuccessorFn = Callable[[State], Iterable[Tuple[Action, State, float]]] HeuristicFn = Callable[...
''' Created by <NAME> ISIA Lab, Faculty of Engineering University of Mons, Mons (Belgium) <EMAIL> Source: Delvigne, et al."PhyDAA: Physiological Dataset Assessing Attention" IEEE Transaction on Circuits and Systems for Video Technology (TCSVT) (2016). Copyright (C) 2021 - UMons This library is free software; you can re...
# #####utils_serv.py,Service服务相关的计算逻辑 import json from flask import g from mdata import metadata as md from config.config import cfg as config from common import constants as const, cache from privilege import role_privilege as rp from mdata import index_unique as idx from data import data_view as vw from ui import ui_...
from pathlib import Path from attr import attrib, dataclass from iters import iter from gd.abstract_entity import AbstractEntity from gd.async_iters import awaitable_iterator from gd.errors import MissingAccess from gd.http import NEWGROUNDS_SONG_LISTEN, URL from gd.model import SongModel # type: ignore fr...
import torch import numpy as np import pandas as pd from torch.utils.data import Dataset from torch.distributions.normal import Normal from torch.distributions.categorical import Categorical from torch.distributions.kl import kl_divergence import torch.nn as nn import torch.optim as optim x_dim = 37 y_dim...
import cv2 import numpy as np import math import time from .utilities import Distance, Distance_ from ...config import config def BwareaOpen(img,MinArea): thresh = cv2.threshold(img, 0, 255, cv2.THRESH_BINARY)[1] # Filter using contour area and remove small noise cnts = cv2.findContours(thresh,...
from threading import Thread from tkinter import messagebox import hashlib import json import os import shutil from urllib.parse import urljoin import requests from semantic_version import Version Timeout = requests.urllib3.connection.ConnectTimeoutError class Paths(object): meta_file = "VERSION.json" te...
#------------------------------------------------------------------------------+ # # <NAME> (<EMAIL> or <EMAIL>) # Racing Line Optimization with PSO # MIT License, Copyright (c) 2021 <NAME> # #------------------------------------------------------------------------------+ import json import math import matplotlib.pypl...
#!/usr/bin/env python import datetime import html import json import uuid import molstruct.names as n def jsonldhtml(reader, limit=None): print('''<!DOCTYPE html> <html lang="en"> <head> <title>Example Document</title> <script type="application/ld+json">''') jsonld(reader, limit=None) print('''...
from __future__ import division """The main window.""" import os import logging from bisect import bisect from PyQt4 import QtCore, QtGui from PyQt4.QtGui import (QAction, QMainWindow, QMessageBox, QSystemTrayIcon, QIcon, QMenu, QPushButton, QLineEdit, QDialog) from wefree.passwords_manager import PM,GEO from w...
import argparse import os import numpy as np import shutil import time import torch import torch.nn as nn import torch.nn.parallel import torch.backends.cudnn as cudnn import torch.distributed as dist import torch.optim import torch.utils.data import torch.utils.data.distributed import torchvision.transforms as transf...
import os import pathlib import subprocess import sys import time # from consts import config # wandb.init(project="rxrx1", config=config, sync_tensorboard=True) # from wandb.keras import WandbCallback import numpy as np import pandas as pd import tensorflow as tf from sklearn.model_selection import train_test_split ...
#-*- coding: utf-8 -*- """ Written by <NAME> and CONTRIBUTORS Email: danaukes<at>asu.edu. Please see LICENSE for full license. """ import qt.QtCore as qc import qt.QtGui as qg from popupcad.filetypes.userdata import UserData from dev_tools.acyclicdirectedgraph import AcyclicDirectedGraph, Node class NotValid(Except...
#!/usr/bin/python # -*- coding: utf-8 -*- import math import operator from collections import namedtuple from pathlib import Path from typing import List, Dict, Union, Tuple, Iterable, Optional from pyutils.list_utils import _ from tensorboardX import SummaryWriter from data_structure import GraphNode, GraphLink, Gra...
#!/usr/bin/python3 import operator import sys import json import os sys.path.append(os.getcwd()) sys.path.append("..") import log import log.logger import traceback import datetime import sqlalchemy import stmanage import requests import random import comm import comm.error import comm.result import comm.values from co...
from manimlib.imports import * from ManimProjects.utils.Parabola import Parabola from ManimProjects.utils.geometry import CText class OpenScene(Scene): def construct(self): sub1 = CText('这将是一个') sub2 = CText('关于线段长度的性质') subs = VGroup(sub1, sub2) subs.arrange(DOWN) self.play...
#!/usr/bin/env python from __future__ import annotations import argparse from collections import deque import json import logging import os import signal import sys from typing import Any from pygtrie import CharTrie import Xlib import Xlib.X import Xlib.XK import Xlib.display import Xlib.ext.record import Xlib.prot...
from datetime import datetime from unittest import mock from click.testing import CliRunner from test.splitgraph.conftest import OUTPUT from splitgraph.commandline import ( status_c, sql_c, diff_c, commit_c, log_c, show_c, table_c, object_c, objects_c, ) from splitgraph.core.metada...
""" Tests for Tax-Calculator calcfunctions.py logic. """ # CODING-STYLE CHECKS: # pycodestyle test_calcfunctions.py # pylint --disable=locally-disabled test_calcfunctions.py import os import re import ast from taxcalc import Records # pylint: disable=import-error from taxcalc import calcfunctions import numpy as np i...
from hashlib import sha256 import time import random import uuid import pandas as pd import logging import os import gnupg from tempfile import TemporaryDirectory from datetime import datetime CSV_SEPARATOR = ";" PAN_UNENROLLED_PREFIX = "pan_unknown_" SECONDS_IN_DAY = 86400 MAX_DAYS_BACK = 3 TRANSACTION_FILE_EXTENSI...
# Copyright (c) 2020, Huawei Technologies.All rights reserved. # # Licensed under the BSD 3-Clause License (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://opensource.org/licenses/BSD-3-Clause # # Unless required by applicable law...
# Copyright 2008-2015 Nokia Networks # Copyright 2016- Robot Framework Foundation # # 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 ...
import pytest from motllo.markdown_parser import ( InlinedCodeBlock, BareCodeBlock, BareCodeBlockParser, LinkBlock, ListBlock, ListBlockParser, TextBlockParser, CodeBlockParser, OrderedOneOfParser, LinkBlockParser, TagBlockParser, SequenceParser, TextBlock, CodeBl...
from __future__ import annotations import string import sys from typing import Any, Callable, Union, Optional, Type, Tuple, TYPE_CHECKING from maybe import Maybe from subtypes import Enum, ValueEnum, Dict, DoNotTranslateMeta from miscutils import cached_property, is_running_in_ipython from .synchronizer import Synch...
# (C) Copyright 2017 Inova Development Inc. # All Rights Reserved # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appl...
from collections import namedtuple, UserList import base64 import re import requests import os class Config(object): """Configuration to acess DocBase API. :type api_token: str :param api_token: The api token to access API. :type team: str :param team: The team name to access API. """ ...
import re import itertools from bs4 import BeautifulSoup as bs from .models import * __all__ = ['SourceParser', 'LanguageParser', 'WordParser', 'EtymonParser', 'LoanParser', 'NoiseParser', 'NearParser', 'RootParser'] class Parser: """ A Parser is concerned with one main data type. As such it kno...
import torch import torch.nn as nn import torch.optim as optim from torch.autograd import Variable from torch.optim.lr_scheduler import StepLR from nets import Net from config import args from dataloader import Producer, loadImg, loadImg_testing from utils import read_miniImageNet_pathonly, mean_confidence_interval, D...
""" Functions for planning a delete move. - makePlanForEmptyComps - makePlanForEligibleComps - getEligibleCompInfo - getEligibleCount """ import numpy as np from bnpy.deletemove import DeleteLogger def makePlanForEmptyComps(curSS, dtargetMinCount=0.01, **kwargs): """ Create a Plan dict for any empty states. ...
#!/usr/bin/env python3 import sys # with collection, we keep the same device order as the json file import json, collections import re if len(sys.argv) != 3: print("usage: ", sys.argv[0], "<mode> <filename.json>\n"); sys.exit(1); # mode is C or ADA mode = sys.argv[1]; filename = sys.argv[2]; ###############...
""" Format-independent file objects. (c) 2019-2020 <NAME>. Copywright: Ask for permission writing to <EMAIL>. """ import numpy as np import matplotlib.pyplot as plt from autologging import logged, traced from fullwavepy.generic.decor import timer from fullwavepy.generic.parse import kw, del_kw, exten, strip, path_le...
import gc import gzip import operator as op from functools import reduce from pathlib import Path import torch from rtg import log import inspect import shutil import os from datetime import datetime import atexit from typing import Tuple import resource import sys import numpy as np import subprocess from itertools im...
#!/usr/bin/env python # -*- coding:utf-8 -*- import re from xbmcswift2 import Plugin import requests from bs4 import BeautifulSoup import xbmcgui import base64 import json import urllib2 import sys import HTMLParser import re def unescape(string): string = urllib2.unquote(string).decode('utf8') quoted = HTMLP...
#!/usr/bin/env python2.7 """ update_dreqs_0034.py This file adds data and variable requests for the Ofx table, which was missed at the start of the project. """ from __future__ import (unicode_literals, division, absolute_import, print_function) import argparse from datetime import datetime imp...
import logging import os import pickle import statistics import threading import time from typing import Dict, List, Callable, Optional, Tuple import matplotlib.pyplot as plt from matplotlib.backends.backend_pdf import PdfPages from rlai.agents.mdp import MdpAgent # plotting data and objects from rlai.policies.parame...
""" Just a process to a centralized basic create user from password and username """ from flask import request, redirect, render_template, session, flash, abort import random import json from flask_babel import _ from datetime import timedelta, datetime import logging logging.basicConfig(level=logging.INFO) from fact...
# -*- coding: utf-8 -*- # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved # File: transform.py import numpy as np from fvcore.transforms.transform import HFlipTransform, NoOpTransform, Transform from PIL import Image import cv2 import random import logging from detectron2.utils.autoaug import * ...