source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
watch_rel_1_17.py | #
# Copyright (c) 2021 Incisive Technology Ltd
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, pu... |
gsi_rebalance_2i.py | from datetime import datetime
import random
import threading
from membase.api.rest_client import RestConnection, RestHelper
from queue import Queue
from lib import testconstants
from lib.couchbase_helper.query_definitions import SQLDefinitionGenerator, QueryDefinition, RANGE_SCAN_TEMPLATE
from lib.couchbase_helper.tu... |
quantize_mobilenet-ssd3_test.py | #!/usr/bin/env python
# --------------------------------------------------------
# Quantize Fast R-CNN based Network
# Written by Chia-Chi Tsai
# --------------------------------------------------------
"""Quantize a Fast R-CNN network on an image database."""
import os
os.environ['GLOG_minloglevel'] = '2'
import _... |
nifty.py | """@package geometric.nifty Nifty functions, originally intended to be imported by any module within ForceBalance.
This file was copied over from ForceBalance to geomeTRIC in order to lighten the dependencies of the latter.
Table of Contents:
- I/O formatting
- Math: Variable manipulation, linear algebra, least square... |
main.py | #! /usr/bin/env python
# -*- coding: UTF-8 -*-
# Copyright 2021 NXP
# All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
import wx
import sys
reload(sys)
sys.setdefaultencoding('utf-8')
import os
import time
import threading
import inspect
import ctypes
from run import runcore
from ui import uidef
from u... |
mevea_runner.py | import numpy as np
import gym, pyautogui, cv2, os, shutil
import os.path as osp
from common.runners import AbstractEnvRunner, swap_and_flatten
from common.solver_utils import get_solver_path, start_solver, stop_solver
from common.server_utils import is_backend_registered, delete_id
from time import sleep, time
from th... |
lib.py | from termcolor import cprint
import threading
from info.GetVersion import GetVersion
from info.FindAdmin import FindAdmin
from info.trace import trace
from info.shortpath import shortpath
from info.passwordrest import passwordres
from info.path import path
from script.advancedsearch_sqli import advancedsearch_sqli
from... |
SCOREBOARD_WITH_SETTING_PAGE.py | # This my first app done using REMI and Python. Probably there is a better way to do it.
# This app is a simple scoreboard. I use it when I play pool/biliard.
# In the app is possible set-up how many Games one has to win, to win a Match.
# Example: the program starts with 5 games to win for a match. The background colo... |
tests.py | import unittest
import threading
from src.FiniteConsole.FiniteConsole import Program, Menu, Option
from src.FiniteConsole import ProgramExistsException, MenuExistsException, UndeterminedOption
class TestProgram(unittest.TestCase):
def setUp(self) -> None:
self.p = Program()
Menu.TEST = True
... |
test_util.py | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
test_command_server.py |
import threading
import time
import unittest
from pisat.comm.transceiver import SocketTransceiver, CommSocket
from pisat.tester.comm import TestTransceiver
from can09.server.command_server import CommandServer
from can09.server.request import (
Request, RequestForm,
CommandBase, CommandParams, RequestCommand... |
borrar.py | from multiprocessing import Process, Queue, Value
from time import sleep, time
class Hijo():
mensaje:str='Original'
#def __init__(self):
# self.qq = Queue()
def start(self, q:Queue):
self.qq = q
espera = 10
while True:
for _ in range(espera):
if n... |
installwizard.py |
import os
import sys
import threading
import traceback
from PyQt5.QtCore import *
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *
from electrum_civx.wallet import Wallet
from electrum_civx.storage import WalletStorage
from electrum_civx.util import UserCancelled, InvalidPassword
from electrum_civx.base_wizar... |
client.py | #-------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#--------------------------------------------------------------------------
# pylint: d... |
multiprocess_web_server.py | #!/usr/bin/python3
# file: multiprocess_web_server.py
# Created by Guang at 19-7-19
# description:
# *-* coding:utf8 *-*
import multiprocessing
import socket
import re
def service_client(new_socket):
"""为这个客户端返回数据"""
# 1.接收浏览器发送过来的请求, 即HTTP请求
# GET / HTTP/1.1
request = new_socket.recv(1024).decode('... |
thermald.py | #!/usr/bin/env python3
import datetime
import os
import queue
import threading
import time
from collections import OrderedDict, namedtuple
from pathlib import Path
from typing import Dict, Optional, Tuple
import psutil
import cereal.messaging as messaging
from cereal import log
from common.dict_helpers import strip_d... |
shift_classification.py | import cv2
import threading
import tensorflow as tf
import numpy as np
import capturer
from utils.circularBuffer import CircularBuffer
classes = ['Left of Sidewalk', 'Middle of Sidewalk', 'Right of Sidewalk', 'Nothing Detected']
model_path = "./shift_classification/shift_classification_model_vgg16_final.h5"
readings_b... |
train_pascal.py | #!/usr/bin/env python
# --------------------------------------------------------
# Faster R-CNN
# Copyright (c) 2015 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Written by Ross Girshick
# --------------------------------------------------------
"""Train a Faster R-CNN network using alternat... |
router.py | #!/usr/bin/env python3
"""
Basic HTTP server (main driver).
Processes all incoming and outgoing HTTP Requests/Responses
Creates a new thread for every request and handles it
Calls appropriate RequestParser.py and Responder.py objects
"""
import socket
import threading
import sys, os
from RequestParser import RequestP... |
sql_isolation_testcase.py | """
Copyright (c) 2004-Present Pivotal Software, Inc.
This program and the accompanying materials are made available under
the terms of the 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.... |
util.py | # *****************************************************************************
# © Copyright IBM Corp. 2018. All Rights Reserved.
#
# This program and the accompanying materials
# are made available under the terms of the Apache V2.0
# which accompanies this distribution, and is available at
# http://www.apache.org/l... |
test.py | # -*- coding: utf-8 -*-
import redis
import unittest
from hotels import hotels
import random
import time
from RLTest import Env
from includes import *
def testAdd(env):
if env.is_cluster():
raise unittest.SkipTest()
r = env
env.assertOk(r.execute_command(
'ft.create', 'idx', 'schema', 'ti... |
run-tests.py | #!/usr/bin/env python3
#
# run-tests.py - Run a set of tests on Mercurial
#
# Copyright 2006 Olivia Mackall <olivia@selenic.com>
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
# Modifying this script is tricky because it has many... |
engine.py | import json
import copy
import rules
import threading
import inspect
import random
import time
import datetime
import os
import sys
import traceback
def _unix_now():
dt = datetime.datetime.now()
epoch = datetime.datetime.utcfromtimestamp(0)
delta = dt - epoch
return delta.total_seconds()
class Closur... |
watch.py | from threading import Thread
class Watch:
""" Watch class to implement a data-observer pattern on the encapsulated data item.
The event-handlers/callbacks will be ran when the data is changed/set. """
def __init__(self, data=None):
""" Pass constructor the data item to be watched. None by def... |
windows.py | # Diverter for Windows implemented using WinDivert library
import logging
from pydivert.windivert import *
import socket
import os
import dpkt
from . import fnpacket
import time
import threading
import platform
from .winutil import *
from .diverterbase import *
import subprocess
class Win... |
resultPusher.py | #!/usr/bin/env python
"""
Script: resultPusher
Checks the queue for completed jobs, and notifies <mqsub> instances that the corresponding job has been completed.
Runs on the same machine from which jobs have been submitted.
"""
#
# Fix: push results only for the local machine. (the mq task directory should record t... |
control_Husky_UR3_5.py | #! /usr/bin/env python
# -*- coding: utf-8 -*-
"""
"""
import sys
import rospy
import copy, math
import threading
import time
from math import pi, radians, degrees, atan2, sqrt
from moveit_commander import MoveGroupCommander, RobotCommander
from moveit_commander import PlanningSceneInterface, roscpp_initialize, roscp... |
lambda_executors.py | import base64
import glob
import json
import logging
import os
import re
import subprocess
import sys
import threading
import time
import traceback
from multiprocessing import Process, Queue
from typing import Tuple
from localstack import config
from localstack.services.awslambda.lambda_utils import (
LAMBDA_RUNTI... |
sampler.py | # (C) Datadog, Inc. 2018-present
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)
# flake8: noqa
"""
A lightweight Python WMI module wrapper built on top of `pywin32` and `win32com` extensions.
**Specifications**
* Based on top of the `pywin32` and `win32com` third party extensions o... |
_looping.py | #!/usr/bin/python3
# -*- coding: utf-8 -*-
"""
.. module:: __init__
:synopsis: module that contains asynchronous looping related methods.
"""
import sys
import threading
from mockintosh.services.asynchronous import AsyncService, AsyncConsumerGroup, AsyncActor, AsyncProducer, AsyncConsumer
from mockintosh.service... |
freetests.py | #!/usr/bin/env python3
# coding: utf-8
# Copyright 2013 Abram Hindle
#
# 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 ... |
zzj_monitor_rtmp.py | import os
import os.path as osp
import time
import multiprocessing as mp
from process_rtmp import *
max_q_size = 1
queues = [mp.Queue(maxsize=2) for i in range(0, max_q_size+1) ]
processes = []
processes.append(mp.Process(target=load_im, args=(queues[0],None)))
processes.append(mp.Process(target=first_layer_detection... |
custom.py | # pylint: disable=too-many-lines
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# -----------------------------------... |
prepare_data.py | import os
import os.path
import argparse
from multiprocessing import Process
import cv2
# this function makes a directory
def make_dir(path):
if not os.path.isdir(path):
os.mkdir(path)
# this function processes the depth image
def process_depth(input_depth_path, output_depth_path):
depth = cv2.imread(... |
app_mt.py | '''
Copyright 2020 Xilinx Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distr... |
Client.py | import ssl, socket, threading
from Device import Device
from DataFormatter import Protocol_Receive, Protocol_Send
from Commands import CLI_Command_Handler
import Config
#Connects to the server on given ip/port and creates send thread. We also send initial data to the server (Name/type)
def Connect(host, port):
con... |
cpuinfo.py | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
# source: https://github.com/workhorsy/py-cpuinfo/blob/v4.0.0/cpuinfo/cpuinfo.py
# version: 4.0.0
# date: 2018-05-05
# Copyright (c) 2014-2018, Matthew Brennan Jones <matthew.brennan.jones@gmail.com>
# Py-cpuinfo gets CPU info with pure Python 2 & 3
# It uses the MIT Lice... |
es_index_listener.py | """\
Example.
%(prog)s production.ini
"""
from webtest import TestApp
from contentbase.storage import DBSession
import atexit
import datetime
import json
import logging
import os
import psycopg2
import select
import signal
import socket
import sqlalchemy.exc
import sys
import threading
import time
from urllib.p... |
autonomous_v9.py | '''
Attempt to incorporate ultrasonic sensor.
'''
import car
import cv2
import numpy as np
import os
import serial
import socket
import SocketServer
import threading
import time
from imutils.object_detection import non_max_suppression
from keras.layers import Dense, Activation
from keras.models import Sequential
imp... |
xs_detect_vitis.py | # Copyright 2019 Xilinx Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... |
test_distributed.py | # -*- coding: utf-8 -*-
# MegEngine is Licensed under the Apache License, Version 2.0 (the "License")
#
# Copyright (c) 2014-2020 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... |
fileStore.py | # Copyright (C) 2015-2018 Regents of the University of California
#
# 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... |
snippet.py | from bs4 import BeautifulSoup,SoupStrainer
import urllib.request
import colorama,re,queue,threading
from colorama import Fore
from urllib.parse import *
class check_link():
def __init__(self,address):
self.address=address
def check(self,address):
try:
req=urllib.request.R... |
Mikload.py | #ulimit -n 999999
#Made simply for Kowai
#Made by slumptheogod @telnut on instagram
#line 86 is where u can edit ranges in the script Loli
import threading, paramiko, random, socket, time, sys
paramiko.util.log_to_file("/dev/null")
blacklisted = ["127.0","10.0","192.168"] #You can these out add or whatev... |
example_SampleSplitter_bufferhandling.py | # -*- coding: utf-8 -*-
#pylint: disable-msg=E0611, E1101, C0103, R0901, R0902, R0903, R0904, W0232
#------------------------------------------------------------------------------
# Copyright (c) 2007-2021, Acoular Development Team.
#------------------------------------------------------------------------------
"""
Thi... |
run.py | import base64
import datetime
import io
import json
import re
import socket
import sys
import threading
import zlib
from collections import defaultdict
from configparser import ConfigParser
from pathlib import Path
from socketserver import StreamRequestHandler
from socketserver import ThreadingTCPServer
from typing imp... |
hub.py | import requests
import os
import threading
import binascii
import time
import sys
import logbook
logger = logbook.Logger(__name__)
class HubConn:
def __init__(self, host, port, username=None, password=None, poll_time=1, timeout=0.1):
self._host = host
self._port = port
self._username = use... |
helpers.py | from LSP.plugin.core.typing import Any, Callable, Dict, List, Optional, Tuple
import os
import re
import sublime
import subprocess
import threading
StringCallback = Callable[[str], None]
SemanticVersion = Tuple[int, int, int]
def run_command_sync(
args: List[str], cwd: Optional[str] = None, extra_env: Optional[D... |
web.py | #!/usr/bin/env python3
from random import random
import threading
from flask import Flask
from flask import redirect
from flask import render_template
from flask import request
from flask import session
from flask import url_for
import pyotp
server_results = {}
def view():
if request.form:
if request.... |
gatosratones.py | import threading
import time
ratones = 0
mutex = threading.Semaphore(1)
plato_disponible = threading.Semaphore(1)
torniquete = threading.Semaphore(1)
def gato(num):
global ratones
print "El gato %d esta en la casa" % num
torniquete.acquire()
if ratones >= 1:
print "Hay %d ratones en la casa!" ... |
logger.py | import collections, threading, traceback
import paho.mqtt.client as mqtt
try:
# Transitional fix for breaking change in LTR559
from ltr559 import LTR559
ltr559 = LTR559()
except ImportError:
import ltr559
from bme280 import BME280
from pms5003 import PMS5003
from enviroplus import gas
class EnvLogg... |
test_io.py | """Unit tests for the io module."""
# Tests of io are scattered over the test suite:
# * test_bufio - tests file buffering
# * test_memoryio - tests BytesIO and StringIO
# * test_fileio - tests FileIO
# * test_file - tests the file interface
# * test_io - tests everything else in the io module
# * test_univnewlines - ... |
screenutils.py | #!/usr/bin/env python
# -*- coding:utf-8 -*-
# Note: this may not work with bpython, use python 2.6 or upper
# Author: Christophe Narbonne
# Contrib: Alexis Metaireau
from subprocess import getoutput
from multiprocessing import Process
from os import system
from time import sleep
def list_screens():
"""List all t... |
coap.py | import logging.config
import random
import socket
import struct
import threading
import os
from coapthon import defines
from coapthon.layers.blocklayer import BlockLayer
from coapthon.layers.cachelayer import CacheLayer
from coapthon.layers.forwardLayer import ForwardLayer
from coapthon.layers.messagelayer import Mes... |
interact.py | import multiprocessing
import os
import sys
import threading
import time
import types
import colorama
import cv2
import numpy as np
from tqdm import tqdm
from core import stdex
is_colab = 'COLAB_GPU' in os.environ # Check if we are in a Google Colab environment
yn_str = {True:'y',False:'n'}
class InteractBase(obj... |
elevator_manager.py | from serial.serialutil import EIGHTBITS
import serial.tools.list_ports
import serial #pyserial
from time import time, sleep
from cobs import cobs # for encoding
import threading
BAUDRATE = 9600
ARDUINO_COUNT = 2
SERVER_COUNT = 2
ELEVATOR_COUNT = 2
QUEUE_SIZE ... |
pipeline.py | import os
import threading as th
from collections import OrderedDict as OrdD
from queue import Queue
from time import sleep
from typing import Dict, List, Optional, OrderedDict, Tuple
import numpy as np
import torch as pt
from ._logging import get_logger
from ._utils import get_tf_device
from .custom_types import Cac... |
task.py | """ Backend task management support """
import itertools
import json
import logging
import os
import sys
import re
from enum import Enum
from tempfile import gettempdir
from multiprocessing import RLock
from pathlib2 import Path
from threading import Thread
from typing import Optional, Any, Sequence, Callable, Mapping,... |
start_net_and_sensor.py | # coding=utf-8
import os, sys, pdb
from threading import Thread, Lock, Condition
topo_path = os.path.abspath(os.path.join('..', '..', 'Topology'))
sen_path = os.path.abspath(os.path.join('..', '..', 'Sensor'))
blk_path = os.path.abspath(os.path.join('..', '..', 'Blockchain'))
sys.path.insert(0, topo_path)
sys.path.... |
gui.py | import eel
import os
import battlecode_cli as cli
import threading
import sys
import json
import signal
import psutil
import player_plain
import battlecode as bc
target_dir = os.path.abspath(os.path.dirname(__file__))
print('Moving into', target_dir)
os.chdir(target_dir)
options = {'host':'0.0.0.0', 'port':6147, 'mod... |
conv_net_sentence2_parallel.py | """
Sample code for
Convolutional Neural Networks for Sentence Classification
http://arxiv.org/pdf/1408.5882v2.pdf
Much of the code is modified from
- deeplearning.net (for ConvNet classes)
- https://github.com/mdenil/dropout (for dropout)
- https://groups.google.com/forum/#!topic/pylearn-dev/3QbKtCumAW4 (for Adadelta... |
globus_https.py |
import os
import time
import requests
import tempfile
import threading
from queue import Queue
class GlobusHttpsDownloader:
def __init__(self, download_type="file", in_tmpdir=False):
self.download_type = download_type
self.orig_dir = os.getcwd()
if in_tmpdir:
self.new_dir = ... |
miniterm.py | #!/home/Prinzessin/mesh/zucc/bin/python3
#
# Very simple serial terminal
#
# This file is part of pySerial. https://github.com/pyserial/pyserial
# (C)2002-2015 Chris Liechti <cliechti@gmx.net>
#
# SPDX-License-Identifier: BSD-3-Clause
import codecs
import os
import sys
import threading
import serial
from serial.to... |
download.py | import threading
import cursor
from halo import Halo
from halo._utils import decode_utf_8_text
from ipywidgets.widgets import Output
from IPython.display import display
def download_file_from_google_drive(gid, destination):
import requests
GGL_URL = "https://docs.google.com/uc?export=download"
CHUNK_SIZE ... |
frontEnd.py | from __future__ import division
from random import random
from kivy.app import App
from kivy.lang import Builder
from kivy.uix.screenmanager import ScreenManager, Screen, FadeTransition
from kivy.uix.widget import Widget
from kivy.graphics import Line, Color, Ellipse
from kivy.uix.boxlayout import BoxLayout
from kivy.... |
serial_handler.py | """
SerialHandler class for PyGPSClient application
This handles all the serial i/o , threaded read process and direction to
the appropriate protocol handler
Created on 16 Sep 2020
:author: semuadmin
:copyright: SEMU Consulting © 2020
:license: BSD 3-Clause
"""
from io import BufferedReader
from threa... |
ArmoryQt.py | #! /usr/bin/python
# -*- coding: UTF-8 -*-
##############################################################################
# #
# Copyright (C) 2011-2015, Armory Technologies, Inc. #
# Distributed under the GNU Affero Gener... |
mult-processing.py | import os
from multiprocessing import Process
def run_proc(name):
print('child process {name} {pid} Running'.format(name=name, pid=os.getpid()))
if __name__ == '__main__':
print('Parent process {current_pid}'.format(current_pid=os.getpid()))
for i in range(5):
p = Process(target=run_proc, args=(st... |
VideoPlayer.py | import logging
import threading
import time
from Configuration import config
from Configuration import testMode
from features.GpioFeature import *
if not testMode:
from omxplayer import OMXPlayer
class VideoPlayer(GpioFeature):
# Path to video to play
path = config.get('VIDEO', 'PATH')
def __init__(... |
base_sensors.py | from time import sleep
import threading
import abc
import logging
class ServerMonSensor:
def __init__(self, channels, config) -> None:
self.channels = channels
sensor_thread = threading.Thread(target=self.run_sensor)
sensor_thread.start()
def run_sensor(self) -> None:
logging.... |
tasks.py | # -*- coding:utf-8 -*-
import logging
import threading
import time
logger = logging.getLogger("tasks.project")
class PeriodicCallback(object):
def __init__(self, callback, callback_time):
self.callback = callback
if callback_time <= 0:
raise ValueError("Periodic callback must have a p... |
HVAC2_newdata.py | """
Run a large number of simulations for the HVAC model.
Results from these simulations are reported in:
C. Campaigne, M. Balandat and L. Ratliff: Welfare Effects
of Dynamic Electricity Pricing. In preparation.
@author: Maximilian Balandat
@date Sep 23, 2017
"""
# import packages and set up things
import os
import m... |
gki.py | #!/usr/bin/env python3
# Ukljucivanje sistemskog modula
from sys import exit as greska
# Ukljucivanje grafickog modula
from tkinter import Tk, Frame, Menu, LabelFrame, \
Canvas, Button, Entry
# Ukljucivanje pomocnog modula za
# kutijice sa iskacucim porukama
from tkinter.messagebox ... |
test_threading.py | # Very rudimentary test of threading module
import test.test_support
from test.test_support import verbose
import random
import re
import sys
thread = test.test_support.import_module('thread')
threading = test.test_support.import_module('threading')
import time
import unittest
import weakref
import os
import subproces... |
hidapi_backend.py | # pyOCD debugger
# Copyright (c) 2006-2020 Arm Limited
# Copyright (c) 2021-2022 Chris Reed
# Copyright (c) 2022 Harper Weigle
# SPDX-License-Identifier: Apache-2.0
#
# 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 c... |
ib.py | import asyncio
import threading
from queue import Queue
from random import randint
from ibapi.client import EClient # type: ignore
from ibapi.wrapper import EWrapper # type: ignore
from ibapi.order import Order # type: ignore
from aat.exchange import Exchange
from aat.config import EventType, TradingType
from aat.... |
event.py | import time
import threading
from modules.base_module import Module
class_name = "Event"
class Event(Module):
prefix = "ev"
def __init__(self, server):
self.server = server
self.commands = {"get": self.get_events, "gse": self.get_self_event,
"crt": self.create_event,... |
_base.py | # Copyright (c) 2015-2020, Swiss Federal Institute of Technology (ETH Zurich)
# All rights reserved.
#
# 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... |
train_chart.py | #!/usr/bin/env python
import os
import json
import torch
import numpy as np
import queue
import pprint
import random
import argparse
import importlib
import threading
import traceback
from socket import error as SocketError
import errno
import re
from tqdm import tqdm
from utils import stdout_to_tqdm
from config impo... |
client.py | import collections
import json
import logging
import time
import weakref
from enum import Enum
from json import JSONEncoder
from threading import Thread
from typing import Deque, Dict, Iterable, Optional, Tuple, Type, Union
from .credentials import CertificateCredentials, Credentials
from .errors import ConnectionFail... |
tcp.py | """
TCP transport classes
Wire protocol: "len(payload) msgpack({'head': SOMEHEADER, 'body': SOMEBODY})"
"""
import errno
import logging
import os
import queue
import socket
import threading
import time
import traceback
import urllib.parse as urlparse
import weakref
import salt.crypt
import salt.exceptions
import s... |
32.multiprocessing_daemonprocess.py | import multiprocessing
import time
import sys
def daemon():
p = multiprocessing.current_process()
print('Starting:', p.name, p.pid)
sys.stdout.flush()
time.sleep(2)
print('Exiting :', p.name, p.pid)
sys.stdout.flush()
def non_daemon():
p = multiprocessing.current_process()
print('Sta... |
auth.py | """
Globus Auth Helpers.
"""
# A lot of this code is copied from the Globus Auth Example repo:
# https://github.com/globus/native-app-examples
import json
import stat
import queue
import functools
import threading
import webbrowser
from pathlib import Path
from http.server import HTTPServer, BaseHTTPRequestHandler
fro... |
pyminer.py | #!/usr/bin/python
#
# Copyright (c) 2011 The Bitcoin developers
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
import time
import json
import pprint
import hashlib
import struct
import re
import base64
import httplib
import... |
test_fx.py | # Owner(s): ["oncall: fx"]
import builtins
import contextlib
import copy
import functools
import inspect
import math
import numbers
import io
import operator
import os
import pickle
import sys
import torch
import traceback
import typing
import types
import warnings
import unittest
import torch.nn.utils._stateless as _... |
face2rec2.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... |
main.py | from __future__ import print_function
import argparse
import os
import sys
import torch
import torch.optim as optim
import torch.multiprocessing as mp
import torch.nn as nn
import torch.nn.functional as F
from envs import create_atari_env
from train import train
from test import test
from utils import build_model
imp... |
slow_post_client.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");... |
system_test.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... |
zeromq_consumer.py | # -*- coding: utf-8 -*-
# @Author : ydf
import os
import socket
import json
# import time
import zmq
import multiprocessing
from function_scheduling_distributed_framework.constant import BrokerEnum, ConcurrentModeEnum
from function_scheduling_distributed_framework.consumers.base_consumer import AbstractConsumer
from n... |
test_simple_rest_get_set.py | from contextlib import contextmanager
import requests
import sqlalchemy as sa
from sqlalchemy import exc
TEST_DB_NAME = 'test_rest_pgfire'
def get_test_config():
return {
"db": {
"db": TEST_DB_NAME,
"username": "postgres",
"port": 5432,
"password": "123456... |
hw7.py | from dominate import document
from dominate.tags import div, attr, p
from time import sleep
import socket
import threading
def create_doc(my_date = ""):
doc = document(title="My favorite page")
with doc:
with div():
attr(cls="body")
p("lorem ipsum")
p(f"{my_date}")
... |
main.py | import pdb
import time
import os
import subprocess
import re
import random
import json
import numpy as np
import glob
from tensorboard.backend.event_processing.event_accumulator import EventAccumulator
import socket
import argparse
import threading
import _thread
import signal
from datetime import datetime
import csv
f... |
ocr_asprise.py | #!/usr/bin/python
import os
import sys
import threading
import datetime
import logging
import os.path
from PyPDF2 import PdfFileWriter, PdfFileReader, PdfFileMerger
import traceback
from slugify import slugify
import subprocess
from PIL import Image
from asprise_ocr_api import *
import signal
import time
import random
... |
kernel-generator.py | #!/usr/bin/env python3
"""rocFFT kernel generator.
It accept two sub-commands:
1. list - lists files that will be generated
2. generate - generate them!
"""
import argparse
import collections
import functools
import itertools
import subprocess
import sys
import os
from copy import deepcopy
from pathlib import Path
... |
test_upload_url_concurrency.py | ######################################################################
#
# File: b2/account_info/test_upload_conncurrency.py
#
# Copyright 2018 Backblaze Inc. All Rights Reserved.
#
# License https://www.backblaze.com/using_b2_code.html
#
######################################################################
import os... |
pit-server.py | import Arena
from MCTS import MCTS
from chess.ChessGame import ChessGame, display
from chess.ChessPlayers import *
from chess.keras.NNet import NNetWrapper as NNet
import numpy as np
from utils import *
from flask import Flask, request, send_from_directory, send_file
from threading import Thread
import json, random, ... |
ui_bridge.py | """Bridge for connecting a UI instance to nvim."""
import sys
from threading import Semaphore, Thread
from traceback import format_exc
class UIBridge(object):
"""UIBridge class. Connects a Nvim instance to a UI class."""
def connect(self, nvim, ui, profile=None, notify=False):
"""Connect nvim and th... |
imgprocx.py | #!/usr/bin/python
from __future__ import division
import cv2
from cv2 import cv
from copy import copy
import numpy as np
import multiprocessing.dummy as mp
from multiprocessing import Lock
import sys
import math
import rospy
import roslib
import cv_bridge
from sensor_msgs.msg import Image
from numpy import dtype
cl... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.