source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
ant.py | # Ant
#
# Copyright (c) 2012, Gustav Tiger <gustav@tiger.name>
#
# 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, m... |
SentenceTransformer.py | import json
import logging
import os
import shutil
from collections import OrderedDict
from typing import List, Dict, Tuple, Iterable, Type, Union
from zipfile import ZipFile
import requests
import numpy as np
import transformers
import torch
from numpy import ndarray
from torch import nn, Tensor, device
from torch.opt... |
launcher.py | import asyncio
import logging
import multiprocessing
import os
import sys
import time
import requests
from dotenv import load_dotenv
import config
import ipc
from app.classes.cluster import Cluster
from app.utils import webhooklog
load_dotenv()
WEBHOOK_URL = os.getenv("UPTIME_HOOK")
TOKEN = os.getenv("TOKEN")
SHARD... |
clientPerf.py | #!/usr/bin/env python3
from multiprocessing import Process, Value
import time
import sys
import xmlrpc.client
def call_rpc(errors, i):
try:
s = xmlrpc.client.ServerProxy('https://localhost:8000')
s.test(i)
except Exception as Ex:
errors.value += 1
def jobs_process(errors, process_n):
... |
win32.py | __all__ = ['start', 'stop']
from sys import platform, exit
from ctypes import (windll, Structure, sizeof, WINFUNCTYPE, pointer, byref, c_uint, c_int, c_char, c_wchar)
from ctypes.wintypes import (HWND, HANDLE, HICON, HBRUSH, HMENU, POINT, LPCWSTR, WPARAM, LPARAM, MSG, RECT, DWORD, WORD)
import os
import asynci... |
bebroadcast.py | import json
import socket
import threading
from enum import Enum
from byzantinerandomizedconsensus.base.broadcast import Broadcast
class BEBroadcast(Broadcast):
"""
Implements a Best Effort Broadcast protocol.
"""
SERVER_QUEUE = 10
class MessageType(Enum):
SEND = 1
def __init__(sel... |
server_old.py | import socket
import threading
import room
PORT = 5050
SERVER = socket.gethostbyname(socket.gethostname())
ADDR = (SERVER, PORT)
FORMAT = "utf-8"
DISCONNECT_MESSAGE = "!DISCONNECT"
server = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
server.bind(ADDR)
# room objects
rooms = []
# key: user_id; value: connectio... |
test_search_20.py | import pytest
from time import sleep
from base.client_base import TestcaseBase
from utils.util_log import test_log as log
from common import common_func as cf
from common import common_type as ct
from common.common_type import CaseLabel, CheckTasks
from utils.utils import *
from common.constants import *
prefix = "se... |
pcrender.py | from __future__ import print_function
import numpy as np
import ctypes as ct
import os
import cv2
import sys
import torch
import argparse
import time
import gibson.core.render.utils as utils
import transforms3d
import json
import zmq
from gibson import assets
from torchvision import datasets, transforms
from torch.au... |
snapcast_socket.py | from __future__ import (absolute_import, division, print_function,
with_statement, unicode_literals)
import socket, select, json
import threading
from operator import itemgetter
CLIENT_CONNECT_CHANGES = [
"Client.OnConnect",
"Client.OnDisconnect",
]
CLIENT_VOLUME_CHANGES = [
"Client.OnVolumeCh... |
mp2.py | from multiprocessing import Process, Queue
sentinel = -1
import time
def creator(data, q):
"""
Creates data to be consumed and waits for the consumer
to finish processing
"""
print('Creating data and putting it on the queue')
for item in data:
time.sleep(0.5)
q.put(item)
def my... |
test_clients_gateways.py | import asyncio
import copy
import multiprocessing
import time
from typing import Dict
import pytest
from jina import Document, DocumentArray
from jina.helper import random_port
from jina.parsers import set_gateway_parser
from jina.serve import networking
from jina.serve.runtimes.gateway.grpc import GRPCGatewayRuntime... |
views.py | from django.db.models.query import QuerySet
from django.http import response
from django.http.response import HttpResponse
from django.shortcuts import render
from rest_framework.serializers import Serializer
from .models import Video
from .serializers import VideoSerializer
from rest_framework import status
from rest_... |
__init__.py | import sys
import os
from threading import Thread
from i3pystatus.core.exceptions import ConfigError
from i3pystatus.core.imputil import ClassFinder
from i3pystatus.core import io, util
from i3pystatus.core.modules import Module
class CommandEndpoint:
"""
Endpoint for i3bar click events: http://i3wm.org/docs... |
plugin.py | # -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# --------------------------------------------------------------------------
import atexit
import gzip
import json
import multiprocessing as mp
import os
import sys
import tempfile
imp... |
server.py | """
This module contains the interface for graphlab server, and the
implementation of a local graphlab server.
"""
'''
Copyright (C) 2015 Dato, Inc.
All rights reserved.
This software may be modified and distributed under the terms
of the BSD license. See the LICENSE file for details.
'''
from ..cython.cy_ipc import... |
spark.py | # Copyright 2021 Raven 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 applicable law or ... |
HiwinRA605_socket_ros_20190614132405.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 HiwinRA605_s... |
getset.py | import socket
from threading import Thread
byte = 0
status = ""
sock = socket.socket()
conn = None
address_file = ""
ip = ""
port = 0
def set_file():
global conn
f = open(address_file, 'r')
str_code = str(f.read())
f.close()
conn.send(str_code.encode("utf-8"))
print()
print("CODE:",str_code... |
threads-dishes-examples.py | import threading
import queue
import time
import os
import multiprocessing as mp
pid = os.getpid()
def washer(dishes, dish_queue):
for dish in dishes:
print("Washing", dish, '\n')
# time.sleep(5)
dish_queue.put(dish)
def dryer(dish_queue):
# print('dryer')
while True:
di... |
auth_client.py | #!/usr/bin/env python
import Pyro.core, Pyro.protocol
import threading, time, sys, copy
# worker thread code
def processing(username, proxy):
print "Processing started for user ",username
time.sleep(0.5)
proxy.init()
for i in range(30):
sys.stdout.write(username+" ")
sys.stdout.flush()
proxy.addline("little... |
test_wsgi.py | import sys
import threading
import time
import requests
from six.moves import http_client
import testtools
from testtools.matchers import Equals, MatchesRegex
import falcon
import falcon.testing as testing
def _is_iterable(thing):
try:
for i in thing:
break
return True
except:
... |
example_test.py | from __future__ import print_function
from __future__ import unicode_literals
import re
import os
import socket
import random
import string
from SimpleWebSocketServer import SimpleWebSocketServer, WebSocket
from tiny_test_fw import Utility
from threading import Thread, Event
import ttfw_idf
def get_my_ip():
s = s... |
nmeastreamer.py | """
Threaded NMEAMessage streamer which polls for every currently
recognised standard NMEA message type.
Connects to the receiver's serial port and sets up a
daemon NMEAReader thread. While the thread is running in the
background, it sends a GNQ poll request for every currently
documented standard NMEA message ... |
optimization.py | import hashlib
import json
from copy import copy
from datetime import datetime
from itertools import product
from logging import getLogger
from threading import Thread, Event
from time import time
from typing import Union, Any, Sequence, Optional, Mapping, Callable
from .job import TrainsJob
from .parameters import Pa... |
main.py | import cv2
import os
import telebot
import photos_module
import config_module
import database_module
import large_messages
import storage_module
import threading
import time
import tempfile
from datetime import datetime
print("Press Ctrl+C to exit.")
telebot.apihelper.API_URL = config_module.server_url
bot = telebot.T... |
HWDriver.py | __version__ = '0.1.0'
from gpiozero import Button, LED
from NeuralNet import *
import numpy as np
import threading
import Config as cfg
import os
import time
import math
class KeyboardSensor(object):
def __init__(self, skip_neural=False):
self.sensors = [Button(i) for i in cfg.SENSE_PINS]
self.bu... |
watch.py | # Using the following encoding: utf-8
import ctypes
from ltk.actions.action import Action
from ltk.actions import add_action
from ltk.actions import request_action
from ltk.actions import download_action
from ltk.logger import logger
from ltk.utils import map_locale, restart, get_relative_path, log_error
from ltk.local... |
player1.py | # BrewV written by Aditya Dubey
"""
____ __ __
/ __ )__________ _ __| | / /
/ __ / ___/ _ \ | /| / /| | / /
/ /_/ / / / __/ |/ |/ / | |/ /
/_____/_/ \___/|__/|__/ |____/
"""
import platform
import os
import sys
import time
#from pymediainfo import MediaInfo
from PyQt... |
api.py | """Remotely control your Binance account via their API : https://binance-docs.github.io/apidocs/spot/en"""
import hashlib
import hmac
import json
import math
import re
import sys
import time
from datetime import datetime, timedelta
from threading import Thread
from urllib.parse import urlencode
import numpy as np
imp... |
main.py | import logging
from threading import Thread
from random import randint
from time import sleep
from pq.queue import Queue
from pq.job import Job
from pq.worker import Worker
from task import JobRequestSiteArticle
if __name__ == "__main__":
logging.basicConfig(level="DEBUG")
site_list = ["https://revistaquem.gl... |
gavin_data_hub.py | #!/usr/local/bin/python3.6 -u
# Daemon to aggregate values from the sensor daemons and write to log files
# Data is requested through a json string, and returned as a json string
import os.path
from os import unlink
import time
import datetime
import threading
from threading import Thread
import json
import socket
fr... |
dump_csv_converter.py | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
import os
import threading
from datetime import datetime
from math import floor
from pathlib import Path
import numpy as np
import pandas as pd
import yaml
class DumpConverter:
""" This class is used for convert binary snapshot dump conte... |
multipart_uploader.py | #!/usr/bin/env python
# -*- coding: utf-8; -*-
# Copyright (c) 2022 Oracle and/or its affiliates.
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/
from typing import Dict, List
from ads.common.oci_client import OCIClientFactory
from ads.common.auth import get_s... |
learner.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... |
test_lib_test.py | #!/usr/bin/env python
import threading
import time
from absl.testing import absltest
from grr_response_core.lib import rdfvalue
from grr.test_lib import test_lib
class FakeTimelineTest(absltest.TestCase):
def testRunSingleSleep(self):
log = []
def foo():
while True:
log.append("foo")
... |
test_attn_fpga.py | import torch
import numpy as np
import pytest
from daceml.pytorch import DaceModule
from dace.transformation.dataflow import RedundantSecondArray
from daceml.transformation import ConstantFolding
from dace.transformation.interstate import FPGATransformSDFG, InlineSDFG
from dace.transformation.dataflow import PruneCo... |
connection.py | #
# A higher level module for using sockets (or Windows named pipes)
#
# multiprocessing/connection.py
#
# Copyright (c) 2006-2008, R Oudkerk
# Licensed to PSF under a Contributor Agreement.
#
# Modifications Copyright (c) 2020 Cloudlab URV
#
import time
import socket
import selectors
import threading
import random
im... |
jupyterhub_config.py | # This file provides common configuration for the different ways that
# the deployment can run. Configuration specific to the different modes
# will be read from separate files at the end of this configuration
# file.
import os
import json
import string
import yaml
import threading
import time
import requests
import ... |
web_util.py | import logging
from queue import Queue
import uuid
import json
from threading import Thread
from bottle import request, abort
from telegram import Update
from telegram.ext import Dispatcher
from daysandbox_bot import init_bot_with_mode, register_handlers
def setup_web_app(app, mode='production'):
logging.basicC... |
app.py | #
# This file is:
# Copyright (C) 2018 Calin Culianu <calin.culianu@gmail.com>
#
# MIT License
#
import os
from electroncash_gui.ios_native.monkeypatches import MonkeyPatches, PatchedSimpleConfig
from electroncash.util import set_verbosity
from electroncash_gui.ios_native import ElectrumGui
from electroncash_gui.io... |
utils.py | #/usr/bin/env python3
#-*- coding: utf-8 -*-
import pyaudio
import shutil
import wave
import numpy as np
import pylab as pl
import matplotlib as plt
from os import system, path
from queue import Queue, Empty
from socket import socket, timeout
from threading import Thread
from time import sleep
from thr... |
simple_http_server.py | import os
import urlparse
import datetime
import threading
import mimetools
import socket
import errno
import xlog
import sys
import select
import time
logging = xlog.Logger()
class HttpServerHandler():
default_request_version = "HTTP/1.1"
MessageClass = mimetools.Message
rbufsize = -1
wbufsize = 0
... |
app.py | from flask import Flask
from ..spy import WeChatSpy
from queue import Queue
from threading import Thread
from ..command import *
import requests
class SpyService(Flask):
def __init__(self, import_name,
static_url_path=None,
static_folder="static",
static_host=Non... |
class_one_process.py | """Module with class for all operations with one process"""
from __future__ import print_function
# Standard library imports
import sys
import os
import logging
from multiprocessing import Process
import datetime
# Third party imports
from local_simple_database import LocalSimpleDatabase
import psutil
# Local imports... |
diskover_socket_server.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""diskover - Elasticsearch file system crawler
diskover is a file system crawler that index's
your file metadata into Elasticsearch.
See README.md or https://github.com/shirosaidev/diskover
for more information.
Copyright (C) Chris Park 2017-2019
diskover is released unde... |
all.py | from utlis.rank import setrank,isrank,remrank,remsudos,setsudo, GPranks,IDrank
from utlis.send import send_msg, BYusers, GetLink,Name,Glang,getAge
from utlis.locks import st,getOR
from utlis.tg import Bot
from config import *
from pyrogram import ReplyKeyboardMarkup, InlineKeyboardMarkup, InlineKeyboardButton
import t... |
device_report_client.py | """Server to handle incoming session requests"""
import threading
import grpc
from forch.proto.shared_constants_pb2 import PortBehavior
from forch.proto.devices_state_pb2 import DevicesState
from forch.base_classes import DeviceStateReporter
from forch.utils import get_logger
try:
from daq.proto.session_server_p... |
link.py | import threading
from threading import Thread
import os
def run1():
os.system(r"python C:\OSProj\TrainedDynamicRR\trainedDynamicRR.py")
def run2():
os.startfile(r"C:\OSProj\TrainedDynamicRR\tdrr.exe")
print("Running Earliest Deadline First Algorithm Simulator")
Thread(target = run1).start()
Thread(... |
test_batch.py | # -*- coding:utf-8 -*-
# @author :adolf
import cv2
import os
import math
import json
import base64
import argparse
import textwrap
import requests
import numpy as np
from time import time
from os import listdir
from os.path import isfile, join, getsize
import multiprocessing
from PIL import Image, ImageDraw, ImageFont
... |
Command.py | # Copyright (C) 2007 - 2009 The MITRE Corporation. See the toplevel
# file LICENSE for license terms.
# This file was borrowed heavily from a combination of the
# dexec package written under the auspices of Reading Comp, and
# some tools for persistent clients and servers, also written
# under the auspices of Reading ... |
pakitaki.py | # coding=utf-8
# PakiTaki Rhythmbox Plugin
# alditis <alditis@gmail.com>, 2017
# License MIT
import gi
gi.require_version('Gtk', '3.0')
import os
import rb
import time
import ntpath
import random
import datetime
import threading
from ffmpy import FFmpeg
from gi.repository import GObject, RB, Peas, Gtk, Gio
from ut... |
test_win_runas.py | # -*- coding: utf-8 -*-
# Import Python libs
from __future__ import absolute_import, unicode_literals
import io
import inspect
import logging
import os
import subprocess
import socket
import sys
import textwrap
import threading
import time
import traceback
import yaml
# Import Salt Testing libs
from tests.support.cas... |
analyse_scs.py | # -*- coding: utf-8 -*-
"""
Created on Tue Jan 2 13:04:57 2018
@author: pscog
"""
from multiprocessing import Process
import PyThurstonian
from PyThurstonian import thurstonian, hdi
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
if __name__ == '__main__':
output_folder =... |
__init__.py |
import asyncore
import sys
import traceback
import time
import gc
from threading import Thread, Event
from zope.server.taskthreads import ThreadedTaskDispatcher
class LoopTestMixin(object):
thread_name = 'LoopTest'
task_dispatcher_count = 4
LOCALHOST = '127.0.0.1'
SERVER_PORT = 0 # Set these ... |
scdlbot.py | # -*- coding: utf-8 -*-
"""Main module."""
import gc
import pathlib
import random
import shelve
import shutil
from datetime import datetime
from multiprocessing import Process, Queue
from queue import Empty
from subprocess import PIPE, TimeoutExpired # skipcq: BAN-B404
from urllib.parse import urljoin, urlparse
from... |
client.py | """
gRpc client for interfacing with CORE.
"""
import logging
import threading
from contextlib import contextmanager
from typing import Any, Callable, Dict, Generator, Iterable, List, Optional
import grpc
from core.api.grpc import configservices_pb2, core_pb2, core_pb2_grpc
from core.api.grpc.configservices_pb2 impo... |
utils.py | import threading
class ThreadHandler():
STEP = 0.2
def __init__(self, target):
self.lock = threading.Lock()
self.stop = threading.Event()
args = (self.lock, self.stop)
self.thread = threading.Thread(target=target, args=args)
def start(self):
self.thread.start()
... |
test.py | #!/usr/bin/env python3
# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4
import libtorrent as lt
import unittest
import time
import datetime
import os
import shutil
import binascii
import subprocess as sub
import sys
import pickle
import threading
import tempfile
import socket
import select
import logging
import... |
_multi_drone_threading.py | import setup_path
import airsim
import numpy as np
import os
import tempfile
import pprint
import sys
import msgpackrpc
import time
import base64
import threading
from msgpackrpc.error import RPCError
MININET_MACHINE_IP = None
MININET_MACHINE_PORT = None
image_folder = 'C:\\NESLProjects\\airsim_v1.2.0\\screenshot'... |
campaign.py | from common.helpers.collections import omit_falsy
from common.models import Tag
from .client import SalesforceClient
import json
import requests
import threading
''' Project model maps to the Campaign object in Salesforce '''
client = SalesforceClient()
def run(request):
response = SalesforceClient().send(request... |
24_hilos.py | import threading # Antes se llama thread
import time
import datetime
#POSTERIORMENTE DEFINIR QUE HACE CADA FUNCIÓN
def consultar(id_persona):
time.sleep(2)
return
def guardar(id_persona, data):
time.sleep(5)
return
'''
tiempo_ini = datetime.datetime.now()
#Declaración de ... |
variable_scope.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... |
Session.py | from __future__ import annotations
import base64
import json
import logging
import os
import sched
import socket
import struct
import threading
import time
import typing
import defusedxml.ElementTree
import requests
from Cryptodome.Hash import HMAC
from Cryptodome.Hash import SHA1
from Cryptodome.PublicKey import RSA... |
run_ransomware.py | # Imports
from cryptography.fernet import Fernet # encrypt/decrypt files on target system
import os # to get system root
import webbrowser # to load webbrowser to go to specific website eg bitcoin
import ctypes # so we can intereact with windows dlls and change windows background etc
import urllib.request # used f... |
base_client.py | '''
Created on 20.09.2016
@author: rustr
'''
from threading import Thread
import socket
import struct
import time
import sys
if (sys.version_info > (3, 0)):
from queue import Queue
else:
from Queue import Queue
from ur_online_control.communication.msg_identifiers import *
class BaseClient(object):
""... |
__init__.py | # -*- coding: utf-8 -*-
"""Miscellaneous helper functions (not wiki-dependent)."""
#
# (C) Pywikibot team, 2008-2017
#
# Distributed under the terms of the MIT license.
#
from __future__ import absolute_import, unicode_literals
import collections
import gzip
import hashlib
import inspect
import itertools
import os
imp... |
multi_times.py | import multiprocessing
def now(seconds):
from datetime import datetime
from time import sleep
sleep(seconds)
print('czekamy', seconds, 'sekund, bieżący czas:', datetime.utcnow())
if __name__ == '__main__':
import random
for n in range(3):
seconds = random.random()
proc = multip... |
main2.py | import os
import os.path
import sys
import venv
from subprocess import PIPE, Popen
from threading import Thread
from urllib.parse import urlparse
from urllib.request import urlretrieve
class ExtendedEnvBuilder(venv.EnvBuilder):
"""
This builder installs setuptools and pip so that you can pip or
easy_insta... |
build.py | # Copyright 2014 The Oppia 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 applicable ... |
proy02_CalzadaMartinez.py | # -*- coding: utf-8 -*-
"""
Created on Mon Nov 20 00:11:10 2020
@author: Jonathan Calzada
"""
#Se utiliza threading para los hilos, random para los valores al azar; time para el tiempo
import threading
import random
import time
#Se crearon variables globales para reutilizar en las funciones
global paquete
global tie... |
inference_webcam.py | """
Inference on webcams: Use a model on webcam input.
Once launched, the script is in background collection mode.
Press B to toggle between background capture mode and matting mode. The frame shown when B is pressed is used as background for matting.
Press Q to exit.
Example:
python inference_webcam.py \
... |
pybuster.py | #!/usr/bin/pypy
from datetime import datetime
from random import choice
from string import ascii_lowercase,ascii_uppercase
from requests import get,head
from os import path
import threading
import argparse
parser = argparse.ArgumentParser()
parser.add_argument("-w","--wordlist", help="path to wordlist")
parser.add_arg... |
ForTesting5.py | import tensorflow as tf
tf.logging.set_verbosity(tf.logging.DEBUG)
#tf.logging.set_verbosity(tf.logging.INFO)
# Other settings
tf.logging.debug('debug message...')
tf.logging.info('info message...')
tf.logging.warn('warn message')
tf.logging.error('error message')
tf.logging.fatal('fatal message')
class SkipRun(Exc... |
test_signal.py |
import sys
import logging
import unittest
import threading
import random
import time
import copy
import numpy as np
import epics
from ophyd.signal import (Signal, EpicsSignal, EpicsSignalRO)
from ophyd.utils import (ReadOnlyError, TimeoutError)
logger = logging.getLogger(__name__)
class FakeEpicsPV(object):
_... |
stream.py | import os
import sys
import time
import json
import yaml
import queue
import signal
import argparse
import requests
import dateutil
import psycopg2
import numpy as np
from pprint import pprint
from datetime import datetime
from psycopg2.extras import Json
from multiprocessing import Queue
from multiprocessing import Va... |
collectionPoint.py | #################
# Copyright 2018 Adobe Systems Incorporated
#
# 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 requ... |
mocrin.py | ###################### INFORMATION #############################
# akf-mocrin is a "Multiple OCR Interface"
# Program: **akf-mocrin**
# Info: **Python 3.6**
# Author: **Jan Kamlah**
# Date: **12.01.2018**
########## IMPORT ##########
import configparser
import numpy as np
import argparse
import su... |
test_multiprocessing.py | import asyncio
import copy
import os
import platform
import sys
import threading
import time
import pytest
import loguru
from loguru import logger
@pytest.fixture
def fork_context(monkeypatch):
import multiprocessing
context = multiprocessing.get_context("fork")
monkeypatch.setattr(loguru._handler, "mu... |
network.py | #-------------------------------------------------------------------------------
# Name: Network
# Purpose: Network connection object that intuitively extends a queue. Poll
# polls the receiving queue; push pushes to the send queue.
#
# Author: tetrisd
#------------------------------... |
tube.py | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
import logging
import re
import six
import string
import subprocess
import sys
import threading
import time
from six.moves import range
from pwnlib import atexit
from pwnlib import term
from pwnlib.context import context
f... |
server 2.py | ## DanderSpritZ Server V2
## By ShowNadda
# Global Imports
import socket
import termcolor
import json
import os
import shutil
import sys
import threading
def reliable_send(target,data):
jsondata = json.dumps(data)
target.send(jsondata.encode())
def upload_file(target,file_name):
f = open(file_name, "rb")... |
test_browser.py | # coding=utf-8
# Copyright 2013 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.
import argparse
import json
import multiprocessing
imp... |
ca_util.py | #!/usr/bin/python3
'''
SPDX-License-Identifier: Apache-2.0
Copyright 2017 Massachusetts Institute of Technology.
'''
from M2Crypto import X509, EVP, BIO
import sys
import os
import base64
import argparse
import datetime
import getpass
import zipfile
import io
import socket
from keylime import revocation_notifier
impo... |
test_worker.py | import asyncio
import logging
from multiprocessing import Process
from unittest.mock import MagicMock
import pytest
import arq.worker
from arq.drain import TaskError
from arq.testing import RaiseWorker
from arq.worker import import_string, start_worker
from .example import ActorTest
from .fixtures import (EXAMPLE_FI... |
Simulation.py | import tkinter as tk
from time import time as tm
import threading as th
from functools import wraps as wr
from functools import partial
import os
import logging as lg
# ==============================================================================
# Metapg
def decorator(funct):
""" Param funct: function to be wea... |
cronjobs.py | #!/usr/bin/env python
"""Cron management classes."""
import logging
import random
import threading
import time
from grr import config
from grr.lib import rdfvalue
from grr.lib import registry
from grr.lib import stats
from grr.lib import utils
from grr.lib.rdfvalues import cronjobs as rdf_cronjobs
from grr.lib.rdfva... |
validator.py | from util import *
from settings import bgp_validator_server, validator_path, \
maintenance_timeout, maintenance_log, thread_max_errors
import json
import Queue
import socket
import sys
import traceback
from datetime import datetime, timedelta
from subprocess import PIPE, Popen
from threading imp... |
map_test.py | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
test_creator.py | from __future__ import absolute_import, unicode_literals
import difflib
import gc
import logging
import os
import stat
import subprocess
import sys
from itertools import product
from threading import Thread
import pytest
import six
from virtualenv.__main__ import run, run_with_catch
from virtualenv.create.creator im... |
GNSS.py | import os
import sys
import serial
from serial import SerialException
import pynmea2
from pynmea2 import ParseError
import time
import uptime
from multiprocessing import Queue, Process
def generate_test_GPGGA_sentence(self):
msg = pynmea2.GGA('GP',
'GGA',
(time.strftim... |
main.py | '''
(*)~---------------------------------------------------------------------------
Pupil - eye tracking platform
Copyright (C) 2012-2017 Pupil Labs
Distributed under the terms of the GNU
Lesser General Public License (LGPL v3.0).
See COPYING and COPYING.LESSER for license details.
-----------------------------------... |
run_tests_on_spark.py | #!/usr/bin/env python3
# Copyright (c) YugaByte, 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 a... |
game_controller.py | import os
import threading
import time
import cv2
from template_finder import TemplateFinder
from utils.auto_settings import check_settings
from bot import Bot
from config import Config
from death_manager import DeathManager
from game_recovery import GameRecovery
from game_stats import GameStats
from health_manager im... |
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 .utils import xyxy2xywh, xywh2xyxy
img_formats = [... |
watcher.py | import logging
import os.path
import threading
import time
from galaxy.util.hash_util import md5_hash_file
try:
from watchdog.events import FileSystemEventHandler
from watchdog.observers import Observer
from watchdog.observers.polling import PollingObserver
can_watch = True
except ImportError:
Obse... |
exampleinterval.py | import time
from threading import Thread
import rxbp
from rxbp.schedulers.timeoutscheduler import TimeoutScheduler
from rxbp.testing.tobserver import TObserver
def counter(sink):
while True:
time.sleep(1)
print(f"immediate: {sink.immediate_continue}, received: ", sink.received)
publisher = rxbp... |
zombie.py | import base64, socket, threading
import time, random
class Zombie:
def __init__(self):
self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
def connect_socket(self):
self.sock.connect(('2.tcp.ngrok.io', 10142))
def send_packet(self, content: str):
try:
sel... |
th1.py | import threading
def sum1():
answer = 0
for i in range(1,10**8):
answer+=i
print('thread_name:', threading.currentThread().getName())
print('sum1 = ', answer)
def sum2():
answer = 0
for i in range(1,100):
answer+=i
print('thread_name:', threading.currentThread().get... |
framework.py | #!/usr/bin/env python3
from __future__ import print_function
import gc
import sys
import os
import select
import signal
import unittest
import tempfile
import time
import faulthandler
import random
import copy
import psutil
import platform
from collections import deque
from threading import Thread, Event
from inspect ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.