source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
video2ws.py | from threading import Thread
from tornado.ioloop import IOLoop
from tornado.web import Application
from tornado.websocket import WebSocketHandler
import cv2
RES = (176, 144)
FPS = 50
class VideoToWs(WebSocketHandler):
def open(self):
print('Connection opened.')
Thread(target=self.pub_video).sta... |
test_ca.py | import numpy as np
import threading
from pycrazyswarm import *
import time
import scipy as sp
# 飞控常数
TAKEOFFTIME = 2.0
RADII = 0.7
HOVERTIME = 3.0
CATIME = 1.0
# cf是否避障标志位
cf_flag = {1: 0, 2: 0, 3: 0, 4: 0, 5: 0, 6: 0, 7: 0}
# 航点类
class Waypoint:
def __init__(self, agent, x, y, z, arrival, durat... |
startServer.py | """
MIT License
Copyright (c) 2021 Meme Studios
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, ... |
overlap.py | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import random
import math
import json
import threading
import numpy as np
import tensorflow as tf
from . import util
from . import coref_ops
from . import conll
from . import metrics
from . import op... |
multipose.py | import os
import socket
import threading
import re
import atexit
from math import pi
import requests
bl_info = {
"name": "Multipose Blender Plugin",
"blender": (2, 80, 0),
"category": "Import-Export",
}
import bpy
x = []
HOST = '0.0.0.0'
PORT = 65432
_is_running = True
basepath = "./mocAPP_cache_blender/... |
daemon.py | #!/usr/bin/env python3
from xdg.BaseDirectory import xdg_config_home
from PIL import Image, ImageDraw
from threading import Thread
from i3expo.debounce import Debounce
from i3expo.geometry import Geometry, Dimension
import os
os.environ['PYGAME_HIDE_SUPPORT_PROMPT'] = "hide"
import logging
import math
import argpars... |
test_ai2thor_wrapper.py | """
Tests related to the ai2thor environment wrapper.
"""
import random
import threading
import time
import unittest
import warnings
import ai2thor.controller
from gym_ai2thor.envs.ai2thor_env import AI2ThorEnv
class TestAI2ThorEnv(unittest.TestCase):
"""
General environment generation tests
"""
def ... |
test_omega_ithx.py | import os
import time
import socket
import threading
from datetime import datetime
from msl.loadlib.utils import get_available_port
from msl.equipment import EquipmentRecord, ConnectionRecord
from msl.equipment.resources.omega import iTHX
def simulate_omega_iserver(address, port, term):
s = socket.socket(socket... |
common.py | # Copyright (c) 2015 Ansible, Inc.
# All Rights Reserved.
# Python
from datetime import timedelta
import json
import yaml
import logging
import os
import subprocess
import re
import stat
import urllib.parse
import threading
import contextlib
import tempfile
from functools import reduce, wraps
# Django
from django.cor... |
Lending.py | # coding=utf-8
from decimal import Decimal
import sched
import time
import threading
Config = None
api = None
log = None
Data = None
MaxToLend = None
Analysis = None
SATOSHI = Decimal(10) ** -8
cancel_at_round_turn = 0
sleep_time_active = 0
sleep_time_inactive = 0
sleep_time = 0
min_daily_rate = 0
max_daily_rate = 0
... |
reactivebebop.py | import numpy
import threading
import time
import roslib
try:
roslib.load_manifest('TFG-Bebop-YOLO')
except:
pass
import rospy
from std_msgs.msg import Empty
from std_msgs.msg import Bool
from geometry_msgs.msg import Twist
from bebop_msgs.msg import CommonCommonStateBatteryStateChanged as Battery
import termios
impor... |
test_async.py | # -*- coding: utf-8 -*-
import unittest
import subprocess
import threading
import trytond.tests.test_tryton
from trytond.tests.test_tryton import activate_module, with_transaction
from trytond.pool import Pool
class Command(object):
"""
Wrapper around subprocess to execute on a different thread and use the
... |
variable_scope_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... |
threaded_crawler.py | # coding:utf8
import time
import threading
import urlparse
from downloader import Downloader
SLEEP_TIME = 1
def threaded_crawler(seed_url, delay=5, cache=None, scrape_callback=None, user_agent='wswp', proxies=None,
num_retries=1, max_threads=10, timeout=60):
"""Crawl this website in multiple... |
support.py | """
Assorted utilities for use in tests.
"""
import cmath
import contextlib
import enum
import errno
import gc
import math
import platform
import os
import shutil
import subprocess
import sys
import tempfile
import time
import io
import ctypes
import multiprocessing as mp
import warnings
import traceback
from contextl... |
distributed.py | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""Distributed helpers."""
import multiprocessing
import os
import signal
import threading
import traceback
import torch
from xcom.core.conf... |
test_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... |
daemon.py | from time import sleep, perf_counter
from threading import Thread
import sys
start = perf_counter()
def show(name):
print(f'Starting {name} ...')
sleep(3)
print(f'Finishing {name} ...')
t1 = Thread(target=show, args=('One',))
t2 = Thread(target=show, args=('Two',))
t1.setDaemon(True)
t1.start()
t2.st... |
redis.py | import redis
import os, time, multiprocess, logging, sys
import json
from compute import Config_ini
from compute.log import Log
from compute.file import get_algo_local_dir, get_population_dir
def get_logger(logger_name, log_file, level=logging.INFO):
l = logging.getLogger(logger_name)
formatter = logging.Form... |
adaderana.py | import tweepy
import os
import time
import threading
from elasticsearch import Elasticsearch, helpers
from datetime import datetime
from dotenv import load_dotenv
load_dotenv()
consumer_key = os.getenv('consumer_key')
consumer_secret = os.getenv('consumer_secret')
access_key = os.getenv('access_key')
access_secret =... |
multiprocess.py | # 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 writing, software
# distributed under the Li... |
run.py | from __future__ import print_function
import js2py
from js2py.base import PyJsException, PyExceptionToJs
from js2py.internals import seval
from js2py.internals.simplex import JsException
import os, sys, re, traceback, threading, ctypes, time, six
from distutils.version import LooseVersion
from node_eval import NodeJsEr... |
job_server.py | """
JobServer: class for job farming using amuse communication channels
usage:
start jobserver
jobserver=JobServer(hosts=<list of hostnames> [ ,channel_type="mpi", preamble="<commands>", retry_jobs=True/ False] )
submit job
job=jobserver.submit_job(somework, (args,))
wait for one result (encounters all):
jobs... |
02_cartpole_rainbow_main.py | #!/usr/bin/env python3
# https://github.com/higgsfield/RL-Adventure
import time
import torch
import torch.multiprocessing as mp
from torch import optim
import os
from codes.f_utils.common_utils import make_gym_env
from config.names import PROJECT_HOME
print(torch.__version__)
from common.fast_rl import actions, expe... |
site_tests.py | # -*- coding: utf-8 -*-
"""Tests for the site module."""
#
# (C) Pywikibot team, 2008-2019
#
# Distributed under the terms of the MIT license.
#
from __future__ import absolute_import, division, unicode_literals
import os
import pickle
import random
import re
import sys
import time
try:
from collections.abc impor... |
1_2_threading_condiction.py | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
'''
@Time : 2021-4-6
@Author : EvilRecluse
@Contact : https://github.com/RecluseXU
@Desc :
条件变量总是与某种类型的锁对象相关联,锁对象可以通过传入获得,或者在缺省的情况下自动创建。
当多个条件变量需要共享同一个锁时,传入一个锁很有用。锁是条件对象的一部分,你不必单独地跟踪它。
class threading.Condition(lock=None)
实现条件变量对象的类。一个条件变量对象允许一个或多个线程... |
runner.py | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
import sys
import os.path
import optparse
import time
import threading
import Queue
from multiprocessing import Process
from nps.core import PacketSimulator, PacketSniff
from nps.parser import XmlTestCaseParser
from nps.network_entity import NetworkEntity
from nps.accessi... |
video_monitor.py | import threading
import compare_audio
import compare_screenshots
import eye_tracker
import datetime
import sqlite3
has_youtube = 0
def set_youtube(yt):
global has_youtube
# print("Has youtube", yt)
has_youtube = yt
def run_eye_tracker(kill_flag, db_path):
threading.Thread(name="eye tracker thread",... |
10_rms_wait_die_gui.py | from functools import reduce
from sys import *
import numpy as np
import random as r
import ping_code as pc
import socket
import struct
import subprocess as sp
import threading
from threading import Thread
import ast
import time
import datetime as dt
import os
import getpass as gp
import psutil
from drawnow import *
fr... |
widgets.py | # -*- coding: utf-8 -*-
"""
Created on Fri Dec 11 19:55:12 2020
@author: Timothe
"""
import sys, os#, time
import numpy as np
from matplotlib.backends.qt_compat import QtCore, QtWidgets
from matplotlib.backends.backend_qt5agg import (FigureCanvas, NavigationToolbar2QT as NavigationToolbar)
from matplotlib.figure imp... |
multi_process_runner_test.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... |
local_planner.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#change
import numpy as np
import rospy
import tf
import math
from nav_msgs.msg import Path
from geometry_msgs.msg import PoseStamped, Twist
from sensor_msgs.msg import LaserScan
from dwa import DWAPlanner
from threading import Lock, Thread
from pynput import keyboard
impo... |
run.py | # export PYTHONPATH=/usr/local/lib/python2.7/site-packages:$PYTHONPATH
import os
from flask import Flask, request, redirect, url_for, render_template, send_file, jsonify
from werkzeug.utils import secure_filename
import subprocess
import SimpleHTTPServer
import SocketServer
import webbrowser
from threading import Threa... |
test_pubsub.py | # -*- coding: utf-8 -*-
# python std lib
from __future__ import unicode_literals
import threading
import time
# rediscluster imports
from rediscluster.client import RedisCluster
# 3rd party imports
import pytest
# import redis
from redis import Redis
from redis.exceptions import ConnectionError
from redis._compat i... |
_threadedselect.py | # -*- test-case-name: twisted.test.test_internet -*-
#
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
from __future__ import generators
"""
Threaded select reactor
Maintainer: Bob Ippolito
The threadedselectreactor is a specialized reactor for integrating with
arbitrary foreign event loop,... |
ssh.py | # -*- coding: utf-8 -*- #
# Copyright 2018 Google LLC. 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 requir... |
threads_thread_pool.py | """
"An example of a threaded application" section example
showing how to implement simple thread pool.
"""
import time
from queue import Queue, Empty
from threading import Thread
from gmaps import Geocoding
THREAD_POOL_SIZE = 4
api = Geocoding()
PLACES = (
'Reykjavik', 'Vien', 'Zadar', 'Venice',
'Wrocła... |
ingress.py | """A 'backdoor' shell for running servers (very much like Twisted manhole).
Once installed, you can 'telnet <host> <port>' and run Python commands on your
server environment. This is very helpful in debugging servers.
This one uses only modules found in the standard library.
"""
__author__ = 'Miki Tebeka <miki.tebek... |
master_feed.py | from multiprocessing import Process
import feed, algo
import glob, time, copy
waitTime = 1800
def buildList():
print("Built the list.")
returnList = []
with open("stocks", "r") as f:
for i in f:
returnList.append(i.rstrip())
return returnList
def main():
print("Starting feed programs")
stocks = c... |
udp.py | import collections
from typing import Dict, Tuple
import threading
import socket
import struct
import binascii
from time import time
import enum
import attr
PROTOCOL_VERSION = 1001
_battery_table = {
# CHARGING 1-11
# dying
(True, 1): 0x01,
(True, 2): 0x01,
# low
(True, 3): 0x02,
(True, ... |
runtests_log_handler.py | # -*- coding: utf-8 -*-
'''
:codeauthor: Pedro Algarvio (pedro@algarvio.me)
:copyright: Copyright 2016 by the SaltStack Team, see AUTHORS for more details.
:license: Apache 2.0, see LICENSE for more details.
pytestsalt.salt.log_handlers.pytest_log_handler
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~... |
poster.py | import os
import sys
import time
import signal
import multiprocessing
from datetime import datetime
PROJECT_PATH = os.path.abspath(os.path.dirname(__file__))
sys.path.append(os.path.join(PROJECT_PATH, '..', '..'))
from pygithub3 import Github
import src.todoMelvin
from src.todoMelvin import settings, createGithubObj... |
display_functions.py | import os
import random
from threading import Thread
from modules.audio import speaker
from modules.conditions import conversation
from modules.models import models
from modules.utils import support
env = models.env
def brightness(phrase: str):
"""Pre-process to check the phrase received and call the appropriat... |
SerialClient.py | #!/usr/bin/env python
#####################################################################
# Software License Agreement (BSD License)
#
# Copyright (c) 2011, Willow Garage, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that th... |
keepkey.py | from binascii import hexlify, unhexlify
import traceback
import sys
from typing import NamedTuple, Any, Optional, Dict, Union, List, Tuple, TYPE_CHECKING
from electrum.util import bfh, bh2u, UserCancelled, UserFacingException
from electrum.bip32 import BIP32Node
from electrum import constants
from electrum.i18n import... |
pixiv_crawler.py | # -*- coding: utf-8 -*-
"""
-------------------------------------------------
File Name: pixiv_crawler
Description :
Author : zdf's desktop
date: 2020/5/28
-------------------------------------------------
Change Activity:
2020/5/28:21:14
----------------------------... |
tft_display.py | import Adafruit_GPIO.SPI as SPI
import ST7789 as TFT # https://github.com/solinnovay/Python_ST7789
import urllib.request
from io import BytesIO
from PIL import Image
from collections import OrderedDict
import threading
no_cover_image_path = 'img/no_cover.png'
class ImageLookup(OrderedDict):
"""
A lookup tab... |
test017.py | import webview
import threading
"""
This example demonstrates creating a save file dialog.
"""
def save_file_dialog():
import time
time.sleep(5)
print(webview.create_file_dialog(webview.SAVE_DIALOG,
directory="/",
save_filename='te... |
trezor.py | import traceback
import sys
from typing import NamedTuple, Any
from electrum_mona.util import bfh, bh2u, versiontuple, UserCancelled, UserFacingException
from electrum_mona.bitcoin import TYPE_ADDRESS, TYPE_SCRIPT
from electrum_mona.bip32 import BIP32Node, convert_bip32_path_to_list_of_uint32 as parse_path
from electr... |
thread_join.py | import threading
import time
def our_thread(i):
print("Thread {} Started".format(i))
time.sleep(i * 2)
print("Thread {} Finished".format(i))
def main():
thread = threading.Thread(target=our_thread, args=(1,))
thread.start()
print("Is thread 1 Finished?")
thread2 = threading.Thread(targ... |
WebSocketServer.py | import errno
import socket
import threading
import hashlib
import base64
import logging
from .DataFrameFormat import *
from .ServerException import *
class WebSocketServer:
_SEC_KEY = "258EAFA5-E914-47DA-95CA-C5AB0DC85B11"
_HANDKSHAKE_RESP = (
"HTTP/1.1 101 Switching Protocols\r\n"
"Upgrade: ... |
flow2npy.py | import cv2
import os
import numpy as np
import json
import glob
import multiprocessing as mp
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('thread_num', type=int)
parser.add_argument('--video_info_path', type=str,
default='anet_annotations/video_info_train_val.json')
parser... |
miner.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
## Copyright (c) 2017, The HongbaoBlockchain Project (www.hongbaoblockchain.org)
'''
Main miner worker, RPC client
'''
import sys, psutil
import json, socket, struct
import errno
import threading, time, urlparse, random, platform
from multiprocessing import Pro... |
train_sampling.py | """Training GCMC model on the MovieLens data set by mini-batch sampling.
The script loads the full graph in CPU and samples subgraphs for computing
gradients on the training device. The script also supports multi-GPU for
further acceleration.
"""
import os, time
import argparse
import logging
import random
import stri... |
test_imperative_data_loader_exit_func.py | # Copyright (c) 2020 PaddlePaddle 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 appli... |
test_git.py | """
test_git.py - tests for the git module
author: nu11us <work.willeggleston@gmail.com>
"""
import unittest
from mock import MagicMock
from modules import git
from threading import Thread
class TestGit(unittest.TestCase):
def setUp(self):
self.phenny = MagicMock()
self.input = MagicMock()
d... |
email_warnings_thread.py | # Built-in Python imports
import logging
import threading
import time
# iotalib imports
from . import logutil
from . import notification
from . import config_notification
def start():
"""
Called by the client to kick off the e-mail warning notification thread
"""
logging.info("Starting... |
HomePage.py | import threading
from tkinter import *
import tkinter.filedialog
from tkinter import ttk
import time
import cv2
from PIL import Image, ImageTk
import constants
from datetime import datetime
from VideoProcessor import VideoProcessor
class HomePage(Frame):
def __init__(self, master):
Frame._... |
memory_watcher.py |
# Copyright 2010 Alon Zakai ('kripken'). All rights reserved.
# This file is part of Syntensity/the Intensity Engine, an open source project. See COPYING.txt for licensing.
'''
'''
import os, signal, time, threading, subprocess
from intensity.base import *
def get_memory_usage():
'''Returns memory usage of cu... |
test_rpc_proxy.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... |
networkstreams.py | import socket
import threading
import tankmanager
server_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
socket_port = 16505
socket_hostname = socket.gethostname()
def start_server(hostname=socket_hostname, port=socket_port):
global socket_port, socket_hostname
socket_port = port
socket_hostn... |
manager.py | import argparse # noqa
import atexit # noqa
import codecs # noqa
import collections
import copy # noqa
import errno # noqa
import fnmatch # noqa
import hashlib # noqa
import os # noqa
import shutil # noqa
import signal # noqa
import sys # noqa
import threading # noqa
import traceback # noqa
from contextlib... |
parser.py | import os
import sys
import time
import signal
import multiprocessing
PROJECT_PATH = os.path.abspath(os.path.dirname(__file__))
sys.path.append(os.path.join(PROJECT_PATH, '..', '..'))
from pygithub3 import Github
import src.todoMelvin
from src.todoMelvin import settings, createGithubObject
from src.todoLogging impor... |
testdisk_gui.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Dec 30 11:44:00 2016
@author: pavel
"""
import os
import sys
import gi
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk, Gdk, GObject
import threading
import signal
signal.signal(signal.SIGINT, signal.SIG_DFL) #handle Ctrl-C
APP_NAME =... |
common_func.py | #!/usr/bin/env python3
# coding=utf-8
from __future__ import print_function, unicode_literals, division, absolute_import
import sys
import time
import binascii
import struct
import collections
import logging
import socket
import select
import threading
import traceback
import functools
import server_pool
try:
# f... |
MF_socketIO.py | #-------------------------------------------------------------------------------
#Targeting: Python 2 and 3
#Use: Wrapper to implement a socketIO connection to a MF controller
#-------------------------------------------------------------------------------
from socketIO_client import SocketIO, Loggi... |
__init__.py | """MIT License
Copyright (c) 2017-2022 TwitchIO
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, ... |
start_all.py | """
This is the code to automatically start up the hosts Apple and Banana in a
synchronized way.
To make it work for other groups of hosts, you only need to edit the HOSTS
and MASTERCONFIG constants for this file.
The synchronization currently only supports the case where all hosts operate
in separate processes from e... |
rate_limits.py | # -*- coding: utf-8 -*-
import logging
import urllib2
import httplib
import threading
# import time
from ...core.models import HEADERS
logger = logging.getLogger('sitetest')
def test_rate_limits(site, total_count=500, verbose=False):
"""
Hammer the homepage to see if it hits any limits
"""
if verbo... |
service_zipkin_test.py | #
# voice-skill-sdk
#
# (C) 2020, Deutsche Telekom AG
#
# This file is distributed under the terms of the MIT license.
# For details see the file LICENSE in the top directory.
#
#
import logging
import threading
import unittest
from configparser import ConfigParser
from unittest.mock import patch, Mock
from skill_sdk ... |
streaming_puppet_gui.py | from multiprocessing import Process, Queue
import time
import serial
import numpy
import pandas as pd
from scipy import signal
from scipy import fftpack
import math
import sys
import PySimpleGUI as sg
def sync_to_uq(ser):
"""
Aligns the serial port read to the next 'UQ' header at the start of a data frame.
... |
ga5.py | '''
rewrite in 2014/10/01:
- all multiprocess
- standard GA
'''
import multiprocessing as mp
from numpy import *
from time import time
class extended_Queue(object):
def __init__(self, max = 500, threshold = 50):
self.qs = [mp.Queue() for i in range(max)]
self.ind... |
main.py | from threading import Thread
from animation import*
from RealTime_Stock_Price import*
def main():
data = stock_data(['AAPL','ACB','TSLA','FB'])
animating = animation(data.stock_list)
Thread(target = data.save_data).start()
animating.display()
main()
|
process_replay.py | #!/usr/bin/env python3
import capnp
import os
import sys
import threading
import importlib
if "CI" in os.environ:
def tqdm(x):
return x
else:
from tqdm import tqdm # type: ignore
from cereal import car, log
from selfdrive.car.car_helpers import get_car
import selfdrive.manager as manager
import cereal.messa... |
test_functools.py | import abc
import builtins
import collections
import collections.abc
import copy
from itertools import permutations
import pickle
from random import choice
import sys
from test import support
import threading
import time
import typing
import unittest
import unittest.mock
from weakref import proxy
import contextlib
imp... |
robot_script.py | #!/usr/bin/env python3
import socket, sys
from threading import Thread
import logging
from math import sin, cos
import numpy as np
import ev3dev.auto as ev3
try:
import cPickle as pickle
except:
import pickle
### Initialize ###
# Constants
PORT = 50008
THIS_ROBOT = 2 # Our own ID
PI = 3.1415
TWO_PI = 2 * PI... |
test_loader_semaphore.py | # Copyright (c) MONAI Consortium
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, so... |
ventilator.py | # Copyright (c) 2017-2018 Uber Technologies, 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 ... |
messenger_manager.py | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# 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 sys
import threading
import time
import traceback
from parlai.messenger.core.agents imp... |
timeout.py | # coding=utf-8
# Copyright 2021 The Google Research 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 applicab... |
test_soef_integration.py | # -*- coding: utf-8 -*-
# ------------------------------------------------------------------------------
#
# Copyright 2018-2020 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 ... |
sensing_interface.py | #!/usr/bin/env python3
import rospy
import rospkg
import re
import threading
import numpy as np
from threading import Lock
import imp
from rosplan_knowledge_msgs.srv import KnowledgeUpdateServiceArray, KnowledgeUpdateServiceArrayRequest
from rosplan_knowledge_msgs.srv import GetDomainPredicateDetailsService, GetDomain... |
sleep.py |
__copyright__ = "Copyright 2013-2016, http://radical.rutgers.edu"
__license__ = "MIT"
import os
import time
import threading as mt
import radical.utils as ru
from ... import states as rps
from ... import constants as rpc
from .base import AgentExecutingComponent
# -----------------------------------... |
threading_with_webservers__flask.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = 'ipetrash'
import threading
def run(port=80):
from flask import Flask
app = Flask(__name__)
import logging
logging.basicConfig(level=logging.DEBUG)
@app.route("/")
def index():
html = "Hello World! (port={})".format(port)... |
test_restful.py | #!/usr/bin/python3
'''
DISTRIBUTION STATEMENT A. Approved for public release: distribution unlimited.
This material is based upon work supported by the Assistant Secretary of Defense for
Research and Engineering under Air Force Contract No. FA8721-05-C-0002 and/or
FA8702-15-D-0001. Any opinions, findings, conclusions ... |
launch.py | #!/usr/bin/python2
"""
(C) Copyright 2018-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 appli... |
installwizard.py |
from functools import partial
import threading
from kivy.app import App
from kivy.clock import Clock
from kivy.lang import Builder
from kivy.properties import ObjectProperty, StringProperty, OptionProperty
from kivy.core.window import Window
from kivy.uix.button import Button
from kivy.utils import platform
from kivy... |
Fundus_Cam.py | ##############################################################################
######################### Fundus_Cam.py #########################
######################### Primary Author: Ebin #########################
######################### Version : 1.0 #########################
... |
server.py | import eel
import configparser
import subprocess
import threading
import sys
import os
import json
import glob
# ユーザー定義ファイル
import main
eel.init('view',allowed_extensions=['.js','.html','.css'])
@eel.expose
def on_button_clicked():
print("Button clicked[Python]")
eel.showAlert("Button clicked!")
@eel.expose
... |
CanvasServer.py | from typing import Dict, Optional, Callable, Any
from threading import Thread
import json
import os.path as ospath
from .FileServer import (
FileServer,
relative_file_handler,
absolute_file_handler,
)
from .WebsocketServer import WebsocketServer
from . import Canvas, create_canvas, DispatchEvent, ReceiveEv... |
test_core.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
#... |
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... |
controller.py | ''' Implement infrastructure for the solver to add various interfaces '''
from functools import wraps
import threading
try:
from thread import LockType
except ImportError:
from _thread import LockType
from pysph.base.particle_array import ParticleArray
import logging
logger = logging.getLogger(__name__)
clas... |
win32eventreactor.py | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
A win32event based implementation of the Twisted main loop.
This requires pywin32 (formerly win32all) or ActivePython to be installed.
To install the event loop (and you should do this before any connections,
listeners or connectors are add... |
test_coco.py | # -*- coding:utf-8 -*-
from __future__ import absolute_import
from __future__ import print_function
from __future__ import division
import os
import sys
import tensorflow as tf
import time
import cv2
import numpy as np
import json
import math
from tqdm import tqdm
import argparse
from multiprocessing import Queue, Pr... |
threads_py37.py | from time import perf_counter
from typing import Tuple, List, NamedTuple
from threading import Thread
from queue import SimpleQueue
from primes import is_prime, NUMBERS
class Result(NamedTuple): # <3>
flag: bool
elapsed: float
def check(n: int) -> Result: # <5>
t0 = perf_counter()
res = is_prime(n)... |
__init__.py | # -*- coding: utf-8 -*-
"""Miscellaneous helper functions (not wiki-dependent)."""
#
# (C) Pywikibot team, 2008-2017
#
# Distributed under the terms of the MIT license.
#
from __future__ import absolute_import, unicode_literals
__version__ = '$Id: c3e2d6f1b048f74faa4f4ae4a06a0c8518e74447 $'
import collections
import g... |
http_1_0_server_socket_client_100_continue_test.py | import test_util.proxy
import test_util.runner
import http
import http.server
import threading
import test_util.thread_safe_counter
import random
import socket
import time
if __name__ == "__main__":
request_counter = test_util.thread_safe_counter.Counter()
# This is HTTP 1.1 server that does not support pers... |
real_functions.py | from __future__ import print_function
from builtins import object
import numpy
from multiprocessing import Process, Queue
import keras
from keras import backend as K
from keras.preprocessing.image import ImageDataGenerator
from keras.models import Sequential
from keras.layers import Dense, Dropout, Activation, Flatten... |
TestThreadingLocal.py | """Test the ThreadingLocal module."""
import sys
import unittest
from threading import Thread
sys.path.insert(1, '../..')
from DBUtils.PersistentDB import local
__version__ = '1.2'
class TestThreadingLocal(unittest.TestCase):
def test0_GetAttr(self):
mydata = local()
mydata.number = 42
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.