source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
woofchangewall.py | #!/bin/python3
import gi
import os
import json
import threading
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk, GdkPixbuf
if os.getenv("WALLPAPER_FOLDER") == None:
os.environ["WALLPAPER_FOLDER"] = "~/Pictures/wallpapers"
wallpaper_location = os.getenv("WALLPAPER_FOLDER")
else:
wallpaper_l... |
utils.py | # -*- coding: utf-8 -*-
"""
| '_ \ / _` |_____ / __/ _ \| '_ ` _ \| '_ \ / _` | '__/ _ \
| |_) | (_| |_____| (_| (_) | | | | | | |_) | (_| | | | __/
| .__/ \__, | \___\___/|_| |_| |_| .__/ \__,_|_| \___|
|_| |___/ |_|
This is used to compare two databases. Takes two connection strin... |
make_noises.py | import os
import sys
import datetime
import cv2
from multiprocessing import Process, cpu_count
import numpy as np
import matplotlib.pyplot as plt
H_IMG, W_IMG = 100, 100
SAMPLE_SIZE = 70000
SAMPLES_DIR = 'samples'
def make_noise(index):
h = np.random.randint(1, H_IMG)
w = np.random.randint(1, W_IMG)
noi... |
shared_queue.py | # Copyright (c) 2021, NVIDIA CORPORATION & AFFILIATES. 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... |
coordinator_main.py | """A runnable script for running a meadowgrid server"""
import argparse
import logging
import multiprocessing
import asyncio
import contextlib
from typing import Iterator, Optional
import meadowgrid.coordinator
from meadowgrid.agent_creator import AgentCreatorType
from meadowgrid.config import DEFAULT_COORDINATOR_HOST... |
client.py | from constants import CMD_CHAT, CMD_END_CHAT, CMD_LIST_USERS, CMD_POSTBOX, CMD_QUIT, SERVER_NAME, SERVER_PORT
import socket
from message import Message
from datetime import datetime
import pickle
import threading
import sys
HOST = 'localhost' # maquina onde esta o par passivo
current_chat = None
postbox = []
username... |
app.py | # Copyright 2019, Google, Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... |
road_speed_limiter.py |
import json
import threading
import time
import socket
from threading import Thread
from common.params import Params
from common.numpy_fast import interp
current_milli_time = lambda: int(round(time.time() * 1000))
class RoadSpeedLimiter:
def __init__(self):
self.json = None
self.last_updated = 0
self.... |
SVM.py | import DataProcessor as dp
from multiprocessing import Process
# 文件夹路径
data_loc_path = '/Users/zhongwentao/Desktop/毕业设计/训练数据'
file_name = 'kddcup_10_percent'
# file_name = 'debug_used_data'
# 转换数据
# p = Process(target=dp.read_file_to_csv, args=[data_loc_path, '{}.txt'.format(file_name), '{}.csv'.format(file_name)])
... |
run-tests.py | #!/usr/bin/env python
#
# 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 "Li... |
nr1ui.py | #!/usr/bin/python3
# ____ ____ ___ __ ___ __ _ ______ ___
# / __ )/ __ \/ | / / / / | / / / | / / __ < /
# / __ / /_/ / /| |/ / / / |/ / / |/ / /_/ / /
# / /_/ / _, _/ ___ / /_/ / /| / / /| / _, _/ /
# /_____/_/ |_/_/ |_\____/_/ |_/ /_/ |_/_/ |_/_/
# __ __ ... |
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
from sklearn.manifold import TSNE
DATASETS_FOLDER = '../omniglot_resized'
import matplotlib.pyplot as plt
parser = argpar... |
_channel.py | # Copyright 2016 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... |
custom.py | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... |
__init__.py |
###############################################################################
# DO NOT MODIFY THIS FILE #
###############################################################################
import logging
import textwrap
import time
from collections import namedtuple
f... |
tween_machine.py | """
tween_machine.py
"""
# Built-in
import contextlib
import json
import logging
import logging.config
import os
import sys
import tempfile
import webbrowser
from threading import Thread
import xml.etree.cElementTree as etree
# Python 2/3 compatibility
try:
from urllib.request import urlopen
except ImportError:
... |
trademanager.py | import os,sys,time
from basebot import BaseBot
from threading import Thread
class TradeManager(BaseBot):
def __init__(self,market):
BaseBot.__init__(self,market,"TradeManager")
self.botlist = []
self.done = False
def monitor_trades(self,bot):
self.botlist += [bot]
def u... |
input_manager.py | from config.config import REPEAT_DELAY, REPEAT_RATE
import time
import pyautogui
pyautogui.FAILSAFE = False
pyautogui.PAUSE = 0.0
# import pydirectinput
# pydirectinput.FAILSAFE=False
# pydirectinput.PAUSE = 0.0
import threading
# Managers sending inputs to manipulate the keyboard or mouse, or to print out statements ... |
test_util_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... |
combat.py | import math
import string
from datetime import datetime, timedelta
from util.logger import Logger
from util.utils import Region, Utils
from threading import Thread
class CombatModule(object):
def __init__(self, config, stats, retirement_module, enhancement_module):
"""Initializes the Combat module.
... |
conftest.py | # Copyright (c) 2011 Florian Mounier
# Copyright (c) 2011 Anshuman Bhaduri
# Copyright (c) 2014 Sean Vig
# Copyright (c) 2014-2015 Tycho Andersen
#
# 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 Soft... |
server.py | # https://medium.com/python-in-plain-english/build-a-chatroom-app-with-python-458fc435025a
import threading
import socket
import argparse
import os
class Server(threading.Thread):
"""
Supports management of server connections.
Attributes:
connections (list): A list of ServerSocket objects repres... |
3.2-1.py | from multiprocessing import Process
def target(number, arr):
print("Appending {}".format(number))
arr[number] = number
if __name__ == "__main__":
a = []
processes = [Process(target=target, args=(i, a), name="shared-Memory-{}".format(i)) for i in range(10)]
for i in a:
print(i)
for... |
test.py | from multiprocessing import Process
import pytest
import requests
import uvicorn
from fastapi import FastAPI
app = FastAPI()
@app.get("/")
async def read_main():
return {"msg": "Hello World"}
def run_server():
uvicorn.run(app)
@pytest.fixture
def server():
proc = Process(target=run_server, args=(),... |
main.py | from datetime import datetime
from http.server import BaseHTTPRequestHandler
from http.server import HTTPServer
from threading import Event
from threading import Thread
from time import sleep
from analysis import Analysis
from logs import Logs
from trading import Trading
from twitter import Twitter
# Whether to send ... |
main.py | import base64
import os
import pickle
import random
import threading
import time
from collections import deque
from concurrent.futures import ThreadPoolExecutor
from io import BytesIO
from sys import platform as _platform
import cv2 # opencv
import keras
import numpy as np
import pandas as pd
import tensorflow as tf
#... |
repeating_timer.py | import time
from threading import Event, Thread
import logging
logger = logging.getLogger(__name__)
class Repeating_Timer (object):
DEFAULT_INTERVAL_REDUCTION = 0.9
"""Repeat `function` every `interval` seconds."""
def __init__(self, interval):
self.interval = int(interval * self.DEFAULT_INTER... |
server.py | import socket
import threading
# Connection Data
host = '127.0.0.1'
port = 1234
server = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
server.bind((host, port))
server.listen()
clients = []
nicknames = []
def broadcast(message):
for client in clients:
client.send(message)
def handle(client):
wh... |
wifiConnection.py | """
Holds all the data and commands needed to fly a Bebop drone.
Author: Amy McGovern, dramymcgovern@gmail.com
"""
from zeroconf import ServiceBrowser, Zeroconf
import time
import socket
import ipaddress
import json
from utils.colorPrint import color_print
import struct
import threading
from commandsandsensors.DroneS... |
utils.py | from __future__ import unicode_literals
import threading
from .future import Future
from .context import get_context_id, context
__all__ = [
'ThreadWithFuture',
]
class ThreadWithFuture(object):
"""
Wrapper around `Thread`.
:param daemon: If `True`, start as daemon.
"""
def __init__(self, ta... |
UI.py | import time
import threading
import eleonora.utils.config as config
def look(async=False):
config.emitter = 'look'
waitandreset(30, async)
def love(async=False):
config.emitter = 'love'
waitandreset(5, async)
def happy(async=False):
config.emitter = 'happy'
waitandreset(5, async)
def mindful... |
QemuRunner.py | ##
# This plugin runs the QEMU command and monitors for asserts.
# It can also possibly run tests and parse the results
#
# Copyright (c) Microsoft Corporation
# SPDX-License-Identifier: BSD-2-Clause-Patent
##
import logging
import os
import sys
import time
import threading
import datetime
import subproc... |
audio.py | '''
Created on 24.11.2016
@author: simon
'''
from devices import DeviceBase,devices
import pyaudio,threading,time,warnings
from gui.terminator import terminatehooks
SRATES=[44100,48000,64000,88200,96000,144000,192000]
class AudioDevice(DeviceBase):
name="Audio IO"
description="""
Get data from audio inpu... |
window.py | from PyQt5.QtWidgets import QMainWindow, QLabel, QAction, qApp, QMenu, QSystemTrayIcon, QTextBrowser
from PyQt5 import QtMultimedia
from PyQt5.QtCore import Qt, QTimer, QObject, pyqtSignal, QUrl
from PyQt5.QtGui import QMovie, QIcon, QCursor, QFont
import random
from functools import partial
from util.script import ope... |
gui_chat.py | from tkinter import *
import socket
import time
import threading
class Gui(Tk):
def __init__(self):
super().__init__()
self.server_name = socket.gethostname()
self.ip_address = socket.gethostbyname(socket.gethostname())
self.port = 5060
self.format = 'utf-8'
self.c... |
__init__.py | import threading
import uuid
import platform
import hashlib
from socketIO_client import SocketIO
from .models import *
from .channel import *
from .response import TelepatResponse
from .db import TelepatDB
from .transportnotification import *
from telepat import httpmanager
class TelepatError(Exception):
pass
c... |
client.py | import speech_recognition as sr
import base64
from socketIO_client import SocketIO, BaseNamespace
from threading import Thread, ThreadError
import time
socketIO = SocketIO('localhost',5000)
live_namespace = socketIO.define(BaseNamespace, '/live')
def receive_events_thread():
socketIO.wait()
def on_speech_response... |
app.py | # -*- coding: utf-8 -*-
from datetime import datetime
from flask import Flask
from flask import render_template, request
import logging
import telegram
import leancloud
from leancloud import Engine, Query, Object, LeanCloudError
import random
import re
import sys
import urllib2
import json
import threading
reload(sy... |
orchestrator.py | import json
import os
import logging
from os.path import expanduser
from threading import Thread
from time import sleep
from boto.ec2 import connect_to_region
from orchestration.definitions import Pool, InstanceDefinition
# Logging boilerplate.
logger = logging.getLogger('orchestrator')
# Dynamically create the excep... |
execution.py | import contextlib
import faulthandler
import io
import multiprocessing
import os
import platform
import signal
import tempfile
from typing import Optional, Dict
def check_correctness(problem: Dict, completion: str, timeout: float,
completion_id: Optional[int] = None) -> Dict:
"""
Evalua... |
flaskserver.py | import sys
import os
import time
import threading
import socket
import uuid
import configparser
from flask import Flask, Response, request, send_from_directory, render_template, url_for
from server.sct_loop import Sct_loop
from kivy import Logger
from pathlib import Path
path = Path(__file__).parent # test.pyのあるディ... |
planner_non_ros_01092019.py | #!/usr/bin/env python
"""
Subscribe to rostopic od tracked Objects
Pubslish list of waypoints
Uses a Generative RNN and MCTS for path planning in dynamic environments
#todo:
update input and output formats (create ros msg format, rather than using multiarray)
test pipeline
retrain
Last edits:
19/07/19 - Stuart Eiffe... |
run_unittests.py | #!/usr/bin/env python3
# Copyright 2016-2017 The Meson development team
# 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 ... |
iostream.py | # coding: utf-8
"""Wrappers for forwarding stdout/stderr over zmq"""
# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.
from __future__ import print_function
import atexit
from binascii import b2a_hex
from collections import deque
try:
from importlib import lock_h... |
multithread.py | # -*- coding: utf-8 -*-
"""
@brief: Extract judicial acts from `bsr.sudrf.ru` (multithread version)
@file: multithread.py
@author: dmryutov (dmryutov@gmail.com)
@date: 25.04.2017 -- 26.04.2017
"""
import csv
import os
from threading import Thread
import selenium.webdriver as webdriver
import settings
def find_... |
bot.py | # coding=utf-8
# Copyright 2008, Sean B. Palmer, inamidst.com
# Copyright © 2012, Elad Alfassa <elad@fedoraproject.org>
# Copyright 2012-2015, Elsie Powell, http://embolalia.com
#
# Licensed under the Eiffel Forum License 2.
from __future__ import unicode_literals, absolute_import, print_function, division
import col... |
main.py | """
Created on 28/09/2021
Author: Fabio Salinas (fabio.salinas1982@gmail.com)
Version: 1.0
"""
# External Packages
import pandas as pd
from datetime import datetime as dt
import time
from multiprocessing import Process
# Internal packages
from scripts.web_scraping.colsubsidio import colsubsidioScraper, colsubsidioPos... |
main.py | """
Created on Thu Apr 6 01:01:43 2017
@author: abhisheksingh
"""
import time
import struct
import numpy as np
import cv2
import os
from pynput import keyboard
from PIL import ImageGrab,Image
from multiprocessing.pool import ThreadPool
import actionCNN as myNN
import mychrome as chrome
class ScreenCapture(object... |
SDCManager.py | # This file is part of Qualified Caching-as-a-Service.
# BSD 3-Clause License
#
# Copyright (c) 2019, Intelligent-distributed Cloud and Security Laboratory (ICNS Lab.)
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following ... |
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 thread... |
main.py | #!/usr/bin/python3
# -*- coding: utf-8 -*-
# Name: Cody Ngrok Client Service
# Author: Icy(enderman1024@foxmail.com)
# OS: Linux
import time, socket, threading, os, sys, json
def init(): # initializer
global LOGGER, KEY, STOP, NGROK_SERVICE
paths = ("./bin/","./cache/","./configs/","./logs/")
for i in paths:
... |
wit_sindt_resolver.py | #!/usr/bin/env python3
''' emul-gs232.py by ka8ncr '''
''' MIT license '''
import argparse
import serial
import sys
import threading
import time
import yaml
class Wit_SinDT_Resolver:
def __init__(self,config = None, debug = False):
self.config = config
self.x = 0
self.y =... |
utils.py | # -*- coding: utf-8 -*-
# Stdlib imports
import base64
import datetime
import hashlib
import json
import jwt
import logging
import re
import threading
from io import BytesIO
# Imports from your apps
from operator import add
# Third-party app imports
from codicefiscale import codicefiscale
from dateutil import tz
fro... |
runner.py | # Python 2 + 3
# Copyright 2019 Mycroft AI 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 agre... |
sessions.py | import os
import time
from threading import Thread, Lock
from contextlib import contextmanager
import sentry_sdk
from sentry_sdk.envelope import Envelope
from sentry_sdk.session import Session
from sentry_sdk._types import MYPY
from sentry_sdk.utils import format_timestamp
if MYPY:
from typing import Callable
... |
VideoShow.py | from threading import Thread
import cv2
class VideoShow:
"""
Class that continuously shows a frame using a dedicated thread.
"""
def __init__(self, frame=None):
self.frame = frame
self.stopped = False
def start(self):
Thread(target=self.show, args=()).start()
retur... |
installwizard.py |
import os
import sys
import threading
import traceback
from PyQt5.QtCore import *
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *
from electrum import Wallet, WalletStorage
from electrum.util import UserCancelled, InvalidPassword
from electrum.base_wizard import BaseWizard
from electrum.i18n import _
from .... |
schedule_job.py | from src.platform.coldfusion.interfaces import CINTERFACES
from src.platform.coldfusion.authenticate import checkAuth
from src.module.deploy_utils import _serve, waitServe, parse_war_path,killServe
from os.path import abspath
from log import LOG
from threading import Thread
from re import findall
from time import sleep... |
app.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import logging
import subprocess
from collections import namedtuple
from datetime import datetime, timezone
from threading import Thread
from time import sleep
import requests
from flask import Flask, jsonify, request
app = Flask(__name__)
logging.basicConfig()
logger... |
step.py | import socket
import threading
import RPi.GPIO as GPIO
import time
class Conveyor:
def __init__(self):
self.ip = ""
self.port = 8888
self.data = "_".encode()
self.sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
self.sock.bind((self.ip,self.port))
self.out1 =... |
test_remote_account.py | # Copyright 2015 Confluent Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... |
pi_netconnect.py | # coding=utf8
import socket
import netifaces
import threading
import select
import sqlite3
from pprint import pprint
from time import sleep, time
from netaddr import IPNetwork, IPAddress
from lib._logging import logger
from lib.pi_utilities import pi_revision, pi_serialnumber
from lib.database_utils import update_nod... |
widget.py | #!/usr/bin/env python
# -*- 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
i... |
word2vec.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... |
control.py | from __future__ import annotations
from multiprocessing import SimpleQueue as MSimpleQueue
from multiprocessing import Process as MProcess
from multiprocessing import Manager
try:
# queue.SimpleQueue is only available in python >= (3, 7)
from queue import SimpleQueue as TSimpleQueue
USE_T_SIMPLEQUEUE = Tr... |
train_dist.py | import sys
sys.path.append('.')
import os
import tqdm
import torch
import random
import tempfile
import argparse
import numpy as np
import multiprocessing
from torch import optim
from torch.utils.data import DataLoader
from torch.utils.tensorboard import SummaryWriter
from data.aug.compose import Compose
from data.a... |
utils.py | import pyhik.hikvision
import datetime
import logging
import time
from PIL import Image
import io
import threading
import requests
try:
import xml.etree.cElementTree as ET
except ImportError:
import xml.etree.ElementTree as ET
# Make pydispatcher optional to support legacy implentations
# New usage should i... |
mpirun_exec_fn.py | # Copyright 2019 Uber Technologies, Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
12.robot_servo_face.py | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
* @par Copyright (C): 2010-2020, Hunan CLB Tech
* @file robot_sevo_face
* @version V1.0
* @details
* @par History
@author: zhulin
"""
from __future__ import division
import cv2
import time
import numpy as np
import Adafruit_PCA9685... |
feature_shutdown.py | #!/usr/bin/env python3
# Copyright (c) 2018-2019 The Btcavenue Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test btcavenued shutdown."""
from test_framework.test_framework import BtcavenueTestFramework
from t... |
generate_pointcloud_from_depth.py | import os
import sys
import random
import subprocess
import multiprocessing
import time
import argparse
import numpy as np
from tqdm import tqdm
from PIL import Image
from im2mesh.utils.depth_to_pointcloud import DepthToPCNp
from im2mesh.utils.visualize import visualize_pointcloud
MASK_ROOT = '/home2/xieyunwei/occupan... |
source.py | #!/usr/bin/env python
import rospy
from gazebo_msgs.srv import GetModelState
from geometry_msgs.msg import Pose2D
from tf.transformations import euler_from_quaternion
#from threading import Thread
#import time
n = 10 #number of robots need to edit the main function whenever changed
Arr_s =[(1,1)]*n
def source(mod... |
config.py | # Copyright 2015 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 copy
import datetime
import functools
import logging
import os
import sys
import time
import threading
# Not all apps enable endpoints. If the import... |
gsi_rebalance_2i.py | import Queue
from datetime import datetime
from base_2i import BaseSecondaryIndexingTests, log
from membase.api.rest_client import RestConnection, RestHelper
import random
import threading
from lib import testconstants
from lib.couchbase_helper.query_definitions import SQLDefinitionGenerator, QueryDefinition, RANGE_SC... |
client.py | from __future__ import print_function, division
__version__ = '0.0.1'
import datetime as dt
import logging
import os.path
from threading import Thread, RLock
from zeep.client import Client, CachingClient, Settings
from zeep.wsse.username import UsernameToken
import zeep.helpers
from onvif.exceptions import ONVIFError... |
test_find_service.py | from unittest import TestCase
import time
from find_service import find_service
from multiprocessing import Pool, Process
import multiprocessing as mp
import zmq
import cv2
import msgpack
import msgpack_numpy as m
import pandas as pd
import numpy as np
from os import listdir
from line_profiler import LineProfiler
fro... |
darkest_dungeon.py | import os
import subprocess
from collections import Counter
from itertools import chain
from pathlib import Path
from shutil import rmtree
from subprocess import Popen
from threading import Thread
from typing import Iterable, List, Dict
import sys
from matt import AppName
import PySimpleGUI as sg
from pyunpack import A... |
client.py | ##############################################################################
#
# Copyright (c) 2001, 2002 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# TH... |
loader.py | """
The Salt loader is the core to Salt's plugin system, the loader scans
directories for python loadable code and organizes the code into the
plugin interfaces used by Salt.
"""
import contextvars
import copy
import functools
import importlib
import importlib.machinery # pylint: disable=no-name-in-module,import-erro... |
nonblocking.py | # This file isn't used. Keeping it for reference in case I want to re-add the separate process functionality
"""Creates a non-blocking instance of the Pandas GUI in a separate process. Works in both script & interactive mode"""
import multiprocessing
def start_gui(**kwargs):
import sys
from PyQt5 import QtW... |
GUI.py | """
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is ... |
testutil.py | """
Utility functions for testing
"""
import sys, os, shutil, unittest, random, warnings, threading, time, re, glob
import tempfile as tempfile_mod
import atexit
from unittest_extensions import SkipTest
import pathfix
from pygr import logger, classutil
try:
import hashlib
except ImportError:
import md5 as h... |
execute.py |
from scriptcore.process.popen import Popen
from scriptcore.process.thread import Thread
from scriptcore.console.output.output import Output
import subprocess
import time
import types
class Execute(object):
def __init__(self, output=None):
"""
Construct
:param output: The output
... |
wsdump.py | #!/Users/badisamosesane/Desktop/PycharmProjects/PySOSA/venv/bin/python
import argparse
import code
import sys
import threading
import time
import ssl
import six
from six.moves.urllib.parse import urlparse
import websocket
try:
import readline
except ImportError:
pass
def get_encoding():
encoding = get... |
massban.py | # -*- coding: utf-8 -*-
import discord
from discord.ext import commands
import requests
import threading
import time
from colorama import Fore, init
import ctypes
import os
import random
def title(content):
ctypes.windll.kernel32.SetConsoleTitleW(content)
title(f"[MassBan | [Vanis] Bootup")
init(au... |
test_comms.py | import asyncio
import os
import sys
import threading
from functools import partial
import pytest
from tornado import ioloop
from tornado.concurrent import Future
import dask
from distributed.comm import (
CommClosedError,
asyncio_tcp,
connect,
get_address_host,
get_local_address_for,
inproc,
... |
server.py | import json
from robot import config, utils, logging, Updater
import base64
import requests
import tornado.web
import tornado.ioloop
import tornado.httpserver
import tornado.options
import hashlib
import threading
import asyncio
import subprocess
import os
import time
import yaml
import markdown
import random
logger =... |
process.py | import logging
import multiprocessing
import os
import time
from datetime import datetime
logfile = os.path.join(os.getcwd(), "task_manager.log")
logging.basicConfig(filename=logfile, level=logging.DEBUG)
def daemon():
while True:
time.sleep(1)
logging.info(f'Running process with pid {os.getpi... |
jsondump.py | from threading import Lock, Thread
from queue import Queue
import base64
import json
from mitmproxy import ctx
FILE_WORKERS = 1
HTTP_WORKERS = 10
# Modified version of https://github.com/mitmproxy/mitmproxy/blob/41199622db6a5f9dc2f0b74e2d38a0d6cd74baa6/examples/complex/jsondump.py
# use it like this: mitmdump -r INP... |
main.py | from __future__ import absolute_import
import argparse
import logging
import logging.config
import docker
import multiprocessing.pool
import os
import psutil
import random
import shutil
import sys
import traceback
from benchmark.datasets import DATASETS
from benchmark.algorithms.definitions import (get_definitions,
... |
create_thread.py | from threading import Thread
def f(name):
print("hello", name)
class PrintThread(Thread):
def __init__(self, name):
super().__init__()
self.name = name
def run(self):
print("hello", self.name)
if __name__ == "__main__":
th = Thread(target=f, args=("Bob",))
th.start()
... |
hashcat.py | #!/usr/bin/python3
import os
import sys
import re
import time
import subprocess
import logging
import hashlib
import tempfile
from os import listdir
from os.path import isfile, join
from datetime import datetime
import threading
import random
import string
import operator
if os.name == 'nt':
import win32console
fro... |
ex6_co2_udp.py | #!/usr/bin/env python3
# coding: utf-8
################################################################################
# BLE Sensor ex6_co2_udp.py [棒グラフ機能付き][UDP送信機能付き]
# ex3_server.py に CO2センサ(SENSIRION SGP30)を追加します。
#
# Copyright (c) 2021 Wataru KUNINO
#################... |
example1.py | from socket import socket, AF_INET, SOCK_STREAM
import threading
class LazyConnection:
def __init__(self, address, family=AF_INET, type=SOCK_STREAM):
self.address = address
self.family = AF_INET
self.type = SOCK_STREAM
self.local = threading.local()
def __enter__(self):
... |
test_v2_0_0_image.py | import json
import unittest
from multiprocessing import Process
import requests
from dateutil.parser import parse
from .fixtures import APITestCase
class ImageTestCase(APITestCase):
def test_list(self):
r = requests.get(self.podman_url + "/v1.40/images/json")
self.assertEqual(r.status_code, 200, ... |
multiprocessing_test.py | # import os
# #fork只能用于linux/unix中
# pid = os.fork() # fork是复制进程,将父进程的全部数据和程序拷贝到子进程
# print("bobby")
# if pid == 0:
# print('子进程 {} ,父进程是: {}.' .format(os.getpid(), os.getppid()))
# else:
# print('我是父进程:{}.'.format(pid))
import multiprocessing
#多进程编程
import time
def get_html(n):
time.sleep(n)
print("sub_p... |
measure_methods.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... |
test_simple_x86.py | try:
import capstone
except ImportError as e:
capstone = None
import pytest
import windows.native_exec.simple_x86 as x86
from windows.native_exec.simple_x86 import *
del Test # Prevent pytest warning
from windows.pycompat import int_types
VERBOSE = False
if capstone:
disassembleur = capstone.Cs(capston... |
plugin.py | import threading
from binascii import hexlify, unhexlify
from electrum_xuez.util import bfh, bh2u
from electrum_xuez.bitcoin import (b58_address_to_hash160, xpub_from_pubkey,
TYPE_ADDRESS, TYPE_SCRIPT, NetworkConstants)
from electrum_xuez.i18n import _
from electrum_xuez.plugins import B... |
credentials.py | # Copyright (c) 2012-2013 Mitch Garnaat http://garnaat.org/
# Copyright 2012-2014 Amazon.com, Inc. or its affiliates. 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. A copy of
# the License is located at
#
# http... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.