source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
test_local_task_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... |
fuchsia.py | # Copyright (C) 2018 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the ... |
es_stress.py | from datetime import datetime
import json
import argparse
from elasticsearch import Elasticsearch
from tqdm import tqdm
import time
import es_query
import pandas as pd
import random
import logging
import os
import multiprocessing as mp
ES_HOST = "https://vpc-gamechanger-iquxkyq2dobz4antllp35g2vby.us-east-1.es.amazonaws... |
parallel_ex2.py | from multiprocessing import Process, Pipe
def sqr(conn):
for i in range(10):
conn.send(i*i)
conn.close()
if __name__ == '__main__':
parent_conn, child_conn = Pipe()
p = Process(target=sqr, args=(child_conn,))
p.start()
while True:
if parent_conn.poll(1):
x = parent_... |
context.py | #!/usr/bin/env python3
from http import HTTPStatus
from urllib.parse import urlparse
from ruamel.yaml.comments import CommentedMap as OrderedDict # to avoid '!!omap' in yaml
# from collections import OrderedDict
# import socketserver
import threading
import http.server
import json
import queue
import socket
import su... |
bot.py | # -*- coding: utf-8 -*-
"""
The MIT License (MIT)
Copyright (c) 2017-2019 TwitchIO
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... |
RERAN_Test.py | import os
import sys
from subprocess import call, check_output, Popen, PIPE
from multiprocessing import Process
import os.path as path
default_tests_path="./tests/RERANTests"
translate_jar_path="./resources/jars/RERANTranslate.jar"
replay_bin_path="./resources/bin/replay"
def record_events(filename):
cmd = "adb shel... |
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... |
installwizard.py | # Copyright (C) 2018 The Electrum developers
# Distributed under the MIT software license, see the accompanying
# file LICENCE or http://www.opensource.org/licenses/mit-license.php
import os
import json
import sys
import threading
import traceback
from typing import Tuple, List, Callable, NamedTuple, Optional, TYPE_CH... |
subproc.py | import gym
import time
import ctypes
import numpy as np
from collections import OrderedDict
from multiprocessing.context import Process
from multiprocessing import Array, Pipe, connection
from typing import Any, List, Tuple, Union, Callable, Optional
from tianshou.env.worker import EnvWorker
from tianshou.env.utils im... |
source.py | """
This module consists of encapsulators that return threads
where each thread gets data from an external source and
puts the data into a queue. The scheduler reads data from
the queue and puts the data on to streams. Effectively,
these encapsulators put data from external sources on to
streams.
An external source co... |
test_dbdict.py | #!/usr/bin/env python
import unittest
from threading import Thread
from requests_cache.backends.storage.dbdict import DbDict, DbPickleDict
from tests.test_custom_dict import BaseCustomDictTestCase
class DbdictTestCase(BaseCustomDictTestCase, unittest.TestCase):
def test_bulk_commit(self):
d = DbDict(self... |
_threadedselect.py | # -*- test-case-name: twisted.test.test_internet -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Threaded select reactor
The threadedselectreactor is a specialized reactor for integrating with
arbitrary foreign event loop, such as those you find in GUI toolkits.
There are three things... |
power_monitoring.py | import random
import threading
import time
from statistics import mean
from typing import Optional
from cereal import log
from common.params import Params, put_nonblocking
from common.realtime import sec_since_boot
from selfdrive.hardware import HARDWARE
from selfdrive.swaglog import cloudlog
PANDA_OUTPUT_VOLTAGE = 5... |
utils.py | from __future__ import absolute_import, division, print_function
from collections import OrderedDict, defaultdict
import contextlib
import fnmatch
import hashlib
import json
from locale import getpreferredencoding
import libarchive
import logging
import logging.config
import mmap
import operator
import os
from os.path... |
sqliteq.py | import os
import sys
import threading
import time
import unittest
from functools import partial
try:
import gevent
from gevent.event import Event as GreenEvent
except ImportError:
gevent = None
from peewee import *
from playhouse.sqliteq import ResultTimeout
from playhouse.sqliteq import SqliteQueueDataba... |
main.py | # Copyright (C) 2018 SCARV project <info@scarv.org>
#
# Use of this source code is restricted per the MIT license, a copy of which
# can be found at https://opensource.org/licenses/MIT (or should be included
# as LICENSE.txt within the associated archive or repository).
from sca3s import backend as sca3s_be
from ... |
parallel.py | import concurrent.futures
from multiprocessing import Process, Queue
import time
class v:
def __init__(self, valueInitial):
self.value = valueInitial
def increment(self):
self.value += 1
print("New : " + self.value)
numb = 271508852
def inc(q):
for i in range(0, numb):
... |
helpers.py | """
Helper functions file for OCS QE
"""
import base64
import random
import datetime
import hashlib
import json
import logging
import os
import re
import statistics
import tempfile
import threading
import time
import inspect
from concurrent.futures import ThreadPoolExecutor
from itertools import cycle
from subprocess i... |
_coreg_gui.py | """Traits-based GUI for head-MRI coregistration"""
# Authors: Christian Brodbeck <christianbrodbeck@nyu.edu>
#
# License: BSD (3-clause)
import os
from ..externals.six.moves import queue
import re
from threading import Thread
import warnings
import numpy as np
from scipy.spatial.distance import cdist
# allow import... |
batcher.py | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
# Modifications Copyright 2017 Abigail See
#
# 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... |
connection.py | import socket
import threading
from typing import Any
from .data import Data
from .event_handler import EventHandler
from .utils import valid_data_types, build_data_header, split_header, build_header
from .protocol import headers, defaults
from .exceptions import DataSizeError
class Connection(EventHandler):
de... |
components.py | """Definitions for the components for models participating in the framework.
A "component" is a functional unit that performs a specific step in
the coupled model processing pipeline. Generally, a component will
correspond to one of the models being coupled, but components can also
implement utility processes, such a... |
GUI.py | #!/usr/bin/python
# -*- coding: UTF-8 -*-
# File name : client.py
# Description : client
# Website : www.adeept.com
# E-mail : support@adeept.com
# Author : William
# Date : 2018/08/22
#
import cv2
import zmq
import base64
import numpy as np
from socket import *
import sys
impor... |
mysingleton3.py | #!usr/bin/python
# -*- coding:utf8 -*-
# 利用类实现单例模式 支持多线程的单例模式
import time
import threading
class Singleton(object):
_instance_lock = threading.Lock()
def __init__(self):
time.sleep(1)
@classmethod
def instance(cls, *args, **kwargs):
with cls._instance_lock:
if not hasattr... |
test_ftplib.py | """Test script for ftplib module."""
# Modified by Giampaolo Rodola' to test FTP class, IPv6 and TLS
# environment
import ftplib
import asyncore
import asynchat
import socket
import io
import errno
import os
import threading
import time
try:
import ssl
except ImportError:
ssl = None
from unittest import Test... |
server.py | from http.server import SimpleHTTPRequestHandler
from socketserver import TCPServer
import os, logging, threading, subprocess, json
from pathlib import Path
BASEPATH = os.path.dirname(os.path.realpath(__file__))
vygdbpath = os.path.join(BASEPATH,'gdb_client.py')
global THREAD
THREAD = None
def _restart(cmd):
global ... |
test_waitable.py | # Copyright 2018 Open Source Robotics Foundation, 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... |
subprocess_consumer.py |
import multiprocessing
import random
from mixpanel import Mixpanel, BufferedConsumer
# As your application scales, it's likely you'll want to
# to detect events in one place and send them somewhere
# else. For example, you might write the events to a queue
# to be consumed by another process.
#
# This demo shows ho... |
test_operator_gpu.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... |
notif_handler.py | # Handles sending notifications on Windows, Mac, and Linux.
import platform
import os
import tempfile
import time
from urllib.request import urlopen
from urllib.error import URLError
current_os = platform.system() # This method returns 'Darwin' for macs.
notif_icon_path = os.path.join(os.path.dirname(__file__), 're... |
subproc_vec_env.py | import numpy as np
from multiprocessing import Process, Pipe
from common.vec_env import VecEnv
def worker(remote, env_fn_wrapper):
env = env_fn_wrapper.x()
while True:
cmd, data = remote.recv()
if cmd == 'step':
if data >= env.action_space.n:
# reward = -1.0
... |
main.py | """
DESCRIPTION: Main entry point.
this Section of code accomplishes three things.
First it creates a thread for the communication.
Second it lets TK call it's thread (main)
after the thread has been completed the program advances and closes the listener.
However if you DO NOT want the TK window. Delete the code for ... |
interactive_client.py | import logging
import time
import threading
from kik_unofficial.client import KikClient
from kik_unofficial.callbacks import KikClientCallback
from kik_unofficial.datatypes.xmpp.chatting import IncomingChatMessage, IncomingGroupChatMessage, IncomingStatusResponse, IncomingGroupStatus
from kik_unofficial.datatypes.xmpp... |
10bot.py | # -*- coding: utf-8 -*-
import LINETCR
from LINETCR.lib.curve.ttypes import *
from datetime import datetime
from bs4 import BeautifulSoup
from threading import Thread
from googletrans import Translator
from gtts import gTTS
import time,random,sys,json,codecs,threading,glob,urllib,urllib2,urllib3,re,ast,os,subprocess,r... |
viewer.py | import os
import queue
import sys
import threading
import traceback
import time
try :
import numpy as np
except ImportError:
print('Failed importing numpy. Please install it (pip install numpy).')
exit(0)
try:
import cv2
except ImportError:
print('Failed importing cv2. Please install it (pip insta... |
test_robotframework_interactive.py | from dataclasses import dataclass
from io import StringIO
import os
import sys
import threading
import pytest
from robotframework_interactive.interpreter import RobotFrameworkInterpreter
USE_TIMEOUTS = True
if "GITHUB_WORKFLOW" not in os.environ:
if "pydevd" in sys.modules:
USE_TIMEOUTS = False
@pytes... |
parasol.py | # Copyright (C) 2015-2021 Regents of the University of California
#
# 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 app... |
hammer.py | #!/usr/bin/python3
# -*- coding: utf-8 -*-
# python 3.3.2+ Hammer Dos Script v.1
# by Can Yalçın
# only for legal purpose
from queue import Queue
from optparse import OptionParser
import time,sys,socket,threading,logging,urllib.request,random
def user_agent():
global uagent
uagent=[]
uagent.append... |
test_ipc.py | # -*- coding: utf-8 -*-
'''
:codeauthor: Mike Place <mp@saltstack.com>
'''
# Import python libs
from __future__ import absolute_import, print_function, unicode_literals
import os
import errno
import socket
import threading
import logging
import tornado.gen
import tornado.ioloop
import tornado.testing
import salt... |
Youtube SDP.py | from os import remove, environ, path, system
from time import sleep
from threading import Thread
try:
import pytube, json
from moviepy.editor import VideoFileClip
from youtubesearchpython import SearchVideos
except Exception as msg:
print("[*] Installing requirments - Try re-start the script aft... |
aaapi.py | from flask import Flask, request
from config import CONSUMERSECRET
import base64
import hashlib
import hmac
import json
import multiprocessing as mp
import tipbot
application = Flask('twitter-tipbot')
def sig(msg: bytes) -> str:
sha256_hash_digest = hmac.new(CONSUMERSECRET.encode(), msg = msg, digestmod = hashlib... |
map_comparator.py | #!/usr/bin/env python
import rospy
import sys
import tf
import pudb
import numpy as np
from visualization_msgs.msg import Marker, MarkerArray
from scipy import spatial, stats
from geometry_msgs.msg import Twist
from nav_msgs.msg import Odometry
from time import sleep
from math import pi
from colle... |
the_trickster_0.2.py | # -*- coding: utf-8 -*-
from os import name, system
from time import sleep
from smtplib import SMTP_SSL
from email.message import EmailMessage
from threading import Thread
from random import choice
if name == 'nt':
system("title The Trickster")
system("mode 120, 30")
def clear():
system("cl... |
test_rest_tracking.py | """
Integration test which starts a local Tracking Server on an ephemeral port,
and ensures we can use the tracking API to communicate with it.
"""
import mock
from multiprocessing import Process
import os
import pytest
import socket
import time
import tempfile
from click.testing import CliRunner
import mlflow.exper... |
call_maker.py | from receive_video import *
from receive_audio import *
from audio_server import *
from video_server import *
from database import *
import multiprocessing
import redis
# These functions will run in separate processes
def start_audio_server(r):
audio_server = SendAudioFrameThread(11, "Send Video", 11, r)
audi... |
data_provider.py | from __future__ import print_function
import threading
import tensorflow as tf
import tensorflow.contrib.staging as tf_staging
from pybh import thread_utils
# TODO: Remove or move to support libraries
class QueueBridge(object):
def __init__(self, coord, dequeue_fn, enqueue_fn, transform_fn=None, verbose=False):
... |
test_insert.py | from ssl import ALERT_DESCRIPTION_UNKNOWN_PSK_IDENTITY
import threading
import numpy as np
import pandas as pd
import random
import pytest
from pymilvus import Index, DataType
from base.client_base import TestcaseBase
from utils.util_log import test_log as log
from common import common_func as cf
from common import c... |
dispatcher.py |
import threading
_registry = []
def _register_class(target):
global _registry
_registry += [target]
def execute_methods(method):
threads = []
for cls in _registry:
t = threading.Thread(target=cls.execute, args=(method,))
threads.append(t)
t.start()
print("Waiting for exec... |
test_bz2.py | from test import test_support as support
from test.test_support import TESTFN, _4G, bigmemtest, import_module, findfile
import unittest
from cStringIO import StringIO
import os
import subprocess
import sys
try:
import threading
except ImportError:
threading = None
bz2 = import_module('bz2')
from bz2 import B... |
testclient.py | import asyncio
import http
import inspect
import io
import json
import queue
import threading
import types
import typing
from urllib.parse import unquote, urljoin, urlsplit
import requests
from starlette.types import Message, Receive, Scope, Send
from starlette.websockets import WebSocketDisconnect
# Annotations for... |
DVMod_Win.py | import tkinter as tk
import tkinter.ttk as ttk
from tkinter import simpledialog
import os
import requests
import threading
import shutil
import json
import urllib.request
import subprocess
# ------------------------------MS imports for admin privileges start---------------------------------------------------
import cty... |
multi_process.py | # MIT License
# Copyright (c) 2014 Adafruit Industries
# Author: Tony DiCola
# Improved by the yongdol503
# 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 with... |
jupyter_magics.py | # This code is part of Qiskit.
#
# (C) Copyright IBM 2017, 2018.
#
# 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 modifications or derivat... |
SCC.py | ''' save this as a script to run in the terminal '''
import sys, threading
sys.setrecursionlimit(3000000)
threading.stack_size(67108864)
def kosaraju(graph, loop_order={}):
"""
Compute strongly connected components or SCCs in the graph.
input: a directed graph
output: a tuple(ft, ld) where -:
... |
common.py | """Test the helper method for writing tests."""
from __future__ import annotations
import asyncio
import collections
from collections import OrderedDict
from collections.abc import Awaitable, Collection
from contextlib import contextmanager
from datetime import datetime, timedelta
import functools as ft
from io import... |
gui_main.py | import sys
sys.path.insert(0,'/usr/local/lib/python2.7/site-packages')
import cv2
import numpy as np
import threading
import json
import random
import math
import time
import types
#import Tkinter
from Tkinter import *
import tkFileDialog
import ttk
import tkMessageBox
import tkFont
import ScrolledText
import Pmw
from ... |
utility.py | import os #导入系统编程的操作模块
import math #导入内置数学类函数库,完成基本的数学运算
import time #导入处理时间数据的标准库
import datetime #导入处理时间日期的标准库
from multiprocessing import Process #导入进程模块,实现对资源的调用、内存的管理、网络接口的调用
from multiprocessing import Queue #导入队列模块,实现信息在多个线程间信息的安全交换
import matplotlib #导入绘图工具库
matplotlib.use('Agg') #配置matplotlib的后端,使用‘Agg’渲染器,该语... |
oracletest.py | import tensorflow as tf
from utils.nn import linearND, linear
from mol_graph import atom_fdim as adim, bond_fdim as bdim, max_nb, smiles2graph, smiles2graph_test, bond_types
from models import *
import math, sys, random
from optparse import OptionParser
import threading
from multiprocessing import Queue
import rdkit
fr... |
test_futures.py | from panda3d import core
import pytest
import threading
import time
import sys
if sys.version_info >= (3,):
from concurrent.futures._base import TimeoutError, CancelledError
else:
TimeoutError = Exception
CancelledError = Exception
def test_future_cancelled():
fut = core.AsyncFuture()
assert not... |
Blinker.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import json
import time as _time
import socket
import threading
from Blinker.BlinkerConfig import *
from Blinker.BlinkerDebug import *
from BlinkerUtility.BlinkerUtility import *
# from BlinkerAdapters.BlinkerBLE import *
# from BlinkerAdapters.Blink... |
nodemanagerservice.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... |
start_network.py | # Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the Apache 2.0 License.
import http
import time
import sys
import json
import os
from loguru import logger as LOG
from web3_client import Web3Client
import json
import agent
from multiprocessing import Process
sys.path.append("../CCF/tests")... |
test_subscribe.py | """Tests for the subscription registry and http server module."""
import threading
import unittest.mock as mock
from http.server import HTTPServer
import pytest
import requests
from pywemo import LightSwitch, subscribe
@pytest.fixture()
def outer():
"""Mock SubscriptionRegistry used for testing the http server.... |
tcp_flooding.py | import random
import socket
import string
import sys
import threading
import time
def attack(host: str, port: int = 80, request_count: int = 10 ** 10) -> None:
# Threading support
thread_num = 0
thread_num_mutex = threading.Lock()
# Utility function
def print_status() -> None:
global thre... |
nanny.py | from __future__ import annotations
import asyncio
import errno
import logging
import os
import shutil
import threading
import uuid
import warnings
import weakref
from contextlib import suppress
from inspect import isawaitable
from queue import Empty
from time import sleep as sync_sleep
from typing import TYPE_CHECKING... |
trex_async_client.py | #!/router/bin/python
try:
# support import for Python 2
import outer_packages
except ImportError:
# support import for Python 3
import client.outer_packages
from client_utils.jsonrpc_client import JsonRpcClient, BatchMessage
from common.text_opts import *
import json
import threading
import time
impo... |
main.py | import os
import time
import socket
import threading
import pandas as pd
from configparser import ConfigParser
import pyfortiapimod
start_global = 0.0
api_invoke_add = []
api_invoke_move = []
rule_apply = []
global_time = []
total_time = []
api_invoke_delete = []
def change_format_float_list(old_list):
new_li... |
serverlocal.py | from flcore.clients.clientavg import clientAVG
from flcore.servers.serverbase import Server
from threading import Thread
class Local(Server):
def __init__(self, args, times):
super().__init__(args, times)
# select slow clients
self.set_slow_clients()
self.set_clients(args, clientA... |
train.py | from dataset import processes
import os
import torch
import argparse
import logging
import yaml
import wandb
import numpy as np
import time
import random
import math
from copy import deepcopy
from threading import Thread
from torch import nn
from torch import optim
import test
from torch.cuda import amp
im... |
run.py | import os
import time
import shutil
import torch
import numpy as np
import numpy.random as rd
import multiprocessing as mp
from elegantrl.env import build_env
from elegantrl.replay import ReplayBuffer, ReplayBufferMP
from elegantrl.evaluator import Evaluator
"""[ElegantRL.2021.09.01](https://github.com/AI4Finance-LL... |
apply-firewall.py | #!/usr/bin/env python
"""
Apply a "Security Group" to the members of an etcd cluster.
Usage: apply-firewall.py
"""
import os
import re
import string
import argparse
from threading import Thread
import uuid
import colorama
from colorama import Fore, Style
import paramiko
import requests
import sys
import yaml
def ge... |
web_service.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... |
demon2.py | import threading
import time
def run():
time.sleep(2)
print('当前线程的名字是: ', threading.current_thread().name)
time.sleep(2)
if __name__ == '__main__':
start_time = time.time()
print('这是主线程:', threading.current_thread().name)
thread_list = []
for i in range(5):
t = threading.Thread... |
pinata.py | # robot-arm.py
#
import time
import arena
import random
import os
import json
import time
import threading
import signal
pinata_loc = [ 3, 2, -10]
NUM_HITS = 10
hit_counter = NUM_HITS
# AREA for seeding location and effects
AREA_X_START = -100
AREA_X_STOP = 100
AREA_Y_START = -100
AREA_Y_STOP = 100
NUM_BOXES = 50
k... |
external_api.py | import json
import re
import requests
import string
import threading
import urllib
from bs4 import BeautifulSoup
ONELOOK_URL = 'https://api.datamuse.com/words?{params}'
GUBALLA_URL = 'https://www.guballa.de/vigenere-solver'
MW_URL = 'https://merriam-webster.com/thesaurus/{word}'
NUTRIMATIC_URL = 'https://nutrimatic.o... |
test_local_task_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... |
build_imagenet_data.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 a... |
big_boss.py | from game_ctl import *
import win32com.client
import os
import threading
import logsystem
# 初始化对象
log = logsystem.WriteLog()
yys = GameControl(u'阴阳师-网易游戏')
log.writeinfo('Registration successful')
def is_admin():
'''
UAC申请,获得管理员权限
'''
try:
return ctypes.windll.shell32.IsUserAnAdmin()
exc... |
tuq_free_tier_limits.py | from .tuq import QueryTests
from membase.api.rest_client import RestConnection
from remote.remote_util import RemoteMachineShellConnection
from security.rbac_base import RbacBase
from deepdiff import DeepDiff
import threading
import time
import json
class QueryFreeLimits(QueryTests):
def setUp(self):
super... |
server.py | import socket
import os
import threading
import hashlib
import base64
BINARY_PATH="BINARY_PATH_PLACEHOLDER"
def read_headers(conn):
headers = ""
while headers[-4:] != '\r\n\r\n':
read = conn.recv(1024)
headers+= read
return headers
def parse_headers(headers):
header_dict = {}
headers = headers[:-4]
headers... |
sga_sa.py | from GA_pack.GAs.basic.sga import SGA
from GA_pack.encoders.binary_en_de_coder import multi_binary_encoder, multi_binary_list_decoder
from SA_pack.energy_functions.energy_pack import energy_pack
from SA_pack.SAs.sa import sa_thread
import time
from queue import Queue
from threading import Thread
class SGA_SA(SGA):
... |
safe_t.py | from binascii import hexlify, unhexlify
import traceback
import sys
from electrum.util import bfh, bh2u, versiontuple, UserCancelled, UserFacingException
from electrum.bitcoin import TYPE_ADDRESS, TYPE_SCRIPT
from electrum.bip32 import BIP32Node
from electrum import constants
from electrum.i18n import _
from electrum.... |
email.py | from threading import Thread
from flask import current_app, render_template
from flask_mail import Message
from . import mail
def send_async_email(app, msg):
with app.app_context():
mail.send(msg)
def send_email(to, subject, template, **kwargs):
app = current_app._get_current_object()
msg = Messa... |
loadgen.py | """
Copyright 2017 BlazeMeter 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, softwar... |
chopper2.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
This module implements the QKD business logic. It manages and coordinates all
releveant processes to generate encryption keys.
Copyright (c) 2020 Mathias A. Seidler, S-Fifteen Instruments Pte. Ltd.
Permission is hereby granted, free of charge, to any person obtainin... |
ConsoleFrame.py | import threading
from tkinter import Button, Frame, StringVar, Text
from tkinter.constants import COMMAND, END
from datetime import datetime
import serial
class ConsoleFrame(Frame):
def __init__(self, master, *args, **kwargs):
super().__init__(master=master, *args, **kwargs)
self.master = master
... |
LocalInterface.py | from .Interface import Interface
import socketserver
import threading
import socket
import time
import sys
import os
import RNS
class HDLC():
FLAG = 0x7E
ESC = 0x7D
ESC_MASK = 0x20
@staticmethod
def escape(data):
data = data.replace(bytes([HDLC.ESC]), by... |
factory.py | """
RPyC connection factories: ease the creation of a connection for the common
cases)
"""
import socket
import threading
try:
from thread import interrupt_main
except ImportError:
try:
from _thread import interrupt_main
except ImportError:
# assume jython (#83)
from java.lang impor... |
dx_provision_vdb.py | #!/usr/bin/env python
#Adam Bowen - Apr 2016
#This script provisions a vdb or dSource
# Updated by Corey Brune Aug 2016
# --- Create vFiles VDB
#requirements
#pip install docopt delphixpy
#The below doc follows the POSIX compliant standards and allows us to use
#this doc to also define our arguments for the script.
... |
mic_client.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = 'Benjamin Milde'
import argparse
from ws4py.client.threadedclient import WebSocketClient
import time
import threading
import sys
import urllib
import Queue
import json
import time
import os
import pyaudio
import wave
import nltk
import traceback
import request... |
extract.py | #!/usr/bin/env python
import pandas as pd
import numpy as np
import multiprocessing
import argparse
import operator
import os
import random
import sys
import time
import random
import subprocess
import pysam
import collections
import warnings
import math
import re
from Bio import SeqIO
base_path = os.path.split(__fil... |
test_conditions.py | # -*- coding: utf-8 -*-
# **CAUTION**: To test the condition system, using a test framework that uses
# that condition system (`unpythonic.test.fixtures`), leads to circular logic.
# In my defense, the different parts of `unpythonic` have co-evolved, so what
# we have here is a Hartree-Fock equilibrium.
#
# If you don... |
tcp_ser.py | import socket
import threading
bind_ip = "0.0.0.0"
bind_port = 9999
server = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
server.bind((bind_ip, bind_port))
server.listen(5)
print "[*] Listening on %s:%d" % (bind_ip,bind_port)
def handle_client(client_socket):
request = client_socket.recv(1024)
print "[*] R... |
thread_executor.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... |
elmap.py | from copyreg import pickle
import os
from numpy import save
import yaml
from sel_map_segmentation import ColorScale
import rospy
from mesh_msgs.msg import MeshGeometryStamped, MeshGeometry, MeshMaterial, \
MeshMaterials, MeshMaterialsStamped, MeshFaceCluster, \
Me... |
Urllib3Using.py | # Copyright 2019, Kay Hayen, mailto:kay.hayen@gmail.com
#
# Python test originally created or extracted from other peoples work. The
# parts from me are licensed as below. It is at least Free Software where
# it's copied from other people. In these cases, that will normally be
# indicated.
#
# L... |
multi_crawler.py | def date2():
month31=[1,3,5,7,8,10,12]
month30=[4,6,9,11]
year2=['2012']
nday31=range(1,32)
nday30=range(1,31)
nday28=range(1,29)
day10=['01','02','03','04','05','06','07','08','09']
# month7=['06','07','08','09','10','11','12']
month7=['11','12']
nday31 = map(str,nday31[9:])
... |
hive.py | import inspect
from collections import defaultdict
from contextlib import contextmanager
# from .utils import Queue # TODO: Optimize queue
from queue import Queue
from queue import Empty
from threading import Thread
from .core import Listener, Streamer, Event, Killable
from .logging import create_logger, debug_handler... |
runner.py | #!/usr/bin/env python3
# Copyright 2010 The Emscripten Authors. All rights reserved.
# Emscripten is available under two separate licenses, the MIT license and the
# University of Illinois/NCSA Open Source License. Both these licenses can be
# found in the LICENSE file.
"""This is the Emscripten test runner. To run ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.