source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
proxy_session.py | import time
import json
import threading
import xstruct as struct
from xlog import getLogger
xlog = getLogger("x_tunnel")
import utils
import base_container
import encrypt
import global_var as g
from gae_proxy.local import check_local_network
def encrypt_data(data):
if g.config.encrypt_data:
return encr... |
ssh.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Author: leeyoshinari
import io
import re
import time
import socket
import logging
import traceback
import paramiko
from threading import Thread
logger = logging.getLogger('django')
class SSH:
def __init__(self, websocket):
self.websocket = websocket
... |
plugin_main.py | # --coding:utf-8--
# Copyright (c) 2017 Intel 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.0
#
# Unless required by applicable l... |
monitor.py | import functools
import logging
import os
import subprocess
import threading
from dataclasses import dataclass
from typing import TYPE_CHECKING, Callable, List
from dvc.stage.decorators import relock_repo
from dvc.stage.exceptions import StageCmdFailedError
if TYPE_CHECKING:
from dvc.stage import Stage
logger =... |
backdoros.py | #!/usr/bin/env python2.7
#
# Copyright (c) 2019, SafeBreach
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# 1. Redistributions of source code must retain the above
# copyright notice, this ... |
serv.py | import socket
import cv2
import numpy as np
import threading
import time
import pickle
import my_detect
#PORT = 9001
PORT = 2233
IP = '' # all ips
POSSIBLE_CONNECTIONS = 1
CHUNK = 4096
with open('bboxes.dat', 'rb') as fin:
bboxes = pickle.load(fin)
class Server:
def __init__(self, ip, port):
self.s... |
test_renderers.py | import json
import sys
import base64
import threading
import time
import pytest
import requests
import numpy as np
import plotly.graph_objs as go
import plotly.io as pio
from plotly.offline import get_plotlyjs
if sys.version_info.major == 3 and sys.version_info.minor >= 3:
import unittest.mock as mock
from u... |
test_container.py | # global
import os
import queue
import pickle
import pytest
import random
import numpy as np
import multiprocessing
# local
import ivy
from ivy.container import Container
import ivy_tests.test_ivy.helpers as helpers
def test_container_list_join(dev, call):
container_0 = Container({'a': [ivy.array([1], dev=dev)],... |
app-manager.py | #!/usr/bin/env python3
# SPDX-FileCopyrightText: 2021 Aaron Dewes <aaron.dewes@protonmail.com>
#
# SPDX-License-Identifier: MIT
import threading
from typing import List
import yaml
import json
from lib.composegenerator.v0.generate import createComposeConfigFromV0
from lib.composegenerator.v1.generate import createCom... |
__init__.py | # -*- coding: utf-8 -*-
'''
Set up the Salt integration test suite
'''
# Import Python libs
import os
import sys
import time
import errno
import shutil
import pprint
import logging
import tempfile
import subprocess
import multiprocessing
from hashlib import md5
from datetime import datetime, timedelta
try:
import... |
utils.py | import asyncio
from asyncio import TimeoutError
import atexit
import click
from collections import deque, OrderedDict, UserDict
from concurrent.futures import ThreadPoolExecutor, CancelledError # noqa: F401
from contextlib import contextmanager, suppress
import functools
from hashlib import md5
import html
import json... |
middleware.py | from multiprocessing import Process, Queue
import requests
def child_process(queue):
while True:
print(queue.get())
requests.get('http://requestb.in/15s95oz1')
class GunicornSubProcessTestMiddleware(object):
def __init__(self):
super(GunicornSubProcessTestMiddleware, self).__init__()... |
flask_gunicorn.py | try:
import asyncio
except ImportError:
raise RuntimeError("This example requries Python3 / asyncio")
import os
import sys
import importlib
from threading import Thread
from flask import Flask, render_template, redirect
from jinja2 import Environment, FileSystemLoader
from tornado.httpserver import HTTPServer... |
pain.py | from threading import Thread
from Queue import Queue
import requests
import sys
import time
import locale
from socket import error as SocketError
try:
from colorama import Fore, Back, Style
except ImportError:
print 'Pain requires Colorama - You should `pip install colorama`'
sys.exit(1)
try:
import... |
alpacastore.py | from __future__ import (absolute_import, division, print_function,
unicode_literals)
import os
import collections
import time
from enum import Enum
import traceback
from datetime import datetime, timedelta, time as dtime
from dateutil.parser import parse as date_parse
import time as _time
impor... |
pythonstatusjson.py | from NasaCollageGUI.network.urltask import BaseUrlTask
from NasaCollageGUI.network.downloadimageurltask import DownloadImageUrlTask
from NasaCollageGUI.network.previewimageurltask import PreviewImageUrlTask
import json
import os
from threading import Thread
import threading
import time
from concurrent.futures import Th... |
example_test.py | import re
import os
import socket
import http.server
from threading import Thread
import ssl
from tiny_test_fw import DUT
import ttfw_idf
import random
import subprocess
server_cert = "-----BEGIN CERTIFICATE-----\n" \
"MIIDXTCCAkWgAwIBAgIJAP4LF7E72HakMA0GCSqGSIb3DQEBCwUAMEUxCzAJBgNV\n"\
"B... |
test__xxsubinterpreters.py | from collections import namedtuple
import contextlib
import itertools
import os
import pickle
import sys
from textwrap import dedent
import threading
import time
import unittest
from test import support
from test.support import script_helper
interpreters = support.import_module('_xxsubinterpreters')
##############... |
linkcheck.py | """
sphinx.builders.linkcheck
~~~~~~~~~~~~~~~~~~~~~~~~~
The CheckExternalLinksBuilder class.
:copyright: Copyright 2007-2020 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import json
import queue
import re
import socket
import threading
import time
from datetime imp... |
scrape.py | import time
import random
from bs4 import BeautifulSoup
from selenium import webdriver
from PIL import Image
from io import BytesIO
from threading import Thread
from flask import Flask, session, redirect
from flask import request
from flask import send_file
from flask import render_template
from selenium.webdriver.c... |
mpv.py | # -*- coding: utf-8 -*-
# vim: ts=4 sw=4 et
#
# Python MPV library module
# Copyright (C) 2017-2020 Sebastian Götte <code@jaseg.net>
#
# This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General
# Public License as published by the Free Software Foundation, either... |
feeder.py | import os
import threading
import time
import traceback
import random
import numpy as np
import tensorflow as tf
from infolog import log
from sklearn.model_selection import train_test_split
from tacotron.utils.text import text_to_sequence
from tacotron.utils.symbols import _characters
_batches_per_group = 64
class ... |
_test_multiprocessing.py | #
# Unit tests for the multiprocessing package
#
import unittest
import unittest.mock
import queue as pyqueue
import time
import io
import itertools
import sys
import os
import gc
import errno
import signal
import array
import socket
import random
import logging
import subprocess
import struct
import operator
import p... |
autopwn.py | #!/usr/bin/python3
#coding: utf-8
#----------------------------------------------------------
#Made by: WizzzStark
#-----------------------------------------------------------
import requests
import pdb
import threading
import signal
import sys
import time
from pwn import *
def exit(sig, frame):
print("\n [!] Sal... |
test_monitor.py | #
# Test for monitoring classes and integration
#
import io
import json
import os
import multiprocessing as mp
import sys
import tempfile
import unittest
from collections import defaultdict
import osbuild
import osbuild.meta
from osbuild.api import API
from osbuild.monitor import LogMonitor
from .. import test
def ... |
use_custom_sastoken.py | # -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------
import os... |
server.py | from __future__ import print_function, unicode_literals, division, absolute_import
import sys
import os
import threading
import socket
from select import select
from struct import pack, unpack
from weakref import WeakSet
import errno
import ipaddress
import zmq
PY2 = sys.version_info.major == 2
if PY2:
str = unic... |
sparse_conditional_accumulator_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... |
task.py | import atexit
import os
import signal
import sys
import threading
import time
from argparse import ArgumentParser
from tempfile import mkstemp
try:
from collections.abc import Callable, Sequence as CollectionsSequence
except ImportError:
from collections import Callable, Sequence as CollectionsSequence
from t... |
_measure.py | # Copyright (2013) Sandia Corporation. Under the terms of Contract
# DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government
# retains certain rights in this software.
#
# This software is released under the FreeBSD license as described
# in License.txt
import time
import string
import subprocess
import os
im... |
download.py | #!/usr/bin/env python3
# -*- encoding: utf-8 -*-
import os
import shutil
import time
import requests
from multiprocessing import Process
from selenium.webdriver.chrome.options import Options
from selenium import webdriver
import platform
WINDOWS = 'Windows'
MAC_OS = 'Darwin'
LINUX = 'Linux'
def init_chrome_driver... |
load_test.py | #!/usr/bin/python2.7
# Copyright 2016 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 or ... |
envs.py | import atexit
import os
import sys
import threading
import traceback
import cloudpickle
import gym
import numpy as np
class Wrapper:
def __init__(self, env):
self._env = env
def __getattr__(self, name):
if name.startswith('__'):
raise AttributeError(name)
try:
... |
scylla_node.py | # ccm node
from __future__ import with_statement
from datetime import datetime
import errno
import os
import signal
import shutil
import socket
import stat
import subprocess
import time
import threading
import psutil
import yaml
import glob
import re
from six import print_
from six.moves import xrange
from ccmlib i... |
bluesky_simple.py | # short-term goals:
# - use setstate/monitor stuff
# - get the scan steps into xtc2 (via beginstep phase1 json)
# - make sure psana can read the step info
# questions:
# * how does control.py learn a step is complete?
# * how does scan script learn control.py step is complete?
# - possible ways to complete:
# - elap... |
tmqa33.py | #!/usr/bin/env python
# coding: utf-8
# In[1]:
get_ipython().run_line_magic('autosave', '180')
get_ipython().run_line_magic('matplotlib', 'inline')
# In[2]:
import requests
import time
from datetime import datetime
import itertools as it
import re
#import numpy
from copy import copy
import matplotlib.pyplot as p... |
mainscreen.py | """Add functionality for main window.
Bind button functionality between interface and MotionLink options.
Update status fields.
"""
from kivy.uix.floatlayout import FloatLayout
from kivy.properties import StringProperty, BooleanProperty, ListProperty, AliasProperty, NumericProperty
from kivy.uix.label import Label
fro... |
threading.py | import threading
import time
from Queue import Queue
from pylegos.core import LogFactory
from pylegos.core import ProgressBar
from pylegos.core import Spinner
from pylegos.core import SpinnerType
class Thread(object):
def __init__(self):
self.logger = LogFactory().getLibLogger()
self.queue = Qu... |
collective_ops_test.py | # Copyright 2020 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 applicab... |
test_signal.py | import enum
import errno
import inspect
import os
import random
import signal
import socket
import statistics
import subprocess
import sys
import threading
import time
import unittest
from test import support
from test.support import os_helper
from test.support.script_helper import assert_python_ok, spawn_python
from t... |
server25.py | # -*- coding: utf-8 -*-
import sys
import simplejson as json
import select
import threading
import SocketServer
from server_common import (SimpleJSONRPCDispatcher,
SimpleJSONRPCRequestHandler)
class SimpleJSONRPCServer(SocketServer.TCPServer,
SimpleJS... |
test_util.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... |
__main__.py | #!/usr/bin/python
import argparse
import logging
import time
import signal
import sys
import json
import serial
import math, random
import click
import os.path
import RPi.GPIO as GPIO
from six.moves import input
from threading import Thread, Event
import threading
from queue import Queue
from . import (audio_helpers, ... |
ImageFetcher.py | from Queue import Queue
from threading import Thread
from mxnet.io import DataIter, DataBatch
import mxnet as mx
import os
import numpy as np
import cPickle as pickle
class ImageFetcher(DataIter):
def __init__(self,
image_root,
label_file,
num_class,
... |
chat_test.py | """
Created on 23/11/2015
@author: gioia
This script provides test cases for the socket-implementation of a simple chat sever-client application.
The code is organized as follows:
- the ChatServerTest class tests the ChatServer (defined in the chat_server module);
- the ChatClientTest class tests the ChatClient (def... |
test_reading_network.py | from scramjet.streams import Stream
import asyncio
import pytest
from multiprocessing import Process
import os
import math
import test.large_test_files
# Run in a separate process to avoid influence on tested code
class ServeOverTCP():
def __init__(self, path, port):
self.path = path
self.port = po... |
datasets.py | # Dataset utils and dataloaders
import glob
import logging
import math
import os
import random
import shutil
import time
from itertools import repeat
from multiprocessing.pool import ThreadPool
from pathlib import Path
from threading import Thread
import cv2
import numpy as np
import torch
import torch.nn.functional ... |
_simple_stubs_test.py | # Copyright 2020 The gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... |
bot.py | import time
import threading
from telebot import TeleBot
import schedule
from config.settings import TOKEN, MY_ID, REPORT_TIME, REPORT_EVERY
from core import controller
bot = TeleBot(token=TOKEN, parse_mode='MARKDOWN')
@bot.message_handler(commands=['start'], func=lambda message: message.chat.id == MY_ID)
def repor... |
interface.py | # Date: 06/07/2018
# Author: Pure-L0G1C
# Description: Interface for the master
from os import path
from re import match
from lib import const
from . import ssh, sftp
from hashlib import sha256
from time import time, sleep
from os import urandom, path
from threading import Thread
from datetime import dat... |
cli.py | #!/usr/bin/env python3
# COMMAND LINE INTERFACE
import sys
import os
from nhentai import (
Thread,
Client,
Progress,
sift,
download
)
import startup
import asyncio
from math import floor as flr
class NHentai_Vanilla(object):
def __init__(self, code:str, savedir:str):
... |
shell_objects.py | #!/usr/bin/env python
# Copyright (c) 2006-2007 Open Source Applications Foundation
# Copyright (c) 2008-2009 Mikeal Rogers <mikeal.rogers@gmail.com>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy o... |
speech_input.py | # Copyright 2016 Louis Kirsch. 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... |
multithreadedServerExample.py | import socket
import threading
import time
import random
SERVER_PORT = 5002
clients = []
#addresses = []
class ThreadedServer(object):
def __init__(self, host, port):
self.host = host
self.port = port
self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
self.sock.setsockop... |
datamanager.py | """Data for training and loading of trainState and trainDynamics.
trainState gets data in an autoencoder fashion where input
and label are the same.
A datapoint is only a single observation as input and output.
trainDynamics gets 4 observations and an action as input
and the next observation as label.
The action is f... |
music_player.py | import os
import pygame
from pygame import mixer
from mutagen.mp3 import MP3
import queue
import time
import threading
from random import shuffle
from tkinter import *
class tree:
t = []
def insert_adress(self, adress):
file = os.listdir(adress)
temp = []
for files in file:
... |
main.py | import numpy as np
import pandas as pd
import random
import traceback
import cv2
import os
import string
import csv
import pickle
from datetime import datetime
from multiprocessing import Process,Pool,cpu_count
import argparse
from selenium.webdriver import Firefox
import warnings
warnings.filterwarnings("ignore")
fro... |
iromlab.pyw | #! /usr/bin/env python
"""
Script for automated imaging / ripping of optical media using a Nimbie disc robot.
Features:
* Automated load / unload / reject using dBpoweramp driver binaries
* Disc type detection using libcdio's cd-info tool
* Data CDs and DVDs are imaged to ISO file using IsoBuster
* Audio CDs are rip... |
plot.py | import multiprocessing as mp
import numpy as np
import tkinter
from itertools import accumulate
from matplotlib import pyplot as plt, lines
from casadi import MX, Callback, nlpsol_out, nlpsol_n_out, Sparsity
from .variable_optimization import Data
from .mapping import Mapping
from .enums import PlotType
class Custo... |
email.py | from app import mail
from flask_mail import Message
from threading import Thread
from flask import current_app
def send_async_email(app, msg):
with app.app_context():
mail.send(msg)
def send_email(subject, sender, recipients, text_body, html_body):
msg = Message(subject, sender=sender, recipients=re... |
main_pytorch.py | #!/home/mario/Projects/MNIST_exercise/venv/bin python
# Libraries
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torchvision import datasets, transforms
import torch.multiprocessing as mp
# Libraries
def get_n_params(model):
"""
DESCRIPTION:
Function t... |
simulate_data.py | #!/usr/bin/env python3
"""Simulate a live data feed by sending stored logger data to
specified UDP ports and/or simulated (temporary) serial ports.
May either be invoked for a single data feed with command line
options, or by specifying a YAML-format configuration file that sets
up multiple feeds at once.
To invoke a... |
__init__.py | #!/usr/bin/python3
"""
dispy: Distribute computations among CPUs/cores on a single machine or machines
in cluster(s), grid, cloud etc. for parallel execution. See
http://dispy.sourceforge.net or https://pgiri.github.com/dispy for details.
"""
import os
import sys
import time
import socket
import inspect
import stat
... |
ThreadedAppServer.py | #!/usr/bin/env python
"""Threaded Application Server
The AppServer is the main process of WebKit. It handles requests for
servlets from webservers.
ThreadedAppServer uses a threaded model for handling multiple requests.
At one time there were other experimental execution models for AppServer,
but none of these were... |
gui.py | import tkinter as tk
from tkinter import filedialog,ttk,messagebox
from datetime import datetime
import os
import threading
import imageprocess as imgproc
from pathlib import Path
PIC_TYPE=(".JPG",".jpg")
today=datetime.today()
date=today.strftime("%d-%m_%H-%M")
def getFolderPath():
#Display window with director... |
test_nvvs_plugins.py | # Copyright (c) 2021, 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 appli... |
test_ipc_provider.py | import os
import pathlib
import pytest
import socket
import tempfile
from threading import (
Thread,
)
import time
import uuid
from newchain_web3.auto.gethdev import (
w3,
)
from newchain_web3.middleware import (
construct_fixture_middleware,
)
from newchain_web3.providers.ipc import (
IPCProvider,
)
... |
core.py | """
The MIT License (MIT)
Copyright (c) 2015-2021 Rapptz
Copyright (c) 2021-present Pycord Development
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 limit... |
caasp.py | # Copyright (c) 2020 SUSE LINUX GmbH
#
# 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 w... |
cashan_game.py | #!/usr/bin/python3
# -*- coding: utf-8
import argparse
from collections import Counter, defaultdict, deque
import curses
import itertools
import json
import os
import random
import socket
import sys
import threading
import time
from cashan import *
from game import *
from network import *
VERSION = '0.0.4'
# High f... |
nfcworker.py | import threading
from pirc522 import RFID
import signal
import time
import logging
logger = logging.getLogger(__name__)
class NFCWorker():
def __init__(self, frontend):
self.frontend = frontend
config = frontend.config
self.rfid = RFID(pin_rst=config['pin_rst'],
pi... |
custom.py | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... |
client.py | from base64 import b64encode
from engineio.json import JSONDecodeError
import logging
import queue
import signal
import ssl
import threading
import time
import urllib
try:
import requests
except ImportError: # pragma: no cover
requests = None
try:
import websocket
except ImportError: # pragma: no cover
... |
svo2avi_convertor.py | import os
import cv2
import pyzed.sl as sl
import numpy as np
import sys
from queue import Queue
import threading
# functions
def progress_bar(percent_done, bar_length=50):
done_length = int(bar_length * percent_done / 100)
bar = '=' * done_length + '-' * (bar_length - done_length)
sys.stdout.write('[%s] ... |
script_process.py | import os
from multiprocessing import Process
from typing import Protocol
import pytest
from dotctl.context import Context
from dotctl.manager import Manager
def run_setup_script(script: str):
setup = Manager.get_setup_fn(script)
setup()
class ScriptProcess(Protocol):
"""configures a Context and creates a ... |
test_state.py | # -*- coding: utf-8 -*-
# Import Python libs
from __future__ import absolute_import, print_function, unicode_literals
import os
import shutil
import tempfile
import textwrap
import threading
import time
# Import Salt Testing libs
from tests.support.case import ModuleCase
from tests.support.unit import skipIf
from tes... |
sqlite_web.py | #!/usr/bin/env python
import datetime
import hashlib
import math
import operator
import optparse
import os
import re
import sys
import threading
import time
import webbrowser
import json
import yaml
import logging
import ast
import glob
import subprocess
import time
import io
import csv
from collections import namedtu... |
core.py | #! /usr/bin/python3
#
# Copyright (c) 2018 Sébastien RAMAGE
#
# For the full copyright and license information, please view the LICENSE
# file that was distributed with this source code.
#
from binascii import hexlify
import traceback
from time import (sleep, strftime, monotonic)
import logging
import json
import os
f... |
start_client.py | import time
import threading
import traceback
from BCIClient.TCPClient import TCPClient
def keep_try():
while True:
try:
client = TCPClient()
except:
traceback.print_exc()
time.sleep(5)
if __name__ == '__main__':
thread = threading.Thread(targe... |
mock_unit.py | from pythonfiledatastore import main_executor
from pythonfiledatastore import operations
from time import sleep
import threading
class mock_unit:
client = "hopstre"
key = "mock_test"
key_int = 12
key_more_than_32 = "Reamsochung Chongapipa Aiill CFCS6"
value_dict = {"Registered_firm" :
{
"firm":"Alpha",
... |
Design.py | import time ,sys ,threading
__all__ = ['Color','Text','Square','Animation','ThreadAnimation']
class Color(str):
colors = {
"BOLD":"\033[1m",
"UNDERLINE": "\033[4m",
"BLINK": "\033[5m",
"NORMAL": "\033[0m",
"WIHTEBG": "\033[7m",
"REDBG": "\033[41m",
"GREENBG... |
java_gateway_test.py | # -*- coding: UTF-8 -*-
"""
Created on Dec 10, 2009
@author: barthelemy
"""
from __future__ import unicode_literals, absolute_import
from collections import deque
from contextlib import contextmanager
from decimal import Decimal
import gc
import math
from multiprocessing import Process
import os
from socket import AF... |
test_index.py | import logging
import time
import pdb
import threading
from multiprocessing import Pool, Process
import numpy
import pytest
import sklearn.preprocessing
from utils import *
nb = 6000
dim = 128
index_file_size = 10
BUILD_TIMEOUT = 300
nprobe = 1
top_k = 5
tag = "1970-01-01"
NLIST = 4046
INVALID_NLIST = 100000000
field_... |
socket_robot.py | # -*- coding: utf-8 -*-
"""WebSocket for Robot module.
This is WebSocket module for Robot.
Send telemetry datas and receive control signals.
"""
__auther__ = 'EnsekiTT'
__version__ = '0.1'
import os
import cv2
import threading
import pyaudio
import numpy as np
import tornado.ioloop
import tornado.web
import tornado.w... |
app-vanilla.py | #!/usr/bin/python
"""
app.py - Program to execute command on Multiple Linux Servers without using any third party modules
Dependency - None
Input: list of hostnames
command
Output: Stdout of the Command from each Servers
"""
import sys, os, string, threading
import traceback
import subprocess
uname = "... |
caching-whois-proxy.py | #!/usr/bin/python
## Glen Dosey <doseyg@r-networks.net>
## 2019-01-09
## MIT License
## Copyright (c) 2018 Glen Dosey
## caching-whois-proxy.py
## https://github.com/doseyg/caching-whois-proxy
import sys, datetime
## This is the python-whois package; pip install python-whois
import whois
import requests, json
import ... |
webdriver.py | from flask import Flask
from threading import Thread
app = Flask('')
@app.route('/')
def home():
return 'M GOOD'
def run():
app.run(host="0.0.0.0", port=0000)
def keep_alive():
test = Thread(target=run)
test.start()
|
custom.py | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... |
test_io.py | from __future__ import division, absolute_import, print_function
import sys
import gzip
import os
import threading
from tempfile import NamedTemporaryFile
import time
import warnings
import gc
from io import BytesIO
from datetime import datetime
import numpy as np
import numpy.ma as ma
from numpy.lib._iotools import ... |
connection.py | import time
import queue
import pickle
import functools
import threading
task = queue.Queue()
prepared = {}
def myopen(oldopen, conn):
task.put(conn)
return oldopen()
def bg_prepare(started=[]):
def _prepare(prepared={}):
while True:
try:
conn = task.get(timeout=1)
... |
generate_breakpad_symbols.py | #!/usr/bin/env python
# Copyright (c) 2013 GitHub, Inc.
# Copyright (c) 2013 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.
"""Convert pdb to sym for given directories"""
import errno
import glob
import optparse
import o... |
test_runner.py | #
# Copyright (c) 2021, 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 appl... |
env.py | import sys
import os
import cv2
import gym_gvgai
from multiprocessing import Process, Pipe
from baselines.common.vec_env import VecEnv, CloudpickleWrapper
from baselines import logger
from baselines.common.atari_wrappers import *
from baselines.common import set_global_seeds
from baselines.bench import Monitor
from uti... |
HelloWorldASServer.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... |
app.py | #!/bin/python
import threading
from flask import Flask
import logging
from multiprocessing import Process
from kafkawrapper.errorconsumer import error_consume
from configs.configs import app_host, app_port,ENABLE_CORS,context_path
from flask.blueprints import Blueprint
from flask_cors import CORS
import routes
from ser... |
thread_lock.py | #!/usr/bin/env python
# _*_ coding:utf-8 _*_
'''
import threading
import time
print('main thread start!')
gl_num = 0
def show(arg):
global gl_num
#time.sleep(1)
gl_num += 1
time.sleep(0.0001)
print(gl_num)
for i in range(10):
t= threading.Thread(target=show,args=(i,))
t.start()
print('mai... |
Gui.py | import os
import sys
import tempfile
import shutil
import base64
import numpy as np
import pandas as pd
import yaml
import importlib
import imp
import traceback
from multiprocessing import Process
import threading
from threading import Thread, Event
import pickle
from sklearn import linear_model
from jinja2 import Temp... |
resolvers.py | import logging
import math
import multiprocessing as mp
from multiprocessing.queues import SimpleQueue
import sys
import threading
from threading import Thread, Lock
import time
from Queue import Queue, Empty
import analyzer
import communicator
import parsers
import rpsl
threads_count = 10
class FilterResolver:
... |
test_c10d.py | from __future__ import absolute_import, division, print_function, unicode_literals
import copy
import math
import os
import random
import signal
import sys
import tempfile
import threading
import time
import unittest
from datetime import timedelta
from sys import platform
from contextlib import contextmanager
from it... |
okta.py | """
Copyright 2016-present Nike, 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, softw... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.