text stringlengths 6.04k 39.5k |
|---|
import numpy as np
from classy_blocks.classes import mesh
from classy_blocks.classes.operations import Face, Loft, Extrude, Revolve
import classy_blocks.util.functions as f
class Geometry:
""" calculation of a centrifugal pump is done separately;
since that is not the topic of this showcase it is convenientl... |
import datetime
import time
from django.contrib import messages
from django.db.models import *
from django.shortcuts import render, redirect
from django.http import HttpResponse
from django.contrib.auth.decorators import login_required
from django.contrib.auth import authenticate, login, logout, get_user
from .forms im... |
#!/usr/bin/env python
# coding: utf-8
# ## Plot cancer type prediction results
# In this notebook, we'll visualize the results of our one-vs-rest cancer type prediction experiments. The files analyzed in this notebook are generated by the `run_cancer_type_prediction.py` script.
#
# Notebook parameters:
# * FILTER_CA... |
#!/usr/bin/env python
# Copyright (C) 2015-2016 Hewlett Packard Enterprise Development LP
# 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/lice... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# @Author: <NAME> (<EMAIL>)
# @Date: 2018-01-17
# @Filename: command.py
# @License: BSD 3-clause (http://www.opensource.org/licenses/BSD-3-Clause)
from __future__ import annotations
import asyncio
import logging
import re
import sys
import time
from contextlib import su... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
SELFIES: a robust representation of semantically constrained graphs with an
example application in chemistry (https://arxiv.org/abs/1905.13741)
by <NAME>, <NAME>, <NAME>, <NAME>, <NAME>
Variational Auto Encoder (VAE) for chemistry
... |
# coding=utf-8
"""
(memory efficient) DenseNet.
Reference:
https://github.com/pytorch/vision/blob/master/torchvision/models/densenet.py
https://github.com/gpleiss/efficient_densenet_pytorch/blob/master/models/densenet.py
https://github.com/maciejczyzewski/batchboost/blob/master/models/densenet3.py
https://github.c... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Apr 30 14:09:50 2017
@author: ziaulchoudhury
"""
import csv # read and write csv datasets
import matplotlib.pyplot as plt # plotting
import numpy as np # number
from itertools import groupby, zip_longest # goruping and list's longest index
import urlli... |
from collections import OrderedDict
import numpy as np
from six import string_types, next
from artemis.general.should_be_builtins import all_equal
__author__ = 'peter'
_immutible_types = (int, float, bool, type(None))+string_types
def flatten_struct(struct, primatives = (int, float, np.ndarray, type(None), bool)+... |
# Copyright 2017 <NAME>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writin... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
This file contains diverse collate functions. Each collate function has two roles :
- merge together the data from different samples
- merge together the data from different sensors, when needed
These functions use a list of couples (dictionnary, tensor)... |
import re
import json
from functools import partial
from collections import namedtuple, OrderedDict
from ..graph import Graph, Root, Node, Link, Option, Field, Nothing
from ..graph import GraphVisitor, GraphTransformer
from ..types import TypeRef, String, Sequence, Boolean, Optional, TypeVisitor
from ..types import A... |
import discord, enum
from discord.ext import commands
from database.database import Database
from tools.embed import Embed
from tools.string import StringTools
from tools.validate import Validate
import tools.error as Error
import tools.members as Members
from typing import Any, Callable, Optional, Dict, Union, List
S... |
# Copyright 2022 Accenture Global Solutions Limited
#
# 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 ... |
"""
image_novice
============
A special Python image submodule for beginners.
Description
-----------
The image novice module provides a simple image manipulation interface for
beginners. It allows for easy loading, manipulating, and saving of image
files.
NOTE: This module uses the Cartesian coordinate system!
Exa... |
# -*- coding: utf-8 -*-
import datetime
import re
from .._globals import IDENTITY
from .._compat import integer_types, basestring
from ..objects import Table, Query, Field, Expression
from ..helpers.classes import SQLALL, Reference
from ..helpers.methods import use_common_filters, xorify
from .base import NoSQLAdapter... |
from .subject import Subject
from .tenor import Tenor
from ..exceptions import PricingError, InvalidSubjectError
__all__ = ["SubjectBuilder"]
CURRENCY_CODES = [
"XAU",
"XPT",
"XPD",
"XAG",
"XDR",
"EUR",
"GBP",
"AUD",
"NZD",
"USD",
"CAD",
"CHF",
"NOK",
"DKK",
... |
#!/usr/bin/env python
# coding=utf-8
import json
import hashlib
import threading
import types
import copy
import sys
import traceback
import time
import weakref
import gevent
import functools
import ctypes
from . import DEFAULT, SPACE, RETRY, TIMELIMIT, CONTINUOUS, Enum
MTID = threading._get_ident() # i... |
from skimage.feature import hog
from sklearn.preprocessing import StandardScaler
import matplotlib.image as mpimg
import matplotlib.pyplot as plt
import numpy as np
import pickle
import cv2
import random
# NOTE: the next import is only valid
# for scikit-learn version <= 0.17
# if you are using scikit-learn >= 0.18 th... |
#!/usr/bin/env python3.4
import tensorflow as tf
import tflearn
import numpy as np
import numpy.random as npr
np.set_printoptions(precision=2)
# np.seterr(all='raise')
np.seterr(all='warn')
import argparse
import csv
import os
import sys
import time
import pickle as pkl
import json
import shutil
import re
import s... |
import sys
import random
import timeit
import math
import argparse
from collections import Counter
from copy import deepcopy
#from read import *
#from write import writeNextInput
class Board:
def __init__(self):
"""
Go game.
:param n: size of the board n*n
"""
self.size = ... |
import time
from p4p.nt import NTScalar
from p4p.server.thread import SharedPV
from psdaq.pyxpm.pvhandler import *
provider = None
lock = None
FID_PERIOD = 1400e-6/1300.
FID_PERIOD_NS = 1400e3 /1300.
def addPV(name,ctype,init=0):
pv = SharedPV(initial=NTScalar(ctype).wrap(init), handler=DefaultPVHandler()... |
""" Various utility functions for manipulating video data
"""
import os
import platform
import itertools
from .xmltodict import parse as xmltodictparser
import subprocess as sp
import numpy as np
from .edge import canny
from .stpyr import SpatialSteerablePyramid
from .mscn import compute_image_mscn_transform, gen_gaus... |
# -*- coding: utf-8 -*-
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# so... |
# This code is designed for those who wants a deeper control on Static Optimization via Python. Otherwise, you should
# call the proper AnalyzeTool as described in this minimal example:
#
# import opensim as osim
# tool = osim.AnalyzeTool("data/gait2392_Setup_StaticOptimization.xml")
# tool.run()
import os
import time... |
# -*- coding: utf-8 -*-
""" Thresholding schemes
Notes
-----
* This is a direct translation from `Data Driven Topological Filtering of Brain Networks via Orthogonal Minimal Spanning Trees <https://github.com/stdimitr/topological_filtering_networks>'
* Original author is <NAME> <<EMAIL>>
|
-----
"""
# Author: <NAM... |
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import logging
import os
import pipes
import re
import subprocess
import sys
import time
from telemetry.core import exceptions
from telemetry.core import fo... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
__author__ = u'Rimco'
from blinker import signal
# System imports
from threading import Thread
import datetime
import time
import logging
import traceback
from . import i18n
# Local imports
from ospy.inputs import inputs
from ospy.log import log, logEV
... |
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from .plan_losses import PPC, PlanCost,get_leading_hint
from .cost_model import *
from query_representation.utils import deterministic_hash,make_dir
from query_representation.viz import *
from matplotlib.backends.backend_pdf import PdfPages
import m... |
from os import error
import os
import re
from flask import Flask, render_template, session, request, redirect, send_from_directory
from flask.helpers import url_for
from flask_sqlalchemy import SQLAlchemy
from sqlalchemy.sql.operators import distinct_op
from PIL import Image
import random
import pandas as pd
import num... |
import logging
import math
import numpy as np
from ..osrparse.enums import Mod
from ..EEnum.EReplay import Replays
class DiffCalculator:
RELAX_BONUS_ACCEL = 4
def __init__(self, diff):
self.diff = diff
self.max_distance = self.cs()
self.slidermax_distance = self.max_distance * 2.4 # source: https://www.red... |
from tools.machine_learning import getAccuracy, preprocess_data, sliding_window
from sklearn.model_selection import train_test_split
from sklearn.ensemble import RandomForestClassifier
from sklearn.metrics import classification_report
from sklearn.model_selection import GridSearchCV
from sklearn.preprocessing import St... |
import tensorflow as tf
import tensorflow.contrib.slim as slim
import logging
import numpy as np
from math import acos, ceil
logger = logging.getLogger('silhonet.' + __name__)
def get_bias(shape, name='bias'):
return tf.get_variable(
name, shape=shape, initializer=tf.constant_initializer(0.0))
def get_... |
import os
import html
import time
import logging
import asyncio
import traceback
import functools
import yaml
import aiohttp
from pathlib import Path
from typing import List
from io import BytesIO
from pyee import AsyncIOEventEmitter
from datetime import timedelta
from pyrogram import Client, filters, StopPropagation, ... |
import os, re, json, sys, random, copy, argparse, torch
import numpy as np
import pandas as pd
from collections import OrderedDict
from tqdm import tqdm
from util import *
import warnings
warnings.filterwarnings('ignore')
# remove duplicates from df_a
def RemoveDuplicates(df_a, df_b, cols):
df = pd.concat([df_a, ... |
# coding=utf-8
# Copyright 2022 The Uncertainty Baselines 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 ap... |
# Standard library imports
# Third party imports
import numpy as np
import cv2
import pyzbar.pyzbar as pyzbar
# Local application imports
# Constants variables
QR_NORTH = 0
QR_EAST = 1
QR_SOUTH = 2
QR_WEST = 3
OTSU_BINARIZATION = 0
THRES_BINARIZATION = 1
DEBUG_MODE_OFF = 0
DEBUG_MODE_ON = 1
class PointIntersecti... |
#-----------------------------------------------------------------------
# DynAdjust.py
#-----------------------------------------------------------------------
# Author: <NAME>
# Date: 22 May 2019
# Purpose: To add type B uncertainties to DynAdjust .apu and .xyz files.
#
# ---------... |
# Import libraries
import pandas as pd
import numpy as np
from tqdm import tqdm
import ast
import math
# Splitting a categorical variable
def split_categorical_vars(series, values_and_labels):
'''
This function splits a variable that comes in list form into multiple variables as
specified i... |
"""Early version of the analysis that used a matched filter approach.
Both the data and mocks are convolved with a template. The distribution
of values observed in the convolved mocks is fit to a Gaussian and used to
determine the significance of the largest excursion observed in the convolved data.
"""
import nump... |
from __future__ import division, print_function
import matplotlib
matplotlib.rcParams.update({'font.size': 8})
import matplotlib.pyplot as plt
from matplotlib.pyplot import cm
import numpy as np
import h5py
from scipy.stats import norm
def plot_activations(filename, epoch, seq_i=0, normalise=False):
f = h5py.File... |
#!/usr/bin/env python3
"""
Mod9 ASR REST API: wrapper over the ASR Engine.
This server implements a RESTful API compatible with Google Cloud STT.
It can run as a standalone Flask server, but is best deployed via WSGI.
"""
import argparse
from collections import OrderedDict
from datetime import datetime
import iterto... |
'''
Created on June 14, 2016
@author: <NAME>
@contact: <EMAIL>
@copyright: You are free to use, change, or redistribute this code in any way you want for non-commercial purposes.
'''
import os
import warnings
import re
import numpy as np
from glob import glob
from .. external_code.python_plyfile.plyfile import P... |
"""
This script is borrowed from https://github.com/rwightman/pytorch-image-models.
Adhere to their license to use this script
We hacked it a little bit to make it happy in our framework.
"""
from collections import OrderedDict # pylint: disable=g-importing-member
import logging
import torch
import math
import os
... |
#-------------------------------------------------Topic Modeling-------------------------------------------------------#
#---------------------------------------------------April 2020---------------------------------------------------------#
# References:
# https://www.machinelearningplus.com/nlp/topic-modeling-gensim... |
# createPropertyIds.py
# Python script to transform the JSON Property IDs to
# header file
#
# Just add the tag $PROPERTYIDS$ in your template file
# and this script will replace this tag with all the
# property found in the propertyIDS.json file
#
# NOTE: IMPORTANT INFORMATION ABOUT DEPRECATED PROPERTIES
# There is a ... |
'''Port and partial rewrite of A Network of Ideas.
'''
import abc
import enum
import functools
import struct
from typing import Any, Dict, Iterator, Optional, Tuple
import redis
class ANOIReserved(enum.Enum):
NIL = 0x0 # None, by any other name...
ROOT = 0xe000 # Start of private-use Unicode code points (... |
from sklearn.model_selection import train_test_split
from sklearn.model_selection import GridSearchCV, RandomizedSearchCV
from sklearn.datasets import load_digits
from sklearn.tree import DecisionTreeClassifier
from sklearn.linear_model import LogisticRegression, LinearRegression
from sklearn.svm import SVC, SVR, Line... |
import matplotlib.pyplot as plt
import networkx as nx
from scipy import stats
from matplotlib.animation import FuncAnimation
import numpy as np
import time
import os
import random
from epidemic_simulation import get_epidemic_infection_times, import_data, get_epidemic_infection_times_np_array
from best_protection_strat... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2012-2021 SoftBank Robotics. All rights reserved.
# Use of this source code is governed by a BSD-style license (see the COPYING file).
""" This module contains few functions around subprocess """
from __future__ import absolute_import
from __future__ import ... |
#!/usr/bin/env python
# Copyright 2019 <NAME>
# License: Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
import torch as th
import torch.nn as nn
import torch.nn.functional as tf
from typing import Optional, Tuple, Union, List, Dict
from aps.asr.base.component import VariantRNN, FSMN, Conv1d, Conv2d, PyTorc... |
import math
import torch
import numpy as np
import torch.nn as nn
from torch import Tensor
from typing import Dict, Tuple
import pytorch_lightning as pl
import torch.nn.functional as F
from constants.constants import *
from utils.nilm_metrics import NILMmetrics
from neural_networks.base_models import BaseModel
from uti... |
"""
Lab 2.5 - Modified NIST (MNIST) Multi-Class Classification Network
Author:
- <NAME> (<EMAIL>)
- <NAME> (<EMAIL>)
"""
# Import the Libraries and Packages
# Import the Operative System Library as operative_system
import os as operative_system
# Disable all the Debugging Logs from TensorFlow Library
operative_sys... |
# #!/usr/bin/env python3
# # -*- coding: utf-8 -*-
# """
# Created on Sat Oct 7 15:48:23 2017
# """
# from sample import Sampler
# GSL_sampler = Sampler()
# import scipy.io as sio
# import matplotlib.pyplot as plt
# from collections import defaultdict
# import PGBN_sampler
# import warnings
# warnings.fi... |
import os
import pickle
import time
from datetime import datetime
import cx_Oracle
from interpro7dw.utils import logger
from interpro7dw.utils.store import BasicStore, copy_files
_PDB2INTERPRO = "pdb2interpro.csv"
def connect(uri: str, max_attempts: int = 3) -> cx_Oracle.Connection:
attempts = 1
while Tru... |
# load the 2nd alternate sentera format (combination of procerus
# flight controller log file and sentera camera log files.) The added
# wrinkle is needing to find a way to time correlate between camera
# and flight controller. Initially I will look at correlating IMU
# data which should produce a reliable correlatio... |
import cv2
import numpy as np
from utils.math_utils import compute_circle_center_coords, euclidean_distance_coords
from utils.error_utils import SUCCESS, WRONG_IMAGE_FORMAT, PUPIL_DETECTION_FAILED, IRIS_DETECTION_FAILED, EYELIDS_DETECTION_FAILED
#-----------------------------------------------------------------------... |
# 【映射】
from sys import stderr
KA_DEF = u"(?:新建|有)?"
KA_AS = u"(?:称为)"
KA_OBJ_VAL = u"^《(\w+)》的值$"
KA_OBJ_ATTR = u"^《(\w+)》的(\w+)$"
KA_ITER_NOW = u"^《(\w+)》当前值$"
ka_pmap=KaeLevMap(lev0={
u"^“(.+)”$":'"{0}"',
u"(?:在|于|用|使用)?(控制台|语音)?(?:打印|输出|说|说出)[::]\s*(.+)":"ka_out('{0}', *1*)",
u"(?:把|将)?(.+),并打印":"ka_out(<... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import datetime
from django.db import models
from django.shortcuts import render, redirect, get_object_or_404
from django.core.validators import RegexValidator, MinLengthValidator, MaxLengthValidator, \
validate_comma_separated_integer_list
from django.core.exceptions impo... |
#
# MIT License
#
# Copyright (c) 2020 Tskit Developers
#
# 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, ... |
#!/usr/bin/env python3
"""A script to process gfa images with the SDSS-V FPS"""
import time
import tqdm
import fitsio
import sep
import argparse
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
from pathlib import Path
from matplotlib import animation
from matplotlib.patches import Ellipse
from... |
# Basic packages
import numpy as np # linear algebra
import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)
import random as rd # generating random numbers
import datetime # manipulating date formats
# Viz
import matplotlib.pyplot as plt # basic plotting
import seaborn as sns # for prettier plots... |
import backtest as bt
import indicator
from indicator import Indicator
import json
import pandas as pd
import numpy as np
def give_result_more(data, mt=None, get_json=True):
if mt is None:
mt = Indicator(name=data['symbol_id'])
valid = int(data['valid'])
indicators = {'main': {}, 'minor': {}}
... |
import gc
import glob
import os
import h5sparse
import numpy as np
import pandas as pd
from joblib import Parallel, delayed
import sys
sys.path.append('/Users/josang-yeon/2020/tobigs/tobigs_reco_conf/recsys2019/src')
from recsys.transformers import (
FeatureEng,
FeaturesAtAbsoluteRank,
LagNumericalFeature... |
import logging
import sys
import os
from collections import OrderedDict
import cartosql
import requests
import datetime
import copy
import time
import numpy as np
import urllib
import zipfile
import pandas as pd
import shutil
# do you want to delete everything currently in the Carto table when you run this script?
CLE... |
from time import time
import cv2
import numpy as np
from Mosse_Tracker.TrackerManager import Tracker, TrackerType
from PIL import Image
#from Car_Detection_TF.yolo import YOLO
#from Car_Detection.detect import Yolo_image
from Mosse_Tracker.utils import draw_str
from boxes.yoloFiles import loadFile
pi=22/7
# clf = pi... |
# (C) Copyright 2017 IBM Corp.
# (C) Copyright 2017 Inova Development 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-... |
# link: https://www1.nyc.gov/site/tlc/about/tlc-trip-record-data.page
import json
import math
import os
from datetime import datetime
import time
import pandas as pd
old_time_format = '%Y-%m-%d %H:%M:%S'
new_time_format = '%Y-%m-%dT%H:%M:%SZ'
def get_data_url(input_dir_flow, start_year, start_month, end_year, end_mo... |
#!/usr/bin/env python
# Copyright (c) 2018-2020 Intel Corporation
#
# This work is licensed under the terms of the MIT license.
# For a copy, see <https://opensource.org/licenses/MIT>.
"""
This module provide BasicScenario, the basic class of all the scenarios.
"""
from __future__ import print_function
import opera... |
import sys
import numpy as np
from matplotlib import patches, collections, ticker, pyplot as plt
from skimage import io, morphology, measure
# width of vacuum opening
ROOMBA_WIDTH = 180
SCALING_FACTOR = 10 # mm/pixel
class Polygon():
def __init__(self, points, center=[0, 0], snap=90, scaling=1):
self.sn... |
# coding: utf-8
# pystacia/image/tests/__init__.py
# Copyright (C) 2011-2012 by <NAME>
# This module is part of Pystacia and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
from __future__ import division
import sys
from threading import Thread
from re import match
from tempf... |
#!/usr/bin/env python
# ==============================================================================
# MODULE DOCSTRING
# ==============================================================================
"""
MPI
===
Utilities to run on MPI.
Provide functions and decorators that simplify running the same code on
mult... |
import sys
import requests, json, re
from pathlib import Path
from loguru import logger
import pandas as pd
from bs4 import BeautifulSoup
from tqdm import tqdm
from scipy import stats
import time
logger.remove()
logger.add(sys.stderr, level="INFO") # default level for this module is INFO
API_ENCODING = "ISO-8859-1"
... |
"""
parse_catalog_into_database.py
--------------------------------
This module contains a set of functions that implement the extraction
of the Knowledge Areas, Courses, and stated Learning Outcomes from a
Course Catalog and inserts them into a Database.
"""
__author__ = "<NAME>"
import string... |
import torch
import math
import numpy as np
import matplotlib.pyplot as plt
from utility.utils import *
'''
envs should have following:
variables:
obs_dim: tuple or int
act_dim: tuple or int
act_limit: tensor, shape act_dim*2
'''
class env_base(object):
def __init__(self):
... |
import numpy
import copy
import random
from collections import deque
import heapq
from typing import List, Tuple
from typing import Dict
import parameters
class Node:
def __init__(self, _id: int = 0, _x: float = 0.0, _y: float = 0.0):
self.id = _id
self.x = _x
self.y = _y
self.cl... |
import numpy as np
from math import sqrt, floor, ceil
import matplotlib.pyplot as plt
import pandas as pd
import geopandas as gpd
import rasterio
from rasterio.mask import mask
from rasterio.plot import show
from rasterio.crs import CRS
from rasterio.transform import from_bounds
import fiona
from rasterio.en... |
"""
Rank constraints via convex iteration (Dattorro's Convex Optimization and Euclidean Distance Geometry textbook).
"""
import numpy as np
import cvxpy as cp
import networkx as nx
from timeit import default_timer
from progress.bar import ShadyBar as Bar
from liegroups.numpy import SE3
from graphik.solvers.sdp_formul... |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
# Some parts stolen from Astropy CCDData testing bench
import pytest
import numpy as np
from astropop.framedata.compat import extract_header_wcs, _extract_ccddata, \
_extract_fits
from astropy.io import fits
from ast... |
"""
Copyright 2020 <NAME>
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, distribute, sublicens... |
import math
from decimal import Decimal
from typing import Union
import numpy as np
import pandas as pd
from psycopg2._range import NumericRange
from sqlalchemy.engine import Engine
from bach import DataFrame
from sql_models.util import is_postgres, is_bigquery
from tests.functional.bach.test_data_and_utils import as... |
__author__ = "<NAME>, Albuquerque"
from math import pi, sqrt
import pytest
import numpy as np
import astropak.geometry as geom
class Test_Class_XY:
@staticmethod
@pytest.fixture(scope='function')
def setup_xy():
xy1a = geom.XY(4, 5)
xy1b = geom.XY(4, 5)
xy2 = geom.XY(7, 9)
... |
import disnake, json, asyncio, datetime
from disnake.ext import commands
from async_timeout import timeout
from random import choice
from disnake import Webhook
from io import BytesIO
import zipfile
import inspect
from core.utils.utils import thecolor, Json, thebed
from core.Context import Context
from... |
import copy
import os
from django.shortcuts import render,redirect,HttpResponseRedirect,reverse,get_object_or_404
from django.urls import reverse
from django.contrib.auth.decorators import login_required
from .models import Student,StudentList,Parent
from django.conf import settings
from .filter import StudentFilter
fr... |
import inspect
import os
import sys
from collections import defaultdict, namedtuple
from functools import lru_cache
from types import ModuleType
from typing import Optional, Dict, List, Tuple, Any, Union
import pandas as pds
from jsonschema import Draft7Validator
from linkml_runtime.utils.schemaview import SchemaView
... |
import argparse
import sys
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.animation as ani
import matplotlib.colors as col
class Pattern:
def __init__(self, name, desc, upper_left_points, cells):
self.name = name
self.desc = desc
self.start_cells = {
... |
'''
Util functions for luigi bigmetadata tasks.
'''
import os
import time
import re
import subprocess
import shutil
import zipfile
from lib.logger import get_logger
from itertools import zip_longest
from slugify import slugify
import requests
OBSERVATORY_PREFIX = 'obs_'
OBSERVATORY_SCHEMA = 'observatory'
LOGGER = ... |
import apiclient
import httplib2
import pandas as pd
import pytest
from conftest import get_data_from_yaml
import datasheets
def test_init(mock_tab):
assert isinstance(mock_tab, datasheets.Tab)
assert mock_tab.tabname == 'test_tab'
# sheets_svc variable properly created
assert isinstance(mock_tab.sh... |
"""
The Monitor class that performs the aggregation.
"""
import os
import time
import atexit
import hashlib
import weakref
import logging
import datetime
import threading
from queue import Queue, Empty
from itemdb import ItemDB
logger = logging.getLogger("mypaas_stats")
# Number of seconds for one aggregation uni... |
# -*- coding: utf-8 -*-
import os
import pkg_resources
import pytest
from datetime import datetime
from pathlib import Path
from shutil import move, copy, rmtree
import numpy as np
import pandas as pd
from gridwxcomp.util import get_gridmet_meta_csv, parse_yr_filter
from gridwxcomp.prep_input import main, prep_input... |
import math
import numpy as np
from enum import IntEnum
from elfirl.pybrain_extensions import ParametricLoggingEpisodicTask, ParametricLoggingEnvironment
import logging
logger = logging.getLogger(__name__)
"""An implementation of a simple Grid world model
Definition of the MDP.
"""
class Transition():
def __in... |
#!/usr/bin/env python
from __future__ import print_function
import roslib
roslib.load_manifest('mct_tracking_2d')
import rospy
import sys
import functools
import threading
import math
import cv
import numpy
import Image as PILImage
import ImageDraw as PILImageDraw
import ImageFont as PILImageFont
import time
import mct... |
#!/usr/bin/env python
# run ./wikize_refs.py --help for documentation
from shutil import copyfile
import re, os
def usage():
return \
"""
Re-formats a series of reference style links in a GitHub Markdown file
so that the article's footnote links behave more Wikipedia-like.
Treats a markdown file as being compos... |
import json
# get item list from yml file and convert into ungrouped file.
def getItemName(infilename='baseworth.yml'):
rawindex = {}
with open(infilename) as worth:
for line in worth:
line = line.strip()
if len(line) > 0 and line[0] != '#':
parts = line.split(':... |
import h5py
import numpy as np
numeric_types = {int, float}
primitive_types = {int, float, str, bool, type(None), np.ndarray} # Numpy array behaves like a primitive for most purposes
collection_types = {tuple, list, dict, set}
indexed_types = {tuple, list}
associative_types = {dict, set}
collection_type_strs = {x.__... |
import os
import pandas as pd
import numpy as np
from ast import literal_eval
from pandas import Series, DataFrame
from math import sqrt
from scipy import stats
raw_data_folder = 'data/'
stand_data_folder = '/standard_data/'
cwd = os.getcwd()
LEVENE_SIG = .05
PEN_VALS = [0, 100, 500]
all_subs = []
for n in ran... |
from pathlib import Path
from typing import Union, List
import numpy as np
from scipy.interpolate import interp1d
from scipy.optimize import brentq
from sklearn.metrics import roc_curve
# from time import perf_counter as timer
import torch
from torch import nn
from torch.nn.utils import clip_grad_norm_
from resemblyze... |
"""Contains tools required to submit projects to Clarity."""
import os
import logging
import logging.config
import traceback
import datetime
from bs4 import BeautifulSoup
from jinja2 import Template
from ua_clarity_tools import ua_clarity_tools
from ua_project_transfer import core_specifics
LOGGER = logging.getLogger... |
import os, os.path as op
import shutil
import logging
import cv2
import numpy as np
import pprint
import matplotlib.pyplot as plt
from lib.backend import backendDb
from lib.utils import utilBoxes
FONT = cv2.FONT_HERSHEY_SIMPLEX
SCALE = 28
FONT_SIZE = 0.7
THICKNESS = 3
def validateFileName(filename):
invalid = '... |
#!/usr/bin/python
# -*- coding: UTF-8 -*-
from lib import *
import pyglet
# pyglet.clock.set_default(pyglet.clock.Clock())
fps_display = pyglet.clock.ClockDisplay()
pyglet.resource.path = ['resource']
window = controls.Form(800, 600, resizable=True)
root = window.root_control
def on_draw():
win... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.