text stringlengths 3.07k 12.6k |
|---|
"""
Python = 3.8
Author: <NAME>
Db and template files are generated using the base name of the configuration file.
By default, the template file used will be the default template packaged with NALMS.
This may instead be specified.
"""
from lxml import etree
import sys
import os
import string
from importlib_resource... |
from keras import backend as K
from keras_applications.imagenet_utils import _obtain_input_shape, preprocess_input
from keras.layers import Activation, Conv2D, Add, Concatenate, GlobalAveragePooling2D, GlobalMaxPool2D
from keras.layers import Input, Dense, MaxPooling2D, AveragePooling2D, BatchNormalization, Lambda
from... |
# Copyright (c) 2013 <NAME>
# Copyright (c) 2014 <NAME>
# Copyright (c) 2014-2015 <NAME>
# Copyright (c) 2014 <NAME>
# Copyright (c) 2019 zordsdavini
#
# 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 ... |
from parsuite.core.argument import Argument,DefaultArguments,ArgumentGroup,MutuallyExclusiveArgumentGroup
from parsuite import helpers
from parsuite.core.suffix_printer import *
from parsuite.parsers.nmap import parse_nmap, parse_http_links as parse_nmap_links
from parsuite.parsers.nessus import parse_nessus, parse_htt... |
import re
from typing import Callable, Dict
def test_silver_example():
rules, messages = parse("example_silver.txt")
assembler = create_silver_assembler(rules)
assert "a" == assembler(4)
assert "b" == assembler(5)
assert "(ab|ba)" == assembler(3)
assert "(aa|bb)" == assembler(2)
assert "((... |
#!/usr/bin/env python
import sys
sys.dont_write_bytecode = True
sys.excepthook = sys.__excepthook__
import os
import fnmatch
"""
The following config_table contains a section for each machine/platform, which
always starts with
[machine name]
Follow this with "host_match" to match the current machine to one of the
e... |
# -*- coding: utf-8 -*-
"""
Functions to train the readout module to perform
tasks
@author: <NAME>
"""
import numpy as np
import pandas as pd
import scipy as sp
import mdp
from sklearn import metrics
from sklearn.model_selection import ParameterGrid
from sklearn.linear_model import Ridge, RidgeClassifier
from sklear... |
"""Utils for PyTorch"""
import numpy as np
import torch
def clip_eta(eta, norm, eps):
"""
PyTorch implementation of the clip_eta in utils_tf.
:param eta: Tensor
:param norm: np.inf, 1, or 2
:param eps: float
"""
if norm not in [np.inf, 1, 2]:
raise ValueError("norm must be np.in... |
#!/usr/bin/env python3
#
# Copyright (c) 2020-2022 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... |
import re
import subprocess
from typing import List
from .lnd_client import LndInfo
from .resources import ResourcesInfo
from .bitcoin_client import BitcoinInfo
WARNING_THRESHOLD = 0.9
MEGABYTE = 2**20
GIGABYTE = 2**30
TERABYTE = 2**40
RESET = "\033[0m"
RED = "\u001b[31m"
GREEN = "\u001b[32m"
YELLOW = "\u001b[33m"
... |
# coding: utf-8
# In[5]:
import pymongo
from pymongo import MongoClient
import json
import tweepy
import twitter
from pprint import pprint
import configparser
# In[6]:
config = configparser.ConfigParser()
config.read('config.ini')
CONSUMER_KEY = config['mytwitter']['api_key']
CONSUMER_SECRET = config['m... |
# 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 struct
import logging
import util
import util.primitives.bits as bits
import oscar
x09_name="Privacy management"
subcodes = {}
log = logging.getLogger('oscar.snac.x09')
@util.gen_sequence
def x09_init(o, sock, cb):
log.info('initializing')
me = (yield None); assert me
sock.send_sn... |
import http
from flask import Flask, jsonify, request
from flask_cors import CORS, cross_origin
from aggregator_service.average_aggregator import AverageAggregator
from data_source.database_source import DatabaseSource
from evaluator.evaluator import Evaluator
from extractor_service.rule_based_extractor import RuleBa... |
import json
import requests
from util import *
from partypost import redisCon
MESSAGE_URL = "https://graph.facebook.com/v2.11/me/messages"
HEADERS = {"Content-Type": "application/json"}
class Message:
def __init__(self):
pass
def getData(self):
data = dict()
data["recipient"] = dict... |
import json
import logging
import os
import re
from model import script_config
from model.model_helper import InvalidFileException
from model.script_config import get_sorted_config
from utils import os_utils, file_utils
from utils.file_utils import to_filename
from utils.string_utils import is_blank
LOGGER = logging.... |
#!/usr/bin/env python
#
# 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; version 2 of the License
#
# Author: <NAME> <<EMAIL>>
#
# Based on TAP13:
#
# Copyright 2013, Red Hat, Inc.
# Author: <NAM... |
import os
import shutil
from glob import glob
import torch
import pytorch_pretrained_bert
from pytorch_pretrained_bert import BertForPreTraining, BertConfig
from onir import util
def _hugging_handler(name, base_path, logger):
# Just use the default huggingface handler for model
return name
def _scibert_hand... |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
from django.http import HttpResponse
from .models import AuditFlow,Environment,WorkOrder,WorkOrderFlow
from django.contrib.auth.decorators import login_required
from skaccounts.permission import permission_verify
from .forms import WorkOrderCommit_form,WorkOrderC... |
#inPrime.py: script for designing insertional primer pools
#author: <NAME>, QVEU-NIAID-NIH
#USAGE: python3 inPrime.py ./sequenceFileAsSingleLine.txt OutputFileName.txt <insertion nt sequence> <startSite (1 indexed)> <endSite (1 indexed)>
#Imports
from Bio.SeqUtils import MeltingTemp
from Bio.Seq import Seq
import sys... |
from __future__ import print_function
from __future__ import absolute_import
import lldb
from lldbsuite.test.lldbtest import *
import lldbsuite.test.lldbutil as lldbutil
import lldbsuite.test.test_categories as test_categories
# System modules
import os
import textwrap
# Third-party modules
import io
# LLDB modules
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Module that contains manager to handle playblasts
"""
from __future__ import print_function, division, absolute_import
__author__ = "<NAME>"
__license__ = "MIT"
__maintainer__ = "<NAME>"
__email__ = "<EMAIL>"
import os
import logging
import tempfile
import tpDcc as... |
from weakref import proxy
from vnpy.trader.utils.datetime import *
from vnpy.trader.vtObject import VtBarData
class BarUtilsMixin(object):
def align_datetime(self, dt, freq):
return align_datetime(dt, freq)
def merge_bar_with_bar(self, bar1, bar2):
bar1.high = max(bar1.high, bar2.high)
... |
#!/usr/bin/env python3
# Copyright 2018 <NAME>, BMW AG
#
# 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 la... |
# Copyright 2019 Atalaya Tech, Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, ... |
# -*- coding: utf-8 -*-
from .preprocess import text_processing
from .bert.predict import bert_prediction
from .spacy.predict import spacy_prediction
from .crf_lstm.predict import crf_lstm_prediction
from .crf.predict import crf_prediction
from .diet.predict import diet_prediction
from nltk.tokenize import word_tokeniz... |
# -*- coding: utf-8; -*-
#
# The MIT License (MIT)
#
# Copyright (c) 2014 <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... |
# Utilities for dealing with Twitter archives
import json
# Goal is to have a mapping of filename to a tuple with
# (callable, pk=) triples, where the callable
# takes the JSON from that file and returns a dictionary
# of tables that should be created {"tabe": [rows-to-upsert]}
transformers = {}
def register(filenam... |
from __future__ import print_function
import re
from oauth2client.service_account import ServiceAccountCredentials
from oauth2client import file, client, tools
import pickle
import os.path
from googleapiclient.discovery import build
from google_auth_oauthlib.flow import InstalledAppFlow
from google.auth.transport.reque... |
import traceback
import click
import json
import os
from pathlib import Path
from random import randint
from time import sleep
from gcapi.gcapi import Client
def cli(input_path: str, output_dir: str, algorithm_title: str, upload_session_wait=600, job_wait=6000, token=None):
input_file_path = input_path
if no... |
import requests
import pandas as pd
from bs4 import BeautifulSoup
from quantUrls import quanturls
def appendDFToCSV_void(df, csvFilePath, sep=","):
import os
if not os.path.isfile(csvFilePath):
df.to_csv(csvFilePath, mode='a', encoding='utf-8', index=False, sep=sep)
elif len(df.columns) != len(pd.r... |
from Enums import Label
import itertools
import numpy as np
import os
import pickle
class Loader:
@staticmethod
def load_file(filename):
APP_ROOT = os.path.dirname(os.path.abspath(__file__)) # refers to application_top
APP_STATIC = os.path.join(APP_ROOT, 'static')
fh = open(os.path.jo... |
import numpy as np
import matplotlib.pyplot as plt
from scipy import optimize
from matplotlib.patches import Rectangle
from typing import Callable, Tuple
from mpl_toolkits.mplot3d import Axes3D
Point3D = Tuple[float, float, float]
Point2D = Tuple[float, float]
def plot_level_scattering_3d(foo: Callable[[Point3D], fl... |
"""NDG Security Obligation type definition
NERC DataGrid
"""
__author__ = "<NAME>"
__date__ = "24/02/10"
__copyright__ = "(C) 2010 Science and Technology Facilities Council"
__contact__ = "<EMAIL>"
__license__ = "BSD - see LICENSE file in top-level directory"
__contact__ = "<EMAIL>"
__revision__ = "$Id$"
from ndg.xacm... |
from logging import getLogger
from importlib import import_module
from urllib.request import HTTPCookieProcessor
from .common import alias, url_to_module
from .videoinfo import VideoInfo
from .util.http import add_default_handler, remove_default_handler, \
install_default_handlers, fake_headers,... |
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... |
import twitter
import yfinance
from sqlalchemy import create_engine
import pandas as pd
from datetime import datetime, timedelta
import pytz
from requests import get
from bs4 import BeautifulSoup as bs
import json
def get_tweet_history(username):
api_key = "l6W2qcWFlQIvj7wVbkQu4t9qo"
api_key_secret = "<KEY>"
... |
import datetime
import enum
import pathlib
import re
import shutil
import subprocess
import urllib.parse
import flask
import hurry.filesize
import loguru
FOLDER_DOWNLOADS = "downloads"
FOLDER_WGET_LOGS = "wget_logs"
ESCAPED_NAME_SEPARATOR = "|"
IGNORED_FILES = (".ds_store", "._.ds_store")
class RemoteFile:
def ... |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... |
import logging
import sys
import threading
import time
import paho.mqtt.client as mqtt
from django.core.management.base import OutputWrapper
from django.core.management.color import color_style
from rest_framework import serializers
from rest_framework.renderers import JSONRenderer
logger = logging.getLogger(__name... |
import pandas
import numpy as np
import matplotlib.pyplot as plt
import argparse
from matplotlib import rc
from matplotlib.lines import Line2D
import os
rc('text', usetex=True)
rc('font', size=16)
_BASE_PATH = ".."
def df_columns_to_numpy(frame, columns, dtype=np.int):
col_arrays = []
for col in columns:
... |
# -*- coding: utf-8 -*-
from __future__ import division, print_function, absolute_import
import json
import math
import os
import sys
import cv2
import numpy as np
import tensorflow as tf
sys.path.append('../../../')
from alpharotate.utils.tools import makedirs, view_bar
tf.app.flags.DEFINE_string('root_dir', '/da... |
import json
import random
import hashlib
from Model.util import log_message
from Model.ChromeModel.JSON.base import (
BaseJSONHandler,
BaseJSONClass,
BaseAttribute,
Caretaker,
OTHER,
DT_SEC,
DT_SIMPLE_STRING,
DT_WEBKIT,
DT_WEBKIT_SEC,
DT_SEC_DOT_MICRO
)
NAME = "Name"
TYP = "Typ... |
#!/usr/bin/python
# #*** <License> ************************************************************#
# This module is part of the repository CNDB.
#
# This module is licensed under the terms of the BSD 3-Clause License
# <http://www.c-tanzer.at/license/bsd_3c.html>.
# #*** </License> ***************************************... |
import matplotlib.pyplot as plt
from matplotlib.lines import Line2D
import numpy as np
from visdom import Visdom
def show_images(images, labels):
"""Show image with label
Args:
images = input images
labels = input labels
Output:
plt = concatenated image and label """
plt.imsh... |
"""Keras."""
import argparse
import functools
import os
import tensorflow as tf
tf.logging.set_verbosity(tf.logging.INFO)
def parse(example_proto):
features = tf.parse_single_example(
example_proto,
features={
'image': tf.FixedLenFeature([], tf.string),
'label': tf.FixedLenFeature(... |
# -*- coding: utf-8 ; test-case-name: bridgedb.test.test_configure -*-
#
# This file is part of BridgeDB, a Tor bridge distribution system.
#
# :authors: please see the AUTHORS file for attributions
# :copyright: (c) 2013-2015, Isis Lovecruft
# (c) 2013-2015, <NAME>
# (c) 2007-2015, <NAME>
# ... |
# Copyright 2013 Red Hat, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by... |
import torch
import numpy as np
import torch.nn as nn
import torch.nn.functional as F
from fvcore.nn import sigmoid_focal_loss_jit
class CategoryLoss(nn.Module):
"""
The Focal loss for category loss
"""
def __init__(self, alpha=0.25, gamma=2., reduction='none'):
super(CategoryLoss, self).__init... |
import hashlib
import os
import pathlib
from flask import request, jsonify, Blueprint
from werkzeug.utils import secure_filename
from models.FileModel import FileModel, FileSchema
ALLOWED_EXTENSIONS = {'txt', 'pdf', 'png', 'jpg', 'jpeg', 'gif', 'exe', 'zip'}
file_api = Blueprint('safe_files', __name__)
file_schema = ... |
#!/usr/bin/env python3
import argparse
import csv
import os
import re
# Data Quality - just like water quality! - is very poor
# Each file is just _slightly_ different from each other file
# some have _ in the name, some have [space], some are "Return", some "Returns"
# some have a blank first field, some have extra... |
import os
import glob
from PIL import Image
import torch
from torch.utils.data import Dataset,DataLoader
import numpy as np
from torchvision import transforms as T
import torchvision
import cv2
from PIL import ImageFile
ImageFile.LOAD_TRUNCATED_IMAGES = True
from config import Config
import random
import warnings
warni... |
# Copyright 2021 The Kubeflow 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... |
# ==============================================================================
# Copyright (c) Microsoft. All rights reserved.
# Licensed under the MIT license. See LICENSE.md file in the project root
# for full license information.
# ==============================================================================
im... |
# Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the LICENSE file in
# the root directory of this source tree. An additional grant of patent rights
# can be found in the PATENTS file in the same directory.
import numpy as np
import torch
f... |
from biostar.accounts.tasks import create_messages
from biostar.emailer.tasks import send_email
import time
from biostar.utils.decorators import spool, timer
from django.db.models import Q
#
# Do not use logging in tasks! Deadlocking may occur!
#
# https://github.com/unbit/uwsgi/issues/1369
def message(msg, level... |
import gym
import numpy as np
from parl import layers
from paddle import fluid
import parl
from parl.utils import logger, summary,ReplayMemory
from parl.algorithms import SAC
import argparse
ACTOR_LR = 1e-4
CRITIC_LR = 1e-4
gamma = 0.99
TAU = 0.005
replay_size = int(2e6)
start_steps = 1e4
REWARD_SCALE = 5.0 ... |
# coding: utf-8
# In[1]:
from __future__ import print_function
import torch
import torch.optim as optim
from torch.utils.data.dataset import Dataset
import pandas as pd
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F
from torch.utils.data import DataLoader
import matplotlib.pyplo... |
import math
import uuid
from typing import Dict, List, cast
import networkx as nx
import numpy as np
import pandas as pd
from app.types import Node
from app.utils.timer import use_timing
from collections import Counter
import itertools
@use_timing
def get_labels(df: pd.DataFrame, feature: str, isFeatur... |
import copy
from enum import Enum
class Table:
"""Represents a table with foreign key and primary key relationships"""
def __init__(self, table_name, primary_key=["id"], table_nn_attribute=None, table_size=1000, csv_file_location=None,
attributes=None, irrelevant_attributes=None, kee... |
import matplotlib.pyplot as plt
import random
import scipy.optimize
import numpy as np
import math
from risk_calculation.sigmoid import bounded_sigmoid
def curve_fit(x, y):
p0 = [np.median(x), 1]
return scipy.optimize.curve_fit(bounded_sigmoid, x, y, p0, method='dogbox')
def max_likelihood_conditional_fit(x... |
# Copyright 2020 Xanadu Quantum Technologies 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 agre... |
# Hexapod Model
# Representation of the hexapod's shape and state.
# ALL UNITS IN MM
#
# <NAME>
import numpy as np;
from pyrr import Quaternion, Vector3;
from movement import HexapodMotionPlanner;
from stepping import HexapodStepMotionPlanner;
from referenceframe import ReferenceFrame;
class Hexapod(objec... |
# coding=utf-8
# Copyright 2019 Deepmind Technologies Limited.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applic... |
import pygame
import os
import board
import ai_handler
import asyncio
HUMAN_PLAYER = 2
AI_PLAYER = 3
SCREEN_WIDTH = 700
SCREEN_HEIGHT = 700
CELL_DIMENSION = 100
WHITE = (255,255,255)
BLACK = (0,0,0)
RED = (255,0,0)
GREEN = (0,255,0)
GRASS_GREEN = (51,204,51)
BLUE = (0,0,255)
BROWN = (153,102,51)
LIGHT_GREY = (224,22... |
#!/usr/bin/env python3
"""
@summary: how to send a signed transaction
@version: v03 (6/March/2020)
@since: 6/March/2020
@author: https://github.com/drandreaskrueger
@see: https://github.com/drandreaskrueger/chainhammer-substrate for updates
"""
import time, sys
from threading import Thread
from queue import Qu... |
# -*- coding: utf-8 -*-
# Copyright 2012-2013 <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 a... |
from __future__ import print_function
from __future__ import with_statement
import os
import math
import numpy
from tqdm import tqdm
from PIL import Image
from configparser import ConfigParser
from tigre.utilities.geometry import Geometry
def NikonDataLoader(filepath, **kwargs):
# NikonDataLoader(filepath) Load... |
# PLEASE STOP!
# DO NOT EDIT THIS FILE
# Create a new config.py file in same dir and import, then extend this class.
import os
from telethon.tl.types import ChatBannedRights
class Config((object)):
LOGGER = True
APP_ID = int(os.environ.get("APP_ID", 6))
API_HASH = os.environ.get("API_HASH", "eb06d4abfb49... |
import os
import numpy as np
def cleanUponError(writefile):
def clean_writefile(*args, **kwargs):
if os.path.exists(args[0]) and ('debug' in kwargs.keys()) and kwargs['debug']:
print(f'warning: overwiting existing {args[0]}')
try:
writefile(*args, **kwargs)
except:
... |
from typing import Optional
import haiku as hk
import jax
import jax.numpy as jnp
"""
This file contains our custom complex valued GRU and associated complex activations
and initialization schemes. The specifics of the setup are based on this paper
https://openreview.net/attachment?id=H1T2hmZAb&name=pdf.
"""
# split... |
from pathlib import Path
import pygame
from src.constants import *
class ScoreTable:
def __init__(self):
# Username Input Box
self.username = ''
self.input_box = pygame.Rect(90, 230, 140, 32)
self.box_start = self.input_box.x
self.input_box_active = False
self.col... |
"""
Evaluates the softmax baseline models generated during training.
This code is based on the Inception tutorial in the tensorflow/models repository.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from datetime import datetime
import math
import tim... |
from clld.lib.bibtex import Record
PUBLICATIONS = [
Record(
'ARTICLE', 'HammarstroemEtAl2011Oslo',
('author', u'<NAME> and <NAME>'),
('year', '2011'),
('title', 'LangDoc: Bibliographic Infrastructure for Linguistic Typology'),
('journal', 'Oslo Studies in Language'),
... |
import numpy as np
import matplotlib.pyplot as plt
import scipy.optimize
import gasdynamics as gd
from heat_flux import heat_flux
from plug_nozzle_angelino import plug_nozzle
import MOC
## NASA CEA CONSTANTS
class CEA_constants():
def __init__(self,gamma,T_c,p_c,rho_c,a_c,Pr,cp,c,w):
self.gamma = gamma
self.T_... |
import socket
import struct
import os
import logging
from contextlib import closing
from enum import IntEnum
try:
import gdb
except ImportError:
pass
class ReqType(IntEnum):
INVALID = 2
NONE = 3
ADD = 4
GETPRIV = 5
SETPRIV = 6
GET = 7
STORE = 8
LOAD... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import argparse
import functools
import gdb
import six
import pwndbg.chain
import pwndbg.color
import pwndbg.enhance
impor... |
import tensorflow as tf
import cv2 as cv
import numpy as np
import random
from superpoint.datasets.utils import photometric_augmentation as photaug
from superpoint.models.homographies import (sample_homography, compute_valid_mask,
warp_points, filter_points)
from superpoint.... |
# -------------------------------------------------------------------------
#
# Part of the CodeChecker project, under the Apache License v2.0 with
# LLVM Exceptions. See LICENSE for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
#
# ---------------------------------------------------... |
import tensorflow as tf
from tensorflow.contrib import rnn
import numpy as np
import math
event_len = 40
pitch_num = 120
tick_num = 12
data_size = pitch_num * 2 + tick_num
hidden_size = 300
epochs = 20000
num_layers = 2
batch_size = 16
print("Making Graph")
x = tf.placeholder("float", [None, event_len, data_size])
l... |
# coding: utf-8
from .singleton import Singleton
from .basic import Basic
from sympy.core.compatibility import with_metaclass
import numpy
# TODO [YG, 12.03.2020] verify why we need all these types
# NOTE: symbols not used in pyccel are commented out
__all__ = (
#
# --------- CLASSES -----------
#
'CustomDataTy... |
# <NAME> 2014-2020
# mlxtend Machine Learning Library Extensions
#
# Bootstrap functions
# Author: <NAME> <<EMAIL>>
#
# License: BSD 3 clause
import numpy as np
from .bootstrap_outofbag import BootstrapOutOfBag
from sklearn.base import clone
from itertools import product
def _check_arrays(X, y=None):
if isinstan... |
# -*- coding: utf-8 -*-
"""Test base."""
#------------------------------------------------------------------------------
# Imports
#------------------------------------------------------------------------------
import logging
import numpy as np
from pytest import fixture
from ..base import BaseVisual, GLSLInserte... |
#!/usr/bin/python
"""
Merges expression values for overlapping group of genes. See for details:
Christelle, and Watson. "Errors in RNA-Seq quantification affect genes of
relevance to human disease." Genome Biology 16.1 (2015): 177.
# List mmquant.in:
gene sample1 sample2
gene00 1 2
gene02 1 2
gene05 1 2
gene07 10 20... |
import sys
from copy import deepcopy
from pathlib import Path
import numpy as np
import torch
from agent.memory.DreamerMemory import DreamerMemory
from agent.models.DreamerModel import DreamerModel
from agent.optim.loss import model_loss, actor_loss, value_loss, actor_rollout
from agent.optim.utils import advantage
f... |
# -*- coding: utf-8 -*-
import os
from typing import Any, Callable, Dict, List, Mapping, Optional
import faker
import pytest
from fastapi import FastAPI
from fastapi.testclient import TestClient
from bildungslogin_plugin.backend import UserNotFound
from bildungslogin_plugin.models import Class, SchoolContext, User, ... |
"""
Module for configuring DNS Client on Windows systems
"""
def __virtual__():
"""
Load if the module win_dns_client is loaded
"""
if "win_dns_client.add_dns" in __salt__:
return "win_dns_client"
return (False, "win_dns_client module could not be loaded")
def dns_exists(name, servers=No... |
from lan_ast import *
precedence = (
('left', 'PLUS', 'MINUS'),
('left', 'TIMES', 'DIVIDE'),
)
def p_first(p):
""" first : top_level
"""
p[0] = FileAST([]) if p[1] is None else FileAST(p[1])
def p_top_level(p):
""" top_level : top_level comment
| top_level function_declaration
| to... |
# Python - 3.4.3
class Interpreter:
DEFAULT_RETURN_VALUE = -1
COMMENT_CHAR = ';'
QUOTES_CHAR = "'"
PARAM_SPLIT_CHAR = ','
LABEL_CHAR = ':'
TOKEN_SPLIT_CHARS = ' \t' + PARAM_SPLIT_CHAR + COMMENT_CHAR + LABEL_CHAR
SHORT_TOKEN_SPLIT_CHARS = PARAM_SPLIT_CHAR + COMMENT_CHAR
def __init__(sel... |
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
import logging
import pathlib
import shlex
import signal
import subprocess
import time
from dataclasses import dataclass
from typing import Dict, List, Optional, Union
import spur # type: ignore
from assertpy.assertpy import AssertionBuilder, a... |
"""
Functions for exception manipulation + custom exceptions used by PyScaffold to identify
common deviations from the expected behavior.
"""
import functools
import logging
import sys
import traceback
from pathlib import Path
from typing import Optional, Sequence, Union, cast
if sys.version_info[:2] >= (3, 8):
# ... |
from __future__ import division, print_function, absolute_import
import pdb
import copy
from collections import OrderedDict
import torch
import torch.nn as nn
import numpy as np
from types import SimpleNamespace
from automl.core.operations import SPP
def helloworld(msg="hello"):
print(f'hello world with mgs: {... |
"""
Contains classes and functions that are intended as utilities.
"""
import itertools
import logging
import os
import string
import sys
from itertools import zip_longest
class ColorizingLogFormatter(logging.Formatter):
"""
Represents an implementation of :class: 'Formatter' that adds color
capability to... |
from mido import Message, MidiFile, MidiTrack
import numpy as np
import mido
import os.path
import pickle
# last key is 'split' key (indicates when to move to next line)
keys = ["!", "$", "%", "&", "(", ")", "*", "+", ",", "-", ".", "/", "0", "1", "2", "3", "4", "5", "6",
"7", "8", "9", ":", ";", "<", "=", ">"... |
# Copyright 2017-2021 TensorHub, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... |
#!/usr/bin/env python
# -*- coding:utf-8 -*-
from __future__ import print_function
from google.cloud import datastore
from WorkPool import WorkPool
from PriceCrawlingJob import PriceCrawlingJob
import datetime
import getopt
import json
import os
import sys
import time
import urllib2
def commit_computed_data(entities... |
import os
from collections import Counter
from copy import deepcopy
from os.path import exists
from pathlib import Path
from typing import List, Tuple
import numpy
import zarr
import dask.array as da
from aydin.util.log.log import lprint
def is_zarr_storage(input_path):
"""Method to check if given file is a zarr... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2021, <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 = r'''
---
module: hana_query
short_descr... |
"""
Copyright 2022-present ImNimboss
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, ... |
#
# Copyright (c) 2019 by Delphix. All rights reserved.
#
class PlatformError(Exception):
"""This error should be converted and thrown as a Delphix Fatal exception
if it gets converted through protobuf.
Some Platform specific errors (operations not implemented errors,
specifically) should have been v... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.