text stringlengths 3.07k 22.1k |
|---|
#!/usr/bin/python3
"""Module containing the exploration algorithm based on conditional entropy."""
import importlib
from datetime import datetime
from math import ceil
from multiprocessing import Pool
from os import cpu_count
from typing import Tuple
from loguru import logger
from brfast.config import params
from br... |
# Copyright 2017,2018,2019,2020,2021 Sony Corporation.
# Copyright 2021 Sony Group Corporation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-... |
import os, sys, os.path as op
import logging
import sqlite3
import shutil
import unittest
import tempfile
import numpy as np
import progressbar
import nose
from lib.backend import backendDb
from lib.utils import testUtils
class TestCars(unittest.TestCase):
CARS_DB_PATH = 'testdata/cars/micro1_v4.db'
def se... |
#!/usr/bin/env python
# ******************************************************************************
# Copyright 2017-2018 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
... |
# from bitarray import bitarray
import random
# import math
import copy
import numpy as np
# import logging
import itertools
from collections import defaultdict
import statistics
# logger = logging.getLogger(__name__)
class GranuleCell():
def __init__(self):
self.id = None
self.edges = []
... |
# -*- coding: utf-8 -*-
"""Portfolio tracker utils functions."""
import datetime
import functools
import os
from concurrent.futures import ProcessPoolExecutor
import numpy as np
import pandas as pd
import pandas_datareader as pdr
import requests_cache
CACHE_EXPIRE_DAYS = 1
requests_cache.install_cache(
cach... |
import pandas as pd
import numpy as np
import math
import os
import geopandas as gpd
import folium
import datetime
from datetime import date, timedelta
from abc import ABC, abstractmethod
from pathlib import Path
from CovidCases import CovidCases
from CovidCasesWHO import CovidCasesWHO
from CovidCasesOWID import CovidC... |
from collections import OrderedDict
import os, lmdb, math
def _(x):
return (x).to_bytes(5,'big')
class MMR:
"""
Storage with merkle tree structure above it.
We add obj and also obj index (sometimes term `hash` is used instead of `index`).
Tree is built from indexes via summ which should be redefined... |
'''
TODO:
* consider removing the extension of minicircles, if they start anyway with CSB1?
* include coverage plots pdf
'''
from __future__ import division
import os
import re
import sys
import pysam
import numpy
import subprocess
from Bio import SeqIO
from Bio.SeqRecord import SeqRecord
class Error (Exception... |
"""
This module contains all functions that help to clean raw data, genreating feature engineering,
general helpers functions, plotting functions, etc.
"""
import warnings
import datetime as dt
import pandas as pd
from pandas import concat
import numpy as np
import matplotlib.pyplot as plt
warnings.filterwarnings('ig... |
import IPython, graphviz, re
from io import StringIO
from IPython.display import Image
import numpy as np
import pandas as pd
import math
from sklearn import tree
from sklearn.datasets import load_boston, load_iris
from collections import defaultdict
import string
import re
YELLOW = "#fefecd" # "#fbfbd0" # "#FBFEB0"
B... |
"""Commonly used losses, from domain adaptation package
https://github.com/criteo-research/pytorch-ada/blob/master/adalib/ada/models/losses.py
"""
import torch
import torch.nn as nn
from torch.autograd import grad
from torch.nn import functional as F
def cross_entropy_logits(linear_output, label, weights=None):
... |
import datetime
# import dateutil.parser as dpaser
import requests
from bs4 import BeautifulSoup
from config import *
from tools import log, DDingWarn
from tools.reply_template import *
import os
logger = log.logger
local_articles_tree = {}
def get_soul_bread(page_list_urls, root_path):
daily_bread_urls = read_p... |
# Copyright 2020 DeepMind Technologies Limited. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by a... |
from tkinter import *
import os
from pygame import mixer
import tkinter.messagebox
from tkinter import filedialog
import time
import threading
from tkinter import ttk
from ttkthemes import themed_tk as tk
from mutagen.mp3 import MP3
import pyttsx3
import datetime
engine=pyttsx3.init('sapi5')
voices=engine.getProperty(... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import argparse
import os
import re
from operator import attrgetter
import psycopg2
import yaml
# Matches a view or function definition
SQL_VIEW_STATEMENT_RE = re.compile(
r'(?P<declaration>'
'create\s+(or replace\s+)?' # Matches 'create [or replace]'
'(?P<... |
from core_tools.data.SQL.SQL_common_commands import execute_statement, execute_query
from core_tools.data.SQL.SQL_common_commands import select_elements_in_table, insert_row_in_table, update_table
from core_tools.data.SQL.SQL_utility import text, generate_uuid, N_to_n
from core_tools.data.SQL.connect import SQL_conn_i... |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""Record types that reflect Algolia search records."""
from __future__ import annotations
__all__ = ["ContentType", "AlgoliaRecord", "TutorialRecord", "GuideRecord"]
import copy
import datetime
import json
import math
import re
from base64 import b64en... |
### import ####################################################################
import numpy as np
import matplotlib
matplotlib.pyplot.ioff()
from PySide2 import QtWidgets
import WrightTools as wt
import attune
import yaqc_cmds.project.project_globals as g
import yaqc_cmds.project.classes as pc
import yaqc_cmds.p... |
import argparse
import os
import numpy as np
import pandas as pd
import pickle
import time
# from sklearn.linear_model import Ridge, LogisticRegression
from sklearn.model_selection import KFold, train_test_split
from sklearn.linear_model import LogisticRegression, Ridge
from lightgbm import LGBMClassifier, LGBMRegress... |
import numpy as np
import random
import matplotlib.pyplot as plt
from simulation2_sample import Simulator
from simulation import Simulation
from deap import algorithms
from deap import base
from deap import creator
from deap import tools
class SimpleOpt:
def __init__(self, pop_size, generations, m_rate, c_rate, t... |
from django.template import RequestContext
from django.shortcuts import render
from django.utils.html import escape
from types import ModuleType, FrameType
from django.core.urlresolvers import reverse
from django.contrib.auth.decorators import user_passes_test
import gc
import sys
import threading
from . import dowser... |
import time
from ctypes import (POINTER, Structure, byref, c_char_p, c_float, c_int,
c_int8, c_int16, c_int64, c_long, c_uint, c_uint8,
c_uint16, c_uint64, c_ulong, c_void_p, c_wchar_p)
import numpy as np
from . import AlazarApi as API
from .AlazarCmd import *
from .AlazarError... |
"""
Given that integers are being read from a data stream.
Find median of all the elements read so far starting from the first integer
till the last integer. This is also called Median of Running Integers.
The data stream can be any source of data,
example: a file, an array of integers, input stream etc.
"""
import sys... |
# -*-coding:utf-8-*-
import xlrd
import json
import os
from datatest import validate, ValidationError
from jsonpath import jsonpath
from rado.core import exceptions, logger
def get_test_data_from_excel(excel_file, num_sheet):
f = xlrd.open_workbook(excel_file)
sheet = f.sheets()[num_sheet]
test_datas =... |
# import necessary files
import serial
import numpy as np
from matplotlib import pyplot as plt
from scipy.signal import savgol_filter
def readArduinoData():
"""
DOCSTRING: this is the function for reading data from the arduino
return : function will return a 3xn matrix containg RGB data and averaged 1D ... |
#! /usr/bin/env python3
# NOTES - How to run the script
# script is intended to be ran on windows from the scripts directory
# cd scripts
# chmod +x getStats.py;
# ./getStats.py
import subprocess
import matplotlib.pyplot as plt
from matplotlib.ticker import MaxNLocator
import numpy as np
# all possible settings
MAPS... |
import os
import random
import string
import subprocess
import signal
import tempfile
from itertools import zip_longest
from select import select
import sys
from collections import Counter, defaultdict
from pathlib import Path
from typing import List, Tuple
import pytest
import zmq
from ipc import create_killer
from ... |
from unittest import TestCase
import pytest
import sonipy
import numpy as np
import sonipy.thinkdsp as thinkdsp
from sonipy.sonify import MultiTone, SonifyTool
from sonipy.scales.durations import DurationsScale, getScale
# linear sample scatterplot data
x_lin = np.linspace(-10, 2, 10)
y_lin = np.linspace(-1, 1, 10)
... |
"""
usage: parking_utilisation.py [-h] --park PARK [--pfile PFILE]
[--dbname DBNAME] [--dbhost DBHOST]
[--dbuser DBUSER] --dbpwd DBPWD
[--veh_type VEHT] [--granular G]
Script to plot parking utilisation by time of day.
optional ... |
import typing
from enum import Enum
from pydantic import BaseModel, Field, SecretStr, validator, root_validator
from opentrons.system import wifi
class ConnectivityStatus(str, Enum):
full = "full"
limited = "limited"
none = "none"
portal = "portal"
unknown = "unknown"
class ConnectionType(str, ... |
# -*- coding: utf-8 -*-
from . import core as html5
from . import utils
class Button(html5.Button):
def __init__(self, txt=None, callback=None, className=None, *args, **kwargs):
super().__init__(*args, **kwargs)
self["class"] = "btn"
if className:
self.addClass(className)
self["type"] = "button"
if t... |
import json
import tempfile
from pathlib import Path
from typing import Callable, List
from unittest.mock import MagicMock
import pytest
import yaml
from gretel_client.config import RunnerMode
from gretel_client.projects.models import Model, ModelConfigError, read_model_config
@pytest.fixture
def transform_model_p... |
from datetime import datetime
import gzip
import multiprocessing
from glob import glob
from utils import groups_of
from os import path, environ
from jug import TaskGenerator, CachedFunction, iteratetask
from jug.utils import sync_move
import diskhash
import gzip
from jug import Task, TaskGenerator, barrier, CachedFun... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# @Time : 19-3-1 上午10:41
# @Author : MaybeShewill-CV
# @Site : https://github.com/MaybeShewill-CV/attentive-gan-derainnet
# @File : tf_io_pipline_tools.py
# @IDE: PyCharm
"""
Some tensorflow records io tools
"""
import os
import os.path as ops
import cv2
import ... |
from collections import defaultdict
import json
import operator
from django.shortcuts import render, get_object_or_404, redirect
from django.db.models import Prefetch, F, Max
from django.conf import settings
from django.contrib.auth import login, logout
from django.contrib.auth.decorators import login_required
from dj... |
from iconsdk.builder.transaction_builder import DeployTransactionBuilder, CallTransactionBuilder
from iconsdk.builder.call_builder import CallBuilder
from iconsdk.exception import JSONRPCException
from iconsdk.icon_service import IconService
from iconsdk.libs.in_memory_zip import gen_deploy_data_content
from iconsdk.pr... |
from streamlit_option_menu import option_menu
import os,io,base64,csv
import streamlit as st
import pandas as pd
from PIL import Image
from datetime import datetime
from annotated_text import annotated_text
def config():
file_path = "./components/img/"
img = Image.open(os.path.join(file_path, 'logo.ico'))
... |
""" Python Obit FitModel class
This class contains info about an image fitting region
FitModel Members with python interfaces:
========= ======================================================
name An optional name for the object.
corner bottom left corner in selected region of image (0-rel)
dim dimensi... |
# coding: utf-8
#
# # Analisis de datos del tile b278
# ## Imports and global configurations
# In[51]:
from __future__ import print_function, division
import os
import warnings
import time
import argparse
import sys
import multiprocessing as mp
import numpy as np
import pandas as pd
import pytff
import tables... |
#!/usr/bin/env python3
#
# grammar.py
r"""
.. versionadded:: 0.2.0
As with ``coverage.py``, lines are marked with comments in the form::
# pragma: no cover
With ``coverage_pyver_pragma``, the comment may be followed with an expression enclosed in parentheses::
# pragma: no cover (<=py38 and !Windows)
Each expre... |
import numpy as np
from numpy import linalg as LA
import math
import matplotlib
import constant
from matplotlib import pyplot as plt
import time
# from scipy import linalg
from scipy.linalg import hadamard
import seaborn as sns
import pandas as pd
from sklearn.ensemble import RandomForestRegressor
import matplotlib.pyp... |
from invoke import task
import sys
import os
import os.path as osp
from pathlib import Path
from ..config import (
ENV_METHOD,
DEFAULT_ENV,
ENVS_DIR,
)
## user config examples
# SNIPPET:
# # which virtual environment tool to use: venv or conda
# ENV_METHOD = 'venv'
# # which env spec to use by default... |
import pandas as pd
import numpy as np
from operator import itemgetter
from datetime import datetime
from keras_preprocessing.sequence import pad_sequences
def format_x(input_format: np.array) -> np.array:
for i in range(input_format.shape[0]):
input_format[i] = np.array(np.nan_to_num(input_format[i].asty... |
import math
import os
from logging import getLogger
import tensorflow as tf
from tensorflow.keras.callbacks import ModelCheckpoint
from tensorflow.keras.models import load_model
from tensorflow.keras.utils import Sequence
from hugin.engine.core import RasterModel
from hugin.tools.callbacks import CSVLogger
from hu... |
import torch
import torch.nn as nn
import torch.nn.functional as F
from operations import *
from torch.autograd import Variable
from genotypes import PRIMITIVES
from genotypes import Genotype
class MixedOp(nn.Module):
def __init__(self, C, stride):
super(MixedOp, self).__init__()
self._ops = nn.ModuleList(... |
import math
import numpy as np
import torch.nn as nn
__all__ = ['PrunedMobileNetV2', 'PrunedMobileBottleneck']
def conv3x3(in_planes, out_planes, stride=1):
"3x3 convolution with padding"
return nn.Conv2d(in_planes, out_planes, kernel_size=3, stride=stride,
padding=1, bias=False)
def ... |
# Modified by Microsoft Corporation.
# Licensed under the MIT license.
# The control module
# Creates and runs control loops at levels: Experiment, Trial, Session
from copy import deepcopy
import pydash as ps
import torch.multiprocessing as mp
from convlab import agent as agent_module
from convlab.agent import Body
... |
# Lint as: python2, python3
# Copyright 2018 The TensorFlow Authors All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#... |
class BSTNode:
def __init__(self, data):
# root node
self.data = data
# Sol övlad(left child)
self.left = None
# Sağ övlad(right child)
self.right = None
def get_data(self):
return self.data
def get_left_child(self):
return self.left
def... |
# coding: utf-8
'''
admin.py
~~~~~~~~
'''
from datetime import datetime
from flask import (render_template, Blueprint, request,
url_for, current_app, redirect)
from flask_login import login_required
from fine import db
from fine.models import (Post, PostTag, User, Tag, Link,
... |
from collections import Counter
from copy import copy
from functools import reduce
from itertools import chain
import numpy as np
from numpy.lib.stride_tricks import as_strided
from mygrad._utils import reduce_broadcast
from mygrad.operation_base import BroadcastableOp
__all__ = ["MatMul", "EinSum"]
class MatMul(B... |
from typing import List
import matplotlib.pyplot as plt
import energyscope as es
def plot_pareto(case_study_path: str, test_case: str, epsilons: List[float]) -> None:
cost_opt_cost = es.get_total_cost(f"{case_study_path}/{test_case}/cost")
einv_opt_cost = es.get_total_einv(f"{case_study_path}/{test_case}/c... |
import os
import json
import shutil
import tempfile
import pandas as pd
from flask import Flask, render_template, request, jsonify, send_from_directory
from flask_login import current_user, login_user, logout_user, login_required
from werkzeug.utils import secure_filename
from .utils.db_controller import DatabaseContro... |
"""
Executable for processing the R1 waveforms, and storing the reduced parameters
into a HDF5 file, readable as a `pandas.DataFrame`.
"""
import argparse
import numpy as np
import pandas as pd
from tqdm import tqdm
from CHECLabPy.core.io import WaveformReader, HDF5Writer
from CHECLabPy.core.chain import WaveformReduce... |
# This file is part of Indico.
# Copyright (C) 2002 - 2019 CERN
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see the
# LICENSE file for more details.
from __future__ import print_function, unicode_literals
import os
import re
import subprocess
import sys
... |
from botocore.validate import validate_parameters
from metaflow import FlowSpec,step,batch,Parameter,IncludeFile,retry,resources
import click
import math
sideX = 512
sideY = 512
def sigmoid(x):
x = x * 2. - 1.
return math.tanh(1.5*x/(math.sqrt(1.- math.pow(x, 2.)) + 1e-6)) / 2 + .5
class VideoGe... |
# coding: utf-8
"""
Deals with generating the site-wide navigation.
This consists of building a set of interlinked page and header objects.
"""
from mkdocs import utils, exceptions
import posixpath
import os
def filename_to_title(filename):
"""
Automatically generate a default title, given a filename.
... |
from flask import Blueprint, request, render_template, \
flash, g, session, redirect, url_for, jsonify,\
abort
from flask_login import login_required, login_user, \
current_user, logout_user
from sqlalchemy.exc import IntegrityError
from app import db, lm
... |
# -*- coding: utf8 -*-
"""
======================================
Project Name: NLP
File Name: tokenizers
Author: czh
Create Date: 2021/9/28
--------------------------------------
Change Activity:
======================================
"""
import re
import string
from typing import List, Optional
... |
# Copyright (c) 2022 by <NAME>
# Copyright (c) 2012 - 2021, Udacity, Inc.
# All rights reserved.
# This file is part of the computer vision course project submission of Udacity's Self-driving
# Cars Nanodegree Program. It has been developed based on the starter code provided by Udacity
# on https://github.com/udacity/n... |
# Licensed under Apache License Version 2.0 - see LICENSE
import operator
import pickle
import sys
import pytest
from iteration_utilities import sideeffects, return_None
import helper_funcs as _hf
from helper_cls import T, toT
def raise_error_when_below10(val):
if isinstance(val, tuple):
if val[0].val... |
# Copyright 2018 SAP SE
#
# 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, software
... |
import copy
import SimEngine.Mote.MoteDefines as d
import tests.test_utils as u
from SimEngine.Mote.rpl import RplOFBestLinkPDR
def test_free_run(sim_engine):
sim_engine = sim_engine(
diff_config = {'rpl_of': 'OFBestLinkPDR'}
)
u.run_until_end(sim_engine)
def test_parent_selection(sim_engine):
... |
# %%
# simple UnRollredRNN_Model
from mxnet import gluon, autograd
from mxnet.gluon import nn, rnn
from g_rnn.shared import *
# %% [markdown]
# ## Character RNN using gluon/lstm api
#
# Training sequence 2 sequence models using Gluon API
# %%
# Class to create model objects.
class GluonRNNModel(gluon.Block):
"... |
from __future__ import division
from __future__ import print_function
import numpy as np
import pandas as pd
import scipy.sparse as sp
import random
# For automatic dataset downloading
from urllib.request import urlopen
from zipfile import ZipFile
from io import StringIO
from io import BytesIO
import shutil
import ... |
from pycocotools.coco import COCO
import os
import argparse
import sys
import shutil
from huicv.deps.Cityscapes.cityperson_eval import cityperson_eval
from collections import OrderedDict
from huicv.evaluation.expand_cocofmt_eval import COCOExpandEval
"""
require:
conda install scipy, tqdm
dependency install... |
import typing as t
from typing import TYPE_CHECKING
import numpy as np
from simple_di import inject
from simple_di import Provide
from bentoml import Tag
from bentoml import Model
from bentoml import Runner
from bentoml.exceptions import BentoMLException
from bentoml.exceptions import MissingDependencyException
from... |
import pandas as pd
import numpy as np
import itertools
from . import query_manager_strategy_factory
from django.conf import settings
import accountifie.toolkit.utils as utils
from accountifie.common.api import api_func
import logging
logger = logging.getLogger('default')
def _get_acct_list(acct_list, paths):
... |
# -*- encoding: utf-8 -*-
from imaplib import ParseFlags
# mockimaplib: A very simple mock server module for imap client APIs
# Copyright (C) 2014 <NAME> <<EMAIL>>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License a... |
import numpy as np
import math
import pdb
import torch
import torch.nn as nn
import torch.nn.functional as F
class Buffer(nn.Module):
def __init__(self, args, input_size=None):
super().__init__()
self.args = args
self.k = 0.03
self.place_left = True
if input_size is Non... |
#! /usr/bin/env python3
import json
import os
import sys
import time
import traceback
from datetime import datetime
from typing import Dict
import numpy as np
import requests
from dotenv import load_dotenv
from plane import Plane
class Tracker:
API_KEY = ''
DEBUG = False
LOG_ENABLE = False
in_test =... |
from types import SimpleNamespace
from flask import make_response, request, jsonify, g
from ordered_set import OrderedSet
from label_studio.utils.auth import requires_auth
from label_studio.utils.misc import exception_handler
from label_studio.data_manager.actions import get_all_actions, perform_action
from label_stu... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Utilities module for pre-processing audio stimuli
Run on the command line, e.g.: ::
$ python preprocess.py
.. note:: This module has dependencies not required by the CAQE web application. To install these dependencies, run
``pip install -r analysis_requirements.... |
#!/usr/bin/python3
# -*- coding: utf-8 -*-
#
## @file terminal.py
#
# @author <NAME>
# @version 0.1
# @date 2019-03-02
# @brief The KETCube Terminal common validation module
#
# @note Requirements:
# Standard Python3 installation (Tested Fedora ...)
#
# @attention
#
# <h2><center>© Copyright (c) 2019 Un... |
#
# Copyright (c) nexB Inc. and others. All rights reserved.
# http://nexb.com and https://github.com/nexB/scancode-toolkit/
# The ScanCode software is licensed under the Apache License version 2.0.
# Data generated with ScanCode require an acknowledgment.
# ScanCode is a trademark of nexB Inc.
#
#
# Copyright (c) nexB... |
# Copyright (c) 2012-2020 Jicamarca Radio Observatory
# All rights reserved.
#
# Distributed under the terms of the BSD 3-clause license.
"""Utilities for publish/send data, files & plots over different protocols
"""
import os
import glob
import time
import json
import numpy
import zmq
import datetime
import ftplib
fr... |
import logging
from typing import Dict
from typing import List
import boto3
import neo4j
from .util import get_botocore_config
from cartography.util import aws_handle_regions
from cartography.util import run_cleanup_job
from cartography.util import timeit
logger = logging.getLogger(__name__)
@timeit
@aws_handle_re... |
#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import pickle
from typing import Any, List, Optional, Type
import numpy as np
from habitat.config import Config
from ha... |
from copy import deepcopy as dcopy
import os
import warnings
from pathlib import Path as P
import pickle
import subprocess
import time
import yaml
from . import os as _os
__all__ = \
['Filename',
'Printer',
'TDict',
'Timer',
'Path',
'append',
'cmd',
'equal',
'equal_set',
'iseven',
'isodd',
'is_iterable',
... |
#!/usr/bin/env python
"""
Some I/O utilities.
"""
import os
import re
import json
import numpy as np
import zipfile
import importlib
#import pint
import pickle
import gc
import socket
from .log import log, LogLevel
import functools
# See https://github.com/h5py/h5py/issues/961
import warnings
warnings.simplefilter(ac... |
#!/usr/bin/env python
# Copyright 2020 Sarubee
#
# 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 applicabl... |
import numpy as np
from SimPEG.electromagnetics.utils import (
getStraightLineCurrentIntegral,
segmented_line_current_source_term,
line_through_faces,
)
import discretize
import unittest
from SimPEG.utils import download
class LineCurrentTests(unittest.TestCase):
def setUp(self):
url = "https:... |
#-*-coding:utf-8-*-
# date:2020-05-02
# Author: <NAME>
from __future__ import print_function
import os
import sys
import time
sys.path.append('./')
import cv2
import argparse
import torch
import torch.backends.cudnn as cudnn
import numpy as np
from data import cfg_mnet, cfg_re50
from layers.functions.prior_box import ... |
#!/usr/bin/env python3
"""
Generic GEDCOM transformer
<NAME>, 2016.
The transforms are specified by separate Python modules ("plugins") in the subdirectory "transforms".
Parameters of main():
1. The name of the plugin. This can be the name of the Python file ("module.py")
or just the name of the modu... |
from __future__ import division
import chainer
from chainer.backends import cuda
import chainer.functions as F
import chainer.links as L
from chainercv import utils
import numpy as np
from chainer_dense_fusion.links.model.posenet import PoseNet
from chainer_dense_fusion.utils import generate_organized_pcd
from chaine... |
r"""
Dyck Paths
This is an implementation of the abstract base class
:class:`sage.combinat.path_tableaux.path_tableau.PathTableau`.
This is the simplest implementation of a path tableau and is included
to provide a convenient test case and for pedagogical purposes.
In this implementation we have sequences of nonnegat... |
# coding: utf-8
# In this tutorial we'll show how to export squeezenet which is implemented and trained in pytorch to run on mobile devices.
# Before we start, you should have [pytorch](https://github.com/pytorch/pytorch), [caffe2](https://github.com/caffe2/caffe2), [onnx](https://github.com/onnx/onnx) and [onnx-caff... |
import importlib
import importlib as _importlib
import inspect
import inspect as _inspect
import os
import typing
from typing import Callable, Tuple, Union
from flytekit.configuration.feature_flags import FeatureFlags
from flytekit.exceptions import system as _system_exceptions
from flytekit.loggers import logger
cl... |
# Copyright 2009 the Melange 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 or agreed to in wr... |
from __future__ import division
import math
import numpy as np
import torch
from mmcv.runner import get_dist_info
from torch.utils.data import DistributedSampler as _DistributedSampler
from torch.utils.data import Sampler
class DistributedSampler(_DistributedSampler):
def __init__(self,
dataset... |
# -*- coding: utf-8 -*-
"""Tests for imfusion.insertions.aligners.star module."""
# pylint: disable=wildcard-import,redefined-builtin,unused-wildcard-import
from __future__ import absolute_import, division, print_function
from builtins import *
# pylint: enable=wildcard-import,redefined-builtin,unused-wildcard-import
... |
from sklearn.model_selection import train_test_split
import numpy as np
from medcat.utils.models import LSTM as MODEL
from sklearn.metrics import classification_report, f1_score, confusion_matrix, precision_score, recall_score
import torch
from torch import nn
import torch.nn.functional as F
import torch.optim as optim... |
"""
module to deal with getting data from a capture file
nmea capture text files should be plain text files with each NMEA 0183 sentence
on it's own line
jsonlines are files previously exported from pyaisnmea and consist of AIS
message data as seperate JSON statements each on a new line
csv are comma seperated value... |
# -*- coding: utf-8 -*-
import numpy as np
import re
import itertools
from collections import Counter
def load_data_and_labels(positive_data_file):
"""
Loads MR polarity data from files, splits the data into words and generates labels.
Returns split sentences and labels.
"""
# Load data from fi... |
import matplotlib.image as mpimg
import matplotlib.pyplot as plt
import numpy as np
import cv2
import glob
import time
from skimage.feature import hog
from sklearn.model_selection import train_test_split
from sklearn.svm import LinearSVC
from sklearn.preprocessing import StandardScaler
import pickle
def load_data():
... |
"""
pygiftbit
Copyright 2020 <NAME>
https://github.com/donaldkbrown/pygiftbit
OSI Compliant: MIT License
A simple API wrapper for the Giftbit Gift API.
"""
from time import sleep
from requests import get, post, delete, put
from pygiftbit.errors import AuthError, APIError, CampaignError, ConflictError, FundError, Gift... |
import arcpy
from arcpy import env
import os
import pandas as pd
import numpy as np
# This list can be updated to ignore certain fields. Change_type is currently being ignored because it is not used and will almost always contain domain errors
IGNORE_FIELDS = ['CHANGE_TYPE']
def get_coded_domain_name_values(gdb):
... |
# -*- coding: utf-8 -*-
"""
@author: wi-ith
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os.path
import time
from datetime import datetime
import numpy as np
import tensorflow as tf
import tensorflow.contrib.slim as slim
from six.moves import... |
"""
--Do we need this file?--
"""
#import csv
#import os
#import sys
#from nltk.corpus import stopwords
#import matplotlib.pyplot as plt
#import pyfpgrowth
#from pyspark.ml.fpm import FPGrowth
#from sklearn.feature_extraction.text import TfidfTransformer
import numpy as np
import pandas as pd
import re
from nltk.stem... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.