source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
run_chesapeake_cvpr_experiments.py | #!/usr/bin/env python3
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
"""Runs the train script with a grid of hyperparameters."""
import itertools
import os
import subprocess
from multiprocessing import Process, Queue
# list of GPU IDs that we want to use, one job will b... |
programs.py | # -*- coding: utf-8 -*-
#
# Copyright © Spyder Project Contributors
# Licensed under the terms of the MIT License
# (see spyder/__init__.py for details)
"""Running programs utilities."""
from __future__ import print_function
# Standard library imports
from ast import literal_eval
from getpass import getu... |
client.py |
import importlib
import logging
import threading
import time
import uuid
import msgpack
import zmq
from .exceptions import Timeout, UnknownFormat, RemoteException, UnknownMessageType
LOGGER = logging.getLogger("zmqdrpc-client")
LOGGER.setLevel("WARNING")
_ = logging.StreamHandler()
_.setLevel('WARNING')
_.setFormat... |
video2rec.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
import os
import sys
curr_path = os.path.abspath(os.path.dirname(__file__))
sys.path.append(os.path.join(curr_path, "../python"))
import mxnet as mx
import random
import argparse
import cv2
import time
import traceback
import pdb
try:
... |
simpleeca.py | import asyncio
import random
import ray
import threading
import time
async def some_event_step(stepid):
await asyncio.sleep(random.uniform(2, 4))
return stepid
@ray.remote
class SimpleECA:
def __init__(self):
self.pool = []
try:
self.thread = threading.Thread(target=asyncio.run,... |
loader.py |
# -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# --------------------------------------------------------------------------
import bisect
import os
import sys
from collections import defaultdict
from .. import consts, io, utils
f... |
test3.py | import sys
from PyQt5 import QtGui,QtWidgets,QtCore
from PyQt5.QtWidgets import QWidget, QGridLayout, QPushButton, QSizePolicy, QApplication, QDesktopWidget
import threading
from pynput.mouse import Button,Controller
from pynput.keyboard import Controller as KController
from pynput.keyboard import Key
import tim... |
treeRender.py | import threading
import random
import os
import time
mutex = threading.Lock()
tree = list(open('treeTemplate.txt').read().rstrip())
def formatColor(color):
if color == 'Y':
return f'\033[93m⏺\033[0m'
if color == 'R':
return f'\033[91m⏺\033[0m'
if color == 'G':
return f'\033[92m⏺\03... |
coqtop.py | # -*- coding: utf8 -*-
# Author: Wolf Honore
"""Coqtop interface with functions to send commands and parse responses."""
import datetime
import logging
import signal
import subprocess
import threading
import time
from concurrent import futures
from queue import Empty, Queue
from tempfile import NamedTemporaryFile
from... |
bind_shell.py | #!/usr/bin/env python
#**************************************************************************#
# Filename: py_bind_shel.py (Created: 2016-08-14) #
# (Updated: 2016-10-02) #
# Info: ... |
websocket_server.py | # Author: Johan Hanssen Seferidis
# License: MIT
import sys
import struct
import ssl
from base64 import b64encode
from hashlib import sha1
import logging
from socket import error as SocketError
import errno
import threading
from socketserver import ThreadingMixIn, TCPServer, StreamRequestHandler
from websocket_server... |
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... |
app.py | import sys
import json
import sqlalchemy as sa
from threading import Thread
from flask import Flask, request, jsonify
from flask_httpauth import HTTPBasicAuth
from flask_cors import CORS
from db import engine, Base, Session
from event import Event
from observer import Observer
from config import load_vars
from datetim... |
Server.py | # Imports
import socket # Communication
import threading # Communication with multiple users at once
import pickle # Serialising data
import hashlib # Hashing passwords
from Crypto.Cipher import AES # AES encryption algorithms
from Crypto.Random import get_random_bytes # For generating random keys and nonces... |
support.py | """
Assorted utilities for use in tests.
"""
from __future__ import print_function
import cmath
import contextlib
import enum
import errno
import gc
import math
import os
import shutil
import subprocess
import sys
import tempfile
import time
import io
import ctypes
import multiprocessing as mp
import warnings
from con... |
test_operator_gpu.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... |
zeromq.py | # -*- coding: utf-8 -*-
'''
Zeromq transport classes
'''
# Import Python Libs
from __future__ import absolute_import
import logging
import os
import errno
import hashlib
import weakref
from random import randint
# Import Salt Libs
import salt.auth
import salt.crypt
import salt.utils
import salt.utils.verify
import sa... |
learn.py | import tensorflow as tf
from multiprocessing import Process, Queue
import os
import datetime
import numpy as np
from impala.model import ImpalaModel, Learner, Actor
from impala.replay_buffer import UniformBuffer, PrioritizedBuffer
from common.logger import TensorBoardWriter, CSVWriter, CombinedWriter
import utils as U
... |
dogcamaibase.py | from dogcamlogger import DogCamLogger, DCLogLevel
import threading
import time
import queue
import cv2
class DogCamAIBase():
debugDisplay = False
# Queue of movement commands necessary for the robot.
# The main file handles the interclass processing of these commands.
commandQueue = queue.Queue()
# The thr... |
test_memcached_backend.py | import os
from threading import Thread
import time
from unittest import TestCase
import weakref
import pytest
from dogpile.cache.backends.memcached import GenericMemcachedBackend
from dogpile.cache.backends.memcached import MemcachedBackend
from dogpile.cache.backends.memcached import PylibmcBackend
from . import eq_... |
direct_downloader.py | # Written by: Derek Santos
# 3rd Party Modules
import requests
# Python Modules
import os
import re
from threading import Thread, active_count
from queue import Queue
import shutil
import logging
from time import sleep
""" Setting up logging """
LOG_FORMAT = "[%(levelname)s] %(asctime)s - %(message)s"
logging.basicC... |
testresult.py | # -*- coding: utf-8 -*-
#
# Tencent is pleased to support the open source community by making QTA available.
# Copyright (C) 2016THL A29 Limited, a Tencent company. All rights reserved.
# Licensed under the BSD 3-Clause License (the "License"); you may not use this
# file except in compliance with the License. You may ... |
titanic.py | """
Titanic service
Implements server side of http:#rfc.zeromq.org/spec:9
Author: Min RK <benjaminrk@gmail.com>
"""
import cPickle as pickle
import os
import sys
import threading
import time
from uuid import uuid4
import zmq
from mdwrkapi import MajorDomoWorker
from mdcliapi import MajorDomoClient
from zhelpers i... |
tests.py | # Unit tests for cache framework
# Uses whatever cache backend is set in the test settings file.
import copy
import io
import os
import pickle
import re
import shutil
import sys
import tempfile
import threading
import time
import unittest
import warnings
from pathlib import Path
from unittest import mock, skipIf
from ... |
calc_features_mp.py | import sys
import os
import multiprocessing as mp
import traceback
import networkx as nx
import numpy as np
import constants
import util
import util_batch
import util_amira
import util_geometry
import util_graph
import util_meta
import util_time
import util_feature_IO
import util_morphology
import util_morphology_slic... |
__init__.py | import socket
from threading import Thread
import time
import sys
import os
from configparser import ConfigParser
from tornado.web import Application
from tornado.ioloop import IOLoop
import schedule
from .common.controllers import Error404Handler
from server.routes import get_handlers
from .database import connectio... |
utils.py | from jesse.models.Candle import Candle
from jesse.models.Ticker import Ticker
from jesse.models.Trade import Trade
from jesse.models.Orderbook import Orderbook
import jesse.helpers as jh
import threading
import numpy as np
def store_candle_into_db(exchange: str, symbol: str, candle: np.ndarray):
"""
store can... |
dev_servers.py | """\
Examples
For the development.ini you must supply the paster app name:
%(prog)s development.ini --app-name app --init --clear
"""
from pkg_resources import resource_filename
from pyramid.paster import get_app
from multiprocessing import Process
import atexit
import logging
import os.path
import select
import... |
main.py | #!/usr/bin/env python3
from sensor import sensor
from room_devices import room_devices
from mqtt import mqtt
# from instance import room_devices
from threading import Thread
import curses
import time
def salutation(screen):
screen.addstr(0, 0, "digite 0 para sair do programa")
screen.addstr(1, 0, "digite 1 para adi... |
TCPserver.py | import socket
import threading
bind_ip = "0.0.0.0"
bind_port = 9999
server = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
#pass of ip and port that server going to listen on
server.bind((bind_ip,bind_port))
#listen max 5 clients
server.listen(5)
print "[*] Listening on %s:%d" %(bind_ip, bind_port)
#client-ha... |
System.py | # -*- coding: utf-8 -*-
"""Models the whole thing.
Process, controller and a main loop."""
import threading
import time
import logging
class System(object):
"""
Manages the whole system.
process is the current controlled process.
controller is the current controller.
The whole syste... |
web.py | import socket
import os
import threading
import sys
import framework
import logging
logging.basicConfig(level=logging.DEBUG,
format="%(asctime)s-%(filename)s[lineno:%(lineno)d]-%(levelname)s-%(message)s",
filename="longging.log",
filemode="a")
# http协议的web服务... |
service.py | # -*- coding: utf-8 -*-
from resources.lib import proxy
from codequick import Script
from codequick.script import Settings
import SocketServer
import threading
from xbmc import Monitor
from kodi_six import xbmcgui
def serveForever(handler):
try:
handler.serve_forever()
except Exception as e:
... |
_test_multiprocessing.py | #
# Unit tests for the multiprocessing package
#
import unittest
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 struct
import operator
import test.support
import test.support.script_... |
computers.py | ####################
#
# Copyright (c) 2018 Fox-IT
#
# 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... |
test_reducer.py | import itertools
import logging
import threading
import traceback
from collections import namedtuple
from typing import Any, Callable, List
import numpy as np
import pytest
from determined import _core
from determined.pytorch import Reducer, _PyTorchReducerContext, _reduce_metrics
logger = logging.getLogger(__name__... |
serialize_tensorboard.py | # Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... |
bot.py | # -*- coding:utf-8 -*-
from utils.logging.logger import logger
import os
import time
import random
import traceback
from threading import Thread, Timer
from beem.comment import Comment
from steem.settings import settings
from steem.comment import SteemComment
from steem.account import SteemAccount
from steem.writer ... |
celery_command.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... |
learner.py | from typing import Tuple
import glob
import os
import shutil
import signal
import threading
import time
from collections import OrderedDict, deque
from os.path import join
from queue import Empty, Queue, Full
from threading import Thread
import numpy as np
import psutil
import torch
from torch.nn.utils.rnn import Pack... |
InvokerHandler.py | '''
Created on 2015年7月12日
@author: sunshyran
'''
from rpc.framework.driver.MessageDriver import AbstractMessageDriver
from rpc.framework.driver.MessageThread import MessageFullError, StopError, \
MessageEmptyError, MessageThread
from rpc.framework.channel.ChannelError import ChannelBrokenError, \
Chan... |
audioutil.py | #@title Prepare data and utility functions. {display-mode: "form"}
#@markdown
#@markdown You do not need to look into this cell.
#@markdown Just execute once and you are good to go.
#@markdown
#@markdown In this tutorial, we will use a speech data from [VOiCES dataset](https://iqtlabs.github.io/voices/), which is licen... |
Liquid.py | """
Liquid.py - Python+Pygame port V1 Robert Rasmay
MIT License ( http://www.opensource.org/licenses/mit-license.php )
/**
* self version:
* Copyright Stephen Sinclair (radarsat1) (http://www.music.mcgill.ca/~sinclair)
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://w... |
web_server.py | from flask import Flask
from threading import Thread
app = Flask('')
@app.route('/')
def home():
return "Server is up!"
def run():
app.run(host='0.0.0.0',port=8080)
def keep_alive():
t = Thread(target=run)
t.start() |
server.py | import asyncio
import os
import traceback
from functools import partial
from inspect import isawaitable
from multiprocessing import Process
from signal import SIG_IGN, SIGINT, SIGTERM, Signals
from signal import signal as signal_func
from socket import SO_REUSEADDR, SOL_SOCKET, socket
from time import time
from httpt... |
test_greenlet.py | import gc
import sys
import time
import threading
import unittest
from abc import ABCMeta, abstractmethod
from greenlet import greenlet
# We manually manage locks in many tests
# pylint:disable=consider-using-with
class SomeError(Exception):
pass
def fmain(seen):
try:
greenlet.getcurrent().parent.s... |
SmartCacheWorkloadLauncher.py | #
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
#
from threading import Thread
from mlos.Examples.SmartCache.SmartCache import SmartCache
from mlos.Examples.SmartCache.SmartCacheWorkloadGenerator import SmartCacheWorkloadGenerator
from mlos.Mlos.SDK import mlos_globals, MlosAgent
... |
a3c.py | import time
import gym
import torch
import torch.multiprocessing as mp
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torch.distributions import Categorical
# Hyperparameters
n_train_processes = 3
learning_rate = 0.0002
update_interval = 5
gamma = 0.98
max_train_ep = 300
max_te... |
main.py | import sys
from homescreen import run_all
from homescreen import play_sound
import multiprocessing
import config
from sound_player import play_music1
config.init()
mylist = [False]
def soundmanager(num):
p3 = multiprocessing.Process(target=play_music1)
p3.start()
count = 1
while (True):
if ... |
base_crash_reporter.py | # Electrum - lightweight Bitcoin client
#
# 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... |
serve.py | # -*- coding: utf-8 -*-
from __future__ import print_function
import abc
import argparse
import json
import os
import re
import socket
import sys
import threading
import time
import traceback
import urllib2
import uuid
from collections import defaultdict, OrderedDict
from multiprocessing import Process, Event
from .... |
run.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""fMRI preprocessing workflow."""
from .. import config
def main():
"""Entry point."""
import os
import sys
import gc
from multiprocessing import Process, Manager
from .parser import parse_args
from ..utils.bids import write_derivative_descrip... |
data_set_helpers.py |
import pandas
import tensorflow as tf
import numpy as np
from threading import Thread
from math import ceil
from six.moves import range
from gesgen_keras.util.audio import audiofile_to_input_vector
from gesgen_keras.util.gesture import gesturefile_to_label_vector
from gesgen_keras.util.gpu import get_available_gpus
f... |
thread.py | import threading
from time import sleep
lock = threading.Lock()
# funcao que espera 1 segundo
def wait():
global lock
while True:
sleep(1)
lock.release()
def LerVelocidade():
global lock
while True:
lock.acquire()
print('Leitura da Velocidade')
print('cheguei'... |
song.py | import requests
import re
from bs4 import BeautifulSoup
import json
import time
import threading
import os
import pickle
headers = {
"Host":"music.163.com",
"Referer":"http://music.163.com/",
"User-Agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.84 Safari/537.3... |
test_ssl.py | # Test the support for SSL and sockets
import sys
import unittest
from test import support
import socket
import select
import time
import datetime
import gc
import os
import errno
import pprint
import tempfile
import urllib.request
import traceback
import asyncore
import weakref
import platform
import functools
from u... |
train_ac_exploration_f18.py | """
Original code from John Schulman for CS294 Deep Reinforcement Learning Spring 2017
Adapted for CS294-112 Fall 2017 by Abhishek Gupta and Joshua Achiam
Adapted for CS294-112 Fall 2018 by Soroush Nasiriany, Sid Reddy, and Greg Kahn
Adapted for CS294-112 Fall 2018 with <3 by Michael Chang, some experiments by Greg Kah... |
kernel.py | """
Start an IPython Qt console or notebook connected to the python session
running in Excel.
This requires sys.executable to be set, and so it's recommended
that the following is added to the pyxll.cfg file:
[PYTHON]
executable = <path to your python installation>/pythonw.exe
"""
from .magic import ExcelMagics
from ... |
helpers.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
# ------- IMPORT DEPENDENCIES -------
from datetime import *
from dateutil import *
from dateutil import tz
import time
from jinja2 import Environment
import bleach
import jinja2
# security
import os
import binascii
from cryptography.fernet import Fernet
from werkzeug.secu... |
OSC.py | #!/usr/bin/python
"""
This module contains an OpenSoundControl implementation (in Pure Python), based
(somewhat) on the good old 'SimpleOSC' implementation by Daniel Holth & Clinton
McChesney.
This implementation is intended to still be 'simple' to the user, but much more
complete (with OSCServer & OSCClient classes) ... |
thread_RLock.py | import threading
import time
# 说白了就是在一个大锁中还要再包含子锁
def run1():
print("grab the first part data")
lock.acquire()
global num
num += 1
lock.release()
return num
def run2():
print("grab the second part data")
lock.acquire()
global num2
num2 += 1
lock.release()
return num2... |
callbacks_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 applica... |
test_libsosplugin.py | # Licensed to the .NET Foundation under one or more agreements.
# The .NET Foundation licenses this file to you under the MIT license.
# See the LICENSE file in the project root for more information.
from __future__ import print_function
import unittest
import argparse
import re
import tempfile
import subprocess
impor... |
InferenceDataProducer.py | import numpy as np
from threading import Thread
from Queue import Queue
from PIL import Image
import os
import mxnet as mx
class InferenceDataProducer(object):
def __init__(self,
im_root,
mask_root,
flist_path,
scale_list,
rgb_mea... |
multi_process.py | # läuft parallel
import time
import math
from multiprocessing import Process
NUM_PROCESSES = 4
def calc(num_elements):
res = 0
for i in range(num_elements):
res += math.sqrt(i)
print(res)
def main():
processes = []
for _ in range(NUM_PROCESSES):
processes.append(Process(target=... |
train.py | # -*- coding: utf-8 -*-
"""
Created on Tue Dec 31 10:57:51 2019
@author: truthless
"""
import numpy as np
import torch
from torch import multiprocessing as mp
from convlab2.dialog_agent.agent import PipelineAgent
from convlab2.dialog_agent.env import Environment
from convlab2.dst.rule.multiwoz import RuleDST
from convl... |
boot.py | #standard simulator bootstrap
#from wx.core import Sleep
import q3
import q3.config
import q3.Timer as Timer
from q3.ui.engine import qtw,qtc,qtg
import threading
import os
keys = globals().keys()
runApp = False
if False and not 'c' in keys:
c = None
class encImpl(qtc.QThread):
def __init_... |
alignjoy.py | #!/usr/bin/env python
import os
import time
import shutil
import threading
class align():
def alinha_arquivos(self, name, images, cmdvel):
if os.path.isfile("../bag-files/joy/"+name):
diferenca_images = []
#images = [arq for arq in os.listdir("../bag-files/images")]
for ... |
traybar.py | import os
from .win32_adapter import *
import threading
import uuid
class SysTrayIcon(object):
QUIT = 'QUIT'
SPECIAL_ACTIONS = [QUIT]
FIRST_ID = 1023
def __init__(self,
icon,
hover_text,
menu_options=None,
on_quit=None,
... |
mt.py | #!/usr/bin/python3
import time
from datetime import datetime, timedelta
from threading import Thread
class Multi:
def __init__(self):
self.stop = False
def countdown(self, n):
self.start = datetime.now()
while not self.stop and n > 0:
delta = datetime.now()-self.start
... |
ab.py | #!/usr/bin/python
# encoding: utf-8
# Copyright 2017 Google Inc.
#
# Use of this source code is governed by a BSD-style license that can be found
# in the LICENSE file.
#
# This is an A/B test utility script used by calmbench.py
#
# For each bench, we get a distribution of min_ms measurements from nanobench.
# From th... |
__init__.py | """The Remote Python Debugger integration."""
from asyncio import Event
import logging
from threading import Thread
from typing import Optional
import debugpy
import voluptuous as vol
from homeassistant.const import CONF_HOST, CONF_PORT
from homeassistant.core import HomeAssistant, ServiceCall
import homeassistant.he... |
MagnetometerData.py |
from .TimeSeries import TimeSeries, generateTimeSeries
from .DataSet import DataSet, DataSet_3D
from .DataSet_1D import DataSet_1D
from threading import Thread
import numpy as np
from numpy import logical_or, logical_and
from ai import cdas
class MagnetometerData():
"""Class providing a high level api for data ... |
katak.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
import os
import sys
import time
import hashlib
import requests
import threading
import progressbar
class hash_kill:
class TypeError(Exception):
def __init__(self):
Exception.__init__(self, "Its not supported algorithms!")
def __init__(self, hash):
self.hash = hash
... |
training.py | # -*- coding: utf-8 -*-
from __future__ import print_function
from __future__ import absolute_import
import warnings
import copy
import time
import numpy as np
import multiprocessing
import threading
import six
try:
import queue
except ImportError:
import Queue as queue
from .topology import Container
from .... |
RATAttack.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os, os.path, platform, ctypes
os.environ["PBR_VERSION"]='5.0.0'
import logging
from consoleTools import consoleDisplay as cd
from PIL import ImageGrab # /capture_pc
from shutil import copyfile, copyfileobj, rmtre... |
ant.py | #!/bin/python3
#
# Arm0red Net Tool
# ant.py
import sys
import socket
import getopt
import threading
import subprocess
# define some global variables
listen = False
command = False
upload = False
execute = ""
target = ""
upload_destination = ""
port ... |
listen_user.py | import abc
from asyncio.queues import QueueEmpty
import json
import os
import threading
import time
import numpy as np
from sentence_transformers import SentenceTransformer
from onnx_sentence_transformers import ONNXSentenceTransformer
import simpleaudio as sa
import speech_recognition as sr
import yaml
from ibm_cloud... |
async_policy_saver.py | # coding=utf-8
# Copyright 2020 The TF-Agents 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... |
server.py | #######################################################
#
# TAKFreeServer.py
# Original author: naman108
# This code is Open Source, made available under the EPL 2.0 license.
# https://www.eclipse.org/legal/eplfaq.php
# credit to Harshini73 for base code
#
#######################################################
import ... |
w.py | #!/usr/bin/python
import sys, re, os, paramiko
from multiprocessing import Process
if len(sys.argv) < 2:
sys.exit("\033[37mUsage: python "+sys.argv[0]+" [vuln list]")
paramiko.util.log_to_file("/dev/null")
cmd=""
r34d = open(str(sys.argv[1]),'a+')
print "\033[31mStarting Scan!\n"
def w0rk(username,passw... |
interval_runner.py | import threading
from threading import Thread, Event
from typing import Callable
class IntervalRunner:
event: Event
thread: Thread
def __init__(self, target: Callable[[], None], interval_seconds: float = 0.1):
self.event = threading.Event()
self.target = target
self.interval_secon... |
utils.py | def secureErase(file, passes, securityLevel):
import random
import os
import sys
FileNameLength = 50
charList = list('abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890-=[];,./!@#$%^&*(){}|_+<>?')
# Check if the file exists
if not os.path.exists(file):
sys.exit(str(file... |
multiprocessing_namespaces.py | # Copyright (c) 2009 Doug Hellmann All rights reserved.
#
"""
"""
# end_pymotw_header
import multiprocessing
def producer(ns, event):
ns.value = "This is the value"
event.set()
def consumer(ns, event):
try:
print("Before event: {}".format(ns.value))
except Exception as err:
print("B... |
timer.py | from threading import Thread
class Timer:
def __init__(self, config, bus):
self.bus = bus
bus.register('tick')
self.sleep = config['sleep']
self.thread = Thread(target=self.run)
def start(self):
self.thread.start()
def join(self, timeout=None):
self.thread... |
DirForcer.py | #!/usr/bin/env python3
import argparse
import queue
import sys
import threading
import urllib.error
import urllib.parse
import urllib.request
sys.exit("Use the -h parameter to learn about using the program.") if len(sys.argv[1:]) == 0 else True
description = "DirForcer is a brute-forcing tool designed to brute force... |
servers.py | # Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See LICENSE in the project root
# for license information.
from __future__ import absolute_import, division, print_function, unicode_literals
import os
import subprocess
import sys
import threading
import time
i... |
AdminPanel.py | #import modules
from os import curdir
from tkinter import *
import os
import tkinter.filedialog
import numpy as np
from numpy.lib.function_base import append
from numpy.lib.polynomial import polyfit
from pandas.core import frame
from styleframe import StyleFrame, utils
import pandas as pd
import numpy as np
import ... |
app.py | #!/usr/bin/env python
#
# Copyright 2018 IBM Corp. 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... |
main.py | from marks_monitoring import tg_bot
import threading
def main():
threading.Thread(target=lambda: tg_bot.bot.polling(none_stop=True)).start()
print("Telegram bot started successfully")
if __name__ == "__main__":
main()
|
saisoku.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""saisoku.py
Saisoku is a Python module that helps you build complex pipelines of batch file copying jobs.
See README.md or https://github.com/shirosaidev/saisoku
for more information.
Author: shirosai <cpark16@gmail.com>
Copyright (C) Chris Park 2019
saisoku is release... |
k_pert_average_cell_sorting.py | import OS_model
from numpy import random
import multiprocessing
import numpy as np
from matplotlib import pyplot as plt
from matplotlib import rc
from numpy import genfromtxt
time_step = 0.005
end_time = 100
simulation_count = 10
times = np.linspace(0, end_time, int(end_time / time_step) + 1)
# Generate Data
def ... |
SentenceTransformer.py | import json
import logging
import os
import shutil
import stat
from collections import OrderedDict, Counter
from typing import List, Dict, Tuple, Iterable, Type, Union, Callable, Optional
import requests
import numpy as np
from numpy import ndarray
import transformers
from huggingface_hub import HfApi, HfFolder, Reposi... |
other.py | import os
import threading
import time
FILE_PATH="./data/keys.lst"
last=""
def keypress():
s=""
for k in last.split("\n"):
if (k==""):continue
s+=k.title()+" + "
print(s[:len(s)-3])
if ("enter" in last):
os.system("CLS")
while True:
with open(FILE_PATH,"r") as f:
d=f.readlines()
if ("".join(d)!=... |
mainwindow.py | """
Main application window for starcheat GUI
"""
import sys
import logging
import json
from PyQt5 import QtWidgets
from PyQt5 import QtCore
from PyQt5.QtWidgets import QApplication
from PyQt5.QtWidgets import QMainWindow
from PyQt5.QtWidgets import QTableWidgetItem
from PyQt5.QtWidgets import QFileDialog
from PyQt5.... |
mesos_executor.py | import sys
import threading
from lwr.mesos import (
Executor,
MesosExecutorDriver,
mesos_pb2,
ensure_mesos_libs,
)
from lwr.lwr_client.util import from_base64_json
from lwr.scripts.lwr_submit import (
manager_from_args,
wait_for_job
)
from lwr.manager_endpoint_util import submit_job
from lwr.d... |
t_threading2.py | #!/usr/bin/env python
#coding:utf-8
# Author:
# Purpose:
# Created: 2013年3月27日
import threading
import time
def worker(i=1):
print "test:",i
time.sleep(2)
print 'after'
for i in xrange(5):
t = threading.Thread(target=worker,args=[2])
t.start()
time.sleep(5)
print "current has %... |
ext_subprocess.py | import subprocess
import sys
import threading
def run_command_stream_output(cmd: str):
process = subprocess.Popen(cmd, stdout=subprocess.PIPE, shell=True)
_stream_output_from_process(process)
def run_command_in_background_stream_output(cmd: str):
process = subprocess.Popen(cmd, stdout=subprocess.PIPE, s... |
util.py | # Electrum - lightweight Bitcoin client
# Copyright (C) 2011 Thomas Voegtlin
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation files
# (the "Software"), to deal in the Software without restriction,
# including without limitation the rights t... |
vnlhang.py | # encoding: utf-8
import urllib
import hashlib
import requests
from Queue import Queue, Empty
from threading import Thread
from time import sleep
LHANG_API_ROOT ="https://api.lhang.com/v1/"
FUNCTION_TICKER = ('ticker.do', 'get')
FUNCTION_DEPTH = ('depth.do', 'get')
FUNCTION_TRADES = ('trades.do', 'get')
FUNCTION_... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.