source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
plotting.py | """Pyvista plotting module."""
import pathlib
import collections.abc
from functools import partial
import logging
import os
import time
import warnings
import weakref
from functools import wraps
from threading import Thread
import imageio
import numpy as np
import scooby
import vtk
from vtk.util import numpy_support ... |
autoencoder.py | import os
import keras.backend as k
from keras.layers import Conv2D, Input, Dense, Reshape, LeakyReLU, Flatten, Cropping2D
from keras.optimizers import Adam
from keras.models import Model
from train_model_cli_dcgan_v2 import set_vram_growth
from pixel_shuffler import PixelShuffler
from cv2 import imdecode, imread, imwr... |
tk_raw_analy_ver0.4.py |
## 영상 처리 및 데이터 분석 툴
from tkinter import *; import os.path ;import math
from tkinter.filedialog import *
from tkinter.simpledialog import *
## 함수 선언부
def loadImage(fname) :
global window, canvas, paper, filename, inImage, outImage, inW, inH, outW, outH
fsize = os.path.getsize(fname) # 파일 크기 확인
inH... |
__init__.py | #!/usr/bin/python3 -OO
# Copyright 2007-2021 The SABnzbd-Team <team@sabnzbd.org>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any late... |
filemanager.py | # -*- coding: utf-8 -*-
"""
File Manager
============
Copyright (c) 2019 Ivanov Yuri
For suggestions and questions:
<kivydevelopment@gmail.com>
This file is distributed under the terms of the same license,
as the Kivy framework.
A simple manager for selecting directories and files.
Example
-------
from kivy.app ... |
client.py | import asyncio
import logging
import sys
import time
from threading import Thread, Event
from typing import Union, List, Tuple
from asyncio import Transport, Protocol
from bs4 import BeautifulSoup
import kik_unofficial.callbacks as callbacks
import kik_unofficial.datatypes.exceptions as exceptions
import kik_unofficia... |
nyx_lambda.py | """
NYX LAMBDA
====================================
Runs code stored in notebooks using two triggers:
* Interval
* Message received
VERSION HISTORY
===============
* 27 Nov 2019 1.0.16 **AMA** First version
* 30 Nov 2019 1.0.17 **AMA** Common Section added
* 11 Feb 2020 1.1.0 **AMA** Linked with elastic helper tha... |
client.py | import socket
import threading
import json
from cmd import Cmd
class Client(Cmd):
"""
客户端
"""
prompt = ''
intro = '[Welcome] 简易聊天室客户端(Cli版)\n' + '[Welcome] 输入help来获取帮助\n'
def __init__(self):
"""
构造
"""
super().__init__()
self.__socket = socket.socket(so... |
pre_commit_linter.py | # coding: utf-8
#
# Copyright 2014 The Oppia Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... |
amber_clustering.py | #!/usr/bin/env python3
#
# AMBER Clustering
import os
from time import sleep
import yaml
import ast
import threading
import multiprocessing as mp
import numpy as np
from astropy.time import Time, TimeDelta
import astropy.units as u
from astropy.coordinates import SkyCoord
from darc import DARCBase, VOEventQueueServe... |
client_runner.py | import json
import os
import subprocess
import sys
import tempfile
import threading
import time
from collections import deque
from typing import Optional, Dict, Any
import ray
from ray_release.anyscale_util import LAST_LOGS_LENGTH
from ray_release.cluster_manager.cluster_manager import ClusterManager
from ray_release... |
messager.py | import queue
from threading import Thread, Lock
from typing import List, Tuple, Set, Dict, Any
import json
MessageType = Tuple[str, str]
Instruction = Tuple[str, Any]
class MessageWorker:
def __init__(self) -> None:
self.queue: "queue.Queue[Instruction]" = queue.Queue(256)
def start(self) -> None:
... |
p2p_server.py | def p2p_server(task_id):
class RequestHandler(myRequestHandler):
def do_POST(self):
global delegates_aswers
content_len = int(self.headers.get('content-length', 0))
post_body = self.rfile.read(content_len)
received_uuid = ""
received_mess... |
helpers.py | #!/usr/bin/env python
'''
Gintaras Grebliunas
combinacijus@gmail.com
Helper code
'''
import rospy
from std_msgs.msg import String
class IsFresh:
'''
Class for tracking if variables/etc are fresh (updated recently)
'''
def __init__(self, timeout, prefix, audio=True):
'''
@par... |
run.py | from time import sleep
from threading import Thread
from virtual_modi import VirtualBundle
vb = VirtualBundle()
vb.open()
def idle():
sleep(0.01)
Thread(target=idle, daemon=True).start()
while True:
sleep(0.01)
|
__init__.py | # -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making BK-LOG 蓝鲸日志平台 available.
Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
BK-LOG 蓝鲸日志平台 is licensed under the MIT License.
License for BK-LOG 蓝鲸日志平台:
------------------------------------------------... |
run.py | import argparse
import json
import os
import torch
from time import gmtime, strftime
from train import start_training
import subprocess
import torch.multiprocessing as mp
from torch.multiprocessing import Pool, Process, Manager
torch.backends.cudnn.benchmark = True
if mp.cpu_count() >= 32:
# should only be on ... |
chat_test.py | """Decentralized chat example"""
import argparse
import os
from threading import Thread
# dependency, not in stdlib
from netifaces import interfaces, ifaddresses, AF_INET
import zmq
PORT_RANGE=range(9000, 9010)
def listen(masked, last_octet):
"""listen for messages
masked is the first three parts of an ... |
MyPrint_ReubenPython2and3Class.py | # -*- coding: utf-8 -*-
'''
Reuben Brewer, reuben.brewer@gmail.com, www.reubotics.com
Apache 2 License
Software Revision D, 08/29/2021
Verified working on: Python 2.7 and 3.7 for Windows 8.1 64-bit and Raspberry Pi Buster (no Mac testing yet).
'''
__author__ = 'reuben.brewer'
import os, sys, platform
i... |
pipes_test.py | from multiprocessing import Process, Pipe
def f(conn):
conn.send([42, None, 'hello'])
conn.close()
if __name__ == '__main__':
parent_conn, child_conn = Pipe()
p = Process(target=f, args=(child_conn,))
p.start()
print(parent_conn.recv()) # prints "[42, None, 'hello']"
p.join()
|
mpy_fuse.py | """
Module to mount a micropython device as fuse-filesystem.
"""
import os
import re
from multiprocessing import Process
from fuse import FUSE, FuseOSError, Operations
from mpy_device import MpyDevice, MpyDeviceError
class MpyFuseOperations(Operations):
def __init__(self, device):
self.board = device
... |
multi_process_executor.py | # Copyright (c) 2021-2022, NVIDIA CORPORATION. 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 ... |
customserver.py | from __future__ import annotations
import functools
import logging
import os
import websockets
import asyncio
import socket
import threading
import time
import random
from .models import *
from MultiServer import Context, server, auto_shutdown, ServerCommandProcessor, ClientMessageProcessor
from Utils import get_pu... |
rest-server.py | #!flask/bin/python
from flask import Flask, jsonify, abort, request, make_response, url_for
from flask.ext.httpauth import HTTPBasicAuth
import threading
import serial
ser = serial.Serial('/dev/cu.usbmodem1421')
app = Flask(__name__, static_url_path = "")
auth = HTTPBasicAuth()
brewing = False
def start_brew():
... |
test_threading_local.py | # this is http://svn.python.org/view/python/trunk/Lib/test/test_threading_local.py?view=markup&pathrev=78336
# although we do have test_patched_local.py, it does not have all the tests that this file has
from gevent import monkey; monkey.patch_all()
import unittest
from doctest import DocTestSuite
try:
from test im... |
ib_gateway.py | """
IB Symbol Rules
SPY-USD-STK SMART
EUR-USD-CASH IDEALPRO
XAUUSD-USD-CMDTY SMART
ES-202002-USD-FUT GLOBEX
"""
from copy import copy
from datetime import datetime
from queue import Empty
from threading import Thread, Condition
from typing import Optional
import shelve
from tzlocal import get_localzone
from ib... |
.py | import numpy as np
from timeit import default_timer as timer
from numba import vectorize
from multiprocessing import Process, Lock
import time
import tkinter as tk
@vectorize(['float64(float64, float64)'], target='cuda')
def pow_gpu(a, b):
c = a b
for j in range(25):
c = c (1 / b)
c = c ... |
bm_go.py | """
Go board game
"""
import math
import multiprocessing as mp
from mpkmemalloc import *
import os
import gc
import threading
import psutil
import random
import pyperf
SIZE = 9
GAMES = 200
KOMI = 7.5
EMPTY, WHITE, BLACK = 0, 1, 2
SHOW = {EMPTY: '.', WHITE: 'o', BLACK: 'x'}
PASS = -1
MAXMOVES = SIZE * SIZE * 3
TIMEST... |
dx_update_env.py | #!/usr/bin/env python
# Corey Brune - Feb 2017
# Description:
# Update Environment
#
# Requirements
# pip install docopt delphixpy.v1_8_0
# The below doc follows the POSIX compliant standards and allows us to use
# this doc to also define our arguments for the script.
"""Description
Usage:
dx_update_env.py (--pw <na... |
utils.py | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
"""Utilities for benchmark tests."""
import os
import multiprocessing as multiprocessing
from multiprocessing import Process
from superbench.benchmarks import BenchmarkRegistry
from superbench.common.utils import network
def clean_simulated_d... |
task.py | import json
import importlib
import datetime
import threading
from loguru import logger
from chronos.metadata import Task, Session
from chronos.event import event
def dispatch_task(task_id, task_arguments, task_priority="ROUTINE"):
session = Session()
task = Task(
task_id=task_id,
task_argum... |
app.py | # encoding: utf-8
'''
A REST API for Salt
===================
.. versionadded:: 2014.7.0
.. py:currentmodule:: salt.netapi.rest_cherrypy.app
:depends:
- CherryPy Python module. Version 3.2.3 is currently recommended when
SSL is enabled, since this version worked the best with SSL in
internal testing.... |
pholus.py | #!/usr/bin/python
from scapy.all import *
import argparse
import re
import binascii
import random
import multiprocessing
import logging
import itertools
from scapy.utils import PcapWriter
sys.setrecursionlimit(30000)
logging.getLogger("scapy.runtime").setLevel(logging.ERROR)#supress Scapy warnings`
##################... |
test_errno.py | import unittest, os, errno
from ctypes import *
from ctypes.util import find_library
try:
import threading
except ImportError:
threading = None
class Test(unittest.TestCase):
def test_open(self):
libc_name = find_library("c")
if libc_name is None:
raise unittest.SkipTest("Unable... |
CLI.py | try:
import cmd, struct, serial, ctypes, threading, Queue, binascii, sys, glob, subprocess, errno
import datetime, time, os
import math
import socket
import m2m2_server
from cobs import cobs
from m2m2_common import *
import colorama as cr
import array as arr
import tqdm
impor... |
MyClass.py | # encoding:utf-8
from flask import render_template, request
from os import path
from os import system
import threading
import os
import sys
import time
from db import Db
from plugins.pornhub import Pornhub
class Server():
def __init__(self, workpath):
self.workpath=workpath
self.homeroot = workpath+'/static/'
... |
debug_listener.py | #!/usr/bin/env python
from evdev import InputDevice, list_devices, categorize, ecodes
from time import sleep
import threading
def listen_for_events(dev):
for event in dev.read_loop():
if event.type == ecodes.EV_KEY:
print dev.name+": "+str(categorize(event))
devices = [InputDevice(fn) for fn ... |
callback_api.py | from app import mythic
import app
from sanic.response import json, raw
from app.database_models.model import (
Callback,
Task,
LoadedCommands,
PayloadCommand,
)
from sanic_jwt.decorators import scoped, inject_user
import app.database_models.model as db_model
from sanic.exceptions import abort... |
pacmen.py | #!/usr/bin/python3
from time import sleep
from os import system
from threading import Thread
def show_memory_usage():
system("free")
sleep(1)
thread = Thread(target=show_memory_usage)
thread.start()
memory = list()
while(True):
memory.append("a")
|
test_workflow_docker.py | """Tests running docker workflows"""
import json
import os
import shutil
import subprocess
import tempfile
from threading import Event, Thread
import time
from typing import Optional, Union
from collections.abc import Callable, Iterable
import pytest
# pylint: disable=global-statement,protected-access
# Path to the ... |
TimerServer.py | import os
import json
import signal
from threading import Thread
import asyncio
import time
import socket
import re
import traceback
class TimerClientInstance:
def __init__(self, parent, c, addr):
self.parent = parent
self.clientSocket: socket.socket = c
self.addr = addr
self.runni... |
main.py | import threading
import Xlib
from Xlib.display import Display
from Xlib import X, XK
from Xlib.protocol import event
from normal import normal_mode
class Manager():
def __init__(self, inkscape_id):
self.id = inkscape_id
self.disp = Display()
self.screen = self.disp.screen()
self.ro... |
youtube-dl-server.py | """Web app wrapping around youtube-dl."""
import json
import logging
import os
import pprint
import string
import subprocess
import textwrap
import time
import unicodedata
from collections import defaultdict
from functools import partial, wraps
from pathlib import Path
from queue import Queue
from threading import Thre... |
scrape_ib.py | # Gist example of IB wrapper from here: https://gist.github.com/robcarver17/f50aeebc2ecd084f818706d9f05c1eb4
#
# Download API from http://interactivebrokers.github.io/#
# (must be at least version 9.73)
#
# Install python API code /IBJts/source/pythonclient $ python3 setup.py install
#
# Note: The test cases, and the d... |
main.py | # (c) @dasqinnagiyev
import asyncio
from configs import Config
from multiprocessing import Process
from pyrogram import Client, filters
from dasqin.livestatus import GetLiveStatus
from pyrogram.types import Message
Bot0 = Client(
session_name="Looped-Session",
api_id=Config.API_ID,
api_hash=Config.API_HAS... |
test_mixed.py | import asyncio
import contextlib
import sys
import threading
import pytest
import janus
class TestMixedMode:
@pytest.mark.skipif(
sys.version_info < (3, 7),
reason="forbidding implicit loop creation works on "
"Python 3.7 or higher only",
)
def test_ctor_noloop(self):
wit... |
__init__.py | # Copyright (c) PyZMQ Developers.
# Distributed under the terms of the Modified BSD License.
import platform
import sys
import time
from threading import Thread
from typing import List
from unittest import SkipTest, TestCase
from pytest import mark
import zmq
from zmq.utils import jsonapi
try:
import gevent
... |
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... |
_run.py | from profil3r.app.colors import Colors
import threading
def run(self):
# Get arguments from the command line
self.parse_arguments()
self.load_config()
self.print_logo()
self.menu()
self.get_permutations()
# Number of permutations to test per service
print(Colors.BOLD + "[+]" + Co... |
pump.py | #!/usr/bin/env python
import os
import base64
import copy
import http.client
import logging
import re
import queue
import json
import string
import sys
import threading
import time
import urllib.request, urllib.parse, urllib.error
import urllib.parse
import zlib
import platform
import subprocess
import socket
import s... |
runners.py | # -*- coding: utf-8 -*-
import locale
import os
import struct
from subprocess import Popen, PIPE
import sys
import threading
import time
import signal
from .util import six
# Import some platform-specific things at top level so they can be mocked for
# tests.
try:
import pty
except ImportError:
... |
test_tracer.py | # -*- coding: utf-8 -*-
"""
tests for Tracer and utilities.
"""
import contextlib
import multiprocessing
import os
from os import getpid
import threading
from unittest.case import SkipTest
import mock
import pytest
import six
import ddtrace
from ddtrace.constants import ENV_KEY
from ddtrace.constants import HOSTNAME_... |
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... |
anomaly_detection.py | # Flask app that acts as a sample application for the OPC UA Monitoring Brokers.
# It periodically gets values from the brokers via grpc, detects whether they are anomaly values by comparing
# them to the training data set (data.csv) using Local Outlier Factor, and displays a log of the values on a
# web server, showin... |
train.py | import argparse
import logging
import math
import os
import random
import time
from pathlib import Path
from threading import Thread
import numpy as np
import torch.distributed as dist
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
import torch.optim.lr_scheduler as lr_scheduler
impo... |
Wallet.py | #!/usr/bin/env python3
##########################################
# Duino-Coin Tkinter GUI Wallet (v2.52)
# https://github.com/revoxhere/duino-coin
# Distributed under MIT license
# © Duino-Coin Community 2019-2021
##########################################
import sys
from base64 import b64decode, b64encode
fr... |
decoder.py | from __future__ import division # float division of integers
from collections import deque
import pyaudio
import struct
import math
import numpy
import sys
import threading
from config import *
TWOPI = 2 * math.pi
WINDOW = numpy.hamming(CHUNK_SIZE)
class Decoder:
def __init__(self, debug):
self.win_len = 2... |
test_util.py | # Copyright 2017 theloop, 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... |
ip.py | """
ip.py:
Module containing a comm-layer adapter for the Tcp/UDP/IP stack. This pairs with the F prime component "SocketIpDriver"
in order to read data being sent via Tcp or Udp. This is the default adapter used by the system to handle data sent
across a Tcp and/or UDP network interface.
@author lestarch
"""
import ... |
dl.py | #!/usr/bin/env python3
import os
import argparse
import logging
import threading
from string import ascii_lowercase, ascii_uppercase
from urllib import request, error
def create_directory(path):
if path is not None:
directory = path
else:
directory = os.path.join(os.path.curdir + '/files/')
... |
trezor.py | import traceback
import sys
from typing import NamedTuple, Any, Optional, Dict, Union, List, Tuple, TYPE_CHECKING
from electrum.util import bfh, bh2u, versiontuple, UserCancelled, UserFacingException
from electrum.bip32 import BIP32Node, convert_bip32_path_to_list_of_uint32 as parse_path
from electrum import constants... |
utils.py | from collections import OrderedDict
from multiprocessing import Queue, Process
import ast
import numpy as np
import tensorflow as tf
import torch as th
from stable_baselines.common.vec_env import VecEnv, VecNormalize, DummyVecEnv, SubprocVecEnv, VecFrameStack
from environments import ThreadingType
from environments.u... |
thread_with_function.py |
import time
from threading import Thread
#create function for thread
def Tfunc(i):
print("%d sleeping 5 sec from thread\n" % i)
time.sleep(5)
print("\n %d finished sleeping from thread" % i)
#start the thread for function
for i in range(5):
t1 = Thread(target=Tfunc, args=(i,))
t1.start()
|
main.py | # Copyright (c) 2013 - 2020 Adam Caudill and Contributors.
# This file is part of YAWAST which is released under the MIT license.
# See the LICENSE file or go to https://yawast.org/license/ for full license details.
import gc
import locale
import platform
import signal
import ssl
import sys
import threading
import ... |
test_channel.py | #!/usr/bin/python
#
# Server that will accept connections from a Vim channel.
# Used by test_channel.vim.
#
# This requires Python 2.6 or later.
from __future__ import print_function
import json
import socket
import sys
import threading
try:
# Python 3
import socketserver
except ImportError:
# Python 2
... |
server.py | from __future__ import unicode_literals
import os
import threading
import logging
import bottle
import kvaut.automator.factory as factory
@bottle.get("/ping")
def ping():
if get_root_widget() is None:
bottle.abort(503, "Still booting up, try again later")
return 'Ping!'
@bottle.get("/tree")
def tr... |
remote.py | '''
Buildozer remote
================
.. warning::
This is an experimental tool and not widely used. It might not fit for you.
Pack and send the source code to a remote SSH server, bundle buildozer with it,
and start the build on the remote.
You need paramiko to make it work.
'''
__all__ = ["BuildozerRemote"]
... |
test_decimal.py | # Copyright (c) 2004 Python Software Foundation.
# All rights reserved.
# Written by Eric Price <eprice at tjhsst.edu>
# and Facundo Batista <facundo at taniquetil.com.ar>
# and Raymond Hettinger <python at rcn.com>
# and Aahz (aahz at pobox.com)
# and Tim Peters
"""
These are the test cases for... |
main.py | import os
import time
import psutil
import logging
import datetime
import coloredlogs
import numpy as np
from argparse import ArgumentParser
from multiprocessing import Process
from preprocessing.embedding.facenet import Facenet
from preprocessing.feature_extraction import Features
from core.flicker import Flicker
... |
generate_data_opensource.py | import os
import sys
import importlib
import logging
import time
import argparse
from uuid import uuid1
import pickle
import platform, multiprocessing
import random
sys.path.append("../")
from gobigger.server import Server
from gobigger.render import RealtimeRender, RealtimePartialRender, EnvRender
from gobigger.agent... |
pickletester.py | import collections
import copyreg
import dbm
import io
import functools
import os
import math
import pickle
import pickletools
import shutil
import struct
import sys
import threading
import unittest
import weakref
from textwrap import dedent
from http.cookies import SimpleCookie
try:
import _testbuffer
except Impo... |
socket_handler.py | '''
File: socket_handler.py
Description: Socket handling mechanism for the bolt client
Author: Saurabh Badhwar <sbadhwar@redhat.com>
Date: 13/10/2017
'''
import os
import socket
import threading
class SocketHandler(object):
"""Socket handling mechanism for the bolt client
Socket Handler is responsible for han... |
forest_vis.py | #!/usr/bin/env python2.7
"""
This node visualizes what the field dispensers should be doing.
"""
import lcm
import forseti2 as fs2
import pygame
import time
import threading
import settings
SERVO_RELEASED = False
RED = 0
YELLOW = 1
GREEN = 2
SERVO = 3
WIDTH=640
HEIGHT=480
DSIZE=80
SSIZE=40
class DispenserDisplay:
... |
test_mlt_base.py | # -*- coding:utf-8 -*-
from __future__ import absolute_import
from __future__ import print_function
from __future__ import division
import os
import sys
import tensorflow as tf
import cv2
import numpy as np
import math
from tqdm import tqdm
import argparse
from multiprocessing import Queue, Process
from utils import... |
ansiblelaunchserver.py | # Copyright 2014 OpenStack Foundation
#
# 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... |
updateCheck.py | #updateCheck.py
#A part of NonVisual Desktop Access (NVDA)
#This file is covered by the GNU General Public License.
#See the file COPYING for more details.
#Copyright (C) 2012-2018 NV Access Limited, Zahari Yurukov, Babbage B.V.
"""Update checking functionality.
@note: This module may raise C{RuntimeError} on i... |
python_c.py | import threading
import ctypes
def deadloop():
while True:
pass
lib=ctypes.cdll.LoadLibrary("./deadloop.so") # open the library
t=threading.Thread(target=lib.deadloop) # use the "deadloop" function in the lib
t.start()
deadloop()
|
convRockstar.py | import numpy as np
import time
import multiprocessing as mp
import array
def convRockstarToMTF(snapColName,numProgName,redshiftColName,startSnap,endSnap,treefilelist,fieldsDict):
Redshift,MTFdata = LoadRockstarIntoMTF(snapColName,numProgName,redshiftColName,startSnap,endSnap,treefilelist,fieldsDict)
MTFdata = con... |
netattack2.py | #!/usr/bin/env python
import os
import sys
import socket
import logging
from threading import Thread
import socket
from time import sleep
from subprocess import Popen, PIPE
# COLORS
B, R, Y, G, N = '\33[94m', '\033[91m', '\33[93m', '\033[1;32m', '\033[0m'
# making scapy quite
logging.getLogger('scapy.runtime').setLe... |
TCPSocket.py | #! /usr/bin/python3
import random
import datetime
import time
import fcntl
from IP.IPSocket import *
from tcp.TCPPacket import *
import threading
class TCPSocket:
def __init__(self):
self.socket = None
self.connected = False
self.src = (get_ip(), random.randrange(0, 1 << 16))
self... |
serialTest.py | from __future__ import print_function
import time
import serial
import threading
class Threads():
def __init__(self):
self.kill = 1
self.ser = serial.Serial(
port='/dev/ttyS0',
baudrate=9600,
parity=serial.PARITY_NONE,
stopbits=serial.STOPBITS_ONE,
bytesize=serial.EIGHTBITS,
timeout=1
)
... |
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... |
test_writer.py | import os
import socket
import tempfile
import threading
import time
import mock
import msgpack
import pytest
from ddtrace.compat import PY3
from ddtrace.compat import get_connection_response
from ddtrace.compat import httplib
from ddtrace.constants import KEEP_SPANS_RATE_KEY
from ddtrace.internal.uds import UDSHTTPC... |
marathon-bigip-ctlr.py | #!/usr/bin/env python
#
# Copyright (c) 2017,2018, F5 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 by ... |
TipRemoval V2.py | #python3
#split to 15-mers
import sys
import threading
sys.setrecursionlimit(10**6)
threading.stack_size(2**26)
class Node():
def __init__(self):
self.visited = False
self.area = None
self.pre = None
self.post = None
def loadReads():
reads = []
for _ in range(numReads):
r... |
SmSh.py | from threading import Thread
from subprocess import Popen, PIPE
import pandas as pd
import numpy as np
from typing import List
from tensorflow.python.keras.models import load_model
from datetime import datetime
from sklearn.preprocessing import StandardScaler
import os, signal, time, re
def ApplyCommand(Commande: str)... |
test_ftplib.py | """Test script for ftplib module."""
# Modified by Giampaolo Rodola' to test FTP class, IPv6 and TLS
# environment
import ftplib
import asyncore
import asynchat
import socket
import io
import errno
import os
import time
try:
import ssl
except ImportError:
ssl = None
from unittest import TestCase, skipUnless
... |
server.py | '''
Created on Feb 14, 2019
@author: jcorley
'''
import unittest, zmq, json, time
from threading import Thread
from request_server import server, constants
class TestServer(unittest.TestCase):
def setUp(self):
serverThread = Thread(target=server.main, args=(constants.PROTOCOL, constants.IP_... |
gui.py | import os
import sys
from flexx import flx, event
import threading
from tornado.web import StaticFileHandler, RequestHandler
import time
from flexx.ui.widgets import Widget
import asyncio
from bson.objectid import ObjectId
import json
import frontend.benplot as bp
import frontend.stock_analytics as salib
import copy
i... |
195307adc18e21727f09c231bd2e88de_interface.py | """Interface class for Chapter on Distributed Computing
This implements an "interface" to our network of nodes
"""
import time
import uuid
from threading import Thread
import zmq
from zmq.eventloop.ioloop import IOLoop, PeriodicCallback
from zmq.eventloop.zmqstream import ZMQStream
import udplib
# ================... |
server.py | # Computer Communications Homework I
# Hakan Eröztekin
# 150130113
# 3.10.18
import socket
import sys
import asyncore
from _thread import start_new_thread
from threading import Thread
import datetime
import collections
import logging
import socket
class Server():
is_first_connection = True
clients = {}
ad... |
app.py | from json import dumps, loads
from os import environ
from threading import Thread
from flask import Flask, request
from pika import BlockingConnection, ConnectionParameters
from helpers import json_respone
from lofar import stage_entrypoint, status_entrypoint
### Config
amqp_host = environ['AMQP_HOST']
amqp_exchang... |
test_collector.py | """Test theia collector module.
"""
import asyncio
from datetime import datetime
from unittest import mock
from websockets import WebSocketClientProtocol as WebSocket
from theia.collector import LiveFilter, Live, Collector
from theia.model import Event, EventSerializer
from theia.storeapi import EventStore
_WAIT_TIME... |
test_pv_scale_and_respin_ceph_pods.py | """
PV Create with ceph pod respin & Memory Leak Test: Test the PVC limit
with 3 worker nodes create PVCs and check for memory leak
TO DO: This Test needs to be executed in Scaled setup,
Adding node scale is yet to be supported.
"""
import logging
import pytest
import threading
import time
from ocs_ci.helpers import h... |
test_heterograph.py | import dgl
import dgl.function as fn
from collections import Counter
import numpy as np
import scipy.sparse as ssp
import itertools
import backend as F
import networkx as nx
import unittest, pytest
from dgl import DGLError
import test_utils
from test_utils import parametrize_dtype, get_cases
from utils import assert_is... |
datasets_rl.py | import glob
import math
import os
import random
import shutil
import time
from pathlib import Path
from threading import Thread
import cv2
import numpy as np
import torch
from PIL import Image, ExifTags
from torch.utils.data import Dataset
from tqdm import tqdm
from yolov5.utils.general_rl import xyxy2xywh, xywh2xyxy... |
weather_prediction.py | import threading
import time
from datetime import datetime
import pyodbc
import board
import busio
import adafruit_bme280
#weather variables
minTemp = 1000
maxTemp = 0
temp9am = 0
temp3pm = 0
humidity9am = 0
humidity3pm = 0
pressure9am = 0
pressure3pm = 0
mlp = 0.0
tl = 0
now = datetime.now().time()
i2c = busio.I2C(... |
basis.py | from bandits import *
from solvers import *
from multiprocessing import Process, Queue
from threading import Thread
from queue import Empty
from queue import Queue as ThreadQueue
import os
import typing as tp
from tqdm import tqdm
import matplotlib.pyplot as plt
import struct
import numpy as np
import pickle
class Ex... |
test_eap_proto.py | # EAP protocol tests
# Copyright (c) 2014-2015, Jouni Malinen <j@w1.fi>
#
# This software may be distributed under the terms of the BSD license.
# See README for more details.
import binascii
import hashlib
import hmac
import logging
logger = logging.getLogger()
import select
import struct
import threading
import time... |
clock.py | #!/usr/bin/env python3
from gi.repository import GLib
import subprocess
import threading
from datetime import datetime
from nwg_panel.tools import check_key
import gi
gi.require_version('Gtk', '3.0')
gi.require_version('Gdk', '3.0')
from gi.repository import Gtk, Gdk
class Clock(Gtk.EventBox):
def __init__(... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.