text
stringlengths
3.07k
12.6k
''' Created on Jan 29, 2022 @author: immanueltrummer ''' import argparse import codexdb.catalog import codexdb.engine import json import math import os import pandas as pd import time def get_code(language, test_case): """ Extract code in specified language from test case. Args: language: extract...
# -*- coding: utf-8 -*- """Support for LaMetric notifications.""" import logging import voluptuous as vol from enum import Enum import requests import json from homeassistant.components.notify import ATTR_DATA, ATTR_TARGET, PLATFORM_SCHEMA, BaseNotificationService from . import DOMAIN as LAMETRIC_DOMAIN from . imp...
import json import os import subprocess import unittest from . import assertPopen from .. import * from mike import git_utils, versions _default_output = ('4.0 [dev, latest]\n' + '"3.0.3" (3.0) [stable]\n' + '"2.0.2" (2.0)\n' + '1.0\n') class ListTestCase(uni...
#!/usr/bin/env python # Copyright (c) Microsoft. All rights reserved. # Licensed under the MIT license. See LICENSE.md file in the project root # for full license information. # ============================================================================== import argparse import os import shelve import sys import ti...
import os, itertools, traceback, hashlib, time, collections import numpy as np import tables def sliceiter(n, stop): i = 0 while i<stop: yield slice(i,i+n) i+= n def multihash(*args, binary=False): h = hashlib.sha256() for a in args: h_ = hashlib.sha256() h_.update(a.encode("utf-8") if type(a...
"""Adapted from sphinx.ext.autosummary.generate Modified to only consider module members listed in `__all__` and only class members listed in `autodoc_allowed_special_members`. Copyright 2007-2016 by the Sphinx team, https://github.com/sphinx-doc/sphinx/blob/master/AUTHORS License: BSD, see https://github.com/sphinx-...
import torch import torch.utils.data as data import random import math import os import logging from utils import config import pickle from tqdm import tqdm import numpy as np import pprint pp = pprint.PrettyPrinter(indent=1) from nltk.tokenize import word_tokenize from nltk.corpus import wordnet import nltk # nltk.dow...
#!/usr/bin/python import os import time import atexit import cv2 import math import numpy as np import sys import params import argparse import input_kbd ########################################################## # import deeppicar's sensor/actuator modules ########################################################## c...
# coding=utf-8 import collections import time import urwid import urwid.curses_display from websockets.protocol import State palette = [ ('starting', 'white', ''), ('starting_text', 'black', 'yellow'), ('connected', 'black', 'dark green'), ('connected_highlight', 'black', 'white'), ('error', 'blac...
import nltk import spacy from collections import Counter from textstat import flesch_reading_ease import regex as re from nltk import ngrams as make_ngrams from language_change_methods.utility_functions import get_ll_and_lr import pandas as pd from typing import Iterable from sklearn.feature_extraction import DictVecto...
""" - [ ] TODO change spec format? - [ ] TODO SPEC: allow to ignore fields """ import itertools import unittest from unittest import TestCase class UNDEFINED_Class: def __repr__(self): return "UNDEFINED" def __str__(self): return self.__repr__() UNDEFINED = UNDEFINED_Class() class Diff: ...
from solver import Solver from task_scheduler import TaskScheduler from DAG_scheduler import DAGScheduler from data_loader import DataLoader import numpy as np import logging import time def DepthBasedBaseline(file_path="../ToyData.xlsx"): """ Depth Based Baseline, implemented by <NAME> """ f = open(...
from typing import List from urllib.parse import quote_plus import aiohttp # type: ignore import discord # type: ignore from kanaconv import KanaConv # type: ignore from discord.ext import commands # type: ignore import botto romanizer = KanaConv() # pylint: disable=invalid-name # This exists because otherwise...
#!/usr/bin/env python3 # coding:utf-8 import datetime from sqlalchemy import Integer, Column, String, DateTime, Boolean from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.orm import sessionmaker Base = declarative_base() class BaseModel(object): keys = [] def __init__(self, id, engine, ...
#dotomole - 27/7/19 #Html scrape, to dsv creation, all done here from bs4 import BeautifulSoup import re import os import requests import unit_indexes import sys import time cur_dir = os.getcwd() src_dir = os.path.dirname(cur_dir) raw_dir = os.path.join(src_dir, r'raw') dsv_dir = os.path.join(raw_dir, r'dsv') html_dir...
import multiprocessing import numpy as np from skimage import io as skio, transform as skt from tensorflow.keras.utils import Sequence, OrderedEnqueuer from tqdm import tqdm # # # # # class ImageLoader(Sequence): # def __init__(self, filenames, img_size=None, img_type='rgb', prepro=None, batch_size=1): # if...
#!/usr/bin/env python # -*- coding: utf-8 -*- import argparse,os,sys,re import multiprocessing as mp def str2bool(v): if v.lower() in ('yes', 'true', 't', 'y', '1'): return True elif v.lower() in ('no', 'false', 'f', 'n', '0'): return False else: raise argparse.ArgumentTypeError('Bo...
class BaseCreateTemplate(object): template = u""" create {materialization} "{schema}"."{identifier}" {dist_qualifier} {sort_qualifier} as ( {query} );""" incremental_template = u""" {{% if not already_exists("{schema}", "{identifier}") %}} create table "{schema}"."{identifier}" {dist_qualifier} {sort_qua...
from discord.ext import commands import discord import toml from commands.utils import checks import typing import re class Rules(commands.Cog, name='Handlers'): def __init__(self, bot: commands.AutoShardedBot): self.bot = bot # todo role listener try: with open("rules.toml", 'r...
# -*- coding: utf-8 -*- # Zinc data types # See the accompanying LICENSE file. # (C) 2016 VRT Systems # (C) 2021 Engie Digital # # vim: set ts=4 sts=4 et tw=78 sw=4 si: """ Implementation of all haystack types. See https://www.project-haystack.org/doc/TagModel#tagKinds """ import base64 import binascii import re from...
# Copyright 2015 Fortinet Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agre...
from rest_framework import serializers class ProjectMetadata: def __init__(self, torrent_name, torrent_info_hash, additional_data, processing_steps): self.torrent_name = torrent_name self.torrent_info_hash = torrent_info_hash self.additional_data = additional_data self.processing_s...
from pathlib import Path import sys import os sys.path.append('../model/') import pandas as pd import numpy as np # This needs to be here despite not being used see # https://scikit-learn.org/stable/modules/generated/sklearn.impute.IterativeImputer.html from sklearn.experimental import enable_iterative_imputer from sk...
import os import numpy as np import torch from torch import nn from torch.nn import functional from torch.jit.annotations import Tuple, List import einops from torchdistill.common.constant import def_logger from torchdistill.models.util import wrap_if_distributed, load_module_ckpt, save_module_ckpt, redesign_model fro...
import os import sys import pandas as pd import collections import matplotlib.pyplot as plt plt.switch_backend('agg') from src.utils import cxpPrinter def plotDistribution(data, output_dir, title_prefix='', title='Number of active cells'): fig, axes = plt.subplots(1, 2, figsize=(11,4)) # overall figure fi...
import email.message import importlib.metadata import os import pathlib import zipfile from typing import Collection, Dict, Iterable, Iterator, Mapping, Optional, Sequence from pip._vendor.packaging.requirements import Requirement from pip._vendor.packaging.utils import NormalizedName, canonicalize_name from pip._vend...
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://github.com/nedbat/django_coverage_plugin/blob/master/NOTICE.txt """Base classes and helpers for testing the plugin.""" import contextlib import os import os.path import re import unittest import coverage import dja...
import pixy.core import allel import numpy as np from scipy import special from itertools import combinations from collections import Counter # vectorized functions for calculating pi and dxy # these are reimplementations of the original functions # helper function for calculation of pi # for the given site (row of...
#!/usr/bin/env python from whatshap.core import ReadSet, PedigreeDPTable, Pedigree, NumericSampleIds, PhredGenotypeLikelihoods from whatshap.testhelpers import string_to_readset, canonic_index_list_to_biallelic_gt_list import textwrap from collections import defaultdict from whatshap.core import Read, ReadSet, readsel...
""" Readable/Writable objects """ from typeclasses.objects import Object from evennia import CmdSet from commands.base import ArxCommand from world.templates.mixins import TemplateMixins class Readable(Object): """ Class for objects that can be written/named """ def at_object_creation(self): ...
# Copyright 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.txt" file accom...
#!/usr/bin/python # Copyright 2015 Google 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 appli...
from .apitest_shared import * from datetime import timedelta, date from personio_py import Employee, ShortEmployee, Personio, PersonioError, Absence, AbsenceType @skip_if_no_auth @pytest.mark.parametrize("half_day_start", [True, False]) @pytest.mark.parametrize("half_day_end", [True, False]) def test_create_absences...
import discord from discord.ext import commands from Functions.data import DATA from Functions.dates import DATES import asyncio class seasonlist(commands.Cog): """ Displays the list of seasons in the TWOW Glicko data. """ FORMAT = "(page)" USAGE = """Using `gl/seasonlist` will display a paged ...
import os import time import random import numpy as np import pandas as pd import torch import torch.nn as nn import torch.optim as optim import torch.utils.data as data import torch.backends.cudnn as cudnn import argparse from tqdm import tqdm from utils.distill import Attention, DistillKL from utils.metric import E...
# # CAMP # # Copyright (C) 2017 -- 2019 SINTEF Digital # All rights reserved. # # This software may be modified and distributed under the terms # of the MIT license. See the LICENSE file for details. # from camp.entities.report import FailedTest, ErroneousTest, \ SuccessfulTest, TestSuite, TestReport, Verdict ...
# -*- coding: utf-8 -*- from __future__ import absolute_import, division from six.moves.urllib.request import urlretrieve try: import pathlib except ImportError: # Python 2.7 import pathlib2 as pathlib import os import os.path import pytest from MDAnalysisData import base from MDAnalysisData import ad...
import argparse import re import matplotlib.pyplot as plt import seaborn as sns import numpy as np import pandas as pd import os ap = argparse.ArgumentParser() ap.add_argument('-i', '--input', type=str, default='../results/logs.csv', help='Input file containing the logs') ap.add_argument('-o', '--outp...
import urllib2 import base64 import kerberos as krb from urlparse import urlparse import logging log = logging.getLogger( __name__ ) class PreemptiveBasicAuthHandler(urllib2.BaseHandler): """ A BasicAuthHandler class that will add Basic Auth headers to a request even when there is no basic auth challenge...
from django.shortcuts import get_object_or_404, render, render_to_response from django.http import HttpResponseRedirect, HttpResponse from django.core.urlresolvers import reverse from django.template import * from django.views import generic from django.utils import timezone from blog.models import Blog, Comment from p...
# -*- coding: utf-8 -*- # MegEngine is Licensed under the Apache License, Version 2.0 (the "License") # # Copyright (c) 2014-2020 Megvii Inc. All rights reserved. # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT ARRANTI...
import aioredis import asyncio import datetime import coc import discord import aiohttp import traceback import creds from discord.ext import commands from botlog import setup_logging, add_hooks from cogs.utils import context, category from cogs.utils.db import Table from cogs.utils.error_handler import error_handler...
import json import sys import os from bs4 import BeautifulSoup import ast import csv import re import configuration as c cloned_repos = './repos_mining_data/otherData/cloned_repos.json' clones_path = '../Repos/' detection_result_path = './repos_mining_data/otherData/repos_detected_files.json' filtered_heuristic = './...
# python3 """Transform ISIC classifications into RDF and JSON-LD Notes: ----- This package allows to transform ISIC classification (*.txt) into RDF and JSON-LD. It can transform the ISIC classification into centrally registered identifier (CRID) and into classes. The package is compatible with the IEO ontology[1]. [...
from tkinter import * import sys import time from networktables import NetworkTables as nt import logging #ip Address ip = "XX.XX.XX.XX" #Replace with Valid IP '''Network Tables Communication''' class NetworkTables: def __init__(self, sd, scale, switch): self.sd = nt.getTable("SmartDashb...
# adapted from PyTorch tutorials import copy import time from typing import List, Tuple, Optional import torch import torch.optim as optim from torch import nn from data import AudioVideo, AudioVideo3D from kissing_detector import KissingDetector, KissingDetector3DConv ExperimentResults = Tuple[Optional[nn.Module], ...
from django.shortcuts import render from django.contrib.auth.models import User from .models import Profile, Review, Service from django.shortcuts import render, redirect, get_object_or_404 from .forms import ReviewForm, UserRegistrationForm, UpdateUserProfileForm from .email import send_welcome_email from django.contr...
"""Call arbitrary API endpoints.""" import json import click from SoftLayer.CLI import environment from SoftLayer.CLI import exceptions from SoftLayer.CLI import formatting from SoftLayer.CLI import helpers from SoftLayer import utils SPLIT_TOKENS = [ ('in', ' IN '), ('eq', '='), ] def _build_filters(_filt...
#!/usr/bin/env python3.6 ## Example output: # ex: Crypto-Loot.com,show-anime.com,172.16.58.3,1 # ^^args.keyword ^^domain ^^ip, ^found vs not found # ## Example of keyword (javascript) embedded in html. # A match in use should look something like this, specifically in the case # of crypto-loot.com: <...
import os import magma as m from magma.testing import check_files_equal from magma.primitives import LUT import fault def test_basic_lut(): contents = ( m.Bits[8](0xDE), m.Bits[8](0xAD), m.Bits[8](0xBE), m.Bits[8](0xEF) ) class test_basic_lut(m.Circuit): io = m.I...
import logging import re import time from os import getenv import en_core_web_sm import sentry_sdk from flask import Flask, request, jsonify # import spacy - not worked # nlp = spacy.load("en_core_web_sm") - not worked nlp = en_core_web_sm.load() sentry_sdk.init(getenv("SENTRY_DSN")) logging.basicConfig(format="...
import csv import glob def parser(): files = glob.glob('*.csv') target = open('result.csv', 'w') for file in files: with open(file) as csvfile: readCSV = csv.reader(csvfile, delimiter=',') for row in readCSV: div = row[0] date = r...
""" Ensemble ======== The behavior and properties of a simulated system can be described with a statistical mechanical ensemble. Even though the system contains an extremely large number of particles and distribution of possible states, the ensemble can be parametrized by just a few quantities. Then, the real thermody...
import re from string import Template from lxml import html from vigorish.scrape.brooks_pitch_logs.models.pitch_log import BrooksPitchLog from vigorish.util.result import Result PITCHFX_URL_XPATH = '//a[text()="Get Expanded Tabled Data"]/@href' PITCH_COUNTS_XPATH = '//div[@class="span9"]//table[2]//tr' T_PITCHFX_UR...
#!/usr/bin/env python3 import argparse import re import os from three_ds.aesengine import AESEngine from three_ds.content import SDFile, NANDFile import hashlib from binascii import hexlify, unhexlify import struct import progressbar import math parser = argparse.ArgumentParser(description='3DS SD card contents encry...
""" Computes the test accuracy of the model. author: <NAME> date: 2020-05-02 """ import argparse import torch import torch.nn as nn import torch.nn.functional as F import utils.metrics as metrics import utils.misc as misc from datahandler.LITIV import LITIV from datahandler.LITIVDataset import TestLITIVDataset from...
import re import random import string from wafamole.utils.check import type_check def replace_nth(candidate, sub, wanted, n): """Replace the n-th occurrence of a portion of the candidate with wanted. Arguments: candidate (str) : the string to be modified sub (str) : regexp containing what t...
### # Copyright 2015-2019, Institute for Systems Biology # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable la...
import datetime from django.shortcuts import render, redirect from .models import MarkList, MarkListSetUp, Score, Result from students.models import Student, Subject, Paper from mainapp import helper def creat_marklist(request): year = datetime.datetime.now().year marklists = MarkList.objects.filter(year=year...
#!/usr/local/bin/python3 ## Author: CaptainSmiley ## Date: 2/14/2022 ## License: Creative Commons Zero v1.0 Universal import sys import csv import getopt ## algorithim from: ## http://users.telenet.be/WBtE/cunning.html def CunninghamEquation(mass, fat): print("\n") print("\nIf you eat a moderate ...
""" MeasureImageSkeleton ==================== **MeasureImageSkeleton** measures the number of branches and endpoints in a skeletonized structure such as neurons, roots, or vasculature. This module can analyze the number of total branches and endpoints for branching objects in an image. A branch is a pixel with more t...
import sqlite3 import sys import time import getpass from cryptography.fernet import Fernet from tqdm import tqdm from password_strength import PasswordStats def updateUser(db_file, userInformation): query = "UPDATE USER SET userMail = ?, userPassword = ? WHERE userMail = userMail;" connection = sqlite3.connect(d...
from typing import Optional, Union import numpy as np from fruits._backend import _increments from fruits.preparation.abstract import DataPreparateur class INC(DataPreparateur): """DataPreparateur: Increments For one dimension of a time series:: X = [x_1, x_2, ..., x_n] this class produces th...
from typing import Optional from django.db import models from django.contrib.auth.models import AbstractUser from django.utils.dateparse import parse_datetime class User(AbstractUser): pass class UserInWarehouse(models.Model): user = models.ForeignKey(User, on_delete=models.CASCADE) warehouse = models.F...
# =*= coding:utf-8 =*= # かしら import re import os import os.path import sys import functools import itertools class StringSeq : def __init__(self, org, seq) : self.org = org self.seq = seq def __repr__(self) : return 'StringSeq<%s>' % ', '.join(repr(c) for c in self.seq) def __str_...
# -*- coding: utf-8 -*- # Python modules import json import sys from collections.abc import Iterable # Python typing from typing import List, Dict, Type, _GenericAlias, TypeVar # Jsonty models from .exceptions import TypeNotReconized from .exceptions import IterableNotAllSameType # Standard data types _STANDARD_DAT...
# Name: # Name: # Course: CSC 480 # Instructor: <NAME> # Assignment: Know Op # Term: Summer 2021 import math import itertools import random from typing import Callable, Dict, List, Tuple class Math: """A collection of static methods for mathematical operations.""" @staticmethod def dot...
from scipy.special import expit from scipy.stats import logistic import random import numpy as np from pygraphviz import AGraph sigmoid = expit sigmoid_grad = logistic._pdf random = random.Random() random.seed(0) class Node: name_counter = 0 def __init__(self, function=sigmoid, gradient=sigmoid_grad): ...
# Copyright 2019 <NAME>, <EMAIL> # # 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...
#!/usr/bin/env python # -*- coding: utf-8 -*- """Script to analyze a source device, file or directory.""" import argparse import locale import logging import os import sys from dfvfs.credentials import manager as credentials_manager from dfvfs.helpers import command_line from dfvfs.helpers import source_scanner from ...
import requests import random from time import sleep import string import traceback import datetime import sys import threading try: from colorama import init, Fore, Back, Style from bs4 import BeautifulSoup except: print('Missing Colorama and/or BeautifulSoup4 modules!\n') sys.exit() logo = ''' _ ...
# coding=utf-8 """ Module to convert TF motif databases and associated binned motif counts to HDF5 """ import os as os import sys as sys import pandas as pd import numpy as np import tempfile as tempf import operator as op import multiprocessing as mp from crplib.auxiliary.text_parsers import text_file_mode, get_mem...
""" The .win parser interface. -------------------------- Contains routines to parse Wannier90 input files. Will in the future be utilizing the parser in the Wannier90 plugin, but no input parser exists. """ import re class BaseKeyValueParser(): # pylint: disable=useless-object-inheritance """Common codebase fo...
import os import pyperclip import time import re import random import pyautogui as pt from pynput.keyboard import Key, Controller as keyboard_con import library as lib def logger(user='', message='', bot=False, newuser=False): f = open(f"{lib.logfile_texts}", 'a') if newuser is True: print('hey') ...
# -*- coding: utf-8 -*- # Copyright 2018-2021 releng-tool from releng_tool import __version__ as releng_version from releng_tool.engine import RelengEngine from releng_tool.exceptions import RelengToolException from releng_tool.opts import RelengEngineOptions from releng_tool.util.log import debug from releng_tool.uti...
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2012-2021 SoftBank Robotics. All rights reserved. # Use of this source code is governed by a BSD-style license (see the COPYING file). """ QiBuild Configuration Tests """ from __future__ import absolute_import from __future__ import unicode_literals from __f...
from gensim.models import Word2Vec from gensim.models.phrases import Phrases, Phraser import logging from sklearn.manifold import TSNE from matplotlib import pyplot as plt class MySentences(object): """Takes the corpus file as input, then iterates over it and yields a generator. Must be within the __...
#!/usr/bin/env python3 import time __author__ = "<NAME>" __license__ = "MIT" __version__ = "1.0" __maintainer__ = "<NAME>" import pandas as pd import os import sys import shutil import logging from logging import handlers logger = logging.getLogger(__name__) def list_files(src_path, age_lmt, ignore_list, dst_path=''...
# print a large worksheet from reportlab.lib import colors from reportlab.lib.pagesizes import letter, landscape from reportlab.lib.units import inch from reportlab.lib.enums import * from reportlab.platypus import SimpleDocTemplate, Table, TableStyle, Paragraph, Spacer from reportlab.lib.styles import getSampleStyleSh...
from os import environ, path import json import requests base_path = environ.get('XML_PATH') def generate_headers(token): """ :param token: :return: """ authorization = 'Bearer ' + token headers = { 'Authorization': authorization, 'Content-Type': 'application/json', ...
""" This code file is the one you should run in the console to """ import json import sys import logging import pandas as pd from positioning_handler.f_formation import extract_formation from positioning_handler.feature_extraction import feature_extraction from positioning_handler.pozyx_extraction import generate_po...
#!/usr/bin/env python3 # # Author: # <NAME> (@skelsec) # import io import enum from minidump.common_structs import * # https://msdn.microsoft.com/en-us/library/windows/desktop/ms680510(v=vs.85).aspx class DumpFlags(enum.Enum): MINIDUMP_THREAD_INFO_ERROR_THREAD = 0x00000001 #A placeholder thread due to an error acce...
from fileinput import filename import logging import click from pathlib import Path from gammapy.scripts.download import progress_download log = logging.getLogger(__name__) logging.basicConfig(level=logging.INFO) BASE_URL = "https://github.com/gammapy/gammapy-data/raw/master/" PATH = Path(__file__).parent.parent PATH...
""" unstratified-secondary-spherical_polar.py A regression test for globAccDisk-src-primary_grav.hpp (source terms for gravity with a source away from the coordinate center). Current test: -- stratified gravity -- spherical_polar coordinate version -- an immobile sphere is initialized, the test ensures its center ...
# written by LazyGuyWithRSI import pyautogui import ctypes import time from PIL import ImageGrab import numpy as np import cv2 as cv import win32api import keyboard from configparser import ConfigParser # TODO HOTKEY not implemented yet # change HOTKEY to whatever key you want (ex. 'a', 'f2') even modifiers (ex. 'ctr...
# @author swapmali import subprocess import os import random import pandas as pd import re import sys from moviepy.video.io.VideoFileClip import VideoFileClip import time def select_folder(): folders_data = pd.read_csv('song_folders.csv') folder_names = list(folders_data['Folder_Name']) folder_paths = li...
#!/usr/bin/python3 from __future__ import annotations from typing import List, Tuple, Dict from functools import reduce from sys import argv from os.path import join, exists from os import getenv from matplotlib import pyplot as plt from time import time from multiprocessing import cpu_count import ray from .util imp...
#!/usr/bin/env python # encoding: utf-8 # # Copyright (c) 2015 <NAME> <<EMAIL>> # # MIT Licence. See http://opensource.org/licenses/MIT # # Created on 2015-07-27 # """ Generate English-sounding passwords using Markov chains. The Markov chain is based on the first few paragraphs of *A Tale of Two Cities*. """ from _...
import ujson import sys from tqdm import tqdm import numpy as np from math import sqrt import time from datetime import timedelta, datetime #Define wilson function to determine confidence interval for differential rtts between two colos in an hour. def wilson(p, n, z = 1.96): denominator = 1 + z**2/n centre_a...
# coding: utf-8 # Introduction """ Vizuelize two keyboard layouts: standard (QWERTY) vs optimized, using sample text """ NAME = '5_layout_comparison' ## Name of the notebook goes here (without the file extension!) PROJECT = 'Optimal_Keyboard_Layout' PYTHON_VERSION = '3.6.8' ## Imports import os, re, time, requests...
# Copyright 2022 <NAME>. # # Licensed under the BSD 3-Clause License. from abc import ABC, abstractmethod import numpy as np import jax.numpy as jnp from typing import Union, Dict, Any from xpag.tools.utils import DataType, datatype_convert from xpag.samplers.sampler import Sampler import joblib import os class Buff...
#!/usr/bin/env python import random import socket, select from time import gmtime, strftime import os import sys import coco import utils import model as modellib ROOT_DIR = os.getcwd() MODEL_DIR = os.path.join(ROOT_DIR, "logs") COCO_MODEL_PATH = os.path.join(ROOT_DIR, "mask_rcnn_coco.h5") if not os.path.exists(COCO...
"""This module is to create pecha opf and alignment opa Avialable functions: create_alignment_from_source_text: It will create pecha opf and alignment opa from a source text. create_alignment_from_tmx: It will create source and target opf and alignment opa from tmx path. """ import os from pathlib import Path ...
import math from typing import List from rlbot.utils.structures.game_data_struct import GameTickPacket from rlbot.utils.structures.game_interface import GameInterface from choreography.choreography import Choreography from choreography.drone import Drone from choreography.group_step import BlindBehaviorStep, DroneLis...
#!/usr/bin/env python # coding:utf-8 import torch import logging import torch.optim as opt from .optimizer_AdaBound import AdaBound, AdaBoundW logging.getLogger('matplotlib.font_manager').disabled = True class OptimizerWorker(object): def __init__(self, log_type, logger=None): super(OptimizerWorker, self...
import datetime import numpy import pandas __all__ = ['get_arrays'] def get_timescale(t, unit): ''' Take a datetime or a numerical type, return two things: 1. A unit 2. A function that converts it to numerical form ''' def get_timedelta_converter(t_factor): return lambda td: td.total_sec...
from passlib.hash import bcrypt from flask_jwt import JWT, jwt_required, current_identity from flask_restful import Api, Resource, abort, reqparse from app import app, db from .models import Bucketlist, Item, User api = Api(app, prefix='/api/v1') def verify(username, password): if not (username and password): ...
import io import sys from .helpers import is_terminal class TextPecker: def __init__(self, s): self.str = s self.i = 0 def read(self, n): self.i += n return self.str[self.i - n:self.i] def peek(self, n): if n >= 0: return self.str[self.i:self.i + n] ...
""" Annotations of data, e.g. characteristics, that cannot be automated. Annotations of data are eventually something that cannot be automated. Nevertheless, they can be quite important for the analysis and hence for providing new scientific insight. The simplest form of an annotation is a comment applying to an enti...
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi SDK Generator. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union, overload from ... import _utilities fro...