text stringlengths 6.04k 39.5k |
|---|
# Copyright (c) 2019. Partners HealthCare and other members of
# Forome Association
#
# Developed by <NAME> based on contributions by <NAME>,
# <NAME>, <NAME> and other members of Division of
# Genetics, Brigham and Women's Hospital
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may no... |
from _decimal import Decimal
from django.urls import reverse
from django.utils.safestring import mark_safe
from exporter.applications.helpers.countries import ContractTypes
from exporter.core.constants import (
STANDARD,
OPEN,
HMRC,
EXHIBITION,
GIFTING,
F680,
TEMPORARY,
PERMANENT,
... |
# Copyright 2017 Battelle Energy Alliance, 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 t... |
import contextlib
from arithmetic_coder import arithmetic_coding
import numpy as np
import os
import argparse
import time
from utils.inout import occupancy_map_explore, pc_2_block
from voxel_dnn_coder.voxel_dnn_meta_endec import save_compressed_file
import gzip
import pickle
from training.voxel_dnn_training import Voxe... |
"""
The :class:`Structure` object is a collection of atoms in a periodic box.
The mandatory inputs are the cell vectors of the box and the chemical species
and *Cartesian coordinates* of the atoms.
The atoms are automatically folded back into the primary cell, so the
input coordinates don't need to lie inside the box.
... |
import os
from flask import Blueprint
from flask import render_template
from flask import request
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import seaborn as sns
from flask import redirect
import base64
import io
from .auth import UserData, login_required
from .classes.preProcessClass ... |
#!/usr/bin/env python
# coding: utf-8
# For python 2 compatibility
from __future__ import unicode_literals
import sys
from codecs import open
from os.path import split, join, exists
from os import getcwd, mkdir
import subprocess
import unicodedata
#from traceback import print_exc
# Python Version Compatibility
majo... |
"""
This module defines the generic base class and the functionality.
All browsers from :py:mod:`browser_history.browsers` inherit this class.
"""
import abc
import csv
import datetime
import json
import os
import shutil
import sqlite3
import tempfile
import typing
from collections import defaultdict
from functools im... |
# -*- coding: utf-8 -*-
from django.shortcuts import render, redirect, get_object_or_404
from django.urls import reverse_lazy
from django.contrib.auth.decorators import login_required
from django.utils.decorators import method_decorator
from django.urls import reverse
from django.views.generic.edit import DeleteView
fr... |
#! /usr/bin/python
#
# Copyright (c) 2013 VMware, 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
#
#... |
"""
Module contains helper functions to test models.
Authors: <NAME>
"""
import itertools
import time
from time import localtime, strftime
from os import path, mkdir, rename
import sys
from sklearn.metrics import (accuracy_score, confusion_matrix, classification_report)
from sklearn.model_selection import GridSearchCV,... |
#!/usr/bin/python2.4
#
# Copyright 2007 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 require... |
#!/usr/bin/env python3
"""
Created on Mon Sep 23 21:17:43 2019.
@author: mtageld
"""
import numpy as np
from imageio import imread
from pandas import DataFrame, concat
from skimage.color import rgb2gray
from skimage.segmentation import slic
from skimage.transform import resize
from sklearn.mixture import GaussianMixtu... |
# Copyright 2016 Hewlett Packard Enterprise Development Company LP
#
# 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... |
"""Contains classes and functions related to patterns/transformations.
"""
from __future__ import print_function
import copy
import dace
import inspect
from typing import Dict
from dace.sdfg import SDFG, SDFGState
from dace.sdfg import utils as sdutil, propagation
from dace.sdfg.graph import SubgraphView
from dace.pro... |
import os
import multiprocess
from multiprocess.context import TimeoutError
from multiprocess.managers import BaseProxy, RemoteError
import pytest
import threading
import time
from catkit.emulators.npoint_tiptilt import SimNPointLC400
from catkit.multiprocessing import MutexedNamespace, Process, SharedMemoryManager
f... |
# coding=utf-8
import os
# noinspection PyPep8Naming
import pickle
from datetime import datetime
from globalvars import GlobalVars
import metasmoke
import requests
import json
import time
import math
# noinspection PyCompatibility
import regex
# methods to load files and filter data in them:
def load_files():
i... |
# Reference: https://arxiv.org/pdf/1509.02971.pdf
# https://github.com/seungeunrho/minimalRL/blob/master/ddpg.py
# https://github.com/openai/spinningup/blob/master/spinup/algos/pytorch/ddpg/ddpg.py
import argparse
import collections
import os
import random
import time
from distutils.util import strtobool
import gym
i... |
# Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 OpenStack Foundation
# Copyright 2012 Nebula, Inc.
# Copyright (c) 2012 X.commerce, a business unit of eBay Inc.
#
# Licensed under the Apach... |
"""
Module implements the perturbation class for atomic and lattice relaxation.
"""
import os
from typing import Union, List
import numpy as np
from monty.serialization import loadfn
from pymatgen.core.operations import SymmOp
from pymatgen.core.sites import Site, PeriodicSite
from pymatgen.core.structure import Struc... |
"""
Main pysud module.
Contains basic classes such as the game, player character, levels(rooms)...
"""
import pysud_events as ev
import pysud_str
from functools import reduce
class GameEntity():
""" Inner use abstract class. """
def __init__(self):
self.name = None
self.uid = None
s... |
from __future__ import division
import onmt
import argparse
import torch
import torch.nn as nn
from torch import cuda
from torch.autograd import Variable
import math
import time
from nltk.translate import bleu_score
parser = argparse.ArgumentParser(description='train.py')
## Data options
parser.add_argument('-data'... |
#!/usr/bin/env python
# stdlib imports
import warnings
import os.path
# third party
from lxml import etree
import defusedxml.ElementTree as dET
from openquake.hazardlib.geo import point
from obspy.io.quakeml.core import _is_quakeml
from obspy.core.event import read_events
from strec.tensor import fill_tensor_from_com... |
from dotenv import load_dotenv, find_dotenv
load_dotenv(find_dotenv())
from datetime import date, timedelta
import importlib
import json
import os
from addict import Dict
import json
import pytest
from requests.exceptions import HTTPError
from pureapi import client, common
from . import changes_including_zero_count... |
from __future__ import print_function, division, absolute_import, unicode_literals
from builtins import bytes, dict, object, range, map, input, str
from future.utils import itervalues, viewitems, iteritems, listvalues, listitems
import os.path
import numpy as np
from astropy import time
import pwkit.environments.casa.... |
# Copyright (c) 2021 Graphcore Ltd. All rights reserved.
"""Build the faster R CNN model.
"""
import numpy as np
import json
from IPU.basic_func import np64to32_or_16
from layer.rpn import RPN
from layer.vgg import VGG16
from layer.resnet import Resnet
from layer.tpu_proposal_target_layer import ProposalTargetLayer
fro... |
import math
from PySide2 import QtGui
from .core import Object
__author__ = "<NAME>"
class Point(Object):
def __init__(self, x = 0, y = 0):
super(Point, self).__init__()
if not isinstance(x, (int, float)):
x = 0
if not isinstance(y, (int, float)):
y = 0
self.x = x
self.y = y
def __str__(self)... |
"""
model selection:
trains models that classify birdsong syllables,
using algorithms and other parameters specified in config file
"""
# from standard library
import os
import copy
# from dependencies
import numpy as np
from sklearn.preprocessing import StandardScaler
from sklearn.metrics import accuracy_score
from ... |
# Copyright (c) 2012 VMware, Inc.
# Copyright (c) 2011 Citrix Systems, Inc.
# Copyright 2011 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://w... |
"""
In this file the user can test some models and some other configurations for finding tables into some documents.
It takes the test images from PATHS_TO_TEST_IMAGE, the models from PATHS_TO_CKPTS, the evaluation scores from TEST_SCORES
and the number of classes from NUM_CLASSES.
# How the pipeline works
## Only bmp ... |
##########################################################################
#
# This file is part of Lilith
# made by <NAME> and <NAME>
#
# Web page: http://lpsc.in2p3.fr/projects-th/lilith/
#
# In case of questions email <EMAIL>
#
#
# Lilith is free software: you can redistribute it and/or modify
# it under ... |
#!/usr/bin/env python3
#
# Run these tests with: nosetests -v -d <file>.py
# This will run all functions even if one throws an assertion.
#
# For debugging: ./<file>.py
# Easier to print statements.
# This will exit qfter the first assertion.
import torch
from torch.autograd import Variable
import numpy as np
i... |
#!/usr/bin/python
# coding:utf-8
import conf
from util import util
# 类型列表
lan_types = ['u8', 'i8', 'u16', 'i16', 'u32', 'i32', 'u64', 'i64', 'f32', 'f64', 'string']
# 协议名及对应协议映射
mess_protos = {}
# 解析入口
def parse(code_path, common_path, protos, file_protos):
name_ids = list()
for proto in ... |
"""
Tests that run inside GDB.
Note: debug information is already imported by the file generated by
Cython.Debugger.Cygdb.make_command_file()
"""
from __future__ import absolute_import
import os
import re
import sys
import trace
import inspect
import warnings
import unittest
import textwrap
import tempfile
import fu... |
import resnet
import torch
import torch.nn as nn
from torch.nn.parameter import Parameter
from collections import OrderedDict
import numpy as np
# smallest positive float number
FLT_MIN = float(np.finfo(np.float32).eps)
FLT_MAX = float(np.finfo(np.float32).max)
class FeatureLayer(nn.Sequential):
def __init__(se... |
import torch
import numpy as np
from matplotlib import pylab as plt
import random
from collections import deque
import torch.nn as nn
from torch.nn import functional as F
from torch.nn import Linear, Module
import gym
class FCQSA(nn.Module):
def __init__(self,
input_dim,
output_di... |
# Copyright (c) 2017 The Khronos Group Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed ... |
# -*- coding: utf-8 -*-
from django.db import models
from django.conf import settings
# apps externas
from datospersonalesapp.models import Paciente
"""
Datos para planificacion familiar:
1. datospersonales\models. Tabla: Paciente.
Esta tabla contiene una serie de informacion que se necesitan para
planificacion fam... |
# PBNT: Python Bayes Network Toolbox
#
# Copyright (c) 2005, <NAME>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code must retain the above copyright
... |
import contextlib
import logging as logger
import time
import uuid
from django.db import transaction
from django.db.models import Manager
from django.db.models import Q
from django.db.utils import OperationalError
from django_cte import CTEQuerySet
from le_utils.constants import content_kinds
from mptt.managers import... |
import sys
import socket
import warnings
from awaitress.compat import (
PY2,
WIN,
)
if sys.version_info[:2] == (2, 6): # pragma: no cover
import unittest2 as unittest
else: # pragma: no cover
import unittest
class Test_asbool(unittest.TestCase):
def _callFUT(self, s):
from awaitress.ad... |
import itertools
import math
import os
import random
import torch
from torch import optim
from models import BaseVAE
from models.types_ import *
from utils import data_loader
import pytorch_lightning as pl
from torchvision import transforms
import torchvision.utils as vutils
from torchvision.datasets import CelebA
fro... |
from ._constants import (
COORD_X_CENTER,
COORD_Y_CENTER,
COORD_X_OUTER,
COORD_Y_OUTER,
VAR_LON_CENTER,
VAR_LAT_CENTER,
VAR_LON_OUTER,
VAR_LAT_OUTER,
)
from ._plot_helpers import (
infer_cmap_params,
_get_var_label,
_align_grid_var_dims,
_align_plot_var_dims,
)
from ._mas... |
import csv
import json
from collections import OrderedDict
from dateutil.relativedelta import relativedelta
from itertools import groupby
from django.contrib.auth.decorators import permission_required
from django.db.models import Sum, Q, Min, Max
from django.http import HttpResponse
from django.shortcuts import rende... |
from js9 import j
def get_stats_collector(service):
stats_collectors_services = service.consumers.get('stats_collector')
if stats_collectors_services:
return stats_collectors_services[0]
def get_statsdb(service):
statsdb_services = service.aysrepo.servicesFind(role='statsdb')
if statsdb_serv... |
# -*- coding: utf-8 -*-
# Copyright (C) 2018 by
# <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
# All rights reserved.
# BSD license.
#
# Authors: <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
"""Make a bijectio... |
from dataclasses import dataclass
from . import B
class Keyboard:
WRAP_TOP = "wrap_top"
WRAP_BOTTOM = "wrap_bottom"
WRAP_LEFT = "wrap_left"
WRAP_RIGHT = "wrap_right"
EXIT_TOP = "exit_top"
EXIT_BOTTOM = "exit_bottom"
EXIT_LEFT = "exit_left"
EXIT_RIGHT = "exit_right"
EXIT_DIRECTIO... |
import sys
import numpy as np
from timeit import default_timer as timer
from scipy.sparse import block_diag, coo_matrix
from common.estimator import EstimatorModel
from common.regression import max_affine_predict
from optim.quadprog import qp_solve, convert_matrix_to_qp_solver_format, QP_BACKEND__DEFAULT
class PCNL... |
import os, sys
import re
CONFIG_BAK_PATH = ".important.bak"
AOS_MAKEFILE = "aos.mk"
COMPONENT_KEYWORD = "KEYWORD: COMPONENT NAME IS "
def find_comp_mkfile(dirname):
""" Find component makefile (aos.mk) from dirname and its subdirectory,
exclude out, build, publish folder """
mklist = []
for root, dir... |
# 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... |
# --------------------------------------------------------
# Deep Feature Flow
# Copyright (c) 2017 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Written by <NAME>
# --------------------------------------------------------
import numpy as np
import os
import cv2
import random
from PIL import I... |
"""
AMRVAC data structures
"""
import os
import stat
import struct
import warnings
import weakref
import numpy as np
from yt.data_objects.index_subobjects.grid_patch import AMRGridPatch
from yt.data_objects.static_output import Dataset
from yt.funcs import mylog, setdefaultattr
from yt.geometry.grid_geometry_handl... |
import abc
import itertools
from enum import Enum
from typing import Callable, Iterable, List, Optional, Tuple
from github3.exceptions import NotFoundError
from cumulusci.core.config.project_config import BaseProjectConfig
from cumulusci.core.dependencies.github import (
get_2gp_version_id_from_tag,
get_packa... |
# ----------------------------------------------------------------------------
# pyglet
# Copyright (c) 2006-2018 <NAME>
# 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... |
"""
Allow representation of queries as logic expressions. This module makes
sure that attributes that are combined using the two logic operations AND (&)
and OR (|) always are in disjunctive normal form, that is, there are only two
levels - the first being disjunction and the second being conjunction. In other
words, ... |
'''
'''
import os
import sys
import h5py
import numpy as np
from scipy.stats import chi2
np.seterr(divide='ignore', invalid='ignore')
# -- abcpmc --
import abcpmc
from abcpmc import mpi_util
# -- galpopfm --
from . import dustfm as dustFM
from . import measure_obs as measureObs
dat_dir = os.environ['GALPOPFM_... |
# 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... |
# Copyright (c) 2009-2021 The Regents of the University of Michigan
# This file is part of the HOOMD-blue project, released under the BSD 3-Clause License.
# Maintainer: joaander / All Developers are free to add commands for new features
"""Base classes for all HOOMD-blue operations."""
# Operation is a parent class... |
# -*- coding: utf-8 -*-
from future import standard_library
standard_library.install_aliases()
import hashlib
import json
import logging
import os
import random
import string
import uuid
from io import BytesIO
from tempfile import TemporaryFile
import pytest
from django.core.files.storage import default_storage
from ... |
#Continuum Plotting
#<NAME>
#21/03/16
import numpy as np
import matplotlib.pyplot as plt
import scipy.interpolate as interp
import pyfits as pf
import glob
from ipdb import set_trace as st
def find_nearest(array,value,forcefloor=0):
idx=(np.abs(array-value)).argmin()
if forcefloor==1:
if array[idx] >... |
# This file is part of comma, a generic and flexible library
# Copyright (c) 2011 The University of Sydney
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must ... |
import torch
import torch.nn as nn
class Builder(nn.Module):
def __init__(self, base_encoder, dim=128, qlen=4096, emam=0.999, temp=0.2, proj='lin', pred='none', method='npair', shuffle_bn=False, head_mul=1, sym=False, in_channels=3, small=False, distributed=False, kaiming_init=True):
super(Builder, self).... |
# coding:utf-8
# Author: 阿财(<EMAIL>)(<EMAIL>)
# Created date: 2020-02-27
#
# The MIT License (MIT)
#
# Copyright (c) 2016-2019 yutiansut/QUANTAXIS
#
# 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 Sof... |
import asyncio
import distributed
from distributed import Event, Lock, Worker
from distributed.client import wait
from distributed.utils_test import (
_LockedCommPool,
assert_story,
gen_cluster,
inc,
slowinc,
)
async def wait_for_state(key, state, dask_worker):
while key not in dask_worker.ta... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# =============================================================================
## @file ostap/fitting/modifiers.py
# Set of useful utilities to modify the certain PDF
# @author <NAME> <EMAIL>
# @date 2018-11-29
# ========================================================... |
# A collection of functions to create displays of different ABI RGB
# products and band subtractions.
# abitrucol is derived from McIDAS-X's ABITRUCOL function
# which creates an ABI RGB by deriving a green band
# McIDAS-X's ABITRUCOL is based on the CIMSS Natural True Color method
# http://cimss.ssec.wisc.edu/goes/OC... |
import random
import pygame
class WordList:
def __init__(self):
self.wordList = [
['Annual', 'Occurring once every year'],
['Apparent', 'Clearly visible or understood'],
['Assist', 'To help someone'],
['Attempt', 'To make an effort to complete a task'],
... |
# ===============================================================================
# Copyright 2012 <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/LI... |
from __future__ import annotations
import escnn.group
from escnn.group import Group, GroupElement
from escnn.group import IrreducibleRepresentation, Representation, directsum
from escnn.group import utils
from .utils import build_identity_map
import numpy as np
from typing import Tuple, Callable, Iterable, List, Di... |
#!/usr/bin/python
import re
import os
import yaml
import json
import time
import random
import base64
import aiohttp
import asyncio
import requests
import aiofiles
import asyncio_redis
from urllib.parse import quote
from fuzzywuzzy import process
from bs4 import BeautifulSoup
from datetime import datetime, timedelta
fr... |
#!/usr/bin/env python3
import csv
import fnmatch
import glob
import json
import linecache
import platform
import re
import tempfile
import shutil
from collections import OrderedDict
from functools import partial, wraps
from itertools import chain, zip_longest
from multiprocessing.pool import ThreadPool as Pool
from opt... |
#%%
import random
import matplotlib.pyplot as plt
import tensorflow as tf
import tensorflow.keras as keras
import seaborn as sns
import numpy as np
import pickle
from sklearn.model_selection import StratifiedKFold
from math import log2, ceil
import sys
from proglearn.progressive_learner import ProgressiveLearner
... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import random
import os
from time import sleep
from timeit import default_timer
# 启用调试
DEBUG = False
# ~ DEBUG = True
# 启用随机点击
# ~ RANDOM_CLICK = False
RANDOM_CLICK = True
class Block:
__slots__ = ["x", "y", "_clicked", "_have_mine", "_num", "_fl... |
import cv2
import time
from tkinter import *
import tkinter as tk
from tkinter import ttk
from PIL import Image, ImageTk
from utils import image_resize
from tkinter import messagebox
import smtplib
from email.mime.text import MIMEText
from email.mime.multipart import MIMEMultipart
from email.mime.base import MIMEBase
f... |
import logging
import torch
import tqdm
import timeit
import warnings
import numpy as np
import torch.nn.functional as F
from typing import Dict, Any, List, Optional, Union, Tuple
from numpy import random
from src.models.api import AbstractModel, EvaluationModel
from src.metrics import Metric
from src.callbacks imp... |
import os
import random
import numpy as np
import networkx as nx
from scipy.sparse import csr_matrix
from collections import Counter
from sklearn.metrics.pairwise import cosine_similarity
def determine_positive_and_negative_samples(graph, args):
if isinstance(graph, csr_matrix):
print ("graph is sparse adj m... |
# -*- coding: utf-8 -*-
# *****************************************************************************
# NICOS, the Networked Instrument Control System of the MLZ
# Copyright (c) 2009-2021 by the NICOS contributors (see AUTHORS)
#
# This program is free software; you can redistribute it and/or modify it under
# the t... |
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.utils.checkpoint import checkpoint
from typing import Optional
from torch import Tensor
import math
from utils import get_clones
from models.depatch_embed import build_patch_embeds
class Transformer(nn.Module):
"""
Transformer compu... |
from datetime import datetime, date
import numpy
import pandas
import copy
import uuid
from past.builtins import basestring # pip install future
from pandas.io.formats.style import Styler
from functools import partial, reduce
from .offline import iplot, plot
from IPython.core.display import HTML, display
import... |
import numpy as np
import matplotlib.pyplot as plt
import wobble
import tensorflow as tf
from tqdm import tqdm
import h5py
import os
__all__ = ["improve_order_regularization", "improve_parameter", "test_regularization_value", "plot_pars_from_file"]
def get_name_from_tensor(tensor):
# hacky method to get rid of ch... |
#!/usr/bin/env python3
"""
Simple test of read and write times for columnar data formats:
python filetimes.py <filepath> [pandas|dask [hdf5base [xcolumn [ycolumn] [categories...]]]]
Test files may be generated starting from any file format supported by Pandas:
python -c "import filetimes ; filetimes.base='<hdf5ba... |
from functools import partial
import types
from django.core.exceptions import FieldDoesNotExist, FieldError
from django.core.serializers.python import Serializer as _PythonSerializer
from django.core.serializers.xml_serializer import Serializer as _XmlSerializer
from django.db import models
from django.db.models.base ... |
# Copyright (c) 2016 Presslabs SRL
#
# 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 writ... |
#!/usr/bin/env python
from math import sqrt
import rospy
import rosparam
import signal
import socket
import sys
from diagnostic_msgs.msg import DiagnosticArray, DiagnosticStatus, KeyValue
from atlas_ros.msg import Ph, Conductivity, DissolvedOxygen, Temperature, OxiRedoxPotential
from atlas_ros.srv import CalibrateEC,... |
import sys
import os
import time
import socket
import logging
import traceback
from collections import deque
try:
# Use simplejson instead of json because it is released more frequently and
# is generally faster.
import simplejson as json
# However, if speedups are not installed, simplejson will be sl... |
# Copyright 2010-2011 OpenStack Foundation
# Copyright 2018 Verizon Wireless
# 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/... |
from flasgger import Swagger, swag_from
from flask import Flask, redirect, url_for, request, jsonify, make_response
from flask_restful import reqparse, abort, Api, Resource
from app import db
from app.models import Project, Worker, Temperature, Power, Alarm
from sqlalchemy import and_
import json
import random
import d... |
# Copyright (c) 2011 X.commerce, a business unit of eBay Inc.
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# Copyright 2011 Piston Cloud Computing, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (... |
import abc
import struct
from datetime import datetime, timezone
from typing import Any, Callable, Dict, List, Optional, Tuple, Union
from nanotime import nanotime
from hashkernel import BitMask, utf8_decode, utf8_encode
from hashkernel.files.buffer import FileBytes
from hashkernel.typings import is_NamedTuple, is_su... |
import os
import math
import csv
import time
import numpy as np
import matplotlib
matplotlib.use('agg')
import matplotlib.pyplot as plt
import torch
from torch.autograd import Variable
from data_attention_bottom import get_train, get_dev_test_original_expl, get_batch, build_vocab, get_target_expl_batch, get_dev_test... |
# Copyright 2009 Divmod, Inc. See LICENSE file for details
"""
Tests for L{xmantissa.terminal}.
"""
from zope.interface import implements
from zope.interface.verify import verifyObject
from twisted.internet.protocol import ProcessProtocol
from twisted.trial.unittest import TestCase
from twisted.cred.credentials imp... |
import numpy as np
from pyfmmlib2d import SFMM
def stokes_kernel(sx, tx):
ns = sx.shape[1]
nt = tx.shape[1]
dx = tx[0][:,None] - sx[0]
dy = tx[1][:,None] - sx[1]
d2 = dx**2 + dy**2
d = np.sqrt(d2)
logr = np.log(d)
c = 0.25/np.pi
G00 = (-logr + dx*dx/d2)
G01 = dx*dy/d2
G11 = ... |
"""
Implementation of IODINE from
"Multi-Object Representation Learning with Iterative Variational Inference"
<NAME>, <NAME>, <NAME>, <NAME>, <NAME>,
<NAME>, <NAME>, <NAME>, <NAME>
https://arxiv.org/abs/1903.00450
This (re)-implemetation is draws from re-implementations of
https://github.com/zhixuan-lin/IODINE
https... |
from Analisis_Ascendente.Instrucciones.Expresiones.Expresion import Expresion
import Analisis_Ascendente.Tabla_simbolos.TablaSimbolos as TS
from Analisis_Ascendente.Instrucciones.PLPGSQL.CasePL import CasePL
from Analisis_Ascendente.Instrucciones.PLPGSQL.Declaracion import Declaracion
from Analisis_Ascendente.Instrucci... |
"""
Created By <NAME>
October 2020
@parzuko
"""
import re
import discord
from discord import player
import lavalink
from discord.ext import commands
import random
import math
url_rx = re.compile(r'https?://(?:www\.)?.+')
time_hashmap = {}
class Music(commands.Cog):
def __init__(self, bot):
self.bot ... |
# Copyright (C) 2015-2019 <NAME>
# SPDX-License-Identifier: Apache-2.0
import dolfin
from dolfin import div, grad, dot, jump, avg
from . import UPWIND
from ..solver_parts import navier_stokes_stabilization_penalties
from .coupled_equations_cg import CoupledEquationsCG
class CoupledEquationsDG(object):
use_strong... |
r"""
Manifolds Catalog
A catalog of manifolds to rapidly create various simple manifolds.
The current entries to the catalog are obtained by typing
``manifolds.<tab>``, where ``<tab>`` indicates pressing the tab key.
They are:
- :func:`Sphere`: sphere embedded in Euclidean space
- :func:`Torus`: torus embedded in Eu... |
import math
import warnings
from fractions import Fraction
from typing import List, Tuple
import torch
from .._internally_replaced_utils import _get_extension_path
try:
lib_path = _get_extension_path("video_reader")
torch.ops.load_library(lib_path)
_HAS_VIDEO_OPT = True
except (ImportError, OSError):
... |
# Copyright 2018 Yelp
# Copyright 2019 Yelp
#
# 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... |
import requests
import enum
import tarfile
import zipfile
import gzip
import lzma
import shutil
from abc import abstractmethod
from datetime import timedelta
from hashlib import sha1
from pathlib import Path
from furl import furl
from typing import Optional, Set, List, Dict, Type
from marshmallow import Schema
from sq... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.