source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
compiled.py | import zipfile
import tarfile
import gzip
import bz2
import os
import subprocess
import shutil
import glob
import json
GIT_SCRIPT = """
git clone https://michael78912/smnw-archives
cd smnw-archives
git init
echo copying archives...
cp ../Archives/* .
git add *
git push origin master
"""
def make_xz(file, dir='.'):
... |
publish.py | #!/usr/bin/env python3
import json
import random
import redis
import time
from threading import Thread
# Replaces with your configuration information
redis_host = "localhost"
redis_port = 6379
redis_password = ""
event_channels = {
'login': 'user_event:login',
'view': 'user_event:view',
'logout': 'user_... |
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... |
dmx512.py | #!/usr/bin/python3
# Author: Kenta Ishii
# SPDX short identifier: BSD-3-Clause
# ./dmx512.py
import RPi.GPIO as gpio
import threading
class DMX512:
"""Dependency:RPi.GPIO, threading"""
def __init__(self, list_gpio_output, num_gpio_busy_toggle, num_gpio_eop_toggle):
self.list_gpio_output = list_gpio_o... |
test_integration.py | """
Integration tests for mureq.
These tests depend on third-party infrastructure and MUST NOT be run in an
automated CI setting.
"""
import contextlib
import json
import unittest
import socket
import threading
import tempfile
import os.path
import urllib.parse
import ssl
import http.client
import http.server
import... |
train_tiles.py | """
@author: Viet Nguyen <nhviet1009@gmail.com>
"""
import os # NOQA: E402
os.environ["CUDA_VISIBLE_DEVICES"] = "3" # NOQA: E402
import argparse
import torch
from src.env import create_train_env
from src.model_tiles import ActorCritic
from src.optimizer import GlobalAdam
from src.process_tiles import local_train, l... |
_testing.py | import bz2
from collections import Counter
from contextlib import contextmanager
from datetime import datetime
from functools import wraps
import gzip
import operator
import os
import re
from shutil import rmtree
import string
import tempfile
from typing import (
Any,
Callable,
ContextManager,
List,
... |
Subforce.py | # Useful documentation:
# Sublime Plugin Framework: http://docs.sublimetext.info/en/latest/reference/plugins.html
# Sublime Plugin Python API: http://www.sublimetext.com/docs/3/api_reference.html
# Perforce API: https://www.perforce.com/perforce/r16.1/manuals/cmdref
# Perforce Python API: https://www.perforce.com/perfo... |
orangepiplatform.py | import time
import threading
from pyA20.gpio import gpio as GPIO # pylint: disable=import-error
from .rpilikeplatform import RPiLikePlatform
class OrangepiPlatform(RPiLikePlatform):
def __init__(self, config):
super(OrangepiPlatform, self).__init__(config, 'orangepi', GPIO)
def setup(self):
GPIO.init()
G... |
run_batch_experiments.py | import os, sys, signal
import random
import numpy as np
from multiprocessing import Process, Queue, current_process, freeze_support
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('--method', type=str, default='ours')
parser.add_argument('--num-seeds', type=int, default=5)
parser.add_argument('-... |
app.py | #!/usr/bin/env python
# coding: utf-8
import os
import json
import logging
from queue import Queue, Empty
from threading import Thread
import datetime
import math
import time
import argparse
import copy
from flask import Flask, request
## setup logging
parser = argparse.ArgumentParser()
subparsers = parser.add_subpa... |
api.py | #!/usr/bin/env python3
import binaries
import db
import flask
import json
import os
import redis
import threading
import time
from ast import literal_eval
from celery import Celery
from flask import request
from flask_cors import CORS, cross_origin
from shutil import copy
queue_poll_interval = 10
default_product = "c... |
trab_atualizado.py | # -*- coding: utf-8 -*-
"""trab_atualizado.ipynb"""
import pygame, random
from pygame.locals import *
import threading
from threading import Lock
mutex1 = threading.Lock()
mutex2 = threading.Lock()
mutex3 = threading.Lock()
mutex4 = threading.Lock()
mutex5 = threading.Lock()
UP = 0
RIGHT = 1
DOWN = 2
LEFT = 3
pygam... |
client_main.py | import threading
import time
import requests
import sys
import json
import os
import jieba.analyse
from PyQt5 import QtCore, QtGui, QtWidgets
import pickle
from Spiders.bilibili.spider import Bilibili
from Spiders.zhihu.spider import Zhihu
from tools.helper import LoginHelper
from Chat import chat_client
pickle_file... |
demo_webcam.py | """
Videoconferencing plugin demo for Linux.
v4l2loopback-utils needs to be installed, and a virtual webcam needs to be running at `--camera-device` (default: /dev/video1).
A target image and background should be supplied (default: demo_image.png and demo_video.mp4)
Once launched, the script is in background collecti... |
utils.py | import subprocess, os, os.path, yaml, shlex, re, urllib.parse, shutil, urllib.request, threading
def exe(cmd):
if type(cmd) != type([]):
cmd = shlex.split(cmd)
return subprocess.Popen(cmd)
def exe_pipes(cmd):
if type(cmd) != type([]):
cmd = shlex.split(cmd)
return subprocess.Popen(cmd, stdout = subprocess.PIP... |
test_singleton.py | # -*- coding: utf-8; -*-
from ..syntax import macros, test, test_raises, the # noqa: F401
from ..test.fixtures import session, testset, returns_normally
import pickle
import gc
import threading
from queue import Queue
from ..singleton import Singleton
from ..misc import slurp
from ..it import allsame
# For testing... |
utils.py | import importlib.machinery
import logging
import shutil
from multiprocessing import Process, Queue, Pool
import random
import re
import string
def import_by_filename(name, module_path):
"""
Import module by path. Module would appear in sys.modules
:param name: str The name of the module that this loader ... |
socketserverhandler.py | import socket as pythonsocket
from threading import Thread
from time import sleep
import datetime
import pickle
import datetime
import database
import reddit
import string
import random
import settings
socket = pythonsocket.socket(pythonsocket.AF_INET, pythonsocket.SOCK_STREAM)
def startServer():
... |
job.py | # Copyright (c) 2019 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 app... |
pangeamt_files_preprocess.py | #!/usr/bin/env python
import os
import json
import argparse
from multiprocessing import Process
from pangeamt_nlp.processors import Pipeline
# Parallel preprocess of train, dev and test files.
def _get_parser():
parser = argparse.ArgumentParser(description='Preprocess file.')
parser.add_argument('config', he... |
train_sampling_multi_gpu.py | import dgl
import numpy as np
import torch as th
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
import dgl.multiprocessing as mp
import dgl.nn.pytorch as dglnn
import time
import math
import argparse
from torch.nn.parallel import DistributedDataParallel
import tqdm
from model import ... |
cgatt.py | import logging
import re
import threading
from time import sleep
import gatt
from pylgbst.comms import Connection, LEGO_MOVE_HUB, MOVE_HUB_HW_UUID_SERV, MOVE_HUB_HW_UUID_CHAR, \
MOVE_HUB_HARDWARE_HANDLE
from pylgbst.utilities import str2hex
log = logging.getLogger('comms-gatt')
class CustomDevice(gatt.Device, ... |
startup.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... |
test_index.py | import pytest
from base.client_base import TestcaseBase
from base.index_wrapper import ApiIndexWrapper
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 common.code_mapping import CollectionErro... |
pycc.py | #!/usr/bin/env python
"""Python Capability Container start script"""
__author__ = 'Adam R. Smith, Michael Meisinger'
# NOTE: Imports here must be controlled before gevent monkey patching
import argparse
import ast
from copy import deepcopy
from multiprocessing import Process, Event, current_process
import os
import ... |
test_dataloader.py | # -*- coding: utf-8 -*-
# MegEngine is Licensed under the Apache License, Version 2.0 (the "License")
#
# Copyright (c) 2014-2021 Megvii Inc. All rights reserved.
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT ARRANTI... |
main.py | # Copyright (c) 2019, NVIDIA CORPORATION. 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... |
cloud_mask_demo.py | import numpy as np
import os, glob
from matplotlib import pyplot as plt
import camera as cam
import time, sys
import stat_tools as st
from scipy.ndimage import morphology,filters, measurements ####more efficient than skimage
from scipy import signal
from skimage.morphology import remove_small_objects
# from skimage im... |
SerialHandler.py | """Serial Handler for Interaction with NomadBLDC Board"""
# SerialHandler.py
#
# Created on: March 20, 2020
# Author: Quincy Jones
#
# Copyright (c) <2020> <Quincy Jones - quincy@implementedrobotics.com/>
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and a... |
index.py | """Routines related to PyPI, indexes"""
import sys
import os
import re
import gzip
import mimetypes
try:
import threading
except ImportError:
import dummy_threading as threading
import posixpath
import pkg_resources
import random
import socket
import string
import zlib
from pip.log import logger
from pip.util ... |
YoutubeDownloader.py | from PyQt5.QtCore import *
from pytube import YouTube
from threading import Thread
import Core.OSHandler as OSHandler
import Core.FFmpegHandler as FFmpegHandler
class YoutubeDownloader(QObject):
class DownloadHandler(QObject):
progressSignal = pyqtSignal([int, int])
completeSignal = pyqtSignal()
... |
OpTestInstallUtil.py | #!/usr/bin/env python2
# OpenPOWER Automated Test Project
#
# Contributors Listed Below - COPYRIGHT 2018
# [+] International Business Machines Corp.
#
#
# 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 Lic... |
emr_step_main.py | import io
import os
import pickle
import sys
import time
from queue import Empty, Queue
from threading import Thread
import boto3
from dagster_aws.s3.file_manager import S3FileHandle, S3FileManager
from dagster.core.execution.plan.external_step import PICKLED_EVENTS_FILE_NAME, run_step_from_ref
DONE = object()
def... |
agt_smart_mirror.py | #
# Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# These materials are licensed under the Amazon Software License in connection with the Alexa Gadgets Program.
# The Agreement is available at https://aws.amazon.com/asl/.
# See the Agreement for the specific terms and conditions of the Agreem... |
template.py | import pygame, pygcurse
from pygame.locals import *
# import LED_display as LD
# import threading
import time
import copy
import os
delay = 0.1
#t=threading.Thread(target=LD.main, args=())
#t.setDaemon(True)
#t.start()
iScreen =[[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,... |
manul.py | # Manul - main module
# -------------------------------------
# Maksim Shudrak <mshudrak@salesforce.com> <mxmssh@gmail.com>
#
# Copyright 2019 Salesforce.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 t... |
update.py | #!/usr/bin/env python
# coding:utf-8
import os
import urllib2
import json
import time
import threading
import zipfile
import sys
import platform
from distutils.version import LooseVersion
from instances import xlog
import config
import uuid
import update_from_github
#opener = urllib2.build_opener()
#update_url = "h... |
experiment.py | from multiprocessing import Process
from DLplatform.coordinator import Coordinator, InitializationHandler
from DLplatform.worker import Worker
from DLplatform.communicating import Communicator, RabbitMQComm
from DLplatform.dataprovisioning import IntervalDataScheduler
from DLplatform.learningLogger import LearningLogge... |
test_smtplib.py | import asyncore
import email.mime.text
import email.utils
import socket
import smtpd
import smtplib
import io
import re
import sys
import time
import select
import errno
import unittest
from test import support, mock_socket
try:
import threading
except ImportError:
threading = None
HOST ... |
stream.py | import warnings
from logging import getLogger
from queue import Queue
from threading import Thread, Semaphore
from typing import *
import numpy as np
from ..typing_ import *
from ..utils import (minibatch_slices_iterator, AutoInitAndCloseable, NOT_SET,
GeneratorIterator, to_number_or_numpy)
__al... |
__init__.py | # -*- coding: utf-8 -*-
"""
Implements context management so that nested/scoped contexts and threaded
contexts work properly and as expected.
"""
from __future__ import absolute_import
from __future__ import division
import collections
import functools
import logging
import os
import platform
import six
import socket
... |
settings_20210906113250.py | """
Django settings for First_Wish project.
Generated by 'django-admin startproject' using Django 3.2.
For more information on this file, see
https://docs.djangoproject.com/en/3.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.2/ref/settings/
"""
from pathli... |
logger.py | import time
import re
import socket
import sys
import traceback
import paho.mqtt.client as mqtt
from threading import Thread
class TemperatureLogger:
config = None
mqtt_client = None
mqtt_connected = False
worker = None
# removed as not one of my requirements
#temperatures = {}
def __ini... |
ensembles_base.py | import warnings
from abc import abstractmethod, ABC
from functools import partial
from itertools import repeat
from multiprocessing import Process, Queue
from multiprocessing.pool import ThreadPool, Pool
from queue import PriorityQueue
from threading import Thread
import numpy as np
import pandas as pd
import scipy.st... |
test_docxmlrpc.py | from xmlrpc.server import DocXMLRPCServer
import http.client
import sys
from test import support
threading = support.import_module('threading')
import time
import socket
import unittest
PORT = None
def make_request_and_skipIf(condition, reason):
# If we skip the test, we have to make a request because
# the s... |
create_images.py | #!/usr/bin/env python3
#
# Copyright 2018 The Bazel 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 ... |
_invocation.py | # Copyright 2017 gRPC 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 writing... |
datasets.py | from flask import request
from flask_restplus import Namespace, Resource, reqparse, inputs
from flask_login import login_required, current_user
from werkzeug.datastructures import FileStorage
from mongoengine.errors import NotUniqueError
from mongoengine.queryset.visitor import Q
from threading import Thread
from goog... |
nat_net_client.py | import socket
from threading import Thread
import time
from typing import Optional
from .data_frame import DataFrame
from .event import Event
from .server_info import ServerInfo
from .data_descriptions import DataDescriptions
from .packet_buffer import PacketBuffer
from .version import Version
class Na... |
receiver_test.py | import sys
import threading
import unittest
import mitogen.core
import testlib
def yield_stuff_then_die(sender):
for x in range(5):
sender.send(x)
sender.close()
return 10
class ConstructorTest(testlib.RouterMixin, testlib.TestCase):
def test_handle(self):
recv = mitogen.core.Receiv... |
StreamDeck.py | # Python Stream Deck Library
# Released under the MIT license
#
# dean [at] fourwalledcubicle [dot] com
# www.fourwalledcubicle.com
#
import threading
import time
from abc import ABC, abstractmethod
from ..Transport.Transport import TransportError
class StreamDeck(ABC):
"""
Represents... |
k8s.py |
import hashlib
import logging
import os
import random
import string
from string import Template
import scalyr_agent.monitor_utils.annotation_config as annotation_config
import scalyr_agent.third_party.requests as requests
import scalyr_agent.util as util
from scalyr_agent.util import StoppableThread
from scalyr_agent... |
test_run.py | import contextvars
import functools
import platform
import sys
import threading
import time
import types
import warnings
import weakref
from contextlib import contextmanager, ExitStack
from math import inf
from textwrap import dedent
import gc
import attr
import outcome
import sniffio
import pytest
from .tutil import... |
coderhub_stats.py | """
the purpose of this file is to collect data from coderhub.sa API, prepare and group it
to make it easier to start analysing the data
"""
import pandas as pd
import time
from coderhub import CoderHub
import threading
import requests
class CoderHubStats(CoderHub):
users_data = {}
threads_lst = []
de... |
server.py | # Copyright 2014 OpenStack Foundation
#
# 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... |
test-socket_stream_redirect.py | """
###############################################################################
test the socket_stream_redirection.py modes
###############################################################################
"""
import sys, os, multiprocessing
from socket_stream_redirect import *
#####################################... |
base.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import tools
import time
import re
import db
import threading
class Source (object) :
def __init__ (self):
self.T = tools.Tools()
self.now = int(time.time() * 1000)
def getSource (self) :
urlList = []
url = 'https://www.jianshu.c... |
sqlite_web.py | #!/usr/bin/env python
import datetime
import math
import operator
import optparse
import os
import re
import sys
import threading
import time
import webbrowser
from collections import namedtuple, OrderedDict
from functools import wraps
from getpass import getpass
from io import TextIOWrapper
# Py2k compat.
if sys.ver... |
test_pool.py | import threading
import time
from sqlalchemy import pool, select, event
import sqlalchemy as tsa
from sqlalchemy import testing
from sqlalchemy.testing.util import gc_collect, lazy_gc
from sqlalchemy.testing import eq_, assert_raises, is_not_
from sqlalchemy.testing.engines import testing_engine
from sqlalchemy.testing... |
setupaws.py | import random
import json
import time
import sys
import threading
from pathlib import Path
from PIL import Image
from botocore.exceptions import ClientError
from secureaws import common
def secure_account_menu(session):
"""
This will enable basic security services on your AWS account
"""
try:
... |
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... |
multiprocessing_tools.py | import multiprocessing
def fun(f, q_in, q_out):
while True:
i, x = q_in.get()
if i is None:
break
q_out.put((i, f(x)))
def parmap(f, X, nprocs=multiprocessing.cpu_count()):
q_in = multiprocessing.Queue(1)
q_out = multiprocessing.Queue()
proc = [multiprocessing.Proc... |
multirotor_autonomous.py | """
For connecting to the AirSim drone environment and testing API functionality
And to learn how to control the drone
"""
import setup_path
import airsim
import numpy as np
import os
import tempfile
import pprint
import json
import cv2
import sys
import time
import threading
# connect to the AirSim simulator
client ... |
softskin.py | import serial
import serial.tools.list_ports
import numpy as np
import math
import threading
import re
import os
import sys
import time
import matplotlib.pyplot as plt
pwd = os.path.abspath(os.path.abspath(__file__))
father_path = os.path.abspath(os.path.dirname(pwd) + os.path.sep + "..")
sys.path.append(father_path)
... |
option_picker.py | import traceback
from tkinter import *
from multiprocessing import Queue
from tkinter.colorchooser import askcolor
import json
import re
import tkinter.ttk
import pygame.sysfont
from options import Options
import logging
import urllib.request, urllib.error, urllib.parse
import webbrowser
import platform
import threadin... |
CoapAdapter.py | from aiocoap import *
import threading
import asyncio
class CoapAdapter:
def __init__(self, controller):
self.controller = controller
self.broker_address = None
self.protocol = None
self.topics = []
async def connect(self, address):
self.broker_address = address
... |
cluster.py | # Standard
import ast
import importlib
import signal
import socket
import traceback
import uuid
from multiprocessing import Event, Process, Value, current_process
from time import sleep
# External
import arrow
# Django
from django import db, core
from django.apps.registry import apps
try:
apps.check_apps_ready()... |
__init__.py | '''
Set up the Salt integration test suite
'''
# Import Python libs
import optparse
import multiprocessing
import os
import sys
import shutil
import tempfile
import time
import signal
import subprocess
from hashlib import md5
from subprocess import PIPE, Popen
from datetime import datetime, timedelta
try:
import p... |
Host.py |
import socket
import threading , sys
s= socket.socket(socket.AF_INET,socket.SOCK_STREAM,0)
s.bind(('192.168.101.9',5967))
s.listen(5)
name=['sdf','sdf','sdf']
connname=[]
print("HOST SUCCESFULLY \n")
def connect():
while True:
try:
conn, addr = s.accept()
user_name ... |
XMPP_server.py | #!/usr/local/bin/python
#
# Copyright (c) 2003-2005 Maxim Sobolev. All rights reserved.
# Copyright (c) 2006-2014 Sippy Software, Inc. All rights reserved.
#
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions... |
test_executors.py | import os
import multiprocessing
import sys
import threading
import tempfile
import time
import pytest
import prefect
from prefect.utilities.configuration import set_temporary_config
from prefect.utilities.executors import (
timeout_handler,
tail_recursive,
RecursiveCall,
)
def test_timeout_handler_time... |
test_scheduler.py | from datetime import datetime, timedelta
import os
import signal
import time
from threading import Thread
from rq import Queue
from rq.compat import as_text
from rq.job import Job
from rq_scheduler import Scheduler
from rq_scheduler.utils import to_unix, from_unix, get_next_scheduled_time, get_utc_timezone
from tests... |
main_app_host.py | #!/usr/bin/env python3
from traffic_generator_host import TrafficGeneratorHost
from load_files_helper import LoadFilesHelper
import multiprocessing
import argparse
import os
import shutil
# Se puede cambiar la duracion de los intervalos
# pero cabe recalcar que el estudio se ha hecho para intervalos de 5 minutos
pars... |
interactiveformatter.py | # -*- coding: utf-8 -*-
"""Interactive interface."""
import curses
import threading
import formatter
import executor
import functools
import i18n
_ = i18n.translate
# TODO: i18n
# TODO: refactoring with Formatter + separate UI class
HELP_MESSAGE = """
PVCHECK automatic verification of computer programs
========... |
example_binance_us.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# File: example_binance_us.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://pypi.o... |
wrappers.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... |
test_asyncore.py | import asyncore
import unittest
import select
import os
import socket
import threading
import sys
import time
from test import test_support
from test.test_support import TESTFN, run_unittest, unlink
from StringIO import StringIO
HOST = test_support.HOST
class dummysocket:
def __init__(self):
self.closed ... |
test_utils_test.py | import asyncio
import os
import pathlib
import signal
import socket
import threading
from contextlib import contextmanager
from time import sleep
import pytest
import yaml
from tornado import gen
import dask.config
from distributed import Client, Nanny, Scheduler, Worker, config, default_client
from distributed.comp... |
test_athenad.py | #!/usr/bin/env python3
import json
import os
import requests
import tempfile
import time
import threading
import queue
import unittest
from multiprocessing import Process
from pathlib import Path
from unittest import mock
from websocket import ABNF
from websocket._exceptions import WebSocketConnectionClosedException
... |
Run.py | from Bracket_Class import Bracket, clean_year
import multiprocessing as mp
import time
def parallel_bracket(year):
B = Bracket(year)
B.run()
B.write_to_csv()
B.write()
def p_print(n, label):
if n == 0:
return ''
elif n == 1:
return '{} {} '.format(n, label)
else:
... |
test_util.py | # pylint: disable=invalid-name
"""Test utils for tensorflow."""
import contextlib
import math
import re
import threading
import tensorflow.python.platform
import numpy as np
from google.protobuf import text_format
from tensorflow.core.framework import config_pb2
from tensorflow.python import pywrap_tensorflow
from ... |
main.py | import os
import time
import threading
from copy_files import copy_files
from delete_files import delete_files, delete_empty_folders
from results import compile_results
from utils import load_config
from multiprocessing import Pool
from tqdm import tqdm
# TODO: Fix bug that rewrites skipped and error log files on ea... |
cors_web_server.py | import threading
class CORSWebServer(object):
def __init__(self) -> None:
self.thread = threading.Thread(target=self.serve)
self.server = None
def serve(self):
outer = self
from http.server import HTTPServer, SimpleHTTPRequestHandler, test
class ClojureServer(HTTPSer... |
csv_to_mr.py | # Copyright 2020 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... |
_impl.py | from __future__ import print_function, division, absolute_import
import ast
import contextlib
import fnmatch
import importlib
import pathlib
import shlex
import sys
import tempfile
import threading
import packaging.version
import pytest
from IPython import get_ipython
from ._config import current_config
def run(*... |
test_uploader.py | import time
import threading
import unittest
import logging
import json
from selfdrive.swaglog import cloudlog
import selfdrive.loggerd.uploader as uploader
from common.xattr import getxattr
from selfdrive.loggerd.tests.loggerd_tests_common import UploaderTestCase
class TestLogHandler(logging.Handler):
def __init... |
__init__.py | """Miscellaneous helper functions (not wiki-dependent)."""
#
# (C) Pywikibot team, 2008-2020
#
# Distributed under the terms of the MIT license.
#
import collections
import gzip
import hashlib
import inspect
import itertools
import os
import queue
import re
import stat
import subprocess
import sys
import threading
impo... |
MAPS_temp_plugin.py | # -*- coding: UTF-8 -*-
# mod for temp/RH plugin
import math
import time
import serial
import threading
from datetime import datetime
from collections import deque
from statistics import median
MIC_COM_PORT = '/dev/ttyACM0'
BAUD_RATES = 115200
#pairs = datetime.now().strftime("%Y-%m-%d %H-%M").split(" ")
#time_slot... |
BluetoothHCI.py | #!/usr/bin/python
# Bluetooth HCI Python library (Experimental)
#
# Pure Python and standard library based module for interacting with the Bluetooth HCI.
# There is no dependency on the PyBluez Python/Native libraries, bluetoothd service or D-Bus.
# This can be considered to be a Pythonisation of the NodeJS NoBLE/ B... |
manager.py | # -*- coding: utf-8 -*-
# ------------------------------------------------------------------------------
#
# Copyright 2018-2020 Fetch.AI Limited
#
# 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 ... |
patch_extractor.py | import os
import numpy as np
import glob
import fire
import xml.etree.ElementTree as ET
from PIL import Image
from openslide import open_slide
import pandas as pd
from multiprocessing import Process
class BTPatchExtractor:
def __init__(self, file_path: str, output_path: str, asap_xml_path: str, overwrite: bool = ... |
anpr_camera_stream.py | #!/usr/bin/env python
from __future__ import absolute_import, division, print_function
import argparse
import csv
import io
import os
from datetime import datetime
from threading import Thread
import cv2
import requests
from PIL import Image
os.environ["OPENCV_FFMPEG_CAPTURE_OPTIONS"] = "rtsp_transport;udp"
def pa... |
train.py | #!/usr/bin/env python
"""
Main training workflow
"""
from __future__ import division
import argparse
import glob
import os
import random
import signal
import time
import heapq
import torch
from pytorch_pretrained_bert import BertConfig
import distributed
from models import data_loader, model_builder
from models.... |
http.py | #!/usr/bin/env python3
# MIT License
#
# Copyright (C) 2020, Entynetproject. All Rights Reserved.
#
# 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 lim... |
1extract_image_label.py |
"""
Taken and Customized from:
https://github.com/KushalBKusram/WaymoDataToolkit
"""
"""
As step 1
Extract images and labels from segment
"""
import time
import threading
from datetime import timedelta
import util_image_label as WODKit
if __name__=="__main__":
#Path where the input and output folders... |
tester.py | #!/usr/bin/env python3
# Author: Psyho
# Twitter: https://twitter.com/fakepsyho
#TODO:
# HIGH PRIORITY:
# -create proper ReadMe
# -more error checking / clearer error messages
# -fix grouping/filtering if data file doesn't contain all test cases
# -add warnings if data is not present for all test cases?
# -config: me... |
utility.py | import os
import math
import time
import datetime
from multiprocessing import Process
from multiprocessing import Queue
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import numpy as np
import imageio
import torch
import torch.optim as optim
import torch.optim.lr_scheduler as lrs
class time... |
main4.py |
import time
import threading
import requests
L = 'http://localhost:8001'
TIMEOUT = 5
def make_request(method):
method = getattr(requests, method)
def req(path, *a, type=None, headers=None, **kw):
if 'timeout' not in kw:
kw['timeout'] = TIMEOUT
if type:
if no... |
session.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright 2020 Alibaba Group Holding Limited. 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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.