source
stringlengths
3
86
python
stringlengths
75
1.04M
_display.py
""" Copyright (c) 2019 The Cereja Project 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, publish, distrib...
pricer.py
# -*- coding: utf-8 -*- """ Created on Tue May 29 19:34:42 2018 @author: Branson """ import argparse from threading import Thread import zmq import BATrader as ba import pandas as pd from BATrader.market.MarketReader import market_time_keeper, market_time_hk_futures, currentTime, currentTimeSecond, is_stock from BATr...
web.py
"""website module for the bot""" import threading import flask import config app = flask.Flask("BatChest") @app.route("/") def index(): """bot's index page""" return flask.render_template("index.html") server = threading.Thread(target=app.run, kwargs={"host": config.HOST, "port": config.PORT}) server.daem...
atualizar.py
from tkinter import Toplevel from tkinter import messagebox from tkinter import Frame from tkinter import Button from tkinter import Message from tkinter import Label from tkinter import FLAT from tkinter import NSEW from webbrowser import open as webbrowser_open from threading import Thread from datetime import dateti...
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...
waypoints_yz_circle.py
#!/usr/bin/env python import rospy import tf from crazyflie_driver.msg import Hover from std_msgs.msg import Empty # from geometry_msgs.msg import PoseStamped from crazyflie_driver.srv import UpdateParams from threading import Thread from vicon_bridge.srv import viconGrabPose class Crazyflie: def __init__(self, p...
data_utils.py
"""Utilities for file download and caching.""" from __future__ import absolute_import from __future__ import print_function import hashlib import multiprocessing import os import random import shutil import sys import tarfile import threading import time import zipfile from abc import abstractmethod from multiprocessi...
test_forward.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...
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....
execute.py
'''Implementation of L{TaskDispatcher.execute}. Normally there is no need to be imported directly by clients. ''' __all__ = ['ExecuteIterator'] import heapq import threading from copy import copy from itertools import takewhile, imap, starmap, islice, repeat from papyros.task import Task try: from Pyro.core import...
desicosST03.py
#!/usr/bin/env python from multiprocessing import Process, Manager, Value, Array,freeze_support import logging from threading import Thread import threading import thread import io import sys import PySide import time import sys import os import json #from PySide.QtCore import QRect, QMetaObject, QObject #from PySide.Q...
ui.py
import urwid from threading import Thread from asana_service import AsanaService from ui.task_list import MyTasks, TaskList from ui.task_details import TaskDetails class Ui(object): nav_stack = [] def __init__(self, asana_service, update): self.asana_service = asana_service self.update = upda...
create_and_run_compiler_gym_service.py
#! /usr/bin/env python3 # # Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. """An example CompilerGym service in python.""" import os import sys from concurrent import futures from multiproces...
DRipper.py
import os import random import socket import string import signal import sys import threading import time import urllib.request import subprocess import math from dataclasses import dataclass, field from datetime import datetime from optparse import OptionParser from os import urandom as randbytes from typing import Li...
send.py
from PyQt5.QtWidgets import QApplication, QMainWindow, QSizePolicy import xtd_ui import rospy from geometry_msgs.msg import Twist, PoseStamped, TwistStamped from std_msgs.msg import String from multiprocessing import Process,Queue from PyQt5.QtCore import * from receive import Ros2Gui from PIL import Image import rando...
tgsrepcrack.py
#!/usr/bin/env python3 -tt import kerberos from pyasn1.codec.ber import encoder, decoder from multiprocessing import Process, JoinableQueue, Manager import glob wordlist = JoinableQueue() enctickets = None #ENDOFQUEUE = 'ENDOFQUEUEENDOFQUEUEENDOFQUEUE' def loadwordlist(wordlistfile, wordlistqueue, threadcount): wi...
cli.py
import os from threading import Thread import click from release_exporter.exceptions import UnknownRepo from release_exporter.formatter import github from release_exporter.formatter import gitlab from release_exporter.utils import get_repo_url_info, check_version, Init from release_exporter.version import __version__...
run.py
import os import gym import time import torch import numpy as np import numpy.random as rd from copy import deepcopy from elegantrl.agent import ReplayBuffer, ReplayBufferMP from elegantrl.env import PreprocessEnv """[ElegantRL](https://github.com/AI4Finance-LLC/ElegantRL)""" class Arguments: def __init__(self, ...
browser_integration.py
import sublime import sublime_plugin import os import sys import threading import time sys.path.append(os.path.dirname(__file__)) from .browser import Browser SETTINGS_FILE = 'BrowserIntegration.sublime-settings' log_file = '/var/log/sublime-browser-integration.log' def require_browser(function): def wrapper(...
filevideostream.py
## From the imutils package ## https://github.com/PyImageSearch/imutils/blob/c12f15391fcc945d0d644b85194b8c044a392e0a/imutils/video/filevideostream.py ## Minor modifications by Tapani Hopkins ## This is basically the same as in the package, except for two changes: ## - bug fix ('break' in line 80) ## - option to only p...
app.py
#!/usr/bin/env python3 import time import threading import os import datetime import markovify import re from src.config import BotConfig from src.ActivityPubTool import get_account_info, interact_activitypub_api, post_activity from src.exportModel import generateAndExport def worker(bot_config: BotConfig): # 学習...
run.py
import threading from db_worker import * from db_connect import * TRACKERS = [] def check_log_size(): while True: if (os.path.getsize('src/logs/history.log')/1024) > 1024*10*10: open('src/logs/history.log', 'w').close() if (os.path.getsize('src/logs/debug.log')/1024) > 1024*10*10: open('src/logs/debug....
ve_dbus_service_async.py
import threading from gi.repository import GLib import dbus from dbus.mainloop.glib import DBusGMainLoop from signals import DbusSignal from os import environ from os.path import dirname, join from sys import path path.insert(1, join(dirname(__file__), 'ext', 'velib_python')) # noinspection PyUnresolvedReferences fro...
batoonet.py
from batoosprites import * from batoo import * from pygame import * import batoomaps import socket import threading from random import random, randint import time as tm import sys, os HOST = '143.248.2.116' PORT = 50000 DATA_SIZE = 128 class Batoo(object): display_size = ( 900, 720 ) size = ...
download_generation.py
import json import logging import multiprocessing import os from pathlib import Path from typing import Optional, Tuple, List import psutil as ps import re import shutil import subprocess import tempfile import time import traceback from datetime import datetime, timezone from ddtrace import tracer from ddtrace.ext i...
main.py
''' Created on 23/04/2016 @author: MARIANO ''' #!/usr/bin/python import paho.mqtt.client as paho import psutil import pywapi import signal import sys import time import socket import fcntl import struct import pyupm_i2clcd as lcd from threading import Thread from random import randint import plotly.p...
threading.py
import logging import threading import time def thread_function(name): logging.info("Thread %s: starting", name) time.sleep(2) logging.info("Thread %s: finishing", name) if __name__ == "__main__": format = "%(asctime)s: %(message)s" logging.basicConfig(format=format, level=logging.INFO, ...
apt_tdc_surface_consept.py
""" This is the main script for controlling the experiment. It contains the main control loop of experiment. """ import time import datetime import multiprocessing from multiprocessing.queues import Queue import threading import numpy as np # Serial ports and NI import serial.tools.list_ports import pyvisa as visa im...
test_smtp.py
"""integration tests for BridgeDB .""" from __future__ import print_function import smtplib import asyncore import threading import Queue import random import os from smtpd import SMTPServer from twisted.trial import unittest from twisted.trial.unittest import FailTest from twisted.trial.unittest import SkipTest f...
server.py
import socket import json import threading import sys import argparse import os from datetime import datetime from message import Message from streaming import createMsg, streamData, initializeAES, decryptMsg, returnVector from clientConnectionObj import ClientConnection import pyDHE import time serverDH = pyDHE.new()...
mtsleepF.py
from __future__ import with_statement __Author__ = "noduez" '''锁示例''' from atexit import register from random import randrange from threading import Thread, currentThread, Lock from time import sleep, ctime class CleanOutputSet(set): def __str__(self): return ','.join(x for x in self) loops = (randrange(...
test_nameregistry.py
from unittest import TestCase import time import threading from dogpile.core.nameregistry import NameRegistry import random import logging log = logging.getLogger(__name__) class NameRegistryTest(TestCase): def test_name_registry(self): success = [True] num_operations = [0] def create(id...
devicemanager.py
# -*- coding: UTF-8 -*- # # Tencent is pleased to support the open source community by making QTA available. # Copyright (C) 2016THL A29 Limited, a Tencent company. All rights reserved. # Licensed under the BSD 3-Clause License (the "License"); you may not use this # file except in compliance with the License. You may ...
dask_run.py
#!/usr/bin/env python import itertools import os import signal import socket import subprocess import sys import uuid from contextlib import contextmanager from functools import partial from threading import Thread import click from dask.distributed import Client, as_completed def timed_wait_proc(proc, timeout): ...
pkn.py
from __init__ import * import sys from threading import Thread from StartScreen.start_screen import StartScreen from GameScreen.game_screen import GameScreen from Options.options import Options from WaitingRoom.waiting_room import WaitingRoom from Results.results import Results from style_sheets import Theme class ...
node_base.py
# Copyright 2019 Google LLC # # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
models.py
import os import sqlite3 from multiprocessing import Process, Semaphore, Manager from Bio import Seq, SeqRecord, SeqIO from advntr.reference_vntr import ReferenceVNTR from advntr.vntr_annotation import get_gene_name_and_annotation_of_vntr, is_vntr_close_to_gene, get_genes_info from advntr import settings from advntr...
scanbackup_20210224150921.py
""" 1、文件到这里 一份给ES 一份给自己 新增ES旧索引入库 在继承原有功能的基础上 重构备份程序,按照数据内的 国家-当前时间(年-月-日) 如果按照数据内的时间的话也会面临和按国家端口备份的问题 不用再分端口了 create by judy 20201217 """ from pathlib import Path import threading import json from queue import Queue import traceback import datetime import time from shutil import copyfile import zipfile import shutil ...
redispy.py
import random import redis import threading import multiprocessing as mp import subprocess import time HOST = "localhost" PROB_GET = 0.8 SIZE_GET_KEYSPACE = 3750000 # 3.75 million SIZE_SET_KEYSPACE = 3000000 # 3 million BYTES = memoryview(b"0" * 3000) default_client = redis.Redis(HOST) def generate_key_set(): ...
test_naoqi_audio_source.py
import time import unittest from threading import Thread, Event import numpy as np from Queue import Queue from cltl.naoqi.audio_source import reframe, NAOqiMicrophone class DummySession: def service(self, *args): return DummyService() def registerService(self, *args): pass class DummySer...
chat_client_class.py
import time import socket import select import sys import json from chat_utils import * import client_state_machine as csm import threading import encrypt class Client: def __init__(self, args): self.peer = '' self.console_input = [] self.state = S_OFFLINE self.system_msg = '' ...
test.py
from ..src.dispatcher import DEFER import threading from tensorflow.python.keras.applications.resnet50 import ResNet50, preprocess_input, decode_predictions from tensorflow.python.keras.preprocessing import image import tensorflow as tf import numpy as np import queue import time numNodes = 8 computeNodes = ["IPs COMP...
composed_reader.py
#!/usr/bin/env python3 import logging import sys import threading from os.path import dirname, realpath sys.path.append(dirname(dirname(dirname(realpath(__file__))))) from logger.utils import formats # noqa: E402 from logger.readers.reader import Reader # noqa: E402 # How long to a reader thread should lie dormant...
rdd.py
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us...
walt_agent.py
# Copyright 2017 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import py_utils import optparse import threading from devil.android import device_utils from systrace import trace_result from systrace import tracing_agent...
client.py
import socket import errno import sys import time import threading from queue import Queue, PriorityQueue from tools import * class TCPClient(): def __init__(self, server_addr=('127.0.0.1', 5000), HEADER_LEN=10): self.send_queue = PriorityQueue() self.server_addr = server_addr self.HEADER...
athenad.py
#!/usr/bin/env python3 import base64 import hashlib import io import json import os import queue import random import select import socket import threading import time from collections import namedtuple from functools import partial from typing import Any import requests from jsonrpc import JSONRPCResponseManager, dis...
env_stock_papertrading.py
import datetime import threading from finrl.finrl_meta.data_processors.processor_alpaca import AlpacaProcessor import alpaca_trade_api as tradeapi import time import pandas as pd import numpy as np import torch import gym class AlpacaPaperTrading(): def __init__(self,ticker_list, time_interval, drl_lib, agent, cw...
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...
http_server.py
import time import logging import eventlet from eventlet import wsgi logging.basicConfig() logger = logging.getLogger(__name__) logger.setLevel(logging.DEBUG) # Monkey patch socket, time, select, threads eventlet.patcher.monkey_patch(all=False, socket=True, time=True, select=True, thread...
bot_client.py
import sys import logging import time import pinybot log = logging.getLogger(__name__) def main(): if pinybot.pinylib.CONFIG.AUTO_INFO: if len(pinybot.pinylib.CONFIG.ROOM_NAME) is not 0: # Handle automatic login with the information already provided. bot = pinybot.TinychatBot(roo...
main.py
# -*- coding: utf-8 -*- """ @Author : Fang Yao @Time : 2021/3/24 9:28 上午 @FileName: main.py @desc: 主程序入口文件 """ import re import os import random from collections import Counter import unicodedata from threading import Thread import cv2 from Levenshtein import ratio from PIL import Image from numpy import average,...
views.py
from django.http import FileResponse, StreamingHttpResponse from django.shortcuts import render from django.utils.encoding import escape_uri_path from tools.box.downloadBook.db.dbController import dbc from tools.box.audioProcess.formatConversion import transAudio import threading import pymysql import os # Create yo...
evaluation_worker.py
'''This module is responsible for launching evaluation jobs''' import argparse import json import logging import os import time from threading import Thread import rospy from rl_coach.base_parameters import TaskParameters from rl_coach.core_types import EnvironmentSteps from rl_coach.data_stores.data_store import Sync...
addRemoveBenchmark.py
import time; import subprocess; from threading import Thread; from Thesis.util.util import checkExitCodeOfProcess; from Thesis.ycsbClient.runMultipleYcsbClients import executeCommandOnYcsbNodes; from Thesis.plot.ParseYcsbTestResults import parseAndPlot; def runAddRemoveBenchmark(cluster, remoteYcsbNodes, ipNodeToRemo...
sleeSort.py
#!/usr/bin/env python3 import time import threading def sleep(i): time.sleep(i) print(i) def sleepSort(v): for i in range(len(v)): newThread = threading.Thread(target=sleep, args=(v[i],)) newThread.start() return None def main(): v = [5,2,6,1,4,3] sleepSort(v); if __name__ ...
run_vs_pass.py
# -*- coding: utf-8 -*- """ Example startup script to perform full quantization of a two qubit, one cavity Josephson circuit. The results are saved, printed, and nicely plotted. @author: Zlatko """ from pyEPR import ProjectInfo, DistributedAnalysis, QuantumAnalysis # 1. Project and design. Open link to HFSS control...
tweet_miner.py
import Queue import multiprocessing from threading import Thread from tweepy.streaming import StreamListener from tweepy import OAuthHandler from tweepy import Stream import unicodedata import json import os from src.common import LABELS, SENTENCES from src.features import build_features from src.models.algorithms.ne...
__init__.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # Han Xiao <artex.xh@gmail.com> <https://hanxiao.github.io> import sys import threading import time import uuid from collections import namedtuple import numpy as np import zmq from zmq.utils import jsonapi __all__ = ['__version__', 'BertClient'] # in the future client ...
test_server.py
import ctypes import logging import unittest from unittest import mock import snap7.error import snap7.server import snap7.types logging.basicConfig(level=logging.WARNING) class TestServer(unittest.TestCase): def setUp(self): self.server = snap7.server.Server() self.server.start(tcpport=1102) ...
build.py
#!/usr/bin/env python import os, sys import subprocess, threading import tempfile, shutil import argparse import json, ConfigParser import xml.etree.ElementTree as ET import zipfile import SimpleHTTPServer, SocketServer packageJson = json.load(open("package.json")) NAME = packageJson["id"] VERSION = packageJson["versi...
test_socket.py
import unittest from test import support import errno import io import itertools import socket import select import tempfile import time import traceback import queue import sys import os import array import platform import contextlib from weakref import proxy import signal import math import pickle import struct impo...
evaluate.py
from __future__ import absolute_import, division, print_function import os import shutil import sys import traceback from io import StringIO from itertools import product from multiprocessing import Process import numpy as np import tensorflow as tf from odin.bay.vi import Criticizer from odin.bay.vi.downstream_metr...
ipscanner.py
import multiprocessing from src.utils import get_gateway from scapy.all import * subdomain = get_gateway()[:len(get_gateway())-2] def check_ip(index_ip: int, queue): ip = subdomain + '.' + str(index_ip) resp, _ = srp(Ether(dst='ff:ff:ff:ff:ff:ff')/ARP(pdst=ip), timeout=4, retry=2) if resp: ...
tests.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...
test_collection.py
import numpy import pandas as pd import pytest from pymilvus import DataType from base.client_base import TestcaseBase from utils.util_log import test_log as log from common import common_func as cf from common import common_type as ct from common.common_type import CaseLabel, CheckTasks from utils.util_pymilvus impor...
subscreens.py
# subscreens.py # Classes that display game data to the user (or editor) # by Andrew Martin (2006) # # TODO: # [] Comment all classes # [] Rename members that don't adhere to style guidelines # [] Review algorithms to determine if there is a more pythonic way # [] Review classes included in module for relev...
connection.py
# -*- coding: utf-8 -*- # Copyright: (c) 2019, Jordan Borean (@jborean93) <jborean93@gmail.com> # MIT License (see LICENSE or https://opensource.org/licenses/MIT) from __future__ import division import binascii import hashlib import hmac import logging import math import os import struct import time import threading ...
peripheral.py
""" This example exhibits some of the functionality of a peripheral BLE device, such as reading, writing and notifying characteristics. This peripheral can be used with one of the central examples running on a separate nordic device, or can be run with the nRF Connect app to explore the contents of the service "...
xapp_frame.py
# ================================================================================== # Copyright (c) 2020 Nokia # Copyright (c) 2020 AT&T Intellectual Property. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You ...
issue_23395.py
#!/usr/bin/env python # https://bugs.python.org/issue23395 import signal, threading, thread, time signal.signal(signal.SIGINT, signal.SIG_DFL) # or SIG_IGN def thread_run(): # NOTE: This should interrupt the main thread w/o an error, but # We see an error (int not callable) thread.interrupt_main()...
actor_factory.py
#!/usr/bin/env python # # Copyright (c) 2020 Intel Corporation # # This work is licensed under the terms of the MIT license. # For a copy, see <https://opensource.org/licenses/MIT>. # import itertools try: import queue except ImportError: import Queue as queue import time from enum import Enum from threading i...
visualiser.py
#!/usr/bin/env python3 from GroupCode.monitor_interface import MonitorInterface from ui import VisualiserUI from threading import Thread, Semaphore from multiprocessing import Process, Array, Value class Visualiser(object): def __init__(self): self.ui = VisualiserUI() self.ui_thread = Process(targ...
app.py
import requests import itertools import os import flask from flask import Flask, render_template from flask import request, jsonify from GoogleNews import GoogleNews from datetime import datetime,timedelta import news import analysis from threading import Thread import numpy news_dic=dict() news_dic['n...
duet_test.py
# stdlib from multiprocessing import set_start_method import socket import sys import time from typing import Any from typing import Generator from typing import List # third party import pytest # syft absolute import syft as sy # syft relative from ...grid.duet.process_test import SyftTestProcess ts = pytest.impor...
train.py
#!/usr/bin/env python """Train models.""" import os import signal import torch import onmt.opts as opts import onmt.utils.distributed from onmt.utils.misc import set_random_seed from onmt.utils.logging import init_logger, logger from onmt.train_single import main as single_main from onmt.utils.parse import ArgumentPa...
image_pre_processing.py
import cv2 import numpy as np import threading from time import sleep def handleContrastEnlargement(img, height, width): Imax = img.max() Imin = img.min() g = np.zeros((height,width), np.uint8) print(g) for i in range(0, height): for j in range(0, width): g[i][j] = (...
__init__.py
""" Entry Points for Hyde Engine """ import imp import os import sys import shutil import thread import threading import subprocess from collections import defaultdict from datetime import datetime from Queue import Queue, Empty from threading import Thread, Event from django.conf import settings from django.core.m...
main.py
import sys import threading import xml.etree.ElementTree as ET from sty import fg import src INPUT_FILENAME = "" OUTPUT_FILENAME = "" def check_commandline_args(): global INPUT_FILENAME, OUTPUT_FILENAME if len(sys.argv) < 2: raise Exception(fg.red + "No filename specified, please add command-line a...
tello.py
from collections import namedtuple import socket from threading import Thread import queue from datetime import datetime import time import traceback Address = namedtuple('Address', 'ip, port') class LogItem(object): """ Log item. """ def __init__(self, command, id): """ Ctor. ...
DataCollection.py
''' Created on 21 Feb 2017 @author: jkiesele ''' #from tensorflow.contrib.labeled_tensor import batch #from builtins import list from __future__ import print_function from Weighter import Weighter from TrainData import TrainData, fileTimeOut #for convenience import logging from pdb import set_trace import copy usene...
Canvas.py
# Canvas module for simple drawing and mouse handling # Quintin Cutts # Richard Cziva Last modified 2017 ### -------------------------------------------------------- ### IF YOU JUST WANT TO KNOW WHAT FUNCTIONS ARE AVAILABLE ### THEN JUMP STRAIGHT TO THE END OF THIS CODE - YOU'LL ### FIND THE FULL LIST THERE. ### ...
server.py
# Copyright (c) 2016, Xilinx, 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: # # 1. Redistributions of source code must retain the above copyright notice, # this list of con...
APIAccessor.py
# -*- coding: utf-8 -*- import threading import time import requests BASE_URL = "http://cryptic-bayou-3624.herokuapp.com/api/" def _post_request(request, parameters): ExecuteConnectionOnThread(BASE_URL + request, parameters) #print request, requests.post(BASE_URL + request, parameters).text def new_or_updat...
__init__.py
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import print_function, unicode_literals import base64 import copy import contextlib import enum import functools import io import json import logging import os import re import threading import time from collections import defaultdict, namedtuple from typi...
movie.py
#A* ------------------------------------------------------------------- #B* This file contains source code for the PyMOL computer program #C* Copyright (c) Schrodinger, LLC. #D* ------------------------------------------------------------------- #E* It is unlawful to modify or remove this copyright notice. #F* --------...
gcsmessages.py
#!/usr/bin/python # -*- coding: utf-8 -*- """Process messages between GCSCommands and an interface.""" from logging import debug, error from threading import Lock, Thread import sys from time import time from pipython import gcserror from pipython.gcserror import GCSError # prevents cyclic import def endofanswer(an...
worker.py
from contextlib import contextmanager import atexit import faulthandler import hashlib import inspect import io import json import logging import os import redis import sys import threading import time import traceback from typing import Any, Callable, Dict, Iterator, List, Optional, Tuple, Union # Ray modules from ra...
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 - ...
main.py
import os import signal import subprocess import json import time from datetime import datetime import threading import django os.environ.setdefault("DJANGO_SETTINGS_MODULE", "gpu_tasker.settings") django.setup() from base.utils import get_admin_config from task.models import GPUTask from task.utils import run_task ...
keep_alive.py
from flask import Flask from threading import Thread app = Flask('') @app.route('/') def home(): return "Hello. I am alive!" def run(): app.run(host='0.0.0.0',port=8080) def keep_alive(): t = Thread(target=run) t.start()
tests.py
# -*- coding: utf-8 -*- # Unit and doctests for specific database backends. from __future__ import absolute_import, unicode_literals import datetime import threading from django.conf import settings from django.core.management.color import no_style from django.core.exceptions import ImproperlyConfigured from django.d...
wl_monitor.py
#!/usr/bin/python3 import sys import getopt import requests import time import threading import atexit import board import busio import digitalio import adafruit_character_lcd.character_lcd_rgb_i2c as character_lcd # Global variables rbl_index = 0 # Index for selecting a specific RBL object in the array rbl_number...
servers.py
""" Starting in CherryPy 3.1, cherrypy.server is implemented as an :ref:`Engine Plugin<plugins>`. It's an instance of :class:`cherrypy._cpserver.Server`, which is a subclass of :class:`cherrypy.process.servers.ServerAdapter`. The ``ServerAdapter`` class is designed to control other servers, as well. Multiple servers/p...
test_pdb.py
# A test suite for pdb; not very comprehensive at the moment. import doctest import os import pdb import sys import types import unittest import subprocess import textwrap from contextlib import ExitStack from io import StringIO from test import support # This little helper class is essential for testing pdb under do...
datasets_fortrain.py
# Dataset utils and dataloaders import glob import logging import math import os import random import shutil import time from itertools import repeat from multiprocessing.pool import ThreadPool from pathlib import Path from threading import Thread import cv2 import numpy as np import torch import torch.nn.functional ...
test_strategy.py
""" """ import threading import time import hiro from limits.limits import RateLimitItemPerSecond, RateLimitItemPerMinute from limits.storage import ( MemoryStorage, RedisStorage,MemcachedStorage, RedisSentinelStorage) from limits.strategies import ( MovingWindowRateLimiter, FixedWindowElasticExpiryR...
CBRSArrayMonitor.py
#!/usr/bin/python3 # # Monitor GUI for an array of CBRS boards to watch power levels # and temperature across time along with a user-controlled # value for frequency, gain, and others. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, # INCLUDING BUT NOT LIMITED TO T...
player.py
""" ReSpeaker Python Library Copyright (c) 2016 Seeed Technology 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 a...
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...