text stringlengths 3.07k 22.1k |
|---|
# -*- coding: utf-8 -*-
"""
Created on Fri Nov 1 19:27:14 2019
@author: hp
"""
import cv2
import numpy
from djitellopy import Tello
import cv2
import pygame
from pygame.locals import *
import numpy as np
import time
import datetime
import os
import csv
center_x = 480
center_y = 360
# Speed of... |
from NetworkToTree import *
from LGT.LGT_network import *
from tree_to_newick import *
from joblib import Parallel, delayed
from datetime import datetime
import pandas as pd
import numpy as np
import pickle
def make_data_fun(beta, n=None, n_range=None, num_trees=None, net_num=0, distances=True, partial=False, comb_m... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Author: leeyoshinari
import os
import json
import logging
import traceback
from django.shortcuts import render, redirect, resolve_url
from django.conf import settings
from .models import TestPlan, ThreadGroup, TransactionController
from common.Result import re... |
import demistomock as demisto
from CommonServerPython import * # noqa # pylint: disable=unused-wildcard-import
from CommonServerUserPython import * # noqa # pylint: disable=unused-wildcard-import
import traceback
import dateparser
from datetime import timedelta
from enum import Enum
from typing import List, Dict, An... |
"""
Author: <NAME>
Institution: University of Rhode Island
"""
import os
import glob
import collections
import subprocess
from Bio import SeqIO, AlignIO, Phylo
from pathlib import Path
from os.path import normpath, basename
# download the HMM files in first command! https://raw.githubusercontent.com/AstrobioMike/GToTre... |
import torch
from config import *
from augmentation import *
import numpy as np
from murhash import murmurhash
import regex
REGEX0 = regex.compile(r"([\p{S}\p{P}]+)")
REGEX1 = regex.compile(r" +")
def sub_tok(text):
return [text]
def parse_data(file_path, tokenizer, sequence_len, token_style, pqrnn=False):
"... |
"""trommer2010.py
This is an implementation of Trommer's (2010)[1] theory of Paradigmatic
Generalisation of Morphemes.
[1] Trommer, Jochen (2010): Paradigmatic Generalization of Morphemes. In:
<NAME>, <NAME> & <NAME> (eds.), 2 in Agreement,
Linguistische Arbeits Berichte 88. Leipzig, University of Leipz... |
#!/usr/bin/env python3
import os
import glob
from datetime import datetime
import re
import ipaddress
import ast
from dataclasses import dataclass
from enum import Enum, IntEnum
from typing import Union
import pathlib
from collections import defaultdict, Counter
from pprint import pprint
from analysis.parser.common i... |
# -*- coding:utf-8 -*-
# author : BieFeNg
# date_time 2020/06/21 13:36
# file_name : MysqlUtil.py
import getopt
import sys
from csv import DictWriter, DictReader
import tqdm
import pymysql
DEV = {'host': '10.128.62.33', 'user': 'root', 'password': '<PASSWORD>', 'database': 'jy_catering'}
CATERING_PROD = {'host': '172... |
""" Support for Dakuo Mosquito Dispeller."""
import logging
from functools import partial
from miio import Device, DeviceException
from homeassistant.const import (
CONF_HOST,
CONF_TOKEN,
ATTR_MODE
)
from homeassistant.exceptions import PlatformNotReady
from homeassistant.components.fan import (... |
from typing import Dict, List
import os
import random
import copy
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.distributions import Categorical
import numpy as np
from ..modules import Module
def vae_loss_hook(agent,
losses_dict,
input_strea... |
import torch
import torch.nn as nn
from settings import Parameters
import numpy as np
class DeformLoss(torch.nn.Module):
def __init__(self, lambda_flow=0, lambda_graph=0, lambda_warp=0, lambda_mask=0, flow_loss_type="L2"): # L1, L2, MSE (like L2 but w/o sqrt)
super(DeformLoss, self).__init__()
se... |
# This Python file uses the following encoding: utf-8
import sys
import dimod
from circuit_fault_diagnosis.gates import gate_model, GATES
_PY2 = sys.version_info.major == 2
if _PY2:
def iteritems(d):
return d.iteritems()
def itervalues(d):
return d.itervalues()
else:
... |
# Copyright 2018 - The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... |
from datetime import datetime
import discord
from discord.ext import tasks
import db
BOT = None
CALENDAR_EMBED = None
CLOSE_CALL_EMBED = None
CLOSE_CALL_EMBED_NONE = None
MSG = None
MSG_CC = None
MSG_CC_NONE = None
###########################
# Function: display_events
# Description: Sends or updates the embed for the... |
#! /bin/python
import os
import sys
import json
import luigi
import nifty.tools as nt
from elf.util import chunks_overlapping_roi, downscale_shape
import cluster_tools.utils.volume_utils as vu
import cluster_tools.utils.function_utils as fu
from cluster_tools.cluster_tasks import SlurmTask, LocalTask, LSFTask
# thi... |
from file_read_backwards import FileReadBackwards
TEST_LIST_spec=[
"429.mcf",
"433.milc",
"435.gromacs",
"436.cactusADM",
"437.leslie3d",
"444.namd",
"445.gobmk",
"453.povray",
"454.calculix",
"456.hmmer",
"458.sjeng",
"459.GemsFDTD",
"462.libquantum",
... |
from tkinter import ttk,filedialog
from tkinter import *
import pandas as pd
# import argparse
from openpyxl import Workbook,worksheet
from openpyxl.styles import Border, Side, Font, Alignment
from openpyxl.utils.dataframe import dataframe_to_rows
from openpyxl.utils import get_column_letter
root = Tk()
root.title('ea... |
# 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 os
import struct
import logging
from primitives import *
from constants import *
from astypes import MalformedFLV
from astypes import get_script_data_variable, make_script_data_variable
log = logging.getLogger('flvlib.tags')
STRICT_PARSING = False
def strict_parser():
return globals()['STRICT_PARSING']
... |
# Copyright 2017 The Forseti Security 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 ap... |
#!/usr/bin/python3
"""
.. module:: webservice
:synopsis: Webservice to calculate sanitised EPCIS events
https://github.com/european-epc-competence-center/epcis-sanitisation
.. moduleauthor:: <NAME> <<EMAIL>>
Copyright 2021 <NAME>
This program is free software: you can redistribute it and/or modify
... |
# bundler.py
"""Module to implement the Bundler component of the Long Term Archive."""
import asyncio
import json
from logging import Logger
import logging
import os
import shutil
import sys
from typing import Any, Dict, Optional
from zipfile import ZIP_STORED, ZipFile
from rest_tools.client import RestClient # type... |
###########################################################################################################
# Copyright (C) 2021 Intel Corporation
# SPDX-License-Identifier: BSD-3-Clause
###########################################################################################################
import os
import sys
imp... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Code relating to a specific Dwarf Fortress installation."""
from __future__ import print_function, unicode_literals, absolute_import
import sys, os, shutil, re
import struct
import zlib
from datetime import datetime
from distutils import dir_util
from glob import glob
f... |
#!/usr/bin/env python2
# Copyright (c) 2017-present, Facebook, 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 ... |
import pyparsing as pp
import re
import torch
from torch.autograd import Variable
import numpy as np
from .const import min_nnml_word_length, max_nnml_word_length, nnml_preprocess_regex, nnml_manufacturers_dropout, \
nnml_manufacturers_trains, nnml_devicetypes_dropout, nnml_devicetypes_trains
class NNMLParser:
... |
import dataclasses
import logging
from dataclasses import dataclass
from typing import Any, Callable, Generic, Iterable, NoReturn, Tuple, TypeVar, cast
from expression.collections import FrozenList, Map, frozenlist, map
from expression.core import (
MailboxProcessor,
Nothing,
Option,
Some,
TailCall... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# author: <NAME> <<EMAIL>>
# original repo url: https://github.com/MaxMatti/BeatSaverDownloader
import atexit
import os
import requests
import shutil
import sys
import termios
import time
import threading
completion = {"songs": set()}
songs = {}
running = True
t = {
... |
import datetime
import json
import os
import spotipy
import zoneinfo
# Class to contain and analyse raw streaming information from Spotify data
class StreamingHistory:
def __init__(self, files: list, tz: str) -> None:
self.year = datetime.date.today().year
self.end = None # String representatio... |
# To-do:
# -prioritised experience_replay
# -Manual Mode
# Credit where it's due:
# https://github.com/gsurma/cartpole
# https://towardsdatascience.com/cartpole-introduction-to-reinforcement-learning-ed0eb5b58288
# https://www.youtube.com/watch?v=t3fbETsIBCY
# https://www.youtube.com/watch?v=qfovbG84EBg&list=PLQVvvaa0... |
import os
import numbers
import torch
import torch.utils.data as data
import torch
import torchvision.transforms as transforms
import random
from PIL import Image, ImageOps
import numpy as np
import torchvision
from . import exp_transforms
import pdb
import cv2
from utils.flowlib import read_flow
from utils.util_flow i... |
import os
import json
import random
import pickle
import torch
import torch.nn as nn
import torchvision.models as models
import torchvision.transforms as Transforms
import scipy
import scipy.spatial
import numpy
from models.datasets.attrib_dataset import AttribDataset
from ..datasets.hd5 import H5Dataset
from ..data... |
"""
Top level models
"""
from django.contrib.auth.models import Permission, User
from django.core.exceptions import ValidationError
from django.core.validators import MaxValueValidator, MinValueValidator
from django.db import models
from django.utils.translation import gettext_lazy as _
from eveuniverse.models import ... |
# Copyright 2019-2021 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... |
#%%
import re
import datetime
import geopandas as gpd
import requests
import pandas as pd
import numpy as np
import rioxarray as rxr
import ee
####################################
# ABARES AND LAND COVER FUNCTIONS #
####################################
def get_abares_crop_data(state):
try:
abares_pa... |
import random
class RsaKeys(object):
'''
A class implementation of the RSA key
generation that takes p and q and has a
method call Keys() to return ((e, n), d).
Note that all methods are private by
default except for the Keys() method.
>>>RsaKeys(23, 47).Keys()
((59, 1081), 953)
''... |
from datetime import datetime as dt
from django.contrib.auth.decorators import login_required
from django.contrib.postgres.search import SearchQuery, SearchRank
from django.shortcuts import get_object_or_404, redirect, render
from django.core.paginator import Paginator
from django.db.models import Avg
from django.core... |
import logging
import sys
from random import shuffle
import numpy as np
import treefiles as tf
from MeshObject import Object, TObjectLoadable
from tqdm import tqdm
from FractalTree.Branch3D import set_log_level, Nodes, Branch
from FractalTree.Mesh import Mesh
class Curvature:
def __init__(self, src: TObjectLoad... |
from detectron2 import model_zoo
from detectron2.data.datasets import register_coco_instances
import logging
import os
from detectron2.config import get_cfg
from detectron2.engine import DefaultTrainer
from detectron2.evaluation import COCOEvaluator
from detectron2.engine.hooks import HookBase
from detectron2.u... |
import requests
import json
import tweepy
# REPORTS ###########################################################################################
def incorrect_loading_mode(m: str):
"""display a message"""
print("'{}' is not a correct loading mode, switching to default : 'json'".format(m))
def failed_loading... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
""" Plots """
__author__ = "<NAME> <<EMAIL>>"
import numpy as np
import matplotlib as mpl
from matplotlib import pyplot as plt
from matplotlib.ticker import MaxNLocator
cmaps = {
"GnBu": [(0.90354479621438422, 0.96276816830915568, 0.88175317890503824),
... |
import logging
import datetime
from indra.statements import Event, QualitativeDelta, WorldContext, \
TimeContext, RefContext
from indra.sources.eidos.processor import EidosProcessor, EidosDocument
logger = logging.getLogger(__name__)
class EidosWorldProcessor(EidosProcessor):
def __init__(self, json_dict, g... |
#!/usr/bin/env python
# coding: utf-8
import torch
import torch.nn as nn
from torch.nn.utils import weight_norm
class Chomp1d(nn.Module):
def __init__(self, chomp_size):
super(Chomp1d, self).__init__()
self.chomp_size = chomp_size
def forward(self, x):
return x[:, :, :-self.chomp_siz... |
# -*- coding: utf-8 -*-
import os
import sys
import xbmc
import urllib,urllib2
import xbmcvfs
import xbmcaddon
import xbmcgui,xbmcplugin,shutil
from zipfile import ZipFile
from cStringIO import StringIO
import uuid
__addon__ = xbmcaddon.Addon()
__author__ = __addon__.getAddonInfo('author')
__scriptid__ = __add... |
# -*- coding: utf-8 -*-
# Copyright (c) 2019 - now, Eggroll 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... |
from flask import jsonify, request, g, abort, url_for, current_app
from .. import db
from flask.ext.login import login_required, current_user
from pickle import dump
from ..models import Post, Permission, User, Favor
from . import api
from .decorators import permission_required
from .authentication import verify_passwo... |
#!python
import cv2
import tkinter as tk
from tkinter import filedialog
from PIL import Image, ImageTk
import numpy as np
from classDeepSort import DeepSort
from yolov3_tf2.utils import draw_YOLO, draw_DS
from os import path
from datetime import datetime
"""
Tareas por hacer:
-> BIG PROBLEM, está retornando valores ne... |
import cv2
from PIL import Image
import numpy as np
from skimage import measure
from PIL.ExifTags import TAGS, GPSTAGS
def close_contour(contour):
if not np.array_equal(contour[0], contour[-1]):
contour = np.vstack((contour, contour[0]))
return contour
def binary_mask_to_polygon(binary_mask, tolerance... |
from ast import *
from inspect import isclass, isfunction, getargspec
from itertools import dropwhile
import random
import string
from asthelpers import *
from decorators import *
import rules
# Dispatchers
def new(kind, context):
# if isinstance(kind, type):
# kind = kind.__name__
new_thing = globals()['new_' + ki... |
from nose.tools import (
set_trace,
eq_
)
import feedparser
from api.admin.opds import AdminAnnotator, AdminFeed
from api.opds import AcquisitionFeed
from core.model import Complaint, Library
from core.lane import Facets, Pagination
from core.opds import Annotator
from .. import DatabaseTest
class TestOPDS(... |
import requests
import time
import json
from django.core.cache import cache
import logging
from heltour import settings
logger = logging.getLogger(__name__)
def _apicall(url, timeout=120, check_interval=0.1, post_data=None):
# Make a request to the local API worker to put the result of a lichess API call into the... |
import re
from random import randint
from typing import Any
from typing import Dict
from typing import List
from typing import Match
from typing import Optional
from retrying import retry
import apysc as ap
from apysc._animation.animation_base import AnimationBase
from apysc._event.custom_event_type impor... |
import numpy as np
import sys
import torch
from torch.utils.tensorboard import SummaryWriter
from tqdm import tqdm
import os
from lstm_net import LSTMNet
torch.manual_seed(0)
torch.multiprocessing.set_sharing_strategy("file_system")
print(sys.argv)
AGENT = sys.argv[1]
GAME_STATE_LENGTH = 583 + 20 # base + extended... |
# Author: <NAME>
# Time: 2/1/2020 7:02 PM
# Copyright 2019. 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 ... |
from collections import defaultdict
class Interval:
'''Internal class for PlanarityChecker'''
def __init__(self, low=None, high=None):
self.low = low
self.high = high
def empty(self):
return self.low is None and self.high is None
class ConflictPair:
'''Inte... |
import unittest
import pandas as pd
import pandas.testing as pdt
from werkzeug.exceptions import NotFound
from microsetta_private_api.repo.metadata_repo._constants import (
HUMAN_SITE_INVARIANTS, UNSPECIFIED)
from microsetta_private_api.exceptions import RepoException
from microsetta_private_api.repo.metadata_repo.... |
#!/bin/env python
#
# Features.py: classes for handling feature data
# Copyright (C) University of Manchester 2011-2019 <NAME>, <NAME>
# & <NAME>
#
"""
Features.py
Classes for handling feature data.
"""
import logging
import io
from .distances import closestDistanceToRegion
from .utils import make_errlin... |
#!/usr/bin/env python3
from app import app, db
from flask import session, render_template, redirect, url_for, request, flash, make_response, jsonify
from sqlalchemy import and_
from .forms import RegisterForm, LoginForm
from werkzeug.urls import url_parse
from .models import Visit
from .models import BoardUser, BoardC... |
# Copyright 2018 <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 to in writing, software... |
# coding: utf-8
# データ用スクリプト
# 外部依存がなく、関数内で完結する関数が中心
import chainer
import chainer.links as L
import chainer.functions as F
from skimage import draw
from skimage import transform
import numpy as np
import cupy as cp
import math
import pickle
from bokeh.plotting import figure
from bokeh.layouts import gridplot
from b... |
import torch
import torch.nn
class FGM(object):
"""
Example
# initialization
fgm = FGM(model,epsilon=1,emb_name='word_embeddings.')
for batch_input, batch_label in processor:
# normal training
loss = model(batch_input, batch_label)
loss.backward() # backward,get the normal g... |
# coding=utf-8
# 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, software
# distr... |
# -*- coding: utf-8 -*-
"""
Forms of Assignment
"""
from mathics.builtin.base import Builtin, BinaryOperator
from mathics.core.symbols import Symbol
from mathics.core.systemsymbols import (
SymbolFailed,
)
from mathics.core.definitions import PyMathicsLoadException
from mathics.builtin.assignments.internals im... |
# ------------------------------------
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# ------------------------------------
from urllib.parse import urlparse
from unittest.mock import Mock, patch
from azure.core.pipeline.policies import ContentDecodePolicy, SansIOHTTPPolicy
from azure.identi... |
# Copyright 2016-2020 The <NAME> at the California Institute of
# Technology (Caltech), with support from the Paul Allen Family Foundation,
# Google, & National Institutes of Health (NIH) under Grant U24CA224309-01.
# All rights reserved.
#
# Licensed under a modified Apache License, Version 2.0 (the "License");
# you ... |
"""
Module used to provide controls and status of the BrickBatteryController
via a web API
"""
import datetime
import logging
import math
from collections import deque
from ruamel.yaml import YAML
from aiohttp import web
LOGGER = logging.getLogger('battery_api')
class BrickBatteryHTTPServer:
"""
An asynchron... |
# This Software (Dioptra) is being made available as a public service by the
# National Institute of Standards and Technology (NIST), an Agency of the United
# States Department of Commerce. This software was developed in part by employees of
# NIST and in part by NIST contractors. Copyright in portions of this softwar... |
import numpy as np
from matplotlib.pylab import plt
import seaborn as sns
from matplotlib.collections import PatchCollection
from matplotlib.patches import Rectangle
import ot
import ot.plot
from mpl_toolkits import mplot3d
from mpl_toolkits.mplot3d import Axes3D
from matplotlib.patches import FancyArrowPatch
from ... |
import os
import numpy as np
import tensorflow as tf
from tensorflow import keras
import matplotlib.pyplot as plt
import tensorflow_datasets as tfds
from tensorflow.keras import layers
import matplotlib.cm as cm
import random
import glob
from skimage.segmentation import chan_vese
def check_dataset(dataset):
plt.fig... |
import shutil
import numpy as np
import torch
import torch.nn as nn
import torch.utils.data
import h5py
from torch.autograd import Variable
import time
from tqdm import tqdm
import model
import argparse
import platform
import astropy.units as u
import sys
import os
class dataset_h5(torch.utils.data.Dataset):
def _... |
"""
Twisted integration for Urwid.
This module allows you to serve Urwid applications remotely over ssh.
The idea is that the server listens as an SSH server, and each connection is
routed by Twisted to urwid, and the urwid UI is routed back to the console.
The concept was a bit of a head-bender for me, but really we... |
from PIL import PngImagePlugin
from PIL import Image
from PIL import ImageFont
from PIL import ImageDraw
from PIL import ImageEnhance
import os
def create_image(team_number, card, team_pics_path, out_path, padding_left, padding_top, width):
try:
team_path = "{}/{}.JPG".format(team_pics_path, team_number)
... |
"""
Created on Sun Mar 12 15:39:22 2017
@author: <NAME>
Prepared by [<NAME>](http://www.vincentgregoire.com),
Department of Finance, The University of Melbourne.
This is a sample code to illustrate some basic features of the Python language.
This notebook was created as supplemental material to a Python for
finan... |
"""Pure python library for calculating CRC16"""
##############################################################################
#
# Copyright (C) <NAME>, 2011
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
#... |
#!/usr/bin/env python
"""
This source file is part of the Swift.org open source project
Copyright (c) 2014 - 2021 Apple Inc. and the Swift project authors
Licensed under Apache License v2.0 with Runtime Library Exception
See https://swift.org/LICENSE.txt for license information
See https://swift.org/CONTRIBU... |
"""
flask_clova
~~~~~~~~~~~
:copyright: (c) 2018 by <NAME>. <EMAIL>
:license: MIT, see LICENSE for more details.
:All the structure and ideas were copied after seeing flask-ask
:flask-ask github: https://github.com/johnwheeler/flask-ask
"""
import os
import yaml
import inspect
from functools i... |
#import encoding.nn as nn
#import encoding.functions as F
import torch.nn as nn
from torch.nn import functional as F
import math
import torch.utils.model_zoo as model_zoo
import torch
import numpy as np
from torch.autograd import Variable
affine_par = True
import functools
import sys, os
from libs import InPlaceABN, ... |
# 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 ... |
# encoding: utf-8
import sys
import re
import argparse
from workflow.workflow import MATCH_ATOM, MATCH_STARTSWITH, MATCH_SUBSTRING, MATCH_ALL, MATCH_INITIALS, MATCH_CAPITALS, MATCH_INITIALS_STARTSWITH, MATCH_INITIALS_CONTAIN
from workflow import Workflow, ICON_WEB, ICON_WARNING, ICON_BURN, ICON_SWITCH, ICON_HOME, ICON... |
import math
import numpy as np
from scipy.spatial.distance import euclidean
# Angular calculations,
# assuming that the angular positions
# are expressed as below:
# _____________________________
# | |
# | pi/2 |
# | _|_ |
# | / |... |
""" OptionsDictionary class definition. """
import warnings
from six import iteritems
class OptionsDictionary(object):
""" A dictionary for storing options for components/drivers/solvers. It
is generally used like a standard Python dictionary, except that 1) you
can only set or get keys that have been re... |
from __future__ import print_function
from astropy.extern.six import iteritems
import numpy as np
import warnings
r2deg = 180/np.pi
"""
.. TODO::
When any section length is zero, that means the following values are to be
ignored. No warning is needed.
"""
def read_lmv(fn):
"""
Read an LMV cube file
... |
import hashlib
import copy
from nanome.util import StringBuilder, Vector3, enums
s_ConformersDisabled = False # Nanome.Core.Config.getBool("mol-conformers-disabled", "false")
s_ConformersAlways = False # Nanome.Core.Config.getBool("mol-conformers-always", "false")
def _get_hash_code(string):
return hash(string)... |
# Copyright 2017 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 a... |
__author__ = "<NAME> <<EMAIL>>"
__date__ = "2018/05/29 20:38:05"
import numpy as np
import torch
import torch.nn as nn
import scipy.optimize as optimize
class MBAR():
"""
The MBAR class is initialized with an energy matrix and an array
of num of conformations. After initizlization, the MBAR class met... |
# fitdecode
#
# Copyright (c) 2018 <NAME>
# All rights reserved.
#
# This code is licensed under the MIT License.
# See the LICENSE.txt file at the root of this project.
import math
import struct
__all__ = []
class BaseType:
__slots__ = ('name', 'identifier', 'fmt', 'size', 'parse')
enum = None # in case ... |
import matplotlib
matplotlib.rcParams['pdf.fonttype'] = 42
matplotlib.rcParams['ps.fonttype'] = 42
matplotlib.use('Agg')
import matplotlib.pyplot as plot
from sim import *
import sys, pprint, math, numpy, simpy, getopt, itertools
class JS(object):
def __init__(self, env):
self.env = env
self.qt_l = []... |
import datetime
import dash_daq as daq
import pandas as pd
import dash
from dash import Dash, html, dcc, dash_table
from dash.dependencies import Input, Output, State
from dash.exceptions import PreventUpdate
import figures as figs
import utils
app = Dash(__name__, title='Financial Planning and Monitoring')
server =... |
import logging
from copy import deepcopy
from functools import wraps, partial
import torch
import torch.nn as nn
from torchvision.models.utils import load_state_dict_from_url
from pytorch_tools.models.resnet import ResNet
from pytorch_tools.modules import TBasicBlock, TBottleneck
from pytorch_tools.modules import Fas... |
import numpy as np
import torch
import torch.nn.functional as F
from torch import nn
from .spline_flows import unconstrained_RQS
from ..nets import MLP4
class Invertible1x1Conv(nn.Module):
"""
As introduced in Glow paper.
"""
def __init__(self, dim, device='cpu', condition_size=0):
super()._... |
# -*- coding: utf-8 -*-
# Copyright (c) 2020, PibiCo and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
# From patient_appointment on healthcare as reference
import json
from frappe.utils import getdate, ad... |
#!/usr/bin/python3
import argparse
import csv
import datetime
import fnmatch
import fractions
import math
from matplotlib import pyplot as plt
import numpy as np
import os
import pyexiv2
from tqdm import tqdm
from rcUAS_flightdata import flight_loader, flight_interp
# helpful constants
d2r = math.pi / 180.0
r2d = 1... |
from __future__ import absolute_import, print_function, division
import sys
import numpy
import convolutional_mlp
import dA
import DBN
import logistic_cg
import logistic_sgd
import mlp
import rbm
import rnnrbm
import SdA
import rnnslu
import lstm
def test_logistic_sgd():
logistic_sgd.sgd_optimization_mnist(n_ep... |
import pygame
from random import randrange
try:
pygame.init()
except:
print('Problema ao iniciar o módulo pygame')
branco = (255,255,255)
preto = (0,0,0)
vermelho = (255,0,0)
verde = (0,255,0)
azul = (0,0,255)
largura = 320
altura = 280
tamanho = 10
placar = 40
recorde = 0
relogio = pygame.time.Clock()
fun... |
# Copyright 2016, 2017 <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 to in writing, ... |
"""
Theano is an optimizing compiler in Python, built to evaluate
complicated expressions (especially matrix-valued ones) as quickly as
possible. Theano compiles expression graphs (see :doc:`graph` ) that
are built by Python code. The expressions in these graphs are called
`Apply` nodes and the variables in these grap... |
# Copyright 2022 <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 to in writing, softw... |
import os
import pytest
import pyproj
import rasterio
import numpy as np
from distutils.version import LooseVersion as V
from rasterio.io import MemoryFile
from tempfile import NamedTemporaryFile, TemporaryDirectory
from telluric.util.raster_utils import build_vrt
from telluric import GeoFeature, GeoRaster2, constants,... |
from collections import OrderedDict, deque
from collections.abc import Generator, Iterator, Mapping, Set
from copy import copy
from functools import partial
from operator import length_hint
from .dispatch import dispatch
from .utils import transitive_get as walk
from .variable import Var, isvar
# An object used to te... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.