text
string
size
int64
token_count
int64
import aiohttp from aiohttp import ClientConnectionError, ClientResponseError from .models import CoinsResponse, SimplePriceResponse from .configs import Config from typing import List, Dict, Union class APIHandler: def __init__(self): self._config: Config = Config() async def get_supported_coins(sel...
2,718
638
from argparse import ArgumentParser from pathlib import Path from tensorflow import keras # Define this script's flags parser = ArgumentParser() parser.add_argument('--lr', type=float, default=1e-3) parser.add_argument('--batch_size', type=int, default=32) parser.add_argument('--max_epochs', type=int, default=5) pars...
1,497
568
""" taskmaster.consumer ~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2010 DISQUS. :license: Apache License 2.0, see LICENSE for more details. """ import cPickle as pickle import gevent from gevent_zeromq import zmq from gevent.queue import Queue from taskmaster.util import import_target class Worker(object): def __init_...
4,432
1,312
import pygame as pg from pygame.time import Clock from src.drawer import Drawer from src.game import Game from src.utils.config import Config from src.utils.score import ScoresList from src.utils.sfx import SfxHolder from src.utils.text import Text from src.utils.util import Util, user_quit class Loop: def __ini...
3,165
882
#!/usr/bin/env python3 from ccjtools import ccj_make def test_detectExactSpecifiedCompilerCommandWord(): """Using -c option, check that the exact word is recognized""" inputFileName = 'dummy' parsedArgs = ccj_make.mkccj_parse_args(['progname', inputFileName, '-c', 'mastadon']) if not parsedArgs: ...
7,135
2,713
# VALID IP ADDRESSES # O(1) time and space def validIPAddresses(string): # Write your code here. validIPAddresses = [] if len(string) < 4: return [] for i in range(3): if not isValidPart(string[:i+1]): continue for j in range(i+1, i+4): if not isValidPart(string[i+1:j+1]): continue for k ...
748
340
""" this .py file contains all the parameters """ import os configs = {} main_dir = 'frame_vessel/resnet152' #****************************************read data parameters************************************** configs['max_angle'] = 20 configs['root_dir'] = 'data' configs['save_dir'] = 'saved_data' configs['im...
1,999
774
# # Copyright (c) nexB Inc. and others. All rights reserved. # ScanCode is a trademark of nexB Inc. # SPDX-License-Identifier: Apache-2.0 # See http://www.apache.org/licenses/LICENSE-2.0 for the license text. # See https://github.com/nexB/scancode-toolkit for support or download. # See https://aboutcode.org for more in...
2,707
766
# decompiled-by-hand & optimized # definitely not gonna refactor this one # 0.18s on pypy3 ip_reg = 4 reg = [0, 0, 0, 0, 0, 0] i = 0 seen = set() lst = [] while True: i += 1 break_true = False while True: if break_true: if i == 1: print("1)", reg[1]) if reg[1...
988
399
from django.conf import settings from canvas.metrics import Metrics class Funnel(object): def __init__(self, name, steps): self.name = name self.steps = steps def __repr__(self): return self.name def step_names(self): return [step.name for step in self.steps] class Funn...
1,247
376
import numpy as np from neupy import algorithms,plots import matplotlib.pyplot as plt from neupy.utils import format_data from neupy.algorithms.memory.utils import bin2sign,step_function import argparse dhnet = algorithms.DiscreteHopfieldNetwork(mode='async', check_limit=False) iteration = 0 output_data = None n_featu...
3,948
1,455
from init import conf_parse, socket_init from sock_ops import pull_sync, push_sync from fs_ops import construct_tree, differences from debug import debug_print import time def main(): conf = conf_parse() sock = socket_init(conf) debug_print("Initialization successful") debug_print("Checking remote") pull_sync(...
686
236
# N-Dimensional Tic-Tac-Toe by Thomas Lively from __future__ import division import curses, curses.ascii, sys # logical representation of the n-dimensional board as a single list class Model(object): def __init__(self, dimensions=2, size=0, players=2): if size < 3: size = dimensions+1 ...
23,850
7,280
# Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Helper functions common to native, java and host-driven test runners.""" import collections import logging from devil.utils import logging_common Cu...
854
254
import sys import time from comet_ml import Experiment import pydub import numpy as np from pydub import AudioSegment import librosa import librosa.display import matplotlib.pyplot as plt import sklearn from sklearn import preprocessing from sklearn.preprocessing import MinMaxScaler from sklearn.preprocessing import St...
4,819
1,832
from flask import Flask, jsonify, request from flask_sqlalchemy import SQLAlchemy app = Flask(__name__) app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///data.db' db = SQLAlchemy(app) class Drink(db.Model): id = db.Column(db.Integer, primary_key=True) name = db.Column(db.String(80), unique=True, nullable=Fa...
1,601
543
#!/usr/bin/env python """A third example to get started with tinypyki. Toying with mass certificate generation. """ import os import tinypyki as tiny print("Creating a pki instance named \"mass-pki\"") pki = tiny.PKI("mass-pki") print("Create the \"root-ca\"") root_ca = tiny.Node(nid = "root-ca", pathlen = 1, s...
2,199
803
from django.contrib import admin from django.contrib.gis import admin as geo_model_admin from leaflet.admin import LeafletGeoAdmin from .models import Forecasts, Dam, Species # Forecast Model class ForecastsAdmin(admin.ModelAdmin): list_display = ('dam', 'species', 'forecast_range') admin.site.register(Forecasts, F...
638
203
# -*- coding: UTF-8 -*- # vim: set expandtab sw=4 ts=4 sts=4: # # phpMyAdmin web site # # Copyright (C) 2008 - 2016 Michal Cihar <michal@cihar.com> # # 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 Foundati...
16,633
5,323
#!/usr/bin/env python # -*- coding: utf-8 -*- from . import db class Sign(db.Model): __table_args__ = { 'mysql_engine': 'InnoDB', 'mysql_charset': 'utf8mb4' } openid = db.Column(db.String(32), primary_key=True, unique=True, nullable=False) lastsigntime = db.Col...
948
325
from django.conf import settings from django.conf.urls.defaults import * from django.views.generic.simple import direct_to_template from django.contrib import admin admin.autodiscover() from account.openid_consumer import PinaxConsumer handler500 = "pinax.views.server_error" if settings.ACCOUNT_OPEN_SIGNUP: ...
2,579
933
# -*- coding: utf-8 -*- # Copyright 2018 New Vector Ltd # # 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 la...
3,060
899
#!/usr/bin/env python3 import os import os.path import shutil import subprocess import sys import tempfile import argparse import amp.utils def main(): #(root_dir, input_audio, min_segment_duration, amp_segments) = sys.argv[1:5] parser = argparse.ArgumentParser() parser.add_argument("input_audio") p...
1,822
582
"""Write a program that allow user enter a file name (path) then content, allow user to save it""" filename = input("Please input filename") f= open(filename,"w+") content = input("Please input content") f.write(content)
226
65
class DxlNmapOptions: """ Constants that are used to execute Nmap tool +-------------+---------+----------------------------------------------------------+ | Option | Command | Description | +=============+=========+=============================...
1,523
294
import intcode def test_default_constructor(): # pylint: disable=C0116 values = [0, 1, 2, 0, 99] program = intcode.IntCodeProgram(values) assert program.instruction_pointer == 0 assert program.memory == values def test_noun_verb(): # pylint: disable=C0116 values = [0, 1, 2, 0, 99] program = intcode.IntCod...
8,203
3,191
import os import sys import pytest import numpy as np import pandas as pd from scipy.stats import ks_2samp sys.path.append("zarnitsa/") from zarnitsa.stats import DataAugmenterExternally N_TO_CHECK = 500 SIG = 0.5 @pytest.fixture def dae(): return DataAugmenterExternally() @pytest.fixture def normal_data()...
720
284
from .Wavefunction import Wavefunction import numpy as np from scipy.fft import ifft2, fft2 import numba CACHE_OPTIMIZATIONS = True class Collision(): targetWavefunction = None # Implements wilson line incidentWavefunction = None # Doesn't (have to) implement wilson line _omega = None _omegaFFT = ...
22,314
6,770
from .tag import Tag
21
7
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by...
8,346
2,477
import numpy as np import tensorflow as tf import model if __name__ == "__main__": print("Making level configs...") level_configs = model.default_level_configs() print("Making filter variables...") filters = model.make_filters(tf.get_default_graph(), level_configs) print("Done")
306
98
import subprocess, os, socket, re, pickle, docx, urllib2 from platform import platform from getpass import getuser from time import sleep from datetime import datetime port = !!!!! ip_addr = @@@@@ lkey = ##### End = $$$$$ skey = %%%%% time_to_sleep = ^^^^^ type_of_scout = 'Command Shell' try: operati...
11,201
3,157
#! /usr/bin/env python from pylib import * CopyConfigForDistribution(InstallRoot)
84
29
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import pygame import threading import time import math import sys import argparse import bench_core import multiprocessing # Couleurs du programme. Peut être modifié à tout moment couleur_txt = (0xc0, 0xc0, 0xc0) # Couleur gris clair pour le texte commun couleur_vic = (0...
17,813
6,663
from sqlalchemy.dialects import registry registry.register("greenplum", "sqlalchemy_greenplum.dialect", "GreenplumDialect") from sqlalchemy.testing.plugin.pytestplugin import *
181
65
# -*- coding: utf-8 -*- # noqa: D205,D400 """ Internationalization ==================== Defines methods and object to help the internationalization of metadata for the climate indicators computed by xclim. All the methods and objects in this module use localization data given in json files. These files are expected t...
10,319
2,963
from machinable import Component class BaseComponent(Component): """Base component"""
92
24
# See # The configuration file should be a valid Python source file with a python extension (e.g. gunicorn.conf.py). # https://docs.gunicorn.org/en/stable/configure.html bind='127.0.0.1:8962' timeout=75 daemon=True user='user' accesslog='/var/local/log/user/blockchain_backup.gunicorn.access.log' errorlog='/var/l...
435
167
from datadog import initialize, api options = { 'api_key': 'api_key', 'app_key': 'app_key' } initialize(**options) # Schedule downtime api.Downtime.create(scope='env:staging', start=int(time.time()))
211
81
default_app_config = 'oscar.apps.customer.apps.CustomerConfig'
63
21
import contextlib import re from typing import NamedTuple, Optional import discord from redbot.core.commands import BadArgument, Context, MemberConverter _discord_member_converter_instance = MemberConverter() _id_regex = re.compile(r"([0-9]{15,21})$") _mention_regex = re.compile(r"<@!?([0-9]{15,21})>$") class Membe...
795
260
from django.contrib import admin from face_api.models import KnowledgeDatabase from face_api.models import ImageUploads # Register your models here. admin.site.register(KnowledgeDatabase) admin.site.register(ImageUploads)
224
62
# Copyright (c) 2017 Adler Neves <adlerosn@gmail.com> # # MIT License # # 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 use, ...
4,596
1,415
# coding:utf-8 from abc import ABCMeta, abstractmethod class AbstractPredictor(metaclass=ABCMeta): @classmethod @abstractmethod def predicate(cls, tasks, user_id, cost): pass
197
61
size = 5 m = (2 * size)-2 for i in range(0, size): for j in range(0, m): print(end=" ") m = m - 1 for j in range(0, i + 1): if(m%2!=0): print("*", end=" ") print("")
216
95
from dydx3.constants import SYNTHETIC_ASSET_MAP, SYNTHETIC_ASSET_ID_MAP, ASSET_RESOLUTION, COLLATERAL_ASSET class TestConstants(): def test_constants_have_regular_structure(self): for market, asset in SYNTHETIC_ASSET_MAP.items(): market_parts = market.split('-') base_token, quote_t...
691
239
#INVASION COMMANDS: # !invasions // !atinvasions <reward> // !rminvasions import discord from discord.ext import commands import asyncio from src import sess class Invasions(commands.Cog): def __init__(self, bot): self.bot = bot self.alert_dict = {} # user: reward, list of prev invasions with ...
5,802
1,677
__version__ = '2.0.0' __description__ = 'Sample for calculations with data from the ctrlX Data Layer' __author__ = 'Fantastic Python Developers' __licence__ = 'MIT License' __copyright__ = 'Copyright (c) 2021 Bosch Rexroth AG'
226
80
import sqlalchemy as sa from .meta import Base class Person(Base): __tablename__ = "person" id = sa.Column(sa.Integer, primary_key=True) name = sa.Column(sa.String) date_of_birth = sa.Column(sa.Date) height = sa.Column(sa.Integer) weight = sa.Column(sa.Numeric) __all__ = [ "Person", ]
320
123
#!/usr/bin/env python import numpy as np import matplotlib.pyplot as plt plt.ion() from figurefirst import FigureLayout layout = FigureLayout('example_hello_world_layout.svg') layout.make_mplfigures() d = np.array([[144, 57], [138, 57], [138, 59], [141, 61], [141, 82], [138, 84], [138, 85], [142, 85], [147, 85], [147...
2,732
2,059
import sys sys.path.append("../../configs") #../../configs from path import EXP_PATH import numpy as np DECAY_PARAMS_DICT =\ { 'stair' : { 128 :{ 'a1': {'initial_lr' : 1e-5, 'decay_steps' : 50000, 'decay_rate' : 0.3}, 'a2' : {'initial_lr' : 3e-4, 'decay_step...
2,009
1,016
from Profesional import Profesional from Particular import Particular from Comercial import Comercial class ManagerUsers: userslist = [] def addProfesional(self, name, address, baja, area, titulo): profesional = Profesional(name, address, baja, area, titulo) self.userslist.append(profes...
1,133
343
# Copyright (C) 2020 Google Inc. # Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file> """Contains WithAction mixin. A mixin for processing actions on an object in the scope of put request . """ from collections import namedtuple, defaultdict import werkzeug.exceptions as wzg_exceptions fro...
10,419
2,912
import sys, os path = os.path.dirname(__file__) if path not in sys.path: sys.path.append(path)
99
37
import torch class GAN_discriminator (torch.nn.Module): def __init__(self, H): #for GAN # H=[5, 256, 128, 128, 5, 1, 64, 128, 256, 256, 4096, 1] #for CGAN # H =[8, 256, 128, 64, 8, 9, 64, 128, 256, 256, 4096, 1] super(GAN_discriminator, self).__init__() #region ...
3,457
1,591
import logging import statuspage_io_client import configuration from enums import OpLevel logger = logging.getLogger(__name__) class Incident: """Incident Class This class represents the details about a Statuspage.io incident Attributes: name: The incident name. description: The inciden...
7,770
1,900
""" test gpath isort:skip_file """ import os import sys import unittest try: from unittest import mock except ImportError: import mock SRC = os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "src") if SRC not in sys.path: sys.path.insert(0, SRC) from ciopath.gpath import Pat...
14,875
5,611
"""This module exports the Healthier plugin class.""" import json import logging import re import shlex from SublimeLinter.lint import NodeLinter logger = logging.getLogger('SublimeLinter.plugin.healthier') class Healthier(NodeLinter): """Provides an interface to the healthier executable.""" # instead of us...
3,513
955
# Copyright 2022 Sony Semiconductors Israel, Inc. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required b...
7,184
1,767
import dgl import torch as th import numpy as np import itertools import time from collections import * Graph = namedtuple('Graph', ['g', 'src', 'tgt', 'tgt_y', 'nids', 'eids', 'nid_arr', 'n_nodes', 'n_edges', 'n_tokens', 'layer_eids']) # We need to create new graph pools for relative position atte...
11,472
3,954
# pylint: disable=not-context-manager from unittest.mock import ANY, Mock from starlette.testclient import TestClient from ariadne.asgi import ( GQL_CONNECTION_ACK, GQL_CONNECTION_INIT, GQL_DATA, GQL_ERROR, GQL_START, GraphQL, ) from ariadne.types import Extension def test_custom_context_val...
12,747
4,122
import tensorflow as tf import prettytensor as pt import numpy as np import gym import math import random from collections import deque from agents import mixed_network, spaces, replay_buffer tensorType = tf.float32 """ Implements a Deep Deterministic Policy Gradient agent. Adjustable parameters: - Actor / Critic ...
7,056
2,189
from aiohttp.test_utils import TestClient import pytest import typing import unittest.mock from rolling.kernel import Kernel from rolling.model.character import CharacterModel from rolling.model.character import MINIMUM_BEFORE_EXHAUSTED from rolling.server.document.affinity import AffinityDirectionType from rolling.se...
14,426
4,686
# myWeather.py for inkyphat and RPiZW print('Starting') try: import requests print('requests module imported') except: print('Sorry, need to install requests module') exit() wx_url = 'api.openweathermap.org/data/2.5/weather?' wx_city = 'q=Quispamsis,CA&units=metric' wx_cityID = 'id=6115383&...
1,311
531
# -*- coding: utf-8 -*- from dotenv import load_dotenv load_dotenv('.env') import logging logging.basicConfig(filename='logs/push-2-gee.log', level=logging.INFO) import ast import glob import json import os import subprocess from datetime import datetime from dbio import * scale_factor = 10000 output_path = os.ge...
4,526
1,436
""" This is the main entrypoint used by Celery workers. As such, it needs to call create_app() in order to initialize things properly """ from typing import Any from celery.signals import worker_process_init # Rabbitai framework imports from rabbitai import create_app from rabbitai.extensions import celery_app, db #...
938
291
from tabulate.tabulate import tabulate import subprocess import sys import os import re import csv import io import json class Adapter(object): def __init__(self, server=None, port=None, user=None, connection_cmd=None, cmd=None, test_query=...
4,403
1,174
import sys sys.path.append("../..") import random from MyCrypto.utils.bitarray import bitarray from MyCrypto.algorithms.exgcd import inverse from MyCrypto.ecc.sm2 import SM2 class SM2_DSA(SM2): def __init__(self): super().__init__() def _identity(self, uid:bitarray, PK) -> bitarray: e...
3,000
1,145
__all__ = ( 'readonly_admin', 'singleton' )
52
23
def somar(x, y): if x and y >= 0: x = x + y return(x) def subtrair(x, y): if x and y >= 0: x = x - y return(x) def multiplicar(x, y): if x and y >= 0: x = x * y return(x) def dividirInteiro(x, y): if x and y >= 0: x = x / y return(x) def dividir(x, y):...
5,103
1,600
from argparse import Namespace from datetime import datetime import pandas from dateutil.parser import parse as dateParse from intervaltree import IntervalTree from pandas import DataFrame from prime_issue_spoilage.utils.primeIssueSpoilageArgs import mainArgs def getIssueTimelineIntervals(day0: datetime, issues: Da...
1,982
647
import os.path as osp import mmcv import numpy as np from mmseg.datasets.builder import PIPELINES @PIPELINES.register_module() class LoadImageFromFile_Semi(object): def __init__( self, to_float32=False, color_type='color', file_client_args=dict(backend='disk'), imdecode_backend='cv2' ): self...
4,544
1,559
from contextlib import contextmanager import pytest from sai import SaiObjType @contextmanager def config(npu): topo_cfg = { "lo_rif_oid": None, "cpu_port_oid": None, } # Create Loopback RIF lo_rif_oid = npu.create(SaiObjType.ROUTER_INTERFACE, [ ...
3,384
1,420
from loguru import logger import datetime from pydantic.fields import ModelField from typing import Optional, List, Union, Any from ....utils.tools.str_datetime import convert from pydantic import BaseModel, Field, validator, ValidationError from ....data_types.QIWIWallet.list_qvc import ReleasedCardStatus, CardType, C...
7,045
2,035
import matplotlib.pyplot as plt import pandas as pd def scenarios_by_product( X: "np.ndarray", indices: list, products: list, ax: plt.Axes = None ) -> plt.Axes: """Plot generated scenarios, with a subplot for each product""" if ax is None: _, ax = plt.subplots(X.shape[-1], 1, figsize=(8, X.shape[-...
818
295
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may ...
26,160
8,181
from microbit import * import microbit_i2c_lcd as lcd i2c.init(sda=pin15,scl=pin13) display = lcd.lcd(i2c) display.lcd_display_string(str(chr(247)), 1) print("this will display a pi symbol for ROM A00 japaneese\n"+\ "display a divide symbol for the A02 ROM european") i2c.init(sda=pin20,scl=pin19)
308
140
import time import textwrap import math import binascii from inkfish.create_discriminant import create_discriminant from inkfish.classgroup import ClassGroup from inkfish.iterate_squarings import iterate_squarings from inkfish import proof_wesolowski from inkfish.proof_of_time import (create_proof_of_time_nwesolowski,...
11,349
5,592
import numpy as np from load_for_ccl_inputs import load_for_ccl_inputs from ccl_marker_stack import ccl_dask base = '/home/mrilee/nobackup/tmp/others/' fnames = None if False: fnames = ['ccl-inputs-globe-122736+23.csv.gz'] if False: fnames = ['ccl-inputs-globe-122736+23.csv.gz' ...
2,415
1,044
import os import re import sys from setuptools import setup, find_packages from typing import Optional, Tuple SETUP_DIR = os.path.dirname(os.path.realpath(__file__)) POLYTRACKER_HEADER = os.path.join(SETUP_DIR, 'polytracker', 'include', 'polytracker', 'polytracker.h') if not os.path.exists(POLYTRACKER_HEADER): sy...
3,108
1,032
'''初始化''' from .server import gobangSever from .client import gobangClient from .playOnline import playOnlineUI
111
36
import os,sys, re from math import ceil, floor class Gazette: """ Loads and parses municipal gazettes. Attributes: file_path: The string path to a gazette. file: The string containing a gazette's content. city: A string for the city (or cities) of the gazette. date: A st...
9,317
2,935
# Generated by Django 3.0.2 on 2020-03-03 21:48 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ('PropertyManagers', '0001_initial'), ('Properties', '0001_initial'), ] operations = [ ...
1,065
328
# @file image_validation.py # This tool allows a user validate an PE/COFF file # against specific requirements ## # Copyright (c) Microsoft Corporation # # SPDX-License-Identifier: BSD-2-Clause-Patent ## from datetime import datetime import os from pefile import PE, SECTION_CHARACTERISTICS, MACHINE_TYPE, SUBSYSTEM_TYP...
21,295
5,718
import os os.remove("fichero_generado.txt")
44
18
# -*- coding: utf-8 -*- from remi.gui import * from remi import start, App import cv2 import numpy import chdkptp import time import threading import rawpy class OpenCVVideoWidget(Image): def __init__(self, **kwargs): super(OpenCVVideoWidget, self).__init__("/%s/get_image_data" % id(self), **kwargs) ...
31,290
9,808
from werkzeug.exceptions import HTTPException class APIException(HTTPException): def __init__(self, msg='客户端错误', code=400, err_code=900, headers=None): self.msg = msg self.code = code self.err_code = err_code super(APIException, self).__init__(msg, None) ''' Custom info...
781
268
import json import csv import tweepy from textblob import TextBlob import nltk from nltk.tokenize import word_tokenize def search_for_hashtags(consumer_key, consumer_secret, access_token, access_token_secret, hashtag_phrase): # create authentication for accessing Twitter auth = tweepy.OAuthHandler(consumer_ke...
2,159
711
import argparse import sys from multiprocessing import cpu_count, Process, Queue import json import logging from datetime import datetime from elasticsearch import Elasticsearch from elasticsearch.helpers import bulk, scan import hashlib from helpers.certparser import process_cert from helpers.hostparser import procc...
9,585
2,774
integer = [ ['lld', 'long long', 9223372036854775807, -9223372036854775808], ['ld', 'long', 9223372036854775807, -9223372036854775808], ['lu', 'unsigned long', 18446744073709551615, 0], ['d', 'signed', 2147483647, -2147483648], ['u', 'unsigned', 4294967295, 0], ['hd', 'short', 32767, -32768], ...
980
554
from ..utils.log import log, INFO, ERROR, PASS from ..utils.i_selenium import assert_tab, image_div from ..tests import TestWithDependency __all__ = ["recieve_verify_emails"] ##### # Test : Recieve Verification Emails ##### @TestWithDependency("RECIEVE_VERIFY_EMAILS", ["REQ_VERIFY_EMAILS"]) def recieve_verify_emails...
1,944
598
#!/usr/bin/env python3 from setuptools import setup import sys setup( name='grr', version='0.2', author='Kunal Mehta', author_email='legoktm@gmail.com', url='https://github.com/legoktm/grr/', license='CC-0', description='A command-line utility to work with Gerrit', long_description=open...
536
187
# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
11,553
3,679
# 获取学生所有的挑战题目信息 # 包括时间、结果、代码等 # 写入数据库stuoj的stuquestionbh表中 from selenium import webdriver # from selenium.webdriver.common.by import By import pymysql import re from bs4 import BeautifulSoup import connsql # import loginzznuoj from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support impo...
7,254
3,228
from stageflow import Flow from stageflow import Stage def test_create_stage(): Stage() def test_create_flow_bare(): flow = Flow() assert flow.get_current_stage() is None assert set(flow.get_stages()) == set([]) def test_create_flow_and_add_stage(): flow = Flow() flow.add_stage('test', St...
3,899
1,186
import asyncio import time import uvloop import importlib from pyrogram import Client as Bot, idle from .config import API_ID, API_HASH, BOT_TOKEN, MONGO_DB_URI, SUDO_USERS, LOG_GROUP_ID from Yukki import BOT_NAME, ASSNAME, app, chacha, aiohttpsession from Yukki.YukkiUtilities.database.functions import clean_restart_st...
1,925
636
import hashlib from abc import abstractmethod, ABC from typing import TYPE_CHECKING from .. import Signature, ExternalAddress, Hash32 from loopchain.crypto.hashing import build_hash_generator if TYPE_CHECKING: from secp256k1 import PrivateKey from . import Transaction, TransactionVersioner class Transaction...
3,180
923
import csv import os resource_dir="/Users/jyj/OneDrive/A_A_Data_Analysis/MINSTP201808DATA2/03-Python/Homework/PyBank/Resources" file_path=os.path.join(resource_dir,"budget_data.csv") with open(file_path,newline="") as data_file: csvreader=csv.reader(data_file,delimiter=",") next(csvreader) i=0 Nu...
1,132
433
#!/usr/bin/env python3 ''' Source name: demo.py Author(s): Stoyan Shopov Python Version: 3.* 32-bit or 64-bit License: LGPL Description: This program was demoed on EV3D4 at PyCon Australia 2017. It kicks off 2 threads a move thread and a feel thread. The move thread drives the bot forward un...
3,508
1,273
from Game.player import Player from pygame import * from Game.const import * class Story: """ Story line class """ def __init__(self, message, treasure, player, screen, fade, maps, sound): self.screen = screen self.message = message self.treasure = treasure self.player = player self.fade = fade se...
21,742
9,571