text stringlengths 6.04k 39.5k |
|---|
from collections import OrderedDict as odict
from lxml import etree
import numpy as np
def str2bool(str):
if str.lower() in ('true', 't', 'y', 'yes', '1'):
return True
return False
def parset_element_is_array(text):
if text.count('\n')>1:
return True
return False
def parset_element_g... |
import matplotlib.pyplot as plt
import numpy as np
import os
import subprocess
from matplotlib import gridspec, rcParams
# If you installed ffmpeg using conda or installed both softwares in
# standard ways on your computer, no changes should be required.
_FFMPEG_BINARY = 'ffmpeg'
_MAGICK_BINARY = 'magick'
rcParams["l... |
#! /usr/bin/env python
import util
import time
import cv2
import numpy as np
import math
from operator import itemgetter
RUNNING = True
GAME_BEGIN = 0
GAME_RUNNING = 1
GAME_END = 2
GAME_STOP = 3
GAME_STATE = GAME_BEGIN
STARTSIGNALSEND = False
XMIN = 25.5
XMAX = 928
XMIDDLE = (XMAX-XMIN)/2
YMIN = 28.5
YMAX = 514.5
SH... |
# -*- coding: utf-8 -*-
# Copyright (c) 2021, <NAME> and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.model.document import Document
from frappe.model.mapper import get_mapped_doc
from one_fm.hiring.doctype.candida... |
import os
import math
import bpy
import mathutils
from ...skl import imp as skl_imp
from ... import xray_io, xray_motions, log, utils
from ...version_utils import (
is_all_empty_textures, IS_28, link_object, set_active_object
)
from .. import fmt
from . import bone, mesh
def _is_compatible_texture(texture, file... |
#######################################################################################
#######################################################################################
## Code initiated by <NAME>, MD, PhD #########################################
## Professor Emeritus, Northwestern University Feinberg School ... |
# Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
"""\
Test that Spack's shebang filtering works correctly.
"""
import filecmp
import os
import shutil
import stat
import sy... |
#print("Initializing NEW 3-head model")
import sys
from pyprojroot import here
proj_path = here()
#these next three lines are to important important TSM module functionality
sys.path.append(str(proj_path / "MULTITASK_FILES/TSM_FILES/temporal-shift-module/"))
from ops.basic_ops import ConsensusModule
from ops.transform... |
import lcms
import pandas as pd
import matplotlib
matplotlib.use("agg")
import matplotlib.pyplot as plt
import seaborn as sns
import numpy as np
import os
import matplotlib as mpl
mpl.rcParams['pdf.fonttype'] = 42
import pickle
import scipy
from scipy.special import erf
from scipy.optimize import curve_fit
from scipy.s... |
#====================== BEGIN GPL LICENSE BLOCK ======================
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later vers... |
# 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, ... |
import asyncio
import inspect
import itertools
import re
import time
import warnings
import aiomysql
from sqlalchemy import util, exc
from sqlalchemy.dialects.mysql import JSON, ENUM
from sqlalchemy.dialects.mysql.base import (
MySQLCompiler,
MySQLDialect,
MySQLExecutionContext,
)
from sqlalchemy.sql impor... |
# NCC: Neural Code Comprehension
# https://github.com/spcl/ncc
# Copyright 2018 ETH Zurich
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
# following conditions are met:
# 1. Redistributions of source code must retain the above... |
"""Comparison module"""
from __future__ import annotations
__all__ = [
# Enums
'Writer', 'PictureType',
# Dicts
'SlowPicsConf',
# Class and function
'Comparison', 'make_comps'
]
import inspect
import os
import random
import subprocess
from enum import Enum, auto
from functools import partia... |
import stripe
import json
import os
from flask import Flask, render_template, jsonify, request, send_from_directory, url_for, redirect, abort
from dotenv import load_dotenv, find_dotenv
from app.payment import bp
from app.payment.forms import UsSaleForm
from app.models import Sale, Domain
import pdfrw
import dropbox
im... |
import logging
from collections import defaultdict
from dataclasses import dataclass, field
from typing import (
TYPE_CHECKING,
Any,
Callable,
DefaultDict,
Dict,
List,
Literal,
NamedTuple,
Optional,
Set,
Tuple,
Type,
overload,
)
from rotkehlchen.accounting.types impo... |
import sys
from time import sleep
import pandas as pd
#from market_maker import _settings_base
from market_maker.order import net_order
from market_maker.order.buy_thread import BuyThread
from market_maker.order.order_thread import OrderThread
from market_maker.order.sell_thread import SellThread
from market_maker.plo... |
# -*- coding: utf-8 -*-
"""
Created on Thu Jan 17 23:39:48 2019
@author: YQ
"""
import tensorflow as tf
import numpy as np
import config
init = tf.truncated_normal_initializer
act = tf.nn.relu
def conv2d(x, output_dim, k_size=5, stride=2, stddev=0.02, name="conv2d"):
conv = tf.layers.conv2d(x, output_dim, kerne... |
import asyncio
import httpx
from httpx_socks import SyncProxyTransport
import ssl
import gzip
import time
import datetime
import re
import sys
import os
import traceback
from threading import Thread
import proxy_modules.utils
import proxy_modules.backbone
import proxy_modules.logging
import proxy... |
"""
mathmethods.py - mathematical methods in physics
"""
import autograd.numpy as anp
import numpy as np
from qoc.standard.functions.convenience import (commutator, conjugate_transpose,
matmuls,
rms_norm,)
### INTERPOLATI... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import cv2
import numpy as np
import tensorflow as tf
import matplotlib.pyplot as plt
import functools
import base64
from core import utils
BLACK = (0, 0, 0)
WHITE = (255, 255, 255)
RED = (255, 0, 0)
GREEN = ... |
import os
import time
import re
import pandas as pd
import numpy as np
from numpy import hstack
import matplotlib
import matplotlib.pyplot as plt
from sklearn.linear_model import LogisticRegression, SGDClassifier
from sklearn.neighbors import KNeighborsClassifier
from sklearn.tree import DecisionTreeClassifier
from sk... |
#!/usr/bin/python
# Author: <NAME>
# changes added by <NAME>
import os
# import sys
import codecs
import re
from collections import OrderedDict
class Node():
def __init__(self, text):
self.text = text
self.lex = None
self.type = None
self.__attributes = OrderedDict... |
'''
IKI Bangladesh (MIOASI): Data processing functions
Data processing functions relating to the IKI Bangladesh project.
Note: Python 3 compatible only
Author: HS
Created: 7/3/19
'''
import datetime
import math
import iris
import pandas as pd
import re
import time
import numpy as np
import netCDF4 as nc
import iris.... |
import os
import csv
import json
import logging
import argparse
import requests
from requests.auth import HTTPBasicAuth
import aiohttp
import asyncio
import async_timeout
import tqdm
import osm_api
# ex https://towardsdatascience.com/fast-and-async-in-python-accelerate-your-requests-using-asyncio-... |
"""plotting_tools.py module."""
import os
import sys
import time as t
import numpy as np
from matplotlib import pyplot as plt
from matplotlib import gridspec
from spinor_gpe.pspinor import tensor_tools as ttools
def next_available_path(file_name, trial_name, ext=''):
"""
Test for the next available path for... |
'''Model for holding TF parts. etc.'''
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
import tensorflow as tf
from multiG import multiG
import pickle
from utils import circular_correlation, np_ccorr
# Orthogonal Initializer from
# http... |
#!/usr/bin/env python
# Copyright (c) 2018 Orange and others.
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
"""Ease dep... |
import Queue
import collections
import copy
import multiprocessing
import os
import socket
import threading
import time
import traceback
from threading import Thread
import logging
import jsonpickle
import psutil
from colorker.comm import messaging
from colorker.core import EngineProcess
from colorker.core import Tar... |
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
import numpy as np
from tqdm import tqdm, tqdm_notebook
from sklearn.model_selection import train_test_split, KFold, StratifiedKFold
from sklearn.preprocessing import OneHotEncoder, LabelEncoder
from sklearn.impute import SimpleImputer
im... |
"""
@author: <NAME>
This file is the Fourier Neural Operator for 1D problem such as the (time-independent) Burgers equation discussed in Section 5.1 in the [paper](https://arxiv.org/pdf/2010.08895.pdf).
"""
import logging
import os
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
#... |
#! /usr/bin/env python3
import socket
import json
import math
import os
import datetime
import sys
import signal
import asyncio
import time
import matplotlib.pyplot as plt
HOST = '192.168.2.15' # The remote host
PORT = 51234 # The same port as used by the server
bitrate_table = {
'240p' : 4000... |
# coding: utf-8
# 2022/3/18 @ ouyangjie
import logging
import torch
import torch.nn as nn
import torch.nn.functional as F
import numpy as np
import math
from sklearn import metrics
from tqdm import tqdm
from EduKTM import KTM
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
class Cell(nn.Modu... |
from __future__ import print_function
import numpy as np
import math
from onnx import ModelProto, GraphProto, NodeProto, TensorProto
from onnx import optimizer, helper, numpy_helper, shape_inference
from hls4ml.writer.vivado_writer import write_hls
from hls4ml.model import HLSModel
from hls4ml.model.optimizer import o... |
import os
import sys
import random
import argparse
import datetime
import numpy as np
import tensorflow as tf
from time import time
from models import VAENAR
from audio import TestUtils
from datasets import TFRecordWriter
from configs import LJHPS, DataBakerHPS, Logger
def set_seeds(seed):
os.e... |
#!/usr/bin/env python
'''
Filename: filter_utilities
Description: functions involving smoothing of data.
'''
from __future__ import (
absolute_import, division, print_function, unicode_literals)
import six
from six.moves import zip
__authors__ = '<NAME> and <NAME>'
__email__ = '<EMAIL>'
__status__ = 'prototype... |
"""
Transformer model is adapted from: https://github.com/graykode/gpt-2-Pytorch
(Commit: 46ae886391a94c6683be438269252c4afd5ba762)
Original Paper and repository here: https://github.com/openai/gpt-2
RNN implementation is adapted from: https://github.com/pytorch/examples/tree/master/word_language_m... |
# -*- coding: utf-8 -*-
"""
The "aggregator" module containes the main Aggregator class which receives the collected data from agents
and aggregate them all into a comprehensive and meaningful data to be stored in database or used as a query
data for the Provenance API
<NAME> (<EMAIL>)
"""
from scheduler ... |
'''
Created on Sep 2, 2012
@author: Luke
'''
from reader.language_tools import Greek
from reader.models import Lemma, Case, WordForm, WordDescription, Dialect
from reader.importer.LineImporter import LineImporter
import re
import logging
from time import time
from django.db import transaction
logger = ... |
from zkay.type_check.contains_private import contains_private
from zkay.type_check.final_checker import check_final
from zkay.type_check.type_exceptions import TypeMismatchException, TypeException
from zkay.zkay_ast.ast import IdentifierExpr, ReturnStatement, IfStatement, AnnotatedTypeName, Expression, TypeName, \
... |
#!/usr/bin/python
from __future__ import division # Python 2 users only
from __future__ import print_function
__doc__= """
Module for building a parametric tSNE model.
Trains a neural network on input data.
One can then transform other data based on this model
Main reference:
<NAME>, L. (2009). Learning a paramet... |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
"""
Functions to create the connection table in view to enforce symmetry in the
topological optimization
<NAME> EPFL 2018
"""
# System libs
import os
import json
import argparse
import importlib
import sys
# Third party libs
import numpy as np
import scipy.misc
import sc... |
# -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making BK-BASE 蓝鲸基础平台 available.
Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
BK-BASE 蓝鲸基础平台 is licensed under the MIT License.
License for BK-BASE 蓝鲸基础平台:
------------------------------------------... |
# Copyright (c) 2008-2015 MetPy Developers.
# Distributed under the terms of the BSD 3-Clause License.
# SPDX-License-Identifier: BSD-3-Clause
"""Test the `thermo` module."""
import numpy as np
import pytest
from metpy.calc import (density, dewpoint, dewpoint_rh, dry_lapse, el,
equivalent_pote... |
from __future__ import print_function
import os
import argparse
import torch
import torch.nn as nn
import torch.optim as optim
from torch.optim.lr_scheduler import CosineAnnealingLR
from util.data_util import ModelNet40
from model.GDANet_cls import GDANET
import numpy as np
from torch.utils.data import DataLoader
from ... |
#!/usr/bin/env python
# coding=utf-8
# Copyright 2021 The HuggingFace Inc. team. 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/LI... |
import json
import sys
import numpy as np
import random
import tqdm
from collections import namedtuple
import torch
import torch.nn as nn
from torch.autograd import Variable
import torch.nn.functional as F
import torch.distributions as D
from utils import vocab_pad_idx, vocab_bos_idx, vocab_eos_idx, flatten, try_cuda... |
# coding: utf-8
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import time
import numpy as np
import tensorflow as tf
import evalu
import lrs
import model
import bert
from data import Dataset
from tasks import get_task
from utils import parallel... |
"""
This file implements the ADR SVM Classifier
Package: adr_svm_classifier
Author: <NAME>
Credits Declaimer: this file uses code snippets from few public sites, the credits are given in each place where used below.
"""
import adrmine_data_loader
import argparse
import re
from nltk.tokenize import word_tokenize
fr... |
# coding=utf-8
# Copyright 2020 The Edward2 Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... |
# -*- coding: utf-8 -*-
#########################################################################
# This file is derived from Curious AI/mean-teacher, under the Creative Commons Attribution-NonCommercial
# Copyright <NAME>, <NAME>, <NAME>, <NAME>, 2019, v1.0
# This software is distributed under the terms of the License... |
# coding: utf-8
import os
import sys
sys.path.insert(1, os.path.join(sys.path[0], '../'))
import numpy as np
import h5py
import argparse
import time
import logging
from sklearn import metrics
from utils import utilities, data_generator, agument
import tensorflow as tf
slim = tf.contrib.slim
import pandas as pd
impor... |
# Copyright (C) 2021 <NAME> and <NAME>
#
# SPDX-License-Identifier: MIT
import argparse
import os
import gmsh
import numpy as np
from mpi4py import MPI
try:
import meshio
except ImportError:
print("Meshio and h5py must be installed to convert meshes."
+ " Please run `pip3 install --no-binary=h5p... |
#Parser for shakemap xml files
import pandas
import lxml.etree as le
import io
import numpy as np
import quakeml
import datetime
#FIXME: shakemap_id event_id
#shakemlfile = 'grid.xml'
#with open(shakemlfile,'r') as f:
# shakeml = f.read()
class quakemap():
'''
Class that keeps all information related to a... |
"""
network.py
~~~~~~~~~~
A module to implement the stochastic gradient descent learning
algorithm for a feedforward neural network. Gradients are calculated
using backpropagation. Note that I have focused on making the code
simple, easily readable, and easily modifiable. It is not optimized,
and omits many desirabl... |
################################################################################
# The Neural Network (NN) based Speech Synthesis System
# https://svn.ecdf.ed.ac.uk/repo/inf/dnn_tts/
#
# Centre for Speech Technology Research
# ... |
# Copyright (c) 2020, <NAME>
#
# All rights reserved.
#
# 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 right... |
# coding=utf-8
# Copyright 2018 Google LLC & <NAME>.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... |
import pygame
import random
import os
pygame.init()
win = pygame.display.set_mode((700, 700))
pygame.display.set_caption("Falling Blocks")
script_dir = os.path.dirname('Obstacles')
rel_path = r"/Users/alecdewulf/Desktop/Falling-Blocks/Images/Obstacles"
abs_file_path = os.path.join(script_dir, rel_path)
# loading o... |
#! /usr/bin/python3
# -*- coding: utf-8 -*-
# Needs freetype-py>=1.0
# Implements multi-pass solution to setting an exact font height
# Some code adapted from <NAME>'s work at the following URL
# http://dbader.org/blog/monochrome-font-rendering-with-freetype-and-python
# The MIT License (MIT)
#
# Copyright (c) 2016 ... |
'''
* Copyright 2018 Canaan 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... |
from io import TextIOWrapper
from time import time as epochTime, sleep
import sys
from typing import (
Generator, Iterable,
Optional, SupportsInt, Union, IO
)
from . import utils, gen, sets, cond
from . utils import Term, T
NEVER_DRAW = not Term.SUPPORTED
DEBUG = False
# we override stdout so we can keep track o... |
"""Example for Developer Meetup October 22 covering most cloud products, using research
from the Carbon Black Cloud Threat Analysis Unit (TAU).
References:
community.carbonblack.com/t5/Threat-Research-Docs/TAU-TIN-Egregor-Ransomware/ta-p/95786#
"""
import time
import logging
import json
# Audit and Remediation
from ... |
import cv2
from .thinning import *
from .trappedball_fill import *
from skimage.measure import block_reduce
from skimage.morphology import disk, dilation, erosion
from numba import njit
def np_min_pool(x):
return block_reduce(x, (2, 2), np.min)
def np_max_pool(x):
return block_reduce(x, (2, 2), np.max)
de... |
"""Definitions of option learning strategies."""
from __future__ import annotations
import abc
from typing import List, Sequence, Dict, Tuple, Set
import numpy as np
from predicators.src.structs import STRIPSOperator, OptionSpec, Datastore, \
Segment, Array, ParameterizedOption, Object, Variable, Box, State, Actio... |
"""
datasources - Provides introspection functionality for datasources in insights-core
This module provides classes to provide introspection for each of the datasource
definition classes in the :py:mod`insights.specs` package.
"""
import inspect
import insights.core.spec_factory
import insights.specs
from insights.sp... |
import os
from cs50 import SQL
from flask import Flask, flash, jsonify, redirect, render_template, request, session, Response
from flask_session import Session
from tempfile import mkdtemp
import plaid
import datetime
from dateutil.relativedelta import relativedelta
from werkzeug.exceptions import default_exceptions, ... |
# Copyright 2021 <NAME>
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, softwar... |
# MODIFIED. Inspiration taken from the ref link below.
# ref: https://raw.githubusercontent.com/kuza55/keras-extras/master/utils/multi_gpu.py @IgnorePep8
# The inspirational one carried license:
# Apache License
# Version 2.0, January 2004
# For further info refer to: https://github.com/kuza55/keras-extras
#
# ... |
import math
magnitudes = {
'hundred': 100,
'thousand': 1_000,
'million': 10**6,
'billion': 10**9,
'trillion': 10**12,
'quadrillion': 10**15,
'quintillion': 10**18,
'sextillion': 10**21,
'septillion': 10**24,
'octillion': 10**27,
'nonillion': 10**30,
'decillion': 10**33
}... |
# -*- coding: utf-8 -*-
from icemac.addressbook.interfaces import MIN_SUPPORTED_DATE
from icemac.addressbook.utils import dotted_name
import grokcore.component as grok
import icemac.addressbook.interfaces
import persistent
import persistent.interfaces
import persistent.mapping
import six
import zc.sourcefactory.basic
i... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
__author__ = 'ar'
import sys
import json
import shutil
import os
import pandas as pd
import numpy as np
import skimage.io as skio
import skimage.transform as sktf
import matplotlib.pyplot as plt
import cv2
from keras.utils.vis_utils import plot_model as kplot
import matplotli... |
import logging
from enum import Enum
from django.conf import settings
from abc import abstractmethod, ABCMeta
from typing import Union, List
from elasticsearch_dsl import Q as ES_Q
from usaspending_api.common.exceptions import InvalidParameterException
logger = logging.getLogger(__name__)
class _QueryType(Enum):... |
import argparse
import sys
import operator
import math
import codecs
import numpy as np
from collections import defaultdict
import os
#parser arguments
desc = "Computes the observed coherence for a given topic and word-count file."
parser = argparse.ArgumentParser(description=desc)
#####################
#positional a... |
# MIT License
#
# Copyright (c) 2020 <NAME>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publi... |
# import cv2
import copy
import hashlib
import os
import pickle as pkl
import shutil
import time
import numpy as np
class Logger(object):
def __init__(self):
self._logger = None
def init(self, logdir, name='log'):
if self._logger is None:
import logging
if not os.path... |
# -*- coding: UTF-8 -*-
# Copyright 2012-2017 <NAME>
# License: BSD (see file COPYING for details)
from __future__ import unicode_literals
from __future__ import print_function
from builtins import str
import logging
logger = logging.getLogger(__name__)
from decimal import Decimal
ZERO = Decimal()
ONE = Decimal(1)
... |
# -*- coding: utf-8 -*-
"""
@author: wi-ith
"""
import tensorflow as tf
import numpy as np
FLAGS = tf.app.flags.FLAGS
def soft_max(logits, axis=-1):
tile_depth = logits.shape[axis]
max_value = tf.tile(tf.reshape((tf.reduce_max(logits, axis=axis)), [-1, 1]), [1, tile_depth])
exp_logits = tf.exp(logits-max... |
import tensorflow as tf
import tensorflow_probability as tfp
import numpy as np
from collections import deque
import random
from tqdm import tqdm
import gym
from gym import spaces
from gym.utils import seeding
import math
import cv2
#import pantilthat
import time
import signal
import time
import readchar
MAXDIST =... |
import sys
import re
import struct
import copy
import argparse
class AssemblerException(Exception):
pass
class InvalidRegister(AssemblerException):
def __init__(self, register):
super().__init__("Invalid register: {}".format(register))
class InvalidOperation(AssemblerException):
def __init__... |
import os
import vanilla
from defconAppKit.windows.baseWindow import BaseWindowController
from mojo.UI import HelpWindow, HTMLView
from mojo import extensions
from freezeDryer import core
# --------
# Projects
# --------
projectsDefaultsKey = "com.typesupply.FreezeDryer.projects"
class FDProjectsWindowController(Bas... |
"""Functions useful for asteroidhammer"""
from functools import lru_cache
from glob import glob
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import animation
import matplotlib.patheffects as path_effects
from tqdm import tqdm
import tess_ephem
from astropy.utils.data import d... |
#!/usr/bin/env python
from __future__ import print_function
from distutils.command.build_py import build_py
from distutils.command.install import install
from setuptools.command.build_clib import build_clib
from setuptools.command.egg_info import egg_info
try:
import torch
except ImportError as e:
print('Unabl... |
from __future__ import division
#from DataSets import MnistData
from DataSets import RadarData
from DataSets_tasks import RadarData_tasks
#from consensus.consensus_v3 import CFA_process
# best use with PS active
# from ReplayMemory import ReplayMemory
import os
import pickle
import tensorflow as tf
from tensorflow impo... |
import unittest
import fecfile
from datetime import datetime
import os
import json
import shutil
import zipfile
import random
import sys
import warnings
class CandidateTest(unittest.TestCase):
def test_simple(self):
parsed = {}
with open('test-data/1229017.fec') as file:
unparsed = fil... |
# -*- coding: utf-8 -*-
#------------------------------------------------------------------------------
# Name: timespans/spans.py
# Purpose: Tools for grouping notes and chords into a searchable tree
# organized by start and stop offsets
#
# Authors: <NAME>
# <NAME>
#
# Co... |
import os
import argparse
import datetime
import numpy as np
import time
import torch
import json
import random
from pathlib import Path
# import functools
import utils
from create_model import create_model
from create_datasets.prepare_datasets import build_dataset, build_dataset_imbalance
from engine import *
from lo... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import,print_function,division
import tensorflow as tf
import tensorflow.contrib.slim as slim
import numpy as np
def psroi_warp(feature_maps, boxes, crop_size, num_spatial_bins):
'''
:param feature_maps:[N, H, W, C]
:param boxes: [y1, x1, y2, x2]... |
import os.path
import sys
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
from io_scene_xray.xray_io import ChunkedReader, PackedReader
from io_scene_xray.fmt_object import Chunks
import io
import time
def calc_hash(data):
import hashlib
m = hashlib.md5()
m.update(data)
... |
# Copyright 2020 <NAME> (Falcons)
# SPDX-License-Identifier: Apache-2.0
#!/usr/bin/python
import time, datetime
import traceback
from collections import OrderedDict
import numpy as np
import pandas as pd
pd.set_option('mode.chained_assignment','raise')
import matplotlib.pyplot as plt
import matplotlib.lines as lines
f... |
import curses
import os
import sys
import re
import shutil
import configparser
import json
import pkg_resources
import locale
from time import sleep
import requests
import requests_cache
from curses import KEY_F5
import argparse
import time
from sys import stdout
from apt_pkg import TIME
# GLOBALS!
BASEDIR = os.path.j... |
##############################################################
# GDAL wrapper for convenient raster data handling and processing
# <NAME> 2015-2018
##############################################################
# todo: function to write data with the same metadata as a given file
# todo: documentation
from __future_... |
# -*- coding: utf-8 -*-
__doc__ = """\
A module of useful functions for analyzing Python code.
"""
# Import builtins
import os, sys, re, tokenize, keyword
try:
import cStringIO as io
except ImportError: # Ahh, Python 3
import io
import obfuscate
# Globals
py3 = False
if not isinstance(sys.version_info, tupl... |
"""
The MIT License (MIT)
Copyright (c) 2018 <NAME>
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import sys
import math
import numpy as np
import scipy as scp
import logging
from functools import partial
logging.basicConfig(format='%(as... |
from copyreg import pickle
import os
from numpy import save
import yaml
from sel_map_segmentation import ColorScale
import rospy
from mesh_msgs.msg import MeshGeometryStamped, MeshGeometry, MeshMaterial, \
MeshMaterials, MeshMaterialsStamped, MeshFaceCluster, \
Me... |
#!/usr/bin/env python3
# Ukljucivanje modula za matematiku
import numpy as np
# Ukljucivanje modula za animaciju
from OpenGL.GL import *
from OpenGL.GLU import *
from OpenGL.GLUT import *
# Ukljucivanje izometrijskog modula
from izometrije import linear, SLerp, \
Euler2Q, Q2Euler
... |
import argparse
import contextlib
import enum
import io
import os
import nr.fs
import subprocess
import sys
import warnings
try: import ntfy
except ImportError: ntfy = None
from craftr import api
from craftr.core.build import to_graph
from nr.stream import groupby
from termcolor import colored
if sys.version_info[0... |
"""
<NAME>-2020.
MLearner Machine Learning Library Extensions
Author:<NAME><www.linkedin.com/in/jaisenbe>
License: MIT
"""
import numpy as np
import time
import tensorflow as tf
from tensorflow.keras import layers
from ..utils.keras import keras_checkpoint
"""
Based on:
https://www.udemy.com/course/procesamiento-... |
######################################################################
# Deep Reinforcement Learning for Autonomous Driving
# Created/Modified on: February 5, 2019
# Author: <NAME>
#######################################################################
from __future__ i... |
import re
import clevercsv as csv
import io
import os
import string
import enum
import logging
import pprint
import pytoml
import cchardet
from itertools import chain
from string import ascii_lowercase, digits
logger = logging.getLogger(__name__)
_ESCAPE_ACCEPTABLED = frozenset(ascii_lowercase + digits)
current_dir ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.