source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
start.py | #!/usr/bin/env python3
from concurrent.futures import ThreadPoolExecutor, as_completed
from contextlib import suppress
from itertools import cycle
from json import load
from logging import basicConfig, getLogger, shutdown
from math import log2, trunc
from multiprocessing import RawValue
from os import urandom as randb... |
tornado.py | import asyncio
import fnmatch
import json
import logging
import os
import threading
import webbrowser
from functools import partial
from urllib.parse import urlparse
import tornado
import tornado.httpserver
import tornado.ioloop
from tornado.web import StaticFileHandler
from tornado.websocket import WebSocketHandler
... |
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, SuspiciousOperation
from dj... |
logviewplus.py | import sublime, sublime_plugin
import threading
import unicodedata
class StatusAnimation:
animation = [ "... ", " ... ", " ...", " ... "]
animationPos = 0
stopFlag = False
view = None
key = None
updateLock = threading.RLock()
def updateAnimation(self):
if (self.stopFlag):
self.view = None
self.key =... |
sanitylib.py | #!/usr/bin/env python3
# vim: set syntax=python ts=4 :
#
# Copyright (c) 2018 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import os
import contextlib
import string
import mmap
import sys
import re
import subprocess
import select
import shutil
import shlex
import signal
import threading
import concurrent.fu... |
main_window.py | #!/usr/bin/env python
#
# Electrum - lightweight Bitcoin client
# Copyright (C) 2012 thomasv@gitorious
#
# 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 witho... |
subcmd.py | #!/usr/bin/env python2
import logging
import multiprocessing as mp
import multiprocessing.queues
import xml.dom.minidom
from arch_temp_data import ArchTempData
from datetime import datetime, timedelta
from host_conn import HostConn
from kairoslib.kairos_aptr import AppKairosAPTR
from mongodbcluster import MongoDBClus... |
pika_publisher_test.py | import time
import threading
import sys
sys.path.append("../")
from IoTPy.core.stream import Stream, run
from IoTPy.concurrency.PikaPublisher import PikaPublisher
# multicore imports
from IoTPy.concurrency.multicore import get_processes_and_procs
from IoTPy.concurrency.multicore import terminate_stream
from IoTPy.conc... |
main.py | from pystyle import Anime, Center, Colorate, Colors
from pynput.mouse import Button, Controller
import threading, time, pymem, random
class Offset:
def __init__(self):
self.dwEntityList = 0x4DBF75C
self.dwLocalPlayer = 0xDA544C
self.m_iCrosshairId = 0x11838
self.m_iTeamNum ... |
tool.py |
import ast
from configparser import ConfigParser, SafeConfigParser
import csv
import datetime
import json
import multiprocessing
import os
import shutil
import subprocess
import sys
import time
from shutil import copyfile
import re
import ntpath
import spats_shape_seq
from spats_shape_seq import Spats
from spats_shap... |
fakeeslserver.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import socket
import threading
import time
class FakeESLServer(object):
def __init__(self, address, port, password):
self._address = address
self._port = port
self._password = password
self._client_socket = None
self._running = ... |
inject.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# lib/eapeak/inject.py
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list o... |
feature_shutdown.py | #!/usr/bin/env python3
# Copyright (c) 2018-2020 The Zenacoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test zenacoind shutdown."""
from test_framework.test_framework import ZenacoinTestFramework
from test... |
examplegui.py | #!/usr/bin/env python
#Note check this out: http://johnroach.info/2011/03/02/image-capturing-from-webcam-using-opencv-and-pygame-in-python/
from __future__ import print_function
import pygtk, math, array, numpy as np
pygtk.require('2.0')
import gtk, gobject, cv, cairo, opencv, multiprocessing, time, Queue
from PIL imp... |
schedule.py | import time
import json
from multiprocessing import Process
import asyncio
import aiohttp
try:
from aiohttp.errors import ProxyConnectionError
except:
from aiohttp import ClientProxyConnectionError as ProxyConnectionError
from proxypool.db import RedisClient
from proxypool.error import ResourceDepletionError
fr... |
test_pyfftw_interfaces_cache.py | #
# Copyright 2017 Knowledge Economy Developments Ltd
#
# Henry Gomersall
# heng@kedevelopments.co.uk
#
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must re... |
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 tornado.options import options
from webssh.utils import (
is_valid_ip_address, is_valid_port, is_valid_hostname, to_bytes, to_s... |
writer.py | import os
import time
from threading import Thread
from queue import Queue
import cv2
import numpy as np
import torch
import torch.multiprocessing as mp
from alphapose.utils.transforms import get_func_heatmap_to_coord
from alphapose.utils.pPose_nms import pose_nms
DEFAULT_VIDEO_SAVE_OPT = {
'savepath': 'examples... |
distribute_coordinator_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... |
core.py | # #!/usr/bin/env python
# -*- coding: utf-8 -*-
# <HTTPretty - HTTP client mock for Python>
# Copyright (C) <2011-2018> Gabriel Falcao <gabriel@nacaolivre.org>
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation
# files (the "Software"), to d... |
test_watchdog_utils_bricks.py | # -*- coding: utf-8 -*-
import threading
from nose.tools import \
assert_equal, \
assert_true
try:
import queue # IGNORE:F0401
except ImportError:
import Queue as queue # IGNORE:F0401
from watchdog.events import DirModifiedEvent, FileModifiedEvent
from watchdog.utils.bricks import OrderedSetQueue
c... |
a_csvimport.py | ############################################################################
# #
# Copyright (c) 2019 Carl Drougge #
# #
# Licensed u... |
downloader.py | #!/usr/bin/env python2
import sys
import urllib2
import urllib
from bs4 import BeautifulSoup
import traceback
import dao
from threading import Thread
def download(vUrl, out):
# uses savido to download video
url = "http://www.savido.net/download?url=" + vUrl
doc = urllib2.urlopen(url).read()
soup = B... |
app.py | #!/usr/bin/python
import RPi.GPIO as GPIO
from serial import Serial
import time
import threading
import os
import sys
# BUTTON
BUTTON_GPIO_PIN = 4
SHORT_PRESS_TICKS = 5
LONG_PRESS_TICKS = 200
TICK_TIME = 0.01
DOWN = 0
# LED
LED_GPIO_PIN = 18
SLOW_FLASH_TIMES = [1,1]
FAST_FLASH_TIMES = [0.2,0.2]
# Global Navigation ... |
botkit_with_auto-refreshed-ngrok.py | #!/usr/bin/env python
"""This is part of the MEA-Calendar Webex-Teams bot functionality.
It overcomes the limitation of the ngrok free account limitation of tunnel expiration every 8 hours,
by automatically stopping the current ngrok and botkit every 7.5 hours and then recreating a new ngrok
session, getting the ne... |
_config.py | """
Copyright (C) 2021 Intel Corporation
SPDX-License-Identifier: BSD-3-Clause
"""
from envparse import Env
from zmq_integration_lib import InputPortWithEvents, get_outpad
from threading import Thread, RLock
class LoginSessionWatcher(object):
_session_valid = None
_session_id = None
_lock = None
d... |
__init__.py | #! /usr/bin/env python
"""pykef is the library for interfacing with kef speakers"""
import datetime
import logging
import select
import socket
from enum import Enum
from threading import Semaphore, Thread
from time import sleep, time
_LOGGER = logging.getLogger(__name__)
_VOL_STEP = 0.05 # 5 percent
_RESPONSE_OK = 1... |
color pattern with threading.py | import time
import random
from multiprocessing import pool
from playsound import playsound
from threading import Thread
i = -1
l = 0
count = 0
class loops:
def loop(self):
print(" ", end="")
def A(self):
global i
global l
global i
for j in range(i, 5):
... |
fastapi.py | import json
import logging
import sys
import time
import uuid
from threading import Event, Thread
from typing import Any, Dict, Optional, Tuple, Type, Union, cast
from fastapi import APIRouter, FastAPI, Request, WebSocket
from fastapi.middleware.cors import CORSMiddleware
from fastapi.responses import RedirectResponse... |
settings.py | import sys
from network import getSocket, serialNumber
from signal import pause
from time import sleep
from threading import Thread
#
# NOTE: it is intentional that we only have one zone per arbiter
# While it is possible to have the arbiter control multiple
# emitters, which indeed it will for some situatio... |
n_tonos.py | import jams
from pathlib import Path
import matplotlib.pyplot as plt
import itertools
import numpy as np
import configparser
import os, sys
import argparse
from GuitarTrain import GuitarSetTrainWrapper
import threading
BASE_PATH = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
cur_path = Path(BASE_PATH + ... |
camera_message_framework.py | import struct
import threading
import time
import numpy as np
from collections import namedtuple, OrderedDict
from ctypes import POINTER, c_ubyte, c_uint32, c_uint64, c_char_p, c_voidp, c_ssize_t, c_bool, c_int32, addressof, Structure, create_string_buffer
from functools import reduce
import operator
from auv_python... |
google_voice.py | #!/usr/bin/env python
# google voice client, start listen voice input by google assistant and publish text to ros node
# Copyright (C) 2018 Elemtary Robotics Inc.
from __future__ import print_function
import argparse
import os.path
import json
import google.auth.transport.requests
import google.oauth2.credentials
f... |
client.py | # Created by MysteryBlokHed on 21/02/2020.
import socket
from datetime import datetime
from math import ceil
from threading import Thread
from time import sleep
from .encryption import *
from .exceptions import *
from .status import *
HEADERSIZE = 16
class Client(object):
"""
`port: int` - The port that the ... |
bot.py | # -*- coding: utf-8 -*-
from linepy import *
####################################################
from liff.ttypes import *
####################################################
from akad.ttypes import *
####################################################
from datetime import datetime, timedelta
###############... |
market_data.py | from algoplex.api.common.market_data import MarketData
import threading
import time
import requests
import json
class MarketData(MarketData):
api_url = 'https://coincheck.com/api/ticker'
def __init__(self, poll_period_sec):
self.poll_period_sec = poll_period_sec
self.subscribers = []
... |
count people with magnetic sensor - local MQTT publish.py | # Import standard python modules
import time
import sys
import threading
import datetime
# Import Raspberry Hardware
import board
import busio
# Import ADS1115 module
import adafruit_ads1x15.ads1115 as ADS
from adafruit_ads1x15.analog_in import AnalogIn
# Import RPi.GPIO Module
import RPi.GPIO as GPIO
# Import paho... |
individual_coverage.py | import io
import contextlib
import os
import sys
import glob
import multiprocessing
import configparser
import itertools
import pytest
def run_tests(src, test, fail):
stderr = io.StringIO()
stdout = io.StringIO()
with contextlib.redirect_stderr(stderr):
with contextlib.redirect_stdout(stdout):
... |
pingChat.py | #!/usr/bin/python
import time
import socket
import struct
import sys
import array
import threading
listeningIP = "149.161.253.97"
seqNumber = 0 # Sequence Number is Incremented every time a ping is sent...
ICMP_ECHOREPLY = 0 # Echo reply (per RFC792)
ICMP_ECHO = 8 # Echo request (per RFC792)
ICMP_MAX_RECV = 2048... |
MotifFinderHomerServer.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import datetime
import json
import os
import random as _random
import sys
import traceback
from getopt import getopt, GetoptError
from multiprocessing import Process
from os import environ
from wsgiref.simple_server import make_server
import requests as _requests
from json... |
basic_gpu_test.py | # Copyright 2016 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... |
shadow.py | # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0.
import argparse
from awscrt import auth, io, mqtt, http
from awsiot import iotshadow
from awsiot import mqtt_connection_builder
from concurrent.futures import Future
import sys
import threading
import traceback
... |
_test_multiprocessing.py | #
# Unit tests for the multiprocessing package
#
import unittest
import unittest.mock
import queue as pyqueue
import time
import io
import itertools
import sys
import os
import gc
import errno
import signal
import array
import socket
import random
import logging
import subprocess
import struct
import operator
import p... |
axr.py | #!/usr/bin/env python3
import sys
import time
import struct
import threading
import subprocess as sp
def eprint(*a, **ka):
ka["file"] = sys.stderr
print(*a, **ka)
class A(object):
def __init__(self, nch, profile):
self.nch = nch
self.profile = profile
self.dec = []
self.... |
tasks.py | import math
import pytz
import logging
from datetime import datetime, timedelta
from celery.task import task
from time import sleep
from redis_cache.cache import RedisCache
from corehq.apps.sms.mixin import SMSLoadBalancingMixin
from corehq.apps.sms.models import SMSLog, OUTGOING, INCOMING
from corehq.apps.sms.api impo... |
handler.py | # Copyright (C) 2015-2021 Swift Navigation Inc.
# Contact: https://support.swiftnav.com
#
# This source is subject to the license found in the file 'LICENSE' which must
# be be distributed together with this source. All other rights reserved.
#
# THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIN... |
atminterface.py | #!/usr/bin/env python
import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk, GObject, Gdk, GLib
from thread import *
import time
import socket
import subprocess
import threading
from imutils import face_utils
import numpy as np
import argparse
import imutils
import dlib
import cv2
from sympy import ... |
process_attr.py | """
进程模块使用,基础示例
"""
# 不能选带横线的
from multiprocessing import Process
from time import sleep
a = 1
# 进程执行函数
def fun():
print("开始运行第一个进程")
print(p.is_alive())
sleep(2)
print("第一个进程结束")
# print(p.is_alive())
# 实例化进程对象
p = Process(target=fun, name="Aid",daemon=True)
p.start()
print("第二个进程开始运行")
sleep... |
imgaug.py | from __future__ import print_function, division, absolute_import
import random
import numpy as np
import copy
import numbers
import cv2
import math
from scipy import misc, ndimage
import multiprocessing
import threading
import sys
import six
import six.moves as sm
import os
from skimage import draw
if sys.version_info... |
utils.py | import threading
import numpy as np
import jesse.helpers as jh
from jesse.models.Candle import Candle
from jesse.models.CompletedTrade import CompletedTrade
from jesse.models.DailyBalance import DailyBalance
from jesse.models.Order import Order
from jesse.models.Orderbook import Orderbook
from jesse.models.Ticker imp... |
53moo.py | # -*- coding: utf-8 -*-
'''
© 2018SelfBot ProtectV3.5
'''
from important import *
# Setup Argparse
parser = argparse.ArgumentParser(description='© 2018SelfBot ProtectV3.5')
parser.add_argument('-t', '--token', type=str, metavar='', required=False, help='Token | Example : Exxxx')
parser.add_argument('-e', '--email', typ... |
threadecho.py | # A simple echo server with threads
from socket import *
from threading import Thread
def echo_server(addr):
sock = socket(AF_INET, SOCK_STREAM)
sock.setsockopt(SOL_SOCKET, SO_REUSEADDR,1)
sock.bind(addr)
sock.listen(5)
while True:
client, addr = sock.accept()
Thread(target=echo_ha... |
util_image_label.py | """
Taken and Customized from:
https://github.com/KushalBKusram/WaymoDataToolkit
"""
import os
import cv2
import threading
import sys
import shutil
import tensorflow.compat.v1 as tf
tf.enable_eager_execution()
from google.protobuf.json_format import MessageToDict
from waymo_open_dataset import dataset_pb2... |
test_policies.py | # Copyright 2013-2014 DataStax, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... |
stub.py | #!/usr/bin/env python
# coding: utf-8
# Copyright (c) 2002-2019 "Neo Technology,"
# Network Engine for Objects in Lund AB [http://neotechnology.com]
#
# This file is part of Neo4j.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# Y... |
loggerbythread.py | # -*- coding: utf-8 -*-
import logging
import logging.handlers
import sys
import threading
import os
__author__ = 'Ares Ou (aresowj@gmail.com)'
# public logging levels
LOG_LEVEL_NOTSET = logging.NOTSET
LOG_LEVEL_DEBUG = logging.DEBUG
LOG_LEVEL_INFO = logging.INFO
LOG_LEVEL_WARNING = logging.WARNING
LOG_LEVEL_ERROR =... |
test_dag_serialization.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... |
adaptive_manfold_learning_knn.py | import os
import sys
import numpy as np
import scipy
import scipy.sparse as sp
import matplotlib.pyplot as plt
from sklearn.neighbors import NearestNeighbors
from sklearn.decomposition import PCA
import multiprocessing
from multiprocessing.dummy import Pool as ThreadPool
# from multiprocessing import Pool as ThreadPool... |
test_decimal.py | # Copyright (c) 2004 Python Software Foundation.
# All rights reserved.
# Written by Eric Price <eprice at tjhsst.edu>
# and Facundo Batista <facundo at taniquetil.com.ar>
# and Raymond Hettinger <python at rcn.com>
# and Aahz (aahz at pobox.com)
# and Tim Peters
"""
These are the test cases for the Decim... |
tests.py | from __future__ import unicode_literals
import threading
import warnings
from datetime import datetime, timedelta
from django.core.exceptions import MultipleObjectsReturned, ObjectDoesNotExist
from django.db import DEFAULT_DB_ALIAS, DatabaseError, connections
from django.db.models.fields import Field
from django.db.m... |
acq400_base.py | #
# Copyright (c) 2017, Massachusetts Institute of Technology All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# Redistributions of source code must retain the above copyright notice, this
# list o... |
download_funcs.py | from threading import Thread
import urllib.request
import os
import tkinter as tk
from tkinter import messagebox
def get_content(path_var, url_entry_var):
url = url_entry_var.get()
path = path_var.get()
sep = "\\" if os.name == "nt" else "/"
error = "URL is in wrong format!"
file_n... |
functions.py | try:
import sys
import os,ffmpeg
from PIL import Image
from PIL import ImageEnhance
from time import sleep
from pydub import AudioSegment
import math
import numpy
from threading import Thread
import cv2
except ImportError:
print ("Error: missing one of the libraries (numpy... |
preventfreeze.py | """
Reference:
Why your GUI app freezes
http://stupidpythonideas.blogspot.com/2013/10/why-your-gui-app-freezes.html
"""
import tkinter as tk
import time
"""
Imagine a simple Tkapp.
(Everything is pretty much the same for most other GUI frameworks, and many frameworks for games and network servers,
and even things like... |
bm_dulwich_log.py | """
Iterate on commits of the asyncio Git repository using the Dulwich module.
"""
import os
from mpkmemalloc import *
import os
import gc
import threading
import psutil
import pyperf
import dulwich.repo
def iter_all_commits(repo):
# iterate on all changes on the Git repository
for entry in repo.get_walker... |
runtests.py | #!/usr/bin/env python
from __future__ import print_function
import atexit
import os
import sys
import re
import gc
import heapq
import locale
import shutil
import time
import unittest
import doctest
import operator
import subprocess
import tempfile
import traceback
import warnings
import zlib
import glob
from context... |
server.py | import argparse
import json
import os
import urlparse
import multiprocessing
import glob
import warnings
import logging
import signal
from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer
from rasa_nlu.train import do_train
from rasa_nlu.config import RasaNLUConfig
class RasaNLUServer(object):
def __init_... |
surface_stats_collector.py | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import Queue
import datetime
import logging
import re
import threading
from pylib import android_commands
from pylib.device import device_utils
# Log marke... |
testStereoPointCloud.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
import cv2
import numpy as np
import os
import Queue
import sys
import threading
from LidarTransforms import *
from VideoReader import VideoReader
from VtkRenderer import *
from GPSReader import *
from GPSTransforms import *
from ArgParser import *
from StereoCompute import ... |
main.py | import argparse
import multiprocessing as mp
import sys
import yaml
from kivy import Config
from shared import SettingLoader
class Settings:
def __init__(self):
# Player mode, either 'human' or 'ai_rl'
self.player_type = None
# Frame rate of the game in seconds per frame
self.fra... |
main.py | from PySide6.QtGui import QGuiApplication
from PySide6.QtCore import QStringListModel, Qt, QUrl
from PySide6.QtQuick import QQuickView
from PySide6.QtQml import QQmlApplicationEngine
import sys
import os
import canvas_grab
import threading
from .sync_model import SyncModel
from colorama import init
from termcolor impor... |
train.py | import os
import queue
import threading
import time
from collections import defaultdict
import numpy as np
import parl
import retro
from parl.utils import logger, summary, machine_info, get_gpu_count
from parl.utils.time_stat import TimeStat
from parl.utils.window_stat import WindowStat
import retro_util
from actor i... |
run_cluster.py | #!/usr/bin/bin python3
import os
import logging
import asyncio
import random
import raftos
import raftos.serializers
from argparse import ArgumentParser
from datetime import datetime
from multiprocessing import Process
from js9 import j
logging.basicConfig(level=logging.INFO)
log = logging.getLogger()
CURRENT_DIR = ... |
email.py | from threading import Thread
from flask import current_app
from flask_mail import Message
from app import mail
def send_async_email(app, msg):
with app.app_context():
mail.send(msg)
# ----------------------------------------- Helper FN that sends an email -------------------------------------------
# ... |
OpenCV3D.py | #<!--------------------------------------------------------------------------->
#<!-- ITU - IT University of Copenhagen -->
#<!-- SSS - Software and Systems Section -->
#<!-- File : OpenCV3D.py -... |
test_filters.py | ''' Some tests for filters '''
from __future__ import division, print_function, absolute_import
import sys
import numpy as np
from numpy.testing import (assert_equal, assert_allclose,
assert_array_equal, assert_almost_equal)
from pytest import raises as assert_raises
import scipy.ndimage a... |
git_integration.py | __all__ = ['RemoteProgress', 'GitRemoteProgress', 'DesignerGit']
from uix.action_items import DesignerActionSubMenu, DesignerSubActionButton
from components.designer_content import DesignerCloseableTab
from uix.settings import SettingListContent
from uix.py_code_input import PyScrollView
from uix.input_dialog import I... |
locks_doesnot_lock_any_thing.py |
"""
A primitive lock is in one of two states, "locked" or "unlocked". It is created in the
unlocked state. It has two basic methods, acquire() and release(). When the state is unlocked,
acquire() changes the state to locked and returns immediately. When the state is locked, acquire()
blocks until a call to release(... |
gcp_janitor.py | #!/usr/bin/env python
# Copyright 2016 The Kubernetes 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 appli... |
foo.py | # Python 3.3.3 and 2.7.6
# python fo.py
from threading import Thread
# Potentially useful thing:
# In Python you "import" a global variable, instead of "export"ing it when you declare it
# (This is probably an effort to make you feel bad about typing the word "global")
i = 0
def incrementingFunction():
glob... |
task.py | import asyncio
import re
import traceback
from abc import ABC, abstractmethod
from multiprocessing import Process
from re import Pattern
from typing import List, Optional, Dict, Set, Tuple, Type, Awaitable
from guapow.common import system
from guapow.common.scripts import RunScripts
from guapow.common.users import is_... |
relaykeys-qt.py | # -*- coding: utf-8 -*-
import os
from time import sleep, time
from sys import exit, argv
import sys
# util modules
import logging
import argparse
from configparser import ConfigParser
import traceback
from relaykeysclient import RelayKeysClient
import pyWinhook as PyHook3
from PyQt5.QtCore import pyqtSignal, Qt, p... |
osa_online_drain.py | #!/usr/bin/python
"""
(C) Copyright 2020-2021 Intel Corporation.
SPDX-License-Identifier: BSD-2-Clause-Patent
"""
import time
import random
import threading
from test_utils_pool import TestPool
from write_host_file import write_host_file
from osa_utils import OSAUtils
from daos_utils import DaosCommand
from apric... |
flight.py | from __future__ import annotations
from datetime import datetime, timedelta
import time
from threading import Thread
from typing import Any, Dict, Optional, TYPE_CHECKING
import pytz
import requests
from .general import make_request
if TYPE_CHECKING:
from account import Account
CHECKIN_URL = "mobile-air-operatio... |
mission_basic.py | from __future__ import print_function
from dronekit import connect, VehicleMode, LocationGlobalRelative, LocationGlobal, Command
import time
import math
from pymavlink import mavutil
import urllib
import re
from bs4 import BeautifulSoup
import threading
#Set up option parsing to get connection string
import argparse... |
test_netbeans.py | #!/usr/bin/python
#
# Server that will communicate with Vim through the netbeans interface.
# Used by test_netbeans.vim.
#
# This requires Python 2.6 or later.
from __future__ import print_function
import socket
import sys
import time
import threading
try:
# Python 3
import socketserver
except ImportError:
... |
portscanner.py | # This script runs on Python 3
import socket, threading
import sys
import logging
def TCP_connect(ip, port_number, delay, output):
TCPsock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
TCPsock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
TCPsock.settimeout(delay)
try:
TCP... |
jobs.py | #!/usr/bin/env python3
#
# MIT License
#
# Copyright (c) 2020-2021 EntySec
#
# 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... |
th.py | import threading as thread
import time
def TheTh(args=(), kwargs={}):
print('TheTh: hi')
print('TheTh:', repr(thread.currentThread().getName()))
time.sleep(3.0)
print('TheTh: bye')
def do():
theTh = thread.Thread(target=TheTh, name='TheTh', kwargs={})
print('do:', repr(theTh.getName()))
theTh.start()
... |
gdal2tiles-multiprocess.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
# ******************************************************************************
# $Id: gdal2tiles.py 27349 2014-05-16 18:58:51Z rouault $
#
# Project: Google Summer of Code 2007, 2008 (http://code.google.com/soc/)
# Support: BRGM (http://www.brgm.fr)
# Purpose: Convert a ... |
test_protocol.py | ##
# .test.test_protocol
##
import sys
import unittest
import struct
import decimal
import socket
import time
from threading import Thread
from ..protocol import element3 as e3
from ..protocol import xact3 as x3
from ..protocol import client3 as c3
from ..protocol import buffer as pq_buf
from ..python.socket import fi... |
__init__.py | from __future__ import annotations
import collections
from datetime import datetime
from decimal import Decimal
from functools import wraps
import operator
import os
import re
import string
from typing import (
TYPE_CHECKING,
Callable,
ContextManager,
Counter,
Iterable,
)
import warnings
import nu... |
main.py | #!/usr/bin/env python3
# vim: sts=4 sw=4 et
import argparse
import logging, logging.config
import signal
import sys
import threading
import tll.logger
from tll.config import Config, Url
from tll.channel import Context
from tll.processor import *
parser = argparse.ArgumentParser(description="Run TLL processor")
pars... |
forcecore.py | #! /usr/bin/env python
import os
import threading
import select
import socket
class ds_forkcore(object):
#init function
def __init__(self,worker,port=3333):
s=socket.socket(socket.AF_INET,socket.SOCK_STREAM)
s.setsockopt(socket.SOL_SOCKET,socket.SO_REUSEADDR,1)
s.bind(("",port))
s.... |
test_util.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... |
pivideostream.py | from picamera.array import PiRGBArray
from picamera import PiCamera
from threading import Thread
class PiVideoStream:
def __init__(self, resolution=(320, 240), framerate=32, **kwargs):
# initialize the camera
self.camera = PiCamera()
# set camera parameters
self.camera.resolution ... |
test_rest_v2_0_0.py | import json
import subprocess
import sys
import time
import unittest
from multiprocessing import Process
import requests
from dateutil.parser import parse
from test.apiv2.rest_api import Podman
PODMAN_URL = "http://localhost:8080"
def _url(path):
return PODMAN_URL + "/v2.0.0/libpod" + path
def ctnr(path):
... |
common.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... |
test_insert.py | import pytest
from pymilvus import DataType, ParamError, BaseException
from utils.utils import *
from common.constants import *
from common.common_type import CaseLabel
ADD_TIMEOUT = 60
uid = "test_insert"
field_name = default_float_vec_field_name
binary_field_name = default_binary_vec_field_name
default_single_query ... |
map_reduce.py | r"""
Parallel computations using RecursivelyEnumeratedSet and Map-Reduce
There is an efficient way to distribute computations on a set
`S` of objects defined by :func:`RecursivelyEnumeratedSet`
(see :mod:`sage.sets.recursively_enumerated_set` for more details)
over which one would like to perform the following kind of... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.