source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
algo_main.py | from tps import common, ohlc_file
import os, sys, re, time
import pandas
import datetime
#from collections import OrderedDict
from ib_quote import IbQuote
#from tabulate import tabulate
import matplotlib.pyplot as plt
g_fdrcfg = {
"type": "normal",
"name": "ib1d",
"start": "",
"end": "",
"path": ".... |
main.py | import os
from tkinter import *
import tkinter.messagebox
from tkinter import filedialog
import time
import threading
from tkinter import ttk
from ttkthemes import themed_tk as tk
from pygame import mixer
from mutagen.mp3 import MP3
root = tk.ThemedTk()
root.get_themes()
root.set_theme("radiance")
# Menubar
menubar =... |
multithread_demo.py | __filename__ = 'multithread_demo.py'
__author__ = 'jwestover@sonobi.com'
import threading
import time
import random
class HelloWorld(object):
def __init__(self):
self.my_number = 1
self.lock = threading.Lock()
def thread_target1(self, parameter = None):
if parameter:
prin... |
client.py | from base64 import b64encode
from engineio.json import JSONDecodeError
import logging
import queue
import signal
import ssl
import threading
import time
import urllib
try:
import requests
except ImportError: # pragma: no cover
requests = None
try:
import websocket
except ImportError: # pragma: no cover
... |
main.py | '''
KAHOOT ANSWER GIVER FROM GOOGLEMEET SCREENSHARE
DATE: 25/02/2020
AUTHOR: ARRZ.DEV
'''
#DEFAULT
import os
from os import system
import sys
from time import sleep
import json
import datetime
from threading import Thread
import win32api, win32con
from ctypes import *
#NORMALIZER MODULE
... |
operator_tests.py | import unittest
import random
import logging
import itertools
import multiprocessing
import inspyred
class DummyEC(object):
pass
def test_generator(random, args):
return [random.random() for _ in range(6)]
def test_evaluator(candidates, args):
fitness = []
for c in candidates:
fitness.app... |
weixin.py | #!/usr/bin/env python
# coding: utf-8
import qrcode
import urllib
import urllib2
import cookielib
import requests
import xml.dom.minidom
import json
import time
import re
import sys
import os
import random
import multiprocessing
import platform
import logging
import httplib
from collections import defaultdict
from urlp... |
s-cli.py | #!/usr/bin/python3
import getpass
import sys
import os
import subprocess
from time import gmtime, strftime, localtime
import re
import pexpect, struct, fcntl, termios, signal
import string
import subprocess
#import sh
#from multiprocessing import Process
u = subprocess.getstatusoutput('whoami')[1]
sd = subprocess.get... |
vtktools.py | # Copyright (c) 2020. The Medical Image Computing (MIC) Lab, 陶豪毅
#
# 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... |
constructor.py | import Tkinter as tk
import ttk
import socket
import os
from time import sleep
import threading
n_files = 0
counter = 0
path = "work_directory" + "/"
prbar_flag = True
def progress():
while prbar_flag:
prbar['value'] = counter
if prbar["value"] >= prbar["maximum"]:
break
return
... |
test_base_events.py | """Tests dla base_events.py"""
zaimportuj errno
zaimportuj logging
zaimportuj math
zaimportuj socket
zaimportuj sys
zaimportuj threading
zaimportuj time
zaimportuj unittest
z unittest zaimportuj mock
zaimportuj asyncio
z asyncio zaimportuj base_events
z asyncio zaimportuj constants
z asyncio zaimportuj test_utils
spr... |
run.py | import sys
import logging
from os import path
from os import remove
import requests
import streamingAnalytics.listener
import deviceRegistration.registrationProcess
import API.authentication as auth
import API.identity
import time
import threading
import utils.settings
import dockerWatcher.sendDockerStats
import stream... |
lisp-etr.py | #-----------------------------------------------------------------------------
#
# Copyright 2013-2019 lispers.net - Dino Farinacci <farinacci@gmail.com>
#
# 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 ... |
boltwood.py | import logging
import time
import serial
import threading
from . import api
from .report import Report, SensorsReport
class BoltwoodII:
"""Class that operates a Boltwood II cloud sensor weather station."""
def __init__(self, port: str = '/dev/ttyUSB0', baudrate: int = 4800, bytesize: int = 8, parity: str = ... |
route_planning_program_executor.py | #! /usr/bin/env python
from threading import Thread
from time import time
import subprocess
import rospy
import actionlib
import offload.msg
import socket
class RoutePlanningProgramExecutor(object):
# create messages that are used to publish feedback/result
# _feedback = offload.msg.FibonacciFeedback()
... |
exchange_rate.py | from datetime import datetime
import inspect
import requests
import sys
from threading import Thread
import time
import traceback
import csv
from decimal import Decimal
from bitcoin import COIN
from i18n import _
from util import PrintError, ThreadJob
from util import format_satoshis
# See https://en.wikipedia.org/w... |
compute.py | from mininet.link import Link
from resources import *
from docker import DockerClient
import logging
import threading
import uuid
import time
import ip_handler as IP
class HeatApiStackInvalidException(Exception):
"""
Exception thrown when a submitted stack is invalid.
"""
def __init__(self, value):
... |
test_manager.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... |
commands.py | ###
# Copyright (c) 2002-2005, Jeremiah Fincher
# Copyright (c) 2009-2010, James Vega
# 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 c... |
test_logging.py | #!/usr/bin/env python
#
# Copyright 2001-2012 by Vinay Sajip. All Rights Reserved.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose and without fee is hereby granted,
# provided that the above copyright notice appear in all copies and that
# both that copyright n... |
utils.py | # Copyright 2012-present MongoDB, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... |
bundle_manager.py | import datetime
import logging
import os
import random
import re
import sys
import threading
import time
import traceback
from codalab.objects.permission import check_bundles_have_read_permission
from codalab.common import PermissionError, NotFoundError
from codalab.lib import bundle_util, formatting, path_util
from c... |
__init__.py | """
Queue for running deferred code via plugins.
"""
import logging
import os
import threading
from Queue import Queue
from galaxy import model
from galaxy.util.bunch import Bunch
from galaxy.util.sleeper import Sleeper
log = logging.getLogger(__name__)
class DeferredJobQueue(object):
job_states = Bunch(READY='... |
ch03_listing_source.py | # -*- coding: utf-8 -*-
import threading
import time
import unittest
import redis
ONE_WEEK_IN_SECONDS = 7 * 86400
VOTE_SCORE = 432
ARTICLES_PER_PAGE = 25
'''
# <start id="string-calls-1"/>
>>> conn = redis.Redis()
>>> conn.get('key') #A
>>> conn.incr('key') #B
1 #... |
responder.py | # MIT License
#
# Copyright (c) 2018 KubeMQ
#
# 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, publi... |
relay_integration.py | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... |
server.py | import socket
import threading
import classes
import modules.generate as generator
PORT = 5000
valid_codes = []
rooms = []
def client_listener(conn, addr):
"""
Listens to clients and responds to requests
Args:
conn (socket.socket): the client connection
addr (tuple): where the connection... |
process.py | import multiprocessing as mp
import random
import string
import requests
import time
random.seed(123)
# Define an output queue
output = mp.Queue()
# define a example function
def rand_string(length, output):
proxies = { 'http': '83.149.70.159:13012', 'https': '83.149.70.159:13012'}
r = requests.get('https://www.... |
plugin.py | import threading
from binascii import hexlify, unhexlify
from qtum_electrum.util import bfh, bh2u
from qtum_electrum.bitcoin import (b58_address_to_hash160, xpub_from_pubkey,
TYPE_ADDRESS, TYPE_SCRIPT, NetworkConstants)
from qtum_electrum.i18n import _
from qtum_electrum.plugins import B... |
utils.py | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
from collections import OrderedDict
import uuid
import sys
import hashlib
import binascii
from functools import wraps
import os
import pwd
import os.path
try:
from urllib.parse import urlparse
except ImportError:
from urlparse import urlparse
if sys.version... |
test_tsdb.py | import unittest
import multiprocessing
import time
from timeseries import TimeSeries
from tsdb.persistentdb import PersistentDB
from tsdb.tsdb_client import *
from tsdb.tsdb_server import TSDBServer
from tsdb.tsdb_error import *
import numpy as np
from scipy.stats import norm
schema = {
'pk': {'type': str, 'index':... |
test_bson.py | # -*- coding: utf-8 -*-
#
# Copyright 2009-present MongoDB, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... |
prueba.py | from flask import Flask, g, render_template, make_response, request, redirect, url_for, jsonify
from flask_socketio import SocketIO, send, emit
from threading import Thread
import rethinkdb as r
from rethinkdb import RqlRuntimeError
app = Flask(__name__)
socketio = SocketIO(app)
global thread
thread = None
# Load def... |
process_1_简单实现.py | #!/usr/bin/env python3
# file: thread_demo_1.py
# Created by Guang at 19-7-15
# description:
# *-* coding:utf8 *-*
import multiprocessing
import time
def func1():
for i in range(5):
print("这是一个进程测试函数func1")
time.sleep(1)
def func2():
for i in range(5):
print("这是一个进程测试函数func2")
... |
system_test.py | '''
Copyright (c) 2019, Arm Limited and Contributors
SPDX-License-Identifier: Apache-2.0
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 requ... |
serverLocal.py | from flask import Flask, render_template
from pymavlink import mavutil
from msgdef import *
import socket
import os
import threading
HOST = '127.0.0.1' #Server IP address
PORT = 65432 #Server port
firstTime = True #Indicates whether its the first time to call my_server()
data_view = """""" #Store data to view on we... |
val.py | """Validate a trained YOLOv5 model accuracy on a custom datasets
Usage:
$ python path/to/val.py --data coco128.yaml --weights yolov5s.pt --img 640
"""
import argparse
import json
import os
import sys
from pathlib import Path
from threading import Thread
import numpy as np
import torch
from tqdm import tqdm
FILE... |
generate_grasp.py | import warnings
warnings.filterwarnings("ignore")
import operator
import numpy as np
import sys,os,glob,re,time,copy,trimesh,gzip
code_dir = os.path.dirname(os.path.realpath(__file__))
sys.path.append("{}/../".format(code_dir))
import pickle
from dexnet.grasping.gripper import RobotGripper
from dexnet.grasping.grasp_sa... |
manytopics_subscriber.py | """
This is the subscriber for the 'many topics' messages example.
For code with more explanations, see the regular 'weather' message example code.
"""
from __future__ import print_function
import os
import time
import threading
import Pyro4
from operator import itemgetter
from messagebus.messagebus import Subscriber
... |
dns_server.py | #!/usr/bin/env python2.7
# Copyright 2015 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 la... |
test_threading.py | """
Tests for the threading module.
"""
import test.support
from test.support import threading_helper, requires_subprocess
from test.support import verbose, cpython_only, os_helper
from test.support.import_helper import import_module
from test.support.script_helper import assert_python_ok, assert_python_failure
impor... |
hasherservice.py | #!/usr/bin/env python
'''A library and a command line tool to interact with the LOCKSS daemon hasher
service via its Web Services API.'''
# $Id$
__copyright__ = '''\
Copyright (c) 2000-2016 Board of Trustees of Leland Stanford Jr. University,
all rights reserved.
'''
__license__ = '''\
Permission is hereby granted,... |
test_basic.py | # -*- coding: utf-8 -*-
"""
tests.basic
~~~~~~~~~~~~~~~~~~~~~
The basic functionality.
:copyright: (c) 2015 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import pytest
import re
import uuid
import time
import flask
import pickle
from datetime import datetime
from threading ... |
swarm.py | from .tello import Tello
from threading import Thread, Barrier
from queue import Queue
class TelloSwarm:
@staticmethod
def fromFile(path, enable_exceptions=True):
with open(path, "r") as fd:
ips = fd.readlines()
return TelloSwarm.fromIps(ips, enable_exceptions)
@staticmethod
def fromIps(ips, enable_excep... |
infolog.py | import atexit
import json
from datetime import datetime
from threading import Thread
from urllib.request import Request, urlopen
_format = '%Y-%m-%d %H:%M:%S.%f'
_file = None
_run_name = None
_slack_url = None
def init(filename, run_name, slack_url=None):
global _file, _run_name, _slack_url
_close_logfile()
_file... |
test_controller.py | from threading import Thread, Event
from unittest.mock import Mock
from mitmproxy import controller
import queue
from mitmproxy.exceptions import Kill, ControlException
from mitmproxy import proxy
from mitmproxy import master
from mitmproxy.test import tutils
class TMsg:
pass
class TestMaster:
def test_s... |
client.py | """
This module contains the main agent client for connecting to the Cayenne server. The client connects
to server, retrives system info as well as sensor and actuator info and sends that data to the server.
It also responds messages from the server, to set actuator values, change system config settings, etc.
"""
from... |
websocket.py | import asyncio
import json
import logging
import os
from threading import (
Thread,
)
import websockets
from web3.exceptions import (
ValidationError,
)
from web3.providers.base import (
JSONBaseProvider,
)
RESTRICTED_WEBSOCKET_KWARGS = {'uri', 'loop'}
DEFAULT_WEBSOCKET_TIMEOUT = 10
... |
installwizard.py | # Copyright (C) 2018 The Electrum developers
# Distributed under the MIT software license, see the accompanying
# file LICENCE or http://www.opensource.org/licenses/mit-license.php
import os
import json
import sys
import threading
import traceback
from typing import Tuple, List, Callable, NamedTuple, Optional, TYPE_CH... |
miniterm.py | #!/usr/bin/env python
#
# Very simple serial terminal
#
# This file is part of pySerial. https://github.com/pyserial/pyserial
# (C)2002-2015 Chris Liechti <cliechti@gmx.net>
#
# SPDX-License-Identifier: BSD-3-Clause
import codecs
import os
import sys
import threading
import serial
from serial.tools.... |
python_multithreading_example.py | #! /usr/bin/python
import threading
from threading import Thread, Lock
from std_msgs.msg import String
from time import sleep
import copy
import rospy
import random
# These will be initialized later
pub1 = None
pub2 = None
kill = False
# Create a lock that controls who has the ball
beach_lock = Lock()
""" Simple cla... |
helper_node.py | # Copyright (c) OpenMMLab. All rights reserved.
import logging
import time
from queue import Full, Queue
from threading import Thread
from typing import List, Optional, Union
import cv2
import numpy as np
from mmcv import color_val
from mmpose.utils.timer import RunningAverage
from .builder import NODES
from .node im... |
complete_knn_train_28.py | # -*- coding: utf-8 -*-
"""
Created on Fri Apr 10 19:57:23 2020
@author: kerui
"""
import sys
sys.path.remove('/opt/ros/kinetic/lib/python2.7/dist-packages')
# 将一个点云的值赋值为离他最近的三个有值点的加权值
import numpy as np
import cv2
import kdtree as KDT
import data_provider
#import config
import velo_2_cam
import os
i... |
syn_exercise.py | #!/usr/bin/env python2
# Copyright 2013-present Barefoot Networks, 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 b... |
_exposition.py | # Copyright 2015-2019 Prometheus Python Client Developers
# Copyright 2019 Matrix.org Foundation C.I.C.
#
# 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/... |
LCEOWindow.py | #!/usr/bin/env python
# -*- coding:utf-8 -*-
from PyQt5.QtCore import QThread, pyqtSignal
from PyQt5 import QtWidgets, QtGui
from PyQt5.QtWidgets import *
from GUI.CEOWindow import Design_CEOWindow
import sys
from Controllers import CEOControl
import win32com.client
import threading
import random
class CEOWindow(De... |
main.py | # /*
# * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
# * contributor license agreements. See the NOTICE file distributed with
# * this work for additional information regarding copyright ownership.
# * The OpenAirInterface Software Alliance licenses this file to You under
# * the OAI Pub... |
test_utils.py | #!/usr/bin/env python
# Copyright 2015 Brett Slatkin
#
# 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... |
SurveillanceSystem.py |
# Surveillance System Controller.
# Brandon Joffe
# 2016
# Copyright 2016, Brandon Joffe, 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/l... |
main.py | import HTMLParser from HTMLParser
import Thread from threading
import re
import request, robotparser from urllib
import URIUnderstand
import basicDownload
class Parse(HTMLParser):
def __init__(self, url, saveList = (), unsafeList = (), hasParsedList = {}):
self.saveList = saveList
self.hasParsedLis... |
rw_mnist.py | from core.run import run
from core.task_schedule import wait_schedule, Task, available_devices
from multiprocessing import Process
import datetime
import argparse
if __name__ == "__main__":
now = datetime.datetime.now().strftime("%Y-%m-%d-%H-%M-%S")
tag = 'ablo_K'
if tag == 'ablo_K':
tasks = []
... |
dataset_formator.py | #!/bin/python
# Begin license text.
#
# Copyright 2021 Ondřej Zobal
#
# 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, ... |
agent.py | import struct
import base64
import subprocess
import random
import time
import datetime
import os
import sys
import zlib
import threading
import http.server
import zipfile
import io
import importlib.util
import types
import re
import shutil
import pwd
import socket
import math
import stat
import grp
import numbers
from... |
xla_client_test.py | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
core_test.py | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
_a4c_create.py |
from cloudify import ctx
from cloudify.exceptions import NonRecoverableError
from cloudify.state import ctx_parameters as inputs
import subprocess
import os
import re
import sys
import time
import threading
import platform
from StringIO import StringIO
from cloudify_rest_client import CloudifyClient
from cloudify im... |
session.py | import os
import json
import time
import logging
from threading import Lock, Timer
from uuid import uuid4
from multiprocessing import Process, Event
from flask import Blueprint, request
from .error import SessionNotInitialized, FileIsBeingEncrypted, FileIsBeingDecrypted, SessionExists
from .encrypter import FileEncry... |
websocketconnection.py | import threading
import websocket
import gzip
import ssl
import logging
from urllib import parse
import urllib.parse
from common.scripts.binance_spot.impl.utils.timeservice import get_current_timestamp
from common.scripts.binance_spot.impl.utils.urlparamsbuilder import UrlParamsBuilder
from common.scripts.bi... |
train_multi_2.0.py | #!/search/odin/liyaozong/tools/python3/bin/python3
# coding: utf8
import random
import numpy as np
from collections import defaultdict, deque
from game import Board, Game
from mcts_pure import MCTSPlayer as MCTS_Pure
from mcts_alphaZero import MCTSPlayer
import multiprocessing
from multiprocessing import Manager, Pool... |
TfServer.py | import time
from threading import Thread, Event
import socket
import cv2
import pickle
import struct
from detection import Obj_Detection
"""
COPYRIGHT @ Grebtsew 2019
TfServer recieves a couple of connections, reads images from incomming streams
and send detections to the QtServer
"""
QtServer_address= [["127.0.0.1",... |
googleimages_dsk.py | """Google Image Downloader
Original written by Neeraj Kumar <me@neerajkumar.org>
DO NOT DISTRIBUTE!
"""
from PIL import Image
import os, sys, time
import urllib
import random
from Queue import Queue
# GLOBALS
# queues for managing downloads
dlq = Queue()
outq = Queue()
# number of simultaneous download threads
NDLTHRE... |
miniterm.py | #!C:\MicroPythonProjects\ch3\pyboard_1_1\venv\Scripts\python.exe
#
# Very simple serial terminal
#
# This file is part of pySerial. https://github.com/pyserial/pyserial
# (C)2002-2015 Chris Liechti <cliechti@gmx.net>
#
# SPDX-License-Identifier: BSD-3-Clause
import codecs
import os
import sys
import threading
impo... |
master.py | """
This module contains all of the routines needed to set up a master server, this
involves preparing the three listeners and the workers needed by the master.
"""
import collections
import copy
import ctypes
import functools
import logging
import multiprocessing
import os
import re
import signal
import stat
import ... |
wallet_multiwallet.py | #!/usr/bin/env python3
# Copyright (c) 2017-2020 The Vadercoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test multiwallet.
Verify that a vadercoind node can load multiple wallet files
"""
from decimal impo... |
client.py | import socket
import threading
def welcome():
print("Nice to see you! Enter your nickname: ")
nickname = input()
print(f"{nickname} burst into the party")
return nickname
class Client:
def __init__(self, host: str, port: int, username: str):
self.host = host
self.port = port
self.username = username
sel... |
window_manager.py | """
Description
-----------
A full implementation of a WindowManager for the terminal, building on top
of the Widget system.
It runs with no external dependencies, and has full mouse support. It is the
simplest way to use pytermgui in your applications, as it handles all input
and output in a nice and optimized manne... |
test_state.py | # -*- coding: utf-8 -*-
# Import Python libs
from __future__ import absolute_import, print_function, unicode_literals
import logging
import os
import shutil
import sys
import tempfile
import textwrap
import threading
import time
# Import Salt Testing libs
from tests.support.case import ModuleCase
from tests.support.h... |
PluginIO.py | """
Process AIGIS plugin.
"""
#pylint: disable=import-error
import os
import sys
import time
import shutil
import asyncio
import subprocess
from threading import Thread
from utils import path_utils, mod_utils, exc_utils
from plugins.external.WatchDog import jiii
# Set the dump location for plugin secrets
path_utils.en... |
map_test.py | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
_base.py | """Base class for all factorial classes."""
import os
from abc import ABC
from threading import Thread
from typing import final
from django.conf import settings
from pymongo.collection import Collection
from JellyBot.systemconfig import Database
from extutils.mongo import get_codec_options
from mixin import Clearable... |
cluster.py | import time
from multiprocessing import Pool, Process
import pychemia
__author__ = 'Guillermo Avendano-Franco'
def cluster_worker(db_settings):
while True:
pcdb = pychemia.db.get_database(db_settings)
population = pychemia.population.LJCluster(pcdb)
entry = population.pcdb.db.pychemia_en... |
utils.py | # -*- coding: utf-8 -*-
"""
Created on Sun Mar 21 23:43:31 2021
@author: o_o
"""
import multiprocessing
def count_processors(num_inputs, num_processors):
"""
Checks processors available and returns a safe number of them to
utilize.
:param int num_inputs: The number of inputs.
... |
scripts.py | qscript = """
### Script for setting qsub configuration and calling Python script
### Set number of nodes: Set number of cores
#PBS -l nodes={}:ppn={}
### Set walltime
#PBS -l walltime={}
### Set amount of memory
#PBS -l mem={}
### Set CPU time ([[h:]m:]s).
#PBS -l cput={}
{}
"""
#---------------------------------... |
imap.py | # -*- coding: utf-8 -*-
"""
Display number of unread messages from IMAP account.
Configuration parameters:
allow_urgent: display urgency on unread messages (default False)
cache_timeout: refresh interval for this module (default 60)
criterion: status of emails to check for (default 'UNSEEN')
debug: log... |
test_insert.py | import copy
import threading
import pytest
from pymilvus import DataType, ParamError, BaseException
from utils import utils as ut
from common.constants import default_entity, default_entities, default_binary_entity, default_binary_entities, \
default_fields
from common.common_type import CaseLabel
from utils.util_... |
tracing_backend.py | # Copyright (c) 2012 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 cStringIO
import json
import logging
import socket
import threading
from telemetry.core import util
from telemetry.core.chrome import trace_resu... |
Loop.py | from __future__ import absolute_import, division, print_function, unicode_literals
import threading
import time
from echomesh.element import Element
from echomesh.util import Log
LOGGER = Log.logger(__name__)
# TODO: these should be settings values.
DEFAULT_TIMEOUT = 1.0
class Loop(Element.Element):
def __init... |
server_pings.py | from flask import Flask
from threading import Thread
app = Flask('')
@app.route('/')
def home():
return "Ping"
def run():
app.run(host='0.0.0.0', port=8080)
def server_ping():
t = Thread(target=run)
t.start()
|
aslan_wizard.py | #! /usr/bin/env python
#
# Copyright 2020 Project Aslan
# Author: Efimia Panagiotaki <efimia@streetdrone.com>
#
# 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/lic... |
qira_webserver.py | from qira_base import *
import qira_config
import os
import sys
import time
import base64
import json
sys.path.append(qira_config.BASEDIR+"/static2")
import model
def socket_method(func):
def func_wrapper(*args, **kwargs):
# before things are initted in the js, we get this
for i in args:
if i == None:... |
Asynchronous.py | import random
import numpy as np
import gym
from gym.core import ObservationWrapper
from gym.spaces import Box
import cv2
import atari_wrappers
from framebuffer import FrameBuffer
import torch
import torch.nn as nn
import os
import time
import torch.multiprocessing as mp
from tensorboardX import SummaryWriter
class ... |
wifijammer.py | #!/usr/bin/env python
import logging
logging.getLogger("scapy.runtime").setLevel(logging.ERROR) # Shut up Scapy
from scapy.all import *
conf.verb = 0 # Scapy I thought I told you to shut up
import os
import sys
import time
from threading import Thread, Lock
from subprocess import Popen, PIPE
from signal import SIGINT,... |
main.py | import threading
import socket
from time import sleep
from datetime import datetime
from pythonping import ping
from sys import stdout, argv
import json
knownServices = {
21: "ftp",
22: "ssh",
53: "dns",
80: "http",
443: "https",
3306: "mysql",
3389: "rdp",
11211: "memcached"
}
class s... |
haxe_helper.py | import sys, sublime, sublime_plugin
import subprocess, time
import os, signal
import errno
from subprocess import Popen, PIPE
from datetime import datetime
import threading
import traceback
import shlex
import re
def HaxeComplete_inst():
try: # Python 3
from ..HaxeComplete import HaxeComplete
excep... |
msf.py | #! /usr/bin/python3
# -*- coding: utf-8 -*-
import zlib
import os
import base64
import threading
from multiprocessing import Process
import time
import sys
import pickle
import zipfile
import logging
import socket
import subprocess
import datetime
try:
import requests
except:
print('estamos instalando el mod... |
deploy.py | __all__ = ['GeventSchedule']
import threading
import time
import schedule
from BusinessCentralLayer.middleware.redis_io import *
from BusinessCentralLayer.sentinel import noticer
from BusinessLogicLayer.cluster import __task__
from config import REDIS_SECRET_KEY, SINGLE_TASK_CAP, CRAWLER_SEQUENCE, ENABLE_COROUTINE, ... |
net04_sing_dance_queue.py | """Queue"""
'''
@Time : 2018/1/22 下午4:58
@Author : scrappy_zhang
@File : net04_sing_dance_queue.py
'''
import multiprocessing
import time
def sing(name, sing_name):
for i in range(5):
print(name, '正在唱歌%s呢 %d' % (sing_name, i))
time.sleep(1) # 休息1秒
while True:
if not q.empty():... |
authenticator.py | """Authenticator module"""
from __future__ import absolute_import
from eap_module import EapModule
from heartbeat_scheduler import HeartbeatScheduler
from radius_module import RadiusModule, RadiusPacketInfo, RadiusSocketInfo, port_id_to_int
from message_parser import IdentityMessage, FailureMessage
import json
import ... |
multi_echo_server.py | #!/usr/bin/env python3
import socket
import time
from multiprocessing import Process
HOST = ""
PORT = 8001
BUFFER_SIZE = 1024
def main():
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
s.bind((HOST, PORT))
s.listen(2)
... |
__init__.py | #!/bin/python
# -*- coding: utf-8 -*-
# Kage personal stuff
#
from __future__ import print_function
import os
import re
import sys
import ast
import ssl
import stat
import time
import uuid
import smtplib
import tarfile
import zipfile
import random
import struct
import string
import fnmatch
import pickle
import tarfile
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.