source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
websocket.py | from __future__ import (absolute_import, division,
print_function, unicode_literals)
from gdax_websocket import constants
from gdax_websocket.auth.APIKeyAuth import generate_nonce, generate_signature
from gdax_websocket.settings import settings
from builtins import *
from pyee import EventEmitte... |
proc_wav_pqmf.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2021 Patrick Lumban Tobing (Nagoya University)
# Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
from __future__ import division
from __future__ import print_function
import argparse
from distutils.util import strtobool
import multiprocessing as mp
... |
sql_workflow.py | # -*- coding: UTF-8 -*-
import datetime
import logging
import re
import traceback
from threading import Thread
import simplejson as json
from django.contrib.auth.decorators import permission_required
from django.core.exceptions import PermissionDenied
from django.db import transaction, connection
from django.db.models... |
vanilla_ppo.py | # -*- coding: utf-8 -*-
import os
import numpy as np
import logging
import pickle
import torch
import torch.nn as nn
from torch import optim
from torch import multiprocessing as mp
from rlmodule import MultiDiscretePolicy, Value, Memory, UserAction2, VanillaTransition
# from estimator import RewardEstimator
from uti... |
ssh.py | import util
import os
import socket
import paramiko
from threading import Thread
from service import Service
from time import sleep
from stubssh import SSHStub, SSHHandler
from zoption import Zoption
class ssh(Service):
def __init__(self):
super(ssh, self).__init__('SSH Server')
self.config['port'... |
utils.py | from .repo import ProcessError
from threading import Thread
# Use the system PRNG if possible
import hashlib, random, time
try:
r = random.SystemRandom()
r.getstate()
random = r
using_sysrandom = True
except NotImplementedError:
using_sysrandom = False
def get_random_string(length=12, allowed_chars... |
test_concurrent_futures.py | from __future__ import print_function
import test.test_support as test_support
# Skip tests if _multiprocessing wasn't built.
test_support.import_module('_multiprocessing')
# Skip tests if sem_open implementation is broken.
test_support.import_module('multiprocessing.synchronize')
multiprocessing = test_support.import... |
setup_actions.py | '''
@author: Frank
'''
import os.path
import zstacklib.utils.xmlobject as xmlobject
import zstacklib.utils.linux as linux
import zstacklib.utils.shell as shell
import zstacklib.utils.log as log
import zstacklib.utils.lock as lock
import zstacklib.utils.ssh as ssh
import zstacklib.utils.http as http
import ... |
pwork.py | from multiprocessing import Process, Queue
import time
try:
from Queue import Empty
except ImportError:
from queue import Empty
import logging
import six
class Stop(object):
pass
STOP = Stop()
class Worker(Process):
def __init__(self, callback, taskq, resultq, ignore_exceptions, *args, **kwargs):
... |
s3.py | """
Object Store plugin for the Amazon Simple Storage Service (S3)
"""
import logging
import multiprocessing
import os
import shutil
import subprocess
import threading
import time
from datetime import datetime
from galaxy.exceptions import ObjectInvalid, ObjectNotFound
from galaxy.util import (
directory_hash_id... |
xidpy_test.py | import unittest
from xidpy import Xid
TestXids = [
# taken from https://github.com/rs/xid/blob/master/id_test.go
{
'xid': Xid([0x4d, 0x88, 0xe1, 0x5b, 0x60, 0xf4, 0x86, 0xe4, 0x28, 0x41, 0x2d, 0xc9]),
'ts': 1300816219,
'machine': ''.join(map(chr, [0x60, 0xf4, 0x86])),
'pid': 0x... |
main.py | # Copyright 2020 Google Research. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... |
TPUCameraManager.py | from . import gstreamer
import threading
import enum
import numpy as np
# gst-launch-1.0 v4l2src device="/dev/video0" ! video/x-raw,width=640,height=480,framerate=30/1 ! videoconvert ! video/x-raw,format=I420 ! autovideosink
class CameraManager:
def __init__(self):
self.camClasses = []
def newCam(s... |
lisp.py | # -----------------------------------------------------------------------------
#
# Copyright 2013-2019 lispers.net - Dino Farinacci <farinacci@gmail.com>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain... |
watcher.py | # ===============================================================================
# Copyright 2014 Jake Ross
#
# 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... |
labours.py | #!/usr/bin/env python3
import argparse
from datetime import datetime, timedelta
from importlib import import_module
import io
import json
import os
import re
import shutil
import sys
import tempfile
import threading
import time
import warnings
try:
from clint.textui import progress
except ImportError:
print("W... |
keepkey.py | from binascii import hexlify, unhexlify
import traceback
import sys
from electrum.util import bfh, bh2u, UserCancelled
from electrum.bitcoin import (b58_address_to_hash160, xpub_from_pubkey,
TYPE_ADDRESS, TYPE_SCRIPT,
is_segwit_address)
from electrum import c... |
shcommon.py | # -*- coding: utf-8 -*-
"""
The Control, Escape and Graphics are taken from pyte (https://github.com/selectel/pyte)
"""
import os
import sys
import platform
import functools
import threading
import ctypes
from itertools import chain
import six
IN_PYTHONISTA = sys.executable.find('Pythonista') >= 0
if IN_PYTHONISTA:... |
_exposition.py | # -*- coding: utf-8 -*-
# Copyright 2015-2019 Prometheus Python Client Developers
# Copyright 2019 Matrix.org Foundation C.I.C.
#
# 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://... |
net_video_stream.py | import socket
import numpy as np
from threading import Thread
import time as t
class NetVideoStream:
def __init__(self, server_ip, server_port, width, height, channel):
self.ip = server_ip
self.port = server_port
self.width = width
self.height = height
self.channel = channe... |
networking.py | """
Defines helper methods useful for setting up ports, launching servers, and handling `ngrok`
"""
import os
import socket
import threading
from flask import Flask, request, session, jsonify, abort, send_file, render_template, redirect
from flask_cachebuster import CacheBuster
from flask_login import LoginManager, lo... |
relay.py | # 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, software
# distributed under t... |
change_gif.py | # MIT License
# Copyright (c) 2014 Adafruit Industries
# Author: Tony DiCola
# Improved by the yongdol503
# 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 with... |
joy_multi_xbox360.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# ##
# @brief [py example simple] motion basic test for doosan robot
# @author Kab Kyoum Kim (kabkyoum.kim@doosan.com)
import rospy
import os
import threading, time
import sys
from sensor_msgs.msg import Joy
sys.dont_write_bytecode = True
sys.path.append( os.path.a... |
pyminer.py | #!/usr/bin/python
import time
import json
import pprint
import hashlib
import struct
import re
import base64
import httplib
import sys
from multiprocessing import Process
ERR_SLEEP = 15
MAX_NONCE = 1000000L
settings = {}
pp = pprint.PrettyPrinter(indent=4)
class BitcreditRPC:
OBJID = 1
def __init__(self, host, p... |
random_shuffle_queue_test.py | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
test_ssl.py | # Test the support for SSL and sockets
import sys
import unittest
from test import support
import socket
import select
import time
import datetime
import gc
import os
import errno
import pprint
import tempfile
import urllib.request
import traceback
import asyncore
import weakref
import platform
import functools
ssl =... |
instagram.py | # Date: 06/10/2017
# Distro: Kali linux
# Desc: Instagram Bruteforce
#
#
import os
import time
import urllib
import argparse
import threading
import subprocess
from platform import platform
from Core.tor import TorManager
from Core.Browser import Browser
class Instagram(TorManager,Browser):
def __init__(self,usernam... |
composer.py | #!/usr/bin/env python
"""
composer.py
--
Christopher Kuech
cjkuech@gmail.com
--
Requires:
Python 2.7, PyAudio
Instructions:
python composer.py [number-of-controllers]
"""
from array import array
from math import sin, pi
from pyaudio import PyAudio
import sys
from threading import Thread, Lock
import Tkinter... |
saph.py | import os
import sys
import threading
import socket
import time as t
import colorama
from colorama import init
from colorama import Fore
import datetime
from datetime import datetime
from queue import Queue
from optparse import OptionParser
import time,sys,socket,threading,logging,urllib.request,random
banne... |
find_s3_writable_buckets.py |
#!/usr/bin/env python3
from lib.constants import *
from lib.logger import *
from lib.traceback import *
from lib.progressbar import *
from lib.get_subpages import Page, get_subpages, get_source_code, get_domain
from module.test_upload import *
from module.find_s3_writable_buckets_constants import *
import datetime
imp... |
benchmark_djangocache.py | """Benchmark diskcache.DjangoCache
$ export PYTHONPATH=/Users/grantj/repos/python-diskcache
$ python tests/benchmark_djangocache.py > tests/timings_djangocache.txt
"""
import collections as co
import multiprocessing as mp
import os
import pickle
import random
import shutil
import time
from utils import display
PR... |
VulnerableScanningEngine.py | # Base Class For Vulnerable Scanning Engine
import threading
from tqdm import tqdm
from Configuration.Configuration import APP_CONFIGURATION
class ScanningThreadPool:
def __init__(self, maxsize):
self.maxsize = maxsize
self.thread_dict = {}
self.container = 0
def thread_function(self,... |
send_cmd.py | """
Manage communications between the PC and the device.
Requirements:
* pyserial
* continuous_threading
"""
import sys
import time
import serial
import functools
import contextlib
import continuous_threading
from pybk8500.parser import Parser
__all__ = ['CommunicationManager', 'send_msg', 'main']
def pop... |
common.py | """Test the helper method for writing tests."""
import asyncio
import os
import sys
from datetime import timedelta
from unittest.mock import patch, MagicMock
from io import StringIO
import logging
import threading
from contextlib import contextmanager
from aiohttp import web
from homeassistant import core as ha, load... |
get_user_info.py | import requests
import json
import urllib2
import urllib
import pandas as pd
from threading import Thread
if __name__ == '__main__':
with open('appcreds.txt', 'r') as credfile:
uid, secret = credfile.read().splitlines()
r = requests.post("https://api.intra.42.fr/oauth/token", data={'grant_type': 'client_credentia... |
subscribe2client.py | from __future__ import print_function
import sys, os, struct
from twisted.python import log
try: # version > 0.8.0
from autobahn.wamp1.protocol import WampClientProtocol
except:
from autobahn.wamp import WampClientProtocol
# For converting Unicode text
import collections
# For saving
import numpy as np
import ... |
spl.py | # coding=utf-8
# Licensed Materials - Property of IBM
# Copyright IBM Corp. 2015,2019
"""
SPL Python primitive operators.
********
Overview
********
SPL primitive operators that call a Python function or
class methods are created by decorators provided by this module.
The name of the function or callable class becom... |
oscproxy.py | import logging
import time
import threading
import os
from queue import Queue, Empty
import rtmidi
from rtmidi.midiconstants import CONTROL_CHANGE
import yaml
from bidict import bidict
from pythonosc import osc_server, udp_client
from pythonosc.dispatcher import Dispatcher
from pythonosc.osc_message_builder import O... |
server.py | import socket
import threading
HOST = "127.0.0.1"
PORT = 5052
ENCODING = "ascii"
clients = []
numbers = []
# This lock is used to access 'numbers' list.
numbers_lock = threading.Lock()
# This semaphore is used for clients. So after a client put one number in 'numbers', it waits until the other number is
# also adde... |
__init__.py | # YOLOv5 experiment logging utils
import warnings
from threading import Thread
import torch
from torch.utils.tensorboard import SummaryWriter
from yolov5_master.utils.general import colorstr, emojis
from yolov5_master.utils.loggers.wandb.wandb_utils import WandbLogger
from yolov5_master.utils.plots import plot_images... |
train_msu.py | #!/usr/bin/env python
# --------------------------------------------------------
# Faster R-CNN
# Copyright (c) 2015 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Written by Ross Girshick
# --------------------------------------------------------
"""Train a Faster R-CNN network using alternat... |
CAServer.py | """
Support mudule for EPICS Input/Output Controllers (IOCs)
Implements the server side of the Channel Access (CA) protocol, version 4.11.
Author: Friedrich Schotte
Date created: 2009-10-31
Date last modified: 2019-06-02
based on: 'Channel Access Protocol Specification', version 4.11
http://epics.cosylab.com/cosyjava... |
github-release.py | #!/usr/bin/env python3
import os
import sys
import threading
import traceback
import queue
from pathlib import Path
from datetime import datetime
import requests
import yaml
BASE_URL = os.getenv("UPSTREAM_URL", "https://api.github.com/repos/")
WORKING_DIR = os.getenv("TUNASYNC_WORKING_DIR")
WORKERS = int(os.getenv("... |
hibike_tester.py | """
Create a separate Hibike process, for testing.
"""
import threading
import time
import queue
from multiprocessing import Process, Pipe, Queue
from runtime import hibike_process
from runtime import hibike_message
class Hibike:
"""
Interface to a separate Hibike process.
"""
DEFAULT_DELAY = 100
... |
test_all.py | import pytest
import subprocess
import server
from random import SystemRandom
import string
from unittest import mock
from multiprocessing import Process
from time import sleep
from sparkbot import SparkBot, receiver
from sparkbot.exceptions import CommandSetupError
from wsgiref import simple_server
import requests
fro... |
executor-minimal.py | #!/usr/bin/env python2.7
from __future__ import print_function
import site
site.addsitedir('/usr/lib/python2.7/site-packages')
site.addsitedir('/usr/local/lib/python2.7/site-packages')
import sys
import time
from threading import Thread
from mesos.interface import Executor, mesos_pb2
from mesos.native import MesosEx... |
player.py | #!/usr/bin/env python2.7
"""Experimental MPEG-DASH player emulator."""
import os
import requests
import shutil
import signal
import threading
import time
import scootplayer.bandwidth as bandwidth
import scootplayer.queue as queue
import scootplayer.remote as remote
import scootplayer.reporter as reporter
import scoo... |
test_messaging.py | # Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See LICENSE in the project root
# for license information.
from __future__ import print_function, with_statement, absolute_import
import json
import io
import pytest
import random
import socket
import threading
import time
... |
manualSIGNING.py |
#=======================================================================
VERSION = 'Bitshares manualSIGNING 0.00000005'
#=======================================================================
# Authenticated BUY/SELL/CANCEL without Pybitshares(MIT) Architecture
' litepresence 2019 '
def WTFPL_v0_March_1765():
... |
test_models.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 (t... |
sshlogger.py | '''
Created on Sep 24, 2017
@author: arnon
'''
from acrilog import SSHLogger
import multiprocessing as mp
import logging
def log(logger_info):
logger1 = SSHLogger.get_logger(logger_info, name='example.e1')
logger2 = SSHLogger.get_logger(logger_info, name='example.e2')
logger2.info('How quickly daft jump... |
Logger.py | # -*- coding: utf-8 -*-
"""
Created on Mon Dec 26 15:56:10 2016
@author: Dell
"""
from time import ctime
import threading
def info(log:str,target='console'):
"""
log: text to record.
target: 'console' to print log on screen or file to write in.
"""
if target=='console':
thd=threading.Thre... |
func.py | # import threading as tr
# # from time import sleep, time
# import time
# def foo(num):
# print(tr.current_thread())
# sleep(2)
# print(num)
# start = time()
# print(tr.current_thread())
# thr1 = tr.Thread(target=foo, args=(1, ))
# thr2 = tr.Thread(target=foo, args=(2, ))
# thr1.start()
# thr2.start()
... |
test_smtplib.py | import asyncore
import base64
import email.mime.text
from email.message import EmailMessage
from email.base64mime import body_encode as encode_base64
import email.utils
import hmac
import socket
import smtpd
import smtplib
import io
import re
import sys
import time
import select
import errno
import textwrap
import uni... |
data.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2019 The Vitess 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
#
# ... |
agent.py | #!/usr/bin/python
# Copyright 2017 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 ... |
client.py | #!/bin/env python
# import proto_message as message
import socket
import os
import sys
import struct
import threading
import select
import time
import socks
# import time
import request_pb2
from config import client_address, \
client_id, \
RL, \
client_logger, \
config_general
# N, TOR_SOCKSPORT
kill... |
ela.py | #!/usr/bin/python
from __future__ import print_function
from PIL import Image, ImageChops, ImageEnhance
import sys, os
import threading
import argparse
parser = argparse.ArgumentParser(description="""
Performs Error Level Analysis over a directory of images
""")
parser.add_argument('--dir', dest='directory... |
hpc05_monitor.py | #!/usr/bin/env python
import asyncio
import operator
import os
import socket
from collections import defaultdict
from datetime import datetime
import psutil
MAX_USAGE = defaultdict(dict)
LATEST_DATA = {}
START_TIME = None
def get_usage():
"""return a dict of usage info for this process"""
from IPython im... |
server.py | from socket import socket
from threading import Thread
from zlib import compress
from mss import mss
WIDTH = int(1366 / 1)
HEIGHT = int(768 / 1)
def send_screenshot(conn):
with mss() as sct:
rect = {'top': 0, 'left': 0, 'width': WIDTH, 'height': HEIGHT}
while 'recording':
img = sct.... |
send_order_demo.py | from threading import Thread
from time import sleep
from ctpbee import CtpbeeApi, helper, CtpBee
from ctpbee.constant import ContractData, LogData, TickData, BarData, OrderType, Offset, OrderData, SharedData, \
TradeData, PositionData, Direction, AccountData
class Demo(CtpbeeApi):
contract_set = set(["rb1910... |
train_faster_rcnn_alt_opt.py | #!/usr/bin/env python
# --------------------------------------------------------
# Faster R-CNN
# Copyright (c) 2015 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Written by Ross Girshick
# --------------------------------------------------------
"""Train a Faster R-CNN network using alternat... |
MessageQueue.py | # -*- coding: utf-8 -*-
"""
pip_services3_messaging.queues.MessageQeueue
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Abstract message queue implementation.
:copyright: Conceptual Vision Consulting LLC 2018-2019, see AUTHORS for more details.
:license: MIT, see LICENSE for more details.
"""
... |
CS.py | #!/usr/bin/env python3
import socket, sys, getopt, os
from signal import signal, pause, SIGINT, SIGTERM, SIG_IGN
from pickle import load, dump
from multiprocessing import Process
from multiprocessing.managers import SyncManager
from lib.server import tcp_server, udp_server, udp_client
from lib.utils import (read_byte... |
openvino_tiny-yolov3_MultiStick_test.py | import sys, os, cv2, time, heapq, argparse
import numpy as np, math
try:
from armv7l.openvino.inference_engine import IENetwork, IEPlugin
except:
from openvino.inference_engine import IENetwork, IEPlugin
import multiprocessing as mp
from time import sleep
import threading
yolo_scale_13 = 13
yolo_scale_26 = 26
... |
tests.py | import os
import shutil
import sys
import tempfile
import threading
import time
import unittest
from datetime import datetime, timedelta
from io import StringIO
from urllib.request import urlopen
from django.core.cache import cache
from django.core.exceptions import SuspiciousFileOperation
from django.core.files.base ... |
blender.py | import sys
import os
import threading
import importlib
import bpy
sys.path.append(os.path.dirname(bpy.data.filepath))
import neopixel
importlib.reload(neopixel)
xmaslights = __import__("xmaslights-spin")
importlib.reload(xmaslights)
xmaslights.coordfilename = os.path.join(os.path.dirname(bpy.data.filepath),"coords.t... |
vnf.onboard.py | #!/usr/bin/python
"""
After ESXi on-boarding finish it push a new job to a AMPQ.
This listener should receive event via AMPQ and start VNF on-boarding.
In this specific case VNF listener on-boards a Velo Cloud VNF.
In order to do that it must have access to VNF Image, the image itself my
contain respected ... |
chess_trace_list.py | # pylint:disable=unused-argument
import typing
from typing import List, Optional, Tuple, TYPE_CHECKING
import threading
import asyncio
from tornado.platform.asyncio import AnyThreadEventLoopPolicy
import PySide2
from PySide2.QtWidgets import QDialog, QPushButton, QHBoxLayout, QVBoxLayout, QMessageBox, QTableView, \
... |
test_noisemachine.py | from enum import auto
import unittest
from gpiozero import Device
from gpiozero.pins.mock import MockFactory
from noisemachine import NoiseMachine
from os import chdir
from os.path import realpath, split
from unittest import mock
from unittest.mock import patch
from time import sleep
import threading
Device.pin_factor... |
server.py | #!/usr/bin/python
# Copyright 2019 Xilinx 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 ag... |
selfNode.py | import logging
import socket
import subprocess
import threading
import time
from python.cloudServer import Processor
def memoryToffmpeg(In, Out):
try:
Out.write(In)
Out.flush()
Out.close()
except Exception as e:
logging.exception(e)
class SelfNode:
def __init__(self):
... |
rdd.py | from base64 import standard_b64encode as b64enc
import copy
from collections import defaultdict
from itertools import chain, ifilter, imap, product
import operator
import os
import shlex
from subprocess import Popen, PIPE
from tempfile import NamedTemporaryFile
from threading import Thread
from pyspark import cloudpic... |
MongoApp.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import subprocess
import threading
import tkFont
import ttk
import webbrowser
from os import makedirs
from os.path import exists, expanduser, join as path_join
from sys import path as sys_path
from Tkinter import *
sys_path.append('libs')
from PIL import ImageTk, Image
... |
forwarding.py | #!/usr/bin/env python3
# Software License Agreement (BSD License)
#
# Copyright (c) 2022, Vm, Inc.
# All rights reserved.
#
# Author: Vinman <vinman.cub@gmail.com>
import sys
import time
import queue
import socket
import logging
import threading
logger = logging.getLogger('tcp_forwarding')
logger.setLevel(logging.INF... |
dictionary_server.py | """
在线字典服务端
"""
from socket import *
from select import *
from multiprocessing import Process
import pymysql
from time import *
# 用于数据库的交互
class Database:
database_args = {
"host": "localhost",
"port": 3306,
"user": "root",
"password": "417355570",
"database": "dict",
... |
database.py | from itertools import permutations
try:
from Queue import Queue
except ImportError:
from queue import Queue
import threading
from peewee import *
from peewee import Database
from peewee import FIELD
from peewee import attrdict
from peewee import sort_models
from .base import BaseTestCase
from .base import Dat... |
index.py | #!/usr/bin/pypy3
#!/usr/bin/python3
from urllib.request import urlopen
import cgi
import mysql.connector
from datetime import datetime, timedelta, date
from threading import Thread
import json
def commit(ticker, iinterval, rrange, results, cursor, cnx):
sql1 = "DELETE FROM yahoofinances WHERE ticker='{}' AND iinte... |
operator.py | import logging
import multiprocessing as mp
import os
import time
import threading
from typing import Any
from typing import Callable
from typing import Dict
from typing import Tuple
from typing import Optional
from kubernetes.client.exceptions import ApiException
import yaml
import ray.autoscaler._private.monitor as... |
psonic.py | # The MIT License (MIT)
#
# Copyright (c) 2016 G. Völkl
#
# 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, ... |
task_runner_test.py | #!/usr/bin/env vpython3
# coding=utf-8
# Copyright 2013 The LUCI Authors. All rights reserved.
# Use of this source code is governed under the Apache License, Version 2.0
# that can be found in the LICENSE file.
from __future__ import print_function
import base64
import datetime
import fnmatch
import json
import logg... |
stagingmanager.py | #!/usr/bin/env python
"""
Listens for messages from ingest to create a staging area, post back the credentials for uploading
files to the staging area
"""
from ingest.api.ingestapi import IngestApi
from ingest.api.stagingapi import StagingApi
__author__ = "jupp"
__license__ = "Apache 2.0"
__date__ = "15/09/2017"
imp... |
train_faster_rcnn_alt_opt.py | #!/usr/bin/env python
# --------------------------------------------------------
# Faster R-CNN
# Copyright (c) 2015 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Written by Ross Girshick
# --------------------------------------------------------
"""Train a Faster R-CNN network using alternat... |
__init__.py | #!/usr/bin/env python
import sys, os, time, threading, signal
import bot
class Watcher(object):
# Cf. http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/496735
def __init__(self):
self.child = os.fork()
if self.child != 0:
self.watch()
def watch(self):
try: os.wait()
e... |
server.py | import sys
import threading
import time
import webbrowser
from BaseHTTPServer import HTTPServer
from SimpleHTTPServer import SimpleHTTPRequestHandler
class Server:
def __init__(self, port=8000):
self._initserver(port)
def openbrowser(self, url):
webbrowser.open_new_tab(url)
self.exit... |
client.py | import threading
import socket
# Choosing Nickname
nickname = input("Escolha o seu nickname: ")
# Connecting To Server
client = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
client.connect(('127.0.0.1', 55555))
# Receiving / Listening Function
# Listening to Server and Sending Nickname
def receive():
while... |
agent.py | from __future__ import print_function
import multiprocessing
import os
import portalocker
import time
import traceback
from builtins import object
from builtins import range
from builtins import zip
import envwrap
import numpy as np
import tensorflow as tf
import valuerl
from config import config
import util
# Cop... |
Tune_GALDA.py | import numpy as np
from sklearn import feature_extraction
from sklearn.feature_extraction.text import CountVectorizer
from pyevolve import G1DList
from pyevolve import GSimpleGA
from pyevolve import Crossovers
import numpy as np
import os
from gensim import corpora, models, interfaces
import gensim
from itertools impor... |
NetEaseMusic.py | # -*- coding: utf-8-*-
# 网易云音乐播放插件
import logging
import threading
import hashlib
import time
import subprocess
import sys
import os
import re
import random
from MusicBoxApi import api as NetEaseApi
import eyed3
reload(sys)
sys.setdefaultencoding('utf8')
# Standard module stuff
WORDS = ["YINYUE"]
SLUG = "netease_musi... |
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... |
test_app.py | from path import Path
import os, sys, asyncio
if sys.platform == 'win32':
asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())
from multiprocessing import Process
import pytest
import pytestqt
import cadquery as cq
from PyQt5.QtCore import Qt, QSettings
from PyQt5.QtWidgets import QFileDialog... |
scraper.py | import json, asyncio, time, socket, datetime, time
import threading
import pandas as pd
from random import randint, choice
from bs4 import BeautifulSoup
from urllib3.exceptions import MaxRetryError
from urllib3 import ProxyManager, PoolManager, disable_warnings, exceptions
from collections import Counter
from scripts.... |
rdd.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 us... |
__init__.py | """ Main module of the ARPOC """
# Python imports
import logging
import logging.config
import warnings
import copy
import argparse
# For scheduling auth & registration to providers
import sched
import threading
import time
import importlib.resources
import os
import pwd
import grp
import hashlib
import urllib.par... |
test_enum.py | import enum
import inspect
import pydoc
import sys
import unittest
import threading
from collections import OrderedDict
from enum import Enum, IntEnum, EnumMeta, Flag, IntFlag, unique, auto
from io import StringIO
from pickle import dumps, loads, PicklingError, HIGHEST_PROTOCOL
from test import support
from datetime im... |
utils.py | # Copyright 2017 MDSLAB - University of Messina
# 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... |
interface.py | # Copyright (c) 2016 Ansible by Red Hat, Inc.
#
# 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 Licen... |
test_ssl.py | # Test the support for SSL and sockets
import sys
import unittest
import unittest.mock
from test import support
import socket
import select
import time
import datetime
import gc
import os
import errno
import pprint
import urllib.request
import threading
import traceback
import asyncore
import weakref
import platform
i... |
sftp_file.py | # Copyright (C) 2003-2007 Robey Pointer <robeypointer@gmail.com>
#
# This file is part of paramiko.
#
# Paramiko is free software; you can redistribute it and/or modify it under the
# terms of the GNU Lesser General Public License as published by the Free
# Software Foundation; either version 2.1 of the License, or (a... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.