source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
__init__.py | import ast
import base64
import os
from pathlib import Path
from threading import Thread
import boto3
import sqlalchemy as sql
from flask import Blueprint, request as rq, send_file
from sqlalchemy import or_
from app.auth import http_auth
from app.entities.Statistic import Statistic
from app.entities.entity import S... |
camera_desktop.py | from __future__ import with_statement
import cv2
import time
from threading import Thread
from threading import Lock
class Camera(object):
stopped = False
image = None
camera = None
lock = Lock()
def start(self, resolution=(640, 480), framerate=16):
"""
Starts camera input in a ne... |
start_server.py | import argparse
import os
import sys
import threading
import time
import requests
from google.protobuf import text_format
import Request_pb2
def new_dummy_server(port):
try:
os.system('python dummy_vm_server.py ' + str(port))
except Exception as e:
print(e)
def master_server():
try:
os.system('pytho... |
agent.py | import multiprocessing
from utils.replay_memory import Memory
from utils.torch import *
import math
import time
def collect_samples(pid, queue, env, policy, custom_reward,
mean_action, render, running_state, min_batch_size):
torch.randn(pid)
log = dict()
memory = Memory()
num_steps... |
test.py | #!/usr/bin/env python
#
# Copyright 2012 the V8 project authors. 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
# noti... |
wspbus.py | r"""An implementation of the Web Site Process Bus.
This module is completely standalone, depending only on the stdlib.
Web Site Process Bus
--------------------
A Bus object is used to contain and manage site-wide behavior:
daemonization, HTTP server start/stop, process reload, signal handling,
drop privileges, PID ... |
cachingFileStore.py | # Copyright (C) 2015-2021 Regents of the University of California
#
# 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 app... |
parmapper.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
parmap (or parmapper): Tool for easy parallel function mapping
without requiring a pickleable function (e.g. lambdas).
"""
from __future__ import print_function, unicode_literals, division
__version__ = '20210422.0'
import multiprocessing as mp
import multiprocessing.... |
motion_tracker.py | #!/usr/bin/env python
progname = "motion_track.py"
ver = "version 0.96"
print("%s %s using python2 and OpenCV2" % (progname, ver))
print("Loading Please Wait ....")
import os ,telegram
import RPi.GPIO as GPIO
import time
PORT = 11
GPIO.setmode(GPIO.BCM)
GPIO.setup(PORT, GPIO.OUT)
mypath = os.path.abspath(__file__)... |
ModelPool.py | """
@title
@description
"""
import argparse
import json
import multiprocessing as mp
import os
import time
from itertools import combinations
from json import JSONDecodeError
from multiprocessing import Queue
from signal import signal, SIGINT
import matplotlib.pyplot as plt
from Andrutil.Misc import find_files_by_name... |
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 ... |
qPyMultiThread.py | # -*- coding=iso-8859-1 -*-
# Copyright 2021 Qualys 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 re... |
T1.py | # multiple threads
import threading
import time
import random
tlist = []
count = 10
def tfunc(*n):
time.sleep(random.randint(1,5))
print('Thread running: ',n)
return
for i in range(count):
t = ('Thread-',i+1)
thd = threading.Thread(target=tfunc,args=t)
tlist.append(thd)
... |
parallel.py | from multiprocessing import Process, Pipe, Queue
import numpy as np
from chainer import cuda
from generate_data import generate_nice
from sinkhorn import sinkhorn_fb
from sdtw import soft_dtw, soft_dtw_grad
from wdtw import gradient_descent
GPU_COUNT = 7
GPU_PRIORITY = [2, 6, 0, 1, 4, 5, 3]
GPU_PRIORITY_REVERSE = li... |
ECMP_fattree4.py | # Copyright (C) 2016 Huang MaChi at Chongqing University
# of Posts and Telecommunications, China.
# Copyright (C) 2016 Li Cheng at Beijing University of Posts
# and Telecommunications. www.muzixing.com
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance ... |
serv.py | import socket
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
def server_handler(conn, addr):
while True:
data = conn.recv(1024)
if not data or data == 'close': break
conn.send(data)
conn.close()
s.bind(('0.0.0.0', 2222))
s.listen(10)
while True:
conn, addr = s.accept()
t ... |
threadtest.py | # -*- coding: utf-8 -*-
import threading
import time
class ThreadingExample(object):
""" Threading example class
The run() method will be started and it will run in the background
until the application exits.
"""
def __init__(self, interval=1):
""" Constructor
:type interval... |
test_runner.py | import sublime
import sublime_plugin
import os
import unittest
import contextlib
from threading import Thread
class __vi_tests_write_buffer(sublime_plugin.TextCommand):
"""Replaces the buffer's content with the specified `text`.
`text`: Text to be written to the buffer.
"""
def run(self, edit, t... |
dicovery.py | import threading
import random
import string
from src.core.broadcast.broadcast_listener import BroadcastListener
from src.protocol.group_view.join import *
from src.core.multicast.co_reliable_multicast import CausalOrderedReliableMulticast
from src.core.multicast.to_reliable_multicast import TotalOrderedReliableMulti... |
plugin.py | import hashlib
import os
import shutil
import sublime
from LSP.plugin.core import logging
from LSP.plugin.core.handlers import LanguageHandler
from LSP.plugin.core.settings import read_client_config
from sublime_lib import ActivityIndicator
from threading import Thread
from urllib.request import urlretrieve
from zipfi... |
threadingEx1.py | import threading as thd
def do_this(what):
whoami(what)
def whoami(what):
print("Thread {} says: {}".format(thd.current_thread(), what))
if __name__ == "__main__":
whoami("I'm the main program.")
for n in range(4):
t = thd.Thread(target=do_this, args=("I'm function {}".format(n),))
t... |
bmv2.py | import multiprocessing
import os
import json
import random
import re
import socket
import threading
import time
import urllib2
from contextlib import closing
from mininet.log import info, warn
from mininet.node import Switch, Host
SIMPLE_SWITCH_GRPC = 'simple_switch_grpc'
PKT_BYTES_TO_DUMP = 80
VALGRIND_PREFIX = 'val... |
reactor.py | import asyncore
import errno
import io
import logging
import os
import select
import socket
import ssl
import sys
import threading
import time
from collections import deque
from functools import total_ordering
from heapq import heappush, heappop
from hazelcast.config import SSLProtocol
from hazelcast.connection impor... |
ULTRACORTEX_conexion.py | import sys
sys.path.append('C:/Python37/Lib/site-packages')
from IPython.display import clear_output
import csv
import os
from pyqtgraph.Qt import QtGui, QtCore
import pyqtgraph as pg
import random
from pyOpenBCI import OpenBCICyton
import threading
import time
import numpy as np
from scipy import signal
from pyOpenBCI... |
tasks.py | """
Long running tasks controllers
"""
import logging
import time
import threading
from task_controller import constants as task_controller_constants
from task_controller.controllers import TaskStatusControllerMaster
LOG = logging.getLogger(__name__)
class SampleControllerMaster(TaskStatusControllerMaster):
""... |
it_test_event_based_scheduler.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... |
dbtime.py | # -*- coding: utf-8 -*-
"""
Created on Tue May 24 15:42:14 2016
Author: Edouard Fouché
"""
from __future__ import print_function
import schiene
import datetime
import time
import os
import sys, getopt
import threading
def sanitize(req):
"""Enhance the information content"""
# get current time
now = datetim... |
testing_server.py | #!/usr/bin/python3
# CS1440 Recursive Web Crawler testing server
#
# Usage:
# python testing_server.py [address=localhost] [port=8000] [timeout=3]
#
# Example: Respond to http://localhost:4444 and stay running for 30 seconds
# python testing_server.py localhost 4444 30
#
# Specify a timeout of 0 to let the server ... |
Carillon.py | """
UI for scheduling and playout of clock chimes stored as .mp3 files
Manage a church or other electronic carillon to playout .mp3 files of
user-provided songs, peals, tolls, and hourly strikes at scheduled system
time(s). Requires Python3 but no desktop environment. Creates a text
based user interface between stdin... |
x.py | import argparse
import asyncio
import importlib.util
import logging
import warnings
import os
import signal
import traceback
from multiprocessing import get_context
from typing import List, Text, Optional, Tuple, Union, Iterable
import aiohttp
import ruamel.yaml as yaml
import rasa.cli.utils as cli_utils
import rasa.... |
test_taskdialog.py | from multiprocessing import Process, Pipe
import time
from utils import (
get_visible_window_handles,
AlertManager,
)
from NativeDialogs.dialogs.win.taskdialog import taskdialog
def create_alert(send_end):
result = taskdialog.alert("Sultry Text", "Charming Title")
send_end.send(result)
def create_... |
main.py | #!/usr/bin/python
'''
Generic JSON HTTP(S) API exporter.
Based on
https://www.robustperception.io/writing-json-exporters-in-python/
https://www.robustperception.io/writing-a-jenkins-exporter-in-python/
'''
import sys
import time
import argparse
import logging
import logging.config
import re
import threading
import sign... |
bot.py | import os
import youtube_dl
import telepotpro
from random import randint
from multiprocessing import Process
from youtubesearchpython import VideosSearch
from dotenv import load_dotenv
from os.path import join, dirname
dotenv_path = join(dirname(__file__), '.env')
load_dotenv(dotenv_path)
TOKEN = os.environ.get("TOKE... |
event.py | # encoding: UTF-8
# 系统模块
import inspect
from concurrent.futures.thread import ThreadPoolExecutor
from queue import Queue, Empty
from threading import *
import functools
class EventManager:
def __init__(self):
"""初始化事件管理器"""
# 事件对象列表
self.__eventQueue = Queue()
# 事件管理器开关
sel... |
auto_scaler.py | #!/usr/bin/env impala-python
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (... |
word2vec.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... |
mainer.py | def runnn():
import time
import re
bot = telebot.TeleBot(constants.token)
listOfSubs = functions.getUsers()
listOfDeadSubs = functions.getDeadUsers()
KeyWaitUsers1= functions.waitUsersGet()
KeyWaitUsers =[]
waitForPost = functions.waitForPostRead()
replyToSubers = functions.... |
runner.py | """
Runner is the module that actually runs the commands.
It is implemented as a single function with its logic implemented as a set of internal functions.
The architecture is based on the idea of a `thread` pool.
- Worker threads actually perform the `exec` of the commands using pythons `subprocess` module.
- T... |
delete_s2server.py | #!/usr/bin/env python
#coding:utf-8
'''
Created on 2019-03-05
@author: yunify
'''
import qingcloud.iaas
import threading
import time
from optparse import OptionParser
import sys
import os
import qingcloud.iaas.constants as const
import common.common as Common
def delete_s2server(conn,user_id,s2_servers_id):
prin... |
mbed_greentea_cli.py |
"""
mbed SDK
Copyright (c) 2011-2016 ARM 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 License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in w... |
simple.py | # Copyright 2011 Omniscale GmbH & Co. KG
#
# 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 ... |
github.py | import copy
import json
import re
import threading
import time
from urllib.request import urlopen
from i3pystatus import IntervalModule, formatp
from i3pystatus.core import ConfigError
from i3pystatus.core.desktop import DesktopNotification
from i3pystatus.core.util import user_open, internet, require
try:
import... |
ASL_app.py | from tkinter import *
import argparse
from tkinter import scrolledtext
from PIL import Image, ImageTk
import threading
import time
import cv2
import pandas as pd
import pafy
from yolo import YOLO
def handlerAdaptor(fun, **kwds):
'''事件处理函数的适配器,相当于中介,那个event是从那里来的呢,我也纳闷,这也许就是python的伟大之处吧'''
return lambda event,... |
lisp-itr.py | # -----------------------------------------------------------------------------
#
# Copyright 2013-2019 lispers.net - Dino Farinacci <farinacci@gmail.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... |
tcp.py | #%%
# %%
# 服务器
# import socket # 导入socket库
# import threading
# s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
# s.bind(('192.168.1.200', 37075)) #绑定监听地址和端口
# s.listen(10) #指定等待连接的最大数量
# # 处理tcp连接
# def tcplink(conn, addr):
# print("Accept new connection ... |
cli.py | import collections
import csv
import multiprocessing as mp
import os
import datetime
import sys
from pprint import pprint
import re
import ckan.include.rjsmin as rjsmin
import ckan.include.rcssmin as rcssmin
import ckan.lib.fanstatic_resources as fanstatic_resources
import sqlalchemy as sa
import urlparse
import routes... |
install.py | from core.config import Settings
from core.providers.aws import BaseAction
from core.log import SysLog
from core import constants as K
from core.terraform import PyTerraform
from core.terraform.utils import get_terraform_scripts_and_files_dir
from time import sleep
from distutils.dir_util import copy_tree
from threadin... |
deploy.py | """
采集服务的定时任务管理模块
"""
__all__ = ["TasksScheduler", "CollectorScheduler", "CollaboratorScheduler"]
import ast
import math
import os
import threading
import time
from datetime import datetime, timedelta
from uuid import uuid4
import gevent
from apscheduler.events import (
EVENT_JOB_SUBMITTED,
EVENT_JOB_MAX_INST... |
parallel_sampler.py | import time
import datetime
from multiprocessing import Process, cpu_count
from multiprocessing.queues import Queue
import multiprocessing
import torch
import numpy as np
# from pytorch_transformers import BertModel
from transformers import BertModel
from . import utils
from . import stats
class ParallelSampler():... |
test_fx.py | import builtins
import contextlib
import copy
import functools
import math
import numbers
import operator
import os
import pickle
import sys
import torch
import traceback
import warnings
import unittest
from math import sqrt
from pathlib import Path
from torch.multiprocessing import Process
from torch.testing import Fi... |
camera.py | import time
import io
import threading
import picamera
class Camera(object):
thread = None # background thread that reads frames from camera
frame = None # current frame is stored here by background thread
last_access = 0 # time of last client access to the camera
def initialize(self):
if C... |
main_binarysearch_threshold.py | import Source.protobuf.system_builder_serializable as sb
import Source.protobuf.make_util as make
import Source.io_util as io
import Source.system_evaluator as ev
import Source.genetic_algorithm.selection as selection
import Source.genetic_algorithm.fitting_functions as fit_fun
import Source.genetic_algorithm.operation... |
testserver.py | # #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# <HTTPretty - HTTP client mock for Python>
# Copyright (C) <2011-2020> Gabriel Falcão <gabriel@nacaolivre.org>
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation
# files (the "Software"), to ... |
BuildGUI.py | import os
import subprocess
import tkinter as tk
import webbrowser
from threading import *
app = tk.Tk()
app.title('VeinIF Build Tools')
app.resizable(False, False)
# app.geometry('800x600')
canvas = tk.Canvas(app, width=350, height=250)
dirname = os.path.dirname(os.path.realpath(__file__))
#new thread:
def startDev... |
CVE-2019-1040.py | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
import ssl
import argparse
import logging
import sys
import getpass
import base64
import re
import binascii
import time
import config
from impacket.dcerpc.v5 import transport, rprn
from impacket.dcerpc.v5.dtypes import NULL
from comm import logger
from comm.ntlmrelayx.serve... |
test_connect.py | import pytest
from milvus import Milvus
import pdb
import threading
from multiprocessing import Process
from utils import *
CONNECT_TIMEOUT = 12
class TestConnect:
def local_ip(self, args):
'''
check if ip is localhost or not
'''
if not args["ip"] or args["ip"] == 'localhost' or ... |
testch.py | #!/usr/bin/python3
import sys
import os
import argparse
import random
import threading
import backTCP
from utils import *
# Actions: What to do for a stream of incoming packets
# 0: Do nothing and forward
# 1: Drop unless retransmitted
# 2: Swap two packets
# 3: Randomly order 3 packets and maybe drop one a... |
augment_trajectories.py | import os
import sys
sys.path.append(os.path.join(os.environ['ALFRED_ROOT']))
sys.path.append(os.path.join(os.environ['ALFRED_ROOT'], 'gen'))
import json
import glob
import os
import constants
import cv2
import shutil
import numpy as np
import argparse
import threading
import time
import copy
import random
from utils.... |
protocol.py | from queue import Queue
from threading import Thread, Lock
from .messages import ResponseMessage
from .parser import parse_line
class ProtocolBase:
def __init__(self, serial):
self.serial = serial
self.serial_mutex = Lock()
self.send_queue = Queue()
self.message_handlers = []
... |
bridge.py | #!/usr/bin/env python3
# type: ignore
import time
import math
import atexit
import numpy as np
import threading
import random
import cereal.messaging as messaging
import argparse
from common.params import Params
from common.realtime import Ratekeeper
from lib.can import can_function, sendcan_function
from lib.helpers i... |
DWH.py | """
Работа с ХД
"""
import dwh_config
import Driver
import Postgresql as pgsql
import FileWorker as fw
import copy
import uuid
import Metadata as meta
from Source import Source as Source
import datetime
from Constants import *
from SystemObjects import *
import math
import threading
class Connection:
"""
Подкл... |
cloud.py | """
Object Store plugin for Cloud storage.
"""
import logging
import multiprocessing
import os
import shutil
import subprocess
import threading
import time
from datetime import datetime
from galaxy.exceptions import ObjectInvalid, ObjectNotFound
from galaxy.util import (
directory_hash_id,
safe_relpath,
s... |
exchange_rate.py | from datetime import datetime
import inspect
import requests
import sys
from threading import Thread
import time
import csv
import decimal
from decimal import Decimal
from .bitcoin import COIN
from .i18n import _
from .util import PrintError, ThreadJob
from .util import format_satoshis
# See https://en.wikipedia.org... |
predict_model.py | from os import listdir
from os.path import isfile, join
import sentiment_model
import datetime
import pandas as pd
import logging
import csv
import multiprocessing as mp
"""
Use multiprocessing to speed up prediction process
"""
def start_processes(ps):
for p in ps:
p.start()
for p in ps:
p.... |
session_test.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... |
wind_direction.py | import os
import re
from multiprocessing import Pipe
from os.path import join
import time
from multiprocessing.context import Process
WIND_REGEX = "\d* METAR.*EGLL \d*Z [A-Z ]*(\d{5}KT|VRB\d{2}KT).*="
WIND_EX_REGEX = "(\d{5}KT|VRB\d{2}KT)"
VARIABLE_WIND_REGEX = ".*VRB\d{2}KT"
VALID_WIND_REGEX = "\d{5}KT"
WIND_DIR_ONL... |
plot_ticker.py | """Shows plot updates from dynamic data."""
import random
import threading
from time import sleep
from dearpygui import core, simple
_COUNT = 5
_MAXHISTORY = 100
_HEIGHT = int(640 / _COUNT)
_TICKRATE = .04
def fakeItTillYouMakeIt():
while 1:
for idx in range(_COUNT):
plot = f"plot-{idx}"
value = core.get_va... |
agents.py | # Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS file in the same directory.
from parlai.core.agents im... |
root.py | import json, time, subprocess, os, sqlite3
from bottle import get, post, route, error, request, run, static_file
from threading import Thread
from queue import Queue, Empty
import asyncPopen
status = { 'state':'off'}
process = None;
projectRoot = "~/Projects/Thesis/" if os.path.isdir("~/Projects/Thesis") else "../" ... |
connectWifi.py | import socket
import struct
import sys
import time
from time import time as tt
import numpy as np
import os.path
from openframeworks import *
from protopixel import Content
UDP_IP = "192.168.8.237"
UDP_PORT = 2390
content = Content('Virtual controller')
content.add_parameter("FPS_LIMIT", min=0, max=60, value=30)
c... |
CXData2.py | """
.. module:: CXData2.py
:platform: Unix
:synopsis: A class for coherent X-ray phasing data.
.. moduleauthor:: David Vine <djvine@gmail.com>
"""
import scipy as sp
import numpy as np
import scipy.fftpack as spf
import scipy.ndimage as spn
from numpy.random import uniform
from numpy import pad
import os
impo... |
bsn_reader.py | # Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserve.
#
#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... |
multiple_thread.py | from multiprocessing import Process
import os
import time
def info(title):
print(title)
print('module name:', __name__)
print('parent process:', os.getppid())
print('process id:', os.getpid())
def foo(name):
info('function f')
count = 0
while(True):
print('Thread {}, count: {}'... |
util.py | import json
import multiprocessing
import random
from six import b
# noinspection PyUnresolvedReferences
from six.moves.BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler
# noinspection PyUnresolvedReferences
from six.moves.urllib.parse import urlparse, parse_qs
PORT = random.randint(8000, 9000)
try: # Py3
... |
rename_gcmd.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# author: houzhiwei
# time: 2019/8/11 20:28
from owlready2 import *
from os import path
from pprint import pprint
import re
from JSON2OWL.OwlConvert.Preprocessor import Preprocessor
onto_path.append(path.normpath(path.dirname(__file__)) + '/')
gcmd = get_ontology('/gcmd.ow... |
server_multi.py | import random
import threading
import time
from src.engine.game_result import GameResult
from src.engine.kifu import GameKifu
from src.engine.server import AyaneruServer
from src.engine.rating import EloRating
# 並列自己対局のためのクラス
class MultiAyaneruServer:
def __init__(self):
# --- public members ---
... |
installwizard.py | # Copyright (C) 2018 The Electrum developers
# Distributed under the MIT software license, see the accompanying
# file LICENCE or http://www.opensource.org/licenses/mit-license.php
import os
import json
import sys
import threading
import traceback
from typing import Tuple, List, Callable, NamedTuple, Optional, TYPE_CH... |
Gprs.py | #!/usr/bin/env python
# *-* coding: utf-8 *-*
import subprocess
import threading
import socket
import os, sys
import time
from time import sleep
import logging
import ctypes
import binascii
import serial
from datetime import datetime
def crc16(datos, offset, length):
crctab16 = (
0x0000, 0x1189, 0x2312, 0... |
__init__.py | import math
import threading
import time
import arrow
import click
import pydash
import jesse.helpers as jh
from jesse.exceptions import CandleNotFoundInExchange
from jesse.models import Candle
from jesse.modes.import_candles_mode.drivers import drivers
from jesse.modes.import_candles_mode.drivers.interface import Ca... |
BiochemistryAPIServer.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from wsgiref.simple_server import make_server
import sys
import json
import traceback
import datetime
from multiprocessing import Process
from getopt import getopt, GetoptError
from jsonrpcbase import JSONRPCService, InvalidParamsError, KeywordError,\
JSONRPCError, Inva... |
mysql.py | import logging
import os
import threading
from redash.query_runner import (
TYPE_FLOAT,
TYPE_INTEGER,
TYPE_DATETIME,
TYPE_STRING,
TYPE_DATE,
BaseSQLQueryRunner,
InterruptException,
register,
)
from redash.settings import parse_boolean
from redash.utils import json_dumps, json_loads
try... |
main_diagram.py | import time
from threading import Thread
from state_machine_py.multiple_state_machine import MultipleStateMachine
from tests.match_server.keywords import INIT, MACHINE_C, MACHINE_S
from tests.match_server.machine_c.context import Context as ContextC
from tests.match_server.machine_c.state_gen_conf import state_gen as ... |
harvest_techamok.py | # Harvests the Techamok Best Pics of the month sub-website
# Date create: 08 December 2017
# Author: Rudolph Lombaard (prlombaard@gmail.com)
# DONE: refactor, move file getter into its own function
# DONE: stop iteration if "end of range" of images reached.
# TODO: make multithreaded / multiprocess to download more... |
debugger.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... |
test.py | import uuid
import requests
import time
import sys
import multiprocessing
from threading import Thread
NUMBER_OF_REQUESTS_PER_TEST = 4
# Do one test, returns True if it succeded, False otherwise.
def do_one_test():
id = str(uuid.uuid4())
value = str(uuid.uuid4())
url = 'http://localhost:8080/store/' + id
... |
menu.py | import pygame
from button import Button
from threading import Thread
from queue import Queue
from time import sleep
class Menu:
KEYBIND = pygame.K_ESCAPE
FONT = "microsoftphagspa"
FONT_SIZE_BUTTON = 15
FONT_SIZE_TITLE = 40
FONT_SIZE_SUBTITLE = 20
BUTTON_HEIGHT = 50
BUTTON_WIDTH = 100
... |
user.py | #!/usr/bin/python3
import os
import sys
import json
import pygetwindow as gw
from tkinter import *
from socket import *
from PIL import ImageTk, Image
from threading import Thread
from ..database.datalocal import *
from ..database.database import *
from ..Notifications import Notification
from ..EventosMo... |
test_pebble.py | #!/usr/bin/python3
# Copyright 2021 Canonical Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agre... |
pyminer.py | #!/usr/bin/python
#
# Copyright (c) 2011 The Bitcoin developers
# Distributed under the MIT/X11 software license, see the accompanying
#
import time
import json
import pprint
import hashlib
import struct
import re
import base64
import httplib
import sys
from multiprocessing import Process
ERR_SLEEP = 15
MAX_NONCE = ... |
utils.py | from os import path
import pandas as pd
import logging
from os.path import join
import pytz
from datetime import datetime
import threading
from typing import Optional
from config import config
import coloredlogs
#
# Time
#
def now() -> pd.Timestamp:
return pd.Timestamp.utcnow()
def is_in_future(timestamp: pd.T... |
test_app.py | # -*- coding: utf8 -*-
# ============LICENSE_START====================================================
# org.onap.vvp/validation-scripts
# ===================================================================
# Copyright © 2017 AT&T Intellectual Property. All rights reserved.
# ===========================================... |
tello-command.py | #!/usr/bin/python3
import threading
import socket
import time
tello_ip = "192.168.10.1"
"""
Tello port to send command message.
"""
command_port = 8889
"""
@brief Host IP address. 0.0.0.0 referring to current
host/computer IP address.
"""
host_ip = "0.0.0.0"
"""
@brief UDP port to receive response msg f... |
mono_session.py | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Thu Mar 2 15:34:08 2017
@author: robert
"""
#from scapy.all import sendrecv
#from scapy.all import utils # for export/import_object
import scapy
from scapy.all import *
from scapy.all import Ether, IP
#from scapy.all import Raw, ICMP, Ether, STP, Dot3, Dot... |
Server.py | #!/usr/bin/env python
#-*-coding:utf-8-*-
import tkinter, threading, socket
class Serveur(tkinter.Tk):
def __init__(self):
tkinter.Tk.__init__(self)
self.width, self.height = str(self.winfo_screenwidth()//2), str(self.winfo_screenheight()//2)
self.title("Miaouh - server")
... |
tello_py.py | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Thu Sep 24 22:11:47 2020
@author: jake
"""
import tello_controller
import tello_video
import multiprocessing
import numpy as np
#import logging
from pose_estimater import pose_estimater
import cv2 as cv
from control_panel import control_panel
import time
... |
unit.py | # coding=utf-8
import unittest
import sys
import os
import re
import json
import time
import errno
import logging
import shutil
import threading
import requests
sys.path.append(os.path.join("..", "src", "bin"))
from webhook import WebServer
class WebhooksAppTest(object):
"""
This provides some functionality f... |
mtping.py | import threading
import subprocess
def ping(host):
result = subprocess.run(
'ping -c2 %s &> /dev/null' % host,
shell=True
)
if result.returncode == 0:
print('%s:up' % host)
else:
print('%s:down' % host)
if __name__ == '__main__':
ips = ('172.40.63.%s' % i for i in r... |
master.py | '''
This module contains all of the routines needed to set up a master server, this
involves preparing the three listeners and the workers needed by the master.
'''
# Import python libs
import os
import re
import time
import errno
import fnmatch
import signal
import shutil
import stat
import logging
import hashlib
imp... |
http.py | from __future__ import print_function
from builtins import str
from builtins import object
import logging
import base64
import sys
import random
import string
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_... |
doc.py | import inspect
import tempfile
import subprocess
import shutil
import os
import sys
import threading
from itertools import chain
def header(func):
signature = inspect.signature(func)
args = [str(k) if v.default is inspect.Parameter.empty else str(k) + "=" + str(v.default)
for k, v in signature.paramete... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.