text
string
size
int64
token_count
int64
from gensim.scripts.glove2word2vec import glove2word2vec (count, dimensions) = glove2word2vec("dataset/glove.42B.300d.txt", "dataset/cropus/42B_w2v.txt")
154
70
# -*- coding: utf-8 -*- """ Created on Sun Jul 19 22:17:33 2015 @author: piotr at nicecircuits.com """ from libraryManager.library import libraryClass from footprints.footprintSmdDualRow import footprintSmdDualRow from libraryManager.part import part from libraryManager.symbol import symbol from libraryManager.symbol...
4,970
1,751
import math n, t, k, d = map(int, input().split()) x = math.ceil(n/k) * t if (d + t) < x: print("YES") else: print("NO")
131
61
import keras from keras import layers from keras.layers import Dropout, Dense from keras.preprocessing.image import ImageDataGenerator import numpy as np import tensorflow_hub as hub import cv2 import pandas as p IMAGE_SHAPE = (224, 224) #(HEIGHT, WIDTH) TRAINING_DATA_DIRECTORY = '/content/drive/My Drive/Colab ...
3,159
1,035
""" A set of functions for extracting header information from PSG objects Typically only used internally in from unet.io.header.header_extractors Each function takes some PSG or header-like object and returns a dictionary with at least the following keys: { 'n_channels': int, 'channel_names': list of strings,...
12,421
3,439
import sys,os import json import logging as log import socket from collections import OrderedDict import datetime from platform import system as system_name # Returns the system/OS name from subprocess import call as system_call # Execute a shell command def ping(host): """ Returns True if host (str) re...
2,620
811
############################################################################## # # Copyright (c) 2012 Zope Foundation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # THIS SOF...
27,156
8,286
#!/usr/bin/env python from flask import Flask from flask import render_template, request app = Flask(__name__) """ # https://www.pluralsight.com/guides/manipulating-lists-dictionaries-python # A list is a mutable, ordered sequence of items. # list = ['a', 'b', 'c'] # list[0] # A dictionary is a mutable, unordered se...
2,410
837
#coding:utf-8 # # id: bugs.core_1894 # title: Circular dependencies between computed fields crashs the engine # decription: # Checked on LI-T4.0.0.419 after commit 19.10.2016 18:26 # https://github.com/FirebirdSQL/firebird/commit/6a00b3aee6ba17b2f80a5b00def728023e34...
1,971
730
# # Modules Info # import pykd moduleList = [] def reloadModules(): global moduleList for m in moduleList: globals()[ m.name().lower() ] = None if pykd.isKernelDebugging(): global nt nt = pykd.loadModule("nt") modules = pykd.typedV...
1,296
531
from construct import * from construct.lib import * repeat_eos_u4 = Struct( 'numbers' / GreedyRange(Int32ul), ) _schema = repeat_eos_u4
139
54
# -*- coding: utf-8 -*- # aes256.py # This file is part of SimpleEncrypt project (https://github.com/shreyasnayak/SimpleEncrypt) # # Copyright Shreyas Nayak (c) 2021-2022 <shreyasnayak21@gmail.com> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documen...
2,981
1,146
"""Test module for the Error dialog widget.""" import os import logging import pytest from PySide2.QtGui import QClipboard from src.widgets import error_dialog from src.about import about_to_string @pytest.fixture() def error_log_path(_package): """Get the log directory path.""" yield os.path.join(_package...
1,735
522
# -*- coding: utf-8 -*-# ''' @Project : ClassicAlgorighthms @File : HashTable.py @USER : ZZZZZ @TIME : 2021/4/25 18:25 ''' class Node(): ''' 链地址法解决冲突的结点 ''' def __init__(self, value = None, next = None): self.val = value self.next = next class HashTable(): ...
3,854
1,989
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
7,908
2,235
import gzip def read_fasta(filename): name = None seqs = [] fp = None if filename.endswith('.gz'): fp = gzip.open(filename, 'rt') else: fp = open(filename) for line in fp.readlines(): line = line.rstrip() if line.startswith('>'): if len(seqs) > 0: seq = ''.join(seqs) yield(name, seq) na...
1,017
493
import torch from pytorch_lightning import Trainer, seed_everything from pytorch_lightning.loggers import WandbLogger from pytorch_lightning.callbacks import LearningRateMonitor from data import CIFAR10Data from module import CIFAR10Module from callbacks import * from pathlib import Path import wandb from absl import...
2,413
819
import networkx as nx import string import numpy as np import math def degree_centrality(G): centrality={} s=1.0 centrality=dict((n,d*s) for n,d in G.degree_iter()) return centrality def in_degree_centrality(G): if not G.is_directed(): raise nx.NetworkXError("in_degree_centrality() not...
10,559
3,364
"""Sequence generation framework. Recurrent networks are often used to generate/model sequences. Examples include language modelling, machine translation, handwriting synthesis, etc.. A typical pattern in this context is that sequence elements are generated one often another, and every generated element is fed back in...
30,867
8,597
import matplotlib.pyplot as plt import numpy as np def plotComponents2D(X, y, labels, use_markers = False, ax=None, legends = None, tags = None): if X.shape[1] < 2: print('ERROR: X MUST HAVE AT LEAST 2 FEATURES/COLUMNS! SKIPPING plotComponents2D().') return # Gray shades can be given ...
1,752
608
#!/usr/bin/python from __future__ import absolute_import from builtins import object import threading import time from collections import namedtuple from . import ta_consts as c from ..common import log as stulog from ...splunktalib.common import util as scu evt_fmt = ("<stream><event><host>{0}</host>" ...
5,541
1,595
class Circle: def __init__(self, radius): self.radius = radius def compute_area(self): return self.radius ** 2 * 3.14 circle = Circle(2) print("Area of circuit: " + str(circle.compute_area()))
220
73
class Solution: def addStrings(self, num1: str, num2: str) -> str: i, j, result, carry = len(num1) - 1, len(num2) - 1, '', 0 while i >= 0 or j >= 0: if i >= 0: carry += ord(num1[i]) - ord('0') if j >= 0: carry += ord(num2[j]) - ord('0') ...
502
179
import pandas as pd from my_mod import enlarge print("Hello!") df = pd.DataFrame({"a":[1,2,3], "b":[4,5,6]}) print(df.head()) x = 11 print(enlarge(x))
154
72
#-*-coding: utf-8-*- from requests import session from bs4 import BeautifulSoup #Aqui pones la ip de tu maquina. host = "192.168.1.167" #Aqui pones la ruta de el dns-lookup.php route = "/mutillidae/index.php?page=dns-lookup.php" with session() as s: cmd = '' while cmd != 'exit': cmd = input(">>") payload = "|...
885
332
# sys.stdin.readline() import sys input = sys.stdin.readline print(input().replace('2017', '2018'))
101
43
""" Utility classes and functions for RSMTool file management. :author: Jeremy Biggs (jbiggs@ets.org) :author: Anastassia Loukina (aloukina@ets.org) :author: Nitin Madnani (nmadnani@ets.org) :organization: ETS """ import json import re from glob import glob from pathlib import Path from os.path import join from .c...
4,069
1,128
from ._threads import _Thread from .utils import filter from .videobulk import _VideoBulk from ._http import _get_playlist_data from ._rgxs import _PlaylistPatterns as rgx from typing import List, Optional, Dict, Any class Playlist: __HEAD = 'https://www.youtube.com/playlist?list=' def __init__(self, playli...
2,479
770
import random def go_to_sleep(text): replies = ['See you later!', 'Just call my name and I\'ll be there!'] return (random.choice(replies)) quit()
160
55
import logging from django.contrib.messages import get_messages from django.utils.encoding import force_str logger = logging.getLogger('django_sso_app') def get_request_messages_string(request): """ Serializes django messages :param request: :return: """ storage = get_messages(request) ...
441
127
#!/opt/anaconda3/bin/python # -*- coding: utf-8 -*- """ Get Stock Data """ import time import pandas as pd import yfinance as yf if __name__ == '__main__': # Path to file # TODO: make directory if directory doesn't exist f_file = "/Users/d.e.magno/Datasets/raw_stocks_new.csv" # TODO: need to ...
1,092
362
""" This module contains functions related to integer formatting and math. """ from functools import reduce from itertools import count from math import gcd, prod # ================ ARRAY FORMATTING FUNCTIONS ================ def str_array_to_int(intarray): return int(''.join(intarray)) def int_array_to_int(i...
2,421
843
#!/usr/bin/env python from keras.models import Sequential from keras.layers import Dense, Activation, Dropout, TimeDistributed, Flatten from keras.layers import LSTM ''' Reference: https://keras.io/getting-started/sequential-model-guide/ A stateful recurrent model is one for which the internal states (memories) obta...
2,260
698
# -*- coding: utf-8 -*- import random from datetime import datetime from operator import itemgetter import requests import time from pyinstagram.model import Media from .exceptions import OAuthException, PyInstagramException from .oauth import OAuth from .constants import API_URL from .utils import DESAdapter class...
26,696
8,671
import csv from typing import List, Iterator, Dict from entities.StayPoint import StayPoint def read(file_path: str) -> List[StayPoint]: """ Returns a list of StayPoint read from the specified file path :param file_path: The path of file to read :return: A list of StayPoint """ file = open(fi...
1,483
475
from django.db import models # Create your models here. class User(models.Model): gender = ( ('male',"男"), ('female',"女") ) name = models.CharField(max_length=128,unique=True) password = models.CharField(max_length=256) email = models.EmailField(unique=True) sex = models.CharF...
1,959
690
import ImportTitanicData import DataPreparation # analiza danych przed preparacją danych class DataAnaliysisBefore(): def showTrain(self): importData = ImportTitanicData.DataImport() train = importData.importTrain() return train def shapeTrain(self): return self.showTrain().sha...
2,083
664
"""Test Predict API calls""" import io from PIL import Image from dataclasses import dataclass import tempfile from pathlib import Path import pytest from mock import patch from mldock.api.predict import send_image_jpeg, send_csv, send_json, handle_prediction import responses import requests @pytest.fixture def image...
10,341
2,829
# 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 # d...
2,081
748
""" Don't load any Eclipse stuff at global scope, needs to be importable previous to Eclipse starting """ from storytext import javarcptoolkit import sys class ScriptEngine(javarcptoolkit.ScriptEngine): def createReplayer(self, universalLogging=False, **kw): return UseCaseReplayer(self.uiMap, universalLo...
1,105
329
# -*- coding: utf-8 -*- # Copyright (c) 2011,2014 Floor Terra <floort@gmail.com> # # Permission to use, copy, modify, and/or distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS ...
11,380
3,627
# -*- test-case-name: vumi.tests.test_worker -*- """Basic tools for workers that handle TransportMessages.""" import time import os import socket from twisted.internet.defer import ( inlineCallbacks, succeed, maybeDeferred, gatherResults) from twisted.python import log from vumi.service import Worker from vumi....
7,661
2,155
# setup.py # This script will build the main subpackages # See LICENSE for details from __future__ import print_function, absolute_import from numpy.distutils.misc_util import Configuration from os.path import join TTFORT_DIR = '../tt-fort' EXPM_DIR = '../tt-fort/expm' EXPOKIT_SRC = [ 'explib.f90', 'n...
1,204
480
from NekoGram import Neko, Bot import json def test_json_text_processor(): neko = Neko(bot=Bot(token='0:0', validate_token=False), validate_text_names=False) raw_json = '{"x": {"text": "hello"} }' neko.add_texts(texts=raw_json, lang='en') assert neko.texts['en'] == json.loads(raw_json)
305
122
from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models class Migration(migrations.Migration): dependencies = [migrations.swappable_dependency(settings.AUTH_USER_MODEL)] operations = [ migrations.CreateModel( name="Meeting", ...
7,960
1,807
# Copyright (c) 2020 Ngô Ngọc Đức Huy from db import db class MailModel(db.Model): """Model for representing and storing mails.""" id = db.Column(db.Integer, primary_key=True) sender = db.Column(db.String(254)) recipient = db.Column(db.String(254), db.ForeignKey('user_mode...
2,247
716
from collections import namedtuple import numpy as np import talib from jesse.indicators.ma import ma from jesse.indicators.mean_ad import mean_ad from jesse.indicators.median_ad import median_ad from jesse.helpers import get_candle_source, slice_candles BollingerBands = namedtuple('BollingerBands', ['upperband', 'm...
1,681
581
from __future__ import print_function import logging from argparse import ArgumentParser import backoff import requests import sys POLL_URL = 'https://coveralls.io/builds/{}.json' DONE_URL = 'https://coveralls.io/webhook' def setup_logging(): logger = logging.getLogger('backoff') logger.addHandler(logging....
3,050
860
import subprocess import glob import os import datetime # This file is part of https://github.com/cpina/science-cruise-data-management # # This project was programmed in a hurry without any prior Django experience, # while circumnavigating the Antarctic on the ACE expedition, without proper # Internet access, with 150...
1,399
461
""" Global Flask Application Settings """ import os from app import app class Config(object): DEBUG = False TESTING = False PRODUCTION = False class Development(Config): MODE = 'Development' DEBUG = True class Production(Config): MODE = 'Production' DEBUG = False PRODUCTION = True...
515
165
word = input('Enter a word') len = len(word) for i in range(len-1, -1, -1): print(word[i], end='')
103
44
ss = input('Please give me a string: ') if ss == ss[::-1]: print("Yes, %s is a palindrome." % ss) else: print('Nevermind, %s isn\'t a palindrome.' % ss)
162
65
from flask import Blueprint, jsonify, make_response from flask_restful import Resource, Api, reqparse, inputs from ..models.decorators import admin_required from ..models.models import UserModel import os class SignUp(Resource): def __init__(self): """ Validates both json and form-data input ...
5,420
1,552
""" Test the model blocks """ import datetime from django.test import TestCase from mock import Mock from django.db.models import Model, IntegerField, DateTimeField, CharField from django.template import Context, Template, TemplateSyntaxError from example_project.pepulator_factory.models import Pepulator, Distribut...
21,160
6,337
# Lint as: python3 r"""LIT Demo for a Toxicity model. To run locally: python -m lit_nlp.examples.toxicity_demo --port=5432 Once you see the ASCII-art LIT logo, navigate to localhost:5432 to access the demo UI. """ from absl import app from absl import flags from absl import logging from lit_nlp import dev_server ...
1,794
614
import pandas as pd import streamlit as st import plotly.graph_objects as go import plotly.express as px import plotly.io as pio pio.templates.default = "plotly_white" def load_portifolio_analysis(df_stocks_and_grades): st.write('# Portifolio analysis') st.write('## Investments by sector and sub sector') ...
2,669
973
""" Copyright 2015 Brocade Communications Systems, 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 t...
864
281
from .make_web_app import *
28
11
class AbridgerError(Exception): pass class ConfigFileLoaderError(AbridgerError): pass class IncludeError(ConfigFileLoaderError): pass class DataError(ConfigFileLoaderError): pass class FileNotFoundError(ConfigFileLoaderError): pass class DatabaseUrlError(AbridgerError): pass class Ex...
689
207
from rest_framework.permissions import BasePermission, IsAuthenticated class IsBackOffice(BasePermission): def has_permission(self, request, view): return bool(request.user and request.user.is_authenticated and request.user.role == 'collaborator') class IsUserBase(IsAuthenticated): def has_permissio...
989
268
import json probes = [] with open("./multilingual_probes.jsonl",'r') as f: for line in f: probes.append(json.loads(line.rstrip('\n|\r'))) results = [] for probe in probes: new_items = {} answer_labels = ["A", "B", "C", "D", "E","F","G","H"] print(probe["truth_id"]) answerKey = answer_label...
956
372
import pytest from labelsync.github import Github from labelsync.helpers import HTTPError from tests.helpers import fl, FIXTURES_PATH, create_cfg_env, get_labels c = create_cfg_env('good.cfg') github = Github(c, name='github', api_url='https://api.github.com/repos') label = { 'name':'blabla', 'color':...
2,016
670
import copy import random from pprint import pformat from txaio import make_logger from autobahn.wamp.exception import ApplicationError from autobahn.util import hl, hltype, hlid, hlval # a simple principals database. in real world use, this likey would be # replaced by some persistent database used to store principal...
4,249
1,314
#!/usr/bin/env python3 import itk import syd # ----------------------------------------------------------------------------- def stitch_image(db, image1, image2): print('image1', image1) print('image2', image2) im1 = syd.read_itk_image(db, image1) im2 = syd.read_itk_image(db, image2) im = stitch...
1,368
506
import numpy as np import pdb from . import columns from . import h5utils from .base import Base class DDT(Base): def __init__(self,segid): self.segid=segid self.pix=[] self.xyg=columns.XYG() self.wav=columns.WAV() self.val=columns.VAL() def extend(self,xyg,wa...
2,617
953
import os import tensorflow as tf import argparse parser = argparse.ArgumentParser() parser.add_argument('--ckpt_path', type=str) parser.add_argument('--output_path', type=str) args = parser.parse_args() os.environ["CUDA_VISIBLE_DEVICES"] = "-1" checkpoint = args.ckpt_path ##input_checkpoint input_che...
851
323
from django.db import models # 1. Django不支持符合主键(Composite Primary Key). # 2. Django不支持关闭主键(Disable Primary Key), # 当表中的所有字段都没有定义 Primary Key 时, # Django会自动增加一个id字段, 并将primary key设定到id字段上. # # # 一般情况下, InnoDB在建表时, 当没有定义Primary Key时, # 如果有 Unique Key 时, InnoDB会将该Unique Key当作聚集索引. # 如果也没有 Unique Key时, InnoDB会创建一个隐藏的...
2,045
854
import pandas as pd from pathlib import Path import sys ''' Concatenates all csv files in the folder passed to stdin ''' path = Path(sys.argv[1]) def get_csv_paths(path): return [p for p in path.iterdir() if p.suffix == '.csv'] def ask_details(): print('Please specify the following:') encod...
1,247
407
#!/usr/bin/env python import rospy import unittest, rostest from rostest_example.Quacker import * from std_msgs.msg import String, Int32 class DuckiecallTesterNode(unittest.TestCase): def __init__(self, *args): super(DuckiecallTesterNode, self).__init__(*args) self.msg_duckiecall = String() ...
2,589
891
import infra.basetest from tests.init.base import InitSystemBase as InitSystemBase class InitSystemBusyboxBase(InitSystemBase): config = infra.basetest.BASIC_TOOLCHAIN_CONFIG + \ """ # BR2_TARGET_ROOTFS_TAR is not set """ def check_init(self): super(InitSystemBusyboxBase, self...
1,679
604
from __future__ import absolute_import, unicode_literals from django.shortcuts import get_object_or_404 from mayan.apps.acls.models import AccessControlList from mayan.apps.documents.models import Document from mayan.apps.documents.permissions import permission_document_view from mayan.apps.rest_api import generics ...
8,529
2,402
import argparse, os import lib.config as config import lib.utils as utils def count_present_and_missing(cls, directory, metadata): """ Count present and missing videos for a class based on metadata. :param cls: The class. If None, count all videos (used for testing videos - no classes). :param direc...
4,013
1,325
def aumentar(preco, taxa): p = preco + (preco * taxa/100) return p def diminuir(preco, taxa): p = preco - (preco * taxa/100) return p def dobro(preco): p = preco * 2 return p def metade(preco): p = preco / 2 return p
257
118
# pylint: disable=invalid-name import pytest import sys from unittest.mock import MagicMock from test_common import create_config, DummyResource sys.path.append('plugins/sdm') from lib import ShowResourcesHelper pytest_plugins = ["errbot.backends.test"] extra_plugin_dir = 'plugins/sdm' class Test_show_resources: ...
3,885
1,197
import tensorflow as tf def tanh(x): return tf.nn.tanh(x)
64
27
# Generated by Django 3.0 on 2019-12-23 06:19 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('game', '0010_auto_20191223_0818'), ] operations = [ migrations.AddField( model_name='onlinegame', name='...
406
157
#### Transfer data from JSON file to MongoDB #### # @client.command() # async def qupload(self, ctx): # mclient = MongoClient(host="localhost", port=27017) # db = mclient.coeusbot # quotesdb = db.quotes # with open('quotes.json', 'r') as f: # quotes = json.load(f) # for quotenum in ra...
2,380
844
import shutil import pathlib asset_dirs = ["artifacts/main", "artifacts/build_python_version"] pathlib.Path("distfiles").mkdir(exist_ok=True) for asset_dir in asset_dirs: for fname in list(pathlib.Path(asset_dir).glob('**/RobotRaconteur-*-MATLAB*')): print(fname) dest = pathlib.Path(fname) ...
370
138
"""Metadata for package to allow installation with pip.""" import setuptools exec(open("closek/version.py").read()) with open("README.md", "r") as fh: long_description = fh.read() setuptools.setup( name="closek", description="Scikit-learn-style implementation of the close-k classifier.", long_descri...
821
269
from ramda.memoize_with import memoize_with from ramda.product import product from ramda.private.asserts import assert_equal as e count = 0 def memoize_with_test(): @memoize_with(lambda x: -x) def factorial(n): global count count += 1 return product(range(1, n + 1)) e(factorial(...
491
210
import numpy as np from cdlib.evaluation.internal import onmi from cdlib.evaluation.internal.omega import Omega from nf1 import NF1 from collections import namedtuple, defaultdict __all__ = [ "MatchingResult", "normalized_mutual_information", "overlapping_normalized_mutual_information_LFK", "overlappin...
18,821
5,969
from .node_view import ConnectNodesViewSet, PathViewSet
56
16
from typing import Optional import pytest from fastapi import FastAPI, Header from fastapi.testclient import TestClient from meiga import BoolResult, Failure, isFailure, isSuccess from petisco import NotFound, assert_http from petisco.extra.fastapi import FastAPIController app = FastAPI(title="test-app") result_fro...
1,193
379
from django.core.mail import send_mail from component.reminder.models import Reminder from server.celery import app @app.task def send_email(id): reminder = Reminder.objects.filter(id=id).first() if reminder is not None: send_mail(subject="ReminderMessage", message=reminder.text, ...
438
129
import pandas as pd import pytest from ..base import BaseMiner, MDLOptimizer def test_inst_params(): class MyMiner(BaseMiner): def __init__(self, eps=3): self.eps = eps self._a = 2 def fit(self, D): self._a = 12 kwargs = dict(eps=4) miner = MyMiner(**...
1,203
426
import season import random class Controller(season.interfaces.controller.base): def __init__(self, framework): super().__init__(framework) def __default__(self, framework): return self.redirect('list') def list(self, framework): data = [] for i in range(20): ...
893
272
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import copy import io import onnx import torch import torch.onnx.symbolic_helper as sym_help import torch.onnx.symbo...
11,770
3,850
from arekit.common.data.input.providers.label.multiple import MultipleLabelProvider from arekit.common.data.row_ids.multiple import MultipleIDProvider from arekit.common.data.storages.base import BaseRowsStorage from arekit.common.data.views.samples import BaseSampleStorageView from arekit.common.experiment.data_type i...
3,582
1,084
# # Copyright (c) 2009-2015, Jack Poulson # All rights reserved. # # This file is part of Elemental and is under the BSD 2-Clause License, # which can be found in the LICENSE file in the root directory, or at # http://opensource.org/licenses/BSD-2-Clause # from ..core import * import ctypes # Apply packed refle...
9,038
3,762
from Point import Point import Constant as c from GeometryMath import bisector_point class Bisector(Point): def __init__(self, item): """Construct Bisector.""" Point.__init__(self, item) self.item["sub_type"] = c.Point.Definition.BISECTOR def tikzify(self): return '\\tkzDefLin...
2,443
673
DOMAIN = "fitx" ICON = "mdi:weight-lifter" CONF_LOCATIONS = 'locations' CONF_ID = 'id' ATTR_ADDRESS = "address" ATTR_STUDIO_NAME = "studioName" ATTR_ID = CONF_ID ATTR_URL = "url" DEFAULT_ENDPOINT = "https://www.fitx.de/fitnessstudios/{id}" REQUEST_METHOD = "GET" REQUEST_AUTH = None REQUEST_HEADERS = None REQUEST_PAYLOA...
354
154
from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import int_or_none class SciVeeIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?scivee\.tv/node/(?P<id>\d+)' _TEST = { 'url': 'http://www.scivee.tv/node/62352', 'md5': 'b16699b74c9e6a120f677...
1,894
657
"""Process a big data EEG resource (TUH EEG Corpus) =================================================== In this example, we showcase usage of the Temple University Hospital EEG Corpus (https://www.isip.piconepress.com/projects/tuh_eeg/html/downloads.shtml#c_tueg) including simple preprocessing steps as well as cutting...
11,790
4,100
import logging import numpy as np from emmental.metrics.accuracy import accuracy_scorer from emmental.metrics.accuracy_f1 import accuracy_f1_scorer from emmental.metrics.fbeta import f1_scorer, fbeta_scorer from emmental.metrics.matthews_correlation import ( matthews_correlation_coefficient_scorer, ) from emmenta...
9,752
4,641
"""Module containing class `JobLoggingManager`.""" from collections import defaultdict from logging import FileHandler, Handler from logging.handlers import QueueHandler, QueueListener from multiprocessing import Queue import logging import vesper.util.logging_utils as logging_utils import vesper.util.os_utils as os...
3,986
1,017
import math from typing import List import numpy as np from datasets.Dataset import Dataset from models.Solution import Solution def calculate_avgValue(population: List[Solution]) -> float: avgValue = 0 for ind in population: avgValue += ind.compute_mono_objective_score() avgValue /= len(populati...
4,837
1,708
#!/usr/bin/env python """Original NetworkX graph tests""" from nose.tools import * import networkx import networkx as nx from networkx.testing.utils import * from historical_tests import HistoricalTests class TestDiGraphHistorical(HistoricalTests): def setUp(self): HistoricalTests.setUp(self) sel...
3,803
1,521
# -*- coding: utf-8 -*- # (c) Copyright IBM Corp. 2019. All Rights Reserved. # pragma pylint: disable=unused-argument, no-self-use import logging import re import sys import requests from bs4 import BeautifulSoup as bsoup from resilient_circuits import ResilientComponent, function, handler from resilient_circuits impo...
6,325
1,881
# # © Copyright 2020 Hewlett Packard Enterprise Development LP # # This file was auto-generated by the Python SDK generator; DO NOT EDIT. # from ...resource import Resource, Collection from ...exceptions import NimOSAPIOperationUnsupported class Group(Resource): """Group is a collection of arrays operating ...
28,484
6,892
import json import mtgsdk as mtg magic_sets = ('grn',) def main(): for s in magic_sets: cards = [vars(c) for c in mtg.Card.where(set=s).all()] with open(f'tests/data/{s}.json', 'w') as f: json.dump(cards, f, indent=4, sort_keys=True) if __name__ == '__main__': main()
309
126