source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
trainingsetup.py | import pickle, os, logging
from numpy import zeros, zeros_like, sqrt
from multiprocessing import Manager, Process
from time import sleep
from __config__.filepath import INIT_DIR
from utils import make_shared, shared_zeros_like, Timeout, UserTimeoutError
class TrainingSetup():
"""
A semantic function... |
rsu_main_core.py | #!/usr/bin/env python
import random
import select
import sys
import threading
import time
from threading import Thread, Event, RLock
from Buffer import *
from Custom_Class import *
from DataManagerRx import rxd_platform_RSU
from User import User
from mcast4 import rxd_multicast, txd_multicast
from message_gen import m... |
runtime_manager_dialog.py | #!/usr/bin/env python
"""
Copyright (c) 2015, Nagoya University
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
... |
processing.py | import multiprocessing
from threading import Thread
from six.moves.queue import Queue, Empty
import math
import platform
import sys
# alternative: https://github.com/jreese/aiomultiprocess
def run_parallel(target, tasks, n_workers = None, use_processes = False):
"""
From James: https://github.com/nesp-tsr3-1/t... |
simulated_test_fixture.py | import threading
import argparse
import time
import os
import pytest
import software.python_bindings as tbots
from proto.import_all_protos import *
from pyqtgraph.Qt import QtCore, QtGui
from software.networking.threaded_unix_sender import ThreadedUnixSender
from software.simulated_tests.robot_enters_region import R... |
HID_UTILL.py | #!/usr/bin/python3
# C:\Work\Python\HID_Util\src\HID_UTILL.py
from binascii import hexlify
import sys
import argparse
import threading
from time import sleep
from time import process_time as timer
import tkinter as tk
from tkinter import ttk
import include_dll_path
import hid
# BOARD_TYPE_MAIN = 0,
# BOARD_TYPE_JO... |
modulo_serializar.py | # License: Released under MIT License
# Notice: Copyright (c) 2020 TytusDB Team
# Developer: Andree Avalos
import pickle
import threading
path = 'data/'
def commit(objeto, nombre):
try:
file = open(path+nombre+".bin","wb+")
file.write(pickle.dumps(objeto))
file.cl... |
pyminer.py | #!/usr/bin/python
#
# Copyright (c) 2011 The Bitcoin developers
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
import time
import json
import pprint
import hashlib
import struct
import re
import base64
import httplib
import... |
omsagent.py | #!/usr/bin/env python
#
# OmsAgentForLinux Extension
#
# Copyright 2015 Microsoft Corporation
#
# 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.... |
FindPrincess.py | """
Note:
To shut down the old tcpip process
sudo netstat -anp | grep 55000
sudo kill -9 <id>
"""
import pygame
import time
import socket
import random
from threading import Thread
from pygame.locals import *
import sys
sys.path.insert(0, './source')
from GameComponents import *
outData = 0
_debug = 1
_running = ... |
run_nvmf.py | #!/usr/bin/env python3
import os
import re
import sys
import json
import paramiko
import zipfile
import threading
import subprocess
import itertools
import time
import uuid
import rpc
import rpc.client
from common import *
class Server:
def __init__(self, name, username, password, mode, nic_ips, transport):
... |
test_submit_multithreaded.py | import cv2
import numpy as np
import pandas as pd
import threading
import queue
import tensorflow as tf
from tqdm import tqdm
import params
input_size = params.input_size
batch_size = params.batch_size
orig_width = params.orig_width
orig_height = params.orig_height
threshold = params.threshold
model = params.model_fa... |
main_threaded.py | import queue
import threading
from pathlib import Path
import cv2
import depthai
import numpy as np
from imutils.video import FPS
def cos_dist(a, b):
return np.dot(a, b) / (np.linalg.norm(a) * np.linalg.norm(b))
def frame_norm(frame, bbox):
return (np.array(bbox) * np.array([*frame.shape[:2], *frame.shape[... |
progress.py | """Implements an extended version of the multiprocessing.Pool object to allow progress reporting.
Using several subclasses and wrapper objects, this module injects data into the standard multiprocessing pool. So long
as the API for this does not change substantially, this module should work, and does not need to be up... |
main_only_chief.py | import sys, os
from multiprocessing import Process
idx = os.getcwd().index("{0}rl".format(os.sep))
PROJECT_HOME = os.getcwd()[:idx+1] + "rl{0}".format(os.sep)
sys.path.append(PROJECT_HOME)
import rl_main.utils as utils
from rl_main import rl_utils
if __name__ == "__main__":
utils.make_output_folders()
utils... |
Accompany.py | import threading
from ..Typing import *
from .traits import Sync
from .Delegate import Delegate
__all__ = ['Accompany', 'ThreadExit']
_cancel_sign = object()
class Accompany(Sync, Generic[T, TR, TE]):
"""
>>> from Redy.Async.Accompany import Accompany, Delegate, ThreadExit
>>> from Redy.Tools import Pa... |
test_thread.py | __author__ = 'zhyq'
import time
import threading
import os
import thread
def loop0():
print 'start loop0 ', time.ctime()
time.sleep(4)
print 'end loop ', time.ctime()
def loop1():
print 'start loop1 ', time.ctime()
time.sleep(2)
print 'end loop1 ', time.ctime()
def main():
print 'main st... |
RestClientWindow.py | #RestClientThreads.py
import requests
import json
import time
import threading
#TYPE: HNA-LAYER-2
#MODIFICATION: This file NEEDS TO BE MODIFIED
#-According to the layer, a different NUMBER_POA_SCENARIO is required
#DATE: 05-05-2020
#TO-DOs:
# -Testing not updated
"""
DESCRIPTION:
#Implements the window appro... |
server.py | # coding: utf-8
# -----------------------------------------------------------
# Threaded, Gevent and Prefork Servers
# -----------------------------------------------------------
import datetime
import errno
import logging
import os
import os.path
import platform
import random
import select
import signal
import socket... |
bookrank3.py | #!/usr/bin/env python
from atexit import register
from re import compile
from threading import Thread
from time import ctime
from urllib.request import urlopen as uopen
REGEX = compile(b'#([\d,]+) in Books ')
AMZN = 'http://amazon.com/dp/'
ISBNs = {
'0132269937': 'Core Python Programming',
'013235... |
detect_flood_radar.py | # -----------------------------------------------------------------------------
# Copyright * 2014, United States Government, as represented by the
# Administrator of the National Aeronautics and Space Administration. All
# rights reserved.
#
# The Crisis Mapping Toolkit (CMT) v1 platform is licensed under the Apache
#... |
utility.py | # coding=utf-8
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# -----------------------------------------------------... |
test_tmgr.py |
import os
import json
import pika
import time
import glob
import shutil
import pytest
from hypothesis import given, settings
import hypothesis.strategies as st
import threading as mt
import multiprocessing as mp
import radical.utils as ru
from radical.entk.execman.base import Base_TaskManager as Base... |
data_2.py | # Copyright 2016 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 applicab... |
__init__.py | # -*- coding: utf-8 -*-
'''
pytestsalt.utils
~~~~~~~~~~~~~~~~
Some pytest fixtures used in pytest-salt
'''
# Import Python libs
from __future__ import absolute_import
import os
import re
import sys
import json
import time
import errno
import atexit
import pprint
import signal
import socket
import logging
import subpr... |
sign.py | from player import *
from threading import Thread
from ecc.elliptic import inv,mulp,add
import time
elliptic_time = 0
broadcast_time = 0
random_number = 0
def broadcast(players):
#players = ComputePlayer.ComputeList
#print(players[0].rec_port, players[1].rec_port)
global broadcast_time
t_start = tim... |
train_ga.py | """
The code is inspired from "Deep Reinforcement Learning Hands-On" - Maxim Lapan
https://github.com/PacktPublishing/Deep-Reinforcement-Learning-Hands-On/blob/master/Chapter16/04_cheetah_ga.py
"""
#!/usr/bin/env python3
import os
import sys
import argparse
import collections
import copy
import time
import pickle
impor... |
run_all.py | # An example of how to run all the configuration files in the current directory, in parallel.
# Usage: python3 run_all.py
import logging
import random
import threading
import time
import queue
import glob
import os
import json
logging.basicConfig(level=logging.DEBUG,
format='(%(threadName)-10s) %(... |
ssrc_daemon.py | #!/usr/bin/env python3
"""
Copyright (c) 2019: Scott Atkins <scott@kins.dev>
(https://git.kins.dev/igrill-smoker)
License: MIT License
See the LICENSE file
"""
__author__ = "Scott Atkins"
__version__ = "1.4.0"
__license__ = "MIT"
import pigpio
import ... |
GUI.py | from PyQt5.QtWidgets import QMainWindow,QDialog,QFileDialog
from PyQt5.QtCore import pyqtSignal
from Classifier_ui import Ui_MainWindow
from threading import Thread
import pandas as pd
from EmotionClassifier import eAnalyse
from ScoreClassifier import sAnalyse
class Window(QMainWindow):
ui = Ui_MainWindow()#... |
test_datapipe.py | import http.server
import itertools
import os
import os.path
import pickle
import random
import socketserver
import sys
import tarfile
import tempfile
import threading
import time
import unittest
import warnings
import zipfile
from functools import partial
from typing import (
Any,
Awaitable,
Dict,
Gene... |
webcam_demo.py | import argparse
import time
from collections import deque
from operator import itemgetter
from threading import Thread
import cv2
import numpy as np
import torch
from mmcv.parallel import collate, scatter
from mmaction.apis import init_recognizer
from mmaction.datasets.pipelines import Compose
FONTFACE = cv2.FONT_HE... |
MicrosoftTeams.py | import demistomock as demisto
from CommonServerPython import *
from CommonServerUserPython import *
''' IMPORTS '''
import requests
from distutils.util import strtobool
from flask import Flask, request, Response
from gevent.pywsgi import WSGIServer
import jwt
import time
from threading import Thread
from typing import... |
env_player.py | # -*- coding: utf-8 -*-
"""This module defines a player class exposing the Open AI Gym API.
"""
from abc import ABC, abstractmethod, abstractproperty
from gym.core import Env # pyre-ignore
from queue import Queue
from threading import Thread
from typing import Any, Callable, List, Optional, Tuple
from poke_env.env... |
server.py | #!/usr/bin/env python3
import socket
import os
import sys
import traceback
import random
from threading import Thread
PORT = int(os.environ.get("PORT", 24000))
flag = open('flag', 'r').readline()
def client_thread(conn, ip, port, MAX_BUFFER_SIZE = 4096):
RANDOM_NUMBER = random.randint(0, 2 ** 32)
tries = 0
... |
main_window.py | import re
import os
import sys
import time
import datetime
import traceback
from decimal import Decimal
import threading
import electrum
from electrum.bitcoin import TYPE_ADDRESS
from electrum import WalletStorage, Wallet
from electrum_gui.kivy.i18n import _
from electrum.paymentrequest import InvoiceStore
from electr... |
test_client.py | from __future__ import annotations
import asyncio
import functools
import gc
import inspect
import logging
import os
import pickle
import random
import subprocess
import sys
import threading
import traceback
import types
import warnings
import weakref
import zipfile
from collections import deque
from collections.abc i... |
tcpros_service.py | # Software License Agreement (BSD License)
#
# Copyright (c) 2008, Willow Garage, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code must retain the above... |
SimVideo.py | import socket
import json
import cv2
import numpy as np
import threading, queue
import time
import signal
import sys
UDP_SIM_IP = "0.0.0.0"
UDP_SIM_PORT = 16000
UDP_SIM_PORT = 11750
FRAME_SIZE = 1100
HEADER_SIZE = 4
FPS = 30
imageQueue = queue.Queue()
img = None
run = True
def sigHandler(sig, frame):
global run... |
Utils.py | import datetime
import errno
import os
import sys
import time
import threading
import subprocess
class Utils(object):
@staticmethod
def Log(message):
print("\t" + message)
@staticmethod
def TLog(message):
timestamp = time.time()
timestamp_str = datetime.datetime.fromtimestam... |
connect_manager.py | #!/usr/bin/env python
# coding:utf-8
import os
import binascii
import time
import socket
import struct
import threading
import operator
import httplib
import socks
from xlog import getLogger
xlog = getLogger("gae_proxy")
current_path = os.path.dirname(os.path.abspath(__file__))
import OpenSSL
SSLError = OpenSSL.SS... |
labels.py | import hashlib
import requests
import threading
import json
import sys
import traceback
import base64
import electrum_ltc as electrum
from electrum_ltc.plugins import BasePlugin, hook
from electrum_ltc.i18n import _
class LabelsPlugin(BasePlugin):
def __init__(self, parent, config, name):
BasePlugin.__... |
Scheduler.py | # MIT License
#
# Copyright (c) 2019 Sam McCormack
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify,... |
cell.py | import os
import ssl
import time
import shutil
import socket
import asyncio
import logging
import tarfile
import argparse
import datetime
import platform
import functools
import contextlib
import multiprocessing
import tornado.web as t_web
import synapse.exc as s_exc
import synapse.common as s_common
import synapse.... |
pager.py | """
Pager implementation in Python.
"""
import asyncio
import sys
import threading
import weakref
from typing import Dict, List, Optional, Sequence, Tuple
from prompt_toolkit.application import Application
from prompt_toolkit.buffer import Buffer
from prompt_toolkit.completion import PathCompleter
from prompt_toolkit.... |
ads.py | import RPi.GPIO as GPIO
import os
import time
import threading
GPIO.setmode(GPIO.BCM)
GPIO.setup(23, GPIO.IN, pull_up_down=GPIO.PUD_UP)
GPIO.setup(24, GPIO.OUT)
GPIO.output(24, 1) # Turn off realy
os.system('killall -9 omxplayer.bin')
relay = 0 # realy turned off
timeout = 0
def movies():
"""Thread omxplayer ... |
app.py | # Create main app tkinter frame.
import config
from tkinter import *
from tkinter import ttk
from pathlib import Path
from tkinter import StringVar, messagebox
from selenium import webdriver
from TradeCenter import TradeEngine
from threading import Thread
from time import sleep
from selenium.webdriver.common.keys impo... |
explorer.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Provide the Explorer class used in the first step of RL algorithms
It consists to explore and collect samples in the environment using the policy. The samples are stored in the
given memory/storage unit which will be used to evaluate the policy, and then update its para... |
data_io.py | ##########################################################
# pytorch-kaldi v.0.1
# Mirco Ravanelli, Titouan Parcollet
# Mila, University of Montreal
# October 2018
##########################################################
import numpy as np
import sys
from utils import compute_cw_max, dict_fea_lab_arch, is_sequential... |
DataCollection.py | '''
Created on 21 Feb 2017
@author: jkiesele
'''
from DeepJetCore.TrainData import TrainData
from DeepJetCore.compiled.c_trainDataGenerator import trainDataGenerator
import tensorflow as tf
import tempfile
import pickle
import shutil
import os
import keras
import copy
import time
import logging
from DeepJetCore.sto... |
threaded_dispatch.py | #!/usr/bin/env python
import subprocess
import ConfigParser
from threading import Thread
from Queue import Queue
import time
"""
A threaded ssh based command dispatch system
"""
start = time.time()
queue = Queue()
def readConfig(file="config.ini"):
"""Extract IP addresses and CMDS from config file and returns tup... |
Client.py | from tkinter import *
import tkinter
import socket
from threading import Thread
from time import sleep
def enter(self):
global message_sent
message = my_message.get()
my_message.set("")
s.send(bytes(message, "utf8"))
message_sent = True
if message == "#quit":
s.close()
window.... |
pinger.py | import logging
import os
import threading
import time
from groundstation.models import Ping
from groundstation.utils import sendstate
class Pinger:
def __init__(self, host):
self.host = host
def start(self):
thread = threading.Thread(target=self.ping_forever)
thread.daemon = True
... |
cache.py | import time
from queue import Queue
from threading import Thread
from ctools.utils import LockContext, LockContextType
class Cache:
r"""
Overview:
data cache for reducing concurrent pressure, with timeout and full queue eject mechanism
Interface:
__init__, push_data, get_cached_data_iter,... |
mainwindow.py | # -*- coding: utf-8 -*-
#
# Copyright © Spyder Project Contributors
# Licensed under the terms of the MIT License
# (see spyder/__init__.py for details)
"""
Spyder, the Scientific PYthon Development EnviRonment
=====================================================
Developped and maintained by the Spyder Pro... |
load-data.py | #!/usr/bin/env python
# Copyright (c) 2012 Cloudera, Inc. All rights reserved.
#
# This script is used to load the proper datasets for the specified workloads. It loads
# all data via Hive except for parquet data which needs to be loaded via Impala.
# Most ddl commands are executed by Impala.
import collections
import ... |
13_lazy_connection.py | import threading
from socket import socket, AF_INET, SOCK_STREAM
from functools import partial
class LazyConnection:
def __init__(self, address, family=AF_INET, type_=SOCK_STREAM):
self.address = address
self.family = family
self.type = type_
self.local = threading.local()
def... |
tokenprotection.py | ##############################
# TokenGuard by ZaikoARG #
# All Rights Reserved :) #
##############################
# https://github.com/ZaikoARG | Discord: ZaikoARG#1187
import time
import threading
import psutil
import memory
import files
import psutil
import shared_variables
class TokenProtection():
... |
installwizard.py |
import os
import sys
import threading
import traceback
from PyQt5.QtCore import *
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *
from electrum.wallet import Wallet
from electrum.storage import WalletStorage
from electrum.util import UserCancelled, InvalidPassword
from electrum.base_wizard import BaseWizard,... |
mat_mult.py | # imports
import sys, time
from threading import Thread
import numpy as np
import pandas as pd
class mat_mult:
def __init__(self, matrix_a, matrix_b, pool_size):
""" Create a new point at the origin """
try:
self.pool_size = int(pool_size)
except ValueError:
print(V... |
main.py | import os
import threading
import time
import Queue
import cv2
import pygame
from PIL import Image
from util.HiloCaptura import WriterCaptura
from util.config import configuration
from util.images2gif import writeGif
from util.logger import clienteLog
# solo para emular el GPIO
if os.name == 'poxis':
import RPi.... |
test_client.py | import os
import pytest
import time
import sys
import logging
import threading
import _thread
import ray.util.client.server.server as ray_client_server
from ray.util.client.common import ClientObjectRef
from ray.util.client.ray_client_helpers import ray_start_client_server
@pytest.mark.skipif(sys.platform == "win32"... |
test_threading.py | try:
from builtins import object
except ImportError:
pass
import time
from threading import Thread
import logging
from transitions.extensions import MachineFactory
from .test_nesting import TestNestedTransitions as TestsNested
from .test_core import TestTransitions as TestCore
from .utils import Stuff, DummyM... |
pytorch_dist.py | #!/usr/bin/env python
import os
import torch
import torch.distributed as dist
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
import argparse
from math import ceil
from random import Random
from torch.multiprocessing import Process
from torch.autograd import Variable
from torchvision... |
Sentiment247.py | import tkinter as tk
from tkinter import ttk
from tkinter import filedialog
from tkinter import messagebox
from Extensions import loading, tooltip, hover
import threading
from Extensions import twitter
import validators
import socket
import sqlite3
import glob
from Extensions import vision, DepressionScore, Polarit... |
parser.py | import sublime, sublime_plugin
from http.server import BaseHTTPRequestHandler, HTTPServer
import json, _thread, threading
import platform, os, sys, time
TESTS_FILE_SUFFIX = '__tests'
totalProblems, problems_parsed, successful_problems = 1, 0, 0
settings = None
contest_name, contest_dir, working_dir, error, parse_in_vi... |
manager.py | #!/usr/bin/env python3
import datetime
import os
import signal
import subprocess
import sys
import traceback
from multiprocessing import Process
import cereal.messaging as messaging
import selfdrive.crash as crash
from common.basedir import BASEDIR
from common.params import Params, ParamKeyType
from common.text_window... |
example_test.py | from __future__ import unicode_literals
import os
import threading
import time
import serial
import ttfw_idf
from tiny_test_fw import Utility
class SerialThread(object):
'''
Connect to serial port and fake responses just like from a real modem
'''
# Dictionary for transforming received AT command t... |
simulation_loop.py | import threading
import time
class ThreadingExample(object):
""" Threading example class
The run() method will be started and it will run in the background
until the application exits.
"""
def __init__(self, refresh_interval=10):
""" Constructor
:type interval: int
:param ... |
testclient.py | import asyncio
import http
import inspect
import io
import json
import queue
import threading
import types
import typing
from urllib.parse import unquote, urljoin, urlsplit
import requests
from starlette.types import Message, Receive, Scope, Send
from starlette.websockets import WebSocketDisconnect
# Annotations for... |
plugin.py | import threading
from binascii import hexlify, unhexlify
from electrum_vtc.util import bfh, bh2u
from electrum_vtc.bitcoin import (b58_address_to_hash160, xpub_from_pubkey,
TYPE_ADDRESS, TYPE_SCRIPT,
is_segwit_address)
from electrum_vtc import constants
from... |
__init__.py |
from __future__ import print_function
import sys
import re
import threading
import os
import time
try:
from Tkinter import *
import tkFileDialog
import tkMessageBox
import tkSimpleDialog
import tkFont
except ImportError:
from tkinter import *
import tkinter.filedialog as tkFileDialog
... |
Display.py | from threading import Thread
import pygame
from Note import queue, get_note
pygame.init()
screenWidth, screenHeight = 300, 300
screen = pygame.display.set_mode((screenWidth, screenHeight))
clock = pygame.time.Clock()
#Colors
black = (0, 0, 0)
white = (255, 255, 255)
red = (200, 0, 0)
green = (0, 200, 0)
bright_red ... |
Highlime.py | import sublime
import sublime_plugin
import ast
import colorsys
import json
import os
import re
import threading
import time
PLUGIN_ACTIVATED = False
CHANGES_TO_CLEAR = ''
class HighlimePauseCommandListener(sublime_plugin.EventListener):
"""
Listener to stop the plugin when requested
"""
@staticmet... |
Data_Grabber.py | import os
import ccxt
import time
import datetime
import dash
from dash.dependencies import Input, Output, Event
import dash_core_components as dcc
import dash_html_components as html
import plotly.graph_objs as go
import threading
import dataset
from collections import deque
def ensure_dir(directory):
""""""
... |
netstats.py | import random
import os
import time
import argparse
from Queue import Empty
from multiprocessing import Process, Queue
import ioutils
from representations import sparse_io
from googlengrams.indexing import get_full_word_list
"""
Get statistics on PPMI network such as degrees and clustering coefficients.
"""
NAN = fl... |
ftp_camera.py | import glob
import os
from datetime import datetime, timedelta
import threading
import time
import pytz
class FtpCamera(object):
def __init__(
self,
logger,
camera_name,
ftp_upload_path,
image_file_path,
video_file_path,
ftp_purge_days,
image_timeout... |
utils.py | """
Lot of the code here is stolen from C-lightning's test suite. This is surely
Rusty Russell or Christian Decker who wrote most of this (I'd put some sats on
cdecker), so credits to them ! (MIT licensed)
"""
import bip32
import coincurve
import itertools
import json
import logging
import os
import re
import socket
im... |
client.py | import socket
import tkinter as tk
from json import dumps, loads
from threading import Thread
from os import system, name
from time import sleep
system("")
def clear():
system("cls" if name == 'nt' else "clear")
host, port = 'localhost', 8500
socket = socket.socket(socket.AF_INET, socket.S... |
interface_rpc.py | #!/usr/bin/env python3
# Copyright (c) 2018-2020 The Picacoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Tests some generic aspects of the RPC interface."""
import os
from test_framework.authproxy import JS... |
api_test.py | import base64
import datetime
import json
import io
import os
import re
import shutil
import socket
import tempfile
import threading
import time
import unittest
import docker
from docker.api import APIClient
import requests
from requests.packages import urllib3
import six
from . import fake_api
import pytest
try:
... |
go_tool.py | import argparse
import copy
import json
import os
import shutil
import subprocess
import sys
import tempfile
import threading
arc_project_prefix = 'a.yandex-team.ru/'
std_lib_prefix = 'contrib/go/_std/src/'
vendor_prefix = 'vendor/'
def compare_versions(version1, version2):
v1 = tuple(str(int(x)).zfill(8) for x ... |
CameraController.py | import time
import rospy
import picamera
from rospy import Service
from std_srvs.srv import (Empty, EmptyRequest, EmptyResponse)
import threading
class CameraController:
# Operational variable
__camera = None
# Predefined variables
__is_recording: bool = False
__start_recording_service: S... |
server-threaded.py | import socket
import threading
def handle_client(c, addr):
print(addr, "connected.")
while True:
data = c.recv(1024)
if not data:
break
c.sendall(data)
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
s.bind(("0.0.0.0", 1234))
s.listen()
while Tru... |
server.py | #import all needed packages
#for serial port
import serial
#for dcd hub interaction
from dcd.entities.thing import Thing
from dcd.entities.property import PropertyType
from dotenv import load_dotenv
import os
# for site and websocket
from flask import Flask, request, render_template
from flask_socketio import SocketI... |
irc_mirror_backend.py | import irc.bot
import irc.strings
from irc.client import ip_numstr_to_quad, ip_quad_to_numstr, Event, ServerConnection
from irc.client_aio import AioReactor
import multiprocessing as mp
from typing import Any, Dict
class IRCBot(irc.bot.SingleServerIRCBot):
reactor_class = AioReactor
def __init__(self, zulip_... |
sanitylib.py | #!/usr/bin/env python3
# vim: set syntax=python ts=4 :
#
# Copyright (c) 2018 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import os
import contextlib
import string
import mmap
import sys
import re
import subprocess
import select
import shutil
import shlex
import signal
import threading
import concurrent.fu... |
main.py | #!/usr/bin/env python
import time
import os
import random
import threading
import argparse
import matplotlib.pyplot as plt
import numpy as np
import scipy as sc
import cv2
from collections import namedtuple
import torch
from torch.autograd import Variable
from robot import Robot
from trainer import Trainer
from logger... |
testsuite.py | """
Commands for activating the test environment
"""
import sys
import os
import json
from zipfile import ZipFile
import multiprocessing
from livereload import Server
import click
import requests
from scintillant import addons_versions
def create_snlt():
with open(os.getcwd() + '/.snlt', 'w+') as snlt:
... |
dense_slam_gui.py | # ----------------------------------------------------------------------------
# - Open3D: www.open3d.org -
# ----------------------------------------------------------------------------
# The MIT License (MIT)
#
# Copyright (c) 2018-2021 www.open3d.org
#
# Permission i... |
utils.py | from __future__ import print_function
import colorsys
import json
import math
import os
import pickle
import platform
import numpy as np
import pybullet as p
import random
import sys
import time
import datetime
from collections import defaultdict, deque, namedtuple
from itertools import product, combinations, count
f... |
loading_animation.py | import webview
import threading
"""
This example demonstrates a simple loading animation workflow
"""
def load_html():
webview.load_html("""
<style>
body {
background-color: #333;
color: white;
font-family: Helvetica Neue, Helvetica, Arial, sans-serif;
}
... |
components.py | import numpy as np
import cv2
import g2o
from threading import Lock, Thread
from queue import Queue
from enum import Enum
from collections import defaultdict
from .covisibility import GraphKeyFrame
from .covisibility import GraphMapPoint
from .covisibility import GraphMeasurement
class Camera(object):
def __... |
main.py | import web,socket,time,Adafruit_ADS1x15,tempvar
from web import form
import RPi.GPIO as GPIO
from threading import Thread
import threading
localhost = "http://" + socket.gethostbyname(socket.gethostname()) + ":8080"
print(localhost)
global infrared, ultrasonic, servomotor, motor_L1, motor_L2, motor_R1, motor_R2,... |
minion.py | # -*- coding: utf-8 -*-
'''
Routines to set up a minion
'''
# Import python libs
from __future__ import absolute_import, print_function, with_statement
import os
import re
import sys
import copy
import time
import types
import signal
import fnmatch
import logging
import threading
import traceback
import contextlib
impo... |
custom.py | # pylint: disable=too-many-lines
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# -----------------------------------... |
server.py | import lib.MyUtils as MyUtils
import socket
import random
import threading
def client_handler(conn, address):
while True:
try:
raw_data = conn.recv(1024)
split_data = MyUtils.MessageHandler(raw_data).message_loads()
print(split_data)
operation = split_data[0... |
proxy.py | #coding= utf-8
import socket, sys, traceback, threading, time, select
MAX_HEADER_SIZE = 4096
RECV_SIZE = 512
def getHeader(string, name):
string = string.lower()
name = name.lower()
base, i, l = 0, 0, len(string)
while i<l:
# 根据约定,空行代表头的结束
if string[i] == "\r" and i<l-1 and string[i+1... |
task4_client.py | import argparse
import os
import socket
import threading
import time
parser = argparse.ArgumentParser(description='Сервер для задачи №4')
parser.add_argument('--host', help='IP хоста', default='localhost')
parser.add_argument('--port', help='Порт хоста', default=8888)
parser.add_argument('--uname', help='Имя пользоват... |
command_server.py | #!/usr/bin/python
import socket
import serial
import sys
import time
import re
import os
import random
import datetime
from threading import Thread, Lock
MSG_LENGTH = 14
LOG_FILE = "/var/log/pipool/command_server_error.log"
def logger(string):
log_file = open(LOG_FILE, 'a')
log_file.write(datetime.datetime.now()... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.