text stringlengths 3.07k 22.1k |
|---|
# -*- coding: utf-8 -*-
"""
@author: <NAME>
"""
from __future__ import print_function
import time
import numpy as np
_EPS = 1e-14
def mstamp(seq, sub_len, return_dimension=False):
""" multidimensional matrix profile with mSTAMP (stamp based)
Parameters
----------
seq : numpy matrix, shape (n_dim, ... |
#!/usr/bin/env python
# Software License Agreement (BSD License)
#
# Copyright (c) 2008, <NAME>, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code must r... |
##> Imports
import math
import sys
# > 3rd party dependencies
import pandas as pd
import gspread
import gspread_dataframe as gd
from urllib.request import urlopen
from PIL import Image
from io import BytesIO
# > Discord dependencies
import discord
from discord.ext import commands
from discord.ext.tasks import loop
#... |
import glob
import itertools
import multiprocessing
import os
import shutil
import subprocess
import sys
import time
from parsable import parsable
import pomagma.atlas
import pomagma.cartographer
import pomagma.surveyor
import pomagma.theorist
import pomagma.util
from pomagma.util import DB, suggest_region_sizes
par... |
#!/usr/bin/python3
import math
import logging
import numpy as np
from functools import reduce
import dao
from parser import NODES_ENTRY, NODE_ENTRY, BROADCAST_ENTRY
from parser import FLOODS_ENTRY, GLOSSY_ENTRY
from parser import SEQNO_ATTR, REF_RELAY_CNT_ATTR, T_SLOT_ATTR
from parser import N_TX_ATTR, N_RX_ATTR
fr... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import os
import shutil
import glob
import errno, stat
import re
import pkg_resources
"""
createmodulefromskeleton.py - Create your own module form a oneplace Skeleton
Renames all modules and cleanup code structure
Usage: createmodulefromskeleton.py path/to/mo... |
from cone.app.browser import get_related_view
from cone.app.browser import RelatedViewProvider
from cone.app.browser import render_main_template
from cone.app.browser.actions import ActionDelete
from cone.app.browser.actions import ActionEdit
from cone.app.browser.actions import ActionMoveDown
from cone.app.browser.act... |
"""Utilities for setting up a project's settings.
The default way to use this is to import and call :func:`init_settings`
in a project's settings module:
# project/top_level_package/settings.py
from arcutils.settings import init_settings
init_settings()
This adds a few default settings for bootstrapping ... |
# coding=utf-8
import tensorflow as tf
import numpy as np
import os
from algorithm import config
from base.env.market import Market
from checkpoints import CHECKPOINTS_DIR
from base.algorithm.model import BaseRLTFModel
from helper.args_parser import model_launcher_parser
from helper.data_logger import generate_algor... |
import importlib
import inspect
import json
import os
import sqlite3
import tempfile
import typing
from shutil import copyfile
from typing import Any, Generator, List, Union
from pydantic import BaseModel, root_validator
from pydantic.fields import ModelField
from sqlite_utils import Database as _Database
from typing_... |
# -*- coding: utf-8 -*-
"""
Created on Fri Oct 19 19:24:49 2019
@author: mlin
"""
import matplotlib.pyplot as plt
from collections import OrderedDict
import numpy as np
import copy
class ffd():
def __init__(self, ffd_file, incident_Power_W=1):
self.incident_Power_W=incident_Power_W
... |
import argparse
import imaplib
import logging
import mailbox
import os
import re
import signal
import sys
import time
import mr.config
import mr.db
class IMAPTool:
def __init__(self, imap):
self.imap = imap
def _check_error(self, status, response):
if status != 'OK':
raise Runtim... |
import logging
# For drag and drop vs click separation
import time
# will change these to specific imports once code is more final
from PyQt5.QtCore import *
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *
from enum import Enum
from mpfmonitor.core.devices import DeviceNode
class Shape(Enum):
DEFAULT ... |
# spikein_utils.py
# Single Cell Sequencing Quality Assessment: scqua
#
# Copyright 2018 <NAME> <<EMAIL>>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the Lice... |
import hashlib
import logging
import os
import shutil
from kluctl.deployment.helm_chart import HelmChart
from kluctl.seal.deployment_sealer import SEALME_EXT
from kluctl.utils.dict_utils import merge_dict
from kluctl.utils.exceptions import CommandError, InvalidKluctlProjectConfig
from kluctl.utils.external_tools impo... |
"""Defines the anvil logging module.
"""
__author__ = '<EMAIL>'
from anvil import enums
from anvil import util
class WorkUnit(object):
"""A class used to keep track of work progress.
The WorkUnit class uses total and complete metrics to keep track of work
completed. WorkUnits can be chained in parent-child r... |
from browser import document, html, ajax, window, alert
import urllib.request
from javascript import JSON
moogleid = '904000103'
containerid = '904000115'
containername = {'en':'Prism Moogle', 'ko':'프리즘 모그리', 'zh':'信賴度莫古利(原晶)', 'es':'Moguri prismático', 'de':'Prismamogry', 'fr':'Prismog'}
def loadlanguage(event):
... |
from discord.ext.commands import Cog, Bot, command, Context
from discord.ext.commands.core import has_guild_permissions, has_permissions
from discord.ext.commands.errors import BadArgument, CommandError, MissingPermissions, MissingRequiredArgument, NoPrivateMessage
from discord.mentions import AllowedMentions
from sqla... |
import tensorflow as tf
import cnn_lstm.utils as util
import numpy as np
import os
def cnn_encoder_layer(data, filter_layer, strides):
"""
:param data: the input data, when it is the first layer is 5 * 30 * 30 * 3, the second layer is 30 * 30 * 32,
the third layer is 15 * 15 * 64, the fourth ... |
import pymysql
import random
import os
import struct
import subprocess
import collections
import tensorflow as tf
from tensorflow.core.example import example_pb2
TOTAL_COUNT = 235704
TEST_COUNT = 8000
VAL_COUNT = 8000
TRAIN_COUNT = 219704
VOCAB_SIZE = 500000
CHUNK_SIZE = 1000 # num examples per chunk, for the chunke... |
import itertools
from typing import Sequence
import pytest
import depparse
from depparse import Dep, Action
def test_read_conllu():
# read the entire training data and count the words and sentences read
n_sentences = 0
n_deps = 0
for parse in depparse.read_conllu("UD_English-EWT/en_ewt-ud-train.conll... |
# Copyright 2019 Adobe. All rights reserved.
# This file is licensed to you 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 ... |
import copy
import json
import logging
import os
import shlex
import sys
import contextlib
import katpoint
import numpy as np
from astropy.io import fits
import Radio_continuum_validation as rcv
import katsdpimageutils.primary_beam_correction as pbc
from katacomb.aips_export import _make_pngs, FITS_EXT, PNG_EXT, MET... |
import random
import sys
import time
import paramiko
import scp
import redis
# async def aredis_exec(conn, *cm, prt=0):
# try:
# r = await conn.execute_command(*cm)
# if prt != 0:
# print(r)
# except redis.exceptions.ResponseError as e:
# print(repr(e))
def redis_exec(conn... |
# -*- coding: utf-8 -*-
import rpy2.robjects as ro
from rpy2.robjects import pandas2ri
from glob import glob
from os.path import join
import pandas
import datetime
import numpy as np
import logging
import os.path
def load_data(dirname="../Data/training",f_geop="Geop_d02",f_meteo="meteoWRF",year=2016):
"""
Loa... |
#############################################################################
#
#
# Module of BFA that is in charge of storing server settings information
#
#
#############################################################################
""" This module implements the logging and storing of Bf-Round Settings.
Depen... |
import pygame
from pygame.sprite import Sprite, Group, OrderedUpdates, LayeredUpdates
from pygame.surface import Surface
from durakgui.constants import HAMMER_AND_SICKLE, COMMUNIST_RED, COMMUNIST_YELLOW
from durakgui.settings import (
CARD_BACKGROUND_COLOR,
CARD_WIDTH,
CARD_HEIGHT,
CARD_RADIUS,
CAR... |
from pkg_resources import get_distribution, DistributionNotFound
import logging
try:
# Change here if project is renamed and does not equal the package name
dist_name = __name__
__version__ = get_distribution(dist_name).version
except DistributionNotFound:
__version__ = 'unknown'
finally:
del get_d... |
#!/usr/bin/python
import os.path
import sys
import psutil
import subprocess
import time
import multiprocessing
import signal
# usage
# python main_remote.py file.json
# out put
# time_out_file_name: all link files and jsons of time out
# memory_out_file_name: all link files and jsons of memory out
# klee_result_file_... |
"""
Copyright 2018-present, Airbnb 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 agreed to in writing, sof... |
# -*- coding: utf-8 -*-
# @Time : 2021/03/08 16:12:52
# @Author : <NAME> <<EMAIL>>
# @Project : projects
# @Description: this program accepts the data_path which is about to save embedding
# the coMap which stores the diagnose cooccurence
# ... |
#!/usr/bin/env python3
import dbus
import subprocess
from sys import argv
from getopt import getopt
from os import getenv
max_width = 0
prefix = ['' ,
' ' + (b' ' ).decode('utf-8') + ' ',
' ' + (b' \xE2\x83\x9E' ).decode('utf-8') + ' ',
' ' + (b'\x... |
from py4jps.resources import JpsBaseLib
import os
from tqdm import tqdm
import time
import numpy as np
import pandas as pd
from SPARQLWrapper import SPARQLWrapper, CSV, JSON, POST
from shapely import geometry, wkt, ops
def query_usage(limit):
'''
Querying the KG for all regions gas-usages in 2019
'''
... |
'''
Created on 2015/8/12
:author: hubo
'''
from vlcp.protocol import Protocol
from vlcp.config import defaultconfig
from vlcp.event import Event, withIndices, ConnectionWriteEvent
import logging
import os
import json
import re
@withIndices('state', 'connection', 'connmark', 'createby')
class JsonRPCConnectionStateEv... |
"""
Demonstrates how to:
* use the MAML wrapper for fast-adaptation,
* use the benchmark interface to load Omniglot, and
* sample tasks and split them in adaptation and evaluation sets.
"""
from torchvision import transforms
import random
import numpy as np
import torch
from torch import nn, optim
import ... |
import copy
import random
import numpy as np
import pytest
from cotk.metric import BleuPrecisionRecallMetric, EmbSimilarityPrecisionRecallMetric
from metric_base import *
def setup_module():
random.seed(0)
np.random.seed(0)
bleu_precision_recall_test_parameter = generate_testcase(\
(zip(test_argume... |
import logging
import multiprocessing
import sys
import hydra
import numpy as np
import pandas as pd
import torch
import torch.nn as nn
import torch.optim as optim
from gensim.models.doc2vec import Doc2Vec, TaggedDocument
from nltk.tokenize import word_tokenize
from omegaconf import OmegaConf
from sklearn.linear_model... |
# -*- coding: utf-8 -*-
# Copyright (c) 2020, Core Initiative and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
from inn.inn_hotels.doctype.inn_folio.inn_folio import update_close_by_reservation
class In... |
import collections
import importlib
import os
import sys
import typing as t
from decimal import Decimal
from functools import wraps
from docker_check import checker as docker_checker
from dpath.util import get
from yaml import SafeLoader
from yaml import dump as dump_yaml
from yaml import load as yaml_load
# noinspe... |
import os
from glob import glob
from tqdm.notebook import tqdm
import matplotlib.pyplot as plt
from neural_punctuator.utils.data import get_config_from_yaml
from neural_punctuator.models.BertPunctuator import BertPunctuator
import torch
from torch.utils.data import DataLoader
from tqdm import tqdm
from neural_punctuat... |
"""
This file will read in the file 'ParameterFile', which is a human-readable
version of the input for LBLRTM (called TAPE5). It will convert that into
TAPE5 for use by LBLRTM. You should never need to call this directly!
This file is part of the TelFit program.
TelFit is free software: yo... |
import numpy as np
from cartesian.cgp import Primitive
from scipy.stats import skew, kurtosis
#################################################################
# Here we define pool of functions available for CGP experiments.
#################################################################
##########################... |
import math
import numpy as np
import torch
import torch.nn as nn
from torch.utils.data import DataLoader
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
def value(energy, noise, x, gen):
logp_x = energy(x)
logq_x = noise.log_prob(x).unsqueeze(1)
logp_gen = energy(gen)
logq_ge... |
"""
generates a TSV parallel corpus from a crawl (the output of gain_wiki_revision.py)
python gen_data_from_crawl.py wiki_crawl/final_data.pkl CACHE OUT
pickle_path = sys.argv[1]
cache_path = sys.argv[2]
out_prefix = sys.argv[3]
"""
import sys
import os
import pickle
from itertools import groupby
import random
impor... |
#
# Color Forth compiler (no colour, obviously)
#
from vmcompilerinfo import VMCompilerInfo
import re
class CompilerException(Exception):
pass
#
# Represents the memory block.
#
class Memory:
def __init__(self):
self.memory = [ None ] * 65536
self.lowest = 0xFFFF
self.highest = 0x0000
self.emit = False
def... |
# -*- coding: utf-8 -*-
"""
CQL pygments lexer
~~~~~~~~~~~~~~~~~~
Lexer for the Cassandra Query Language (CQL).
This is heavily inspired from the pygments SQL lexer (and the Postgres one in particular) but adapted to CQL
keywords and specificities.
TODO: This has been hacked quickly... |
import copy
import json
from pathlib import Path
from typing import Any, List, Union, cast
from otsutil import OtsuNone, load_json, save_json
from otsuvalidator import CPath
from otsuvalidator.validators import VTuple
from .funcs import get_dict_keys_position, support_json_dump
class MetaCM(type):
... |
"""
Generator for online social network (OSN) models, v0.5, Updated 10/21/11
References
-----------
[1] <NAME>., <NAME>., <NAME>., <NAME>., <NAME>., <NAME>. Measurement-calibrated graph models for social network experiements. In Proc. of WWW (2010).
The paper describes 6 social graph models proposed to use as models ... |
#!/usr/bin/env python3
# std
import argparse
import json
import re
import sys
import urllib3
# from std
from http import HTTPStatus
from urllib.parse import quote
# 3rd party
import requests
# from 3rd party
# global changes
urllib3.disable_warnings()
class SetFromJSON(object):
def setFromJSON(self, attr, ke... |
import argparse
import cv2
import numpy as np
# When the four corners are identified, we will do a four-point
# perspective transform such that the outmost points of each
# corner map to a TRANSF_SIZE x TRANSF_SIZE square image.
TRANSF_SIZE = 512
#
# Answer sheet properties.
#
N_QUESTIONS = 10
ANSWER_SHEET_WIDTH = 7... |
"""Take an HCUP data set and convert to enclave data set
Resources
- https://docs.google.com/spreadsheets/d/1cbHB9AZLpirOz4_N7SrsnDLomg1I6VgbPFp8rzGnpzc/edit#gid=510825150
"""
import os
from argparse import ArgumentParser
from datetime import datetime, timezone
from typing import Dict
from uuid import uuid4
import pan... |
from TimerManager import TimerManager
from enum import Enum # no need for these
'''
Parsing technique:
- check if empty
- trim whitespace
- check what it starts with
- subdivide string accordingly
- call correct function
'''
class CommandType(Enum):
'''
Desc:
These represent the... |
import sys
from pathlib import Path
import torch
import torch.nn.functional as F
import tqdm
from sacred import Experiment
from config import experiments_setup
from config import global_ingredient, device_ingredient
from core import solver
from core.base_trainer import BaseTrainer, BaseEvaluator
from core.metrics imp... |
'''
Simulations of IMU-signals during 3D movements
author: ThH
date: June-2018
'''
import numpy as np
import matplotlib.pyplot as plt
import scipy as sp
import skinematics as skin
from scipy.constants import g
import pandas as pd
def make_gauss(rate=1000, duration=1, t_0=0.5, sigma=0.1):
'''Generate a Gaussian... |
import sys
from typing import Tuple
import torch
from torch import nn
from torch.nn import functional as F
from clip import CLIP
from unet_model import UNetSlotAttentionModel, \
SlotAttention, BgSepSlotAttention, SoftPositionEmbed
class TwoStreamSlotAttentionModel(UNetSlotAttentionModel):
"""CLIP + Slot Att... |
"""
Page definitions for the experiment.
March 2021, <NAME> <<EMAIL>>
"""
from otree.api import Currency as c, currency_range
from ._builtin import Page, WaitPage
from .models import Constants, FruitOffer, Purchase
from django.forms import modelformset_factory, ModelForm, IntegerField, HiddenInput
class NormalWait... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2017, Ansible by Red Hat, inc
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = """
module: junos_l2_interface
author: <NA... |
# pylint:disable=unused-variable
# pylint:disable=unused-argument
# pylint:disable=redefined-outer-name
import time
from random import randint
from typing import Dict, List
from uuid import uuid4
import pytest
from simcore_service_webserver.resource_manager.config import (
APP_CLIENT_REDIS_CLIENT_KEY,
APP_CLI... |
# Created by <NAME>
# <EMAIL>
# Copyright (c) 2014 <NAME>. See included LICENSE file.
import csv
from operator import itemgetter
import SWSettings as s
class SWHumanConcentrationReader(object):
"""docstring for ConcentrationReader
A class designed to help extract information from
either a CMAN.txt or CWOMAN.txt ... |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may... |
import re
from enum import Enum
from cv2 import cv2
from pytesseract import pytesseract
TOWN_MISSION_0_0 = [676, 457]
TOWN_MISSION_1_1 = [1178, 1348]
TOWN_MISSION_COLUMN_WIDTH = TOWN_MISSION_1_1[0] - TOWN_MISSION_0_0[0]
TOWN_MISSION_ROW_HEIGHT = TOWN_MISSION_1_1[1] - TOWN_MISSION_0_0[1]
TOWN_MISSION_TOP_LEFT = [1181,... |
import path_learn as pl
import preprocessing as prc
import networkx as nx
import pickle
import traceback
import os
from flask import Flask, request
from flask_restx import Api, Resource
from werkzeug.middleware.proxy_fix import ProxyFix
try:
from feat_transform import feat_transform_func
except:
feat_transfor... |
# -*- coding: utf-8 -*-
import pytest
import random
import time
import sys
sys.path.extend(["../"])
from bbc1.core import bbclib
from testutils import prepare, get_core_client, start_core_thread, make_client, domain_setup_utility
from bbc1.core import domain0_manager, user_message_routing
from bbc1.core.message_key_t... |
# -*- coding:utf-8 -*-
import logging
import math
import random
import pickle
import zlib
import base64
def flatten(lst):
for x in lst:
if isinstance(x, list):
for x in flatten(x):
yield x
else:
yield x
class NeuralNetwork:
def __init__(self, learnin... |
import argparse
from datetime import datetime as dt
import gc
import json
import os
import random
import numpy as np
import torch
import torch.nn as nn
from lib import dataset
from lib import nets
from lib import spec_utils
def train_val_split(mix_dir, inst_dir, val_rate, val_filelist_json):
in... |
#!/usr/bin/python3
#
# Home control proxy for various devices in the house
#
# by <NAME>
# Copyright 2016 Mink Technologies 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
#
# ht... |
# Copyright 2017 <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... |
from slowfast.utils.parser import load_config, parse_args
import numpy as np
import pprint
import torch
import copy
from torch.utils.data import DataLoader
from transformers import AdamW, get_linear_schedule_with_warmup
from slowfast.models.lamb import Lamb
from torch import optim
import slowfast.models.losses as loss... |
import torch
from torch import nn
from torch.nn import init
from torch.nn import functional as F
import numpy as np
torch.manual_seed(1)
def to_tensor(x):
x = np.array(x)
x = torch.from_numpy(x)
return x.cuda()
class Classifier(nn.Module):
def __init__(self, word_size, label_size, category_sizes,
... |
"""
Obstacle navigation using A* on a toroidal grid
Author: <NAME> (daniel-s-ingram)
<NAME> (<EMAIL>)
"""
from math import pi
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.colors import from_levels_and_colors
import sys
plt.ion()
# Simulation parameters
M = 100
obstacles = [[1.75, 0.75, ... |
import random
import re
import requests
from bs4 import BeautifulSoup
room_name = ""
room_heart = 10
room_inscription_lower = 0
room_inscription_upper = 0
room_swords = []
room_swords_min_inscription = 0 # その部屋で最小の銘コスト
hp_upper = None
atk_upper = None
dfs_upper = None
agi_upper = None
required = None
# 1 [!]: 【必須】戦闘... |
# -*- coding: utf-8 -*-
"""
Created on Tue Dec 19 14:10:51 2017
@author: 309
"""
import numpy as np # linear algebra
import dicom
import os
import scipy.ndimage
import matplotlib.pyplot as plt
from skimage import measure
from mpl_toolkits.mplot3d.art3d import Poly3DCollection
import cv2
from sys import... |
import sqlite3 as sqlite
from utilities.general.class_builders import self_setup_class
from google.cloud.sql.connector import connector
import os
class BSEstockEntry(self_setup_class):
security_TABLE='SC_CODE'
def __init__(self,**kwargs):
super().__init__(**kwargs)
self.set_table()
def set... |
import warnings
warnings.simplefilter("ignore", (UserWarning, FutureWarning))
from torch.autograd import Variable
from torch.utils.data import DataLoader
from torchvision import transforms
from torch import nn
from tqdm import tqdm
from codebase.utils import logger
from codebase.utils import data_utils
from codebase.... |
from __future__ import annotations
from typing import (
TYPE_CHECKING,
Any,
Dict,
Iterator,
KeysView,
Optional,
Sequence,
Type,
overload,
)
from attr import define, field
from fontTools.ufoLib.glifLib import GlyphSet
from ufoLib2.constants import DEFAULT_LAYER_NAME
from ufoLib2.ob... |
from __future__ import print_function, division
import types
import numpy as np
from functools import wraps
import warnings
import properties
from discretize.utils import asArray_N_x_Dim
# scooby is a soft dependency for SimPEG
try:
from scooby import Report as ScoobyReport
except ImportError:
class ScoobyRe... |
from __future__ import absolute_import, division, print_function, unicode_literals
import logging
import os
import re
import sys
import traceback
import jinja2
from pathlib import Path
from datetime import datetime
from subprocess import Popen, PIPE
def print_line(line, ignore_text=False, newline=True, status='ok')... |
from pyomo import environ as po
from pyomo import dae as pod
from matplotlib import pyplot as plt
import numpy as np
def create_model_hgp(spt):
m = po.ConcreteModel()
tau = max(spt)
norm_spt = spt / tau
m.t = pod.ContinuousSet(bounds=(0, 1), initialize=norm_spt) # normalized time variable (unitle... |
# coding: utf8
import bisect
import re
import collections
import warnings
class Keyphrase:
def __init__(self, sentence, label, id, spans):
self.sentence = sentence
self.label = label
self.id = id
self.spans = spans
def split(self):
if len(self.spans) > 1:
... |
"""
.. topic:: The :mod:`datasets` module provides data sets to test the
**Spectrum** functionalities.
.. autosummary::
data_cosine
marple_data
TimeSeries
.. codeauthor:: <NAME> 2011
:Reference: [Marple]_
"""
import numpy as np
from numpy import arange, pi, cos, sin
from nump... |
"""
Hourglass network inserted in the pre-activated Resnet
Use lr=0.01 for current version
inspired by:
Hourglass: https://github.com/bearpaw/pytorch-pose/blob/master/pose/models/hourglass.py
ResNet: https://github.com/bearpaw/pytorch-pose/blob/master/pose/models/pose_resnet.py
"""
import torch.nn as nn
import torch... |
#!/usr/bin/env python
from kubernetes.client.rest import ApiException
from build_and_deploy_operator import (
build_and_push_operator,
deploy_operator,
load_yaml_from_file,
)
import k8s_conditions
import dump_diagnostic
from dockerutil import build_and_push_image
from typing import Dict
from dev_config imp... |
import io
import math
import random
import requests
import textwrap
from functions import *
from datetime import datetime
from PIL import Image, ImageFont, ImageDraw, ImageSequence
def shaky_text(text):
frames = []
frame = Image.new('RGBA', (1, 1))
draw = ImageDraw.Draw(frame)
font_path = os.path.join... |
#!/usr/bin/env python3
import argparse
import datetime
import os
import traceback
from prompt_toolkit.completion import WordCompleter
from prompt_toolkit.history import FileHistory
from prompt_toolkit.shortcuts import print_formatted_text, PromptSession
from prompt_toolkit.formatted_text import FormattedText
from twis... |
import struct
import math
import time
import pyglet
from . import resources
from .anim import AnimatedValue, ConstantValue, Wait, Blocker, fork
CAR_FORMAT = '=4h2e3e'
STRIDE = struct.calcsize(CAR_FORMAT)
HISTORY_SIZE = 6
LINE_FORMAT = '=2h'
LINE_STRIDE = struct.calcsize(LINE_FORMAT)
ACTION_DIRECTIONS = {
0: (-... |
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... |
# -*- coding: utf-8 -*-
"""Top-level package for boxcast-python-sdk."""
__author__ = """<NAME>"""
__email__ = '<EMAIL>'
__version__ = '0.1.1'
import requests
import json
import base64
import logging
from urllib.parse import unquote, urlencode, urlparse, parse_qs
from .helpers import merge_url_query_params
logger = ... |
import tarfile
import zipfile
import os
import hashlib
import shutil
import math
import re
from pathlib import Path
from typing import Tuple, List
import requests
from tqdm.autonotebook import tqdm
from argparse import ArgumentParser
import polimorfo
CACHE_DIR = polimorfo.__cache_dir__
CACHE_SUBDIR = 'datasets'
def ... |
import pandas as pd
import os
import re
import requests
from operator import itemgetter
from statistics import mode
from bs4 import BeautifulSoup
current_weeknum = '12'
current_year = '2018'
def teamname_to_abbreviation(teamname):
if teamname == 'New England Patriots':
teamname = 'NE'
elif teamname == '... |
# Copyright (c) 2018 DDN. All rights reserved.
# Use of this source code is governed by a MIT-style
# license that can be found in the LICENSE file.
"""
Corosync verification
"""
import socket
import json
import time
import threading
from chroma_agent.lib.shell import AgentShell
from chroma_agent.lib.pacemaker impo... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed May 9 13:22:13 2018
@author: chrelli
SET up the namespace and methods for numpy reading from numpy binary files
"""
#%% Import the nescessary stuff
# basic OS stuff
import time, os, sys, shutil
# for math and plotting
import pandas as pd
import nu... |
import os
import cv2
import dlib
from flask import redirect, render_template, request, send_file, session, url_for
import matplotlib as mpl
mpl.use('Agg')
import matplotlib.pyplot as plt
from matplotlib.patches import Ellipse
from scipy.interpolate import make_interp_spline
import numpy as np
detector = dlib.get_fr... |
# -*- coding: utf-8 -*-
""" This module is a facade for AMT (Boto) services. """
from __future__ import print_function
from functools import wraps
from builtins import str
from builtins import object
import boto3
import botocore
import datetime
import dateutil.tz
from flask import jsonify
import re as re
from psitur... |
import matplotlib.pyplot as plt
import torch
import argparse
from PIL import Image
import numpy as np
import torchvision
import torchvision.transforms.functional as TF
import torchvision.transforms as transforms
from torchvision.utils import save_image
import torch.nn.functional as F
from cyclegan_code import Generato... |
#!/usr/bin/env python
import argparse
import os
import re
import sys
import bson
import wiredtiger
from mtools.util.cmdlinetool import BaseCmdLineTool
from mtools.version import __version__
codec_options = bson.codec_options.CodecOptions(uuid_representation=bson.binary.STANDARD)
class MTransferTool(BaseCmdLineTool... |
# -*- coding: UTF-8 -*-
import os
import time
import traceback
import random
import sys
import json
import webbrowser
import subprocess
import urllib.request
import platform
import zipfile
import shutil
# dirname:get parent directory
# sys.argv[0] getFileName
CASE_PATH = os.path.abspath(os.path.dirname(sys.argv[0]))
P... |
#!/usr/bin/python
# Copyright (c) 2020, 2021 Oracle and/or its affiliates.
# This software is made available to you under the terms of the GPL 3.0 license or the Apache 2.0 license.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Apache License v2.0
# See LICENSE.TXT for d... |
#!/usr/bin/python
import numpy as np
import pandas as pd
import sys
import time
import string
import csv
import pickle
from sklearn.feature_extraction.text import CountVectorizer
from nltk import pos_tag
from nltk.corpus import wordnet as wn
from nltk.stem import WordNetLemmatizer
from nltk.stem.snowball import Snowba... |
import json
import datetime
import traceback
from celery.utils.log import get_task_logger
from appcomposer.db import db
from appcomposer.models import RepositoryApp, TranslationBundle, TranslationUrl
from appcomposer.translator.downloader import retrieve_updated_translatable_apps, retrieve_all_translatable_apps, ret... |
import os
import sys
import argparse
import cv2
import numpy as np
import stl
from stl import mesh
def parse_args():
parser = argparse.ArgumentParser(description='convert image to stl height map')
parser.add_argument('--image',type=str, help='input image file path', required=True)
parser.add_argument('--o... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.