source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
spacebrew.py | import websocket
import threading
import json
import logging
import time
class Spacebrew(object):
# Define any runtime errors we'll need
class ConfigurationError(Exception):
def __init__(self, brew, explanation):
self.brew = brew
self.explanation = explanation
def __str__(self):
return repr(self.explan... |
_channel.py | # Copyright 2016, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... |
supervisor.py | from typing import Tuple
import multiprocessing
from pyacyclicnet.core.processes.channel import Channel
from pyacyclicnet.core.types.enums import ProcessType, ProcessStrategies, ProcessRestart, ProcessSpecification
from pyacyclicnet.core.types.errors import ProcessLabelNotFound, ProcessLabelInvalid
from pyacyclicnet.c... |
PrefetchingIter.py | # --------------------------------------------------------
# Deep Iterative Matching Network
# Licensed under The Apache-2.0 License [see LICENSE for details]
# Written by Yi Li
# --------------------------------------------------------
from __future__ import print_function, division
import mxnet as mx
from mxnet.io im... |
scheduler_job.py | # -*- coding: utf-8 -*-
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
#... |
mul_lock.py | import threading
lock = threading.Lock()
count = 0
def count_fun():
global count
for _ in range(1000000):
with lock: # 在执行对公用变量操作时,加上锁,以此来保证线程的安全性
count += 1
threading_list = []
t1 = threading.Thread(target=count_fun)
t2 = threading.Thread(target=count_fun)
threading_list.append(t1)
t... |
client_1.py | from socket import *
from threading import Thread
import sys,tkinter, time
import RSA
def recevoir():
#Reçoit les messages.
message_list.insert(tkinter.END, "Bonjour! %s" % NOM)
message_list.insert(tkinter.END, " Vous êtes en ligne!")
while True:
try:
message = CLIENT.recv(BUFFER_SI... |
mock_web_api_server.py | import asyncio
import json
import logging
import re
import sys
import threading
import time
from http import HTTPStatus
from http.server import HTTPServer, SimpleHTTPRequestHandler
from multiprocessing.context import Process
from typing import Type
from unittest import TestCase
from urllib.parse import urlparse, parse_... |
child_process_executor.py | """Facilities for running arbitrary commands in child processes."""
import os
import queue
import sys
from abc import ABC, abstractmethod
from collections import namedtuple
from dagster import check
from dagster.seven import multiprocessing
from dagster.utils.error import serializable_error_info_from_exc_info
from da... |
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 selfdrive.swaglog import cloudlog, add_logentries_handler
from common.basedir import BASEDIR, PARAMS
from common.android import ANDROID
WEBCAM = os.getenv... |
captureMulVideo.py | import threading
import cv2
import time
import queue
#import socket
#sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
#sock.bind(('192.168.1.247',8000))
# url="rtsp://admin:admin12345678@192.168.1.13/Streaming/Channels/1"
class hkCamera(threading.Thread):
def __init__(self, queue, ip, username="admin",... |
gateway_tcp.py | """Implement a TCP gateway."""
import asyncio
import ipaddress
import logging
import select
import socket
import threading
import time
import serial.threaded
from getmac import get_mac_address
from mysensors import (BaseAsyncGateway, BaseMySensorsProtocol,
BaseTransportGateway, Message, Threadi... |
example2.py | # ch14/example2.py
import threading
import random
import time
def update():
global counter
with count_lock:
current_counter = counter # reading in shared resource
time.sleep(random.randint(0, 1)) # simulating heavy calculations
counter = current_counter + 1
counter = 0
count_lock = t... |
db_simpletest.py | #!/usr/bin/python
# Copyright (c) 2014 Adafruit Industries
# Author: Tony DiCola
#
# 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... |
microtvm_api_server.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... |
io.py | # Copyright (c) 2018 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... |
main.py | import threading
import time
import requests
import json
mutex = threading.Lock()
logidall = []
def login(username, pwd, appId):
reps = requests.post(r'http://api.hnscen.cn/mobile/api/login', {'username': username, "pwd": pwd}).text
logininfo = json.loads(reps)
return logininfo
def getuserinfo(auth_fi... |
clients_starter.py | from extra.lcp_client import BetweenLCPMessages, LCPMessages, LCPClient
from threading import Thread
from extra.lcp_config import LCPConfig
class ThreadLCP:
thread_started = False
@classmethod
def thread_lcp(cls):
if ThreadLCP.thread_started:
return
lcp_client = LCPClient()
... |
mriqc_run.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Author: oesteban
# @Date: 2015-11-19 16:44:27
"""
=====
MRIQC
=====
"""
from os import cpu_count
import logging
import gc
from pathlib import Path
import matplotlib
DSA_MESSAGE = """\
Anonymized quality metrics (IQMs) will be submitted to MRIQC's metrics repository. ... |
test_filters.py | ''' Some tests for filters '''
from __future__ import division, print_function, absolute_import
import sys
import numpy as np
from numpy.testing import (assert_equal, assert_allclose,
assert_array_equal, assert_almost_equal)
from pytest import raises as assert_raises
import scipy.ndimage a... |
argserver.py | """
The http-server
"""
import socketserver
import sys
import time
import threading
from datetime import datetime, timedelta
import http.server
from bson import objectid
import pymongo
import mace
from plugins import *
import Config
class HTTPServer(socketserver.ThreadingMixIn, http.server.HTTPServer):
"""
... |
MoveCursor.py | import pyautogui as move
from threading import Thread
from graphics import *
WIDTH = 350
HEIGHT = 350
TRIANGLE_SIZE = 50
class MoveCursor:
def __init__(self):
super().__init__()
self._direction_list = ["Up", "Right", "Down", "Left", "Select"]
self._current_dir_index = 3
self._comm... |
process_scenario.py | import copy
import logging
import os
import time
import traceback
from enum import Enum, unique
from multiprocessing import Semaphore
from multiprocessing.context import Process
from typing import Tuple, List
from commonroad.common.solution import PlanningProblemSolution, Solution, \
CommonRoadSolutionWriter
from ... |
mrn_trna_console_app.py | # |-----------------------------------------------------------------------------
# | This source code is provided under the Apache 2.0 license --
# | and is provided AS IS with no warranty or guarantee of fit for purpose. --
# | See the project's LICENSE.md for details. ... |
net_power.py | """Melody main orchestrator logic
.. moduleauthor:: Vignesh Babu <vig2208@gmail.com>, Rakesh Kumar (gopchandani@gmail.com)
"""
import datetime
import json
import kronos_functions
import subprocess
import sys
import os
import tempfile
import threading
import logging
import srcs.lib.defines as defines
from srcs.cybe... |
Optimiso fasta.py | #-v "final obostha.mp4"
from threading import Thread
import sys
import cv2
from queue import Queue
class FileVideoStream:
def __init__(self, path, queueSize=128):
# initialize the file video stream along with the boolean
#used to indicate if the thread should be stopped or not
self.stream =... |
index.py | from PIL import Image, ImageOps
import pytesseract
import re
import sentence_transformers
from sentence_transformers import SentenceTransformer, util
from pywinauto.application import Application
from pynput import keyboard
from pynput.keyboard import Key, Controller
import pywinauto
import sounddevice as sd
from scip... |
parallel_runner.py | from envs import REGISTRY as env_REGISTRY
from functools import partial
from components.episode_buffer import EpisodeBatch
from multiprocessing import Pipe, Process
import numpy as np
# Based (very) heavily on SubprocVecEnv from OpenAI Baselines
# https://github.com/openai/baselines/blob/master/baselines/common/vec_en... |
multi_inference_20200801212617.py | # coding=utf-8
import os
import cv2
import sys
import pdb
import subprocess
import multiprocessing
import inference_utils
import common
def single_process(index, task, gpu):
print(("任务%d处理%d张图片" % (index, len(task))))
# 写文件
filename = inference_utils.dump_testfile(task, index)
out_str = subproces... |
distiller.py | #!/usr/bin/python
import beanstalkc
import sys
import threading
from time import sleep
from server.inserter import Inserter
from server.preprocess import TraceProcessor
from server.reducer import TraceReducer
from utils.config_import import DistillerConfig
def check_beanstalk():
try:
beanstalkc.Connectio... |
test_basics.py | import unittest
import logging
import redique, time
import threading
logging.basicConfig(level=logging.DEBUG)
class SampleBackend(object):
def add(self, x, y):
return x+y
def concat(self, str1, str2):
return "%s%s" % (str1, str2)
def getval(self):
return 66
def fa... |
manage.py | #!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
from multiprocessing import Process
import run
def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'monitoring.settings')
try:
from django.core.management import execute_from_command_line
... |
logwidget.pyw | #!/bin/python3
# -*- coding: utf-8 -*-
# References:
# https://gist.github.com/moshekaplan/c425f861de7bbf28ef06
# https://www.iditect.com/how-to/53371117.html
# https://beenje.github.io/blog/posts/logging-to-a-tkinter-scrolledtext-widget/
# https://stackoverflow.com/questions/13318742/python-logging-to-tkinter-text-wi... |
kb_escherServer.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import datetime
import json
import os
import random as _random
import sys
import traceback
from getopt import getopt, GetoptError
from multiprocessing import Process
from os import environ
from wsgiref.simple_server import make_server
import requests as _requests
from json... |
visual.py | # Copyright (c) 2020 Max Planck Gesellschaft
from baselines.common import Dataset, explained_variance, fmt_row, zipsame
from baselines import logger
import baselines.common.tf_util as U
import tensorflow as tf, numpy as np
import time
from baselines.common.mpi_adam import MpiAdam
from baselines.common.mpi_moments impo... |
__init__.py | import sys
import webview
import threading
class App:
def create_app(self):
"""Create the app from Blueprints"""
from flask import Flask
app = Flask(__name__)
from dc.views.users import user_bp
# from fup.views.commun import comm
... |
test_selenium.py | import re
import threading
import time
import unittest
from selenium import webdriver
from app import create_app, db
from app.models import Role, User, Post
class SeleniumTestCase(unittest.TestCase):
client = None
@classmethod
def setUpClass(cls):
# start Chrome
try:
chrom... |
tests.py | import json
import logging
import multiprocessing
import os
import re
import time
from contextlib import redirect_stderr
from io import StringIO
from multiprocessing import Process, Value
from unittest import mock
import websocket
from envyaml import EnvYAML
from rembrain_robot_framework import RobotDispatcher
from r... |
test_api.py | """
mbed SDK
Copyright (c) 2011-2014 ARM 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 License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in wr... |
filewriter.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright 2020 by Murray Altheim. All rights reserved. This file is part of
# the Robot Operating System project and is released under the "Apache Licence,
# Version 2.0". Please see the LICENSE file included as part of this package.
#
# author: Murray Altheim
# cre... |
sender.py | #!/usr/bin/python
# This file is part of the MAVLink Router project
#
# Copyright (C) 2017 Intel 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
#
# ht... |
c4ntf.py | #! python
# -*- coding: utf-8 -*-
"""tem13 extended notify module
Author: Kazuya O'moto <komoto@jeol.co.jp>
"""
import time
import struct
import socket
import threading
HOST = "172.17.41.1"
PORT = 2010
STREAM = None
TIMEOUT = 4
def open():
global STREAM
host = HOST
port = PORT
if not STREAM:
... |
udp_bouncer.py | # Copyright 1996-2021 Cyberbotics 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 in... |
installwizard.py |
from functools import partial
import threading
from kivy.app import App
from kivy.clock import Clock
from kivy.lang import Builder
from kivy.properties import ObjectProperty, StringProperty, OptionProperty
from kivy.core.window import Window
from kivy.uix.button import Button
from kivy.utils import platform
from kivy... |
coref_model_raw.py | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
#-*-encoding:utf-8-*-
import os
import operator
import random
import math
import json
import threading
import numpy as np
import tensorflow as tf
import tensorflow_hub as hub
import h5py
import util
import cor... |
__init__.py | """
Queue for running deferred code via plugins.
"""
import os, sys, logging, threading
from Queue import Queue, Empty
from galaxy import model
from galaxy.util.bunch import Bunch
log = logging.getLogger( __name__ )
class DeferredJobQueue( object ):
job_states = Bunch( READY = 'ready',
WA... |
endClient.py | import socket
import os
import threading
import hashlib
from Crypto import Random
import Crypto.Cipher.AES as AES
from Crypto.PublicKey import RSA
import signal
from lazyme.string import color_print
def RemovePaadding(s):
return s.replace(' ','')
def Padding(s):
return s + ((16 - len(s) % 16) * ' ')
def ... |
Server.py | import socket
import os
import sys
import time
import threading
import select
from getpass import getpass
from Crypto import Random
from Crypto.Cipher import AES
from tinydb import TinyDB, Query
ADMIN_PASSWORD = ""
HOST = socket.gethostbyname(socket.gethostname())
PORT = 9999
MAX_CLIENTS = 2
BUFFER_SIZE = 4096
socket... |
nanny.py | from __future__ import print_function, division, absolute_import
from datetime import timedelta
import logging
from multiprocessing.queues import Empty
import os
import psutil
import shutil
import threading
from tornado import gen
from tornado.ioloop import IOLoop, TimeoutError
from tornado.locks import Event
from .... |
wmitest.py | """Unit tests for WMI modules
Some tests are optional, since they rely on remote machines and
usernames / passwords. To enable these, copy wmitest.master.ini
to wmitest.ini and set the parameters you have available.
The watcher tests spawn temporary processes and temporary
logical drives. These may get left behind.
"... |
ploter.py | import numpy as np
import matplotlib.pyplot as plt
from matplotlib.ticker import MultipleLocator, FormatStrFormatter
import multiprocessing
import time
class ploter:
def __init__(self, num_wind, num_point):
self.num_wind = num_wind
self.num_point = num_point
self._xlabel = ran... |
io.py | # Copyright (c) 2018 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... |
core.py | """
Progress bar implementation.
quo v2021.3
"""
import os
import datetime
import functools
import signal
import threading
import traceback
from asyncio import get_event_loop, new_event_loop, set_event_loop
from typing import (
Generic,
Iterable,
List,
Optional,
Sequence,
Sized,
TextIO,
... |
simulation_server.py | #!/usr/bin/env python
# Copyright 1996-2019 Cyberbotics 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 applica... |
bot.py | from threading import Thread, Lock
from enum import Enum
# Keyboard inputs and timing
from time import time
import pyautogui
# Custom librairies
from position import Direction, translate, getKey, getDirection
from a_star.path_finder import PathFinder
class BotState(Enum):
COMPUTE_NEXT_MOVE = 0,
WAIT_NEXT_BE... |
test__ssl.py | from gevent import monkey; monkey.patch_all()
import os
import sys
import socket
import greentest
# Be careful not to have TestTCP as a bare attribute in this module,
# even aliased, to avoid running duplicate tests
import test__socket
import ssl
class TestSSL(test__socket.TestTCP):
certfile = os.path.join(os.pa... |
utils.py | import os
import tempfile
import traceback
from threading import Thread
from easelenium.ui.file_utils import save_file
from easelenium.ui.parser.parsed_class import ParsedClass
from wx import ALL, EXPAND
FLAG_ALL_AND_EXPAND = ALL | EXPAND
def run_in_separate_thread(target, name=None, args=(), kwargs=None):
thre... |
nogil.py | #!/usr/bin/env python
from __future__ import print_function, division, absolute_import
import math
import threading
from timeit import repeat
import numpy as np
from numba import jit
nthreads = 4
size = 1e6
def func_np(a, b):
"""
Control function using Numpy.
"""
return np.exp(2.1 * a + 3.2 * b)
@j... |
tracing_test.py | # Copyright 2019, The TensorFlow Federated Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... |
map_test.py | # Copyright 2017 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... |
DataListener.py | """
Created on 23.11.2017
updated on 19.01.2020
@author: Florian Gleixner
@Updater: Inonoob
@license: pylarexx is licensed under the Apache License, version 2, see License.txt
DataListener Objects can be added to a Logger instance by configuration of "output".
DataListener get all values from the Sensor instances th... |
_export.py | #!/usr/bin/env python
# Copyright 2018 RebirthDB
#
# 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... |
test_grpc_server_registry.py | import sys
import threading
import time
import pytest
from dagster import file_relative_path, pipeline, repository
from dagster.core.errors import DagsterUserCodeProcessError
from dagster.core.host_representation.grpc_server_registry import ProcessGrpcServerRegistry
from dagster.core.host_representation.origin import ... |
acilbot.py | # -*- coding: utf-8 -*-
import LINETCR
from LINETCR.lib.curve.ttypes import *
from datetime import datetime
import time,random,sys,re,os,json,subprocess,codecs,threading,glob
cl = LINETCR.LINE()
cl.login(token="EmLrQghnrYdXWnHQZsm6.bOvOGCf2RHfeZhv4yDfqvG.LaP0K9Pj1X4spyPVL5MdTl7COZgUhMNZXATZ6ukWA+w=")
cl.loginResult(... |
keep_alive.py | from flask import Flask
from threading import Thread
app = Flask('')
@app.route('/')
def main():
return 'RKS is Online and Working Perfectly'
def run():
app.run(host="0.0.0.0", port=8080)
def keep_alive():
server = Thread(target=run)
server.start() |
dispatcher.py | """GRPC client.
Implements loading and execution of Python workers.
"""
import asyncio
import concurrent.futures
import logging
import queue
import threading
import traceback
import grpc
from . import bindings
from . import functions
from . import loader
from . import protos
class DispatcherMeta(type):
__cur... |
c-realV2.py | #!/usr/bin/python3
# -*- coding: utf-8 -*-
"""
MIT License
Copyright (c) 2020 - 2021
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
t... |
connection.py | # -*- coding: utf-8 -*-
# ------------------------------------------------------------------------------
#
# Copyright 2018-2019 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... |
SentenceTransformer.py | import json
import logging
import os
import shutil
from collections import OrderedDict
from typing import List, Dict, Tuple, Iterable, Type, Union
from zipfile import ZipFile
import requests
import numpy as np
import transformers
import torch
from numpy import ndarray
from torch import nn, Tensor, device
from torch.opt... |
analyze_suspend.py | #!/usr/bin/python
#
# Tool for analyzing suspend/resume timing
# Copyright (c) 2013, Intel Corporation.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms and conditions of the GNU General Public License,
# version 2, as published by the Free Software Foundation.
#
# This prog... |
py_thread_process_profile.py | #coding=utf-8
'''
ref https://segmentfault.com/a/1190000007495352
1. much cpu --- use multi process, not others
2. much io --- use multi process, not others
3. much net --- use multi thread first
what is different :
1. pure python code and python+c is different, in python+c thread pool is usefull
'''
from __f... |
cpu_test.py | import inspect
import os
import sys
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))))
import threading
import socket
import time
import psutil
from prometheus_client import start_http_server, Gauge, registry, MetricsHandler
start_http_server(8000)
def gather_d... |
runner.py | #!/usr/bin/env python2
# Copyright 2010 The Emscripten Authors. All rights reserved.
# Emscripten is available under two separate licenses, the MIT license and the
# University of Illinois/NCSA Open Source License. Both these licenses can be
# found in the LICENSE file.
"""This is the Emscripten test runner. To run ... |
Utl.py | import copy
import random
import threading
class Core:
def color_picker(self, is_random, index, color_set):
if is_random:
selected_id = int(random.uniform(0, len(color_set)))
selected = color_set[selected_id]
del color_set[selected_id]
return selected
... |
camera.py | import logging
import threading
import time
import numpy as np
import picamera
from picamera.array import PiRGBArray
from config import Config
logger = logging.getLogger(__name__)
class Camera:
"""
Camera provide entry for get camera frames with formats of BGR numpy ndarray
and raw jepg.
"""
... |
runtime.py | from __future__ import annotations
from dataclasses import *
from typing import *
import json
import os
import re
import signal
import sys
import threading
import traceback
from collections import defaultdict
from contextlib import contextmanager
from datetime import datetime, timedelta
from queue import Queue
from t... |
base_camera.py | import time
import threading
try:
from greenlet import getcurrent as get_ident
except ImportError:
try:
from thread import get_ident
except ImportError:
from _thread import get_ident
class CameraEvent(object):
"""An Event-like class that signals all active clients when a new frame is
... |
testing.py | import datetime
import rejson
import numpy as np
import random
import string
from matplotlib import pyplot as plt
import multiprocessing
rejson_client = rejson.Client(host='localhost', port=6379, decode_responses=True)
def generate_data(format='string', strlen=100, b=0, kb=0, mb=0):
date_string = str(datetime.da... |
Twitch.py | # coding: utf-8
import time
import logging
import asyncio
import threading
import functools
import common.tools as tools
from common.service import *
logger = logging.getLogger(__name__)
import twitchio
from twitchio.ext import commands
@tools.decorate_all_methods(tools.catch_exception(logger=logger))
class Main(Servi... |
installwizard.py | # Copyright (C) 2018 The Electrum developers
# Distributed under the MIT software license, see the accompanying
# file LICENCE or http://www.opensource.org/licenses/mit-license.php
import os
import sys
import threading
import traceback
from typing import Tuple, List, Callable, NamedTuple, Optional
from PyQt5.QtCore i... |
console_script.py | import pkg_resources
import log as log
from library.exception import ParseException
import threading
import sys
try:
FFW_VERSION = pkg_resources.get_distribution("muddy").version
except pkg_resources.DistributionNotFound:
FFW_VERSION = "dev"
def console_entry():
"""If come from console entry point"""
... |
AlembicSceneTest.py | ##########################################################################
#
# Copyright (c) 2017, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistribu... |
utils.py | import itertools
import torch
import torch.nn as nn
import numpy as np
from torchvision.ops import nms
import os
import pycuda.driver as cuda
import pycuda.autoinit
import tensorrt as trt
from threading import Thread
import time
import cv2
import random
EXPLICIT_BATCH = 1 << (int)(trt.NetworkDefinitionCreationFlag... |
WebSocketServer.py | import errno
import socket
import threading
import hashlib
import base64
import logging
from .DataFrameFormat import *
from .ServerException import *
class WebSocketServer:
_SEC_KEY = "258EAFA5-E914-47DA-95CA-C5AB0DC85B11"
_HANDKSHAKE_RESP = (
"HTTP/1.1 101 Switching Protocols\r\n"
"Upgrade: ... |
conftest.py | # Copyright 2020 Petuum, 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... |
Internal_MManager.py | import os
import time
import threading
import marshal
import types
from queue import Queue
from subprocess import Popen, PIPE, STDOUT, call
from distutils.dir_util import copy_tree
import base64
#WRITES READS SERVER FUNCTIONS
def Server_Read(r_q,w_q,server):
global message
while True:
#GETS SERVER MES... |
__init__.py | # Copyright 2017 Mycroft AI 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 writin... |
strong components.py | import sys
import time
import threading
#import resource
# Increase recursion depth and stack size
sys.setrecursionlimit(100000)
#resource.setrlimit(resource.RLIMIT_STACK, (resource.RLIM_INFINITY, resource.RLIM_INFINITY))
lista = "D:/Workbench/Online Courses/Design and Analysis of Algorithms, Part 1/Progr... |
tpool.py | # Copyright (c) 2007-2009, Linden Research, Inc.
# Copyright (c) 2007, IBM 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 License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless re... |
open_git_repo_on_web.py | from pathlib import Path
from typing import Any, Callable, Optional, Tuple, Union
import re
import shlex
import shutil
import sublime
import sublime_plugin
import subprocess
import threading
PathLike = Union[str, Path]
class GitException(Exception):
"""Exception raised when something went wrong for git"""
d... |
optimizer.py | import logging
import threading
import cma
import numpy as np
from numpy.linalg import norm
import math
import os
import glob
def optimizer_worker(opt):
opt.solve()
class Optimizer(object):
def __init__(self, sim, motion):
self.logger = logging.getLogger(__name__)
self.sim = sim
self... |
get_functions.py | #!/usr/bin/python3
# -*- coding: utf-8 -*-
import logging, re, json, requests
from utils import (
load,
messages as _msg,
restricted as _r,
get_set as _set,
task_box as _box,
task_payload as _payload,
callback_stage as _stage,
__version__,
)
from workflow import copy_workflow as _copy
f... |
async_producer_threading_consumer.py | """
w1thermsensor
~~~~~~~~~~~~~
A Python package and CLI tool to work with w1 temperature sensors.
:copyright: (c) 2020 by Timo Furrer <tuxtimo@gmail.com>
:license: MIT, see LICENSE for more details.
"""
# NOTE(TF):
# This examples uses async producers which read
# temperature from sensors and a threaded consumer
# ... |
app.py | import os
from flask import Flask, flash, request, redirect, url_for, jsonify
from werkzeug.utils import secure_filename
from flask import send_from_directory
from flask_cors import CORS, cross_origin
import json
import zipfile
from augmentations import *
from sample import *
from modelStats import *
from train import ... |
webhost.py |
def find_chromium():
import shutil
import platform
import os
uname = platform.system()
if uname == 'Windows':
executables = ['chrome.exe', 'msedge.exe']
prefixes = [
os.getenv('ProgramFiles', os.devnull),
os.getenv('ProgramFiles(X86)', os.devnull),
... |
test_futures.py | import sys
import time
import pytest
import threading
from loky._base import (PENDING, RUNNING, CANCELLED, CANCELLED_AND_NOTIFIED,
FINISHED, Future)
from .utils import captured_stderr
if sys.version_info[:2] < (3, 3):
import loky._base as futures
else:
# This makes sure of the compatibi... |
upload_test.py | # !/usr/bin/env python
# -*- coding: utf-8 -*-
"""
@author: mango
@contact: w4n9@sina.com
@create: 16/2/15
上传测试脚本
"""
__author__ = "mango"
__version__ = "0.1"
import os
import sys
import uuid
import time
from multiprocessing import Process, Manager
import requests
from prettytable import PrettyTable
class FDFSUp... |
main_solo12_replay.py | # coding: utf8
import os
import sys
sys.path.insert(0, './solopython')
import threading
from Controller import Controller
import numpy as np
import argparse
from LoggerSensors import LoggerSensors
from LoggerControl import LoggerControl
import libquadruped_reactive_walking as lqrw
params = lqrw.Params() # Object t... |
httpd.py | """
This file is part of dispy project.
See http://dispy.sourceforge.net for details.
"""
import sys
import os
import threading
import json
import cgi
import time
import ssl
import re
import functools
import copy
import traceback
import dispy
from dispy import DispyJob, DispyNodeAvailInfo, logger
import dispy.config
... |
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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.