source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
ledHelper.py | from threading import Thread
from neopixel import NeoPixel
import time
SLEEP_TIME = 0.05
COLOR_STEPS = 10
class Led:
pixel: NeoPixel
cycleRunning: bool
cycleThread: Thread
baseColor: "tuple[int, int, int]"
def __init__(self, leds: NeoPixel, baseColor) -> None:
self.pixel = leds
s... |
input_handler.py | import liblo
import sys
import time
import shlex
import utilities
import threading
from liblo_error_explainer import LibloErrorExplainer
from proto_reader_v1 import *
from proto_reader_v2 import *
class InputHandler(object):
def __init__(self, queue):
self.queue = queue
self.gap_size = 0
s... |
_multi_drone_threading - Copy.py | import setup_path
import airsim
import numpy as np
import os
import tempfile
import pprint
import msgpackrpc
import time
import base64
import threading
from msgpackrpc.error import RPCError
image_folder = 'C:\\NESLProjects\\airsim_v1.2.0\\screenshot'
image_id = {
'Drone1': 1,
'Drone2': 1,... |
ch.py | ################################################################
# File: ch.py
# Title: Chatango Library
# Original Author: Lumirayz/Lumz <lumirayz@gmail.com>
# Current Maintainers and Contributors:
# Nullspeaker <nhammond129@gmail.com>
# asl97 <asl97@outlook.com>
# pystub
# dani87
# domzy
# kamijouto... |
pynani.py | #!usr/bin/env python
from shutil import copyfile
import http.server
import socketserver
import sys
import os
import time
import threading
try:
from watchdog.observers import Observer
from watchdog.events import FileSystemEventHandler
except:
pass
os.system("cls" if os.name == "nt" else "clear") # suppo... |
__init__.py | """YTA TFTP Server Package"""
from os.path import isfile
import threading
import yta_tftp.util as util
class TFTPServer:
"""A TFTP Server"""
max_bytes = 1024
server_port = 69
chunk_sz = 512
listening_ip = ""
def __init__(self, **kwargs):
"""Constructor"""
self.source_port = s... |
rdd.py | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... |
mod_crew_extended403.py | # -*- coding: utf-8 -*-
import os
import re
import json
import codecs
import datetime
import threading
import urllib
import urllib2
import math
import BigWorld
from gui.shared.gui_items.dossier import TankmanDossier
from constants import AUTH_REALM
from gui.Scaleform.daapi.view.lobby.hangar import Hangar
from items.t... |
git_common.py | # Copyright 2014 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.
# Monkeypatch IMapIterator so that Ctrl-C can kill everything properly.
# Derived from https://gist.github.com/aljungberg/626518
import multiprocessing.pool
... |
node.py | from definitions import *
import os
import utility as util
import socket
import threading
from packet import *
from known_hosts import *
from struct import *
import math
routing_table_update_progress = False
class ThreadedNode:
def __init__(self, port=None, host=None):
if host is None:
self.h... |
main.py | import keep_alive
from discord.ext import commands
import subprocess
import threading
import aiofiles
import discord
import asyncio
import aiohttp
import random
import ctypes
import re
import os
keep_alive.keep_alive()
token = 'ODU3MzIzMjQ4Njk3OTk5Mzcx.YNN6fg.CqI4Z4Cdgz2lvcbQTkucusgYvzY'
prefix = '/'
intents = discor... |
example_interactive_mode.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# File: example_interactive_mode.py
#
# Part of ‘UNICORN Binance WebSocket API’
# Project website: https://github.com/oliver-zehentleitner/unicorn-binance-websocket-api
# Documentation: https://oliver-zehentleitner.github.io/unicorn-binance-websocket-api
# PyPI: https://... |
tree_traversal2.py | # python3
"""
You are given a rooted binary tree.
Build and output its in-order, pre-order and post-order traversals.
"""
import sys
import threading
sys.setrecursionlimit(10 ** 6) # max depth of recursion
threading.stack_size(2 ** 27) # new thread will get stack of such size
class TreeOrders:
def __init__(sel... |
thread_buffer.py | # Copyright 2020 - 2021 MONAI Consortium
# 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 wri... |
smb_hashes.py | from src.platform.weblogic.authenticate import checkAuth
from src.platform.weblogic.interfaces import WINTERFACES
from src.lib.cifstrap import Handler
from auxiliary import Auxiliary
from threading import Thread
from log import LOG
from re import findall
from time import sleep
import socket
import utility
import state
... |
msgcenter.py | #!/usr/bin/env python
# -*- coding: utf-8 -*
# Copyright: [CUP] - See LICENSE for details.
# Authors: Guannan Ma (@mythmgn),
"""
:descrition:
msg center related module
"""
import abc
import time
import socket
import threading
from cup import log
from cup.net.asyn import conn
from cup.net.asyn import msg as async_... |
test_socket.py | #!/usr/bin/env python3
import unittest
from test import support
import errno
import io
import socket
import select
import tempfile
import _testcapi
import time
import traceback
import queue
import sys
import os
import array
import platform
import contextlib
from weakref import proxy
import signal
import math
import p... |
api.py | #!/usr/bin/env python3
import sys
import http.server
import socketserver
import json
import threading
import tuxedo as t
class Handler(http.server.BaseHTTPRequestHandler):
def do_POST(self):
content = self.rfile.read(
int(self.headers.get("Content-Length", "0"))
)
req = json.l... |
torrent.py | import os
import random
import requests
import threading
import time
from platypush.context import get_bus
from platypush.plugins import Plugin, action
from platypush.message.event.torrent import \
TorrentDownloadStartEvent, TorrentDownloadedMetadataEvent, TorrentStateChangeEvent, \
TorrentDownloadProgressEven... |
run.py | import apifuzz as af
import argparse
import traceback
parser = argparse.ArgumentParser()
parser.add_argument("-t", "--type", help="Type of test : prefix of the log file", type=str, default='openapi2')
parser.add_argument("-f", "--file", help="Provide the valid OpenAPI2.0 file", type=str, required=True)
parser.add_arg... |
chat_client.py | import socket
import threading
import tkinter
import tkinter.scrolledtext
from tkinter import simpledialog
HOST = '146.59.176.144'
PORT = 9090
class Client:
def __init__(self, host, port):
self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
self.sock.connect((host, port))... |
train.py | # --------------------------------------------------------
# FCN
# Copyright (c) 2016 RSE at UW
# Licensed under The MIT License [see LICENSE for details]
# Written by Yu Xiang
# --------------------------------------------------------
"""Train a FCN"""
from fcn.config import cfg
from gt_data_layer.layer import GtDat... |
lisp.py | # -----------------------------------------------------------------------------
#
# Copyright 2013-2019 lispers.net - Dino Farinacci <farinacci@gmail.com>
#
# 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... |
webhooklistener.py | import traceback
from http.server import BaseHTTPRequestHandler, HTTPServer
import json
import sys
import socket
import os
import threading
import discord.ext.commands as commands
import asyncio
def runServer(self, bot):
server = HTTPServerV6((os.environ.get("FRED_IP"), int(os.environ.get("FRED_PORT"))), MakeGith... |
sensor_server.py | import time
import json
import threading
import zmq
from robot_brain.sensors import MCP3008AnalogSensor, PingSensor
from robot_brain.actuators import PWMActuator, ServoActuator
class SensorServer(object):
def __init__(self, port=2012):
self.port = port
# Whether or not to continue running the ... |
acs_client.py | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... |
test_server_client.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import pytest
from pytest import raises, approx, mark
from EasyVision.vision import *
from .common import *
from EasyVision.server import Server
import threading as mt
import time
def create_server(images, camera, name):
"""This test requires Pyro NameServer started"... |
download_data.py | """
Script to download images and create descriptions file.
Usage:
wget https://image-net.org/imagenet_data/urls/imagenet_fall11_urls.tgz # download imagenet urls. please decompress.
python --cmd_urls # get relevant urls from imagenet
python --cmd_split # create train/dev/test splits of urls
python --... |
flask_app.py | import os
import typing
from http import HTTPStatus
import threading
import hashlib
import flask
import pymongo
from energuide import database
from energuide import cli
from energuide import logger
LOGGER = logger.get_logger(__name__)
App = flask.Flask(__name__)
DEFAULT_ETL_SECRET_KEY = 'no key'
App.config.updat... |
cassandra_cql.py | #
# Copyright (c) 2020 Juniper Networks, Inc. All rights reserved.
#
import collections
import datetime
import importlib
import itertools
import math
from multiprocessing import Process
from multiprocessing.queues import Queue
import queue
import ssl
import sys
import gevent
import gevent.lock
import gevent.queue
fro... |
variable_cell.py | from ..interfaces.cell import Cell
from ..utils.functions import *
from ..utils.stats import kde, pmf, find_x_range
from ..utils.js_code import HOVER_CODE
from ..utils.constants import COLORS, BORDER_COLORS, PLOT_HEIGHT, PLOT_WIDTH, SIZING_MODE, RUG_DIST_RATIO, RUG_SIZE
from functools import partial
import threading
... |
train_pg_1.py | #Reference:
#1. https://github.com/mabirck/CS294-DeepRL/blob/master/lectures/class-5/REINFORCE.py
#2. https://github.com/JamesChuanggg/pytorch-REINFORCE/blob/master/reinforce_continuous.py
#3. https://github.com/pytorch/examples/blob/master/reinforcement_learning/actor_critic.py
# With the help from the implementation... |
dash_buffer.py |
from collections import deque
import threading
import time
import csv
import os
from . import config_dash
from .stop_watch import StopWatch
# Durations in seconds
PLAYER_STATES = ['INITIALIZED', 'INITIAL_BUFFERING', 'PLAY',
'PAUSE', 'BUFFERING', 'STOP', 'END']
EXIT_STATES = ['STOP', 'END']
class Das... |
mqtt_rpc.py | #!/usr/bin/env python
# -- Content-Encoding: UTF-8 --
"""
Pelix remote services: MQTT pseudo RPC
An remote service protocol based on MQTT.
This implementation tries to mimic the MQTT-RPC Javascript project:
https://github.com/wolfeidau/mqtt-rpc
This module depends on the paho-mqtt package (ex-mosquitto), provided by ... |
Basic_with_Added_Functions.py | #!/usr/bin/env python
"""
Created by Jiggs
Basic python script to connect to an IMAP mailbox, retrieve a specific line of text from an email body and write it to a
csv file.
Includes various functions for cleaning up the returned email body if necessary.
Intended as a base code to assist with building an email checkin... |
game3D.py | import pygame
import pygame.locals as pylocals
import threading
import sys
import random
import time
from core.cube_3d import Cube3D
import numpy as np
import OpenGL.GL as gl
import OpenGL.GLU as glu
pygame.init()
window_name = '.'.join(sys.argv[0].split('.')[:-1])
pygame.display.set_caption(window_name if window_n... |
ReadMappingServer.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... |
threading_service.py | from factories.logger_factory import LoggerFactory
import constants
# from tqdm import tqdm_gui
import api_handler
import threading
import config
from threading import Thread, ThreadError
import time
class ThreadService:
def __init__(self, states, master_logger, scrape_service):
self.states = states
... |
FunctionFinder.py | import inspect, time, math, random, multiprocessing, queue, copy, sys, os
import numpy
from . import StatusMonitoredLongRunningProcessPage
from . import ReportsAndGraphs
import zunzun.forms
import zunzun.formConstants
import multiprocessing
import pyeq3
externalDataCache = pyeq3.dataCache()
def parallelWorkFunc... |
run_squad_ColabVersion.py | # coding=utf-8
# Copyright 2018 The Google AI Language Team Authors.
#
# 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 ... |
FIRmatrix_Thread.py | # -*- coding: utf-8 -*-
"""
Created on Thu Sep 12 09:41:43 2019
@author: Anna Isabel Montevilla Shupikova
"""
import xlrd
import numpy as np
import scipy.signal as signal
from PIL import Image
from PIL import ImageDraw
import matplotlib.pyplot as plt
import time
import cv2
import threading
def blue(resu... |
example_multiprocessing_composite_dwell_analysis.py | from multiprocessing import Process, Manager
import numpy as np
from cxotime import CxoTime
import itertools
import pandas as pd
from timbre import f_to_c, Composite
def add_inputs(p, limits, date, dwell_type, roll, chips):
"""
Add input data to Timbre coposite results.
:param p: Output data
:type p... |
main.py | # -*- coding: utf-8 -*-
from threading import Thread
from time import sleep
import json
import vk_api
from vk_api.longpoll import VkLongPoll, VkEventType
from config import *
vk_session = vk_api.VkApi(token=token)
vk = vk_session.get_api()
longpool = VkLongPoll(vk_session)
########################################... |
decorators.py | """
This module includes functions that are used as decorators in the API endpoints.
"""
import json
import threading
import logging
import random
import re
from functools import wraps
from urllib import request, parse, error
from django.http import JsonResponse, Http404
from django.views.decorators.csrf import csrf... |
run.py | from flask import jsonify, Flask, request, render_template
from autolog import autolog
import os
import time
import datetime
import logging
import threading
LOGGER = logging.getLogger("AutoLogApp")
class AutoLogApp(object):
def __init__(self, autolog_obj, title, post_magic):
self.bk = autolog_obj
... |
base.py | """Multitest main test execution framework."""
import os
import collections
import functools
import time
from threading import Thread
from six.moves import queue
from schema import Use, Or, And
from testplan import defaults
from testplan.common.config import ConfigOption
from testplan.common.entity import Runnable, ... |
views.py | # Create your views here.
# importing all the required modules
from datetime import timedelta
import threading
from pathlib import Path
from django.shortcuts import render
from pytube import *
# defining function
def information(request):
# checking whether request.method is post or not
# def x():
if re... |
brutespray.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
from argparse import RawTextHelpFormatter
import readline, glob
import sys, time, os
import subprocess
import xml.dom.minidom
import re
import argparse
import argcomplete
import threading
import itertools
import tempfile
import shutil
from multiprocessing import Process
servic... |
plugin_event_multiplexer.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... |
probe.py | #!/usr/bin/env python3
"""Plugin that probes the network for failed channels.
This plugin regularly performs a random probe of the network by sending a
payment to a random node in the network, with a random `payment_hash`, and
observing how the network reacts. The random `payment_hash` results in the
payments being re... |
hifitts.py | # Available at http://www.openslr.org/109/
from corpora import dataset_path, transformed_path
import os, glob, shutil
import librosa
import json
from scipy.io import wavfile
import tqdm
import threading
from functools import partial
in_path = os.path.join(dataset_path, 'hi_fi_tts_v0', 'hi_fi_tts_v0')
speaker_subcorp... |
portable_runner.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... |
dht22.py | """
Based on:
https://github.com/joan2937/pigpio/blob/master/EXAMPLES/Python/DHT22_AM2302_SENSOR/DHT22.py
"""
import threading
import time
import atexit
import pigpio
import asyncio
from astroplant_kit.peripheral import *
class _DHT22:
"""
A class to read relative humidity and temperature from the
DHT22 se... |
final.py | from os import listdir
#from PIL import Image
import os, os.path
import tensorflow as tf, sys
from multiprocessing import Pool
patharg = sys.argv[1]
#path = "E:/project/test/output/"
valid_images = [".jpg",".gif",".png",".jpeg"]
# Loads label file, strips off carriage return
label_lines = [line.rstrip() fo... |
process.py | import time
import logging
import traceback
from multiprocessing import Process
from threading import Lock
LOG = logging.getLogger(__name__)
class _Task:
def __init__(self, func, args, kwargs):
self.func = func
self.args = args
self.kwargs = kwargs
def __call__(self):
return... |
cli.py | import argparse
import base64
import os
import socketserver
import struct
import sys
import threading
import tempfile
import time
import shutil
import requests
SSH_AGENT_FAILURE = struct.pack('B', 5)
SSH_AGENT_SUCCESS = struct.pack('B', 6)
SSH2_AGENT_IDENTITIES_ANSWER = struct.pack('B', 12)
SSH2_AGENT_SIGN_RESPONSE ... |
lock.py | from threading import Thread
from pyinotify import IN_CLOSE_WRITE, IN_OPEN, Notifier, ProcessEvent, WatchManager
class MiniscreenLockFileMonitor:
def __init__(self, lock_path):
self.thread = Thread(target=self._monitor_lockfile)
self.when_user_stops_using_oled = None
self.when_user_starts... |
webserver.py | # Copyright 2013 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.
import BaseHTTPServer
import os
import threading
import ssl
import sys
class Responder(object):
"""Sends a HTTP response. Used with TestWebServer."""
... |
bulk_write_test.py | #!/usr/bin/env python3
import os
import time
import threading
from typing import Any, List
from panda import Panda
JUNGLE = "JUNGLE" in os.environ
if JUNGLE:
from panda_jungle import PandaJungle # pylint: disable=import-error
# The TX buffers on pandas is 0x100 in length.
NUM_MESSAGES_PER_BUS = 10000
def flood_tx... |
server3.py | ################################################################################
#
# 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
# ... |
skipgram.py | from __future__ import division # py3 "true division"
import logging
import sys
import os
import heapq
import copy
import numpy as np
from timeit import default_timer
from copy import deepcopy
from collections import defaultdict
import threading
import itertools
try:
from queue import Queue, Empty
except Import... |
index.py | from flask import *
import threading
import socket
import queue
app = Flask(__name__)
messages = queue.Queue()
@app.route('/thread')
def start_thread():
threading.Thread(target=socket_handler).start()
return "Thread Started"
def socket_handler():
serversocket = socket.socket(
socket.AF_INET, socket.S... |
api.py | import threading
import ujson
import numpy as np
from copy import deepcopy
from hyperion import *
from multiprocessing.connection import Listener
from hyperion import shared
from hyperion.logs import hand_logs
def manage_api(debug, host=HOST, port=PORT):
listener = Listener((host, port))
while True:
c... |
pabot.py | #!/usr/bin/env python
# Copyright 2014->future! Mikko Korpela
#
# 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 ... |
subscriber.py | import zmq
import json
import threading
class Subscriber:
def __init__(self, port, cb=None):
self.values = None
self.cb = None
self.port = port
self.context = zmq.Context()
self.socket = self.context.socket(zmq.SUB)
self.socket.connect ("tcp://127.0.0.1:%s" % port... |
test_frags.py | #!/usr/bin/env python2
import logging
from random import randint
from time import sleep
from multiprocessing import Process
from scapy.all import IPv6, ICMPv6PacketTooBig, UDP, IPv6ExtHdrFragment, \
sniff, send, DNS, DNSQR, DNSRROPT, sr1
from argparse import ArgumentParser
def set_log_level(args_level):
... |
audio_player_wrapper.py | import os
import fcntl
import subprocess
import threading
import getpass
import signal
from gmusicapi import Mobileclient
class AudioPlayerProtocolV1:
def play_message_for(self, stream_url):
return "play {0}\n".format(stream_url)
def pause_message(self):
return "pause \n"
def unpause_mess... |
task_running.py | import json
from cases.models import TestCase
from tasks.models import TestTask,TaskCaseRelevance
import os
from backend.settings import BASE_DIR
from tasks.task_running.test_result import save_test_result
import threading
data_dir = os.path.join(BASE_DIR,'tasks','task_running','test_data.json')
test_dir = os.path.joi... |
crawler.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
import urllib2
import re
import chardet
import sys
import login
import parser
import dbhandler
import exception
import conf
import time
import logging
import threading
import thread
import errno
import socket
def getInfo(url, cookie,logPath):
logging.basicConfig(filename=... |
google_cloud.py | import time
from threading import Thread
from bootstrapbase import BootstrapBase
from common.mapr_logger.log import Log
from common.os_command import OSCommand
from mapr.clouds.cloud import Cloud
class GoogleCloud(Cloud):
NAME = "Google"
CMD_ROLE_BINDING = "kubectl create clusterrolebinding user-cluster-admi... |
async_iter.py | import datetime
import operator
__version__ = '0.1.3'
try:
import Queue
except ImportError:
import queue as Queue
import threading
import sys
class ThreadPool:
"""
Customized thread pool
"""
class TreadPoolException(Exception):
pass
class NULLKEY:
pass
def __init_... |
main_upload_script.py |
import os, sys, logging, datetime, multiprocessing, icebridge_common, shutil
import threading, time
import parallel_premet_maker
import label_flight_list # Contains AN_FLIGHTS and GR_FLIGHTS
#===============================================================================
# Constants
COMPLETED_DATES_FILE = '/u/smcm... |
dmc.py | import os
import threading
import time
import timeit
import pprint
from collections import deque
import torch
from torch import multiprocessing as mp
from torch import nn
from .file_writer import FileWriter
from .models import Model
from .utils import get_batch, log, create_env, create_buffers, create_optimizers, act... |
automatic_maintain.py | #!/usr/bin/python3
# -*- coding: utf-8 -*-
from threading import Thread
from pydrive.auth import GoogleAuth
from pydrive.drive import GoogleDrive
import os, socket, time
REMOTE_SERVER = "www.google.com"
def connection_test():
try:
# see if we can resolve the host name -- tells us if there is
# a DNS listeni... |
sftpserver.py | #!/usr/bin/python
# License: Apache
# Author: Pascal TROUVIN
# History:
# 2017-08-31 pt: add IP whiltelist
# 2017-08-31 pt: add multithreading
# 2017-08-31 pt: Add password as authentication method
import os
import time
import socket
import argparse
import sys
import textwrap
import paramiko
import logging
import ... |
__init__.py | # -*- coding: utf-8 -*-
"""
zboard
========
FULL CREDIT GOES TO THE ORIGINAL AUTHER AND OPEN SOURCE COMMUNITY!!!!!
MADE SOME CHANGES(TWEAKS) FOR PERSONAL USE AND TO SHARE WITH MY TEAM
Take full control of your keyboard with this small Python library. Hook global events, register hotkeys, simulate key presses and muc... |
ranking_debug_rank_training.py | #!/usr/bin/python
# This script computes ranking for train500.idx
# Input: /dat/fb15k-intermediate/train500.idx
# /result/...
# Output: /evaluation/rank15k_i[ITERATION]_d[DIM].txt
import numpy as np
import time
from collections import OrderedDict
import sys
import threading
entityNum = 14505
relNum = 23... |
xla_client_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... |
IndexFiles1.py | #!/usr/bin/env python
INDEX_DIR = "IndexFiles.index"
import sys, os, lucene, threading, time
import subprocess
from datetime import datetime
from java.nio.file import Paths
from org.apache.lucene.analysis.miscellaneous import LimitTokenCountAnalyzer
from org.apache.lucene.analysis.standard import StandardAnalyzer
fr... |
test_driver.py | #!/usr/bin/env python
# Copyright (C) 2015-2021 Swift Navigation Inc.
# Contact: https://support.swiftnav.com
#
# This source is subject to the license found in the file 'LICENSE' which must
# be be distributed together with this source. All other rights reserved.
#
# THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHO... |
trading.py | import copy
from decimal import Decimal, getcontext
import logging
import logging.config
try:
import Queue as queue
except ImportError:
import queue
import threading
import time
from qsforex.execution.execution import OANDAExecutionHandler
from qsforex.portfolio.portfolio import Portfolio
from qsforex import s... |
actions.py | # issue: https://github.com/0-complexity/openvcloud/issues/768
def init_actions_(service, args):
"""
this needs to returns an array of actions representing the depencies between actions.
Looks at ACTION_DEPS in this module for an example of what is expected
"""
return {
'test': ['install']
... |
Sender.py | import os
from multiprocessing import Queue
from socketserver import BaseRequestHandler, TCPServer
from threading import Thread
from Encoder import Encoder
class ServerHandler(BaseRequestHandler):
def handle(self):
print("Ricevuta una connessione da: ", self.client_address)
file = files.get()
... |
supersuit_utils_experimental.py | class SharedArray_patched(SharedArray):
def __setstate__(self, state):
(self.shared_arr, self.dtype, self.shape) = state
self._set_np_arr()
class ProcConcatVec_patched(ProcConcatVec):
def __init__(self, vec_env_constrs, observation_space, action_space, tot_num_envs, metadata):
self.obse... |
plugin.py | import base64
import re
import threading
from binascii import hexlify, unhexlify
from functools import partial
from electrum.bitcoin import (bc_address_to_hash_160, xpub_from_pubkey,
public_key_to_p2pkh, EncodeBase58Check,
TYPE_ADDRESS, TYPE_SCRIPT,
... |
client.py | import socket
import threading
import pickle
import sys
state = {}
def serverListen(serverSocket):
while True:
msg = serverSocket.recv(1024).decode("utf-8")
if msg == "/viewRequests":
serverSocket.send(bytes(".","utf-8"))
response = serverSocket.recv(1024).decode("utf-8")
if response == "/sendingData":
... |
handler.py | import logging
import time
from collections import defaultdict
from queue import Queue
from threading import Thread
from kube_hunter.conf import get_config
from kube_hunter.core.types import ActiveHunter, HunterBase
from kube_hunter.core.events.types import Vulnerability, EventFilterBase, MultipleEventsContainer
logg... |
server_launcher.py | #!/usr/bin/python
import os
import shutil
import time
from conans import SERVER_CAPABILITIES
from conans.server.conf import get_server_store
from conans.server.crypto.jwt.jwt_credentials_manager import JWTCredentialsManager
from conans.server.crypto.jwt.jwt_updown_manager import JWTUpDownAuthManager
from conans.server... |
ffmpegtoOpenCV_RecordScreen_.py | # Python script to read video frames and timestamps using ffmpeg
import subprocess as sp
import threading
import matplotlib.pyplot as plt
import numpy
import cv2
ffmpeg_command = [ 'ffmpeg',
'-nostats', # do not print extra statistics
#'-debug_ts', # -debug_ts could provide time... |
main_window.py | import re
import os
import sys
import time
import datetime
import traceback
from decimal import Decimal
import threading
import electrum_dash
from electrum_dash.bitcoin import TYPE_ADDRESS
from electrum_dash import WalletStorage, Wallet
from electrum_dash_gui.kivy.i18n import _
from electrum_dash.paymentrequest import... |
__init__.py | from aplus import Promise
from futile.logging import LoggerMixin
from openmtc_server.Plugin import Plugin
from openmtc_etsi.exc import OpenMTCError
from gevent.server import DatagramServer, StreamServer
from openmtc_scl.platform.gevent.ServerRack import GEventServerRack
from openmtc_etsi.scl import CreateRequestIndicat... |
test_general.py | """
Collection of tests for unified general functions
"""
# global
import os
import math
import time
import einops
import pytest
from hypothesis import given, strategies as st
import threading
import numpy as np
from numbers import Number
from collections.abc import Sequence
import torch.multiprocessing as multiproces... |
CPUCore.py | import time
from threading import Thread, Lock
from DataStructures.Timer import Timer
class CPUCore:
def __init__(self, core_name):
self.core_name = core_name
self.task = None
self.executing_task_id = -1
self.idle_time = 0
self.idle_timer = Timer()
self.idle_timer... |
utils.py | #!/usr/bin/env python3
###############################################################################
# Module Imports
###############################################################################
import logging
import re
import time
import threading
import signal
import functools
import inspect
#################... |
runnerversion_cache.py | #!/usr/bin/env python3
from http.server import BaseHTTPRequestHandler, HTTPServer
import sys, logging, os, json, threading, requests, time, datetime
if os.environ.get('RVC_DEBUG'):
logging_level = logging.DEBUG
else:
logging_level = logging.INFO
logging.basicConfig(level=logging_level, format="%(asctime)s %(l... |
bot_runner.py | import logging
from multiprocessing import Process
import asyncio
import os
from pantsgrabbot import PantsGrabBot
from twitchio.ext import commands
import configparser
import nest_asyncio
nest_asyncio.apply()
class FollowingBot(commands.Bot):
follow_set = set()
processes = []
def __init__(self, channel,... |
dockerdaemon.py | from flask_pymongo import PyMongo, wrappers
from classes.daemon.daemon import Daemon
from classes.api.docker import DockerContainerAPI
from models.container import Container
from database import mongo
from util import deserialize_json, login_required, randomString, error, json_result
import threading, time
class Dock... |
client.py | #-------------Boilerplate Code Start-----
import socket
from tkinter import *
from threading import Thread
import random
from PIL import ImageTk, Image
screen_width = None
screen_height = None
SERVER = None
PORT = None
IP_ADDRESS = None
playerName = None
canvas1 = None
canvas2 = None
nameEntry = None
nameWindow = ... |
motor_encoder_assembly_test.py | import math
import sys
import threading, time
import serial
from PyQt5 import QtCore, QtGui, QtWidgets
from ui_motor_encoder_assembly_test import Ui_motor_encoder_assembly_test
class MotorEncoderAssemblyTest(Ui_motor_encoder_assembly_test):
def __init__(self):
super().__init__()
self.mobot = seria... |
14Sync Console.py | import pydrive
import shutil
import os
import time
from tkinter import Tk,TRUE,FALSE,Label,Frame,Button,COMMAND,Image,mainloop,PhotoImage,FLAT,TOP,LEFT,BOTH
from pydrive.auth import GoogleAuth
from pydrive.drive import GoogleDrive
from tkinter.filedialog import askdirectory
from threading import Thread
#clientno=the... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.