text stringlengths 3.07k 22.1k |
|---|
from simple_slack_bot.simple_slack_bot import SimpleSlackBot
import random
import requests
import re
import pyjosa
import time
import threading
from bs4 import BeautifulSoup
simple_slack_bot = SimpleSlackBot(debug=True)
@simple_slack_bot.register("hello")
def hello_callback(request):
request.write("너하-! 난 너굴맨이라구... |
import sys
import math
import attr
from beastling.util import xml
__all__ = ['Distribution', 'Calibration']
registered_distributions = (
("Beta", "beast.math.distributions.Beta"),
("Exponential", "beast.math.distributions.Exponential"),
("InverseGamma", "beast.math.distributions.InverseGamma"),
("Lo... |
import datetime
import os.path
import pickle
import sys
import webbrowser
from closeio_api import Client
from google.auth.transport.requests import Request
from google_auth_oauthlib.flow import InstalledAppFlow
from googleapiclient.discovery import build
CLOSE_API_KEY = sys.argv[1] # Provide API key as a parameter
C... |
from __future__ import print_function
#
# skpp.py - Helper for implementing Skopos plugins as python modules
#
# Copyright (c) 2017, Datagrid Systems, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions a... |
import os
import numpy as np
import gym
from gym import error, spaces
from gym.utils import seeding
from gym.envs.robotics import rotations, robot_env, utils
def goal_distance(goal_a, goal_b):
assert goal_a.shape == goal_b.shape
return np.linalg.norm(goal_a - goal_b, axis=-1)
class HaroldEnv(robot_env.Robot... |
import random
import time
import dateutil.parser
from hashlib import sha1
from hexdump_canonical import hexdump_canonical
import sys # TODO raise Exception
# https://github.com/dulwich/dulwich/blob/master/dulwich/objects.py
# https://www.samba.org/~jelmer/dulwich/docs/tutorial/file-format.html
# http://www-cs-student... |
# Aplicativo Streamlit House Rocket
import folium
import geopandas
import webbrowser
import numpy as np
import pandas as pd
import streamlit as st
import plotly_express as px
from matplotlib import pyplot as plt
from datetime import datetime
from streamlit_folium import folium_s... |
# text_transform
import re
import string
import unicodedata
import ftfy
from typing import List, Tuple, Optional, Any
import pandas as pd
from taxonomy import Taxonomy
from local_translation_context import LocalTranslationContext
from taxonomy_token_identify import TaxonomyTokenIdentify
def pre_process_line(line) ... |
# engine/default.py
# Copyright (C) 2005, 2006, 2007 <NAME> <EMAIL>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
from sqlalchemy import schema, exceptions, util, sql, types
import StringIO, sys, re
from sqlalchemy.engine import base
... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Jan 20 19:04:56 2019
@author: tc
%%bash
catalyst ingest-exchange -x binance -i xrp_usdt -f minute
catalyst ingest-exchange -x binance -i btc_usdt -f minute
"""
# import os
from datetime import datetime
import pytz
import pandas as pd
from catalyst.u... |
from collections import namedtuple, OrderedDict
import copy
import logging
import json
import os
import re
import boto3
from botocore.exceptions import ClientError
from jinja2 import Environment, DictLoader, FileSystemLoader
import jsonref
from lambda_uploader import package, uploader
from retrying import retry
import... |
import os
from messgen import MessgenException
def to_camelcase(str):
return ''.join(x for x in str.title().replace('_', '') if not x.isspace())
def fmt_int8(var, t_info):
return "buf[ptr] = byte(v.%s)" % var
def parse_int8(t_info):
return " = %s(buf[ptr])" % t_info["element_type"]
def fmt_int(var,... |
#!/usr/bin/env python3
import polyinterface
import sys
import logging
import paho.mqtt.client as mqtt
import json
LOGGER = polyinterface.LOGGER
class Controller(polyinterface.Controller):
def __init__(self, polyglot):
super().__init__(polyglot)
self.name = 'MQTT Controller'
self.address =... |
import numbers
import numpy as np
import torch
from functools import reduce
from torch.optim import Optimizer
from scipy import optimize
from torch._vmap_internals import _vmap
from torch.autograd.functional import (_construct_standard_basis_for,
_grad_postprocess, _tuple_postproc... |
#!/usr/bin/env python
"""Tool to broadcast deployments specified in yaml files."""
import base64
import socket
import struct
import argparse
import time
import os
import io
import hashlib
import re
import msgpack
import yaml
INTER_DEPLOYMENT_WAIT_TIME_MS = 5000
MIN_DEPLOYMENT_LIFETIME = 10000
def main():
"""Load... |
import argparse, os, cv2, re, ast
import utils.db_utils as db_utils
import pandas as pd
import numpy as np
import math, subprocess
from pathlib import Path
from datetime import date
from kso_utils.zooniverse_utils import auth_session
from panoptes_client import (
SubjectSet,
Subject,
Project,
Panoptes,... |
import json
import random
from torch.utils.data import Subset
from tqdm import tqdm
class InputExample(object):
"""A single training/test example for simple sequence classification."""
def __init__(self, guid, text_a, text_b=None, label=None):
"""Constructs a InputExample.
Args:
gu... |
from ..conversions import hex_to_bytes
from ..set5.challenge36 import bytes_to_num, num_to_bytes, sha256_hash
from ..set5.challenge39 import rsa_decrypt, rsa_encrypt, rsa_generate_keys
from ..set5.challenge40 import integer_cube_root
# taken from https://tools.ietf.org/html/rfc3447#section-9.2
ASN1_IDENTIFIER_SHA256 =... |
"""
<NAME>
<NAME>
CS 535
Note: several characteristics of the memory classes
are not designed to be customized, such as:
- word size is 32 bits
- memory is word addressable
- Caching is write-through (write hit -> immediate write to cache and memory)
and no allocate (write miss -> write immediatel... |
import urllib.request
from urllib.request import build_opener, HTTPCookieProcessor
from bs4 import BeautifulSoup as BS
import re
import json
import requests
import pandas as pd
from cosmosclient import CosmosClient as cc
from cosmosclient import BlobStorageClient as bc
from azure.storage.blob import BlobServic... |
#!/usr/bin/python3
import argparse
import pathlib
import json
import pprint
import os
import subprocess
ARCH_DIR = pathlib.Path('arch').resolve()
BIN_DIR = pathlib.Path('bin').resolve()
BUILD_DIR = pathlib.Path('.build').resolve()
INCLUDE_DIR = pathlib.Path('include').resolve()
SRC_DIR = pathlib.Path('src').resolve()
... |
import os
import pathlib
import re
from io import StringIO
from typing import Any, Optional
import click
import numpy as np
import tomlkit as toml
import yaml
from .input_reader import TimeVaryingConfig
from .plot import plot_strat
from .raster_model import load_model_params, load_params_from_strings
from .sequence_m... |
import os
import pygame
from FantasyStrategia.logic import unit
from FantasyStrategia.gui import texts
from PyWorld2D.mapobjects.objects import MapObject
std_material_cost = {'Deep water': float("inf"),
'Grass': 1.5,
'Rock': 3.5,
'Sand': 3.5,
... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri May 28 11:51:20 2021
@author: alejandrobertolet
"""
from os import listdir, path
import numpy as np
import matplotlib.pyplot as plt
import csv
import pkg_resources
DATA_PATH = pkg_resources.resource_filename('MIRD', 'VoxelSValues/')
class SValuesData... |
from datetime import timedelta
from inflection import camelize
from statsnba.api import Api
import gevent
from cached_property import cached_property
_async_fetch = True
__all__ = ['Game', 'Player', 'Team', 'Matchup']
# noinspection PyUnresolvedReferences
class Model(object):
"""Base class for other models such... |
import numpy as np
from menpo.rasterize.copengl import COpenGLRasterizer
from menpo.image import MaskedImage
# noinspection PyProtectedMember
from menpo.rasterize.base import TextureRasterInfo
class GLRasterizer(object):
def __init__(self, width=1024, height=768, model_matrix=None,
view_matrix... |
from itertools import groupby
from collections import defaultdict
from zope.interface import implementer
from sqlalchemy import (
Column,
Unicode,
Float,
Integer,
Boolean,
ForeignKey,
UniqueConstraint,
)
from sqlalchemy.orm import relationship
from sqlalchemy.ext.declarative import declared... |
# Najprej uvozimo vse potrebno v tekstovni vmesnik, ter pripravimo seznama, ki sta potrebna za delovanje programa.
# -------------------------------------------------------------------------------------------------------------------------------------#
from model import Knjiznica, Knjiga, povprecje
seznam_dejanj = []
... |
#! /usr/bin/env python3
from enum import Enum
#from numba import jit
from random import choice
class SolfeggioType (Enum):
RED = 0
ORANGE = 1
YELLOW = 2
GREEN = 3
BLUE = 4
VIOLET = 5
solfeggio_db = {
SolfeggioType.RED : ( 8, 2, 14),
SolfeggioType.ORANGE : ( 1, 7, 13),
SolfeggioType.YELLOW : ( 6... |
#!/usr/bin/env python3
# -*- mode: python -*-
# objReader.py, a plugin to read point and face data from a Wavefront
# OBJ file # (a 3D-structures file format) - jiw 9 Oct 2020 Ref:
# <https://www.fileformat.info/format/wavefrontobj/egff.htm>
# This program defines a data structure class (ObjFileData) and
# several me... |
#
# Copyright 2015 Quantopian, 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 wr... |
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: MIT-0
import os
import sys
import logging
import json
import base64
import uuid
from cv2 import imwrite
from datetime import datetime
from concurrent.futures import ThreadPoolExecutor, wait, as_completed
import requests
impo... |
from openfermion.ops import QubitOperator
from openfermion.linalg import qubit_operator_sparse
import numpy as np
from scipy.sparse.linalg import expm
from functools import reduce
from openfermion.utils import hermitian_conjugated
from quchem.Misc_functions.Misc_functions import sparse_allclose
from quchem.Unitary_Par... |
import numpy as np
import json
import scipy.stats as st
varCount = 0
_floatinfo = np.finfo(np.float64)
_intinfo = np.iinfo(np.int64)
_float_special_values = [0.0, 1.0, _floatinfo.min, _floatinfo.max, _floatinfo.max - 1.0, _floatinfo.min + 1.0,
_floatinfo.eps,
_floatinfo... |
# -*- coding: utf-8 -*-
import logging
from functools import partial
from email.utils import parseaddr
MANDRILL = False
try:
from mandrillit.api import send_constructed_mail
MANDRILL = True
except ImportError:
pass
from django.contrib import admin
from django.core.mail import get_connection
from django.u... |
import os
import pickle
import pprint
import random
from glob import glob
from os.path import exists, join
import numpy as np
import torch
import sklearn, sklearn.metrics
import sklearn.model_selection
from sklearn.metrics import roc_auc_score, accuracy_score
import torchxrayvision as xrv
from tqdm import tqdm as tqd... |
import pytest
from yarl.quoting import _py_quote, _py_unquote, _quote, _unquote
@pytest.fixture(params=[_py_quote, _quote], ids=['py_quote', 'c_quote'])
def quote(request):
return request.param
@pytest.fixture(params=[_py_unquote, _unquote],
ids=['py_unquote', 'c_unquote'])
def unquote(request)... |
##########################################################################
#
# Copyright (c) 2021, Cinesite VFX Ltd. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions ... |
import itertools
from keras import backend as K
from keras.backend import tf
from keras.models import load_model, Model
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import seaborn as sns
def plot(data, y_labels, title):
fig, ax = plt.subplots()
x_labels = [title[:-1] + "_" + str(i) f... |
from collections import defaultdict
import gzip
import os
import re
import subprocess
from django.conf import settings
from settings import JBROWSE_DATA_URL_ROOT
from settings import S3_BUCKET
from main.model_utils import get_dataset_with_type
from main.models import Dataset
from utils.bam_utils import sort_bam_by_co... |
from PyQt5.QtCore import Qt, pyqtSignal, pyqtBoundSignal
from PyQt5.QtGui import QFont, QIcon
from .qinputtracklist import QInputFiles
from .qfilterlist import QFilterList
from .qavailablefilters import QAvailableFilters
from .qoutputfiles import QOutputFiles
from .qoutputconfig import QOutputConfig
from PyQt5.QtWidge... |
# ======================================================================== #
# BLOSPRAY - OSPRay as a Blender render engine #
# <NAME>, SURFsara <<EMAIL>> #
# Property definition #
# =============================... |
import pandas as pd
from Bio import SeqIO
from Bio.Alphabet import IUPAC
import re
import pdb
import numpy as np
import os
import mpathic.qc as qc
import mpathic.utils as utils
from mpathic import SortSeqError
import time
def format_fasta(s):
'''Function which takes in the raw fastq format and returns only the seq... |
import os
import argparse
import time
from time import strftime, gmtime
import datetime
import random
import numpy as np
import torch
from torch.utils.data import DataLoader
import torch.nn as nn
import torch.optim as optim
import torchvision.transforms as transforms
from torchvision.models.detection import fasterrcn... |
from socket import *
import threading
RESERVED_KEYWORDS = ['SEND', 'ALL', 'REGISTER', 'TOSEND', 'TORECV', 'FORWARD', 'REGISTERED', 'ERROR']
UsernameToPortSend = {}
UsernameToPortRcv = {}
serverPort = 18000
serverSocket = socket(AF_INET, SOCK_STREAM)
serverSocket.bind(('localhost', serverPort))
serverSocket.listen()
pri... |
# Import dependencies
from PIL import Image
import numpy as np
import sys
# Get Filename
filename = sys.argv[1]
# Get Image by filename
im = np.array(Image.open(filename))
# SSD Function ( Also produces "unaligned image")
def ssd(im):
# Holder for the image manipulation
new_im = np.array([])
ssd_rg = np... |
r"""X as a third language reading assistant tool.
Translate the clipboard content
"""
# based on playground\shortcut-key-python\janus-ctrl-alt-g-activate.py
import asyncio
import re
from textwrap import fill
import janus
from pynput import keyboard
import pyperclip
# from pyperclip import copy, paste
# import langi... |
from __future__ import annotations
import scipy.signal as sig
import numpy as np
from .dsp import lowpass_cheby
import logging
from math import gcd
from typing import TYPE_CHECKING
if TYPE_CHECKING:
from typing import List, Optional as Opt, Callable
class BackendNotAvailable(Exception):
pass
logger = loggin... |
import sys
from sqlbuilder.smartsql.constants import OPERATOR
from sqlbuilder.smartsql.expressions import Alias, Concat, Value, datatypeof, func
from sqlbuilder.smartsql.operator_registry import operator_registry
from sqlbuilder.smartsql.operators import (
Binary, EscapeForLike, Like, ILike, All, Asc, Desc, Between... |
import logging
import os
import sys
import urllib
from netaddr import IPAddress, IPNetwork
from json import loads
from time import time
from yaml import safe_load
from boto3 import client as botoclient, resource as botoresource, session as botosession, Session as boto_Session
from boto3.resources.base import ServiceRe... |
# coding: utf-8
# /*##########################################################################
#
# Copyright (c) 2017 European Synchrotron Radiation Facility
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
#... |
import shutil
import WAnet.openwec
import numpy
import scipy.spatial
import sklearn.utils
import pkg_resources
import os
def generate_data():
data_dir = pkg_resources.resource_filename('WAnet', 'data')
if not os.path.exists(data_dir):
os.makedirs(data_dir)
# Save the current directory for later u... |
import tensorflow as tf
import tensorflow.contrib.layers as layers
import torchfile as th
def init_model_variables(file_path, trainable = True):
"""
Initialize all model variables of a given torch model. The torch model pre-trained on MPII or MPII+LSP can be
downloaded from author's pages: https://www.adr... |
#
# Class to handle Commands to a webbrick and retrieve data from a webbrick
#
# The aim is for this to provide low level webbrick access, this version uses
# HTTP exclusively, where as the original used UDP packets.
#
# o2m8.com
#
#
import logging
import httplib
# Action types.
AT_NONE = 0
AT_OFF = 1
AT_O... |
#!/usr/bin/env python3
import re
import os
import signal
import subprocess
import sys
import time
import argparse
import logging
import socket
import uuid
#from . import __version__
from pprint import pprint
from enum import Enum
from beaconsql import *
from log_dev_sql import *
application_name = 'PyBeacon'
#version ... |
"""MS COCOデータセット関連。
以下の3ファイルを解凍した結果を格納しているディレクトリのパスを受け取って色々処理をする。
- [train2017.zip](http://images.cocodataset.org/zips/train2017.zip)
- [val2017.zip](http://images.cocodataset.org/zips/val2017.zip)
- [annotations_trainval2017.zip](http://images.cocodataset.org/annotations/annotations_trainval2017.zip)
"""
import pat... |
# valueIterationAgents.py
# -----------------------
# Licensing Information: You are free to use or extend these projects for
# educational purposes provided that (1) you do not distribute or publish
# solutions, (2) you retain this notice, and (3) you provide clear
# attribution to UC Berkeley, including a link to ht... |
from boto3_docs_parser import Boto3DocsParser, parser, boto3_session
import json
import boto3
from typing import List, Callable
import inflect
from utils import camel_case_split
from collections import Counter
import factories
inflect_engine = inflect.engine() # used for same word comparing
AMBIGUOUS_PARAMETER_NAMES =... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2013 The Plaso Project Authors.
# Please see the AUTHORS file for details on individual 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 L... |
#!/usr/bin/python
from __future__ import (absolute_import, division, print_function)
# Copyright 2019-2020 Fortinet, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of th... |
""" Vampire Spawn Monster Class """
import unittest
from unittest.mock import patch
import colors
import dice
from pycs.attack import Action
from pycs.arena import Arena
from pycs.attack import MeleeAttack
from pycs.constant import Condition
from pycs.constant import DamageType
from pycs.constant import MonsterType
fro... |
import os
import boto3
import shutil
import argparse
import datetime
import time
import json
from datetime import datetime, timedelta
import logging
import zipfile
from PIL import Image
from PIL.ExifTags import TAGS
import random, string
logFormatter = '%(asctime)s - %(message)s'
logging.basicConfig(format=logFormatte... |
import pandas as pd
from datetime import date
import hashlib
from urllib.parse import urlparse
def fx_cleaning(daily_fx):
'''
This function gets a dirty Pandas
object and return a cleaned DataFrame
about DailyFx News.
'''
# Delete Unnamed column
daily_fx_mod = daily_fx.drop(['Unnamed: 0'],... |
import argparse
import math
import numpy as np
import os
import pickle
import scipy.io as sio
from scipy import ndimage
from subprocess import call
import sys
curr_dir = os.path.dirname(os.path.abspath(__file__))
sys.path.append(os.path.join(curr_dir, '../tools/'))
import smpl_utils
SMPL_PATH = os.getenv('SMPL_PATH',... |
import collections
import threading
import time
from datetime import datetime
from prompt_toolkit.application.current import get_app
from prompt_toolkit.key_binding import KeyBindings
from prompt_toolkit.layout import HSplit, VSplit
from prompt_toolkit.layout.containers import FloatContainer, Window
from prompt_toolki... |
#!/usr/bin/env python
from __future__ import (absolute_import, division,
print_function, unicode_literals)
import sys
import os
import argparse
import inspect
import shutil
from amptk import amptklib
class MyFormatter(argparse.ArgumentDefaultsHelpFormatter):
def __init__(self,prog):
... |
import os
import io_utils
import xml.etree.ElementTree as ET
from resources_pb2 import RsResource, RsProperty, RsIndex, RsLookups, RsStrings
def property_json(prop_key, prop):
rs={'key':prop_key}
for key in prop.values.keys():
if key not in ['zh-TW']:
parts=key.split('-')
rs['va... |
import pygame
from player import Player
from enemies import *
import tkinter
from tkinter import messagebox
SCREEN_WIDTH = 800
SCREEN_HEIGHT = 576
BLACK = (0,0,0)
WHITE = (255,255,255)
BLUE = (0,0,255)
RED = (255,0,0)
class Game(object):
def __init__(self):
self.font = pygame.font.Font(None... |
import json
import os
import requests
import datetime
import csv
import re
import random
import string
class Bot():
def __init__(self, json):
self.json = json
self.dict_messages = self.json['messages']
self.APIUrl = os.getenv('APIUrl')
self.token = os.getenv('token')
# sel... |
## Algorithme d'évolution de réseaux de neurones
## Ces réseaux sont représentés sous la forme d'un graphe orienté
import matplotlib.pyplot as plt
import numpy as np
import copy
import networkx as nx
from math import *
##Hyperparamètres
ALPHA = 0.1
#Mutation
WEIGHTMUTATION = 0.5 #Correcteur de mutabilité des poids p/r... |
import numpy as np
import pandas as pd
import datetime as dt
import flask
import dash
import dash_table
import plotly.io as pio
import plotly.express as px
import dash_html_components as html
import dash_bootstrap_components as dbc
import dash_core_components as dcc
import plotly.graph_objs as go
from dash.dependencies... |
#!/usr/bin/env python3
"""
Push solar and related data to New Relic.
Can be run from the CLI or as a service. If running as a service, set the
environment variable AS_SERVICE to something.
"""
import os
import sys
import time
from datetime import datetime as dt
from pprint import pprint as pp
import requests
import ... |
#!/usr/bin/env python3
import os
import sys
import datetime as dt
import argparse
import attr
from typing import List, Dict, Any, Optional
from dateutil.relativedelta import relativedelta
from netCDF4 import Dataset, date2num
from odinapi.database import level2db
from odinapi.views.get_ancillary_data import get_ancill... |
import numpy as np
import constants
import random
import math
import matplotlib
import numpy.random as nprand
import time
import scipy
import scipy.interpolate
from contours.core import shapely_formatter as shapely_fmt
from contours.quad import QuadContourGenerator
from matplotlib import pyplot as plt
from matplot... |
import argparse
import logging
import os
import torch
from transformers import BertTokenizer, BertConfig
import data
import train
from models import bert_model, lstm_model
logger = logging.getLogger(__name__)
# The auxiliary objectives used to train the speech grader.
# Note that mlm (masked language modelling) can ... |
from datetime import datetime
import os
import re
from stat import S_ISLNK, S_ISDIR, S_ISREG, S_IFDIR, S_IRWXU, S_IRWXG, S_IRWXO
import time
from dateutil.tz import tzlocal
from dulwich.errors import NotTreeError
from dulwich.objects import S_ISGITLINK, Blob, Commit, Tree
import logbook
from stuf.collects import Chain... |
"""These tests are for edge cases where OPENJPEG does not exist, but
OPENJP2 may be present in some form or other.
"""
# Standard library imports ...
import contextlib
import ctypes
import imp
import os
import sys
import tempfile
import unittest
import warnings
try:
from unittest.mock import patch
except ImportErro... |
import os
import utility as util
import matplotlib as mpl
mpl.use("Agg")
import matplotlib.pyplot as plt
import seaborn as sns
sns.set()
import multiprocessing as mp
import numpy as np
from scipy.stats import binom_test
def test(ABS_path, exp_name, best_j, best_r, ref_names):
sample_names, purity = util.load_samp... |
"""
The ResNet-18 model (pre-trained) is used as a feature extractor.
The average pooling layer in the last layer before the softmax FC layer is used as a
feature vector of dims: 512.
The feature vector and associated label is used to train an isolation forest classifier.
author: <NAME>
email: <EMAIL>
date: 10-28-2019... |
import os
import pandas as pd
import timeit
import numpy as np
import tensorflow as tf
import horovod.tensorflow.keras as hvd
from tensorflow.keras.layers import Flatten, Dense
from tensorflow.keras.models import Model
from tensorflow.keras.preprocessing.image import ImageDataGenerator
from tensorflow.keras.optimize... |
import os.path as op
import numpy as np
import matplotlib.pyplot as plt
from elfpy.filters import _parse_list_of_ints
from elfpy.dataio import _get_filename
class Cycler(list):
def __init__(self, sequence):
list.__init__(self, sequence)
self.n_max = len(sequence)
def __getitem__(self, ii):
... |
try:
import simplejson as json
except ImportError:
import json
# Copyright (c) 2019, CRS4
#
# 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... |
import itertools
import numpy as np
from collections import Counter
from matplotlib import pyplot as plt
from sklearn.model_selection import learning_curve
from sklearn.utils import check_random_state
from sklearn.metrics import cohen_kappa_score as kappa_scorer
__all__ = ['plot_confusion_matrix', 'plot_decision_funct... |
# coding: utf-8
'''
Created on Oct 20, 2014
@author: tmahrt
To be used in conjunction with get_pitch_and_intensity.praat.
For brevity, 'pitch_and_intensity' is referred to as 'PI'
'''
import os
from os.path import join
import math
import io
from praatio import dataio
from praatio import tgio
from praatio.utilities... |
# -*- coding: utf-8 -*-
"""
Created on Sat Jun 8 14:12:07 2019
@Title: FrontierLab exchange program - BPS source code (for Bayesian Logistic Regression)
@Author: <NAME>
@Reference: <NAME>, <NAME>, and <NAME>, “The bouncy particle sampler: A non-reversible rejection-free markov chain monte carlo method,” 2015.
"""
imp... |
"""
Load tests for the courseware student module.
"""
import os
import sys
# due to locust sys.path manipulation, we need to re-add the project root.
sys.path.append(os.path.dirname(os.path.dirname(os.path.dirname(__file__))))
# from gevent import monkey
# monkey.patch_all()
# import pymysql
# Monkeypatch MySQLdb t... |
import os
import codecs
import json
import numpy as np
import tensorflow as tf
from functools import reduce
from operator import mul
from utils.logger import get_logger
from utils.CoNLLeval import CoNLLeval
class CharTDNNHW:
def __init__(self, kernels, kernel_features, dim, hw_layers, padding="VALID", activation=... |
# Copyright 2020 SAS Project 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 requ... |
import discord
from jshbot import utilities, plugins, data, logger
from jshbot.exceptions import ConfiguredBotException
from jshbot.commands import Command, SubCommand, ArgTypes, Arg, Opt, Response
__version__ = '0.1.2'
CBException = ConfiguredBotException('Role assigner')
uses_configuration = False
@plugins.comman... |
import os
import ujson
import unittest
import docsbox
import time
import test_dependencies as dep
from requests import get
# SetUp/EndPoints
class BaseTestCase(unittest.TestCase):
headers = {'Content-Disposition': ""}
def setUp(self):
self.app = docsbox.app
self.app.config["TESTING"] = True
... |
import collections
import random
from django.core.paginator import Paginator
from django.http import JsonResponse
from django.shortcuts import render, redirect
from django.template import TemplateSyntaxError
from django.utils import timezone
from django.contrib import messages
from django.utils.translation import get... |
#! /usr/bin/env python3
# Copyright (C) 2015 Linaro Limited. All rights received.
#
# 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 re... |
#!/usr/bin/python
import os
import json
import socket
import select
import subprocess
import Queue
from hashlib import md5
def bash_it(args):
cmd = "python ../Rummy_src/rummy.pyc " + args
process = subprocess.Popen(cmd, shell=True, executable="/bin/bash", stdout=subprocess.PIPE)
return process.communicate... |
#!/usr/bin/env python
# coding: utf-8
# <NAME>
import numpy as np
import matplotlib.animation as animation
import matplotlib.pyplot as plt
import argparse
import scipy.spatial.distance as distance
# User interface for easier use
'''
age: rezges-lenges_PeterBenceX89O8X.py [-h] [-D SPRING_CONSTANT] [-L SPRING_LENGTH] ... |
# Repository: https://gitlab.com/quantify-os/quantify-scheduler
# Licensed according to the LICENCE file on the master branch
"""Compiler classes for Qblox backend."""
from __future__ import annotations
from typing import Optional, Dict, Any
from quantify_scheduler.backends.qblox import compiler_container
from quanti... |
import json
import psycopg2
from pathlib import Path
import xml.etree.ElementTree as et
import os
import argparse
import wget
import csv
import subprocess
from time import time
# I guess I shouldn't set password here?
CONNECTION = "postgres://username:password@localhost:30003/pss_database"
TABLENAME = 'oltpbench_resul... |
#
# (C) Copyright 2000- NOAA.
#
# (C) Copyright 2000- ECMWF.
#
# This software is licensed under the terms of the Apache Licence Version 2.0
# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
# In applying this licence, ECMWF does not waive the privileges and immunities
# granted to it by virtue of ... |
#
# mcfly
#
# Copyright 2017 Netherlands eScience Center
#
# 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 l... |
#!/usr/bin/env python3
import math
import copy
class Group():
def __init__(self, _id, _klasse, _units, _hp, _weakness, _immune, _damagePts, _damageType, _initiative):
self.id = _id
self.klasse = _klasse
self.units = _units
self.hp = _hp
self.weakness = _weakness
self.immune = _immune
self.damagePts = _... |
"""
SC101 Baby Names Project
Adapted from <NAME>'s Baby Names assignment by
<NAME>.
YOUR DESCRIPTION HERE
"""
import tkinter
import babynames
import babygraphicsgui as gui
FILENAMES = [
'data/full/baby-1900.txt', 'data/full/baby-1910.txt',
'data/full/baby-1920.txt', 'data/full/baby-1930.txt',
'data/full/... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.