source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
__main__.py | import logging
import signal
import sys
import traceback
from threading import Thread
import ob2.config as config
import ob2.dockergrader
import ob2.mailer
import ob2.repomanager
import ob2.web
from ob2.database.migrations import migrate
from ob2.database.validation import validate_database_constraints
from ob2.docker... |
__init__.py | # ----------------------------------------------------------------------------
# fos.lib.pyglet
# Copyright (c) 2006-2008 Alex Holkner
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Re... |
prcontigfilterServer.py | #!/usr/bin/env python
from wsgiref.simple_server import make_server
import sys
import json
import traceback
import datetime
from multiprocessing import Process
from getopt import getopt, GetoptError
from jsonrpcbase import JSONRPCService, InvalidParamsError, KeywordError,\
JSONRPCError, ServerError, InvalidRequestE... |
win_touch_client.py | #!/usr/bin/python
import gtk, wnck
import os, time
import struct
TEST = False
class WinTouch(object):
def __init__(self, event_file):
self.__cb_obj = None
self.__des_file = event_file
self.__fmt = 'LLHHI'
self.__ev_type = 0x1
'''use ev_key = 0x110 to test, actually is 0x... |
rpc.py | """RPC interface for easy testing.
RPC enables connect to a remote server, upload and launch functions.
This is useful to for cross-compile and remote testing,
The compiler stack runs on local server, while we use RPC server
to run on remote runtime which don't have a compiler available.
The test program compiles the... |
test_insert_20.py | import threading
import numpy as np
import pandas as pd
import pytest
from pymilvus import Index
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
prefix =... |
train.py | #!/usr/bin python3
""" The script to run the training process of faceswap """
import os
import sys
import threading
import cv2
import tensorflow as tf
from keras.backend.tensorflow_backend import set_session
from lib.utils import (get_folder, get_image_paths, set_system_verbosity,
Timelapse)
f... |
webhook.py | from wsgiref.simple_server import make_server
import subprocess
import json
import threading
def deploy():
subprocess.call(['bash', 'deploy.sh'])
def webhook(environ, start_response):
print("Get Request!")
status = '200 OK'
headers = [
('Content-type', 'application/json; charset=utf-8'),
... |
gui_element.py | from tkinter import *
from tkinter.filedialog import askopenfilename, asksaveasfilename
from tkinter.messagebox import askyesno
from kbana import quick_plot, load_recording, save_recording
from kbana.analysis import simulate_recording
from matplotlib.backends.backend_tkagg import (
FigureCanvasTkAgg, NavigationToo... |
utils.py | import requests
import sys
import time
import threading
import smtplib
import datetime
import json
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
now = datetime.datetime.now()
class Spinner:
busy = False
delay = 0.1
@staticmethod
def spinning_cursor():
wh... |
test_capture.py | import contextlib
import io
import os
import subprocess
import sys
import textwrap
from io import UnsupportedOperation
from typing import BinaryIO
from typing import cast
from typing import Generator
from typing import TextIO
import pytest
from _pytest import capture
from _pytest.capture import _get_multicapture
from ... |
env.py | # Microsoft Azure Linux Agent
#
# Copyright 2014 Microsoft 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 b... |
IPA_image2pc.py | import numpy as np
import cv2
import json
import os
import h5py
from multiprocessing import Process
def perspectiveDepthImageToPointCloud(image_depth,image_rgb, seg, gt_path,defaultValue,perspectiveAngle,clip_start,clip_end,resolutionX,resolutionY,resolution_big,pixelOffset_X_KoSyTopLeft,pixelOffset_Y_KoSyTop... |
test-multiprocess.py | import os
import traceback
import time
import numpy as np
import multiprocessing
class detCalculator(multiprocessing.Process):
def __init__(self, ID, matSize, noChildren, levelsLeft, parent_pipe):
multiprocessing.Process.__init__(self)
self.ID = ID
self.parent_pipe = parent_pipe
... |
cpu.py | import os
import sys
import time
from multiprocessing import Process
from threading import Thread
from psutil import cpu_percent
class CPUStress:
"""`Controller <https://git.io/J9cXV>`__ for CPU stress using multiprocessing. Gets duration as user input.
>>> CPUStress
CPU is stressed using `multiprocess... |
new_test_rqg.py | from base_test_rqg import BaseRQGTests
from new_rqg_mysql_client import RQGMySQLClientNew
from new_rqg_query_helper import RQGQueryHelperNew
import threading
from rqg_mysql_client import RQGMySQLClient
from rqg_postgres_client import RQGPostgresClient
import traceback
class RQGTestsNew(BaseRQGTests):
''' Call of ... |
devserver.py | import os
import threading
import time
import traceback
from werkzeug.serving import run_simple
from werkzeug.serving import WSGIRequestHandler
from lektor.admin import WebAdmin
from lektor.builder import Builder
from lektor.db import Database
from lektor.reporter import CliReporter
from lektor.utils import portable_... |
__main__.py | import logging
import sys
from multiprocessing import Pipe, Process
from operator import itemgetter
from pathlib import Path
import numpy as np
from pong_rl.agents import AgentKerasConv
from pong_rl.environments import PongEnvironment, VectorizedPongEnvironment
from pong_rl.timer import ContextTimer
MODEL_NAME = "co... |
test_operator_gpu.py | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... |
test_largefile.py | """Test largefile support on system where this makes sense.
"""
import os
import stat
import sys
import unittest
import socket
import shutil
import threading
from test.support import TESTFN, requires, unlink, bigmemtest
from test.support import SHORT_TIMEOUT
from test.support import socket_helper
import io # C implem... |
calculate.py | """
This module implements methods to calculate electron scattering.
"""
import logging
import multiprocessing
import time
import traceback
from multiprocessing import cpu_count
from queue import Empty
from typing import Any, Dict, List, Optional, Union
import numba
import numpy as np
import quadpy
from pymatgen.elec... |
build_image_data.py | # Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... |
client.py | import socket
import threading
nickname = input("choose a nickname: ")
client = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
client.connect(('127.0.0.1',55555))
def receive():
while True:
try:
message = client.recv(1024).decode('ascii')
if message == "Nick:":
... |
cam.py | import datetime
from threading import Thread
import cv2
class FPS:
def __init__(self):
self.start = None
self.end = None
self.numFrames = 0
def start(self):
self.start = datetime.datetime.now()
return self
def stop(self):
self.end = datetime.datetime.now()
... |
twisterlib.py | #!/usr/bin/env python3
# vim: set syntax=python ts=4 :
#
# Copyright (c) 2018 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import os
import contextlib
import string
import mmap
import sys
import re
import subprocess
import select
import shutil
import shlex
import signal
import threading
import concurrent.fu... |
example.py | import threading
import matplotlib.pyplot as plt
import pickle
import time
import numpy as np
import cv2
import GaussianProcess
import util
from scipy import interpolate
plt.ion()
N = util.N
M = util.M
K = 2
# MAP = np.ones((N,M,K))/float(K)
MAP = lambda x, y: np.ones(K)/float(K)
# np.random.seed(0)
def Image_Classi... |
async_task.py | import os
import subprocess
import threading
class AsyncTask:
encoding = "utf-8"
killed = False
proc = None
def __init__(self, command=["printf", "Hello"], cwd=None, output=print):
self.output = output
if self.proc is not None:
self.proc.terminate()
self.proc ... |
http.py | # Last Update: 18-09-2021, Author: Lusmaysh
import sys,os,random
R = "\33[31;1m";G = "\33[32;1m";Y = "\33[33;1m";
try:
from requests import *
from threading import Thread
from user_agent import generate_user_agent
except ImportError:
try:
os.system("pip3 install requests threaded user_agent")
except:
os.system... |
fn_api_runner.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... |
generate_datasets_from_testreal.py | # -*- coding: UTF-8 -*-
'''=================================================
@Author :zhenyu.yang
@Date :2020/11/5 11:37 AM
=================================================='''
import sys
sys.path.append('./')
sys.path.insert(0,'/data/zhenyu.yang/modules')
import cv2
import json
import numpy as np
import random
i... |
aumhMQTT.py | ###############################################################################
# a umhMQTT.py #
# #
# Python library for controlling an arduino using Arduino_UART_MessageHandler #
... |
trade_sample.py | import time
from tcoreapi_mq import *
import tcoreapi_mq
import threading
g_TradeZMQ = None
g_TradeSession = ""
ReportID=""
#已登入資金帳號變更
def OnGetAccount(account):
print(account["BrokerID"])
#實時委託回報消息
def OnexeReport(report):
global ReportID
print("OnexeReport:", report["ReportID"])
ReportID=report["... |
git.py | # -*- coding: utf-8 -*-
"""
Core Git Module
This module provides a GitQueue to pushmanager, into which three types of task
can be enqueued:
- Verify Branch: Check that a given branch exists
- Test Pickme Conflict: Check if a pickme conflicts with other pickmes in the
same push
- Test All Pickmes: Recheck every pickm... |
core.py | #!/usr/bin/env python3
#Imports
import os
import re
import pexpect
from Crypto.PublicKey import RSA
from Crypto.Cipher import PKCS1_OAEP
import ast
from time import sleep
import datetime
import sys
import threading
from pathlib import Path
from copy import deepcopy
#functions and classes
class node:
''' This clas... |
main.py | from streamlistener import StreamListener
import tweepy
from settings import Settings
from send import EventHubSender
import webapp
import threading
httpd=webapp.HTTPServer(('0.0.0.0',Settings.WEB_PORT),webapp.web_server)
thread= threading.Thread(target= httpd.serve_forever)
thread.daemon=True
thread.start()
print("... |
pool.py | # -*- coding: utf-8 -*-
#
# Module providing the `Pool` class for managing a process pool
#
# multiprocessing/pool.py
#
# Copyright (c) 2006-2008, R Oudkerk
# Licensed to PSF under a Contributor Agreement.
#
from __future__ import absolute_import
#
# Imports
#
import errno
import itertools
import os
import platform
i... |
PC_Miner.py | #!/usr/bin/env python3
"""
Duino-Coin Official PC Miner 2.7.3 © MIT licensed
https://duinocoin.com
https://github.com/revoxhere/duino-coin
Duino-Coin Team & Community 2019-2021
"""
from time import time, sleep, strptime, ctime
from hashlib import sha1
from socket import socket
from multiprocessing import ... |
GetAuthCodeServer.py | '''
------------------------------------------------------------------------------
Copyright (c) 2015 Microsoft Corporation
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... |
data_helper.py | from typing import Iterable, Any, Optional
from collections.abc import Sequence
import numbers
import time
from threading import Thread
from queue import Queue
import numpy as np
import torch
def to_device(item: Any, device: str, ignore_keys: list = []) -> Any:
r"""
Overview:
Transfer data to certain... |
conftest.py | import collections
import contextlib
import platform
import socket
import ssl
import sys
import threading
import pytest
import trustme
from tornado import ioloop, web
from dummyserver.handlers import TestingApp
from dummyserver.proxy import ProxyHandler
from dummyserver.server import HAS_IPV6, run_tornado_app
from du... |
app.py | # modules
# dash-related libraries
import dash
from dash.dependencies import Output, Event
from math import log10, floor, isnan
from datetime import datetime
from random import randint
import dash_core_components as dcc
import dash_html_components as html
import colorama
import sys
import getopt
# non-dash-related lib... |
campaign.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# king_phisher/client/tabs/campaign.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
# not... |
client_socket.py | # TODO documentation
from __future__ import print_function
import sys
import socket
import threading
import select
from fprime_gds.common.handlers import DataHandler
from fprime.constants import DATA_ENCODING
# Constants for public use
GUI_TAG = "GUI"
FSW_TAG = "FSW"
class ThreadedTCPSocketClient(DataHandler):
... |
config.py | # Configuration with default values
import json
import logging
import os
import sys
from threading import Thread
import configargparse
import time
from mrmime import init_mr_mime
from mrmime.cyclicresourceprovider import CyclicResourceProvider
from pgscout.proxy import check_proxies
log = logging.getLogger(__name__)... |
test_client.py | import pytest
import time
import sys
import logging
import threading
import _thread
import ray.util.client.server.server as ray_client_server
from ray.util.client.common import ClientObjectRef
from ray.util.client.ray_client_helpers import ray_start_client_server
@pytest.mark.skipif(sys.platform == "win32", reason="... |
server_gui.py | import socket
from threading import Thread
def accept_incoming_connections():
"""Sets up handling for incoming clients."""
while True:
client, client_address = SERVER.accept()
print("%s:%s has connected." % client_address)
client.send(bytes("Greetings from the cave! Now type your name ... |
safe_t.py | from binascii import hexlify, unhexlify
import traceback
import sys
from electrum_pac.util import bfh, bh2u, versiontuple, UserCancelled
from electrum_pac.bitcoin import (b58_address_to_hash160, xpub_from_pubkey, deserialize_xpub,
TYPE_ADDRESS, TYPE_SCRIPT, is_address)
from electrum_p... |
UserClient.py | import socket
import time
import threading
from rwaFiles import *
from verifiers import *
from cipher import *
from colors import *
import getpass
HEADER = 4096
PORT = 5050
SERVER = socket.gethostbyname(socket.gethostname())
ADDR =(SERVER, PORT)
FORMAT = "utf-8"
DISCONNECT_MESSAGE = "!DISCONNECT"
print(f"... |
adminset_agent.py | #!/usr/bin/env python
# coding=utf-8
import os, re, platform, socket, time, json, threading
import psutil, schedule, requests
from subprocess import Popen, PIPE
import logging
AGENT_VERSION = "0.21"
token = 'HPcWR7l4NJNJ'
server_ip = '192.168.47.130'
def log(log_name, path=None):
logging.basicConfig(level=logging... |
task.py | # -*- coding: UTF-8 -*-
#
# Copyright © 2016 Alex Forster. All rights reserved.
# This software is licensed under the 3-Clause ("New") BSD license.
# See the LICENSE file for details.
#
import sys
import os
import time
import functools
import threading
import multiprocessing
import concurrent.futures
import six
from... |
server.py | import asyncio
import os
import traceback
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
from time import time
from httpt... |
mask_detect_live_cam.py | import numpy as np
import os
import six.moves.urllib as urllib
import sys
import tarfile
import tensorflow as tf
import zipfile
import cv2
import time
from threading import Thread
import importlib.util
from collections import defaultdict
from io import StringIO
from matplotlib import pyplot as plt
from ... |
mp3player.py | #!/usr/bin/env python
import ctypes
from enum import Enum
import threading
import queue
from queue import Empty
import mpg123
import logging
import random
from ctypes.util import find_library
logger = logging.getLogger(__name__)
class mpg123_frameinfo(ctypes.Structure):
_fields_ = [
('version', ctype... |
local_parallel.py | import curses
import subprocess
import threading
import itertools
from gin.config_parser import ConfigParser, BindingStatement
class GinParser:
def __init__(self, file):
self.parser = ConfigParser(file, None)
lines = [line for line in self.parser]
self.combinations = [self.get_combination... |
tools.py | # Licensed under a 3-clause BSD style license - see LICENSE.rst
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, unicode_literals, print_function
"""
This file contains utilities to generate test repositories.
"""
import datetime
import io
import os
import threading
import time
import six
im... |
fleetspeak_client.py | #!/usr/bin/env python
"""Fleetspeak-facing client related functionality.
This module contains glue code necessary for Fleetspeak and the GRR client
to work together.
"""
import logging
import pdb
import platform
import queue
import struct
import threading
import time
from absl import flags
from grr_response_client ... |
test_running.py | # Copyright 2019 The PlaNet 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 applicable... |
MVC2_5G_Orc8r_deployment_script.py | #!/usr/bin/env python3
"""
Copyright 2020 The Magma Authors.
This source code is licensed under the BSD-style license found in the
LICENSE file in the root directory of this source tree.
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BAS... |
scheduler.py | #!/usr/bin/env python
from multiprocessing import Process, Queue
from uuid import uuid4
import time, sys
from random import random
class Scheduler:
def __init__(self, maxsize):
q_in = Queue()
work_q = Queue(maxsize = maxsize)
def worker():
while True:
sys.stder... |
main.py | # -*- coding: utf-8 -*-
"""
Created on Wed May 6 03:38:43 2020
@author: hp
"""
import webbrowser
import time
import os
import threading
import cv2
import dlib
import numpy as np
from yolo_helper import YoloV3, load_darknet_weights, draw_outputs
from dlib_helper import (shape_to_np,
eye_on_mas... |
senderManager.py | # Copyright (c) 2020-present ly.com, 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 applic... |
people_perception.py | import cv2
import os
import threading
from darcyai import DarcyAI
from flask import Flask, request, Response
VIDEO_DEVICE = os.getenv("VIDEO_DEVICE", "/dev/video0")
def analyze(frame_number, objects):
return
for object in objects:
if object.body["has_face"]:
print("{}: {}".format(object.... |
orderpoint_procurement.py | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... |
test.py |
from time import sleep
import cv2
from threading import Thread
class App1:
def __init__(self, src=0):
self.stopped = False
self.stream = cv2.VideoCapture(src)
(self.grabbed, self.frame) = self.stream.read()
self.thread = Thread(target=self.update, args=())
# self.thread.da... |
RERANWrapper.py | import os
import sys
import argparse
from subprocess import call, check_output, Popen, PIPE
from multiprocessing import Process
import os.path as path
default_tests_path="./tests/"
translate_jar_path="./build/RERANTranslate.jar"
replay_bin_path="./build/replay"
def record_events(filename):
cmd = "adb shell getevent ... |
__main__.py | import queue
import argparse
import logging
from multiprocessing import Queue, Process, cpu_count
from itertools import count
import pysam
from spliceai.utils import Annotator, get_delta_scores
from collections import namedtuple
try:
from sys.stdin import buffer as std_in
from sys.stdout import buffer as std... |
v2_Process_algoritimo_aprendizagem_02.py | import numpy as np
import datetime
from concurrent.futures.process import ProcessPoolExecutor as Process
from threading import Thread
inicio = datetime.datetime.now()
def sigmoid(soma):
return 1 / (1 + np.exp(-soma))
def sigmoidDerivada(sig):
return sig * (1 - sig)
def processar(epocas, entradas,saidas,taxa... |
utils_test.py | #!/usr/bin/env python
# Copyright 2013 The LUCI Authors. All rights reserved.
# Use of this source code is governed under the Apache License, Version 2.0
# that can be found in the LICENSE file.
# Disable 'Access to a protected member ...'. NDB uses '_' for other purposes.
# pylint: disable=W0212
import datetime
impo... |
minion.py | # -*- coding: utf-8 -*-
'''
Routines to set up a minion
'''
# Import python libs
from __future__ import absolute_import, print_function, with_statement
import os
import re
import sys
import copy
import time
import types
import signal
import fnmatch
import logging
import threading
import traceback
import contextlib
impo... |
RaceResult.py | import socket
import sys
import time
import datetime
import atexit
import subprocess
import threading
import re
import wx
import wx.lib.newevent
import Utils
import Model
from threading import Thread as Process
from queue import Queue, Empty
import JChip
from RaceResultImport import parseTagTime
from Utils import logC... |
PseudoDialogOptions.py |
from tkinter import ttk
import tkinter as tk
import tkinter.filedialog as fd
import pandas as pd
import threading
import hashlib
import os
import pandas.io.formats.excel
import logging
from logging.handlers import RotatingFileHandler
import pem
from functools import partial
pandas.io.formats.excel.header_style = None
... |
test_pubsub.py | # coding=utf-8
"""Test of the Configuration Database events interface."""
import time
from threading import Thread
from sip_config_db._events.event_queue import EventQueue
from sip_config_db._events.pubsub import get_subscribers, publish, subscribe
from sip_config_db import ConfigDb
DB = ConfigDb()
def test_events_... |
webserver.py | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import BaseHTTPServer
import os
import threading
class Responder(object):
"""Sends a HTTP response. Used with TestWebServer."""
def __init__(self, han... |
PC_Miner.py | #!/usr/bin/env python3
##########################################
# Duino-Coin Python PC Miner (v2.5.6)
# https://github.com/revoxhere/duino-coin
# Distributed under MIT license
# © Duino-Coin Community 2019-2021
##########################################
# Import libraries
import sys
from configparser import ... |
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... |
test_model_avg_opt.py | """Tests for ModelAverageOptimizer."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import portpicker
import tensorflow as tf
from tefla.core.optimizer import ModelAverageOptimizer, ModelAverageCustomGetter, GLOBAL_VARIABLE_NAME
def create_local_cluste... |
utils.py | from binascii import hexlify
import errno
import os
import sys
from os.path import join as pjoin
from tempfile import TemporaryDirectory
from threading import Thread, Event
from unittest.mock import patch
from jupyterlab_server import LabServerApp, LabConfig
from ..servertest import ServerTestBase
from ..server impor... |
pexpect_runner.py | #!/usr/bin/python
import sys
import pexpect
import os
from Tkinter import *
import Pmw
import threading
import signal
import time
import Queue
def sighandler(signum, frame):
# print "Signaled: %d" %signum
if signum == signal.SIGCHLD:
sys.exit(1)
else:
text_queue.put("SIGQUIT")
def proc... |
buffered_data_provider.py | import plotter_controller
import random_data_provider
from threading import Thread, Lock, Condition
import random
import time
class BufferedDataProvider(plotter_controller.StepDataProvider):
# Buffer size is in number of steps
def __init__(self, data_provider, buffer_size=1024):
#Setup buffers
self.read_buffer ... |
processor_v2_abl_audio.py | import datetime
import lmdb
import math
import matplotlib.pyplot as plt
import numpy as np
import os
import pickle
import pyarrow
import python_speech_features as ps
import threading
import time
import torch
import torch.optim as optim
import torch.nn as nn
import torch.nn.functional as F
from librosa.feature import m... |
thread1.py | import threading
import time
# Exemplo de função sem parametros
def funcao():
for i in range(3):
print(i, 'Executando a Thread!')
time.sleep(0.5)
print('Iniciando o programa!')
threading.Thread(target=funcao).start() # target sempre recebe o nome da função definida na função. E .start() é para... |
halo2_after_purge.py | import json
import os
import multiprocessing
import threading
import urllib.request
from bs4 import BeautifulSoup
from multiprocessing.pool import ThreadPool
def get_metadata(metadata):
gametype, mapname, playlist, date, time = \
None, None, None, None, None
for line in metadata.text.split('\n'):
... |
audio_reader.py | import fnmatch
import os
import re
import threading
import librosa
import numpy as np
import tensorflow as tf
def find_files(directory, pattern='*.wav'):
'''Recursively finds all files matching the pattern.'''
files = []
for root, dirnames, filenames in os.walk(directory):
for filename in fnmatch... |
views.py | # Copyright: (c) OpenSpug Organization. https://github.com/openspug/spug
# Copyright: (c) <spug.dev@gmail.com>
# Released under the MIT License.
from django.views.generic import View
from django.db.models import F
from django.conf import settings
from django_redis import get_redis_connection
from libs import json_respo... |
manager.py | #! /usr/bin/env python3
# -*- coding: utf-8 -*-
# vim:set ts=4 sw=4 et:
# Copyright 2018-2019 Artem Smirnov
# 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/licens... |
sb.py | # -*- coding: utf-8 -*-
from linepy import *
from datetime import datetime
from time import sleep
from bs4 import BeautifulSoup
from gtts import gTTS
from humanfriendly import format_timespan, format_size, format_number, format_length
import time, random, sys, json, codecs, threading, glob, re, string, os, requests, s... |
test_communicator.py | import unittest
import torch
import os
from bagua.torch_api.communication import (
_get_default_group,
allreduce,
allreduce_inplace,
send,
recv,
allgather,
barrier,
broadcast_object,
reduce,
reduce_inplace,
reduce_scatter,
reduce_scatter_inplace,
ReduceOp,
)
from test... |
state.py | import random
from abc import ABC
from functools import reduce
from threading import Thread, Event
HEARTBEAT_TIMEOUT = 0.01
ELECTION_TIMEOUT = 0.5, 1.0
class State(ABC):
def __init__(self, server):
from server import SurfstoreServer
self.server: SurfstoreServer = server
self.majority = s... |
client03-empty.py | import copy
import logging
import asyncio
import threading
import time
from collections import deque
from dataclasses import asdict
from typing import Dict
import zmq
from zmq.asyncio import Context, Socket
import arcade
from pymunk.vec2d import Vec2d
from demos.movement import KeysPressed, MOVE_MAP, apply_movement
fr... |
main.py | from gui.uis.windows.main_window.functions_main_window import *
import sys,os,time
import requests,json
import random
from bs4 import BeautifulSoup as bs4
from qt_core import *
from gui.core.json_settings import Settings
from gui.uis.windows.main_window import *
# IMPORT PY ONE DARK WIDGETS
from gui.widgets import *
im... |
emulators.py | import sys
import time
from contextlib import suppress
import asyncio
import logging
import os
import subprocess
from dataclasses import dataclass
from multiprocessing import Queue, Process
from pathlib import Path
from typing import Optional, List, Dict, Any, Set, Union, Coroutine, Tuple, Mapping
from mobiletestor... |
ACS.py | # -*- coding: utf-8 -*-
import sys
import socket
import json
from time import time, sleep
from random import randint
from threading import Thread, Lock
try:
import netifaces
except:
pass
import urllib.request
import xml.dom.minidom as minidom
class AttoException(Exception):
def __init__(self, errorTex... |
keepalive.py | from flask import Flask
from threading import Thread
app = Flask('')
@app.route('/')
def home():
return "Script running successfully"
def run():
app.run(host='0.0.0.0',port=8080)
def keep_alive():
t = Thread(target=run)
t.start()
|
federated_scheduler.py | #
# Copyright 2019 The FATE 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... |
run_local_test.py | """run local test in starting kit"""
# pylint: disable=logging-fstring-interpolation
import argparse
import logging
import os
from os.path import join, isdir
import shutil
from multiprocessing import Process
VERBOSITY_LEVEL = 'WARNING'
logging.basicConfig(
level=getattr(logging, VERBOSITY_LEVEL),
format='%(a... |
minion.py | # -*- coding: utf-8 -*-
'''
Routines to set up a minion
'''
# Import python libs
from __future__ import absolute_import
from __future__ import print_function
import copy
import errno
import fnmatch
import hashlib
import logging
import multiprocessing
import os
import re
import salt
import signal
import sys
import threa... |
spanprocessor.py | # Copyright The OpenTelemetry 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 ... |
asset_info.py | #!/usr/bin/env python
# coding: utf8
'''
@Creator: valor7
@Email: valor7@163.com
@File: asset_info.py
@Time: 2017/10/15 15:33
@desc:
'''
from deploy.saltapi import SaltAPI
from oms_valor7 import settings
import threading
asset_info = []
def GetInfoDict(r, arg):
try:
result = ''
for k in r[arg]:
... |
gui.py | import ants
import ants_strategies
import utils
import state
import json
import distutils.core
import urllib.request
import os
import shutil
import zipfile
import threading
import importlib
from time import sleep
from ucb import *
VERSION = 1.2
ASSETS_DIR = "assets/"
INSECT_DIR = "insects/"
STRATEGY_SECONDS = 3
INSECT... |
build_openwebtext_pretraining_dataset.py | # coding=utf-8
# Copyright 2020 The Google Research 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 applicab... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.