text
string
size
int64
token_count
int64
from .supervisor import Supervisor
35
9
# Generated by Django 3.0.5 on 2020-05-21 17:31 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('Entradas', '0011_comentarios'), ] operations = [ migrations.RenameField( model_name='comentarios', old_name='comentario', ...
366
130
from jd.api.base import RestApi class ComJdQlBasicWsGlscGlscBasicSecondaryWSGetAssortByFidRequest(RestApi): def __init__(self,domain,port=80): RestApi.__init__(self,domain, port) self.assFid = None def getapiname(self): return 'jingdong.com.jd.ql.basic.ws.glsc.GlscBasicSecondaryWS.getAssortByFid' ...
322
146
"""Unit tests for generate training data test.""" from os import path from absl import flags import tensorflow as tf from tensorflow_gnn.tools import generate_training_data from tensorflow_gnn.utils import test_utils FLAGS = flags.FLAGS class GenerateDataTest(tf.test.TestCase): def test_generate_training_data(...
682
214
import random as rnd import numpy as np from random_agent import RandomAgent from geister2 import Geister2 from vsenv import VsEnv class VsEnvs(VsEnv): """複数のエージェントからランダムに一つ使うやつ""" # Resetting def on_episode_begin(self, init_red0): self._opponent = rnd.choice(self._opponents) return super(...
561
213
import os.path import shutil from data_parsers.json_parser import JsonParser from data_parsers.xml_parser import XmlParser from data_parsers.parser import ParserError from packing_algorithms.ratcliff.texture_packer_ratcliff import TexturePackerRatcliff from packing_algorithms.maxrects.texture_packer_maxrects import Te...
2,007
629
import json import logging import rethinkdb as r from tornado import gen, escape from myslice.db.activity import Event from myslice.lib.util import myJSONEncoder from myslice.web.rest import Api logger = logging.getLogger('myslice.rest.confirm') class ConfirmHandler(Api): @gen.coroutine def get(self, id): ...
1,038
282
import requests def getContacts(email): payload = {'email': email} r = requests.get('https://api.fullcontact.com/v2/person.json', params=payload, headers={"X-FullContact-APIKey": "841831f8eef0a46f"}) return r.text
218
85
"""--- Day 1: Not Quite Lisp --- Santa was hoping for a white Christmas, but his weather machine's "snow" function is powered by stars, and he's fresh out! To save Christmas, he needs you to collect fifty stars by December 25th. Collect stars by helping Santa solve puzzles. Two puzzles will be made available on each d...
1,665
467
# vim: expandtab tabstop=4 shiftwidth=4 from setuptools import setup # read the contents of your README file from os import path this_directory = path.abspath(path.dirname(__file__)) with open(path.join(this_directory, 'README.md'), 'r') as f: long_description = f.read() setup( name='ipylogging', version...
875
282
from babel import Locale from flask import current_app as cur_app, request from flask.ext.babel import Babel, get_locale from functools import wraps from popong_nlp.utils.translit import translit __all__ = ['PopongBabel'] class PopongBabel(Babel): def init_app(self, app): super(PopongBabel, self).ini...
2,594
841
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may...
5,240
1,786
from selenium import webdriver from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as EC from selenium.webdriver.common.by import By import pickle import configparser class AmazonLogin: def __init__(self, driver=None): self.url = "https://www.a...
1,056
290
import numpy as np import heapq class PriorityQueue(list): def pop(self): return heapq.heappop(self) def push(self, value): return heapq.heappush(self, value) def neighbors(i, j): return ((i-1, j), (i+1, j), (i, j-1), (i, j+1)) def numpy_dijkstra(costs): m, n = costs.shape s...
1,317
519
""" The ffi for rpython, need to be imported for side effects """ from rpython.rtyper.lltypesystem import rffi from rpython.rtyper.lltypesystem import lltype from rpython.rtyper.tool import rffi_platform from rpython.rtyper.extfunc import register_external from pypy.module._minimal_curses import interp_curses from rpy...
5,291
1,888
import calcpy calcpy.calculcate()
34
13
import RPi.GPIO as GPIO import time from mfrc522 import SimpleMFRC522 import importlib.util spec = importlib.util.spec_from_file_location("conn", "lib/conn.py") conn = importlib.util.module_from_spec(spec) spec.loader.exec_module(conn) def readCard(): try: time.sleep(1) reader = SimpleMFRC522() cardid, ...
470
180
# -*- coding: utf-8 -*- # Copyright (c) 2019, Silvio Peroni <essepuntato@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 I...
1,310
483
class TextCharacterFormat: material_index = None use_bold = None use_italic = None use_small_caps = None use_underline = None
149
49
'''Unit test package for latexipy.'''
38
13
from enum import Enum class CounterOperationType(Enum): none = "None" increment = "Increment" delete = "Delete" get = "Get" def __str__(self): return self.value
192
62
from src.lib.spaces.vector import Vector class OrientedPlane: def __init__(self, normal: Vector) -> None: self.normal = normal.normalise() def reflect(self, initialVector: Vector): normalComponent: float = initialVector.dot(self.normal) if normalComponent < 0: normalCompon...
516
138
# Generated by Django 4.0.2 on 2022-02-02 19:01 import core.models from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('core', '0002_carro_motoristas'), ] operations = [ migrations.AlterField( mod...
715
241
# -*- coding: utf-8 -*- """Top-level package for snake.""" __author__ = """Luca Parolari""" __email__ = 'luca.parolari23@gmail.com' __version__ = '0.2.2'
156
72
import pickle import os import sys import pandas as pd from sklearn.metrics import accuracy_score from sklearn.model_selection import train_test_split import warnings warnings.filterwarnings("ignore", message="Reloaded modules: <module_name>") def train(): data = pd.read_csv('heart.csv') Y = data["target"...
1,357
506
from django.db import models from django.db.models import CASCADE class House(models.Model): class Meta: verbose_name = 'Дом' verbose_name_plural = 'дома' address = models.CharField(verbose_name='Адрес дома', max_length=255) tg_chat_id = models.BigIntegerField(verbose_name='ID чата жильцо...
1,432
500
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' \file genCompileScript.py \brief Python script to generate the compile script for unix systems. \copyright Copyright (c) 2018 Visual Computing group of Ulm University, Germany. See the LICENSE file at the...
3,592
1,408
#!/usr/bin/env python # -*- coding: utf-8 -*- import unittest import pandas as pd import numpy as np import pathlib import pickle from datetime import datetime, timezone from emhass.retrieve_hass import retrieve_hass from emhass.optimization import optimization from emhass.forecast import forecast from emhass.utils i...
8,326
2,949
class Args: def __init__(self, *args, **kwargs): self.args = args self.kwargs = kwargs class TestCase: def __init__(self, args: Args, answer): self.args = args self.answer = answer
223
71
from django.conf import settings from django.utils.functional import cached_property import redis from redis.sentinel import Sentinel from redis.exceptions import ConnectionError, ResponseError COUNTER_CACHE_KEY = 'experiments:participants:%s' COUNTER_FREQ_CACHE_KEY = 'experiments:freq:%s' class Counters(object): ...
4,555
1,379
import os ENV_ASSET_DIR = os.path.join(os.path.dirname(__file__), 'assets') def get_asset_xml(xml_name): return os.path.join(ENV_ASSET_DIR, xml_name) def test_env(env, T=100): aspace = env.action_space env.reset() for t in range(T): o, r, done, infos = env.step(aspace.sample()) prin...
447
172
""" Example of converting ResNet-50 PyTorch model """ import argparse import os import torch, torchvision import numpy as np from webdnn.backend import generate_descriptor, backend_names from webdnn.frontend.pytorch import PyTorchConverter from webdnn.util import console def generate_graph(): model = torchvisi...
1,483
453
from fileperms import Permission, Permissions class TestGetterSetter: def test_empty(self): prm = Permissions() for item in Permission: assert prm.get(item) == False def test_other(self): prm = Permissions() for item in Permission: prm.set(item, True) ...
436
131
from my_sum import sum def test_sum_benchmark(benchmark): hundred_one_list = [1] * 100 result = benchmark(sum, hundred_one_list) assert result == 100
157
60
import pygame class Settings(): # A class to store all settings for Alien Invasion. def __init__(self): # Screen Settings. self.screen_width = 1080 self.screen_height = 630 self.bg_image = pygame.image.load('Project_1-Alien_Invasion/_images/background_stars_moving.jpg') ...
1,889
619
import urllib import psycopg2 import psycopg2.extras # Connect to a postgres database. Tweak some things. def pgconnect(pghost, pgdb, pguser): connection = psycopg2.connect(host = pghost, dbname = pgdb, user = pguser) # Set autocommit to avoid repetitive connection.commit() statements. connection.autocom...
431
135
from flask import redirect, render_template, request, session, url_for from flask_login import login_required from app import letter_jobs_client from app.main import main from app.utils import user_is_platform_admin @main.route("/letter-jobs", methods=['GET', 'POST']) @login_required @user_is_platform_admin def lett...
1,153
374
""" Adapting Euler method to handle 2nd order ODEs Srayan Gangopadhyay 2020-05-16 """ import numpy as np import matplotlib.pyplot as plt """ y' = dy/dx For a function of form y'' = f(x, y, y') Define y' = v so y'' = v' """ def func(y, v, x): # RHS of v' = in terms of y, v, x return x + v - 3*y # PARAMETERS y0 ...
909
440
import cv2 import os import glob import numpy as np def mark(img):
73
25
__author__ = 'florian' import unittest from occi.backend import ActionBackend, KindBackend from sm.sm.backends import ServiceBackend from mock import patch from sm.sm.so_manager import SOManager from occi.core_model import Kind from occi.core_model import Resource @patch('mcn.sm.so_manager.CONFIG') @patch('mcn.sm.so_...
3,022
947
TESTPHRASE = 'Lorem ipsum' # ANSI COLORS # ====== FAMILY ===== # end = '\33[0m' bold = '\33[1m' italic = '\33[3m' underline = '\33[4m' blink = '\33[5m' blink2 = '\33[6m' selected = '\33[7m' # ====== COLOR ====== # # greyscale black = '\33[97m' grey = '\33[90m' grey2 = '\33[37m' white = '\33[30m' # less saturation red ...
4,738
2,067
import sys import os from setuptools import setup long_description = open("README.rst").read() classifiers = [ "Development Status :: 3 - Alpha", "License :: OSI Approved :: Apache Software License", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.7", "Programming Lang...
1,370
495
import random import numpy as np import torch import torch.nn as nn import torch.nn.functional as func from torchsupport.data.io import netwrite, to_device, make_differentiable from torchsupport.training.energy import DenoisingScoreTraining from torchsupport.training.samplers import AnnealedLangevin class ScoreSupe...
1,652
545
import time class Timer(): def __init__(self): self.start = time.time() def end(self): self.end = time.time() elapsed_time = self.end - self.start minutes = int(elapsed_time // 60) seconds = elapsed_time % 60 print("Elapsed time: {}m {}s".format(minutes, round...
332
110
import os import shutil from ..utils import temporary_directory class workspace_factory(temporary_directory): def __init__(self, source_space='src', prefix=''): super(workspace_factory, self).__init__(prefix=prefix) self.source_space = source_space def __enter__(self): self.temporary...
3,538
1,146
# ---------------------------------------------------------------------------- # Copyright (c) 2021, QIIME 2 development team. # # Distributed under the terms of the Modified BSD License. # # The full license is in the file LICENSE, distributed with this software. # -----------------------------------------------------...
1,019
311
from zero.side import SideInformation from zero.chrono import Chrono from collections import defaultdict from itertools import product import numpy as np import pickle import os.path import logging class RecommendationAlgorithmFactory: def __init__(self): self.algorithm_registry = {} self.algorith...
7,722
2,417
from __future__ import division from __future__ import print_function from __future__ import absolute_import """ Copyright 2009-2015 Olivier Belanger This file is part of pyo, a python module to help digital signal processing script creation. pyo is free software: you can redistribute it and/or modify it under the t...
150,103
52,707
from napalm_yang import base def model_to_dict(model, mode="", show_defaults=False): """ Given a model, return a representation of the model in a dict. This is mostly useful to have a quick visual represenation of the model. Args: model (PybindBase): Model to transform. mode (string...
5,382
1,551
from enum import IntEnum from typing import List, Dict class AssetType(IntEnum): FOREX = 0 CFD = 1 class SpreadMode(IntEnum): BIDASK = 0 RANDOM = 1 IGNORE = 2 FIXED = 3 SESSIONAL = 4 class Op(IntEnum): LONG = 0 SHORT = 1 HOLD = 2 CLOSEALL = 3 class Config: datafile:st...
2,430
1,017
# -*- coding: utf-8 -*- from __future__ import unicode_literals import datetime from django.db import models from django.utils.translation import ugettext_lazy as _ from model_utils import Choices from model_utils.fields import AutoCreatedField, AutoLastModifiedField from model_utils.models import StatusModel from m...
3,020
942
import torch import os from torch import nn from transformers import BertForTokenClassification,BertTokenizer,BertConfig; cwd=os.getcwd() class BERT_CRF(nn.Module): def __init__(self,vocab_size): pass
218
79
from .interpu import interpu from .minmaxmean import minmaxmean from .randomdeviates import random_deviates_1d, random_deviates_2d from .rotation_matrix import rotation_matrix from .smooth import smooth, smooth_sphere from .fit_model import fit_model from .histogram import HistogramSphere, Histogram, Histogram2d name...
415
142
import logging from typing import Any, Dict, List, Callable, Union import pandas as pd from dgraphpandas.config import get_from_config from dgraphpandas.strategies.vertical import vertical_transform logger = logging.getLogger(__name__) def horizontal_transform( frame: Union[str, pd.DataFrame], conf...
3,841
1,086
# 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, ...
2,675
943
# Create your views here. from django.template import Template, context, RequestContext from django.shortcuts import render_to_response, render, get_object_or_404, redirect, HttpResponseRedirect, HttpResponse from django.contrib.auth.decorators import login_required from remit_admin.forms import RateUpdateForm, Profile...
74,410
21,232
from ActiView import ActiveTwo import pyqtgraph as pg from pyqtgraph.Qt import QtCore, QtGui import numpy as np app = QtGui.QApplication([]) win = pg.GraphicsWindow() win.setWindowTitle("Mimicking ActiView's EEG monitoring screen") monitor = win.addPlot() #we have so many curves that we will store them in an array ...
932
317
import os class NetworkParameters: def __init__(self, modelDirectory): self.modelDirectory = modelDirectory if os.path.exists(self.modelDirectory) is False: os.mkdir(self.modelDirectory) self.checkpointedModelDir = os.path.join(self.modelDirectory, 'savedModels') if ...
608
192
import os import logging import numpy as np import torch from PIL import Image #from torchsummary import summary from thop import profile __all__ = ['get_color_pallete', 'print_iou', 'set_img_color', 'show_prediction', 'show_colorful_images', 'save_colorful_images'] def print_iou(iu, mean_pixel_acc, clas...
11,401
8,089
from django.conf import settings from django.utils.timezone import now from .utils import intspace, set_param def extra(request): ctx = { 'dir': dir, 'list': list, 'len': len, 'enumerate': enumerate, 'range': range, 'settings': settings, 'now': now, 'intspace': intspace, 'set_param': set_...
342
104
class Hotel: def __init__(self, name: str): self.name = name self.rooms = [] self.guests = 0 @classmethod def from_stars(cls, stars_count): name = f'{stars_count} stars Hotel' return cls(name) def add_room(self, room): self.rooms.append(room)...
1,163
409
#!/usr/bin/env python __author__ = "Sreenivas Bhattiprolu" __license__ = "Feel free to copy, I appreciate if you acknowledge Python for Microscopists" # https://www.youtube.com/watch?v=6P8YhJa2V6o """ Using Random walker to generate lables and then segment and finally cleanup using closing operation. """ import mat...
2,671
1,046
SUB_SECRET = 'secret' SUB_MAIN = 'main'
40
19
#!/usr/bin/env python from termcolor import cprint import argparse import docker DOCKER_CLIENT = docker.from_env() def main(): try: not_found_for_stop = False not_found_for_start = False ARGS = parser_arguments() k_name_stop = 'byr' if ARGS.service == 'dla' else 'dev' k_nam...
3,090
912
def get_http_header(user_agent): # 字典数据类型 dict headers = { 'user-agent': user_agent } return headers
125
46
import random import matplotlib.pyplot as plt import numpy as np # 在一个图形中创建两条线 fig = plt.figure(figsize=(10, 6)) ax1 = fig.add_subplot(1, 1, 1) ax1.set_xlabel('Frame', fontsize=18) ax1.set_ylabel('Overall Time Cost (s)', fontsize=18) x = range(180) y1 = [] y2 = [] for i in range(180): y1.append(random.uniform(0...
625
318
from typing import Dict XRD_RRI: Dict[str, str] = { "mainnet": "xrd_rr1qy5wfsfh", "stokenet": "xrd_tr1qyf0x76s", "betanet": "xrd_br1qy73gwac", "localnet": "" }
176
96
# These requirements were auto generated # from software requirements specification (SRS) # document by TestFlows v1.6.200716.1214830. # Do not edit by hand but re-generate instead # using 'tfs requirements generate' command. from testflows.core import Requirement RQ_SRS001_CU_LS = Requirement( name='RQ.SRS001...
1,349
460
import os from flask import Flask #import SQLAlchemy from flaskr import db def clear_data(session): meta = db.metadata for table in reversed(meta.sorted_tables): print('Clear table %s' % table) session.execute(table.delete()) session.commit() def create_app(test_config=None): # cre...
1,067
335
from nlpatl.sampling.clustering.nearest_mean import NearestMeanSampling from nlpatl.sampling.clustering.farthest import FarthestSampling
139
51
import rdflib import requests from EvaMap.Metrics.metric import metric def sameAs(g_onto, liste_map, g_map, raw_data, g_link) : result = metric() result['name'] = "Use of sameAs properties" nbPossible = 0 points = 0 set_URIs = set() for s, _, _ in g_map.triples((None, None, None)) : if...
830
300
# -*- coding: utf-8 -*- from __future__ import absolute_import import os from zeeko._build_helpers import get_utils_extension_args, get_zmq_extension_args, _generate_cython_extensions, pxd, get_package_data from astropy_helpers import setup_helpers utilities = [pxd("..utils.rc"), pxd("..utils.msg"), ...
1,501
502
# -*- coding: utf-8 -*- import logging from django.db.models import get_model from rest_framework import serializers from networkapi.util.geral import get_app from networkapi.util.serializers import DynamicFieldsModelSerializer log = logging.getLogger(__name__) class RouteMapV4Serializer(DynamicFieldsModelSerializ...
5,716
1,503
from src import db, BaseMixin class Log(db.Model, BaseMixin): action = db.Column(db.String(55), nullable=False) owner_id = db.Column(db.Integer, db.ForeignKey('user.id')) updated_data = db.Column(db.String(1024)) updated_model = db.Column(db.String(125))
274
107
# -*- coding: utf-8 -*- """ /*************************************************************************** UDTPlugin In this file is where the LineMMC class is defined. The main function of this class is to run the automation process that exports the geometries and generates the metadata of a municipal line. **********...
10,329
3,391
""" Module: Sentiment Analysis Author: Hussain Ali Khan Version: 1.0.0 Last Modified: 29/11/2018 (Thursday) """ from vaderSentiment.vaderSentiment import SentimentIntensityAnalyzer import pandas as pd import re import os from emoji import UNICODE_EMOJI import matplotlib.pyplot as plt import seaborn as sns class Res...
5,369
1,792
""" Modified code from https://github.com/nwojke/deep_sort """ import numpy as np import copy import torch import torch.nn as nn import torch.nn.functional as F import scipy.signal as signal from scipy.ndimage.filters import gaussian_filter1d class TrackState: """ Enumeration type for the single target t...
11,100
3,530
import re from django.contrib.auth.backends import ModelBackend from django.contrib.auth.mixins import LoginRequiredMixin from django.http import JsonResponse from apps.users.models import User class AuthMobile(ModelBackend): def authenticate(self, request, username=None, password=None, **kwargs): try: ...
818
235
from django.conf.urls import url, patterns from . import views urlpatterns = patterns("", )
95
31
''' ''' import sys, subprocess sys.path.insert(0, '/nethome/asalomatov/projects/ppln') import logProc ntFlag = '-nt 10' #interval_padding = '--interval_padding 0' # bed files padded with 100bp interval_padding = '--interval_padding 200' read_filter = '--read_filter BadCigar' print '\nsys.args :', sys.argv[1:] inb...
1,184
514
# -*- coding: utf-8 -*- import cv2 import numpy as np import os import pandas as pd import math from skimage import io from skimage.transform import rescale import skimage import numba from numba import prange import time from pathlib import Path # MAX 35 IMG ## Create TXT FILE for loading def import_norm_data(fil...
14,773
5,562
##################################################################### # # # File: csvtoqbo.py # # Developer: Paul Puey # # Original Code by: Justin Leto # # Forked from https://github.com/jleto/csvtoqbo # # # # main utility script file Python scrip...
4,676
1,706
import copy import json import os from app.common import path from app.common.projection import epsg_string_to_proj4 from app.common.test import BaseApiTest from . import geofile, storage class TestLoad(BaseApiTest): def testArea(self): with self.flask_app.app_context(): layer = geofile.load...
14,613
4,508
import os import sys def get_script_path(): #the path to the actual called script return os.path.realpath(sys.argv[0]) def get_script_dir(): #the path to the actual called script directory return os.path.dirname(os.path.realpath(sys.argv[0])) def get_executing_file_dir(): #e.g. the path to the module file ...
488
161
''' Basic piTomation configuration options. ''' from pydantic import BaseModel from typing import Any, Optional, Union from pydantic.class_validators import validator __pdoc__ = { "WithPlugins": None, "configuration": None } __registry: dict[type, list[type]] = {} '''Contains all @configuration class types,...
6,676
1,778
default_app_config = 'danceschool.payments.paypal.apps.PaypalAppConfig'
72
27
__version__ = "1.0.0b13"
25
16
"""Script to generate c++ header file of canbus constants.""" from __future__ import annotations import argparse import io from enum import Enum from typing import Type, Any import sys from opentrons_ot3_firmware.constants import ( MessageId, FunctionCode, NodeId, ) class block: """C block generator....
2,414
719
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ] operations = [ migrations.CreateModel( name='ResponsePage', fields=[ ('id', models.AutoField...
772
221
# Copyright 2018 Samuel Payne sam_payne@byu.edu # 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 ...
5,495
1,658
#coding=utf-8 import numpy as np # TODO: MULTISTEP LR_POLICY_NUM = 7 class LR_POLICY: FIXED, STEP, EXP, INV, MULTISTEP, POLY, SIGMOID = range(LR_POLICY_NUM) class LRUpdater: def __init__(self, *args, **kwargs): if "base_lr" in kwargs: self.base_lr = kwargs["base_lr"] else: ...
1,958
810
import git from mlflow.tracking import MlflowClient from .utils import scp_files class MyMLFlowClient: """ Class to handle all MLFlow interactions. Only need one such client (i.e. can be used for many training runs). """ def __init__(self, tracking_uri): """ Initialise :param t...
5,098
1,421
# coding=utf-8 # Copyright 2021 The Google Research Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
4,215
1,551
from tilequeue.queue import MessageHandle import threading class OutputFileQueue(object): ''' A local, file-based queue for storing the coordinates of tiles to render. Can be used as a drop-in replacement for `tilequeue.queue.sqs.SqsQueue`. Note that it doesn't support reading/writing from multiple `t...
1,675
493
import logging from PyQt5.QtCore import QTimer logger = logging.getLogger('logsmith') class Repeater: def __init__(self): self._current_task = None def start(self, task, delay_seconds): delay_millies = delay_seconds * 1000 self.stop() logger.info('start timer') time...
563
175
from condensate.core.build import gpcore
40
13
# -*- coding: utf-8 -*- """Sub-level package for Scanner, a metrical scanner in Urdu BioMeter.""" __author__ = """A. Sean Pue""" __email__ = "a@seanpue.com" from .scanner import * # noqa from .ghazal import * # noqa from .types import * # noqa
250
102
from canlib import canlib num_channels = canlib.getNumberOfChannels() print("Found %d channels" % num_channels) for ch in range(0, num_channels): chdata = canlib.ChannelData(ch) print("%d. %s (%s / %s)" % (ch, chdata.device_name, chdata.card_upc_no, ...
346
114
from abc import ABC, abstractmethod from dataclasses import asdict, dataclass from typing import Any from triggers.env_trigger import DataPool, Triggerable @dataclass class BaseConfig(Triggerable, ABC): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) def __post_init__(self): ...
2,208
635
"""PackageCompat type. """ from __future__ import annotations import typing from enum import Enum class PackageInfo(typing.TypedDict): """PackageInfo type.""" name: str version: str namever: str size: int home_page: str author: str license: str class PackageCompat(PackageInfo): """PackageCompat type.""" ...
917
469