text
string
size
int64
token_count
int64
def decode(to_be_decoded): """ Decodes a run-length encoded string. :param to_be_decoded: run-length encoded string :return: run-length decoded string """ to_be_decoded_list = list(to_be_decoded) decoded_str_as_list = list() num_to_print_as_list = list() for c in to_be_decoded_list:...
1,830
615
from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import operator_benchmark as op_bench import torch import torch.nn as nn """ Microbenchmarks for Conv1d and ConvTranspose1d operators. """ # Configs for conv-1d ops ...
3,816
1,637
import requests as R class reqNYU(): TOKEN = "" BASEURI = "https://sandbox.api.it.nyu.edu/" def __init__(self, token=""): if not token: raise Exception("[Error] Token can not be empty!") self.TOKEN = token self.ping() def ping(self): try: ...
1,605
456
#from distutils.core import setup #from distutils.extension import Extension #from Cython.Distutils import build_ext #import numpy #setup( #cmdclass = {'build_ext': build_ext}, #ext_modules = [Extension("Z_shooting", ["Z_shooting.c"],)], #include_dirs=[numpy.get_include(),'.', ], #) from dist...
857
322
import numpy as np import pandas as pd import os from sklearn.preprocessing import MinMaxScaler from data_processing.helpers import Config class Load: def __init__(self,train_sales='',calendar=''): """ Read CSV files for daily sales and calendar input data respectively. Args: tra...
11,877
3,505
import math speedofLight = 2.9979*pow(10,8) def timeIntervalBlinks(): time = float(input('Input Time (sec): ')) speed = float(input('Speed: ')) speed = speed * pow(10,8) gamma = math.sqrt(1/(1-pow((speed/speedofLight),2))) answer = gamma * time print(answer) timeInterv...
331
126
import json from upload.common.upload_area import UploadArea # This lambda function is invoked by messages in the the area_deletion_queue (AWS SQS). # The queue and the lambda function are connected via aws_lambda_event_source_mapping def delete_upload_area(event, context): unwrapped_event = json.loads(event["Rec...
419
128
from ..overlap_detection_2d import detect_overlap_2d from unittest.mock import call, Mock, patch import unittest class TestOverlap2d(unittest.TestCase): """Test two dimensional overlap detection functions.""" def setUp(self): """Creates a ``self.first`` and ``self.second`` Mock object.""" sel...
3,089
997
teste = list() teste.append('Matheus') teste.append(17) galera = [teste[:]] # Cria uma copia de teste dentro de galera teste[0] = 'Oliver' teste[1] = 22 galera.append(teste) # Cria um vínculo entre teste e galera print(galera) pessoas = [['Harvey', 23], ['Madeleine', 19], ['Roger', 250], ['Mark', 20]] print(pessoas...
786
347
# -*- coding: utf-8 -*- """Bio2BEL custom errors.""" class Bio2BELMissingNameError(TypeError): """Raised when an abstract manager is subclassed and instantiated without overriding the module name.""" class Bio2BELModuleCaseError(TypeError): """Raised when the module name in a subclassed and instantiated ma...
756
229
# -*- coding: utf8 -*- # Copyright (c) 2017-2021 THL A29 Limited, a Tencent company. 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...
1,967
844
from django.contrib.auth import get_user_model from django.test import TestCase from django.contrib.staticfiles import finders from django.urls import reverse from .models import StudentProfileInfo, User from .forms import UserForm, ContactForm, UserProfileInfoForm class IndexPageTest(TestCase): # Page can only ...
8,851
2,655
# # Module to support the pickling of different types of connection # objects and file objects so that they can be transferred between # different processes. # # processing/reduction.py # # Copyright (c) 2006-2008, R Oudkerk --- see COPYING.txt # __all__ = [] import os import sys import socket import t...
6,248
1,943
""" Print elements of a linked list in reverse order as standard output head could be None as well for empty list Node is defined as class Node(object): def __init__(self, data=None, next_node=None): self.data = data self.next = next_node """ def ReversePrint(head): if head is None: ...
570
176
# MIT License # # Copyright (c) 2020 Aleksandr Zhuravlyov and Zakhar Lanets # # 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...
9,088
3,581
import struct ascii_glyphs = [ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0x18, 0x00, 0x18, 0x00, 0x6c, 0x6c, 0x6c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x36, 0x7f, 0x36, 0x7f, 0x36, 0x36, 0x00, 0x0c, 0x3f, 0x68, 0x3e, 0x0b, 0x7e, 0x18, 0x00, 0x60, 0...
10,209
6,546
from .sdm import Sdm __red_end_user_data_statement__ = ( "This cog does not persistently store data or metadata about users." ) async def setup(bot): bot.add_cog(Sdm(bot))
183
66
#!/usr/bin/python """ ************************************************* * @Project: Self Balance * @Description: GPIO Mapping * @Owner: Guilherme Chinellato * @Email: guilhermechinellato@gmail.com *************************************************...
1,330
652
# Copyright (C) 2019 by geehalel@gmail.com # This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT) import platform _WIN32 = (platform.system() == 'Windows') VK_USE_PLATFORM_WIN32_KHR = _WIN32 VK_USE_PLATFORM_ANDROID_KHR = False VK_USE_PLATFORM_WAYLAND_KHR = False _DIRECT2DISPLAY = Fal...
449
212
#!/bin/env python # Vulture often detects false positives when analyzing a code # base. If there are particular things you wish to ignore, # add them below. This file is consumed by # scripts/dead_code/find-dead-code.sh from vulture.whitelist_utils import Whitelist view_whitelilst = Whitelist() # Example: # view_w...
359
118
# Copyright (c) OpenMMLab. All rights reserved. import warnings from collections import abc from contextlib import contextmanager from functools import wraps import torch from mmdet.utils import get_root_logger def cast_tensor_type(inputs, src_type=None, dst_type=None): """Recursively convert Tensor in inputs f...
8,088
2,250
# import packages to extend python (just like we extend sublime, or Atom, or VSCode) from random import randint from gameComponents import gameVars, chooseWinner while gameVars.player is False: print("=======================*/ RPS CONTEST /*=======================") print("Computer Lives: ", gameVars.ai_lives, "/"...
2,278
818
import pandas as pd import os def df_from_image_dirs(directory, image_format="jpg", relative_path=False, verbose=0): dataframe_dict = { "images":[], "classes":[] } num_dirs = 0 num_images = 0 images_per_classes = [] classes = [] for dirs in os.listdir(directory): ...
1,227
384
import time from threading import Timer i = 0 class RepeatedTimer(object): def __init__(self, interval, function, *args, **kwargs): self._timer = None self.interval = interval self.function = function self.args = args self.kwargs = kwargs ...
1,222
401
# coding: utf-8 # In[1]: import keras # In[2]: # scipy import scipy print( ' scipy: %s ' % scipy.__version__) # numpy import numpy print( ' numpy: %s ' % numpy.__version__) # matplotlib import matplotlib print( ' matplotlib: %s ' % matplotlib.__version__) # pandas import pandas print( ' pandas: %s ' % pandas.__...
721
255
from .DefaultColorScheme import DefaultColorScheme class DarkColorScheme(DefaultColorScheme): def __init__(self): self.colors = dict() self.colors['background'] = 'black' self.colors['edge'] = 'white' self.colors['fontcolor'] = 'black' self.colors['initv'] = 'grey65' self.colors['initm'] = 'g...
577
216
# Copyright 2019 Google LLC # # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
3,817
1,144
import matplotlib.pyplot as plt plt.switch_backend('agg') import seaborn as sns sns_plot = \ (sns.jointplot(psi, phi, size=12, space=0, xlim=(-190, 190), ylim=(-190, 190)).plot_joint(sns.kdeplot, zorder=0, n_levels=6)) # sns_pl...
554
225
from unittest import mock import pytest get_tracer = pytest.importorskip('opentelemetry.trace.get_tracer') @mock.patch('hedwig.backends.base.Message.exec_callback', autospec=True) def test_message_handler_updates_span_name(mock_exec_callback, message, consumer_backend): provider_metadata = mock.Mock() trace...
692
219
from logic import * def game(): pass
42
14
# Definition for singly-linked list. class ListNode(object): def __init__(self, x): self.val = x self.next = None class Solution(object): def swapPairs(self, head): """ :type head: ListNode :rtype: ListNode """ nodeRec = [] check = head pr...
1,184
364
#!/usr/bin/python #coding=utf-8 import os from flask import Flask from flask import Response from flask import request app = Flask(__name__) @app.route('/') def root(): return app.send_static_file('index.html') @app.route('/env') def env(): html = "System Environment:\n\n" for env in os.environ.keys(): ...
939
294
""" Ahira Justice, ADEFOKUN justiceahira@gmail.com """ import os import pygame BASE_DIR = os.path.dirname(os.path.abspath(__file__)) IMAGE_DIR = os.path.join(BASE_DIR, "images") BLACK = "BLACK" WHITE = "WHITE" BISHOP = "BISHOP" KING = "KING" KNGHT = "KNIGHT" PAWN = "PAWN" QUEEN = "QUEEN" ROOK = "ROOK" c...
2,696
991
from resource_management.core.resources.system import Execute from resource_management.libraries.script import Script from resource_management.core.resources.system import Directory from resource_management.core.resources.system import File from resource_management.core.source import InlineTemplate from resource_manag...
3,993
1,281
"""Cue: Script Orchestration for Data Analysis Cue lets your package your data analysis into simple actions which can be connected into a dynamic data analysis pipeline with coverage over even complex data sets. """ DOCLINES = (__doc__ or '').split('\n') from setuptools import find_packages, setup setup(...
819
281
#!/usr/bin/python3.2 # # Zabbix API Python usage example # Christoph Haas <email@christoph-haas.de> # username='' password='1' hostgroup='' item_name='system.cpu.load[,avg1]' zabbix_url='' import zabbix_api import sys # Connect to Zabbix server z=zabbix_api.ZabbixAPI(server=zabbix_url) z.login(user=username, passwor...
1,689
549
import copy import math import os import random import cherrypy """ This is a simple Battlesnake server written in Python. For instructions see https://github.com/BattlesnakeOfficial/starter-snake-python/README.md """ class Battlesnake(object): global neighbours @cherrypy.expose @cherrypy.tools.json_out() def...
11,813
5,145
# $Header: /nfs/slac/g/glast/ground/cvs/GlastRelease-scons/EventIntegrity/EventIntegrityLib.py,v 1.2 2008/08/28 21:50:54 ecephas Exp $ def generate(env, **kw): if not kw.get('depsOnly', 0): env.Tool('addLibrary', library = ['EventIntegrity']) env.Tool('GlastSvcLib') env.Tool('LdfEventLib') def exist...
342
146
"""Gives users direct access to class and functions.""" from mr4mp.mr4mp import pool, mapreduce, mapconcat
107
33
# -*- coding: utf-8 -*- # Copyright 2020 Google LLC # # 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...
59,098
16,500
from collections import defaultdict class WordDistance(object): def __init__(self, words): """ initialize your data structure here. :type words: List[str] """ self.indice = defaultdict(list) self.memo = {} self.MAXLEN = len(words) for i, word in enum...
1,457
467
from perceptron import train_network, create_perceptron, test_network from preprocessingData import get_ids_matrix, separate_test_and_training_data, read_word_list from extractRawData import get_raw_data from lstm import create_lstm, create_lstm_with_tensorflow def main(): all_texts, pos_texts, neg_texts = get_raw...
1,060
380
# Databricks notebook source import builtins as BI # Setup the capstone import re, uuid from pyspark.sql.types import StructType, StringType, IntegerType, TimestampType, DoubleType from pyspark.sql.functions import col, to_date, weekofyear from pyspark.sql import DataFrame static_tests = None bronze_tests = None silv...
33,225
10,697
import requests from bs4 import BeautifulSoup as bs, BeautifulSoup import pandas as pd import numpy as np import re import logging class Scraper: """ This is a scraper class, which can scrape California housing information from https://www.point2homes.com/ website. The flow: - First, all California ar...
12,658
3,371
from selenium import webdriver from scrapy.selector import Selector import time chrome_opt = webdriver.ChromeOptions() prefs = {"profile.managed_default_content_settings.images": 2} chrome_opt.add_experimental_option("prefs", prefs) browser = webdriver.Chrome(executable_path="H:\chromedriver.exe", chrome_options=chrom...
693
231
from nine import str from Qt.QtWidgets import QApplication, QStyleFactory from Qt import QtGui from Qt import QtCore import sys import os from PyFlow.App import PyFlow FILE_DIR = os.path.abspath(os.path.dirname(__file__)) SETTINGS_PATH = os.path.join(FILE_DIR, "PyFlow", "appConfig.ini") STYLE_PATH = os.path.join(FILE...
1,678
687
import pandas as pd from dash import Dash, html, dcc, Input, Output import altair as alt df = pd.read_csv('../../data/raw/world-data-gapminder_raw.csv') # local run # df = pd.read_csv('data/raw/world-data-gapminder_raw.csv') # heroku deployment url = '/dash_app2/' def add_dash(server): """ It creates a D...
4,344
1,318
# Author: Arrykrishna Mootoovaloo # Collaborators: Alan Heavens, Andrew Jaffe, Florent Leclercq # Email : a.mootoovaloo17@imperial.ac.uk # Affiliation : Imperial Centre for Inference and Cosmology # Status : Under Development ''' Perform all additional operations such as interpolations ''' import os import logging im...
4,595
1,631
from pybench import Test # First imports: import os import package.submodule class SecondImport(Test): version = 0.1 operations = 5 * 5 rounds = 20000 def test(self): for i in xrange(self.rounds): import os import os import os import os ...
2,984
676
from unittest import TestCase class TestRSTGenerator(TestCase): def _make_one(self): from soho.generators.rst import RSTGenerator return RSTGenerator() def _call_generate(self, filename): import os.path generator = self._make_one() here = os.path.dirname(__file__) ...
1,745
548
from django.apps import AppConfig class WagtailAbTestingTestAppConfig(AppConfig): label = "wagtail_ab_testing_test" name = "wagtail_ab_testing.test" verbose_name = "Wagtail A/B Testing tests"
206
73
# Copyright 2020 Michael Thies <mail@mhthies.de> # # 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...
835
232
def get_package_data(): return {"minicds":['minicds.cfg']}
65
28
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' Simple Http Client, to request html files Modification: 11/09/2017 Author: J. Júnior ''' import httplib import sys #get http server ip - pass in the command line http_server = sys.argv[1] #create a connection with the server conn = httplib.HTTPConnection(ht...
777
269
"""Implement asymmetric cryptography. """ from __future__ import print_function, division, absolute_import from __future__ import unicode_literals from cryptography.hazmat.primitives import hashes, serialization from cryptography.hazmat.primitives.asymmetric import rsa, dsa, utils, padding from cryptography.hazmat.pri...
6,881
2,196
""" @ jetou @ cart decision_tree @ date 2017 10 31 """ import numpy as np class naive_bayes: def __init__(self, feature, label): self.feature = feature.transpose() self.label = label.transpose().flatten(1) self.positive = np.count_nonzero(self.label == 1) * 1.0 self.ne...
1,230
405
from . import frame_manager
27
7
import os import sys if sys.version_info[:2] >= (3, 4): import configparser config = configparser.ConfigParser() else: import ConfigParser config = ConfigParser.ConfigParser() config.readfp(open('app/config/config_%s.cfg' % os.environ.get('APP_ENV', 'dev')))
276
92
import tkinter from tkinter import * from rsa_decryption_125 import decryptor class AppWindow(Frame): def __init__(self, master=None): super().__init__(master) self.master = master self.init_window() def init_window(self): self.master.title('RSA Decryptor') self.p...
3,164
1,075
import paddle.fluid as fluid import parl from parl import layers class MAModel(parl.Model): def __init__(self, act_dim): self.actor_model = ActorModel(act_dim) self.critic_model = CriticModel() def policy(self, obs): return self.actor_model.policy(obs) def value(self, obs, act): ...
2,031
728
from PyQt4.QtGui import QPalette, QColor __author__ = 'pawel' from PyQt4 import QtGui from PyQt4.QtCore import Qt class FmColorEdit(QtGui.QLineEdit): def __init__(self, parent): super(FmColorEdit, self).__init__(parent) self.setReadOnly(True) def mousePressEvent(self, event): self....
724
245
import sys, os, urllib, StringIO, traceback, cgi, binascii, getopt, shutil import zipfile, gzip, tarfile #sys.path.append('/usr/local/pypi/lib') import store, config def set_password(store, name, pw): """ Reset the user's password and send an email to the address given. """ user = store.get_user(name.str...
6,543
2,026
import random import re import six from itertools import izip from geodata.address_expansions.gazetteers import * from geodata.encoding import safe_decode, safe_encode from geodata.text.normalize import normalized_tokens from geodata.text.tokenize import tokenize_raw, token_types from geodata.text.utils import non_br...
1,777
578
num = 1 while num <= 10: # Fill in the condition x = num ** 2# Print num squared num = num + 1# Increment num (make sure to do this!) print x print num
170
62
from setuptools import setup, find_packages def requirements() -> list: return [ 'click==6.7', 'curio==0.8', ] setup( name='udptest', version='0.1.0', description='UDP benchmarking/testing tool.', long_description=open('README.rst').read(), url='https://github.com/povilas...
948
310
from __future__ import division import numpy as np from untwist import data from untwist import transforms def target_accompaniment(target, others, sample_rate=None): """ Given a target source and list of 'other' sources, this function returns the target and accompaniment as untwist.data.audio.Wave objec...
3,200
1,018
import os import re class EventHandler: def __init__(self, fname, suffix = '_events'): # Removing extension and suffix (if present) fname = re.sub( r'\.tsv$', '', fname ) fname = re.sub( suffix + '$', '', fname ) self.__filename = '{}{}.tsv'.format(fname, suffix) self.trials ...
812
252
from unittest import TestCase class A(TestCase): def test_it(self): pass
87
29
''' Statement Fibonacci numbers are the numbers in the integer sequence starting with 1, 1 where every number after the first two is the sum of the two preceding ones: 1, 1, 2, 3, 5, 8, 13, 21, 34, ... Given a positive integer n, print the nth Fibonacci number. Example input 6 Example output 8 ''' num = int(input()...
427
158
from src.sum_up import * def test_sum_up(): x = 1 y = 2 assert sum_up(x,y) == 3 def test_sum_up3(): assert sum_up3(1,2,3) == 6
144
71
# -*- coding: utf-8 -*- """ Created on Fri Jul 13 15:38:11 2018 @author: Yekta """ import csv import numpy as np from sklearn.cluster import KMeans clon = list(csv.reader(open("C:/Users/Yekta/Desktop/stajvol3/MoS2BP Binding Characterization_07-11-17_DY.csv"))) for k in range(1,15): fin=[] for m i...
1,376
588
#!/usr/bin/env python # -*- coding: utf-8 -*- """ test_collision.test_discretedynamicsworld """ from __future__ import unicode_literals, print_function, absolute_import import unittest import bullet from .test_worlds import WorldTestDataMixin class DiscreteDynamicsWorldTestCase(WorldTestDataMixin, ...
1,440
456
# (C) Copyright 2010-2020 Enthought, Inc., Austin, TX # All rights reserved. import unittest from force_wfmanager.notifications.ui_notification_hooks_manager \ import \ UINotificationHooksManager from force_wfmanager.notifications.ui_notification_plugin import \ UINotificationPlugin class TestUINotifi...
820
265
from django.shortcuts import redirect from .models import UserLanguage class FirstLoginMiddleware(object): def process_request(self, request): if request.user.is_authenticated: langs = UserLanguage.objects.filter(user=request.user) if langs.__len__() == 0: return r...
447
122
money = 2000 print(money) # 変数moneyに5000を足して、変数moneyを上書きしてください money += 5000 # 変数moneyの値を出力してください print (money)
113
82
#!/usr/bin/env python # -*- coding: utf-8 -*- from flask import redirect, request, url_for from flask.views import MethodView from flask.ext.security import current_user class SwatchView(MethodView): """ change the bootswatch theme """ def post(self): current_user.set_swatch(request.form.get...
380
119
"""Randomised linear algebra.""" import numpy.linalg as la def normalise(v): norm = la.norm(v) return v if 0 == norm else v / norm
142
51
from bt_utils.console import Console from bt_utils.config import cfg from bt_utils.embed_templates import SuccessEmbed, WarningEmbed from bt_utils.handle_sqlite import DatabaseHandler SHL = Console('BundestagsBot Reload') DB = DatabaseHandler() settings = { 'name': 'reload', 'channels': ['team'], 'mod_cmd...
887
278
#! /usr/bin/env python2.7 import getopt, sys, time, util from wmbus import WMBusFrame from Crypto.Cipher import AES def main(argv): samplefile = '' interface = '/dev/ttyUSB3' usagetext = 'scanner.py -hv -i <interface>' verbosity = 0 # setup known keys dictionarry by their device id ...
4,022
1,175
# encoding: utf-8 # module gi._gi # from /usr/lib/python3/dist-packages/gi/_gi.cpython-35m-x86_64-linux-gnu.so # by generator 1.145 # no doc # imports import _gobject as _gobject # <module '_gobject'> import _glib as _glib # <module '_glib'> import gi as __gi import gobject as __gobject from .object import object c...
2,080
619
#!/usr/bin/env python # -*- coding: utf-8 -*- from selecta import __version__ from setuptools import setup options = dict( name='python-selecta', version=__version__, url='http://github.com/ntamas/python-selecta', description='Python port of @garybernhardt/selecta', license='MIT', author='T...
828
268
# cython: language_level=3 from distutils.core import setup, Extension from Cython.Build import cythonize import numpy # import cython_utils import os os.environ["CC"] = "/opt/homebrew/Cellar/gcc/11.2.0_3/bin/g++-11" os.environ["CXX"] = "/opt/homebrew/Cellar/gcc/11.2.0_3/bin/g++-11" setup(ext_modules=cython...
525
219
import sys def get_network(args): """ return given network """ if args.MODEL.NAME == 'vgg16': from models.vgg import vgg16_bn net = vgg16_bn() elif args.MODEL.NAME == 'vgg13': from models.vgg import vgg13_bn net = vgg13_bn() elif args.MODEL.NAME == 'vgg11': from models.vgg import vgg11_bn net = vgg11...
4,958
2,037
import pytest from hypothesis import ( given, settings, strategies as st, ) from eth_utils import ( ValidationError, ) from eth.constants import ( ZERO_HASH32, ) from eth2.beacon.committee_helpers import ( get_crosslink_committees_at_slot, ) from eth2.beacon.state_machines.forks.serenity.block...
10,812
3,486
########################################################################################################### ########################################################################################################### ## SeqtaToSDS ...
13,679
3,695
""" 存储一些经常使用的图像操作 """ import os from PIL import Image from numpy import * def get_imlist(path): """ 返回目录中所有JPG图像的文件名列表 :param path: :return: """ return [os.path.join(path, f) for f in os.listdir(path) if f.endswith('.jpg')] def imresize(im, sz): """ 图像缩放 :param im: 图像对应的数据 :pa...
457
216
from django.shortcuts import ( render, redirect, reverse, get_object_or_404, HttpResponse) from django.contrib import messages from shop.models import Product from members.models import Member def load_cart(request): """This view render's the user's cart contents""" return render(request, 'cart/cart.html'...
5,190
1,478
from confess import app from confess.config import PORT, DEBUG if __name__ == '__main__': app.run( host='0.0.0.0', port=PORT, debug=DEBUG )
172
61
""" Plots analysis on the workflow variables for experiments with different workflow types and different %of workflow core hours in the workload. Resuls are plotted as barchars that show how much the vas deviate in single and multi from aware. """ import matplotlib from orchestration import get_central_db from orches...
5,945
2,287
from __future__ import annotations from .title import TitleFromGroupChat, Base class InevitableTitle(TitleFromGroupChat): __tablename__ = f'{Base.TABLENAME_PREFIX}inevitable_titles' __group_chat_back_populates__ = 'inevitable_titles' def __repr__(self): return ('<InevitableTitle(' ...
410
138
import requests import pandas as pd import matplotlib.pyplot as plt url_gas_data = 'https://raw.githubusercontent.com/KeithGalli/matplotlib_tutorial/master/gas_prices.csv' res1 = requests.get(url_gas_data, allow_redirects=True) with open('gas_prices.csv', 'wb') as file: file.write(res1.content) plt.figure(figsiz...
1,034
413
import unittest import uuid from app import survey_loader from app import message_manager from app.tester import run_survey class TestSurveys(unittest.TestCase): @classmethod def setUpClass(cls): message_manager.start() @classmethod def tearDownClass(cls): message_manager.stop() ...
2,305
674
from os import environ from azure.storage.table import TableService azure_account_name = environ['AZURE_ACCOUNT_NAME'] azure_account_key = environ['AZURE_ACCOUNT_KEY'] azure_table_name = environ['AZURE_TABLE_NAME'] table = TableService(azure_account_name, azure_account_key) get_entity = table.get_entity def fetch_v...
509
166
import logging import h5py import numpy as np from sklearn.utils import check_random_state from csrank.constants import OBJECT_RANKING from csrank.dataset_reader.letor_dataset_reader import LetorDatasetReader from csrank.dataset_reader.objectranking.util import sub_sampling NAME = "LetorObjectRankingDatasetReader" ...
3,424
1,170
from sklearn.preprocessing import QuantileTransformer, PowerTransformer from hydroDL.data import usgs, gageII, gridMET, ntn, GLASS, transform, dbBasin import numpy as np import matplotlib.pyplot as plt from hydroDL.post import axplot, figplot from hydroDL import kPath import json import os import importlib importlib.re...
1,222
580
""" The :mod:`pysad.statistics` module contains methods to keep track of statistics on streaming data. """ from .abs_statistic import AbsStatistic from .average_meter import AverageMeter from .count_meter import CountMeter from .max_meter import MaxMeter from .median_meter import MedianMeter from .min_meter import MinM...
659
207
"""Global index view.""" import pkg_resources from django.shortcuts import render def index(request): """Basic view.""" plugins = \ [plugin.load() for plugin in pkg_resources.iter_entry_points(group='elrados.plugins')] return render(request, "index.html", { "plugins": plugins ...
324
98
import pandas as pd import matplotlib.pyplot as plt from zipline.finance.commission import PerShare from zipline.api import set_commission, symbol, order_target_percent import zipline from models.live_momentum import LiveMomentum with open('/Users/landey/Desktop/Eonum/live_model/eouniverse/stock_list.txt', 'r') as f...
2,274
840
# Copyright 2020 Jan Feitsma (Falcons) # SPDX-License-Identifier: Apache-2.0 #!/usr/bin/env python3 # Jan Feitsma, March 2020 # Robot will continuously intercept around current position. # # For description and usage hints, execute with '-h' import sys, os import time import logging, signal logging.basicConfig(leve...
10,120
2,970
# -*- coding: utf-8 -*- import numpy as np import matplotlib.pyplot as plt from matplotlib.gridspec import GridSpec, GridSpecFromSubplotSpec from matplotlib.ticker import FuncFormatter def tick_label_func(y, pos=None): return '%1.f' % (5 * y * 1e-2 // 5) def tick_label_func_1(y, pos=None): return '%0.0f' ...
4,859
2,229