text stringlengths 3.07k 22.1k |
|---|
"""OpenSprinkler integration."""
import asyncio
from datetime import timedelta
import logging
from pyopensprinkler import (
Controller as OpenSprinkler,
OpenSprinklerAuthError,
OpenSprinklerConnectionError,
)
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import CONF_PASSWOR... |
import serial, codecs, threading, sys, requests, time, json
from flask import Flask, jsonify, request, Response, make_response, render_template
import numpy as np
from datetime import datetime
# ---------------{ CONFIGURATION }---------------
server_name = 'WX Telemetry Server'
com_port = "COM1"
host = "192.168.1.20... |
from time import time
import cv2
import utils
from config import config
from gameplay import GameWithFriendOpenVINO, SoloIntensiveFastAim, SoloClassic
class Label:
def __init__(
self,
text,
pos=(0, 0),
font_face=cv2.FONT_HERSHEY_COMPLEX,
font_scale=1.0... |
#!/usr/bin/python
## system
import sys,os,pdb,json,codecs
###
## darknet.py from github.com/dcmartin/openyolo/tree/master/darknet/python/darknet.py
###
from ctypes import *
import math
import random
class BOX(Structure):
_fields_ = [("x", c_float),
("y", c_float),
("w", c_float),... |
import nn
from optim import get_optimizer
from utils.common import GLOBAL, List, Tuple
import nn.functional as F
import nn.objectives
from utils.toolkit import ProgressBar, format_time, SummaryProfile
import time
import pickle
import utils.data as data
from collections import defaultdict
import core.autograd
class _B... |
"""
Matrix factorization example
"""
# Inspiration: Music Recommendations with Collaborative Filtering and Cosine Distance
# https://beckernick.github.io/music_recommender/
#
# Inspiration: Matrix Factorization for Movie Recommendations in Python
# https://beckernick.github.io/matrix-factorization-recommender/
#
# Ex... |
#! /usr/bin/env python3
import argparse
import configparser
import logging.config
import os
import subprocess
import sys
from argparse import RawTextHelpFormatter
from collections import namedtuple
from pprint import pformat
from typing import Dict
logging.basicConfig(format="%(levelname)s: %(message)s", level=loggin... |
#coding:utf-8
#!/bin/env python2.7
import sys
import os
import matplotlib
matplotlib.use('Agg')
import pylab
import itertools
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.ticker as tkr
from matplotlib.backends.backend_pdf import PdfPages
args = sys.argv
inputdirs = args[1:-1] #dir... |
import gc
import os
import numpy as np
from tqdm import tqdm
from datasets.dsb_binary import DSB2018BinaryDataset
from losses import binary_crossentropy, make_loss, hard_dice_coef_ch1, hard_dice_coef
from models.model_factory import make_model
from params import args
# os.environ['CUDA_VISIBLE_DEVICES'] = args.gpu
... |
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
import argparse
import itertools
import copy
import os
import numpy as np
import anytime_models.examples.ann_app_utils as ann_app_utils
from petridish.philly.generator import SCRIPT_TEMPLATE
from petridish.app.options import (
add_app_argume... |
# CREATED BY <NAME>
# #
# #
# #
#
# =========================================================================================
# IMPORT LIBRARIES
# =========================================================================================
import pandas as pd
import numpy a... |
import argparse
from ipaddress import ip_address
from itertools import chain
import logging
from multiprocessing import Process, Queue
import os
import statistics
from time import perf_counter
from typing import Tuple, List, Optional
from twisted.internet import defer
from twisted.python.failure import Failure
from d... |
import numpy as np
import json
import os
import importlib
import argparse
import pandas as pd
import numpy as np
from collections import namedtuple
from sklearn.metrics import accuracy_score
class ConfusionMatrix(namedtuple('ConfusionMatrix', 'minority majority label truth')):
def get_matrix(self):
... |
# coding: utf-8
# /*##########################################################################
#
# Copyright (c) 2017 European Synchrotron Radiation Facility
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
#... |
"""
runtimeCommands.py
Convenience methods for binding commands or callbacks to runtimeCommand objects.
"""
import maya.cmds as cmds
import mGui.events as events
import json
import inspect
def create_proxy_command(callable_object, *args, **kwargs):
"""
generates an expression which imports... |
import os
import random
from typing import Any, Dict
import numpy as np
# from mmcls.models.losses import accuracy, f1_score, precision, recall
# from mmcls.models.losses.eval_metrics import class_accuracy
from .base_dataset import BaseDataset
from .builder import DATASETS
# 0 1 2 ... |
"""
Copy fyglet/fonts folder to root
SPEC
____
hiddenimports=['engineio.async_drivers.eventlet', 'eventlet.hubs.epolls', 'eventlet.hubs.kqueue',
'eventlet.hubs.selects', 'dns.dnssec', 'dns.e164', 'dns.edns', 'dns.entropy', 'dns.exception',
'dns.flags', 'dns.grange', 'dns.hash', 'dns.inet', 'dns.ipv4', 'dns.ipv6... |
import sys
import os
import re
import mdtraj
import glob
import argparse
import pandas as pd
import matplotlib.pyplot as plt
def parse_arguments():
"""
Parse user arguments
Output: list with all the user arguments
"""
# All the docstrings are very provisional and some of them ... |
from hashlib import md5
from json import dumps
from LSP.plugin import FileWatcher
from LSP.plugin import FileWatcherEventType
from LSP.plugin import FileWatcherProtocol
from LSP.plugin import register_file_watcher_implementation
from LSP.plugin.core.transports import AbstractProcessor
from LSP.plugin.core.transports im... |
from ymmsl import Identifier, Reference, Settings
from ymmsl import SettingValue # noqa: F401 # pytest: disable=W0611
from collections import OrderedDict
from typing import cast, List
import yatiml
import pytest
@pytest.fixture
def settings() -> Settings:
return Settings()
def test_create_settings(settings: ... |
import re
import nltk
from nltk.corpus import words
from nltk.stem import WordNetLemmatizer
import mistune
from langdetect import detect
'''preprocess data for input'''
# remove previously referenced comments
#remove every line that starts with ">"
def remove_reference(text):
pattern = r'''^>.*'''
result = re.... |
# Import useful packages
import numpy as np
import time
import itertools
from collections import deque
from bokeh.plotting import figure
from bokeh.layouts import row, column, widgetbox
from bokeh.models.widgets import Slider, Div, Button, RadioButtonGroup
from bokeh.events import ButtonClick
from bokeh.server.server ... |
from torch.nn import functional as F
import torch.nn as nn
from torch.autograd import Variable
import torch
import config
##############################################################################################################
# Parameters
########################################################################... |
"""Tools for io handling."""
import os
import shutil
import subprocess
from collections import OrderedDict, namedtuple
from typing import Iterable, Tuple
import h5py
import numpy as np
import pandas as pd
from .utils import get_logger
class auto_open(object):
# TODO(<EMAIL>) 1.Add log system. ... |
################### Bibliotecas Utilizadas ##########################
import os,cv2
import numpy as np
import matplotlib.pyplot as plt
import time
from sklearn.utils import shuffle
from sklearn.model_selection import train_test_split
from keras import backend as K
K.set_image_dim_ordering('tf')
from ke... |
import unittest
import collections
from solution import (RANKS, SUITS, Card, CardCollection,
StandardDeck, SixtySixDeck, BeloteDeck)
class RankTest(unittest.TestCase):
def setUp(self):
self.rank_string = 'Three'
self.rank = RANKS[self.rank_string]()
def test_creation(sel... |
# -*- coding: utf-8 -*-
"""
Utility functions needed by the DNSDB module
"""
from dateutil.parser import parse
def build_uri(options):
"""
Build URI for DNSDB API query
:param options: Dictionary
:return: String
"""
path = build_path(options)
uri = build_parameters(options, path)
r... |
import argparse
import os
import time
import logging
from logging import getLogger
import urllib
import torch
import torch.nn as nn
import torch.nn.parallel
import torch.backends.cudnn as cudnn
import torch.optim
import torch.utils.data as data
import torchvision.transforms as transforms
import torchvision.datasets as... |
import os,sys,re
import numpy as np
import subprocess
from multiprocessing import Process,Pool
import pickle
from Bio.Blast import NCBIXML
from Bio import pairwise2
from Bio.SubsMat import MatrixInfo as matlist
from Bio.SeqIO.FastaIO import SimpleFastaParser
import math
from math import log, exp
from getNatureA import ... |
"""
Interface to irvsp.
"""
import warnings
import os
from os import path
import subprocess
from monty.json import MSONable
from monty.dev import requires
from monty.os.path import which
from monty.serialization import loadfn
from pymatgen.symmetry.analyzer import SpacegroupAnalyzer
from pymatgen.core import Struct... |
# This file contains the Options objects for pitches and hits. These objects contain all the information about the
# the conditions of the situation that allow for accurate calculations.
from constants import *
import numpy as np
class PitchOptions(object):
def __init__(self, play_type, release_speed, release_... |
import numpy as np
import pandas as pd
import logging
import matplotlib.pyplot as plt
from numpy.linalg import inv, multi_dot
from copy import deepcopy
logger = logging.getLogger(__name__)
def load_dataset(csv_path):
return pd.read_csv(csv_path)
class KalmanFilterSteadyState:
"""定常モデルのカルマンフィルター.
Attri... |
from itertools import count
import logging
from typing import Tuple, Iterator, Union, Dict, Optional, List
import torch
import torch.nn.functional as F
from tqdm import tqdm
from adaptor.adapter import Adapter
from torch import Tensor
from transformers import BatchEncoding, PreTrainedTokenizer, BertTokenizer
from ad... |
# -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------
"""VirusTo... |
# -*- coding: utf-8 -*-
# /usr/bin/python2
'''
June 2017 by <NAME>.
<EMAIL>.
https://www.github.com/kyubyong/transformer
'''
from __future__ import print_function
import codecs
import os
import typing
import tensorflow as tf
import numpy as np
import numpy.linalg
from hyperparams import Hyperparams as hp
from data_l... |
"""
Code for self-training with weak supervision.
Author: <NAME> (<EMAIL>)
"""
import pandas as pd
import numpy as np
import os
from sklearn.model_selection import train_test_split
import joblib
class PreprocessDataset(object):
"""Abstraction for a loadable dataset.
To use a custom dataset, inherit this cla... |
#!./venv_nano_local/bin/python
from os import system
from math import ceil, log10
from time import time
from src.nano_rpc import NanoRpc, NanoTools
from src.parse_nano_local_config import ConfigParser, ConfigReadWrite
import copy
from interruptingcow import timeout
import logging
import time
import json
import unittest... |
###############################################################################
# Copyright (c) 2006-2016 Franz Inc.
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v1.0
# which accompanies this distribution, and is available at
# htt... |
import re
from multiprocessing import Pool
import pandas as pd
# NOTE: grc_seqs uses GENCODE. I should probably switch to GRCm38_98 as on the server..
from moritzsphd.data import (ensembl_release, grc_annotation, grc_seqs,
mirbase_seqs, special_normalized_mirnas)
from moritzsphd.mirna_targ... |
# -*- coding: utf-8 -*-
#
# osc2rtmidi/midiio.py
#
"""Asynchroneous MIDI input / output framework."""
import logging
import multiprocessing
import threading
import time
from operator import attrgetter
try:
import Queue as queue
except ImportError:
# Python 3
import queue
try:
StandardError
except Na... |
# In[]:
import numpy as np
from gridworld import GridWorld
# In[]:
env = GridWorld(3, 4)
state_matrix = np.zeros((3,4))
# this is the charging station
state_matrix[0, 3] = 1
# this is the staircase
state_matrix[1, 3] = 1
# this is the invalid state
state_matrix[1, 1] = -1
reward = np.full((3,4), -0.04)
# this is th... |
"""Tests for rio_tiler_crs."""
import os
import morecantile
import pytest
from rasterio.crs import CRS
from rio_tiler.errors import TileOutsideBounds
from rio_tiler_crs import COGReader
from rio_tiler_crs.cogeo import geotiff_options
COG_PATH = os.path.join(os.path.dirname(__file__), "fixtures", "cog.tif")
COG_CMAP... |
import modeli
import datetime
MAX_REZULTATOV_ISKANJA = 15
def izberi_moznost(moznosti):
"""
Funkcija, ki izpiše seznam možnosti in vrne indeks izbrane možnosti.
Če na voljo ni nobene možnosti, izpiše opozorilo in vrne None.
Če je na voljo samo ena možnost, vrne 0.
>>> izberi_moznost(['jabolko'... |
from __future__ import annotations
from dataclasses import dataclass
from typing import Callable, Dict, Iterator, Sequence, TypeVar, Optional, Tuple
from context_manager_patma import derive, register
from . import entity_types as et
import html
import json
R = TypeVar("R", bound="HtmlRender")
class HtmlRender:
... |
'''
@article{LF-DFnet,
author = {<NAME> and <NAME> <NAME> and <NAME> and <NAME> and <NAME>},
title = {Light Field Image Super-Resolution Using Deformable Convolution},
journal = {IEEE Transactions on Image Processing},
volume = {30),
pages = {1057-1071},
year = {2021},
}
'''
import torch
import to... |
from abc import ABC
import torch_geometric as pyg
import torch
import torch.nn.functional as F
import torch.nn as nn
import torch_geometric.nn as gnn
import torch_geometric.data as tgd
from torch_geometric.data import InMemoryDataset
import torch_geometric.utils as utils
from torch.autograd.function import Fun... |
#!/usr/bin/env python
import argparse
import contextlib
import os
import pandas as pd
import select
import shlex
import subprocess as sp
import time
from pathlib import Path
from typing import Optional
def memory_t(value):
if isinstance(value, int):
return value
elif value.lower().endswith("g"):
... |
# Copyright 2018 <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, software
... |
import random
import sys
import re
import os
sys.setrecursionlimit(1000000)
def get_random_str(randomlength=16):
random_str = ''
base_str1 = 'ABCDEFGHIGKLMNOPQRSTUVWXYZabcdefghigklmnopqrstuvwxyz'
base_str = 'ABCDEFGHIGKLMNOPQRSTUVWXYZabcdefghigklmnopqrstuvwxyz0123456789'
length1 = len(base_str1) - 1
... |
# Create your views here.
import json
import logging
import re
from smtplib import SMTPRecipientsRefused
import cStringIO as StringIO
from cgi import escape
from django import forms
from django.contrib.admin.views.decorators import staff_member_required
from django.contrib.sites.models import Site
from django.core.url... |
# -*- coding:utf-8 -*-
"""
-------------------------------------------------------------------------------
Project Name : ESEP
File Name : get_obs_data.py
Start Date : 2021-10-08 11:5... |
import json
from django.db import IntegrityError
from dlkit.runtime.errors import *
from dlkit.runtime.primitives import Type
from rest_framework.response import Response
from rest_framework.renderers import BrowsableAPIRenderer
from utilities import assessment as autils
from utilities import general as gutils
from... |
"""
kr_helper_funcs.py - generic helper functions that can be used across Tensorflow & Keras DL code
@author: <NAME>
Use this code at your own risk. I am not responsible if your computer explodes of GPU gets fried :P
Usage:
- to import functions from this module, copy the py file to your project folder
- impo... |
import os
import six
import sys
import math
import ntpath
import random
import argparse
import threading
import numpy as np
import tensorflow as tf
from datetime import datetime
def _int64_feature(value):
"""Wrapper for inserting int64 features into Example proto."""
if not isinstance(value, list):
va... |
import os
import sys
import time
import torch
import torch.nn as nn
import torch.backends.cudnn as cudnn
import torch.optim.lr_scheduler as schedule
from tqdm import tqdm as tqdm
from util import *
from model import create_model
import data_loader
from collections import OrderedDict
def train(config, train_loader, e... |
# This code is part of Qiskit.
#
# (C) Copyright IBM 2018, 2021.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivat... |
"""
move
"""
from __future__ import absolute_import, division, print_function
import logging
from PySide import QtGui
from mcedit2.command import SimpleRevisionCommand
from mcedit2.editortools import EditorTool
from mcedit2.imports import PendingImportNode, PendingImport
from mcedit2.rendering.scenegraph import ... |
import pandas as pd
from pptx import Presentation
from pptx.dml.color import RGBColor
from pptx.dml.line import LineFormat
from pptx.enum.dml import MSO_LINE
from pptx.enum.text import MSO_ANCHOR
from pptx.enum.text import PP_ALIGN
from pptx.util import Inches
from pptx.util import Pt
from pptx.oxml.xmlchemy import Ox... |
import io
import os.path
import sys
import PIL.Image
from PIL import Image
import caffe
import numpy as np
import scipy.ndimage as nd
from google.protobuf import text_format
import ai_integration
# a couple of utility functions for converting to and from Caffe's input image layout
def preprocess(net, img):
# p... |
import unittest
import textwrap
from collections import defaultdict
class TrackCallbacks(object):
kv_pre_events = []
'''Stores values added during the pre event dispatched callbacks.
'''
kv_applied_events = []
'''Stores values added during the applied event dispatched callbacks.
'''
kv_... |
#!/usr/bin/env python
# coding: utf-8
import argparse
from fastai.vision import *
from tqdm import tqdm
from pathlib import Path
import pandas as pd
import os
import sys
from fastai.callbacks import CSVLogger
from torch import einsum
# suppress anoying and irrelevant warning, see https://forums.fast.ai/t/warnings-wh... |
import os
import torch
import torchvision
import torchvision.transforms as transforms
import math
import torch.optim as optim
#import torch.optim.lr_scheduler as lr_scheduler
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
import numpy as np
from torch.auto... |
import re
import json
class CData:
def __init__(self):
self.m_data=""
def Add(self, add):
"""Gets a string that is added to m_data
Args:
add: value that is added to m_data
"""
self.m_data += str(add)
def LoadData(self, data):
"""Takes rtf file as a string and... |
import cv2
import numpy as np
from sklearn.neighbors import NearestNeighbors
def nearest_neighbor(src, dst):
'''
Find the nearest (Euclidean) neighbor in src for each point in dst
Input:
src: template points
dst: destination points
Output:
distances: Euclidean distances of the ... |
"""
==============================================
Composite, Composer, and MetaComposer Classes
==============================================
"""
import abc
import copy
from typing import Dict, Any, Optional, Iterable, List
from vivarium.core.process import (
_override_schemas, assoc_in, _get_parameters, Proces... |
import os
from cs50 import SQL
from flask import Flask, flash, redirect, render_template, request, session
from flask_session import Session
from tempfile import mkdtemp
from werkzeug.exceptions import default_exceptions, HTTPException, InternalServerError
from werkzeug.security import check_password_hash, generate_pa... |
import csv
from django.contrib import messages
from django.contrib.auth.mixins import LoginRequiredMixin
from django.contrib.messages.views import SuccessMessageMixin
from django.core.exceptions import PermissionDenied
from django.db.models import Q
from django.http import HttpResponse, HttpResponseRedirect
from djang... |
from flask import Flask, request, Response, abort, redirect
import os
import requests
import logging
import json
import re
import sys
from time import sleep
app = Flask(__name__)
format_string = '%(asctime)s - %(name)s - %(levelname)s - %(message)s'
logger = logging.getLogger('freshdesk-rest-service')
# Log to stdout... |
'''
Copyright 2017-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... |
import numpy as np
import ot
#import ot.plot
from ot_utils import *
#from extract_pos import *
import pandas as pd
from tqdm import tqdm
'''
User input :
- filename : name of the csv with input
- dt_max : maximal frame separation between things we want to connect
- epsilon : coefficient of the entropic regularizati... |
import random
from decimal import Decimal
from django.shortcuts import get_object_or_404, render
from django.http import HttpResponse, HttpResponseRedirect, HttpResponseForbidden
from django.template import loader
from .models import Event, Pledge
from .users.models import User
from .models import Event
from django.ht... |
# -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------
from ..co... |
import pandas as pd
from datetime import date, timedelta
import calendar
from itertools import product
from typing import *
__all__=[
"Time",
"GroupBy",
"AssistCol",
"Others",
]
class Time:
@classmethod
def next_month_date(cls, cur_date: date, step: int):
'''
得到一年内的下一个月头的日期
... |
import re
from luna.wrappers.base import MolWrapper
from luna.util.default_values import MIN_FDEF_FILE
from luna.util.exceptions import FingerprintNotCreated, IllegalArgumentError
from rdkit.Chem.Fingerprints import FingerprintMols
from rdkit.Chem import MACCSkeys
from rdkit.Chem.AtomPairs import Pairs, Torsions
from... |
from cone.app.browser.ajax import ajax_continue
from cone.app.browser.ajax import ajax_message
from cone.app.browser.ajax import AjaxAction
from cone.app.browser.form import Form
from cone.app.browser.form import YAMLForm
from cone.app.browser.layout import ProtectedContentTile
from cone.app.browser.settings import Set... |
import glob
import os
import numpy as np
from moviepy.editor import *
import librosa
import soundfile as sf
import argparse
import numpy as np
import os
import sys
import time
from tqdm import tqdm
from collections import OrderedDict
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.utils.... |
# -*- coding: utf-8 -*-
"""
Created on Fri Dec 18 21:51:41 2015
@author: SW274998
"""
import pdb
import dateutil.relativedelta
from nsepy.commons import *
import ast
import json
import io
from bs4 import BeautifulSoup
from nsepy.liveurls import quote_eq_url, quote_derivative_url, option_chain_url, futures_chain_url, h... |
import os
import time
import json
import zipfile
import argparse
import numpy as np
import pandas as pd
import cv2.cv2 as cv2
from progressbar import *
class csv_to_coco(object):
def __init__(self):
print('the process of the function: \
_image & _categories --> _annotation --... |
import datetime
import math
import pytz
import re
import time
from django.conf import settings
from django.core.mail import EmailMessage
from django.core.management.base import BaseCommand
import pandas as pd
from bs4 import BeautifulSoup
from selenium import webdriver
from ...models import Gateway, Query, Sensor, T... |
from datetime import datetime, timedelta
from django.db import connection
from django.db.models import Sum, Count, Q
from django.shortcuts import get_object_or_404, redirect
import jingo
from babel import numbers
from tower import ugettext as _
import amo
from addons.models import Addon
from amo.decorators import lo... |
from __future__ import annotations
import argparse
import collections
import logging
import operator
import time
from concurrent.futures import ThreadPoolExecutor
from dataclasses import dataclass
from typing import Optional, List, AnyStr, Iterator
from btrfslime.scantree import iterate_files
from . import btrfs
from... |
import asyncio
import random
import requests
from bs4 import BeautifulSoup
import lxml
import re
import urllib
from urllib.parse import urlparse
import pathlib
import os
import logging
import signal
import urllib
from crawly.identifier import Identified
from crawly.parser import Parsed
from crawly.downloader import D... |
# measure version 1.9.1s
from measure import npfarray,pltext,plt,sqrt,expreg,val,linreg,tbl,lst,exp,mv,dtot_mv
# Aufgabe 2
ug_5min = 120
ug_5min_err = sqrt(ug_5min)
ug_1s = ug_5min / (5 * 60)
ug_1s_err = ug_5min_err / (5 * 60)
print('\nAufgabe 2:\n')
print(val(ug_1s,ug_1s_err,name='Untergrund / s'))
# Aufgabe 3
t = ... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat Jan 9 13:55:53 2021
@author: Clement
"""
import pandas
import geopandas as gpd
import numpy
import os
import sys
import datetime
sys.path.append(os.path.dirname(os.path.dirname(os.path.realpath(__file__))))
from gen_fct import file_fct
from gen_fct im... |
# ==============================================================================
# This file is part of the SPNC project under the Apache License v2.0 by the
# Embedded Systems and Applications Group, TU Darmstadt.
# For the full copyright and license information, please view the LICENSE
# file that was distributed... |
import sys
import xml.etree.ElementTree as ET
import requests
import csv
import time
import ping3
import getpass
import threading
#Ignores SSL warnings
requests.packages.urllib3.disable_warnings()
#Function to authenticate fw with user/pw provided and obtain the API key
def authenticate(fwip, user, pw):
#Calls t... |
import csv
import logging
from contextlib import closing
from pathlib import Path
from shutil import rmtree
from typing import Any, Generator, Tuple
import dbcat.settings
import pytest
from dbcat.api import catalog_connection_yaml, init_db, scan_sources
from dbcat.catalog.catalog import Catalog
from pytest_cases impor... |
#!/usr/bin/env python3
"""
Copyright 2018 <NAME> (<EMAIL>)
https://github.com/rrwick/Bacsort
This merges Bacsorted assemblies into a Kraken library build.
This file is part of Bacsort. Bacsort is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by ... |
# -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import numpy as np
from ... import units as u
from ..distances import Distance
from .. import transformations as t
from ... |
# Stores all functions for the single experiment (within-subject) analyses
# testing the relationship between vividness and memory attributes
# <NAME> - September 2021
#########################################
# imports: ----------------------------- #
import pandas as pd
import numpy as np
import matplotlib.pyplot ... |
from __future__ import annotations
from typing import Iterator
import contextlib
import os
import platform
from pathlib import Path
from . import commands
from .log import (
RuntimeMetadata,
LogEntry,
Log,
)
from .commands import (
Metadata,
Command,
BiotekCmd,
Checkpoint,
Duration,... |
import torch
from torch import nn, optim
import torch.nn.functional as F
from torchvision import datasets, transforms, models
from PIL import Image
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from collections import OrderedDict
def load_datasets(data_dir):
'''
Load traini... |
# Copyright (c) 2013 <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... |
"""
Author: <NAME>, <NAME>, <NAME>
common.py
contains some function that will be used on classifiers
Data: a class to read data
predict: infer data from model
compare_result: compare inference result and label
draw_image: draw debug image
gen_data: generate data from inference result
... |
"""This module controls everything to do with storing, editing,
displaying, and destroying shortcuts (or aliases) to tags."""
import sys
import argparse
from typing import Tuple, List
from halo import Halo # extremely important
from inputfuncs.input_reader import (
read_lines_into_dict
)
def create_tag_shortc... |
from rest_framework import serializers
from rest_framework.response import Response
from rest_framework.decorators import api_view
from rest_framework import status
from rest_framework.views import APIView
# from rest_framework import mixins
from rest_framework import generics
from rest_framework import viewsets
from ... |
#<NAME> RECURSION
import random,copy, statistics, timeit, threading, math, time
from math import *
import numpy as np
import matplotlib.pyplot as plt
import queue as Queue
from graphics import *
#ones that didnt work
#cm150a
#cc
#twocm
print("BB Partitioning")
files = ['cm82a.txt', 'con1.txt', 'z4ml.t... |
import logging
import dataclasses
import pprint
import torch
from torch import optim
import torch.cuda
import torch.utils.data
import torch.nn as nn
import torch.multiprocessing as mp
from torch.utils.collect_env import get_pretty_env_info
from torch.utils.tensorboard import SummaryWriter
from pyhocon import ConfigTre... |
from rest_framework.authtoken.models import Token
from rest_framework.response import Response
from rest_framework import status
from django.contrib.auth.forms import UserCreationForm
from django import forms
from django.db import models
from django.core import serializers
from django.contrib.auth.models import User
fr... |
# -*- coding: utf-8 -*-
"""Main module."""
from __future__ import absolute_import
import json
from datetime import date, datetime
import dateutil
from toolspy import is_int, is_number
from decimal import Decimal
import six
def instance_of(item, type_):
"""This method is an enhanced version of isinstance
It... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.