text stringlengths 6.04k 39.5k |
|---|
# Copyright 2017-2019 Manheim / Cox Automotive
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed t... |
import random
import math
import cv2
import numpy as np
import pylab as plt
import scipy.io as sio
import scipy.misc as sm
import os
from os import listdir, makedirs, system
def get_minibatches_idx(n,
minibatch_size,
shuffle=False,
min_frame=None... |
import io
import os.path as osp
from typing import Callable
from unittest import TestCase, skip
import matplotlib.pyplot as plt
import numpy as np
import pytest
from pylinac import LeedsTOR, StandardImagingQC3, LasVegas, DoselabMC2kV, DoselabMC2MV
from pylinac.core import image
from pylinac.planar_imaging import Plan... |
# pylint: disable=consider-using-enumerate,invalid-name,too-many-function-args
"""
Functions that run on executor for measurement.
These functions are responsible for building tvm module, uploading it to
remote devices, recording the running time costs and checking the correctness of output
"""
import logging
import o... |
# emacs: -*- mode: python; py-indent-offset: 4; tab-width: 4; indent-tabs-mode: nil -*-
# ex: set sts=4 ts=4 sw=4 noet:
# ## ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ##
#
# See COPYING file distributed along with the datalad package for the
# copyright and license terms.
#
# ## ### ##... |
"""
Registry of special known ssb operations for the decompiler and some code to handle them.
ExplorerScript only maps ssb opcodes by name.
TODO: These are only valid for Sky-style ssb.
"""
# MIT License
#
# Copyright (c) 2020-2021 Parakoopa and the SkyTemple Contributors
#
# Permission is hereby granted, free of ch... |
# Copyright (c) 2015-2016 <NAME>
# Copyright (c) 2000-2002 by <NAME> <<EMAIL>>
# Copyright (c) 1999 <NAME>
"""
A spark grammar for Python 2.x.
However instead of terminal symbols being the usual ASCII text,
e.g. 5, myvariable, "for", etc. they are CPython Bytecode tokens,
e.g. "LOAD_CONST 5", "STORE NAME myvariabl... |
"""
Copyright (c) 2018-2021 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 agreed to in wri... |
from abc import ABC, abstractmethod
from collections import namedtuple
from copy import copy, deepcopy
from inspect import signature, Parameter
import time
from .evaluate import EvaluationFunction
from .formatter import getLogger, make_one_model_summary_str, make_two_models_summary_str, \
default_display_filter_fu... |
"""
Generate synthetic resistivity models randomly.
References
----------
https://stackoverflow.com/questions/44865023/circular-masking-an-image-in-python-using-numpy-arrays
https://docs.scipy.org/doc/numpy-1.16.0/reference/routines.random.html
https://numpy.org/doc/1.18/reference/random/index.html
https://doc... |
"""
Binary Tree
https://algorithm.yuanbin.me/zh-hans/basics_data_structure/binary_tree.html
"""
import unittest
from collections import deque
import functools as fn
class TreeNode:
def __init__(self, val) -> None:
"""
Node for bianry tree
:param val: value
:type val: Any
... |
from params import *
from utils import *
from shared_pow import *
from compress import *
def heuristics_filter(cand_no_list, prefix_bytes, nonce, f_check_edge, limit=0, left_stop_range=None, right_stop_range=None, quad_set=BLANK_QSET, edge_offset=0):
assert(len(cand_no_list) == 8) # Cand no for a full quad set.
ass... |
'''
General-purpose numerical routines, relating to angular functions defined on
surfaces of spheres, used in other parts of the module.
'''
# Copyright (c) 2015 <NAME>. All rights reserved.
# Restrictions are listed in the LICENSE file distributed with this package.
import math, numpy as np
from scipy import special... |
from __future__ import annotations
import abc
import inspect
from typing import *
import cffi
import numpy
from .constants import MaterialPropertyType, MetadataType, TextureSemantic
if TYPE_CHECKING:
from .structs import Texture, MaterialProperty, MetadataEntry, Material, Scene, Mesh
ffi = cffi.FFI()
class C... |
'''
function_pipe.py
Copyright 2012-2017 Research Affiliates
Authors: <NAME>, <NAME>
Common usage:
import function_pipe as fpn
'''
import functools
import inspect
import collections
import types
import sys
#-------------------------------------------------------------------------------
# FunctionNode utilities
d... |
# The MIT License (MIT)
#
# 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, subl... |
import logging
from collections import defaultdict, namedtuple
from datetime import datetime
from threading import RLock
from typing import TYPE_CHECKING
from networkx import DiGraph, single_source_shortest_path
from sqlalchemy import or_
from sqlalchemy.orm import aliased
from sqlalchemy.sql import label, literal
fr... |
#!/usr/bin/env python
"""
Create a base docker image for building pyflann_ibeis
References:
https://github.com/skvark/opencv-python
# Files skvark uses to make his base opencv docker image
https://github.com/skvark/opencv-python/blob/master/docker/Dockerfile_i686
https://github.com/skvark/opencv-pytho... |
#!/usr/bin/env python
###################### INFORMATION ##############################
# Extract the table of content (TOC) from Reichanzeiger
#Program: **crop**
#Info: **Python3**
#Author: **<NAME>**
#Date: **08.04.2021**
####################### IMPORT ##################################
import arg... |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# <NAME>
# Created : 10/31/2017
# Last Modified: 04/06/2018
# Vanderbilt University
from __future__ import print_function, division, absolute_import
__author__ =['<NAME>']
__copyright__ =["Copyright 2017 <NAME>, 1-halo MCF Make"]
__email__ =['<EMAIL>']
__ma... |
'''show_msdp.py
IOSXE parsers for the following commands
* 'show ip msdp peer'
* 'show ip msdp vrf <vrf> peer'
* 'show ip msdp sa-cache'
* 'show ip msdp vrf <vrf> sa-cache'
'''
# Python
import re
# Metaparser
from genie.metaparser import MetaParser
from genie.metaparser.util.schemaengin... |
import time
from multiprocessing import Value
import pytest
from dash import Dash, Input, Output, State, callback_context, html, dcc, dash_table
from dash.exceptions import PreventUpdate
def test_cbmt001_called_multiple_times_and_out_of_order(dash_duo):
app = Dash(__name__)
app.layout = html.Div([html.Butto... |
from ctypes.wintypes import *
from wintypes_extended import *
from kernel32 import *
from user32 import *
from comdlg32 import *
from gdi32 import *
from comctl32 import *
import ctypes
import os
INJECT_BUTTON = 100
PROCESS_LISTVIEW = 101
SEARCH_BUTTON = 102
FILEPATH_EDIT = 103
ExtractIconExA = ctypes.windll.shell32... |
# !usr/bin/env python2
# -*- coding: utf-8 -*-
#
# Licensed under a 3-clause BSD license.
#
# @Author: <NAME>
# @Date: 2017-06-12 18:18:54
# @Last modified by: <NAME>
# @Last modified time: 2017-07-31 12:07:88
from __future__ import absolute_import, division, print_function
import copy
import json
from imp import... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import unicode_literals
import math
import numbers
import re
from collections import namedtuple
import tenacity
from future.utils import raise_from
from sqlalchemy import exc, util, Column
from sqlalchemy.engine import reflection, Engine
f... |
import warnings
import numpy as np
from astropy.modeling.models import Polynomial1D, Gaussian1D, custom_model
from astropy.modeling.fitting import (LevMarLSQFitter,
_validate_model,
_fitter_to_model_params,
... |
# Copyright 2017 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... |
import torch
import tuning
import masking
import numpy as np
import scipy.signal as sg
import functools
import re
from latencies import *
from filters import *
from suppression import *
def get_sq_masking_excitation_patterns(f, bw10Func, n_conditions, n_bands,
amp_list, f_low_list, f_high_list, filter_model='gau... |
import configparser
import os
import sys
import netCDF4 as nc
import numpy as np
from numpy import linalg as LA
import nrrd
from scipy.interpolate import RegularGridInterpolator
from readMRIData import get_rotation_matrix
from readMRIData import plot_lin_plane_fitting_with_bbox
from readMRIData import read_intra_op_p... |
from time import time
import numpy as np
import lptml
import itertools
import csv
from sklearn import datasets
from sklearn.decomposition import PCA
from sklearn.neighbors import KNeighborsClassifier
from sklearn.model_selection import ShuffleSplit
from sklearn.metrics import accuracy_score
from sklearn.metrics import ... |
import os
import time
import importlib
import argparse
import numpy as np
import torch
from torch import nn, optim
from collections import defaultdict
from data import MonoTextData, VocabEntry
from modules import VAE, LinearDiscriminator, MLPDiscriminator
from modules import GaussianLSTMEncoder, LSTMDecoder
from e... |
import re
import sys
import json
import spacy
import string
import argparse
import numpy as np
from pingouin import mwu
from nltk.corpus import stopwords
def _process_strings(line,
lang_nlp,
get_lemmas,
get_pos,
remove_stopwords,
... |
# Copyright (c) <NAME> & <NAME>. Licensed under the Apache License 2.0. All Rights Reserved
""" Evaluator for Flickr30k """
import xml.etree.ElementTree as ET
from collections import defaultdict
from pathlib import Path
from typing import Any, Dict, List, Optional, Sequence, Tuple, Union
import numpy as np
from pretty... |
#from numpy import genfromtxt
#import numpy as np
import csv
#import pandas as pd
import textwrap
import itertools
#re.sub('\*\*+', '*', text)
#my_data = my_data[~np.isnan(my_data)]
#my_data = np.genfromtxt('D:\Home\Downloads\CC1\CONCMED1.EDS', delimiter='\t')
def is_center_pt_number(elem):
if '-' in elem:
... |
# -*- coding: utf-8 -*-
# Copyright (c) 2018, <NAME> and <NAME> and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
import json
from frappe import _
from frappe.utils import flt, get_datetime, getdate, date_... |
import logging
import numpy as np
import scipy.sparse.csgraph as spgr
from openpnm.topotools import is_fully_connected
from openpnm.algorithms import GenericAlgorithm
from openpnm.algorithms import BCsMixin
from openpnm.utils import prettify_logger_message
from openpnm.utils import Docorator, SettingsAttr, TypedSet, Wo... |
import functools
import logging
from dataclasses import dataclass, field
from typing import Set, Tuple, List, Optional, TYPE_CHECKING
from ordered_set import OrderedSet
from passlib.hash import md5_crypt
from irrd.conf import get_setting
from irrd.rpsl.parser import RPSLObject
from irrd.rpsl.rpsl_objects import RPSLM... |
import trimesh
from trimesh.base import Trimesh
import trimesh.creation
from trimesh.remesh import subdivide_to_size
import matplotlib.tri as mtri
import numpy as np
import torch
import quaternion
import os
from tqdm import tqdm_notebook as tqdm
from matplotlib import pyplot as plt
def plot_info(history_grad_norm, hi... |
import RobotRaconteur as RR
RRN = RR.RobotRaconteurNode.s
import numpy as np
import general_robotics_toolbox as rox
from .IdentifierUtil import IdentifierUtil
def _name_from_identifier(id_):
if id_ is None:
return None
return id_.name
class GeometryUtil(object):
def __init__(self, node = None, cli... |
# Lint as: python3
# Copyright 2019 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Part of the PsychoPy library
# Copyright (C) 2012-2020 iSolver Software Solutions (C) 2021 Open Science Tools Ltd.
# Distributed under the terms of the GNU General Public License (GPL).
from __future__ import division, absolute_import, print_function
import os
import ate... |
import layoutparser as lp
import cv2
from anuvaad_auditor.loghandler import log_info
from anuvaad_auditor.loghandler import log_exception
import src.utilities.app_context as app_context
import uuid
from config import PRIMA_SCORE_THRESH_TEST, LAYOUT_CONFIG_PATH,LAYOUT_MODEL_PATH,LAYOUT_CELL_CONFIG_PATH,LAYOUT_CELL_MODEL... |
# Copyright 2019 Open End AB
#
# 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, s... |
"""The Alarmo Integration."""
import logging
import bcrypt
import base64
from homeassistant.core import (
callback,
)
from homeassistant.components.alarm_control_panel import DOMAIN as PLATFORM
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import (
ATTR_CODE,
ATT... |
# import python libraries
import glob
import numpy as np
import cv2
from matplotlib import pyplot as plt
import matplotlib.image as mpimg
from skimage.feature import hog
from scipy.ndimage.measurements import label
### grab images from a directory
### returns np array of images
def read_image_dir(path):
Images = n... |
"""A plan and plan stubs factory designed for XPD experiment."""
import functools
import subprocess
import typing as tp
from pathlib import Path
from pprint import pprint
from typing import Union, Tuple, Generator, Any
import bluesky.plan_stubs as bps
import bluesky.plans as bp
import bluesky.preprocessors as bpp
impo... |
#!/usr/bin/env python
# Copyright (c) 2020 NVIDIA Corporation. All rights reserved.
# This work is licensed under the NVIDIA Source Code License - Non-commercial. Full
# text can be found in LICENSE.md
"""Test a PoseCNN on images"""
import torch
import torch.nn.parallel
import torch.backends.cudnn as cudnn
import to... |
#!/usr/bin/env python3
# --------------------( LICENSE )--------------------
# Copyright (c) 2014-2021 Beartype authors.
# See "LICENSE" for further details.
'''
**Beartype decorator code generator.**
This private submodule dynamically generates both the signature and body of the
wrapper fun... |
import os
import pandas as pd
import numpy as np
from datetime import datetime
import calendar
import matplotlib.pyplot as plt
from matplotlib import gridspec
def main():
# Read in data
print('reading in data')
all_dfs = {}
for kind in ['MEF', 'AEF']:
for region in ['PJM', 'RFC']:
... |
import numpy as np
import torch
import torch.nn as nn
import random
import time
from multiprocessing import Pool
import argparse
import cv2
import os
import glob
import math
from utils import path_to_action_vectors, extract_path
from astar import astar_planner_2d, astar_planner_3d, dijkstra_planner_2d, dijkstra_planne... |
from cassandra.cluster import Cluster
from cassandra.protocol import NumpyProtocolHandler
from cassandra.auth import PlainTextAuthProvider
from dask.distributed import Client, LocalCluster
import copy
import dask
import dask.dataframe as dd
import logging
import pandas as pd
from sqlalchemy import sql
from sqlalchemy.s... |
import pickle
import pytest
from vnep_approx import treewidth_model
import numpy as np
from alib import util
from .test_data.request_test_data import create_test_request
from .test_data.substrate_test_data import create_test_substrate_topology_zoo
import random
import time
logger = util.get_logger(__name__, make_... |
# <NAME>
# 05/10/2019
# RNN model training with no trial dynamics
import pandas as pd
import torch
import numpy as np
from torch.autograd import Variable
import torch.nn.functional as F
import task
import multiprocessing as mp
import h5py
from importlib import reload
task = reload(task)
np.set_printoptions(suppress=Tru... |
# Copyright 2019 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2021 The CASICloud 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/licen... |
"""Supporting functions for the 'fix' command."""
import logging
import numpy as np
import pandas as pd
from . import descriptives, params, smoothing
def do_fix(target_raw, antitarget_raw, reference,
do_gc=True, do_edge=True, do_rmask=True, do_cluster=False):
"""Combine target and antitarget coverage... |
import os
import inspect
import numpy as np
import scipy
from IPython import embed
import inspect
from matplotlib import pyplot as plt
from pypeit import msgs
from pypeit import specobjs
from pypeit.core import flux_calib
from pypeit.core import telluric, fitting
from pypeit.spectrographs.util import load_spectrogr... |
##1 pool3
#basedir = "/local/users/polivar/src/projects/mltracer/datain/20201229_bulk_rna_pilot2/GSTLT_bulk2/"
#sbcs = ['AGACTC', 'AGCTTC', 'CATGAG', 'CAGATC', 'TCACAG', 'GTCTAG', 'GTTGCA', 'GTGACA']
#pool1_sbcs = ['AGACTC', 'AGCTTC', 'CATGAG', 'CAGATC', 'TCACAG']
#pool2_sbcs = ['GTCTAG', 'GTTGCA', 'GTGACA', 'AGACTC', ... |
# -*- coding: utf-8 -*-
"""
Created on Wed Sep 12 01:20:37 2018
@author: sugho
"""
import pickle
import cv2
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
import glob
from moviepy.editor import VideoFileClip
# Calibrating the Camera
images = glob.glob('./camera_cal/calibration*.... |
"""
This file stores functions for scoring metrics on a tree.
Currently, we'll support parsimony and likelihood calculations.
"""
from typing import Callable, Optional, Tuple, Union
import numpy as np
import scipy
from cassiopeia.data import CassiopeiaTree
from cassiopeia.mixins import TreeMetricError
from cassiopeia... |
# coding=utf8
import os
import json
import yaml
from datetime import datetime, date
import calendar
import locale
from dateutil.relativedelta import relativedelta
from time import sleep
from threading import Thread
from context import EasydbException
from context import InvalidValueError
from context import get_jso... |
from pathlib import Path, PurePath
from historical_data import get_espn_tournaments
import path_config
import pandas as pd
import numpy as np
def find_subsequence(seq, subseq):
target = np.dot(subseq, subseq)
candidates = np.where(np.correlate(seq,
subseq, mode='valid') ... |
"""IMPORTANT: This version can only run in docker containers with a virtual display or a normal computer"""
import base64
import pathlib
import time
import uuid
import cv2
import os
from PIL import Image
from fastapi import Body, FastAPI, Path
from fastapi.middleware.cors import CORSMiddleware
from pyautogui import mo... |
class LegalMove():
"""
Tests proposed moves for correct cardinal direction and for obstacles in path
Called by propagate_board method in Class TowerkriegGame
"""
def __init__(self, gameboard, fp, fp_total, dir):
"""
Initializes parameters passed from Class TowerkriegGame, used to de... |
#!/usr/bin/env python
# Licensed to Pioneers in Engineering under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Pioneers in Engineering licenses
# this file to you under the Apache License, Version 2.0 (the
#... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
A lightweight privacy method based on time shuffling designed for sharing \
power profiles based data in open forums.
Conceptulised in the Energy and Power Group.
Energy and Power Group is part of the Department of Engineering Science,
University of Oxford.
A profile... |
import datetime as dt
import math
from Library import Reader
from Library import functionFiles
import pandas as pd
import time
import numpy as np
from sklearn.mixture import GaussianMixture
import matplotlib.pyplot as plt
import gdal
from gdalconst import *
def Import(Directories):
print("Import: Begin")
# Colu... |
#!/usr/bin/env python3
# Copyright 2017-2018 <NAME> et al
#
# 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... |
from common.models import Lake
from django.contrib.auth import get_user_model
from django.db import models
from django.db.models import F, Sum
from django.template.defaultfilters import slugify
from django.urls import reverse
from markdown import markdown
User = get_user_model()
from .Gear import Gear
class FNProto... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import torch
import torch.nn as nn
from torch.autograd import Variable
import torch.optim as optim
import numpy as np
import time
import os
from six.moves import cPickle
import torch.backends.cudnn as cudnn
im... |
"""Quite specifically my pyganim replacement.
More advanced animation/sprite abstractions are in
the animations module.
This gets its own module due to its complicated nature,
and because it avoids circular import issues.
"""
import pygame
from PIL import Image
class Anchor(object):
"""A coordinate on a surfa... |
# Copyright (c) 2020, MD2K Center of Excellence
# - <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 met:
#
# * Redistributions of source code must retain the above copyright notice, th... |
# Copyright 2015 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... |
import torch.nn as nn
import torch.nn.functional as F
import torch
import numpy as np
class Conv(nn.Module):
def __init__(self, in_planes, planes, kernel_size, stride=1, padding=0, bias=False, bn_before=None, bn_after=None):
super(Conv, self).__init__()
self.conv = nn.Conv2d(in_planes, planes, ker... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# #
# Copyright (C) 2021 ZinoHome, Inc. All Rights Reserved
# #
# @Time : 2021
# @Author : <NAME>
# @Email : <EMAIL>
# @Software: Neptune
import os
from core import dbengine, tableschema
from sqlalchemy import inspect, Table
from sqlalchemy.schema import Meta... |
"""a VLBI pipeline
Description:
------------
"""
import itertools
# External library imports
import numpy as np
# Midgard imports
from midgard.dev import plugins
# Where imports
from where import apriori
from where import obs
from where import cleaners
from where import estimation
from where.lib import config
fro... |
import os
import json
import torch
import numpy as np
from torch.utils.data import Dataset
from PIL import Image
from torchvision.transforms.functional import to_tensor
from learning.inputs.pose import Pose
from learning.inputs.vision import standardize_image
from learning.models.semantic_map.pinhole_camera_inv import... |
import pandas as pd
import plotly.express as px
import dash_table
import dash
import dash_html_components as html
import dash_core_components as dcc
from dash.dependencies import Input, Output, State
from dataclasses import dataclass, field
from typing import List
import random
import numpy
from dash_extensions import ... |
from __future__ import print_function
# this file contains different operations on files and directories:
# 1. fixNames: files generated with old functions give mouth images, stored as 'videoName_faces_frameNb.jpg'
# Transform this to the format 'videoName_frameNb_faces.jpg'
#
import sys
import getopt
... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import glob
import json
import os
import click
from collections import Counter
from datetime import datetime
from statistics import mean
from sqlalchemy import create_engine, exists, MetaData, Table
from sqlalchemy.orm import sessionmaker
from tqdm import tqdm
from t... |
# -*- coding: utf-8 -*-
"""
Created on Thu Oct 18 11:47:42 2018
@author: lefko
1sec~230 indexes
1index=0.004125 sec
every 1 index deviation from 230 points/sec = shifted axis values by 0.0002 sec
shock ttl on anIn3 channel of fp
"""
import csv
import pandas as pd
import numpy as np
import os
import matplotlib.pypl... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# using sys and os here ensures that we use the local RDS incase RDS has already been installed through pip
import sys, os
sys.path.insert(0, os.path.abspath(".."))
from rds import Server
server = Server("https://covid19.richdataservices.com/rds")
# testing metadata
de... |
from payment.filter import ClientTransactionType, SupplierTransactionType
from typing import (Any, Dict, List, Optional, Sequence)
from django.contrib import admin
from django.contrib.admin.options import (ModelAdmin, TabularInline)
from django.db.models.query import QuerySet
from django.http import request
from django... |
import sys
import math
from PySide import QtCore, QtGui
from PySide.QtCore import Qt, QPoint, QPointF
from PySide.QtNetwork import QAbstractSocket
from gazecontour import basewindow
from gazecontour.recorder import Recorder
from gazecontour.eyetribe import EyeTribe
import gazecontour.realtime
import gazecontour.image... |
# coding: utf-8
#
# Copyright 2015 The Oppia 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 requi... |
import numpy as np
import ast
import pathos
import pandas as pd
import src.metrics as metrics
def proc_data(df):
for col in ['covariates', 'interventions']:
if col in df.columns:
df[col] = df[col].apply(ast.literal_eval)
for col in ['p_xd', 'p_dy', 'p_xy']:
df[col]=df[col].apply(lam... |
import numpy as np
from typing import Dict, List
from eight_mile.tf.layers import TransformerEncoderStack, TransformerEncoder, TransformerDecoderStack, TransformerDecoder, MultiHeadedAttention, FFN
from eight_mile.tf.embeddings import LookupTableEmbeddings, LearnedPositionalLookupTableEmbeddingsWithBias, LearnedPositio... |
#
# Copyright (c) 2018 <NAME> <<EMAIL>>
#
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL... |
from __future__ import print_function, division
import os
import torch
import numpy as np
import random
from torch.utils.data import Dataset, DataLoader
from torchvision import transforms, utils
from torch.utils.data.sampler import Sampler
from pycocotools.coco import COCO
from ..util.pascal_voc_eval import voc_eval
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import argparse
import os
import pipeline as pipe
from WorkflowConfig import parseProjectConfig
from multiprocessing import Pool
def run_bwa(configuration):
'''Run BWA MEM with multiple threads on one or more samples'''
#print type(configuration)
... |
import csv
import os
from bidict import bidict
from enum import IntEnum, Enum
from ..io_utils.types import singleton
__reload_order_index__ = -1
class M2GlobalFlags(IntEnum):
TILT_X = 0x1
TILT_Y = 0x2
UseTextureCombinerCombos = 0x8
LoadPhysData = 0x20
UNK = 0x80
CameraRelated = 0x100
Ne... |
import requests
from rdflib import Graph, URIRef
from rdflib.namespace import RDF, SKOS
from rdflib.util import guess_format
from rdflib.exceptions import ParserError
from rdflib.plugins.parsers.notation3 import BadSyntax
import skosify
import os
import gzip
import json
import logging
from io import BytesIO
import zipf... |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Loader for Israel YAML format.
See base_loader for full documentation.
"""
from __future__ import absolute_import
from __future__ import print_function
from __future__ import unicode_literals
from datetime import timedelta
import json
import logging
import os
import... |
"""
LispTick TimeSerie Streaming Server module
To work on an Onion Omega2 needs:
opkg update
opkg install python-codecs
"""
import datetime
import json
import struct
import socket
# Types byte definition
TNULL = b'\x00'
TINT = b'\x01'
TFLOAT = b'\x02'
TTIME = b'\x03'
TDURATION = b'\x04'
TERROR = b'\x05'
TSTRING = b'\x... |
"""Functions for exploratory analysis
Variables looked at:
precipitation (fine grid) over space and time
model fields (coarse grid but also fine grid using default interpolation)
over space and time
topography over space (fine grid but also coarse grid using default
interpolation)
Cities lo... |
import os
import time
import psutil
from collections import deque
import multiprocessing
from blessed import Terminal
from .nxbt import Nxbt, PRO_CONTROLLER
class LoadingSpinner():
SPINNER_CHARS = ['■ □ □ □', '□ ■ □ □', '□ □ ■ □', '□ □ □ ■', '□ □ □ ■', '□ □ ■ □', '□ ■ □ □', '■ □ □ □'] # noqa
def __init__... |
# Copyright 2019 Graphcore Ltd.
import os
import sys
import json
import argparse
import math
from typing import List, Any, Optional
import numpy as np
import onnx
from logging import getLogger
from onnx import TensorProto, numpy_helper
from bert_model import BertConfig
logger = getLogger(__name__)
def load_initiali... |
import glob
import os
import shutil
import time
import zipfile
from datetime import datetime
from django import forms
from museum_site.models import *
from museum_site.fields import *
from museum_site.widgets import *
from museum_site.common import GENRE_LIST, YEAR, any_plus, TEMP_PATH, SITE_ROOT, get_sort_option_for... |
# encoding=utf-8
"""Misc system & data process utils
Usage:
>>> import misc_utils as utils
>>> utils.func_name() # to call functions in this file
"""
import datetime
import glob
import os
import pdb
import string
import random
import sys
import time
import numpy as np
import logging
import pickle
import json... |
# -*- encoding: utf-8; test-case-name: tests.test_main -*-
# ========================================================================
"""
Copyright and other protections apply. Please see the accompanying
:doc:`LICENSE <LICENSE>` and :doc:`CREDITS <CREDITS>` file(s) for rights
and restrictions governing use of this so... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.