source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
Post_MainEnvironmentSimulator.py | #Post_MainEnvironmentSimulator.py
#Version:4
#Date:2020-04-14
#Author: Jaime Burbano
#Description: This file is the MAIN to run the PUBLISHER application of the HNA (Hazard Notification App)
#runs with python 3
#python3 MainEnvironmentSimulator v001
#TYPE: ORIGINAL FILE
#MODIFICATION: This file NEEDS ... |
terraform_notebook.py | """Helper methods to call terraform commands"""
import sys
import threading
import subprocess
def init():
"""
args:
"""
proc = subprocess.Popen(
"/bin/sh",
stdout=subprocess.PIPE,
stdin=subprocess.PIPE,
stderr=subprocess.STDOUT,
)
def outloop():
running... |
util_test.py | # Copyright 2014 Scalyr Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, so... |
k8s-dock-profile.py | #!/usr/bin/env python3
import sys
import threading
from argparse import ArgumentParser
from time import sleep
import subprocess
import traceback
import signal
import re
from os import system, name, environ, path
import json
con_dict = {}
def signal_handler(sig, frame):
try:
if not args.docker:
... |
dorna.py | import threading
import json
from random import random
import time
from .ws import ws
from .track import track_cmd
class dorna(ws):
"""docstring for Dorna"""
def __init__(self):
super(dorna, self).__init__()
def id_loop(self):
while self.connected:
time.sleep(0)
ms... |
train.py | #!/usr/bin/env python
from worker import *
from network import *
import threading
from time import sleep
flags = tf.app.flags
FLAGS = flags.FLAGS
flags.DEFINE_boolean('is_approaching_policy', False, 'If learning approaching policy.')
flags.DEFINE_integer('max_episodes', 200000, 'Maximum episodes.')
flags.DEFINE_inte... |
sync_rate_limiter.py | import logging
import time
import threading
import queue
# This is a moving-window rate limiter. The theory behind this limiter is that it will guarantee that at most
# `max_rate` hits will be allowed during any window of `period_s`. To be clear since the window is sliding
# there will be many windows this pertains ... |
athenad.py | #!/usr/bin/env python2.7
import json
import os
import random
import time
import threading
import traceback
import zmq
import requests
import six.moves.queue
from jsonrpc import JSONRPCResponseManager, dispatcher
from websocket import create_connection, WebSocketTimeoutException
from selfdrive.loggerd.config import ROOT... |
__main__.py | #!/usr/bin/env python3
# SPDX-FileCopyrightText: 2021 Benedict Harcourt <ben.harcourt@harcourtprogramming.co.uk>
#
# SPDX-License-Identifier: BSD-2-Clause
# vim: ts=4 expandtab nospell
"""Only Hope Bot"""
from __future__ import annotations
from typing import List
from multiprocessing import Process
import os
fro... |
c.py | import cv2
from queue import Queue
import threading
from fellbeast.drone import Drone
from fellbeast.routines import follow_person
q = Queue()
def display():
print("Start Displaying")
while True:
if q.empty() != True:
frame = q.get()
cv2.imshow("frame1", frame)
if cv2... |
dqn_learning_rate_cartpole.py | import sys
sys.path.insert(0, '../')
from algo.dqn import run_dqn
arguments = {
'game': 'CartPole-v1',
'mode': 'train',
'model': 'CartPoleModel',
'learning_rate': 0.0025,
'target_network_update': 200,
'egreedy_final': 0.01,
'egreedy_decay': 0.999,
'env_transforms': ['Penalizer'],
'replay_start_size': 1000,
... |
main.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# File : main.py
# Author : Chi Han
# Email : haanchi@gmail.com
# Date : 10.09.2019
# Last Modified Date: 01.10.2019
# Last Modified By : Chi Han
#
# Welcome to this little kennel of Glaciohound!
from __future__ import di... |
pumpThread.py | #Creation Date: (July 16, 2007)
#Author: John Creson
import maya.cmds as cmds
import maya.utils as utils
import threading
import time
import sys
from PyQt4 import QtCore, QtGui
pumpedThread = None
app = None
def pumpQt():
global app
def processor():
app.processEvents()
... |
test_suite.py | # -*- coding: utf-8 -*-
#
# Copyright 2017-2020 AVSystem <avsystem@avsystem.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 ... |
hc_sr04.py | import copy
import logging
from threading import Semaphore, Thread
from circum_hc_sr04.Bluetin_Echo.Bluetin_Echo import Echo
import click
logger = logging.getLogger(__name__)
tracking_semaphore = None
tracking_info = {"objects": []}
vector_info = []
updated = False
max_seen = 0
def _get_targets(echo: Echo, sample... |
main.py | from bottle import route, run, static_file, request, WSGIRefServer
from threading import Thread
import os, sys
EXIT_CODE = 0
@route('/static/<path:path>')
def server_static(path):
root = os.path.dirname(__file__)
if path == 'rs_require.js':
root = os.path.join(root, '../')
return static_file(path,... |
test_mycroft_skill_get_response.py | """Tests for the mycroft skill's get_response variations."""
from os.path import dirname, join
from threading import Thread
import time
from unittest import TestCase, mock
from lingua_franca import load_language
from mycroft.skills import MycroftSkill
from mycroft.messagebus import Message
from test.unittests.mocks... |
archive_downloader.py | import model
import helpers
import requests
import datetime
import json
import time
import threading
import queue
import logging
logger = logging.getLogger()
ch = logging.StreamHandler()
ch.setFormatter(logging.Formatter(
'\u001b[36m[%(threadName)s]\u001b[0m %(asctime)s - %(levelname)s - %(message)s'
))
logger.a... |
run.py | import os
import sys
import time
import argparse
from multiprocessing import Process
from fHDHR import fHDHR_VERSION
import fHDHR.exceptions
import fHDHR.config
import fHDHR.origin
import fHDHR.api
ERR_CODE = 1
ERR_CODE_NO_RESTART = 2
if sys.version_info.major == 2 or sys.version_info < (3, 3):
print('Error: f... |
__init__.py | import functools
import io
import logging
import mimetypes
import os
import os.path
import re
import socketserver
import threading
import time
import warnings
import wsgiref.simple_server
import watchdog.events
import watchdog.observers.polling
class _LoggerAdapter(logging.LoggerAdapter):
def process(self, msg, ... |
tests.py | from __future__ import unicode_literals
from datetime import datetime
import threading
from django.core.exceptions import ObjectDoesNotExist, MultipleObjectsReturned
from django.db import connections, DEFAULT_DB_ALIAS
from django.db import DatabaseError
from django.db.models.fields import Field, FieldDoesNotExist
fro... |
link_extractor.py | import json
import Queue
import threading
import argparse
from spider import spider
class LinkExtraction:
def __init__(self):
self.q = Queue.Queue()
self.args = None
def parse_arguments(self):
""" Parse arguments from the command line """
parser = argparse.ArgumentParser(desc... |
batch_utils.py | import time
import numpy as np
import multiprocessing
import os
import h5py
class DataGenerator(object):
"""
Generate minibatches with real-time data parallel augmentation on CPU
args :
hdf5_file (str) path to data in HDF5 format
batch_size (int) Minibatch size
dset ... |
node_client.py | import os
import subprocess
import threading
import time
import json
import sublime
import sublime_plugin
import time
from .logger import log
from . import json_helpers
from . import global_vars
# queue module name changed from Python 2 to 3
if int(sublime.version()) < 3000:
import Queue as queue
else:
import... |
ImagesTool.py | # https://google-images-download.readthedocs.io/en/latest/arguments.html ## Argumentos para downloads do Google
from google_images_download import google_images_download
# from zipfile import ZipFile
import os
import cv2
import threading
class ImagesTool:
def __init__(self):
self.downloader = google_images... |
speedtest_cli.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2012-2015 Matt Martz
# 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.or... |
common.py | import os
import re
import subprocess
import threading
import time
from contextlib import contextmanager
from pathlib import Path
import docker
import requests
from tests.helpers import fake_backend
from tests.helpers.util import (
get_container_file_content,
get_docker_client,
get_host_ip,
pull_from_r... |
http_mapi.py | from __future__ import print_function
from builtins import str
from builtins import object
import logging
import base64
import random
import os
import ssl
import time
import copy
import sys
import threading
from pydispatch import dispatcher
from flask import Flask, request, make_response
# Empire imports
from lib.comm... |
hermes.py | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import unicode_literals
from builtins import object
from typing import Optional, Callable, List, Text
from .ontology import MqttOptions
from .ontology.dialogue import ContinueSessionMessage, EndSessionMessage, StartSessionMessage, Sessio... |
gui_agent.py | import algorithms.gui.algo_one as a1
import algorithms.gui.algo_two as a2
import algorithms.gui.algo_three as a3
import algorithms.gui.algo_four as a4
import algorithms.gui.algo_five as a5
import algorithms.gui.algo_six as a6
import paho.mqtt.client as mqtt
import pickle
import subprocess as sp
import time
import rando... |
window.py | from tkinter import Tk, Frame, Label, BOTH, END
from PIL import ImageTk, Image
from controller.controller import Controller
import os
import threading
class MainWindow(Frame):
def __init__(self):
self.root = Tk()
self.root.geometry("250x100+" + str(self.root.winfo_screenwidth() - 250) + "... |
test_basic.py | # -*- coding: utf-8 -*-
"""
tests.basic
~~~~~~~~~~~~~~~~~~~~~
The basic functionality.
:copyright: © 2010 by the Pallets team.
:license: BSD, see LICENSE for more details.
"""
import re
import sys
import time
import uuid
from datetime import datetime
from threading import Thread
import pytest
im... |
main.py | import schedule
import time
import threading
import logging.config
from schedinstances.TextFileURLs import TextFileURLs
from schedinstances.ArtPackages import ArtPackages
from schedinstances.ArtMails import ArtMails, ArtDevMails
from schedinstances.BigTasks import BigTasks
from schedinstances.Harvester import Harveste... |
test_threaded.py | import os
import sys
import signal
import threading
from multiprocessing.pool import ThreadPool
from time import time, sleep
import pytest
import dask
from dask.compatibility import PY2
from dask.threaded import get
from dask.utils_test import inc, add
def test_get():
dsk = {"x": 1, "y": 2, "z": (inc, "x"), "w"... |
__init__.py | #!/usr/bin/env python
#
# Copyright 2017-2018 Amazon.com, Inc. and its affiliates. All Rights Reserved.
#
# Licensed under the MIT License. See the LICENSE accompanying this file
# for the specific language governing permissions and limitations under
# the License.
#
#
# Copy this script to /sbin/mount.efs and make sur... |
test_sitcp.py | # -*- coding:utf-8 -*-
"""
Unit test for sitcp module.
Copyright (c) 2018, Bee Beans Technologies Co.,Ltd.
"""
from __future__ import print_function
import datetime
import sys
from threading import Thread
import time
from unittest import TestCase
import unittest
from sitcpy import to_str, to_bytes, to_bytearray, to... |
gui_advance.py | """
This is the main script of main GUI of the advance Atom Probe.
"""
import numpy as np
import nidaqmx
import time
import threading
import datetime
import os
# PyQt and PyQtgraph libraries
from PyQt5 import QtCore, QtGui, QtWidgets
from PyQt5.QtCore import QThread, pyqtSignal
from PyQt5.QtWidgets import QApplication... |
wallet_multiwallet.py | #!/usr/bin/env python3
# Copyright (c) 2017-2020 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test multiwallet.
Verify that a flocoind node can load multiple wallet files
"""
from decimal import D... |
gui.py | #!/usr/bin/env python3
import json
import multiprocessing
import os
import threading
import time
import sys
from PyQt5 import QtCore, QtWidgets, uic
from PyQt5.QtGui import QIcon
from tools.exceptions import ValidationError, MissingValuesError
from tools.gui import oeffne_file_dialog_select
from tools import Modus
... |
taskq.py | #!/usr/bin/env python2
from multiprocessing import Process, Queue, Pool
from time import sleep
workq = Queue()
doneq = Queue()
errq = Queue()
def f():
retries=0
q = workq
done = doneq
err = errq
while True:
### get an item from the queue
try:
i = q.get_nowait()
... |
client1.py | """
network_client v1.0
done by:
Moe Assal
Contact:
mohammad.elassal04@gmail.com
phone number: +96171804948
location: Lebanon, Bekaa, Khirbet Rouha
v2.0:
-reboot without exiting
"""
import socket
import threading
HOST = "127.0.0.1"
PORT = 5432
my_sock = socket.socket(socket.AF_INET, socket.SOCK_STR... |
__init__.py | import time
from collections import deque
import torch
import numpy as np
from ... import mohex, hex
from . import json, analysis
from .. import common
from rebar import arrdict
from pavlov import stats, runs, logs
from logging import getLogger
import activelo
import pandas as pd
from functools import wraps
from contex... |
smutclient.py | # Copyright 2017,2018 IBM Corp.
#
# 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 agr... |
asyncs.py | """
Created 11 Mar. 2020
Author: Jordan Prechac
"""
from django.db import connection
import gc
import threading
# -----------------------------------------------------------------------------
# def perform_async_request(function, *args, **kwargs):
# """
# Wrapper for performing asyncronous functions
# ... |
bot_telegram.py | #-*- coding: utf-8 -*-
# window git https://git-scm.com/download/win
# pip install git+https://github.com/MoumenKhadr/telepot
import time
import telepot
from telepot.loop import MessageLoop
import os
import sys
import psutil
import threading
import config_key
import traceback
import json
TELEGRAM_BOT_ACCESS_TOKEN = co... |
websocket_client.py | # gdax/WebsocketClient.py
# original author: Daniel Paquin
# mongo "support" added by Drew Rice
#
#
# Template object to receive messages from the gdax Websocket Feed
from __future__ import print_function
import json
import base64
import hmac
import hashlib
import time
from threading import Thread
from websocket impor... |
test_poplib.py | """Test script for poplib module."""
# Modified by Giampaolo Rodola' to give poplib.POP3 and poplib.POP3_SSL
# a real test suite
import poplib
import asyncore
import asynchat
import socket
import os
import errno
import threading
from unittest import TestCase, skipUnless
from test import support as test... |
tangotineproxy.py | # ----------------------------------------------------------------------
# Author: yury.matveev@desy.de
# ----------------------------------------------------------------------
"""TangotoTine camera proxy
"""
import numpy as np
import time
import logging
from threading import Thread
try:
import PyTango
ex... |
_server_shutdown_scenarios.py | # Copyright 2018 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... |
common.py | # Copyright 2021 The Emscripten Authors. All rights reserved.
# Emscripten is available under two separate licenses, the MIT license and the
# University of Illinois/NCSA Open Source License. Both these licenses can be
# found in the LICENSE file.
from enum import Enum
from functools import wraps
from pathlib import... |
websocket_event_handler.py | # -*- coding: utf-8 -*-
__all__ = ('WebSocketEventHandler',)
import asyncio
import json
import threading
import typing
import queue
import attr
import websockets
from .event import DarjeelingEvent
from .handler import DarjeelingEventHandler
if typing.TYPE_CHECKING:
EventQueue = queue.Queue[DarjeelingEvent]
else... |
keep_alive.py | from flask import Flask
from threading import Thread
app = Flask('')
@app.route('/')
def main():
return "OMG its Working!!"
def run():
app.run(host="0.0.0.0", port=8080)
def keep_alive():
server = Thread(target=run)
server.start()
|
server.py | # Network Security Spring 2015 Assignment 2
# Programming problem
# Roberto Amorim - rja2139
import argparse, socket, signal
import time, ssl, os.path
from threading import Thread
# Configuration variables
BUFSIZE = 1024
filename = ""
# Here I take care of the command line arguments
parser = argparse.ArgumentParser(... |
check_public_headers.py | #!/usr/bin/env python
#
# Checks all public headers in IDF in the ci
#
# Copyright 2020 Espressif Systems (Shanghai) PTE 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... |
cli.py | import ast
import inspect
import os
import platform
import re
import sys
import traceback
from functools import update_wrapper
from operator import attrgetter
from threading import Lock
from threading import Thread
from typing import Any
from typing import TYPE_CHECKING
import click
from werkzeug.utils import import_s... |
photon.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from __future__ import print_function
# Let's import what we need
import os
import sys
import tld
import time
import random
import warnings
import argparse
import threading
from math import log
from re import search, findall
from requests import get, post
try:
impor... |
master.py | #
# Copyright Cloudlab URV 2020
#
# 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 writin... |
playmedia.py | from threading import Thread
import vlc, os, random, time
stopped_multiple = False
stopped_single = False
single_instance = None
multiple_instance = None
class SinglePlayer:
def __init__(self, file):
self.player = vlc.MediaPlayer()
self.player.audio_set_volume(100)
self.media = vlc.Media(f... |
userenum.py | #!/usr/bin/python3
# -*- coding: utf-8 -*-
# This is a part of CMSeeK, check the LICENSE file for more information
# Copyright (c) 2018 - 2020 Tuhinshubhra
import cmseekdb.basic as cmseek ## Good old module
import re ## Comes in handy while detecting version
import json ## For parsing the wpvulndb result
import thread... |
bundle_manager.py | import datetime
import logging
import os
import random
import re
import sys
import threading
import time
import traceback
from codalab.objects.permission import check_bundles_have_read_permission
from codalab.common import PermissionError
from codalab.lib import bundle_util, formatting, path_util
from codalabworker.fi... |
nzbsrv.py | """ nzbsrv: Simple web server to list and download movies from RSS feed of NZB indexes
It grabs some info about the movie, like poster and imdb link.
It provides Download and Ignore buttons.
- Download will download the .nzb in a folder, so that sabnzbs or other can start downloading it.
- Ignore will mark the mo... |
main.py | import os
import sys
import json
import shutil
import winreg
from requests import get
from threading import Thread
from PyQt5 import QtWidgets, QtCore
from files.installer import Ui_MainWindow
base_url = 'https://pixelsuft.github.io/gdl-installer-files/'
base_folder = ''
REG_PATH = 'Software\\Microsoft\\Windows\\Curr... |
gevent_tests.py | import time
import threading
from threading import Thread, Event
def worker(event_obj):
i=3
while i:
localtime = time.asctime(time.localtime(time.time()))
print("开始时间为 :", localtime)
time.sleep(100)
print("end")
localtime = time.asctime(time.localtime(time.time()))
... |
test.py | import argparse
import json
import os
from pathlib import Path
from threading import Thread
import numpy as np
import torch
import yaml
from tqdm import tqdm
from models.experimental import attempt_load
from utils.datasets import create_dataloader
from utils.general import coco80_to_coco91_class, check_dataset, check... |
robot.py | # Variable para determinar si se está ejecutando en una Raspberry o en PC. True para Raspberry
_raspi = True
if _raspi:
print("--- SISTEMA CARGADO EN UNA RASPI ---")
from python_code.admin_es import AdminES
else:
print("--- SISTEMA CARGADO EN UNA PC ---")
import random
import time
from python_code.stoppablethrea... |
workingScheduler.py | """
This project is going to be awesome. Need to research I/O in python for the jetson nano,
also need to research tensorflow lite.
So far all this does is toggle on and off an LED on pin 12
"""
import Jetson.GPIO as GPIO
import time
import nanocamera as nano
import cv2
import numpy as np
# For RT_Task
import queue
i... |
init.py | import time
import datetime
import numpy as np
import cv2
import mss
import mss.tools
import threading
startScreen = None
stgScreen = 340
stgWrong = 670
def listenAwaking():
curtime = datetime.datetime.now()
while True:
time.sleep(1)
diff = (datetime.datetime.now()- curtime).total_seconds()
... |
monitor.py | # -*- coding: utf-8 -*-
# File: monitor.py
import json
import numpy as np
import operator
import os
import re
import shutil
import time
from collections import defaultdict
from datetime import datetime
import six
import threading
from ..compat import tfv1 as tf
from ..libinfo import __git_version__
from ..tfutils.su... |
base.py | import sys
import numpy as np
from OpenGL.GL import *
from OpenGL.GL import shaders
from OpenGL.GLUT import *
import glm
import threading
import time
import pywavefront
import pyrr
import os
from PIL import Image
from PIL import ImageOps
vao = None
vbo = None
shaderProgram = None # none, phong, flat, smooth
shaderP... |
main.py | import threading
import time
import math
import sys
import os
import tkinter as tk
from tkinter import ttk
import cv2
import pytesseract
from PIL import ImageGrab
import numpy as np
pytesseract.pytesseract.tesseract_cmd = r'Tesseract-OCR\tesseract.exe'
'''
Convert coordinates for different screen sizes. Only works fo... |
day13.py | from random import randint
from time import time, sleep
def download_task(filename):
print('开始下载%s...' % filename)
time_to_download = randint(5, 10)
sleep(time_to_download)
print('%s下载完成! 耗费了%d秒' % (filename, time_to_download))
def main():
start = time()
download_task('Python从入门到住院.pdf')
... |
communicator.py | import asyncio, websockets, json, sys, pathlib, ssl
from trial import Trial
from multiprocessing import Process, Pipe
from s3upload import Uploader
import logging
# https://irll.net/?server=ws://localhost:5000
ADDRESS = "localhost" # set desired IP for development
PORT = 5000 # if port is changed here it must also b... |
net_stresser.py | #! /usr/bin/env python2
import multiprocessing as mp
import argparse
import subprocess
import time
import os
from random import randint
parser = argparse.ArgumentParser(description="Stress the VM network stack")
parser.add_argument('--host', dest="host")
parser.add_argument('--duration', type=int, dest="duration", d... |
test_rate_mgr.py | import statistics
import time
import unittest
from multiprocessing import Lock
from threading import Thread
from time import sleep
from apiqueue import ApiQueue
class TestRateManager(unittest.TestCase):
test_metrics = []
thread_end_times = []
mutex = Lock()
brm = None
def setUp(self):
se... |
train.py | """Train a YOLOv5 model on a custom dataset
Usage:
$ python path/to/train.py --data coco128.yaml --weights yolov5s.pt --img 640
"""
import argparse
import logging
import os
import random
import sys
import time
import warnings
from copy import deepcopy
from pathlib import Path
from threading import Thread
import ... |
data_recorder_process.py | # Copyright 2019 Jetperch LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... |
video.py | # -------------------------------------#
# 调用摄像头或者视频进行检测
# 调用摄像头直接运行即可
# 调用视频可以将cv2.VideoCapture()指定路径
# 视频的保存并不难,可以百度一下看看
# -------------------------------------#
import cv2
import numpy as np
import tensorflow as tf
from PIL import Image
from yolo import YOLO
import face_recognition
import os
import time
impo... |
OptimizeRasters.py | # ------------------------------------------------------------------------------
# Copyright 2022 Esri
# 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/LICEN... |
cliente.py | import socket # Import socket module
from threading import Thread
import time
#print "Ingresa el mensaje "
#msg=input()
def bandeja():
global status
global s
while 1:
men=s.recv(1024)
print str("\n")+men
if "Adios" in men:
status=True
break
def caja():
global s
global status
while 1:
... |
sequence_input_layer.py | #!/usr/bin/env python
#Data layer for video. Change flow_frames and RGB_frames to be the path to the flow and RGB frames.
import sys
sys.path.append('../../python')
import caffe
import io
from PIL import Image
import matplotlib.pyplot as plt
import numpy as np
import scipy.misc
import time
import pdb
import glob
imp... |
core.py | # -*- coding: utf-8 -*-
import os
import sys
import json
import subprocess
import shutil
import glob
import uuid
from datetime import datetime
from tqdm import tqdm
import configparser
from loguru import logger
import javalang
from javalang import parse
core_config = configparser.ConfigParser()
core_config.read(os.p... |
main.py | from __future__ import unicode_literals
from prompt_toolkit.application import Application
from prompt_toolkit.auto_suggest import AutoSuggestFromHistory
from prompt_toolkit.buffer import Buffer, AcceptAction
from prompt_toolkit.buffer_mapping import BufferMapping
from prompt_toolkit.enums import DUMMY_BUFFER, Editing... |
go_tool.py | import argparse
import copy
import json
import os
import shutil
import subprocess
import sys
import tempfile
import threading
arc_project_prefix = 'a.yandex-team.ru/'
std_lib_prefix = 'contrib/go/_std/src/'
vendor_prefix = 'vendor/'
def compare_versions(version1, version2):
v1 = tuple(str(int(x)).zfill(8) for x ... |
REDItoolDnaRna.py | #!/home/epicardi/bin/python27/bin/python
# Copyright (c) 2013-2014 Ernesto Picardi <ernesto.picardi@uniba.it>
#
# 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 ... |
AudioThread.py | from queue import Queue
from threading import Thread
import logging
class AudioThread:
def __init__(self, stream, chunk, timeout=0, rate=16000):
self.run = True
self.queue = Queue(maxsize=0)
self.thread = Thread(target=self.read_stream, args=(stream, chunk, rate, timeout))
self.thr... |
game.py | import inspect
import json
import threading
import time
from GAME_ATTR import GAME_ATTR, TUTORIAL
from channel import Channel
import requests
from requests.structures import CaseInsensitiveDict
class Game(Channel):
def __init__(self, bot, channel, verbose):
super().__init__(bot, channel, ver... |
fleetspeak_client.py | #!/usr/bin/env python
"""Fleetspeak-facing client related functionality.
This module contains glue code necessary for Fleetspeak and the GRR client
to work together.
"""
import logging
import os
import pdb
import Queue
import struct
import threading
import time
from fleetspeak.src.client.daemonservice.client import ... |
saltmod.py | # -*- coding: utf-8 -*-
'''
Control the Salt command interface
==================================
This state is intended for use from the Salt Master. It provides access to
sending commands down to minions as well as access to executing master-side
modules. These state functions wrap Salt's :ref:`Python API <python-ap... |
test_html.py | from functools import partial
from importlib import reload
from io import BytesIO, StringIO
import os
from pathlib import Path
import re
import threading
from urllib.error import URLError
import numpy as np
import pytest
from pandas.compat import is_platform_windows
from pandas.errors import ParserError
import pandas... |
drEngine.py | # encoding: UTF-8
'''
本文件中实现了行情数据记录引擎,用于汇总TICK数据,并生成K线插入数据库。
使用DR_setting.json来配置需要收集的合约,以及主力合约代码。
'''
import json
import csv
import os
import copy
import traceback
from collections import OrderedDict
from datetime import datetime, timedelta
from Queue import Queue, Empty
from threading import Thread
from pymongo.er... |
base_crash_reporter.py | # Electrum - lightweight Bitcoin client
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation files
# (the "Software"), to deal in the Software without restriction,
# including without limitation the rights to use, copy, modify, merge,
# publish... |
ucomm_relay_server.py | #!/usr/bin/env python
#
# Cloudlet Infrastructure for Mobile Computing
#
# Author: Kiryong Ha <krha@cmu.edu>
# Zhuo Chen <zhuoc@cs.cmu.edu>
#
# Copyright (C) 2011-2013 Carnegie Mellon University
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in com... |
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... |
xp.py | import discord
from discord.ext import commands
from discord.utils import find
from __main__ import send_cmd_help
import platform, asyncio, string, operator, random, textwrap
import os, re, aiohttp
from cogs.utils.dataIO import dataIO, fileIO
from cogs.utils import checks
# from cogs.economy import Banque, Bank... |
30_4_multithread_rlock.py | from threading import Thread
num = 0
def do_sth():
global num
for i in range(1000000):
num += 1
adda()
addb()
def adda():
global num
num += 1
def addb():
global num
num += 1
tlist = []
for i in range(10):
t = Thread(target=do_sth)
tlist.append(t)
t.start()
... |
createfulldb.py | if __name__ == '__main__':
import feed_control
import multiprocessing
import time
import logStore
process = multiprocessing.Process(target=feed_control.cli)
process.start()
time.sleep(5)
process.terminate()
logMerge = LogMerge()
from EventCreationTool import EventFa... |
minimizer.py | # Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
loop.py | import threading
from datetime import timedelta, datetime
import time
class Loop(object):
def __init__(self, name, root, interval, delay=5 ):
self._loop_root = root
self._loop_delay = delay
self._loop_interval = interval
self._loop_name = name
self._loop_thread = N... |
light_reaper.py | # Copyright 2016-2018 CERN for the benefit of the ATLAS collaboration.
#
# 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... |
server.py | # Copyright (c) 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 wri... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.