source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
passport.py | # -*- coding: utf-8 -*-
"""
passport.py
~~~~~~~~~~~
Passport: A country-lvel router geolocation system
This module implements the execution of main geolcation system (with website) of the Passport System.
:author: Muzammil Abdul Rehman
:credits: [Muzammil Abdul Rehman, Dave Choffnes, Sharon G... |
test_master_slave_connection.py | # Copyright 2009-2012 10gen, 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,... |
weston.py | #
# SPDX-License-Identifier: MIT
#
from oeqa.runtime.case import OERuntimeTestCase
from oeqa.core.decorator.depends import OETestDepends
from oeqa.core.decorator.data import skipIfNotFeature
from oeqa.runtime.decorator.package import OEHasPackage
import threading
import time
class WestonTest(OERuntimeTestCase):
w... |
datasource.py | __author__ = 'beepi'
from queryable import *
import requests
import time
from datetime import datetime
from math import ceil
from Queue import Queue, Empty
from threading import Thread
class PrivateVTQueryable(Queryable):
_alias = "vtpriv"
_name = 'VirusTotal - Private API'
def get_hash_info(self, q, re... |
goc_to_image.py | #!/usr/bin/env python2
import argparse
import csv
from pprint import pprint
import os
import struct
import sys
import time
import threading
import queue
import numpy as np
import pygame
import pygame.fastevent
from pygame.locals import *
import m3_common
from m3_logging import get_logger
logger = get_logger(__name... |
outfeed_example.py | from threading import Thread
from tensorflow.python import ipu
import tensorflow as tf
NUM_ITERATIONS = 100
#
# Configure the IPU system
#
cfg = ipu.config.IPUConfig()
cfg.auto_select_ipus = 1
cfg.configure_ipu_system()
#
# The input data and labels
#
def create_dataset():
mnist = tf.keras.datasets.mnist
(x_t... |
ArduinoLogger.py | """
____ ____ ____ _ ____ ____ __ __
| _ \ _ _ | _ \ / ___| | | ___ __ _ / ___|/ ___|\ \ / /
| |_) || | | || | | |\___ \ | | / _ \ / _` | _____ \___ \\___ \ \ \ / /
| __/ | |_| || |_| | ___) || || (_) || (_| | |_____| ___) |___) | \ V /
|_| \_... |
ns3.py | """
From https://github.com/piotrjurkiewicz/mininet.git
Credit: Piotr Jurkiewicz
"""
"""
NS-3 integration for Mininet.
Mininet Mininet
node 1 node 2
+---------+ +---------+
| name ... |
conftest.py | import socket
from threading import Thread
from typing import Tuple
import pytest
from google.protobuf.message import Message
from singa import tensor
from src.client.app import Client
from src.proto import interface_pb2
from src.proto.utils import serialize_tensor
from src.server.app import Server
@pytest.fixture(... |
Video_age.py | import cv2
import threading
import numpy as np
class VideoLoader(object):
""" Generator of face images in the video
Invoke an additional thread to load the video frames in the file and generate the cropped faces of the same size
Attributes
----------
path : Path
Path to the video file
... |
run.py | #!/usr/local/bin/python3
#
## bootstrap to serve local files and run the api server
#
import http.server, socketserver, threading
# TODO: this flask app is pointing to test, once API server is completed, change this line:
from api import api as apiServer
API_PORT = 8002
HTTP_PORT = 8001
def run():
try:
... |
start.py | #!/usr/bin/python3
import os
import glob
import shutil
import multiprocessing
import logging as log
import sys
from podop import run_server
from pwd import getpwnam
from socrate import system, conf
log.basicConfig(stream=sys.stderr, level=os.environ.get("LOG_LEVEL", "WARNING"))
def start_podop():
os.setuid(getp... |
mp_process01.py | ## how to affect the results when start() and join() in different location.
from multiprocessing import Process
import os
# child process
def run_proc(name):
print('Run child process %s (%s)...' % (name, os.getpid()))
if __name__=='__main__':
print('Parent process %s.' % os.getpid())
p = Process(target=r... |
data.py | from __future__ import print_function
import threading
import time
from phi.physics.field.staggered_grid import StaggeredGrid
from .stream import DerivedStream
class Interleave(DerivedStream):
def __init__(self, fields):
DerivedStream.__init__(self, fields)
self.field_count = len(fields)
... |
proxy_creation_test.py | import queue
from abc import ABC, abstractmethod
from threading import Thread
from time import sleep
from typing import Any, Dict, List, Tuple, cast
from unittest import TestCase
from puma.attribute import ProcessAction, ThreadAction, manually_managed
from puma.attribute.mixin import ScopedAttributesCompatibilityMixin... |
tests.py | from oj.server import judge, main
import threading
import time
import subprocess
import unittest
import xmlrpc.client
PORT = 8000
class ProductTestCase(unittest.TestCase):
def test_CE(self):
self.assertEqual(judge('', [], 0), 'CE')
def test_AC(self):
self.assertEqual(judge('#include <cstdi... |
ppo_continuous_multiprocess.py | '''
Multi-processing for PPO continuous version 1
'''
import math
import random
import gym
import numpy as np
import torch
torch.multiprocessing.set_start_method('forkserver', force=True) # critical for make multiprocessing work
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F
from ... |
autoreload.py | """
auto reload的设计思路,主进程和子进程,主进程一直监控子进程,子进程退出后,主进程启动一个新的子进程
"""
import functools
import itertools
import logging
import os
import signal
import subprocess
import sys
import threading
import time
import traceback
import weakref
from collections import defaultdict
from pathlib import Path
from types import ModuleType
fr... |
server.py | import errno
import http.server
import os
import socket
from socketserver import ThreadingMixIn
import ssl
import sys
import threading
import time
import traceback
import uuid
from collections import OrderedDict
from queue import Empty, Queue
from h2.config import H2Configuration
from h2.connection import H2Connection... |
ucfounderbrute.py | #coding:utf-8
import requests
import sys
from threading import Thread
from Queue import Queue
NUM=5
dicpath='top5000.txt'
apptype='DISCUZX'
appname='Discuz!'
appurl='localhost'
ucclientrelease='20110501'
ucapi='http://target/uc_server' # no '/' in the end!!
def testucserver():
try:
r=requests.get(ucapi+'/in... |
app.py | import io
import os
import time
import json
import pickle
from uuid import uuid4
from threading import Thread
from flask import Flask, jsonify, request, send_file
from classification import ClassificationInputModel, do_autoclassification, NotSupportedMetricException
app = Flask(__name__)
error_logs_path = 'error_logs... |
invoke_run.py | # coding: utf-8
#########################################################################
# 网站: <a href="http://www.crazyit.org">疯狂Java联盟</a> #
# author yeeku.H.lee kongyeeku@163.com #
# #
# version 1.0 ... |
test_utils.py | import unittest
import json
import timeit
import sys
import datetime
import re
import threading
import uuid
from bugsnag.utils import (SanitizingJSONEncoder, FilterDict,
is_json_content_type, parse_content_type,
ThreadContextVar)
class TestUtils(unittest.TestCase... |
test.py | #imports
import arcade
import random
import math
import os
import timeit
import threading
import time
from tkinter import *
from tkinter.ttk import *
import tkinter as tk
# Set up the constants
SCREEN_WIDTH = 800
SCREEN_HEIGHT = 600
SCREEN_GAME_Height = 300
SCREEN_GAME_Width = 400
SCREEN_TITLE = "CS 230 Final Proje... |
storage.py | #
# Copyright (c) 2019-2021, ETH Zurich. All rights reserved.
#
# Please, refer to the LICENSE file in the root directory.
# SPDX-License-Identifier: BSD-3-Clause
#
from flask import Flask, request, jsonify, g
import json, tempfile, os
import urllib
import datetime
import async_task
import threading
# logging handl... |
buildtools.py | ####################################################################################################
##
## Project: Embedded Learning Library (ELL)
## File: buildtools.py
## Authors: Chris Lovett, Kern Handa
##
## Requires: Python 3.x
##
########################################################################... |
ibalgo.py | from ibapi.client import EClient
from ibapi.wrapper import EWrapper
from ibapi.contract import Contract
import threading
import time
class IBapi(EWrapper, EClient):
def __init__(self):
EClient.__init__(self, self)
def tickPrice(self, reqId, tickType, price, attrib):
#if tickType == 2 and reqId == 1:
print('T... |
payload.py | # -*- coding: utf-8 -*-
"""
peregrine.resources.submission.util
----------------------------------
Provides utility functions for the submission resource.
"""
from collections import Counter
import json
import os
import simplejson
import flask
from flask import current_app as capp
from flask import request
from func... |
rabbit.py | """
Classes for working with RabbitMQ message queues. Support for three types of
queues is provided.
1. ``MessageQueue`` -- a message queue for implementing the producer/consumer
pattern.
#. ``Broadcaster`` -- used to send messages to all registered listeners.
#. ``MessageBus`` -- used to send messages to a specific l... |
plugin.py | #!/usr/bin/env/python
# -*- coding: utf-8 -*-
###
# Copyright (c) 2016, Nicolas Coevoet
# 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 abov... |
__init__.py | import json
import multiprocessing
import os
import requests
from requests_oauthlib import OAuth1
from time import sleep
import tweepy
def get_users_single(x,auth,output_folder):
while(True):
url=f"https://api.twitter.com/1.1/users/lookup.json?user_id={','.join([str(i) for i in x])}"
if(type... |
CasesGenerator.py | import os
import sys
import time
import yaml
import random
import signal
import argparse
import itertools
import subprocess
import numpy as np
import cv2
import scipy.io as sio
from multiprocessing import Queue, Pool, Lock, Manager, Process
from os.path import dirname, realpath, pardir
os.system("taskset -p -c 0 %d" ... |
main_thread.py | import threading
import time
def myChildThread():
print('Child Thread Starting')
time.sleep(5)
print('Current Thread ------')
print(threading.current_thread())
print('---------------------')
print('Main Thread ---------')
print(threading.main_thread())
print('---------------------')
... |
task_launcher.py | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from mephisto.data_model.assignment import (
Assignment,
InitializationData,
AssignmentState,
)
from mephis... |
tests.py | import unittest
import time
import urllib.request
from multiprocessing import Process
from x100http import X100HTTP, X100Response
import requests
class UploadHandler:
def upload_start(self, req):
self.content = "start"
def upload_process(self, key, line):
self.content += line.decode()
d... |
pigweed_rpc_transport.py | # Copyright 2021 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, ... |
stim_server_client.py | # Author: Mainak Jas <mainak@neuro.hut.fi>
# License: BSD (3-clause)
import queue
import time
import socket
import socketserver
import threading
import numpy as np
from ..utils import logger, verbose
class _ThreadedTCPServer(socketserver.ThreadingMixIn, socketserver.TCPServer):
"""Create a threaded TCP server.... |
cavstool_server.py | #!/usr/bin/env python3
# Copyright(c) 2022 Intel Corporation. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
import os
import sys
import struct
import logging
import asyncio
import time
import subprocess
import ctypes
import mmap
import argparse
import socketserver
import threading
import netifaces
# Globa... |
test_basic.py | # -*- coding: utf-8 -*-
#-----------------------------------------------------------------------------
# Copyright (c) 2005-2022, PyInstaller Development Team.
#
# Distributed under the terms of the GNU General Public License (version 2
# or later) with exception for distributing the bootloader.
#
# The full license is... |
pilot.py | """
To install X-Box gamepad software on Ubuntu 14.04:
sudo apt-get install dkms
sudo git clone https://github.com/paroj/xpad.git /usr/src/xpad-0.4
sudo dkms install -m xpad -v 0.4
sudo modprobe xpad (might need to turn off "secure boot" in BIOS)
reboot computer and then plug in an Xbox 360/One game... |
main.py | import curses
from curses import wrapper
import sys
from timeit import default_timer
import multiprocessing
from trie import main as trie
import fuzzy
from LRUcache import LRUCache
"""
NOTE: All coordinates are in the format (y, x) because that's how curses works)
"""
manager = multiprocessing.Manager()
mutex = manag... |
test_pdb.py | # A test suite for pdb; not very comprehensive at the moment.
import doctest
import os
import pdb
import sys
import types
import codecs
import unittest
import subprocess
import textwrap
import linecache
from contextlib import ExitStack
from io import StringIO
from test.support import os_helper
# This little helper cl... |
mlaunch.py | #!/usr/bin/env python
import Queue
import argparse
import subprocess
import threading
import os, time, sys, re
import socket
import json
import re
import warnings
import psutil
import signal
from collections import defaultdict
from mtools.util import OrderedDict
from operator import itemgetter, eq
from mtools.util.... |
safe_t.py | from binascii import hexlify, unhexlify
import traceback
import sys
from electrum_mona.util import bfh, bh2u, versiontuple, UserCancelled, UserFacingException
from electrum_mona.bitcoin import TYPE_ADDRESS, TYPE_SCRIPT
from electrum_mona.bip32 import BIP32Node
from electrum_mona import constants
from electrum_mona.i18... |
test_cassandra.py | # (C) Datadog, Inc. 2010-2016
# All rights reserved
# Licensed under Simplified BSD License (see LICENSE)
# stdlib
import threading
import time
from types import ListType
import unittest
import os
import mock
# 3p
from nose.plugins.attrib import attr
# project
from aggregator import MetricsAggregator
import logging... |
api.py | import datetime
import multiprocessing
import os
from typing import Dict, Mapping
from dateutil.parser import parse as parse_datestr
from flask import Blueprint, abort, g, jsonify, make_response, request
from google.auth import jwt
from trailblazer.server.ext import store
blueprint = Blueprint("api", __name__, url_p... |
Server.py | ### BAAMSAT CAMERA PAYLOAD SERVER ###
import socket
import logging
import queue
import csv
import threading
import os
from datetime import datetime
from time import sleep
from multiprocessing import Process
from gpiozero import CPUTemperature
from temperature_Sensor import Temperature_Sensor
from mosfet import Mosfet... |
imackager.py | #!/usr/bin/env python3
import subprocess
from xml.dom import minidom
from xml.dom.minidom import Node
import os
import shutil
import xml.etree.ElementTree as ET
import urllib.request
from flask import Flask, request, jsonify, send_from_directory
from urllib.parse import urlparse
import urllib.parse
import os.path
impo... |
streampie.py | import sys
import zlib
import dill
import redis
import random
import inspect
import threading
import traceback
import itertools
import collections
import multiprocessing
try:
# Python2
import Queue as queue
ifilter = itertools.ifilter
imap = itertools.imap
except:
# Python3
import queue
# In pyt... |
test_rtrl_base_env.py | # Copyright (c) 2018, The SenseAct Authors.
# 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.
import copy
import numpy as np
import unittest
import time
import psutil
from multiprocessing import Process, Value, Arr... |
email.py | from threading import Thread
from flask import render_template
from flask_mail import Message
from app import app, mail
def send_async_email(app, msg):
with app.app_context():
mail.send(msg)
def send_email(subject, sender, recipients, text_body, html_body):
msg = Message(subject, sender=sender, recipi... |
insert_rating.py | import time
import pymysql
import mysql.connector
import multiprocessing
from pymysql.cursors import DictCursor
from multiprocessing import Process, Pool
db1 = pymysql.connect("localhost", "root", "", "miraihyoka")
db2 = pymysql.connect("localhost", "root", "", "miraihyoka")
cursor_b = db1.cursor(DictCursor)
cursor_... |
utils.py | # coding=utf-8
# Copyright 2019 The SEED 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 agre... |
test_events.py | """Tests for events.py."""
import collections.abc
import concurrent.futures
import functools
import io
import os
import platform
import re
import signal
import socket
try:
import ssl
except ImportError:
ssl = None
import subprocess
import sys
import threading
import time
import errno
import unittest
from unitt... |
target_bigquery.py | #!/usr/bin/env python3
import argparse
import io
import sys
import json
import logging
import collections
import threading
import http.client
import urllib
import pkg_resources
from jsonschema import validate
import singer
from oauth2client import tools
from tempfile import TemporaryFile
from google.cloud import bi... |
app.py | import os, sys
from soundspider import SoundSpider
from time import sleep
import threading
import tkinter as tk
the_menu = False
class Application(tk.Frame):
def __init__(self, master=None):
super().__init__(master)
self.master = master
self.pack()
self.create_widgets()
def destroy(self):
try:
downl... |
environment.py | import glob
import logging
import os
import shutil
import tarfile
import traceback
from datetime import datetime, timedelta
from pathlib import Path
from threading import Thread
from typing import Dict, List, Optional
import requests
import yaml
from bauh.api.abstract.download import FileDownloader
from bauh.api.abst... |
cluster.py | # Future
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from time import sleep
# external
import arrow
import ast
# Standard
import importlib
import signal
import socket
import traceback
# Django
from django import d... |
saga2owl.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# author: houzhiwei
# time: 2019/1/3 16:04
from owlready2 import *
import json
import re
from JSON2OWL.OwlConvert.OwlUtils import OWLUtils
from JSON2OWL.OwlConvert.Preprocessor import Preprocessor
from rdflib import BNode, RDF, Graph, URIRef, Namespace, Literal
from rdflib... |
speed-camera.py | #! /usr/bin/env python
from smartcameras.speedcamera import SpeedCamera
import threading
def main():
print("########################################")
print ""
print("You have ordered a new speed camera!")
print("We need some details before activating it:")
print ""
print("###################... |
miniterm.py | #!/usr/bin/env python
#
# Very simple serial terminal
#
# This file is part of pySerial. https://github.com/pyserial/pyserial
# (C)2002-2015 Chris Liechti <cliechti@gmx.net>
#
# SPDX-License-Identifier: BSD-3-Clause
import codecs
import os
import sys
import threading
import struct
import time
import fnmatch
import ... |
TK_NetworkScanning.py | import datetime
import re
import subprocess
import threading
from tkinter import Listbox, Menu, StringVar, Tk, messagebox, ttk
from tkinter.filedialog import askopenfilename, asksaveasfilename
import xlwt
from PIL import Image, ImageTk
TITLE_FONT = ("Helvetica", 16, "bold")
FALSE = False
function = 'function'
# imag... |
pages.py | import threading
import tkinter as tk
from tkinter import *
from tkinter import ttk
import ipaddress
import automation.automation_core
class StartPage(tk.Frame):
"""
The application starts by asking you to provide your api key, checks it and set it to the AutomationCore Application
variable, and then r... |
app.py | #!/usr/bin/env python3
import json
import os
import pickle
import sys
import re
import uuid
from psutil import Process as ProcessManager
from psutil import NoSuchProcess
from flask import Flask, make_response, Response, jsonify, request, send_file, send_from_directory
from data_access.Dataset import GeneyDataset
from ... |
sensor_receiver_ros.py | import sys
import argparse
import socket
import struct
from collections import namedtuple
import cv2
import numpy as np
import multiprocessing
# Each port corresponds to a single stream type
STREAM_PORTS = {
"color": 10080,
"depth": 10081
}
SENSOR_STREAM_HEADER_FORMAT = "@qIIIIffffffffffffffffffff"
SENSOR_FRA... |
helper.py | """A library of helper functions for the Cheroot test suite."""
from __future__ import absolute_import, division, print_function
__metaclass__ = type
import datetime
import logging
import os
import sys
import time
import threading
import types
from six.moves import http_client
import six
import cheroot.server
impo... |
tf_unittest_runner.py | # ==============================================================================
# Copyright (C) 2021 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
# ==============================================================================
import unittest
import sys
import argparse
import os
import re
import fnmatch
im... |
utility.py | import os
import math
import time
import datetime
from multiprocessing import Process
from multiprocessing import Queue
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import numpy as np
import imageio
import torch
import torch.optim as optim
import torch.optim.lr_scheduler as lrs
class time... |
irc.py | # coding=utf-8
"""
irc.py - A Utility IRC Bot
Copyright 2008, Sean B. Palmer, inamidst.com
Copyright 2012, Edward Powell, http://embolalia.net
Copyright © 2012, Elad Alfassa <elad@fedoraproject.org>
Licensed under the Eiffel Forum License 2.
Sopel: http://sopel.chat/
When working on core IRC protocol related feature... |
client communicator.py | import socket,time
from threading import Thread
from socket import *
servers=[]
clients=[]
s=socket(AF_INET,SOCK_STREAM)
host="0.0.0.0"
port=10000
s.bind((host,port))
s2=socket(AF_INET,SOCK_STREAM)
address=socket.gethostbyname(socket.getfqdn())
s2.connect((address,10500))
def main_send(msg):
s2.send(bytes(str(msg),'... |
AWSBucketDump.py | #!/usr/bin/env python
# AWSBucketDump is a tool to quickly enumerate AWS S3 buckets to look for loot.
# It's similar to a subdomain bruteforcer but is made specifically to S3
# buckets and also has some extra features that allow you to grep for
# delicous files as well as download interesting files if you're not
# afr... |
music_gen_gui.py | #!/usr/bin/env python
import pygame
from music_generation import *
from sound_generation import *
from constants import *
from helpers import *
import math
import random as rd
import time
import threading
import sys
import random
class MusGUI(object):
def __init__(self):
pygame.mixer.pre_init(44100, 16... |
feature_shutdown.py | #!/usr/bin/env python3
# Copyright (c) 2018 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 lksd shutdown."""
from test_framework.test_framework import BitcoinTestFramework
from test_framework.u... |
test_session.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 1999-2020 Alibaba Group Holding 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-... |
secondcam.py | import tkinter as tk
from tkinter import *
import socket
import threading
from vidstream import *
black = '#000000'
white = '#ffffff'
color = '#EFFBB1'
color1 = '#CBF0AA'
color2 = '#F0A9C0'
color3 = '#CD93CF'
color4 = '#D6F72D'
local_ip = socket.gethostbyname(socket.gethostname())
print(local_ip)
server = Streamin... |
test_client.py | import unittest
from antchain_alipay_util.client import Client
from Tea.exceptions import TeaException
import threading
from http.server import HTTPServer, BaseHTTPRequestHandler
class Request(BaseHTTPRequestHandler):
def do_PUT(self):
body = self.rfile.read(int(self.headers['content-length']))... |
keep_alive.py | from flask import Flask
from threading import Thread
app = Flask('')
@app.route('/')
def main():
return '<meta http-equiv="refresh" content="0; URL=https://darkshadoow159258.github.io"/>'
def run():
app.run(host="0.0.0.0", port=8080)
def keep_alive():
server = Thread(target=run)
server.start()
|
sniffer.py | # -*- coding: UTF-8 -*-
#/**
# * Software name: CC2531
# * Version: 0.1.0
# * Library to drive TI CC2531 802.15.4 dongle to monitor channels
# * Copyright (C) 2013 Benoit Michau, ANSSI.
# *
# * This program is free software; you can redistribute it and/or modify
# * it under the terms of the CeCILL-B license as publish... |
conftest.py | import logging
import os
import random
import time
import tempfile
import threading
from concurrent.futures.thread import ThreadPoolExecutor
from datetime import datetime
from math import floor
from shutil import copyfile
from functools import partial
from botocore.exceptions import ClientError
import pytest
from coll... |
writer.py | import os
import time
from threading import Thread
from queue import Queue
import cv2
import numpy as np
import torch
import torch.multiprocessing as mp
from alphapose.utils.transforms import get_func_heatmap_to_coord
from alphapose.utils.pPose_nms import pose_nms, write_json
DEFAULT_VIDEO_SAVE_OPT = {
'savepath... |
multi.py | from multiprocessing import Process
from functools import partial
def singleCount(cnt, name):
for i in range(100000000):
cnt += 1
if i % 2500000 == 0:
print name, ':', i
cnt = 0
name = ['hyunho1', 'hyunho2']
p1 = Process(target=singleCount, args=(cnt, name[0]))
p2 = Process(target=singleCount, args=(cnt, na... |
core.py | # -*- coding: utf-8 -*-
#
# 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
#... |
outputgrabber.py | import os
import sys
import threading
import time
# Credits to craymichael
# https://stackoverflow.com/questions/24277488/in-python-how-to-capture-the-stdout-from-a-c-shared-library-to-a-variable # noqa
class OutputGrabber(object):
"""
Class used to grab standard output or another stream.
"""
escape_... |
display_ili9341.py | #!/usr/bin/env python3
'''
*****************************************
PiFire Display Interface Library
*****************************************
Description:
This library supports using
the ILI9341 display with 240Hx320W resolution.
This module utilizes Luma.LCD to interface
this display.
******************... |
bot.py | # Copyright (c) 2013 Alan McIntyre
import datetime
import threading
import time
import traceback
import btceapi
from btceapi.common import validatePair
from trader import TraderBase
def _runBot(bot):
while bot.running:
loop_start = time.time()
# Collect the set of pairs for which we sho... |
victim.py | import argparse
import sys
import socket
import random
import time
import struct
import threading
from scapy.all import *
#from scapy.all import sniff, sendp, send, get_if_list, get_if_hwaddr
#from scapy.all import Packet, IPOption
#from scapy.all import Ether, IP, UDP, TCP, DNS
#from scapy.all import rdpcap
def get... |
eventsub.py | # Copyright (c) 2021. Lena "Teekeks" During <info@teawork.de>
"""
Full Implementation of the Twitch EventSub
------------------------------------------
The EventSub client runs in its own thread, calling the given callback function whenever an event happens.
Look at the `Twitch EventSub reference <https://dev.twitch... |
app.py | # Tray
from pystray import MenuItem as item
import pystray
# Dialog box
from tkinter import Tk, Label, Button, Entry
import pyqrcode
from PIL import ImageTk, Image
from os import path, kill
from pynput import keyboard
from multiprocessing import Process
# Set default paths for images
basepath = path.dirname(__file__... |
_test_multiprocessing.py | #
# Unit tests for the multiprocessing package
#
import unittest
import queue as pyqueue
import contextlib
import time
import io
import itertools
import sys
import os
import gc
import errno
import signal
import array
import socket
import random
import logging
import struct
import operator
import weakref
import test.su... |
__init__.py | #!/usr/bin/python3 -OO
# Copyright 2007-2019 The SABnzbd-Team <team@sabnzbd.org>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any late... |
server_ingester_test.py | # Copyright 2020 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... |
ch10_listing_source.py | # coding: utf-8
import binascii
from collections import defaultdict
from datetime import date
from decimal import Decimal
import functools
import json
from Queue import Empty, Queue
import threading
import time
import unittest
import uuid
import redis
CONFIGS = {}
CHECKED = {}
def get_config(conn, type, component, ... |
connection.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
MIT License
Copyright (c) 2017 Maxim Krivich
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 t... |
Binance_Detect_Moonings.py | """
Disclaimer
All investment strategies and investments involve risk of loss.
Nothing contained in this program, scripts, code or repositoy should be
construed as investment advice.Any reference to an investment's past or
potential performance is not, and should not be construed as, a recommendation
or as a guarantee... |
mergy.py | #!/usr/bin/env python3
# Author: Emmanuel Odeke <odeke@ualberta.ca>
# Copy content from src to destination only if it doesn't
# exist in the destination
import os
import sys
import json
import shutil
import hashlib
from threading import Thread
isDir = lambda p: p and os.path.isdir(p)
isPath = lambda p: p and os.path... |
pitmTemperature.py | #!/usr/bin/python
# piTempTemperature Temperature
import os
import hashlib
import struct
import socket
import syslog
import json
import sys
import threading
import time
import re
from pitmCfg import pitmCfg
class pitmTemperature:
def __init__(self):
self.logging = 2 # 1 = syslog, 2 = stderr
sel... |
test_bandwidth.py | from athena import ndarray, optimizer
from athena import gpu_ops as ad
import time, os, sys
import yaml
import multiprocessing
import argparse
import signal
import numpy as np
import ctypes
from tqdm import tqdm
from concurrent.futures import ThreadPoolExecutor
import threading
def pointer(arr):
assert(arr.data.... |
statreload.py | import multiprocessing
import os
import signal
import time
from pathlib import Path
HANDLED_SIGNALS = (
signal.SIGINT, # Unix signal 2. Sent by Ctrl+C.
signal.SIGTERM, # Unix signal 15. Sent by `kill <pid>`.
)
class StatReload:
def __init__(self, config):
self.config = config
self.shoul... |
bpr.py | from pysmore.libs import graph, optimizer, embedding, util
import multiprocessing as mp
### global variables ###
globalVariables = {
'graph': None,
'optimizer': optimizer.get_margin_bpr_loss,
'updater': embedding.update_l2_embedding,
'progress': util.print_progress,
'l2_reg': ... |
manage_mysql_script.py | import os
import threading
class Manage_Mysql:
def get_path(self):
lines = [line.rstrip('\n') for line in open('data/mysql_path.txt')]
return lines[0]
def start_mysql(self):
path = self.get_path();
print(path + 'mysqld')
os.system(path + 'mysqld')
def start(self):
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.