source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
moca_memory.py | # ฮฉ*
# โโโโโโโโโโโโโ โโโโโโโโโโโ โ โ โ โ โโ
# โโโโโโโโโโโโโ โโโโโโโโโโ โ โโโโ โ โ
# โโโโโโโโโโโโโ โโโโโโโโโ โ โโโโโโ โ
# โโโโโโโโโโโโโ โโโโโโโโโ โ โโโโโโโ
# โโโ โ โ โ โ โโโโโโ โโโโโโโโโ โ โ โโโโโโ
# โโ โ โโโโ โ โโโโโ โโโโโโโโโโ โ โ โโโโโ
# โ โ โโโโโโ โ โโโโ โโโโโโโโโโโ โ โ โ โโโ
# โ โ โโโโโโ โ โโโโ โโโโโโโโโโโโโ โ โ โ โ
# โ โ โ โ โ โ โ โ โ โโโโ โโโโโโโโโโโโโโโ โ โ
... |
tkgui.py | from tkinter import Frame, PanedWindow, LEFT, TOP, RIGHT, BOTTOM, Label, Button, Entry, Text, INSERT, END, DISABLED
from tkinter import Radiobutton, Checkbutton, Listbox, SINGLE, MULTIPLE, BROWSE, Scrollbar, Scale, Spinbox
from tkinter import LabelFrame, Menu, Menubutton, Canvas, PhotoImage
from tkinter import Tk, Topl... |
bsv-safe-mode-reorg-notification.py | #!/usr/bin/env python3
# Copyright (c) 2021 Bitcoin Association
# Distributed under the Open BSV software license, see the accompanying file LICENSE.
"""
Tests webhook notifications for correct information about reorg.
"""
import threading
from http.server import HTTPServer, BaseHTTPRequestHandler
from json import load... |
FldigiInterface.py | from time import sleep
import sys
import serial
import threading
import time
import RNS
from RNS.Interfaces.Interface import Interface
import pyfldigi
# Notes:
# Fldigi configuration (Configure -> UI -> User Inteface)
# should be set to not have any exit prompts so we can cleanly
# stop the application (successi... |
metadata_reporter.py | # This script provides some reporting on the resolver data from identifiers.org
#
# Author: Manuel Bernal Llinares <mbdebian@gmail.com>
import sys
import time
import random
import pandas
import requests
import threading
import numpy as np
import multiprocessing as mp
#import matplotlib.pyplot as plt
from collections i... |
git.py | #!/usr/bin/env python
"""
git.py - Github Post-Receive Hooks Module
"""
import atexit
from fnmatch import fnmatch
import http.server
from io import StringIO
import json
import logging
import os
import re
import signal
from threading import Lock, Thread
import time
import urllib.parse
from modules import more
from too... |
buzzer.py | #
# Memento Pi
# Utilities for dsiplaying notification on the raspberry pi
#
import time
import threading
from gpiozero import TonalBuzzer
buzzer = TonalBuzzer(23)
# play a tone on the buzzer
def play():
def play_fn():
buzzer.play("A4")
time.sleep(1)
buzzer.stop()
threading.Thread(tar... |
miniterm.py | #!F:\Git\HPLC\WebApp\venv\Scripts\python.exe
#
# Very simple serial terminal
#
# This file is part of pySerial. https://github.com/pyserial/pyserial
# (C)2002-2015 Chris Liechti <cliechti@gmx.net>
#
# SPDX-License-Identifier: BSD-3-Clause
import codecs
import os
import sys
import threading
import serial
from seria... |
broker.py | # Copyright (C) 2020. Huawei Technologies Co., Ltd. All rights reserved.
#
# 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 us... |
commands.py | ###
# Copyright (c) 2002-2005, Jeremiah Fincher
# Copyright (c) 2009-2010, James McCoy
# 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 ... |
run-snappy-tests.py | #!/usr/bin/env python
#
# 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 "Li... |
fretting_ecr.py | """
Date 01.2021
@author: Chair of Functional Materials - Saarland University - Saarbrรผcken, Bruno Alderete
@version 1.0
"""
__author__ = 'Bruno Alderete'
#######################################################################################################################
#
# The MIT License (MIT)
#
# Cop... |
batch_sender.py | import json
import logging
import threading
import queue
import time
import gzip
import requests
from specklepy.logging.exceptions import SpeckleException
LOG = logging.getLogger(__name__)
class BatchSender(object):
def __init__(
self,
server_url,
stream_id,
token,
max_ba... |
createDataset.py | import numpy as np
import cv2
import dlib
from threading import Thread
class WebcamVideoStream: #multiThread video acq
def __init__(self, src=0, w=320, h=240):
# initialize the video camera stream and read the first frame
# from the stream
self.stream = cv2.VideoCapture(src)
self.... |
task.py | """ Backend task management support """
import itertools
import json
import logging
import os
import re
import sys
from copy import copy
from enum import Enum
from multiprocessing import RLock
from operator import itemgetter
from tempfile import gettempdir
from threading import Thread
from typing import Optional, Any, ... |
crawler.py | # coding=UTF-8
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.common.exceptions import UnexpectedAlertPresentException
from selenium.webdriver.chrome.options... |
player.py | #!/usr/bin/env python3
"""Play an audio file using a limited amount of memory.
The soundfile module (https://PySoundFile.readthedocs.io/) must be
installed for this to work. NumPy is not needed.
In contrast to play_file.py, which loads the whole file into memory
before starting playback, this example program only ho... |
collectors.py | import threading
import requests
from requests.exceptions import RequestException
try:
from queue import Queue
except ImportError:
from Queue import Queue
class AsyncCollector:
'''Collector which uses threads to send the events asynchronously.
Args:
endpoint (url): URL endpoint
method ... |
chat_server.py | import socket
import threading
import configparser
from time import sleep
import protocol
from chat_server.server_client import ServerClient
class ChatServer:
MAX_NUM_CLIENTS = 64
SERVER_CONNECTION_POLL_INTERVAL = 0.1
SERVER_CLIENT_POLL_INTERVAL = 0.2
def __init__(self, host_address, port, socket_fa... |
map_printer.py | import numpy as np # pip3 install -U opencv-contrib-python numpy
import cv2, time
import multiprocessing
from multiprocessing import Process, Queue
# You don't need to understand
def vis_map(map_list): # 1,0,*,x
"""
:param map_list: list of list of characters, only accept characters: 1,0,*,x
:return: co... |
run_test_from_archive.py | #!/usr/bin/env python
# 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.
"""Reads a manifest, creates a tree of hardlinks and runs the test.
Keeps a local cache.
"""
import ctypes
import hashlib
import ... |
motor.py | import RPi.GPIO as GPIO
import time
from redis import Redis
import firebase_admin
from firebase_admin import credentials
from firebase_admin import db
import RPi.GPIO as GPIO
from multiprocessing import Process
cred = credentials.Certificate("fire-sdk.json")
firebase_admin.initialize_app(cred, {
'databaseURL': 'ht... |
cluster_multiprocessing_1_test.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... |
gmpydl.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright (c) 2015 Steve Newbury
import argparse
import datetime
import os
import shelve
import sys
import threading
import unicodedata
from gmusicapi import Musicmanager
program_dir = os.path.expanduser("~/.gmpydl")
dl_store_file = os.path.join(program_dir, ".gmpydl_... |
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... |
exp.py | #!/usr/bin/python
import sys
import random
import os.path
import psPlot
import commands
import math
import shutil
import threading
import time
import os
import cgi
import cgitb; cgitb.enable()
import socket
from string import Template
# Globals
#
# The program can be used interactively as a web program,
# in which ca... |
process.py | import os
import subprocess
import threading
from time import monotonic as _time
from pipenv._compat import DEFAULT_ENCODING
from pipenv.cmdparse import Script
class PopenProcess:
"""A wrapper of subprocess.Popen that
doesn't need to worry about the Pipe buffer exceeding the limit.
"""
def __init__(... |
distributed_sampled_trainer.py | import argparse
import copy
import os
import numpy as np
from tqdm import tqdm
import torch
import torch.distributed as dist
import torch.multiprocessing as mp
from torch.nn.parallel import DistributedDataParallel
from .sampled_trainer import (
SampledTrainer,
ClusterGCNTrainer,
NeighborSamplingTrainer,
... |
custom.py | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... |
processing_2.py | __author__ = "JJ.sven"
import multiprocessing
from multiprocessing import Queue, Process, Pipe, Manager
import os
'''่ฟ็จ้ด้่ฎฏ
ไธๅ่ฟ็จ้ดๅ
ๅญๆฏไธๅ
ฑไบซ็๏ผ่ฆๆณๅฎ็ฐไธคไธช่ฟ็จ้ด็ๆฐๆฎไบคๆข๏ผๅฏไปฅ็จไปฅไธๆนๆณ
1. Queue
่ฟ็จ้ด้่ฟไผ ้Queue๏ผๅ
ฑไบซๆฐๆฎ
ๅฎ้
ไธๆฏไผ ้่ฟ็จไธญ๏ผQueueๅ
้ไบไธไปฝ๏ผๅฎไปฌ็ๆฐๆฎๅฎ้
ๆฏๅบๅๅๅๅ
ฑไบซ็๏ผๅ็ๆถๅๅๅๅบๅๅ๏ผ
ไนๅฐฑๆฏQueue ๅ ๅฎ ๅ
้็Queue๏ผๅ
ฑไบซๅไธไปฝๅบๅๅ็ๆฐๆฎ
2. pipe ็ฎก้๏ผ็ฑปไผผsocket๏ผไธๅไธๆถ
3. Manager
A manager ... |
dual_blob_store.py | #!/usr/bin/env python
"""A BlobStore proxy that writes to two BlobStores."""
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
import logging
import queue
import threading
import time
from typing import Callable, Dict, Iterable, Optional, Text, TypeVar
from... |
vr driver example.py | import os
import sys
import speech_recognition
import speech_recognition as sr
import threading
import wave # for audio playback (testing purposes)
from datetime import datetime, timedelta
import pyaudio
from heapq import heappush, heappop
from Yuumi import *
class YouMeSpeechRecognizer:
# Chunk siz... |
network_mailslot.py | import threading
from winsys import ipc
def logger ():
with ipc.mailslot ("logger") as l:
while True:
word = l.get ()
if word == "STOP":
break
else:
print word
threading.Thread (target=logger).start ()
with ipc.mailslot (r"\\*\mailslot\logger") as logging_mails... |
test_app.py | import contextlib
import io
import sys
import time
import unittest
import unittest.mock
import importlib
import requests
import simple_custom_dashboard
from threading import Thread
class TestApp(unittest.TestCase):
@contextlib.contextmanager
def _capture_output(self):
new_out, new_err = io.StringIO(... |
webrepl_connection.py | import sys
import threading
import time
from queue import Queue
from thonny.common import ConnectionFailedException
from thonny.plugins.micropython.connection import MicroPythonConnection
DEBUG = False
class WebReplConnection(MicroPythonConnection):
"""
Problem with block size:
https://github.com/microp... |
test_common.py | import socket
from unittest.mock import Mock, patch
import pytest
from amqp import RecoverableConnectionError
from kombu import common
from kombu.common import (PREFETCH_COUNT_MAX, Broadcast, QoS, collect_replies,
declaration_cached, generate_oid, ignore_errors,
may... |
chord.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import hashlib
import random
import sys
import threading
import zmq
import os
import math
from time import sleep
totalNodes = 32768
powNodes = int(math.log2(totalNodes))
class myNode:
def __init__(self, ip, port, IdHash):
self.ip = ip
self.port = port
self.idhas... |
tests.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... |
Hiwin_socket_ros_20190425122031.py | #!/usr/bin/env python3
# license removed for brevity
#ๆฅๆถ็ญ็ฅ็ซฏๅฝไปค ็จSocketๅณ่ผธ่ณๆงๅถ็ซฏ้ป่
ฆ
import socket
##ๅคๅท่กๅบ
import threading
import time
##
import sys
import os
import numpy as np
import rospy
import matplotlib as plot
from std_msgs.msg import String
from ROS_Socket.srv import *
from ROS_Socket.msg import *
import Hiwin_socke... |
server2.py | import tornado.httpserver
import tornado.ioloop
import tornado.options
import tornado.web
import tornado.websocket
import time
import Queue
import threading
import random
from tornado.options import define, options
define("port", default=9000, help="run on the given port", type=int)
class IndexHandler(tornado.web.... |
an.py | #!/usr/bin/env python
"""Access Ninja.
Usage:
an.py compile <device>|all|groupname
an.py deploy <device>|all|groupname
Options:
-h --help Show this screen.
"""
import sys
import threading
from docopt import docopt
from os import listdir
from os.path import isfile, join
from accessninja.config import Confi... |
node.py | from transport import Transport
from election import Election
from store import Store
from threading import Thread
class Node(Transport):
def __init__(self, my_ip: str, peers: list, timeout: int, **kwargs):
self.__store = Store(**kwargs)
self.__transport = Transport(my_ip, timeout=timeout)
... |
app.py | # encoding: utf-8
'''
A REST API for Salt
===================
.. versionadded:: 2014.7.0
.. py:currentmodule:: salt.netapi.rest_cherrypy.app
:depends:
- CherryPy Python module. Version 3.2.3 is currently recommended when
SSL is enabled, since this version worked the best with SSL in
internal testing.... |
base.py | # -*- coding: utf-8 -*-
'''
napalm-logs base
'''
from __future__ import absolute_import
# Import std lib
import os
import re
import imp
import sys
import time
import yaml
import logging
import threading
from multiprocessing import Process
# Import third party libs
# crypto
import nacl.utils
import nacl.secret
import ... |
run.py | import sys, time, threading
from functools import partial
import traceback, os
import subprocess
import argparse
import faulthandler
import pystray
from PIL import Image
import threading
from pylewm.commands import PyleCommand, InitFunctions, CommandQueue, run_pyle_command
import pylewm.windows
import pylewm.hotkey... |
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... |
reverseshell_stager_server.py | from __future__ import print_function
import socket
from empire.server.common.plugins import Plugin
import empire.server.common.helpers as helpers
class Plugin(Plugin):
description = "Empire reverseshell stager server plugin."
def onLoad(self):
print(helpers.color("[*] Loading Empire reverseshell s... |
csv_generation.py | import json
import logging
import multiprocessing
import os
import re
import shutil
import subprocess
import tempfile
import time
import zipfile
import csv
from django.conf import settings
from usaspending_api.awards.v2.lookups.lookups import contract_type_mapping, assistance_type_mapping, idv_type_mapping
from usasp... |
cross_device_ops_test.py | # Copyright 2018 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... |
slave.py | #!/usr/bin/env python
from __future__ import with_statement
import socket
import time
import threading
#import proc
import logexplode
class SlaveMonitor(object):
""" This is the dumb version of the slave monitor.
Rather than perform utility checks here, it merely just
reports back log write information. The Maste... |
flaskapp.py | from flask import Flask
from multiprocessing import Process,Queue
app = Flask(__name__)
world = "None"
@app.route("/")
def getWorld():
global world
while not pqueue.empty():
world = pqueue.get()
return world
def exportServer(queue):
for i in range(0,10):
queue.put(f"QUEUE {i}")
if __n... |
process_lock_1.py | from multiprocessing import Process, Lock, Value
import time
def add(total,n):
for i in range(n):
time.sleep(0.01)
total.value+=1
def sub(total,n):
for i in range(n):
time.sleep(0.01)
total.value-=1
if __name__=='__main__':
total=Value('i',500)
n=500
add_process=P... |
flexbe_mirror.py | #!/usr/bin/env python
import roslib; roslib.load_manifest('flexbe_mirror')
import rospy
import smach
import threading
import zlib
from flexbe_core import JumpableStateMachine, LockableStateMachine
from flexbe_core.core import PreemptableState
from mirror_state import MirrorState
from flexbe_core.proxy import ProxyPu... |
scan.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (c) 2014, LCI Technology Group, LLC
# 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... |
coordinator.py | from __future__ import generators
import os
import time
import thread
import sys
import xmlrpclib
import traceback
from SimpleXMLRPCServer import SimpleXMLRPCServer
import socket
import dbfile
import logging
def get_hostname(host=None):
'get FQDN for host, or current host if not specified'
if host is None:
... |
tea.py | import sys
import os
import common
import tkinter as tk
from tkinter import ttk
import tkinter.scrolledtext
import tkinter.simpledialog
import shutil
import subprocess
import threading
main_path = 'D:\\python_project\\my_toolbox\\tea_main'
window = tk.Tk()
config = common.Dict()
config.exclusions = ('__pycache__', 'co... |
ERTB.py | # Token
from Token import botToken, botUsername
# Public libraries
from aiogram import Bot, Dispatcher, executor, types
from aiogram.types.message import ContentType
from aiogram.types.inline_keyboard import InlineKeyboardMarkup, InlineKeyboardButton
import numberize
from threading import Thread
import sys
from dateti... |
hello.py | import time
import threading
def main():
threads = [
threading.Thread(target=greeter, args=("Michael", 10), daemon=True),
threading.Thread(target=greeter, args=("Sarah", 5), daemon=True),
threading.Thread(target=greeter, args=("Zoe", 2), daemon=True),
threading.Thread(target=greete... |
main.py | import queue
import threading
import pandas as pd
from myfilter import *
from spider import *
# =================== Global =================
# query_queue = Queue()
# cnt = 0 #ๅชๆฏ็ป่ฎก็ฌๅurl็ๅคง่ดไธชๆฐ,ๅฐฑไธๅ ็บฟ็จ้ไบ
query_queue = [] # url ็ ่ฏทๆฑ้ๅ
init_url = 'https://xmu.edu.cn/' # ไธๅ็ฝชๆถ็ๆบๅคด
query_queue.append(init_url)
# tel_filter... |
backend.py | from threading import Thread
from pymitter import EventEmitter
from typing import List, Dict, Any, Tuple, NamedTuple, Callable, TYPE_CHECKING
from persimmon.view.pins import Pin # For typing only
import logging
logger = logging.getLogger(__name__)
# backend types
InputEntry = NamedTuple('InputEntry', [('origin', in... |
parallel.py | def parallel_for(function, iterable, wait_completion=True, debug=False) -> list:
if debug:
for element in iterable:
function(element)
return []
import threading
threads = []
for element in iterable:
t = threading.Thread(target=function, args=(element, ))
threa... |
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, TEST_NETWORK,
)
import os
import queue
import pytest
import ... |
test_auth_frontend.py | # (C) Copyright 1996- ECMWF.
#
# This software is licensed under the terms of the Apache Licence Version 2.0
# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
# In applying this licence, ECMWF does not waive the privileges and immunities
# granted to it by virtue of its status as an intergovernment... |
test_manager.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... |
swivel.py | #!/usr/bin/env python
#
# 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 require... |
main_audit-test04b-bug-workaround.py | """
mlperf inference benchmarking tool
"""
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import argparse
import array
import collections
import json
import logging
import os
import sys
import threading
import time
from queue import Queue
import mlperf_l... |
Barrier.py | from random import randrange
from threading import Barrier, Thread
from time import ctime, sleep
num_persons = 3
finish = Barrier(num_persons)
persons = ['Si A', 'Si B', 'Si C']
def editing():
name = persons.pop()
sleep(randrange(2, 5))
print('%s Mulai mengedit pada: %s ' % (name, ctime()))
finish.wai... |
server.py | import socket
import threading
import constants
from keystore import KeyStore
class Server:
def __init__(self, cip, cport, sip, sport, lbip, lbport):
# create an INET, STREAMing socket
self.socket = socket.socket(
socket.AF_INET, socket.SOCK_STREAM)
self.sip = sip
self... |
ETM_Protect.py | # -*- coding: utf-8 -*-
#Cat_Bot
import NOXTIAN
from NOXTIAN.lib.curve.ttypes import *
from datetime import datetime
import time,random,sys,json,codecs,threading,glob,re,ast,os,subprocess,requests
cl = NOXTIAN.LINE()
cl.login(qr=True)
#cl.login(token='')
cl.loginResult()
print "Cl-Login Success\n"
ki = N... |
mods.py | from colorsys import rgb_to_hls, hls_to_rgb
from types import SimpleNamespace
from libqtile.widget import base, KeyboardLayout
from libqtile.command import lazy
from libqtile import bar
from libqtile.log_utils import logger
from subprocess import Popen, PIPE
from threading import Timer
from functools import wraps
SPEA... |
utils.py | """Utilities shared by tests."""
import asyncio
import collections
import contextlib
import io
import logging
import os
import re
import selectors
import socket
import socketserver
import sys
import tempfile
import threading
import time
import unittest
import weakref
from unittest import mock
from http.server import... |
server.py | import json
from json.decoder import JSONDecodeError
import logging
import random
import socket
import threading
import os
import sys
from typing import Dict, Union, Any
import sha3
from file_module import FTPFileProcessing
from data_processing import DataProcessing
currentdir = os.path.dirname(os.path.realpath(__fi... |
Blender.py | import os.path as osp
import os
import logging
import sys
from subprocess import PIPE, Popen
from threading import Thread, Lock
from datetime import timedelta, datetime
import time
import glob
import shutil
try:
from Queue import Queue, Empty
except ImportError:
from queue import Queue, Empty # python 3.x... |
test_local_task_job.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
#... |
platformio_flasher.py | import json
import sys
from .base_flasher import BaseFlasher
from collections import deque
from subprocess import Popen, PIPE
import zipfile
import os
import shutil
import re
from threading import Thread
from datetime import datetime
import serial
import flask
import platform
from flask_babel import gettext
from .platf... |
server.py | import socket
import sys
import threading
import time
from queue import Queue
NUMBER_OF_THREADS = 2
JOB_NUMBER = [1, 2]
queue = Queue()
all_connections = []
all_address = []
# Create a Socket ( connect two computers )
def create_socket():
try:
global host
global port
global s
host ... |
mysql_yonk_library.py | import time
import random
import argparse
import threading
import logging
import mysql.connector
import string
import os
config = {
'user': 'movie_json_user',
'password': 'Ch@nge_me_1st',
'host': '127.0.0.1',
'database': 'movie_json_test',
'raise_on_warnings': True
}
def load_db(config):
print ('insid... |
test_time.py | from test import support
import decimal
import enum
import locale
import math
import platform
import sys
import sysconfig
import time
import threading
import unittest
import warnings
try:
import _testcapi
except ImportError:
_testcapi = None
# Max year is only limited by the size of C int.
SIZEOF_INT = syscon... |
syschat.py | import xmpp, sys, logging, os, threading, time
import traceback
import argparse
import yaml
import execute
from chat import SysChat
logging.basicConfig(level=logging.DEBUG)
log = logging.getLogger(__name__)
args = None
ch = None
exe = None
login = None
password = None
server = None
chroot = '/tmp'
secure_black ... |
thumbnail_maker.py | # thumbnail_maker.py
import time
import os
import logging
from urllib.parse import urlparse
from urllib.request import urlretrieve
from queue import Queue
from threading import Thread
import PIL
from PIL import Image
FORMAT = "[%(threadName)s, %(asctime)s, %(levelname)s] %(messages)s"
logging.basicConfig(filename='lo... |
install_apk.py | # -*- coding: utf-8 -*-
#-------------------------------------------------------------------------
# drawElements Quality Program utilities
# --------------------------------------
#
# Copyright 2017 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use t... |
test_threading.py | import os
import threading
import uuid
import pytest
from ddtrace.internal import nogevent
from ddtrace.profiling import recorder
from ddtrace.profiling.collector import threading as collector_threading
from . import test_collector
TESTING_GEVENT = os.getenv("DD_PROFILE_TEST_GEVENT", False)
def test_repr():
... |
RestClientWindow.py | #RestClientThreads.py
import requests
import json
import time
import threading
#TYPE: HNA-INDIVITUAL-TEST-CASE
#MODIFICATION: This file NEEDS TO BE MODIFIED
#-According to the layer, a different NUMBER_POA_SCENARIO is required
#DATE: 15-04-2020
#TO-DOs:
# -Testing not updated
"""
DESCRIPTION:
#Implements the... |
test_pool.py | import collections
import random
import threading
import time
import weakref
import sqlalchemy as tsa
from sqlalchemy import event
from sqlalchemy import pool
from sqlalchemy import select
from sqlalchemy import testing
from sqlalchemy.testing import assert_raises
from sqlalchemy.testing import assert_raises_context_o... |
client.py | # Took base code from below link and started working on it
###https://medium.com/swlh/lets-write-a-chat-app-in-python-f6783a9ac170
from socket import AF_INET, socket, SOCK_STREAM
from threading import Thread
import tkinter
import os
import errno
import time
file_list = [] # files list of client
next_file ... |
main.py | #!/usr/bin/env python3
import argparse
import logging
from queue import Queue
import subprocess
from threading import Thread
module_info = {
# Name of the module (should be the same as the filename)
'name': 's3__bucket_finder',
# Name and any other notes about the author
'author': 'Dwight Hohnstein',... |
syncer.py | # Pyrogram - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-2018 Dan Tรจs <https://github.com/delivrance>
#
# This file is part of Pyrogram.
#
# Pyrogram 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 S... |
websocket.py | import os
import signal
import asyncio
import threading
try:
import websockets
except (ImportError, SyntaxError):
# websockets 3.10 on python 3.6 causes SyntaxError
# See https://github.com/yt-dlp/yt-dlp/issues/2633
has_websockets = False
else:
has_websockets = True
from .common import FileDownloa... |
tensorboard.py | "Provides convenient callbacks for Learners that write model images, metrics/losses, stats and histograms to Tensorboard"
from ..basic_train import Learner
from ..basic_data import DatasetType, DataBunch
from ..vision import Image
from ..vision.gan import GANLearner
from ..callbacks import LearnerCallback
from ..core i... |
test_windows_events.py | import os
import signal
import socket
import sys
import subprocess
import time
import threading
import unittest
from unittest import mock
if sys.platform != 'win32':
raise unittest.SkipTest('Windows only')
import _overlapped
import _testcapi
import _winapi
import asyncio
from asyncio import windows_events
from t... |
dataset.py | # Copyright 2022 MosaicML Composer authors
# SPDX-License-Identifier: Apache-2.0
"""The :class:`StreamingDataset` class, used for building streaming iterable datasets.
"""
import math
import os
from io import BytesIO
from threading import Lock, Thread
from time import sleep
from typing import Any, Callable, Dict, Ite... |
sensing_interface.py | #!/usr/bin/env python3
import rospy
import rospkg
import re
import threading
import numpy as np
from threading import Lock
import imp
from rosplan_knowledge_msgs.srv import KnowledgeUpdateServiceArray, KnowledgeUpdateServiceArrayRequest
from rosplan_knowledge_msgs.srv import GetDomainPredicateDetailsService, GetDomain... |
controller.py | import glob
import json
import locale
import os
import re
import shutil
import subprocess
import traceback
from math import floor
from pathlib import Path
from threading import Thread
from typing import List, Type, Set, Tuple, Optional, Dict, Generator, Iterable
import requests
import yaml
from colorama import Fore
fr... |
test_ssl.py | # Test the support for SSL and sockets
import sys
import unittest
from test import support
import socket
import select
import time
import datetime
import gc
import os
import errno
import pprint
import urllib.request
import threading
import traceback
import asyncore
import weakref
import platform
import functools
try:
... |
ppo_mp.py | import numpy as np
import pydart2 as pydart
from Examples.jump.skate_env_using_ref import SkateDartEnv
from collections import namedtuple
from collections import deque
from itertools import count
import random
import time
import os
from multiprocessing import Process, Pipe
from multiprocessing.connection import wait... |
Pong_v0.py | # Una pelota rebotando contra 4 paredes. Tanto la pelota como las
# paredes son sprites.
import pygame
import threading
import time
from empty_display import EmptyDisplay
import lib.colors as Color
SPEED = 8
class Ball(pygame.sprite.Sprite):
def __init__(self,
color,
width,... |
SCOREBOARD_WITH_SETTING_PAGE.py | # This my first app done using REMI and Python. Probably there is a better way to do it.
# This app is a simple scoreboard. I use it when I play pool/biliard.
# In the app is possible set-up how many Games one has to win, to win a Match.
# Example: the program starts with 5 games to win for a match. The background colo... |
generator.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
This module is for generating the batch data for training and testing.
"""
import torch
import numpy as np
from multiprocessing import Process, Queue
from pykg2vec.common import TrainingStrategy
def raw_data_generator(command_queue, raw_queue, config):
"""Function ... |
__init__.py | """
Base classes for job runner plugins.
"""
import os
import time
import string
import logging
import datetime
import threading
import subprocess
from Queue import Queue, Empty
import galaxy.jobs
from galaxy.jobs.command_factory import build_command
from galaxy import model
from galaxy.util import DATABASE_MAX_STRI... |
test_error.py | # -*- coding: utf-8 -*-
# ------------------------------------------------------------------------------
#
# Copyright 2018-2019 Fetch.AI Limited
#
# 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 ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.