source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
manager.py | #!/usr/bin/env python2.7
import os
import sys
import fcntl
import errno
import signal
import subprocess
import selfdrive.messaging as messaging
from common.basedir import BASEDIR
sys.path.append(os.path.join(BASEDIR, "pyextra"))
os.environ['BASEDIR'] = BASEDIR
manager_sock = None
def unblock_stdout():
# get a non-b... |
__init__.py | # Copyright (c) 2013, 2020, Oracle and/or its affiliates.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License, version 2.0, as
# published by the Free Software Foundation.
#
# This program is also distributed with certain software (including
# ... |
generate_train_2.py | import json
import os
from multiprocessing import Process
def chunks(lst, n):
"""Yield successive n-sized chunks from lst."""
for i in range(0, len(lst), n):
yield lst[i:i + n]
def cut_videos(cmds, i):
for i in range(len(cmds)):
cmd = cmds[i]
print(i, cmd)
os.system(cmd)
... |
web.py | # Electrum - lightweight Bitcoin client
# Copyright (C) 2011 Thomas Voegtlin
#
# 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 t... |
conftest.py | from pcloud.tests.server import MockHandler
from pcloud.tests.server import MockServer
import pytest
from threading import Thread
PORT = 5023
@pytest.fixture(scope="session")
def start_mock_server():
"""Start a mock server on port 5023"""
httpd = MockServer(("", PORT), MockHandler)
httpd_thread = Thread(... |
threading.py | import sys
import threading
__all__ = ['Thread', 'ThreadAliveError']
class ThreadAliveError(Exception):
pass
class Thread(threading.Thread):
"""Replacement of threading.Thread for use in TestCase.
When join'ed, exceptions and assertion are collected.
Usage:
class Test(TestCase):
... |
installwizard.py |
import os
import sys
import threading
import traceback
from PyQt5.QtCore import *
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *
from wampum import Wallet, WalletStorage
from wampum.util import UserCancelled, InvalidPassword
from wampum.base_wizard import BaseWizard
from wampum.i18n import _
from .seed_dia... |
jd_OpenCard.py | #!/bin/env python3
# -*- coding: utf-8 -*
'''
项目名称: JD_OpenCard
Author: Curtin
功能:JD入会开卡领取京豆
CreateDate: 2021/5/4 下午1:47
UpdateTime: 2021/6/19
'''
version = 'v1.2.2'
readmes = """
# JD入会领豆小程序

## 使用方法
#### [手机用户(参考) https:/... |
test_storage.py | # -*- coding: utf-8 -*-
# Copyright (C) 2013 Yahoo! 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... |
gen_protos.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 us... |
MindwaveTest2.py | import time
import bluetooth
import threading
import socket
import sys
from mindwavemobile.MindwaveDataPoints import *
from mindwavemobile.MindwaveDataPointReader import *
import textwrap
def recv():
count = 0
while True:
try:
data, server = sock.recvfrom(1518)
print(data.deco... |
pipeline_flow.py | import importlib
import json
import os
import time
import threading
import traceback
import datetime
import pytz
import idseq_dag
import idseq_dag.util.s3
import idseq_dag.util.command as command
import idseq_dag.util.log as log
import idseq_dag.util.count as count
from idseq_dag.util.trace_lock import TraceLock
from ... |
DBusControlledDhcpClient.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
from __future__ import print_function
import sys
import os
import signal
import gobject
import dbus
import dbus.service
import dbus.mainloop.glib
import argparse
import subprocess
import random
import MacAddr
import threading
import time
import atexit
import lockfile
... |
InstagramChecker.py | import requests, time, os, sys
from Queue import Queue
from threading import Thread
THREADCOUNT = 10
queue = Queue()
notTaken = []
def Read(filename):
return [line.strip() for line in open(filename) ]
def DoWork(line):
Sesson = requests.Session()
req = Sesson.get('http://www.instagram.com/%s' % line)
... |
replybot.py | # coding=utf-8
from __future__ import print_function
from shitpostbot import *
import atexit
import string
import multiprocessing
path = os.path.dirname(sys.argv[0])
def getUniques(l):
nl = l[:]
cl = l[:]
for i in l:
intimes = 0
while i in cl:
intimes += 1
cl.remove(i)
if intimes > 1:
for j in xrange... |
terminal.py | import serial
import time
import threading
class Terminal:
def __init__(self, com_port, baud_rate=9600, timeout=0.0) -> None:
self.connected = False
self.prompt = "Arduino >> "
self.encoding = 'utf-8'
self.is_reader_alive = False
self.reader = threading.Thread(target=self.r... |
manager.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2015 clowwindy
#
# 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 b... |
client.py | from __future__ import print_function, division
__version__ = '0.0.1'
import datetime as dt
import logging
import os.path
from threading import Thread, RLock
from zeep.client import Client, CachingClient, Settings
from zeep.wsse.username import UsernameToken
import zeep.helpers
from onvif.exceptions import ONVIFError... |
estimator.py | """
"""
import pickle
import copy
from functools import partial
from multiprocessing import Process, Pipe
import time
from sklearn.base import BaseEstimator
from sklearn.metrics import accuracy_score, r2_score
from sklearn.decomposition import PCA
try:
from sklearn.model_selection import KFold, StratifiedKFold, Lea... |
test_basic.py | # coding: utf-8
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import collections
from concurrent.futures import ThreadPoolExecutor
import json
import logging
from multiprocessing import Process
import os
import random
import re
import setproctitle
import s... |
monitoring.py | import time
from .. import widgets, logs, runs, tests, files
from . import registry
import pandas as pd
import threading
from contextlib import contextmanager
import _thread
from logging import getLogger
log = getLogger(__name__)
def adaptive_rule(df):
timespan = (df.index[-1] - df.index[0]).total_seconds()
i... |
reGeorgSocksProxy.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import logging
import argparse
import signal
import sys
import atexit
import httplib
import urllib3
from threading import Thread
from urlparse import urlparse
from socket import *
from threading import Thread
from time import sleep
#import struct
# Constants
SOCKTIMEOUT =... |
custom.py | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... |
minion.py | # -*- coding: utf-8 -*-
'''
Routines to set up a minion
'''
# Import python libs
from __future__ import absolute_import, print_function
import os
import re
import sys
import copy
import time
import types
import signal
import fnmatch
import logging
import threading
import traceback
import multiprocessing
from random imp... |
example_binance_jersey.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# File: example_binance_jersey.py
#
# Part of ‘UNICORN Binance WebSocket API’
# Project website: https://github.com/oliver-zehentleitner/unicorn-binance-websocket-api
# Documentation: https://oliver-zehentleitner.github.io/unicorn-binance-websocket-api
# PyPI: https://py... |
app.py | """ Copyright (c) 2021 Cisco and/or its affiliates.
This software is licensed to you under the terms of the Cisco Sample
Code License, Version 1.1 (the "License"). You may obtain a copy of the
License at
https://developer.cisco.com/docs/licenses
All use of the material herein must be in accordance with the t... |
tcp_echo_server.py | # Example application: TCP Echo Server
import logging
import multiprocessing
from multiprocessing import process
import socket
import select
import time
import random
# Test function
def chat_server(ip, port):
name = process.current_process().name
logging.info(f'Process starts: name = {name}'... |
Semaphore.py | import threading
import time
#sempahore = digunakan untuk menentukan berapa jumlah thread yang akan berjalan secara bersamaan
# disini terdapat 20, jadi akan ada 5 output yang waktu nya
semaphore = threading.Semaphore(5)
def test():
semaphore.acquire()
time.sleep(1)
print("{} : {}".format(threadin... |
test_threading_local.py | import unittest
from doctest import DocTestSuite
from test import support
import threading
import weakref
import gc
class Weak(object):
pass
def target(local, weaklist):
weak = Weak()
local.weak = weak
weaklist.append(weakref.ref(weak))
class ThreadingLocalTest(unittest.TestCase):
def test_local... |
core.py | """
An API and a CLI for quickly building complex figures.
"""
from __future__ import absolute_import
__license__ = '''\
Copyright (c) 2009-2010 Jeff Klukas <klukas@wisc.edu>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software... |
Main.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
import numpy as np
import cv2
import socket
import os
import io
import time
import imghdr
import sys
from threading import Timer
from threading import Thread
from PIL import Image
from Command import COMMAND as cmd
from Thread import *
from Client_Ui import Ui_Client
from Vide... |
__init__.py | # -*- coding: utf-8 -*-
"""The initialization file for the Pywikibot framework."""
#
# (C) Pywikibot team, 2008-2020
#
# Distributed under the terms of the MIT license.
#
from __future__ import absolute_import, division, unicode_literals
__version__ = __release__ = '3.1.dev0'
__url__ = 'https://www.mediawiki.org/wiki/... |
tpv.py | # -*- coding: utf-8 -*-
# @Author: Manuel Rodriguez <valle>
# @Date: 10-May-2017
# @Email: valle.mrv@gmail.com
# @Last modified by: valle
# @Last modified time: 16-Mar-2018
# @License: Apache license vesion 2.0
from kivy.uix.anchorlayout import AnchorLayout
from kivy.storage.jsonstore import JsonStore
from kivy.l... |
Threading.py | import threading
from datetime import datetime
def thread_func(): # 线程函数
i = 0
while(1):
print(datetime.now())
i += 1
def many_thread():
threads = []
for _ in range(10): # 循环创建500个线程
t = threading.Thread(target=thread_func)
threads.append(t)
# t.setDaemon(True)... |
email.py | from flask import render_template
from flask_mail import Message
from app import app, mail
from threading import Thread
def send_async_email(app, msg):
with app.app_context():
mail.send(msg)
def send_email(subject, sender, recipients, text_body, html_body):
msg = Message(subject, sender=sender, recipi... |
CHMachine.py | import cv2
import numpy as np
from tkinter import *
from PIL import ImageGrab, ImageTk, Image
import win32gui
import win32con
import win32console
import pyHook # pyhook_py3k is advised
import serial
import threading
import serial.tools.list_ports
import pygame
from win32api import GetSystemMetrics
import ctypes
import... |
mainWindow.py | from PyQt5 import QtWidgets,QtGui,QtCore
from .PyQtFrames.chatWidget import ChatWidget
from .PyQtFrames.toolBarWidget import ToolBar
from .PyQtFrames.videoFrame import VideoFrame
from pyngrok import ngrok,conf
from .Video.player import Player
from .Chat.server import ChatServer
import sys, os, json, base64, threading, ... |
pykms_GuiMisc.py | #!/usr/bin/env python3
import os
import re
import sys
from collections import Counter
from time import sleep
import threading
try:
# Python 2.x imports
import Tkinter as tk
import ttk
import tkFont
except ImportError:
# Python 3.x imports
import tkinter as tk
fr... |
regrtest.py | #! /usr/bin/env python
"""
Usage:
python -m test.regrtest [options] [test_name1 [test_name2 ...]]
python path/to/Lib/test/regrtest.py [options] [test_name1 [test_name2 ...]]
If no arguments or options are provided, finds all files matching
the pattern "test_*" in the Lib/test subdirectory and runs
them in alphabeti... |
test_Manage_mainwidow.py | #!user/bin/env python3.7
# coding:utf-8
# author:wanghongzhang
# email:458620786@qq.com
# time: 2018/11/20
import datetime
import sys
import pygame
import time
from PyQt5.QtCore import QVariant
from bai_du_voice import *
from Manage_mainwindow import Ui_Manage_UI
from PyQt5.QtWidgets import QMainWin... |
ActionQueue.py | #!/usr/bin/env python
'''
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")... |
flood_simulator.py | #!/usr/local/bin/python
import threading, multiprocessing
import logging
from graph_construction import Node
TTL=15
RES_FOLDER = "results"
log = logging.getLogger(__name__)
log.setLevel(logging.INFO)
log.addHandler(logging.StreamHandler())
class ExpStep():
def __init__(self, number_of_nodes, node_degree):
... |
helpers.py | import sys
import re
from multiprocessing import Process
import threading
import time
from typing import List
from concurrent.futures import ProcessPoolExecutor
import nb_log
from fabric2 import Connection
from funboost.utils.paramiko_util import ParamikoFolderUploader
logger = nb_log.get_logger('funboost')
def _r... |
surface.py | import tkinter as tk
from tkinter.filedialog import *
from tkinter import ttk
import predict
import cv2
from PIL import Image, ImageTk
import threading
import time
class Surface(ttk.Frame):
pic_path = ""
viewhigh = 600
viewwide = 600
update_time = 0
thread = None
thread_run =... |
sound.py | import appdaemon.appapi as appapi
from queue import Queue
from threading import Thread
from threading import Event
import time
#
# App to manage announcements via TTS and stream sound files to Sonos
#
# Provides methods to enqueue TTS and Media file requests and make sure that only one is executed at a time
# Volume of... |
batcher.py | # Most of this file is copied form https://github.com/abisee/pointer-generator/blob/master/batcher.py
import queue as Queue
import time
from random import shuffle
from threading import Thread
import numpy as np
import config
import data
import random
random.seed(1234)
class Example(object):
def __init__(self, arti... |
spyder.py | # -*- coding: utf-8 -*-
#
# Copyright © 2009- The Spyder Development Team
# Licensed under the terms of the MIT License
# (see spyderlib/__init__.py for details)
"""
Spyder, the Scientific PYthon Development EnviRonment
=====================================================
Developped and maintained by the S... |
multiprocess_iterator.py | from __future__ import division
from collections import namedtuple
import multiprocessing
from multiprocessing import sharedctypes
import signal
import sys
import threading
import warnings
import numpy
import six
from chainer.dataset import iterator
from chainer.iterators.order_samplers import ShuffleOrderSampler
_... |
app.py | from requests import post
from threading import Thread
from time import sleep
from twitter_autobase import Autobase
from twitter_autobase import webhook_manager as webMan
import config
import logging
logging.basicConfig(level=logging.WARNING, format="%(name)s - %(levelname)s - %(message)s")
# if you want to run multip... |
recipe-466427.py | from math import e, pi
from os.path import basename
from sys import argv
from threading import currentThread, Thread
from time import ctime, sleep
NAP_TIME = 1
BUSY_TIME = 40000
def main():
try:
if len(argv) != 3:
raise Exception
engine(int(argv[1]), int(argv[2]))
except:
p... |
threading.py | import threading
import datetime
from queue import Queue
from random import randint
import re
import sys
import traceback
import inspect
from datetime import timedelta
import logging
from appdaemon import utils as utils
from appdaemon.appdaemon import AppDaemon
class Threading:
def __init__(self, ad: AppDaemon, ... |
rdd.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 us... |
framework.py | #!/usr/bin/env python
from __future__ import print_function
import gc
import sys
import os
import select
import unittest
import tempfile
import time
import faulthandler
import random
import copy
import psutil
from collections import deque
from threading import Thread, Event
from inspect import getdoc, isclass
from tra... |
data.py | """
Represents A1s database and database access functions.
"""
# ==================================================================================
# Copyright (c) 2019-2020 Nokia
# Copyright (c) 2018-2020 AT&T Intellectual Property.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# ... |
lcms.py | """Module to run demo on streamlit"""
import cv2
import time
import beepy
import threading
import numpy as np
import pandas as pd
import streamlit as st
from datetime import date
import face_recognition as fr
class Camera:
'''
Camera object to get video from remote source
use read() method ... |
download_from_google_storage.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.
"""Download files from Google Storage based on SHA1 sums."""
import hashlib
import optparse
import os
import Queue
import re
impo... |
main_window.py | import re
import os
import sys
import time
import datetime
import traceback
from decimal import Decimal
import threading
import electrum_ltc as electrum
from electrum_ltc.bitcoin import TYPE_ADDRESS
from electrum_ltc import WalletStorage, Wallet
from electrum_ltc_gui.kivy.i18n import _
from electrum_ltc.paymentrequest... |
context.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 us... |
video_ui.py | """This user interface allow the user to take control of the drone in the same time it provides you
a live stream video of the front camera of the drone"""
import os
import tkinter as tk
from tkinter import PhotoImage, TclError
from time import sleep
from threading import Thread
from PIL import ImageTk
from toolbox ... |
plotter.py | """Plotting of episode in second process. Allows interacting with the plot while training is running.
"""
import multiprocessing as mp
import time
from pathlib import Path
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
class ProcessPlotter(object):
"""Started in a seperate process to plot ep... |
grpc-client.py | import time
import threading
import json
import grpc
import melsec_pb2
import melsec_pb2_grpc
import ast
import datetime
def ReadFloatData(stub,Device,Num):
messages = []
messages.append(melsec_pb2.ReadMsg(device=Device,num=Num))
responses = stub.BlockReadFloat(iter(messages))
for response in response... |
test_workflow_event_processor.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... |
task_running_resources_test.py | # -*- coding: utf-8 -*-
#
# Copyright 2012-2015 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... |
aira_graph.py | # -*- coding: utf-8 -*-
#
# AIRA graph node
#
from eth_account.messages import defunct_hash_message
from ipfs_common.pubsub import subscribe, publish
from time import sleep, time
import ipfsapi
from urllib.parse import urlparse
from web3.auto import w3
from json import dumps, loads
from threading import Thread
from et... |
terminal.py | from pymorphy2 import MorphAnalyzer
from dic import *
from tell import Speaker
from threading import Thread
def post(s):
print('[{}]'.format(s.capitalize()))
M = MorphAnalyzer()
S = Speaker()
def normalWord(s):
return M.parse(s)[0].normal_form
def normal(text):
ntext = [normalWord(s) for s in text.s... |
prepro.py | # -*- coding: utf-8 -*-
import threading, time, scipy, skimage
import numpy as np
import scipy.ndimage as ndi
# import tensorlayer as tl
from scipy import linalg
from scipy.ndimage.filters import gaussian_filter
from scipy.ndimage.interpolation import map_coordinates
from six.moves import range
from skimage import exp... |
state.py | # -*- coding: utf-8 -*-
"""
The State Compiler is used to execute states in Salt. A state is unlike
an execution module in that instead of just executing a command, it
ensures that a certain state is present on the system.
The data sent to the state calls is as follows:
{ 'state': '<state module name>',
'fun... |
snapchat-scraper.py | import os
import sys
import requests
import time
import json
import numpy as np
import pandas as pd
import random
import threading
import argparse
import traceback
import csv
from pprint import pprint
from subprocess import call
from shapely.geometry import shape, Point, MultiPolygon
from shapely.geometry.polygon impo... |
Reader.py | ## Reader for labpics dataset
import numpy as np
import os
import cv2
import json
import threading
import ClassesGroups
import Visuallization as vis
#########################################################################################################################
class Reader:
# Initiate reader a... |
run.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
fMRI preprocessing workflow
=====
"""
import os
import re
from pathlib import Path
import logging
import sys
import gc
import uuid
import warnings
from argparse import ArgumentParser
from argparse import ArgumentDefaultsHelpFormatter
from multiprocessing import cpu_co... |
rc_driver.py | __author__ = 'zhengwang'
import threading
import SocketServer
import serial
import cv2
import numpy as np
import math
import socket
# distance data measured by ultrasonic sensor
sensor_data = " "
class NeuralNetwork(object):
def __init__(self):
self.model = cv2.ANN_MLP()
def create(self):
... |
rpc.py | """ an XML-RPC server to allow remote control of PyMol
Author: Greg Landrum (glandrum@users.sourceforge.net)
Created: January 2002
$LastChangedDate$
License: PyMol
Requires:
- a python xmlrpclib distribution containing the SimpleXMLRPCServer
module (1.0 or greater should be ... |
test.py | import threading
import time
class ThreadingExample(object):
""" Threading example class
The run() method will be started and it will run in the background
until the application exits.
"""
def __init__(self, interval=1):
""" Constructor
:type interval: int
:param interval:... |
plugin_manager.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# king_phisher/client/windows/plugin_manager.py
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright... |
balance_table.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... |
jsondump.py | """
This script serializes the entire traffic dump, including websocket traffic,
as JSON, and either sends it to a URL or writes to a file. The serialization
format is optimized for Elasticsearch; the script can be used to send all
captured traffic to Elasticsearch directly.
Usage:
mitmproxy
--mode revers... |
executormarionette.py | import hashlib
import httplib
import os
import socket
import threading
import time
import traceback
import urlparse
import uuid
from collections import defaultdict
from ..wpttest import WdspecResult, WdspecSubtestResult
errors = None
marionette = None
pytestrunner = None
here = os.path.join(os.path.split(__file__)[0... |
gorgon.py | '''
Gorgon. A simple multiplier process analysis tool in Python
'''
from threading import Thread
from multiprocessing import Process, Queue
from copy import deepcopy
import sys
if sys.version > '3':
from gorgon.report import GorgonReport
else:
from report import GorgonReport
from uuid import uuid4
import inspec... |
app.py |
from tkinter import *
from tkinter.ttk import Notebook,Progressbar,Combobox
import threading
import time
from tkinter import filedialog
from PIL import Image
import tkinter.messagebox
class ConvertingImage:
def __init__(self,root):
self.root=root
self.root.title("Image Converter")
s... |
train.py | import torch
import torch.distributed as dist
import torch.multiprocessing as mp
from data import Vocab, DataLoader, STR, END, CLS, SEL, TL, rCLS
from generator import Generator
from extract import LexicalMap
from adam import AdamWeightDecayOptimizer
from utils import move_to_device
from work import validate
import ar... |
botpermaudit.py | import os
import discord
from discord.ext import commands
from cogs.utils.dataIO import dataIO
from .utils import checks
import logging
# import asyncio
# from threading import Thread
from cogs.utils.chat_formatting import box, pagify
from __main__ import settings
import itertools
log = logging.getLogger('red.BotPermA... |
exp_depthcontrolpressure.py | from lib_depthsensor import DepthSensor
from lib_fin import Fin
from lib_leds import LEDS
import RPi.GPIO as GPIO
import threading
import time
caudal = Fin(20, 21, 1)
dorsal = Fin(19, 26, 4)
pectol = Fin(18, 23, 1)
pector = Fin(4, 22, 1)
threading.Thread(target=caudal.run).start()
threading.Thread(target=dorsal.run)... |
test_gym.py | import pytest
import gym
import ffai.ai
from multiprocessing import Process, Pipe
import numpy as np
import multiprocessing
import os
envs = [
"FFAI-1-v3",
"FFAI-3-v3",
"FFAI-5-v3",
"FFAI-7-v3",
"FFAI-11-v3"
]
@pytest.mark.parametrize("env", envs)
def test_gym(env):
env = gym.make(env)
se... |
sshslot.py | from utility import *
import subprocess
import sys
import os
import threading
import time
ssh_privkey_file = os.getenv("SSH_PRIVKEY_FILE", "daala.pem")
binaries = {
'daala':['examples/encoder_example','examples/dump_video'],
'x264': ['x264'],
'x264-rt': ['x264'],
'x265': ['build/linux/x265'],
'x26... |
multiprocessing_queue.py | #!/usr/bin/env python
# encoding: utf-8
#
# Copyright (c) 2009 Doug Hellmann All rights reserved.
#
"""
"""
#end_pymotw_header
import multiprocessing
class MyFancyClass(object):
def __init__(self, name):
self.name = name
def do_something(self):
proc_name = multiprocessing.current_pro... |
test_csv.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... |
flask_http_listener_client.py | """Flask client to receive messages from customer app."""
import threading
from flask import Flask
from flask import request
from agogosml.common.listener_client import ListenerClient
from agogosml.utils.logger import Logger
DEFAULT_HOST = '127.0.0.1'
class FlaskHttpListenerClient(ListenerClient):
"""Flask cli... |
installwizard.py |
import os
import sys
import threading
import traceback
from PyQt5.QtCore import *
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *
from electrum import Wallet, WalletStorage
from electrum.util import UserCancelled, InvalidPassword
from electrum.base_wizard import BaseWizard, HWD_SETUP_DECRYPT_WALLET
from elec... |
raspetarberry_pi_demo_lcd_1602_temp_sensor_dht11_01.py | import time
import multiprocessing
import Adafruit_DHT
from rpi_lcd import LCD
from datetime import datetime
screen = LCD()
# pinVcc = 3V3 (1)
# pinGnd = GND (9)
pinSignal = 17 # GPIO17 (11)
errorMessageGetDataDHT11Runtime = "ERROR: Runtime error while executing getDataFromDHT11!"
errorMessageGetDataDHT11 = "ERROR: ... |
pub.py | import datetime
import json
import random
import re
from collections import Counter
from collections import defaultdict
from collections import OrderedDict
from dateutil.relativedelta import relativedelta
from threading import Thread
from time import time
import requests
from enum import Enum
from lxml import etree
fr... |
object_storage_service_benchmark.py | # Copyright 2016 PerfKitBenchmarker 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... |
main.py | '''
The main module which spawns a gui and a effect thread and opens a socket connection to the specified
host. The effect algorithm is in the effect module. Change this file to develop your effect.
Change the host and port to your needs in this main file and also the values representing your led configuration.
Create... |
utils.py | import threading
import socketserver
import webbrowser
import json
import subprocess
import sys
import os
os.chdir(os.path.dirname(__file__))
def get_headers():
headers={}
try:
j=json.load(open('headers.json'))
assert 'User-Agent' in j
return headers
except:
print('No cach... |
batch_extract_and_fuse_all_scenes.py | #!/usr/bin/python
import os
import rospy
import time
import gc
import multiprocessing as mp
import resource
import shutil
import argparse
from fusion_server.fusion import FusionServer
import fusion_server.tsdf_fusion as tsdf_fusion
import spartan.utils.utils as spartanUtils
fs = None
LINEAR_DISTANCE_THRESHOLD = ... |
flow_test.py | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
"""Tests for API client and flows-related API calls."""
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
import io
import threading
import time
import zipfile
from absl import app
from grr_api_client import ... |
NetworkRetransmitsCollector.py | #!/usr/bin/env python
import os
import queue
import socket
import time
import threading
from threading import Thread
import copy
import json
from datetime import datetime
import stomp
import tools
import siteMapping
TOPIC = "/topic/perfsonar.raw.packet-retransmits"
INDEX_PREFIX = 'ps_retransmits-'
siteMapping.reload... |
bruter.py | # Date: 12/28/2018
# Author: Mohamed
# Description: Bruter
from time import time, sleep
from .browser import Browser
from .session import Session
from .display import Display
from threading import Thread, RLock
from .proxy_manager import ProxyManager
from .password_manager import PasswordManager
from .co... |
emard400.py | #!/usr/bin/python
# -*- coding: UTF-8 -*-
from os import system, name
import itertools
import threading
import time
import sys
import datetime
from base64 import b64decode,b64encode
from datetime import date
expirydate = datetime.date(2022, 2, 25 )
#expirydate = datetime.date(2021, 12, 30)
today=date.today()
def her... |
live_trace_stream.py | '''
This file is part of PM4Py (More Info: https://pm4py.fit.fraunhofer.de).
PM4Py is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any late... |
viewer.py | import sys
import cv2
import numpy as np
from pysvso.py_pose_graph.point3d import Point3D
from pysvso.lib.log import LoggerAdaptor, init_logging
import logging
init_logging()
_logger = logging.getLogger("PCViewer")
import OpenGL.GL as gl
import pangolin
import multiprocessing
from multiprocessing import Process, J... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.