text stringlengths 8.04k 46.5k |
|---|
"""
MIT License
Copyright (c) 2017-2019 kyb3r
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, di... |
"""Implementation of closeGraph."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import codecs
import collections
import copy
import itertools
import time
from graph import AUTO_EDGE_ID
from graph import Graph
from graph import VACANT_GRAPH_ID
from graph... |
# (c) <NAME>, 2010-2021. MIT License.
import webbrowser
import numpy as np
from bokeh.colors import RGB
from bokeh.models import (
BasicTicker,
ColorBar,
HoverTool,
LinearColorMapper,
PrintfTickFormatter,
Range1d,
)
from bokeh.plotting import ColumnDataSource, figure
from bokeh.plotting import ... |
"""Script for training the MultipleEVM (MEVM) given a trained CRNN."""
# Python default packages
import logging
import os
# 3rd party packages
import h5py
import numpy as np
from ruamel.yaml import YAML
from scipy import stats
from sklearn.decomposition import PCA
import torch
from torch.autograd import Variable
from ... |
#!/usr/bin/python2.5
# Copyright (C) 2007 Google 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 la... |
# Copyright (C) 2020-2021 Intel Corporation
#
# SPDX-License-Identifier: MIT
import logging as log
import numpy as np
import copy
from math import gcd
from enum import Enum
from datumaro.components.extractor import (Transform, AnnotationType,
DEFAULT_SUBSET_NAME)
from datumaro.components.cli_plugin import CliPlug... |
#!/usr/bin/python -u
# -*- coding: utf-8 -*-
import dbus
import fcntl
import functools
import gobject
import itertools
import logging
import os
import sc_utils
import signal
import sys
import traceback
# Victron packages
sys.path.insert(1, os.path.join(os.path.dirname(__file__), 'ext', 'velib_python'))
from sc_utils ... |
"""Node embedding optimizers"""
import abc
from abc import abstractmethod
import torch as th
from ...utils import get_shared_mem_array, create_shared_mem_array
from ...nn.pytorch import NodeEmbedding
from ...cuda import nccl
from ...partition import NDArrayPartition
class SparseGradOptimizer(abc.ABC):
r''' The ab... |
#!/usr/bin/env python3
'''Program plots data from home databases.
Run with -h or --help to see command line options.
'''
import pandas as pd # https://pandas.pydata.org/pandas-docs/stable/
import numpy as np # https://numpy.org/doc/stable/
from bokeh.layouts import gridplot # ht... |
"""Compatibility fixes for older version of python, numpy and scipy
If you add content to this file, please give the version of the package
at which the fix is no longer needed.
# XXX : originally copied from scikit-learn
"""
# Authors: <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
# ... |
"""
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/.
"""
from __future__ import annotations
import asyncio
import csv
import random
import time
from collections import defaul... |
import numpy as np
import os
import cv2
import torch
import torch.nn as nn
import torchvision.transforms as transforms
from skimage.io import imread, imsave
from skimage.transform import estimate_transform, warp
from time import time
from models.resfcn import load_SPRNET
from data.dataset import USRTestDataset, ToTenso... |
"""Sensor platform for garbage_collection."""
import logging
from datetime import date, datetime, time, timedelta
from typing import Any, List, Optional
import holidays
import homeassistant.util.dt as dt_util
from dateutil.parser import parse
from dateutil.relativedelta import relativedelta
from homeassistant.const im... |
"""Functions for computing biochemical edges of graphs."""
# Graphein
# Author: <NAME>, <NAME> <<EMAIL>>
# License: MIT
# Project Website: https://github.com/a-r-j/graphein
# Code Repository: https://github.com/a-r-j/graphein
from __future__ import annotations
import logging
from itertools import combinations
from typ... |
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
from matplotlib.gridspec import GridSpec, GridSpecFromSubplotSpec
from mpl_toolkits.axes_grid1.inset_locator import inset_axes
from mpl_toolkits.axes_grid1 import make_axes_locatable
import copy
from .pdp_plot_utils import _axes_modify
from ... |
"""
@package mi.instrument.um.thsph.thsph.driver
@file marine-integrations/mi/instrument/um/thsph/thsph/driver.py
@author <NAME>
@brief Driver for the thsph
Release notes:
Vent Chemistry Instrument Driver
"""
import re
import time
from mi.core.exceptions import InstrumentException
from mi.core.driver_scheduler impo... |
#!/usr/bin/env python3
# -*- mode: python; py-indent-offset: 4; py-continuation-offset: 4 -*-
#===============================================================================
#
# License (3-Clause BSD)
# ----------------------
# Copyright 2021 National Technology & Engineering Solutions of Sandia,
# LLC (NTESS). Under ... |
import numpy as np
import pandas as pd
import math
import mutual_information.mf as mf
import mutual_information.synergy_tree as synergy_tree
from mimic_mf_analysis.preparation import encounterOfInterest, indexEncounterOfInterest, diagnosisProfile, rankICD, rankHpoFromLab, rankHpoFromText
from tqdm import tqdm
from mim... |
from __future__ import print_function, absolute_import, division
import pandas as pd
import numpy as np
import argparse
import json
import math
import re
import os
import sys
import csv
import socket # -- ip checks
import seaborn as sns
import matplotlib.pyplot as plt
from jinja2 import Environment, PackageLoader
#... |
"""This module performs additional processing necessary when optimizing hyperparameters in the
`Keras` library. Its purpose is twofold: 1) to enable the construction of Keras models while
requiring minimal syntactic changes on the user's end when defining hyperparameter space choices;
and 2) to enable thorough collecti... |
"""Generate C code from an ASDL description."""
import os
import sys
import textwrap
import re
import dataclasses
from abc import ABCMeta, abstractmethod
from typing import Union, Optional
from argparse import ArgumentParser
from contextlib import contextmanager
from dataclasses import dataclass
from enum import Enum... |
from timeit import default_timer as timer
import numpy as np
from numpy import outer as np_outer
import time
import matplotlib.pyplot as plt
import numexpr as ne
from numexpr import evaluate
import sys
import os
import random
import inspect
import json
import pickle
class CRBM:
def __init__(self, n_vis, n_h... |
import uuid
import numpy as np
import logging
import os
from datetime import datetime
import re
from copy import deepcopy
try:
import importlib.resources as pkg_resources
except ImportError:
# Try backported to PY<37 `importlib_resources`.
import importlib_resources as pkg_resources
from .... |
#!/usr/bin/python
import os
import sys
import re
import copy
import monkTools as tools
sys.path.append(tools.get_current_path(__file__) + "/ply/ply/")
sys.path.append(tools.get_current_path(__file__) + "/codeBB/")
sys.path.append(tools.get_current_path(__file__) + "/codeMarkDown/")
sys.path.append(tools.get_current_p... |
# ------------------------------------------------------------------------------
# Copyright (c) Microsoft
# Licensed under the MIT License.
# Written by <NAME> and <NAME>
# Email: <EMAIL>
# siamrpn class
# ------------------------------------------------------------------------------
import torch
import numpy as np
f... |
# coding=utf-8
# Copyright 2022 The Fiddle-Config 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... |
import glob
import torch
import torchvision
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
from PIL import Image
import cv2
#import skvideo.io
import pywt
matplotlib.use('agg')
import matplotlib.pyplot as plt
from skimage import measure
import numpy as np
import cv2
# -*- coding: utf-8 -*-
impor... |
"""
Copyright (c) 2018 iCyP
Released under the MIT license
https://opensource.org/licenses/mit-license.php
"""
import bpy,blf
import bmesh
from .. import V_Types as VRM_types
from ..V_Types import nested_json_value_getter as json_get
from .armature_maker import ICYP_OT_MAKE_ARAMATURE
import re
from math import sqrt, p... |
import struct
import logging
import asyncio
from bitarray import bitarray
from migen import *
from migen.genlib.cdc import MultiReg
from migen.genlib.fsm import FSM
from .. import *
from ...gateware.pads import *
from ...database.jedec import *
from ...arch.jtag import *
from ...pyrepl import *
class JTAGBus(Module)... |
# -*- coding: utf-8 -*-
"""
Implements dagger monoidal functors into tensors.
>>> n = Ty('n')
>>> Alice, Bob = rigid.Box('Alice', Ty(), n), rigid.Box('Bob', Ty(), n)
>>> loves = rigid.Box('loves', n, n)
>>> ob, ar = {n: 2}, {Alice: [0, 1], loves: [0, 1, 1, 0], Bob: [1, 0]}
>>> F = Functor(ob, ar)
>>> assert F(Alice >... |
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import sys
import argparse
def save(d1, fname):
d1.to_csv(fname, index=False)
def colC(d1):
if "C" in d1.columns : return
names = d1["Model Name"].values
nv = []
for s in names:
if "Lasso" in s:
v = float(s... |
#!/usr/bin/env python3
import collections
import datetime
import functools
import json
import logging
import random
import re
import os
import flask
import flask_sqlalchemy
import requests
import pytz
import app_secrets
import stats
import util
DB_INSTANCE = 'two-truths:us-central1:two-truths'
DB_USER = 'two_truths'... |
import numpy as np
from scipy.integrate import quad
from landlab.components.erosion_deposition.generalized_erosion_deposition import (
DEFAULT_MINIMUM_TIME_STEP,
_GeneralizedErosionDeposition,
)
from landlab.utils.return_array import return_array_at_node
from .ext.calc_qs import calculate_qs_in
ROOT2 = np.sq... |
#!/usr/bin/env python3
"""generate 2spk conv kernels dynamically
"""
import os
import sys
import hashlib
class KernelInfo:
def __init__(self, path, flt_size, s_size, k_num, cta_y_num, cta_x_num, warp_y, warp_x, buf_size):
self.path = path
self.flt_size = flt_size
self.s_size = s_size
... |
# === common imports ===
import requests
import json
import uuid
import logging
logger = logging.getLogger()
logger.setLevel(logging.INFO)
# === aws imports ===
import boto3
from boto3 import resource
# === azure imports ===
import httplib, urllib
# === gcp imports ===
# Imports the Google Cloud client library
fr... |
# -*- coding: utf-8 -*-
"""
Created on 17-7-18
@author: hy_qiu
"""
import json
import multiprocessing.dummy as mt
import os
import re
import time
import requests
import util.excel
import util.fileutil
import util.js
import util.mt
import util.verify
from bs4 import BeautifulSoup
from util.wraps imp... |
from __future__ import absolute_import, division, print_function
from operator import attrgetter
import iotbx
from scitbx.array_family import flex
from mmtbx.chemical_components import get_type
from libtbx.utils import Sorry
from mmtbx.monomer_library import linking_setup
from mmtbx.monomer_library.linking_setup impor... |
#!/usr/bin/env python3
import enum
import json
import logging
import pathlib
import strink
__version__ = "1.0.2"
class UpperDict(dict):
class _Sentinel(enum.Enum):
NOTSPECIFIED = 1
def __getitem__(self, k):
if hasattr(k, "upper"):
k = k.upper()
return super().__getitem__(k)
def __setitem__(self, k, v... |
import numpy as np
from scipy.linalg import expm
from eom import eom,eom_coeffs,eom_spfs,cmfeom_coeffs
#from eom import fulleom,eom_coeffs,eom_spfs
from optools import matel
from cy.wftools import norm,inner
from functools import lru_cache
import units as units
@lru_cache(maxsize=None,typed=False)
def get_butcher(met... |
import numpy as np
import pytest
from simphox.fdfd import FDFD
from simphox.typing import Size, Size3, Optional, List, Union
np.random.seed(0)
from jax.config import config
config.update("jax_enable_x64", True)
# config.update('jax_platform_name', 'cpu')
EPS_3_3_2 = 1 + np.random.rand(3, 3, 2).astype(np.complex128... |
from flask import Flask, jsonify, render_template, request, session, redirect, url_for, send_from_directory, send_file, Response
from jinja2 import Template
from werkzeug.utils import secure_filename
import csv
import pandas as pd
import numpy as np
import json
import sys
import copy
import os
import tempfile
#import s... |
#!/usr/local/bin/python3
# -*- coding: utf-8 -*-
"""
"Wireless (Bluetooth) Water Quality Monitor"
"based on PyQt5, Matplotlib, Arduino, and Sensors"
author: <NAME>, <NAME>
last edited: Sept. 1, 2017
"""
# Oct. 20
# change single-end to differential,
# ADC1, pin0-ph; pin1-1.5V; pin2-Cl, pin3-1.5V
# chnage LSB of... |
import torch
import torch.nn.functional as F
from torch.nn import Linear
from reformer_pytorch import ReformerLM
from reformer_pytorch.generative_tools import TrainingWrapper
import argparse
import deepspeed
import json
import os
import pickle
from utils import *
from over9000 import RangerLars
import numpy as np
impor... |
# -*- coding: ISO-8859-1 -*-
import wx
from meerk40t.gui.icons import icons8_administrative_tools_50
from meerk40t.gui.mwindow import MWindow
_ = wx.GetTranslation
MILS_IN_MM = 39.3701
class LhystudiosConfigurationPanel(wx.Panel):
def __init__(self, *args, context=None, **kwds):
kwds["style"] = kwds.g... |
import logging
import threading
import random
from tests import helpers
from ocs_ci.ocs.ocp import OCP
from ocs_ci.framework import config
from ocs_ci.ocs.resources import pod, pvc
from ocs_ci.ocs import constants, cluster, machine, node
from ocs_ci.ocs.exceptions import (
UnavailableResourceException, UnexpectedB... |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
"""
Catalog gene losses, and bites within genes.
"""
from __future__ import print_function
import sys
import logging
from itertools import groupby
from jcvi.formats.blast import Blast
from jcvi.formats.bed import Bed
from jcvi.utils.range import range_minmax, range_over... |
import math
import torch
import torch.nn as nn
import torch.nn.functional as F
from mmdet.models.utils.attention_module import CBAMBlock
from mmdet.core.utils.summary import (
get_epoch, get_total_epoch, get_inner_iter, get_total_inner_iter, add_summary)
from mmdet.models.utils.norm import ShareBN
_dyn_dila_count... |
import torch
from torchvision import transforms
import cv2
import numpy as np
import types
from numpy import random
from imgaug import augmenters as iaa
def intersect(box_a, box_b):
max_xy = np.minimum(box_a[:, 2:], box_b[2:])
min_xy = np.maximum(box_a[:, :2], box_b[:2])
inter = np.clip((max_xy - min_xy), a_min=0,... |
#
# GingaGw.py -- Gw display handler for the Ginga reference viewer.
#
# This is open-source software licensed under a BSD license.
# Please see the file LICENSE.txt for details.
#
# stdlib imports
import sys, os
import platform
import glob
import traceback
import time
# GUI imports
from ginga.gw import GwHelp, GwMain... |
from numpy.core.defchararray import center
from numpy.core.fromnumeric import take
from numpy.lib.shape_base import apply_along_axis
from nuscenes.nuscenes import NuScenes
from nuscenes.utils.data_classes import Box
from nuscenes.utils.splits import create_splits_scenes
# import open3d as o3d
# import open3d.visualiza... |
"""
MIT License
Copyright (c) 2021 TheHamkerCat
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, ... |
# Copyright 2018 The Fuego Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wr... |
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
from __future__ import print_function
import socket
import torch
from torch.utils.data import (SequentialSampler)
import numpy as np
import random
import os
from collections import OrderedDict
import pickle
i... |
import warnings
from collections import defaultdict
from pathlib import Path
try:
import geopandas
from osgeo import __version__ as osgeo_version # noqa
from osgeo import ogr, osr # noqa
except (ImportError, ModuleNotFoundError) as e:
msg = (
f"`{Path(__file__).stem}` requires installation o... |
'''
Check finance data by Selenium.
Notes:
1. It requires 3rd parth python lib (at least): requests, selenium.
2. Selenium depends on:
Firefox driver: https://github.com/mozilla/geckodriver/releases
PhantomJS (Headless): http://phantomjs.org/download.html
Chrome driver: https://chromedriver.chromium.o... |
import numpy as np
import heapq
import math
import time
COLOR_BLACK = -1
COLOR_WHITE = 1
COLOR_NONE = 0
chessboard_len = 0
best_move = []
candidate_number = 5
DEPTH = 5
class Status:
def __init__(self, chessboard: np.array, scope: list):
self.chessboard = chessboard # current_chessboard
self.next... |
import math
from datetime import timedelta, datetime
from enum import Enum
from typing import Optional
import numpy as np
import pandas as pd
from feast import FeatureView, Feature, ValueType, FeatureStore
from feast.data_source import DataSource
from pytz import FixedOffset, timezone, utc
DEFAULT_ENTITY_DF_EVENT_TIM... |
from rlbot.utils.structures.game_interface import GameInterface
from rlbot.utils.structures.game_data_struct import GameTickPacket, FieldInfoPacket
from rlbot.utils.structures.ball_prediction_struct import BallPrediction
from caster_utils import *
from rlbot.agents.base_script import BaseScript
import pyttsx3
from queu... |
import streamlit as st
import os
import requests
import pandas as pd
import numpy as np
import plotly.express as px
import plotly.graph_objects as go
from datetime import date, timedelta, datetime
PATH = os.path.abspath('')
def get_csv_from_url():
'''This function gets updated COVID-19 data from the OWID website... |
# 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
# d... |
from random import randint
from random import sample
import sys
buycodes = {-1:2.0, 0:1.75, 1:1.5, 2:1.35, 3:1.25, 4:1.2, 5:1.15,
6:1.1, 7:1.05, 8:1, 9:0.95, 10:0.9, 11:0.85, 12:0.8, 13:0.75, 14:0.7,
15:0.65, 16:0.6, 17:0.55, 18:0.5, 19:0.45, 20:0.4, 21:0.35, 22:0.3,
23:0.25}
sellcodes = {-1:0.3, 0:0.4, 1:0.45, 2:0.5... |
# Copyright © 2018-2021 Intel Corporation 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
# notice, this list of conditions... |
import requests
import time
import platform #for hostname
from prometheus_client import start_http_server, Gauge, registry, Counter
class MineratorMetrics():
def __init__(self):
#TODO: DDR4 stuff
#peak values are commented out
labels = ['rig', 'device']
self.voltage = Gauge('miner... |
import pandas as pd
import streamlit as st
import numpy as np
from streamlit_folium import folium_static
import folium
from folium.plugins import MarkerCluster
import geopandas
import plotly.express as px
from datetime import datetime
pd.set_option('display.float_format', lambda x: '%.2f' % x)
@st.cache(a... |
import pyautogui
import pygame
import time
pygame.init()
# Setting Window size
display_width = 2000
display_height = 1552
# Organising Colours
black = (0, 0, 0)
white = (255, 255, 255)
red = (255, 0, 0)
green = (34, 139, 34)
blue = (0, 0, 205)
yellow = (255, 255, 0)
# Creating window and personalization
gameDisplay... |
#!/usr/bin/env python3
"""! @brief Python script to check data in GPos generated openPMD files
Script containing the GPos units and variables namespace as well as the functions to read input.txt, openPMD and data.txt files for GPos runs
The functions defined here should be imported in other python scripts for use
@a... |
import os
import sys
import time
import argparse
import tempfile
import subprocess
import collections
import torch
import torch.nn as nn
import torch.nn.functional as F
from functools import reduce
try:
from urllib.request import urlopen
except:
from urllib2 import urlopen # Python 2 support.
import google.protobuf... |
#!/usr/bin/env python
"""Convert pyx12 configuration files from XML to Python.
The Python X12 module contains a number of XML files which
define X12 message structures. They need to be converted into the syntax for the
:mod:`X12.parse` parser.
Note that the pyx12 module defines Loops, Segments, Composites and indivi... |
#
# Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
#
# This program is distributed in th... |
import collections
import math
import matplotlib
matplotlib.use("TkAgg")
import matplotlib.pyplot as plt
from matplotlib import cm
import numpy as np
import os
import shutil
from sty import fg, bg, ef, rs, RgbFg
import sys
from mpl_toolkits.axes_grid1 import make_axes_locatable
import matplotlib as mpl
mpl.rcParams["t... |
""".. _workflow:
Workflow Outline
################
**TL; DR** conda install `fitgrid` and `jupyter` into a fresh conda
virtual environment (shown :ref:`here
<conda_install_fitgrid>`). Download this document as Jupyter notebook
and run it. Read the notes, explore the output. Prerequisites: a
working knowledge of conda... |
import concurrent.futures
import json
import math
import random
import time
from collections import defaultdict
import matplotlib.pyplot as plt
import pyjq
from ax.modelbridge.generation_strategy import GenerationStep, GenerationStrategy
from ax.modelbridge.registry import Models
from ax.service.ax_client import AxClie... |
"""Create address tables.
Revision ID: 6411b673d98b
Revises: <PASSWORD>
Create Date: 2020-01-29 08:07:05.926797
"""
import sqlalchemy as sa
from alembic import op
# revision identifiers, used by Alembic.
revision = '6411b673d98b'
down_revision = '<PASSWORD>'
branch_labels = None
depends_on = None
def upgrade():
... |
"""
transition_state.py
Some of the functions in this file originate from RDChiral (https://github.com/connorcoley/rdchiral).
"""
import rdkit.Chem as Chem
from rdkit.Chem import AllChem
import numpy as np
from copy import deepcopy
import re
import subprocess
import os
def make_mols(smi, stereoinformation):
"""
... |
'''
The logging module for all of terra apps.
Whether a part of terra core or apps, cli, workflow, service, task, all modules
should import :mod:`terra.logger` to output all messages to user and developer.
Logging, like everything is configured by :data:`terra.settings`. Before the
:data:`terra.settings` is configure... |
# -*- coding: utf8 -*-
"""MARC record processing tools used within samiTools."""
# Import required modules
from samiTools.sami_functions import *
__author__ = '<NAME>'
__license__ = 'MIT License'
__version__ = '1.0.0'
__status__ = '4 - Beta Development'
# ====================
# Constants
# ==... |
import discord
import asyncio
import time
from collections import OrderedDict
import json
from discord.ext import commands
from functools import partial
class Clans(commands.Cog):
def __init__(self, client):
self.users = None
self.client = client
async def update_guild(self, man_id: str, na... |
"""
@package PKD_Tools.libGUI
This package contains all the GUI that is used in the PKD_Tools
Here we break from the pep 8 convention as pyside follows a camel case convention
"""
from functools import partial
import pymel.core as pm
from PKD_Tools import logger
from PKD_Tools import libPySide
from PKD_Tools import ... |
#!/usr/bin/env python
"""
.. module:: tabel.tabel
.. moduleauthor:: <NAME> <<EMAIL>>
"""
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import numpy as np
from .numpy_types import * # pylint: disable=wildcard-import
from .hashjo... |
#
# Copyright (c) 2006-2013, Prometheus Research, LLC
#
from cogs import task, setting, env
from cogs.fs import sh, pipe, exe, cp, mv, rm, mktree, rmtree
from cogs.log import log, debug, warn, fail, prompt
import os, os.path
import glob
import urllib.request, urllib.error, urllib.parse
import socket
import datetime
i... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# vizdoom_wrappers.py
# Wrappers around Vizdoom, similar to what OpenAI Universe has
# (e.g. image resizing/cropping, adding noise, stacking)
# Author: <NAME>
import numpy as np
# TODO use cv2 resize or skimage resize instead
from scipy.misc import imresi... |
import numpy as np
import xarray as xr
from scipy.signal import filtfilt, gaussian
from scipy import stats
from dask.array import coarsen, ones_like
from dask.array.core import Array
import warnings
from xarrayutils.utilities import detect_dtype
from xarrayutils.filtering import filter_1D as filter_1D_refactored
"""... |
import datetime
from flask.ext.login import current_user
from flask.ext.babel import gettext as _
from flask.ext.security import UserMixin, RoleMixin
from sqlalchemy import event
from sqlalchemy.dialects.postgresql import HSTORE, JSON
from sqlalchemy.ext.declarative import declared_attr
from sqlalchemy.orm import relat... |
from manimlib.imports import *
class HoldUpMultivariableChainRule(TeacherStudentsScene):
def construct(self):
title = TextMobject("Multivariable chain rule")
title.to_edge(UP, buff=MED_SMALL_BUFF)
screen = ScreenRectangle()
screen.next_to(title, DOWN)
morty = self.teacher
... |
import itertools
import time
from collections import OrderedDict, Iterable
from itertools import chain
from AnyQt.QtCore import Qt, QAbstractItemModel, QByteArray, QBuffer, QIODevice, QLocale
from AnyQt.QtGui import QColor, QBrush
from AnyQt.QtWidgets import QGraphicsScene, QTableView
from Orange.util import try_
fro... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Author: <NAME>
import Queue
import datetime as dt
import logging
import requests
import threading
import time
import vk_requests
import vk_requests.exceptions
from vk_requests.auth import VKSession
from synchrobot import db_ops
from synchrobot.chat_user import User
impo... |
"""A ROS node for testing the AGV navigation task in hardware."""
from typing import Optional, Tuple
import rospy
from cv_bridge import CvBridge
from geometry_msgs.msg import Twist, PoseStamped
from sensor_msgs.msg import Image
from tf.transformations import euler_from_quaternion, quaternion_from_euler
import jax
imp... |
import sys
sys.path.append('./gen-py')
import math
import random
import time
from thrift import Thrift
from thrift.transport import TSocket
from thrift.transport import TTransport
from thrift.protocol import TBinaryProtocol
from fogclient import FogService
from fogclient.ttypes import *
from EdgeServices import EdgeSer... |
######### Bot V0.4 created by <NAME> #########
### NOTE: This is not the main module. Please run main.py
# This is an extension of main.py
# This bot is for the intent to be used as a fun resource for Discord servers and is a work in progress
#
# In this section of code, you will find the following:
### Commands:
# .ro... |
#!/usr/bin/env python
from astropy.io import fits
import astropy.units as u
import numpy as np
from astropy.wcs import WCS
from astropy.coordinates import SkyCoord
from astropy.table import Table, QTable
from astropy.modeling import models
from astropy.modeling.functional_models import GAUSSIAN_SIGMA_TO_FWHM
# from t... |
import pandas as pd
import numpy as np
import scipy.stats as stats
import copy
import sys
import os
from argotools.config import *
import time
''' Auxiliary functions '''
def preds2matrix(preds_dict):
# Receives preds in Predictor object format.
pred_arrays = []
for model, preds in preds_dict.items():
... |
# --------------------------------------------------------------------------------------
# Copyright 2016, <NAME>, <NAME>, <NAME>, <NAME>
# Hummingbird is distributed under the terms of the Simplified BSD License.
# -------------------------------------------------------------------------
"""Window to display 2D plots"... |
# This code was adapted from the Root implementation on 2.Feb.2022 by <NAME> (<EMAIL>). The links below point to the Root documentation and implementation.
# https://root.cern.ch/doc/master/group__PdfFunc.html#ga53d01e04de833eda26560c40eb207cab
# https://root.cern.ch/doc/master/PdfFuncMathCore_8cxx_source.html
import ... |
from typing import Dict, List, Optional, Union
from heaty.quantity.scalar import Quantity as Qty
from heaty.model import UnPacker
from heaty.model.climate_data import ClimateData
from heaty.model.building_elements import BuildingElement, CATEGORIES
import heaty.model.auxiliary as aux
class HeatedSpace:
def __ini... |
"""
Copyright (c) 2010-2018 CNRS / Centre de Recherche Astrophysique de Lyon
Copyright (c) 2016-2019 <NAME> <<EMAIL>>
Copyright (c) 2016 <NAME> <<EMAIL>>
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are ... |
"""
autobazel-workspace
===================
"""
import ast
import re
from docutils.parsers.rst import Directive, directives
import os
from pkg_resources import parse_version
import sphinx
sphinx_version = sphinx.__version__
if parse_version(sphinx_version) >= parse_version("1.6"):
from sphinx.util import loggin... |
# coding=utf-8
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from loganalysis.const import *
class DlSchd():
'''下行调度分析类'''
def __init__(self, log, cell, uegid=None):
self._type = LTE_FILE_DLSCHD
self._log = log
self._id_filter = {}
self._cell = cell
... |
import os
import pickle
import librosa
import pathlib
import itertools
import numpy as np
import pandas as pd
from sklearn.svm import SVC
import warnings
warnings.filterwarnings("ignore")
with open("./storage/model_ML_cough.pkl", 'rb') as f:
model = pickle.load(f)
with open("./storage/pca_weights.pkl", 'rb') as ... |
#!/usr/bin/env python
# coding: utf-8
"""
@author <NAME>
"""
# Import packages
import pandas as pd
from array import array
import time
start = time.time()
import os
from datetime import date
import numpy as np
import random
from PIL import Image
from io import StringIO, BytesIO
import base64
i... |
# You are at the top. Notice there are no bats hanging from the ceiling
# If there are weird bind errors like the mesh is not deforming correctly, compare
# the oct version of closest triangles to the one without oct
bl_info = {
"name": "Surface Follow",
"author": "<NAME>, email: <EMAIL>",
"version": (... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.