text stringlengths 8.04k 46.5k |
|---|
# Copyright 2018 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... |
from IPython.display import display, HTML
import time
import math
from matplotlib import cm
# Created at: 23rd October 2018
# by: <NAME>
# Modified at: 5/21/2020
# by: <NAME>
# Modified at: 9/3/2020
# by: <NAME>
# Module for drawing classic Turtle figures on Google Colab notebooks.
# It uses h... |
#!/usr/bin/env python3
# Copyright (c) 2015-2020 The Baricoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the ZMQ notification interface."""
import struct
from test_framework.address import (
ADDRES... |
# Copyright (c) Facebook, Inc. and its affiliates.
import logging
import math
import warnings
import numpy as np
import matplotlib.colors as mplc
import napari
from detectron2.utils.colormap import random_color
from detectron2.utils.visualizer import ColorMode
from detectron2.utils.visualizer import Visualizer as Det... |
#!/usr/bin/env python3
import re
import warnings
warnings.simplefilter(action='ignore', category=UserWarning)
import numpy as np
import pandas as pd
import pyranges as pr
from src import logger
from src.query import bam
__all__ = ["Interval", "Regions"]
tag_parser = re.compile(r"(?P<chrom>chr.{1,2}):(?P<start>\d*... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
__year__ = [2017];
__status__ = "Development";
__contact__ = "<EMAIL>";
# Imports
import signal
import argparse
import logging
import pyric.pyw as pyw;
logging.getLogger("scapy.runtime").setLevel(logging.ERROR);
from netaddr import *
from scapy.all import *
from s... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# ========================================================================
# hyperparameter tuning, model training and validation.
# (the hyperparameters are tuned with the hyperopt package.)
# ========================================================================
impor... |
#
# Copyright 2017 <NAME>ios
#
# Licensed under the Apache License, Version 2.0 (the "Apache License")
# with the following modification; you may not use this file except in
# compliance with the Apache License and the following modification to it:
# Section 6. Trademarks. is deleted and replaced with:
#
# 6. Trademark... |
import calendar
# import datetime
import traceback
import tempfile
import json
from datetime import datetime, timedelta, date
from calendar import monthrange
from dateutil.parser import parse
# from weasyprint import HTML, CSS
from django.conf import settings
from django.contrib import messages
from django.contrib.si... |
import cgi
import collections
import csv
import io
import json
import pathlib
import subprocess
import sys
import time
import typing
import urllib.parse
import uuid
import arrow
import requests
import encapsia_api
from encapsia_api.lib import (
download_to_file,
guess_mime_type,
guess_upload_content_type,... |
import json
import numpy as np
import pandas as pd
from .utils import get_blocked_videos
from .utils import interpolated_prec_rec
from .utils import segment_iou
from joblib import Parallel, delayed
class ActionDetectorDiagnosis(object):
GROUND_TRUTH_FIELDS = ['database', 'taxonomy', 'version']
PREDICTION_FI... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from itertools import groupby
from quixote.errors import TraversalError, AccessError
from vilya.libs.template import st
from vilya.libs.text import get_mentions_from_text
from dispatches import dispatch
from vilya.views.util import jsonize
from vilya.mode... |
#!/usr/bin/enc/python
# -*- coding: utf-8 -*-
"""An unofficial Farsight Security DNSDB client"""
from __future__ import print_function
import os
import logging
import json
import locale
import copy
from datetime import datetime
from collections import OrderedDict
from csv import DictWriter
try:
# Python 2 suppor... |
# import modules
from tkinter import *
import tkinter
from tkinter import filedialog
import csv
import time
import pandas as pd
from matplotlib.figure import Figure
from matplotlib.backends.backend_tkagg import (FigureCanvasTkAgg,
NavigationToolbar2Tk)
from mpl_toolkits.... |
import argparse
import datetime
import numpy as np
import time
import torch
import torch.backends.cudnn as cudnn
import json
from pathlib import Path
from timm.data import Mixup
from timm.models import create_model
from timm.loss import LabelSmoothingCrossEntropy, SoftTargetCrossEntropy
from timm.scheduler import cre... |
import operator
import re
import os
import sys
import platform
from pathlib import Path
import warnings
from typing import Dict, List, Any, ByteString, Union
from .libclang.cindex import CursorKind, StorageClass, TypeKind, \
TranslationUnit, Config, TranslationUnitLoadError, Cursor, Type
from .c_data_model import ... |
"""
Copyright (c) 2015 SONATA-NFV
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 agreed to in... |
# Copyright 2021 Paychex, Inc.
# Licensed pursuant to the terms of the Apache License, Version 2.0 (the "License");
# your use of the Work is subject to the terms and conditions of the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Disclaimer of Warranty. Un... |
import dbApi
import unittest
import scanner.logSetup as logSetup
import psycopg2
import test_settings
TEST_DATA = [
{"fspath" : '/test/dir1', "internalpath" : 'item1', "itemhash" : 'DEAD', "phash" : 12, "itemkind" : 'N/A', "imgx" : 50, "imgy" : 30},
{"fspath" : '/test/dir1', "internalpath" : 'item2... |
# Modified from
# https://github.com/facebookresearch/ClassyVision/blob/main/classy_vision/models/anynet.py
# https://github.com/facebookresearch/ClassyVision/blob/main/classy_vision/models/regnet.py
import math
import torch
from collections import OrderedDict
from functools import partial
from typing import Any, Ca... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Tested w/ python3-apt v1.6.5ubuntu0.4 on Ubuntu 18.04.5 LTS.
#
# References:
#
# Fri, 11 Dec 2020 18:45:40 +0100 [1] Python APT Library — python-apt 2.1.7 documentation <https://apt-team.pages.debian.net/python-apt/library/index.html>
#
# TODO: -A --autoremove autoremo... |
import subprocess
from copyreg import constructor
import os
import sys
import os.path
from os import path
import re
def print_error(file, error_type, error_tuple, rule):
pattern = " {color}[{error_type}] ({error_name}){endcolor} - {message}{fileinfo}"
pattern2 = " [{error_type}] ({error_name}) - {message}{fi... |
# -*- coding: utf-8 -*-
"""
Copyright 2018 IBM 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 agree... |
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
# $Id$
# $Revision$
#
# libsnmp - a Python SNMP library
# Copyright (c) 2003 <NAME> <<EMAIL>>
#
# This file contains all the base types for SNMP with the abstract
# ASN1 stuff removed and a 'hardcoded' d... |
#!/usr/bin/env python
#
# Copyright (c) 2011-2013 <NAME>, <NAME>, <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 ... |
#!/bin/env python
'''
Convert macOS keyboard layout files (.keylayout) to
equivalent Windows files (.klc).
'''
import os
import re
import sys
import time
import argparse
import codecs
import unicodedata
import xml.etree.ElementTree as ET
# local modules
from data.klc_data import (
win_to_mac_keycodes, win_keyco... |
# Copyright 2006-2012 <NAME>
import re
from pycbio.hgdata.autoSql import intArraySplit, intArrayJoin, strArraySplit, strArrayJoin
from pycbio.tsv.tabFile import TabFileReader
from pycbio.hgdata import dnaOps
from pycbio.hgdata.cigar import ExonerateCigar
from collections import defaultdict
from deprecation import depre... |
from __future__ import division
from typing import List, Optional
import numpy as np
import matplotlib.pyplot as plt
import random
import cv2
from PIL import Image, ImageDraw, ImageFont
import pickle
from pathlib import Path
import scipy.signal as ssig
import scipy.stats as sstat
import math
def sample_weighted(p_dic... |
### NAME: <NAME>
### ID: 21249309
### Git URL: https://github.com/rachelkmalone/ARC
#!/usr/bin/python
import os, sys
import json
import numpy as np
import re
### Code Commentary
# The following ARC tasks were solved as part of Assignment 3:
# Task: c1d99e64, ed36ccf7, 3de23699, 2204b7a8, 1caeab9d, a78176bb, a3df8b1... |
# Copyright 2019-2020 Spirent Communications.
#
# 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 ... |
#! /usr/bin/env python
import glob
import io
import os
import os.path
import ntpath
import stat
import uuid
# Different types of projects found within the solution.
LIBRARY_PROJECT = 0
TEST_PROJECT = 1
BENCHMARK_PROJECT = 2
SAMPLE_PROJECT = 3
project_groups = {
BENCHMARK_PROJECT: 'benchmarks',
... |
###############################################################################
###############################################################################
##
## PyHART - Master
##
###############################################################################
#################################################... |
# submission form jupyter notebook supporting code
# Author: <NAME>
# Version: 0.2 (March 2015)
# to do:
# separate out generic form code (e.g. git repo handling) as a super class
# from which specific form handlers inherit
"""
=============================================
Data submission form tools
==================... |
import json
import sys
import numpy as np
import random
from collections import namedtuple
sys.path.append('build')
import MatterSim
import math
import torch
import torch.nn as nn
from torch.autograd import Variable
import torch.nn.functional as F
import torch.distributions as D
from utils import vocab_pad_idx, vocab_... |
"""!
@brief Cluster analysis algorithm: Genetic clustering algorithm (GA).
@details Implementation based on papers @cite article::ga::1, @cite article::ga::2.
@authors <NAME>, <NAME> (<EMAIL>)
@date 2014-2020
@copyright BSD-3-Clause
"""
import numpy
import matplotlib.pyplot as plt
import matplotlib.animation as a... |
import cv2
import numpy as np
cv2.setNumThreads(0) # pytorch issue 1355: possible deadlock in dataloader
def get_random_color(background_color):
""" Output a random scalar in grayscale with a least a small
contrast with the background color """
color = np.random.randint(256)
if abs(color - bac... |
import common, colors
import psmove
import time
import psutil, os, glob
import random
import numpy
import json
from piaudio import Audio
from enum import Enum
from multiprocessing import Process, Value, Array, Queue
from math import sqrt
import statistics
# How fast/slow the music can go
SLOW_MUSIC_SPEED = 0.7
#this ... |
import asyncio
import cozmo
import cv2
import getopt
import logging
import numpy as np
import sys
import threading
import time
import datetime
from cozmo.util import degrees, distance_mm, speed_mmps
from matplotlib import pyplot as plt
""" A simple line follow logic, which guides Cozmo along a line.
For best results... |
# Copyright 2017 MongoDB, 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, so... |
import logging
import re
from IPy import IP
from ordered_set import OrderedSet
from typing import Optional, List, Set, Tuple
from irrd import __version__
from irrd.conf import get_setting
from irrd.mirroring.nrtm_generator import NRTMGenerator, NRTMGeneratorException
from irrd.rpsl.rpsl_objects import OBJECT_CLASS_MAP... |
"""
Logic function for AES cipher
"""
# Disable 'invalid-name', b/c 'logic' package uses unconventional names
# pylint: disable=C0103
from pyeda.boolalg.bfarray import exprzeros, uint2exprs, fcat
_SBOX = [
0x63, 0x7c, 0x77, 0x7b, 0xf2, 0x6b, 0x6f, 0xc5,
0x30, 0x01, 0x67, 0x2b, 0xfe, 0xd7, 0xab, 0x76,
... |
"""Contains functions for dealing with the .pdb file format."""
from datetime import datetime
import re
from itertools import groupby, chain
import valerius
from math import ceil
from .data import CODES
from .structures import Residue, Ligand
from .mmcif import add_secondary_structure_to_polymers
def pdb_string_to_pd... |
#!/usr/bin/env python
# Copyright 2017 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 requ... |
import html
import re
from typing import Generator, Iterator, List, Optional, Set, Tuple
from mwparserfromhell import nodes, wikicode
from mwparserfromhell.nodes import extras
from mwparserfromhell.string_mixin import StringMixIn
from mwcomposerfromhell.namespace import (
ArticleNotFound,
ArticleResolver,
... |
# -*- coding: utf-8 -*-
# Copyright 2015 <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... |
# Authors: <NAME>
# License: BSD 3 clause
from __future__ import division
import logging
import copy
import numpy as np
import scipy as sp
from warnings import warn
from scipy import sparse
from scipy.sparse import lil_matrix, csr_matrix, vstack
from numpy import random
from scipy.sparse import issparse
import n... |
# -*- coding: utf-8 -*-
"""
@Ubuntu Linux ~ Bugtraq II-Black Widow
Created on Fri Jun 20 14:18:35 2014
@author: Waiyaki ~ #Spyder
"""
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from random import randint
import sqlite3
import string
import time
import... |
# Proxy management (asyncio version).
#
# Copyright © 2014, 2015 <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
# There is NO WARRANTY.
i... |
import os
import sys
import argparse
import importlib
import numpy as np
import torch
import _pickle as pickle
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
ROOT_DIR = os.path.dirname(BASE_DIR)
sys.path.append(BASE_DIR)
sys.path.append(os.path.join(ROOT_DIR, 'models'))
from model_util import NUM_HEADING_BIN, NU... |
"Definition of a univariate parameter."
from equadratures.distributions.gaussian import Gaussian
from equadratures.distributions.uniform import Uniform
from equadratures.distributions.triangular import Triangular
from equadratures.distributions.chebyshev import Chebyshev
from equadratures.distributions.beta import Beta... |
import unittest
import warnings
import nose
from numpy.testing import assert_allclose, assert_raises
from numpy.testing.decorators import knownfailureif
import numpy as np
from lmfit import Model, Parameter, models
from lmfit.lineshapes import gaussian
def assert_results_close(actual, desired, rtol=1e-03, atol=1e-03,... |
import numpy as np
import numpy.linalg as nla
import scipy.linalg as sla
import math
from ..power_converter import utils
# Import progress bar
from tqdm import tqdm
# Import mathprogbasepy
import mathprogbasepy as mpbpy
# import miosqp solver
import miosqp
# Internal functions and objects
from .tail_cost import T... |
'''
Script for running distributed DP master node
'''
import copy
import datetime
import numpy as np
import os
import pickle
import sys
import time
import logging
from collections import OrderedDict as OD
import argparse
import torch
import torch.nn.functional as F
from torch import nn
from torch import optim
from to... |
import re
from operator import itemgetter
#---------------------------------------------------------------------------
# Constants
#---------------------------------------------------------------------------
phases = [
'It is currently in the Pre-game Setup Phase',
"It is now {}'s READY Step",
"... |
# -*- coding: utf-8 -*-
"""
Created on Tue Dec 28 18:41:05 2021
@author: Fiona
"""
#https://medium.com/emergent-future/simple-reinforcement-learning-with-tensorflow-part-0-q-learning-with-tables-and-neural-networks-d195264329d0
# from gym import Env, spaces
# import numpy as np
# import random
# import tensorflow as t... |
import unittest
from zExceptions import NotFound
from zope.interface import implementer
from zope.publisher.interfaces import IPublishTraverse
from zope.publisher.interfaces import NotFound as ztkNotFound
@implementer(IPublishTraverse)
class DummyTraverser(object):
def publishTraverse(self, request, name):
... |
# -*- coding: utf-8 -*-
"""Module containing the abstract search classes to retrieve DOV data."""
import datetime
from distutils.util import strtobool
import owslib
import pandas as pd
from owslib.etree import etree
from owslib.feature import get_schema
from owslib.fes import FilterRequest
from owslib.wfs import WebF... |
# View more python tutorials on my Youtube and Youku channel!!!
# Youtube video tutorial: https://www.youtube.com/channel/UCdyjiB5H8Pu7aDTNVXTTpcg
# Youku video tutorial: http://i.youku.com/pythontutorial
import pyglet
import numpy as np
import pandas as pd
import learning_methods
import matplotlib.pyplot as plt
impo... |
import cupy as xp
from chainer import Chain
import chainer.links as L
from lib.utils import *
from lib.functions import *
class YOLOv2(Chain):
"""
YOLOv2
- It takes (416, 416, 3) sized image as input
"""
def __init__(self, n_classes, n_boxes):
super(YOLOv2, self).__init__(
###... |
import datetime
from urllib.parse import urlparse, parse_qs
import requests
from pydnevnikruapi.dnevnik.exceptions import DiaryError
class DiaryBase:
"""
Базовый класс для синхронного использования дневник.ру API
"""
def __init__(self, login: str = None, password: str = None, token: str = None):
... |
# -*- coding: utf-8 -*-
# Copyright (C) 2000-2014 <NAME>
#
# 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 prog... |
import sys
sys.path.append('../')
from collections import deque
import os
from pathlib import Path
import imageio
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.cbook as cbook
from matplotlib.backend_bases import MouseButton
import pickle
from re import split
from scipy.cluster.vq import vq, kmea... |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
"""
Module that contains functions and classes related with meshes
"""
from __future__ import print_function, division, absolute_import
import logging
from collections import defaultdict
import maya.cmds
import maya.mel
import maya.api.OpenMaya
from tpDcc.dccs.maya im... |
import struct
from datetime import datetime as dt
import numpy as np
import pandas as pd
'''
Created 12/11/2018
@Author: <NAME>
This script defines classes for reading the AUSGeoid2020 binary NTv2 file, and interpolating the Ellipsoid to AHD
Separation, Deflection in the Prime Meridian and Deflection in the Prime V... |
"""Parallel FB Prophet transformer is a time series transformer that predicts target using FBProphet models."""
"""
This transformer fits one FBProphet model per time group and therefore may take time. Before using this transformer
we suggest you check FBProphet prediction significance by running an experiment with
pa... |
#!/usr/bin/python3
# -*- coding: utf-8 -*-
"""
Midi3
v0.7.0
Midi Handler :
- Hook to the MIDI host
- Enumerate connected midi devices and spawn a process/device to handle incoming events
- Provide sending functions to
- found midi devices with IN port
- OSC targets /noteon /noteoff /cc (see midi2OSC).
- La... |
# -*- coding: utf-8 -*-
import os
import sys
import re
from langdetect import detect, lang_detect_exception
import pycountry
from datasetcreator import damerau_levenshtein, jaccard, jaro, jaro_winkler, monge_elkan, cosine, \
strike_a_match, soft_jaccard, sorted_winkler, permuted_winkler, skipgram, davies, l_jaro... |
#!/usr/bin/env python
"""
Module to automatically setup a calibration process
using modelica models.
"""
import os
import sys
from ebcpy.data_types import TimeSeriesData
from ebcpy.simulationapi.dymola_api import DymolaAPI
from ebcpy.modelica import get_names_and_values_of_lines, get_expressions
from aixcalibuha.utils ... |
import os
from tkinter import *
from tkinter.ttk import *
import tkinter.font as tkf
from tkinter.filedialog import askopenfilename
from tkinter.filedialog import asksaveasfilename
import MovelistParser
class GUI_MoveViewer:
DISTINCT_COLORS = [
'#e6194b',
'#3cb44b',
'#ffe119',... |
import tempfile
from typing import Dict, Iterable, List, Tuple
from overrides import overrides
import torch
import allennlp
from allennlp.data import DataLoader, DatasetReader, Instance, Vocabulary
from allennlp.data.fields import LabelField, TextField
from allennlp.data.token_indexers import TokenIndexer, SingleIdTo... |
import argparse
import logging
import time
import math
import os
import sys
import itertools
import signal
from pathlib import Path
from dataclasses import dataclass
import z3
import p4z3.util as util
import check_p4_pair as z3check
log = logging.getLogger(__name__)
FILE_DIR = Path(__file__).parent.resolve()
P4Z3_... |
"""
Team: <NAME>, <NAME>, <NAME>, and <NAME>
To run this code:
requirements: numpy, matplotlib
At the bottom of the code, after the " if __name__ == "__main__": " statement
- Change the parameters you desire to change such as size of board
- Change the policy that you want to run
- change the parameters that affect ... |
# -*- coding:utf-8 -*-
"""Library to restfully handle Honeywell Home Assistant API calls."""
import logging
import os
import time
import urllib.parse
import requests
from requests.auth import HTTPBasicAuth
from requests.compat import json
from requests_oauthlib import OAuth2Session
_LOGGER = logging.getLogger(__na... |
# -*- coding: utf-8 -*-
from __future__ import print_function
import codecs
import io
import json
import logging
import os
import re
import tarfile
from collections import Counter
from operator import itemgetter
import numpy as np
import pandas as pd
import six
import tqdm
def strip_empty_strings(strings):
whil... |
import discord, os, sys, time, inspect, json, io, typing
from discord.ext import commands
from core.views import pagination
class Information(commands.Cog, description="Stalking people is wrong and bad!"):
def __init__(self, bot):
self.bot = bot
self.dagpi = {"Authorization": os.getenv("DAGPI")}
... |
from __future__ import print_function
import numpy as np
import multiprocessing as mp
import time
from scipy.integrate import simps
from functools import partial
from scdn.validation_truncation_1 import cross_validation
from scdn.model_config import Modelconfig, Modelpara
import os
from six.moves import cPickle as pkl
... |
from ctypes import CFUNCTYPE, POINTER, cast, memmove, create_string_buffer
from ctypes import c_int, c_long, c_char_p, c_void_p, c_longlong
AFUNPTR = CFUNCTYPE(None)
TRACE_BUFFER_CALLBACK = CFUNCTYPE(c_void_p, c_int, c_int, c_void_p,
c_void_p, c_longlong, c_void_p)
ROOT_THREAD_FUNC =... |
# Copyright 2020 Toyota Research Institute. All rights reserved.
import collections
import torch
import numpy as np
import pickle
import os
from maad.dataset.maad_gaze_dataset import MAADGazeDataset
from maad.dataset.maad_att_awareness_dataset import MAADAttAwarenessDataset
from maad.dataset.maad_pairwise_gaze_datase... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import wx
import os
import sys
import subprocess
import codecs
import shutil
import time
# import win32com.client as win32
import subprocess
import importlib
import smtplib
from email.message import EmailMessage
# importlib.reload(sys)
# sys.setdefaultencoding... |
from typing import Tuple, List, Dict, Any
import pandas as pd
import numpy as np
from sklearn.preprocessing import LabelEncoder, Imputer, FunctionTransformer
from sklearn.pipeline import Pipeline
from sklearn.base import BaseEstimator, TransformerMixin, RegressorMixin
from sklearn.ensemble import RandomForestRegresso... |
from django.shortcuts import render,redirect
from django.http import HttpResponse,HttpResponseRedirect,JsonResponse
from django.contrib.auth.models import User,auth
from django.contrib.auth.decorators import login_required
import json
from researchera.models import Research,Files
from datetime import date
from django.c... |
import os
import re
# Path to Gameplay directory:
current_dir = os.curdir + '/../'
# Path to the generated folder:
generated_folder = 'generated/'
generated_path = current_dir + generated_folder
# Path to the util folder:
util_folder = 'scriptingUtil/'
util_path = current_dir + util_folder
# Path to the folder that ha... |
#!/usr/bin/env python3
# usage: ./import.py path/to/file.c path/to/asm.s [make flags]
import argparse
from collections import defaultdict
import json
import os
import platform
import re
import shlex
import shutil
import subprocess
import sys
import toml
from typing import Callable, Dict, List, Match, Mapping, Optional,... |
"""
- plot_hist_line - Plot a histogram line.
- plot_segmented_line - Draw a line segment by segment.
- plot_scatter - Draw a scatter plot.
- plot_hist_bars - Plot a histogram bar graph.
- plot_conf_fill - Draw a median line and (set of) confidence interval(s).
"""
impor... |
#!/usr/bin/env python
"""HiJitReg registers color CCDs to corresponding red CCDs by using the
ISIS tool hijitreg to perform a deconvolution of jittered image data.
This program corrects for spacecraft jitter and prepares
images for coregistration. Using the ISIS program hijitreg it creates
a reference grid of control ... |
import random
from collections import deque, Counter
import math
import test_set
import statistics
import itertools
import sampling
import bisect
import heapq
from seidel_tree import to_line, Segment, Line, \
approx_above, approx_eq_above
import poly_tree as poly
import geometric as geom
class FirstList(list):
... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import sys
import os
import numpy as np
import cv2
import time
from sklearn import preprocessing
from sklearn.metrics.pairwise import pairwise_distances
from sklearn import metrics
sys.path.append("..")
from ... |
import math
from abc import ABC, abstractmethod
import numpy as np
import skimage.transform
import torch
from fastmri_utils.data import transforms
from fastmri_utils.data.transforms import fftshift, ifftshift
# ----- Utilities -----
class RadialMaskFunc(object):
""" Generates a golden angle radial spokes mas... |
# -*- coding: utf-8 -*-
from . static import Base_RM_Register
from . SYNTH_field import *
class RM_Register_SYNTH_STATUS(Base_RM_Register):
def __init__(self, rmio, label):
self.__dict__['zz_frozen'] = False
super(RM_Register_SYNTH_STATUS, self).__init__(rmio, label,
0x40083000, 0x00... |
from __future__ import division
from keras.callbacks import Callback
from keras import backend as K
import math
import numpy as np
import types
import seaborn as sns
import matplotlib.pyplot as plt
sns.set_style("whitegrid")
class ValidationMonitor(Callback):
'''Callback to monitor validation performance and op... |
#!/usr/bin/env python3
# clang-tidy review
# Copyright (c) 2020 <NAME>
# SPDX-License-Identifier: MIT
# See LICENSE for more information
import argparse
import contextlib
import datetime
import itertools
import fnmatch
import json
import os
from operator import itemgetter
import pathlib
import pprint
import re
import... |
import unittest
from Command import Command
from Order import Order, Orderlist
import re, json
def broken_function():
raise Exception('This is broken')
class TestStringMethods(unittest.TestCase):
def test(self):
with self.assertRaises(Exception) as context:
broken_function()
se... |
import os
import sys
import itertools
import asyncio
import pickle
from time import time
from collections import OrderedDict
from multiprocessing import Process, current_process
from multiprocessing.reduction import ForkingPickler
import pulsar
from pulsar import system, MonitorStarted, HaltServer, Config
from pulsar.... |
"""
---------- Original Work this file is based on: ----------
Published in Bioinformatics journal featuring ISMB/ECCB 2019
Title: 'Multifaceted Protein-Protein Interaction Prediction Based on Siamese Residual RCNN'
Authors: <NAME> and <NAME> and <NAME> and <NAME> and <NAME> and <NAME> and <NAME> and <N... |
""" All about Artificial star tests """
from __future__ import print_function
import argparse
import logging
import os
from astropy.io import fits
import re
import sys
import matplotlib.pylab as plt
import numpy as np
from scipy.interpolate import interp1d
from .. import astronomy_utils
logger = logging.getLogger(_... |
from detectron2.structures import BoxMode
# Some basic setup:
# Setup detectron2 logger
import detectron2
# import some common libraries
import numpy as np
import os, json, cv2, random
# import some common detectron2 utilities
from detectron2 import model_zoo
from detectron2.engine import DefaultPredictor
from detect... |
"""Library of functions and constants used by Project Euler solutions."""
import math
import string
import collections
from random import choice
import pytest
GOLDEN_RATIO = (1 + 5**.5)/2
GOLDEN_RATIO_CONJUGATE = (1 - 5**.5)/2
LOWERCASE_ALPHABET = string.ascii_lowercase
Card = collections.namedtuple('Card', ['ran... |
import sys, os
import numpy as np
import pandas as pd
import ujson
from scipy.interpolate import interp1d
import scipy.ndimage
from ast import literal_eval
from get_workflow_info import get_workflow_info
project_name = "planetary-response-network-and-rescue-global-caribbean-storms-2017"
# st thomas DG
#ssid = 1475... |
# Copyright (c) 2020, TU Wien, Department of Geodesy and Geoinformation
# 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,... |
import cv2
import numpy as np
import matplotlib.pyplot as plt
from MyDIPUtils.config import *
# check_ol1: circle[i] and circle[j] overlaps too much
# check_ol2: circle[i] lies too much outside original image
# check_ol3: compare the overlapping area between different stepsize
def direction_map(edge, clockwise):
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.