text stringlengths 3.07k 22.1k |
|---|
"""
"""
import pickle
import numpy as np
from matplotlib import pyplot as plt
from mpl_toolkits.axes_grid1 import make_axes_locatable
from oap.core import decompress
from oap.bnp import progress, Runtime
from oap.__conf__ import COLUMN, ROSETTE
def load_imagefile(filename):
with open(filename, "rb") as file:
... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Jun 17 15:25:25 2019
@author: ggaregnani
"""
from typing import Any, Dict, List, Optional, Tuple
from pint import UnitRegistry
import numpy as np
import resutils.unit as resu
from osgeo import gdal
from matplotlib import colors
CLRS_SUN = "#F19B03 #F6... |
from discord.ext import commands
from dotenv import load_dotenv
from lib.mysqlwrapper import mysql
from lib.logger import Logger
from pathlib import Path
import discord
import logging
import os
# Load up the environment variables
env_file_name = '.env'
env_path = Path('.') / env_file_name
load_dotenv(dotenv_path=env_p... |
"""
Base Event Module.
Contains base event class for tracking specific calendar events. Init
arguments are bundled in a separate data class to prevent excessive
code duplication in subclass init methods.
"""
import abc
from dataclasses import dataclass
from datetime import datetime
from typing import List, Optional
... |
from __future__ import absolute_import, unicode_literals, print_function
import sys
import socket
import json
import logging
import contextlib
from ilabs.client.get_secret import get_secret
from ilabs.client.send_request import send_request, ILABS_USER_AGENT, HTTPError
@contextlib.contextmanager
def show_error():
... |
import warnings
import mmcv
import numpy as np
import torch
from mmcv.ops import RoIPool
from mmcv.parallel import collate, scatter
from mmcv.runner import load_checkpoint
from mmdet.core import get_classes
from mmdet.datasets import replace_ImageToTensor
from mmdet.datasets.pipelines import Compose
from mmdet.models... |
"""
NCL_panel_35.py
===============
This script illustrates the following concepts:
- Attaching three filled contour plots along Y axes
- Adding a common colorbar to attached plots
- Adding a common title to attached plots
- Generating dummy data using "generate_2d_array"
- Drawing a custom colorbar
-... |
from ..design.createFigs_design import Ui_MainWindow
from .caption_creator import captionCreator
from ..support_classes import LoadingSpinner
from ..validators import NumNonNegativeValidator
from PyQt5 import QtWidgets as qtw
from PyQt5 import QtCore as qtc
import matplotlib.pyplot as plt
import os, sys
cla... |
# -*- coding: utf-8 -*-
"""Parser for the Microsoft File History ESE database."""
from __future__ import unicode_literals
from dfdatetime import filetime as dfdatetime_filetime
from dfdatetime import semantic_time as dfdatetime_semantic_time
from dfdatetime import java_time as dfdatetime_java_time
from plaso.contain... |
from enum import Enum
from sys import float_info
from googleapiclient.discovery import build
from httplib2 import Http
from oauth2client import file, client, tools
import gspread
class BorderTypes(Enum):
Top = 'top'
Bottom = 'bottom'
Left = 'left'
Right = 'right'
InnerHorizontal = 'innerHorizontal'
InnerV... |
"""Python Decorator Templated"""
from functools import wraps, partial
__all__ = [
'base_decorator_func',
'base_decorator_func_with_args',
'BaseDecorator',
]
def base_decorator_func(func):
"""Decorator function:
This decorator overrides original 'function' and
returns the wrapper function.
... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function
import utool
import six
print, print_, printDBG, rrr, profile =\
utool.inject(__name__, '[nnfilt]', DEBUG=False)
import numpy as np
import vtool.linalg as ltool
from numpy import array
from six.moves import zip
eps = 1E-8
... |
"""
trains a sequence to sequence (seq2seq) model for English to Spanish translation.
This is an advanced example that assumes some knowledge of sequence to sequence models.
After training the model in this notebook, you will be able to input a Spanish sentence,
such as *"are you still at home?"* and return the Spanis... |
import numpy as np
import scipy as sp
from scipy import special
import matplotlib.pyplot as plt
import latte_lammps_functions as llf
def PorezagSKF(r):
"""
Computes Hamiltonian and matrix overlap elements for building corresponding .skf file.
Parameterization taken from Porezag et. al.'s "Construction o... |
import os, sys
from os.path import dirname, abspath
import time
likely_lib_path = os.path.join(dirname(dirname(dirname(abspath(__file__)))), 'lib', 'p27_site_packages')
if os.path.exists(likely_lib_path):
sys.path.insert(0, likely_lib_path)
import roslib
import rospy
from pacmod_msgs.msg import PacmodCmd, Positio... |
import math
import numpy as np
import torchvision.models as models
import torch.utils.data as data
from torchvision import transforms
import cv2
import torch.nn.functional as F
from torch.autograd import Variable
import pandas as pd
import os ,torch
import torch.nn as nn
import argparse,random
from models.ResNet_utils ... |
#
# CISC 452
# Prediction of Blood Glusose Levels based on RTCGM Data
#
# November 10, 2016
#
# This script implements a multi-layer feed-forward neural network for glucose
# prediciton
#
# The network has 7 input nodes and 1 output node. If the current time is 'T',
# then the inputs and output represent the blood gluc... |
import numpy as np
import tensorflow as tf
from tensorflow import keras
import os, sys
import argparse
import horovod.tensorflow as hvd
parser = argparse.ArgumentParser(description='Tensorflow MNIST Example')
parser.add_argument('--tensorboard', action='store_true', default=False,
help='output summ... |
from abc import ABCMeta, abstractmethod
import zmq
from six import add_metaclass, iteritems
from fuel.iterator import DataIterator
from fuel.server import recv_arrays
@add_metaclass(ABCMeta)
class AbstractDataStream(object):
"""A stream of data separated into epochs.
A data stream is an iterable stream of ... |
"""
Utility functions for the benchmarks
==========================================
"""
import importlib
import os
import time
import matplotlib as mpl
from matplotlib import pyplot as plt
from si_prefix import si_format
import numpy as np
import torch
import jax
use_cuda = torch.cuda.is_available()
#############... |
from libheap.frontend.printutils import color_title
from libheap.frontend.printutils import color_value
try:
import gdb
except ImportError:
print("Not running inside of GDB, exiting...")
exit()
def format_address(value):
"""Helper for printing gdb.Value on both python 2 and 3"""
try:
ret... |
"""
Script is Created by <NAME>
"""
import os, errno
import argparse
import numpy as np
import pandas as pd
from datetime import datetime, timedelta
import sys
# date_time format
date_time_format = '%Y-%m-%dT%H:%M:%S.%f'
date_only_date_time_format = '%Y-%m-%d'
sys.path.append(os.path.join(os.path.curdir, '../', 'uti... |
from django.db import models
from django.db.models import Q
from django.utils.dateformat import format as django_format
from stages.models import Corporation, CorpContact, Teacher
GENDER_CHOICES = (
('M', 'Masculin'),
('F', 'Féminin'),
('I', 'Inconnu')
)
SECTION_CHOICES = (
('ASA', 'Aide en soin et a... |
# Copyright (c) Facebook, Inc. and its affiliates.
# Copyright (c) <NAME>.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from scipy import sparse
import numpy as np
from torch_geometric.nn import fps, knn_graph
import matplotlib.pyplot as ... |
#!/usr/bin/env python3
"""
Application for logging the AVUE camera platform to SensorNet MQTT
"""
import argparse
import json
import logging
import os
import re
import signal
import socket
import subprocess
import sys
from threading import Timer
import time
import yaml
from yaml import Loader
import paho.mqtt.client ... |
import serial
import asyncio
from typing import Iterator, Tuple
from serial.tools.list_ports import comports
from PyQt5 import QtCore, QtGui, QtWidgets
from PyQt5.QtWidgets import QApplication, QMessageBox
from PyQt5.QtCore import QSettings
from PyQt5.QtGui import QCloseEvent
from quamash import QEventLoop
from numpy ... |
import torch
import torch.nn as nn
import torch.nn.functional as F
from torchvision import models
import pretrainedmodels
import timm
from .modules import Conv2d, NonLocal2d
from .DCNv2.dcn_v2 import DCN
def fill_fc_weights(layers):
for m in layers.modules():
if isinstance(m, nn.Conv2d):
nn.i... |
import sys
import numpy as np
from numpy import cos, pi
from numpy.lib.polynomial import polyint
from skimage.measure import marching_cubes_lewiner
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
np.set_printoptions(threshold=sys.maxsize)
np.set_printoptions(formatter={'float_kind':'{:f}... |
# -*- coding: utf-8 -*-
# import sys
# sys.path.append('/usr/local/lib/python2.7/dist-packages/')
import lib
import codecs
import Constants
from Dict import Dict
import ast, asttokens
# from ..parser.JavaLexer import JavaLexer
# from ..parser.JavaParser import JavaParser
# from ..parser.JavaListener import JavaListene... |
from .tts import *
from .url import Url
import tts
import zipfile
import json
import urllib.error
PAK_VER=2
def importPak(filesystem,filename):
log=tts.logger()
log.debug("About to import {} into {}.".format(filename,filesystem))
if not os.path.isfile(filename):
log.error("Unable to find mod pak {}".format(... |
from django.shortcuts import render, redirect
from .models import Post, Like, Dislike
# from django.contrib.auth.forms import UserCreationForm
from django.contrib import messages
from django.contrib.auth.decorators import login_required
from django.contrib.auth.models import User
from .forms import UserRegisterForm
fro... |
"""
Classifiers for the Toxic Comment Classification Kaggle challenge,
https://www.kaggle.com/c/jigsaw-toxic-comment-classification-challenge
To run locally:
python trainer/model.py --train_data=train.csv --predict_data=test.csv --y_class=toxic
To run locally using Cloud ML Engine:
gcloud ml-engine local train \
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Extensión de pydatajson para leer catálogos de metadatos a través de la API
de CKAN v3.
"""
import os.path
import logging
import json
from six.moves.urllib_parse import urljoin
from six import iteritems
from ckanapi import RemoteCKAN
from .helpers import clean_str, tit... |
from ..exceptions import ConfigurationError
RANGE_255 = list(range(256))
class Modifier:
_submod = None
subcodes = None
code = None
submod = property()
def __init__(self, submod=None):
self.submod = submod
@classmethod
def _get_code_str(cls, src) -> str:
"""
:... |
from enum import Enum
from functools import lru_cache
import matplotlib.pyplot as plt
import numpy as np
import wikipedia
from IPython.display import display, clear_output
import fasttext as FastText
from ipywidgets import Tab, Text, Checkbox, Label, HBox, VBox, Button, Dropdown, Textarea
from mpl_toolkits.mplot3d imp... |
import logging
from businessLogic import InsertQuery, DeleteQuery
from businessLogic.CreateValidation import CreateValidation
from businessLogic.SelectSqlValidation import SelectSqlValidation
from businessLogic.UpdateValidation import UpdateSqlValidation
from businessLogic.methods import executeQueries
global databas... |
"""
Summary
=======
This plugin implements news item listings for a subset of Pyblosxom
post categories, suitable for display on a landing page. It is
compatible with the pages plugin, and has simple support for
prepublication preview of news content.
There are several elements to the magic.
**Set date from filenam... |
#!/usr/bin/python3
import copy
noCard = -1
king = 12
queen = king - 1
jack = queen - 1
ten = jack - 1
ace = 0
suitChars = ['C', 'D', 'H', 'S', ]
pipsChars = ['-', 'A', '2', '3', '4', '5', '6', '7', '8', '9', 'T', 'J', 'Q', 'K', ]
def makeCard(suit, pips):
return suit * 13 + pips
def suit(card):
return car... |
import warnings
from random import randint
class OpNet:
"""
Manager class for all created nodes, ports, and conduits.
"""
def __init__(self):
self.nodes = []
self.conduits = []
def add_node(self, op, params, outputs, name=None):
"""
Add new node to net.
""... |
# import some libraries
import numpy as np
import pandas as pd
import statsmodels.api as sm
import random
from scipy.stats import t, f
import matplotlib.pyplot as plt
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
import torch.utils.data as data
from sklearn import metr... |
import linalgeuc.math.linear_algebra as lalib
from linalgeuc.graphics.entity import Entity
from linalgeuc.graphics.mesh import Mesh
from linalgeuc.graphics.primitive import Line
import pygame as pg
from pygame.locals import *
import math
import sys
class Camera(Entity):
fov_keys = "op"
def __init__(self, dim... |
import warnings
import numpy as np
from scipy.linalg import eigh
from scipy.spatial.distance import pdist
from scipy.cluster.hierarchy import linkage, cut_tree
from fanok.sdp._full_rank import _full_rank
from fanok.sdp._low_rank import _sdp_low_rank
try:
import cvxpy as cp
except ImportError:
# CVXPY isn't i... |
#!/usr/bin/python3.8
# -*- coding: utf-8 -*-
from exchanges_wrapper import __version__
import aiohttp
import asyncio
import json
import hmac
import hashlib
import random
import logging
import time
import exchanges_wrapper.ftx_parser as ftx
logger = logging.getLogger('exch_srv_logger')
class EventsDataStream:
... |
#!/usr/bin/python -i
# generate ids and keys for joining the network
# <NAME>
# 201309211719
# <EMAIL>
import M2Crypto
import json,string,os
import logging
import hashlib
import base64
import sqlite3
import StringIO
import time
import os,sys
import traceback
import storage
import readline,rlcompleter
base_schema =... |
import sys
from pysnark import gmpy
snarkjsp=21888242871839275222246405745257275088548364400416034343698204186575808495617
class LinearCombination:
def __init__(self, lc): self.lc = lc
def __add__(self, other):
lc = dict()
for a in self.lc:
if a in other.lc:
lc[a] ... |
from builtins import object
import time
from common.firewall.base import BaseFirewallTest
class MatchOp(object):
# operator for use in where-clause, copies from opserver_util.py
EQUAL=1
NOT_EQUAL=2
IN_RANGE=3
NOT_IN_RANGE=4
LEQ=5
GEQ=6
PREFIX=7
REGEX_MATCH=8
CONTAINS=9
class Ba... |
"""
@author: <NAME>
@contact: <EMAIL>
"""
import itertools
import logging
import numpy as np # type: ignore
import os
import pandas as pd # type: ignore
from rich.progress import track # type: ignore
import shutil
from typing import List
from ifpd2.probe import OligoProbe
class OligoProbeSet:
"""Set of non-o... |
ANSIBLE_METADATA = {
'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'
}
DOCUMENTATION = '''
---
module: tetration_role
short_description: Manage roles and capabilities
version_added: '2.9'
description:
- Enables management of Cisco Tetration roles.
- Enables creation, modifi... |
import glob
import json
import logging
import os.path
import re
from datetime import datetime
from os import mkdir
from os.path import exists, isfile, join
import pandas as pd
from bsbetl import calc_helpers, g, helpers
def save_runtime_config():
''' call this after runtime values need to be persisted '''
... |
from futile.Utils import write as safe_print
from . import InputGenerator
cpickle_file = "bigdft-results.cpickle"
def process_element(run, var, dico, force_run, Elements, strains):
import math
import cPickle
name = dico["name"]
hgrids = var['dft']['hgrids']
ngrids = (math.ceil(strains[0] * dico["... |
import os.path as osp
import torch
import torch.nn as nn
from torch.nn import functional as F
from torch.cuda.amp import GradScaler, autocast
from dassl.engine import TRAINER_REGISTRY, TrainerX
from dassl.metrics import compute_accuracy
from dassl.utils import load_pretrained_weights, load_checkpoint
from dassl.optim... |
import requests
from bs4 import BeautifulSoup
from tqdm import tqdm
def latestSubmit() :
user_agent = {'User-agent' : 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) \
AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36'}
req = requests.get('https://www.acmicpc.net/status', headers =... |
import tensorflow as tf
from tensorflow.keras.layers import (Conv2D,
BatchNormalization,
ReLU,
MaxPool2D,
Concatenate,
GlobalAveragePoo... |
import datetime
import os
import re
from datetime import timedelta
from typing import List
import tqdm as tqdm
from googleapiclient.discovery import build
from youtube_downloader import download_videos_by_id
from yt_list_downloader.input import playlists
VIDEO_WATCH_IDS = """6cFU7KVgb0w
BDEqF1Xd7-s
UeNIg-9GsXY
IOcDv... |
from evdev import InputDevice, categorize, ecodes
import serial
import sys
import time
from pyjoycon import PythonicJoyCon, get_PRO_id
import time, math
from bluepy import btle
# time to sleep between commands to make sure they're not skipped
deltaTime = 1.0/30
deltaTimeLong = deltaTime *6
# joystick d... |
import os
import json
import shutil
from base64 import b64decode
from jupyterhub.handlers import BaseHandler
from jupyterhub.auth import Authenticator
from jupyterhub.auth import LocalAuthenticator
from jupyterhub.utils import url_path_join
from traitlets import Unicode, Callable
import jwt
DEFAULT_COOKIE_NAME = "XSR... |
"""Unit test for :func:`esmvalcore.preprocessor._multimodel`"""
from datetime import datetime
import iris
import numpy as np
import pytest
from cf_units import Unit
from iris.cube import Cube
import esmvalcore.preprocessor._multimodel as mm
from esmvalcore.preprocessor import multi_model_statistics
SPAN_OPTIONS = (... |
#!/usr/bin/python
import glob
import os
import re
import socket
import subprocess
import sys
from datetime import datetime, date
import yaml
import vmu
def run_command(command, shell=False):
# Preprocess command
if shell:
if not isinstance(command, str):
command = ' '.join(command)
el... |
"""# *************************************************************
# 2018
# *************************************************************
#
# SERVER
#
# *************************************************************"""
# Import function from socket module
#... |
# Python and OS
import os
# Data
import pandas as pd
import numpy as np
# Time
import time
# Clustering
from sklearn.preprocessing import StandardScaler
from sklearn.cluster import AgglomerativeClustering
# Plot
import probscale
import matplotlib.pyplot as plt
from matplotlib.ticker import FuncFormatter
def main(... |
# Copyright (c) 2010-2011 openpyxl
#
# 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, ... |
"""
Common utils for scoring.
"""
from functools import partial
from typing import Any, Callable, Dict, List, Optional, Tuple, Union
from collections import ChainMap
import numpy as np
import pandas as pd
import sed_eval
import torch
from sklearn.metrics import average_precision_score, roc_auc_score
from scipy import ... |
import sys
import argparse
from functools import reduce
from collections import OrderedDict
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import xgboost as xgb
from sklearn.metrics import roc_auc_score
from sklearn.linear_model import Ridge, LinearRegression
import torch
import torch.nn as nn
... |
import threading
import psutil
import logging as logger
from time import sleep
from osbot_utils.utils.Files import path_combine, folder_create, file_create
from osbot_utils.utils.Json import json_save_file_pretty, json_load_file, file_exists
from cdr_plugin_folder_to_fold... |
import argparse
import logging
import multiprocessing as mp
import os
import time
from pathlib import Path
import matplotlib.pyplot as plt
import numpy as np
from tqdm import tqdm
from environments import SimulatedSpe_edEnv, WebsocketEnv
from environments.logging import CloudUploader, Spe_edLogger
from e... |
import os
import copy
import math
import numpy as np
import gurobipy as gp
from gurobipy import GRB
def save_checkpoint(model, where):
try:
model_check_point = np.array([abs(var.x) for var in model.getVars()])
np.save(os.path.join("sol", model.ModelName), model_check_point)
except:
pas... |
"""Sensor to represent overall internet status."""
import logging
from homeassistant.const import CONF_NAME, CONF_ENTITY_ID
from homeassistant.helpers.entity import Entity
from .const import (
DOMAIN,
CONF_LINKS,
CONF_RTT_SENSOR,
CONF_UPDATE_RATIO,
CONF_DEBUG_RTT,
DEF_LINK_NAME,
DEF_LINK_... |
"""EVALUATION METRICS FOR BIOMETRIC APPLICATIONS
"""
import numpy as np
from logging import warning
from tqdm import tqdm
def find_thresholds_by_FAR(score_vec, label_vec, FARs=None, epsilon=10e-8):
assert len(score_vec.shape)==1
assert score_vec.shape == label_vec.shape
assert label_vec.dtype == np.bool
... |
from __future__ import division
#Python imports
import itertools
import logging
import math
VERSION = (0, 1, 0)
__version__ = "".join([".".join(map(str, VERSION[0:3])), "".join(VERSION[3:])])
#TODO: make sure to handle 0, 180, and -180 degrees
class Tiler(object):
def __init__(self, geo_helper, max_tile_wh):
... |
# coding:utf-8
# Produced by <NAME>
# Start Data: 8_Aug_2020
# TensorFlow Version for Bucket Search.
#
# For GOD I Trust.
# 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.apac... |
#!/usr/bin/env python
import os
import sys
import json
import glob
import fnmatch
import argparse
import traceback
import subprocess
from pprint import pprint
from deepdiff import DeepDiff # pip install deepdiff
sys.path.append("..")
from lib_parser import parse
from lib_engine import Engine
class EngineMock:
def _... |
import os
import random
import numpy as np
# from ..configs import *
def _make_dir_if_not_exists(path):
if not os.path.exists(path):
os.mkdir(path)
class DatasetManager:
KIND_MOVIELENS_100K = 'movielens-100k'
KIND_MOVIELENS_1M = 'movielens-1m'
KIND_MOVIELENS_10M = 'movielens-10m'
KIND_... |
from typing import List, Tuple
import numpy as np
horizontal = 10 # when sprinting Mario can jump over a 10 tiles gap horizontally
vertical = 4 # Mario can jump over a 4 tile wall
diagonal = (
6 # Mario can jump over 6 tiles to clear a 4 block height difference when sprinting
)
empty = "-"
ignored = ["M", "F"... |
#### Paths ####
TEST_IDS_PATH = 'Data/Original/predict.txt'
TEST_IDS_DUMMY_PATH = 'Data/PreProcessed/predict_dummy.txt'
PROCESSED_TRAIN_PATH = 'Data/PreProcessed/training_set_processed.txt'
ORIGINAL_DATA_PATH = 'Data/Original/data_set.txt'
ORIGINAL_DATA_CLEAN_PATH = 'Data/PreProcessed/data_set_clean.txt'
MOVIE_TAG_P... |
"""VIME: Extending the Success of Self- and Semi-supervised Learning to Tabular Domain (VIME) Codebase.
Reference: <NAME>, <NAME>, <NAME>, <NAME>,
"VIME: Extending the Success of Self- and Semi-supervised Learning to Tabular Domain,"
Neural Information Processing Systems (NeurIPS), 2020.
Paper link: TBD
Last updated... |
# Copyright 2019-present Kensho Technologies, LLC.
from graphql.language.ast import FieldNode, InlineFragmentNode, SelectionSetNode
from ...ast_manipulation import get_ast_field_name
from ...exceptions import GraphQLCompilationError
from ...global_utils import merge_non_overlapping_dicts
from ...schema import FilterDi... |
import io
from bs4 import BeautifulSoup
from datetime import datetime
import re
import skpy
import discord
import asyncio
import logging
from config import *
from collections import deque
from typing import Tuple, Deque
class Rex(dict):
def __getitem__(self, item):
return self.setdefault((item, 0), re.com... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# ======================================================================
# Copyright 2016 <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
#
#... |
# More information, as well as the (non)licence can be found at: https://github.com/Katorone/Astrox-Imperium
# If you run into any issues, feel free to open an issue on Github, or write me (katorone#2957) on the Astrox discord.
# This file contains configuration settings for:
# - shipfiles_2_csv.py
# - csv_2_shipfiles... |
#!/usr/bin/python3
import logging
import pybrain
import pybrain.tools.shortcuts
import pybrain.datasets
import pybrain.supervised.trainers
import pybrain.tools.customxml.networkwriter
import json
import argparse
import math
import os
import json
import datetime
import pprint
import numpy as np
def main():
args ... |
from __future__ import print_function
import nose.tools
import numpy
import numpy.testing
import pbcore.data
from pbcore.data import MOVIE_NAME_BC
from pbcore.io.BarcodeH5Reader import BarcodeH5Reader, BarcodeH5Fofn, MPBarcodeH5Reader, LabeledZmw
class TestBarcodeH5Reader(object):
"""Tests of BarcodeH5Reader aga... |
import pandas as pd
import numpy as np
import webbrowser
import os
import tabulate
def return_dataframe_(path, show):
'''Error handling read_csv function
'''
try:
goalie_data = pd.read_csv(path)
if show is True:
print(goalie_data)
return goalie_data
except pd.error... |
# FusionAPI_python Addin ContactCheck
# Author-kantoku
# Description-接触チェック
import adsk.core, adsk.fusion, traceback
from .Fusion360Utilities.Fusion360CommandBase import Fusion360CommandBase
class ContactCheck(Fusion360CommandBase):
def on_destroy(self, command: adsk.core.Command, inputs: adsk.core.CommandInputs,... |
import platform
import subprocess
import sys
from PySide2 import QtCore, QtWidgets
from PySide2.QtCore import Slot, QRunnable, QThreadPool, QObject, SIGNAL, SLOT, Qt
from PySide2.QtGui import QStandardItem, QStandardItemModel
from PySide2.QtWidgets import QAbstractItemView, QDialog, QDialogButtonBox, QApplicati... |
# coding: utf-8
# In[1]:
# bollinger bands is a simple indicator
# just moving average plus moving standard deviation
# but pattern recognition is a different case
# visualization is easy for human to identify the pattern
# but for the machines, we gotta find a different approach
# when we talk about pattern recognit... |
#/usr/bin/python3
import os, sys, subprocess
import github
import shutil
testing = os.environ["INPUT_TESTING"]
if testing:
print("::info::Testing mode is on; will reset repositories!")
################################################################################
def rewind_repos():
pass
####################... |
"""Diphone inventory assembly"""
import argparse
import bisect
import os
import pickle as plk
from pathlib import Path
from scipy.io import wavfile
from unitselection.fcn.constants import *
from unitselection.fcn.prepare_data import split_mlf
from unitselection.fcn.speech_unit import SpeechUnit
parser = argparse.Arg... |
import configparser
import getpass as gp
import logging.config
import os
import re
from datetime import time
from urllib.parse import urljoin
import psycopg2
import wget
import yaml
from bs4 import BeautifulSoup
from requests import get, post
import db_manager as db
def folder():
basedir = os.path.abspath(os.pa... |
import sys, os, shutil, codecs
sys.path.append(os.path.dirname(os.path.abspath(__file__))+"/../..")
from Utils.ProgressCounter import ProgressCounter
from Tools.BLLIPParser import escDict
try:
import xml.etree.cElementTree as ET
except ImportError:
import cElementTree as ET
import Utils.ElementTreeUtils as ETUt... |
import numpy as np
import re
from nltk.tokenize import TweetTokenizer
from sklearn.metrics.pairwise import cosine_similarity as cos
from scipy.stats import pearsonr, spearmanr
import sent2vec
import random
from sklearn.model_selection import GridSearchCV, cross_val_score
from sklearn.preprocessing import StandardScaler... |
import os
import time
import random
from PyQt5 import QtCore
from easygraphics import *
import winsound
UP = 8
RIGHT = 4
DOWN = 2
LEFT = 1
GRID_SIZE = 20
START_X = 21
START_Y = 21
END_X = 481
END_Y = 361
SNAKE_COLOR = Color.YELLOW
SNAKE_SIZE_X = 3
SNAKE_SIZE_Y = 9
class Snake:
def __init__(self):
se... |
import os
import random
import time
from typing import Union
import numpy
import pylab
import imageio
import glob
from rich import print
from rich import progress
# TODO: make it faster by using numpy arrays and asyncio
class Patterns:
"""A class to store all the patterns"""
def __init__(self):
se... |
import warnings
import numpy as np
import scipy
from skimage.restoration import unwrap_phase
from .base import BaseInterferogram
from ..fourier import get_best_interface
class QLSInterferogram(BaseInterferogram):
"""Interferometric analysis of quadri-wave lateral shearing holograms"""
#: Default QLSI pipeli... |
#!/usr/bin/python3
#
# Remapper for Topre Realfoce and the thinkpad internal keyboard.
#
import os
import sys
import threading
import time
import evdev
from evdev import ecodes as ec
import key_remapper
NAME = "Main Keyboard Remapper"
SCRIPT_PATH = os.path.dirname(os.path.realpath(__file__))
ICON = os.path.join(SCRI... |
# Copyright (c) 2019 <NAME> and <NAME>
#
# This file is part of the LipidFinder software tool and governed by the
# 'MIT License'. Please see the LICENSE file that should have been
# included as part of this software.
"""Set of methods focused on correct any retention time misalignments:
> correct_retention_time():... |
# -*- coding: utf-8 -*-
# copyright: sktime developers, BSD-3-Clause License (see LICENSE file)
"""Implements hierarchical reconciliation transformers.
These reconcilers only depend on the structure of the hierarchy.
"""
__author__ = ["ciaran-g", "eenticott-shell", "k1m190r"]
import numpy as np
import pandas as pd
f... |
import os
from genicam.gentl import TimeoutException
from harvesters.core import Harvester
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
import torch
import torchvision.transforms.functional as F
from .._file_utils import get_highest_numbered_file
from .._image_utils import RGB8Image, draw_bbo... |
"""
Utility classes and tools for handling data contained in bpch files
"""
from dask import delayed
import dask.array as da
import numpy as np
import os
from collections import OrderedDict
from . uff import FortranFile
from . util import cf
from . util.diaginfo import get_diaginfo, get_tracerinfo
#: Default datat... |
#!/usr/bin/env python
import os
import sys
import gzip
gene_id_col_map={'exon':2,'gene':1}
def load_annotation(args, annot_type, annotation_file):
gene2coords = {}
gene2num_exons = {}
#gene format:
#chr1 HAVANA gene 11869 14409 . + . ID=ENSG00000223972.5;gene_id=ENSG000002... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Aug 14 18:44:00 2018
@author: xiang
"""
import torch
import torch.nn as nn
import torch.nn.functional as F
from MPNCOV.python import MPNCOV
def conv3x3(in_planes, out_planes, strd=1, padding=1, bias=False):
"3x3 convolution with padding"
retu... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.