source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
manager.py | #!/usr/bin/env python3
import os
import time
import sys
import fcntl
import errno
import signal
import shutil
import subprocess
import datetime
import textwrap
from typing import Dict, List
from selfdrive.swaglog import cloudlog, add_logentries_handler
from common.basedir import BASEDIR
from common.hardware import HA... |
player.py | #!/usr/bin/env python
#encoding: UTF-8
'''
网易云音乐 Player
'''
# Let's make some noise
import subprocess
import threading
import time
import os
import signal
from .ui import Ui
# carousel x in [left, right]
carousel = lambda left, right, x: left if (x>right) else (right if x<left else x)
class Player:
def __in... |
amqp_exchange.py | try:
import kombu
from kombu import pools
except ImportError:
kombu = None
import socket
import logging
import threading
from time import sleep
log = logging.getLogger(__name__)
KOMBU_UNAVAILABLE = "Attempting to bind to AMQP message queue, but kombu dependency unavailable"
DEFAULT_EXCHANGE_NAME = "lwr"... |
dirTrav.py | #!/usr/bin/python
#ONLY WEB HAS BEEN IMPLEMENTED
#If /usr/share/dotdotpwn/Reports exists, dotdotpwn will automatically put raw results in there for you
#Reconscan.py creates the Reports directory for you
import sys
import os
import subprocess
from subprocess import CalledProcessError
import argparse
import multiproce... |
test_api.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... |
generate_main.py | # %%
import os
import pandas as pd
import numpy as np
import threading
import time
base_dir = os.getcwd()
# %%
# 初始化表头
header = ['user', 'n_op', 'n_trans', 'op_type_0', 'op_type_1', 'op_type_2', 'op_type_3', 'op_type_4', 'op_type_5',
'op_type_6', 'op_type_7', 'op_type_8', 'op_type_9', 'op_type_perc', 'op_ty... |
mcs0_calc.py | # -*- coding: utf-8 -*-
import copy
import os
import threading
import warnings
from typing import Union, Callable
import numpy as np
import pandas as pd
from fsetools.lib.fse_bs_en_1991_1_2_parametric_fire import temperature as _fire_param
from fsetools.lib.fse_bs_en_1993_1_2_heat_transfer_c import protection_thicknes... |
transport.py | #!/usr/bin/env python
# https://stackoverflow.com/questions/12607516/python-udp-broadcast-not-sending
# https://stackoverflow.com/questions/15962119/using-bytearray-with-socket-recv-into
from socket import *
# Dynamic load msg classes
import roslib
import imp
import sys
import threading
import rospy
from StringIO im... |
qpapers.py | import re
import threading
from telegram import ParseMode, InlineKeyboardMarkup, InlineKeyboardButton
from telegram.chataction import ChatAction
from telegram.error import BadRequest
from telegram.ext.dispatcher import run_async
from Brain.Modules.help import get_help
from Brain.Utils import button_menu, qpaper_utils... |
distributed.py | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""Distributed helpers."""
import multiprocessing
import os
import signal
import threading
import traceback
import torch
from xnas.core.conf... |
async_executor.py | import logging
from threading import Lock, Thread
logger = logging.getLogger(__name__)
class AsyncExecutor(object):
def __init__(self):
self._busy = False
self._thread_lock = Lock()
self._scheduled_action = None
self._scheduled_action_lock = Lock()
@property
def busy(sel... |
env.py | ''' Batched Room-to-Room navigation environment '''
import sys
sys.path.append('build')
sys.path.append('../build')
import MatterSim
import csv
import numpy as np
import math
import base64
import utils
import json
import os
import random
import networkx as nx
from param import args
from utils import load_datasets, lo... |
test_subprocess.py | import unittest
from unittest import mock
from test import support
from test.support import import_helper
from test.support import os_helper
from test.support import warnings_helper
import subprocess
import sys
import signal
import io
import itertools
import os
import errno
import tempfile
import time
import traceback
... |
workdlg.py | import logging
import os
import queue
import signal
import subprocess
import threading
import time
import tkinter as tk
from tkinter import ttk, messagebox
from typing import Optional
from thonny import tktextext
from thonny.languages import tr
from thonny.misc_utils import running_on_windows
from thonny.ui_utils impo... |
python_web_service.py | from hackernews import HackerNews
import json
import numpy as np
import unicodedata
import random
import string
import cherrypy
import Queue
import threading
class article:
url = ""
title = ""
article_id = 0
article_vector = None
mod_weight = 0.1
def __init__(self, url, title, article_id):
... |
worker.py | #!/usr/bin/python3
# first init env
import env, tools
config = env.getenv("CONFIG")
tools.loadenv(config)
# must import logger after initlogging, ugly
from log import initlogging
initlogging("docklet-worker")
from log import logger
import xmlrpc.server, sys, time
from socketserver import ThreadingMixIn
import thread... |
ThreadChapter10.py | # encoding:UTF-8
__author__ = 'Hope6537'
import threading
import time
# 新线程执行的代码:
def loop():
print 'thread %s is running...' % threading.current_thread().name
n = 0
while n < 5:
n = n + 1
print 'thread %s >>> %s' % (threading.current_thread().name, n)
time.sleep(1)
print 'thr... |
server.py | import asyncio
import os
import traceback
from collections import deque
from functools import partial
from inspect import isawaitable
from multiprocessing import Process
from signal import SIG_IGN, SIGINT, SIGTERM, Signals
from signal import signal as signal_func
from socket import SO_REUSEADDR, SOL_SOCKET, socket
fro... |
detector_utils.py | # Utilities for object detector.
import numpy as np
import sys
import tensorflow as tf
import os
from threading import Thread
from datetime import datetime
import cv2
from utils import label_map_util
from collections import defaultdict
from matplotlib import pyplot as plt
from scipy.cluster.vq import vq, kmeans
import... |
data_runner.py | import multiprocessing
class DataRunnerMP:
"""
A multi-processing data runner for tensorflow
"""
def __init__(self, task_func, task_generator, input_pls, capacity=100):
self._input_pls = input_pls
self._task_func = task_func
self._task_generator = task_generator
self.cou... |
bot.py | # coding=utf8
"""
bot.py - Willie IRC Bot
Copyright 2008, Sean B. Palmer, inamidst.com
Copyright 2012, Edward Powell, http://embolalia.net
Copyright © 2012, Elad Alfassa <elad@fedoraproject.org>
Licensed under the Eiffel Forum License 2.
http://willie.dftba.net/
"""
from __future__ import unicode_literals
from __futu... |
io.py | """Data iterators for common data formats."""
from __future__ import absolute_import
from collections import OrderedDict, namedtuple
import sys
import ctypes
import logging
import threading
import numpy as np
from .base import _LIB
from .base import c_array, c_str, mx_uint, py_str
from .base import DataIterHandle, NDA... |
movementSampler2.py | #!/usr/bin/env python3.5
import argparse
import logging
import time
import cv2
import numpy as np
import tensorflow as tf
from tf_pose import common
from tf_pose.estimator import TfPoseEstimator
from tf_pose.networks import get_graph_path, model_wh
import datetime
from threading import Thread
import pickle
import i... |
conftest.py | import asyncio
import json
import os
import threading
import time
import typing
import pytest
import trustme
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives.serialization import (
BestAvailableEncryption,
Encoding,
PrivateFormat,
load_pem_private_key,
)
from... |
BrokerDemo.py | # (C) Copyright 2021 ECMWF.
#
# This software is licensed under the terms of the Apache Licence Version 2.0
# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
# In applying this licence, ECMWF does not waive the privileges and immunities
# granted to it by virtue of its status as an intergovernmenta... |
parallel-mp.py | import multiprocessing as mp
import time
def task(i):
print("sleeping ",i)
time.sleep(3)
print("awakening ",i)
if __name__ == '__main__':
jobs = []
for i in range(4):
p = mp.Process(target=task,args=[i])
p.start()
jobs.append(p)
for p in jobs:
p.join() |
watch_sync.py | import logging
import os
import queue
import threading
from datetime import datetime
import watchdog.events
import watchdog.observers
from . import path_match
from .file_trees import compare_file_trees, get_remote_mtime
from .models import ChangeEventType, FsChangeEvent
from .pubsub import Messages
class TimestampD... |
support.py | import gc
import time
import thread
import os
import errno
from pypy.interpreter.gateway import interp2app, unwrap_spec
from pypy.module.thread import gil
NORMAL_TIMEOUT = 300.0 # 5 minutes
def waitfor(space, w_condition, delay=1):
adaptivedelay = 0.04
limit = time.time() + delay * NORMAL_TIMEOUT
whi... |
hw_TCP2CAN.py | import time
import struct
import socket
import threading
import traceback
import socketserver
from cantoolz.can import CANMessage
from cantoolz.module import CANModule, Command
class CustomTCPClient:
def __init__(self, conn):
self.socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
self.s... |
viz.py | import argparse
import os
import threading
import ouster.client as client
from ouster.sdk._viz import PyViz
def main() -> None:
descr = """Visualize pcap or sensor data using simple viz bindings."""
epilog = """When reading data from a sensor, this will currently not
configure the sensor or query it for... |
velociraptor_python_tools.py | #Make backwards compatible with python 2, ignored in python 3
from __future__ import print_function
import sys,os,os.path,string,time,re,struct
import math,operator
import numpy as np
import h5py #import hdf5 interface
import tables as pytb #import pytables
import pandas as pd
from copy import deepcopy
from collection... |
drive5.py | from __future__ import print_function
import pygame
import os, sys, time, shutil
from datetime import datetime
import select
import argparse
import urllib2
import subprocess
#import cv2
import numpy as np, pandas as pd
from PIL import ImageOps
from PIL import Image
from train4 import process_image, model
import logging... |
pika.py | import json
import logging
import typing
import os
import warnings
from collections import deque
from threading import Thread
from typing import Dict, Optional, Text, Union, Deque, Callable
import time
from rasa.constants import ENV_LOG_LEVEL_LIBRARIES, DEFAULT_LOG_LEVEL_LIBRARIES
from rasa.core.brokers.broker import... |
pushrpc.py | """Pusher intergration for messages from the cloud."""
import json
import logging
import Queue
import sys
import threading
import uuid
from pusherclient import Pusher
import requests
import websocket
from common import public_creds
from pi import simple_pusher
CONFIG_FILE = 'proxy.cfg'
APPENGINE_ADDRESS = 'https:/... |
test_server.py | # -*- coding: utf-8 -*-
"""Tests for pyss3.server."""
import pyss3.server as s
import threading
import argparse
import socket
import pytest
import pyss3
import json
import sys
from os import path
from pyss3 import SS3
from pyss3.util import Dataset, Print
HTTP_REQUEST = "%s %s HTTP/1.1\r\nContent-Length: %d\r\n\r\n%s... |
test_py_reader_using_executor.py | # Copyright (c) 2018 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... |
worker_process_wrapper.py | """
worker_process_wrapper.py is the entrypoint for Horovod worker processes.
It exists to redirect stdout/stderr to the docker logging without needing
to package a shell script.
"""
import os
import subprocess
import sys
import threading
from typing import BinaryIO, List
from determined import constants
def forward... |
test_dispatcher.py | from __future__ import print_function, division, absolute_import
import errno
import multiprocessing
import os
import shutil
import subprocess
import sys
import threading
import warnings
import numpy as np
from numba import unittest_support as unittest
from numba import utils, jit, generated_jit, types, typeof
from ... |
sqlite_web.py | #!/usr/bin/env python
import datetime
import math
import operator
import optparse
import os
import re
import sys
import threading
import time
import webbrowser
from collections import namedtuple, OrderedDict
from functools import wraps
from getpass import getpass
from io import TextIOWrapper
# Py2k compat.
if sys.ver... |
cassettes.py | import base64
import json
import re
import sys
import threading
from queue import Queue
from typing import Any, Dict, Generator, Iterator, List, Optional, cast
import attr
import click
import requests
from requests.cookies import RequestsCookieJar
from requests.structures import CaseInsensitiveDict
from .. import con... |
concurrency.py | import codecs
from invoke.vendor.six.moves.queue import Queue
from invoke.vendor.six.moves import zip_longest
from invoke.util import ExceptionHandlingThread
from pytest import skip
from fabric import Connection
_words = "/usr/share/dict/words"
def _worker(queue, cxn, start, num_words, count, expected):
tail... |
pydPiper.py | #!/usr/bin/python.pydPiper3
# coding: UTF-8
# pydPiper service to display music data to LCD and OLED character displays
# Written by: Ron Ritchey
# Edited by: Saiyato
import json, threading, logging, queue, time, sys, getopt, moment, signal, subprocess, os, copy, datetime, math, requests
import pages
import displays
... |
topologyGoal.py | # Copyright 2021 CLOBOT Co. Ltd
#
# 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... |
test_caching.py | #!usr/bin/env python3
import threading
import time
from typing import Optional
import pytest
from anchore_engine.subsys.caching import (
TTLCache,
local_named_cache,
thread_local_cache,
)
@pytest.fixture
def ttl_cache(request):
cache: TTLCache = TTLCache()
value: str = "test_value"
cache.cac... |
test_frame_evaluator.py | import sys
import threading
import pytest
from pydev_tests_python.debugger_unittest import IS_PY36_OR_GREATER, IS_CPYTHON
from pydev_tests_python.debug_constants import TEST_CYTHON
pytestmark = pytest.mark.skipif(not IS_PY36_OR_GREATER or not IS_CPYTHON or not TEST_CYTHON, reason='Requires CPython >= 3.6')
def get_f... |
connectbox_exporter.py | import json
import logging
import threading
import time
from http.server import HTTPServer
from socketserver import ThreadingMixIn
from typing import Dict
import click
import compal
from lxml.etree import XMLSyntaxError
from prometheus_client import CollectorRegistry, MetricsHandler
from prometheus_client.metrics_core... |
test_nntplib.py | import io
import socket
import datetime
import textwrap
import unittest
import functools
import contextlib
import os.path
import re
import threading
from test import support
from nntplib import NNTP, GroupInfo
import nntplib
from unittest.mock import patch
try:
import ssl
except ImportError:
... |
file_helpers.py | import sys
import codecs
import re
from functools import wraps
from contextlib import contextmanager
from collections import OrderedDict, defaultdict
import json
import multiprocessing as mp
import threading
import warnings
import os
from abc import ABCMeta
try:
basestring
except NameError:
basestring = (str, ... |
nighttimeSniffer.py | #!/usr/bin/env python3
# -.- coding: utf-8 -.-
try:
import subprocess
import os
import sys
import time
import json
import pyshark
import sqlite3
import datetime
import argparse
import threading
import traceback
import concurrent.futures
except KeyboardInterrupt:
debug... |
PlayerAI_3.py | import multiprocessing
import sys
import time
from logging.handlers import RotatingFileHandler
from BaseAI_3 import BaseAI
from CompositeCalculation import CompositeUtilityCalculator
from FastGrid import FastGrid
from algorithms import *
deadline_offset = 0.1 # mandated solution timeout for exercise is .1 secs
max_d... |
rally_loader.py | # Copyright 2016 Cisco Systems, 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 la... |
PyLidar3_test.py | import threading
import PyLidar3
import matplotlib.pyplot as plt
import math
import time
def draw():
global is_plot
while is_plot:
plt.figure(1)
plt.cla()
plt.ylim(-4000,4000)
plt.xlim(-4000,4000)
plt.scatter(x,y,c='r',s=8)
plt.pause(0.001)
plt.close("all... |
gff3.py | # -*- coding: utf-8 -*-
#
# This file is part of Sequana software
#
# Copyright (c) 2016-2020 - Sequana Development Team
#
# File author(s):
# Thomas Cokelaer <thomas.cokelaer@pasteur.fr>
#
# Distributed under the terms of the 3-clause BSD license.
# The full license is in the LICENSE file, distributed with t... |
test_runner.py | #!/usr/bin/env python3
# Copyright (c) 2014-2016 The Bitcoin Core developers
# Copyright (c) 2017 The Bitcoin developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Run regression test suite.
This module calls down into ind... |
cli.py | import argparse
import requests
import json
import sys
from simple_term_menu import TerminalMenu
from pygments import highlight
from pygments.lexers.bibtex import BibTeXLexer
from pygments.formatters import TerminalFormatter
from multiprocess import Process, Manager
import shutil
def fullname(str1):
# split the s... |
generate_data.py | #%%
# Fetch data from reproducibility.org
#sf.Fetch('marm','marmvel.hh')
# #%% [markdown]
# ## Generating the model
# First we create model by augmenting Marmousi II
#%% [markdown]
# ## Generator features
#
# ### Several layers can be generated from a single one
#
# ### Velocities are exactly the same as in mo... |
test_jutil.py | '''test_jutil.py - test the high-level interface
python-javabridge is licensed under the BSD license. See the
accompanying file LICENSE for details.
Copyright (c) 2003-2009 Massachusetts Institute of Technology
Copyright (c) 2009-2013 Broad Institute
All rights reserved.
'''
from __future__ import absolute_import
... |
light_port_scanner.py | #!/usr/bin/env python3
# author: greyshell
# description: TBD
import socket
import optparse
from socket import *
from threading import *
from time import sleep
screenLock = Semaphore(value=1)
def connect_scan(tgtHost, tgtPort):
try:
sock = socket(AF_INET, SOCK_STREAM)
buffer = "greyshell\r\n"
... |
worker_test.py | # Copyright (c) 2012 Spotify AB
#
# 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, s... |
pjf_server.py | """
The MIT License (MIT)
Copyright (c) 2016 Daniele Linguaglossa <d.linguaglossa@mseclab.com>
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 th... |
perf_test_mock_service_v4_test_timer.py | import requests
import threading
import queue
import sys
import time
# Global variables
queue_results = queue.Queue()
start_time = 0
# event flag to set and check test time is up.
event_time_up = threading.Event()
def test_mock_service():
url = 'http://127.0.0.1:5000/json'
resp = requests.get(url)
# C... |
__init__.py | # coding=utf-8
""" User Interface Tools """
import ee
import threading
import pprint
from . import dispatcher, map
ASYNC = False
def eprint(*args, **kwargs):
""" Print EE Objects. Similar to `print(object.getInfo())` but with
some magic (lol)
:param eeobject: object to print
:type eeobject: ee.Compu... |
PrimitiveTest.py | ##########################################################################
#
# Copyright (c) 2008-2013, Image Engine Design 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:
#
# * Redis... |
BlasterAmpTonePlayer.py | """
**** This generates a High Quality 16 Bit Audio Tone Though a Sound Blaster USB Dongle *****
Code based on this Internet thread,
https://stackoverflow.com/questions/974071/python-library-for-playing-fixed-frequency-sound
The soundfile module (https://PySoundFile.readthedocs.io/) has to be instal... |
test_waiting.py | import sys
import time
from threading import Thread
import pytest
from mock import ANY, Mock, call, patch
from nameko.testing.waiting import WaitResult, wait_for_call
@pytest.fixture
def forever():
value = [True]
yield value
value.pop()
class TestPatchWaitUseCases(object):
def test_wait_for_speci... |
interpreter.py | """
Interpreter
-----------
Runs a block of FoxDot code. Designed to be overloaded
for other language communication
"""
from __future__ import absolute_import
from .config import *
from .message import MSG_CONSOLE
from subprocess import Popen
from subprocess import PIPE, STDOUT
from datetime import d... |
domainfuzzer.py | from dnslookup import lookup
from logger import Output, col
from threading import Thread, Lock
from env import SIGINT_handler
import time, signal, math
import random, string, sys, io, re
import dns.zone
class ScanList():
def __init__(self, args):
if args.dictionary:
try:
self.un... |
create_indoors.py | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from datetime import datetime
import os
import random
import sys
import threading
import numpy as np
import tensorflow as tf
tf.app.flags.DEFINE_integer('train_shards', 12,
'Number... |
message.py | import json
import time
from threading import Thread
class Listen:
listen = False
message_ids = []
def message_list(self):
url = "https://api.mail.tm/messages"
headers = { 'Authorization': 'Bearer ' + self.token }
response = self.session.get(url, headers=headers)
response.r... |
msg_dispatcher_base.py | # Copyright (c) Microsoft Corporation. All rights reserved.
#
# MIT License
#
# 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 u... |
benchmark-rendering-multiprocess.py | # Copyright 2017-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
import time
import os
import multiprocessing as mp
import argparse
import sys
import numpy as np
import cv2
from House3D import objr... |
__main__.py | import contextlib
import os
import time
from threading import Thread
from tanit.master.client.factory import ClientType
from tanit.master.client.factory import ThriftClientFactory
from tanit.master.config.config import MasterConfig
from tanit.master.server.server import MasterServer
from tanit.worker.server.server imp... |
log.py | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Thu Apr 6 17:55:45 2017
@author: ahefny
"""
import threading
import time
import cPickle
import os
import os.path
class Logger:
_instance = None
def __init__(self):
self.global_tag = None
self.filter = lambda gtag,tag: Tru... |
pubsub_json_status_push.py | # Copyright 2016 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.
import ConfigParser
import contextlib
import Queue
import base64
import collections
import datetime
import functools
import httplib2
import json
import multi... |
test_utils.py | # Copyright 2016 Amazon.com, Inc. or its affiliates. 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. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompa... |
cache.py | import contextlib
import logging
import errno
from typing import List
from enum import Enum
from pathlib import Path
from threading import Thread, Event
from fuse import FuseOSError
from requests.exceptions import ReadTimeout
from dropbox import Dropbox
from dropbox_fs.crawler import File
log = logging.get... |
views.py | from django.shortcuts import render
from django.db import transaction
from django.http import JsonResponse
from django.core.serializers.json import DjangoJSONEncoder
from django.db.models.fields.files import ImageFieldFile
from .models import Gallery
import requests
import threading
import random
import json
class Ex... |
nmap_scanner.py | #!/usr/bin/python3
'''
Submits nmap scans to nweb from local targets.txt.
'''
import sys
import requests
import subprocess
import time
import os
import random
import string
import json
import base64
import threading
import multiprocessing
import multiprocessing.pool
from netaddr import *
scope = []
try:
import ip... |
openweathermap.py | # -*- coding: utf-8 -*-
# FOGLAMP_BEGIN
# See: http://foglamp.readthedocs.io/
# FOGLAMP_END
""" Weather report from OpenWeatherMap async plugin """
import copy
import asyncio
import http.client
import json
import logging
from threading import Thread
from aiohttp import web
from foglamp.common import logger
from fog... |
test_pool.py | """Test pool."""
import threading
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from homeassistant.components.recorder.const import DB_WORKER_PREFIX
from homeassistant.components.recorder.pool import RecorderPool
def test_recorder_pool(caplog):
"""Test RecorderPool gives the same ... |
filemanager.py | """
File Manager
============
Copyright (c) 2019 Ivanov Yuri
For suggestions and questions:
<kivydevelopment@gmail.com>
This file is distributed under the terms of the same license,
as the Kivy framework.
A simple manager for selecting directories and files.
Example
-------
from kivy.app import App
from kivy.core... |
screens.py | import asyncio
from decimal import Decimal
import threading
from typing import TYPE_CHECKING, List, Optional, Dict, Any
from kivy.app import App
from kivy.clock import Clock
from kivy.properties import ObjectProperty
from kivy.lang import Builder
from kivy.factory import Factory
from kivy.uix.recycleview import Recycl... |
network.py | import socket
from common import constants as c
from common import settings
import json
import threading
from threading import Timer
import select
from common.game import game
import time
import sys
curr_snake_movements = {}
next_snake_id = 1
message_index = 1
time_step = 0
completed_steps = {} # time_step:1
snakes_... |
bokeh-server.py | import argparse
import keras.backend.tensorflow_backend as ktf
import numpy as np
import tensorflow as tf
from bokeh.embed import server_document
from bokeh.layouts import column, gridplot
from bokeh.models import ColumnDataSource, Slider
from bokeh.plotting import figure
from bokeh.sampledata.sea_surface_temperature ... |
test_random.py | #!/usr/bin/env python
# Copyright (c) 2017-2019, Intel Corporation
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice,
# this list of co... |
timed_subprocess.py | # -*- coding: utf-8 -*-
'''
For running command line executables with a timeout
'''
from __future__ import absolute_import, print_function, unicode_literals
import shlex
import subprocess
import threading
import salt.exceptions
import salt.utils.data
from salt.ext import six
class TimedProc(object):
'''
Crea... |
telnet_bruter.py | #!/usr/bin/python
import threading
import sys, os, re, time, socket
from Queue import *
from sys import stdout
if len(sys.argv) < 4:
print "Usage: python "+sys.argv[0]+" <list> <threads> <output file>"
sys.exit()
combo = [
"root:root",
"root:",
"admin:admin",
"su... |
test_gui.py | """
Unit tests for testing with a CORE switch.
"""
import threading
from core.api.tlv import coreapi, dataconversion
from core.api.tlv.coreapi import CoreExecuteTlv
from core.emulator.enumerations import CORE_API_PORT, NodeTypes
from core.emulator.enumerations import EventTlvs
from core.emulator.enumerations import E... |
test.py | # -*- coding: utf-8 -*-
import time
import threading
import urllib.request, urllib.parse
from datetime import datetime
def schedule():
addr = "1a:2b:3c:46:2b:3c 1a:2b:3c:46:2b:3c 1a:2b:3c:4e:5f:6g"
print("post")
data = {}
data["addr"] = addr
url = "http://127.0.0.1:5000"
try:
data = ... |
solve_hopper_sb3_sac_cnn.py | #!/usr/bin/env python3
import time
import tqdm
import shutil
import datetime
import os.path
import torch as th
import os
from pyvirtualdisplay import Display
import inspect
from typing import Optional, Union, List, Tuple, Dict, Type, Any
import argparse
import csv
from multiprocessing import Process
from stable_basel... |
arb2.py | # general default options
from config import *
# Basic objects
from Balance import *
from Pair import *
from Trades import *
# The individual markets and handling of them
from poloniex import *
from gdax import *
# Our gui
from window import *
# trading algo api
from vanilla import *
import threading
import json
... |
Multi_proc_main.py |
import matplotlib
import matplotlib.pyplot as plt
import tkinter as tk
from tkinter.ttk import Progressbar
from tkinter import filedialog
from PIL import Image, ImageTk
import multiprocessing
import serial as sr
import time
import random
import numpy as np
import get_send_data as gt
import os,os.path
import axes_robot... |
main_window.py | import re
import os
import sys
import time
import datetime
import traceback
from decimal import Decimal
import threading
import asyncio
from electrum_exos.bitcoin import TYPE_ADDRESS
from electrum_exos.storage import WalletStorage
from electrum_exos.wallet import Wallet, InternalAddressCorruption
from electrum_exos.pa... |
calibration.py | import sys
import threading
import cv2
import keyboard
import pyautogui
import pandas as pd
from PyQt5.QtWidgets import *
from PyQt5.QtCore import *
from PyQt5.QtGui import QImage, QPalette, QBrush
from PyQt5.QtWidgets import QWidget, QApplication
from playsound import playsound
from gaze_tracking import GazeTracking
... |
matcher.py | import os
import json
from app.modules import jieba_tw as jieba_tw
import app.modules.logger.logging as log
from config import BASE_DIR, LOG_DIR
import fnmatch
from app.modules.domain_chatbot.user import User
from gensim.models import word2vec
from app.modules.pinyin_compare import pinyin
import threading
import queue
... |
tf_util.py | import joblib
import numpy as np
import tensorflow.compat.v1 as tf
tf.disable_v2_behavior()
import copy
import os
import functools
import collections
import multiprocessing
def switch(condition, then_expression, else_expression):
"""Switches between two operations depending on a scalar value (int or bool).
N... |
util.py | from threading import Thread
class DummyException(Exception):
"""
A more specific error to call during the tests.
"""
def __init__(self, val=0):
self.val = val
def func_exception():
raise DummyException()
def func_succeed():
return True
async def func_succeed_async():
return... |
tests.py | import threading
from datetime import datetime, timedelta
from unittest import mock
from django.core.exceptions import MultipleObjectsReturned, ObjectDoesNotExist
from django.db import DEFAULT_DB_ALIAS, DatabaseError, connections, models
from django.db.models.manager import BaseManager
from django.db.models.query impo... |
example_succeeded.py | from logging_server import LoggingServer, SocketLogger
import logging, sys
def process(process_name:str) -> None:
logger = SocketLogger(process_name)
logger.info(f"Start {process_name}")
# ... some process ...
if __name__ == "__main__":
import multiprocessing as mp
logger = logging.getLogger(... |
thread_GIS.py | from threading import Thread,Lock
from api.GIS.config import GIS_mgdb_config
from api.GIS.database.mongoDB import MGO
import json
from api.GIS.GISStaticsFun import GisStaticsFun
class TheadFun():
def __init__(self):
pass
# self.param = param
def queryQBByIds(self,ids):
DBConfig = []... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.