source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
TFSparkNode.py | # Copyright 2017 Yahoo Inc.
# Licensed under the terms of the Apache 2.0 license.
# Please see LICENSE file in the project root for terms.
"""
This module provides Spark-compatible functions to launch TensorFlow on the executors.
There are three main phases of operation:
1. Reservation - reserves a port for the Tensor... |
install.py | #!/usr/bin/env python
# TODO: add installer support for membasez
import getopt
import copy, re
import logging
import os
import sys
from threading import Thread
from datetime import datetime
import socket
import queue
import traceback
sys.path = [".", "lib"] + sys.path
import testconstants
import time
from builds.bui... |
client-socket.py | import socket
import threading
ServerIP = input("Servidor IP: ")
PORT = int(input("Porta: "))
cliente = socket.socket(socket.AF_INET,socket.SOCK_STREAM)
try:
nomeUsuario= input('Digite seu nome: ')
cliente.connect ((ServerIP,PORT))
print(f'Conectado com sucesso ao {ServerIP}:{PORT}')
except:
... |
stolen_token.py | # Copyright (c) 2020, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
#
# WSO2 Inc. licenses this file to you 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/LICE... |
test_integration_basics.py | """Tests Nighthawk's basic functionality."""
import json
import logging
import math
import os
import pytest
import subprocess
import sys
import time
from threading import Thread
from test.integration.common import IpVersion
from test.integration.integration_test_fixtures import (
http_test_server_fixture, https_t... |
build.py | # Copyright 2014 The Oppia 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 applicable ... |
BotTroxNew.py | # -*- coding: utf-8 -*-
import LINETCR
from LINETCR.lib.curve.ttypes import *
from datetime import datetime
import time,random,sys,json,codecs,threading,glob,re,os,subprocess
satpam = LINETCR.LINE() # BotTrox# Login Pake Akun Utama Kalian(Gunanya Supaya Akun Utama Ke Kick bisa Terima Undangan dari Bot Otomatis)
satpa... |
test_data_join_worker.py | # Copyright 2020 The FedLearner 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... |
map_test.py | # Copyright 2017 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... |
swarm.py | import logging
import sys
import threading
import time
from contextlib import contextmanager
from typing import Union, Optional
from lib.networking.kernel import Kernel
logging.basicConfig(
level=logging.DEBUG,
format="[%(asctime)s][%(levelname)s] %(message)s",
datefmt="%Y-%m-%d %H:%M:%S",
stream=sys.... |
store_gc_service_test.py | # Copyright 2020 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
import threading
import time
from pants.pantsd.service.store_gc_service import StoreGCService
from pants.testutil.test_base import TestBase
class StoreGCServiceTest(TestBase):
def t... |
scrape_amazon.py | '''' Scrape the Amazon.com using requests and Beautiful Soup. Increasing the speed
using the Threading/Processing/Pool in python'''
__author__ = "Tushar SEth"
__email__ = "tusharseth93@gmail.com"
import requests
from bs4 import BeautifulSoup
import pandas as pd
import time
from multiprocessing import Process, Queue, P... |
tutorial_bipedalwalker_a3c_continuous_action.py | """
Asynchronous Advantage Actor Critic (A3C) with Continuous Action Space.
Actor Critic History
----------------------
A3C > DDPG (for continuous action space) > AC
Advantage
----------
Train faster and more stable than AC.
Disadvantage
-------------
Have bias.
Reference
----------
MorvanZhou's tutorial: https://m... |
kasifDetect.py | import zipfile
import json
from datetime import datetime
import base64
import time
import os
import sys
import queue
import threading
import psutil
from persistqueue import Queue
import queue
import os
import time
import pygame.camera
import pygame.image
from PIL import Image
import cv2
import guid
import pika
import s... |
c_types.py | # from multiprocessing import Pool, Array, Process
from lithops.multiprocessing import Pool, Array, Process
def replace(index, value):
a[index] = value
def add(index, value):
a[index] += value
def to_upper():
my_str.value.upper()
if __name__ == '__main__':
x = [4, 8, 15, 16, 23, 42]
a = Arra... |
probe_online_nodes.py | """
author: Rene Pickhardt (rene.m.pickhardt@ntnu.no)
Date: 15.1.2020
License: MIT
Checks which nodes are currently online by establishing a connection to those nodes. Results can later be studied with `lightning-cli listpeers` or when `jq` is installed with `lcli getinfo | jq ".num_peers"`
This tool is intended to b... |
installwizard.py |
from functools import partial
import threading
from kivy.app import App
from kivy.clock import Clock
from kivy.lang import Builder
from kivy.properties import ObjectProperty, StringProperty, OptionProperty
from kivy.core.window import Window
from kivy.uix.button import Button
from kivy.utils import platform
from kivy... |
test_sync_clients.py | # -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------
import py... |
MetadataExtractor.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
This script:
1 - starts dcm4che to receive images from remote PACS.
2 - reads txt files containing feature list to identify research profiles consisting of the interesting attributes.
3 - grabs one instance per series and extract the metadata for the ident... |
test_dist_train.py | # Copyright (c) 2018 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... |
wireshark.py | """
Copyright 2017 ARM Limited
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
dis... |
rubypythonlib.py | #!/usr/bin/env python
# To-Do:
# Logging - log it all... Logging levels...
# Error handling - log all errors... Queue errors and transmit back via xml from bridge...
import socket,asyncore
import types
import sys
import time
from threading import Thread
import threading
import traceback
__newConne... |
Network.py | import datetime
import threading
from typing import List
import jsonpickle
from LocalBlockchain import Blockchain
from txServer import txServer
from rxServer import rxServer
class Network:
'''
class that encapsulates the network that enables communication between the nodes of the blockchain
...
Attri... |
threads.py | from threading import Thread
import time
def carro(velocidade, piloto):
trajeto = 0
while trajeto <= 100:
trajeto += velocidade
time.sleep(0.5)
print('Piloto: {} Km: {}\n'.format(piloto, trajeto))
t_carro1 = Thread(target = carro, args=[1, 'Massa'])
t_carro2 = Thread(target = carro, ... |
gt.py | #!/usr/bin/python
# Copyright (c) 2017 François Cami
# demonstrate how to launch a gnome-terminal monitored by gdbus
# best launched in dbus-run-session:
# $ dbus-run-session -- gt.py
import subprocess
from threading import Thread
import re
cmd1=['gdbus', 'monitor', '--session', '-d', 'org.gnome.Terminal']
cmd2=['... |
program.py | import os
import time
import datetime
import threading
import selenium
from . import scroller, writer
from .notifications import Common
from .custom_logger import log
def determine_action(url, driver, video_id_only, scroll_pause_time, verify_page_bottom_n_times, reverse_chronological, file_name, file_b... |
image_registry.py | import datetime
import logging
from io import StringIO
from threading import BoundedSemaphore
from threading import Lock
from threading import Thread
from self_finance.back_end.date_range import DateRange
from self_finance.back_end.insights._plot import _Plot
from self_finance.back_end.plot_cache import PlotCache
from... |
test_freezetime.py |
import pytest
import random
import datetime
from threading import Thread, RLock
from Acquire.Accounting import Account, Transaction, TransactionRecord, \
Ledger, Receipt, Refund, \
create_decimal
from Acquire.Identity import Authorisation
from Acquire.Se... |
cancom.py | # RaceControl, a bidirectional CAN bus telemetry platform.
# Copyright (C) 2016 Florian Eich
# 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
#... |
udp_io.py | """
Copyright (c) 2015 Glen Rice
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, subl... |
exercise01.py | """
现在有500车票 记为T1--T500
共有10个窗口同时买票 W1--W10
编写一个程序模拟买票过程
卖出一张票则打印 W1--T200
卖出后隔0.1秒才能出下一张
卖空为止
"""
from threading import Thread,Lock
from time import sleep
lock=Lock()
#将车票准备好
list_ticket=[]
for i in range(1,501):
list_ticket.append(f"T{i}")
#ticket=["T%d" %x for x in range(1,501)]
def sale(w):
while list... |
mypydoc.py | #! /usr/bin/python2.7
# -*- coding: latin-1 -*-
"""Generate Python documentation in HTML or text for interactive use.
In the Python interpreter, do "from pydoc import help" to provide online
help. Calling help(thing) on a Python object documents the object.
Or, at the shell command line outside of Python:
Run "pydo... |
sony_210222.py | # ===============================================================================================================================
#
# Name : mavlinkSonyCamWriteVals.py
# Desc : Global memory value class for use to write mavlink to sony cam
# Auth : AIR-obots Ai-Robots
#
# =========================================... |
renderskyplot.py | # -*- coding: utf-8 -*-
"""
Created on Fri Apr 26 09:01:59 2019
@author: S.P. van der Linden
@description: This class contains the main code for rendering the panorama,
given x,y coordinates of the antenna's target. Loosely based on:
https://nerdparadise.com/programming/pygame/part7
"""
im... |
decorators.py | # -*- coding:utf-8 -*-
# @Time : 19-7-4 下午7:48
# @Author : zhangshanling
from flask import abort
from threading import Thread
from functools import wraps
from flask_login import current_user
import os
def async(f):
""" 多线程修饰器 """
def wrapper(*args, **kwargs):
thr = Thread(target=f, args=args, kw... |
dynamodb_state_store.py | import logging
import math
import os
import pickle
import threading
import time
from collections import defaultdict
from collections import OrderedDict
import boto3
from tron.metrics import timer
OBJECT_SIZE = 400000
MAX_SAVE_QUEUE = 500
log = logging.getLogger(__name__)
class DynamoDBStateStore(object):
def _... |
port_scan.py | # libs
import socket
import threading # making process faster | multiprocessing would run many python codes (of this script) independently (wouldn't work here)
from queue import Queue
import sys
# get range of targets
inp = sys.argv
if len(inp) == 5:
host, port_range_start, port_range_end, thread_range = inp[1], i... |
antiseeker.py | import requests, json, sys, colorama
import threading
import time
def check(name):
greq = requests.get(url+"/php/result.txt")
try:
jgres = json.loads(greq.text)
print("Широта : "+jgres['info'][0]['lat'])
print("Долгота : "+jgres['info'][0]['lon'])
sys.exit
except:
... |
test_enum.py | import enum
import inspect
import pydoc
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 imp... |
AWS_Service_Health_Dashboard.py | #!/bin/env python
import re
import argparse
import calendar
import datetime
import dateutil.parser
import feedparser
import threading
import time
import urllib2
import argparse
import json
import socket
import struct
from HTMLParser import HTMLParser
class AWSSHDParser(HTMLParser):
def __init__(self, base_url, b... |
simulation_interface.py | import sys
import os
import numpy as np
import threading
import copy
import ipywidgets as widgets
from IPython.display import display
import matplotlib.pyplot as plt
from mcstasscript.interface.functions import name_search
from mcstasscript.interface import plotter
from mcstasscript.jb_interface import plot_interfac... |
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... |
test_socket.py | import unittest
from test import support
from test.support import os_helper
from test.support import socket_helper
from test.support import threading_helper
import errno
import io
import itertools
import socket
import select
import tempfile
import time
import traceback
import queue
import sys
import os
import platform... |
utils.py | from bitcoin.rpc import RawProxy as BitcoinProxy
from btcproxy import BitcoinRpcProxy
from collections import OrderedDict
from decimal import Decimal
from ephemeral_port_reserve import reserve
from lightning import LightningRpc
import json
import logging
import lzma
import os
import random
import re
import shutil
impo... |
process_crawler.py |
import time
import threading
import multiprocessing
from chapter3.downloader import Downloader
from chapter3.mongo_cache import MongoCache
from chapter4.alexa_cb import AlexaCallback
from chapter4.mongo_queue import MongoQueue
SLEEP_TIME = 1
def threaded_crawler(cache=None, max_threads=10):
"""
Crawl this we... |
async_runner.py | """ Main file with routines to run Listener
"""
import random
import threading
import time
from queue import Queue
from signal import SIGINT, signal
from pony.orm.dbapiprovider import DatabaseError
from ImHearing import audio, logger, post_recording, pre_recording, reader
from ImHearing.database import models
# Con... |
solver_interfaces.py |
import threading
import os
import socket
try:
from SimpleXMLRPCServer import SimpleXMLRPCServer, SimpleXMLRPCRequestHandler
from SimpleHTTPServer import SimpleHTTPRequestHandler
except ImportError:
# Python 3.x
from xmlrpc.server import SimpleXMLRPCServer, SimpleXMLRPCRequestHandler
from http.serve... |
script_helper.py | import argparse
import pickle
from threading import Thread
import os
import tensorflow as tf
import numpy as np
import time
import boml
import boml.load_data as dl
from boml.utils import feed_dicts
DATASETS_FOLDER = '../omniglot_resized'
parser = argparse.ArgumentParser()
parser.add_argument('-m', '--mode', type=st... |
m_share.py | from tkinter import * import ctypes , os , sys , socket ,netifaces
from random import choice
from tkinter.filedialog import askopenfilenames
from threading import Thread
import time
import tkinter.ttk as ttk
def m_share(event=None):
def _click_on_file_send(event=None):
global send_items_list ,files... |
pre_commit_linter.py | # coding: utf-8
#
# Copyright 2014 The Oppia 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 requi... |
test_models.py | from __future__ import unicode_literals
import fcntl
from multiprocessing import Process
import shutil
import mock
from pathlib2 import Path
from django.core import mail
from django.utils.encoding import force_bytes, force_text
from django_celery_beat.models import PeriodicTask
from mayan.apps.common.serialization... |
graph.py | from threading import Thread
import time
import uuid
class Queue:
def __init__(self):
self.queue = {}
def push(self, uid, element):
self.queue[uid] = element
def pop(self, uid=0):
if uid in self.queue:
return self.queue.pop(uid)
else:
return None
... |
test_client.py | import asyncio
import gc
import logging
import os
import pickle
import random
import subprocess
import sys
import threading
import traceback
import warnings
import weakref
import zipfile
from collections import deque
from contextlib import suppress
from functools import partial
from operator import add
from threading i... |
test_pool.py | import collections
import random
import threading
import time
import weakref
import sqlalchemy as tsa
from sqlalchemy import event
from sqlalchemy import pool
from sqlalchemy import select
from sqlalchemy import testing
from sqlalchemy.testing import assert_raises
from sqlalchemy.testing import assert_raises_message
f... |
test_content.py | from __future__ import print_function
import os
import re
import sys
import json
import time
import argparse
import threading
import subprocess
from time import sleep
from datetime import datetime
from distutils.version import LooseVersion
import urllib3
import requests
import demisto_client.demisto_api
from slackclie... |
dashboard.py | #!/usr/bin/python
# -*- coding:utf-8 -*-
import os
import sys
import logging
import ccs811LIBRARY
import os
import subprocess
logging.basicConfig(format='%(asctime)s %(levelname)-8s %(message)s', level=logging.DEBUG, datefmt='%Y-%m-%d %H:%M:%S')
picdir = os.path.join(os.path.join(os.path.join(os.path.join(os.path.d... |
NodeUDP.py | from Node import *
from socket import *
from NeighborsTable import *
from ReachabilityTables import *
from encoder_decoder import *
from queue import PriorityQueue
import time
'''TIMEOUTS'''
TIMEOUT_UPDATES = 30
TIMEOUT_ACK = 2
TIMEOUT_ALIVE_MESSAGES = 200
'''CONSTANTS'''
DEFAULT_MASK = 24
MESSAGE_TYPE_UPDATE = 1... |
worker.py | __title__ = "playground"
__author__ = "murlux"
__copyright__ = "Copyright 2019, " + __author__
__credits__ = (__author__, )
__license__ = "MIT"
__email__ = "murlux@protonmail.com"
import time
import threading
from logging import Logger
from typing import Callable
from playground import __version__
from playground.enum... |
thread.py | from numpy import mean, std
from time import time
from threading import Thread
from .utils import order_list
def thread_sort(initial_list: list, length: int) -> dict:
"""Parallel sort with threads
Args:
initial_list (list): List to be ordered
length (int): Initial length
Returns:
... |
sniffer.py | import socket
from threading import Thread
from struct import *
import string
import re
def packet_to_dict(packet):
#http://www.binarytides.com/python-packet-sniffer-code-linux/
ip_header = packet[0:20]
iph = unpack('!BBHHHBBH4s4s' , ip_header)
version_ihl = iph[0]
version = version_ihl >> 4
... |
serverthread.py | import socket
import time
import sys
from termcolor import colored
import thread
from threading import Thread
'''This file opens a socketed server thread and parses incomming messages to send unique
data packets to multiple clients'''
class Server:
def __init__(self,d,port,host):
self.s = None
sel... |
integration.py | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... |
pykms_Misc.py | #!/usr/bin/env python3
import sys
import logging
import os
import argparse
from logging.handlers import RotatingFileHandler
from pykms_Format import ColorExtraMap, ShellMessage, pretty_printer
#---------------------------------------------------------------------------------------------------------------------------... |
login.py | from PyQt5.QtWidgets import (
QApplication,
QMessageBox,
QDialog,
QGridLayout,
QVBoxLayout,
QHBoxLayout,
QLineEdit,
QComboBox,
QLabel,
QStyleFactory,
QGroupBox,
QPushButton,
QFormLayout,
QDesktopWidget,
)
from PyQt5.QtCore import Qt, QSize
from PyQt5.QtGui import ... |
accountgen.py | import requests
from random import randint
from threading import Thread
import time
import random
import string
from bs4 import BeautifulSoup as soup
import datetime
print("-------------------------------------")
print(" ADIDAS ACCOUNT CREATOR \n Created by Anton Lin \n www.github.com/antonjlin")
print("--... |
Proxy.py | import threading
from multiprocessing import Process
from ClientConnection import *
class Proxy:
def __init__(self, clientConnection: ClientConnection):
self.localHostAddr = "127.0.0.1"
self.localHostPort = 6410
self.managerSocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
... |
LightBluePebble.py | #!/usr/bin/env python
import logging
import multiprocessing
import os
import Queue
import re
import socket
from multiprocessing import Process
from struct import unpack
log = logging.getLogger()
logging.basicConfig(format='[%(levelname)-8s] %(message)s')
log.setLevel(logging.DEBUG)
class LightBluePebbleError(Exceptio... |
chuck.py | #!/usr/bin/python3
"""
Chuck is an script for invoking a package's automated unit tests
===============================================================================
usage: chuck [options] --match PATTERN [args <testargs>...]
chuck [options] --file CMDLIST
chuck [--help]
Arguments:
--match PATTE... |
main.py | import tornado.ioloop
from tornado.web import StaticFileHandler, Application as TornadoApplication
import datetime
import paho.mqtt.client as mqtt
from os.path import dirname, join as join_path
import json
import math
import requests
import rest_api as raw
from threading import Timer, Thread
import time
cl... |
main.py | from controller.controller import Controller
from move_robot.move_robot import MoveRobot
from safety.safety import Safety
from real_camera_interface import RealCamera
import threading
UR_IP = "192.168.1.148"
if __name__ == "__main__":
move_robot = MoveRobot(UR_IP)
camera_interface = RealCamera()
controlle... |
server.py | #!/usr/bin/env python3
import socket
from threading import Thread
from threading import Lock
import argparse
def sendall(msg, pref, dst = "ALL"):
with clients_lock:
for client in clients:
if dst == "ALL" or dst == clients[client]:
try:
client.send(bytes(p... |
file_server.py | # Copyright 2015 Samsung Electronics 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 agree... |
test_video.py | from depthai_demo import DepthAI
import threading
import time
import sys
if __name__ == "__main__":
dai = DepthAI()
passed = 1 # 1 is failed, 0 is passed
thread = threading.Thread(target=dai.startLoop)
thread.start()
dataLen = 0
nnetLen = 0
i=0
while i<8:
time.sleep(1)
... |
server.py | # 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-2.0
#
# Unless required by applicable law or a... |
launcher.py | import logging
import os
import signal
import subprocess
import threading
import shlex
from esrally import config, time, exceptions, client
from esrally.mechanic import telemetry, cluster
from esrally.utils import console, process, jvm
logger = logging.getLogger("rally.launcher")
def wait_for_rest_layer(es, max_att... |
test_loop.py | import asyncio
import platform
import threading
from typing import Any
import pytest
from aiohttp import web
from aiohttp.helpers import PY_38
from aiohttp.test_utils import AioHTTPTestCase, loop_context
@pytest.mark.skipif(
platform.system() == "Windows", reason="the test is not valid for Windows"
)
async def ... |
collect_3.py |
import threading
import urllib2
import time, json
import requests
import os.path
#"284330,150810,09,1109,52,071040,17,28432,7406"
countrylist = ["brazil","canada","china","france","japan","india","mexico","russia","uk","us"]
yrs = ["2011","2012","2013","2014","2015"]
dataTable ={"284330":"Gold","150810":"crude","09... |
cli.py | #!/usr/bin/env python3
import os
import sys
import yaml
import logging
from threading import Thread
from toposort import toposort_flatten, CircularDependencyError
from marathon.cli_parser import init_cli_parser
from marathon.utils import get_marathon_config, init_marathon_config, interpolate_var
from marathon.utils ... |
auth.py | from workflow import PasswordNotFound
import json
import logging
import requests
# from urllib import parse # this is a Py3 function
from urllib import quote_plus
from urlparse import urlparse, parse_qs
from mstodo import config
from mstodo.util import relaunch_alfred, workflow
log = logging.getLogger('mstodo')
def ... |
hambonemilker-LinuxMac.py |
import time
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.chrome.options import Options
import getpass
import multiprocessing
import random
from webdriverdownloader import ChromeDriverDownloader
import... |
test_flight.py | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... |
main.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from crawl import kuaidaili
from utils import host
from multiprocessing import Process
from time import sleep
def init():
f = open("ip.txt", "w")
for page_index in range(1, 20):
kuaidali_instance = kuaidaili.spider(page_index)
http_proxies = kuaid... |
testque.py | from multiprocessing import Process, Queue
from collections import defaultdict
def f(q):
q.put(1.0)
x = defaultdict(list)
x['a'].append(10)
x['b'].append((5.0, 'mb2', 0, 4))
q.put(x)
if __name__ == '__main__':
q = Queue()
ps = [Process(target=f, args=(q,)) for _ in range(10)]
for p in ... |
things3_app.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""KanbanView (app) for Things 3."""
from __future__ import print_function
import sys
import signal
from os import system
from threading import Thread
import webview # type: ignore
import objc # type: ignore # pylint: disable=unused-import # noqa F401
import things3.t... |
request_connector.py | # Copyright 2021. ThingsBoard
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... |
raft.py | import json
import logging
import os
import threading
import time
from pysyncobj import SyncObj, SyncObjConf, replicated, FAIL_REASON
from pysyncobj.dns_resolver import globalDnsResolver
from pysyncobj.node import TCPNode
from pysyncobj.transport import TCPTransport, CONNECTION_STATE
from pysyncobj.utility import TcpU... |
ssd_model.py | # coding=utf-8
# Copyright 2019 The Google Research 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 applicab... |
comm.py | """
N64 Converter
comm.py
Copyright 2020 Riley Lannon
A file for interfacing between the Arduino and pyserial.
This will take the signals generated by the arduino (sent over serial) and convert them into mouse movements and keystrokes.
"""
# libraries
import serial
import serial.tools.list_ports
import sys
import g... |
test_http.py | # -*- encoding: utf-8 -*-
import collections
import email.parser
import platform
import socket
import threading
import time
import pytest
from ddtrace.vendor import six
from ddtrace.vendor.six.moves import BaseHTTPServer
from ddtrace.vendor.six.moves import http_client
import ddtrace
from ddtrace.profile.exporter im... |
progressBar.py | from threading import Thread
from tkinter import *
from tkinter import ttk , messagebox
root = Tk()
probar = ttk.Progressbar(root , orient=HORIZONTAL , length=200)
probar.pack(pady=20)
probar.config(mode='indeterminate')
probar.start()
probar.stop()
probar.config(mode='determinate' , maximum=50 ,value=10)
# probar.st... |
test_runtime_captures_signals.py | import multiprocessing
import os
import time
import pytest
import signal
import zmq
from jina.clients.request import request_generator
from jina.parsers import set_gateway_parser, set_pea_parser
from jina import Executor, DocumentArray, Document, requests
from cli.api import gateway, executor_native
from jina.peapo... |
views_api.py | from webinterface import webinterface
from flask import render_template, send_file, redirect, request, url_for, jsonify
from werkzeug.utils import safe_join
from lib.functions import find_between, theaterChase, theaterChaseRainbow, sound_of_da_police, scanner, breathing, \
rainbow, rainbowCycle, fastColorWipe, play... |
TwitchLinkBiscuitEngine.py | import threading
import subprocess
from Services.Twitch.TwitchPlaybackAccessTokens import *
class TwitchDownloaderNetworkError(Exception):
def __str__(self):
return "\nNetwork Error"
class TwitchDownloader:
FILE_READER = re.compile("#EXTINF:(\d*\.?\d*),")
FILE_PROGRESS = re.compile("\[.* @ .*\] ... |
server.py | import socket
import threading
import random
import weakref
import time
from threading import *
import tkinter as tk
from tkinter import ttk
from tkinter import *
StartServer = True
servername = ""
print_lock = threading.Lock()
Players = {}
players_database = {
}
lobby_gui = ""
endserver = False
total_players = 0
serv... |
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... |
output_devices.py | from __future__ import (
unicode_literals,
print_function,
absolute_import,
division,
)
from threading import Lock
from itertools import repeat, cycle, chain
from colorzero import Color, Red, Green, Blue
from collections import OrderedDict
from .exc import OutputDeviceBadValue, GPIOPinMissing
from .de... |
send.py | #!/usr/bin/env python3
"""
@summary: submit many contract.set(arg) transactions to the example contract
@version: v52 (22/January/2019)
@since: 17/April/2018
@author: https://github.com/drandreaskrueger
@see: https://github.com/drandreaskrueger/chainhammer for updates
"""
# extend sys.path for imports:
if __na... |
geditdown.py | import threading
import lib.common
import lib.urlentity
MODULE_NAME = 'geditdown'
def init():
pass
def __download(url_obj, suffix):
new_url = url_obj.get_url() + suffix
new_url_obj = lib.urlentity.URLEntity(new_url)
new_url_obj.make_get_request()
if new_url_obj.get_response() is not None:
... |
mario.py | import tensorflow as tf
import cv2
import multiprocessing as _mp
from src.utils import load_graph, mario, detect_hands, predict
from src.config import ORANGE, RED, GREEN
tf.flags.DEFINE_integer("width", 640, "Screen width")
tf.flags.DEFINE_integer("height", 480, "Screen height")
tf.flags.DEFINE_float("threshold", 0.6,... |
NehushtanMPQueue.py | import signal
import time
from multiprocessing.context import Process
from typing import List
from nehushtan.helper.SignalHandler import SignalHandler
from nehushtan.logger.NehushtanFileLogger import NehushtanFileLogger
from nehushtan.logger.NehushtanLogging import NehushtanLogging
from nehushtan.multiprocessing.Nehus... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.