source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
keepkey.py | from binascii import hexlify, unhexlify
import traceback
import sys
from electrum_ltc.util import bfh, bh2u, UserCancelled, UserFacingException
from electrum_ltc.bitcoin import TYPE_ADDRESS, TYPE_SCRIPT
from electrum_ltc.bip32 import BIP32Node
from electrum_ltc import constants
from electrum_ltc.i18n import _
from ele... |
14Sync Console.py | import pydrive
import shutil
import os
import time
from tkinter import Tk,TRUE,FALSE,Label,Frame,Button,COMMAND,Image,mainloop,PhotoImage,FLAT,TOP,LEFT,BOTH
from pydrive.auth import GoogleAuth
from pydrive.drive import GoogleDrive
from tkinter.filedialog import askdirectory
from threading import Thread
#clientno=the... |
plt_process.py | # coding: utf-8
from multiprocessing import Process
import multiprocessing
import time
def task1(msg):
print('task1: hello, %s' % msg)
time.sleep(1)
def task2(msg):
print('task2: hello, %s' % msg)
time.sleep(1)
def task3(msg):
print('task3: hello, %s' % msg)
time.sleep(2)
if __name__ ==... |
LogCatReaderThread.py | """
:copyright: (c)Copyright 2013, Intel Corporation All Rights Reserved.
The source code contained or described here in and all documents related
to the source code ("Material") are owned by Intel Corporation or its
suppliers or licensors. Title to the Material remains with Intel Corporation
or its suppliers and lice... |
simulation.py | import json
import logging
import numpy as np
from multiprocessing import Event, Process, Queue, sharedctypes
from PyQt5 import QtCore
from .collision import CollisionManager
from .instrument import PositioningStack
from ..geometry.mesh import Mesh
from ..geometry.intersection import path_length_calculation
from ..math... |
ChannelPoints_to_ChannelCurrency_StreamlabsSystem.py | # -*- coding: utf-8 -*-
# Importing Required Libraries
import clr, codecs, json, os, re, sys, threading, datetime
clr.AddReference("IronPython.Modules.dll")
clr.AddReferenceToFileAndPath(os.path.join(os.path.dirname(os.path.realpath(__file__)) + "\References", "TwitchLib.PubSub.dll"))
from TwitchLib.PubSub import Twi... |
test_protocol_cybinary.py | # -*- coding: utf-8 -*-
import collections
import multiprocessing
import os
import time
import pytest
from thriftpy2._compat import u
from thriftpy2.thrift import TType, TPayload, TDecodeException
from thriftpy2.transport import TSocket, TServerSocket
from thriftpy2.utils import hexlify
from thriftpy2._compat impor... |
IntegrationTests.py | import os
import sys
import time
import unittest
import multiprocessing
import percy
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.common.by import By
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
from selenium.webdriver.su... |
updater.py | import os,time
from threading import Thread
def updater(m,plugin):
print('Module %s started' % plugin)
try:
func = getattr(m,plugin)()
except Exception as e:
print(str(e),plugin)
print('Module %s completed' % plugin )
def main():
threadsList = []
path = os.path.dirname(os.path.... |
test_arpack.py | __usage__ = """
To run tests locally:
python tests/test_arpack.py [-l<int>] [-v<int>]
"""
import threading
import itertools
import numpy as np
from numpy.testing import (assert_allclose, assert_array_almost_equal_nulp,
assert_equal, assert_array_equal, suppress_warnings)
from pytest imp... |
youtube_downloader.py | from os import path
from tkinter.filedialog import askdirectory, askopenfile
from tkinter.ttk import Progressbar
from tkinter import Menu, messagebox
from tor_handler import TorHandler
from toplevel_window_manager import ToplevelManager
from video_quality_selector_manager import VideoQualitySelector
import threading
im... |
__init__.py | from gevent.pywsgi import WSGIServer
from flask import Flask, request, session
import threading
import uuid
from .pages import fHDHR_Pages
from .files import fHDHR_Files
from .brython import fHDHR_Brython
from .api import fHDHR_API
fHDHR_web_VERSION = "v0.8.1-beta"
class fHDHR_HTTP_Server():
app = None
de... |
train_faster_rcnn_alt_opt_last_2_stages.py | #!/usr/bin/env python
# --------------------------------------------------------
# Faster R-CNN
# Copyright (c) 2015 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Written by Ross Girshick
# --------------------------------------------------------
"""Train a Faster R-CNN network using alternat... |
OrganelleFinder_helper.py | # Copyright (C) 2021 Nicolette Shaw - All Rights Reserved
from ij import IJ, ImagePlus
from ij.gui import Line, Plot
import math
import csv
import gc
from ij.plugin.frame import RoiManager
from ij.process import ImageProcessor
from ijopencv.ij import ImagePlusMatConverter as imp2mat
from org.bytedeco.javacpp.opencv_cor... |
sensors.py | #!/usr/bin/env python
from datetime import datetime
import multiprocessing
import time
import colorsys
import psutil
import json
import os
import sys
from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer
from random import randint
import json
import ST7735
try:
# Transitional fix for breaking change in LTR... |
thread2.py | #!/usr/bin/python -u
import string, sys, time
try:
from _thread import get_ident
except:
from thread import get_ident
from threading import Thread, Lock
import libxml2
THREADS_COUNT = 15
failed = 0
class ErrorHandler:
def __init__(self):
self.errors = []
self.lock = Lock()
def hand... |
test_serializer.py | import math
import pickle
import sys
from pathlib import Path
import pytest
import nni
import torch
from torch.utils.data import DataLoader
from torchvision import transforms
from torchvision.datasets import MNIST
from nni.common.serializer import is_traceable
if True: # prevent auto formatting
sys.path.insert(... |
02 - A3C Data Parallelism.py | import argparse
import collections
import gym
import os
import ptan
import numpy as np
import torch
import torch.nn.utils as nn_utils
import torch.nn.functional as F
import torch.optim as optim
import torch.multiprocessing as mp
from tensorboardX import SummaryWriter
from lib import utils
GAMMA = 0.99
LEARNING_RATE... |
server.py | import socket
from threading import Thread
import time
users = []
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.bind(('127.0.0.1', 53330))
sock.listen(10)
sock.setblocking(False)
def coming_users():
while True:
sock.setblocking(True)
clientsoc, addr = sock.accept()
sock.s... |
main.py | import pdb
import time
import os
import subprocess
import re
import random
import json
import numpy as np
import glob
from tensorboard.backend.event_processing.event_accumulator import EventAccumulator
import socket
import argparse
import threading
import _thread
import signal
from datetime import datetime
from sklearn... |
torture.py | # SPDX-License-Identifier: Apache-2.0
#
# Copyright (C) 2018, Arm Limited and contributors.
#
# 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
#
# ... |
websocket.py | # -*- coding: utf-8 -*-
import json
import logging
import ssl
import threading
import time
import traceback
from itertools import cycle
from threading import Thread
import websocket
from events import Events
from .exceptions import NumRetriesReached
log = logging.getLogger(__name__)
# logging.basicConfig(level=lo... |
visdom_logger.py | # flake8: noqa
# @TODO: code formatting issue for 20.07 release
from typing import Dict, List, Union
from collections import Counter
import logging
import queue
import threading
import time
from alchemy.logger import Logger
import visdom
from catalyst.core.callback import (
Callback,
CallbackNode,
Callbac... |
parallel.py | # Copyright 2015 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 the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... |
views.py | from threading import Thread
import Queue
from django.core.urlresolvers import reverse
from django.conf import settings
from django import forms
from django.http import HttpRequest, QueryDict
from django.test import TestCase
from haystack import connections, connection_router
from haystack.forms import model_choices, S... |
webcam.py | #!/usr/bin/python3
import os
import cv2
import argparse
import importlib.util
import numpy as np
from threading import Thread
# Source - Adrian Rosebrock, PyImageSearch: https://www.pyimagesearch.com/2015/12/28/increasing-raspberry-pi-fps-with-python-and-opencv/
class VideoStream():
"""Camera object that control... |
rates_api_server.py | """ rates api server """
from contextlib import contextmanager
from collections.abc import Generator
import multiprocessing as mp
import requests
from requests.exceptions import RequestException
from .rates_api import start_rates_api
@contextmanager
def rates_api_server() -> Generator[None, None, None]:
""" ra... |
threading_sample.py | import threading
Thread_Number = 5
def function():
print("This is function content ...")
if __name__ == '__main__':
threads_list = [threading.Thread(target=function) for _ in range(Thread_Number)]
for __thread in threads_list:
__thread.start()
for __thread in threads_list:
__threa... |
test_lightningd.py | from binascii import hexlify, unhexlify
from concurrent import futures
from decimal import Decimal
from hashlib import sha256
from lightning import LightningRpc
import copy
import json
import logging
import queue
import os
import random
import re
import sqlite3
import string
import sys
import tempfile
import threading... |
miniterm.py | #!c:\users\jose reza\appdata\local\programs\python\python37-32\python.exe
#
# Very simple serial terminal
#
# This file is part of pySerial. https://github.com/pyserial/pyserial
# (C)2002-2015 Chris Liechti <cliechti@gmx.net>
#
# SPDX-License-Identifier: BSD-3-Clause
import codecs
import os
import sys
import threa... |
test_autograd.py | import contextlib
import gc
import sys
import io
import math
import random
import tempfile
import time
import threading
import unittest
import warnings
from copy import deepcopy
from collections import OrderedDict
from itertools import product, permutations
from operator import mul
from functools import reduce, partial... |
sensoren.py | #!/usr/bin/env python3
# Programm : sensoren.py
# Version : 1.02
# SW-Stand : 17.02.2022
# Autor : Kanopus1958
# Beschreibung : Periodische Anzeige der Temperatur, Spannung und Taktfrequenz
from time import sleep
import datetime
import subprocess
import threading
import socket
from rwm_mod01 impor... |
json_jq_Processor.py | import subprocess
import sys
import os
from tempfile import NamedTemporaryFile
from xpathwalker.utils import list_compare_idx
from xpathwalker.processor import Processor
##########################################################################
# JSON #... |
flask_app.py | import base64
import sys
import cv2
import time
import datetime
import re
import numpy as np
from queue import Queue
from threading import Thread
import threading
from fps import FPS
from stream import liveStream
from detector import ObjectDetector
from objects import detect_objects_webcam
MODEL_BASE = 'models/resea... |
bm_fannkuch.py | """
The Computer Language Benchmarks Game
http://benchmarksgame.alioth.debian.org/
Contributed by Sokolov Yura, modified by Tupteq.
"""
import pyperf
from mpkmemalloc import *
import os
import gc
import threading
import psutil
from six.moves import xrange
DEFAULT_ARG = 9
def fannkuch(n):
count = list(xrange(1... |
publisher.py | # -*- encoding: utf-8 -*-
# Copyright (c) 2015 b<>com
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... |
mqtt_ssl_example_test.py | from __future__ import print_function, unicode_literals
import os
import re
import ssl
import sys
from builtins import str
from threading import Event, Thread
import paho.mqtt.client as mqtt
import ttfw_idf
from tiny_test_fw import DUT
event_client_connected = Event()
event_stop_client = Event()
event_client_receive... |
webcam_demo.py | # Copyright (c) OpenMMLab. All rights reserved.
import argparse
import time
from collections import deque
from operator import itemgetter
from threading import Thread
import cv2
import numpy as np
import torch
from mmcv import Config, DictAction
from mmcv.parallel import collate, scatter
from mmaction.apis import ini... |
webgpio2.0.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
@Description: WebGPIO For vvBoard
@author: xiezuoru,james,yyp,ndfrobot
@version: 2.0
@Date:2020.10.24
@Link: https://github.com/vvlink/vvBoard-app/tree/master/webgpio
"""
import threading
from flask import Flask
from flask import request
import time
import json
import... |
tf_util.py | import numpy as np
import tensorflow as tf # pylint: ignore-module
import copy
import os
import functools
import collections
import multiprocessing
import errno
def switch(condition, then_expression, else_expression):
"""Switches between two operations depending on a scalar value (int or bool).
Note that both... |
run.py | #!/usr/bin/python
from functions import *
try:
t1 = threading.Thread(target=lidar_fun)
t1.daemon = True
t1.start()
t2 = threading.Thread(target=pcb_fun)
t2.daemon = True
t2.start()
#print("start")
t3 = threading.Thread(target=acc_fun)
t3.daemon = True
t3.start()
while Tr... |
datasets.py | # Copyright 2020 Lorna 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 applicable l... |
videorecorder.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# IkaLog
# ======
# Copyright (C) 2015 Takeshi HASEGAWA
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/l... |
app.py | from flask import Flask, Blueprint
from api.authorization import ns as authorization_namespace
from api.dashboard import ns as dashboard_namespace
from api.restplus import api
from serviceApi import startSub
import threading
from flask_cors import CORS, cross_origin
app = Flask(__name__)
cors = CORS(app)
def initial... |
local.py | import pygame
pygame.init()
import threading
import socket
class VexRemote():
def __init__(self):
self.ip='192.168.1.241'
self.port=9001
self.running=True
self.socksend=socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
self.sockrecv=socket.socket(socket.AF_INET, socket.SOCK_... |
test_s3.py | from cStringIO import StringIO
import boto.exception
import boto.s3.connection
import boto.s3.acl
import boto.s3.lifecycle
import bunch
import datetime
import time
import email.utils
import isodate
import nose
import operator
import socket
import ssl
import os
import requests
import base64
import hmac
import sha
import... |
adder.py | import requests
import time
import threading
def findRegStreams(token, user):
head = {
'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.157 Safari/537.36',
'X-Auth-User': user,
'X-Auth-Token': token
}
r ... |
visual-groundstation.py | """
TKinter based ground station
"""
import os
import time
import random
import threading
import Queue
import csv
from argparse import ArgumentParser
from pymavlink import mavutil
import simplekml
import Tkinter
import tkMessageBox
# list of message types that will be used
MSG_TYPE_RADIO = 1
MSG_TYPE_HEARTBEAT = 2
M... |
firmware.py | #!/usr/bin/python3
import signal
import RPi.GPIO as GPIO
import logging
import coloredlogs
import sys
sys.path.append("..")
import argparse
import ruamel.yaml as YAML
import time
import threading
import asyncio
from neopixeldevice import NeopixelDevice, LED_PIN, LightMode, ws as ws_
from utils import *
from pn532 i... |
wsgiex.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
__ver_major__ = 0
__ver_minor__ = 4
__ver_patch__ = 1
__ver_sub__ = ""
__version__ = "%d.%d.%d" % (__ver_major__, __ver_minor__, __ver_patch__)
"""
This package provide extended versions of StreamServer, WSGIRequestHandler and some additions.
It doesn't has any dependences... |
editor_test.py | """
Copyright (c) Contributors to the Open 3D Engine Project.
For complete copyright and license terms please see the LICENSE at the root of this distribution.
SPDX-License-Identifier: Apache-2.0 OR MIT
This file provides editor testing functionality to easily write automated editor tests for O3DE.
For using these ut... |
flow_control.py | import logging
import sys
import threading
import time
from parsl.dataflow.task_status_poller import TaskStatusPoller
logger = logging.getLogger(__name__)
class FlowControl(object):
"""Implements threshold-interval based flow control.
The overall goal is to trap the flow of apps from the
workflow, meas... |
check_local_network.py |
import sys
import os
import httplib
import time
import socket
import threading
current_path = os.path.dirname(os.path.abspath(__file__))
if __name__ == "__main__":
python_path = os.path.abspath( os.path.join(current_path, os.pardir, os.pardir, 'python27', '1.0'))
noarch_lib = os.path.abspath( os.path.join(... |
client.py | #!/usr/bin/env python3
#Code By Leeon123
###################################################
# This is a new version of python3-botnet project #
# Added new stuff like daemon, slowloris... #
# Good Luck have Fun #
###################################################
#-- Aoyama version... |
TeslaAPI.py | import base64
import hashlib
import json
import logging
import os
import re
import requests
from threading import Thread
import time
from urllib.parse import parse_qs
logger = logging.getLogger("\U0001F697 TeslaAPI")
class TeslaAPI:
__apiChallenge = None
__apiVerifier = None
__apiState = None
__auth... |
MyDecorators.py | def run_async(func):
from threading import Thread
from functools import wraps
@wraps(func)
def async_func(*args, **kwargs):
func_hl = Thread(target=func, args=args, kwargs=kwargs)
func_hl.start()
return func_hl
return async_func
def log_timer(func):
import time
fr... |
vtmis.py | # Copyright 2014-2015 PUNCH Cyber Analytics Group
#
# 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... |
ssh_utils.py | #!/usr/bin/env python
#
# Copyright (c) Greenplum Inc 2008. All Rights Reserved.
#
# This file contains ssh Session class and support functions/classes.
import sys
import os
import cmd
import threading
from qautils.gppylib.commands.base import WorkerPool, REMOTE, ExecutionError
from qautils.gppylib.commands.unix impor... |
listener_utils.py | import logging
import threading
from dji_asdk_to_python.mission_control.\
waypoint.waypoint_mission_operator_listener import (
WaypointMissionOperatorListener,
WaypointMissionUploadEvent,
WaypointUploadProgress,
WaypointMissionState,
WaypointMissionExecutionEvent,
Wa... |
database.py | from itertools import permutations
try:
from Queue import Queue
except ImportError:
from queue import Queue
import re
import threading
from peewee import *
from peewee import Database
from peewee import FIELD
from peewee import attrdict
from peewee import sort_models
from .base import BaseTestCase
from .base ... |
fedoraserver.py | import socket
import threading
from datetime import datetime
import time
host = "0.0.0.0"
port = 4311
players = []
addrlist = []
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
def send_data(newdata, sender):
global players
if newdata == "":
return
data = newdata
if data == "ALIVE":
... |
cluster_master.py | from concurrent.futures import ThreadPoolExecutor
from datetime import datetime
import os
import sched
from threading import Thread
from typing import List
from app.common.cluster_service import ClusterService
from app.common.metrics import SlavesCollector
from app.master.build import Build, MAX_SETUP_FAILURES
from ap... |
threading.py | """A threading based handler.
The :class:`SequentialThreadingHandler` is intended for regular Python
environments that use threads.
.. warning::
Do not use :class:`SequentialThreadingHandler` with applications
using asynchronous event loops (like gevent). Use the
:class:`~kazoo.handlers.gevent.Sequential... |
utils.py | # spot-model/utils.py
#
# Author: Daniel Clark, 2015
'''
This module contains various utilities for the modules and scripts in
this folder or package
'''
# Apply simulation dataframe
def apply_cost_model(sim_df_row):
'''
Apply cost model to the simulation results dataframe by row
Parameters
---------... |
Interface.py | import sys
import os
import ast
from cmd import Cmd
from threading import Thread
sys.path.append(os.path.abspath('..'))
sys.path.append(os.path.abspath('../AeroComBAT/'))
from AeroComBAT.FEM import Model
class UserInterface(Cmd):
def __init__(self):
super(UserInterface, self).__init__()
self.Mo... |
pymultithread.py | #!/usr/bin/env python
from threading import Thread
from threading import Lock
import time
import os
lock = Lock()
def sleep(n: float):
lock.acquire()
print("start thread: %d" % os.getpid())
lock.release()
time.sleep(10)
def start():
now = time.time()
threads = []
for _ in range(0,10):
... |
force_torque_monitor.py | #!/usr/bin/env python
"""--------------------------------------------------------------------
This Module defines the ForceTorqueMonitor class which provides realtime visualization of
`geometry_msgs/WrenchStamped` messages via a matplotlib plot, and also provides the functionality to
detect if a given force or torque ... |
cli.py | from __future__ import absolute_import
import os
import sys
import logging
from flask_assistant.core import Assistant
from .schema_handlers import IntentGenerator, EntityGenerator, TemplateCreator
from .api import ApiAi
from . import logger
from multiprocessing import Process
logger.setLevel(logging.INFO)
api = ApiAi... |
gpu.py | import os
import re
import sys
import time
import math
import uuid
import shutil
import curses
import hashlib
import requests
import threading
import clip_filter
import pandas as pd
from glob import glob
from tqdm import tqdm
from PIL import Image
from dashing import *
from pathlib import Path
from colorama import Fore... |
upnp.py | import logging
import threading
from queue import Queue
from typing import Optional
try:
import miniupnpc
except ImportError:
pass
log = logging.getLogger(__name__)
class UPnP:
thread: Optional[threading.Thread] = None
queue: Queue = Queue()
def __init__(self):
def run():
t... |
test_collection.py | # -*- coding: utf-8 -*-
# Copyright 2009-present MongoDB, 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 applicabl... |
slcan.py | #
# Copyright (C) 2014-2016 UAVCAN Development Team <uavcan.org>
#
# This software is distributed under the terms of the MIT License.
#
# Author: Ben Dyer <ben_dyer@mac.com>
# Pavel Kirienko <pavel.kirienko@zubax.com>
#
from __future__ import division, absolute_import, print_function, unicode_literals
import... |
__main__.py | import threading
import os
from tango_driver import config, logger, start_http_server
from tango_driver.utils import daemon
def main():
'''
The main method
'''
# satrt daemon process
# d = threading.Thread(target=daemon.daemon_process, name="tango-daemon", daemon=True)
# d.start()
lo... |
twitterBot.py | import WonderPy.core.wwMain
from WonderPy.core.wwConstants import WWRobotConstants
from threading import Thread
import twitter
from queue import *
'''
This example requires you to set up a Twitter Application (https://apps.twitter.com/)
and provide your key and token below.
This example will listen for tweets to a s... |
utils.py | #!/usr/bin/env python
import json, subprocess, time, copy, sys, os, yaml, tempfile, shutil, math, re
from datetime import datetime
from multiprocessing import Process
from flask import Flask, request
import logging
formatter = logging.Formatter(fmt='%(asctime)s :: %(process)d :: %(levelname)-8s :: %(message)s', date... |
connection.py | # -*- coding: utf-8 -*-
# ------------------------------------------------------------------------------
#
# Copyright 2018-2019 Fetch.AI Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the... |
test_capi.py | # Run the _testcapi module tests (tests for the Python/C API): by defn,
# these are all functions _testcapi exports whose name begins with 'test_'.
from __future__ import with_statement
import os
import pickle
import random
import subprocess
import sys
import time
import unittest
from test import support
try:
imp... |
app.py | #!/usr/bin/env python
# vim: ai ts=4 sts=4 et sw=4
import rapidsms
import cgi, urlparse, traceback
from threading import Thread
from SocketServer import ThreadingMixIn
from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer
from django.utils.simplejson import JSONEncoder
from django.db.models.query import Quer... |
c.py | # -*- coding: utf-8 -*-
import LINETCR
from LINETCR.lib.curve.ttypes import *
from datetime import datetime
import time,random,sys,json,codecs,threading,glob,re
cl = LINETCR.LINE()
#cl.login(qr=True)
cl.login(token="Ewp8tOSAWMhO0PVOi3zf.jxorRZbOqBNQcmQEXgUMRW.sOcLV9/Q24tGUaJB547i4XgW93GsnKG8myl3OaF7TRo=")
ki = kk = ... |
shell.py | import os
import sys
import traceback
import threading
import core.loader
import core.colors
import core.job
import core.extant
''' Cmd is just a bad wrapper around readline with buggy input '''
class Shell(object):
def __init__(self, banner, version):
self.banner = banner
self.version = version
... |
test_socket.py | import unittest
from test import support
import errno
import io
import itertools
import socket
import select
import tempfile
import time
import traceback
import queue
import sys
import os
import array
import contextlib
from weakref import proxy
import signal
import math
import pickle
import struct
... |
trezor.py | import threading
from binascii import hexlify, unhexlify
from electrum_ltc.util import bfh, bh2u, versiontuple
from electrum_ltc.bitcoin import (b58_address_to_hash160, xpub_from_pubkey,
TYPE_ADDRESS, TYPE_SCRIPT)
from electrum_ltc import constants
from electrum_ltc.i18n import _
fro... |
fileManager.py | '''
Created on Jul 25, 2014
@author: gigemjt
'''
import time
from multiprocessing import Process, Queue
def _createDialog(communicationQueue):
from src.utilities import fileDialog
fileDialog.createDialog(communicationQueue)
print 'method!'
def showDirectoryDialog():
"""A blocking method that return... |
html.py | from fontTools.ttLib import TTFont
import browserstack_screenshots
from pkg_resources import resource_filename
from jinja2 import Environment, FileSystemLoader, select_autoescape
from browserstack.local import Local
import tempfile
import os
from multiprocessing import Process
from contextlib import contextmanager
from... |
mobile.py | # Author: Joel Maldonado Rivera
# Student-ID: 801-14-3804
# H.W # 1 : Consumer and Producer problem
# We create the Mobile.py which will have one thread which will do the following:
# 1)Concurrently generate random numbers that simulates the time the mobile job will take in the compute server.
# 2) Send a message ... |
test_bootstrap.py | """Test the bootstrapping."""
# pylint: disable=too-many-public-methods,protected-access
import os
import tempfile
from unittest import mock
import threading
import voluptuous as vol
from homeassistant import bootstrap, loader
from homeassistant.const import (__version__, CONF_LATITUDE, CONF_LONGITUDE,
... |
corehandlers.py | """
socket server request handlers leveraged by core servers.
"""
import logging
import os
import shlex
import shutil
import socketserver
import sys
import threading
import time
from itertools import repeat
from queue import Empty, Queue
from typing import Optional
from core import utils
from core.api.tlv import core... |
utils.py | import requests
import ConfigParser
from bs4 import BeautifulSoup
from time import sleep
from clint.textui import progress
import os, sys, itertools
from threading import Thread
from logs import *
def ip_address():
"""
Gets current IP address
"""
response = requests.get('http://www.ip-addr.es')
pr... |
vimbaproxy.py | # ----------------------------------------------------------------------
# Author: yury.matveev@desy.de
# ----------------------------------------------------------------------
"""Vimba camera proxy
"""
import time
import numpy as np
import logging
try:
import PyTango
except ImportError:
pass
from th... |
cisd.py | #!/usr/bin/env python
# Copyright 2014-2021 The PySCF Developers. 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
#
# U... |
__init__.py | import sys,os
os.chdir('/home/pi/Desktop/node')
from p2p import Node, getIp
from envirobox import get_values
from socket import *
from time import sleep
import gpiozero
from threading import Thread
print('init...')
print(getIp())
def get_status(kwargs):
co = int(get_values()['co'])
print(co)
danger_value ... |
pushkind.py | from daemon import DaemonContext
from time import sleep
from redis import Redis
from pushkin import Pushkin
from json import loads
from threading import Thread, Lock
# FIXME: merge device & commands
def pushkin_send_commands(device, commands):
with Lock():
p = Pushkin(**device)
p.login()
p... |
workspace_server.py | import json
import os
from http.server import SimpleHTTPRequestHandler, ThreadingHTTPServer
from threading import Thread
from typing import Any, Dict, Optional, Tuple
from tango.workspace import StepInfo, Workspace
_module_directory = os.path.dirname(os.path.abspath(__file__))
class WorkspaceRequestHandler(SimpleHT... |
extract_data.py | import json
import os
import time
import warnings
from collections import deque
from math import gcd
from multiprocessing import Process, Queue
from ai2thor.controller import BFSController
from datasets.offline_controller_with_small_rotation import ExhaustiveBFSController
def noop(self):
pass
BFSController.lock_... |
fencing.py.py | #!@PYTHON@ -tt
import sys, getopt, time, os, uuid, pycurl, stat
import pexpect, re, syslog
import logging
import subprocess
import threading
import shlex
import socket
import textwrap
import __main__
## do not add code here.
#BEGIN_VERSION_GENERATION
RELEASE_VERSION = "New fence lib agent - test release on steroids"
... |
train.py | import argparse
import logging
import math
import os
import random
import time
from copy import deepcopy
from pathlib import Path
from threading import Thread
import numpy as np
import torch.distributed as dist
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
import torch.optim.lr_sche... |
__init__.py | # -*- coding: utf-8 -*-
"""
keyboard
========
Take full control of your keyboard with this small Python library. Hook global events, register hotkeys, simulate key presses and much more.
## Features
- Global event hook on all keyboards (captures keys regardless of focus).
- **Listen** and **sends** keyboard events.
... |
background.py | import threading
from typing import *
class BackFurby:
def background(self, command: Union[str, Callable], *args, **kwargs):
"""
Run a command in the background.
It is a fake-overloaded function where command is either a str (name of method to be called)
or a method to be called.
... |
inference.py | #from __future__ import absolute_import, division, print_function
from opts import OPTIONS
from utils.logger import Writer
from torchvision import transforms
import threading
import networks
import numpy as np
import torch
import torch.nn.parallel
import torch.backends.cudnn as cudnn
import torch.optim
cudnn.benchmark... |
modbus.py | # -*- coding: utf-8 -*-
#
# Copyright (c) 2021 Jason Engman <jengman@testtech-solutions.com>
# Copyright (c) 2021 Adam Solchenberger <asolchenberger@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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.