source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
compatibility_test.py | # Copyright 2020 The gRPC 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 law or agreed to in writ... |
test_flight.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 u... |
publisher.py | #-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2015, Continuum Analytics, Inc. All rights reserved.
#
# Powered by the Bokeh Development Team.
#
# The full license is in the file LICENSE.txt, distributed with this software.
#----------------------------------------... |
train_pg.py | import numpy as np
import tensorflow as tf
import gym
import logz
import scipy.signal
import os
import time
import inspect
from multiprocessing import Process
from tensorflow.contrib.distributions import MultivariateNormalDiag
#===========================================================================================... |
test_sockets.py | # Copyright 2013 The Emscripten Authors. All rights reserved.
# Emscripten is available under two separate licenses, the MIT license and the
# University of Illinois/NCSA Open Source License. Both these licenses can be
# found in the LICENSE file.
import multiprocessing
import os
import socket
import shutil
import s... |
CyWebSocket.py | # -*- coding: utf8 -*-
#
# ♦ CyKIT ♦ 2018.Dec.26
# ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
# CyWebSocket.py
# Adapted by Warren
#
# pywebsocketserver.py
# Written by suxianbaozi
#
# Python web server for connecting sockets locally
# with browsers as well as a generic TCP server.
#
import sys
import socket
import time
im... |
util.py | """
homeassistant.util
~~~~~~~~~~~~~~~~~~
Helper methods for various modules.
"""
import collections
from itertools import chain
import threading
import queue
from datetime import datetime, timedelta
import re
import enum
import socket
import random
import string
from functools import wraps
RE_SANITIZE_FILENAME = re.... |
test_dag_serialization.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... |
JIRA_API.py | """
JIRA API access module
Original Author: Alex Radnaev (alexander.radnaev@gmail.com)
Status: alpha
Python Version: 3.6
"""
import threading
import logging
from datetime import datetime
import etabotapp.TMSlib.Atlassian_API as Atlassian_API
from jira import JIRA
from typing import Dict
from etabot... |
test_windows_events.py | import os
import signal
import socket
import sys
import time
import threading
import unittest
from unittest import mock
if sys.platform != 'win32':
raise unittest.SkipTest('Windows only')
import _overlapped
import _winapi
import asyncio
from asyncio import windows_events
from test.test_asyncio import utils as te... |
serverboards_aio.py | import sys
import os
import json
import time
import traceback
import datetime
# from contextlib import contextmanager
sys.path.append(os.path.join(os.path.dirname(__file__),
'env/lib64/python3.6/site-packages/'))
sys.path.append(os.path.join(os.path.dirname(__file__),
'env/lib64/python3.... |
__init__.py | #!/usr/bin/python3
# -*- coding: utf-8 -*-
#
# 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 ... |
decorators.py | from threading import Thread
def async(f):
def wrapper(*args, **kwargs):
thr = Thread(target=f, args=args, kwargs=kwargs)
thr.start()
return wrapper
|
test_desync.py | #! python2.7
from multiprocessing import Process
import os
import time
import win32gui
from soundrts import config
config.mods = "crazymod9beta10"
from soundrts import worldplayercomputer2 as wpc2
from soundrts.lib.nofloat import PRECISION
class Computer2ForTests(wpc2.Computer2):
def cheat(self):
self.... |
functions.py | import socket
import threading
import json
from itertools import product
from time import sleep
from .sql import *
HEADER = 16
PORT = 5050
SERVER = socket.gethostbyname(socket.gethostname())
ADDR = (SERVER, PORT)
FORMAT = 'utf-8'
DISCONNECT_MESSAGE = "dc"
RDY_MESSAGE = "!OK"
DONE_MESSAGE = "!DONE"
... |
houndify.py | ##############################################################################
# Copyright 2015 SoundHound, Incorporated. All rights reserved.
##############################################################################
import base64
import hashlib
import hmac
import httplib
import json
import threading
import time
... |
__init__.py | from server.hw_controller.buttons.buttons_manager import ButtonsManager
from server.utils.settings_utils import get_ip4_addresses
from flask import Flask, url_for
from flask.helpers import send_from_directory
from flask_socketio import SocketIO
from engineio.payload import Payload
from flask_sqlalchemy import SQLAlchem... |
compare.py | import serial
import sys
import queue
import threading
SERIAL_1 = '/dev/ttyACM0'
SERIAL_2 = '/dev/vtty0'
BAUD_RATE = 19200
def pipe_stdin(ser1, ser2):
while True:
data = sys.stdin.buffer.read(1)
if len(data) == 0:
return
ser1.write(data)
ser2.write(data)
def read_ser(s... |
api.py | # -*- coding: utf-8 -*-
import threading
import asyncio
import websockets
import json
class PyAlmondPlus:
def __init__(self, api_url, event_callback=None):
self.api_url = api_url
self.ws = None
self.loop = asyncio.get_event_loop()
self.receive_task = None
self.event_callbac... |
test_distributed_worker.py | # Copyright 2021 Huawei Technologies Co., Ltd
#
# 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... |
helpers.py | import ConfigParser
import os
import re
import sys
import subprocess
from threading import Thread
def mpileup_cmdgen(args,case_name,source_dir):
#generate command for mpileup
cmd = "qsub -sync y -t " + str(args.start) + "-" + str(args.end) \
+ " -V " \
+ "-N " + case_name \
+ " -e " + a... |
Navigator_rs_test.py | #encoding=utf-8
'''
project overview:
Subscribe:
1.slam pose(global/local pose) *
2.octomap_server/global map
3.local pointcloud/local octomap
4.target input(semantic target/visual pose target/gps target)
Publish:
1.Mavros(amo) Command
2.Navigator status
Algorithms:
1.D*
2.state transfer
... |
dbapi.py | # pysqlite2/test/dbapi.py: tests for DB-API compliance
#
# Copyright (C) 2004-2010 Gerhard Häring <gh@ghaering.de>
#
# This file is part of pysqlite.
#
# This software is provided 'as-is', without any express or implied
# warranty. In no event will the authors be held liable for any damages
# arising from the use of t... |
MQTTRadio.py | from os import system
import signal
import sys
import threading, queue
import paho.mqtt.client as mqtt
import re
import pyttsx3
import importlib
topic = "bbc/subtitles/bbc_news24/compacted"
q = queue.Queue()
running = True
def say(text):
# Workaround because runAndWait() sometimes hangs on windows
importlib.r... |
support.py | """
Assorted utilities for use in tests.
"""
from __future__ import print_function
import cmath
import contextlib
import enum
import errno
import gc
import math
import os
import shutil
import subprocess
import sys
import tempfile
import time
import io
import ctypes
import multiprocessing as mp
from contextlib import c... |
main.py | import argparse
import copy
import os
import gym
from torch import multiprocessing as mp
import networks
import optimizers
import utils
import worker
import tensorboard_writer
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument('--env-name', action='store', type=str, required=Tr... |
msg_channel_wsh.py | #!/usr/bin/python
import json
import logging
import urllib
import threading
import traceback
from queue import Empty
from mod_pywebsocket import stream, msgutil
from wptserve import stash as stashmod
logger = logging.getLogger()
address, authkey = stashmod.load_env_config()
stash = stashmod.Stash("msg_channel", addr... |
core.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 1999-2020 Alibaba Group Holding Ltd.
#
# 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-... |
context.py | #!/usr/bin/env python3
from http import HTTPStatus
from socketserver import ThreadingMixIn
from urllib.parse import urlparse
from ruamel.yaml.comments import CommentedMap as OrderedDict # to avoid '!!omap' in yaml
import threading
import http.server
import json
import queue
import socket
import subprocess
import time
... |
main.py | import pygame
from units import Unit
from battlefields import Battlefield
import interface
import threading
from glob import glob
import json
from utils import *
import astar
TILE_SIZE = 45
pygame.display.init()
running = True
screen = pygame.display.set_mode((1, 1))
previous_drawn = None
WIN_WIDTH = 0
WIN_HEIGHT =... |
device.py | # Copyright (c) Microsoft. All rights reserved.
# Licensed under the MIT license.
import base64
import hashlib
import hmac
import json
import threading
import time
from abc import ABCMeta, abstractmethod
from collections import namedtuple
from time import sleep
import iotc
from iotc import IOTConnectType, IOTLogLevel... |
base.py | import hashlib
import httplib
import os
import threading
import traceback
import socket
import urlparse
from abc import ABCMeta, abstractmethod
from ..testrunner import Stop
here = os.path.split(__file__)[0]
# Extra timeout to use after internal test timeout at which the harness
# should force a timeout
extra_timeou... |
mpv_lib.py | # -*- coding: utf-8 -*-
# vim: ts=4 sw=4 et
#
# Python MPV library module
# Copyright (C) 2017-2020 Sebastian Götte <code@jaseg.net>
#
# This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General
# Public License as published by the Free Software Foundation, either... |
hivetest.py | #!/usr/bin/env python
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "Lic... |
arrow_dataset_ops.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... |
main.py | from direct.showbase.ShowBase import ShowBase
from panda3d.core import *
from math import pi
class MyApp(ShowBase):
def left(self):
#print(self.scene.set)
h = app.scene.getH()+1
app.scene.setH(h)
print("left", h)
def right(self):
h = app.scene.getH()-1
app.sce... |
train_ensemble_old.py | import gc
import time
from datetime import datetime
from multiprocessing import Process
import cv2
import nvidia_smi
import tensorflow as tf
import tensorflow.keras.backend as K
from tensorflow.keras.callbacks import LearningRateScheduler, ModelCheckpoint, TensorBoard
from tensorflow.keras.losses import binary_crossen... |
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 ... |
shell.py | # Copyright 2019 Barefoot Networks, 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 agreed to in... |
main.pyw | #####################################################################
# #
# /main.pyw #
# #
# Copyright 2014, Monash University ... |
threads.py |
__author__="Jaimiey Sears, Sully Cothran"
__copyright__="January 31, 2016"
__version__= 2
import queue
import threading
import socket
from utility import *
from constants import *
# from lidar_servo_driver import turnTo
##############################
# PROGRAM MAIN ENTRY POINT #
##############################
def ... |
wallet.py | # Electrum - lightweight Bitcoin client
# Copyright (C) 2015 Thomas Voegtlin
#
# 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 t... |
server.py | # Copyright (c) 2013 Shotgun Software Inc.
#
# CONFIDENTIAL AND PROPRIETARY
#
# This work is provided "AS IS" and subject to the Shotgun Pipeline Toolkit
# Source Code License included in this distribution package. See LICENSE.
# By accessing, using, copying or modifying this work you indicate your
# agreement to the S... |
search.py | import os
import sys
import traceback
import numpy as np
import argparse
import threading
import codecs
import logging
logger = logging.getLogger(__name__)
logging.basicConfig(level=logging.INFO, format="%(message)s")
from tensorboardX import SummaryWriter # install tensorboardX (pip install tensorboardX) before import... |
soak_utils.py | #!/usr/bin/python
"""
(C) Copyright 2019 Intel 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.0
Unless required by applicable law or agre... |
run_test.py | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
import multiprocessing as mp
import os
import shutil
import subprocess
import tempfile
imp... |
email.py | from app.extensions import mail
from flask_mail import Message
from flask import current_app,render_template # 当前实例
from threading import Thread # 导入多线程
# 异步发送邮件
def send_async_email(app, msg):
with app.app_context():
mail.send(msg)
# 邮件发送给谁,邮件主题,模板 网页和客户端 其他参数
def send_mail(to_name,subject,template,*... |
swarmskin1.py | #!/usr/bin/env python
import rospy
import crazyflie
import time
import uav_trajectory
import swarmlib
import message_filters
from geometry_msgs.msg import PoseStamped, TransformStamped
import os
import sys
from multiprocessing import Process
import random
import numpy as np
from math import *
def start_recording(cf... |
wenku8toepub.py | import requests
import bs4
from bs4 import BeautifulSoup as Soup
from ebooklib import epub
import os
import sys
import getopt
from base_logger import get_logger
import threading
import io
import re
import signal
class Wenku8ToEpub:
USER_AGENT = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML,... |
test_run.py | import contextvars
import functools
import platform
import sys
import threading
import time
import types
import warnings
from contextlib import contextmanager
from math import inf
import attr
import outcome
import sniffio
import pytest
from async_generator import async_generator
from .tutil import check_sequence_matc... |
test_atomic.py | from threading import Thread
import pytest
import mitsuba
def test01_add(variant_scalar_rgb):
from mitsuba.core import AtomicFloat
f = AtomicFloat(5)
threads = []
def increment(f):
for i in range(10):
f += 1
for j in range(0, 10):
threads.append(Thread(target=increm... |
test_async_utils.py | # -*- coding: utf-8 -*-
# ------------------------------------------------------------------------------
#
# Copyright 2018-2019 Fetch.AI Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the ... |
devkit_tools.py |
import re
import subprocess
import time
from collections import defaultdict
from glob import glob
from multiprocessing import Process, Queue
from multiprocessing.context import ProcessError
from os import listdir, makedirs, remove, removedirs
from pathlib import Path
from dolreader.dol import DolFile
from dolreader.se... |
cvimage.py | from __future__ import annotations
from dataclasses import dataclass
from typing import overload
from numbers import Real
import builtins
import sys
import os
import io
import math
import warnings
import contextlib
from pathlib import Path
import cv2
import numpy as np
def isPath(f):
return isi... |
microservice.py | import argparse
import os
import importlib
import json
import time
import logging
import multiprocessing as mp
import sys
import seldon_core.persistence as persistence
from distutils.util import strtobool
from seldon_core.flask_utils import ANNOTATIONS_FILE
import seldon_core.wrapper as seldon_microservice
from typing ... |
NuoAdminNuoMonitorPlugin.py | # (C) Copyright NuoDB, Inc. 2017-2020
#
# This source code is licensed under the MIT license found in the LICENSE
# file in the root directory of this source tree.
import logging
import os
import re
import socket
import threading
import time
import datetime
from copy import deepcopy
from pynuoca.nuoca_plugin import N... |
tgsrepcrack.py | #!/usr/local/bin/python2 -tt
import kerberos
from pyasn1.codec.ber import encoder, decoder
from multiprocessing import Process, JoinableQueue, Manager
import glob
wordlist = JoinableQueue()
enctickets = None
#ENDOFQUEUE = 'ENDOFQUEUEENDOFQUEUEENDOFQUEUE'
def loadwordlist(wordlistfile, wordlistqueue, threadcount):
... |
multiprocessing01.py | # coding: utf-8
"""
multiprocessingモジュールについてのサンプルです。
"""
import multiprocessing
import os
import time
from trypython.common.commoncls import SampleBase
from trypython.common.commonfunc import pr
class Sample(SampleBase):
def exec(self):
#
# multiprocessingモジュール
# threadingと似た構成を持つモジュール。t... |
log_printer.py | # Forked from docker-compose
from __future__ import absolute_import
from __future__ import unicode_literals
import sys
import os
import threading
from collections import namedtuple
from itertools import cycle
from threading import Thread
from six.moves import _thread as thread
from six.moves.queue import Empty
from ... |
player.py | """
The MIT License (MIT)
Copyright (c) 2015-present Rapptz
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, merg... |
pigz_python.py | """
Functions and classes to speed up compression of files by utilizing
multiple cores on a system.
"""
import os
import sys
import time
import zlib
from multiprocessing.dummy import Pool
from pathlib import Path
from queue import PriorityQueue
from threading import Lock, Thread
CPU_COUNT = os.cpu_count()
DEFAULT_BLOC... |
ParallelTasks.py | # Copyright 2016, EMC, Inc.
import datetime
import os
import sys
if os.name == 'posix' and sys.version_info[0] < 3:
import subprocess32 as subprocess
else:
import subprocess
import multiprocessing
class ParallelTasks(object):
"""
Run a set of tasks in parallel, collecting the output from each task (... |
ner.py | import os
import socket
import subprocess
from contextlib import contextmanager, closing
from threading import Thread
from time import sleep
from cltl.triple_extraction import logger
class NER(object):
ROOT = os.path.join(os.path.dirname(__file__), '../stanford-ner')
IP = 'localhost'
def __init__(self, ... |
run_dummy_server.py | from threading import Thread
from time import sleep
from tests.helpers.paramiko_connect import paramiko_connect
def run_dummy_server(user: str,
server_port: int,
timeout: float):
"""Runs a simple HTTP server on the testing container as the given user.
:param use... |
main.py | from core import bot
from core.web import run, stay_alive
from threading import Thread
site_thread = Thread(target=run)
ping_thread = Thread(target=stay_alive)
self = bot.BreadBot()
site_thread.start()
ping_thread.start()
self.run() |
test_sys.py | import unittest, test.support
from test.support.script_helper import assert_python_ok, assert_python_failure
import sys, io, os
import struct
import subprocess
import textwrap
import warnings
import operator
import codecs
import gc
import sysconfig
import locale
import threading
# count the number of test runs, used t... |
ffmpeg_recursive.py | #!/bin/python3
import argparse
import concurrent.futures
import concurrent.futures.thread
import json
import logging
import os
import re
import shutil
import socketserver
import subprocess
import sys
import threading
import time
from datetime import datetime, timedelta
from json import JSONDecodeError
from pathlib imp... |
pg_lib.py | import io
import psycopg2
from psycopg2 import sql
from psycopg2.extras import RealDictCursor
import sys
import json
import datetime
import decimal
import time
import os
import binascii
from distutils.sysconfig import get_python_lib
import multiprocessing as mp
class pg_encoder(json.JSONEncoder):
def default(self,... |
test_mysqlx_connection.py | # -*- coding: utf-8 -*-
# Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License, version 2.0, as
# published by the Free Software Foundation.
#
# This program is also d... |
bgp-rib-diffs.py | #!/usr/bin/python
from __future__ import print_function
import argparse
import gzip
import os
import radix
import re
import sys
from bz2 import BZ2File
from datetime import datetime, timedelta
from multiprocessing import Process, Queue, cpu_count
from netaddr import IPSet, IPNetwork
# own imports
import mrtx
verbo... |
main_visual.py | #!/usr/bin/env python3
import threading
import multiprocessing
import numpy as np
import matplotlib.pyplot as plt
import tensorflow as tf
import tensorflow.contrib.slim as slim
from tensorflow.examples.tutorials.mnist import input_data
from PIL import Image
from PIL import ImageDraw
from PIL import ImageFont
import ... |
watchdog.py | #!/usr/bin/python
# Copyright (c) Microsoft Corporation
# All rights reserved.
#
# MIT License
#
# 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 limitatio... |
test_application.py | # GUI Application automation and testing library
# Copyright (C) 2006-2018 Mark Mc Mahon and Contributors
# https://github.com/pywinauto/pywinauto/graphs/contributors
# http://pywinauto.readthedocs.io/en/latest/credits.html
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or with... |
ViewWinRenderedGrid.py | '''
Created on Oct 5, 2010
@author: Mark V Systems Limited
(c) Copyright 2010 Mark V Systems Limited, All rights reserved.
'''
import os, threading, time, logging
from tkinter import Menu, BooleanVar, font as tkFont
from arelle import (ViewWinTkTable, ModelDocument, ModelDtsObject, ModelInstanceObject, XbrlConst,
... |
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.contacts import Contacts
from electrum.payment... |
DialogPluginManager.py | '''
Created on March 1, 2012
@author: Mark V Systems Limited
(c) Copyright 2011 Mark V Systems Limited, All rights reserved.
based on pull request 4
'''
from tkinter import Toplevel, font, messagebox, VERTICAL, HORIZONTAL, N, S, E, W
from tkinter.constants import DISABLED, ACTIVE
try:
from tkinter.ttk import Tre... |
parallel.py | import os
import subprocess
import sys
from collections import OrderedDict
from threading import Event, Semaphore, Thread
from tox import reporter
from tox.config.parallel import ENV_VAR_KEY as PARALLEL_ENV_VAR_KEY
from tox.util.spinner import Spinner
def run_parallel(config, venv_dict):
"""here we'll just start... |
modelservicecontext.py | #Data : 2018-10-15
#Author : Fengyuan Zhang (Franklin)
#Email : franklinzhang@foxmail.com
from enum import Enum
import socket
import time
import threading
import json
import os
import sys
import zipfile
from shutil import copy
class EModelContextStatus(Enum):
EMCS_INIT_BEGIN = 1,
EMCS_INIT = 2... |
events_parser.py | import json
from Queue import *
import threading
import time
import requests
repo = 'https://api.github.com/repos/SleeplessByte/programming-life/'
print "hello"
def getComs(sha):
while True:
item = q.get()
comsurl = repo + 'commits?sha=' + sha +'&per_page=50'
payload = {'some': 'data'}
headers = {'conten... |
main.py | from multiprocessing import Process
from solver import solverbucket, solver, analysis
if __name__ == '__main__':
tasks = [
'a_example',
'b_little_bit_of_everything',
'c_many_ingredients',
'd_many_pizzas',
'e_many_teams'
]
anal = False
sol = True
solbuc = F... |
proxy.py | import socket
from threading import Thread
from argparse import ArgumentParser
# try to import C parser then fallback in pure python parser.
try:
from http_parser.parser import HttpParser
except ImportError:
from http_parser.pyparser import HttpParser
class HttpProxy:
BUFFER_SIZE = 8192
def __init__... |
scoreboard.py | # init
import os
import json
import random
import config
if __name__ == '__main__':
import pygame
import button
import switch
import tkinter
import hyperlink
import text_field
import fancy_blit
import dropdown_list
import event_handler
import multiprocessing
from tkinter impo... |
mjpg_stream_server.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from PIL import Image
import threading
from http.server import BaseHTTPRequestHandler,HTTPServer
from socketserver import ThreadingMixIn
from io import StringIO, BytesIO
import time
import cv2
import logging
class CamHandler(BaseHTTPRequestHandler):
def do_GET(self):
... |
Client.py | # coding=utf-8
import math
from socket import *
from Config import Config
from Protocal.generate import TransferProtocal_pb2
HOST = Config.HOST
PORT = Config.PORT
BufferSize = Config.BufferSize
ADDR = (HOST, PORT)
def receiveDataFromServer(server, address):
data = b''
while True:
buf = server.recv(Bu... |
multi_worker_with_keras_runner.py | import sys
import os
import threading
node_str = sys.stdin.read().replace("\n","")
nodes = node_str.split(' ')
first = True
node_string = ""
for node in nodes:
if not first:
node_string += ','
node_string += '"' + node + ':12345"'
first = False
for i, node in enumerate(nodes):
config = ('TF_C... |
lib.py | """
Test library.
"""
import difflib
import inspect
import json
import subprocess
import os
import posixpath
import re
import shlex
import shutil
import string
import threading
import urllib.error
import urllib.parse
import urllib.request
import pprint
import socketserver
import http.server
import zlib
def ungzip_if... |
prepare_tether.py | #!/usr/bin/env python
# Copyright 2020 Informatics Matters Ltd.
#
# 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... |
TcpClientService.py | from __future__ import annotations
from logging import getLogger
from socket import AF_INET, SOCK_STREAM
from threading import Thread
from typing import Optional, Tuple
from ..clock import IClock
from ..constants import buffer_size
from ..log.util import log_method_call
from ..receive import IReceiveListener
from ..rel... |
Hermes.py | #!/usr/bin/python
# coding: utf-8
# __author__ jax777
import os
import cgi
import json
import urllib
import hashlib
import datetime
import tornado.ioloop
import tornado.web
import traceback
from tornado.escape import json_decode
from multiprocessing import Process
from sqllitedb import *
from DnsServer import dns_serv... |
main.py | from beamngpy import BeamNGpy
beamng_user_path = "G:\\gitrepos\\BeamNG_user_path"
beamng_install_path = "G:\\gitrepos\\beamng-research_unlimited\\trunk"
parallel = True
def create_instance(i: int) -> BeamNGpy:
from beamngpy import Scenario, Vehicle
bng = BeamNGpy("localhost", 64523 + i * 100, home=beamng_ins... |
clock.py | from apscheduler.schedulers.blocking import BlockingScheduler
import predict
import threading
sched = BlockingScheduler()
@sched.scheduled_job('cron', day='*')
def scheduled_job():
thread1 = threading.Thread(target=predict.refresh, args=('confirmed',))
thread1.start()
# thread2 = threading.Thread(target=... |
test_threadswitch.py | # ThreadSwitch Unit Test
# Copyright (c) Kiruse 2021. See license in LICENSE.
# TODO: Test thread-bound resources simulating libraries and interfaces like sqlite3
from __future__ import annotations
from threading import Thread
from threadswitch import *
from time import sleep, time
from typing import *
import pytest
c... |
helper_tools.py | #!/usr/bin/env python
import threading
import time
from motes import motes
import moteconfig
import sensor_data
import configuration
import data_utils
isListening = False
listenThread = None
selectedMote = None
# Process mote data if available
def processMote(m):
length = m.tryRead(binaryToo = moteconfig.instan... |
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... |
test_ace.py | # vim: sw=4:ts=4:et
import logging
import os.path
import threading
from subprocess import Popen, PIPE, TimeoutExpired
from saq.constants import *
from saq.test import ACEBasicTestCase
import psutil
class CLITestCase(ACEBasicTestCase):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwar... |
main_window.py | #!/usr/bin/env python
#
# Electrum - lightweight Bitcoin client
# Copyright (C) 2012 thomasv@gitorious
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation files
# (the "Software"), to deal in the Software without restriction,
# including witho... |
widget.py | #!/usr/bin/env python3
# This Python file uses the following encoding: utf-8
from operator import truediv
import os
from pathlib import Path
import sys
import threading
import time
from cpu_information import *
from gpu_information import *
from system_information import *
import gpu_information
import importlib
from i... |
auth.py | import functools
from werkzeug.local import LocalProxy
from flask import (
Blueprint, flash, g, redirect, render_template, request, session, url_for, current_app, make_response
)
from werkzeug.security import check_password_hash, generate_password_hash
from threading import Thread
import time, datetime, re
from .... |
email.py | from threading import Thread
from flask import current_app
from flask_mail import Message
from bkmrk import mail
def send_async_email(app, msg):
with app.app_context():
mail.send(msg)
def send_email(subject, *, sender, recipients, text_body, html_body): # noqa: E999
msg = Message(subject, sender=... |
triangle.py | #! /usr/bin/env python
import rospy
from time import time, sleep
from datetime import datetime
from ar_track_alvar_msgs.msg import AlvarMarkers
from controlmulti import *
from callback_alvar import *
if __name__ == '__main__':
# try:
rospy.init_node('control_node', anonymous= False)
rate = rospy... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.