text stringlengths 3.07k 22.1k |
|---|
import os
import pandas as pd
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
from matplotlib import rcParams, cycler, colors
params = {
# 'text.latex.preamble': ['\\usepackage{gensymb}'],
# 'text.usetex': True,
'font.family': 'Helvetica',
}
rcParams.update(params)
from matplotlib.... |
# Code generated by lark_sdk_gen. DO NOT EDIT.
from pylark.lark_request import RawRequestReq, _new_method_option
from pylark import lark_type, lark_type_sheet, lark_type_approval
import attr
import typing
import io
@attr.s
class SearchApprovalTaskReq(object):
user_id: str = attr.ib(
default="", metadata=... |
import os
from flask import Flask,redirect,render_template,request
import urllib
import datetime
import json
import ibm_db
import geocoder
import geopy.distance
from config import *
import time
from cachetools import cached, Cache
import pandas as pd
app = Flask(__name__)
cache = Cache(maxsize=1000000)
@cached(cache)... |
"""
Implementation of Smiles2Vec and ChemCeption models as part of the ChemNet
transfer learning protocol.
"""
__author__ = "<NAME>"
__license__ = "MIT"
import numpy as np
import tensorflow as tf
from typing import Dict
from deepchem.data.datasets import pad_batch
from deepchem.models import KerasModel
from deepchem... |
import os
import sys
import numpy as np
import pandas as pd
import re
from pathlib import Path
import imageio
import tifffile
from qtpy import QtWidgets, QtCore, QtGui
from saenopy.gui import QtShortCuts
from saenopy.gui.stack_selector_leica import StackSelectorLeica
class StackSelectorTif(QtWidgets.QWidget):
loa... |
#!/usr/bin/env python3
'''
* Copyright 2020 <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 applicab... |
"""
Periodically checks Twitter for tweets about arxiv papers we recognize
and logs the tweets into mongodb database "arxiv", under "tweets" collection.
"""
import logging
import os
import re
from collections import defaultdict
import pytz
import time
import math
import pickle
import datetime
from dateutil import par... |
import sys
import time
import datetime
import logging
from sqlalchemy.exc import IntegrityError
import Utils.configuration_file_service as config_service
import Utils.DB_utils as dbUtil
import pandas as pd
import tushare as ts
from sqlalchemy import Column, String, Float, MetaData, Table, create_engine, INT
token =... |
##this is the special case of checking the transverse bases
from Scripts.BEseqType import *
from Bio.Seq import Seq
from Scripts.baseEditorsTable import CBElist, CBElistMinor, ABElist, ABElistMinor, BEletter
#from Scripts.BEMain import cutFromRF,getRevComp
def printPamSeq(seq5,activationWindow,seq3, locfromEnd,P... |
import pandas as pd
import numpy as np
import json
import gzip
import requests
import os
import collections
from darwinian_shift.utils.util_functions import get_uniprot_acc_from_transcript_id
from .errors import MetricLookupException
class PDBeKBLookupError(MetricLookupException): pass
class PDBeKBLookup:
"""
... |
# Copyright 2018 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... |
import torch, os
import numpy as np
from prettytable import PrettyTable
from itertools import combinations
from utils.cardlib import hand_rank,encode
from collections import OrderedDict
def count_parameters(model):
table = PrettyTable(["Modules", "Parameters"])
total_params = 0
for name, parameter in model... |
# -*- coding: utf8 -*-
#
# 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... |
# Copyright 2015 <EMAIL>
# Copyright 2016-2017 FUJITSU 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 appli... |
class TextPos:
def __init__(self, offset, col, line):
assert offset >= -1
self.offset = offset
self.col = col
self.line = line
def new_line(self):
return self.__class__((self.offset + 1) if self.offset >= 0 else -1, 0, self.line + 1)
@classmethod
def from_source... |
import os,sys
import argparse
import torch
from argparse import Namespace
import numpy as np
import random
def interpret_args():
""" Interprets the command line arguments, and returns a dictionary. """
arg_parser = argparse.ArgumentParser()
arg_parser.add_argument('--seed', default=1234, type=int, help='r... |
# -*- coding: utf-8 -*-
"""
Automatic port-to-port routing functions.
"""
import math
import numpy as np
from samplemaker.devices import DevicePort
import samplemaker.makers as sm
from copy import deepcopy
# The following are routines for the connector
def __connectable_facing(port1: "DevicePort",port2: "DevicePort... |
from Modules import PIGCSDLL
import ctypes
import time
import numpy
import serial
class PIPiezo:
piezo = ctypes.windll.LoadLibrary("Libraries/PI_GCS2_DLL_x64.dll")
connected_flag = ctypes.c_bool(False)
moving_flag = ctypes.c_bool(False)
position = ctypes.c_double(0)
position_targeted = ctypes.c_do... |
import fileinput
import json
import copy
from random import randint
from fractions import Fraction
from src.parse import parse_html, format_recipe
from src.lib.debug import test_random_recipe
from src.transform import to_cuisine, to_healthy, to_non_healthy, to_non_vegetarian, to_vegetarian, cooking_method, to_halal, to... |
import logging
import string
from collections import Counter
from typing import Dict, List, Any
import numpy as np
import pandas as pd
import torch
from transfer_nlp.common.tokenizers import CustomTokenizer
from transfer_nlp.embeddings.embeddings import Embedding
from transfer_nlp.loaders.loaders import DatasetSplits... |
# package imports
import dash
import dash_table
import dash_bootstrap_components as dbc
import dash_html_components as html
import dash_core_components as dcc
from dash.dependencies import Input, Output, State
from dash import no_update
from flask import session, copy_current_request_context
import shortuuid
import num... |
# -*- coding: utf-8 -*- #
# Copyright 2017 Google LLC. 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 requir... |
#!/usr/bin/env python
from __future__ import print_function
from waflib.Configure import conf
from rutabaga_css import RutabagaStylesheet
from rutabaga_css.asset import *
from targa import *
def matches_extension(ext):
from os.path import splitext
return lambda i: splitext(i.name)[1] == ext
def do_css2c(t... |
import cuda_kernels
import math
from numba import cuda
import numpy as np
import time
from utility_functions import blockPrint, enablePrint, print_progress
# From Release script
def AveragesOnShellsUsingLogicBCuda(inc, retofRR, retofRI, n1ofR, n2ofR, kXofR, kYofR, kZofR,
NumAtEachR... |
#-*- coding: utf-8 -*-
import sys
import os
import argparse
import traceback
import re
import io
import json
import yaml
import time
import logging
from tqdm import tqdm
import numpy as np
from collections import namedtuple
import pgl
from pgl.utils import paddle_helper
from pgl.graph_wrapper import BatchGraphWrapper... |
import os
import re
import yaml
import pytz
package_components = __package__.split('.')
package_components.pop()
job_func_root = '.'.join(package_components)
def apply_job_templates(jobs, templates):
for job_name, credentials in jobs.items():
if 'use_template' in credentials.keys():
templa... |
import time # for timing
from math import sqrt, tan, sin, cos, pi, ceil, floor, acos, atan, asin, degrees, radians, log, atan2, acos, asin
from random import *
from numpy import *
from pymclevel import alphaMaterials, MCSchematic, MCLevel, BoundingBox, TAG_String, TileEntity
from mcplatform import *
from tracery_settle... |
import os
import numpy as np
import pandas as pd
import torch
import pickle
import random
random.seed(41)
'''
This code is used to generate the data and labels for the 1st experiment of the IMS bearing Dataset:
https://ti.arc.nasa.gov/tech/dash/groups/pcoe/prognostic-data-repository/#turbofan
See below for label inf... |
# -*- coding: utf-8 -*-
import numpy as np
import matplotlib.pyplot as plt
import os
import csv
import tifffile
import imageio
import skimage.measure
from matplotlib import animation
#%%
def load_nidaq(path, chans=10):
'''Loads nidaq file, reshapes it and creates a dictionary with labels for each channel'''
nid... |
import csv
import json
import os
import sys
import time
import numpy as np
import pandas as pd
# Python script do two major functions:
# 1) Filter/prune huge raw IMDb *.tsv files into a smaller logical subset
# of *.csv files for a Movies-to-Actor/Actress graph.
# Movies since 1980, 100-minutes or longer, acto... |
#!/usr/bin/env python
# vim: set ts=4 sw=4 et:
import time
import cv2
import numpy
import rospy
from cv_bridge import CvBridge
import geometry_msgs.msg
import sensor_msgs.msg
from lander.drivers.camera import OpenCVCamera, SimulatedCamera
from lander.lib.kalman import KalmanFilter
from lander.msg import TrackStamp... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
|============================================================================
| DXC100: definition of various classes
| (c) <NAME> 2018
|============================================================================
"""
import re, sys
import dxc100_config as C
import so... |
# Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditio... |
#!/usr/bin/env python3
from argparse import ArgumentParser
from collections import OrderedDict
import json
import os
import shutil
import subprocess
import sys
from tempfile import NamedTemporaryFile
from jinja2 import Environment, FileSystemLoader, BaseLoader
import yaml
__version__ = '1.1.1'
sys.tracebacklimit = ... |
# Taken from https://gitlab.univ-nantes.fr/Master-Projects/TP-MLP/blob/61f03976f0ee2b8efb888d8d59ef7aed14c411f2/convertInkmlToImg.py
import sys
import os
import xml.etree.ElementTree as ET
import numpy as np
from skimage.io import imsave
from skimage.draw import line
import scipy.ndimage as ndimage
import warnings
wa... |
import os
import requests as rq
import dotenv as dv
import discord
from discord.ext import commands
from discord_slash.utils.manage_commands import create_option
from discord_slash import SlashCommand, SlashContext
global log_id
global pasted_logs
async def extract_content(content):
"""Extract conte... |
from archive.fastai import *
from archive.fastai import SaveModelCallback
import os
from contribs.fancy_optimizers import Over9000
from contribs.mish_activation import Mish
from sklearn.model_selection import StratifiedKFold
sz = 128
bs = 32
nfolds = 4
SEED = 2020
N = 12 #number of tiles per image
TRAIN = 'D:/Datasets... |
import os
import numpy as np
import requests
import tarfile
import zipfile
import shutil
from kgcnn.utils.adj import get_angle_indices, coordinates_to_distancematrix, invert_distance, \
define_adjacency_from_distance, sort_edge_indices, get_angle
class MemoryGraphDataset:
fits_in_memory = True
dataset_na... |
import logging
import glob
import os
import os.path
import sys
import re
import subprocess
import datetime
import imp
import warnings
import traceback
import importlib
import inspect
import sqlparse
import click
log = logging.getLogger('mschematool')
DEFAULT_CONFIG_MODULE_NAME = 'mschematool_config'
# Ignore warn... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
This module contains a generalized implementation of the NSRPS algorithm, from
here on referred to as the NSRWS: Non-Sequential Recursive Window Subsitution.
Given an input sequence of integer values, as a list/tuple, it returns this
sequence with the most frequently ... |
import os
from scaleout.config.config import load_config as load_conf, get_default_config_file_path
from scaleout.runtime.runtime import Runtime
from scaleout.auth import get_bearer_token
from scaleout.errors import AuthenticationError
import requests
import json
import pickle
from slugify import slugify
import uuid... |
# -*- coding: utf-8 -*-
import pandas as pd
import numpy as np
import scipy.stats as stats
from datetime import datetime, timedelta
import math
import os
import logging
from pathlib import Path
import ast
class ut1000():
'''
Class dedicated to processing ut1000 data only
'''
def __init__(self):
... |
from werkzeug.serving import run_simple
from flask import Flask, request
import json
import time
from argparse import ArgumentParser
from collections import OrderedDict
import torch
import torch.nn.functional as F
from model import BertModel
from data_utils.tokenization import BertWordPieceTokenizer
from model.gpt_... |
# -*- coding: utf-8 -*-
"""Tests for the somatic_variant_calling workflow module code"""
import textwrap
import pytest
import ruamel.yaml as yaml
from snakemake.io import Wildcards
from snappy_pipeline.workflows.somatic_variant_calling import SomaticVariantCallingWorkflow
from .common import get_expected_log_files_... |
from math import pi
import rospy
from roboclaw_driver.msg import SpeedCommand
from odometry_helpers import (
create_odometry_message, calc_world_frame_pose, calc_world_frame_velocity
)
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Below are used by the BaseNode directly
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~... |
""" gather functions necessary to build an index """
import re
from typing import Optional, Tuple, Union
import faiss
from autofaiss.external.metadata import IndexMetadata
from autofaiss.datasets.readers.local_iterators import read_embeddings_local, read_shapes_local
from autofaiss.datasets.readers.remote_iterators i... |
# -*- coding: utf-8 -*-
import time
import os
import uuid
import subprocess
import sys
from KBaseReport.KBaseReportClient import KBaseReport
from kb_Msuite.Utils.DataStagingUtils import DataStagingUtils
from kb_Msuite.Utils.OutputBuilder import OutputBuilder
def log(message, prefix_newline=False):
"""Logging fu... |
# -*- coding: utf-8 -*-
from argparse import ArgumentParser
import sys
import torch
import random
from preprocessing import load_word_vocab_from_relation_vectors, load_embeddings_filtered_byvocab, load_training_data, split_training_data
#RWE model
class RWE_Model(torch.nn.Module):
def __init__(self, embedding_size... |
#!/usr/bin/env python3
"""Run the gear: set up for and call command-line command."""
import json
import logging
import os
import shutil
import sys
from pathlib import Path
import flywheel_gear_toolkit
from flywheel_gear_toolkit.interfaces.command_line import (
build_command_list,
exec_command,
)
from flywheel... |
import numpy as np
import random
class BasicSoftWeightUpdater:
"""
A basic, default behavior for applying soft target weight updates.
"""
@staticmethod
def update_target_weights(weights_model, weights_target, tau):
"""
Updates soft target weights.
:param weights_model... |
#Builtin imports
import logging
import json
import core
import uuid
import time
import base64
try:
import queue as Queue
except ImportError:
import Queue
import datetime
import string
valid_chars = set(string.ascii_letters+string.digits+'{}|~^<>!#$%()+,-.@_[] ')
log = logging.getLogger()
log.debug("Valid SQL... |
import h5py
import pde_superresolution.utils
import pde_superresolution as pde
import json
import numpy as np
import tensorflow as tf
import enum
assert tf.__version__[:2] == '1.'
from matplotlib import pyplot as plt
import xarray
import seaborn
from pde_superresolution import model
from pde_superresolution.model impor... |
#!/usr/bin/python
# get from https://wiki.mikrotik.com/wiki/Manual:API
import binascii
import hashlib
import select
import socket
import sys
class ApiRos(object):
"""
Routeros API
"""
sock = ''
def __init__(self, host='', port=8728, user='', password='', debug=True):
"""
Initiali... |
"""
Contains the all visualizations related to runhistory dataframes supported by the package. Currently available
visualizations are:
't-sne': Generates 2-D embeddings of all high-dimensional data in the concerned set using the same embedding space,
then plots a comparison of the embeddings of the individual datasets... |
import os
import grpc
import time
import copy
from concurrent import futures
from service.moleprop import MoleProp
from dglt.utils import create_logger
from mpp_service import get_available_tasks
from service.grpc_util.proto import message_pb2, message_pb2_grpc
from multiprocessing import Pool, Process, Queue
#from tor... |
# -*- coding: utf-8 -*-
# Copyright (c) 2018, Libermatic and Contributors
# See license.txt
from __future__ import unicode_literals
import frappe
import unittest
from gwi_customization.microfinance.doctype.microfinance_loan.\
test_microfinance_loan import create_test_loan, remove_test_loan
from gwi_customization.m... |
from django.contrib import admin
from elegislative_app import models
from import_export.admin import ImportExportModelAdmin
from django.contrib.auth.admin import UserAdmin
from django import forms
admin.site.site_header = 'e-Legislative Super Administrator'
admin.site.index_title = 'Super Administrator Page'
admin.... |
import sys
sys.path.insert(0, './')
try:
import wandb
except:
pass
from rlf.exp_mgr import config_mgr
from rlf.rl.utils import CacheHelper
import yaml
import argparse
from collections import defaultdict
import pickle
import os
import os.path as osp
import pandas as pd
import hashlib
import json
def get_arg_p... |
# Copyright 2013-2021 The Salish Sea MEOPAR Contributors
# and The University of British Columbia
# 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... |
import datetime, pytz
import math
from skyfield.api import load
from ..apps.astro.altaz import get_obliquity
from ..apps.astro.time import get_julian_date, estimate_delta_t
def _cosd(d):
return math.cos(math.radians(d))
def _sind(d):
return math.sin(math.radians(d))
def _tand(d):
return math.tan(math.radia... |
from PROJECT_SETUP import ROJECT_ROOT_DIR
from nnreg.config import Config
from nnreg.dataloader import DataLoader
from nnreg.trainer import Trainer
from nnreg.analysis_fun import get_results_where, param_search, train_save_configs, plot_lr_tran_val,unpack, show_heatmap, get_min_value
from RegLib.load_save_data import... |
"""
A python library and CLI tool for the LanguageTool JSON API.
"""
import os
import sys
from pprint import pprint
import configargparse
import pkg_resources
from colorama import Fore, init as init_colors
from . import CustomConfigFileParser
from . import api
from . import converters
indention = " " * 4
def init_... |
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
from django.shortcuts import render, redirect,reverse
from django.contrib.auth.decorators import login_required
from django.contrib.auth import authenticate, login
from django.views import generic
from django.views.generic import View
from django.contrib.auth.models import User
from django.http import HttpResponse
from... |
###############################################################################
# Template manager
#
# template_manager.py
# Written by <NAME>
# April 16 2014
#
# Manges installed license templates and imports new ones.
###############################################################################
import files
import ... |
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from IPython.display import display, HTML
import torch
import torch.nn as nn
import torch.nn.functional as F
def train(n_epochs, loaders, model, optimizer, criterion, save_path='model', device=None, plot=True,
... |
import json
import logging
import numpy as np
import os
import pandas as pd
import pycountry
import pycountry_convert as pc
import yaml
from collections import namedtuple
from jmetal.core.observer import Observer
from jmetal.core.solution import BinarySolution
from jmetal.util.comparator import DominanceComparator
fro... |
"""Tools for model evaluation."""
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.axes_grid1 import make_axes_locatable
import itertools
from ssd_utils import iou
eps = 1e-10
def evaluate_results(ground_truth, detection_results, gt_util, iou_thresh=0.5, max_dets=None, figsize=(10,10), return_... |
'''
Original code for @maesoser in GitHub, a problem with importing StringIO libraries has been fixed. This is the full version of the code. The --output parameter prepares the code obtained from the RPC interface to an importable .txt file in node_exporter and Prometheus.
'''
from xml.etree import ElementTree
from io ... |
import csv
import os
import json
import sqlite3
import logging
from datetime import datetime
recordLen = 11
TABLE_IGNORE = "wechat_ignore_table"
"""
交易时间 0
交易类型 1
交易对方 2
商品 3
收/支 4
金额(元) 5
支付方式 6
当前状态 7
交易单号 8
商户单号 9
备注 10
"""
Wechat = 'Wechat'
class IgnoreSet:
def __init__(self, db_path) -> None:
con... |
from dataclasses import dataclass
import datetime
import sys
from time import sleep
from threading import Thread
import subprocess
import pyautogui as pag
import config as cfg
@dataclass
class Part:
suffix: str
offset: float
rot_x: int
rot_y: int
eqr_x: int
eqr_y: int
angle: int = cfg.NOCHANGE
PARTS = [Part(*a... |
#########
# Copyright (c) 2013 GigaSpaces Technologies Ltd. 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/python
# -*- coding: utf-8 -*-
"""
Parsing accident CSV files for Great Britain data and putting them into DB
"""
import csv
import sys
import db_api.accident
from parsing.common import get_timestamp, translate_field, to_float, to_int, map_from_dictionary, mph_to_kmph
from parsing.gb_common import get_acc_... |
# coding: utf-8
# In[56]:
# <NAME> (5781401)
#invite people for the Kaggle party
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
import numpy as np
from scipy.stats import norm
from sklearn.preprocessing import StandardScaler
from scipy import stats
import warnings
warnings.filterwarnings(... |
import cv2
import torch.hub
import os
import model
from PIL import Image
from torchvision import transforms
from grad_cam import BackPropagation
import time
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
import threading
import vlc
from os.path import dirname, join
from twilio.rest import Client
impo... |
#! /usr/bin/python
# Written By <NAME>, @tompaulus, www.tompaulus.com
from __future__ import print_function
from __future__ import print_function
from __future__ import unicode_literals
import getopt
import json
import logging
import os
import smtplib
import sys
from email.mime.multipart import MIMEMultipart
from emai... |
import json
import os
import math
import keras
from neuralparticles.tools.data_helpers import extract_particles, get_positions, get_data, get_nearest_idx
from neuralparticles.tools.particle_grid import ParticleIdxGrid
from neuralparticles.tools.uniio import readNumpyRaw
from neuralparticles.tools.data_augmentation i... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Author : <NAME> (<EMAIL>)
import os
import numpy as np
from fastapi import FastAPI
from predictor import main
from storages import DIC_ZODB, milvusDB
app = FastAPI()
collection_cosine = 'dependency'
partition_tags_cosine = '202103'
collection_words = 'words'
partit... |
from __future__ import annotations
from collections import namedtuple
import inspect
import torch
import torch.nn as nn
from typing import Type, Tuple, Dict, List
FuncToApply = namedtuple("FuncToApply", ["fn", "hidden_apply"])
class LazyModule(nn.Module):
"""LazyModule offers a simple mechanism to create PyTorc... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
author: <NAME>
Module to support GUI interaction on the pages of loudspeaker and array
configuration.
"""
import numpy as np
import base64
from PALC_functions import calc_progressive_array, calc_arc_array, repmat
from sfp_functions import get_freq_vec
def ref_arra... |
#Copyright (C) 2013, <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, sublicen... |
import numpy as np
import scipy.io as sio
import argparse
from camera import Camera
from plotting import *
# A very simple, but useful method to take the difference between the
# first and second element (usually for 2D vectors)
def diff(x):
return x[1] - x[0]
'''
FORM_INITIAL_VOXELS create a basic grid of vox... |
from __future__ import annotations
import typing
from typing_extensions import TypedDict
from . import block_crud
from . import block_normalize
from ctc import spec
if typing.TYPE_CHECKING:
class BlockGasStats(TypedDict):
base_fee: int | float | None
min_gas_price: int | float | None
med... |
import pytest
from datetime import datetime
from bson import ObjectId
from pymongo import IndexModel, ASCENDING, WriteConcern
from aioodm import Document
from aioodm.document import Meta
from aioodm.errors import DocumentNotFoundError, ValidationError
from aioodm.fields import StrField, ObjectIdField, SynonymField, I... |
import keyword
from collections import defaultdict
from typing import List, Dict, Any, Optional, DefaultDict
import attr
import java.lang.reflect.Modifier
from basic_type import BasicType
from helper import ClassDoc, OverloadSetDoc, MethodDoc
def is_nested_class(parent, child):
# type: (type, type) -> bool
... |
"""
Provides utilities responsible for locking/releasing array writeability.
"""
import os
from collections import Counter, defaultdict
from typing import TYPE_CHECKING, DefaultDict, Dict, Generator, Iterable
from weakref import finalize, ref
import numpy as np
from mygrad._utils import ContextTracker, WeakRefIterabl... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# uTorrent cleanup script.
# Moves downloads to the proper dir, based on their label.
# Useful after assigning new labels to torrents.
#
# ** SHUT DOWN uTorrent BEFORE RUNNING **
#
# Original on: https://github.com/m000/cliutils
#
from __future__ import print_function
im... |
# -*- coding: utf-8 -*-
"""
chemdataextractor.doc.document
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Document model.
:copyright: Copyright 2016 by <NAME>.
:license: MIT, see LICENSE file for more details.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __fut... |
# Copyright (c) 2018, MD2K Center of Excellence
# All rights reserved.
# author: <NAME>
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice, this
# l... |
from ask_sdk_core.skill_builder import SkillBuilder
from ask_sdk.standard import StandardSkillBuilder
from ask_sdk_core.utils import is_request_type, is_intent_name
from ask_sdk_model.dialog.delegate_directive import DelegateDirective
import random
import re
import os
#################
# Set Up Logger #
###############... |
import datetime
import json
import logging
import multiprocessing
from pathlib import Path
import time
import flask
import pandas as pd
import werkzeug
from topicsexplorer import database
from topicsexplorer import utils
from topicsexplorer import workflow
# Initialize logging with logfile in tempdir:
utils.init_lo... |
__all__ = ["Glad"]
import sys
import time
import random
import string
import logging
import logging.config
import pathlib
import tempfile
import itertools
from dataclasses import dataclass, field
from typing import Union, Sequence, Tuple, Optional
import yaap
import utils
from datasets import Dialog... |
"""
Simple calculator
"""
import toga
from toga.style import Pack
from toga.style.pack import COLUMN, ROW
### we're hard-coding for GTK/GDK right now
from gi.repository import Gdk
# Keycodes to show the "alternate" buttons
SHOW_ALT = {
Gdk.KEY_Control_L,
Gdk.KEY_Control_R,
}
# Special characters for disp... |
# -*- coding:utf8 -*-
# !/usr/bin/env python
# Copyright 2017 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... |
#! /usr/bin/env python3
import math
import numpy
from pandas.tseries.offsets import MonthEnd
import matplotlib.pyplot as plt
import matplotlib.dates as mdates
import pandas as pd
from datetime import date
colours = ['#5DADE2', # blue
'#F5B041', # orange
'#58D68D', # green
'#EC7063'... |
# Shared imports
import cv2 as cv
import mimetypes
from os import path
from face_attributes import AttrObj, AttrDict, Emotion, Age, ATTRIBUTES, ATTR_EMOTION, ATTR_AGE, ATTR_SMILE
# Imports for the Microsoft Emotion libs and dependencies
import requests
import json
TYPE_VIDEO = "video"
TYPE_IMAGE = "image"
... |
import numpy as np
import tensorflow as tf
import matplotlib
import os
from scipy import sparse
from numpy import genfromtxt
import time
import shutil
matplotlib.use('Agg')
import matplotlib.pyplot as plt
def get_data(tissue_id, folder, dataset):
#Load dataset
X_train_seq = np.load('../' + folder + '/input' +... |
#!/usr/bin/env python
#
# Initial code from does_it_live.py...
# Version 1.0 2018-10-15
# Written by:
# <NAME>, <EMAIL>
# https://github.com/alexisdacquay/does_it_live
# validate_filter_ip.py 1.0 2020-06-30 by <NAME>, <EMAIL>
import argparse
import logging
import os
import platform
import ... |
"""
Terminology
original_view: the view in the regular editor, without it's own window
markdown_view: the markdown view, in the special window
preview_view: the preview view, in the special window
original_window: the regular window
preview_window: the window with the markdown file and the preview
"""
import os.path
... |
import os
from PySide2.QtCore import QModelIndex, Qt
from PySide2.QtGui import QIcon, QColor
from PySide2.QtWidgets import QAction, QToolBar, QWidget, QTreeView, QLabel
from nexus_constructor.component.component import Component
from nexus_constructor.component.link_transformation import LinkTransformation
from nexus... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.