source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
pn7150.py | # https://gist.github.com/doronhorwitz/fc5c4234a9db9ed87c53213d79e63b6c
# https://www.nxp.com/docs/en/application-note/AN11697.pdf explains how to
# setup a demo of the PN7120/PN7150. With that demo comes an executable called
# "nfcDemoApp". This gist is a proof of concept for how to read from that
# executable in Pyt... |
websockets.py | #!/usr/bin/env python
#
# Electrum-Ganja - lightweight Ganjacoin client
# Copyright (C) 2015 Thomas Voegtlin
# Copyright (C) 2018 GanjaProject
#
# 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 Softwar... |
api.py | #!/usr/bin/python3
# -*- coding: utf-8 -*-
"""
.. module:: api
:platform: Unix
:synopsis: the API of Dragonfire that contains the endpoints.
.. moduleauthor:: Mehmet Mert Yıldıran <mert.yildiran@bil.omu.edu.tr>
"""
from threading import Thread # Thread-based parallelism
import json # JSON encoder and decod... |
novelSpider.py | import time
import queue
import threading
from modules import noveldownload
from modules import search
def work(q):
while True:
if q.empty():
return
else:
r = q.get()
url = r['url']
novelName = r['name']
tid = r['index']
print... |
beo_threads.py | """Activates arm mirror, changes eyes and says a short sentence every few seconds"""
from time import sleep
from random import randint
import subprocess
import threading
from Movements import Movements
from Audio import Audio
from Eyes import Eyes
MOVEMENTS = Movements()
AUDIO = Audio()
EYES = Eyes()
def arm_mirror(... |
plotting.py | """
pyvista plotting module
"""
import collections
import logging
import os
import time
from threading import Thread
import imageio
import numpy as np
import scooby
import vtk
from vtk.util import numpy_support as VN
import pyvista
from pyvista.utilities import (convert_array, convert_string_array,
... |
map_reduce.py | r"""
Parallel computations using RecursivelyEnumeratedSet and Map-Reduce
There exists an efficient way to distribute computations when you have a set
`S` of objects defined by :func:`RecursivelyEnumeratedSet` (see
:mod:`sage.sets.recursively_enumerated_set` for more details) over which you
would like to perform the fo... |
tasks.py | import json, os, requests
# from email.MIMEImage import MIMEImage
from django.conf import settings
from django.core import mail
# from mailin import Mailin
import base64
from pprint import pprint
def send_pushnotifs(channels, message, auto_increment=True):
print ('>>> task send_pushnotifs running with channels ... |
connection.py | import time
import collections
import threading
from .session import *
class Connection(object):
def __init__(self, host, user, password, database, name, port=3306, connections=1, init_thread=True, autocommit=True):
self.__connection_pool = collections.defaultdict(list)
self.__default_pool = name
... |
FDGradient.py | '''
Copyright 2022 Airbus SAS
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
dis... |
ModelBootstrap.py | import copy
import logging
import asyncio
import threading
import sys
import queue
from concurrent.futures import ThreadPoolExecutor
#fly
from .ModelIO import ModelIO
from .ModelConfig import ModelConfig
from pprint import pprint
from .ModelManager import ModelManager
from . import ModelCreate
from . impor... |
multitester.py | """
Certbot Integration Test Tool
- Configures (canned) boulder server
- Launches EC2 instances with a given list of AMIs for different distros
- Copies certbot repo and puts it on the instances
- Runs certbot tests (bash scripts) on all of these
- Logs execution and success/fail for debugging
Notes:
- Some AWS ima... |
file_monitor.py | #
# Copyright 2021 Splunk 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 writing, so... |
ev3client.py | #!/usr/bin/python3.4
# @file ev3client.py
# @author Pavel Cherezov (cherezov.pavel@gmail.com)
import io
import os
import sys
import time
import pygame
import socket
import threading
import queue
import select
from urllib.request import urlopen
__version__ = '0.5'
import configparser
config = configparser.ConfigPars... |
core.py | import os
import time
import queue
import re
import threading
import copy
from collections import OrderedDict
import requests
import lxml.html
import multiprocessing
from .helpers import color_logging
from .url_queue import UrlQueue
from . import helpers
import csv
import requests
from os import path
from bs4 import... |
scriptrun.py | import os
import sh
import time
import threading
def invokenpm():
os.system("sudo npm start")
def invokeBrowser():
os.system("google-chrome http://localhost:8081/index.html")
t1 = threading.Thread(target=invokenpm, args=())
t2 = threading.Thread(target=invokeBrowser, args=())
t2.start()
enter_view = input("vi... |
client.py | import os
import re
import ast
import sys
import json
import uuid
import MySQLdb
import functools
import threading
import subprocess
import unicodedata
import flask, flask.views
app = flask.Flask(__name__)
# Don't do this!
app.secret_key = "bacon"
#get app directory
loc = os.getcwd()+"/"
#variables for registry
regi... |
core.py | from __future__ import absolute_import, division, print_function
from collections import deque, defaultdict
from datetime import timedelta
import functools
import logging
import six
import sys
import threading
from time import time
import weakref
import toolz
from tornado import gen
from tornado.locks import Conditio... |
uDNS.py | # 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 law or agreed to in writing, software
... |
test_requests.py | from collections import defaultdict
import gzip
import requests
import threading
import time
import zlib
from io import BytesIO
from apmserver import ServerBaseTest, ClientSideBaseTest, CorsBaseTest
class Test(ServerBaseTest):
def test_ok(self):
r = self.request_intake()
assert r.status_code == ... |
http_server.py | '''
author: g-tmp
base on python3/http.server
'''
import os
import io
import sys
import socket
import html
import urllib.parse
import mimetypes
import time
import threading
class File(object):
def get_filesize(self,file):
size_unit = ['b','K','M','G','T']
try:
size = os.path.getsize(s)
except OSError ... |
test_CatalogIndexing.py | # -*- coding: utf-8 -*-
from Acquisition import Implicit
from Products.CMFCore.indexing import getQueue
from Products.CMFCore.indexing import INDEX
from Products.CMFCore.indexing import IndexQueue
from Products.CMFCore.indexing import QueueTM
from Products.CMFCore.indexing import REINDEX
from Products.CMFCore.indexing ... |
invoker.py | #
# (C) Copyright IBM Corp. 2019
#
# 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 writi... |
hickup.py | #coding=utf8
# Copyright (C) 2013 Sony Mobile Communications AB.
# All rights, including trade secret rights, reserved.
import os
import time
import glob
import json
import signal
from ave.network.exceptions import *
from ave.network.control import RemoteControl
from ave.network.connection import *
from ave.netwo... |
data_loader.py | # Original code from https://github.com/araffin/robotics-rl-srl
# Authors: Antonin Raffin, René Traoré, Ashley Hill
import queue
import time
from multiprocessing import Queue, Process
import cv2
import numpy as np
from joblib import Parallel, delayed
from modules.config import IMAGE_WIDTH, IMAGE_HEIGHT, ROI
def pre... |
pre_commit_linter.py | # coding: utf-8
#
# Copyright 2014 The Oppia 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 requi... |
test_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 u... |
zmq_poller.py | # Copyright 2015 Mirantis, 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 ... |
download_youtube_noise.py | """
:author:
Paul Bethge (bethge@zkm.de)
2021
:License:
This package is published under Simplified BSD License.
"""
"""
A small script for downloading audio files from the "audioset" dataset using youtube-dl and ffmpeg
The list of files is passed as unbalanced_train_segments.csv
Unfortunately, the balanced_train_segm... |
python_ls.py | # Copyright 2017 Palantir Technologies, Inc.
import logging
import socketserver
import threading
from jsonrpc.dispatchers import MethodDispatcher
from jsonrpc.endpoint import Endpoint
from jsonrpc.streams import JsonRpcStreamReader, JsonRpcStreamWriter
from . import lsp, _utils, uris
from .config import config
from .... |
mapd.py | #!/usr/bin/env python
# thsi progran reads current gps location, find the road in openmaps and caculates the curves ahead
# it will publish the liveMapData message
# see https://towardsdatascience.com/loading-data-from-openstreetmap-with-python-and-the-overpass-api-513882a27fd0
# see https://wiki.openstreetmap.org/wi... |
puzzle.py | from tkinter import *
from logic import *
from random import *
import threading
from copy import deepcopy
from time import sleep
from tkinter.messagebox import showerror, showinfo
import os
SIZE = 500
GRID_LEN = 4
GRID_PADDING = 10
BACKGROUND_COLOR_GAME = "#92877d"
BACKGROUND_COLOR_CELL_EMPTY = "#9e948a... |
halperf-alt.py | #!/usr/bin/python3
import argparse
import time
from ctypes import *
from threading import Thread, Timer
# Open C shared libs to the datatypes; TODO: make spec-driven
xdc_so = None
gma_so = None
DATA_TYP_POS = 1
DATA_TYP_DIS = 2
class GapsTag(Structure):
_fields_ = [("mux", c_uint),
("sec", c_uin... |
code_execution_with_time_limit.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = 'ipetrash'
import threading
def run():
import time
i = 1
# Бесконечный цикл
while True:
print(i)
i += 1
time.sleep(1)
if __name__ == '__main__':
thread = threading.Thread(target=run, daemon=True)
thread... |
game.py | import threading
from matplotlib.pyplot import step
from numpy.core.numeric import Inf
from wheel import reel
import random
from typing import List
import time
import os
import numpy as np
__price = 0
__game_count = 0
__num_of_line = Inf
def reset():
global __game_count,__price
__price = 0
... |
handlers.py | # Copyright 2001-2015 by Vinay Sajip. All Rights Reserved.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose and without fee is hereby granted,
# provided that the above copyright notice appear in all copies and that
# both that copyright notice and this permissio... |
_keyboard_tests.py | # -*- coding: utf-8 -*-
"""
Side effects are avoided using two techniques:
- Low level OS requests (keyboard._os_keyboard) are mocked out by rewriting
the functions at that namespace. This includes a list of dummy keys.
- Events are pumped manually by the main test class, and accepted events
are tested against expecte... |
utils.py | import json
import base64
import threading
import serializer
from socket import *
from events import EmitterAsync
def _recv(self):
buffer = b""
while self.mode == "client":
packet = b""
try:
packet = socket.recv(self, 1024)
except Exception as e:
if self.mode == "closed":
re... |
Igniter.py | """
Ethan Armstrong
warmst@uw.edu
Implements the Igniter class
"""
import RPi.GPIO as GPIO
import time
from multiprocessing import Process
class Igniter():
"""
Igniter object, capable of sending a pulse down a specified GPIO pin on a raspberry pi
"""
def __init__(this, pin):
"""
Igniter... |
__init__.py | # -*- coding: utf-8 -*-
# core
from optparse import OptionParser
import fnmatch
from multiprocessing import Process, Pipe
from itertools import izip
import os
import json
# non-core
import paramiko
DEFAULT_HOST_LIST = '~/.ansible_hosts' #ansible的hosts配置
DEFAULT_MODULE_PATH = '~/ansible' #外置模块存放目录
DEFAULT_... |
global_handle.py | #!/usr/bin/python
'''
(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 applic... |
espresso-mpc.py | #!/usr/bin/python
def he_control_loop(dummy, state):
from time import sleep
from datetime import datetime, timedelta
import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BCM)
GPIO.setup(conf.he_pin, GPIO.OUT)
GPIO.output(conf.he_pin,0)
try:
while True:
control_signal = state['control_signal']
# P... |
2_dance_mixer.py | from __future__ import print_function
from threading import Semaphore, Lock, Thread
from collections import deque
import random
from time import sleep
import time
from timeit import Timer
import itertools
import sys
import logging
#L = int(input('Number of Leaders:'))
#F = int(input('Number of Followers:'))
L = int(s... |
python_threads.py | #!/usr/bin/env python
import time
import threading
def ticker():
while 42:
print("Tick!")
time.sleep(1)
thread = threading.Thread(target=ticker)
thread.daemon = True
thread.start()
# Or using sublcassing:
class TickerThread(threading.Thread):
def run(self):
while 42:
pri... |
bot.py | import os, time
import logging
import threading
from telegram import ReplyKeyboardMarkup, ReplyKeyboardRemove, Update
from telegram.ext import Updater, CommandHandler, MessageHandler, Filters, CallbackContext, ConversationHandler
from PIL import Image, ImageOps
from dataclasses import dataclass
from methods import gan... |
client_console.py | import socket, threading
class Client():
def __init__(self):
self.cli_sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
self.thread_send = threading.Thread(target = self.send)
self.thread_receive = threading.Thread(target = self.receive)
def StartClient(self):
HOST = 'lo... |
multipor.py | # in window and apple application is the multiprocedd avariable
# but in linux is that not quite easy and everything looks different
import multiprocessing
import time
start = time.perf_counter() # reletive time when the computer opens
print(start)
def do_something():
print('start sleep')
time.sleep(1)
... |
util.py | # -*- coding: utf-8 -*-
import random
import re
import string
import sys
import threading
import traceback
import warnings
import functools
import six
from six import string_types
# Python3 queue support.
try:
import Queue
except ImportError:
import queue as Queue
import logging
try:
import PIL
from... |
index.py | #!/usr/bin/pypy3
#!/usr/bin/python3
import mysql.connector
import json
import cgi
from urllib.request import Request, urlopen
from datetime import datetime, timedelta
from threading import Thread
def commit(company_number, output, cursor, cnx):
# Commit to database
sql1 = "DELETE FROM nzcompaniesoffice WHERE ... |
email.py | # -*- coding: utf-8 -*-
_author_ = 'Pylar'
from threading import Thread
from flask import current_app, render_template
from flask_mail import Message
from . import mail
def send_async_email(app, msg):
with app.app_context():
mail.send(msg)
def send_email(to, subject, template, **kwargs):
app = current... |
sh.py | """
http://amoffat.github.io/sh/
"""
#===============================================================================
# Copyright (C) 2011-2015 by Andrew Moffat
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to dea... |
multiple_instances_advance.py | #!/usr/bin/env python3
import os
from random import choice, random
from time import sleep, time
import vizdoom as vzd
# For multiplayer game use process (ZDoom's multiplayer sync mechanism prevents threads to work as expected).
from multiprocessing import cpu_count, Process
# For singleplayer games threads can also ... |
FileList.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
#
# Copyright © 2018 Dell Inc. or its subsidiaries. All rights reserved.
# Dell, EMC, and other trademarks are trademarks of Dell Inc. or its subsidiaries.
# Other trademarks may be trademarks of their respective owners.
#
# Licensed under the Apache License, Ver... |
interface_rpc.py | #!/usr/bin/env python3
# Copyright (c) 2018-2020 The Ludirium Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Tests some generic aspects of the RPC interface."""
import os
from test_framework.authproxy import JS... |
Core.py | import threading
from multiprocessing import Queue
class Core:
def __init__(self):
self.threads = []
def add_process(self, function_called_object, process_priority, process_name, thread_name = None):
if not thread_name:
thread_name = function_called_object.__name__
p... |
async_checkpoint.py | # Copyright 2018 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... |
plotting.py | """PyVista plotting module."""
import collections.abc
import ctypes
from functools import wraps
import io
import logging
import os
import pathlib
import platform
import textwrap
from threading import Thread
import time
from typing import Dict
import warnings
import weakref
import numpy as np
import scooby
import pyvi... |
pyrebase.py | import requests
from requests import Session
from requests.exceptions import HTTPError
try:
from urllib.parse import urlencode, quote
except BaseException:
from urllib import urlencode, quote
import json
import math
from random import uniform
import time
from collections import OrderedDict
from sseclient impor... |
search.py | from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from time import sleep, time
import pandas as pd
from threading import Thread
import requests
import re
from random import random
# choose a driver
wd = webdriver.Chrome()
# specify the the wait time for a new page to be fully loaded
wait_... |
login.py | import os, sys, time, re, io
import threading
import json, xml.dom.minidom
import copy, pickle, random
import traceback, logging
try:
from httplib import BadStatusLine
except ImportError:
from http.client import BadStatusLine
import requests
import datetime
from pyqrcode import QRCode
from .. im... |
index.py | # -*- coding: utf-8 -*-
"""
MIT License
Copyright (c) 2020 gomashio1596
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 us... |
runteststorage.py | from __future__ import unicode_literals
import socket
import multiprocessing
from django.core.management.base import BaseCommand, CommandError
import logging
logger = logging.getLogger(__name__)
class Socket:
'''demonstration class only
- coded for clarity, not efficiency
'''
close_bit = "\x00"
... |
autoreload.py | # -*- coding: utf-8 -*-
#
# Copyright (C) 2006-2018 Edgewall Software
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://trac.edgewall.org/wiki/TracLicense.
#
# This software consi... |
qsym.py | import ConfigParser
import multiprocessing
import subprocess
import os
import sys
import utils
import shutil
import signal
import tempfile
from utils import bcolors
from utils import mkdir, mkdir_force
import qsym_minimizer as minimizer
from qsym_executor import Executor
DEFAULT_TIMEOUT = 90
TARGET_FILE = utils.AT_FIL... |
server.asyncio.py |
#
# Copyright (c) 2020, 2021, John Grundback
# All rights reserved.
#
import sys
import os
import logging
logging.basicConfig(level=logging.INFO)
# logging.basicConfig(level=logging.DEBUG)
import simplejson as json
from flask import Flask
from flask_restful import Api
from flask_cors import CORS, cross_origin
fr... |
closest_goal3.py | #! /usr/bin/env python3
import rospy
from time import time, sleep
from datetime import datetime
from ar_track_alvar_msgs.msg import AlvarMarkers
from control import *
from callback import get_drone_location
N = 3
(goalx_d, goaly_d, d) = (dict(), dict(), dict())
goal = {}
goal[0] = {'x': [0.59, 0.07], 'y': [-0.016, 0... |
test_multiprocess.py | # -*- coding: utf-8 -*-
# ----------------------------------------------------------------------------
# Copyright (c) 2005-2021, PyInstaller Development Team.
#
# Distributed under the terms of the GNU General Public License (version 2
# or later) with exception for distributing the bootloader.
#
# The full license is... |
__init__.py | """The initialization file for the Pywikibot framework."""
#
# (C) Pywikibot team, 2008-2021
#
# Distributed under the terms of the MIT license.
#
import atexit
import datetime
import math
import re
import threading
import time
from contextlib import suppress
from decimal import Decimal
from queue import Queue
from ty... |
patcher_test.py | import os
import shutil
import sys
import tempfile
import six
import tests
base_module_contents = """
import socket
import urllib
print("base {0} {1}".format(socket, urllib))
"""
patching_module_contents = """
from eventlet.green import socket
from eventlet.green import urllib
from eventlet import patcher
print('pa... |
fetcher.py | from __future__ import division
import logging
from time import time, sleep
from datetime import datetime, timedelta
from threading import Thread
from multiprocessing import Process
import os
# @modified 20191115 - Branch #3262: py3
# from os import kill, getpid
from os import kill
import traceback
import re
from sys i... |
keep_alive.py | from flask import Flask
from threading import Thread
app = Flask('')
@app.route('/')
def home():
return "Hello. Pog!"
def run():
app.run(host='0.0.0.0',port=8080)
def keep_alive():
t = Thread(target=run)
t.start() |
botmasterclient.py | #-*-coding: utf-8-*-
from socket import *
import threading
from os import system, getcwd
from getpass import getpass
from time import sleep
from platform import system as s
class Botmaster:
def __init__(self):
os = s()
if os == "Windows":
self.clean = "cls"
else:
self.clean = "clear"
def conn2bot(self, i... |
actor_worker.py | import signal
import time
from queue import Empty
import numpy as np
import psutil
import torch
from gym.spaces import Discrete, Tuple
from torch.multiprocessing import Process as TorchProcess
from algorithms.base.actor_worker import ActorWorkerBase
from algorithms.dqn.dqn_utils import TaskType, make_env_func, set_gp... |
http_test.py | #! /usr/bin/env python
from datetime import datetime
from httplib import HTTPConnection
from json import dumps, loads
from sys import argv
from threading import Thread
from time import sleep, time as now
from unittest import main, TestCase
from uuid import uuid1
FACTS = [{"headline": "Aliens Land", "body": "They just... |
timeout.py | import sys
import threading
class KThread(threading.Thread):
"""A subclass of threading.Thread, with a kill()
method.
Come from:
Kill a thread in Python:
http://mail.python.org/pipermail/python-list/2004-May/260937.html
"""
def __init__(self, *args, **kwargs):
threading.Thread.__init__(self, *args, **kwar... |
video_utils.py | #############################################################################
#
# VFRAME
# MIT License
# Copyright (c) 2020 Adam Harvey and VFRAME
# https://vframe.io
#
#############################################################################
from pathlib import Path
from datetime import datetime
import time
fro... |
test_spark_dataset_converter.py | # Copyright (c) 2020 Databricks, 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... |
core_test.py | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
object_detection_node.py | #################################################################################
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. #
# #
# Licensed under the Apache License, Version 2.0 (the "License"). ... |
graphics.py | #!/usr/bin/python3
import numpy as np
from PIL import Image
import time
import threading
def save_image(x, path):
im = Image.fromarray(x)
im.save(path, optimize=True)
# Assumes [NCHW] format
def save_raster(x, path, rescale=False, width=None):
t = threading.Thread(target=save_raster, args=(x, path, resc... |
test_memcached_backend.py | from ._fixtures import _GenericBackendTest, _GenericMutexTest
from . import eq_, winsleep
from unittest import TestCase
from threading import Thread
import time
from nose import SkipTest
from dogpile.cache import compat
class _TestMemcachedConn(object):
@classmethod
def _check_backend_available(cls, backend):... |
plot_mode_base.py | from __future__ import print_function, division
from pyglet.gl import *
from plot_mode import PlotMode
from threading import Thread, Event, RLock
from color_scheme import ColorScheme
from sympy.core import S
from sympy.core.compatibility import is_sequence
from time import sleep
import warnings
class PlotModeBase(Pl... |
keylogger.py | # import needed modules
import os
import getpass
from datetime import datetime
#import pyxhook
import traceback
import threading
import argparse
import time
#import clipboard
import logging
import re
import struct
from shutil import copyfile
userIn = [] # string buffer before storing in file (during RETURN)
currInde... |
core_test.py | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
test_enum.py | import enum
import inspect
import pydoc
import sys
import unittest
import threading
from collections import OrderedDict
from enum import Enum, IntEnum, StrEnum, EnumMeta, Flag, IntFlag, unique, auto
from io import StringIO
from pickle import dumps, loads, PicklingError, HIGHEST_PROTOCOL
from test import support
from te... |
main.py | from __future__ import print_function
import argparse
import os
import torch
import torch.multiprocessing as mp
import my_optim
from envs import create_atari_env
from network import ActorCriticFFNetwork
from test import test
from train import train
from constants import RMSP_EPSILON
from constants import RMSP_ALPHA
... |
add_kml.py | #!/usr/bin/env python
from std_msgs.msg import String
from lg_common.srv import USCSMessage
from interactivespaces_msgs.msg import GenericMessage
import SimpleHTTPServer
import SocketServer
import threading
import tempfile
import rospy
import json
import copy
import os
DEFAULT_VIEWPORTS = ['left_three', 'left_two', ... |
test_api.py | # Copyright (c) 2017 Red Hat, 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 ... |
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, Union, Dict
from... |
autossh.py | #!/usr/bin/env python3
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
from __future__ import unicode_literals
import os
import time
import sys
import threading
from subprocess import Popen, PIPE, STDOUT
import traceback
import json
import argparse
import re... |
cli.py | import ast
import inspect
import os
import platform
import re
import sys
import traceback
import warnings
from functools import update_wrapper
from operator import attrgetter
from threading import Lock
from threading import Thread
import click
from werkzeug.utils import import_string
from .globals import current_app
... |
k8s.py | from __future__ import print_function, division, unicode_literals
import base64
import functools
import json
import logging
import os
import re
import subprocess
import tempfile
from copy import deepcopy
from pathlib import Path
from threading import Thread
from time import sleep
from typing import Text, List, Callabl... |
func.py | from genericpath import exists
import os
import threading
import sqlite3
from datetime import datetime
from PyQt5.QtCore import QObject, pyqtSlot, pyqtSignal
class Backend(QObject):
def __init__(self):
super().__init__()
self.officer = ''
returnNames = pyqtSignal(list, arguments=['returnRes... |
test_package.py | import sublime
import sublime_plugin
import sys
import os
import logging
from unittest import TextTestRunner, TestSuite
from .core import TestLoader, DeferringTextTestRunner, DeferrableTestCase
from .mixin import UnitTestingMixin
from .const import DONE_MESSAGE
from .utils import ProgressBar, StdioSplitter
import threa... |
http_com.py | from __future__ import print_function
import base64
import copy
import json
import logging
import os
import random
import ssl
import sys
import time
from builtins import object
from builtins import str
from typing import List
from flask import Flask, request, make_response, send_from_directory
from pydispatch import ... |
wamp.py | """ WAMP networking. """
import asyncio
from queue import Queue
from threading import Thread
from autobahn.asyncio.wamp import ApplicationRunner, ApplicationSession
from autobahn.wamp.types import PublishOptions
class WampMoles(object):
def __init__(self):
self._thread = None
self._loop = asynci... |
ruida.py | import logging
from enum import Enum
import time
from ruida_core import get_checksum, swizzle, unswizzle, ruida_bytes_to_unsigned
from socket import socket, AF_INET, SOCK_DGRAM, timeout as SocketTimeout
from multiprocessing import Process, Lock, Value
logger = logging.getLogger(__name__)
class MSGTypes(Enum):
MS... |
fluffy.pyw | #! /usr/bin/env python3
"""""
"Pink Donut" design was designed by fourminute exclusively for
Fluffy and does not infringe on any copyright.
Copyright (c) 2019 fourminute (https://github.com/fourminute)
Fluffy is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License... |
__init__.py | # Copyright (C) 2013 Jaedyn K. Draper
#
# 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, di... |
policy_server_input.py | import logging
import queue
import threading
import traceback
from http.server import SimpleHTTPRequestHandler, HTTPServer
from socketserver import ThreadingMixIn
import ray.cloudpickle as pickle
from ray.rllib.offline.input_reader import InputReader
from ray.rllib.env.policy_client import PolicyClient, \
create_... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.