text stringlengths 8.04k 46.5k |
|---|
"""
This module has useful functions like smoothing, window-deconvolve, derivative etc.
Transfer functions associated with ParticleMesh objects are named pmXyz where Xyz
is the logical name.
"""
import numpy
import math
from scipy.interpolate import InterpolatedUnivariateSpline as interpolate
from scipy.integrate ... |
# Copyright (c) PagerDuty.
# See LICENSE for details.
import logging
import sys
import time
import warnings
from copy import deepcopy
import requests
from urllib3.connection import ConnectionError as Urllib3Error
from requests.exceptions import ConnectionError as RequestsError
if sys.version_info[0] == 3:
strin... |
import sys
from glob import glob
import numpy as np
import networkx as nx
import pandas as pd
import matplotlib.pyplot as plt
import matplotlib as mpl
from matplotlib.colors import ListedColormap
from matplotlib.collections import LineCollection
from matplotlib import lines, colors
from scipy.stats.kde import gaussi... |
""" The ref module contains the reference matrices and code for calculating the
Liouvillian.
Operator basis::
{ Eq,
Ix, Iy, Iz, Sx, Sy, Sz,
2IxSz, 2IySz, 2IzSx, 2IzSy,
2IxSx, 2IxSy, 2IySx, 2IySy,
2IzSz }
"""
import dataclasses as dc
import itertools as it
import re
... |
########################################
# Some notes on the installation and stuff ...
########################################
#!conda install -y -c bioconda bedtools
#!conda install -y -c bioconda ucsc-bedgraphtobigwig -> that was bad ... just a binary from UCSC - was a much better solution
########################... |
import discord
import helpers.helpers as helpers
import datetime
import asyncio
import os
import typing
import time
import textwrap
import traceback
import errors
import jishaku
import random
import itertools
from discord.ext import commands
import importlib
import jishaku.modules
import io
import cont... |
"""
Entrypoint Parser
-----------------
This module contains high-level objects to manage the functionality of ``generic_parser``: entry
point parser and decorator.
These allow a function to be decorated as entrypoint. This function will then automatically
accept console arguments, config files, json files, kwargs an... |
# coding=utf-8
# Copyright 2020 The Tensor2Tensor 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... |
# coding=utf-8
# Copyright 2021, The HuggingFace Inc. team. 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 ... |
# Author: <NAME> <<EMAIL>>
"""Plot uniform time-series of one variable."""
import operator
import matplotlib as mpl
import numpy as np
from .._celltable import Celltable
from .._data_obj import ascategorial, asndvar, assub, cellname, longname
from .._stats import stats
from . import _base
from ._base import (
Eel... |
# Tests for functions in surf_plotting.py
import os
import tempfile
import warnings
import itertools
from distutils.version import LooseVersion
import nibabel as nb
import numpy as np
import pytest
from numpy.testing import assert_array_equal, assert_array_almost_equal
from scipy.spatial import Delaunay
from nibab... |
"""Functions to compute polar/azimuthal averages in radial bins"""
import math
import warnings
import numpy as np
import scipy
from astropy.coordinates import SkyCoord
from astropy import units as u
from .. gcdata import GCData
from . .utils import compute_radial_averages, make_bins, convert_units, arguments_consistenc... |
import warnings
from copy import deepcopy
import numpy as np
import astropy.units as u
from astropy.coordinates import BaseCoordinateFrame, Longitude, SkyCoord, get_body
from astropy.time import TimeDelta
from sunpy.coordinates import Heliocentric, HeliographicStonyhurst, Helioprojective
from sunpy.map import (
... |
# no mother classes have been defined yet! not sure how to separate the the filed in folders...
from enum import Enum
from pyrevolve.genotype import Genotype
from pyrevolve.revolve_bot import RevolveBot
from pyrevolve.revolve_bot.revolve_module import Orientation
from pyrevolve.revolve_bot.revolve_module import CoreMo... |
# Copyright 2021 Xilinx Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
# -*- coding:utf-8 -*-
# Copyright (c) 2010-2012 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ... |
import jax
import jax.numpy as np
from jax.config import config
config.update("jax_enable_x64", True)
def jax_bdf_integrate(fun, y0, t_eval, jac=None, inputs=None, rtol=1e-6, atol=1e-6):
"""
Backward Difference formula (BDF) implicit multistep integrator. The basic algorithm
is derived in [2]_. This part... |
"""Passive BLE monitor integration."""
import asyncio
import copy
import json
import logging
from threading import Thread
import voluptuous as vol
import aioblescan as aiobs
import janus
from homeassistant.config_entries import SOURCE_IMPORT, ConfigEntry
from homeassistant.const import (
CONF_DEVICES,
CONF_DI... |
import collections
import copy
import itertools
import os
import asdl
import attr
import networkx as nx
from ratsql import ast_util
from ratsql.utils import registry
def bimap(first, second):
return {f: s for f, s in zip(first, second)}, {s: f for f, s in zip(first, second)}
def filter_nones(d):
return {k... |
"""
Generic utilities
"""
import datetime
import decimal
import hashlib
import json
import platform
import subprocess
import uuid
import threading
from collections import OrderedDict
from contextlib import contextmanager
from operator import itemgetter
import time
import os
import re
import shlex
from ijson import comm... |
# Copyright 2016 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... |
import numpy as np
from scipy import optimize
from numpy.testing import assert_allclose
from itertools import product
import pytest
from sklearn.utils._testing import assert_almost_equal
from sklearn.utils._testing import assert_array_equal
from sklearn.utils._testing import assert_array_almost_equal
from sklearn.dumm... |
# -*- coding: utf-8 -*-
"""
Copyright [2009-2017] EMBL-European Bioinformatics Institute
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 requir... |
from igibson.envs.igibson_env import iGibsonEnv
import numpy as np
from igibson.objects.ycb_object import YCBObject
from igibson.objects.articulated_object import ArticulatedObject
import math
import pybullet as p
import torch
import random
from gym import spaces
def quaternion_from_euler(ai, aj, ak, axes='sxyz'):
... |
# Copyright 2019-2022 Cambridge Quantum Computing
#
# 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... |
import os, cv2, math
import numpy as np
from scipy import ndimage
from scipy.ndimage import convolve
from scipy.signal import medfilt2d
from skimage import color, io, segmentation
from skimage import color
import matplotlib.pyplot as plt
import networkx as nx
from scipy.spatial import distance
from skimage im... |
"""
mbed SDK
Copyright (c) 2019 ARM Limited
SPDX-License-Identifier: Apache-2.0
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 req... |
import numpy as np
import matplotlib
from matplotlib import colors
from matplotlib import cm
import matplotlib.pyplot as plt
import folium
from folium.plugins import HeatMap
from loci.analytics import bbox, kwds_freq, filter_by_kwd
from wordcloud import WordCloud
from pandas import DataFrame, concat
from geopandas impo... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2016, <NAME> <<EMAIL>>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = '''
---
module: lxd_container
short_des... |
# -*- coding: utf-8 -*-
"""
module for mul and mulfix class: fund combination management
"""
import logging
import pandas as pd
from pyecharts import options as opts
from pyecharts.charts import Pie, ThemeRiver
from xalpha.cons import convert_date, myround, yesterdaydash, yesterdayobj
from xalpha.evaluate import eval... |
import os
import tempfile
import glob
import time
import random
import copy
from datetime import datetime
import tempfile
from collections import defaultdict
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.autograd as A
from torch.utils.data import DataLoader, Subset,... |
#!/usr/bin/env python
# coding: utf-8
import hashlib
import os
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
import math, copy
from torch.autograd import Variable
import pandas as pd
import re
from tqdm import trange
from time import time
from keras.preprocessing.sequence impor... |
import os
from collections import Counter
from copy import deepcopy
from shutil import copyfile
import torch
import torch.nn as nn
from models.networks import model_val, cem2normal
import logging
logger = logging.getLogger('base')
class nullcast():
#nullcontext:
#https://github.com/python/cpython/commit/07... |
"""
Geometry generator from
Shapefiles (buiding footprint)
and .tiff (terrain)
into 3D geometry with windows and roof equivalent to LOD3
"""
import os
import pickle
from itertools import repeat
from osgeo import gdal, osr
import geopandas as gpd
import cea
cea.suppress_3rd_party_debug_loggers()
import math
import... |
from array import array
from dataclasses import dataclass
from msilib.schema import Error
STACKHEAD = "sys_stackhead"
def hi(b):
return (b >> 8) & 0xff
def lo(b):
return b & 0xff
class Scope:
def __init__(self, context, prev_scope = None):
self.variables = {}
self.funcparams = {}
... |
# Project: Haptyc
# Author: <NAME> (@defparam)
#
# Copyright 2021 <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
#
# U... |
# -*- coding: utf-8 -*-
"""
:mod:`main`
===========================================================================
:synopsis: Main class
:author: UCADatalab - http://datalab.uca.es, NESG (Network Engineering & Security Group) - https://nesg.ugr.es
:contact: <EMAIL>, <EMAIL>, <EMAIL>
:organizati... |
"""
Helper function for running Grizli redshift fits in AWS lambda
event = {'s3_object_path' : 'Pipeline/j001452+091221/Extractions/j001452+091221_00277.beams.fits'}
Optional event key (and anything to grizli.fitting.run_all):
'skip_started' : Look for a start.log file and abort if found
'check_wcs' : check... |
from enum import Enum
from http import HTTPStatus
from requests import HTTPError
from typing import Any, Dict, List, Optional, Set
from intezer_sdk.api import IntezerApi
from intezer_sdk.errors import UnsupportedOnPremiseVersion
from intezer_sdk.consts import OnPremiseVersion, BASE_URL, API_VERSION, AnalysisSta... |
# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserve.
#
# 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 appl... |
# Copyright (C) 2021, QuantStack
# SPDX-License-Identifier: BSD-3-Clause
from boa.core.solver import get_solver
import copy
import re
import json
from pathlib import Path
import sys
from dataclasses import dataclass
from typing import Tuple
import rich
from rich.table import Table
from rich.padding import Padding
#... |
# $Id$
#
# Copyright (C) 2001-2011 <NAME> and Rational Discovery LLC
#
# @@ All Rights Reserved @@
# This file is part of the RDKit.
# The contents are covered by the terms of the BSD license
# which is included in the file license.txt, found at the root
# of the RDKit source tree.
#
""" SMARTS definitions for th... |
# coding: utf-8
# Copyright (c) 2021 AkaiKKRteam.
# Distributed under the terms of the Apache License, Version 2.0.
import shutil
from pymatgen.core.sites import PeriodicSite
from pymatgen.core import Structure
from pymatgen.analysis.structure_matcher import StructureMatcher
import json
from pymatgen.symmetry.analy... |
#!/usr/bin/env python3
"""Module dedicated to the time simulation of reaction models.
Here are functions that calculate reaction rates as well, which is needed for
the time simulations.
"""
from __future__ import annotations
__all__ = ["get_y", "get_dydt", "get_fixed_scheme"]
import logging
import numpy as np
f... |
#!/usr/bin/env python3.6
import sys
import os
import time
import shlex
import platform
import re
import traceback
import appdirs
import utils
from configVar import config_vars
from .instlException import InstlException
current_os = platform.system()
if current_os == 'Darwin':
current_os = 'Mac'
elif current_o... |
from ...third_party import WebsocketServer # type: ignore
from .configurations import ConfigManager
from .configurations import WindowConfigManager
from .diagnostics import ensure_diagnostics_panel
from .logging import debug
from .logging import exception_log
from .message_request_handler import MessageRequestHandler
... |
from typing import Any, TypeVar, Optional, List, Tuple, Dict, Set, Iterator
import wn
from wn._util import flatten
from wn import _db
_FAKE_ROOT = '*ROOT*'
_INFERRED_SYNSET = '*INFERRED*'
class _DatabaseEntity:
__slots__ = '_id',
_ENTITY_TYPE = ''
def __init__(self, _id: int = _db.NON_ROWID):
... |
import numpy as np
from mpl_toolkits.axes_grid1 import make_axes_locatable
from matplotlib.colors import LightSource
from meshoid import GridSurfaceDensity as GridSurfaceDensity
import aggdraw
from PIL import Image, ImageDraw, ImageFont, ImageChops
import matplotlib
matplotlib.use('Agg')
from matplotlib import pyplot a... |
# libraries
import os
from pathlib import Path
from collections import defaultdict
import scipy
import random
import numpy as np
import xarray as xr
import pandas as pd
import joblib
from skimage.filters import sobel
from sklearn.model_selection import train_test_split, GridSearchCV
from sklearn.metrics import r2_score... |
# -*- coding: utf-8 -*-
"""
Created on Fri Nov 30 21:50:19 2018
@author: renxi
"""
# In[] BisecBSIV
def BisecBSIV(PutCall,S,K,rf,q,T,a,b,MktPrice,Tol,MaxIter):
# =============================================================================
# The earlier code invokes theMatlab function Bis... |
import sys
from PyQt4 import QtGui, QtCore
#from GUIElements import *
from GUIElements import FCEntry, FloatEntry, EvalEntry, FCCheckBox, \
LengthEntry, FCTextArea, IntEntry, RadioSet, OptionalInputSection
class ObjectUI(QtGui.QWidget):
"""
Base class for the UI of FlatCAM objects. Deriving classes should... |
#!/usr/bin/python3
from frc971.control_loops.python import control_loop
from frc971.control_loops.python import controls
import numpy
import sys
from matplotlib import pylab
import glog
class DrivetrainParams(object):
def __init__(self,
J,
mass,
robot_radius,
... |
# coding: utf-8
# In[2]:
get_ipython().magic('matplotlib inline')
import matplotlib.pyplot as plt
from keras.layers import Bidirectional, Input, LSTM, Dense, Activation, Conv1D, Flatten, Embedding, MaxPooling1D, Dropout
#from keras.layers.embeddings import Embedding
from keras.preprocessing.sequence import pad_seq... |
# -*- coding: utf-8 -*-
"""
Created on Tue Mar 13 12:00:44 2018
@author: DLozano
"""
import matplotlib.pylab as plt
import numpy as np
import time
import cv2
import sys, os
#%%
# dirParent = "D:/OneDrive - LA TROBE UNIVERSITY/PhD - Datasets"
# dirParent = "C:/Users/dlozanoclaro/OneDrive - LA TROBE UNI... |
# -*- coding: utf-8 -*-
# This code is part of Qiskit.
#
# (C) Copyright IBM 2017, 2021.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any... |
#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import functools
import os
import subprocess
import tempfile
import textwrap
import threading
import unittest
from con... |
# -*- coding: utf-8 -*-
'''
Open Facebook allows you to use Facebook's open graph API with simple python code
**Features**
* Supported and maintained
* Tested so people can contribute
* Facebook exceptions are mapped
* Logging
**Basic examples**::
facebook = OpenFacebook(access_token)
# G... |
# Microsoft Azure Linux Agent
#
# Copyright 2020 Microsoft Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... |
from BirdSongToolbox.file_utility_functions import _save_numpy_data, _save_pckl_data
import numpy as np
import os
import h5py
# TODO: Switch modular functions to Pathlib
# TODO: Write Test Scripts for these Functions
def ask_data_path(start_path, focus: str):
""" Asks the User to select data they wish to selec... |
# ___________________________________________________________________________
#
# EGRET: Electrical Grid Research and Engineering Tools
# Copyright 2019 National Technology & Engineering Solutions of Sandia, LLC
# (NTESS). Under the terms of Contract DE-NA0003525 with NTESS, the U.S.
# Government retains certain r... |
# -*- coding: utf-8 -*-
"""Utilities for working with S3."""
from __future__ import unicode_literals
from past.builtins import basestring, str
from concurrent import futures
import fnmatch
from functools import wraps, reduce
import gzip
import itertools
import logging
import os
import re
import shutil
import tempfile
... |
"""
GBTIDL SDFITS file
==================
GBTIDL SDFITS files representing GBT observing sessions can be read into
pyspeckit. Additional documentation is needed. Nodding reduction is
supported, frequency switching is not.
"""
from __future__ import print_function
from six import iteritems
try:
import astropy.io... |
#
# Copyright (C) 2014 Red Hat, Inc
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wr... |
# -*- coding: utf-8 -*-
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright (C) 2015-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... |
r"""
The Real Line and Open Intervals
The class :class:`OpenInterval` implement open intervals as 1-dimensional
differentiable manifolds over `\RR`. The derived class :class:`RealLine` is
devoted to `\RR` itself, as the open interval `(-\infty, +\infty)`.
AUTHORS:
- <NAME> (2015): initial version
- <NAME> (2016): re... |
#!/usr/bin/env python
"""Train a DeepCpG model to predict DNA methylation.
Trains a DeepCpG model on DNA (DNA model), neighboring methylation states
(CpG model), or both (Joint model) to predict CpG methylation of multiple cells.
Allows to fine-tune individual models or to train them from scratch.
Examples
--------
... |
from datetime import datetime as dt, timedelta
import numpy as np
import os
import torch
from torch.nn import MSELoss
from torch.optim import LBFGS, Adam
from adabelief_pytorch import AdaBelief
from torch_cpo_utils import *
# from cpo_torch import CPO
from buffer_torch import *
from models_torch import MLP_DiagGaussi... |
# Copyright (C) 2019 <NAME>
#
# This software may be modified and distributed under the terms
# of the MIT license. See the LICENSE file for details.
from __future__ import annotations
import itertools
import logging
from typing import Mapping, Callable
from llvmlite import ir, binding
from orcinus.collections impo... |
import shutil
import numpy as np
import iric
from . import util
def case_GridRead():
shutil.copy("data/case_init_hdf5.cgn", "data/case_grid.cgn")
fid = iric.cg_iRIC_Open("data/case_grid.cgn", iric.IRIC_MODE_MODIFY)
util.verify_log("cg_iRIC_Open() fid != 0", fid != 0)
isize, jsize = iric.cg_iRIC_Rea... |
# Copyright (c) 2021 PaddlePaddle 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 appli... |
print("Starting Browser imports... ")
from os import chdir, getcwd
from collections.abc import Iterable
from collections import defaultdict
from random import choice, shuffle
from math import ceil
from time import sleep
from datetime import datetime, timedelta
from typing import Tuple, Any, Union, Iterable, List, Opt... |
# Unicorn Python bindings, by <NAME> <<EMAIL>>
import ctypes
import ctypes.util
import distutils.sysconfig
import pkg_resources
import inspect
import os.path
import sys
import weakref
from . import x86_const, arm64_const, unicorn_const as uc
if not hasattr(sys.modules[__name__], "__file__"):
__file__ = inspect.g... |
import dgl
import sys
import os
import numpy as np
from scipy import sparse as spsp
from numpy.testing import assert_array_equal
from dgl.heterograph_index import create_unitgraph_from_coo
from dgl.distributed import partition_graph, load_partition
from dgl import function as fn
import backend as F
import unittest
impo... |
import os
import re
import sys
#from jsonschema import validate
from datetime import datetime
from pprint import pprint
#### Define functions
def merge_classification(dst, src):
if src is None:
return
for key in src.keys():
if key not in dst:
dst[key] = []
for val in s... |
"""
Type Inference
"""
from .typevar import TypeVar
from .ast import Def, Var
from copy import copy
from itertools import product
try:
from typing import Dict, TYPE_CHECKING, Union, Tuple, Optional, Set # noqa
from typing import Iterable, List, Any, TypeVar as MTypeVar # noqa
from typing import cast
fr... |
"""
Reads cloud cleared GOES-16 data and returns an object with the relevant data.
This software is hereby placed in the public domain.
<EMAIL>
"""
import os
import sys
import numpy as np
from datetime import date, datetime, timedelta
from glob import glob
from netCDF4 import Dataset
#---
DATE_START = date... |
from os import path
import yaml
from collections import OrderedDict
from profit import defaults
from profit.util.base_class import CustomABC
import warnings
VALID_FORMATS = ('.yaml', '.py')
"""
yaml has to be configured to represent OrderedDict
see https://stackoverflow.com/questions/16782112/can-pyyaml-dump-dict-it... |
##########################################################################
#
# Copyright (c) 2011-2012, <NAME>. All rights reserved.
# Copyright (c) 2011-2013, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided ... |
# coding=utf-8
# Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team.
# Copyright (c) 2018, NVIDIA CORPORATION. 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 cop... |
"""
Author : <NAME>\n
email : <EMAIL>\n
LICENSE : MIT License
"""
import torch
from torch import nn
import pandas as pd
import matplotlib.pyplot as plt
from msdlib import msd
import numpy as np
import os
import joblib
import time
plt.rcParams['figure.facecolor'] = 'white'
class NNmodel(nn.Module)... |
# https://gist.githubusercontent.com/anabranch/48c5c0124ba4e162b2e3/raw/6b1acf8391b15ad3a663beb7e685e6835c964036/tfpdf.py
# http://www.cs.duke.edu/courses/spring14/compsci290/assignments/lab02.html
from __future__ import division
from nltk.tokenize import word_tokenize
from scipy.spatial import distance
from nltk.stem.... |
"""Classes for odorants, mixtures, chemical orders, etc."""
import base64
import io
import json
import re
import time
import warnings
from collections import OrderedDict
from datetime import datetime
from urllib.parse import quote
import numpy as np
import pandas as pd
import pubchempy as pcp
import requests
from IP... |
# Copyright 2020 The PyMC Developers
#
# 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 ag... |
# -*- coding: utf-8 -*-
"""Directory entry operations with PyFAT."""
import posixpath
import struct
import warnings
from time import timezone
from pyfatfs.DosDateTime import DosDateTime
from pyfatfs.EightDotThree import EightDotThree
from pyfatfs._exceptions import PyFATException, NotAnLFNEntryException,\
BrokenL... |
from django.shortcuts import render, redirect
from django.http import HttpResponse
from home.models import Student, Teacher, Subject, CourseReg, Quiz, QuizResult
import random
import json
from datetime import datetime
# homepage.
# dynamic things = login thakle nam and relevant link show korbe. Login na thakle login/... |
# Copyright (c) 2011 - 2017, Intel Corporation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agre... |
# -*- coding: utf-8 -*-
# Copyright 2014-2016 OpenMarket Ltd
# Copyright 2018 New Vector Ltd
#
# 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... |
from textwrap import dedent
from random import randint
from discord import Embed, Member
from discord.ext import commands
from datetime import datetime
from typing import Optional
from PIL import Image, ImageFont, ImageDraw
from framework import Wealth, Misc, Paginator, require_account
class EconomyFunCog(com... |
# Copyright 2021 Google 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, ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# vim: et sw=4 ts=4
'''
Copyright (c) 2008, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.html
version: 1.0.0b1
'''
''' A class to parse Javadoc style comments out of javascript to document
an... |
# Copyright (C) 2020. Huawei Technologies Co., Ltd. All rights reserved.
#
# 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 us... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from datetime import datetime
import os
import time
import sys
import tensorflow as tf
import numpy as np
import importlib
import itertools
import argparse
# import facenet
import bioid
#import lfw
import libr... |
from contextlib import suppress
import logging
import uuid
from flask import (
abort,
Blueprint,
current_app,
flash,
g,
redirect,
render_template,
request,
session,
url_for,
)
from flask_login import login_required, login_user, logout_user
from flask_wtf import FlaskForm
from sq... |
""" <NAME> <<EMAIL>>
Sept 17, 2018
"""
import getopt
import sys
import csv
import numpy as np
import dill as pickle # see https://stackoverflow.com/questions/25348532/can-python-pickle-lambda-functions
import random
from tqdm import tqdm
from mdp import MDP
from sarsa import SARSA
from forward import FORWARD
from... |
#!/usr/bin/env python
# coding: utf-8
# # Developing an AI application
#
# Going forward, AI algorithms will be incorporated into more and more everyday applications. For example, you might want to include an image classifier in a smart phone app. To do this, you'd use a deep learning model trained on hundreds of tho... |
#!/usr/env/python
"""
cts_lattice_gas.py: continuous-time stochastic version of a lattice-gas cellular
automaton model.
GT Sep 2014
"""
from __future__ import print_function
import random
import time
from numpy import arange, bincount, zeros
from pylab import axis, plot, show, subplots, title, xlabel, ylabel
from l... |
import os
import sys
import numpy as np
import matplotlib.pyplot as plt
rng = np.random.default_rng(2021) #Setting the seed for reproducibility
def coords_to_string(coords):
"""Function to convert a (RA, DEC) set of coordinates to a string.
Args:
coords:
List or tuple with RA and DEC.
Retur... |
"""
implement ua datatypes
"""
import logging
from enum import Enum, IntEnum
from calendar import timegm
import pytz
import sys
import os
import uuid
import re
import itertools
from datetime import datetime, timedelta, MAXYEAR, tzinfo
from opcua.ua import status_codes
from opcua.ua import ObjectIds
from opcua.ua.uaer... |
"""
This module contains platform specific methods and classes for deployment
on AWS platform
"""
import logging
import os
import shutil
from subprocess import PIPE, Popen
import boto3
from ocs_ci.cleanup.aws.defaults import CLUSTER_PREFIXES_SPECIAL_RULES
from ocs_ci.deployment.ocp import OCPDeployment as BaseOCPDepl... |
# ___ __ ___ _ _ ___
# || \/ | ||=|| \\// ||=||
# || | || || // || ||
import email.utils
import time
import functools
from datetime import timedelta, datetime as Datetime
import re
import pytz
import humanize
import dateparser
import pendulum
import snaptime
from tzlocal import get_localzone
from dateutil.re... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.