text stringlengths 3.07k 22.1k |
|---|
"""
Functions that act on DynSys or DynMap objects
"""
import numpy as np
import neurokit2 # Used for computing multiscale entropy
from .utils import *
from .utils import standardize_ts
def sample_initial_conditions(
model, points_to_sample, traj_length=1000, pts_per_period=30
):
"""
Generate a rando... |
# -*- coding: utf-8 -*- #
# Copyright 2019 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... |
import os
from typing import Dict, List, Tuple
import torch
import torch.nn as nn
from pytorch_lightning import seed_everything
from torchvision.utils import make_grid
from tqdm import tqdm
import losses
import wandb
from dataset import build_dataloader
from models import Discriminator, Encoder, Generator
def train... |
#!/usr/bin/env python3
#
# stredit.py 10/12/2021 D.J.Whale
#
# A programmable string editor.
import sys
ZTERM = '\0'
#===== UTILITY FUNCTIONS =======================================================
def insert(buf:list, start:int, count:int)-> None:
"""Insert a number of items inside a buffer, without creating... |
from Bio import Entrez
import xmltodict
import numpy as np
import re
def download_pubmed_articles(api_key, email, pmid_list):
Entrez.api_key = api_key
Entrez.email = email
pmid_list = set([str(_) for _ in pmid_list if _.isdigit()])
pmid_search_string = ",".join(list(pmid_list))
print('No of uniqu... |
import warnings
import numpy as np
from qiskit import Aer, execute, QuantumCircuit
from qiskit.circuit.library import (HGate, SdgGate, SGate, TGate,
XGate, YGate, ZGate)
from qiskit.extensions.unitary import UnitaryGate
from qiskit.providers.aer.noise import NoiseModel
from deltal... |
#
# Copyright (c) 2016,2020 Wind River Systems, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
import json
from nfv_client.openstack import rest_api
class StrategyStep(object):
step_id = None
step_name = None
entity_type = None
entity_names = []
entity_uuids = []
timeout = None
start_date_... |
import Tkinter as tk
import tkFileDialog
from tkFileDialog import *
import tkMessageBox
import cv2
import face_recognition
import sys
import os
import pandas as pd
from datetime import datetime
LARGE_FONT = ("Verdana", 12)
class first_class(tk.Tk):
def __init__(self, *args, **kwargs):
tk.Tk.__init__(sel... |
from typing import Dict, List
from rest_framework.response import Response
from rest_framework.viewsets import ReadOnlyModelViewSet
from ozpcenter.models import Agency
from ozpcenter.models import Category
from ozpcenter.models import ChangeDetail
from ozpcenter.models import Contact
from ozpcenter.models import Cont... |
"""
WaveGRU model: melspectrogram => mu-law encoded waveform
"""
from typing import Tuple
import jax
import jax.numpy as jnp
import pax
from pax import GRUState
from tqdm.cli import tqdm
class ReLU(pax.Module):
def __call__(self, x):
return jax.nn.relu(x)
def dilated_residual_conv_block(dim, kernel, s... |
from django.shortcuts import render,redirect, get_object_or_404, HttpResponse
from django.contrib.auth.decorators import login_required
from datetime import datetime
from django.views.decorators.http import require_http_methods
from django.http import JsonResponse
from django.contrib.auth import get_user_model
from dja... |
import numpy as np
import math
import tensorflow as tf
import h5py
import sys
import os
######## OPTIONS #########
ver = 6 # Neural network version
table_ver = 6 # Table Version
hu = 25 # Number of hidden units in each hidden layer in network
saveEvery = 1000 # Epoch frequency of ... |
from django.core.exceptions import ValidationError
from django.db import models
import re
class Contributor(models.Model):
"""A contributor to a published work."""
last_name = models.CharField(max_length=191)
first_name = models.CharField(max_length=191, blank=True)
def __str__(self):
return ... |
# The MIT License (MIT)
#
# 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, me... |
"""
preprocess_nih
==============
Data cleaning / wrangling before ingestion of raw data,
specifically:
* Systematically removing generic prefixes using very hard-coded logic.
* Inferring how to correctly deal with mystery question marks,
using very hard-coded logic.
* Splitting of strings into arrays as in... |
from filehash import FileHash
from io import BytesIO
import os, json, yaml
import logging
logger = logging.getLogger(__name__)
from typing import Callable, List
import itertools
# Distinct types that are actually the same (effectively)
TYPE_ALIASES = {
'itk_geometry': 'itk_volume'
}
def to_sql_field(s):
fi... |
"""
CalcLikelihood.py
Code for calculating the likelihood from future direct detection data.
Requires some partial likelihood data to be pre-calculated using
'expt.TabulateAll(mx)' for all the experiments under consideration.
BJK - 23/06/2017
"""
import sys
from scipy.stats import chi2, norm
#import matplotlib.pyplo... |
'''
This module contains a toy encryption tool based on the quasidihedral group of
order 256.
We use this group presentation throughout:
G = < r, s | r^{2^{n-1}} = s^2 = 1, sr = r^{2^{n-2}-1}s >
In our case n = 8 and resulting group has order |G| = 2^n = 256.
Every element of G is uniquely representable in th... |
import argparse
import os
import torch
import torch.nn as nn
import torch.nn.parallel
import torch.optim as optim
import torch.utils.data
import torch.nn.functional as F
import time
from dataloader import listflowfile as lt
from dataloader import SecenFlowLoader as DA
import utils.logger as logger
import models.anynet... |
__all__ = [
'ubcMeshReaderBase',
'ModelAppenderBase',
]
__displayname__ = 'Base Classes'
# Outside Imports:
import os
import numpy as np
import vtk
from .. import _helpers, base
###############################################################################
# UBC Mesh Reader Base
class ubcMeshReaderBase(... |
import copy
import demistomock as demisto # noqa: F401
from CommonServerPython import * # noqa: F401
QUERIES = {
"tag": "get_taginfo",
"signature": "get_siginfo",
"file_type": "get_file_type",
"clamav": "get_clamavinfo",
"imphash": "get_imphash",
"yara_rule": "get_yarainfo",
"issuer_cn": ... |
# bot.py
# Craftquests discord bot made by Bearsy for Lion Forge Guild.
# License: MIT. Good luck, have fun.
import os
import sqlite3
import json
# probably need to install these!
import pandas
import requests
import discord
from dotenv import load_dotenv
from discord.ext import tasks, commands
# impo... |
import os
import pdb
import random
import sys
from collections import OrderedDict as odict
from os import path
import _pickle as pickle
import numpy as np
import scipy.io as sio
from tqdm import tqdm
# scanning function
def scandir(dir):
if sys.version_info >= (3, 5):
return [d.name for d in os.scandir(dir) if... |
#!/usr/bin/python
# ----------------------------------------------------------------------------
# Shows SID info - riq
# ----------------------------------------------------------------------------
'''
Little tool to display SID info
'''
from __future__ import division, unicode_literals, print_function
import sys
impo... |
import torch
from torch import nn
from torch.autograd import Variable
from torch.nn.utils.rnn import pack_padded_sequence
from torch.nn.utils.rnn import pad_packed_sequence
from environment import DEVICE
class GaussianNoise(nn.Module):
"""
Additive Gaussian noise layer
Args:
mean: float, mean ... |
from maskrcnn_benchmark.config import cfg
from demo.predictor import COCODemo
from RDRSeg import RDRSeg
from sptam.dynaseg import DynaSegt,DynaSeg
from sptam.msptam import SPTAM, stereoCamera
from sptam.components import Camera
from sptam.components import StereoFrame
from sptam.feature import ImageFeature
from sptam.... |
import torch
from .symmatrix import SymMatrix, Diag
from .matrices import SHAPE_FULL, SHAPE_BLOCK_DIAG, SHAPE_DIAG, HESSIAN, MatrixManager
from .mvp import power_method, conjugate_gradient_method
__all__ = [
'hessian_eigenvalues',
'hessian',
'hessian_for_loss',
'hessian_free'
]
_supported_shapes = [SHA... |
import random
import pytest
from .models import db, User, UserType, Friendship, Relation, MYSQL_URL
pytestmark = pytest.mark.asyncio
async def test_create(engine):
nickname = "test_create_{}".format(random.random())
u = await User.create(
bind=engine, timeout=10, nickname=nickname, age=42, type=Use... |
import math
from abc import ABC
from dataclasses import dataclass, asdict
from enum import Enum, auto
from typing import Type, Union, Dict, Tuple, cast
import numpy as np
import torch
import wandb
from datargs import argsclass
from nnAudio.Spectrogram import CQT2010v2
from torch import nn, Tensor
from gw_data import ... |
#! python3
# From the shell, this script takes a CSV file (as the first argument, 'SOMECSV.csv') and an output name string without an extension (as the second argument, 'EXAMPLE'), eliminates duplicate names, and returns both (1) an output file with duplicates stripped, (2) an output file of possible duplicates left in... |
# 대신증권 API
# 실시간 분차트 데이터 만들기
# 실시간 시세를 받아, 1분 차트 데이터를 만드는 예제입니다.
# 예제에서는 코스피 200 에 속하는 200 종목을 실시간으로 요청한 후 받은 시세를 기준으로 1분 차트 데이터를 만듭니다.
# (200 종목 분 차트 데이터 생성)
#
# ■ 분 차트 기준 : 14:10분 봉의 겨우 14:09:00~14:09:59초 사이에 들어온 데이터를 하나의 봉으로 만듭니다
# ■ 예제에서는 시세 수신이 있을 경우에만 데이터를 추가하여 분데이터를 만듭니다. (해당 시간 체결이 없을 경우에는 분 데이터를 채우지 ... |
from __future__ import print_function
from __future__ import division
import numpy as np
import scipy.sparse as spa
from builtins import range
import os
import pandas as pd
# Import subprocess to run matlab script
from subprocess import call
from platform import system
# For importing python modules from string
impor... |
# 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 -*-
# Copyright (c) 2020. Distributed under the terms of the MIT License.
from copy import deepcopy
import pytest
from pydefect.analyzer.defect_energy import (
DefectEnergy, CrossPoints, DefectEnergyInfo, DefectEnergies,
DefectEnergySummary, SingleChargeEnergies, ChargeEnergies)
from vise... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Oct 1 07:47:29 2021
@author: alankar
"""
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
from scipy.integrate import solve_ivp
import h5py
import sys
from scipy import interpolate
import sys
from decimal impor... |
import math
import torch
import torch.nn as nn
from collections import OrderedDict
import ltr.models.lwl.label_encoder as seg_label_encoder
from ltr import model_constructor
import ltr.models.lwl.linear_filter as target_clf
import ltr.models.target_classifier.features as clf_features
import ltr.models.lwl.initi... |
#!/usr/bin/python
# Convert planet map coordinates to GPS and back.
# Note: planet position is its bounding box corner, not the center.
from lxml import etree
import math
import os
from PIL import Image
import sys
if len(sys.argv) < 6:
print("Usage: %s <PlanetGeneratorDefinitions.sbc> <Planet name> <Planet position... |
from tkinter import *
from tkinter import ttk
import numpy as np
from PIL import Image
class state:
# 2-Dim Array
def __init__(self):
self.rows = 100
self.cols = 100
self.arr = np.zeros((100, 100), dtype=int)
# fills array with a cool pattern
def Initail_Example(... |
#from common import *
import os
import numpy as np
import cv2
import torch
import torch.nn as nn
import torch.nn.functional as F
#from lib.net.sync_bn.nn import BatchNorm2dSync as SynchronizedBatchNorm2d
#BatchNorm2d = SynchronizedBatchNorm2d
BatchNorm2d = nn.BatchNorm2d
IS_PYTORCH_PAD = True # True # False
###... |
import collections
import datetime
import itertools
import logging
import os
import sys
from typing import List, Optional
import pandas as pd
import requests
from crowdkit.aggregation import BradleyTerry
from crowdkit.aggregation import MajorityVote
from toloka.client import Pool, Project, structure
from toloka.client... |
#!/usr/bin/env python
# ROS Wrapper to publish pointclouds using fisheye camera images from Intel Realsense T265
from __future__ import print_function
# ROS imports
import roslib
import rospy
# ROS Image message
from sensor_msgs.msg import Image, CameraInfo, PointCloud2, PointField
from sensor_msgs import point_clou... |
# import sys
# from bopt.experiment import Experiment
# from bopt.cli.util import handle_cd_revertible, acquire_lock
#
# args = sys.argv[2:]
# experiments = []
#
# for exp_dir in args:
# with handle_cd_revertible(exp_dir), acquire_lock():
# print(exp_dir)
# experiment = Experiment.deserialize()
# ... |
from PyQt5.QtCore import Qt
from PyQt5.QtWidgets import QApplication, QMainWindow, QSplitter
import pyqtgraph as pg
import numpy as np
import datetime
from stytra.collectors import Accumulator
import time
import pandas as pd
import colorspacious
class StreamingPositionPlot(pg.GraphicsWindow):
"""Plot that display... |
from bs4 import BeautifulSoup
from requests import Request, Session, Timeout, ConnectionError
import re
import sys
import argparse
import telegram
from telegram.ext import Updater, CommandHandler, MessageHandler, Filters, CallbackContext
import time
import pytz
from datetime import datetime, timedelta
import ... |
"""
Classes for Mesh and Bounding-Box objects
"""
import numpy as np
from .colour import Colour
from ..math.constants import VECTOR_EPS
from ..math.matrix import Matrix44
from ..math.vector import Vector3
def compute_face_normals(vertices, remove_degenerate=False):
"""Calculates the face normals by determining th... |
'''Test wal list eval logic'''
from wal.core import Wal
from wal.ast_defs import Operator as Op
from .test_eval import OpTest
# pylint: disable=C0103
# pylint: disable=W0201
class BasicListTest(OpTest):
'''Test basic list functions such as list creation'''
def test_list_construcion(self):
'''Test co... |
from numpy.testing import assert_, run_module_suite, assert_allclose
import numpy as np
from qutip.qip.device.processor import Processor
from qutip.qip.device.noise import (
RelaxationNoise, DecoherenceNoise, ControlAmpNoise, RandomNoise, UserNoise)
from qutip.operators import qeye, sigmaz, sigmax, sigmay, destroy... |
from configs.pruning import get_prune_args
from models.networks.convolutional.wide_resnet import *
from models.networks.compress.prune.fischer import *
from models.networks.convolutional.densenet import *
import torch.utils.model_zoo as model_zoo
from torchvision import transforms
import torchvision
import torch
import... |
""" (4.1) Add RabbitMQ details to tenant model
Revision ID: 730403566523
Revises: <PASSWORD>
Create Date: 2017-05-10 15:33:46.837856
"""
from alembic import op
import sqlalchemy as sa
import manager_rest # Adding this manually
# revision identifiers, used by Alembic.
revision = '730403566523'
down_revision = '9... |
import pytest
import test_stack
import Xlib
@pytest.mark.parametrize("single_floating", [True, False])
@pytest.mark.parametrize("raise_on_click", [True, False])
def test_focus_on_click(hlwm, mouse, raise_on_click, single_floating):
if single_floating:
hlwm.call('rule floating=on')
else:
hlwm.c... |
from __future__ import print_function
import base64
import csv
import json
import sys
from collections import Counter
from functools import wraps
import numpy as np
import pandas as pd
import zerorpc
from nestor import keyword as kex
def exception_handler(func):
@wraps(func)
def func_or_exception(*args, **k... |
import itertools
import json
from pathlib import Path
from urllib.parse import urljoin
from flexget.utils.soup import get_soup
from loguru import logger
from ..schema.site_base import SiteBase, SignState, NetworkState, Work
from ..utils.net_utils import NetUtils
class NexusPHP(SiteBase):
def get_message(self, ... |
#!/usr/bin/env python
from __future__ import absolute_import, division, print_function
__metaclass__ = type
# Copyright 2018 Palo Alto Networks, 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... |
class Enota:
def __init__(self, hp, attack, armor, mana, stanje):
self.hp = hp
self.att = attack
self.arm = armor
self.mana = mana
self.stanje = stanje # [("scit", 3)]
def napad(self, other):
skoda = self.att - other.arm
skoda = max(skoda, 1)
oth... |
#!/usr/bin/env python
#
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import json
import logging
import optparse
import os
import re
import shutil
import sys
import tempfile
import zipfile
from util imp... |
# 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
# distributed under the... |
import numpy as np
import sys
import scipy.special as sc
from scipy.spatial import distance
## -------------------------------------------------------------------------- ##
## -------------------------------------------------------------------------- ##
## Implement the Matern correlation function
##... |
import numpy as np
import numba
from numba import jit
#from modern_high_performance import *
from modern_robotics_numba.modern_high_performance import *
#Parallel Disabled For Now. Something is wrong with my installation.
@jit(nopython=True, cache=True)#, parallel=True)
def IKinSpaceConstrained(screw_list, ee_home, ee... |
try:
# more complete, but 3.10+
from sys import stdlib_module_names
except ImportError:
# from python3.9
stdlib_module_names = {
'__future__', '_abc', '_aix_support', '_ast', '_asyncio', '_bisect', '_blake2',
'_bootsubprocess', '_bz2', '_codecs', '_codecs_cn', '_codecs_hk', '_codecs_iso2... |
from pathlib import Path
import cv2
import numpy as np
import torch
import torchvision
from PIL import Image
from torch.utils.data import Dataset
from scipy.spatial.transform import Rotation
from utils import map_fn
class TUMMonoVOMultiDataset(Dataset):
def __init__(self, dataset_dirs, **kwargs):
if is... |
import math
import sys
from copy import deepcopy
import numpy as np
import scipy.linalg as la
from .base_quantum import BaseQuantum
from .geometry import product
from .routines import _density, generate_pauli
class Qobj(BaseQuantum):
"""Basic class for representing quantum objects, such as quantum states and me... |
import mysql.connector
import time
import os
meu_db = ('sysfba',)#podem ser adicionados mais bancos de dados, contando que especifique durante o programa a posição [0]zero
def conecta_db(db=None):
if db == None:
banco = mysql.connector.connect(
host="localhost",
user="root"... |
import pandas as pd, numpy as np
import os,sys,random,pickle,time,glob,gc,shutil
import seaborn as sns
import matplotlib.pyplot as plt
from tqdm.auto import tqdm
import tsai
from tsai.all import *
from sklearn.model_selection import KFold,StratifiedKFold
import sklearn.metrics as skm
from sklearn import preprocessing... |
from discord.ext import commands
import discord
import lavalink
import asyncio
from discord import utils
from discord import Embed
import fileRead
import re
url_rx = re.compile(r'https?://(?:www\.)?.+')
"""
<NAME>. File to contain all functions relating to a playlist.
The actual playl command has been moved to music no... |
import re
from django.conf import settings
from django.contrib.contenttypes.models import ContentType
from django.db.models.query import QuerySet
from django.urls import reverse
from rest_framework import serializers
from reversion.models import Version
from apis_core.apis_labels.serializers import LabelSerializerLeg... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
@author: jiankaiwang
@Note:
install `pip install gym`
install `pip install atari-py` first.
"""
import tensorflow as tf
import gym
import tensorflow.contrib.slim as slim
import cv2
import numpy as np
import random
import tqdm
import copy
# In[]
... |
import torch
import torch.nn as nn
import torch.nn.functional as F
def general_weight_initialization(module: nn.Module):
if isinstance(module, (nn.BatchNorm1d, nn.BatchNorm2d)):
if module.weight is not None:
nn.init.uniform_(module.weight)
if module.bias is not None:
nn.ini... |
#-------------------------------------------------------------------------------
# This module contains two Drop Size Distribution (DSD) models,
# namely, Gamma and Marshal-Palmer DSD for different rainfall types.
#
# The number and size of raindrops within a unit volume is described by
# the number concentration,... |
# -*- coding: latin-1 -*-
############################################################################
# Gnocis
# <NAME>, 2018-2019
# <EMAIL>
############################################################################
progressTasks = []
class progressTask:
def __init__(self, desc, steps):
self.desc = desc
sel... |
"""Provide trimming of input reads from Fastq or BAM files.
"""
import os
import contextlib
from bcbio.utils import (file_exists, save_diskspace, safe_makedir,
replace_suffix, append_stem, is_pair,
replace_directory, map_wrap)
from bcbio.log import logger
from bcbio.bam... |
#
# Copyright (c) 2012-2021 Snowflake Computing Inc. All rights reserved.
#
from __future__ import division
import json
import os
import xml.etree.cElementTree as ET
from datetime import datetime
from logging import getLogger
from random import choice
from string import hexdigits
from typing import TYPE_CHECKING, Any... |
import tkinter as tk
# Variables
topFuncButtons = []
vertFuncButtons = []
numButtonRows = []
numButtons = []
finalNumButtons = []
window = tk.Tk()
topTextText = tk.StringVar()
bottomTextText = tk.StringVar()
numberStack = []
operatorStack = []
# button helper functions
def operatorToStack():
# a... |
import logging
import numpy as np
import scipy.stats as stats
from ..distribution import Distribution
from .. import Tree
class TSSB(Tree, Distribution):
def __init__(self, depth_function, parameter_process, max_depth=20, *args, **kwargs):
super(TSSB, self).__init__(*args, **kwargs)
self.depth_fu... |
import os
from typing import Any, Dict
from . import globalSkill
from ..kernel import core
from .jobclass import adventurer
from .jobbranch import magicians
from ..status.ability import Ability_tool
from ..character import characterKernel as ck
from ..execution.rules import RuleSet, MutualRule, InactiveRule
class P... |
# Import libraries
from dataclasses import dataclass
import numpy as np
import seaborn as sb
from h5py import File
from matplotlib import pyplot as plt
from matplotlib.gridspec import GridSpec
from pandas import DataFrame
from sklearn.preprocessing import MinMaxScaler
from tensorflow.keras import Input, Model
from ten... |
#!/usr/bin/python
import os
import inspect
import sys
import pytest
import mock
from mock import sentinel
import tempfile
@pytest.fixture
def ssh():
from dibctl import ssh
return ssh
@pytest.mark.parametrize('ip, port, user, output', [
['192.168.1.1', 22, 'user', 'user@192.168.1.1'],
['192.168.1.1',... |
"""
NanoTRF is a pipeline for de novo identification and sequence assembly of high-copy tandem repeats in raw data ONT plant DNA data,
to calculate TRs copy number variation and assembly consensus sequences for further analyses (e.g. FISH).
NanoTRF-based TRs search and reconstruction of the consensus sequences has 9 m... |
# last edited: 04/10/2021
#
# The functions pca_initial, pca_initial_, pca_final, and pca_final_ are adapted
# from a post by <NAME> here:
# https://nirpyresearch.com/classification-nir-spectra-principal-component-analysis-python/
#
# Retrieved in December 2020 and is licensed under Creative Commons Attribution 4.0
# I... |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
# -----------------------------------------------------------------------------
#
# P A G E B O T E X A M P L E S
#
# Copyright (c) 2016+ <NAME> + <NAME>
# www.pagebot.io
# Licensed under MIT conditions
#
# Supporting DrawBot, www.drawbot.com
# Supp... |
# -*- coding: utf-8 -*-
"""
Copyright (c) 2020 MeteoSwiss, contributors listed in AUTHORS.
Distributed under the terms of the BSD 3-Clause License.
SPDX-License-Identifier: BSD-3-Clause
"""
# Import from other Python find_packages
from pathlib import Path
from datetime import datetime
import numpy as np
# Import fr... |
#!/usr/bin/python
#
# Copyright (c) 2019 <NAME>, <<EMAIL>>
#
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = '''
---
module: azure_rm_devtestlab
version_added: "0.1.2"
sh... |
# coding=utf-8
# Copyright 2020 HuggingFace Datasets 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 applica... |
# Copyright 2014 Open Source Robotics Foundation, 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... |
import tensorflow as tf
from . import discriminator
from . import generator
from . import utils
from .print_object import print_obj
def train_network(loss, global_step, alpha_var, params, scope):
"""Trains network and returns loss and train op.
Args:
loss: tensor, shape of [].
global_step: t... |
#! /bin/env python
# -*- coding: utf-8 -*-
"""
rule -
"""
import logging
from django.http import JsonResponse
from django.utils.encoding import force_text
from django.utils.translation import ugettext_lazy as _
from django.views import View
from django.views.generic import TemplateView
from lxml.etree import XMLSynta... |
import os
from datetime import datetime, timedelta
from django.db import models
from django.core.exceptions import PermissionDenied, ValidationError
from mezzanine.conf import settings
from hs_core.signals import pre_check_bag_flag
class ResourceIRODSMixin(models.Model):
""" This contains iRODS methods to be i... |
from __future__ import print_function
import sys
import os
import keras
import numpy as np
# fix random seed for reproducibility
seed = 42
np.random.seed(seed)
from optparse import OptionParser
import h5py
from keras.optimizers import Adam, Nadam
from callbacks import all_callbacks
import pandas as pd
from keras.layers... |
# Copyright (c) Pelagicore AB 2016
import logging
from .parser.TListener import TListener
from .parser.TParser import TParser
from .domain import *
from antlr4 import ParserRuleContext
import yaml
import click
from .profile import get_features, EProfile, EFeature
import codecs
import json
try:
from yaml import CS... |
#
# progress.py WJ118
#
# * written by <NAME> <<EMAIL>>
# * This is free and unencumbered software released into the public domain.
# Please refer to http://unlicense.org/
#
'''progress meters'''
import os
import time
import threading
from typing import Callable
_FPS_RATE = 4
class Meter:
'''base cl... |
from django.http import Http404, HttpResponseRedirect, HttpResponse
from django_mako_plus.controller import view_function
import homepage.models as hmod
from django_mako_plus.controller.router import get_renderer
from django import forms
from django.contrib.auth.decorators import permission_required
from django.forms.e... |
#!/usr/bin/env python3
# coding: utf-8
"""
Test dls class
Copyright 2017 MicaSense, Inc.
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 righ... |
# Copyright 2008-2015 Nokia Networks
# Copyright 2016- Robot Framework Foundation
#
# 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
... |
# Copyright 2019 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
import re
from docutils import nodes
from functools import partial
from sphinx.util.docfields import _is_single_paragraph
from sphinx.util import docfields
from sphinx import directives, addnodes
from sphinx import addnodes
from sphinx.addnodes import desc, desc_signature
from .utils import transform_node as _transfo... |
import numpy as np
import platform
import json
import sys
import os
import copy
import argparse
import time
os.environ["KERAS_BACKEND"] = "tensorflow"
from keras.callbacks import ModelCheckpoint, Callback, LearningRateScheduler
from keras.models import model_from_json
from keras.utils import plot_model
from keras.op... |
# -*- coding: utf-8 -*-
"""Parser for Windows WinSearchDB files."""
from __future__ import unicode_literals
from dfdatetime import filetime as dfdatetime_filetime
from dfdatetime import semantic_time as dfdatetime_semantic_time
from plaso.containers import events
from plaso.containers import time_events
from plaso.l... |
########################################################################################################
####
#### if running in spyder please set console working dir before running the program
####
########################################################################################################
import os
impo... |
# Copyright (C) 2013 Google Inc., authors, and contributors <see AUTHORS file>
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
# Created By: <EMAIL>
# Maintained By: <EMAIL>
import datetime
from flask import session, Blueprint
import sqlalchemy.orm
from ggrc import db, settings
from ggrc... |
# -*- coding: utf-8 -*-
"""
Created on Tue Aug 20 10:52:09 2019
@author: <NAME>
"""
import requests, smtplib, os, datetime
import pandas as pd
from bs4 import *
import urllib.request as ur
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from matplotlib import pyplot as... |
# BSD-3-Clause License
#
# Copyright 2017 Orange
#
# 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 copyright notice,
# this list of conditions and the followi... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.