text stringlengths 8.04k 46.5k |
|---|
'''
@author: <NAME>
@author: 2016-04-12
@organization: MLSB API
@summary: A base test class for testing API
'''
from api import app, DB
from pprint import PrettyPrinter
from api.model import Player, Team, Sponsor, League, Game, Bat, Espys, Fun, \
Division
from base64 import b64encode
from datetime import date
from ... |
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.utils.checkpoint as cp
from torch.nn import init
from collections import OrderedDict
import numpy as np
class double_conv(nn.Module):
'''(conv => BN => ReLU) * 2'''
def __init__(self, in_ch, out_ch):
super(doub... |
from dearpygui import *
from contextlib import contextmanager
from functools import wraps
from math import sin, cos
########################################################################################################################
# Helpers
########################################################################... |
# ------------------------------------------------------------------------------
# Copyright (c) Microsoft
# Licensed under the MIT License.
# Written by <NAME> (<EMAIL>)
# Modified by <NAME> (https://github.com/xingyizhou/CenterTrack/blob/master/src/lib/utils/image.py)
# Then modified by <NAME>
# ---------------------... |
from datetime import datetime
from django.core.paginator import Paginator, PageNotAnInteger, EmptyPage
from django.shortcuts import render, redirect
from django.template.loader import render_to_string
from .forms import jsForm, FCMForm, FCMCONCEPTForm, FiltersForm, SortMapsForm, FCMEDGEForm
from .models import FCM
fro... |
"""
A Tkinter - based console for conversing with the Python interpreter,
featuring more tolerant pasting of code from other interactive sessions,
better handling of continuations than the standard Python interpreter,
highlighting of the most recently - executed code block, the ability to
edit and reexecute previously ... |
from collections import OrderedDict
from functools import reduce
import numpy as np
import matplotlib.collections as mcoll
import matplotlib.mlab as mlab
import matplotlib.cbook as cbook
from classes.om import ObjectManager
from classes.ui import UIManager
from classes.ui import RepresentationController
from classes.... |
"""
Callable objects that generate numbers according to different distributions.
"""
import random
import operator
import hashlib
import struct
import fractions
from math import e,pi
import param
from param import __version__ # noqa: API import
class TimeAware(param.Parameterized):
"""
Class of objects t... |
#Copyright (C) 2021 <NAME>, <NAME>, University of California, Berkeley
#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 applic... |
# -*- coding: utf-8 -*-
import datetime
import json
import logging
from urllib import urlencode
from django.core.exceptions import ObjectDoesNotExist
from django.core.urlresolvers import reverse
from django.utils.encoding import smart_unicode
from django.utils.translation import ungettext, ugettext as _
from django.... |
# -*- coding: utf-8 -*-
"""
@author: <NAME>
@description: Module containing functions to calculate derivatives, averages, decompositions, vorticity.
@contact: <EMAIL>
"""
# Imports
import numpy as np
import warnings
# Functions
def avg_z(u):
"""
Return the span-wise spatial average of a three-dimensional field.
If ... |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from __future__ import absolute_import, division, print_function
import copy
import numpy as np
import healpy as hp
from scipy.interpolate import RegularGridInterpolator
from scipy.ndimage.interpolation import map_coordinates
from astropy.io import fits
fr... |
# -*- coding: utf-8 -*-
#------------------------------------------------------------------------------
# file: $Id$
# lib: genemail.util
# auth: <NAME> <<EMAIL>>
# date: 2013/07/09
# copy: (C) Copyright 2013 Cadit Health Inc., All Rights Reserved.
#---------------------------------------------------------------------... |
# based in part of:
# https://github.com/brunchboy/dysentery
# https://bitbucket.org/awwright/libpdjl
from construct import Adapter, Array, Byte, Const, CString, Default, Embedded, Enum, ExprAdapter, FlagsEnum, FocusedSeq, GreedyBytes, GreedyRange, Int8ub, Int16ub, Int32ub, Int64ub, Int16ul, Int32ul, Padded, Padding, ... |
# Copyright 2014 OpenCore 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,... |
from __future__ import print_function
import csv
import configparser
import numpy as np
import vcf
import pysam
import os
import re
from . import svp_load_data
from . import count
from . import svDetectFuncs as svd
from . import bamtools
from . import svp_dtypes as dtypes
def classify_event(sv, sv_id, svd_prev_result... |
#!/usr/bin/env python
"""
originally adapted from:
http://stackoverflow.com/questions/4163740/qtreeview-with-drag-and-drop-support-in-pyqt?rq=1
and:
http://kylemr.blogspot.com/2013/04/pyqt-drag-and-drop-outliner-like.html
great video tutorials on Model View programming in Qt/PyQt/PySide:
http://www.yasinuludag.com/bl... |
'''Collection of functions that generate figures from the fit outputs. Creates figures from fit results using both simulated and real datasets.'''
from fancy.analysis import results
import numpy as np
import os
import h5py
import matplotlib as mpl
from matplotlib import pyplot as plt
import seaborn as sns
from pandas ... |
import numpy as np
from MagniPy.lensdata import Data
import subprocess
import shutil
import scipy.ndimage.filters as sfilt
import itertools
from copy import deepcopy
def dr(x1,x2,y1,y2):
return np.sqrt((x1-x2)**2+(y1-y2)**2)
def snap_to_bins(data, xbin_centers, dx, ybin_centers, dy, ranges):
new_datax = deep... |
import testing
from testing import value_eq,object_eq
associated_files = dict()
def get_files():
return testing.collect_unit_test_file_paths('vasp_analyzer',associated_files)
#end def get_files
relax_files = [
'relax.CONTCAR',
'relax.DOSCAR',
'relax.EIGENVAL',
'relax.err',
'relax.IBZKPT',
... |
r"""
Morphisms of Toric Varieties
There are three "obvious" ways to map toric varieties to toric
varieties:
1. Polynomial maps in local coordinates, the usual morphisms in
algebraic geometry.
2. Polynomial maps in the (global) homogeneous coordinates.
3. Toric morphisms, that is, algebraic morphisms equivariant ... |
import collections
import copy
import functools
import itertools
import json
import time
import warnings
from sentinels import NOTHING
from .filtering import filter_applies, iter_key_candidates
from . import ObjectId, OperationFailure, DuplicateKeyError
from .helpers import basestring, xrange
try:
from collections... |
# -*- coding: utf-8 -*-
"""
legendwidget.py - legendwidget file for gabbs maps
======================================================================
AUTHOR: <NAME>, Purdue University
EMAIL: <EMAIL>
Copyright (c) 2016 Purdue University
See the file "license.terms" for information on usage and
redistribution ... |
# Copyright (c) 2019 Riverbed Technology, Inc.
#
# This software is licensed under the terms and conditions of the MIT License
# accompanying the software ("License"). This software is distributed "AS IS"
# as set forth in the License.
"""
This module contains a number of utilities for working with
dates and times, i... |
"""
Write and Read MESS files for Rates
"""
import importlib
import copy
import automol
import autorun
import mess_io
from mechlib.amech_io import printer as ioprinter
from mechroutines.models import blocks
from mechroutines.models import build
from mechroutines.models import etrans
from mechroutines.models import tun... |
#
# Copyright 2016 the original author or authors.
#
# 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... |
#XXX bug: [FIXED] reloading the script in the script manager freezes the interface, user is required to terminate the application
#XXX bug: init does not pay regard to the current enabledness of the script
#XXX bug: [FIXED] updated paths to reflect new streamlabs system layout
#XXX version 1.0.1.0: changes to be compa... |
from django.http import HttpResponse, JsonResponse
from django.shortcuts import get_object_or_404, render
from django.views.decorators.cache import cache_page
from django.utils.cache import add_never_cache_headers
from .models import Website, WebsiteCall, Publication, Tag, CuratedWebsite, GlobalStatistics
from datetime... |
from django_tables2 import RequestConfig
import netaddr
from django.contrib.auth.decorators import permission_required
from django.contrib.auth.mixins import PermissionRequiredMixin
from django.contrib import messages
from django.core.urlresolvers import reverse
from django.db.models import Count, Q
from django.shortc... |
# -*- coding: utf-8 -*-
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright (C) 2012-2018 GEM Foundation
#
# OpenQuake is free software: you can redistribute it and/or modify it
# under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the Licen... |
# -*- encoding: utf-8 -*-
from json import encoder
import multiprocessing
import time
import json
import yaml
import os
import math
import numpy as np
import pandas as pd
from pandas import DataFrame as df
from itertools import product
from random import random, choice, seed
from typing import Tuple
from deap import... |
import ee
import eemont
from geetools import tools, cloud_mask
import geemap
import hydrafloods as hf
import hydrafloods.depths as hfd
from hydrafloods import geeutils, corrections
from urllib.request import urlretrieve
import shutil
from geetools.utils import makeName
import os
def DSWE(imgCollection, DEM, aoi=None):... |
import sqlite3
import os
import asyncio
from datetime import date, timedelta
from decimal import Decimal as D
import db.cache
attach_lock = asyncio.Lock() # to ensure that two processes don't try to attach at the same time
def customise(constants, DbConn, db_params):
# add db-specific methods to DbConn class
... |
#!/usr/bin/env python
# Contributed September 2019 by Fraunhofer SIT (https://www.sit.fraunhofer.de/en/).
import unittest
import os
import cle
from cle.backends.macho.binding import BindingState, read_sleb, read_uleb
from cle.backends.macho.binding import (
n_opcode_done,
n_opcode_set_dylib_ordinal_imm,
... |
import csv
import re
from EditDistance import *
from Edit_distance import Edit_distance
from freq_json import freq, abrir_freq
from EditDistance import SequenceMatcher
def concantena_tipo_input(classes, frase):
classes += frase.tipo[0]
def concantena_tipo_regras(regras, tipo_regras):
regras.append(tipo_regras)
... |
# -*- coding: utf-8 -*-
"""
Created on Thu May 6 08:01:51 2021
@author: 86159
"""
import math
import os
import numpy as np
# import matplotlib.pyplot as plt
import json
import pandas as pd
# import random
import time
import copy
# import datetime
# from threading import Timer
import time
BASE_DIR = os.path.dirname(... |
# pylint: disable-msg=E0611,E0401,C0103,W0703,R0903
"""Core API calls and classes for ProgBG
This module contains all related API calls for creating and managing
plan.py files. Special global variables are used to keep track
of registered backends and benchmarks.
"""
import os
import sys
import importlib
import insp... |
import unittest
import abc
import glob
import hashlib
from pymongo import MongoClient
from bson.objectid import ObjectId
from gridfs import GridOut
from sample_manager.SampleManager import UsernameException
from main import app
class BaseAbstractSampleManagerTestsClass(unittest.TestCase, abc.ABC):
"""
abstr... |
import torch
import torch.nn as nn
from torch.nn import Linear, Conv2d, BatchNorm2d, LeakyReLU, ConvTranspose2d, ReLU, Tanh, InstanceNorm2d
import torch.nn.functional as F
import numpy as np
import torch.optim as optim
import torch.autograd as autograd
from torch.autograd import Variable
# Relu + Conv + BN block
class... |
""" Freshwater/Salt Transport
- freshwater relative to 35 g/kg
- taking partial bottom cells of high resolution POP grid into account
if called directly, this scripts calculates:
(1) the total salt/volume/freshwater flux through Bering Strait and Strait of Gibraltar
-> f'{path_prace}/Mov/FW_Med_Bering_{run}_{y:04d}.... |
##
## nw_spectrum
##
## <NAME>
## Last modified: 2013-03-08
##
## Python script for parsing NWChem output for TDDFT/vspec excitation
## energies, and optionally Lorentzian broadenening the spectra. For
## online help run:
##
## nw_spectrum --help
##
##
import sys
import textwrap
from optparse import OptionParser
ver... |
#Libraries used:
from random import randint #used for picking random numbers for generating cards
from time import sleep #used to add delay to increase tension when playing
#Card list:
#1-9 in red, yellow and blue
#K in white
#round counter in white
#0 in white
#Priority:
#Highest card always wins (W in white beats ... |
from config import time, render_template, os, escape, secure_filename
from history import saveHistory
import threading
result = []
file1ResultPositions = {}
file2ResultPositions = {}
colorNumberAvlabel = 7
class myThread (threading.Thread):
def __init__(self, file1SubTextID, file2SubTextID, file1SubTextPosition, fi... |
from __future__ import print_function
import argparse
import errno
import glob
import time
import numpy as np
import os
import random
import shutil
import torch
import torch.backends.cudnn as cudnn
import torch.nn as nn
import torch.nn.functional as F
import torch.nn.parallel
import torch.nn.parallel
import torch.opt... |
#!/usr/bin/env python
import os.path
import subprocess
import matplotlib.pyplot as plt
import collections
import scipy
import pylab
import numpy as np
from Bio import SeqIO
from Bio.Seq import Seq
from Bio.SeqRecord import SeqRecord
from Bio.Alphabet import IUPAC
from Bio.SeqFeature import SeqFeature, FeatureLocation
... |
# -*- -*-
"""
Author: <NAME>
This is multivariate linear regression implementation from scratch
"""
import matplotlib.pyplot as plt
import numpy
## Statistical Function
def list_multiplication(dm1,dm2):
if length(dm1) == length(dm2):
return [b*c for b,c in zip(dm1,dm2)]
elif length(dm1) == 1 or length(dm2) == 1:
... |
from __future__ import absolute_import, division, print_function
import itertools
import logging
import os
import shutil
import time
import uuid
import xml.dom.minidom
import sys
import random
from pbcommand.cli import registry_builder, registry_runner, QuickOpt
from pbcommand.pb_io.report import fofn_to_report
from ... |
"""
Routines for the analysis stage of an MMVT calculation
"""
from collections import defaultdict
import numpy as np
import scipy.linalg as la
import seekr2.modules.common_analyze as common_analyze
def openmm_read_output_file_list(output_file_list, max_time=None,
existing_lines=[]... |
from __future__ import annotations
from typing import List, Union, Optional, Any, Dict, Set, TypeVar, Generic, NoReturn, Tuple
from collections import OrderedDict
from ml.utils.visitor import Visitor, TreeT, ResultT
ParentT = TypeVar("ParentT")
"""
Visits a Kore AST in post-order traversal
"""
KoreVisitor = Visitor[... |
from __future__ import absolute_import, division, print_function, unicode_literals
from decimal import Decimal as D
import os
import balanced
import mock
from gratipay.billing.exchanges import create_card_hold
from gratipay.billing.payday import NoPayday, Payday
from gratipay.exceptions import NegativeBalance
from g... |
from enum import Enum
from ProGED.generators.base_generator import BaseExpressionGenerator
from ProGED.equation_discoverer import EqDisco
import numpy as np
import torch
from torch.autograd import Variable
import torch.nn.functional as F
import torch.nn as nn
from torch.utils.data import Dataset, Sampler
from tqdm im... |
def download_data_fn(price_data, account, pnt_stmnt):
'''
This function validates the call for downloading pricing data by
checking if the US markets are open and by checking if the price
data is the latest
'''
download_data = False # Initialize
if account > '':
if Today.dayofweek ... |
"""AFRIFT PyQt5 specific classes
"""
import os
import sys
import PyQt5.QtWidgets as qtw
import PyQt5.QtGui as gui
import PyQt5.QtCore as core
TXTW = 200
class SelectNamesGui(qtw.QDialog):
"""dialog for selecting directories/files
"""
def __init__(self, parent, master):
self.master = master
... |
import os
import re
import numpy as np
import healpy
import h5py
import copy
from lsst.utils import getPackageDir
from desc.sims.GCRCatSimInterface import _DESCQAObject_metadata
from lsst.sims.catalogs.definitions import InstanceCatalog
from lsst.sims.catalogs.decorators import cached
from lsst.sims.catUtils.exampleCat... |
from html.parser import HTMLParser
import re
class ParserHelper:
@staticmethod
def validate_email(email_address):
regex = r'\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Z|a-z]{2,}\b'
if "(at)" in email_address:
email_address = str(email_address).replace("(at)", "@")
if re.ful... |
#!/usr/bin/env python3
# -*- coding=utf8 -*-
# Copyright 2014 <NAME>, and
# Copyright 2014-2019 Institut für Rundfunktechnik GmbH, Munich, Germany
#
# 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... |
#!/usr/bin/env python3
"""
The MIT License
Copyright © 2010-2019 Falkonry.com
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, co... |
import inspect
import logging
import os
import warnings
from datetime import datetime, timedelta, tzinfo
from pprint import pformat
from typing import Any, Dict, List, Optional, Tuple, Type, Union
import numpy as np
import pandas as pd
import pytz
from pandas.tseries.frequencies import to_offset
from sqlalchemy.dialec... |
#!/bin/env python
#
# Copyright 2013-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 required by applicabl... |
# -*- coding: utf-8 -*-
"""
Created on Mon Jul 14 14:42:44 2014
@author: jc3e13
This module contains functions for working with the Garrett Munk internal wave
spectrum. The aim is to develop a toolbox similar to the one that <NAME>
wrote in Matlab, but so far it is just a messy collection of functions.
"""
import n... |
# -*- coding: utf-8 -*-
#
# This file is part of s4d.
#
# s4d is a python package for speaker diarization.
# Home page: http://www-lium.univ-lemans.fr/s4d/
#
# s4d is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as
# published by the Free Software Fo... |
import logging
from collections import defaultdict
from dataclasses import dataclass
from datetime import datetime
from enum import unique
from typing import ClassVar, Collection, Dict, Iterable, Optional, Set, Union
from asn1crypto import cms, core, keys, x509
from pyhanko_certvalidator import CertificateValidator
fr... |
import pandas as pd
import numpy as np
import statistics as sta
from scipy.stats import kurtosis
from scipy.stats import skew
from scipy.stats import iqr
def overlapfunction(N, arr):
overlapnoas = int(N*0.6)
tmp = []
for i in range(overlapnoas):
tmp.append(i)
tmp.sort(reverse=True)
... |
# -*-coding:utf-8-*-
"""
This is the whole code for the traditional method to do the detection for mosquitoes
@@author: <NAME>, <NAME>
"""
import cv2
import numpy as np
import os
import glob
from PIL import Image
from sklearn.cluster import DBSCAN
from sklearn.preprocessing import StandardScaler
import matplotlib.pypl... |
#!/usr/bin/env python
# pylint: disable=C0116
# This program is dedicated to the public domain under the CC0 license.
"""
Simple Bot to reply to Telegram messages.
First, a few handler functions are defined. Then, those functions are passed to
the Dispatcher and registered at their respective places.
Then, the bot is ... |
import sys
import pprint
import csv
import json
from decimal import Decimal
from datetime import date
from piecash import open_book, ledger
pp = pprint.PrettyPrinter(indent=2)
DEDO_DURO_MULTIPLIER = Decimal(0.00005)
ACOES_ETF_TAX_MULTIPLIER = Decimal(0.15)
FII_TAX_MULTIPLIER = Decimal(0.20)
US_DIVIDEND_TAX_MULTIPLI... |
# -*- coding: utf-8 -*-
"""
Parser and core Routines
"""
from __future__ import absolute_import, division, print_function, unicode_literals
import ast
import re
import sys
from warnings import warn
from six.moves import map, range
unicode_tbl = {
"α": "alpha",
"β": "beta",
"χ": "chi",
"δ": "delta",
... |
from typing import Any, Dict, List, Optional, Tuple, Type, Union
import pdb
import gym
import numpy as np
import torch as th
from torch.nn import functional as F
from torch import nn
import pdb
from stable_baselines3.common import logger
from stable_baselines3.common.off_policy_algorithm import OffPolicyAlgorithm
from... |
import ast
import base64
import datetime
import decimal
import functools
import inspect
import os
import random
import string
import traceback
import uuid
from PIL import Image
from django.contrib.auth.views import redirect_to_login
from django.core.exceptions import PermissionDenied, RequestDataTooBig
from django.cor... |
from utils import hagn
import numpy as np
import matplotlib
matplotlib.use("Qt5Agg")
import matplotlib.pyplot as plt
import utils.match as mtc
import pickle
import os
from rot2 import serialize_results
import tree.halomodule as hmo
from rot2 import density_measure as denm
from utils import cosmology
from load.info impo... |
# Licensed to the StackStorm, Inc ('StackStorm') 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 th... |
# Copyright 2019 The Shaderc Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... |
# Copyright 2019 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... |
"""
ncaa_scraper
A module to scrape and parse college baseball statistics from stats.ncaa.org
Created by <NAME> in Spring 2022
"""
import pandas as pd
import time
import random
from bs4 import BeautifulSoup
import requests
import numpy as np
#lookup paths
_SCHOOL_ID_LU_PATH = 'collegebaseball/data/schools.parquet'... |
from scapy.all import *
from queue import Queue
from threading import Lock
from mirage.core.module import WirelessModule
from mirage.libs.bt_utils.packets import *
from mirage.libs.bt_utils.assigned_numbers import AssignedNumbers
from mirage.libs.bt_utils.scapy_layers import *
from mirage.libs.bt_utils.scapy_vendor_spe... |
from pathlib import Path
import cv2
import kornia as K
import mlconfig
import numpy as np
import torch
import torch.nn.functional as F
import torchvision.models as tv_models
from loguru import logger
from mlconfig.collections import AttrDict
from mlconfig.config import Config
from PIL import Image
from torch import nn... |
#!/usr/bin/env python3
#
# This is file `ribeiro-social-sync.py'.
#
# Original twoot.py Copyright 2018-2021 <NAME> (wtsnjp)
# This Fork, 2021-2022 <NAME>
# GitHub: https://github.com/justinribeiro
# Twitter: @justinribeiro
# Mastodon: <EMAIL>
#
# This software is distributed under the MIT License.
#
from log... |
from Borda_Guevara_Tissera_TP2.resolutions.n_queens import Nqueens, tt_entails
from logic import dpll, Expr, pl_true
# DPLL
def test_n_queens_dpll_4():
n_queens = Nqueens(4)
X00, X01, X02, X03, \
X10, X11, X12, X13, \
X20, X21, X22, X23, \
X30, X31, X32, X33 = n_queens.symbols
result = dpll(n_... |
import time
import pyautogui
import PySimpleGUI as sg
from subprocess import Popen
from math import sqrt
from PIL import Image
from keyboard import is_pressed
RETRO_4 = [
(0, 0, 0),
(0, 0, 170),
(0, 170, 0),
(0, 170, 170),
(170, 0, 0),
(170, 0, 170),
(170, 85, 0),
(170, 170, 170),
(... |
"""Collision geometry representation for multibody systems.
Each type of collision geometry is modeled as a class inheriting from the
``CollisionGeometry`` abstract type. Different types of inheriting geometries
will need to resolve collisions in unique ways, but one interface is always
expected: a list of scalars to ... |
# -*- mode:python; coding:utf-8 -*-
# Copyright (c) 2020 IBM Corp. 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# This file is part of the Kramers-Kronig Calculator software package.
#
# Copyright (c) 2013 <NAME>, <NAME>
#
# The software is licensed under the terms of the zlib/libpng license.
# For details see LICENSE.txt
"""This module implements data formats and conversions."""
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""gaetk2.handlers.base - default Request Handler for gaetk2.
Created by <NAME> on 2010-10-03.
Copyright (c) 2010-2019 HUDORA. All rights reserved.
"""
from __future__ import absolute_import
from __future__ import unicode_literals
import inspect
import logging
import os
i... |
from ctypes import string_at
from multiprocessing import RawArray, process
from tkinter import *
from tkinter import messagebox
from tkinter import IntVar
import time
import pyautogui
import win32api, win32con, win32gui
import datetime
import secrets
import keyboard
from pynput import keyboard
from pynput.keyboard impo... |
import datetime
import pytz
from blazar_dashboard import api
from blazar_dashboard import conf
from django import template
from django.urls import reverse_lazy
from django.utils.translation import ugettext_lazy as _
from horizon import exceptions
from horizon import forms
from horizon import messages
from horizon imp... |
#!/usr/bin/env python
# coding: utf-8
# <img style="float: left;" src="earth-lab-logo-rgb.png" width="150" height="150" />
#
# # Earth Analytics Education - EA Python Course Spring 2021
# ## Important - Assignment Guidelines
#
# 1. Before you submit your assignment to GitHub, make sure to run the entire notebook ... |
import scipy
import numpy as np
from ..util import BaseCase
import pygsti
import pygsti.construction.modelconstruction as mc
class ModelConstructionTester(BaseCase):
def setUp(self):
#OK for these tests, since we test user interface?
#Set Model objects to "strict" mode for testing
pygsti... |
import os
import sys
import PyQt5.QtWebKitWidgets
import PyQt5.uic
from PyQt5.uic import *
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.realpath(__file__))))
from syntaxHighlight import *
from common.books import *
from common import dialog, vars
import xmlt
import css
import link
import img
import color... |
"""
# Tuple with keys (
# (input_ids, attention_mask, token_type_ids),
# (start_position, end_position, cls_index, p_mask, is_impossible)
g4dn can do evaluation w/ batch32 with 9GB memory. 1.08 it/s
1.61 it/s when performing inference on single-GPU.
Multi-gpu single-node throws an error, probably OOM.
"""
import da... |
import argparse
import os
import sys
import glob
import time
import math
import numpy as np
import psutil
import oneflow as flow
import oneflow.nn as nn
from petastorm.reader import make_batch_reader
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), os.path.pardir)))
num_dense_fields = 13
num_spa... |
# -*- coding: utf-8 -*-
# Copyright 2015 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Utilities for setting up and cleaning up the chroot environment."""
from __future__ import print_function
import collections
... |
import numpy as np
import logging
import ctypes
import os
import time
from ..core import Node, register_node_type, ThreadPollInput
from pyqtgraph.Qt import QtCore, QtGui
from pyqtgraph.util.mutex import Mutex
# very usefull URL for this wrapper:
# http://www.ifnamemain.com/posts/2013/Dec/10/c_structs_python/
# http:/... |
reselect = False # reselect lines after sending from Visual mode
show_execution_count = True # wait to get numbers for In[43]: feedback?
monitor_subchannel = True # update vim-ipython 'shell' on every send?
run_flags= "-i" # flags to for IPython's run magic when using <F5>
current_line = ''
t... |
#!/usr/bin/env python3
################################################################################
# SPDX-FileCopyrightText: Copyright (c) 2019-2021 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you... |
#!/usr/bin/python
import sys
import struct
import os
from numpy import *
import datetime
from re import *
from copy import *
import threading
import string
import commands
def log_print(print_str):
os.system("echo '" + str(print_str) + "'")
def log_command(print_str):
os.system("echo " + str(print_str))
... |
#!/usr/bin/python3
import sys
import string
import time
import numpy as np
import datetime
from . import ivi
from . import usbtmc
from multiprocessing import Process, Queue, cpu_count
import multiprocessing
from scipy.optimize import leastsq,broyden1
from scipy import stats
from PyQt5 import QtCore
from PyQt5.QtWidge... |
#
# Parse file structure - Parsing file structure of selected region
# (the whole file if not selected) with Kaitai Struct
#
# Copyright (c) 2020, <NAME>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following condit... |
import os
import asyncio
import logging
from dataclasses import Field as ff
from dataclasses import (
dataclass,
is_dataclass,
fields,
_FIELDS,
_FIELD,
asdict,
MISSING,
InitVar,
make_dataclass,
)
import datetime
import typing
import uuid
import numpy as np
from decimal import Decimal... |
# -*- coding: utf-8 -*-
import sys
import numpy as np
import time
from utils import print_bracketing, check_dir
from argparse import ArgumentParser
import torch
import os.path
import re
import matplotlib
import matplotlib.pyplot as plt
from matplotlib.gridspec import GridSpec
from collections import deque
class Saver(... |
"""TODO"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
from warnings import warn
import numpy as np
from numpy import arctan
from numpy import array
from numpy import float64
from numpy import linspace
from numpy import load
from numpy impo... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.