text stringlengths 3.07k 22.1k |
|---|
import random
import cv2
import numpy as np
import torch
import torch.nn.functional as F
class AverageMeter(object):
"""Computes and stores the average and current value"""
def __init__(self):
self.reset()
def reset(self):
self.val = 0
self.avg = 0
self.sum = 0
sel... |
import heterocl as hcl
import numpy as np
import time
from Plots.plotting_utilities import *
from argparse import ArgumentParser
# Backward reachable set computation library
from computeGraphs.graph_3D import *
from computeGraphs.graph_4D import *
from computeGraphs.graph_5D import *
from computeGraphs.graph_6D impor... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
__all__ = [
'Action',
'ActionCollector',
'ActionProxy',
'get_action_identifier',
'group_actions',
'is_action',
'is_action_type',
'sort_actions',
]
import abc
import logging
from operator import attrgetter
from collections i... |
import codecs
import json
import os
import pickle
import random
import time
from argparse import Namespace
from collections import OrderedDict, defaultdict
import numpy as np
import torch
import torch.nn as nn
import torch.utils.data
import yaml
from torch.nn.init import xavier_uniform_
from tqdm import tqdm
import p... |
import torch
import os
import sys
proj_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
sys.path.append(os.path.join(proj_dir, "utils/Pointnet2_PyTorch/pointnet2"))
from utils.mm3d_pn2.ops.furthest_point_sample.furthest_point_sample_utils import furthest_point_sample
from utils.mm3d_pn2.ops.group_poin... |
'''
Code generator for sprite sheets.
'''
import genutil as util
from util import png
import os
Version = 7
#-------------------------------------------------------------------------------
class Sprite :
def __init__(self) :
self.name = ''
self.x = 0
self.y = 0
self.w = 0
... |
# Copyright 2020 Magic Leap, 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... |
import sys
from string import digits
from pathlib import Path
import logging
from tesserocr import PyTessBaseAPI
import numpy as np
import cv2 as cv
from PIL import Image
import pandas as pd
logging.basicConfig(filename='error.log',format='%(asctime)s %(message)s', level=logging.WARNING)
def extract_tableinformatio... |
# coding:utf-8
# --author-- lanhua.zhou
from __future__ import print_function
import os
import shutil
import logging
import datetime
import time
import maya.cmds as cmds
import zfused_api
import zfused_maya.core.record as record
import zfused_maya.core.filefunc as filefunc
import zfused_maya.node.core.alembiccache ... |
from ...exceptions.executorexceptions import CommandExecutionFailure
from ...exceptions.tardisexceptions import TardisError
from ...exceptions.tardisexceptions import TardisTimeout
from ...exceptions.tardisexceptions import TardisResourceStatusUpdateFailed
from ...interfaces.siteadapter import ResourceStatus
from ...in... |
from fixtures import *
from xprocess import ProcessStarter
def proj_root(cwd=os.getcwd()):
proj_root = cwd
if not Path(proj_root).exists():
print("POWERLOADER NOT FOUND!")
return proj_root
def get_powerloader_binary():
env_var = os.environ.get("POWERLOADER_EXE")
if env_var:
retur... |
import os.path
import re
import sys
import tarfile
# pylint: disable=unused-import,g-bad-import-order
import tensorflow.python.platform
from six.moves import urllib
import numpy as np
import tensorflow as tf
# pylint: enable=unused-import,g-bad-import-order
from tensorflow.python.platform import gfile
import h5py
imp... |
# Copyright (C) 2013-2019 DNAnexus, Inc.
#
# This file is part of dx-toolkit (DNAnexus platform client libraries).
#
# 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.a... |
#!/usr/bin/env python
#
# Author: <NAME> <<EMAIL>>
#
'''
Non-relativistic analytical nuclear gradients
'''
import time
import numpy
from pyscf import lib
from pyscf.lib import logger
from pyscf.scf import _vhf
def grad_elec(grad_mf, mo_energy=None, mo_coeff=None, mo_occ=None, atmlst=None):
mf = grad_mf._scf
... |
# -*- coding: utf-8 -*-
"""
Created on Sat Feb 24 10:12:34 2018
@author: <NAME>
Blackjack program that allows
-one player
-one split
-$1000 starting monies
-line art cards
improvements would be:
-to use a dictionary to store player ones hand insted of a list of lists
-inprove the error handeling on the Bet(... |
"""
Module for bulk-exporting IsisCB data in EBSCO format.
The strategy here is to favor extensibility/flexibility in defining output
columns, at the expense of performance. The performance hit is probably OK,
since these jobs will be performed asynchronously.
"""
from __future__ import print_function
from __future__ ... |
import os
import h5py
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import tensorflow as tf
import tensorflow.contrib.slim as slim
from PIL import Image
from pyntcloud import PyntCloud
from sklearn.metrics import auc, roc_curve
matplotlib.use('TkAgg') #uncomment this line i... |
import numpy as np
import random
import tensorflow as tf
import matplotlib.pyplot as plt
import scipy.misc
import os
import csv
import itertools
import tensorflow.contrib.slim as slim
#imageio.plugins.ffmpeg.download()
# This is a simple function to reshape our game frames.
def processState(state1):
return np.resh... |
import librosa
import argparse
import numpy as np
import moviepy.editor as mpy
import random
import torch
from scipy.misc import toimage
from tqdm import tqdm
from pytorch_pretrained_biggan import (BigGAN, one_hot_from_names, truncated_noise_sample,
save_as_images, display_in_term... |
import operator
import argparse
import torch
import os
import pickle
import data_utils
import matplotlib.pyplot as plt
import numpy as np
import model_utils as mu
import sim_utils as su
import model_trainer as mt
import dataset_3d as d3d
from tqdm import tqdm
from torch.utils import data
'''
Important components of ... |
"""Work with a collection of moles."""
import argparse
import json
import math
import pathlib
import uuid
import numpy
import mel.lib.fs
import mel.lib.image
import mel.lib.math
import mel.rotomap.mask
KEY_IS_CONFIRMED = "is_uuid_canonical"
KEY_IS_UNCHANGED = "is_unchanged"
IGNORE_NEW_FILENAME = "ignore-new"
IGNO... |
"""Perform calibration analysis.
"""
import argparse
import sys
import re
from pathlib import Path
import numpy as np
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import fitsio
from desietcimg.calib import *
from desietcimg.util import *
from desietcimg.plot import *
from desietcimg.db im... |
"""
This module is used to access data in NOMIS (the database that hold all information in prisons).
HMPPS has split the functionality that used to be in one API (called NOMIS or Elite2 in the past) into:
- HMPPS Auth for authenticating all API calls
- Prison API for accessing NOMIS-specific endpoints
- and other serv... |
"""
Paper: "Fast and Accurate Image Super Resolution by Deep CNN with Skip Connection and Network in Network"
Ver: 2
functions for loading/converting data
"""
import configparser
import logging
import os
import random
import numpy as np
from helper import utilty as util
INPUT_IMAGE_DIR = "input"
INTERPOLATED_IMAGE_... |
import numpy as np
import mmap
from .utils import is_integer_value
# We need this for compression before a newer version of fitsio arrives
import astropy.io.fits as fits
use_fitsio = False
try:
import fitsio
use_fitsio = True
except ImportError:
pass
_image_bitpix2npy = {
8: 'u1',
10: 'i1',
1... |
# Bismillah
# Bagian 1 - Import library yang dibutuhkan
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
def compare_values(act_col, sat_col):
act_vals = []
sat_vals = []
# Buat List dulu agar bisa dicek
for a_val in act_col:
act_vals.append(a_val)
... |
#!/usr/bin/env python3.4
#
# Copyright (C) 2017 The Android Open Source Project
#
# 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 ... |
# -*- coding: utf-8 -*-
# Copyright (c) 2020, Apple Inc. All rights reserved.
#
# Use of this source code is governed by a BSD-3-clause license that can be
# found in the LICENSE.txt file or at https://opensource.org/licenses/BSD-3-Clause
from coremltools.converters.mil.mil.passes.pass_registry import register_pa... |
import math
import re
import random
from collections import defaultdict, deque
from src.utilities import *
from src.functions import get_players, get_all_players, get_target, get_main_role
from src import users, channels, debuglog, errlog, plog
from src.decorators import command, event_listener
from src.messages impor... |
# Copyright (c) 2020 Club Raiders Project
# https://github.com/HausReport/ClubRaiders
#
# SPDX-License-Identifier: BSD-3-Clause
import logging
from typing import Dict, Tuple
import dash_core_components as dcc
import dash_html_components as html
from dash_table.Format import Format, Scheme, Group
from pkg_resourc... |
import dns
import dns.name
import dns.query
import dns.resolver
class DomainError(Exception):
pass
class GatherDNS:
"""Helper class for gathering DNS data"""
def _convert_utf8(self, s):
""" Decodes string"""
codecs = ['utf8', 'utf16', 'utf32', 'latin1', 'cp1252', 'ascii']
... |
import torch
import torch.nn as nn
class HardSwish(nn.Module):
def __init__(self, inplace=True):
super(HardSwish, self).__init__()
self.relu6 = nn.ReLU6(inplace)
def forward(self, x):
return x*self.relu6(x+3)/6
def ConvBNActivation(in_channels,out_channels,kernel_size,stride,activate)... |
"""
This file demonstrates writing tests using the unittest module. These will pass
when you run "manage.py test".
Replace this with more appropriate tests for your application.
"""
from dateutil.parser import parse as parse_date
from datetime import date
from unittest import TestCase, main
from athlib.uka.agegroups ... |
import fileinput
import html
import json
import re
from prologGeneral import checkErrors, swipl
from util import CondFormatString, removeFile
reProperty = re.compile(r"(prop_[^(]*)\((.*)\)\s*:-")
reBody = re.compile(r"^\s")
reBraces = re.compile(r"\([^()]*\)")
LANG = {
"nl": {
"info": CondFormatString(
... |
#-------------------------------------------------------------------------------
# Name: module1
# Purpose:
#
# Author: kol
#
# Created: 18.01.2020
# Copyright: (c) kol 2020
# Licence: <your licence>
#-------------------------------------------------------------------------------
import tensorflo... |
import numpy as np
from skimage.transform import resize
from tqdm import tqdm
from dianna import utils
def normalize(saliency, n_masks, p_keep):
return saliency / n_masks / p_keep
def _upscale(grid_i, up_size):
return resize(grid_i, up_size, order=1, mode='reflect', anti_aliasing=False)
class RISE:
""... |
import random
from random import choice
import pygame
from pygame import mixer
class Human:
def __init__(self, name, rank, mind, body, spirit, stats, mind_tack, bod_tack, spir_tack):
self.name = name
self.rank = rank
self.mind = mind
self.body = body
self.spirit... |
""" Map the global distribution of Respiratory Syncytial Virus (RSV) by collection date, location,
and viral subtype or genotype """
import os
import pandas as pd
import numpy as np
import plotly.plotly as py
import matplotlib.pyplot as plt
from matplotlib import colors
import rsview.parsearguments
JITTER_DICT = {'... |
import re
import six
from django import forms
from django.contrib import admin
from django.test import TestCase
from django.utils.translation import ugettext_lazy as _
from parsley.decorators import parsleyfy
from .forms import (TextForm, TextForm2, FieldTypeForm, ExtraDataForm,
ExtraDataMissingFieldForm, Fo... |
from __future__ import absolute_import, division, print_function
import traceback
from libtbx.utils import Sorry, to_str
import threading, sys
import os.path, time
#import pathlib
#import ssl
import asyncio
import websockets
from typing import Optional
from websockets.exceptions import (
ConnectionClosed,
Connecti... |
#-*-coding: utf-8 -*-
from django.conf import settings
from django.db import models
from django.contrib.auth.models import User
from django.db.models import Q
from django.core.exceptions import ObjectDoesNotExist
from django.db.models.signals import post_save
import os
from game.tasks import run_match
from datetime imp... |
"""
@package mi.dataset.parser
@file marine-integrations/mi/dataset/parser/nutnr_j_cspp.py
@author <NAME>
@brief Parser for the nutnr_j_cspp dataset driver
Release notes:
initial release
"""
__author__ = '<NAME>'
__license__ = 'Apache 2.0'
import re
from mi.core.log import get_logger
log = get_logger()
from mi.core... |
import os
import warnings
import dgl
import numpy as np
import torch
from torch import optim, nn
from torch.utils.data import DataLoader
from project.datasets.RG.rg_dgl_dataset import RGDGLDataset
from project.utils.fibers import Fiber
from project.utils.modules import GConvSE3, GNormSE3, GMaxPooling, get_... |
# The MIT License (MIT)
#
# Copyright (c) 2019 <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
# ... |
#! /usr/bin/env python3
"""Create random subsampels of input sequences."""
import argparse as ap
import gzip
import glob
from multiprocessing import Pool
import os
import random
import subprocess
import numpy as np
GENOME_SIZE = None
BA_LENGTH = None
BA_SEQUENCES = None
BA_TOTAL = None
BCG_LENGTH = None
BCG_SEQUENCES =... |
#Office 365 Management API Event Poller
__author__ = "<NAME>"
__version__ = "1.0.0"
__maintainer__ = "<NAME>"
__email__ = "<EMAIL>"
__status__ = "Production"
import sys
import os
import re
import json
import datetime as DT
import requests
import logging
import logging.handlers
def pollOffice(planT... |
from collections import defaultdict
from io import BytesIO
import zipfile
import time
import json
import random
from api.database_handler import (db,
commit)
from api.models import (Project,
ProjectData,
ProjectTextData,
... |
import copy
from gym_minigrid.window import Window
from counterfactuals.dataset import TrajectoryDataset, Trajectory, TrajectoryStep
class Navigator:
def __init__(self, index, min_index, max_index):
"""Used as a simple way to constrain movement through time"""
self.index = index
self.min... |
#
# This file is part of pySMT.
#
# Copyright 2014 <NAME> and <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 ... |
# -*- coding: utf-8 -*-
"""
Created on Tue Aug 31 2021
@author: au558899
Source codes for beta timeseries-related codes for main extractor of newsFluxus
"""
import os
import math
from itertools import islice
import numpy as np
import scipy.stats as stats
import matplotlib.pyplot as plt
from icecream import ic
impor... |
#!/usr/bin/env python
import argparse
import json
import os
import uuid
import shutil
import subprocess
import sys
import time
import uuid
from path import Path
import jinja2
TERRAFORM_TEMPLATE_FILE = 'openstack-env.jinja2.tf'
TERRAFORM_OUTPUT_FILE = 'openstack-env.tf'
WORK_DIR = Path.getcwd() / 'work'
CONFIG_FILE_... |
from flask import flash
from flask import redirect
from flask import render_template
from tracker import db
from tracker import tracker
from tracker.form import CVEForm
from tracker.form import GroupForm
from tracker.model import CVE
from tracker.model import Advisory
from tracker.model import CVEGroup
from tracker.mo... |
#Flask imports
import os
import flask
from flask import Flask,Blueprint,request, url_for, session, redirect, render_template
import plotly as py
from plotly.subplots import make_subplots
import plotly.graph_objs as go
import plotly.express as px
import plotly.figure_factory as ff
import pandas as pd
import pickle
#scri... |
#/usr/bin/env python
"""
globifest/Importer.py - globifest Importer
Copyright 2018, <NAME>, Garmin Ltd, or its subsidiaries.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Re... |
#!/usr/bin/env python3
"""
CPAchecker is a tool for configurable software verification.
This file is part of CPAchecker.
Copyright (C) 2007-2017 <NAME>
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... |
# -*- coding: utf-8 -*-
"""The operating system file entry implementation."""
import os
import platform
import stat
import pysmdev
from dfdatetime import posix_time as dfdatetime_posix_time
from dfvfs.lib import definitions
from dfvfs.lib import errors
from dfvfs.path import os_path_spec
from dfvfs.vfs import file_... |
import itertools
import json
import random
from collections.abc import Sequence
from pathlib import Path
from typing import Union, Tuple
import typing
from torch import Tensor
from examples.data_utils import get_mnist_digits, get_next, split_train_dataset
from deepstochlog.context import ContextualizedTerm, Context
... |
# -*- coding: utf-8 -*-import six
from errno import EPERM
from ..exceptions import FuseOSError
from .inodes import FileINode
M_NONE = 0b00000000 # 无权限
M_READ = 0b10000000 # 读取
M_WRITE = 0b01000000 # 写入(内容)
M_EXECUTE = 0b00100000 # (读取和)执行
M_LIST_S = 0b10100000 # 列出文件夹内容
M_DELETE = 0b00010000 # 特殊权限(删除)
M_PWRITE ... |
import pgzrun
import yaml
from pgzero.builtins import *
from map import GameMap
from player import Player
from npc import Npc
from state import GameState
from item import Item, GameItem
WIDTH = 600
HEIGHT = 400
SPRITE_SIZE = 16
SCREEN_ROWS = WIDTH // SPRITE_SIZE
MAP_WIDTH = 35
MAP_HEIGHT = 18
OFFSET = 4
DEBUG = Fa... |
import argparse
import json
import subprocess
import tempfile
from glob import glob
from pathlib import Path
from typing import List, Union
from urllib import request
import platform
import os
project_root = Path(__file__).absolute().parent
def run_subprocess(command):
status, output = subprocess.getstatusoutput... |
import streamlit as st
import altair as alt
import pandas as pd
import numpy as np
rng = np.random.default_rng()
img_bull = 'https://upload.wikimedia.org/wikipedia/commons/0/03/BULL.png'
img_bear = 'https://upload.wikimedia.org/wikipedia/commons/1/1e/JB_PRODUCE_logo_oficial.png'
img_straight = 'https://static.thenoun... |
from asyncio import (
AbstractEventLoop,
Lock,
PriorityQueue,
QueueFull,
)
from itertools import count
from typing import (
Any,
Callable,
Dict,
Generic,
Set,
Tuple,
TypeVar,
)
from eth_utils import (
ValidationError,
)
from eth_utils.toolz import identity
TTask = TypeV... |
from collections import defaultdict
from typing import List
from PySide2.QtGui import QCursor, QContextMenuEvent
from PySide2.QtWidgets import QTreeWidget, QTreeWidgetItem, QMenu, QMessageBox, QInputDialog, QAbstractItemView
from PySide2.QtCore import Qt
from angr import SimState
from inspect import isfunction
clas... |
from __future__ import absolute_import
from __future__ import print_function
import argparse
def init_parser():
parser = argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFormatter)
parser.add_argument('--app', type=str, default='image', choices=['image', 'video'],
... |
from collections import defaultdict
import logging
import os
from typing import Dict, List, Set, Tuple
import xml.dom.minidom
from mir.tools import class_ids
from mir.tools.code import MirCode
from mir.tools.errors import MirRuntimeError
from mir.tools.phase_logger import PhaseLoggerCenter
from mir.protos import mir_... |
import json
import pandas as pd
import numpy as np
from sklearn.metrics.pairwise import euclidean_distances, cosine_distances
import networkx as nx
import rdflib
GEMB_DIM = 100
MAX_NODES = 500
# TODO fix selection of nodes to return
def get_neighbors(center, data, hops=1):
links = data['links'].copy()
nodes... |
"""Object detection, localization, and classification model."""
import enum
import logging
import networkx as nx
import operator
from auvsi_suas.models import pb_utils
from auvsi_suas.models.gps_position import GpsPosition
from auvsi_suas.proto import interop_admin_api_pb2
from auvsi_suas.proto import interop_api_pb2
... |
from iob.devices import ArduinoLeonardo
from iob import I2CTransaction
from datetime import datetime, timedelta
from time import sleep
from unittest import TestCase
class Mcp7940n(object):
CLOCK_BASE_ADDRESS = 0x00
CONTROL_ADDRESS = 0x07
ALARM_BASE_ADDRESS = 0x0A
ALARM_MATCH = 0b01110000
ALARM_PO... |
from . import response as http_response
from ..http2 import request_handler as http2_request_handler
from . import base_request_handler, http_auth, respcodes
from ...client import asynconnect
import base64
from hashlib import md5
import os
from hyperframe.frame import SettingsFrame
from ..http2 import H2_PROTOCOLS
from... |
import numpy as np
import time
import torch
import torch.nn as nn
from torch.autograd import Function
from torch.cuda.amp import custom_bwd, custom_fwd
from .backend import _backend
#########################################
### training functions
#########################################
### generate points (forwa... |
from __future__ import print_function
import json
import numpy as np
from networkx.readwrite import json_graph
import exps_logs
'''
Authors: <NAME> (<EMAIL>)
Example: python osm_eval.py
This script contains codes to evaluate the performance of GAIN architecture.
It evaluates representation vec... |
# -*- coding: utf-8 -*-
"""
This code creates a database with a list of publications data from Google
Scholar.
The data acquired from GS is Title, Citations, Links and Rank.
It is useful for finding relevant papers by sorting by the number of citations
This example will look for the top 100 papers related to the keywo... |
#!/Users/virgil/anaconda3/envs/metr/bin/python
import matplotlib.pyplot as plt
import requests
from bs4 import BeautifulSoup
import xarray as xr
import numpy as np
import pandas as pd
import metpy.calc as mpcalc
from metpy.plots import SkewT, Hodograph
from metpy.units import units, concatenate
from datetime import ti... |
import itertools
import math
import dgl
import ot
import torch
from torch import Tensor, nn
from torch.distributions import MultivariateNormal
from torch.nn.modules.loss import _Loss, L1Loss, MSELoss, BCEWithLogitsLoss
import numpy as np
import torch.nn.functional as F
# Ligand residue locations: a_i in R^3. Recepto... |
# Copyright 2015 The TensorFlow 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 applica... |
"""
.. module:: common
:synopsis: Common utility functions
"""
from __future__ import print_function
import sys
import time
import random
from timeit import default_timer
from math import sqrt, log, cos, pi
from six.moves import cStringIO as StringIO
def isnan(x):
"""
Check if something is NaN.
>>>... |
# (c) Copyright [2018-2022] Micro Focus or one of its affiliates.
# 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 applicabl... |
from __future__ import division
import numpy as np
from .xarray_wrapper import xarray_loop_vars_over_dim
############################################
# Functions for k-R power law calculations #
############################################
@xarray_loop_vars_over_dim(vars_to_loop=["A", "f_GHz"], loop_dim="channel_id... |
from __future__ import print_function
#Custom imports
from model import dqn
from model import replay_memory
from python_agent.kalah_train import Kalah
from python_agent.board import Board
from python_agent.side import Side
import matplotlib
import random
import torch
import math
import matplotlib.pyplot as plt
import... |
# Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
import inspect
import re
import sys
import unicodedata
import yaml
from django.contrib.auth.models import User
from django.db import models
from django.utils.functional import cached_property
from reversion import revisions as reversion
from django.conf import settings
from django.contrib.contenttypes.fields import Ge... |
import geocacher_pb2
import base64
import struct
import os
import sys
import random
import string
import traceback
import logging
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives import hashes, padding, hmac
from cryptography.hazmat.primitives.asymmetric.padding import OAEP,... |
import os
import sys
import scipy
import glob
import numpy as np
import pandas as pd
from sklearn.linear_model import LinearRegression
from scipy.stats import zscore
from glmpca.glmpca import glmpca
def load_data(data_dir):
matrix_dir = data_dir
mat = scipy.io.mmread(glob.glob(data_dir+'/*.mtx*')[0]).tocsr().T
ge... |
from python_zwoasi import zwoasi
from PyQt5.QtCore import QThread, QMutex, QMutexLocker, pyqtSignal, pyqtSlot, qDebug, QObject, QTimer, QSettings
import numpy as np
from camera import Camera
from camera_settings_widget import CameraSettingsWidget
def clamp(x, minn, maxx):
return min(max(x, minn), maxx)
class Z... |
'''
codimd.py
The CodiMD-specific code used by the WOPI bridge.
Author: Giuseppe.<EMAIL>, CERN/IT-ST
'''
import os
import re
import zipfile
import io
from random import randint
import json
import hashlib
import urllib.parse as urlparse
import http.client
import requests
import bridge.wopiclient as wopic
TOOLARGE =... |
"""
@package UnitTests.metaNetworkUnitTest
@brief Testing for meta node functionalitis
@details Here we are testing that all the a meta network is created and saved. Once you have reopened the file you should be recall most of the data.
"""
import pymel.core as pm
from PKD_Tools import libUnitTests
from PKD_Tools.Red9... |
"""This module creates GAN images for a specified category.
"""
# Copyright 2018 The TensorFlow Hub 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:... |
""" For the communication between Objects(gui inclusive) Signal and
SignalDataClasses are defined to pass data for specific tasks
(update, action to do,...)
Each Object to which a signal is send, need to treat it. The class
"SignalReciever" is intende to be use as Parent class fro thos Objects.
It allows objects to... |
#!/usr/bin/env python3 -tt
"""
20180731 tkwolf
This warning message may be ignored:
/usr/lib/python3.6/importlib/_bootstrap.py:219: RuntimeWarning: numpy.dtype size changed, may indicate binary incompatibility.
"""
# Imports
# Standard library imports
import sys
#import os
import argparse as ap
# Related third party ... |
import pandas as pd
import math
from sklearn.tree import export_graphviz
import IPython, graphviz, re #, sklearn_pandas, sklearn, warnings, pdb
from pandas.api.types import is_string_dtype, is_numeric_dtype, is_categorical_dtype
from sklearn.model_selection import learning_curve
import numpy as np
import matplotlib.pyp... |
# --------------------------------------------------------
# Multi-Epitope-Ligand Cartography (MELC) phase-contrast image based segmentation pipeline
#
#
# Written by <NAME>
# --------------------------------------------------------
import json
import tifffile
import cv2
import pandas as pd
import numpy as np
from os.... |
import random
import argparse
import time
'''
======================================================
Copyright (C) 2019 <NAME>.
Version 1.1.1
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 wi... |
"""This file contains the entities present in the database"""
import hashlib
from app import db
from peewee import CharField, DateTimeField, DecimalField, BooleanField, ForeignKeyField, IntegerField, JOIN, fn
class User(db.Model):
firstName = CharField()
lastName = CharField()
emailAddress = CharField(un... |
from __future__ import division
import torch
import random
import numpy as np
import numbers
import types
import scipy.ndimage as ndimage
import cv2
import matplotlib.pyplot as plt
from PIL import Image
# import torchvision.transforms.functional as FF
'''
Data argumentation file
modifed from
https://github.com/Cleme... |
"""
Utility package for various processing in other commands
"""
import json
from contextlib import contextmanager
from functools import reduce
import copy
import os
import os.path
import zipfile
from subprocess import Popen
import sys
import codecs
from typing import Optional, Union, Type, Dict
from logging import Log... |
# LabMultiGraph2D widget
# ======================
#
# visualize 2D slices of the CIELAB color space
# in cartesian and cylindrical representations
#
# Copyright (C) 2019, <NAME>, samjnaa-at-gmail-dot-com
#
# Use, modification and distribution are permitted subject to the
# "BSD-2-Clause"-type license stated in the acco... |
import csv, json
import os
import traceback
import settings
import tools
generic_matcher_1 = {
"a highly": 3, "a notably": 2, "a minorly": 1, "not at all a": 0
}
generic_matcher_2 = {
"always fair and equal": 3,
"usually fair and equal": 2,
"more often than not fair and equal": 1,
"more often tha... |
#!python3
"""
A utility class Bag for bag-filling --- a subroutine in
various algorithms for fair allocation of indivisible items.
Programmer: <NAME>
Since: 2021-04
"""
from fairpy import Allocation, ValuationMatrix
from typing import List
import numpy as np
import logging
logger = logging.getLogger(__name__)... |
import calendar
import time
from anchore_engine.services.policy_engine.engine.feeds import DataFeeds
from anchore_engine.services.policy_engine.engine.policy.gate import Gate, BaseTrigger
from anchore_engine.services.policy_engine.engine.vulnerabilities import have_vulnerabilities_for
from anchore_engine.db import Dis... |
# coding: utf-8
import torch
import torchvision.transforms.transforms as transforms
from torch.utils.data import Dataset
import numpy as np
import pickle
import os
import sys
import errno
import os.path as osp
def mkdir_if_missing(directory):
if not osp.exists(directory):
try:
os.makedirs(dir... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.