text
stringlengths
3.07k
22.1k
# -*- coding: utf-8 -*- ''' Translate an options data structure into command line args ''' # Import python libs import sys import inspect import argparse import functools import collections __virtualname__ = 'args' __contracts__ = [__virtualname__] class ActionWrapper: ''' This class wraps argparse.Action i...
from __future__ import absolute_import from __future__ import division from __future__ import print_function import torch import torchvision import torchvision.transforms as transforms import torch.nn as nn # import torch.nn.functional as F import torch.optim as optim import utils.utils as util import utils.quantizati...
from enum import Enum import logging import dbus try: from gi.repository import GObject except ImportError: import gobject as GObject from .dbus_bluez_interfaces import Characteristic, Service, string_to_dbus_array logger = logging.getLogger(__name__) class BluenetUuids(object): SERVICE = 'FBE51523-B3...
# Copyright 2016 Red Hat, Inc. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
from dataclasses import InitVar, dataclass, asdict, field from typing import Dict, Any, List, Set from enum import Enum class HighValuesAre(str, Enum): bad = "bad" good = "good" neutral = "neutral" class SignalFormat(str, Enum): per100k = "per100k" percent = "percent" fraction = "fraction" ...
import random from psycopg2 import sql from src.modules.catfact_helper import get_catfact from src.modules.db_helper import member_exists, insert_member, get_table, connection_error, dbfunc_run from src.modules.discord_helper import change_nickname, kick_member, try_send from src.tools.botfunction import BotFunction fr...
import json import logging from cryptojwt.exception import BadSignature from cryptojwt.jws.exception import JWSException from cryptojwt.key_jar import KeyJar from fedoidcmsg import ClientMetadataStatement from fedoidcmsg import DoNotCompare from fedoidcmsg import IgnoreKeys from fedoidcmsg import MetadataStatementErr...
from methods import load_json, save_json, chunks from collections import Counter from math import ceil # External libs: from tabulate import tabulate from matplotlib import pyplot as plt from matplotlib.lines import Line2D import seaborn as sns sns.set_style("white") sns.set_context('paper', font_scale=7) my_palette ...
# -*- coding: utf-8 -*- # Imports #================================================== import json, keras, gensim, codecs import tensorflow as tf import numpy as np import keras.preprocessing.text as kpt from keras.callbacks import Callback from keras.layers import Dropout, Input, Dense, Embedding, LSTM, Bidirectional ...
import random from django.contrib.auth.models import User from django_filters.rest_framework import DjangoFilterBackend from rest_framework import status, mixins from rest_framework.authentication import TokenAuthentication from rest_framework.decorators import action from django.db.models import Max from rest_framewo...
""" This module defines functions to install c extensions for all the platforms into Kolibri. It is required to have pip version greater than 19.3.1 to run this script. Usage: > python build_tools/install_cexts.py --file "requirements/cext.txt" --cache-path "/cext_cache" It reads the package name and version from req...
#!/usr/bin/env python3 #**************************************************************************************************************************************************** # Copyright (c) 2014 Freescale Semiconductor, Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without #...
import os import sys import signal import logging.config import driller import argparse import subprocess import multiprocessing import angr from angr.sim_type import SimTypeString try: import cPickle as pickle except: import pickle l = logging.getLogger("local_callback") def _run_drill(drill, fuzz, _path...
# -*- coding: utf-8 -*- # # Copyright 2014-2017 <NAME> # All Rights Reserved. # # 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 #...
from .modules import * class SepNet(nn.Module): def __init__(self, netV, netT): super(SepNet, self).__init__() self.netV = netV self.netT = netT def forward(self, x1, x2=None): if x2 is None: q, p = x1.chunk(2, dim=-1) return self.netV(q) + self.netT(p)...
import sys import open3d import numpy as np import time import os from geometric_registration.utils import get_pcd, get_keypts, get_desc, loadlog import cv2 from functools import partial def build_correspondence(source_desc, target_desc): """ Find the mutually closest point pairs in feature space. source ...
from django.shortcuts import render from django.http import HttpResponseRedirect, HttpResponse from rango.models import Category, Page from rango.forms import CategoryForm, PageForm from rango.forms import UserForm, UserProfileForm from django.core.urlresolvers import reverse from django.contrib.auth import authenticat...
#!/usr/bin/env python # coding: utf-8 # # Import Base Packages # In[ ]: import pandas as pd import numpy as np import warnings warnings.filterwarnings('ignore') # # Interface function to feature engineering data # In[ ]: from sklearn.preprocessing import LabelEncoder from sklearn.preprocessing import Standard...
import torch from torch import nn class BaseAligner(nn.Module): def __init__(self, add_identity = True, add_bias = True): super(BaseAligner, self).__init__() self.n_parameters = None self.add_bias = add_bias self.add_identity = add_identity if self.add_bias: ...
import json import multiprocessing from multiprocessing import Process import os import random import time import traceback import zmq import zmq.decorators as zmqd from aser.database.kg_connection import ASERKGConnection from aser.server.utils import * from aser.extract.aser_extractor import SeedRuleASERExtractor from...
#!/usr/bin/python # # Author: <NAME> (<EMAIL>) # Date: 19th May 2016 # Fusion Tables API: # https://developers.google.com/resources/api-libraries/documentation/fusiontables/v2/python/latest/index.html """ Includes functions to integrate with Google Fusion Tables. The results and implementation is based on the API provi...
# Copyright 2021-2022 <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, ...
from funcparserlib.parser import skip from funcparserlib.parser import some from funcparserlib.parser import forward_decl from funcparserlib.parser import finished from funcparserlib.parser import NoParseError from funcparserlib.lexer import make_tokenizer from funcparserlib.lexer import LexerError import itertools fr...
""" Handles logging in/registering/editing a user account """ from flask import ( flash, request, session, render_template, current_app, redirect, url_for, abort, ) import flask_login from sqlalchemy.exc import IntegrityError from is_safe_url import is_safe_url from muffin_shop.helpers.m...
import numpy as np from sympy import sin, Abs from devito import (Grid, Inc, Operator, Function, SubDomain, Eq, SubDimension, ConditionalDimension, switchconfig) from devito.tools import memoized_meth __all__ = ['Model'] def initialize_damp(damp, nbpml, spacing, mask=False): """ Initial...
import random import math import csv import pickle import os import numpy as np from .helpers.transforms import is_valid_vertical_offset, deg2rad controller_dir = os.path.dirname(os.path.realpath(__file__)) TEST_CASES_PKL = os.path.join(controller_dir, "test_cases/test_cases.pkl") TEST_CASES_CSV = os.path.join(contr...
#!/usr/bin/bash python import argparse import os import sys import urllib.request import urllib.error from colours import TerminalColours from concurrent.futures import as_completed, ThreadPoolExecutor from http.client import HTTPMessage from socket import timeout from typing import Callable, List from output import...
import argparse import sys from tqdm import tqdm import json import subprocess import os import random import numpy as np import torch from sklearn.metrics import (roc_auc_score, auc, precision_recall_curve, r2_score, accuracy_score, log_loss) # optimization goal for various metrics METRI...
from functools import update_wrapper from django.conf.urls import url from django.core.paginator import Paginator from django.http import HttpResponseRedirect from django.shortcuts import get_object_or_404 from django.urls import reverse from django.utils.encoding import escape_uri_path, iri_to_uri from django.utils.t...
"""Tools for gridding widgets History: 2003-05-06 ROwen Adapted from ChangedGridder. 2004-05-18 ROwen Modified _StatusConfigGridSet._makeChangedWdg to eliminate two unused args (colSpan and sticky). 2004-08-11 ROwen Renamed StatusConfigGridSet->_StatusConfigGridSet. De...
# Copyright 2019 The Sonnet Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable l...
# Copyright (c) 2019 UAVCAN Consortium # This software is distributed under the terms of the MIT License. # Author: <NAME> <<EMAIL>> """ Publishes ``uavcan.node.Heartbeat`` periodically and provides a couple of basic auxiliary services; see :class:`HeartbeatPublisher`. """ import enum import time import typing import...
# ***** BEGIN GPL LICENSE BLOCK ***** # # # 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 License, or (at your option) any later version. # # This program is distribute...
import numpy as np import matplotlib.pyplot as plt import matplotlib.patches as mpatches from scipy import linalg as la from matplotlib import cm from matplotlib.ticker import LinearLocator, FormatStrFormatter from cycler import cycler #FUNCAO CONTINUA def potv(xa,multi,lw): x=abs(xa)/lw return mu...
#!/usr/bin/python3 """ DHT_publish_AWS ##Copyright 2016 <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...
# Visualizations for debugging and Tensorboard import matplotlib import socket if socket.gethostname() != 'arch': matplotlib.use('Agg') import matplotlib.pyplot as plt import numpy as np import io import tensorflow as tf from matplotlib.patches import Circle from matplotlib.patches import Patch # Keep colors consi...
# The MIT License (MIT) # # Copyright (c) 2017 <NAME> for Adafruit Industries. # # 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 #...
# Copyright 2017,2021 <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, s...
# Copyright 2015-2016 <NAME> and The University of British Columbia # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # Unless required by appli...
from quex.input.setup import NotificationDB from quex.input.code.base import SourceRef import quex.engine.misc.error as error from quex.engine.misc.file_operations import get_file_content_or_die, \ open_file_or_die from qu...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # package documentation build configuration file, created by # sphinx-quickstart on Tue Jun 6 20:04:57 2017. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # au...
from tkinter import * import subprocess # Colors # b9e7f0 # 4fadb5 # 71cccc # 9adde1 # e2f2f7 # ffffff # dbc7b3 def disableCloseButton(): pass mainWindowFrame = Tk() mainWindowFrame.title('Enigma') mainWindowFrame.geometry('1920x1080') mainWindowFrame.resizable(0, 0) # mainWindowFrame.overrideredirect(True) #...
import numpy as np from PIL import Image import json import open3d as o3d import cv2 def ply_vtx(path): f = open(path) assert f.readline().strip() == "ply" f.readline() f.readline() N = int(f.readline().split()[-1]) while f.readline().strip() != "end_header": continue pts = [] f...
import json import web import six import re import os import urllib.parse as urlparse from werkzeug.exceptions import BadRequest, MethodNotAllowed from urllib.parse import unquote from .utils import props from .init_subclass_meta import InitSubclassMeta from graphql import Source, execute, parse, validate from graph...
'''The framework module contains the logic used in building the graph and inferring the order that the nodes have to be executed in forward and backward direction. Based on FrEIA (https://github.com/VLL-HD/FrEIA)''' import torch.nn as nn from torch.autograd import Variable import FrEIA.dummy_modules as dummys clas...
import csv import io import logging import os from collections import OrderedDict from functools import partial from typing import ( TYPE_CHECKING, Any, Callable, Dict, Generator, List, Optional, ) from funcy import cached_property, first, project from dvc.exceptions import DvcException fr...
#RPi Control Algorithm import RPi.GPIO as GPIO import time #Setup GPIO.setwarnings(False) GPIO.setmode(GPIO.BCM) GPIO.setup(21,GPIO.IN,pull_up_down=GPIO.PUD_DOWN) #Status Input STATUS_IN=21 GPIO.setup(20, GPIO.OUT) #Power Direction Output POWER_DIRECTION=20 GPIO.setup(16, GPIO.OUT) #Power Magnitude Output POWER_MAG_6=1...
import sys from PySide6.QtCore import Qt, QTimer, QSettings, QThread, QRegularExpression from PySide6.QtGui import QIcon, QAction, QPixmap, QIntValidator, QRegularExpressionValidator from PySide6.QtWidgets import QApplication, QSystemTrayIcon, QMenu, \ QLabel, QWidgetAction, QWidget, QHBoxLayout, QMessageBox, QForm...
# -*- coding: utf-8 -*- """ fix alpha blending of font_control =================================== """ # import standard libraries from operator import sub import os from pathlib import Path from colour.models.cie_lab import Lab_to_LCHab # import third-party libraries import numpy as np from colour import LUT3D, RGB_...
from logging import Logger, StreamHandler, basicConfig, getLogger from typing import List, Optional, Union from .api.models.channel import Channel from .api.models.guild import Guild from .api.models.member import Member from .api.models.message import Embed, Message, MessageInteraction, MessageReference from .api.mod...
#!/usr/bin/env python # from __future__ import division import torch import math import random from PIL import Image, ImageOps, ImageEnhance import numbers import torchvision.transforms.functional as F import numpy as np class RandomCrop(object): """Crop the given PIL Image at a random location. Args: ...
# Pygcurse Maze # By <NAME> <EMAIL> # Maze Generation code by <NAME> # This program is a demo for the Pygcurse module. # Simplified BSD License, Copyright 2011 <NAME> import pygcurse, pygame, sys, random, time from pygame.locals import * BLUE = (0, 0, 128) YELLOW = (255, 255, 0) GREEN = (0, 255, 0) BLACK = (0,0,0) R...
######################################################################## # Software License Agreement (BSD License) # # Copyright (c) 2012, <NAME>, Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions ...
import os import warnings from itertools import tee from copy import copy from collections import namedtuple import numpy as np import pybullet as p from pybullet_planning.interfaces.env_manager.pose_transformation import get_distance from pybullet_planning.utils import MAX_DISTANCE, EPS, INF from pybullet_planning.in...
from .remoteproxy import RemoteEventHandler, ClosedError, NoResultError, LocalObjectProxy, ObjectProxy import subprocess, atexit, os, sys, time, random, socket, signal import multiprocessing.connection from pyqtgraph.Qt import USE_PYSIDE try: import cPickle as pickle except ImportError: import pickle __all__ =...
import tfnn from tfnn.body.layer import Layer class PoolingLayer(object): def __init__(self, pooling='max', strides=(2, 2), ksize=(2, 2), padding='SAME', name=None): self.pooling = pooling self.strides = strides self.ksize = ksize self.padding = padding self.name = name ...
import argparse import concurrent.futures import json import math import os import time import MySQLdb import requests from cfg import Config from itertools import zip_longest def grouper(iterable, n, fill_value=None): args = [iter(iterable)] * n return zip_longest(*args, fillvalue=fill_value) def debug(obj...
import numpy as np import sys import tensorflow as tf import cv2 import time import sys from .utils import cv2_letterbox_resize, download_from_url import zipfile import os @tf.function def transform_targets_for_output(y_true, grid_y, grid_x, anchor_idxs, classes): # y_true: (N, boxes, (x1, y1, x2, y2, class, best...
from datetime import datetime import re from bravado.exception import HTTPBadGateway, HTTPGatewayTimeout, HTTPServiceUnavailable from celery import shared_task import feedparser from ics import Calendar import requests import pytz from django.utils.html import strip_tags from allianceauth.services.hooks import get_ext...
# # Copyright (c) 2017, Massachusetts Institute of Technology 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 retain the above copyright notice, this # list ...
from __future__ import print_function import numpy as np import pandas as pd import inspect import os import time from . import Model from . import Utils as U #------------------------------ #FINDING NEAREST NEIGHBOR #------------------------------ def mindistance(x,xma,Nx): distx = 0 mindist = 1000000 * U.P...
import argparse import glob import os import re from enum import Enum from math import ceil, sqrt from pathlib import Path from PIL import Image from fonts.ttf import SourceSansProSemibold as DefaultFont try: from importlib import metadata except ImportError: # on Python <3.8 use importlib-metadata package ...
''' Aggregate experiment data - Experiment: AvidaGP L9 SUMMARY FILES - experiment - config + summary(evaluation) + systematics + summary(world summary) - world - task ''' import argparse, os, sys, errno, csv, json from scipy.stats import entropy run_identifier = "RUN_" # String that identifies a run directory d...
from termcolor import colored class OverlapError(Exception): pass class Box: # constructor can either create a cube from the string in the input, or from a list representing a cube def __init__(self, l): def splitinaTOR(s): x = s.split("=")[1].split("..") return (in...
# from flask import render_template, redirect, url_for,abort,request # from . import main # from flask_login import login_required,current_user # from ..models import User,Blog,Comment # from .forms import UpdateProfile,BlogForm,CommentForm # from .. import db,photos # @main.route('/') # def index(): # quote =Blog...
# # # The Multiverse Platform is made available under the MIT License. # # Copyright (c) 2012 The Multiverse Foundation # # 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 restri...
import copy import errno import os import logging import math import torch from torch import nn import torch.nn.functional as F from torch.nn.parallel import DistributedDataParallel from .helper import TensorBoardWriter from .linear_eval import iter_eval_epoch, linear_eval_online, linear_eval_offline from data import...
# http://developer.empatica.com/windows-streaming-server-commands.html # General Message Structure # # Messages are ASCII strings terminated with a newline (in Windows '\r\n') # character and encoded with UTF-8. Some commands have parameters, # which are separated by spaces. # # Client requests are in the following fo...
#!/usr/bin/env python3 import flask import os from PIL import Image, ImageFilter import hashlib import FileMimetypes as mime app = flask.Flask(__name__) app.jinja_env.trim_blocks = True RELEASE_VERSION = '1.0.0' app.config['APPLICATION_NAME'] = 'AutoGalleryIndex' app.config['ROW_ITEMS_SHORT'] = 3 app.config['ROW_I...
import logging import logging as logger from datetime import datetime from functools import wraps import krakenex import pandas from pandas import DataFrame from pykrakenapi import KrakenAPI from krakee import OrderBuilder from krakee.api import PrettyNames from krakee.api import utils from krakee.types.AssetDataFram...
import numpy as np import random import copy from collections import namedtuple, deque from models import Actor, Critic from noise import NoiseReducer import torch import torch.nn.functional as F import torch.optim as optim BUFFER_SIZE = int(1e5) # replay buffer size WEIGHT_DECAY = 0 # L2 weight decay device...
"""Define docutils elements. This module intentionally does not import anything from sphinx. References: - https://docutils.sourceforge.io/docs/howto/rst-directives.html """ import re from string import Formatter from typing import TYPE_CHECKING, Any, Dict, List, Optional, Tuple from docutils import nodes from docut...
#!/usr/bin/env python ''' Filename : VCFscreen_subset.py Author : <NAME> Email : <EMAIL> Date created : 12/17/2019 Date last modified : 12/17/2019 Python version : 2.7 ''' import sys import os import argparse import cyvcf2 from collections import defaultdict # if VCFscreen not in PYTHONPATH, make sure it is #VCFSCR...
from transformers import (AutoModelForTokenClassification, AutoModelForSequenceClassification, TrainingArguments, AutoTokenizer, AutoConfig, Trainer) from biobert_ner.utils_ner import (con...
#!/usr/bin/env python3 # # Advent of Code 2020 - day 17 # from pathlib import Path from collections import defaultdict INPUTFILE = "input.txt" SAMPLE_INPUT = """ .#. ..# ### """ NEIGHBORS = [ (0, 0, -1), (0, 0, 1), (0, -1, 0), (0, -1, -1), (0, -1, 1), (0, 1, 0), (0, 1, -1), (0, 1, ...
import numpy as np import random import copy class Environment(): def __init__(self, agents, n_players=4, tiles_per_player=7): self.tiles_per_player = tiles_per_player self.hand_sizes = [] self.n_players = n_players self.agents = agents self.pile = generate_tiles() for agent in agents: for i in range...
"""Python package treeplot vizualizes a tree based on a randomforest or xgboost model.""" # -------------------------------------------------- # Name : treeplot.py # Author : E.Taskesen # Contact : <EMAIL> # github : https://github.com/erdogant/treeplot # Licence : See Licences # --------------...
import numpy as np import torch import torch.nn.functional as F from maskrcnn_benchmark.modeling.utils import cat from maskrcnn_benchmark.structures.bounding_box import BoxList from siammot.utils import registry from .feature_extractor import EMMFeatureExtractor, EMMPredictor from .track_loss import EMMLossCom...
import numpy as np import scipy.signal from tqdm import tqdm possible_motion_estimation_methods = ['decentralized_registration', ] def init_kwargs_dict(method, method_kwargs): # handle kwargs by method if method == 'decentralized_registration': method_kwargs_ = dict(pairwise_displacement_method='con...
import csv import io import os import uuid from datetime import datetime, timezone from Levenshtein import distance from requests import Session from requests.auth import HTTPBasicAuth # or HTTPDigestAuth, or OAuth1, etc. from zeep import Client from zeep.transports import Transport from dotenv import loa...
import gensim import numpy as np import pandas as pd import psycopg2 import re import os import warnings; warnings.filterwarnings('ignore') """Review2Vec (R2V) is the second type of model we designed for Groa. We trained Gensim's Doc2Vec word embedding model on documents containing all the reviews a user has written ...
# Authors: <NAME> <<EMAIL>> # <NAME> <<EMAIL>> # <NAME> <<EMAIL>> # <NAME> <<EMAIL>> # # License: BSD (3-clause) from mne_connectivity.io import read_connectivity import numpy as np import pytest from numpy.testing import (assert_allclose, assert_array_equal, asser...
"""The :mod:`search` module defines algorithms to search for Push programs.""" from abc import ABC, abstractmethod from typing import Union, Tuple, Optional import numpy as np import math from functools import partial from multiprocessing import Pool, Manager from pyshgp.push.program import ProgramSignature from pysh...
import json from unittest.mock import Mock, patch import pytest from error.stampifier_error import BadRequestError from summarization.web_entity_detection import ImageDescriptionRetriever def mocked_requests_post(*args, **kwargs): json_data = json.loads(kwargs["data"]) label = "" entity = "" has_cap...
import youtube_dl, spotipy, os, requests, threading, queue from spotipy.oauth2 import SpotifyOAuth from mutagen.mp3 import MP3 from mutagen.id3 import ID3, APIC, TIT2, TPE1, TALB, TRCK from mutagen.id3 import ID3NoHeaderError from youtube_dl.utils import DownloadError from requests.exceptions import HTTPError number_o...
import copy from math import floor from tkinter import (HORIZONTAL, Canvas, N, PhotoImage, S, IntVar, StringVar, Tk, Toplevel, X, colorchooser, messagebox) from tkinter.ttk import (Button, Entry, Frame, Label, Separator, Radiobutton) from models import * from controllers import dijkstra def mou...
# coding=utf-8 import argparse import os import time from math import ceil import caffe import cv2 import numpy as np parser = argparse.ArgumentParser() parser.add_argument('--caffe_prototxt_path', default="model/RFB-320/RFB-320.prototxt", type=str, help='caffe_prototxt_path') parser.add_argument('--caffe_model_path'...
import csv import shutil from mock import patch from django.core.management import call_command from django.test import TestCase from dmd.models import AMP, AMPP, VMP, VMPP from dmd.management.commands.import_dmd import get_common_name from frontend.models import ImportLog, Presentation, NCSOConcession from openpres...
import filecmp import os import pathlib import pytest from lib import _rewrite from _exceptions import NoSolutionError import main def confirm(output): compare_to = "modified_file.py" try: assert filecmp.cmp(output, compare_to) except AssertionError as e: with open(compare_to) as f: ...
# ----------------------------------------------------------------------------- # Copyright (c) 2009-2016 <NAME>. All rights reserved. # Distributed under the (new) BSD License. # ----------------------------------------------------------------------------- """ A framebuffer is a collection of buffers that can be used ...
from __future__ import unicode_literals, division, absolute_import from builtins import * # pylint: disable=unused-import, redefined-builtin import logging from collections import MutableSet from datetime import datetime from sqlalchemy import Column, Unicode, Integer, ForeignKey, func, DateTime from sqlalchemy.orm ...
#!/usr/bin/env python # -*- coding: utf-8 -*- """Generates one ISO14443-A anti-collision process "by-hand" """ from __future__ import print_function import nfc MAX_FRAME_LEN = 264 abtRawUid = bytes(12) abtAtqa = bytes(2) abtAts = bytes(MAX_FRAME_LEN) szAts = 0 szCL = 1 quiet_output = False force_rats = False timed...
'''This is a module that tries to use emcee to solve SNooPy models. The SN object should have all the necessary ingredients. All that is left is to define prior probabilities.''' import emcee import numpy as np from scipy.optimize import minimize import types,os gconst = -0.5*np.log(2*np.pi) def builtin_priors(x, st...
from reprojection import runSuperGlueSinglePair,image_pair_candidates, runSIFTSinglePair from ray_dist_loss import preprocess_match, proj_ray_dist_loss_single import torch import numpy as np import os from random import random import numpy as np import torch import torchvision.transforms as TF import matplotlib.pypl...
import matplotlib.pyplot as plt import numpy as np from mpl_toolkits.mplot3d import Axes3D from sklearn import decomposition import scipy.signal import os import pandas as pd from skimage.transform import resize def get_mean(signal: np.ndarray, axis=0): return signal.mean(axis=axis) def get_std_dev(signal: np.nd...
""" Utilities not directly related to formulas or CNFs """ import logging import math import os import re import shutil import subprocess import tempfile from typing import TYPE_CHECKING, Dict, Set, Tuple, Iterable from dsharpy.preprocess import preprocess_c_code from pathlib import Path from tempfile import NamedTem...
from numpy import argsort, diff, max, where from numpy import abs as np_abs from numpy import mean as np_mean from numpy import median as np_median from numpy import var as np_var from numpy import min as np_min from numpy import max as np_max import numpy as np from numpy.lib.histograms import _unsigned_subtract from ...
""" Contains Marktlokation class and corresponding marshmallow schema for de-/serialization """ import attr from marshmallow import fields from marshmallow_enum import EnumField # type:ignore[import] from bo4e.bo.geschaeftsobjekt import Geschaeftsobjekt, GeschaeftsobjektSchema from bo4e.bo.geschaeftspartner import G...
from sklearn.feature_extraction.text import CountVectorizer from nltk.corpus import names from nltk.stem import WordNetLemmatizer import glob import os import numpy as np file_path = 'enron1/ham/0007.1999-12-14.farmer.ham.txt' with open(file_path, 'r') as infile: ham_sample = infile.read() print(ham_sample) fil...
from collections import OrderedDict from django.contrib import messages from django.contrib.auth import get_user_model from django.contrib.auth.decorators import login_required from django.db.models import Count, Q from django.http import HttpResponseRedirect from django.shortcuts import get_object_or_404, redirect, r...