source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
test_sender.py | import os
import pytest
import queue
import threading
import time
import shutil
import wandb
from wandb.util import mkdir_exists_ok
from .utils import first_filestream
def test_send_status_request_stopped(mock_server, backend_interface):
mock_server.ctx["stopped"] = True
with backend_interface() as interfa... |
main.py | from kivy.app import App
from kivy.uix.boxlayout import BoxLayout
from selenium import webdriver
from webdriver_manager.chrome import ChromeDriverManager
from webdriver_manager.firefox import GeckoDriverManager
import threading
import time
class GuiLayout(BoxLayout):
def __init__(self):
super(GuiLayout, s... |
job.py | # Copyright (c) 2019 PaddlePaddle 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 app... |
cli.py | # encoding: utf-8
from __future__ import print_function
import collections
import csv
import multiprocessing as mp
import os
import datetime
import sys
from pprint import pprint
import re
import itertools
import json
import logging
from optparse import OptionConflictError
import traceback
from six import text_type
f... |
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... |
utils.py | # Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# Copyright 2011 Justin Santa Barbara
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance w... |
transfer_manager.py | """
Manage transfers from arbitrary URLs to temporary files. Socket interface for
IPC with multiple process configurations.
"""
import os, subprocess, socket, logging, threading
from galaxy import eggs
from galaxy.util import listify, json
log = logging.getLogger( __name__ )
class TransferManager( object ):
"""... |
callmonitor.py | #!/usr/bin/python3
import contextlib
import logging
import os
import platform
import socket
import sys
import threading
import time
from enum import Enum
sys.path.append(os.path.dirname(__file__))
from fritzconn import FritzConn
from utils import Log, anonymize_number
logging.basicConfig(level=logging.WARNING)
log =... |
youtube_downloader.py | from pytube import YouTube, Playlist
import validators
from os import getcwd, chdir, rename, mkdir
from os.path import join as join_path, getsize, exists, expanduser
from multiprocessing import Process
from time import sleep
import re
from shutil import move as move_file
from string import ascii_letters as alphabets
fr... |
__init__.py | # -*- coding: utf-8 -*-
from cone.app import browser
from cone.app import security
from cone.app.interfaces import IApplicationNode
from cone.app.model import AppRoot
from cone.app.model import AppSettings
from cone.app.model import LayoutConfig
from cone.app.model import Properties
from cone.app.ugm import ugm_backend... |
gen.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals, print_function
from copy import deepcopy
import json
import logging
from multiprocessing import Process
from os.path import dirname, realpath, join, getmtime, relpath
from os import listdir, system
import pipes
import re
import shutil
import yaml
from ... |
solrqueue.py | import logging
import threading
import os
from queue import Empty, Full, Queue
from haystack.utils import get_identifier
from api.v2.search.index import TxnAwareSearchIndex
LOGGER = logging.getLogger(__name__)
# this will kill the vcr-api process
ABORT_ON_ERRORS = os.getenv("RTI_ABORT_ON_ERRORS", "TRUE").upper()
A... |
LPD_video_node.py | import cv2
import os
import sys
import threading
import time
import rospy
from cv_bridge import CvBridge
from sensor_msgs.msg import Image
from std_msgs.msg import Float32MultiArray
from LP_detection import LicencePlateDetectioin, Parser
from yolo_modules import yolo_gluon
from yolo_modules import global_variable
fro... |
test_asyncore.py | import asyncore
import unittest
import select
import os
import socket
import sys
import time
import errno
import struct
import threading
from test import support
from test.support import socket_helper
from io import BytesIO
if support.PGO:
raise unittest.SkipTest("test is not helpful for PGO")
HAS_UNIX_SOCKETS ... |
test_client.py | import gevent
import zmq.green as zmq
import threading
import time
context = zmq.Context()
def client3():
socket = context.socket(zmq.REQ)
socket.connect('tcp://127.0.0.1:10086')
time.sleep(2)
socket.send_string('你认识鲁迅吗?')
reply = socket.recv() # fixing for recv-send pair
reply = str(reply, ... |
twitchchat.py | '''
LoLAlerter: Every LoL partner's pal
Copyright (C) 2015 Redback
This file is part of LoLAlerter
'''
from threading import Thread
from irc.bot import ServerSpec, SingleServerIRCBot
from logger import Logger
from model import *
import constants as Constants
class TwitchChat(SingleServerIRCBot):
'''
The Twitc... |
musicdata_volumio2.py | #!/usr/bin/python
# coding: UTF-8
# musicdata service to read from Volumio V2
# Written by: Ron Ritchey
from __future__ import unicode_literals
import json, threading, logging, Queue, time, sys
import musicdata
from socketIO_client import SocketIO
def on_GetState_response(*args):
logging.debug(u"********* Got Resp... |
client.py | import socket
from threading import Thread
from typing import Union, Optional, List, Tuple
from time import sleep
from PIL import Image
from io import BytesIO
import hashlib
from utils.rtsp_packet import RTSPPacket
from utils.rtp_packet import RTPPacket
from utils.video_stream import VideoStream
class Client:
DE... |
goc_to_image_with_gdp.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 gdp
import pygame
import pygame.fastevent
from pygame.locals import *
import m3_common
from m3_logging import get_logger
logger = get_l... |
demo_plot.py | from matplotlib import pyplot as plt
import numpy as np
import Pyro4
import Queue
import threading
class SimpleViewer():
def __init__(self):
self.fig = plt.figure()
self.fig.show()
self.ax = self.fig.add_subplot(111)
self.line = None
self.queue = Queue.Queue()
d... |
TileServer.py | #!python3
# coding: utf-8
import errno
import threading, time
import sys,os,re
from subprocess import Popen as Popen
import subprocess as subp
import shlex
from operator import itemgetter
import traceback
sys.path.append(os.path.abspath('./connect'))
from connect import sock
import logging
#logging.basicConfig(leve... |
io_eth.py | """--------------------------------------------------------------------
COPYRIGHT 2014 Stanley Innovation Inc.
Software License Agreement:
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code m... |
tune.py | #!/usr/bin/env python
from __future__ import print_function
import argparse
import json
import multiprocessing
import os
import sys
import time
import pprint
import hyperopt
from hyperopt import hp
def run_vgg19(batch_size=64):
import numpy as np
import keras
import plaidml
# cifar10 data is 1/7th ... |
copyutil.py | # cython: profile=True
# 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
# "... |
test_cli.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
from threading import Thread
from time import sleep
import unittest
THIS_DIR = os.path.dirname(os.path.abspath(__file__))
sys.path.insert(0, os.path.dirname(THIS_DIR))
from mae.cli import ExporterServer
class TestCLIServer(unittest.TestCase):
... |
monitor.py | import re
import time
import threading
from typing import Dict
from datetime import datetime, timedelta
from nonebot import require, get_driver, get_bots
from nonebot.adapters.cqhttp import Message, MessageSegment
from nonebot.log import logger
from .data_source import get_live_info_by_uids, get_play_url, get... |
crawler.py | #! /usr/bin/env python3
# This is a four threads crawler starts from javbus2.pw/genre/hd/1
import parser
import database
import os
import timeit
import threading
import sys
import datetime
from object_prototye import Counter
def parse_page(url, thread_num, counter):
""" parse function for each page"""
# ge... |
trezor.py | from binascii import hexlify, unhexlify
import traceback
import sys
from electrum_ltc.util import bfh, bh2u, versiontuple, UserCancelled
from electrum_ltc.bitcoin import (b58_address_to_hash160, xpub_from_pubkey, deserialize_xpub,
TYPE_ADDRESS, TYPE_SCRIPT, is_address)
from electrum_l... |
websocket_layer.py | import threading
from channels.generic.websocket import WebsocketConsumer
from django.conf import settings
from server.models import RemoteUserBindHost
from webssh.models import TerminalSession
import django.utils.timezone as timezone
from django.db.models import Q
from asgiref.sync import async_to_sync
from util.tool ... |
gui_api.py | import threading
import deformetrica as dfca
import logging
global logger
logger = logging.getLogger()
def call(name, params, estimator_callback=None, callback=lambda *args: None):
# global running
logger.info(params)
def func():
# global running
try:
deformetrica_command_to... |
uiWidgets.py | # -*- coding: utf-8 -*-
"""
基于uiKline扩展得widgets
华富资产/李来佳
"""
import sys
import os
import ctypes
import platform
system = platform.system()
from threading import Thread
# 将repostory的目录,作为根目录,添加到系统环境中。
ROOT_PATH = os.path.abspath(os.path.join(os.path.dirname(__file__), '..' , '..'))
sys.path.append(ROOT_PATH)
from vnpy... |
asyn.py | import asyncio
import asyncio.events
import functools
import inspect
import os
import re
import sys
import threading
from contextlib import contextmanager
from glob import has_magic
from .exceptions import FSTimeoutError
from .spec import AbstractFileSystem
from .utils import PY36, is_exception, other_paths
private =... |
vest_lp_tokens.py | import json
import threading
from decimal import Decimal
from brownie import ERC20CRV, VestingEscrow, accounts, history
from . import deployment_config as config
TOTAL_AMOUNT = 151515151515151515151515151
VESTING_PERIOD = 86400 * 365
# burn addresses / known scammers
BLACKLIST = [
"0x000000000000000000000000000... |
RawListener.py | import logging
import os
import sys
import threading
import SocketServer
import ssl
import socket
from . import *
class RawListener(object):
def taste(self, data, dport):
return 1
def __init__(self,
config,
name='RawListener',
logging_level=logging.INFO,
... |
cartpole-a2c-mp-pytorch.py | #!/usr/bin/env python3
import argparse
import collections
import gym
import gzip
import matplotlib.pyplot as plot
import numpy as np
import os
import random
import signal
import sys
import torch as t
import tqdm
from torch.multiprocessing import Process, Pipe
sys.path.append(sys.path[0] + "/..")
import common
ENV_NA... |
test_bucket.py | import random
import threading
import time
from botocore.retries import bucket
from tests import unittest
class InstrumentedTokenBucket(bucket.TokenBucket):
def _acquire(self, amount, block):
rval = super(InstrumentedTokenBucket, self)._acquire(amount, block)
assert self._current_capacity >= 0
... |
k8s.py |
import hashlib
import os
import random
import re
from string import Template
import scalyr_agent.monitor_utils.annotation_config as annotation_config
from scalyr_agent.monitor_utils.annotation_config import BadAnnotationConfig
from scalyr_agent.monitor_utils.blocking_rate_limiter import BlockingRateLimiter
import sca... |
mnist_to_mr.py | # Copyright 2019 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... |
hikvision.bak.py | """
pyhik.hikvision
~~~~~~~~~~~~~~~~~~~~
Provides api for Hikvision events
Copyright (c) 2016-2018 John Mihalic <https://github.com/mezz64>
Licensed under the MIT license.
Based on the following api documentation:
System:
http://oversea-download.hikvision.com/uploadfile/Leaflet/ISAPI/HIKVISION%20ISAPI_2.0-IPMD%20Servi... |
cmd.py | # coding: utf-8
import os
import sys
import subprocess
import logging
import threading
import webbrowser
from datetime import datetime
from functools import partial
import sublime
from .util import get_executable, get_setting, text_type
from .helpers import GitRepoHelper
logger = logging.getLogger('SublimeGit.cmd')... |
test_backfill_job.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... |
views.py | import logging
import multiprocessing
import threading
import traceback
from datetime import datetime
from django.contrib import messages
from django.core.cache import cache
from django.db import transaction
from django.db.models import F
from django.shortcuts import HttpResponseRedirect, reverse, get_object_or_404
fr... |
server.py | """Setup for Psc2 demo with Arturia keyboard.
This is a server that communicates with SuperCollider for interacting with a
MIDI controller.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from absl import app
import sys
import collections
import importl... |
1208_projTello.py | import os
import numpy as np
import cv2
import cv2.aruco as aruco
import time
from time import sleep
def controller(act_dist, id):
kx = 0.1
ky = 0.1
ref = [0, 0, 0]
act_dist = tvec[i][0] #green line, red line, blue line
y_dist = act_dist[0]*100
x_dist = act_dist[2]*100
... |
test_browser.py | # coding=utf-8
# Copyright 2013 The Emscripten Authors. All rights reserved.
# Emscripten is available under two separate licenses, the MIT license and the
# University of Illinois/NCSA Open Source License. Both these licenses can be
# found in the LICENSE file.
import argparse
import json
import multiprocessing
imp... |
mass_node_join.py | import multiprocessing
from time import sleep
import os
import sys
sys.path.append(".")
os.chdir("..")
from src import utils
def start_node(porty):
os.system(f"python3 start_node.py {porty}")
port = utils.params["testing"]["initial_port"]
processes = []
node_details = []
for _ in range(utils.params["testing"]... |
roiExtract_v1.py | # This code gets the ROI from each frame of each video in the data set
# Change the location and destination of frames and ROI in the settings section
# Set max number of threads and number of video to process as well
# Recommended number of threads = 15 for core i7
# To process fames of Synthesized videos, set syn = 1... |
test_client.py | import os
import re
import socket
import sys
from threading import Thread
import time
PORT = 3333
def tcp_client(address, payload):
for res in socket.getaddrinfo(address, PORT, socket.AF_UNSPEC,
socket.SOCK_STREAM, 0, socket.AI_PASSIVE):
family_addr, socktype, proto, can... |
chip8_interpreter.py | # Python emulator for Chip-8
import random
from constants import *
import threading
from timers import *
import threaded_timers
from instructions import *
class Interpreter():
def __init__(self):
self.memory = bytearray(MEMSIZE)
for i in range(MEMSIZE):
self.memory[i] = random.randint(... |
tk_multithread.py | #!/bin/env python3
import tkinter as tk
import threading
import queue
import time
a=threading.Thread()
a.start()
q=queue.Queue()
def worker():
q.put('开始处理')
time.sleep(3)
print("worker complete")
q.put('处理完成')
class Application(tk.Frame):
def __init__(self, master=None):
super().__init_... |
test_multiple_process_server.py | import multiprocessing
import sys
import time
import unittest
from grpc import insecure_channel
from grpcalchemy import grpcmethod, Server, DefaultConfig, Context
from grpcalchemy.orm import Message
from tests.test_grpcalchemy import TestGRPCAlchemy
@unittest.skipIf(bool(sys.platform == "darwin"), "Need recompile g... |
swiftsync.py | import os
import sys
import time
import threading
import hashlib
import mimetypes
import ast
from swiftclient import client as swiftclient
from swiftclient import exceptions as swiftexceptions
'''
Append an entry in a log file in the specific directory relating to the success or failure of a command. The command would... |
test_certificates.py | from __future__ import unicode_literals # at top of module
import datetime
import json
import ssl
import threading
from http.server import HTTPServer, SimpleHTTPRequestHandler
from tempfile import NamedTemporaryFile
import arrow
import pytest
from cryptography import x509
from cryptography.x509.oid import ExtensionO... |
test_pubsub.py | #!/usr/local/bin/python3.6
# vim: expandtab shiftwidth=4
# Copyright (C) 2019 National Institute of Informatics
#
# 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 own... |
hub.py | """hub.py -- ImagHub and Settings classes
Copyright (c) 2018 by Jeff Bass.
License: MIT, see LICENSE for more details.
"""
import os
import sys
import yaml
import pprint
import signal
import logging
import itertools
import threading
from time import sleep
from ast import literal_eval
from datetime import datetime
fro... |
client2.py | import errno
import socket
import threading
import time
import sys
CODE = 'utf-8'
HEADER_LEN = 10
IP = 'localhost'
PORT = 5001
def client2():
# Нам нужно кодировать имя пользователя в байтах
nickname = input("Enter your nickname: ").encode(CODE)
client_socket = socket.socket(socket.AF_INET, socket.SOCK_S... |
check_pdu_creds.py | #!/usr/bin/env python
from requests import get as reqget, post as reqpost
from json import loads as jsonloads, dumps as jsondumps
from config import configSystem
from threading import Thread
from ftplib import FTP
import time, sys, os
cfg = configSystem('config.cfg')
# Override
#dccode = ''
dccode = cfg.getConfigValu... |
googleDB.py | import gspread
import asyncio
import discord
import random
import os
import sched
import time
import requests
import tempfile
import configparser
from discord.ext import commands
from threading import Thread
from oauth2client.service_account import ServiceAccountCredentials
scope = ['https://spreadsheets.google.com/f... |
ambigroup.py | import traceback
from threading import Thread
import requests
import xbmc
import xbmcgui
from PIL import Image
from resources.lib import ADDON, MINIMUM_COLOR_DISTANCE, imageprocess, lightgroup
from resources.lib import PROCESS_TIMES, reporting, hue, AMBI_RUNNING
from resources.lib.language import get_string as _
from... |
dist.py | try:
from bashmu.Deferred import Deferred
except ImportError:
from .Deferred import Deferred
from threading import RLock, Condition
from threading import Thread
from functools import wraps
class DistBase:
def __init__(self, start=True):
self.lock = RLock()
self.cond = Condition(self.lock)
... |
multi_node_criteo_2node_4gpu.py | from hugectr import Session, solver_parser_helper, get_learning_rate_scheduler
from mpi4py import MPI
import threading
import sys
def session_impl_test(json_file):
solver_config = solver_parser_helper(seed = 0,
batchsize = 16384,
batchsize_eva... |
ldeo_furnace.py | # ===============================================================================
# Copyright 2018 Stephen Cox
#
# 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/licens... |
test_general.py | """Collection of tests for unified general functions."""
# global
import os
import math
import time
import einops
import pytest
from hypothesis import given, strategies as st
import numpy as np
from numbers import Number
from collections.abc import Sequence
import torch.multiprocessing as multiprocessing
# local
impo... |
runner.py | #!/usr/bin/env python2
# Copyright 2010 The Emscripten Authors. All rights reserved.
# Emscripten is available under two separate licenses, the MIT license and the
# University of Illinois/NCSA Open Source License. Both these licenses can be
# found in the LICENSE file.
"""This is the Emscripten test runner. To run ... |
camera_d435.py | #!/usr/bin/env python3
import sys
sys.path.append("/usr/local/lib/")
import os
import time
from threading import Thread
import transformations as tf
import numpy as np
import math as m
import traceback
import pyrealsense2 as rs
import cv2
import csv
from mycelium.components import Camera, RedisBridge
class CameraD... |
stream-camera.py | from imutils.video import VideoStream, FPS
from flask import Response
from flask import Flask
from flask import render_template
import threading
import argparse
import datetime
import imutils
import time
import cv2
import os
import numpy as np
from utils.benchmark import Benchmark
from utils.recorder import Recorder
... |
threading.test.py | #!/usr/bin/env python3
#
# import time
# import multiprocessing
#
# def huhu():
# i = 0
# while True:
# print("Running uwu", i)
# i += 1
# time.sleep(0.5)
#
# x = multiprocessing.Process(target=huhu)
# x.start()
#
# time.sleep(2)
#
# for p in multiprocessing.active_children():
# p.te... |
processpool.py | '''Simple pure-python process pool implementation.'''
import multiprocessing as mp
import queue
from uuid import uuid1
from .base import PoolBase, Task
class ProcessPool(PoolBase):
'''Simple pure-python process pool implementation for general usage.'''
def __init__(self, workers_count=mp.cpu_count()+1):
... |
vtFunction.py | # encoding: UTF-8
"""
包含一些开发中常用的函数
"""
import vtGlobal
import os
import decimal
import json
import time
import datetime as dt
from datetime import datetime
MAX_NUMBER = 10000000000000
MAX_DECIMAL = 4
#----------------------------------------------------------------------
def safeUnicode(value):
"""检查接口数据潜在的错误,保... |
session_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... |
proxy_server.py | import socket
import threading
TCP_to_UDP_message = ""
UDP_to_TCP_message = ""
send_to_TCP_client = False
def TCP_server():
global TCP_to_UDP_message, UDP_to_TCP_message, send_to_TCP_client
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
s.bind(("localhost", 5000))
s.listen()
... |
__init__.py | import argparse
import gettext
import os
import sys
import threading
import time
from collections import defaultdict
from http.server import HTTPServer, SimpleHTTPRequestHandler
from tempfile import TemporaryDirectory
from watchdog.observers import Observer
from watchdog.events import FileSystemEventHandler
from .gene... |
benderjob.py | # -*- coding: utf-8 -*-
from __future__ import print_function, unicode_literals
import sys
reload(sys)
sys.setdefaultencoding("utf-8")
import threading
import time
import datetime
import json
import logging
import os
import json
import hashlib
import codecs
from core import utils
from gensim import corpora
from module... |
netbeez-agent.py | #!/usr/bin/env python
# coding=utf-8
import grpc
import datetime
import sys
import logging
import socket
import os
from ipaddress import ip_network, ip_address, IPv4Address
import json
import signal
import traceback
import re
# import threading
from concurrent.futures import ThreadPoolExecutor
import subprocess
impor... |
indextuning_utility.py | import six.moves.urllib.request, six.moves.urllib.parse, six.moves.urllib.error
import requests
from xml.dom import minidom
import re
from subprocess import Popen, PIPE, check_output
import threading
import six.moves.queue
from time import sleep
import sys
import os
import logging
from io import open
logger = logging.... |
test_leabra_mechanism.py | import copy
import numpy as np
import random
from psyneulink.core.compositions.composition import Composition
from psyneulink.core.components.functions.nonstateful.transferfunctions import Linear
from psyneulink.core.components.mechanisms.processing.transfermechanism import TransferMechanism
from psyneulink.core.compo... |
locators.py | # -*- coding: utf-8 -*-
#
# Copyright (C) 2012-2015 Vinay Sajip.
# Licensed to the Python Software Foundation under a contributor agreement.
# See LICENSE.txt and CONTRIBUTORS.txt.
#
import gzip
from io import BytesIO
import json
import logging
import os
import posixpath
import re
try:
import threading
except Impo... |
trezor.py | from binascii import hexlify, unhexlify
from collections import defaultdict
import traceback
import sys
from electroncash.util import bfh, bh2u, versiontuple, UserCancelled
from electroncash.bitcoin import (b58_address_to_hash160, xpub_from_pubkey, deserialize_xpub,
TYPE_ADDRESS, TYPE... |
widget.py | # -*- coding: utf-8 -*-
"""
| This file is part of the web2py Web Framework
| Copyrighted by Massimo Di Pierro <mdipierro@cs.depaul.edu>
| License: LGPLv3 (http://www.gnu.org/licenses/lgpl.html)
The widget is called from web2py
----------------------------------
"""
import datetime
import sys
from gluon._compat impo... |
context.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... |
test_hadoop_etl_udfs.py | #!/usr/bin/env python2.7
import time
import os
import sys
import socket
import subprocess
import threading
from io import BytesIO
import tarfile
sys.path.append(os.path.realpath(__file__ + '/../../../lib'))
import udf
from udf import useData, expectedFailure
import docker_db_environment
class JavaHive(udf.TestCase)... |
subprocess_env_manager.py | from typing import *
import cloudpickle
from mlagents.envs import UnityEnvironment
from mlagents.envs.exception import UnityCommunicationException
from multiprocessing import Process, Pipe, Queue
from multiprocessing.connection import Connection
from queue import Empty as EmptyQueueException
from mlagents.envs.base_un... |
charts.py | import json
import threading
import time
from reprint import output
from playstoreapi.googleplay import GooglePlayAPI, LoginError
from gplaycrawler.utils import get_logger
class Charts:
def __init__(self, locale='en_US', timezone='UTC', device='px_3a', delay=None, log_level='info'):
self.locale = locale
... |
main.py | from PyQt5.QtWidgets import QApplication, QLabel, QWidget, QStatusBar, QMainWindow, QPushButton, QAction, QFileDialog
from PyQt5.QtCore import pyqtSlot, QTimer
from PyQt5.QtGui import QIcon , QPixmap , QImage
from PyQt5.uic import loadUi
from PyQt5 import QtGui , QtCore
import keras
from keras.models import load_model,... |
log_consumer.py | """Log consumers are responsible for fetching chia logs
and propagating them to subscribers for further handling.
This abstraction should provide an easy ability to switch between
local file reader and fetching logs from a remote machine.
The latter has not been implemented yet. Feel free to add it.
"""
# std
import ... |
http_stub.py | from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer
import threading
import time
import errno
class HttpStub(BaseHTTPRequestHandler):
server = None
thread = None
@classmethod
def last_request(cls):
return cls.requests[0]
@classmethod
def reset(cls):
cls.requests = ... |
replay_client.py | '''
#######################################################################################################
#######################################################################################################
Copyright 2018 Northeastern University
Licensed under the Apache License, Version 2.0 (the "License");
you ... |
test_bson.py | # -*- coding: utf-8 -*-
#
# Copyright 2009-present MongoDB, 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 applicab... |
throttler.py | # -*- coding: utf-8 -*-
# Copyright 2016-2021 CERN
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... |
core.py | #!/usr/bin/python3
# -*- coding: utf-8 -*-
__author__ = 'SL_RU'
##главный файл. Точка входа
import time, os, sys, getopt
def set_output_to_file(path):
fl = open(path, "a", 1)
sys.stdout = sys.stderr = fl
try:
opts, args = getopt.getopt(sys.argv[1:],"hl:")
except:
print("Invalid args\nRaspiBluePlayer... |
detectar_consumo.py | #!/usr/bin/python2
from time import strftime, sleep, localtime
import threading
from os.path import expanduser
class DetectarConsumo():
entrada = 0.0
salida = 0.0
total = 0.0
interface = "" # nombre de la interface a monotorear
periodo = 0.0 # consumido en dicho periodo
home = expanduser("~... |
test_browser.py | # coding=utf-8
# Copyright 2013 The Emscripten Authors. All rights reserved.
# Emscripten is available under two separate licenses, the MIT license and the
# University of Illinois/NCSA Open Source License. Both these licenses can be
# found in the LICENSE file.
from __future__ import print_function
import argparse
... |
transfer.py | #!/usr/bin/env python
"""
Downloads files to temp locations. This script is invoked by the Transfer
Manager (galaxy.jobs.transfer_manager) and should not normally be invoked by
hand.
"""
import os, sys, optparse, ConfigParser, socket, SocketServer, threading, logging, random, urllib2, tempfile, time
galaxy_root = os.... |
imagenet_to_mr.py | # Copyright 2019 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... |
vpn.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import socket
import re
import signal
import requests
import json
from time import sleep
from inspect import stack
from traceback import print_exc
from threading import Thread
from subprocess import Popen, PIPE
from Queue import Queue
import auth
import plugin... |
cronjobs.py | #!/usr/bin/env python
"""Cron management classes."""
import random
import threading
import time
import logging
from grr.lib import access_control
from grr.lib import aff4
from grr.lib import config_lib
from grr.lib import data_store
from grr.lib import flow
from grr.lib import master
from grr.lib import queue_manag... |
socketManage.py | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# __author__ = "JrXnm"
# Date: 18-10-12
import socket
import threading
import datetime
from hashlib import md5
import time
from utils.log import Log
from utils.io import save_info, log_save, server_log
import traceback
import optparse
import re
import string
import random
... |
handler.py | import io
import json
import logging
import socket
import struct
import threading
import traceback
import weakref
import paramiko
import tornado.web
from tornado.ioloop import IOLoop
from webssh.settings import swallow_http_errors
from webssh.utils import (
is_valid_ipv4_address, is_valid_ipv6_address, is_valid_po... |
domainParser.py | #!/usr/bin/env python
import re
import socket
import os.path
import os
import sys
from pprint import pprint as pp
import json
from datetime import datetime, timedelta
import logging as logger
import time
import configparser
from multiprocessing import Process, current_process, active_children
from mqlightQueue import... |
wallet.py | # Electrum - lightweight Bitcoin client
# Copyright (C) 2015 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 rights t... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.