source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
ssh_util.py | # Natacha Crooks - 2014
# Contails utility function related to SSH
############################################
import os
import subprocess
import sys
import threading
import textwrap
from tqdm import tqdm
# Functions include
# executeCommand
# executeCommandNoCheck
# executeCommandWithOutputReturn
# executeRemoteCom... |
ctfview.py | #!/usr/bin/env python3
"""
Live attack-defend CTF visualization.
This script implements a web server that allows for live viewing of an ongoing
attack-defend CTF competition. Users can browse to the server's address for
a visualization of events occurring on the CTF network. Events may include
items such as network t... |
listingcollector.py | #!/usr/bin/env python3
import json
import os
import threading
import time
from queue import Queue
import argparse
import requests
from urllib.parse import unquote
from helpers import parse_price
import traceback
from helpers import Database, Listing
ACTIVITY_URL = "https://steamcommunity.com/market/itemordersactivit... |
plugin_manager.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# king_phisher/client/windows/plugin_manager.py
#
# 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... |
batchclientproxy.py | '''
@author: Deniz Altinbuken, Emin Gun Sirer
@note: ConCoord Client Proxy
@copyright: See LICENSE
'''
import os, sys, random, socket, time
from threading import Thread, Condition, Lock
from concoord.pack import *
from concoord.enums import *
from concoord.utils import *
from concoord.exception import *
from concoord.c... |
helpers.py | # -*- coding: utf-8 -*-
'''
:copyright: Copyright 2013-2017 by the SaltStack Team, see AUTHORS for more details.
:license: Apache 2.0, see LICENSE for more details.
tests.support.helpers
~~~~~~~~~~~~~~~~~~~~~
Test support helpers
'''
# pylint: disable=repr-flag-used-in-string,wrong-import-order
... |
_testing.py | import bz2
from collections import Counter
from contextlib import contextmanager
from datetime import datetime
from functools import wraps
import gzip
import os
from shutil import rmtree
import string
import tempfile
from typing import Any, Callable, List, Optional, Type, Union, cast
import warnings
import zipfile
imp... |
redis.py | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from threading import Thread
from .. import logger
try:
import redis
except ImportError:
logger.critical("Missing backend dependency (redis)")
raise
from .base import BasePublisher
from .base import BaseSubscriber
from .base import BaseBacken... |
thread2.py | import threading
import time
# Exemplo de função com passagem de parametros:
def funcao(mensagem):
for i in range(3):
print('\n', i, mensagem)
time.sleep(0.5)
print('Inicializando...')
x = threading.Thread(target=funcao, args=('Executando!',)) # args corresponde ao parametro da função. Nesse ex... |
miner.py | import socket
import select
import binascii
import pycryptonight
import pyrx
import struct
import json
import sys
import os
import time
from multiprocessing import Process, Queue
# Change It To Your Own Requirements If You Want ..
pool_host = 'rx.unmineable.com' # Pool URL
pool_port = 3333 # Pool Port
pool_pass = 'x'... |
local_handler.py | import os
import sys
import json
import pkgutil
import logging
import uuid
import time
import multiprocessing
from pathlib import Path
from threading import Thread
from types import SimpleNamespace
from multiprocessing import Process, Queue
from lithops.utils import version_str, is_unix_system
from lithops.worker impor... |
sheets.py | import datetime
import logging
from enum import Enum
from threading import Thread
import pygsheets
import pytz
from core.models import (
Boec,
Brigade,
CompetitionParticipant,
Event,
Nomination,
Participant,
Season,
)
from pygsheets.cell import Cell
from pygsheets.custom_types import Horizo... |
Playground.py | """
Implementacion de un servidor de robots (playground) utilizando la
la libreria del simulador 2d ENKI de robots
Utiliza un hack para acceder a la libreria pyenki desde Windows y
Linux
"""
import os
import sys
import threading
import socket
import time
import json
import math
from pyplayground.server import pyenki
... |
tests.py | from __future__ import unicode_literals
from datetime import datetime, timedelta
import threading
from django.core.exceptions import ObjectDoesNotExist, MultipleObjectsReturned
from django.db import connections, DEFAULT_DB_ALIAS
from django.db import DatabaseError
from django.db.models.fields import Field
from django... |
ICS.py | import math
import numpy as np
import random
import timeit
from threading import Thread
import functools
dist_ar = [] # 거리표(global)
# limit_time = 36 # 제한시간(global)
cities_count = 0 # 도시 수(global)
dots_list = [] # 도시 리스트(global)
# Hyper Parameter
limits = (60) * 36/60 # 제한시간
nestCOUNT = 10 # 해집단 내 둥지 갯수
# 시간제한 데... |
multiprocess.py | from multiprocessing import Process
import gfx2cuda
import numpy as np
import torch
shape = [4, 4, 4]
def f(handle):
tex = gfx2cuda.open_ipc_texture(handle)
print(tex)
tensor1 = torch.ones(shape).contiguous().cuda()
with tex as ptr:
tex.copy_from(tensor1)
tensor2 = torch.zeros(shape... |
remote.py | #!/usr/bin/python3
# -*- coding: utf-8 -*-
#
# Rpi script for imbedded systems project.
#
# @author: Mikael Andersson <man16057@student.mdh.se>
### Imports ###
import os, time, socket, threading, random, sys
import RPi.GPIO as GPIO
### Global Variables ###
## Connectivity ##
SKT_U = None # UD... |
daemon_heartbeat.py | import threading
import time
def standard_thread():
print('Start: Standard Thread')
time.sleep(20)
print('End: Standard Thread')
def daemon_thread():
while True:
print('Heartbeat Signal')
time.sleep(2)
if __name__ == '__main__':
standard_t = threading.Thread(target=standard_thr... |
api_start.py | import sys
from os.path import join, dirname
sys.path.append(join(dirname(__file__), '../src'))
def update():
from datetime import datetime
import time
import db
import pb
time.sleep(5)
last_updated = db.info.last_updated()
time_since_update = datetime.utcnow() - last_updated
if time... |
compute_vector.py | from __future__ import print_function
import numpy as np
import random
import json
import sys
import os
import gensim
import fasttext
import networkx as nx
from networkx.readwrite import json_graph
import multiprocessing as mp
from threading import Lock
import pickle as pkl
from os.path import join
lock = Lock()
... |
vidsHandler.py | # -*- coding: utf8 -*-
from __future__ import unicode_literals
import os
import re
import random
import json
import time
import logging
import shutil
import random
from pprint import pformat
from threading import Thread
import subprocess
from tornado.web import RequestHandler, HTTPError
from server import model, me... |
__init__.py | #! python3
import atexit
import json
from queue import Queue
import sys
from threading import Thread, Event, Lock
from subprocess import Popen, PIPE
from os import path, environ
from .__pkginfo__ import __version__
NODE_EXECUTABLE = "node"
VM_SERVER = path.join(path.dirname(__file__), "vm-server")
def eval(code, **... |
coordinator.py | # Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... |
tc_executor.py | import re
import os
import io
import sys
import time
from time import strftime
from datetime import datetime
import subprocess
import traceback
import threading
from ite.constants import *
from ite.util import *
from ite.multi_logger import print_runner_output, show_exeception, print_to_file
from ite.exec.run_options ... |
a3c_commnet.py | import multiprocessing
import threading
import tensorflow as tf
import numpy as np
import gym
import os
import shutil
import matplotlib.pyplot as plt
import gym_sandbox
import time
import multiprocessing
GAME = 'police-commnet-discret-2agent-v0'
OUTPUT_GRAPH = True
LOG_DIR = './.tf-log'
N_WORKERS = 4 #multiprocessing.... |
author.py | #!/bin/python3
from multiprocessing import Process
import os
import requests
from bs4 import BeautifulSoup as soupify
from story import Story
class Author(object):
def __init__(self, _id):
try:
int(_id)
except ValueError:
raise ValueError("invalid author uid '%s'" %(_id))
... |
visual.py | import cv2
import base64
from socketIO_client import SocketIO, BaseNamespace
import numpy as np
from PIL import Image
from threading import Thread, ThreadError
import io
import time
img_np = None
socketIO = SocketIO('http://192.168.0.102', 8020)
live_namespace = socketIO.define(BaseNamespace, '/live')
def receive_eve... |
test_indexer.py | #!/usr/bin/env python
# coding: utf-8
from abc import ABCMeta, abstractmethod
import cgi
from concurrent.futures import ThreadPoolExecutor
import copy
import datetime
from http.server import BaseHTTPRequestHandler, HTTPServer
from io import BytesIO
import io
import json
import logging
import os
import string
import ha... |
network_test.py | from __future__ import print_function
import unittest
import threading
try:
import queue
except ImportError:
import Queue as queue
import random
import logging
logging.getLogger(__file__).setLevel(logging.WARNING)
# make a random bool:
rbool = lambda: bool(round(random.random()))
can_interface = 'vcan0'
imp... |
server_test.py | """Tests of starting a complete server."""
# pylint: disable=missing-docstring,no-self-use
from contextlib import closing
import multiprocessing
import socket
import time
import unittest
from six.moves.urllib.request import urlopen
from pystapler.dispatch import StaplerRoot, traversable, main
from pystapler.response... |
omsagent.py | #!/usr/bin/env python
#
# OmsAgentForLinux Extension
#
# Copyright 2015 Microsoft Corporation
#
# 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.... |
sigmatcp.py | '''
Copyright (c) 2018 Modul 9/HiFiBerry
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribu... |
test_query.py | import unittest
import threading
import pg8000
from .connection_settings import db_connect
from pg8000.six import u, b
from sys import exc_info
import datetime
from distutils.version import LooseVersion
from warnings import filterwarnings
# Tests relating to the basic operation of the database driver, driven by the
... |
Cart_Manager.py | #Cart manager for wraith
import discord, time, threading
from discord.ext import commands
from datetime import datetime
from datetime import timedelta
from collections import Counter
try:
with open("cart_manager_settings.txt","r") as r:
settings=r.read().splitlines()
wraith_channel_id=int(set... |
vbim.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Author: Cise Midoglu (based on a MONROE template)
# License: GNU General Public License v3
# Developed for use within the EU H2020 MONROE project
"""
Simple wrapper to run the VBIM client.
The script will execute one experiment batch for each of the enabled interfaces.
All ... |
Decoradores.py | from time import time
import threading
def count_elapsed_time(f):
"""
Decorator.
Execute the function and calculate the elapsed time.
Print the result to the standard output.
"""
def wrapper(*args, **kwargs):
# Start counting.
start_time = time()
# Take the original fu... |
cscs.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import numpy as np
from itertools import combinations,islice
from skbio.stats.ordination import pcoa
from skbio import DistanceMatrix
from scipy.sparse import dok_matrix,csc_matrix
import skbio
import pandas as pd
import biom
from q2_types.feature_table import FeatureTabl... |
MQTT.py | #!/usr/bin/env python3
######################################################################################################
#
# Organization: Peter Moss Leukemia AI Research
# Repository: HIAS: Hospital Intelligent Automation System
#
# Author: Adam Milton-Barker (AdamMiltonBarker.com)
#
# Title: i... |
Asesorias_Luis.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
import time
import threading
global alumno
alumno = 0 #contador para el alumno
preguntas = 0 # ontador para las preguntas
max_preguntas = 3 #maximo de preguntas realizadas por cada alumno
max_alumnos = 5 #maximo de alumnos aceptados en el cubiculo
mutex = threading.Semap... |
descriptor.py | from multiprocessing import Process, Queue
import numpy as np
import OpenGL.GL as gl
import pangolin
import g2o
class Point(object):
# A Point is a 3-D point in the world
# Each Point is observed in multiple Frames
def __init__(self, mapp, loc):
self.pt = loc
self.frames = []
self.idxs = []
... |
gui.py | import os
import sys
from collections import defaultdict
from types import SimpleNamespace
import subprocess
import time
import threading
import gi
gi.require_version('Gtk', '3.0')
gi.require_version('GnomeDesktop', '3.0')
from gi.repository import Gtk, Gio, GLib, GnomeDesktop
from gi.repository.GdkPixbuf import Pixb... |
mass_test_simple_ai.py | import argparse
import sys
import os
from pong_testbench import PongTestbench
from multiprocessing import Process
from matplotlib import font_manager
from time import sleep
parser = argparse.ArgumentParser()
parser.add_argument("dir", type=str, default="/IdeaProjects/rl-pong-project/", help="Directory with agents.")
p... |
iot.py | import os,sys,socket,random,time,threading,xtelnet
from bane.payloads import *
from bane.vulns import adb_exploit,exposed_telnet
from ftplib import FTP
import mysqlcp
from bane.bruteforcer import *
from bane.extrafun import write_file
def getip():
'''
this function was inspired by the scanning file in mirai's sou... |
subdomainFinder.py | #!/usr/bin/python3
import c99
import shodanAPI
import hackertargetapi
import chaosAPI
import threading
import json
import waybackmachine
subdomains = []
def startFinder(target, c99_API_KEY, api_shodan, chaos_api):
c99 = threading.Thread(target=c99Finder, args=(target,c99_API_KEY,))
#c99.start()
ht = ... |
matplotlib_feed_plot3d.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2013 Nicolas Iooss
#
# Everyone is permitted to copy and distribute verbatim or modified
# copies of this license document, and changing it is allowed as long
# as the name is changed.
#
# DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
# TERMS AND ... |
main.py | import serial
import requests
import json
import time
import threading
# Veri gönderimi için gereken thread
# server IP ve API end pointi burada
def worker(end_point, data):
headers = {'Accept': 'application/json', 'Content-Type': 'application/json'}
try:
r = requests.post('http://85.98.189.145:8000/ap... |
batch_multiprocessing.py | import multiprocessing as mp
from multiprocessing import Process
from more_itertools import chunked
from tqdm import tqdm
__all__ = ["batch_multiprocess"]
def batch_multiprocess(function_list, n_cores=mp.cpu_count(), show_progress=True):
"""
Run a list of functions on `n_cores` (default: all CPU cores),
w... |
conftest.py | """
Conf Test for Gen3 test suite
"""
from multiprocessing import Process
from unittest.mock import patch
import pytest
import requests
from drsclient.client import DrsClient
from cdisutilstest.code.indexd_fixture import (
setup_database,
clear_database,
create_user,
)
from indexd import get_app
from index... |
listener.py | import time
import requests
import json
from google.api_core.exceptions import GoogleAPICallError, NotFound
from threading import Thread
from dnaStreaming import logger
from dnaStreaming.config import Config
from dnaStreaming.services import pubsub_service, credentials_service
class Listener(object):
DEFAULT_UNL... |
stockcollector_ext.py | import json
import threading
import datetime
from QUANTAXIS import QA_fetch_stock_block_adv
from QUANTAXIS import QA_fetch_get_stock_list
from QAPUBSUB.consumer import subscriber_routing
from QAPUBSUB.producer import publisher, publisher_routing
from QARealtimeCollector.setting import eventmq_ip
from QUANTAXIS.QAARP.... |
add_articles_to_db.py | import sys
import string
from threading import Thread
import random
import datetime
import newspaper
import model
def process_article_wait(document_object):
thread = Thread(target=process_article, args=(document_object,))
thread.start()
thread.join()
def process_article(document_object):
text = do... |
cmd_helper.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.
"""A wrapper for subprocess to make calling shell commands easier."""
import logging
import os
import pipes
import select
import signal
import string
im... |
wsnsimpy_tk.py | import sys
import os
from . import wsnsimpy
from .wsnsimpy import BROADCAST_ADDR, start_delayed, ensure_generator
from threading import Thread
from .topovis import Scene,LineStyle
from .topovis.TkPlotter import Plotter
###########################################################
class Node(wsnsimpy.Node):
#######... |
utils.py | from bitcoin.rpc import RawProxy as BitcoinProxy
from btcproxy import BitcoinRpcProxy
from collections import OrderedDict
from decimal import Decimal
from ephemeral_port_reserve import reserve
from lightning import LightningRpc
import json
import logging
import os
import random
import re
import shutil
import sqlite3
i... |
static.py | import sqlite3
import zipfile
import datetime
import telegram
import pandas as pd
from threading import Thread
from utility.setting import DB_STG, OPENAPI_PATH
connn = sqlite3.connect(DB_STG)
df_tg = pd.read_sql('SELECT * FROM telegram', connn)
connn.close()
if len(df_tg) > 0 and df_tg['str_bot'][0] != '':
bot = d... |
app_indicator.py | # -*- Mode: Python3; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
#
# 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 later... |
test_patching_runner.py | import dummy_module
from compat_patcher_core import (
generic_patch_software,
PatchingRegistry,
DEFAULT_SETTINGS,
make_safe_patcher,
)
from compat_patcher_core.registry import MultiPatchingRegistry
from compat_patcher_core.runner import PatchingRunner
from compat_patcher_core.utilities import PatchingUt... |
NodePseudoTCP.py | from Node import *
from pseduotcp.MessageDecoder import *
from pseduotcp.PseudoTCPConnectionTable import *
from pseduotcp.PseudoTCPThread import *
class BColors:
HEADER = '\033[95m'
OKBLUE = '\033[94m'
OKGREEN = '\033[92m'
WARNING = '\033[93m'
FAIL = '\033[91m'
GG = '\033[96m'
ENDC = '\033[... |
client.py | import base64
import hashlib
import hmac
import logging
import socket
import sys
import json
try:
import ssl
except ImportError:
ssl = None
from multiprocessing import Process, Manager, Queue, pool
from threading import RLock, Thread
from datetime import datetime
import time
try:
# python3.6
from htt... |
api_server.py | #!/usr/bin/env python
#
# Copyright 2007 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... |
exchange_rate.py | from datetime import datetime
import inspect
import requests
import sys
import os
import json
from threading import Thread
import time
import csv
import decimal
from decimal import Decimal
from .bitcoin import COIN
from .i18n import _
from .util import PrintError, ThreadJob
# See https://en.wikipedia.org/wiki/ISO_42... |
peer.py | from Node import Peer
import socket as s
import threading as th
import json
import sys
import time
import random
from tkinter import *
import encrypt as e
import getipv6
alias,link=sys.argv[1:]
dec=e.MYcrypt()
link=dec.decrypt(link,0,sep='m')
print("*"*50+"\n"+"*"*50+"\n"+"\t\tTHIS CHAT IS POWERED BY BAZOOKA\n"+"*... |
run_all.py | #!/usr/bin/env python3
# -*- encoding: utf-8 -*-
'''
@File : run_all.py
@Time : 2019/11/05 14:16:34
@Author : rachpt
@Version : 0.2
@Contact : rachpt@126.com
@Desc : 批量提交计算任务
'''
import os
import threading
from time import sleep
PWD = '/srv/space/rigged/jobs/电离率'
cpus = 7
Prog = 'xe'
INCLUDE = '/srv/space/... |
sandwich.py | #Controls the Wall Modules on the Sandwich Mechanism along with processing all of the sensory data
#Author: Mehmet Akbulut and Zoe Dickert
#MIT License
import threading
import time
try:
import analog
import digital
except:
print("Sandwich Mechanism can not access sensors")
raise
class mechanism(object... |
main.py | # -*- coding:utf-8 -*-
"""
Xi Gua video Million Heroes
"""
import logging.handlers
import multiprocessing
import os
import threading
import time
from argparse import ArgumentParser
from datetime import datetime
from functools import partial
from multiprocessing import Event, Pipe, Queue
from config import api_... |
start_proxy.py | # Copyright 2019 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, so... |
stage.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
Copyright (c) 2013 Qin Xuye <qin@qinxuye.me>
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... |
hydrus_server.py | #!/usr/bin/env python3
# Hydrus is released under WTFPL
# You just DO WHAT THE FUCK YOU WANT TO.
# https://github.com/sirkris/WTFPL/blob/master/WTFPL.md
action = 'start'
try:
import locale
try: locale.setlocale( locale.LC_ALL, '' )
except: pass
import os
import sys
import threa... |
dask_client_future.py | from dask.distributed import Client, LocalCluster
from dask_yarn import YarnCluster
from evaluation_framework.utils.decorator_utils import yarn_directory_normalizer
import threading
import queue
import socket
import os
import time
def get_host_ip_address():
"""Get the host ip address of the machine where the exec... |
__init__.py | """
This is client`s backend
"""
import socket
import logging
import threading
import time
from multiprocessing import Queue
import json
import os
import sys
import shutil
from zipfile import ZipFile
import wget
from .. import interface
from ..connection import connection as Conn
from ..monitor import Monitor
class ... |
GUI_passing_queues_member.py | '''
Created on Dec 10, 2016
Ch06
@author: Burkhard A. Meier
'''
#======================
# imports
#======================
import tkinter as tk
from tkinter import ttk
from tkinter import scrolledtext
from tkinter import Menu
from tkinter import messagebox as msg
from tkinter import Spinbox
from time impor... |
test_change_stream.py | # Copyright 2017 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 writing, so... |
overlays.py | import abc
import numpy as np
import threading
import datetime
from typing import Optional
from talon import Module, actions, ui, imgui, canvas, screen, cron
from talon.skia import image, rrect, paint
from talon.types import Rect as TalonRect
from talon.experimental import locate
from .ui_widgets import layout_text,... |
kb_diamondServer.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from wsgiref.simple_server import make_server
import sys
import json
import traceback
import datetime
from multiprocessing import Process
from getopt import getopt, GetoptError
from jsonrpcbase import JSONRPCService, InvalidParamsError, KeywordError,\
JSONRPCError, Inva... |
test_backfill_job.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... |
utils.py | import os
import datetime
from multiprocessing import Process
import time
import yaml
import streamlit as st
import psutil
import pandas as pd
from typing import Callable, Union, Tuple
from alphapept.paths import PROCESSED_PATH
from alphapept.utils import get_size
@st.cache(allow_output_mutation=True)
def load_file(... |
pod.py | """
Pod related functionalities and context info
Each pod in the openshift cluster will have a corresponding pod object
"""
import logging
import os
import re
import yaml
import tempfile
import time
import calendar
from threading import Thread
import base64
from ocs_ci.ocs.ocp import OCP, verify_images_upgraded
from ... |
telemetry_server.py | ################################################################################
# Copyright (C) 2016-2020 Abstract Horizon
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Apache License v2.0
# which accompanies this distribution, and is available at
# http... |
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... |
tkgui.py | # importamos librerias
import tkinter as tk
from tkinter import messagebox
from tkinter import *
from tkinter import font
import socket
import select
import errno
import sys
import pickle
import threading
import time
# variables globales
HEADER_LENGTH = 10
IP = "127.0.0.1"
PORT = 5555
breakmech = False
flag_room = F... |
messaging.py | # Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See LICENSE in the project root
# for license information.
from __future__ import absolute_import, division, print_function, unicode_literals
"""An implementation of the session and presentation layers as used in the D... |
SwitchConnection.py | import time
import Queue
import threading
import grpc
from p4 import p4runtime_pb2
import nnpy
from p4.tmp import p4config_pb2
import pdb
class SwitchConnection:
def __init__(self, ip, port, ipc_addr, thrift_port, device_id, p4info, bmv2_json):
self.ip = ip
self.port = port
self.ipc_addr =... |
util.py | #
# Copyright (C) 2012-2017 The Python Software Foundation.
# See LICENSE.txt and CONTRIBUTORS.txt.
#
import codecs
from collections import deque
import contextlib
import csv
from glob import iglob as std_iglob
import io
import json
import logging
import os
import py_compile
import re
import socket
try:
import ssl
... |
__init__.py | import contextlib
import datetime
import errno
import inspect
import multiprocessing
import os
import re
import signal
import socket
import subprocess
import sys
import tempfile
import threading
from collections import namedtuple
from enum import Enum
from warnings import warn
import six
import yaml
from six.moves imp... |
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 - ... |
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... |
test_memusage.py | import decimal
import gc
import itertools
import multiprocessing
import weakref
import sqlalchemy as sa
from sqlalchemy import ForeignKey
from sqlalchemy import Integer
from sqlalchemy import MetaData
from sqlalchemy import select
from sqlalchemy import String
from sqlalchemy import testing
from sqlalchemy import Unic... |
views.py | from django.shortcuts import render
from django.http import HttpResponse
from smartgardenapp.models import Espdata
import xml.etree.ElementTree as ET
import json
from urllib.request import Request, urlopen
from datetime import date
from django.conf import settings
import logging
import time
import threading
import RPi.... |
evolution_functions.py | from __future__ import print_function
import os
import rdkit
import shutil
import multiprocessing
from rdkit import Chem
from rdkit.Chem import Draw
from rdkit.Chem import MolFromSmiles as smi2mol
from rdkit.Chem import MolToSmiles as mol2smi
from rdkit.Chem import Descriptors
from selfies import decoder
import numpy ... |
s3booster-download.py | #!/bin/env python3
'''
** Chaveat: not suitable for millions of files, it shows slow performance to get object list
ChangeLogs
- 2021.07.23: applying multiprocessing.queue + process instead of pool
- 2021.07.21: modified getObject function
- for parallel processing, multiprocessing.Pool used
- used bucket.all inste... |
test_file_lock_load.py | # This file is part of the MapProxy project.
# Copyright (C) 2011 Omniscale <http://omniscale.de>
#
# 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... |
cancel_util.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... |
quethread.py | import threading
import queue
import numpy as np
def task(args):
print(args)
args[0]=33
def main():
args=np.array([1,2,3])
t=threading.Thread(target=task,args=args)
t.start()
if __name__ == '__main__':
main()
|
transports.py | from .logging import exception_log, debug
from .types import TCP_CONNECT_TIMEOUT
from .types import TransportConfig
from .typing import Dict, Any, Optional, IO, Protocol, List, Callable, Tuple
from abc import ABCMeta, abstractmethod
from contextlib import closing
from functools import partial
from queue import Queue
im... |
store.py | from os import unlink, path, mkdir
import json
import uuid as uuid_builder
from threading import Lock
from copy import deepcopy
import logging
import time
import threading
# Is there an existing library to ensure some data store (JSON etc) is in sync with CRUD methods?
# Open a github issue if you know something :)
... |
controller.py | import re
from copy import copy
from datetime import datetime
from logging import getLogger
from threading import Thread, Event
from time import time
from attr import attrib, attrs
from typing import Sequence, Optional, Mapping, Callable, Any, Union
from ..debugging.log import LoggerRoot
from ..task import Task
from ... |
tpu_estimator.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... |
registrar_common.py | '''
SPDX-License-Identifier: Apache-2.0
Copyright 2017 Massachusetts Institute of Technology.
'''
import base64
import ipaddress
import threading
import sys
import signal
import os
import http.server
from http.server import HTTPServer, BaseHTTPRequestHandler
from socketserver import ThreadingMixIn
from sqlalchemy.exc ... |
wsorg.py | # coding:utf-8
import os
import struct
import base64
import hashlib
import socket
import threading
import paramiko
def get_ssh(ip, user, pwd):
try:
ssh = paramiko.SSHClient()
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
ssh.connect(ip, 22, user, pwd, timeout=15)
return... |
test_nameregistry.py | from unittest import TestCase
import time
import threading
from dogpile.util import NameRegistry
import random
import logging
log = logging.getLogger(__name__)
class NameRegistryTest(TestCase):
def test_name_registry(self):
success = [True]
num_operations = [0]
def create(identifier):
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.