text stringlengths 6.04k 39.5k |
|---|
"""Data analyzation metrics
Each algorithm works on a set of handwritings. They have to be applied like
this:
>>> import hwrt.data_analyzation_metrics
>>> from hwrt.handwritten_data import HandwrittenData
>>> data_json = '[[{"time": 123, "x": 45, "y": 67}]]'
>>> a = [{'is_in_testset': 0,
... 'formula_id': "31L",
.... |
"""
@author: <NAME> (University of Sydney)
-------------------------------------------------------------------------
AMICAL: Aperture Masking Interferometry Calibration and Analysis Library
-------------------------------------------------------------------------
Function related to data cleaning (ghost, background c... |
#!/usr/bin/env python
# encoding: utf-8
import os
import re
import sys
import argparse
import glob
import logging
from numpy import nan as NaN
import pandas as pd
import shutil
import zipfile
def get_arguments():
parser = argparse.ArgumentParser(
formatter_class=argparse.RawDescriptionHelpFormatter,
... |
from win32ctypes.pywin32 import win32api
import win32.lib.win32con as win32con
import win32.win32gui as win32gui
from wx.lib.delayedresult import startWorker
import PIL
import wx
import wx.aui as aui
import wx.adv as adv
import wx.lib.newevent
import os
import threading
import datetime
import random
import mouse
from s... |
# -*- coding: utf-8 -*-
"""
Tera Python SDK. It needs a libtera_c.so
TODO(taocipian) __init__.py
"""
from ctypes import CFUNCTYPE, POINTER
from ctypes import byref, cdll, string_at
from ctypes import c_bool, c_char_p, c_void_p
from ctypes import c_int32, c_int64, c_ubyte, c_uint64
class ScanDescriptor(object):
... |
#! /usr/bin/python3
#
# Copyright (c) 2021 Intel Corporation
#
# SPDX-License-Identifier: Apache-2.0
#
import copy
import os
import subprocess
import commonl
import ttbl
import ttbl.images
import ttbl.power
class pgm_c(ttbl.images.flash_shell_cmd_c):
"""Flash using Intel's Quartus PGM tool
This allows to fl... |
import numpy as np
import torch
import os
import sys
import re
import math
from torch.utils.data import Dataset, DataLoader
from apex import amp
from apex.parallel import DistributedDataParallel as DDP
from lamb import Lamb
#tensorboard for accuracy graphs
import tensorflow as tf
def getCombinations(inputTensor, N, c... |
import os
import requests
from bouncer import Bouncer
from flask import Flask, url_for, redirect, \
render_template, session, request, Response, \
flash, get_flashed_messages, jsonify
from flask_login import LoginManager, login_required, login_user, \
logout_user, current_user, UserMixin
from oauthlib.oaut... |
from collections import defaultdict
import functools
import json
import logging
import re
import subprocess
import threading
import time
import os
from .abstract_connection import AbstractConnection, RcloneException
class RcloneConnection(AbstractConnection):
def __init__(self):
self._job_status = default... |
#
# GitHubNeo.py
#
# note: i tried using bulbs, which would be easier to
# migrate to other tinkerpop graph engines, but had
# trouble authenticating
#
#
"""
package oompa.tracking.github
experiments with working on github graphs in neo
uses py2neo
TODO: i think bulb seems to have better object modeling... |
from __future__ import annotations
import re
from datetime import datetime, timezone
from decimal import Decimal, InvalidOperation
from typing import TYPE_CHECKING, Iterable, List, Mapping, Optional, Sequence, Union
import flask_babel
from babel import numbers
from dateutil.relativedelta import relativedelta
from fla... |
"""Here are defined Python functions of views.
Views are binded to URLs in :mod:`.urls`.
"""
import datetime
import hashlib
import json
import os
from distutils.version import LooseVersion
from json.encoder import JSONEncoder
from urllib.parse import quote
from django import forms
from django.conf import settings
from... |
import ctypes
import ida_ida
import ida_funcs
import ida_graph
import ida_idaapi
import ida_kernwin
import ida_hexrays
from PyQt5 import QtWidgets, QtGui, QtCore, sip
from lucid.ui.sync import MicroCursorHighlight
from lucid.ui.subtree import MicroSubtreeView
from lucid.util.python import register_callback, notify_c... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import torch
import os
from modules.model import BertForSequenceClassification_tpr
from utils.data_utils import convert_examples_to_features, logger
from transformers.file_utils import PYTORCH_PRETRAINED_BERT_... |
"""
@license: MIT
@repository: https://github.com/semontesdeoca/MNPR
_
_ __ ___ _ __ _ __ _ __ ___ _ _ ___| |_ ___ _ __ ___
| '_ ` _ \| '_ \| '_ \| '__| / __| | | / __| __/ _ \ '_ ` _ \
| | | | | | | | | |_) | | \__ \ |_| \__ \ || __/ | | | | ... |
#
# Copyright 2018 British Broadcasting Corporation
#
# 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... |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
"""
Module that contains base save widget for data items
"""
from __future__ import print_function, division, absolute_import
import os
import logging
import traceback
from Qt.QtCore import Signal, QSize
from Qt.QtWidgets import QSizePolicy, QFrame, QDialogButtonBox, Q... |
import os
from django.contrib.gis.db import models
from hrp.ontologies import *
# from hrp.ontologies import ITEM_TYPE_VOCABULARY, HRP_COLLECTOR_CHOICES, \
# HRP_COLLECTING_METHOD_VOCABULARY, HRP_BASIS_OF_RECORD_VOCABULARY, HRP_COLLECTION_CODES
from django.contrib.gis.geos import Point
import projects.models
cl... |
import collections
import os
from itertools import product
from pathlib import Path
from typing import Dict, Iterator, List, NamedTuple, Optional, OrderedDict, Sequence, Tuple, Union
import numpy as np
import xarray as xr
from tqdm import tqdm
from bioimageio.core import image_helper
from bioimageio.core import load_... |
# Standalone GUI Applet for creating levels
import os
os.environ['pg_HIDE_SUPPORT_PROMPT'] = "hide"
import pygame as pg
from multiprocessing import Process
from ui_helpers import *
from levels import levels, read_level, write_level, LEVELS_DIR
from main import play_level
from engine import Level, board_copy
# --- ... |
#!/usr/bin/env python
import asyncio
import io
import http.server
import json
import numpy
import os
import queue
import re
import sys
import threading
import websockets
from obspy.io.quakeml.core import Pickler
from obspy.core.stream import Stream
from obspy.core.utcdatetime import UTCDateTime
from obspy.core.event.... |
import argparse
import os
import mlflow
import numpy as np
import pandas as pd
import torch
import torch.optim as optim
from matplotlib import pyplot as plt
from matplotlib.backends.backend_agg import FigureCanvasAgg
from mlflow import log_metric, log_param, get_artifact_uri
from skimage.io import imsave
from sklearn.m... |
from sportsdb_setup import HGETestSetup, HGETestSetupArgs
from run_hge import HGE
import graphql
import multiprocessing
import json
import os
import docker
import ruamel.yaml as yaml
import cpuinfo
import subprocess
import threading
import time
import datetime
from colorama import Fore, Style
from plot import run_dash_... |
from common.numpy_fast import clip, interp
from selfdrive.car.tesla.values import CruiseButtons
from selfdrive.config import Conversions as CV
import time
from common.params import Params
from cereal import car
ACCEL_MAX = 0.6 #0.6m/s2 * 36 = ~ 0 -> 50mph in 6 seconds
ACCEL_MIN = -3.5
_DT = 0.05 # 20Hz in our case,... |
import argparse
import os
import sys
import time
import warnings
from ast import literal_eval
warnings.filterwarnings("ignore")
import IPython
import matplotlib as mpl
mpl.use('Agg')
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import torch
import context
from context import utils
import uti... |
import argparse
import csv
import os
import signal
import logging
from datetime import datetime
from decimal import Decimal
import pandas as pd
import progressbar
import sqlite3
import sys
import time
from pathlib import Path
from dhalsim.parser.file_generator import BatchReadmeGenerator, GeneralReadmeGenerator
from ... |
#!/usr/bin/env python
from prometheus_client import start_http_server, Summary
import random
import argparse
import time
from prometheus_client import Counter
from prometheus_client import Gauge
from prometheus_client import Summary
from prometheus_client import Histogram
import sys
import time
import json
import date... |
"""General functions for working with observations.
"""
import collections
import os
from shapely.geometry import Point
import pandas as pd
from gisutils import df2shp, project
from mfsetup.obs import make_obsname
from mfsetup.units import convert_length_units, convert_volume_units, convert_time_units
from mapgwm.utils... |
"""Convert XFL edges to SVG paths.
If you just want to convert, use `xfl_edge_to_svg_path()`. If you're interested
in how everything works, read on.
"""
# Read these links first, as there is no official documentation for the XFL
# edge format:
#
# * https://github.com/SasQ/SavageFlask/blob/master/doc/FLA.txt
# * ... |
#! /usr/env/bin python
import os
import linecache
import numpy as np
from collections import OrderedDict
from CP2K_kit.tools import call
from CP2K_kit.tools import data_op
from CP2K_kit.tools import file_tools
from CP2K_kit.tools import read_input
from CP2K_kit.tools import traj_info
from CP2K_kit.deepff import load_d... |
"""
TopView is the main Widget with the related ControllerTopView Class
There are several SliceView windows (sagittal, coronal, possibly tilted etc...) that each have
a SliceController object
The underlying data model object is an ibllib.atlas.AllenAtlas object
TopView(QMainWindow)
ControllerTopView(PgImageCon... |
#!/usr/local/bin/python
from sprint import sprint as print
import string
import uuid
import basics
import config
import useful
# ------ user editor
def print_users(pif):
table_info = pif.dbh.table_info['user']
entries = []
for user in pif.dbh.fetch_users():
user['user_id'] = '<a href="user.cgi... |
# Copyright (C) 2016 <NAME> <<EMAIL>>
# Released under the terms of the BSD license.
import os
import re
import sys
import click
import string
import datetime
import subprocess
from . import __version__
from .remote import get_remote
from .crypto import fernet_encrypt, fernet_decrypt, sha512_hash, digest
from .forma... |
#!/usr/bin/env python3
"""Application for managing the PyLith build environment.
"""
import sys
import os
import argparse
import subprocess
import configparser
class Package():
"""Base class for software package.
"""
NAME = None
CLONE_RECURSIVE = False
def __init__(self, config):
if not ... |
from fipu_face import retina_face as rf
import binascii
import time
from fipu_face.utils import *
from fipu_face.img_utils import *
from exceptions.image_exception import *
from fipu_face.img_config import *
from fipu_face.segmentation.bg_segmentation import get_non_white_bg_pct
# from fipu_face.facial_landmarks.emoti... |
"""
This module exrtacts features from the data, saves the feauters
from all measurements to global results file and creates
one file for every sensor with all measurements.
:copyright: (c) 2022 by <NAME>, Hochschule-Bonn-Rhein-Sieg
:license: see LICENSE for more details.
"""
from pyexpat import features
import pan... |
#!/usr/bin/env python3
# coding: utf-8
__author__ = 'ChenyangGao <https://chenyanggao.github.io/>'
__version__ = (0, 0, 3)
__all__ = ['TkinterXMLConfigParser']
# Reference:
# - [python > docs > tkinter](docs.python.org/3/library/tkinter.html)
# - [Tk tutorial](https://tk-tutorial.readthedocs.io/en/latest/)
# ... |
# ---
# jupyter:
# jupytext:
# text_representation:
# extension: .py
# format_name: light
# format_version: '1.5'
# jupytext_version: 1.11.3
# kernelspec:
# display_name: Python 3
# name: python3
# ---
# + [markdown] id="view-in-github" colab_type="text"
# <a href="https://colab... |
#!/usr/bin/python
# Python Dependencies
import os
from datetime import datetime
# Python 3rd Party dependencies
from werkzeug.utils import secure_filename
# Flask dependecies
from flask import Flask, flash, render_template, request, redirect, url_for
import flask_login
# SQL alchemy dependencies
from sqlalchemy imp... |
'''mpi4py wrapper that allows an ensemble of serial applications to run in
parallel across ranks on the computing resource'''
import argparse
from collections import defaultdict
import os
import sys
import logging
import random
from subprocess import Popen, STDOUT, TimeoutExpired
import shlex
import signal
import time
... |
# Copyright 2018 D-Wave Systems 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... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import numpy as np
import optparse
import os
import re
import sys
import vtk
from multiprocessing import Process
import parse_imx
RADIUS = 3 # For Open and Gauss
SCALE = 50.0 # For Rasterization
class RepairMeshParser(optparse.OptionParser):
def __init__(self):
... |
import csv
from collections import deque
from dataclasses import dataclass
from decimal import Decimal
from datetime import date
import io
import itertools
from typing import List, Optional
from dateutil.parser import parse as dateparse
from dateutil.relativedelta import relativedelta
from casparser.exceptions import... |
# Copyright (c) 2016 <NAME>
# 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
# to use, copy, modify, merge, publish, distribute, s... |
import os
import numpy as np
import pandas as pd
from scipy import sparse as sp
from typing import Callable, List, Tuple, Dict
from os.path import join
from . import utils, process_dat
from . import SETTINGS_POLIMI as SETTINGS
os.environ['NUMEXPR_MAX_THREADS'] = str(SETTINGS.hyp['cores'])
pd.options.mode.chained_ass... |
#/***********************************************************************
# * Licensed Materials - Property of IBM
# *
# * IBM SPSS Products: Statistics Common
# *
# * (C) Copyright IBM Corp. 1989, 2020
# *
# * US Government Users Restricted Rights - Use, duplication or disclosure
# * restricted by GSA ADP Schedule Co... |
# (C) Copyright 1996-2018 ECMWF.
#
# This software is licensed under the terms of the Apache Licence Version 2.0
# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
# In applying this licence, ECMWF does not waive the privileges and immunities
# granted to it by virtue of its status as an intergov... |
import os
import requests
import time
import json
import io
import numpy as np
import pandas as pd
import paavo_queries as paavo_queries
from sklearn.linear_model import LinearRegression
import statsmodels.api as sm
## NOTE: Table 9_koko access is forbidden from the API for some reasons.
# url to the API... |
#!/usr/bin/env python3.6
# -*- mode: python -*-
# =============================================================================
# @@-COPYRIGHT-START-@@
#
# Copyright (c) 2020 of Qualcomm Innovation Center, Inc. All rights reserved.
#
# @@-COPYRIGHT-END-@@
# ===========================================================... |
##+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#Created by: <NAME>
#BE department, University of Pennsylvania
##+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
import numpy as np
import nibabel as nib
import os
from tqdm import tqdm
from functools import partial
i... |
import base64
import hashlib
import inspect
import logging
import os
import random
import string
import sys
import textwrap
import re
import uuid
import warnings
from datetime import datetime
from secrets import token_bytes
from time import sleep
from urllib.parse import urlencode, quote_plus, unquote_plus
from d... |
"""
Graph exploration module.
"""
import itertools
import time
from qas.wikidata import Wikidata, NoSPARQLResponse
MAX_PATH_LENGTH = 5
DISABLE_PARALLEL = True
RETRY_PARALLEL_SPARQL = False
class Path(object):
def __init__(self, path, config, item_from, item_to):
self.length = len(path) // 2 + 1
... |
from copy import deepcopy
import os
import uuid
import pyparsing
from lxml import etree
from resources.sbtabpy import modelSystem
OUTPUT_NAME = "test_model.xml"
######################
######################
##
## Utility Functions
##
######################
######################
def genID():
... |
import torch
import torch_quiver as torch_qv
import random
import numpy as np
import time
from typing import List
from quiver.shard_tensor import ShardTensor, ShardTensorConfig, Topo
from quiver.utils import reindex_feature
import torch.multiprocessing as mp
from torch.multiprocessing import Process
import os
import sy... |
"""
This module contains methods for creating a game H2H chart.
"""
import matplotlib.pyplot as plt
import numpy as np # standard scientific python stack
import pandas as pd # standard scientific python stack
from scrapenhl2.manipulate import manipulate as manip
from scrapenhl2.scrape import schedules, team_info, p... |
# coding: utf-8
from typing import List, Tuple, Dict
import torch
import logging
import sys
import os
import copy
import json
import collections
import subprocess
from tqdm import tqdm, trange
from torch.utils.data import TensorDataset, DataLoader, RandomSampler, SequentialSampler
from torch.utils.data.distributed impo... |
"""BrandComparator2.ipynb
Server Link: https://colab.research.google.com/drive/15x-yWFGtF57rOCfi9tqEONlYWeGlkoml
[Colab Notebook with Explanation](https://colab.research.google.com/drive/1dYH5PAausru6lQy1dh5-aGC9S9DXO_bV?usp=sharing)
[Anvil App](https://NPFLBAAEVOXXUYZK.anvil.app/QED54JFBPJMZBQPITDWWVL75)
# Inst... |
# !/usr/bin/env python
# coding:utf-8
# Author:XuPengTao
# Date: 2020/3/14
from ssd.layers import L2Norm
import torch.nn.functional as F
import torch.nn as nn
import torch
from ssd.modeling import registry
import os
import quantization.WqAq.dorefa.models.util_wqaq as dorefa
import quantization.WqAq.IAO.models.util_wqaq... |
from PySide6.QtCore import Qt, QThread, Signal, QPoint, QRect, QLocale, QTranslator, QCoreApplication, QThreadPool, \
QObject, QRunnable
from PySide6.QtGui import QCursor, QPixmap, QIcon, QFont
from PySide6.QtWidgets import QApplication, QMessageBox
from gui_about import Ui_AboutWindow
from gui_main import Ui_MainW... |
from dipsim import multiframe, util
import numpy as np
import matplotlib.pyplot as plt
import matplotlib
import matplotlib.patches as patches
import os; import time; start = time.time(); print('Running...')
import matplotlib.gridspec as gridspec
# Main input parameters
col_labels = ['Geometry\n (NA = 0.6, $\\beta=80{}... |
#!/usr/bin/env python
# Superficies de revolucion
import OpenGL
OpenGL.ERROR_ON_COPY = True
from OpenGL.GL import *
from OpenGL.GLU import gluOrtho2D
from OpenGL.GLUT import *
import sys, time
from sympy.core.sympify import sympify
from sympy import *
from OpenGL.constants import GLfloat
from OpenGL.GL.ARB.multisampl... |
from dataclasses import dataclass
import netCDF4
import numpy as np
from openamundsen import constants, errors, fileio, util
import pandas as pd
import pandas.tseries.frequencies
import pyproj
import xarray as xr
_ALLOWED_OFFSETS = [
pd.tseries.offsets.YearEnd,
pd.tseries.offsets.YearBegin,
pd.tseries.off... |
from archive.groups import Group
from archive.teams import Team
from logging import Logging
from itertools import cycle
import datetime
from copy import deepcopy
from sys import exit
import collections
from os import path, getcwd
class Tournament:
"""
Store (and initialise) dictionary and storage structures
... |
# -*- coding: utf-8 -*-
from random import Random
#from core.dataloader import DataLoader
from torch.utils.data import DataLoader
import numpy as np
from math import *
import logging
from scipy import stats
import numpy as np
from pyemd import emd
from collections import OrderedDict
import time
import pickle, random
fr... |
import numpy as np
from .citations import cvisb, kgh
def binarize(val):
if((val == val) & (val is not None)):
if(val == 0):
return(False)
elif(val == 1):
return(True)
elif(val.lower() == "yes"):
return(True)
elif(val.lower() == "no"):
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#######################################
#-------------------------------------#
# Module: Frontera Eficiente #
#-------------------------------------#
# Creado: #
# 20. 04. 2019 #
# Ult. modificacion: ... |
## ACL Import Module
# ACL CSV Import
# Version 5
# 2015-10-30
# we only need the datetime class & the static function strptime from datetime module
from datetime import datetime
import re
import sys
import os
import logging
# best postgresql module so far, install it "yum install python-psycopg2"
import psycopg2
im... |
from collections import (
OrderedDict,
)
from unittest.mock import Mock
import pandas as pd
from datetime import (
datetime,
)
from fireant import *
from fireant.slicer.references import ReferenceType
from fireant.slicer.totals import get_totals_marker_for_dtype
from fireant.utils import (
format_dimensio... |
"""
Plot various visualizations
"""
import sys
import json
from collections import Counter
import numpy as np
import scipy.stats as scstats
import matplotlib
matplotlib.use("agg")
import matplotlib.pyplot as plt
import matplotlib.cm as cm
import matplotlib.patches as mp
from zipteedo.util import GzipFileType, load... |
import argparse
import csv
import glob
import json
import os
import re
import time
from math import ceil
from shutil import copyfile, rmtree
from urllib.parse import urlparse
import requests
from pyproc import Lpse, __version__
from pyproc.helpers import DetilDownloader
from urllib3 import disable_warnings
from urll... |
from megastone.util import round_up
import threading
import logging
import io
import enum
import dataclasses
import abc
from megastone.errors import UnsupportedError
from megastone.mem import SegmentMemory, MemoryAccessError
from megastone.debug import Debugger, StopReason, StopType, HookType, CPUError, InvalidInsnErr... |
"""Main module."""
__authors__ = '<NAME>, <NAME>'
__version__ = '1.0'
__date__ = '9/10/2017'
import json
import os.path
import pickle
import random
import urllib
from bs4 import BeautifulSoup
from nltk.corpus import stopwords
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.feature_extracti... |
import torch
import torch.nn as nn
import torch.nn.functional as F
from torchvision.models import resnet18, vgg16_bn
import omni_torch.networks.blocks as block
import researches.img2img.probaV_SR.pvsr_module as module
class CARN(nn.Module):
def __init__(self, inchannel, filters, scale, BN=nn.BatchNorm2d, s_MSE=Fa... |
from __future__ import print_function
import argparse
import os
import platform
import time
import cv2
import h5py
import torch.optim as optim
from torch.utils.data import DataLoader
from datasets import DATASET_NAMES, TrainDataset, TestDataset, dataset_info
from losses import *
from model import DexiNed
from model_... |
# Standard imports
import keras as k
import tensorflow as tf
import numpy as np
"""
NOTE:
All functions in this file are directly adopted from continuum mechanics fundamentals
and hence do not need further introduction. In order to not inflate this file
unnecessarily with comments (and sacrificing readability), we... |
#### Usage: python3 this.py <VDJ.bed> <D.fa> <scripts_dir> <input.tlx> <output_prefix>
#### 2020-02-11, we think the default score threshold = 5 of D annotation in VDJ recombination (yyx_annotate_tlx_midD_LCS.20190116.py) may be too stringent.
#### We decide to change it to 3, and then implement another script to ... |
#!/usr/bin/env python
import sys
import os
import subprocess
import functools
import collections
# Parameters
lbann_dir = subprocess.check_output(["git", "rev-parse", "--show-toplevel"]).strip()
lbann_proto_dir = lbann_dir + "/src/proto/"
work_dir = lbann_dir + "/model_zoo/models/vram"
template_proto = l... |
from functools import lru_cache
import math
import logging
from enum import Enum
from typing import Optional, List, Tuple, Any, Union, Dict, Callable
from concurrent.futures import ThreadPoolExecutor
from io import BytesIO
import requests
import numpy as np
from google.api_core import retry
from PIL import Image
from ... |
"""
Builds wheel files for the dependencies of an app, specified in requirements.txt, into the wheels/
folder of the app repo, and updates the app's JSON config specifying any generated wheels as pip
dependencies.
NOTE: If running this script with the --repair_wheels flag, make sure the script is executed from
a manyl... |
from http import HTTPStatus
import pytest
from django import urls
from crashbin_app.models import Bin, OutgoingMessage, NoteMessage, Label
pytestmark = pytest.mark.django_db
def test_home(admin_client):
response = admin_client.get(urls.reverse("home"))
assert response.status_code == HTTPStatus.OK
asse... |
# coding=utf-8
# Copyright (c) 2021 <NAME> <<EMAIL>>. All rights reserved.
# This file is based on code by the authors denoted below and has been modified from its original version.
# Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you... |
from itertools import product
from Tables import query
from .ImageHelper import *
get_width = lambda v: int(21 + 4*(v - 1))
def get_position_info(version:int) -> list:
width = get_width(version)
info = list()
color = [
[1, 1, 1, 1, 1, 1, 1],
[1, 0, 0, 0, 0, 0, 1],
[1, 0, 1, 1, 1, 0... |
# Copyright (c) 2020, <NAME>, Honda Research Institute Europe GmbH, and
# Technical University of Darmstadt.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code mus... |
"""
Functions for explaining classifiers that use tabular data (matrices).
"""
import collections
import json
import copy
import numpy as np
import sklearn
import sklearn.preprocessing
from . import lime_base
from . import explanation
class TableDomainMapper(explanation.DomainMapper):
"""Maps feature ids to names,... |
from __future__ import absolute_import
import os.path
import argparse
import logging
import json
from six import iteritems
import numpy as np
from sklearn.model_selection import train_test_split
from sklearn.externals import joblib
from keras.models import load_model
from tensorflow.python.client import device_lib
f... |
#
# Copyright The NOMAD Authors.
#
# This file is part of NOMAD. See https://nomad-lab.eu for further info.
#
# 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/licen... |
"""
The :mod:`fatf.utils.models.models` module holds custom models.
The models implemented in this module are mainly used for used for
FAT Forensics package testing and the examples in the documentation.
"""
# Author: <NAME> <<EMAIL>>
# License: new BSD
import abc
from typing import Optional
import numpy as np
imp... |
"""
Base functionality of meshed
"""
from collections import Counter
from dataclasses import dataclass, field
from functools import partial
from typing import Callable, MutableMapping, Iterable, Union, Sized, Sequence
from i2 import Sig, call_somewhat_forgivingly
from meshed.util import ValidationError, NameValidation... |
from . import core
import io
import re
import requests
import pytz
import time
import datetime as dt
import dateutil.parser as du
import numpy as np
import pandas as pd
from typing import Tuple, Dict, List, Union, ClassVar, Any, Optional, Type
import types
class ... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# pylint: disable=invalid-name
"""Let viewers pay currency to boost currency payouts
for everyone in chat for x seconds"""
import json
import os, os.path
import operator
import time
import codecs
#---------------------------------------
# [Required] Script information
#-------... |
# Copyright (c) 2018 PaddlePaddle 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 app... |
"""
This module is the main API used to create track collections
"""
# Standard library imports
import copy
import random
import inspect
import logging
import itertools
from typing import Any
from typing import List
from typing import Union
from typing import Tuple
from typing import Callable
from dataclasses impo... |
#!/usr/bin/python
# python console for OnlyRAT
# created by : C0SM0
# imports
import os
import sys
import getpass
import random as r
from datetime import datetime
# banner for display
banner = """
_;,
... |
"""
PyAltmetric
This is a python wrapper for the Altmetric API.
For more information on the Altmetric API visit http://api.altmetric.com/.
Some pieces of this library were inspired by or derived from the altmetric api
wrapper altmetric.py which is licensed under the MIT open source license.
If you display Altmetric ... |
from bottle import (
template,
route,
redirect,
request,
)
from models import (
Article,
ArticleLinks,
Wiki,
Author,
Tag,
Metadata,
)
from peewee import SQL
from .decorators import *
from .wiki import wiki_home
from .media import image_search
from utils import Message, Error,... |
import sys
from pathlib import Path
import os
import torch
from torch.optim import Adam
import torch.nn as nn
import torch.nn.functional as F
import numpy as np
from networks.critic import Critic
from networks.actor import NoisyActor, CategoricalActor, GaussianActor
base_dir = Path(__file__).resolve().parent.parent.... |
#!/usr/bin/env python3
#-*- coding: utf-8 -*-
#
# PlayonCloud recorder
#
# update-alternatives --install /usr/bin/python python /usr/bin/python3.7 2
# sudo apt-get install chromium-chromedriver
# sudo apt-get install libxml2-dev libxslt-dev python-dev
# which python3 (make sure that path is /usr/bin/python3)
#
# Fin... |
# -*- coding: utf-8 -*-
'''
FileExplorer
============
The :class:`FileExplorer` widget is an advanced file browser. You use it
similarly to FileChooser usage.
It provides a shortcut bar with links to special and system directories.
When touching next to a shortcut in the links bar, it'll expand and show
all the direc... |
"""Module providing functions to build an init script
The :func:`mkinit` function will generate a ``/init`` script.
``do_foo()`` functions write a string performing the foo action into a
stream. This stream should be the init script.
``_fun_foo()`` functions write a string defining the foo function into a
stream. Th... |
#
# Copyright (c) 2020 Bitdefender
# SPDX-License-Identifier: Apache-2.0
#
import yaml
import struct
import os
import crc32
from options import get_options_for_os_version
from objects import CamiYAMLObject, CamiObject, CamiAtom, CamiDataTable, FilePointerException, get_all_objects
from common import IntrocoreVersion
fr... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.