source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
learn.py | # # Unity ML-Agents Toolkit
import logging
from multiprocessing import Process, Queue
import os
import glob
import shutil
import numpy as np
import yaml
from docopt import docopt
from typing import Optional
from mlagents.trainers.trainer_controller import TrainerController
from mlagents.trainers.exception import Tr... |
output_devices.py | import warnings
from time import sleep
from threading import Lock
from itertools import repeat
from RPi import GPIO
from .devices import GPIODeviceError, GPIODevice, GPIOThread
class OutputDeviceError(GPIODeviceError):
pass
class OutputDevice(GPIODevice):
"""
Represents a generic GPIO output device.
... |
base.py | # -*- coding: utf-8 -*-
# BSD 3-Clause License
#
# Copyright (c) 2019, Elasticsearch BV
# 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 ... |
computer.py | # Library file on the Computer.
# Must be in the same directory as any file using it's functions.
import socket
import struct
import sys
from threading import Thread, Event
from binascii import crc_hqx
class CompTalk:
def __init__(self, host):
# Variables that define the communication
self.buf... |
__init__.py | import os
import sys
import cmd
import time
import serial
import select
import struct
import threading
import cPickle as pickle
from cancat import iso_tp
# defaults for Linux:
serialdev = '/dev/ttyACM0' # FIXME: if Windows: "COM10" is default
baud = 4000000
# command constants (used to identify messages between ... |
mp_preload.py | import multiprocessing as multiprocess
multiprocess.Lock()
def f():
print("ok")
if __name__ == "__main__":
ctx = multiprocess.get_context("forkserver")
modname = "test.mp_preload"
# Make sure it's importable
__import__(modname)
ctx.set_forkserver_preload([modname])
proc = ctx.Process(ta... |
engine.py | """"""
import importlib
import os
import traceback
from collections import defaultdict
from pathlib import Path
from typing import Any, Callable
from datetime import datetime, timedelta
from threading import Thread
from queue import Queue
from copy import copy
from vnpy.event import Event, EventEngine
from vnpy.trade... |
independent.py | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import random
import math
import json
import threading
import numpy as np
import tensorflow as tf
import util
import coref_ops
import conll
import metrics
import optimization
from bert import tokeniz... |
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 gen.ut... |
data_flow.py | # -*- coding: utf-8 -*-
from __future__ import division, print_function, absolute_import
import numpy as np
import threading
try:
# Python 2
import Queue as queue
except Exception:
# Python 3
import queue
from . import utils
class DataFlow(object):
""" Data Flow.
Base class for using real t... |
gui_tkinter.py | import board
import pieces
import os
from multiprocessing import Process, Queue
import Tkinter as tk
from PIL import Image, ImageTk
import time
turn = 0
flag = 0
class BoardGuiTk(tk.Frame):
pieces = {}
selected = None
selected_piece = None
hilighted = None
icons = {}
color1 = "white"
color2 ... |
cyber_launch.py | #!/usr/bin/env python3
# ****************************************************************************
# Copyright 2018 The Apollo 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 o... |
installwizard.py |
from functools import partial
import threading
import os
from kivy.app import App
from kivy.clock import Clock
from kivy.lang import Builder
from kivy.properties import ObjectProperty, StringProperty, OptionProperty
from kivy.core.window import Window
from kivy.uix.button import Button
from kivy.utils import platform... |
test_security.py | """Test libzmq security (libzmq >= 3.3.0)"""
# -*- coding: utf8 -*-
# Copyright (C) PyZMQ Developers
# Distributed under the terms of the Modified BSD License.
import os
from threading import Thread
import zmq
from zmq.tests import (
BaseZMQTestCase, SkipTest
)
from zmq.utils import z85
USER = b"admin"
PASS = ... |
__init__.py | # Copyright 2017 Mycroft AI 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 writin... |
worker_manager.py | '''
Code for the work:
``Multi Agent Active Search using Realistic Depth-Aware Noise Model'', Ramina Ghods, William J Durkin and Jeff Schneider
(C) Ramina Ghods 2020 (rghods@cs.cmu.edu)
Please cite the following paper to use the code:
@article{ghods2020multi,
title={Multi-Agent Active Search using Realistic Depth-... |
kerberos_sigmf_playback4.py | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
##################################################
# GNU Radio Python Flow Graph
# Title: Kerberos Sigmf Playback4
# GNU Radio version: 3.7.13.4
##################################################
if __name__ == '__main__':
import ctypes
import sys
if sys.platf... |
tb_device_mqtt.py | # Copyright 2020. ThingsBoard
# #
# 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 ... |
P2PClientForServer.py | import json
import threading
import requests
import socket
from requests.adapters import HTTPAdapter
from urllib3.poolmanager import PoolManager
import asyncio
import websockets
import time
from threading import Thread
class SourcePortAdapter(HTTPAdapter):
""""Transport adapter" that allows us to set the source ... |
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... |
split-fasta-on-degree-th.py | #! /usr/bin/env python
#
# This file is part of khmer, http://github.com/ged-lab/khmer/, and is
# Copyright (C) Michigan State University, 2009-2013. It is licensed under
# the three-clause BSD license; see doc/LICENSE.txt.
# Contact: khmer-project@idyll.org
#
import sys
import screed.fasta
import os
import khmer
impor... |
wordnet_app.py | # Natural Language Toolkit: WordNet Browser Application
#
# Copyright (C) 2001-2013 NLTK Project
# Author: Jussi Salmela <jtsalmela@users.sourceforge.net>
# Paul Bone <pbone@students.csse.unimelb.edu.au>
# URL: <http://www.nltk.org/>
# For license information, see LICENSE.TXT
"""
A WordNet Browser application ... |
merge_smurf_vcfs.py | #!/usr/bin/python
import vcf as pyvcf
import argparse
import re
import os
import sys
import collections
import multiprocessing as mp
import queue
import time
contig_list = []
def main():
for vcf_reader in vcf_readers:
for contig in vcf_reader.contigs:
if contig not in contig_list:
... |
klee_sym_explorer.py | import ConfigParser
import multiprocessing
import subprocess
import os
import sys
import utils
import signal
from utils import bcolors
def se_info(s):
print bcolors.HEADER+"[KleeSym-Info]"+bcolors.ENDC," {0}".format(s)
class SymExplorer:
def __init__(self, config, target):
self.jobs = {}
self... |
intermediate_output.py | # Copyright 2018 Amazon.com, Inc. or its affiliates. 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. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file acc... |
ipc.py | import sys
import threading
from multiprocessing import Queue, Pipe, Process
if sys.platform == 'win32':
from multiprocessing.reduction import reduce_pipe_connection as reduce_connection
from multiprocessing.reduction import rebuild_pipe_connection as rebuild_connection
else:
from multiprocessing.reduction... |
server.py | from flask import Flask, jsonify, request, Response, abort, Blueprint
from flask_socketio import SocketIO
from flask_cors import CORS
import random
import logging
import pkgutil
import threading
import click
import time
from colorama import Fore, Back, Style
flask_log = logging.getLogger("werkzeug")
flask_log.setLev... |
threadedclient.py | # -*- coding: utf-8 -*-
import threading
from ws4py.client import WebSocketBaseClient
__all__ = ['WebSocketClient']
class WebSocketClient(WebSocketBaseClient):
def __init__(self, url, protocols=None, extensions=None, heartbeat_freq=None,
ssl_options=None, headers=None, exclude_headers=None):
... |
tunnel.py | """Basic ssh tunnel utilities, and convenience functions for tunneling
zeromq connections.
Authors
-------
* Min RK
"""
#-----------------------------------------------------------------------------
# Copyright (C) 2010-2011 IPython Development Team, Min Ragan-Kelley
#
# Redistributed from IPython under the terms ... |
gen_key.py | import os
from os import path
from threading import Thread
from netaddr import IPNetwork
cidr = os.environ['CIDR']
client_dir = os.environ['CLIENT_DIR']
number_of_clients = os.environ['NUMBER_OF_CLIENTS']
network = IPNetwork(cidr)
range_ip = list(network)[2:int(number_of_clients)+2]
def gen_key(private_key_path, pu... |
van_hove.py | import multiprocessing
import sys
import itertools as it
import warnings
import numpy as np
import mdtraj as md
from progressbar import ProgressBar
from itertools import combinations_with_replacement
from scattering.utils.utils import get_dt, get_unique_atoms
from scattering.utils.constants import get_form_factor
d... |
option.py | #!/usr/bin/env python
"""
Copyright (c) 2006-2019 sqlmap developers (http://sqlmap.org/)
See the file 'LICENSE' for copying permission
"""
import cookielib
import glob
import inspect
import logging
import os
import random
import re
import socket
import string
import sys
import tempfile
import threading
import time
im... |
move_file.py | #!/usr/bin/env python2
# coding: utf-8
import argparse
import errno
import logging
import os
import threading
import time
import boto3
import yaml
from botocore.client import Config
from pykit import jobq
ITER_STATUS = {
'total': 0,
'total_size': 0,
'marker': '',
}
MOVE_STATUS = {
'total': 0,
... |
measurement.py | '''
OnionPerf
Authored by Rob Jansen, 2015
See LICENSE for licensing information
'''
import os, traceback, subprocess, threading, Queue, logging, time, datetime, re, shlex
from lxml import etree
# stem imports
from stem.util import str_tools
from stem.control import Controller
from stem.version import Version, ... |
ConductorWorker.py | #
# Copyright 2017 Netflix, 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... |
cross_device_ops_test.py | # Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
__init__.py | # Copyright The OpenTelemetry 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 ... |
hard_subs_to_srt.py | from os import times
from PIL import Image
import pytesseract
import imagehash
import cv2
import numpy
import sys
from imutils.video import FileVideoStream
from queue import Queue
from threading import Thread
import argparse
FIRST_FRAME = 2500 # Skip frames up to this point
PREVIEW_MAX_SIZE = (1280, 720)
# The subtit... |
main.py | import os
from . import utils
import numpy as np
from scipy.stats import scoreatpercentile
from scipy.optimize import curve_fit
from scipy import exp
import operator
from copy import copy, deepcopy
from collections import defaultdict, Counter
import re
from pyteomics import parser, mass, fasta, auxiliary as aux, achrom... |
mutex.py | from multiprocessing import Process, Lock
mutex = Lock()
def processData(data):
with mutex:
print(data)
if __name__ == '__main__':
while True:
some_data = "This is the data"
p = Process(target = processData, args = (some_... |
network.py | # Electrum - Lightweight Electrum Client
# Copyright (c) 2011-2016 Thomas Voegtlin
#
# 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 ri... |
addonmanager.py | import gi
gi.require_version("Gtk", "3.0")
import gi
from gi.repository import Gtk, GObject
from addondownloader import AddonDownloader
from pathlib import Path
from threading import Thread
class AddonManagerWindow(Gtk.Window):
adl = None
addons = ""
addons_location = ""
addons_location_field = None
... |
plugin.py | import base64
import re
import threading
from binascii import hexlify, unhexlify
from functools import partial
from electrum.bitcoin import (bc_address_to_hash_160, xpub_from_pubkey,
public_key_to_p2pkh, EncodeBase58Check,
TYPE_ADDRESS, TYPE_SCRIPT,
... |
worker.py | import asyncio
import dataclasses
import itertools
import typing as t
from dataclasses import dataclass, field
from functools import partial
from queue import Empty, SimpleQueue
from threading import Event, ThreadError
from time import monotonic
from hybrid_pool_executor.base import (
Action,
BaseManager,
... |
bot.py | """
AUTO_BOT bot file
Developers: Andrey Kozlovsky, Stanislav Ermokhin
"""
import datetime
import schedule
import time
import telebot
from telebot import types
from threading import Thread
from config import API_TELEGRAM_TOKEN as TOKEN
import local_en as local
import wrapper_functions
import weather
SECONDS_TO_F... |
bootstrap.py | import sys
import threading
import os
from textwrap import dedent
import sublime
# Clean up the installed and pristine packages for Package Control 2 to
# prevent a downgrade from happening via Sublime Text
if sys.version_info < (3,):
sublime_dir = os.path.dirname(sublime.packages_path())
pristine_dir = os.pa... |
environment.py | import abc
import consul
import datetime
import etcd
import kazoo.client
import kazoo.exceptions
import os
import psutil
import psycopg2
import json
import shutil
import signal
import six
import subprocess
import sys
import tempfile
import threading
import time
import yaml
@six.add_metaclass(abc.ABCMeta)
class Abstra... |
client.py | import asyncore
import socket
import json
import threading
server_address = ("127.0.0.1", 5920)
class Client(asyncore.dispatcher):
def __init__(self):
asyncore.dispatcher.__init__(self)
self.create_socket(socket.AF_INET, socket.SOCK_STREAM)
self.connect(server_address)
def handle_read... |
refined_dqn.py | #!/usr/bin/env python3
import glob
import os
import sys
import random
import time
import sys
import numpy as np
import cv2
import math
from collections import deque
import tensorflow as tf
# from keras.applications.xception import Xception
from keras.layers import Dense, GlobalAveragePooling2D, Flatten
from tensorflow.... |
face_detection_service.py | # MIT License
#
# Copyright (c) 2019 Onur Dundar
#
# 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, ... |
framework.py | import argparse
import imp
import os
import re
import sys
# import our libs
from utils import Utils, Display
from keystore import KeyStore as kb
from events import EventHandler
from mynmap import mynmap
from mymsf import myMsf
from threading import RLock, Thread
from keyeventthread import KeyEventThread
class Framew... |
mutate_pdb.py | from pmx import Model
from pmx.rotamer import load_bbdep
import argparse
import os
from helper import map_atom_string
from pmx.library import _aacids_dic
from pmx.rotamer import get_rotamers, select_best_rotamer
from os.path import basename
from multiprocessing import Process
# Argument parsers
def parse_... |
train.py | #!/usr/bin/env python
import os
import json
import torch
import numpy as np
import queue
import pprint
import random
import argparse
import importlib
import threading
import traceback
import torch.distributed as dist
import torch.multiprocessing as mp
from tqdm import tqdm
from torch.multiprocessing import Process, Q... |
portscan.py | import socket
from colorama import Fore as fore
from threading import Thread, Lock
from queue import Queue
import os
def init():
print("portscanner_module [OK]")
def execute(host):
N_THREADS = 400
global q
q = Queue()
print_lock = Lock()
global open_ports
open_ports = []
... |
startCrawler.py | #!/usr/bin/env python
# encoding: utf-8
"""
author:haoning
create time:2015.8.1
"""
import hashlib
import os
import time
import datetime
import traceback
import sys
import random
import json
import socket
import threading
from hashlib import sha1 # ่ฟ่กhashๅ ๅฏ
from random import randint
from struct import unpack
from soc... |
wr_arp.py | # This is Control Plane Assistent test for Warm-Reboot.
# The test first start Ferret server, implemented in Python. Then initiate Warm-Rebbot procedure.
# While the host in Warm-Reboot test continiously sending ARP request to the Vlan member ports and
# expect to receive ARP replies. The test will fail as soon as ther... |
_UIAHandler.py | #_UIAHandler.py
#A part of NonVisual Desktop Access (NVDA)
#Copyright (C) 2011-2018 NV Access Limited, Joseph Lee, Babbage B.V.
#This file is covered by the GNU General Public License.
#See the file COPYING for more details.
from ctypes import *
from ctypes.wintypes import *
import comtypes.client
from comtyp... |
Implement_Xil.py | # A tool implementing full/fractional factorial design for Xilinx ISE design Suite
# Launch format: python Implement_Xil.py config.xml
# where config.xml - custom configuration of DSE flow
# Author: Ilya Tuzov, Universitat Politecnica de Valencia
import sys
import xml.etree.ElementTree as ET
import re
import os
import ... |
start_server.py | #!/usr/bin/env python
# _*_ coding: utf-8 _*_
# @Time : 2022/3/14 21:23
# @Author : dodo
# @Version๏ผV 0.1
# @desc : ๅ
ฅๅฃ่ๆฌ
from gevent import monkey
monkey.patch_all()
import os
import newest_jinzhi_mgr
import peak_valley_mgr
import threading
import requests
import json
import bottle
import valid_funds_db_mgr
from d... |
uiautomation.py | # coding=utf-8
__author__ = 'lxn3032'
import os
import requests
import time
import warnings
import atexit
try:
new_airtest_api = True
import airtest.core.api as _____
except ImportError:
new_airtest_api = False
from airtest.core.android.utils.iputils import get_ip_address
from airtest.core.android.i... |
scanbackup_20210224145802.py | """
1ใๆไปถๅฐ่ฟ้
ไธไปฝ็ปES ไธไปฝ็ป่ชๅทฑ
ๆฐๅขESๆง็ดขๅผๅ
ฅๅบ
ๅจ็ปงๆฟๅๆๅ่ฝ็ๅบ็กไธ
้ๆๅคไปฝ็จๅบ๏ผๆ็
งๆฐๆฎๅ
็
ๅฝๅฎถ-ๅฝๅๆถ้ด๏ผๅนด-ๆ-ๆฅ๏ผ
ๅฆๆๆ็
งๆฐๆฎๅ
็ๆถ้ด็่ฏไนไผ้ขไธดๅๆๅฝๅฎถ็ซฏๅฃๅคไปฝ็้ฎ้ข
ไธ็จๅๅ็ซฏๅฃไบ
create by judy 20201217
"""
from pathlib import Path
import threading
import json
from queue import Queue
import traceback
import datetime
import time
from shutil import copyfile
import zipfile
import shutil
... |
threadDemo.py | import threading, time
print('Start of program.')
def takeANap():
time.sleep(5)
print('Wake up!')
threadObj = threading.Thread(target=takeANap)
threadObj.start()
print('End of program.')
|
async_.py | from __future__ import print_function
from __future__ import absolute_import
from __future__ import division
import sys
import time
import threading
__all__ = [
'await_callback',
]
class ThreadExceptHookHandler(object):
"""Workaround to deal with a bug in the Python interpreter (!).
Report: http://bug... |
jd_OpenCard.py | #!/bin/env python3
# -*- coding: utf-8 -*
'''
้กน็ฎๅ็งฐ: JD_OpenCard
Author: Curtin
ๅ่ฝ๏ผJDๅ
ฅไผๅผๅก้ขๅไบฌ่ฑ
CreateDate: 2021/5/4 ไธๅ1:47
UpdateTime: 2021/6/19
'''
version = 'v1.2.2'
readmes = """
# JDๅ
ฅไผ้ข่ฑๅฐ็จๅบ

## ไฝฟ็จๆนๆณ
#### [ๆๆบ็จๆท๏ผๅ่๏ผ https:/... |
Server.py | import socket
import threading
PORT = 5050
SERVER = socket.gethostbyname(socket.gethostname())
FORMAT = 'ascii'
server = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
server.bind((SERVER, PORT))
server.listen()
clients = []
nicknames = []
def broadcast(message):
for client in clients:
client.send(... |
test_kudu.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... |
stream.py | import queue
import sys
import threading
import time
_global_streams = {"stdout": None, "stderr": None}
DEBOUNCE_SECONDS = 3
class StreamBase(object):
def __init__(self, src, callbacks=None):
assert hasattr(sys, src)
self.src = src
self.callbacks = callbacks or []
@p... |
splash.py | import os
import tkinter
import time
import threading
import builtins
import sys
from PIL import ImageTk, Image
sys._stderr = sys.stderr
sys._stdout = sys.stdout
def disable_print():
sys.stdout = os.devnull
sys.stderr = os.devnull
def enable_print():
sys.stdout = sys._stdout
sys.stderr = sys._stderr
... |
Practisinglist.py | counter = 15
lickT= 900000
start = 67
startmoment = 89
lickLst = []
rewLst= []
rewT=689
lickLst.append([counter,lickT-start,lickT-startmoment,'' +str('RL'), ''+str ('Correct')])
#print lickLst
#lickLst.append([counter,lickT-start,lickT-startmoment,'' +str('LL'), ''+str ('Incorrect')])
rewLst.append([counter, rewT-sta... |
PipeW.py | import os
import time
import io
import threading
import queue
from threading import Thread, Lock
class PipeW:
def __init__(self, fifoPath, msgQMax):
self.path = fifoPath
self.pipe = None
self.blocking = False
self.msgQ = queue.Queue()
self.msgQMax = msgQMax
self.pipeThread = Thre... |
kazoo_more_room_test.py | import datetime
import random
import threading
import time
from kazoo.client import KazooClient
from zk.zk_wrapper import zkWatch
"""
่ชๅทฑ็ฌ่ฎฐๆฌ
700 ๆฟ้ด 400ไบบ 500count/s
50 ๆฟ้ด 400ไบบ 220count/s
ecs 8ๆ ธ16G
cpu 60% 1200count /1s 5ไธช่ฟ็จ ๆฏไธช่ฟ็จ400-600 ็บฟ็จ
cpu 15% 500count /1s 1ไธช่ฟ็จ ๆฏไธช่ฟ็จ400-600 ็บฟ็จ
"""
zk = KazooClient(hosts='127... |
phishingRunner.py | ######################################################
# #
# SOCIALFISH v2.0 #
# #
# by: UNDEADSEC #
# ... |
test_runner_local.py | import os
import threading
import time
from unittest import TestCase
from galaxy import model
from galaxy.jobs import metrics
from galaxy.jobs.runners import local
from galaxy.util import bunch
from ..tools_support import (
UsesApp,
UsesTools
)
class TestLocalJobRunner(TestCase, UsesApp, UsesTools):
de... |
generateDistanceMatrix.py | import math
import subprocess
import threading
import cv2
import numpy as np
import time
import os
from nvjpeg import NvJpeg
from ctypes import *
P = 8
def thread_function(name, folder):
global outputString, labels, files, P
N = len(files)
start = name * math.ceil((float)(N)/ P)
end = mi... |
run_server.py | from server.zmq_server import run_zmq_SUB_server, expire_box_set_members, media_sending_process
import multiprocessing
import zmq
import time
import configfile
import redis
if __name__ == '__main__':
try:
rdb = redis.StrictRedis(host=configfile.REDIS_HOST)
server_process = multiprocessing.Proc... |
Client.py | from socket import *
from threading import *
from tkinter import *
clientSocket = socket(AF_INET, SOCK_STREAM)
clientSocket.setsockopt(SOL_SOCKET, SO_REUSEADDR, 1)
hostIp = "127.0.0.1"
portNumber = 5050
clientSocket.connect((hostIp, portNumber))
window = Tk()
window.title("Connected To: "+ hostIp+ ":"+str(portNumbe... |
common.py | import sys
from io import StringIO
def network_collapse(cluster):
i = 1
for obj in cluster:
obj.stop()
for obj in cluster:
obj.join()
print("Terminating model {0}...".format(i), end = "\r")
i += 1
print("\nAll models terminated")
def swap_in(stdout):
"""Swap in the current stdout object for one given as... |
uvicorn_server_context.py | import contextlib
import time
import threading
import uvicorn
import asyncio
# https://github.com/encode/uvicorn/issues/742
# provides easy to use context
# config = Config(app=app, port = os.environ.get('PORT', '8081'))
# server = UvicornServerContext(config)
# with server.run_in_thread():
# while T... |
process_shapenet.py | import open3d as o3d
import numpy as numpy
import glob
import os
from tqdm import tqdm
from multiprocessing import Pool
import multiprocessing
SHAPENET_ROOT="/home/daxuan/Dataset/ShapeNetCore.v2"
OUTPUT_PATH = "/home/daxuan/Dataset/off_files"
def get_shapenet_files(category):
files = glob.glob("%s/%s/**/models/*... |
thermal_save_mysql.py | import pygame
import os
import math
import time
from datetime import datetime, date
import numpy as np
from scipy.interpolate import griddata
from scipy import stats
import cv2
from colour import Color
from CentroidTracker import CentroidTracker
from multiprocessing import Process, active_children
import pexpect
import... |
azure_api.py | import os
import requests
import urllib3
import time
import threading
import subprocess
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
#This file is a video indexer API
import logging
logging.basicConfig(filename='./logs/example.log',level=logging.DEBUG)
#Log format
#logging.debug('This message ... |
rover_a.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import ConfigParser
import logging
import numpy
import threading
import time
import Adafruit_PCA9685
import atexit
from flask import Flask
from sqlalchemy import create_engine, case
from sqlalchemy.orm import sessionmaker
from sqlalchemy.sql import func
from models impor... |
jssh.py | # -*- coding: utf-8 -*-
# ๆฅ้ไฟกๆฏไธบๅผนๅบๆก
#ไฟฎๆนๅค็บฟ็จ
#ๆง่ก่ฟๅบฆไผๅ
from Tkinter import *
from tkFileDialog import *
from threading import Thread,Semaphore
from datetime import datetime
import gl
from server import *
from ttk import Combobox
from tkFont import Font,NORMAL
# import atexit
from signal import signal,SIGTERM,SIGINT
import... |
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 bitcoind node can load multiple wallet files
"""
from decimal import D... |
ros_wrapper.py | #!/usr/bin/env python
# coding: utf-8
import os
import sys
import atexit
import pybullet
from qibullet.camera import Camera
from qibullet.camera import CameraRgb
from qibullet.camera import CameraDepth
from qibullet.nao_virtual import NaoVirtual
from qibullet.romeo_virtual import RomeoVirtual
from qibullet.pepper_virt... |
nanny.py | from __future__ import print_function, division, absolute_import
from datetime import timedelta
import logging
from multiprocessing.queues import Empty
import os
import psutil
import shutil
import threading
import uuid
import dask
from tornado import gen
from tornado.ioloop import IOLoop, TimeoutError
from tornado.lo... |
dispatcher.py | #!/usr/bin/env python
#
# Copyright 2007 Google 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 o... |
FransLinkfinder.py | #
# BurpLinkFinder - Find links within JS files.
#
# Copyright (c) 2019 Frans Hendrik Botes
# Credit to https://github.com/GerbenJavado/LinkFinder for the idea and regex
#
from burp import IBurpExtender, IScannerCheck, IScanIssue, ITab
from java.io import PrintWriter
from java.net import URL
from java.util import Ar... |
modbus.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Modbus TestKit: Implementation of Modbus protocol in python
(C)2009 - Luc Jean - luc.jean@gmail.com
(C)2009 - Apidev - http://www.apidev.fr
This is distributed under GNU LGPL license, see license.txt
History:
2010/01/08 - RD: Update master.execute(..) to calcul... |
test_containers.py | """toil_container containers tests."""
from multiprocessing import Process
from os.path import join
import getpass
import os
import docker
import pytest
from toil_container import __version__
from toil_container import exceptions
from toil_container.containers import _TMP_PREFIX
from toil_container.containers import... |
scheduler.py | import datetime
import schedule
import time
import threading
class Interval:
daily = "daily"
workdays = "workdays"
weekday = "weekday"
@staticmethod
def list():
return ["daily", "workdays", "weekday"]
class Day:
Sunday = "Sunday"
Monday = "Monday"
Tuesday = "Tuesday"
Wedne... |
test_jacobi.py | import pickle
try:
import unittest2 as unittest
except ImportError:
import unittest
import os
import sys
import signal
import pytest
import threading
import platform
import hypothesis.strategies as st
from hypothesis import given, assume, settings, example
from .ellipticcurve import CurveFp, PointJacobi, INF... |
session_test.py | """Tests for tensorflow.python.client.session.Session."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import threading
import time
import tensorflow.python.platform
import numpy as np
import six
from six.moves import xrange # pylint: disable=redefined... |
sniffer.py | #!/usr/bin/env python3
#
# Copyright (c) 2016-2017, The OpenThread 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/LIC... |
locking.py | import random
import time
from threading import Thread, Lock as ThreadingLock
from traceback import format_exc
import pytest
from ..helpers import daemonize
from ..platform import get_process_id, process_alive
from ..locking import TimeoutTimer, ExclusiveLock, Lock, LockRoster, \
ADD, REMOVE, SH... |
VulnerableWebServer.py | import socket, threading, sys
class WebServer:
def __init__(self):
self.logo()
self.valid = False
try:
self.ip = sys.argv[1]
self.port = int(sys.argv[2])
try:
self.externalip = sys.argv[3]
except:
self... |
high_level.py | """
High level abstraction interfaces to DFFML. These are probably going to be used
in a lot of quick and dirty python files.
"""
import asyncio
import pathlib
from typing import Optional, Tuple, List, Union, Dict, Any, AsyncIterator
from .record import Record
from .df.types import DataFlow, Input
from .df.memory impo... |
build_image_data.py | #!/usr/bin/python
# Copyright 2016 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 a... |
DataCollector.py | import numpy as np
import yfinance as yf
import matplotlib.pyplot as plt
import datetime
from datetime import datetime
import pandas as pd
import multiprocessing
import matplotlib.lines
tickers0 = ["DDD","MMM","WBAI","WUBA","EGHT","AHC","AOS","ATEN","AIR","AAN","ABB","ABT","ABBV","ANF","AGD","AWP","ACP","JEQ"... |
test_opencypher_status_with_iam.py | """
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
"""
import threading
import logging
import time
import pytest
import requests
from botocore.session import get_session
from test.integration.DataDrivenOpenCypherTest import DataDrivenOpenCypherTest
logger = lo... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.