content stringlengths 5 1.05M |
|---|
from unittest import TestCase
import pandas as pd
from pytz import UTC
from exchange_calendars.exchange_calendar_xwar import XWARExchangeCalendar
from .test_exchange_calendar import ExchangeCalendarTestBase
class XWARCalendarTestCase(ExchangeCalendarTestBase, TestCase):
answer_key_filename = "xwar"
calend... |
import numpy as np
import copy
import sklearn.mixture as mixture
from src.lib import data as DataManager
class PlantSegmentation3D:
def __init__(self, Spect, n_segmentations):
self.Spect = Spect
euc_distro = Spect.main_comp
dims = np.shape(euc_distro)
num = np.sum(euc_distro)
... |
# Some extra info first about import statements:
# Python has a lot of sophisticated built-in libraries and libraries that developers have built! You can easily take advantage of them using import statements like below:
import pandas as pd # abbreviations will make your life easier when trying to call functions that a... |
'''
Game with the mouse controls and opposing Artificial Intelligence
To develop: Ball to be circular
_Allen
'''
import pygame, sys, os
from pygame.locals import *
os.environ['SDL_VIDEO_CENTERED'] = '1'
# Number of frames per second. Speed value changed by this
FPS = 230
#Global Variables to b... |
__author__ = 'rmorlok'
|
import csv
from django.http import HttpResponse, HttpResponseRedirect
from django.shortcuts import render
from django.contrib.auth import update_session_auth_hash, authenticate, login
from django.contrib.auth.forms import PasswordChangeForm
from django.contrib.auth.decorators import login_required, permission_required
... |
# Generated by Django 3.1 on 2020-09-08 16:11
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import uuid
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
... |
import pyautogui
import time
def increase_volume():
i = 0
while i < 5:
pyautogui.press("volumeup")
i = i + 1
def decrease_volume():
i = 0
while i < 5:
pyautogui.press("volumedown")
i = i + 1
def switch_window():
pyautogui.keyDown('alt')
pyautog... |
import tensorflow as tf
class TextTransformations:
@staticmethod
def lower(x, y):
"""
Args:
x: inut
y: output
Returns:
x, transform(y)
"""
return x, tf.strings.lower(y)
@staticmethod
def map(fn):
"""
Args:
... |
#!/usr/bin/python
#coding=utf-8
import re
import sys
import MySQLdb
def usage():
print sys.argv[0] + " ip dbname(xx_xx_xx1)"
exit(1)
def check_game_server_status(ip, platform, game_name):
pass
def truncate_tables(ip, user, password, dbname):
conn= MySQLdb.connect(
host = ip,
p... |
from concepts import Context
import pandas as pd
import numpy as np
from fcaVisualize import *
import sqlite3
def graphviz(self, filename=None, directory=None, isEdge=False,showLabel=True, **kwargs):
"""Return graphviz source for visualizing the lattice graph."""
return lattice(self, filename, directory, isEdg... |
# Copyright (c) Facebook, Inc. and its affiliates.
import unittest
import torch
from detectron.structures.masks import BitMasks, PolygonMasks, polygons_to_bitmask
class TestBitMask(unittest.TestCase):
def test_get_bounding_box(self):
masks = torch.tensor(
[
[
... |
from google.cloud import storage
# bucket_name='my-bq-demo-bucket'
# blob_name = 'NYC/neighbourhood_data.csv'
def read_csv(bucket_name,blob_name):
storage_client = storage.Client()
bucket = storage_client.get_bucket(bucket_name)
blob = bucket.get_blob(blob_name)
# with blob.open("rt") as f:
#... |
"""
CONCENTRATION GAME API
api.py -- Contains ConcentrationApi, with numerous functions
for communicating User, Game, and Score related information
to and from users.
"""
# Imports and Setup
import endpoints
from protorpc import remote, messages, message_types
from google.appengine.api import memcache
from models i... |
""" Unit tests for FieldValidator """
import nose.tools
import dcase_util
def test_process():
validator = dcase_util.utils.FieldValidator
nose.tools.eq_(validator.process(field='text'), validator.STRING)
nose.tools.eq_(validator.process(field='text123'), validator.STRING)
nose.tools.eq_(validator.pr... |
# views.py — accounts views
#
# This file is part of debexpo -
# https://salsa.debian.org/mentors.debian.net-team/debexpo
#
# Copyright © 2008 Jonny Lamb <jonny@debian.org>
# Copyright © 2010 Jan Dittberner <jandd@debian.org>
# Copyright © 2019 Baptiste Beauplat <lyknode@cilg.org>
#
# Permission is hereby... |
from .featurengineering import FeatureEngineering
from .linearassumptions import Linear
from .EDA import EDA
|
import warnings
from asyncio import (
LimitOverrunError,
StreamReader,
StreamReaderProtocol,
StreamWriter,
get_event_loop,
iscoroutine,
)
from asyncio.streams import _DEFAULT_LIMIT
from hl7.mllp.exceptions import InvalidBlockError
from hl7.parser import parse as hl7_parse
START_BLOCK = b"\x0b"... |
import heapq
PREREQUISITES = {
'cs112': ['cs101', 'cs102'],
'cs132': ['cs112', 'cs105'],
'cs243': ['cs101', 'cs112'],
'cs229': ['cs101'],
'cs224n': ['cs107', 'cs101', 'cs229'],
'cs230': ['cs229', 'cs101'],
'cs229t': ['cs101', 'cs107'],
'cs224u': ['cs224n'],
'cs300': ['cs230']
}
NLP... |
####################################
# Author: Shashi Narayan
# Date: September 2016
# Project: Document Summarization
# H2020 Summa Project
# Comments: Jan 2017
# Improved for Reinforcement Learning
####################################
"""
Document Summarization Final Model
"""
from __future__ import absolute_import... |
#!/usr/bin/env python
# -*- coding: iso-8859-1 -*-
# generated by wxGlade 0.5 on Sun Aug 12 14:47:25 2007 from C:\work\code\devide\modules\viewers\resources\xml\measure2d_panels.wxg
import wx
import wx.grid
class MeasurementPanelFrame(wx.Frame):
def __init__(self, *args, **kwds):
# begin wxGlade: Measurem... |
#!/usr/bin/env python3
# coding=utf-8
import json
import os
import sys
import unittest
from src.utils.payloadHelper import PayloadHelper
class MappedPayloadTests(unittest.TestCase):
def setUp(self):
pass
def test_hartbeat(self):
script_dir = os.path.dirname(__file__)
rel_path = 'dat... |
from styx_msgs.msg import TrafficLight
import tensorflow as tf
import numpy as np
from styx_msgs.msg import TrafficLight
import rospy
class TLClassifier(object):
def __init__(self):
is_simulation = rospy.get_param('/waypoint_loader/velocity') * 1000 / 3600 > 10;
if is_simulation:
self.... |
# -*- coding: utf-8 -*-
import codecs
file_ler = codecs.open("../txt/cientista_clerico.txt", "r", 'utf-8')
file_grava = codecs.open("../aiml/fcn_cientista_clerico.aiml", "w", 'utf-8')
# Cria o cabeçario do arquivo aiml
file_grava.writelines('''<?xml version="1.0" encoding="UTF-8"?>
<aiml version="1.0"> \n\n'... |
import luis
endpoint = 'https://api.projectoxford.ai/luis/v1/application?id=c413b2ef-382c-45bd-8ff0-f76d60e2a821&subscription-key=fe5ca229c0464f699f8a461c305360c5&q='
l = luis.Luis(url='https://api.projectoxford.ai/luis/v1/application?id=c413b2ef-382c-45bd-8ff0-f76d60e2a821&subscription-key=fe5ca229c0464f699f8a461c30... |
import numpy as np
def kr(t, a, n):
m = 1. - 1. / n
return np.sqrt(t) * (1. - (1. - t**(1. / m))**m)**2
def psi(t, a, n):
m = 1. - 1. / n
me = a * (.046 * m + 2.07 * m**2 + 19.5 * m**3) / (
1. + 4.7 * m + 16. * m**2)
_psi = 1. / a * (t**(1 / m) - 1.)**(1 / n)
return np.max((_psi, me)... |
from nose.tools import raises
from webdnn.graph.axis import Axis
from webdnn.graph.operators.sgemm import Sgemm
from webdnn.graph.order import OrderNHWC, OrderNC
from webdnn.graph.variable import Variable
def test_sgemm():
op = Sgemm(None, M=10, N=20, K=30, out_shape=[1, 10, 4, 5], out_order=OrderNHWC, transpose... |
''' Benchmark that throws files at workbench with 4 subprocesses '''
import zerorpc
import os
import datetime
import multiprocessing
def run():
''' Benchmark that throws files at workbench with 4 subprocesses '''
jobs = []
args = ['../data/pe/bad', '../data/pe/good', '../data/pdf/bad', '../data/pdf/good']... |
import torch
import torch.nn as nn
import torch.utils.model_zoo as model_zoo
import torch
import torch.nn as nn
import torch.nn.functional as F
from net.sync_batchnorm import SynchronizedBatchNorm2d
from torch.autograd import Variable
import torch.nn.init as init
from torch.nn import init
def to_var(x, requires_grad=... |
import numpy as np
import hepfile as hep
def sep_cols_data_ids(filename):
#with open(filename) as input:
# cols = input.read().split('\n', 1)[0].split(",")[1:]
#data = np.loadtxt(filename, unpack=True, dtype=str,
# delimiter=",", skiprows=1)
#data_ID = data[0].astype(np.int32... |
"""
Manage multiple loggers
"""
import logging
import sys
# logger 1: simply writes messages to text file
log1 = logging.getLogger('example1')
log1.addHandler(logging.FileHandler('logger1.log', mode='w'))
log1.setLevel(logging.INFO)
log1.info('message for logger 1')
# logger 2: formats timestamp and writes to stan... |
import logging
import sys
from functools import lru_cache
from unittest import TestCase
from foxylib.tools.function.function_tool import FunctionTool
from foxylib.tools.log.foxylib_logger import FoxylibLogger
class Obj:
@lru_cache(maxsize=1)
def func(self, x):
print(x, file=sys.stderr)
return... |
"""
A modern, Python3-compatible, well-documented library for communicating
with a MineCraft server.
"""
__version__ = "0.0.1"
MINECRAFT_VERSION = "1.8.3"
PROTOCOL_VERSION = 47
|
#!/usr/bin/python3
# Written by Kristoffer Rakstad Solberg, Student
# Copyright (c) 2020 Manta AUV, Vortex NTNU.
# All rights reserved.
import numpy as np
class PIDRegulator:
"""
A very basic 1D PID controller
"""
def __init__(self, p, i, d, sat):
"""
Initialize the PID controller by... |
import json
from django.conf import settings
from django.contrib.auth.models import User
import mock
from nose.tools import eq_
from pyquery import PyQuery as pq
from gallery import forms, views
from gallery.models import Image, Video
from gallery.tests import image, video
from gallery.views import _get_media_info
f... |
"""Solution to 2.5: Sum Lists."""
import itertools as it
from ctci.structs.linkedlist import Node, SinglyLinkedList
def sum(list_a, list_b):
"""Calculates the sum of LinkedList data.
calculates the sum of linked list data in a reverse
manner. The data is then added in a reverse manner
into a new Li... |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-02-02 22:13
from __future__ import unicode_literals
from django.db import migrations, models
import roombookings.api_helpers
class Migration(migrations.Migration):
dependencies = [
('roombookings', '0002_room'),
]
operations = [
... |
from timer_model import Timer
from typing import List
from datetime import datetime
FILENAME = "coc_running_upgrades.txt"
class FileAccess:
def __init__(self):
self.f = open(FILENAME, "r+")
def prepare_content(self, timers):
lines = []
for timer in timers:
line = timer.nam... |
from django import forms
from django.core.exceptions import ValidationError
from accounts.models import Subject, Profile
from django.contrib.auth.models import User
class NewClassForm(forms.Form):
teacher = forms.IntegerField()
name = forms.CharField(max_length=64)
subject = forms.IntegerField()
cost ... |
input = """
sat|e37|e34.
e34:-sat.
e37:-sat.
sat:-e34.
e36:-sat.
sat:-e36.
e55:-sat.
sat:-e55.
e21:-sat.
sat|e55:-e21.
e26:-sat.
sat:-e26.
e59:-sat.
sat:-e59.
e20:-sat.
sat:-e20.
sat:-e20.
sat:-e20.
e12:-sat.
sat|e20:-e12.
e50:-sat.
sat:-e50.
e33:-sat.
sat:-e33.
:-not sat.
"""
output = """
"""
|
from loader import dp,bot
import logging
import middlewares, filters, handlers #не уда
from data import config
#from data import debug_config as config
from aiogram.utils.executor import start_webhook
from aiogram.utils import executor #расскоментить при зтестировании
import asyncio
user = None
logging.debug(f'... |
from django.urls import path
app_name='hospital'
urlpatterns=[
] |
from tqdm import tqdm
from bs4 import BeautifulSoup
import requests
import pandas as pd
import camping_server2.config as config
class CampLink:
base_url = "https://www.gocamping.or.kr"
path = "/bsite/camp/info/list.do"
query = "?pageUnit=3000&searchKrwd=&listOrdrTrget=last_updusr_pnttm"
url = base_url ... |
from mgm11.halconfig import halconfig_types as types
from mgm11.halconfig import halconfig_dependency as dep |
import os
import subprocess
from dataclasses import dataclass
from pathlib import WindowsPath
from time import sleep
from typing import Optional, Sequence
from click import ClickException
from rich.progress import Progress
import rob.console as con
import rob.filesystem
@dataclass
class RobocopyResults:
options... |
import sys
words = []
for line in open(sys.argv[1], encoding="utf8"):
entry = line.split("\t")
if len(entry) < 2:
if len(words) > 0:
print(" ".join(words))
words = []
else:
words.append(entry[1])
if len(words) > 0:
print(" ".join(words))
words = []
|
from django.urls import reverse_lazy
from django.views.generic import TemplateView
from .common import DefaultMetaTags
class CreditsView(DefaultMetaTags, TemplateView):
template_name = "weallcode/credits.html"
# url = reverse_lazy("weallcode-credits")
title = f"Credits & Attributions | We All Code"
|
import copy
from Monitor.Debug import *
from DataObjects.ClassStateNode import StateNode
from DataObjects.ClassTransition import Transition
from Parser.ForkTree import ForkTree
class Transaction:
def __init__(self, startstate, guard, finalstate):
assert isinstance(startstate, StateNode)
assert i... |
"""
More thorough sweep value validator created in June 2020.
Checks EVERY value of EVERY sweep of EVERY channel of EVERY ABF
to ensure it matches what we expect and does not change.
"""
try:
import sys
import pytest
import datetime
import inspect
import numpy as np
import glob
# this ensu... |
#!/usr/bin/env python
# Exercises from the book:
# Designing Sound - Andy Farnell
# Practice 1 - Pedestrian walk
#
# It is a simple beeping sound
#
# Network description:
# Square wave \\
# ==> Multiplication ==> Output
# Sinusoid //
from marsyas import *
from marsyas_util import *
# We don't have a square... |
# uncompyle6 version 3.7.4
# Python bytecode 3.7 (3394)
# Decompiled from: Python 3.7.9 (tags/v3.7.9:13c94747c7, Aug 17 2020, 18:58:18) [MSC v.1900 64 bit (AMD64)]
# Embedded file name: T:\InGame\Gameplay\Scripts\Server\business\business_tests.py
# Compiled at: 2017-09-01 19:16:44
# Size of source mod 2**32: 5049 bytes... |
#!/usr/bin/env pytest
# -*- coding: utf-8 -*-
###############################################################################
# $Id$
#
# Project: GDAL/OGR Test Suite
# Purpose: Test Scaled Integer Gridded Elevation Model support.
# Author: Paul Austin <paul.austin@revolsys.com>
#
###################################... |
class TextMiningServiceException(Exception):
pass
class TextMiningServiceOperationNotSupported(TextMiningServiceException):
pass
|
# -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2016-2018 CERN.
#
# Invenio is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
"""Create oiaserver tables."""
import sqlalchemy as sa
from alembic import op
# rev... |
#!/usr/bin/env python3
import argparse
import asyncio
import collections
import logging
import os
import pathlib
import shutil
import socket
import struct
import sys
import time
from ..database import Db
import dpkt
l = logging.getLogger("pcapbot")
# TODO: do this!
def anonymize_pcap(src, dst, keep_ip):
# Start... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from optimove.constants import AUTHORIZED_DELIMITERS, UNAUTHORIZED_DELIMITERS
class Model(object):
client = None
def __init__(self, client):
self.client = client
def get_customer_attribute_list(self):
"""Re... |
import copy
from kaa.filetype.default import defaultmode
from kaa import doc_re
from kaa.theme import Style
from kaa.command import commandid
from kaa.command import norec
from kaa.command import norerun
from kaa.keyboard import *
from kaa.syntax_highlight import *
MarkdownThemes = {
'basic': [
Style('esc... |
from .helper import *
import open_cp.gui.predictors.retro as retro
import open_cp.retrohotspot
def test_RetroHotspot(model, project_task, analysis_model, grid_task):
provider = retro.RetroHotspot(model)
assert provider.settings_string == "60 Days, Quartic(200m)"
standard_calls(provider, project_task, anal... |
class Pill(object):
icons = {".": 10,
"o": 50}
def isPill(icon):
if isinstance(icon, Pill):
return True
elif icon in Pill.icons:
return True
else:
return False
def __init__(self, coordinates, icon):
self.coordinates = coordin... |
import requests
import json
import time
def post_to_discord(exchange, thing):
discordUrl = 'https://discord.com/api/webhooks/99999/aaaaa-bbbbb'
dContent = exchange + " has added " + thing
data = {"content": dContent}
response = requests.post(discordUrl, json=data)
#print(response.status_code)
r... |
def one_word(word):
for letter in word:
if ord(letter) not in range(48, 58):
return 0
return int(word)
def sum_words(string):
words, sum = (string.split(' ')), 0
while words:
sum += one_word(words.pop())
return sum
def test_sum_words(arg1, value):
pri... |
import tensorflow as tf
import numpy as np
import matplotlib.pyplot as plt
import logging
import os
from matplotlib.image import cm
from mpl_toolkits.mplot3d import Axes3D
import utils
logging.basicConfig(level=logging.INFO, format='%(message)s')
class AE_mnist():
def __init__(self, sess, batch_size=100, repor... |
from __future__ import unicode_literals
from frappe import _
def get_data():
return {
'fieldname': 'Key Information',
'non_standard_fieldnames': {
'Diary Record': 'party_name',
},
'dynamic_links': {
'party_name': ['Key Information', 'Key Information']
},
'transactions': [
{
'items': ['Diary R... |
# -*- coding: utf-8 -*-
'''
Send a message to PushOver
=========================
This state is useful for sending messages to PushOver during state runs.
.. versionadded:: Lithium
.. code-block:: yaml
pushover-message:
pushover.post_message:
- user: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
- token: ... |
#!/usr/bin/env python
from __future__ import unicode_literals, print_function
import re
import yaml
import json
from pprint import pprint as pp
print("its a start")
liste = [{"key1" : "value1" , "key2" : "value2"}, "cars", "planes", ["red", "blue", "green"]]
print(type(liste))
with open("config.yml","w") as f:
... |
# Generated by Django 3.1.5 on 2021-09-15 11:21
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('slackbot', '0001_initial_20210729'),
]
operations = [
migrations.DeleteModel(
name='AnalyticsBot',
),
]
|
from __future__ import absolute_import
import os
from celery import Celery
from django.conf import settings
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'mothra.settings')
app = Celery('mothra')
app.config_from_object('django.conf:settings')
app.autodiscover_tasks(settings.INSTALLED_APPS, related_name... |
from flask import Flask
from app.extensions import register_extensions
from config import Config
def create_app():
app = Flask(__name__)
app.config.from_object(Config)
app.config["SQLALCHEMY_DATABASE_URI"] = "sqlite:///db.sqlite"
app.config["SQLALCHEMY_TRACK_MODIFICATIONS"] = False
app.config["T... |
# -*- coding: utf-8 -*-
"""
Predicate for use within Forseti
"""
# pylint: disable=too-few-public-methods,missing-docstring
class Formula(object):
args = []
def __init__(self):
pass
def __repr__(self):
raise NotImplementedError("Not implemented")
def __str__(self):
raise Not... |
#%%
## External Dependencies ##
import math
from statsmodels.tsa.holtwinters import ExponentialSmoothing
from statsmodels.graphics.tsaplots import plot_acf
from statsmodels.graphics.tsaplots import plot_pacf
import numpy as np
import matplotlib.pyplot as plt
## Internal Dependencies ##
from hacData.HACData import Data... |
from __future__ import division, print_function
import math
import os
import re
import signal
import sys
import matplotlib
from matplotlib import verbose
from matplotlib.cbook import is_string_like, onetrue
from matplotlib.backend_bases import RendererBase, GraphicsContextBase, \
FigureManagerBase, FigureCanvasBa... |
import sys
input = sys.stdin.readline
from math import sqrt
sys.setrecursionlimit(10**9)
# find root node
def find(a):
if parent[a] < 0:
return a
p = find(parent[a])
parent[a] = p
return p
# merge two trees
def union(a,b):
a = find(a)
b = find(b)
if a == b: return False
if pare... |
from django.http import HttpResponse
def traced(request): # pylint: disable=unused-argument
return HttpResponse()
def error(request): # pylint: disable=unused-argument
raise ValueError("error")
|
#!/usr/bin/env python3
from pyevtk.hl import *
import numpy as np
from egsnrc_dosxyz import *
# convert .3ddose to rectilinear vtk
# - in paraview first use filter CellData2PointData
def dose3d2vtr(fn_base, overwrite = False):
fn_3ddose_in = fn_base + ".3ddose"
dose = Egs3dDose().read_3ddose(fn_3ddose_in)
... |
# -*- encoding: utf-8 -*-
"""
Created by eniocc at 11/10/2020
"""
import ctypes
from py_dss_interface.models.Base import Base
class MetersS(Base):
"""
This interface can be used to read/write certain properties of the active DSS object.
The structure of the interface is as follows:
CStr MetersS... |
"""spellcast.dlna: DLNA related utilities (discovery and AV control)"""
import logging
import re
import socket
from http import client
from io import BytesIO
from urllib import parse, request
from requests import post
DISCOVER = "M-SEARCH * HTTP/1.1\r\nHOST: {0}:{1}\r\nMAN: \"ssdp:discover\"\r\nST: urn:schemas-upnp... |
for i in range(0, 10, 2):
print("Ponavaljnje sa brojacem " + str(i))
|
#!/usr/bin/python
#
# Copyright 2018-2020 Polyaxon, 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 ... |
import pandas as pd
import streamlit as st
import plotly.express as px
# import plotly.graph_objects as go
# import json
st.title('Geo_EDA')
st.write('https://github.com/rjc89/Geo_EDA')
example_data = st.checkbox('Use example .csv', value = True)
#uploaded_file = st.file_uploader("Choose a dataset .csv", type="csv"... |
"""Automate Dragoon Rolls"""
from .dragoon import main
__version__ = "0.0.2"
|
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: yandex/cloud/organizationmanager/v1/saml/federation_service.proto
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf ... |
from .endpoint import Endpoint
from .console import Console
from .file import File |
"""Resolve DID result message handler."""
import json
from .....core.error import BaseError
from .....messaging.base_handler import BaseHandler, BaseResponder, RequestContext
from ..messages.resolve_did_result import ResolveDidResult
class ResolveDidResultHandler(BaseHandler):
"""Message handler class for reso... |
#!/usr/bin/env python3.4
# coding: utf-8
from enum import Enum
class Button(Enum):
"""
Mouse button
"""
LEFT = 1
RIGHT = 2
MIDDLE = 3
|
"""
.. module:: Get median improvement values from FUN files (percentage improvement)
:platform: Unix, Windows
.. moduleauthor:: Rodrigo Morales <rodrigomorales2@acm.org>
"""
import os, csv
from statistics import median
from pathlib import Path
'''Hardcoded settings'''
directory_in_str = '/home/moar82/Documents/i... |
import dash_html_components as html
from dash_extensions.enrich import Output, Dash, Input
app = Dash(prevent_initial_callbacks=True)
app.layout = html.Div([
html.Button("Click me", id="btn"), html.Div(id="log")
])
@app.callback(Input("btn", "n_clicks"), Output("log", "children")) # inverted order of Output/Inp... |
import xgboost as xgb
import numpy as np
import pandas as pd
from sklearn.model_selection import KFold
from sklearn.pipeline import make_pipeline
from sklearn.preprocessing import RobustScaler
from pandas.core.frame import DataFrame
train = pd.read_csv("./data/tra1.csv", index_col = 0)
test = pd.read_csv("./data/test.... |
# module for png load
import lvgl as lv
import ustruct as struct
import lodepng as png
import lvgl_helper as lv_h
class lodepng_error(RuntimeError):
def __init__(self, err):
if type(err) is int:
super().__init__(png.error_text(err))
else:
super().__init__(err)
def get_png... |
""" Scipy wrappers for Medical machine learning models
"""
import os
import numpy as np
import json
import sys
#import itertools
#import subprocess
#import pickle
#import time
from scipy import interp
import scipy.stats as st
sys.path.append(".")
from utils import split_cohort, calc_auc_conf_interval, load_models_an... |
# Authors: Sylvain MARIE <sylvain.marie@se.com>
# + All contributors to <https://github.com/smarie/python-pytest-cases>
#
# License: 3-clause BSD, <https://github.com/smarie/python-pytest-cases/blob/master/LICENSE>
from pytest_cases import parametrize_with_cases, fixture
class Cases:
def case_one(self, ... |
import os
from typing import Callable, Iterable, List
import numpy as np
try:
import pycuda
import pycuda.autoinit
import pycuda.driver as cuda
import tensorrt as trt
except ImportError as e:
raise ImportError('Install tensorRT and related dependencies before using tensorRT export.')
import torch... |
import du
import canopy
def save_network(trial, name, network):
with du.timer("serializing network (%s) for %s:%d"
% (name, trial.trial_name, trial.iteration_num)):
value_dict = canopy.network_utils.to_value_dict(network)
du.joblib_utils.dump_dir(
value_dict, trial.fi... |
import module_support_analysis
import pandas as pd
import data_paths_analysis as data_paths
from tqdm import tqdm
import matplotlib.pyplot as plt
import settings_analysis as settings
import main_preprocessing
class ValuesOccurencesDiagram():
'''Plots a diagram which shows the occurences of all different values per... |
from typing import Union
from numbers import Number
import numpy as np
class Agent:
def act(self, obs: np.ndarray) -> Union[np.ndarray, Number]:
raise NotImplementedError
|
#! /usr/bin/env python
# NBT-NS/LLMNR Responder
# Created by Laurent Gaffie
# Copyright (C) 2014 Trustwave Holdings, 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... |
__version__ = "0.2019.9.17.1"
from .DirBasedKeyValueStore import DirBasedKeyValueStore
|
from .utils import sigmoid, tanh
import numpy as np
class LSTM:
def __init__(self, input_shape, output_shape):
self.input_shape = input_shape
self.layer_1 = self.Unit(input_shape, output_shape)
def forward(self, x=.34):
print(self.unit(self.cell_state, self.output_gate, x))
class... |
import typing
import logging
import bson
from secrets import randbelow
import pymodm.fields as fields
from pymodm.context_managers import no_auto_dereference
from arvet.database.autoload_modules import autoload_modules
from arvet.database.reference_list_field import ReferenceListField
from arvet.core.system import Visi... |
from django.shortcuts import render
from django.views.generic import ListView
from shop.models import Product
from django.db.models import Q
from search.models import City
# Create your views here.
class SearchProductView(ListView):
model = City
template_name = "search_results.html"
def get_queryset(self)... |
from django.db import models
# Create your models here.
from django.contrib.auth.models import User
from django.db.models.signals import post_save
from django.dispatch import receiver
class Classes(models.Model):
id = models.AutoField(primary_key=True)
public = models.BooleanField(default=True)
class_nam... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.