source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
run.py | import os
import time
import shutil
import torch
import numpy as np
import numpy.random as rd
import multiprocessing as mp
from env import build_env
from replay import ReplayBuffer, ReplayBufferMP, ReplayBufferMARL
from evaluator import Evaluator
from tqdm import tqdm
"""[ElegantRL.2021.09.09](https://github.com/AI4F... |
__init__.py | import functools
import io
import logging
import mimetypes
import os
import os.path
import pathlib
import posixpath
import re
import socketserver
import string
import threading
import time
import warnings
import wsgiref.simple_server
import watchdog.events
import watchdog.observers.polling
_SCRIPT_TEMPLATE = """
var ... |
vaitracePyRunner.py | #!/usr/bin/python3
# -*- coding: UTF-8 -*-
# Copyright 2019 Xilinx 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... |
dlfuncs.py | import os
import shutil
import json
import threading
import time
from xml.dom.minidom import parseString
from instagram_private_api import ClientConnectionError
from instagram_private_api import ClientError
from instagram_private_api import ClientThrottledError
from instagram_private_api_extensions import live
from i... |
funcs.py | import os
import sys
import traceback
import pwd
import logging
import time
import json
import pickle as pickle
from random import Random
from queue import Empty
from lxml.etree import _ElementStringResult, _Element, tostring, fromstring
from celery.exceptions import SoftTimeLimitExceeded
from sciflo.utils import copy... |
default.py | # Copyright 2018 Microsoft Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... |
__init__.py | # -*- coding: utf-8 -*-
# *****************************************************************************
# NICOS, the Networked Instrument Control System of the MLZ
# Copyright (c) 2009-2022 by the NICOS contributors (see AUTHORS)
#
# This program is free software; you can redistribute it and/or modify it under
# the t... |
virtualcenter.py | # coding: utf-8
"""Backend management system classes
Used to communicate with providers without using CFME facilities
"""
from __future__ import absolute_import
import atexit
import operator
import re
import ssl
import threading
import time
from datetime import datetime
from distutils.version import LooseVersion
from... |
Follower.py | import importlib
import time
import threading
import pandas as pd
import os
from requests import exceptions
from json import decoder
from GetHistory import CrpytoCompare
from datetime import datetime, timedelta
from Markets import APIKeys
class Follower(object):
def __init__(self, live_sleep_secs=10, hist_sleep_s... |
test_examples.py | import itertools
import multiprocessing
import runpy
import sys
from os import path as osp
import pytest
def run_main(*args):
# patch sys.args
sys.argv = list(args)
target = args[0]
# run_path has one difference with invoking Python from command-line:
# if the target is a file (rather than a dire... |
parallel_validation.py | # Copyright BigchainDB GmbH and BigchainDB contributors
# SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0)
# Code is Apache-2.0 and docs are CC-BY-4.0
import multiprocessing as mp
from collections import defaultdict
from abci.types_pb2 import ResponseCheckTx, ResponseDeliverTx
from bigchaindb import BigchainDB, A... |
addition.py |
import wave,pyaudio
import threading,queue
import time
import socket
import math
import tempfile
import os
import gc
class WrongOperation(Exception):pass
class PathError(Exception):pass
class NetworkError(Exception):pass
## No "receive" >> can "send"
## No "send" >> "receive" wait
class Client(object):
'''
... |
startup.py | from threading import Thread, Semaphore
from pydub import AudioSegment
from pydub.playback import play
from os import walk
from datetime import datetime
from datetime import timedelta
from time import sleep
from flask import Flask, send_file, jsonify, make_response, request, send_from_directory, redirect
from l... |
MLPLive.py | import netifaces
import pyshark
import os
import csv
import multiprocessing
import pandas as pd
import subprocess
from scipy.io import arff
import threading
import time
import random
import logging
import mysql.connector
from shutil import copyfile, rmtree
from sklearn.model_selection import train_test_split
from keras... |
random_guess_benchmark.py | from __future__ import print_function
import pandas as pd
import pickle as pk
import numpy as np
import time
import random
import threading
import json
from sklearn.cross_validation import train_test_split
# load configuration
with open('../../config.json', 'rb') as f:
config = json.load(f)
mainImPath = config['i... |
arp.py | import threading
from scapy.all import *
import time
from src.log import log
class ARP_Spoofer(threading.Thread):
"""Thread of the ARP Spoofing module.
Sends ARP packets to a target in order to poison its cache. This way a
MiTM attack can be performed, or the target can be disconnected.
IP Forwardin... |
app.py | # encoding: utf-8
"""
A REST API for Salt
===================
.. py:currentmodule:: salt.netapi.rest_cherrypy.app
:depends:
- CherryPy Python module.
Note: there is a `known SSL traceback for CherryPy versions 3.2.5 through
3.7.x <https://github.com/cherrypy/cherrypy/issues/1298>`_. Please use
... |
starlette_test.py | import pytest
from multiprocessing import Process
from common import send_requests, mode_list, kwargs_list
def server_process(port, mode, **kwargs):
import uvicorn
from starlette.applications import Starlette
from starlette.routing import Route
from starlette.responses import PlainTextResponse
... |
sample.py | #!/usr/bin/env python3
import time
import RPi.GPIO as GPIO
import threading
from EbOled import EbOled
from VCNL4020 import VCNL4020
BUZZER = 18
term = False
sensor = VCNL4020()
oled = EbOled()
oled.begin()
oled.clear()
oled.display()
def prox():
global term
GPIO.setmode(GPIO.BCM)
GPIO.setup(BUZZER, GPIO.OUT)... |
joint_trajectory_action_controller.py | # -*- coding: utf-8 -*-
#
# Software License Agreement (BSD License)
#
# Copyright (c) 2010-2011, Antons Rebguns.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source... |
vrtderived.py | #!/usr/bin/env pytest
# -*- coding: utf-8 -*-
###############################################################################
# $Id$
#
# Project: GDAL/OGR Test Suite
# Purpose: Test AddBand() with VRTDerivedRasterBand.
# Author: Antonio Valentino <a_valentino@users.sf.net>
#
########################################... |
variable_scope.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... |
bdixChecker.py | import os
import sys
###Kivy main library###
from kivy.app import App
from kivy.lang import Builder
from kivy.clock import Clock
###Kivy material design library###
from kivymd.dialog import MDInputDialog, MDDialog
from kivymd.theming import ThemeManager
from kivymd.toast.kivytoast import toast
from kivymd.navigation... |
test_server.py | import os
from multiprocessing.managers import DictProxy
from pathlib import Path
from unittest.mock import Mock, ANY
import requests
import time
import uuid
from typing import List, Text, Type, Generator, NoReturn, Dict
from contextlib import ExitStack
from _pytest import pathlib
from aioresponses import aiorespons... |
test_mom_collections.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2011 Yesudeep Mangalapilly <yesudeep@gmail.com>
# Copyright 2012 Google Inc. 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 ... |
junit_cmd_wrapper.py | #!/usr/bin/env python
# ----------------------------------------------------------------------------
# Copyright 2016-2017 ARM 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
#
# ... |
DLProgress.py |
import time, os
from . import DLProcessor
from .packer import Packer
import gc
class TimeStatus(Packer, object):
def __init__(self):
self.go_startTime = None
self.go_pauseTime = None
self.go_lastTime = 0
self.go_end = False
self.pauseflag = False
self.endflag = ... |
scheduler.py | import os
import threading
import time
import sublime
import sublime_plugin
from .utils import JsonFile
class Unit:
def __init__(self, s):
self.package = s['package']
self.output = s.get('output', None)
self.syntax_test = s.get('syntax_test', False)
self.syntax_compatibility = s.... |
blockchain.py | from flask import Flask, render_template, request, jsonify, make_response, send_file
import hashlib
import time
import json
import threading
import requests # for sending new block to other nodes
import pandas as pd
import uuid
from sqlalchemy import create_engine # for database connection
from Crypto.PublicKey impor... |
shelly.py | # -*- coding: utf-8 -*-
from base import (Application, Plugin, implements, Settings)
from datetime import timedelta
from threading import Thread
from telldus import DeviceManager, Device
from telldus.web import IWebReactHandler
from web.base import IWebRequestHandler, Server, WebResponseJson
import logging
from loggi... |
test_advanced.py | # coding: utf-8
from concurrent.futures import ThreadPoolExecutor
import json
import logging
import random
import sys
import threading
import time
import os
import numpy as np
import pytest
import ray.cluster_utils
import ray._private.profiling as profiling
from ray._private.test_utils import (client_test_enabled,
... |
Listen.py | #!/usr/bin/python
#$Id$
# "Copyright (c) 2000-2003 The Regents of the University of California.
# All rights reserved.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose, without fee, and without written agreement
# is hereby granted, provided that the above cop... |
test_ssl.py | # Test the support for SSL and sockets
import sys
import unittest
from test import test_support
import asyncore
import socket
import select
import time
import gc
import os
import errno
import pprint
import urllib, urlparse
import traceback
import weakref
import functools
import platform
from BaseHTTPServer import HTT... |
test_query_node_scale.py | import threading
import time
import pytest
from base.collection_wrapper import ApiCollectionWrapper
from common.common_type import CaseLabel
from customize.milvus_operator import MilvusOperator
from common import common_func as cf
from common import common_type as ct
from scale import constants
from pymilvus import I... |
necomimi_viewer.py | #!/usr/bin/env python
# coding:utf-8
#
# necomimi_viewer.py
#
# Author: Hiromasa Ihara (miettal)
# URL: http://miettal.com
# License: MIT License
# Created: 2014-10-04
#
import sys
import os
import threading
import matplotlib.pyplot as plt
import matplotlib.animation as animation
import thinkgear
import vario... |
strdd.py | import os,random
import time
import re
import requests
import threading
from requests.exceptions import HTTPError
import json
import sys,configparser
from multiprocessing import Process
import aiohttp,asyncio
import nest_asyncio
nest_asyncio.apply()
proxies = {}
justone = 1
dRooms = []
hRooms = []
dpath... |
reduction.py | #
# Module to allow connection and socket objects to be transferred
# between processes
#
# multiprocessing/reduction.py
#
# Copyright (c) 2006-2008, R Oudkerk
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditio... |
worker.py | import argparse
import time
import threading
import logging
from deep_architect.searchers import common as se
from deep_architect import search_logging as sl
from deep_architect import utils as ut
from deep_architect.contrib.misc.evaluators.tensorflow.tpu_estimator_classification import TPUEstimatorEvaluator
from se... |
approvals_test.py | #!/usr/bin/env python
"""Tests for API client and approvals-related API calls."""
import threading
import time
from grr.gui import api_auth_manager
from grr.gui import api_call_router_with_approval_checks
from grr.gui import api_e2e_test_lib
from grr.lib import flags
from grr.server import access_control
from grr.se... |
leading_line.py | import pglive.examples_pyqt5 as examples
from pyqtgraph import mkPen
from threading import Thread
import pyqtgraph as pg
from pglive.kwargs import LeadingLine
from pglive.sources.data_connector import DataConnector
from pglive.sources.live_plot import LiveLinePlot, LiveScatterPlot, LiveHBarPlot, LiveVBarPlot
from pg... |
xiami.py | #!/usr/bin/env python
# -*- coding:utf-8 _*-
"""
@author: HJK
@file: xiami.py
@time: 2019-01-21
从虾米搜索和下载音乐
"""
import threading
import requests
from .. import config
from ..exceptions import RequestError, ResponseError, DataError
from ..music import Music
__all__ = ["xiami_search", "xiami_download"]
def xiami_sea... |
websocket_client_handler.py | import websockets
import queue
import time
import asyncio
import threading
import uuid
import logging
import json
class Timer:
def __init__(self, timeout, callback, *args, **kwargs):
self.timeout = timeout
self.callback = callback
self.args = args
self.kwargs = kwargs
self.... |
grab_api.py | # coding: utf-8
from unittest import TestCase
from grab.util.py3k_support import *
from grab import GrabMisuseError
from test.util import ignore_transport, only_transport, build_grab
from test.server import SERVER
#from grab.util.py3k_support import *
class GrabApiTestCase(TestCase):
def setUp(self):
SER... |
test_failure.py | import logging
import os
import sys
import tempfile
import threading
import time
import numpy as np
import pytest
import redis
import ray
import ray.ray_constants as ray_constants
from ray.exceptions import RayTaskError
from ray.cluster_utils import Cluster
from ray.test_utils import (
wait_for_condition,
Sig... |
mixins.py | # -*- coding: utf-8 -*-
'''
:codeauthor: Pedro Algarvio (pedro@algarvio.me)
=============
Class Mix-Ins
=============
Some reusable class Mixins
'''
# pylint: disable=repr-flag-used-in-string
# Import python libs
from __future__ import absolute_import, print_function
import os
import sys
import t... |
pricingsvc.py | from flask import Flask, jsonify
from flask import request
import subprocess
import threading
import time
from threading import Thread
import socket
import pdb
import logging
import json
import requests
import sys
import os
from logging import handlers, Formatter
app = Flask(__name__)
PriceData = {}
Disclaimer = 'This... |
irc.py | #coding: utf8
"""
irc.py - An Utility IRC Bot
Copyright 2008, Sean B. Palmer, inamidst.com
Copyright 2012, Edward Powell, http://embolalia.net
Copyright © 2012, Elad Alfassa <elad@fedoraproject.org>
Licensed under the Eiffel Forum License 2.
Willie: http://willie.dftba.net/
When working on core IRC protocol related ... |
http.py | import logging
import base64
import sys
import random
import os
import ssl
import time
import copy
import json
import sys
from pydispatch import dispatcher
from flask import Flask, request, make_response, send_from_directory
# Empire imports
from lib.common import helpers
from lib.common import agents
from lib.common i... |
batch_transcribe.py | """
Batch Audio Transcription script using kalidserve.
Usage: batch_transcribe.py <model-spec-toml> <audio-paths-file>
"""
import time
import threading
from io import BytesIO
from typing import List, Text
from docopt import docopt
import kaldiserve as ks
def transcribe(decoder: ks.Decoder, wav_stream: bytes) -> Li... |
profiler.py | import logging
import time
import threading
from pyloadlimiter import LoadLimiter, CompositeLoadLimiter
from datetime import datetime, timedelta
from matplotlib import pyplot
from matplotlib.animation import FuncAnimation
from random import gauss
import unicodedata
import re
logging.basicConfig(format='%(asctime)s %(... |
runtime_manager_dialog.py | #!/usr/bin/env python
"""
Copyright (c) 2015, Nagoya University
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
... |
trezor.py | import traceback
import sys
from typing import NamedTuple, Any
from electrum.util import bfh, bh2u, versiontuple, UserCancelled, UserFacingException
from electrum.bitcoin import TYPE_ADDRESS, TYPE_SCRIPT
from electrum.bip32 import BIP32Node, convert_bip32_path_to_list_of_uint32 as parse_path
from electrum import const... |
engine.py | import AO3
import enum
import logging
import os
import sys
import threading
import time
from pathlib import Path
from queue import Queue
from AO3 import GuestSession, Series, Session, User, Work
from dataclasses import dataclass
from slugify import slugify
from threading import Lock, Thread, Timer
from t... |
AlaskaServer.py | """Contains the AlaskaServer class.
The AlaskaServer class is the backbone of Alaska, the automatic, complete
RNA-seq analysis platform. The server integrates various quality control
software, along with Kallisto for read alignment/quantification and Sleuth
for differential expression analysis. The AlaskaServer packag... |
utility.py | import os
import math
import time
import datetime
from multiprocessing import Process
from multiprocessing import Queue
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import numpy as np
import imageio
import torch
import torch.optim as optim
import torch.optim.lr_scheduler as lrs
class time... |
basic_threading.py | import threading
import time
import random
SLEEP = True
counter = 0
# Making race conditions visible by introducing sleep time periods
def sleep_for_a_while():
if SLEEP:
time.sleep(random.random())
def worker():
global counter
sleep_for_a_while()
old_counter = counter
sleep_for_a_while... |
s3op.py | from __future__ import print_function
import json
import time
import math
import sys
import os
import traceback
from hashlib import sha1
from tempfile import NamedTemporaryFile
from multiprocessing import Process, Queue
from itertools import starmap, chain, islice
from boto3.s3.transfer import TransferConfig
try:
... |
views.py | # coding: utf-8
import timeout_decorator
from flask import make_response
from flask import request
from flask import redirect
from flask import abort
from flask import render_template
from flask import jsonify
from flask import url_for
from flask import Response
from flask import send_file
from flask import g
from fla... |
run_experiment_sudri.py | #!/usr/bin/env python
import grip_and_record.inverse_kin
from geometry_msgs.msg import (
PoseStamped,
Pose,
Point,
Quaternion,
)
from data_recorder import DataRecorder
from grip_and_record.robot_utils import Orientations
import rospy
import intera_interface
from intera_interface import CHECK_VERSION... |
__init__.py | # Copyright (c) 2020. borik.internet@gmail.com
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merg... |
pgqueue.py | # -*- coding: utf-8 -*-
"""Light PgQ framework.
Stripped from Skytools 3.
"""
import logging
import time
from operator import itemgetter
import psycopg2
import psycopg2.extras
__version__ = '0.6'
__all__ = ['Event', 'Batch', 'Consumer', 'Queue', 'Ticker',
'bulk_insert_events', 'insert_event']
class _Dis... |
test_start_instance_with_failed_jobs.py | import multiprocessing
import os
import time
from tests.constants import Image, InstanceType
from tests.test_utils import TestUtils, TestWrapper
# Workflow
def test_user_start_instance_and_process_one_batch_of_jobs_that_end_up_failing():
file = os.path.dirname(os.path.abspath(__file__)) + '/files/invalid_func_p... |
003_local_threading.py | import threading
print(threading.active_count())
current = threading.current_thread()
print(current.getName())
print(current.is_alive())
try:
current.start()
except RuntimeError as e:
print('ERROR: {error}'.format(error=e))
# current.setName('SuperThread')
# print(current.getName())
current.name = 'SuperThr... |
pokedexServer.py | import zmq
import json
from threading import Thread
import time
database = "database/"
databaseMoves = "database/moves/"
pokemonListFile = database+"!listOfPokemon.txt"
bootReq = "boot"
bootStart = "start"
bootEnd = "end"
jsonTrue = "TRUE"
jsonFalse = "FALSE"
createReq = "create"
reqData = "data"
successResp = "suc... |
conftest.py | import random
import string
import time
from multiprocessing import Process
import pytest
import uvicorn
from app.database import data
from app.main import app
def run_server():
uvicorn.run(app)
@pytest.fixture(scope="module")
def host():
return "127.0.0.1:8000"
@pytest.fixture(scope="module")
def crede... |
servers.py | import os
from http.server import HTTPServer, SimpleHTTPRequestHandler
import multiprocessing
import signal
import time
from django.core.servers import basehttp
from django.core.wsgi import get_wsgi_application
import pytest
@pytest.fixture
def run_django_server():
# Run a Django server in a process
def runner():
... |
test_io.py | """Test whether Skyfield handles file download and file age correctly."""
import os
import shutil
import tempfile
from contextlib import contextmanager
from threading import Thread
try:
from Queue import Queue
except ImportError:
from queue import Queue
try:
from unittest.mock import patch
except ImportErr... |
TCP.py | import socket
import threading
import db
class ThreadedServer(object):
def __init__(self, host, port, testID):
self.host = host
self.port = port
self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
self.sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
se... |
service.py | import base64
import datetime
import os
import random
import re
import sys
import tempfile
import threading
import unicodedata
import zipfile
from itertools import chain
from os.path import join
from django.conf import settings
from django.core.files.storage import FileSystemStorage
from rest_framework import exceptio... |
common.py | """Test the helper method for writing tests."""
from __future__ import annotations
import asyncio
from collections import OrderedDict
from collections.abc import Awaitable, Callable, Collection
from contextlib import contextmanager
from datetime import datetime, timedelta
import functools as ft
from io import StringIO... |
cmd_tasks.py | #!/usr/bin/env python
#
# cmd_tasks.py
#
# Copyright (C) 2020 IMTEK Simulation
# Author: Johannes Hoermann, johannes.hoermann@imtek.uni-freiburg.de
#
# 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 So... |
word2vec.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2013 Radim Rehurek <me@radimrehurek.com>
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
"""
Produce word vectors with deep learning via word2vec's "skip-gram and CBOW models", using either
hierarchical softmax or negative samp... |
client_engine.py | # Copyright (c) 2021, NVIDIA 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 agreed to... |
nowe.py | #!/usr/bin/env python3
# rpi_ws281x library strandtest example
# Author: Tony DiCola (tony@tonydicola.com)
#
# Direct port of the Arduino NeoPixel library strandtest example. Showcases
# various animations on a strip of NeoPixels.
import argparse
from threading import Thread, Lock
import threading
import time
from rp... |
GameDispatcher.py | # -*- coding: Utf-8 -*-
from queue import Queue
from threading import Thread
import subprocess
import time
from sys import stderr,argv
from inspect import currentframe, getframeinfo
debug = False
display = False
timeout = 1
class Program(object):
instances = []
def __init__(self, name, command):
... |
joy_teleop.py | #!/usr/bin/env python
import importlib
import rospy
import genpy.message
from rospy import ROSException
import sensor_msgs.msg
import actionlib
import rostopic
import rosservice
from threading import Thread
from rosservice import ROSServiceException
class JoyTeleopException(Exception):
pass
class JoyTeleop:
... |
server.py | import logging
from flask import Flask, render_template, request, redirect
from werkzeug.security import generate_password_hash, check_password_hash
from flask_cors import CORS
import threading
import json
from flask_login import (
LoginManager,
login_user,
login_required,
logout_user,
current_user... |
evaluate_tflite.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function
import absl.app
import argparse
import numpy as np
import wave
import csv
import os
import sys
from deepspeech import Model
from deepspeech_training.util.evaluate_tools import calculate_and_print_report
from... |
post_processing_gw.py | #------------------------------------------------------------
# Copyright 2017-19 Congduc Pham, University of Pau, France.
#
# Congduc.Pham@univ-pau.fr
#
# This file is part of the low-cost LoRa gateway developped at University of Pau
#
# This program is free software: you can redistribute it and/or modify
# it under... |
curlingui.py | # imports
import sys
import os
# add the parent directory (absolute, not relative) to the sys.path
# (this makes the games package imports work)
sys.path.append(os.path.abspath(os.pardir))
# PyQt imports
from PyQt5 import QtCore, QtWidgets
from PyQt5 import uic, QtGui, QtTest
from PyQt5.QtGui import QImage, QPixmap, ... |
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
from functools import wraps
RE_SANITIZE_FILENAME = re.compile(r'(~|\.\.|/|\\)')
RE... |
cli_api_run_launcher.py | import os
import threading
import weakref
from dagster import check, seven
from dagster.api.execute_run import cli_api_launch_run
from dagster.core.host_representation import ExternalPipeline
from dagster.core.instance import DagsterInstance
from dagster.core.storage.pipeline_run import PipelineRun
from dagster.serdes... |
kubernetesUtils.py | import functools
import logging
from logging import handlers
from multiprocessing import Process
import kubernetes
# Logging Parameters
logger = logging.getLogger(__name__)
file_handler = handlers.RotatingFileHandler("katana.log", maxBytes=10000, backupCount=5)
stream_handler = logging.StreamHandler()
formatter = log... |
turleclass.py | import math
import os
import threading
from typing import Optional, List
import time
from PyQt5 import QtGui, QtCore
import easygraphics as eg
from easygraphics.image import Image
class TurtleWorld(object):
"""
Turtles move and draw in a world. This is the class representing the world.
You must remembe... |
test_state.py | # -*- coding: utf-8 -*-
# Import Python libs
from __future__ import absolute_import, print_function, unicode_literals
import os
import shutil
import tempfile
import textwrap
import threading
import time
# Import Salt Testing libs
from tests.support.case import ModuleCase
from tests.support.unit import skipIf
from tes... |
shellpopen.py | import subprocess
import threading
import queue
from typing import Any, List, Sequence, Optional
#
class StdoutReader():
def __init__(self):
self.endevent = False
self.readlines = queue.Queue()
def stop(self):
self.endevent = True
def read(self, buf, encoding):
linebu... |
__init__.py | from enum import Enum
from itertools import cycle
from threading import Thread, Event as ThreadEvent
from ..action import ActionResponse, StopAction
from ..bus import EmptyBus
from ..bus.event_bus import EventBus
from ..db import Db
from ..event import StopEvent
from ..rules_parser import RulesParser
from ..utils impo... |
scratch.py | from multiprocessing import Process, Queue
import time
import sys
def reader_proc(queue):
## Read from the queue; this will be spawned as a separate Process
while True:
msg = queue.get() # Read from the queue and do nothing
if (msg == 'DONE'):
break
def writer(co... |
leftBrain.py | import numpy as np
import threading
import time
import socket
import swarmNet
import os
import math
import droneControl
import struct
state = 0
running = True
started = False
droneConnected =False
Vu = 0
Vp = 0
dVu = 0
dVp = 0
VuR = 0
VpR = 0
dVuR = 0
dVpR = 0
vision = droneControl.vision()
dr... |
pyminer.py | #!/usr/bin/python
#
# Copyright (c) 2011 The Bitcoin developers
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
import time
import json
import pprint
import hashlib
import struct
import re
import base64
import httplib
import... |
app.py | """
A REST API for Salt
===================
.. py:currentmodule:: salt.netapi.rest_cherrypy.app
.. note::
This module is Experimental on Windows platforms and supports limited
configurations:
- doesn't support PAM authentication (i.e. external_auth: auto)
- doesn't support SSL (i.e. disable_ssl: Tru... |
kinect2grasp.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Author : Hongzhuo Liang
# E-mail : liang@informatik.uni-hamburg.de
# Description:
# Date : 05/08/2018 6:04 PM
# File Name : kinect2grasp.py
import torch
import rospy
from sensor_msgs.msg import PointCloud2
from visualization_msgs.msg import MarkerArray
fr... |
client.py | import socket
import pickle
import time
header=20
import threading
client=socket.socket(socket.AF_INET,socket.SOCK_STREAM)
ip_adr="10.0.2.15"
#Inorder to run it on local ide,ip should be local host
ip_adr = "127.0.0.1"
port=5400
bind=(ip_adr,port)
Format="utf-8"
client.connect(bind)
print(socket.gethostbyname(socke... |
test_cmd2.py | # coding=utf-8
# flake8: noqa E302
"""
Cmd2 unit/functional testing
"""
import builtins
import io
import os
import signal
import sys
import tempfile
from code import (
InteractiveConsole,
)
from unittest import (
mock,
)
import pytest
import cmd2
from cmd2 import (
COMMAND_NAME,
ansi,
clipboard,
... |
util.py | # Copyright 2020 Determined AI. 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 applicable law o... |
test_filelock.py | #
# Copyright (c) 2013-2014, PagerDuty, Inc. <info@pagerduty.com>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright
# notic... |
transaction.py | #!/usr/bin/python3
import functools
import re
import sys
import threading
import time
from enum import IntEnum
from hashlib import sha1
from pathlib import Path
from typing import Any, Callable, Dict, List, Optional, Sequence, Tuple, Union
import black
import requests
from eth_abi import decode_abi
from hexbytes impo... |
handlers.py | """
Author: Keith Bourgoin, Emmett Butler
"""
__license__ = """
Copyright 2015 Parse.ly, 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 ... |
azdar.py | # -*- coding: utf-8 -*-
import LINETCR
from LINETCR.lib.curve.ttypes import *
from datetime import datetime
from bs4 import BeautifulSoup
from threading import Thread
from googletrans import Translator
from gtts import gTTS
import time,random,sys,json,codecs,threading,glob,urllib,urllib2,urllib3,re,ast,os,subprocess,r... |
MDML_client.py | import cv2
import json
import numpy as np
import pandas as pd
import os
import paho.mqtt.client as mqtt
import paho.mqtt.subscribe as subscribe
import queue
import re
import sys
import tarfile
import threading
import time
import boto3
import requests
import multiprocessing
import matplotlib.image as mpimg
from base64 i... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.