source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
polyglot.py | # Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
user_prompt_node.py | #!/usr/bin/env python
import rospy
import rospkg
import os
from std_msgs.msg import String, Empty
from sensor_msgs.msg import JoyFeedbackArray, JoyFeedback
import threading
import pygame
class UserPrompt():
# place compound names before single names
valid_task_types = ['bank', 'changedepth', 'circlecorkscrew', \
... |
driver_util.py | """Scripts for drivers of Galaxy functional tests."""
import fcntl
import logging
import os
import random
import shutil
import signal
import socket
import string
import struct
import subprocess
import sys
import tempfile
import threading
import time
import nose.config
import nose.core
import nose.loader
import nose.p... |
test_channel.py | #!/usr/bin/python
#
# Server that will accept connections from a Vim channel.
# Used by test_channel.vim.
#
# This requires Python 2.6 or later.
from __future__ import print_function
import json
import socket
import sys
import time
import threading
try:
# Python 3
import socketserver
except ImportError:
#... |
keep_alive.py | from flask import Flask
from threading import Thread
app = Flask('')
@app.route('/')
def home():
return "Bot Is Online"
def run():
app.run(host='0.0.0.0',port=8080)
def keep_alive():
t = Thread(target=run)
t.start()
|
test_syncdict.py | from beaker.util import SyncDict, WeakValuedRegistry
import random, time, weakref
import threading
class Value(object):
values = {}
def do_something(self, id):
Value.values[id] = self
def stop_doing_something(self, id):
del Value.values[id]
mutex = threading.Lock()
def create(id):
a... |
runCtaTrading.py | # encoding: UTF-8
from __future__ import print_function
import sys
try:
reload(sys) # Python 2
sys.setdefaultencoding('utf8')
except NameError:
pass # Python 3
import multiprocessing
from time import sleep
from datetime import datetime, time
from negociant.event import EventEngine2
from negocian... |
roboMecanumPanel.py | import tkinter as Tk
from tkinter import font
import matplotlib.pyplot as plt
import matplotlib.animation as animation
import matplotlib.ticker as ticker
from matplotlib import style
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg
style.use('ggplot')
import serial
import numpy as np
import random
impo... |
gobgp.py | # Copyright (C) 2015 Nippon Telegraph and Telephone 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 appli... |
clock.py | import time
from dataclasses import dataclass, field
from threading import Event, Thread
from typing import Callable, NoReturn
@dataclass
class Clock:
callback: Callable[[], None] = field(repr=False)
thread: Thread = field(init=False, repr=False)
started: Event = field(default_factory=Event, init=False, r... |
NAAL_step.py | import socket
import sys
import threading
import numpy as np
from enum import Enum
import time
class board_command(Enum):
INIT=0
START=1
PAUSE=2
STOP=3
NONE=4
class socket_type(Enum):
SEND=0
RECV=1
NONE=3
class naal_socket(object):
def __init__(self, IP_addr,dimensions,type=socket_t... |
trainer_controller.py | # # Unity ML-Agents Toolkit
# ## ML-Agent Learning
"""Launches trainers for each External Brains in a Unity Environment."""
import os
import threading
from typing import Dict, Set, List
from collections import defaultdict
import numpy as np
from mlagents_envs.logging_util import get_logger
from mlagents.trainers.env... |
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 shutil
import time
import tempfile
import mlflow.experiments
from mlflow.ent... |
edfringeplanner.py | import datetime
import uuid
from multiprocessing import Process
from urllib.parse import urlparse, urljoin
import flask
import flask_login
import psycopg2
import pytz
import requests
from argon2 import PasswordHasher
from argon2.exceptions import VerifyMismatchError
from flask import Flask, request
from flask_cachebu... |
singleMachine.py | #!/usr/bin/env python
# Copyright (C) 2015 UCSC Computational Genomics Lab
#
# 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 requi... |
picture.py | from multiprocessing import Process
import os
import requests
from lxml import etree
def baocun(url):#此方法是将图片保存文件到本地 只需要传入图片地址
try:
root = "F://picture//"#这是根文件所在
path=root+url.split('/')[-1]#通过’/‘把图片的url分开找到最后的那个就是带.jpg的保存起来
if not os.path.exists(root):
os.mkdir(root)
... |
crawler.py | # -*- coding: utf-8 -*-
import re
import os
import math
import json
import shutil
import pandas
import codecs
import numpy as np
import data_io
import urllib
import hashlib
import requests
import threading
import multiprocessing
from PIL import Image
from random import randint
from threading import Thread
from selenium... |
reno.py | # Python modules
import socket
import random
from multiprocessing import Process, Queue
import time
# 3rd party modules
import arrow
import riprova
import dns.name
import dns.message
import dns.query
import dns.flags
import dns.resolver
# Local modules
import config as cfg
# Reno version
version_info = (2,0,7)
vers... |
runExperiment.py | import argparse
import io
import os
import os.path
import sys
import datetime
import time
import math
import queue
from util_py3.ssh_util import *
from util_py3.azure_util import *
from util_py3.prop_util import *
from util_py3.math_util import *
from util_py3.graph_util import *
import suboram_benchmark
import balan... |
misshtbtd.py | #!/usr/bin/env python3
# ============LICENSE_START=======================================================
# Copyright (c) 2017-2021 AT&T Intellectual Property. All rights reserved.
# Copyright (c) 2019 Pantheon.tech. All rights reserved.
# Copyright (c) 2020 Deutsche Telekom. All rights reserved.
# Copyright (c) 2021 S... |
main.py | import tkinter as tk, threading
import imageio
from PIL import Image, ImageTk
from time import sleep
import os
video_name = "Videos/Intro.mp4" #This is your video file path
video = imageio.get_reader(video_name)
def stream(label,root):
try:
for image in video.iter_data():
frame_image = ImageTk... |
server.py | #!/usr/bin/env python3
"""Server backend of WebScrapBook toolkit.
"""
import os
import time
import webbrowser
from threading import Thread
# dependency
from werkzeug.serving import WSGIRequestHandler, make_server
# this package
from . import *
from . import Config
from .app import make_app
from .util import is_nullho... |
data_utils.py | # Lint as python3
# Copyright 2018 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 r... |
subproc_vec_env.py | import multiprocessing as mp
from collections import OrderedDict
from typing import Any, Callable, List, Optional, Sequence, Tuple, Union
import gym
import numpy as np
from stable_baselines3.common.vec_env.base_vec_env import (
CloudpickleWrapper,
VecEnv,
VecEnvIndices,
VecEnvObs,
VecEnvStepReturn... |
HiwinRA605_socket_ros_test_20190625190839.py | #!/usr/bin/env python3
# license removed for brevity
#接收策略端命令 用Socket傳輸至控制端電腦
import socket
##多執行序
import threading
import time
##
import sys
import os
import numpy as np
import rospy
import matplotlib as plot
from std_msgs.msg import String
from ROS_Socket.srv import *
from ROS_Socket.msg import *
import HiwinRA605_s... |
connection_test.py | from ibapi.client import EClient
from ibapi.wrapper import EWrapper
from ibapi.contract import Contract
import threading
import time
class IBapi(EWrapper, EClient):
def __init__(self):
EWrapper.__init__(self)
EClient.__init__(self, self)
def tickPrice(self, reqId, tickType, price, attrib):
... |
zmqpub.py | from __future__ import absolute_import, print_function
import logging
log = logging.getLogger(__name__)
from threading import Thread
import json
from six.moves.queue import Empty
import zmq
timeout = 0.1
class Publisher(object):
def __init__(self, ctx, zmqaddr, queue):
self.ctx = ctx
self.zmqad... |
camera_server.py | #important URLs:
#http://192.168.1.113:8000/stream.mjpg
#http://192.168.1.113:8000/prev_view.html
#http://192.168.1.113:8000/next_view.html
#http://192.168.1.113:8000/brighter.html
#http://192.168.1.113:8000/dimmer.html
# in virtual env, python qr.py
# on browser, http://192.168.1.100:8000
# Overview
# Read from pica... |
app.py | import os
import platform
import shutil
import signal
import sys
from subprocess import Popen, PIPE
from threading import Thread
from flask import Flask, render_template
from flask_cors import CORS
from flask_sockets import Sockets
from gevent import pywsgi
from geventwebsocket.handler import WebSocketHandler
from ap... |
rec_particles.py | """
Script for reconstructing particles RELION compatible from full reconstructed tomograms
Input: - STAR file with next columns:
'_rlnMicrographName': tomogram that will be used for reconstruction
'_rlnImageName': tomograms used for picking
'_rlnCtfImage': (op... |
test_collection.py | import numpy
import pandas as pd
import pytest
from pymilvus import 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 common_type as ct
from common.common_type import CaseLabel, CheckTasks
from utils.utils import *
from... |
utility.py | from collections import MutableMapping, defaultdict
from thread import get_ident
from threading import Thread
from random import choice
from Queue import Queue
from zlib import adler32
class ReadOnlyDict(MutableMapping):
def __init__(self, wrapped_dict):
'''
Wraps a dict to only allow reads and no... |
long-short.py | import datetime
import threading
import alpaca_trade_api as tradeapi
import time
from alpaca_trade_api.rest import TimeFrame
API_KEY = "YOUR_API_KEY_HERE"
API_SECRET = "YOUR_API_SECRET_HERE"
APCA_API_BASE_URL = "https://paper-api.alpaca.markets"
class LongShort:
def __init__(self):
self.alpaca = tradeapi.REST... |
_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... |
CHMachine.py | import cv2
import numpy as np
import pyscreenshot as ImageGrab
from tkinter import *
from Xlib import display
import mss
import os
import pyxhook
import serial
import threading
import serial.tools.list_ports
import ctypes
import glob
from PIL import ImageTk, Image
import sys
with open(os.devnull, 'w') as f: ###shutting... |
evaluation.py | # Valentin Macé
# valentin.mace@kedgebs.com
# Developed for fun
# Feel free to use this code as you wish as long as you quote me as author
"""
evaluation.py
~~~~~~~~~~
A module to implement all evaluation routines used in a genetic algorithm
"""
import multiprocessing as mp
import numpy as np
from mlagents_envs.env... |
i2ctest.py | import binascii
import time
import threading
from collections import deque #use as a fifo queue
queue = deque() #queue to pass information from thread to main process
queue_lock = threading.Lock() #prevent possible issues from
txt_file = '50_shades_of_grey.txt' #don't ask ;)
running = True
def nfc_reader():
#cop... |
fakeAP.py | #!/usr/bin/env python
import os
from subprocess import Popen, PIPE
import time
import sys
import re
import signal
import argparse
import logging
logging.getLogger("scapy.runtime").setLevel(logging.ERROR)
from scapy.all import *
conf.verb = 0
from threading import Thread, Lock
import socket
import struct
import fcntl
... |
pc2obs.py | # ECSC on the opencv image to quit
import numpy as np
import cv2
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
import math
import time
import sys
import rospy
import sensor_msgs.point_cloud2 as pc2
from sensor_msgs.msg import PointCloud2, CompressedImage, PointField
from nav_msgs.msg import ... |
day23.py | from intcode import Intcode
import threading, time
verbose = False
with open("../input/day23.txt", 'r') as inputFile:
splitData = inputFile.read().split(",")
data = [int(x) for x in splitData]
def runComputer(id: int):
runner = computers[id]['runner']
runner : Intcode
runner.initProgram(data, inp... |
_v5__sub_browser.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# COPYRIGHT (C) 2014-2020 Mitsuo KONDOU.
# This software is released under the MIT License.
# https://github.com/konsan1101
# Thank you for keeping the rules.
import sys
import os
import time
import datetime
import codecs
import glob
import queue
impo... |
urmp_feature.py | import numpy as np
import argparse
import csv
import os
import time
import h5py
import librosa
import multiprocessing
import sys
sys.path.insert(1, os.path.join(sys.path[0], '../..'))
from utils.utilities import (mkdir, float32_to_int16, freq2note, get_filename, get_process_groups, read_lst, write_lst)
from utils.tar... |
timeout_monitor.py | import faulthandler
import os
import threading
import time
import gym
from PIL import Image
class TimeoutMonitor(gym.Wrapper):
""" Timeout Monitor for Environment lockup bug tracking
This class was created to work around/debug issues with the environment locking up while training
or evaluating.
"""
... |
InstanceDetector.py | #########################################################
#Copyright (c) 2020-present, drliang219
#All rights reserved.
#
#This source code is licensed under the BSD-style license found in the
#LICENSE file in the root directory of this source tree.
##########################################################
import Co... |
server.py | # Python module: ModbusServer class (ModBus/TCP Server)
from .constants import READ_COILS, READ_DISCRETE_INPUTS, READ_HOLDING_REGISTERS, READ_INPUT_REGISTERS, \
WRITE_MULTIPLE_COILS, WRITE_MULTIPLE_REGISTERS, WRITE_SINGLE_COIL, WRITE_SINGLE_REGISTER, \
EXP_NONE, EXP_ILLEGAL_FUNCTION, EXP_DATA_ADDRESS, EXP_DATA... |
jobs.py | # -*- coding: utf-8 -*-
#
# 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
#... |
VCenterPropertiesCollector.py | from BaseCollector import BaseCollector
from tools.Resources import Resources
from threading import Thread
import os
class VCenterPropertiesCollector(BaseCollector):
def __init__(self):
super().__init__()
self.wait_for_inventory_data()
self.name = self.__class__.__name__
self.vrop... |
profiler_api_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 applica... |
server.py | import errno
import logging
import os
import socket
import subprocess
import threading
from mockssh.streaming import StreamTransfer
try:
from queue import Queue
except ImportError: # Python 2.7
from Queue import Queue
try:
import selectors
except ImportError: # Python 2.7
import selectors2 as selec... |
test_shared_mem.py | import networkx as nx
import scipy.sparse as ssp
import dgl
import dgl.contrib as contrib
from dgl.graph_index import create_graph_index
from dgl.utils import toindex
import backend as F
import dgl.function as fn
import pickle
import io
import unittest
from utils import parametrize_dtype
import multiprocessing as mp
im... |
main.py | import copy
import logging
import shutil
import zipfile
import multiprocessing
from multiprocessing.managers import SyncManager
import os
import GPUtil
from main_processes.backend.compute_process_onnx import (
BackendComputeProcessOnnx,
)
from main_processes.backend.input_process import BackendInputProcess
from ma... |
odom_smoother.py | # Copyright 2022 Andreas Steck (steck.andi@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 of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... |
test-client.py | import socket
import threading
def receive_server_msg():
while True:
print(s.recv(4096))
s = socket.socket()
s.connect(('elysium-project.net', 6886))
t = threading.Thread(target=receive_server_msg)
t.start()
while True:
msg = input()
s.sendall(bytes(msg, 'utf8'))
|
test_leaks.py | import unittest
import sys
import gc
import time
import weakref
import greenstack
import threading
class ArgRefcountTests(unittest.TestCase):
def test_arg_refs(self):
args = ('a', 'b', 'c')
refcount_before = sys.getrefcount(args)
g = greenstack.greenstack(
lambda *args: greens... |
proc.py | # Copyright (c) 2014-present PlatformIO <contact@platformio.org>
#
# 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... |
common.py | import socket
import ipaddress
import threading
from .bruteforce import smb_brute,ssh_bruteforcer
import netifaces
from threading import Thread
vuln = dict()
def get_lan() -> set:
"""
this function should return set of address of "nearby" ip by lan.
//TODO 20: find better way to to this
//TODO 21: W... |
mtsleep.py | from atexit import register
from random import randrange
from threading import Thread, currentThread
from time import sleep, ctime
class CleanOutputSet(set):
def __str__(self):
return ', '.join(x for x in self)
loops = (randrange(2,5) for x in range(randrange(3, 7)))
remaining = CleanOutputSet()
print("remaining=... |
presubmit_support.py | #!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Enables directory-specific presubmit checks to run at upload and/or commit.
"""
from __future__ import print_function
__versio... |
tests.py | import threading
import time
import unittest
from django.db import DatabaseError, connection, transaction
from django.test import TestCase, TransactionTestCase, skipUnlessDBFeature
from . import get_next_value
class SingleConnectionTestsMixin(object):
def test_defaults(self):
self.assertEqual(get_next_... |
recmodel_server.py | """InVEST Recreation Server."""
import subprocess
import os
import multiprocessing
import uuid
import zipfile
import glob
import hashlib
import pickle
import time
import threading
import collections
import logging
import queue
from io import StringIO
import Pyro4
import numpy
from osgeo import ogr
from osgeo import o... |
thread1.py | import time
import threading
names=[]
def getnames():
guest_name = input("Enter a guest name : ")
names.append(guest_name)
confirmation = input("Any more guests? (y/n) : ")
if(confirmation == 'y'):
getnames()
def welcome_guests(names):
for name in names:
print("W... |
hyperparam_search.py | from multiprocessing import Process
import torch
from types import SimpleNamespace
from deepbiosphere.scripts.GEOCLEF_Config import choices, paths, Run_Params
import deepbiosphere.scripts.GEOCLEF_Config as config
from deepbiosphere.scripts.GEOCLEF_Run import train_model
from itertools import product
import json
lrs = ... |
tests.py | import atexit
from multiprocessing import Manager, Process
from parameters import Parameters
from root import Root
def run_process(simulation_datas, parameters, seed):
"""Runs a process (window) and appends its simulation datas to the list"""
root = Root(parameters=parameters, seed=seed)
simulation_datas.... |
10_kafka_messages_spec.py | import requests,time
import configuration
import performance
from mamba import description, context, it
from expects import expect, equal,contain,have_key,be_below
import multiprocessing as mp
import json
kafka_mock_hdr = {'content-type': 'MOCK_CONTENT_TYPE','User-Agent':'MOCK_UserAgent',"x-b3-spanid":"bbbbbbbbbbbbbbbb... |
iperf3_client.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import time
import threading
import Queue
from subprocess import call, Popen, PIPE, STDOUT
START_PORT = 65000
HELP_MESSAGE = "Usage: python iperf3_client.py -K <concurrency num> <other iperf3 args, but no need to specify the port arg>"
concurrency_name = '-K'
... |
main.py | import httpx, threading, json, time, itertools, random, os
from colorama import Fore, init; init()
__config__, __lock__, __io_lock__ = json.load(open('./config.json')), threading.Lock(), threading.Lock()
__bios__ = itertools.cycle(list(set(open('./data/bio.txt', 'r+', encoding= 'utf-8', errors= 'ingore').read().sp... |
concurrent_executor.py | # Lint as: python3
# Copyright 2019, The TensorFlow Federated 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 ... |
graph-size-circum-trim.py | #! /usr/bin/env python
#
# This file is part of khmer, http://github.com/ged-lab/khmer/, and is
# Copyright (C) Michigan State University, 2009-2013. It is licensed under
# the three-clause BSD license; see doc/LICENSE.txt.
# Contact: khmer-project@idyll.org
#
import khmer
import sys
import screed
import os.path
import... |
app.py | from flask import Flask, request, render_template
from botocore.exceptions import ClientError
from threading import Thread
import sys, sqlite3, boto3, time, logging, string, random, subprocess
sys.tracebacklimit=0
app = Flask(__name__)
@app.route('/', methods=['GET', 'POST'])
def index():
return rende... |
test_oddball.py | # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0
# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt
"""Oddball cases for testing coverage.py"""
import os.path
import sys
from flaky import flaky
import pytest
import coverage
from coverage import env
from coverag... |
concurrency_test.py | # Copyright 2020 The Magenta 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 ... |
postmortem.py | #!/usr/bin/python3
"""A tiny gdb frontend. This is intended for post-mortem debugging."""
import argparse
import base64
import functools
import http.server
import json
import logging
import os
import pty
import re
import socketserver
import subprocess
import sys
import threading
from typing import (Any, Callable, Dict... |
tuq_n1ql_backfill.py | import threading
from membase.api.exception import CBQError
from membase.api.rest_client import RestHelper
from .tuq import QueryTests
class QueryN1QLBackfillTests(QueryTests):
def setUp(self):
super(QueryN1QLBackfillTests, self).setUp()
self.log.info("============== QueryN1QLBackfillTests setu... |
flask_test_context.py | # Copyright (C) 2019 Apple 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:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... |
kafka_stream_load_share.py | import json
import time
import os
import sys
import multiprocessing as mp
import numpy as np
from numpy import linalg as LA
from tornado.ioloop import IOLoop
from tornado import gen
from kafka import KafkaConsumer
from kafka import KafkaProducer
import kafka as kafkaPy
from minas.map_minas_support import *
def mkTe... |
test_plotter.py | #%%
#%load_ext autoreload
#%autoreload 2
import multiprocessing as mp
import numpy as np
import os
import sys
import pytest
from time import sleep
from types import SimpleNamespace as SN
from utils.memory_tracker.plotter import Plotter, \
watcher
#%%
refresh = .1
history = 5... |
mudpi.py | import RPi.GPIO as GPIO
import threading
import datetime
import socket
import redis
import time
import json
import sys
sys.path.append('..')
from action import Action
from config_load import loadConfigJson
from server.mudpi_server import MudpiServer
from workers.pi.lcd_worker import LcdWorker
from workers.pi.i2c_worker... |
mpdj.py | #!/usr/bin/env python
import gc
import icecast
import hashlib
import json
import mpd
import os
import pprint
import random
import threading
import time
class mpdj:
key_file = '/home/er0k/.www/keys.json'
json_file = '/tmp/mpdj.json'
bad_log = '/etc/mpdj/bad'
nope_log = '/etc/mpdj/nope'
music_dir =... |
tests.py | # -*- coding:utf-8 -*-
from __future__ import unicode_literals
import unittest
from io import BytesIO, StringIO
from decimal import Decimal
import threading
from importlib import import_module
from ijson import common
from ijson.backends.python import basic_parse, Lexer
from ijson.compat import IS_PY2
JSON = b'''
{
... |
im2rec.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# 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 Licens... |
BlindCmdInjection.py | from Injection import *
from threading import Thread
# Python Program to Get IP Address
import socket
import os
class BlindCmdInjection(Injection):
def __init__(self, session, payloadPath, urls, threshold, port=8088):
super().__init__(session, urls, "Blind Cmd Injection")
if payloadPath:
... |
Coordinator.py | from .Agent import Agent
from .Utils import get_distance_tf_idf_cosine, get_seconds
import random
import re
import time
import pickle
import pandas as pd
import os
from math import log
from threading import Thread
from .DataManager import DataManager
from colorama import Fore
class Coordinator:
current_date = pd.... |
variable_scope.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... |
wmd_auto.py | # -*- coding: utf-8 -*-
from __future__ import print_function, unicode_literals
import sys
reload(sys)
sys.setdefaultencoding("utf-8")
import os
import email
import re
import json
import gensim
import codecs
import getopt
import logging
import shutil
from nltk.tokenize import word_tokenize, sent_tokenize
from gensim.s... |
kubeless.py | #!/usr/bin/env python
import os
import imp
import datetime
from multiprocessing import Process, Queue
import bottle
import prometheus_client as prom
mod = imp.load_source('function',
'/kubeless/%s.py' % os.getenv('MOD_NAME'))
func = getattr(mod, os.getenv('FUNC_HANDLER'))
func_port = os.getenv(... |
netcdf.py | #!/usr/bin/env python
###############################################################################
# $Id$
#
# Project: GDAL/OGR Test Suite
# Purpose: Test NetCDF driver support.
# Author: Frank Warmerdam <warmerdam@pobox.com>
#
###############################################################################
# Co... |
music_updated.py | import discord
from discord.ext import commands
import youtube_dl
import pafy
import threading
import time
command_list = [
'//help => Get help on the list of commands and its functionality',
'//join => Invite On Bot into current voice channel',
'//play [song_name] => Start playing songs in queue',
... |
mapandspray.py | #!/usr/bin/env python
import os
import socket
import multiprocessing
import subprocess
import sys
from datetime import datetime
import pexpect
import pxssh
def pinger(job_q, results_q):
"""
Do Ping
:param job_q:
:param results_q:
:return:
"""
DEVNULL = open(os.devnull, 'w')
while T... |
people_live.py | """
A "live mess" that buffers output from YOLO.
It averages and adds to history after each hour.
"""
import subprocess
from collections import deque
from datetime import timedelta, datetime
from threading import Thread
from time import sleep
import schedule
from config import cfg
from kitchen_database import kitchen... |
__init__.py | """The Remote Python Debugger integration."""
from __future__ import annotations
from asyncio import Event
import logging
from threading import Thread
import debugpy
import voluptuous as vol
from homeassistant.const import CONF_HOST, CONF_PORT
from homeassistant.core import HomeAssistant, ServiceCall
import homeassi... |
http_com.py | from __future__ import print_function
import base64
import copy
import json
import logging
import os
import random
import ssl
import sys
import threading
import time
from builtins import object
from builtins import str
from flask import Flask, request, make_response, send_from_directory
from werkzeug.serving import W... |
Server Concurrente.py | from multiprocessing import Process
import time
import socket
import sys
# Create a TCP/IP socket
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
# Bind the socket to the port
server_address = ('localhost', 10000)
print('starting up on {} port {}'.format(*server_address))
sock.bind(server_address)
# Listen ... |
snake.py | from abc import ABCMeta, abstractmethod
from enum import Enum, unique
from random import randrange
from threading import Thread
import pygame
class Color(object):
"""颜色"""
GRAY = (242, 242, 242)
BLACK = (0, 0, 0)
GREEN = (0, 255, 0)
PINK = (255, 20, 147)
@unique
class Direction(Enum):
"""方... |
Updater.py | #!/usr/bin/env python
# Written by: DGC
"""
This is a module for checking if there is a new version of the software.
"""
# python imports
import threading
import urllib2
import xml.dom.minidom
# local imports
import Version
#==============================================================================
class Update... |
main_window.py | #!/usr/bin/env python
#
# Electrum - lightweight Bitcoin client
# Copyright (C) 2012 thomasv@gitorious
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation files
# (the "Software"), to deal in the Software without restriction,
# including witho... |
rhcnode.py | #!/usr/bin/env python
# Copyright (c) 2019, The Personal Robotics Lab, The MuSHR Team, The Contributors of MuSHR
# License: BSD 3-Clause. See LICENSE.md file in root directory.
import cProfile
import os
import signal
import threading
import rospy
from ackermann_msgs.msg import AckermannDriveStamped
from geometry_msg... |
pyminer.py | #!/usr/bin/python
#
# Copyright 2011 Jeff Garzik
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY;... |
webcam_stream.py | #!/usr/bin/env python2
# Basic OS libraries
from sys import argv
from os import system, popen, listdir, path
from time import time, sleep
# Secure shell
from libssh2 import Session
from socket import socket, AF_INET, SOCK_STREAM
# Threading and input handling
from threading import Thread
from evdev import InputDevic... |
test_fx.py | import builtins
import contextlib
import copy
import functools
import inspect
import math
import numbers
import operator
import os
import pickle
import sys
import torch
import traceback
import warnings
import unittest
from math import sqrt
from pathlib import Path
from torch.multiprocessing import Process
from torch.te... |
dxmate.py | import sublime
import sublime_plugin
import os
import subprocess
import threading
import sys
import json
import mdpopups
import time
from collections import OrderedDict
from .lib.printer import PanelPrinter
from .lib.threads import ThreadProgress
from .lib.threads import PanelThreadProgress
from .lib.languageServer imp... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.