text stringlengths 6.04k 39.5k |
|---|
"""
Utility functions for logging, staging data results for external
access (S3 pre-signed URL), decrypting data using a shared secret, and
operating on message queues.
This module relies heavily on environment variables to know
which endpoints to use and how to authenticate to them as follows:
Required when receivin... |
import os,sys
import numpy as np
import math
import time
import random
import multiprocessing as mp
import torch
import torch.utils.data as data
from torch.nn.utils.rnn import pack_padded_sequence, pad_packed_sequence
import torch_models
import params
import log
from data_loader_pred import *
from data_utils import *... |
# -- coding: utf-8 --
# Copyright 2019 FairwindsOps 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 l... |
import math
from typing import List, Union, Iterable, Tuple, Sequence
import numpy as np
import pandas as pd
import sha_calc as sha_calc
from gmhazard_calc.im import IM, IMType, IMComponent, IM_COMPONENT_MAPPING
from gmhazard_calc import site
from gmhazard_calc import gm_data
from gmhazard_calc import dbs
from gmhaza... |
#!/usr/bin/env python
"""Wrapper for numpy arrays so that they can be indexed by name
>>> a = numpy.identity(3, int)
>>> b = DictArrayTemplate('abc', 'ABC').wrap(a)
>>> b[0]
===========
A B C
-----------
1 0 0
-----------
>>> b['a']
===========
A B C
--... |
from collections import OrderedDict
import random
import numpy as np
from unidecode import unidecode
class NodeType(object):
def __init__(self, num_children=None, min_children=None, max_children=None, **kw):
super(NodeType, self).__init__(**kw)
assert((num_children is not None) or (min_children is... |
import torch.nn as nn
import math
import torch.utils.model_zoo as model_zoo
import torch
from torch.nn import functional as F
import numpy as np
from ..backbone import (Backbone, BACKBONE_REGISTRY)
from ..meta_arch import SEM_SEG_HEADS_REGISTRY
from detectron2.layers import ShapeSpec
affine_par = True
... |
import collections
import json as jsonlib
import random
import re
from operator import attrgetter
from urlparse import urljoin
from django.conf import settings
from django.core.exceptions import ObjectDoesNotExist
from django.forms import CheckboxInput
from django.utils import translation
from django.utils.encoding im... |
import torch
from torch import nn
from torch.nn import functional as F
from torch.autograd import Variable
import torch.optim as optim
from torch.autograd import Function
import math
from torchvision import transforms
import logging
from .segment import parse_args, DRNSeg, SegList, SegListSeg, SegListSegAdv
import os.p... |
#!/usr/bin/env python3
#
# TImestream DAta Storage (TIDAS).
#
# Copyright (c) 2015-2019 by the parties listed in the AUTHORS file. All rights
# reserved. Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from __future__ import absolute_import, division, print_functio... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import argparse
import codecs
import distutils.spawn
import os.path
import platform
import re
import sys
import subprocess
from functools import partial
from collections import defaultdict
try:
from PyQt5.QtGui import *
from PyQt5.QtCore import *
from PyQt5.Qt... |
from aimacode.planning import Action
from aimacode.search import Problem
from aimacode.utils import expr, Expr
from lp_utils import decode_state
class PgNode():
"""Base class for planning graph nodes.
includes instance sets common to both types of nodes used in a planning graph
parents: the set of nodes ... |
#-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2021, Anaconda, Inc., and Bokeh Contributors.
# All rights reserved.
#
# The full license is in the file LICENSE.txt, distributed with this software.
#-------------------------------------------------------------------... |
################################################################################
####################### A* ALGORITHM ###########################################
################################################################################
# A* algorithm
class Node:
"""A node class for A* Pathfinding"""
def ... |
"""Given this has been a reoccuring trend where the confusion matrix needs
calculated and certain metrics need calculated FROM the confusion matrix, add
__tested__ metrics derived from the confusion matrix for efficient
computation.
"""
import logging
import os
import h5py
import numpy as np
import pandas as pd
from p... |
import datetime
import json
import re
import colorsys
import difflib
import logging
import tagging
import auxiliary.tag_suggestions
from actstream import action
from django.contrib import messages
from django.contrib.auth.decorators import login_required
from django.contrib.contenttypes.models import ContentType
from... |
# Copyright (c) 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Module containing utilities for apk packages."""
import contextlib
import logging
import os
import re
import shutil
import tempfile
import zipfile
f... |
#External Imports
import pandas as pd
import numpy as np
from shapely.geometry import Point
import geopandas as gpd
from scipy.interpolate import interp1d
from scipy.spatial import distance_matrix
from typing import Union
import folium
from folium.plugins import MarkerCluster, MeasureControl,MousePosition#,LocateContr... |
""" Python back-end. Generates python code from ir-code. """
import contextlib
import io
import logging
import time
from ... import ir
from ...graph import relooper
def literal_label(lit):
""" Invent a nice label name for the given literal """
return '{}_{}'.format(lit.function.name, lit.name)
def ir_to_py... |
# Copyright The PyTorch Lightning team.
#
# 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 i... |
from __future__ import absolute_import
from __future__ import division
import errno
import os
import select
import six
import string
import sys
from pwnlib.term import keyconsts as kc
from pwnlib.term import termcap
__all__ = ['getch', 'getraw', 'get', 'unget']
# When set, convert keypad codes into regular key pres... |
"""Visualizes fit models with matplotlib."""
import logging
import pathlib
from typing import Any, Dict, List, Optional
import matplotlib as mpl
import matplotlib.pyplot as plt
import numpy as np
from cabinetry.visualize import utils
log = logging.getLogger(__name__)
def data_mc(
histogram_dict_list: List[Di... |
# Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... |
from typing import TYPE_CHECKING
import logging
from qtpy.QtCore import (QEvent, QObject, QPoint, QRect, QSize, QXmlStreamReader, Qt)
from qtpy.QtGui import QCloseEvent, QCursor, QGuiApplication, QHideEvent, QMoveEvent
from qtpy.QtWidgets import QApplication, QBoxLayout, QWidget, QDockWidget
from .enums import DockWi... |
# Copyright 2019 TerraPower, 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 writi... |
import settings
import helpers
import sys
import os
import glob
import random
import pandas
import ntpath
import cv2
import numpy
from typing import List, Tuple
from keras.optimizers import Adam, SGD
from keras.layers import Input, Convolution2D, MaxPooling2D, UpSampling2D, merge, Convolution3D, MaxPooling3... |
import sys
import argparse
import logging
import time
def pase_info(seq):
info = {'SVLEN': 0, 'END': 0, "SVTYPE": '', "RE": 0, "CHR2": ''}
for i in seq.split(';'):
if i.split('=')[0] in ["SVLEN", "END", "RE"]:
try:
info[i.split('=')[0]] = abs(int(float(i.split('=')[1])))
except:
pass
if i.split('='... |
'''
Check for IOOS-approved attributes
'''
from __future__ import unicode_literals
from compliance_checker.base import BaseCheck, BaseNCCheck, BaseSOSGCCheck, BaseSOSDSCheck, check_has, Result
from owslib.namespaces import Namespaces
from lxml.etree import XPath
from compliance_checker.cfutil import get_geophysical_var... |
from django.core.exceptions import PermissionDenied
from django.urls import reverse
from django.utils.safestring import mark_safe
from django.utils.translation import ugettext as _
from django.utils.translation import ugettext_lazy, ugettext_noop
from memoized import memoized
from corehq.apps.commtrack.models import ... |
import os
import git
import threading
import time
import logging
import uuid
import json
from tethys_cli.install_commands import (
install_command, open_file, validate_schema)
from tethys_sdk.workspaces import app_workspace
from rest_framework.authentication import TokenAuthentication
from rest_framework.decorato... |
# Copyright (c) 2010-2020 <NAME>
# License: MIT License
from typing import List, TYPE_CHECKING, Iterable, Union, Sequence
import math
from functools import lru_cache
from ezdxf.math import (
Vec3, Vec2, tridiagonal_matrix_solver, Matrix44
)
from ezdxf.math.ellipse import ConstructionEllipse
if TYPE_CHECKING:
f... |
"""
**results** module provides the logic to format, save and read predictions generated by the *automl frameworks* (cf. ``TaskResult``),
as well as logic to compute, format, save, read and merge scores obtained from those predictions (cf. ``Result`` and ``Scoreboard``).
"""
from functools import partial
import collect... |
"""
(c) by <NAME> and <NAME>
"""
import array
import numpy as np
import pandas as pd
import os
import sys
import requests
import xarray as xr
from imdlib.util import LeapYear, get_lat_lon, total_days, get_filename
from datetime import datetime
class IMD(object):
"""
Class to handle binary (.grd) IMD gridded ... |
# -*- coding: utf-8 -*-
import numpy as np
from torch import nn as nn
import torch
import logging
import os
from compress_tools.Matrix2MPO_beta import MPO
from torch.nn import functional as F
from torch import nn
os.environ['KMP_DUPLICATE_LIB_OK']='True'
logger = logging.getLogger(__name__)
def linear_act(x):
ret... |
# coding: utf-8
from __future__ import unicode_literals
import random
import re
from .common import InfoExtractor
from ..compat import compat_urllib_parse_unquote
from ..utils import (
ExtractorError,
int_or_none,
parse_age_limit,
parse_duration,
)
class NRKBaseIE(InfoExtractor):
_faked_ip = Non... |
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torchvision import models
class NetworkParameters(object):
def __init__(self, architecture, n_primitives=32,
mu=0.0, sigma=0.001, add_gaussian_noise=False,
use_s... |
import os
import time
import numpy as np
import pandas as pd
from PIL import Image, ImageDraw
from scipy import interpolate
from skimage import filters
from skimage.morphology import disk, binary_dilation
import multiprocessing
import scipy.interpolate as spint
import scipy.spatial.qhull as qhull
import itertools
# =... |
#!/usr/bin/env python
#
# Decoder from EspNet's e2e_asr.py.
#
import argparse
import datetime
import logging
import random
import six
import numpy as np
import chainer
from chainer.backends import cuda
import chainer.functions as F
import chainer.links as L
from chainer import training
from chainer.training import e... |
#!/usr/bin/python
# (c) 2018-2019, NetApp Inc.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
... |
from __future__ import unicode_literals
from django.shortcuts import render, get_object_or_404
from djoser.conf import settings as dj_settings
from django.http import HttpResponse, JsonResponse
from rest_framework import status
from .models import *
import json
from django.forms.models import model_to_dict
from... |
"""Arcam AV Control"""
import asyncio
import enum
import logging
import sys
from typing import Union
import attr
PROTOCOL_STR = b'\x21'
PROTOCOL_ETR = b'\x0D'
PROTOCOL_EOF = b''
_LOGGER = logging.getLogger(__name__)
_WRITE_TIMEOUT = 3
_READ_TIMEOUT = 3
class ArcamException(Exception):
pass
class ConnectionFail... |
import zipfile
from zipfile import ZipFile
import os
from os import path as osp
import shutil
import pdb
from PIL import Image, ImageFilter
import io
import re
import xml.etree.ElementTree as ET
from docx import Document
import argparse
import sys
#from docx.shared import Inches
########################... |
# Generates C++ autograd functions for the derivatives of ATen operations
#
# This writes two files:
# Functions.h/cpp: subclasses of autograd::Node
# python_functions.h/cpp: Python bindings for the above classes
#
from .gen_inplace_or_view_type import VIEW_FUNCTIONS
from typing import List, Sequence, Tuple
from to... |
import argparse
import os
import cox.store
import numpy as np
import torch as ch
from cox import utils
from robustness import datasets, defaults, model_utils, train_eval_sample
from robustness.tools import helpers
from torch import nn
from torchvision import models
from utils import constants as cs
from utils import ... |
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
import atexit
import os
import os.path as osp
import re
import shlex
import shutil
import sys
import uuid
from datetime import datetime
from glob import glob
from pathlib import Path
from subprocess import PIPE
from sub... |
import utils.correspondence_tools.correspondence_finder as correspondence_finder
import numpy as np
import torch
import torch.nn as nn
from utils.homographies import scale_homography_torch
from utils.loss_functions.pixelwise_contrastive_loss import PixelwiseContrastiveLoss
def get_coor_cells(Hc, Wc, cell_size, device... |
import json
import os
MAX_NODES = 1000
raphael_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'raphael.js')
treant_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'treant.js')
def generate_html(parsed_json):
global current_tone, execution_time, total_nodes
# tones for the differen... |
# -*- coding: utf-8 -*-
# Copyright © 2012-2015 <NAME> and others.
# 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, c... |
from typing import List, Dict, Any, Set
import torch
import trtorch._C
from trtorch import _types
from trtorch.Input import Input
from trtorch.Device import Device
import warnings
def _supported_input_size_type(input_size: Any) -> bool:
if isinstance(input_size, torch.Size):
return True
elif isinstan... |
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use ... |
f"""基本操作"""
import json
import re
import threading
from collections import defaultdict
from io import BytesIO
from itertools import count as iter_count
from bson import ObjectId
import jieba
import pandas
import json
import itertools
from opencc import OpenCC
import pykakasi
from transliterate import tr... |
__author__ = 'RenardDev'
__url__ = 'https://github.com/RenardDev/CryptICE'
__version__ = '2.0'
__all__ = [
'IceKey'
]
class RLIST(list):
'''RestrictLIST'''
def __setattr__(self, name, value):
raise AttributeError('AttributeError: \'{}\' object has no attribute \'{}\''.format(type(self), name))
def... |
# -*- coding: utf-8 -*-
from django.contrib import messages
from django.contrib.auth.decorators import login_required
from django.http import Http404, HttpResponse
from django.shortcuts import get_object_or_404, render, redirect
from django.utils.timezone import now
from django.utils.translation import ugettext_lazy a... |
########################################################################
# Author: <NAME>, <NAME>
# License: Apache 2.0
# source code snippets from: Tensorflow
########################################################################
import numpy as np
import pickle
import os
import download
import random
#from PIL im... |
import json
import os
import pickle
import sys
import tarfile
import tempfile
import shutil
import docker
from uuid import uuid4
from docker.types import Mount
# ################ #
# GLOBAL VARIABLES #
# ################ #
client = docker.from_env()
api_client = docker.APIClient(base_url='unix://var/run/docker.sock')... |
"""Contains the StateDelta class for keeping track of differences between game states after taking actions."""
from dataclasses import dataclass
from typing import List, Dict, Any, Optional, Tuple
from agent.environment import agent
from agent.environment import agent_actions
from agent.environment import card
from ag... |
# Copyright (C) The Arvados Authors. All rights reserved.
#
# SPDX-License-Identifier: Apache-2.0
from future import standard_library
standard_library.install_aliases()
from builtins import str
from past.builtins import basestring
from future.utils import viewitems
import re
import logging
import uuid
import os
impor... |
"""
Description of Arrays or Subarrays of telescopes
"""
import warnings
from contextlib import ExitStack
from copy import copy
from itertools import groupby
from typing import Dict, List, Union
import numpy as np
import tables
from astropy import units as u
from astropy.coordinates import SkyCoord
from astropy.table ... |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from __future__ import annotations
import logging
from collections import namedtuple
from itertools import tee
from typing import Dict, List,... |
from __future__ import annotations
import difflib
import inspect
import json
import logging
import os
import pathlib
from typing import List, Optional, Tuple
import jinja2
import numpydoc
import numpydoc.docscrape
import pcdsutils.utils
import requests
import requests.exceptions
from atlassian import Confluence
log... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Apr 7 14:51:39 2020
@author: zack
"""
from pandas.tseries.offsets import DateOffset
from scipy import stats
import seaborn as sns
import pandas as pd
import numpy as np
from scipy import stats
#TODO: add onset to test taken time and onset to test con... |
from pyg_base import drange, Calendar, calendar, clock, dt, date_range, DAY, timer, eq, as_time, TMIN, TMAX, dt_bump
import datetime
import pandas as pd; import numpy as np
import pytest
from pyg_base._drange import _quarter_clock
t0 = dt(0)
def test_date_range():
assert date_range(-10) == [dt(0) - 10 * DAY, dt(0)... |
# coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
"""
This module provides classes to identify optimal substrates for film growth
"""
from itertools import product
import numpy as np
from pymatgen.analysis.elasticity.strain import Deformation
from pymatgen.c... |
# =============================================================================
# periscope-ps (unis)
#
# Copyright (c) 2012-2016, Trustees of Indiana University,
# All rights reserved.
#
# This software may be modified and distributed under the terms of the BSD
# license. See the COPYING file for details.
#
# T... |
r'''
<MIT License>
Copyright (c) 2013 <NAME> <<EMAIL>>
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, pu... |
"""
Longest common subsequence problem
"""
import pickle
import os
import re
from lab_2.tokenizer import tokenize
def tokenize_by_lines(text: str) -> tuple:
"""
Splits a text into sentences, sentences – into tokens,
converts the tokens into lowercase, removes punctuation
:param text: the initial text
:return:... |
# -*- coding: utf-8 -*-
"""
==================================================
File Name: Load_Model.py
email: <EMAIL>
Author : songdongdong
date: 2020/12/9 01:34
Description : 加载模型
==================================================
"""
# import tensorflow.compat.v1 as tf
i... |
import json
import os
from typing import Any
from typing import Callable
from typing import Dict
from typing import List
from typing import Optional
from typing import Union
import optuna
from optuna import load_study
from optuna import Trial
from optuna._experimental import experimental
from optuna._imports import tr... |
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.cm as cm
from matplotlib.colors import LinearSegmentedColormap
import capsule_distance
capsule = capsule_distance.Capsule(0.18, -0.5, 0.45)
capsule_larger = capsule_distance.Capsule(0.18, -0.5, 0.5)
def cmap_map(function, cmap):
""" Applies fun... |
import collections
from typing import Tuple, List
from . import BaseTokenizer
from .helper import convert_to_unicode, whitespace_tokenize, is_punctuation, is_whitespace, is_control
class BasicTokenizer:
"""Runs basic tokenization (punctuation splitting, lower casing, etc.)."""
def __init__(self, do_lower_ca... |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import... |
import re
import sublime
from sublime import CLASS_WORD_START
from sublime import CLASS_WORD_END
from sublime import CLASS_PUNCTUATION_START
from sublime import CLASS_PUNCTUATION_END
from sublime import CLASS_LINE_END
from sublime import CLASS_LINE_START
from sublime import CLASS_EMPTY_LINE
from Vintageous.vi import ... |
# -*- coding: utf-8 -*-
"""Windows EventLog resources database reader."""
import collections
import os
import sqlite3
from plaso.containers import artifacts
from plaso.engine import path_helper
from plaso.helpers.windows import resource_files
from plaso.output import logger
class Sqlite3DatabaseFile(object):
"""C... |
#!/usr/bin/env python
"""
run_csymmatch
# Gives pdb with oriented model
create copy of csymmatch pdb with residue numbering matching native and rename chain to X
concatenate the native and reformatted csymmatch pdb
run ncont to generate contacts
parse ncont file to generate map & analyse whether placed bits match and ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = '<NAME>'
__copyright__ = 'Copyright 2020'
__date__ = '26/11/20'
__credits__ = ['<NAME>', '<NAME>', ]
__license__ = 'CC0 1.0 Universal'
__version__ = '0.1'
__maintainer__ = 'IFAE Control Department'
__email__ = '<EMAIL>'
import socket
import logging
from threa... |
import xml.etree.ElementTree as ET
from xml.dom import minidom
import uuid
import re
import os
import mtm.ioc.Container as Container
from mtm.ioc.Inject import Inject
from mtm.ioc.Inject import InjectMany
import mtm.ioc.IocAssertions as Assertions
from mtm.util.Assert import *
from prj.main.ProjenyConstants import P... |
#!/bin/env python
"""ThorLabs Motion control GUI
Author: <NAME>
Date: March 16, 2018 -
version: 0.1
"""
import psutil, os
#p = psutil.Process(os.getpid())
#p.nice(psutil.HIGH_PRIORITY_CLASS) #source: https://psutil.readthedocs.io/en/release-2.2.1/
# psutil.ABOVE_NORMAL_PRIORITY_CLASS
# psutil.BELOW_NORMAL_PRIORITY... |
from scipy.ndimage.filters import maximum_filter1d
import numpy as np
import time
import mxnet as mx
import mxnet.ndarray as nd
from numba import njit, float32, int32, vectorize
from . import utils, metrics
@njit('(float32[:], float32[:,:], int32[:], int32[:],int32, int32)')
def neighbor_flow(p, alpha, y, x, Lx, niter... |
# Copyright (c) 2013 eBay Inc.
# Copyright (c) 2013 OpenStack Foundation
#
# 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
#
# ... |
# #!/usr/bin/env python
# -*- coding: utf-8 -*-
# <HTTPretty - HTTP client mock for Python>
# Copyright (C) <2011-2013> <NAME> <<EMAIL>>
#
# 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... |
import datetime
import glob
import gzip
import importlib
import io
import json
import logging
import os
import shutil
import stat
import tarfile
import uuid
from typing import TYPE_CHECKING
from urllib.parse import urlparse
import requests
from ..bundle.config import SavedBundleConfig
from ..bundle.loader import _is_... |
from collections import OrderedDict
from django_tables2 import RequestConfig
from django.contrib import messages
from django.contrib.contenttypes.models import ContentType
from django.core.exceptions import ValidationError
from django.core.urlresolvers import reverse
from django.db import transaction, IntegrityError
f... |
"""Creates easy frame comparisons between multiple VapourSynth clips."""
__author__ = 'Dave <<EMAIL>>'
__date__ = '16 February 2020'
import os
from contextlib import contextmanager
from functools import partial
from math import floor, sqrt
from random import randint, sample
from typing import List, Union
import vapou... |
from abc import ABC, abstractmethod
from typing import Tuple, Union, Type, Iterable, Callable, Any, Optional
import numpy as np
from scipy import integrate as integrate
from chromathicity.error import raise_not_implemented
from chromathicity.math import interp1
from chromathicity.util import construct_component_inds
... |
#To run the program:
#Have a file named 'links.dat', where
#line 1 contains the name of the .json file. Ex: RankingSquash.json
#line 2 contains the spreedsheet ID. Ex: 1NwVZDsYIb7dNAI6SFI5mSaYdSz3BwrM7UoBW0DG-Pb4
#To change initial month, go to function generate_months_list, line 296
from math import *
import numpy... |
# python3.7
"""Misc utility functions."""
import os
import sys
import subprocess
from importlib import import_module
import argparse
from easydict import EasyDict
import cv2
import numpy as np
from utils.visualizer import plt_show
import torch
import torch.distributed as dist
import torch.multiprocessing as mp
import... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
EZ Perspective
A Gimp plug-in to easily change the perspective in an image,
just like it says on the tin.
Particularly useful for correcting photographs,
but can also be used to add a Dutch angle to any image.
Provides 3 parameters to change up/down (tilt, pitch),
left/... |
# -*- coding: utf-8 -*-
# cython: language_level=3
# BSD 3-Clause License
#
# Copyright (c) 2020-2022, Faster Speeding
# 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 sour... |
#!/usr/bin/env python
import argparse
import pathlib
import time
from custom_loss.llv_loss import LocalLipschitzValueLoss
from pytorch_image_classification.models import create_input_sigmoid_model
try:
import apex
except ImportError:
pass
import numpy as np
import torch
import torch.nn as nn
import torch.dis... |
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import annotations
import os
from dataclasses import dataclass
from pathlib import PurePath
from typing import Any, Mapping, Sequence
from pants.engine.engine_aware impor... |
import abc
from collections import defaultdict
import contextlib
import re
import os
import logging
import subprocess
import hashlib
import time
import statistics
from datetime import datetime
logging.basicConfig(level=logging.DEBUG)
class Implementation(object):
"""Contains some properties of a scheme implemen... |
"""
Copyright (c) 2018 iCyP
Released under the MIT license
https://opensource.org/licenses/mit-license.php
"""
import math
import struct
from sys import float_info
from typing import Any, Dict, List, Optional, Sequence, Union, cast
import bpy
class Gltf:
TEXTURE_INPUT_NAMES = [
"color_texture",
... |
from abc import ABC, abstractmethod
from distutils.version import LooseVersion
import ctypes
import math
import warnings
import torch
import typing
import numpy as np
from .. import tflite as tfl
from tinynn.util.util import get_logger
log = get_logger(__name__, 'INFO')
class OperatorConverter(ABC):
def __in... |
from __future__ import print_function, division, absolute_import
import io
import os
from toolz import merge, partial
from warnings import warn
from .compression import seekable_files, files as compress_files
from .utils import (SeekableFile, read_block, infer_compression,
infer_storage_options, ... |
# -*- coding: utf-8 -*-
#
# Copyright 2018-2020- Swiss Data Science Center (SDSC)
# A partnership between École Polytechnique Fédérale de Lausanne (EPFL) and
# Eidgenössische Technische Hochschule Zürich (ETHZ).
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in co... |
import datetime as dt
import matplotlib.pyplot as plt
from matplotlib import cm
import networkx as nx
import numpy as np
import osmnx as ox
import pandas as pd
import pickle
import pydeck as pdk
import scipy
import scipy.interpolate as interpolate
import streamlit as st
import timeit
import s3fs
import pytz
# Thanks t... |
"""
Throne Master Parsing Script - Models
It's not pretty, but it's mine.
Used to create the database objects used to commit data from logs to postgres.
"""
from sqlalchemy import Column, Integer, String, DateTime, Boolean, ForeignKey
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import ... |
import pandas as pd
import numpy as np
import altair as alt
from altair import datum
from datetime import datetime
import altair_saver as alts
import os.path
import plotting_functions as pf
WARNING = '\033[93m'
FAIL = '\033[91m'
ENDC = '\033[0m'
# ---- Failure analysis ---------------------------
repeats = 1
def v... |
import numpy as np
from astropy.table import Table
from astropy import units as u
from astropy.coordinates import SkyCoord, search_around_sky
from pymoc import MOC
from utils import inMoc
#from tqdm import tqdm, tnrange, tqdm_notebook
from concurrent.futures import ProcessPoolExecutor, as_completed
#from test import ge... |
from scipy.stats import gamma,norm,beta,truncnorm
import numpy as np
def transform_uniform(x,a,b):
return a + (b-a)*x
def transform_loguniform(x,a,b):
la=np.log(a)
lb=np.log(b)
return np.exp(la + x*(lb-la))
def transform_normal(x,mu,sigma):
return norm.ppf(x,loc=mu,scale=sigma)
def transform_bet... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.