source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
ioloop.py | # -*- coding: utf8 -*-
# Copyright (C) 2013 - Oscar Campos <oscar.campos@member.fsf.org>
# This program is Free Software see LICENSE file for details
"""
Minimalist asynchronous network library just to fit Anaconda's needs and
replace the horrible asyncore/asynchat
Example of usage:
import ioloop
class TestClient(... |
benchmarks.py | """
This file is the declaration of benchmarks for HTTPie. It
is also used to run them with the current environment.
Each instance of BaseRunner class will be an individual
benchmark. And if run without any arguments, this file
will execute every benchmark instance and report the
timings.
The benchmarks are run throu... |
network.py | import logging
from queue import Queue
from threading import Thread
class NetworkModule(Thread):
def __init__(
self, connexion, receive_queue: Queue, send_queue: Queue, error_queue: Queue
):
Thread.__init__(self)
self.connexion = connexion
self._is_running = False
se... |
__main__.py | # Start Imports
import os
import re
import time
import shutil
import psutil
import requests
import colorama
import subprocess
import bimpy as bp
import config as cfg
import elevate as elevate
# mysql-connector-python
import mysql.connector
from sys import exit
from os import listdir
from colorama import Fore
from os.p... |
test_s3.py | #!/usr/bin/env python3
# Licensed to Crate.io GmbH ("Crate") under one or more contributor
# license agreements. See the NOTICE file distributed with this work for
# additional information regarding copyright ownership. Crate licenses
# this file to you under the Apache License, Version 2.0 (the "License");
# you ma... |
agent.py | import __future__
import struct
import time
import base64
import subprocess
import random
import time
import datetime
import os
import sys
import trace
import shlex
import zlib
import threading
import BaseHTTPServer
import zipfile
import io
import imp
import marshal
import re
import shutil
import pwd
import socket
impo... |
uds.py | #!/usr/bin/env python3
import time
import struct
from typing import NamedTuple, List
from enum import IntEnum
from queue import Queue, Empty
from threading import Thread
from binascii import hexlify
class SERVICE_TYPE(IntEnum):
DIAGNOSTIC_SESSION_CONTROL = 0x10
ECU_RESET = 0x11
S... |
sham.py | import json
import re
from urllib.parse import parse_qs
import atexit
import threading
from collections import namedtuple
from uuid import uuid4
import logging
from flask import Flask, render_template, request
import waitress
from werkzeug.datastructures import ImmutableMultiDict
from werkzeug.exceptions import Method... |
Multiprocessed_Hashing_Compete_Algo.py | from hashlib import sha256
import time, multiprocessing, os, copy
from Orses_Competitor_Core.Compete_Process import genesis_block
from Orses_Competitor_Core.BlockCreator import GenesisBlockCreator
def competitive_hasher(enc_d):
return sha256(sha256(enc_d).digest()).hexdigest()
def get_qualified_hashes(prime_ch... |
Translator.py | import asyncio
import json
import os
import shutil
import threading
import zipfile
import aiohttp
import requests
from Util import Configuration, GearbotLogging, Emoji
LANGS = dict()
BOT = None
def on_ready(bot_in):
global BOT
BOT = bot_in
load_translations()
def load_translations():
directory = os... |
EDNeutronAssistant.py | import os
import sys
import time
import webbrowser
import tkinter as tk
import tkinter.ttk as ttk
import tkinter.messagebox
import json
import threading
if __name__ == '__main__':
import gui
import utils
import api_access
import menu
__version__ = "v3.1.1"
# Find out run path in current environment
i... |
canibals.py | import logging
import time
import datetime
from threading import Thread, Lock, Event, enumerate
logging.basicConfig(level=logging.DEBUG) #mostrar msg das threads
mutex = Lock() # trava para garantir exclusao mutua
cauldron = 5 # variavel compartilhada entre os canibais e o cooker
canibalServing = 1 ... |
test_pool.py | import threading
import time
from sqlalchemy import pool, select, event
import sqlalchemy as tsa
from sqlalchemy import testing
from sqlalchemy.testing.util import gc_collect, lazy_gc
from sqlalchemy.testing import eq_, assert_raises, is_not_
from sqlalchemy.testing.engines import testing_engine
from sqlalchemy.testing... |
measurePerformance.py | # ########################################################################
# Copyright 2013 Advanced Micro Devices, 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.apach... |
app.py | # Import required libraries
import datetime as dt
import csv
import dash
from dash.dependencies import Output, Input
import dash_core_components as dcc
import dash_html_components as html
import plotly.graph_objs as go
import pandas as pd
from math import log10, floor, isnan
import numpy as np
import logging
from loggi... |
test_data_queue.py | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
import multiprocessing
import time
import numpy as np
import pandas as pd
from torch.utils.data import Dataset, DataLoader
from qlib.rl.utils.data_queue import DataQueue
class DummyDataset(Dataset):
def __init__(self, length):
sel... |
Receive_MainEnvironmentSimulator.py | #Receive_MainEnvironmentSimulator.py
#Environment simulator + REST-Server + AdvantEDGE
#Version:4
#Date:2020-04-15
#Author: Jaime Burbano
#Description: This set of files are used to run the first simulation of the system using AdvantEDGE
#runs with python 3
#python3 MainEnvironmentSimulator v002
#TYPE: HNA-LA... |
multicast.py | # Copyright 2016 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 agre... |
process.py | # -*- coding:utf-8 -*-
# Process Connection, Communication
# 多进程通信
"""
>>> 队列消息:Queue
>>> 管道通信:Pipe (send , recv) 两个函数
>>>
"""
from multiprocessing import Process, Queue
import os
import time
import random
# 写数据进程执行的代码:
def write(q):
print('Process to write: %s' % os.getpid())
for value in ... |
runner.py | import threading
from multiprocessing import Process
import json
import socket
import asyncio
import logging
import sys
from resources.commands import build_porter_command, build_porter_command_for_outputs
from shared.config import get_config
from resources.helpers import get_installation_id
from resources.httpserver i... |
test_thread.py | # Test Threads. Count process threads using "top M pid | wc -l".
import logging
import threading
import time
def thread_function(name, life_time):
logging.info("Thread %s: starting", name)
x = life_time
while x > 0:
logging.info("Thread %s: tick", name)
time.sleep(1)
x -= 1
log... |
ClointFusion.py | # Project Name: ClointFusion
# Project Description: A Python based RPA Automation Framework for Desktop GUI, Citrix, Web and basic Excel operations.
# Code Authors: Mayur Patil, Murali M V P
# Code Contributors: Avinash, Fharook
# Code Structure
# 1. All imports
# 2. All global variables
# 3. All function defi... |
dokku-installer.py | #!/usr/bin/env python3
import cgi
import json
import os
import re
try:
import SimpleHTTPServer
import SocketServer
except ImportError:
import http.server as SimpleHTTPServer
import socketserver as SocketServer
import subprocess
import sys
import threading
VERSION = 'v0.20.4'
def bytes_to_string(b):
... |
_a4c_stop.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... |
QSubprocessor.py | import multiprocessing
import sys
import time
import traceback
from PyQt5.QtCore import *
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *
from core.interact import interact as io
from .qtex import *
class QSubprocessor(object):
"""
"""
class Cli(object):
def __init__ ( self, client... |
tcp_client.py | #!/usr/bin/env python3
from queue import Queue
import socket
from pubsub import pub
from threading import Thread
import time
from message_stream_reconstructor import MessageStreamReconstructor
class HeartbeatManager:
def __init__(self):
#give some time for initialisation of the sockets
self.last_h... |
utils.py | # Copyright (c) 2020 PaddlePaddle 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 appli... |
tb_device_mqtt.py | # Copyright 2020. ThingsBoard
#
# 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 ... |
neurons.py | '''
Created on Sep 20, 2018
@author: Vinu Karthek
'''
import os, math, time, inspect, threading
import tensorflow as tf
import pandas as pd
import numpy as np
from classes import tkinter_app
import matplotlib.pyplot as plt
from tensorflow.contrib.tensorboard.plugins import projector
from tensorflow.examples.tutorials.... |
run-tests.py | #!/usr/bin/env python
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "Li... |
tools.py | # Licensed under a 3-clause BSD style license - see LICENSE.rst
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, unicode_literals, print_function
"""
This file contains utilities to generate test repositories.
"""
import datetime
import io
import os
import threading
import time
import six
im... |
variable_scope_test.py | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
gateway_mqtt.py | """Implement an MQTT gateway."""
import asyncio
import logging
import threading
from mysensors import BaseAsyncGateway, Gateway, Message, ThreadingGateway
_LOGGER = logging.getLogger(__name__)
class BaseMQTTGateway(Gateway):
"""MySensors MQTT client gateway."""
# pylint: disable=too-many-arguments, abstrac... |
compress_images_freq.py | from PIL import Image
import pandas as pd
import os
import threading
from_dir = '/media/tsamsiyu/985A6DDF5A6DBAA0/Users/Dmitry/Downloads/full-frames.tar/full-frames/rtsd-frames'
to_base_dir = 'images/freq'
use_threads = 3
def compress(from_file_path, to_file_path):
img = Image.open(from_file_path)
width, he... |
docker_runner.py | import os
import logging
import pdb
import time
import random
from multiprocessing import Process
import numpy as np
from client import MilvusClient
import utils
import parser
from runner import Runner
logger = logging.getLogger("milvus_benchmark.docker")
class DockerRunner(Runner):
"""run docker mode"""
def... |
st_cnn3d.py | import os
import sys
import inspect
import time
import json
import signal
import numpy as np
from pathlib import Path
from collections import OrderedDict
import pandas as pd
import matplotlib as mpl
import matplotlib.pyplot as plt
import plotly.express as px
import configparser
import webbrowser
from io import BytesIO... |
clibroker.py | """CliBroker implementation.
TODO: Terminal size & auto-word-wrap
Copyright (c) Kiruse 2021. See license in LICENSE."""
from __future__ import annotations
from asyncio import Future as AFuture
from concurrent.futures import Future as CFuture
from getpass import getpass
from threading import Condition, Event, RLock, Thr... |
controllerd.py | #!/usr/bin/env python3
"""
Copyright (c) 2017, Intel Corporation
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions an... |
watcher_monitor.py | # -*- coding: utf-8 -*-
# This code is part of Qiskit.
#
# (C) Copyright IBM 2017, 2019.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any... |
OscIn.py | import logging, threading
from cfgr.event import Event
DEPS = None # {'osc_server': None, 'dispatcher': None}
def loadDeps():
result = {}
try:
from pythonosc import dispatcher
from pythonosc import osc_server
result['osc_server'] = osc_server
result['dispatcher'] = dispatcher
except ImportError:... |
WebsocketListener.py | #
# WebsocketListener.py
# PulseMonitor
#
# Created by Ashish Ahuja on 24th September 2017.
# This file is licensed under the MIT License.
#
import threading
import logging
import websocket
class WebsocketListener:
def __init__(self, websocket_link, on_message_callback, notifications=None):
self.websock... |
quantanalysis.py | import abcvoting.rules_approval as abc
from abcvoting.preferences import Profile
import matplotlib.pyplot as plt
import random
import numpy as np
from operator import itemgetter
import preflibio
import pickle
import os.path
import abcvoting.score_functions as sf
from gmpy2 import mpq
from scipy import stats
import iter... |
httpclient_test.py | #!/usr/bin/env python
from __future__ import absolute_import, division, print_function, with_statement
import base64
import binascii
from contextlib import closing
import copy
import functools
import sys
import threading
import datetime
from io import BytesIO
from tornado.escape import utf8
from tornado import gen
f... |
day-019-acquire_a_thread_lock-2.7.6.py | #!/usr/bin/env python2
import threading, time
def takeANap():
time.sleep(5)
print('Wake up!')
print('Start of program.')
threadObj = threading.Thread(target=takeANap)
threadObj.start()
print('End of program.')
|
multithread6.py | """
多个线程共享数据 - 有锁的情况
Version: 0.1
Author: 骆昊
Date: 2018-03-20
"""
import time
import threading
class Account(object):
def __init__(self):
self._balance = 0
self._lock = threading.Lock()
def deposit(self, money):
# 获得锁后代码才能继续执行
self._lock.acquire()
try:
n... |
main.py | ##
"""
Augmented Reality Drumset Main Script
"""
## Imports
import cv2
import numpy as np
import time
import pyaudio
import wave
from array import array
from struct import pack
import os
import threading
##
DRUMSOUNDSFOLDER = "drumFiles"
## Playing Drum Sounds
#threads the play function
def drumThreadCreator(fil... |
testMain.py | from threading import Thread
from TargetVision import Vision
from TargetTrack import Target
import time
import pygame
pygame.init()
dis = pygame.display.set_mode((500, 500))
targetVision = Vision()
ball = Target(diameter="35")
ballX = 0
ballZ = 0
clock = pygame.time.Clock()
def update():
cloc... |
Carputer.py | import sys
import traceback
import logging
from OBDController import NoOBDDataException
from threading import Thread, Event
from Queue import Queue
from time import sleep, time, mktime, strptime
class Carputer(object):
def __init__(self, obdcontroller, gpscontroller, oledcontroller, drivedatabase):
# tri... |
road_speed_limiter.py | import json
import os
import select
import threading
import time
import socket
import fcntl
import struct
from threading import Thread
from cereal import messaging, log
from common.numpy_fast import clip
from common.realtime import sec_since_boot
from common.conversions import Conversions as CV
CAMERA_SPEED_FACTOR = 1... |
web_browse.py | """
browser class
take a string
browse the web
"""
import webbrowser as wb
import threading
import re, time
class WebBrowse(object):
key_members = ['http:', 'https:', 'www.']
def __init__(self, is_url = False, pref_browser = None, key_members = None):
if key_members != None: self.k... |
connection.py | # -*- coding: utf-8 -*-
# Copyright: (c) 2019, Jordan Borean (@jborean93) <jborean93@gmail.com>
# MIT License (see LICENSE or https://opensource.org/licenses/MIT)
from __future__ import division
import binascii
import hashlib
import hmac
import logging
import math
import os
import struct
import time
import threading
... |
sink.py | # codplayer - audio sink, typically sound card
#
# Copyright 2014 Peter Liljenberg <peter.liljenberg@gmail.com>
#
# Distributed under an MIT license, please see LICENSE in the top dir.
"""
Classes implementing various audio packet sinks.
"""
import time
import threading
class SinkError(Exception): pass
class Sink(o... |
data.py | # Copyright 2021 Google LLC
#
# 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 law or agreed to in writing, ... |
server.py | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow as tf
import threading
import signal
import math
import os
import logging
import time
import sys
import _pickle as pickle # CPickle
from multiprocessing import Queue
... |
monitor.py | # curio/monitor.py
#
# Debugging monitor for curio. To enable the monitor, create a kernel
# and then attach a monitor to it, like this:
#
# k = Kernel()
# mon = Monitor(k)
# k.run(mon.start)
#
# If using the run() function, you can do this:
#
# run(coro, with_monitor=True)
#
# run() also looks for the CURI... |
views.py | from django.shortcuts import render
from django.http import HttpResponse, HttpResponseRedirect, Http404
from django.urls import reverse
from datetime import datetime
from configuration.views import google_calendar
from .models import Student, PointCodes, PlistCutoff, Grade, Points, LoggedAction
from configuration.model... |
change_vpn.py | #!/usr/bin/python
import subprocess
import os
import random
import time
import threading
import json
import argparse
from flask import Flask
from flask import request
app = Flask("VPN Controller")
argparser = argparse.ArgumentParser(description="VPN changer")
argparser.add_argument('-l', '--location', help='target_lo... |
models.py |
import numpy
import random
import os
import tempfile
import shutil
import subprocess
import glob
import sys
from aletheialib import utils
from sklearn.model_selection import train_test_split
from sklearn.metrics import accuracy_score
from sklearn.svm import SVC
from sklearn.feature_selection import f_classif, Select... |
__init__.py | # -*- coding: utf-8 -*-
# Copyright (c) 2009-2010 Andrey Vlasovskikh
#
# 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, ... |
fake.py | # This file is Copyright (c) 2010 by the GPSD project
# BSD terms apply: see the file COPYING in the distribution root for details.
"""
gpsfake.py -- classes for creating a controlled test environment around gpsd.
The gpsfake(1) regression tester shipped with GPSD is a trivial wrapper
around this code. For a more int... |
basic_gpu_test.py | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
schoology.py | import os, json, re, sys, time, threading, random
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support... |
test_comms.py | import asyncio
import os
import sys
import threading
import types
import warnings
from functools import partial
import pkg_resources
import pytest
from tornado import ioloop
from tornado.concurrent import Future
import dask
import distributed
from distributed.comm import (
CommClosedError,
connect,
get_a... |
request_signature.py | import argparse
import base64
import json
import logging
import os
import sys
import threading
import time
from typing import Any
import stomp
from operatorcert.logger import setup_logger
from operatorcert.umb import start_umb_client
LOGGER = logging.getLogger("operator-cert")
def setup_argparser() -> Any: # prag... |
test_local_catalog.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... |
collectData.py | import numpy as np
import cv2
import pygame
import socket
import threading
from controlWithJoyStick import ControlWithJoyStick
from SensorClient import UltrasonicSensorClient
from writeToCSV import CSVWriter
from enum import Enum
import argparse
import datetime
class Move(Enum):
FORWARD = 'forward'
BACKWARD = ... |
advanced-reboot.py | #
#ptf --test-dir ptftests fast-reboot --qlen=1000 --platform remote -t 'verbose=True;dut_username="admin";dut_hostname="10.0.0.243";reboot_limit_in_seconds=30;portchannel_ports_file="/tmp/portchannel_interfaces.json";vlan_ports_file="/tmp/vlan_interfaces.json";ports_file="/tmp/ports.json";dut_mac="4c:76:25:f5:48:80";d... |
_wsdump.py | #!/usr/bin/env python3
"""
wsdump.py
websocket - WebSocket client library for Python
Copyright 2022 engn33r
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/LICE... |
test_base_events.py | """Tests for base_events.py"""
import concurrent.futures
import errno
import math
import os
import socket
import sys
import threading
import time
import unittest
from unittest import mock
import asyncio
from asyncio import base_events
from asyncio import constants
from test.test_asyncio import utils as test_utils
fro... |
data_loader.py |
from __future__ import print_function, division, absolute_import
import glob
import random
import time
# Python 2/3 support
try:
import queue
except ImportError:
import Queue as queue
import cv2
import numpy as np
import torch as th
from joblib import Parallel, delayed
from torch.multiprocessing import Queu... |
serial_collection.py | # Copyright 2017 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 agre... |
dokku-installer.py | #!/usr/bin/env python3
import cgi
import json
import os
import re
try:
import SimpleHTTPServer
import SocketServer
except ImportError:
import http.server as SimpleHTTPServer
import socketserver as SocketServer
import subprocess
import sys
import threading
VERSION = 'v0.19.11'
def bytes_to_string(b):
... |
utils.py | import os
import threading
from http.server import HTTPServer, SimpleHTTPRequestHandler
from tempfile import mkdtemp
import requests
import requests_cache
from . import get_logger
lgr = get_logger()
class LoggingRequestHandler(SimpleHTTPRequestHandler):
def log_message(self, format, *args):
lgr.debug(fo... |
secret_key_finder.py | import time
import threading
import db
import git as g
import git_crawling as gc
from models import User, SecretKey, Repository, File
from filters import repo_filter, file_filter, patern_finder, entropy_filter
from code_modifing.code_modifier import CodeModifier
running = True
def start(sleep_time):
thr = threading... |
typosquatting.py | # Typosquatting Detection Scheme (PyPI)
from itertools import permutations
from functools import lru_cache
import re
delimiter_regex = re.compile('[\-|\.|_]')
delimiters = ['', '.', '-', '_']
version_number_regex = re.compile('^(.*?)[\.|\-|_]?\d$')
allowed_characters = 'abcdefghijklmnopqrstuvwxyz12345678... |
test_csv.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... |
hiddencraft.py | #!/usr/bin/env python3
'''
A tool for connecting to minecraft hidden servers.
For more info, look at README.md
'''
from socket import socket, SOL_SOCKET, SO_REUSEADDR
from socket import error as sock_err
import selectors
import torsocks.torsocks as torsocks
import sys
import threading
import queue
import logging
JAVA_... |
test_itertools.py | import unittest
from test import support
from itertools import *
import weakref
from decimal import Decimal
from fractions import Fraction
import operator
import random
import copy
import pickle
from functools import reduce
import sys
import struct
import threading
import gc
maxsize = support.MAX_Py_ssize_t
minsize = ... |
scheduler.py | """
SleekXMPP: The Sleek XMPP Library
Copyright (C) 2010 Nathanael C. Fritz
This file is part of SleekXMPP.
See the file LICENSE for copying permission.
"""
import time
import threading
from threading import RLock
import logging
try:
import queue
except ImportError:
import Queue as queue
lo... |
pipeline.py | """Cytokit preprocessing pipeline core logic
This is not intended to be run directly but rather used by mutliple external
interfaces to implement the core process that comprises Cytokit processing.
"""
import os, logging, itertools, queue, sys
import numpy as np
import pandas as pd
from os import path as osp
from thre... |
test__internal.py | import errno
import os
import socket
import subprocess
import pytest
from tf_yarn._internal import (
MonitoredThread,
reserve_sock_addr,
xset_environ
)
def test_monitored_thread():
def fail():
raise RuntimeError(42)
thread = MonitoredThread(target=fail)
thread.start()
thread.joi... |
test_subprocess.py | import unittest
from unittest import mock
from test import support
import subprocess
import sys
import signal
import io
import itertools
import os
import errno
import tempfile
import time
import traceback
import selectors
import sysconfig
import select
import shutil
import threading
import gc
import textwrap
import jso... |
dataset.py | # ***************************************************************
# Copyright (c) 2020 Jittor. Authors:
# Meng-Hao Guo <guomenghao1997@gmail.com>
# Dun Liang <randonlang@gmail.com>.
# All Rights Reserved.
# This file is subject to the terms and conditions defined in
# file 'LICENSE.txt', which is part of this... |
mpv.py | # -*- coding: utf-8 -*-
# ------------------------------------------------------------------------------
#
# mpv.py - Control mpv from Python using JSON IPC
#
# Copyright (c) 2015 Lars Gustäbel <lars@gustaebel.de>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and as... |
__init__.py |
############-----------Imports-----------###############
import threading
import time
import json
import os
class KVDatastore(dict):
def __init__(self):
self._ttl = 360 # ttl is time to live property for each keys. Default value is 360 sec
self.lock = threading.Lock() # thr... |
kube_env.py | #!/usr/bin/env python3
import argparse
import logging
import sys
import os
from multiprocessing import Process
from concurrent.futures import ThreadPoolExecutor
from pathlib import Path
import requests
import kube_util as util
log = logging.getLogger(__name__)
FILE_DIR = Path(__file__).parent.resolve()
ROOT_DIR = FI... |
automatix.py | # -*- coding: utf-8 -*-
# Copyright 2013-2020 CERN
#
# 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... |
scripts.py | # -*- coding: utf-8 -*-
"""
This module contains the function calls to execute command line scripts
"""
# Import python libs
from __future__ import absolute_import, print_function, unicode_literals
import functools
import logging
import os
import signal
import sys
import threading
import time
import traceback
from ra... |
measurement.py | '''
OnionPerf
Authored by Rob Jansen, 2015
See LICENSE for licensing information
'''
import os, traceback, subprocess, threading, queue, logging, time, datetime, re, shlex
from lxml import etree
# stem imports
from stem.util import str_tools
from stem.control import Controller
from stem.version import Version, ... |
others.py | import re
import threading
import urllib.request
import steamapi
import pickle
import math
import rocket_snake
import discord
import traceback
import utils
import time
from utils import register_command
from random import randint
from dateutil.parser import parse
@register_command("rlstats", "getrlrank", "rlrank")... |
WebFuzzer.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# This material is part of "The Fuzzing Book".
# Web site: https://www.fuzzingbook.org/html/WebFuzzer.html
# Last change: 2019-05-21 19:58:03+02:00
#
#!/
# Copyright (c) 2018-2019 Saarland University, CISPA, authors, and contributors
#
# Permission is hereby granted, free... |
IAC.py | """
This programme is written and may only be used for educational purposes!
Using it for real purposes violates the Instagram guidelines!
Consequences are, for example, the blocking of the Instagram account.
Please read Instagram's guidelines for more information.
DO NOT indicate used program sections as your own. ©20... |
coverage_test_multicast.py | from Queue import Queue
import random
import threading
import unittest
from coapclient import HelperClient
from coapserver import CoAPServer
from coapthon import defines
from coapthon.messages.message import Message
from coapthon.messages.option import Option
from coapthon.messages.request import Request
from coapthon.... |
test_io.py | """Unit tests for the io module."""
# Tests of io are scattered over the test suite:
# * test_bufio - tests file buffering
# * test_memoryio - tests BytesIO and StringIO
# * test_fileio - tests FileIO
# * test_file - tests the file interface
# * test_io - tests everything else in the io module
# * test_univnewlines - ... |
run_service.py | # -*- coding: utf-8 -*-
"""
Copyright (C) 2017 Sebastian Golasch (plugin.video.netflix)
Functions for starting the service
SPDX-License-Identifier: MIT
See LICENSES/MIT.md for more information.
"""
from __future__ import absolute_import, division, unicode_literals
import threading
from xbmcgui import... |
tuq_advisor.py |
from remote.remote_util import RemoteMachineShellConnection
from .tuq import QueryTests
import time
from deepdiff import DeepDiff
from membase.api.exception import CBQError
import threading
class QueryAdvisorTests(QueryTests):
def setUp(self):
super(QueryAdvisorTests, self).setUp()
self.log.info(... |
gradient.py | # coding: utf-8
import numpy as np
import threading
def _numerical_gradient_1d(f, x):
h = 1e-4 # 0.0001
grad = np.zeros_like(x)
for idx in range(x.size):
tmp_val = x[idx]
x[idx] = float(tmp_val) + h
fxh1 = f(x) # f(x+h)
x[idx] = tmp_val - h
fxh2 = f(x)... |
main.py | #!/usr/bin/env python
import os
from datetime import datetime, timezone, timedelta
import threading
import logging
import re
import requests
import boto3
# semaphore limit of 5, picked this number arbitrarily
maxthreads = 5
sema = threading.Semaphore(value=maxthreads)
logging.getLogger('boto3').setLevel(logging.CRI... |
common.py | import torch
from utils2.torch import to_device
import numpy as np
import multiprocessing as mp
import math
def estimate_advantages(memories, value_net, gamma, tau, device='cpu', dtype=torch.double, queue=None, pid=None, num_agent=None):
advantages_list = []
states_list =[]
actions_list = []
returns_l... |
tailer.py | import time
import threading
import os
import numpy as np
import glob
import signal
import argparse
import logging
# from logging.handlers import RotatingFileHandler
import queue
import requests
import datetime
import traceback
def str_lim(obj, lim):
stri = str(obj)
stri = stri.replace('\n', '')
if len(st... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.