text stringlengths 3.07k 22.1k |
|---|
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: MIT-0
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of this
# software and associated documentation files (the "Software"), to deal in the Software
# without restriction, including without ... |
import os
import pathlib
import re
import sys
# mdown matches
heading_1_re = re.compile('^# (.*)')
heading_2_re = re.compile('^## (.*)')
heading_3_re = re.compile('^### (.*)')
heading_4_re = re.compile('^#### (.*)')
heading_6_re = re.compile('^###### (.*)')
unordered_list_re = re.compile('^- (.*)')
unordered_sublist_r... |
"""
Notes: if some expressions do not simplify why they should they might
have 'duplicates'. remove them by using remove_duplicates
"""
import numpy as np
import sympy.physics.optics as so
import sympy
from matplotlib import pyplot as plt
try:
from sr import abcd
except ImportError:
import sys
sys.path.in... |
import os
import sys
from typing import Union
import requests
from suds.client import Client
from suds.transport import Reply
from suds.transport.http import HttpAuthenticated
if 'komle.bindings.v1411.write' in sys.modules:
# Witsml uses the same namespace for each schema
# So for now check what binding is in... |
#!/usr/bin/env python3
# encoding: UTF-8
__author__ = "mirai"
__license__ = "GPLv3"
__version__ = "1.3.2"
################################
import argparse
import sys
import time
import requests
import re
import os
import validators
from termcolor import colored
from argparse import RawTextHelpFormatter
from sys imp... |
from enum import Enum
import logging
import subprocess
import sys
import config
from mainbuttonwindow import MainButtonWindow
from mp3index import Mp3Index
from mp3window import Mp3Window
import osmc
from sessionwindow import SessionWindow
from videocache import VideoCache
from videofeed import VideoFeed
from videoind... |
# inspiration: https://github.com/marten-seemann/quic-interop-runner
import logging, os, re, time, tempfile, subprocess, json
from filemanager import FileManager
from scenarios import SCENARIOS
from metriccalculator import MetricCalculator
class LogFileFormatter(logging.Formatter):
def format(self, record):
msg ... |
#!/usr/bin/env python3
import enum
import math
import cairo
import gi
import data
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk, Gdk
class Scale(enum.Enum):
ABSOLUT = 1
RELATIVE = 2
COLOR_BACKGROUND = (0.1, 0.1, 0.1)
COLOR_HEADER_TEXT = (1, 1, 0)
COLOR_SCALE_TEXT = (0, .6, .6)
COLOR_BORD... |
"""
A way of storing a summary of the state as an experiment progresses
modified from du.sandbox.summary
eg.
>>> s = SummaryPrinter()
>>> s.add("foo", how="max")
>>> s.update({"foo": 1})
>>> s.update({"foo": 3})
>>> s.update({"foo": 2})
>>> print s.to_org_list()
- foo: 3
"""
import socket
import du
class SummaryPri... |
# %%
import os, sys
import re
import cv2
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
# %matplotlib inline
from numpy import linspace, meshgrid
from scipy.interpolate import griddata
import matplotlib.image as mpimg
import matplotlib.style
import matplotlib as mpl
mpl.style.use('default')
fro... |
import numpy as np
from numba import njit
from scipy.interpolate import interp1d
import table_bulge
R0 = 8. # kpc
V0 = 226. # km/s
V_LSR = V0
# stellar density functions ---------------------------------------------------
# THIN DISK
@njit
def diskfun_old(R,z,rho0,eps):
a2 = R**2 + (z/eps)**2
... |
# coding: utf-8
"""
pygaarst.mtlutils
Helpers for parsing MTL metadata files used by USGS Landsat and EO-1
(Hyperion and ALI) Level 1 GeoTIFF scene data archives
Created by <NAME> on 2014-04-20.
[2014-04-20] Refactoring original landsatutils.py, as MTL file format is
also used by Hyperion and ALI.
-----------------... |
# -*- coding: utf-8 -*-
"""
Created on Tue Sep 10 13:37:10 2019
@author: chala
"""
# Database
import logging
from flask import request
from marshmallow import Schema, fields, pprint
from sqlalchemy import func, cast, Numeric
from sqlalchemy.types import Float
import json
from privacy_guard import ... |
"""
Created on 20211109
@author: TedKus
This script uses an FTDI i2c dongle to
1. find a PMBus device
2. ask an output file name for telemetry
3. ask if telemetry should be printed to the screen
4. ask delay time (default 0) between readings
5. ask to start reading telemetry
6. reads telemetry from all channels of t... |
try:
from os import getcwd, startfile, rename, remove
from os.path import dirname, isfile, basename
from threading import Thread
from json import load
from tkinter import Tk, PhotoImage, sys, Frame
from tkinter import ttk
from typing import ClassVar, Dict, List
from requests import get
... |
import os
import time, datetime
import atexit
import re
# Load modules for either datacollect or python control
try:
try:
from . import instrument
_instrument_loaded = True
except ValueError:
import instrument
_instrument_loaded = True
except ImportError:
_instrument_loaded ... |
"""This application experiments with the (grid) layout and some styling
Can we make a compact dashboard across several columns and with a dark theme?"""
# import io
from typing import List, Optional
import os, sys, re
import markdown
import matplotlib
import matplotlib.pyplot as plt
import pandas as pd
import streamli... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2013 pyReScene
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation
# files (the "Software"), to deal in the Software without
# restriction, including without limitation the rights ... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
HAR2LILua
- Converts HAR (http archive) format files (e.g. extracted from a modern
text browser) into a LoadImpact (loadimpact.com) user scenario script in
Lua.
"""
from __future__ import unicode_literals
from __future__ import print_function
import re
import json
from s... |
"""Modules containing tests to check jarvis ouput i.e. jupyter notebook output messages"""
from conftest import get_jarvis4se, remove_xml_file
jarvis4se = get_jarvis4se()
def test_attribute_declaration_input(capsys):
"""Notebook equivalent:
%%jarvis
with attribute_declaration_input
A is an attribu... |
import time
import pandas
import numpy as np
import dill
import multiprocessing
import torch
from tqdm import trange
import myrl.utils.configreader as reader
import myrl.utils.save as save
import myrl.utils.plot as plot
from myrl.environments.gridworld.gridworld import GridWorld
from myrl.models import FullyConnectedN... |
import numpy as np
from keras.preprocessing.sequence import TimeseriesGenerator
from earthquakes.engineering import get_cycle
from common.utils import progress
class Scaler():
"""Class that takes care of scaling the data in various ways.
The following methods are available:
- 'log': take the natural lo... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Clean payloads and extract the download URL.
"""
__maintainer__ = "<NAME>"
__email__ = "<EMAIL>"
__copyright__ = "Copyright 2018-2021"
import argparse
from urllib.parse import unquote_plus, urlparse
# -- helper -----------------------------------------------------... |
""""
meteoblue dataset client
"""
import asyncio
import copy
import hashlib
import json
import logging
from contextlib import asynccontextmanager
import aiohttp
from .protobuf.dataset_pb2 import DatasetApiProtobuf
from .protobuf.measurements_pb2 import MeasurementApiProtobuf
from .utils import run_async
class Clie... |
#====================================Like.py===================================#
# Created by <NAME> 2021
# Contains functions for interfacing with the fortran code in src/like
# the fortran likelihood code needs to be compiled first by running the make
# file in src/like
#=============================================... |
import numpy as np
from reinforce import Player
from colorama import Fore, Back, Style
from colorama import init
init(autoreset=True)
board = None
def getRow(row):
ret = ""
for i in np.nditer(row):
ret += getItem(i)
return ret
def getItem(item):
if item == 1:
return Fore.WHITE + "|... |
"""
The basic module for generating synthetic images and also loading / exporting
Copyright (C) 2015-2020 <NAME> <<EMAIL>>
"""
import logging
# from __future__ import absolute_import
import os
import re
import shutil
import types
import numpy as np
from scipy import stats
from scipy.spatial import distance
def con... |
# coding=utf-8
"""
基于Tornado Log的logger实现.
"""
import logging
import logging.handlers
import os
import sys
from typing import Dict, Any, cast, Union, Optional
bytes_type = bytes
unicode_type = str
basestring_type = str
try:
import colorama # type: ignore
except ImportError:
colorama = None
try:
import ... |
#!/usr/bin/env python3
import logging
import argparse
import socket, struct, random
import ssl, threading, socks, ctypes
from socksproxy import SocksProxy, ThreadingTCPServer, pipe_sockets, str2ipport, setprocname
from tempfile import TemporaryFile
from OpenSSL import crypto
from contextlib import contextmanager
from ... |
# 该程序主要实现能够提取有效特征表示的自编码器(特征映射维数为3)的训练
# 随后利用 k-means 算法实现对 MNIST 数据集中 0, 1 图像已提取特征表示进行聚类
# 参考程序:https://github.com/jswanglp/MyML/blob/master/codes/Neural_network_models/Unsupervised_learning_models/AE.py
# coding: utf-8
import os, sys
import numpy as np
import tensorflow as tf
import matplotlib.pyplot as plt
from ... |
import collections
import numpy as np
import statistics
import tensorflow as tf
from typing import List, Tuple, NoReturn
import time
import threading
# import softskin
from Sensors import IRCamera, softskin
from Network.FrontFollowingNetwork import FrontFollowing_Model as FFL
import PositionalProcessing as PP
from Driv... |
#!/usr/bin/env python
# encoding: utf-8
"""
@Author: yangwenhao
@Contact: <EMAIL>
@Software: PyCharm
@File: test_accuracy.py
@Time: 19-6-19 下午5:17
@Overview:
"""
#from __future__ import print_function
import argparse
import torch
import torch.optim as optim
import torchvision.transforms as transforms
from torch.autog... |
# Copyright 2021 Sony Semiconductors Israel, 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 b... |
# coding=utf-8
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import collections
f... |
import logging
def normal_clamp(value, min_v=0, max_v=1):
value = max(min_v, value) # Clamp to 1 if > 1
value = min(max_v, value) # Clamp to 0 if < 0
return value
class HvirCalculator:
def __init__(self):
self.defaults = {}
def calc_a_limits(self, mass_limit: float, length_limit: floa... |
__author__ = 'sony-w'
__version__ = '1.0'
import os
import torch
import pandas as pd
import numpy as np
import multiprocessing as mp
import nltk
import logging
from .vizwiz import VizWiz
from .images import ImageS3
from torch.utils.data import Dataset
from torchvision import transforms
class VizwizDataset(Dataset)... |
"""Basic utilities used by the whole package."""
import argparse # lazy loaded
import logging
import re # lazy loaded
import signal
import sys
import unicodedata
from itertools import chain
from pathlib import Path
from shutil import rmtree
from time import sleep
from typing import Any, List, Optional, Sized, Tuple,... |
import re
from django.core.exceptions import ValidationError
from django.forms import ModelForm
from django import forms
from survey.models import ListingTemplate
from survey.models import QuestionOption
from survey.models import RandomizationCriterion
from survey.models import Answer
from survey.models import Intervie... |
import pandas
import numpy as np
import random
from .recommender_system_base import RecommenderSystemBase
class HashTable:
def __init__(self, hash_size, inp_dimensions):
self.hash_size = hash_size
self.inp_dimensions = inp_dimensions
self.hash_table = dict()
self.projections = np.r... |
#!/usr/bin/env python
from __future__ import with_statement
from collections import defaultdict
import wget
import requests
import sys
import gzip
import itertools
"""
DESCRIPTION:
Program to download and create the 'geneset' file for input into Gowinda for the species Aedes aegypti from the uniprot
and BioMart (Vect... |
import dill, math, random
from PIL import Image, ImageDraw, ImageFont
def r(tura):
a = dill.load(open("zapisy/Galaktykaztury"+str(tura)+".pickle", "rb"))
return a
def rG():
a = dill.load(open("zapisy/Galaktyka.pickle", "rb"))
return a
def rad():
a = dill.load(open("map.pickle", "rb"))
return ... |
# Import flask dependencies
from flask import Blueprint, request, render_template, \
flash, g, session, redirect, url_for, abort, Response, Markup
from flask_login import LoginManager, login_manager, login_required, logout_user, current_user
from flask_login.utils import login_user
from flask_sqlalche... |
import abc
import logging
import os
import pathlib
import ceryle
import ceryle.util as util
from ceryle.commands.executable import Executable, ExecutionResult
from ceryle.tasks import TaskIOError
from ceryle.tasks.condition import Condition
logger = logging.getLogger(__name__)
class Task:
def __init__(self, ex... |
import copy
import logging
import os.path as osp
import numpy as np
import torch
from fvcore.common.file_io import PathManager
from PIL import Image
from pycocotools import mask as maskUtils
from detectron2.data import detection_utils as utils
from detectron2.data import transforms as T
from detectron2.data.dataset_m... |
import logging
import re
from copy import deepcopy
from inspect import isclass
from textwrap import dedent
from scheme import INBOUND, OUTBOUND, Field, Structure
from scheme.exceptions import *
from scheme.util import format_structure
from mesh.constants import *
from mesh.exceptions import *
from mesh.util import Lo... |
from flask import abort, jsonify, request, g, url_for
from . import api, app
from . import utils
import json
import requests
import registry
import kvstore
from .decorators import restricted, asynchronous
CONSUL_ENDPOINT = app.config.get('CONSUL_ENDPOINT')
MESOS_FRAMEWORK_ENDPOINT = app.config.get('MESOS_FRAMEWORK_END... |
import unittest
import numpy as np
import jax
import jax.numpy as jnp
import functools
from timemachine.potentials import bonded, nonbonded, gbsa
from timemachine.lib import ops, custom_ops
from hilbertcurve.hilbertcurve import HilbertCurve
def prepare_gbsa_system(
x,
P_charges,
P_radii,
P_scale_fa... |
#-------------------------------------------------------------------------------
#
# Project: EOxServer <http://eoxserver.org>
# Authors: <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
#
#-------------------------------------------------------------------------------
# Copyright (C) 2011 EOX I... |
from __future__ import annotations
from celery.utils.log import get_task_logger
from django.conf import settings
from django.core.cache import cache
from django.db.models import Q
from django.utils import timezone
from requests.exceptions import HTTPError
from boundlexx.boundless.game import BoundlessClient
from boun... |
from __future__ import print_function
import io
from logging import log
from new_tools import convcrf
from new_tools.convcrf import GaussCRF, get_default_conf
import os
import sys
cur_path = os.path.abspath(os.path.dirname(__file__))
root_path = os.path.split(cur_path)[0]
sys.path.append(root_path)
import logging
im... |
#!/usr/bin/python3
#
# Copyright 2020 <NAME> <<EMAIL>>
# 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
#... |
# Copyright 2021 Huawei Technologies Co., Ltd
#
# 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... |
"""
MinMax k-Means
*************
:Description: MinMax k-Means (Tzortzis, G. & Likas, A. The MinMax k-Means clustering algorithm
Pattern Recognition , 2014, 47, 2505 - 2516 1) implementation following Sklearn API conventions.
:Authors: <NAME>
:Version: 1.0
:Created on: 16/05/2021 19:50
"""
__author__ = '... |
# standard libraries
import os
import re
import argparse
import subprocess
import io
import json
import unicodedata
import tarfile
# third-party libraries
#import wget
from tqdm import tqdm
#project libraries
#from utils import create_manifest
from speech.utils import data_helpers
from speech.utils import wave
def m... |
"""
Script to compare indices provided by xclim vs the ones of clix-meta.
The output is printed in stdout.
"""
import xclim.indicators.seaIce
import xclim.indicators.atmos
import xclim.indicators.land
# todo read that from yml directly
clix_indices = [("fd", "number_of_days_with_air_temperature_below_threshold"),
... |
import struct
from dso_tools.opcodes import OPCODES
SUPPORTED_DSO_VERSIONS = (43,)
U32_BYTES = 4
FLOAT_BYTES = 8
class DSO:
version = SUPPORTED_DSO_VERSIONS[0]
global_strings = []
function_strings = []
global_floats = []
function_floats = []
code = []
line_break_count = 0
string_refe... |
from musicnn.extractor import extractor
from musicnn.tagger import top_tags
import numpy as np
import matplotlib.pyplot as plt
import os
import json
from pathlib import Path
from unidecode import unidecode
from string import punctuation
def fixName(SVName):
SVName = SVName.replace("✗", " _ ")
SVName = SVName.replac... |
"""
Tomcat Blueprint
==============
**Fabric environment:**
.. code-block:: yaml
blueprints:
- blues.tomcat
settings:
tomcat:
empty_webapps: true # default: true
catalina_options:
xms: 128m # default 128m
xmx: 256m # default: 256m
"""
import os
from HTMLPa... |
from enum import Enum
class OfferType(Enum):
DISCOUNT = 1
COMBO = 2
ANYPACK = 3
def raise_value_error(message):
raise ValueError(message)
class SpecialOffer:
"""
Describes a special offer for an SKU
Types can be any of OfferType, discount describes what the offer is
"""
def ap... |
#!/usr/bin/python
import vcf as pyvcf
import argparse
import re
import os
import sys
import collections
import multiprocessing as mp
import queue
import time
contig_list = []
def main():
for vcf_reader in vcf_readers:
for contig in vcf_reader.contigs:
if contig not in contig_list:
... |
import base64
import datetime
import json
import os
import random
import string
import threading
from enum import Enum
from typing import Any, Callable, Dict, List, Tuple, Union
import requests
import speech_recognition as sr
import websocket
from dotenv import dotenv_values
from num2words import num2words
from pymitt... |
""" This module allows you to retrieve artcles from the 20minutos website
It was adapted from the french version of the website"""
#!/usr/bin/env python3
import sys
import os
import getopt
import urllib.request
from html.parser import HTMLParser
from threading import Thread
from threading import Lock
import html2text... |
from python2printer import pyprinter
import datetime
from amount2words import currency2words
class TextField:
def __init__(self, name=None, text=None, top=0, right=0, fontheight=100, width=0):
self.name = name
self.text = text
self.top = top
self.right = right
self.fonthei... |
from datetime import datetime
from moviepy import Clip
from moviepy.video.compositing.CompositeVideoClip import CompositeVideoClip
from moviepy.video.fx.resize import resize
from moviepy.video.VideoClip import ImageClip, TextClip
from constants import CREDIT_DISPLAY_TIME
from utils import crossfade, get_black... |
# -*- coding: UTF-8 -*-
import logging
from typing import Callable, Union
from homeassistant.components.light import (
LightEntity,
SUPPORT_EFFECT,
ATTR_EFFECT,
)
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import STATE_ON, CONF_HOST, CONF_PORT
from homeassistant.helpers.r... |
from ikomia import core, dataprocess
from ikomia.dnn.torch import models
import os
import copy
import torch
import torchvision.transforms as transforms
import random
# --------------------
# - Class to handle the process parameters
# - Inherits core.CProtocolTaskParam from Ikomia API
# --------------------
class Mask... |
from __future__ import unicode_literals
import frappe
import json
from frappe.model.document import Document
from erpnext.accounts.doctype.accounting_dimension.accounting_dimension import get_accounting_dimensions
from frappe.utils.data import nowdate, getdate, cint, add_days, date_diff, get_last_day, add_to_date, flt... |
from sys import stdout
import zipfile
import os.path as osp
import lmdb
import logging
from PIL import Image
import pickle
import io
import glob
import os
from pathlib import Path
import time
from threading import Thread
from queue import Queue,Empty
import subprocess
def func_wrapper(func):
def sub_func(queue,kwa... |
import numpy as np
from scipy.interpolate import interp1d
from scipy.integrate import quad, simps
from scipy.special import erf
import os
#Some parameters
rho_x = 0.3 #GeV cm^-3
file_dir = os.path.dirname(os.path.realpath(__file__))
def load_probabilities(target, n, l):
readdata = False
readQN = False... |
from moviepy.editor import VideoFileClip, concatenate_videoclips
import ffmpy
import os
from os import path
import re
def stg_log(msg = "test log", level="info", filename = "./vc.log", do_print = 1):
"""
msg: info message to be printed
level: info or warning or error
"""
from datetime import dateti... |
import tkinter as tk
from collections import namedtuple
from tkinter import ttk
from uuid import uuid4
def DEFAULT_TREE_FILTER(k):
return not k.startswith('_')
USER_DEFINED_NODES = {}
def tree_node(o, parent=None, iid=None, name=None):
name = str(name)
for filt, user_node in USER_DEFINED_NODES.items(... |
from onegov.ballot import Candidate
from onegov.ballot import CandidateResult
from onegov.ballot import ElectionResult
from onegov.ballot import List
from onegov.ballot import ListConnection
from onegov.ballot import ListResult
from onegov.ballot import PanachageResult
from onegov.election_day import _
from onegov.elec... |
import random, os
add_library('opencv_processing')
add_library('video')
add_library('minim')
minim = Minim(this)
path = os.getcwd()
cam = ""
opencv = ""
lowerb = 22
upperb = 70
#the bounding pixel values
#up control
uLow = 0
uHigh = 200
#down control
dLow = 400
dHigh = 600
#right control, camera mirrors
rLow = 0
... |
# -*- encoding: utf-8 -*-
"""
@Author : zYx.Tom
@Contact : <EMAIL>
@site : https://zhuyuanxiang.github.io
---------------------------
@Software : PyCharm
@Project : deep-learning-with-python-notebooks
@File : ch0601_raw_text_to_word_embedding.py
@Version : v0.1
@Time :... |
import numpy as np
import os
from PIL import Image
def load_faces(path, ext=".pgm"):
"""Load faces into an array (N, H, W),
where N is the number of face images and
H, W are height and width of the images.
Hint: os.walk() supports recursive listing of files
and directories in a path
... |
#!/usr/bin/env python3
"""
File: catch_up.py
-----------------
This script is for downloading and processing videos that have been collecting
in gs://esper/tvnews/videos, in order to catch up.
"""
import argparse
import errno
import fcntl
from multiprocessing import Pool
import os
from pathlib import Path
import sh... |
#Imports
import tkinter
import sys
#Constants
root = tkinter.Tk()
root.geometry('500x500+10+20')
root.title('Spence\'s Cookie Clicker Version 1.0')
root.maxsize(500, 500)
root.minsize(500, 500)
root.config(bg = 'Wheat')
#Variables
clickValue = 1 #Amount of points per click
counter = tkinter.IntVar()
presti... |
# -*- coding: utf-8 -*-
# created by restran on 2019/05/31
from __future__ import unicode_literals, absolute_import
import hashlib
import os
import string
import uuid
from collections import deque
from optparse import OptionParser
from bs4 import BeautifulSoup
from future.moves.urllib.parse import urlunparse, urlpars... |
#imports Pytorch Tutorial
from __future__ import print_function, division
import torch
import torch.nn as nn
import torch.optim as optim
from torch import tensor
from torch.optim import lr_scheduler
from torch.autograd import Variable
import numpy as np
import torchvision
from torchvision import datasets, models, tra... |
import argparse
from typing import Union, List
import numpy as np
import os
import cv2
import torch
from detectron2.config import get_cfg
from detectron2.modeling import build_model
from detectron2.checkpoint import DetectionCheckpointer
from detectron3.data.transforms import augmentation_impl as custom_aug
from detect... |
import functools
import os
import sys
import click
from click_option_group import MutuallyExclusiveOptionGroup
from . import __version__
from .core import (
CheckHashLineError,
HashFileReader,
HashFileWriter,
check_hash_line,
generate_hash_line,
)
from .hasher import Hasher
from .utils.click impor... |
# All operations related to subfolders and specific files should be put in this file
# So the structure is managed here only
#
from .helper import *
import lxml.etree as etree
child = etree.SubElement
Voxelyze3 = "./simulator/Voxelyze3"
vx3_node_worker = "./simulator/vx3_node_worker"
def foldername_generation(experim... |
######### This file is for finding out the brand and the size of the shoes. #################
import os
from os.path import basename
import sys
import json
import requests
import matplotlib.pyplot as plt
from PIL import Image
from io import BytesIO
import numpy as np
import logging
import cv2
import config_own
def sho... |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import numpy as np
import sys
import os
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
sys.path.append(BASE_DIR)
ROOT_DIR = os.path.dir... |
#!/usr/bin/env python3
'''
This little script is a simple password manager.
You give in your master password and the service you are using and based on this you get a some passwords.
'''
import hashlib
import base64
import getpass
import datetime
import sqlite3
ALPHABET = ('abcdefghijklmnopqrstuvwxyzäöü'
'... |
from TestHelperSuperClass import testHelperSuperClass
from executor import executeCommand
import python_Testing_Utilities
import time
#kong_update_cert_where_any_snis_match http://127.0.0.1:8001 hosta.com,t.ac.uk,asd.com ../examples/certs/server.crt ../examples/certs/server.key hosta.com,t.ac.uk,asd.com
class local_h... |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Wed Nov 21 13:24:24 2018
@author: ead2019
"""
import os.path as osp
import glob
import os
from matplotlib.ticker import NullLocator
import pylab as plt
import numpy as np
import cv2
import seaborn as sns
def read_img(imfile):
import cv2
return cv... |
"""
Item 52: Use subprocess to Manage Child Processes
"""
"""
Child processes run in parallel
Use the run function for simple usage and Popen class for advance usage like UNIX-style pipelines
Use the timeout and communicate methods to avoid deadlocks or hanging processes.
Documentation for the subprocess module (P... |
###################################################################################
# Copyright 2021 National Technology & Engineering Solutions of Sandia, #
# LLC (NTESS). Under the terms of Contract DE-NA0003525 with NTESS, the #
# U.S. Government retains certain rights in this software. ... |
import tempfile
import os
from PIL import Image
from django.contrib.auth import get_user_model
from django.urls import reverse
from django.test import TestCase
from rest_framework import status
from rest_framework.test import APIClient
from core.models import Recipe
from core.models import Tag
from core.models impo... |
"""
DoF - Deep Model Core Output Framework
======================================
Submodule: datamodel
"""
from enum import Enum
from . import __version__
class ContentForm(Enum):
"""
Provide constants for JSON output content form
==============================================
Notes
-----
... |
from typing import Dict
import json
import pytest
from ...func_test_tools import load_result, load_result_from_path, exist_in_path
from ...constants import *
# Fixtures
@pytest.fixture(scope='function', name="csv_one_read_book")
def csv_one_read_book_file(tmpdir_factory):
""" Create a CSV file with just one book... |
'''Funcitons for plotting after prospector has run'''
import os
import pickle
import numpy as np
from astropy.io import ascii
from uvj_clusters import plot_uvj_cluster
from emission_measurements import read_emission_df
import matplotlib.pyplot as plt
import matplotlib.transforms as transforms
from bpt_clusters import ... |
import logging
import os
import re
import requests
import simplejson as json
from datetime import datetime
from itertools import chain
from requests import HTTPError
from requests.exceptions import SSLError
from spacy.en import English
CROWDFLOWER_MAX_ROW_LENGTH = 32767
_LOGO_UID_RE = re.compile(r"^[A-Z0-9]{8}-[A-Z0-9... |
""" Cisco_IOS_XR_controller_otu_cfg
This module contains a collection of YANG definitions
for Cisco IOS\-XR controller\-otu package configuration.
This YANG module augments the
Cisco\-IOS\-XR\-ifmgr\-cfg
module with configuration data.
Copyright (c) 2013\-2016 by Cisco Systems, Inc.
All rights reserved.
"""
im... |
import datajoint as dj
dj.config['database.host'] = 'archive.datajoint.io'
dj.config['database.user'] = 'nips'
dj.config['database.password'] = '<PASSWORD>'
import numpy as np
import seaborn as sns
import sys
sys.path.insert(1, 'C:\\Users\\petko\\Documents\\GitHub\\Sinz2018_NIPS')
sys.path.insert(1, 'C:\\Users\\petko... |
# Author: <NAME> <<EMAIL>>
import sys
import hou
import os
import imp
import re
import inspect
from math import *
from array import array
import xcore
import xhou
try: xrange
except: xrange = range
class NodeInfo:
def __init__(self, xkfr, node, nodePathId, nodeNameId, nodeTypeId):
self.xkfr = ... |
from scipy.io.wavfile import read, write
from pymo.parsers import BVHParser
from pymo.data import Joint, MocapData
from pymo.preprocessing import *
from pymo.writers import *
import os
import json
import re
from g2p_en import G2p
import librosa
import numpy as np
import soundfile
FRONT_APPEND_SILENCE = 0.2 # in secon... |
"""``resources`` module of ``dataql``.
It provides the different classes that are used to store a usable structure from a query
parsed by a dataql parser.
We have three resources. Each one has a name, and filters (subclasses of ``BaseFilter``).
The three resources are:
- ``Field`` : a simple field. A parser may coe... |
import torch
import torch.utils.data
import MidiPoint
import os
class LSTMpredictor(torch.nn.Module):
def __init__(self, hidden_dim):
super(LSTMpredictor, self).__init__()
self.hidden_dim = hidden_dim
self.lstm = torch.nn.LSTM(2, hidden_dim)
self.hidden2note = torch.nn.Linear(hidde... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.