source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
main.py | import os
import cv2
import argparse
import threading
import time
from client import Client
from message import MessageId, HelloMsg, StopMsg
from camera_msg import *
from image_msg import *
from move_msg import *
from camera_prop_msg import *
from chassis import Chassis
cameras = dict()
cameras_dict_lock = threading... |
sample_thread_globals.py | # Thread function with globals
import threading
import time
def threaded_func():
time.sleep(1)
print(globalVar)
globalVar = "Global Variable"
threading.Thread(target=threaded_func).start()
|
connections.py | """PyLabware connection adapters."""
import logging
import socket
import sys
import threading
from abc import ABC, abstractmethod
from time import sleep, time
from urllib.parse import urljoin
from typing import Any, Dict
import requests
import serial
from .exceptions import PLConnectionError, PLConnectionProtocolErr... |
InteractiveRecognizer.py | import numpy
import cv2
import os
import sys
import threading
import wx
import BinasciiUtils
import ResizeUtils
import WxUtils
class InteractiveRecognizer(wx.Frame):
def __init__(self, recognizerPath, cascadePath,
scaleFactor=1.3, minNeighbors=4,
minSizeProportional=(0.25, 0.25... |
core.py | # Copyright 2021 DeepMind Technologies Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... |
test_flight.py | # -*- coding: utf-8 -*-
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "... |
environment.py | #!/usr/bin/env python3
import threading
import serial
import argparse
import time
from influxdb_client import InfluxDBClient, Point
from influxdb_client.client.write_api import ASYNCHRONOUS
import logging
import datetime
from dateutil import tz
from pathlib import Path
import queue
import serial.tools.list_ports
# thr... |
01_hello_world.py | #!/usr/bin/env python2.7
from threading import Thread
import time
import WonderPy.core.wwMain
from WonderPy.core.wwConstants import WWRobotConstants
from WonderPy.components.wwMedia import WWMedia
"""
This example shows connecting to the robot and issuing some simple commands.
See the other 'tutorial' and 'misc' ex... |
firehose.py | #!/usr/bin/python3
# -*- coding: utf-8 -*-
# (c) B.Kerler 2018-2019
import binascii
import io
import platform
import time
import json
from struct import unpack
from binascii import hexlify
from queue import Queue
from threading import Thread
from edlclient.Library.utils import *
from edlclient.Library.gpt import gpt
f... |
emails.py | # -*- coding: utf-8 -*-
"""
:author: Allan
:copyright: ยฉ 2020 Yalun Hu <allancodeman@163.com>
:license: MIT, see LICENSE for more details.
"""
from threading import Thread
from flask import url_for, current_app
from flask_mail import Message
from algorithmic.extensions import mail
def _send_async_mail(a... |
async_executor.py | import logging
from threading import Event, Lock, RLock, Thread
logger = logging.getLogger(__name__)
class CriticalTask(object):
"""Represents a critical task in a background process that we either need to cancel or get the result of.
Fields of this object may be accessed only when holding a lock on it. To ... |
python_ws_client.py | from Socket_setting import Socket_setting
from MongoDB import MongoDB
from Fast_naive_bayes import Naive_Bayes
import requests
from flask import jsonify
import pdb
import pprint
import datetime, threading, time
# from Client_Scheduling import Client_Secheduler
class python_ws_client(object):
def __init__(self, mon... |
cinderlm_check.py | #
# (c) Copyright 2015,2016 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017 SUSE LLC
#
# 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-... |
runner.py | #!/usr/bin/env python3
# Copyright 2020 Google LLC
#
# 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... |
client.py | from Communicator import Communicator
import socket,sys,json,os,time,pdb
import math
from Game import Game
from Board import Board
import argparse
class Client(Communicator):
def __init__(self):
self.GAME_TIMER = 100000 # in Milli Seconds
self.NETWORK_TIMER = 150
super(Client,self).__init__()
pass
def set... |
player.py | import datetime
import gzip
import json
import logging
import pathlib
import time
from threading import Thread
from mokaplayer.core.helpers.event import Event
from mokaplayer.core.keyboard import KeyboardClient
from mokaplayer.core.library import Library
from mokaplayer.core.queue import Queue
from mokaplayer.core.str... |
client.py | from pprint import pprint
# coding=utf-8
import configparser
from tabulate import tabulate
import multiprocessing as mp
from selenium import webdriver
import hashlib
import hmac
import requests
import time
from operator import itemgetter
from .helpers import date_to_milliseconds, interval_to_milliseconds
from .exceptio... |
app.py | """ Main Kivy application """
import asyncio
import os
from logging import getLogger
from threading import Thread
from sys import platform as _platform
from tesseractXplore.settings import read_settings
# Set GL backend before any kivy modules are imported
os.environ['KIVY_GL_BACKEND'] = 'sdl2'
# Set Textprovider bac... |
multiprocessing.py |
import time
import traceback
import pickle
import inspect
import collections.abc
from itertools import islice
from multiprocessing import current_process, Process, Queue
from threading import Thread
from typing import Iterable, Any, List, Optional
from coba.pipes.core import Pipe, Foreach
from coba.pipes.primi... |
sync_manager.py | # -*- coding: utf-8 -*-
from fnmatch import fnmatch
import os
import sys
import requests
import shutil
import sublime
import threading
import time
from .libs import path, settings
from .libs.logger import logger
if sys.version_info < (3,):
from Queue import Queue
else:
from queue import Queue
def get_conte... |
__init__.py | import os
import base64
import mimetypes
import time
import threading
import inspect
import asyncio
mimetypes.init()
MONITORS = {}
def base_directory():
frame = inspect.stack()[2]
module = inspect.getmodule(frame[0])
if module is None:
return os.getcwd()
return os.path.abspath(os.path.dirnam... |
main.py | import pygame
import threading
import time
from utility import button,draw_board_vals,draw_moves,draw_timer
from solver import solver
from generator import sudoku_gen
from random import randrange
pygame.init()
width,height=450,450
win=pygame.display.set_mode((width,height+100))
pygame.display.set_captio... |
refactor.py | # Copyright 2006 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Refactoring framework.
Used as a main program, this can refactor any number of files and/or
recursively descend down directories. Imported as a module, this
provides infrastructure to write your own refactoring too... |
dataset.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.utils import xyxy2xywh, xywh2xyxy
import xml... |
throttler.py | # -*- coding: utf-8 -*-
# Copyright 2016-2021 CERN
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... |
Thread_Server.py | import numpy as np
import cv2
import socket
import pickle
import struct
from Recognize import *
import threading
import ClientHandler
import connUtils
import sys
import os
import time
import matplotlib.pyplot as plt
from Train import *
def quit(command):
sckt = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
... |
lyr_twinkle.py | #!/usr/bin/python
import pxlBuffer as pxb
import random
from time import sleep
import time
def wheel(pos, brightness):
"""Generate rainbow colors across 0-255 positions."""
if pos < 85:
return pxb.Color(pos * 3 * brightness, (255 - pos * 3) * brightness, 0)
elif pos < 170:
... |
cts_utils.py | #!/usr/bin/env python
# Copyright 2020 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.
"""Stage the Chromium checkout to update CTS test version."""
import contextlib
import json
import os
import re
import sys
import tempf... |
__init__.py | # -*- coding: utf-8 -*-
"""
Set up the Salt integration test suite
"""
from __future__ import absolute_import, print_function
import atexit
import copy
import errno
import logging
import multiprocessing
import os
import pprint
import re
import shutil
import signal
import socket
import stat
import subprocess
import sy... |
threads.py | import uwsgi
import threading
import time
import sys
def monitor1():
while 1:
time.sleep(1)
print("i am the monitor 1")
def monitor2():
while 1:
time.sleep(2)
print("i am the monitor 2")
print(sys.modules)
def monitor3():
while 1:
time.sleep(5)
print("5 seconds elapsed")
#reload(fake)
def spa... |
test_cache.py | from nutils import *
from . import *
import sys, contextlib, tempfile, pathlib, threading
@contextlib.contextmanager
def tmpcache():
with tempfile.TemporaryDirectory() as tmpdir:
with cache.enable(tmpdir):
yield pathlib.Path(tmpdir)
class refcount(TestCase):
def setUp(self):
self.x = object()
s... |
webstreaming.py | ## USAGE
# python webstreaming.py --ip 192.168.29.251 --port 8000
# import the necessary packages
# from pyimagesearch.motion_detection import SingleMotionDetector
from imutils.video import VideoStream
from flask import Response
from flask import Flask
from flask import render_template
import threading
import argparse... |
socket_client.py | from re import T
from socket import AF_INET, SOCK_STREAM, socket
from threading import Thread
HOST = "127.0.1.1"
PORT = 8050
client = socket(AF_INET, SOCK_STREAM)
client.connect((HOST, PORT))
def handle_messages():
while True:
msg = client.recv(1024).decode()
splited_message = msg.split("=")
... |
server.py | from __future__ import print_function
import socket
import threading
import socketserver as SocketServer
import audio
import pyaudio
import queue
import time
class SoundHandler(SocketServer.StreamRequestHandler):
def __init__(self,*args):
print("Starting the audio channel for ",*args)
self.lock =... |
test_bigquery.py | import unittest
import os
import json
from unittest.mock import patch
import threading
from test.support import EnvironmentVarGuard
from urllib.parse import urlparse
from http.server import BaseHTTPRequestHandler, HTTPServer
from google.cloud import bigquery
from google.auth.exceptions import DefaultCredentialsError
... |
system.py | from threading import Thread
from functools import wraps
import subprocess
import os
import datetime
import smtplib
from flask import flash
from html.parser import HTMLParser
import ipaddress
import json
import secrets
import logging
from globals import globalvars
from classes.shared import db
from classes import set... |
wxPlot.py | """
This demo demonstrates how to draw a dynamic mpl (matplotlib)
plot in a wxPython application.
It allows "live" plotting as well as manual zooming to specific
regions.
Both X and Y axes allow "auto" or "manual" settings. For Y, auto
mode sets the scaling of the graph to see all the data points.
For X, auto m... |
camera.py | '''
The MIT License (MIT)
Copyright (c) 2015 Thami Rusdi Agus - https://github.com/janglapuk/SPB-OpenCV-Recognizer
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 w... |
principal.py | """
MIT License
Copyright (c) 2021 Standby
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, merge, publish, distr... |
mt_download.py | import requests
import threading
import datetime
def Handler(start, end, url, filename):
headers = {'Range': 'bytes=%d-%d' % (start, end)}
r = requests.get(url, headers=headers, stream=True)
# ๅๅ
ฅๆไปถๅฏนๅบไฝ็ฝฎ
with open(filename, "r+b") as fp:
fp.seek(start)
var = fp.tell()
fp.write(... |
polybeast_learner.py | # Copyright (c) Facebook, Inc. and its affiliates.
#
# 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 ... |
GA-python-Gray-7.py | """
ๆนๅไธบๆ ผ้ท็ ็็ผ็ ๆนๅผ.
ไปไฝฟ็จๆๅฐๅผ.
"""
import numpy as np
import matplotlib.pyplot as plt
import copy as cp
def functiontt(x):
"""
:param x: ่ชๅ้
:return: y: ๅฝๆฐๅผ
"""
return abs(0.2 * x) + 10 * np.sin(5 * x) + 7 * np.cos(4 * x)
#10 + np.sin(1/x)/((x - 0.16)**2+0.1)
# -(x+10*n... |
revocation_notifier.py | '''
SPDX-License-Identifier: Apache-2.0
Copyright 2017 Massachusetts Institute of Technology.
'''
from multiprocessing import Process
import threading
import functools
import time
import os
import sys
import signal
import simplejson as json
import zmq
from keylime import config
from keylime import crypto
from keylim... |
sequence_extraction.py | #!/usr/bin/env python3
import os
import glob
import time
import random
import logging
import numpy as np
from tqdm import tqdm
import multiprocessing as mp
from statsmodels import robust
from scipy.stats import kurtosis, skew
from deepmp import utils as ut
from deepmp.fast5 import Fast5
from deepmp import combined_ext... |
testutil.py | # Copyright 2022 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
import os
from contextlib import contextmanager
from dataclasses import dataclass
from threading import Thread
from typing import BinaryIO
from pylsp_jsonrpc.endpoint import Endpoint # ty... |
multiprocessing_test.py | from multiprocessing import Process
import os
def run_proc(name):
print('Run child process $s (%s)...' % (name ,os.getpid()))
if __name__ == '__main__':
print('Parent process %s .' % os.getpid())
p=Process(target=run_proc,args=('test',))
print('Child process will start.')
p.start()
p.join()
... |
assistant_library_with_button_demo.py | #!/usr/bin/env python3
# Copyright 2017 Google 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... |
kb_eggnog_mapperServer.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... |
netmiko_cfg.py | #!/usr/bin/env python
"""Return output from single show cmd using Netmiko."""
from __future__ import print_function
from __future__ import unicode_literals
import argparse
import sys
import os
import subprocess
import threading
try:
from Queue import Queue
except ImportError:
from queue import Queue
from date... |
main.py | import logging
import re
import time
from copy import deepcopy
from enum import Enum
from typing import List, Optional
from datetime import datetime
import threading
import traceback
import html
import json
import peewee
import telegram.error
from telegram import Update, InlineKeyboardMarkup, InlineKeyboardButton, Bot... |
__init__.py | import logging
import threading
import time
from functools import wraps
from typing import Optional
from platypush.bus import Bus
from platypush.common import ExtensionWithManifest
from platypush.event import EventGenerator
from platypush.message.response import Response
from platypush.utils import get_decorators, ge... |
main.py | from event_queue import *
from prescription_manager import PrescriptionManager
from inventory_manager import InventoryManager
from timer import *
from notifier import Notifier
from time import sleep
from anomaly import Anomaly
import getpass
from threading import Lock, Thread
import tkinter
class Main:
def main(... |
arclinkproxy.py | #!/usr/bin/env python
import os
import sys
import time
import socket
import signal
import select
import datetime
import threading
import SocketServer
import cPickle
from optparse import OptionParser
from xml.etree import cElementTree as ET
from shutil import copyfileobj
from tempfile import TemporaryFile
from seiscomp... |
integrationtest_plugin.py | # -*- coding: utf-8 -*-
#
# This file is part of PyBuilder
#
# Copyright 2011-2015 PyBuilder Team
#
# 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/l... |
test_robot_thread.py | # Execute Mirobot Homing parallelly using Threading
import r2 as rem
import time
import threading
bot1 = rem.remote_control()
bot2 = rem.remote_control()
Flag_robot_one_finished = False
Flag_robot_two_finished = False
def moveRobot_one():
Flag_robot_one_finished = False
print("starting Robot 1")
move_st... |
Animate.py | import itertools, threading, sys, time
class Animate:
def __init__(self):
self.run = False
self.t = None
def start(self, message):
self.run = True
self.t = threading.Thread(target = self.animate, args = [message])
self.t.start()
def animate(self, message):
for c in itertools.cycle(['|', '/', '-', '\\'... |
test_notification_manager.py | import sys
import threading
import warnings
from typing import List
import pytest
from napari._tests.utils import DEFAULT_TIMEOUT_SECS
from napari.utils.notifications import (
Notification,
notification_manager,
show_error,
show_info,
show_warning,
)
# capsys fixture comes from pytest
# https://... |
qt.py | #!/usr/bin/env python3
#
# Cash Shuffle - CoinJoin for Bitcoin Cash
# Copyright (C) 2018-2019 Electron Cash LLC
#
# 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,
# includ... |
uriresolver.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# ____________developed by paco andres____________________
# All data defined in json configuration are attributes in your code object
import time
from node.libs import control, utils
import Pyro4
import Pyro4.naming as nm
from termcolor import colored
import threading
imp... |
rotaboxer.py | # coding=utf-8
'''
kivy 2.0.0
ROTABOXER
______________________________________________________________________________
Rotaboxer is an editing tool for the Rotabox bounds*.
With an image as input, the user can visually shape specific colliding... |
sse.py | import sseclient
import threading
class SSEReceiver():
def __init__(self,url,callback = None, logger = None):
"""
Args:
url [string] the full url like 'http://127.0.0.1:6001/event/stream
callback: the function to be called on event, it should take one argument (... |
blockly_tool.py | #!/usr/bin/env python3
# Software License Agreement (BSD License)
#
# Copyright (c) 2019, UFACTORY, Inc.
# All rights reserved.
#
# Author: Vinman <vinman.wen@ufactory.cc> <vinman.cub@gmail.com>
try:
import xml.etree.cElementTree as ET
except ImportError:
import xml.etree.ElementTree as ET
import re
import sys
imp... |
networks_tensorflow.py | import tensorflow as tf
import numpy as np
import argparse
import os
import sys
import json
import glob
import random
import collections
import math
import time
import threading
import scipy
from PIL import Image
import time
# from selu_utils import selu, dropout_selu
EPS = 1e-12
LR_RANGE_LIM = 50.0 # the max for the ... |
run.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
fMRI preprocessing workflow
=====
"""
import os
import os.path as op
from pathlib import Path
import logging
import sys
import gc
import re
import uuid
import json
import tempfile
import psutil
import warnings
import subprocess
from argparse import ArgumentParser
from... |
mycobot_topics_pi.py | #!/usr/bin/env python2
import time
import os
import sys
import signal
import threading
import rospy
from mycobot_communication.msg import (
MycobotAngles,
MycobotCoords,
MycobotSetAngles,
MycobotSetCoords,
MycobotGripperStatus,
MycobotPumpStatus,
)
from pymycobot import MyCobotSocket
clas... |
common_video.py | # coding=utf-8
# Copyright 2018 The Tensor2Tensor 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 applicable... |
portscanner.py | # Script Name : portscanner.py
# Author : Craig Richards
# Created : 20 May 2013
# Last Modified :
# Version : 1.0
# Modifications :
# Description : Port Scanner, you just pass the host and the ports
import optparse # Import the module
from socket import * # Import the module
from threading import * # Imp... |
tuq_monitoring.py | import json
import logging
import threading
import time
from remote.remote_util import RemoteMachineShellConnection
from .tuq import QueryTests
class QueryMonitoringTests(QueryTests):
def setUp(self):
super(QueryMonitoringTests, self).setUp()
self.threadFailure = False
self.run_cbq_query... |
bot_jira_track_schedule.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# -*- encoding: utf-8 -*-
#
# Copyright (c) 2020 anqi.huang@outlook.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 a copy of the License at
#
# http://www.apach... |
logevent_ocs.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# +
# import(s)
# -
import threading
import time
from OcsLogger import *
from SALPY_ocs import *
# +
# __doc__ string
# -
__doc__ = """Event logger for events in the OCS"""
# +
# dunder string(s)
# -
__author__ = "Philip N. Daly"
__copyright__ = u"\N{COPYRIGHT SIGN} AU... |
tests.py | # -*- coding: utf-8 -*-
# Unit tests for cache framework
# Uses whatever cache backend is set in the test settings file.
from __future__ import unicode_literals
import os
import re
import copy
import shutil
import tempfile
import threading
import time
import unittest
import warnings
from django.conf import settings
... |
crs.py | #!/usr/bin/env python3
import shutil
import yaml
import pickle
import os
import tarfile
import logging
import glob
import time
import shlex
import threading
import subprocess
from datetime import datetime
import requests
API_TOKEN = open("api_token.txt").read().strip()
CACHE_DIR = "cache"
COMP_DIR = "competitions"
A... |
Server.py | import ServerConfig
import SocketQ
import AR_Socket
from multiprocessing import Process
from packet_constants import *
import numpy as np
# ์ ๊ฒฝ๋ง ๋ก๋ ํจ์
def init_NNs(socketQ, config):
procs = []
# FastPose ์ ๊ฒฝ๋ง ์์
if config.UseFastPose:
# ๋ฐ์ดํฐ ์์ผ ์ ์ก ํ๋ก์ธ์ค ์์ฑ ๋ฐ ์์
import FastPose.Server_FastPose... |
process.py | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import argparse
import os
import tempfile
import subprocess
import tensorflow as tf
import numpy as np
import tfimage as im
import threading
import time
import multiprocessing
from size import IMAGE_SIZE
edge... |
test_dada_fildb.py | import os
import unittest
import time
import multiprocessing as mp
import numpy as np
from psrdada import Reader, Writer
from dada_fildb import dada_fildb
from dada_fildb.sigproc import SigprocFile
class TestDadaFildb(unittest.TestCase):
def setUp(self):
"""
Set configuration, create filterbank... |
heartbeat.py | import logging
import multiprocessing
import os
import time
import swf.exceptions
from simpleflow._decorators import deprecated
from simpleflow.utils import retry
logger = logging.getLogger(__name__)
__all__ = ['Heartbeater', 'HeartbeatProcess']
@deprecated
class HeartbeatProcess(object): # Are people using it?
... |
server.py | # you can test the server by running
# nc <host> <port>
# <any number>
from socket import *
from threading import Thread
from concurrent.futures import ProcessPoolExecutor
from config import HOST, PORT
pool = ProcessPoolExecutor(5)
def fib_server(address):
sock = socket(AF_INET, SOCK_STREAM)
sock.setsockopt... |
thermald.py | #!/usr/bin/env python3
import datetime
import os
import queue
import threading
import time
from collections import OrderedDict, namedtuple
from pathlib import Path
from typing import Dict, Optional, Tuple
import psutil
import cereal.messaging as messaging
from cereal import log
from common.dict_helpers import strip_d... |
plot.py | from typing import Callable, Union, Any
import multiprocessing as mp
from copy import copy
import tkinter
from itertools import accumulate
import numpy as np
from matplotlib import pyplot as plt, lines
from matplotlib.ticker import StrMethodFormatter
from casadi import Callback, nlpsol_out, nlpsol_n_out, Sparsity, DM
... |
boleto-reader.py | #!/usr/bin/python3
import os
import sys
import subprocess
import random
import threading
import tkinter as tk
from tkinter import messagebox
token = random.randint(1, 65535)
temp_img = 'boleto-reader-' + str(token) + ".png"
if sys.platform == 'win32':
from PIL import ImageGrab
temp_img_path = os.getenv('TEM... |
distribute_coordinator_test.py | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
test_httplib.py | import errno
from http import client
import io
import itertools
import os
import array
import re
import socket
import threading
import unittest
TestCase = unittest.TestCase
from test import support
here = os.path.dirname(__file__)
# Self-signed cert file for 'localhost'
CERT_localhost = os.path.join(here, 'keycert.p... |
ironpython_agent.py | import json
import struct
import base64
import subprocess
import random
import time
import datetime
import os
import sys
import zlib
import threading
import http.server
import zipfile
import io
import types
import re
import shutil
import socket
import math
import stat
import numbers
from os.path import expanduser
from ... |
tensorflow_profiler.py | # Copyright 2019 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.py | #!/usr/bin/env python3
import time
import urllib
import urllib.request
import sys
from multiprocessing import Process
n = 1000
k = int(sys.argv[1])
def send_req():
req = urllib.request.Request('http://localhost:8080/new/easy/3/100', data=b"")
req.add_header("X-Client-ID", "myclient")
rsp = urllib.request.... |
main_window.py | #!/usr/bin/env python
#
# Electrum - lightweight Chipo client
# Copyright (C) 2012 thomasv@gitorious
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation files
# (the "Software"), to deal in the Software without restriction,
# including without... |
SQLInjectionScanner_dev.py | import lib.spider.SpiderNew
import lib.spider.Spider
import lib.config
import re
import requests
import difflib
import Queue
import threading
import json
import time
import os
import subprocess
# TEST FEATURE:
# Don't modify this if you didn't read the source.
# May cause depression, physical harm and death.
# SHOULD... |
rcnn_demo_kaggle_0.py |
from rcnn_demo_kaggle import *
if __name__ == "__main__":
predict_for_stage(0)
print category_count
'''
for i in range(5):
#thread.start_new_thread(predict_for_stage,(i,))
my_thread = threading.Thread(target = predict_for_stage,args=(i,))
my_thread.start()
''' |
cnn_layer2_multi.py | #!/usr/bin/python
"""Module CNN layer 2 hyperparameter optimization evaluation for Multiple GPUs.
A Convolutional Network implementation example using TensorFlow library.
This example is using the MNIST database of handwritten digits
(http://yann.lecun.com/exdb/mnist/)
Author: Aymeric Damien
Project: https://github.c... |
cli.py | # -*- coding: utf-8 -*-
import configparser
import random
import sys
import time
try:
from importlib.metadata import version
except ImportError:
# We're running a Python < 3.8
from importlib_metadata import version
from pathlib import Path
from threading import Thread
from urllib.parse import urlparse
impo... |
test_using_context_manager.py | from threading import Thread
from unittest import TestCase, main
from expects import expect, be_false, be_true
from twin_sister import dependency, dependency_context
from twin_sister.injection.singleton_class import SingletonClass
class Canary:
def __init__(self):
self.touched = False
def touch(sel... |
serve.py | # -*- coding: utf-8 -*-
import argparse
import json
import logging
import os
import signal
import socket
import sys
import threading
import time
import urllib2
import uuid
from collections import defaultdict
from multiprocessing import Process, Event
repo_root = os.path.abspath(os.path.split(__file__)[0])
sys.path.i... |
latency.py | from threading import Thread, Event, Timer
from pings import Ping
from modules.ping_result import PingResult
class Latency(Thread):
def __init__(self, ping_hosts, interval):
self.MIN_INTERVAL = 20
self.ping_hosts = ping_hosts
self.interval = interval
self.ping_results = {}
s... |
ncc_transaction_receipt_origin_contract_address.py | #!/usr/bin/env python3
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import *
from test_framework.script import *
from test_framework.mininode import *
from test_framework.address import *
import threading
def waitforlogs(node, contract_address):
logs = node.cli.waitforlo... |
main.py | """
mlperf inference benchmarking tool
"""
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import argparse
import array
import collections
import json
import logging
import os
import sys
import threading
import time
from queue import Queue
import mlperf_l... |
wrapper.py | #!/usr/bin/env python
# @@@ START COPYRIGHT @@@
#
# 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 Li... |
PiStreamAndButton.py | # import the necessary packages
from picamera.array import PiRGBArray
from picamera import PiCamera
from threading import Thread
import modules.PiButton
import cv2
class PiStreamAndButton:
def __init__(self, resolution=(320, 240), framerate=20, channel=37):
# initialize the camera and stream
self.camera = PiCamer... |
controller.py | # Electron Cash - lightweight Bitcoin client
# Copyright (C) 2019 Axel Gembe <derago@gmail.com>
#
# 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 limi... |
__init__.py | # The MIT License (MIT)
#
# Copyright (c) 2014 Richard Moore
#
# 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, mod... |
core.py | from __future__ import annotations
import multiprocessing
from multiprocessing import Queue
import threading
from typing import Type, Union
from fredo.conf import PLUGINS, DEFAULT_CALCULATOR, DEFAULT_PLUGIN
from fredo.fredo_types.item import Item
from fredo.plugins.base import Plugin
apps = DEFAULT_PLUGIN()
class ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.