source
stringlengths
3
86
python
stringlengths
75
1.04M
queue_test.py
from queue import Queue from time import sleep def load_data(q): i = 0 while True: sleep(5) q.put(i) i += 1 def run_job(idx): queue = Queue() from threading import Thread load_thread = Thread(target=load_data, args=(queue,)) load_thread.start() print('Wating for...
AWSStartStop.py
import boto3 import datetime as dt from time import ctime, sleep import threading default_profile = 'AwsProfile' default_region = 'ap-south-1' default_cluster_names_list = [ # 'default-cluster' ] logfile_location = '/tmp/LoggingFile.log' default_instances_ids_list = [ #'i-03984cc6' ] default_rds_db_instanc...
ch02_listing_source.py
import json import threading import time import unittest import urlparse import uuid # <start id="_1311_14471_8266"/> def check_token(conn, token): return conn.hget('login:', token) # A # <end id="_1311_14471_8266"/> # A Fetch and return the given user, if available # END # <start id="_1311_14471_8265"/> def ...
_v5_proc_uploader.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # COPYRIGHT (C) 2014-2020 Mitsuo KONDOU. # This software is released under the MIT License. # https://github.com/konsan1101 # Thank you for keeping the rules. import sys import os import time import datetime import codecs import glob import queue impo...
test_telnetlib.py
import socket import telnetlib import time import Queue from unittest import TestCase from test import test_support threading = test_support.import_module('threading') HOST = test_support.HOST EOF_sigil = object() def server(evt, serv, dataq=None): """ Open a tcp server in three steps 1) se...
sound.py
import os import subprocess import threading import time import ampel import config def ring(duration): def do_beep(): started = time.time() while True: elapsed = time.time() - started if elapsed > duration: return else: subproce...
example_respmod_encapsulated_451_error.py
# -*- coding: utf8 -*- import time import threading from icapserver import * set_logger('debug') class ExampleICAPHandler(BaseICAPRequestHandler): def example_OPTIONS(self): self.set_icap_response(200) self.set_icap_header('Methods', 'RESPMOD, REQMOD') self.set_icap_header('Service', 'ICAP Server' + ' ' + s...
gate_server.wsgi
import os import string import random import cgi import json import uuid import sys import traceback import bottle from datetime import datetime from bottle import get, post, request, run, route, Bottle import bottle from Pipeline.Training.GATE import * from Pipeline.Training.CRFRunner import CRFRunner from Pipeline.Tr...
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...
main.py
"""Main script of GalaxyDSLR application""" import threading from flaskapp import app # Application execution if __name__ == "__main__": control_thread = threading.Thread(target=app.control.run) control_thread.start() app.run(host="0.0.0.0", port=5000)
metrics2_resample_ensemble.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # ======================================================================== # the metircs for docking power(AUC, Rp, success rate) just for ML-based models # ensemble strategy for for cross-docked poses # ==================================================================...
datasources.py
"""This module holds classes that can be used as data soures. A data source must be iterable and provide dicts with data values. """ # Copyright (c) 2009-2011, Christian Thomsen (chr@cs.aau.dk) # All rights reserved. # Redistribution and use in source anqd binary forms, with or without # modification, are permitte...
main.py
import math import socket import time import math import select import threading from flask import Flask, render_template, request, jsonify, make_response clients = [] app = Flask(__name__) def get_client(**kwargs): if len(clients) < 1: return None for key, value in kwargs.items(): for c in...
listener_util.py
# Copyright 2020 by B. Knueven, D. Mildebrath, C. Muir, J-P Watson, and D.L. Woodruff # This software is distributed under the 3-clause BSD License. # Async Utility. Started by Bill Hart, # simple generalization by Dave Woodruff 2019. # See doc/philosophy.rst # NOTE: DLW: as of February 2019, all we do is sum..........
__init__.py
# coding=utf-8 from __future__ import absolute_import import time from datetime import timedelta, datetime import humanfriendly import octoprint.plugin import octoprint.settings import os import requests import socket import subprocess import logging from PIL import Image from flask import make_response from io impor...
__init__.py
# YOLOv5 🚀 by Ultralytics, GPL-3.0 license """ Logging utils """ import os import warnings from threading import Thread import pkg_resources as pkg import torch from torch.utils.tensorboard import SummaryWriter from utils.general import colorstr, emojis from utils.loggers.wandb.wandb_utils import WandbLogger from u...
test_local_task_job.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...
main.py
# coding:utf-8 # need manually update tkinter for chinese usage in mac OS from threading import Thread import socket import select import tkinter as tk from tkinter import ttk from tkinter import scrolledtext import platform # for platform.platform import os # for os.system import ast # For ast.literal_eval() impor...
chess_link.py
''' The Chess Link Protocol ``` <V56> 2018-08-31 11:07:31,141 DEBUG ChessLinkBluePy Sending: <b'\xd6\xb5\xb6'> 2018-08-31 11:07:31,212 DEBUG ChessLinkBluePy BLE: Handle: 55, data: b'v\xb01\xb0\xb374' 2018-08-31 11:07:31,212 DEBUG ChessLinkBluePy BLE received [v010374] 2018-08-31 11:07:31,212 DEBUG ChessLinkBluePy blue...
subproc_vec_env.py
""" The MIT License Copyright (c) 2017 OpenAI (http://openai.com) 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...
helper.py
#!/usr/bin/env python """ Helper functions AND functions to be used for register behavior. (Reg behavior) Functions to be used to generate data variance for the plc devices. These functions accept: minimum value maximom value slave context These functions return: a set of values to be written to th...
conexion_control.py
""" Prácticas de Redes de comunicaciones 2 Autores: Miguel Arconada Manteca Mario García Pascual """ import threading import time import socket from src.generales import * from src.modulo_udp import ModuloUDP import src.aplicacion """ Esta es la clase de la conexión de control Args: con...
ant.py
# Ant # # Copyright (c) 2012, Gustav Tiger <gustav@tiger.name> # # 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, m...
fdu.py
#!/usr/bin/env python import datetime import json import pathlib import platform import pprint import subprocess # nosec import sys import time import traceback import warnings from multiprocessing import Process from typing import Callable, Optional, List from urllib.parse import urlparse import click import request...
main.py
import os import smtplib import threading from kivy.app import App from kivy.config import Config from kivy.factory import Factory from kivy.uix.modalview import ModalView from kivy.uix.screenmanager import NoTransition, ScreenManager from mailer.AppScreen import AppScreen from mailer.License import Licensing from mai...
1.py
# -*- coding: utf-8 -*- import LINETCR from LINETCR.lib.curve.ttypes import * from datetime import datetime import time, random, sys, ast, re, os, io, json, subprocess, threading, string, codecs, requests, ctypes, urllib, urllib2, urllib3, wikipedia, tempfile from bs4 import BeautifulSoup from urllib import urlopen fr...
executorselenium.py
import json import os import socket import sys import threading import time import traceback import urlparse import uuid from .base import (CallbackHandler, RefTestExecutor, RefTestImplementation, TestharnessExecutor, extra_timeout, ...
setup.py
import copy import json import logging import os import platform import random import shutil import sys import threading from flask import Blueprint from flask import current_app as app from flask import render_template, request from flask_babel import lazy_gettext as _ from flask_login import login_required from ..h...
test.py
# -*- coding: utf-8 -*- import redis import unittest from hotels import hotels import random import time from RLTest import Env from includes import * from common import * # this tests is not longer relevant # def testAdd(env): # if env.is_cluster(): # raise unittest.SkipTest() # r = env # env.ex...
weather.py
# Python program to find current weather details of any city using openweathermap api # import required modules import requests from core.speak import voice_assistant_speak import threading class Current_Weather(): def __init__(self,city_name): self.city_name = city_name current_temperature, feel_like,m...
Client.py
# coding: utf-8 ######################################################################### # 网站: <a href="http://www.crazyit.org">疯狂Java联盟</a> # # author yeeku.H.lee kongyeeku@163.com # # # # version 1.0 ...
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...
client.py
import asyncio import logging import sys import time from threading import Thread, Event from typing import Union, List, Tuple from asyncio import Transport, Protocol from bs4 import BeautifulSoup from ..kik_unofficial import callbacks as callbacks from ..kik_unofficial.datatypes import exceptions as exception...
minecraft_discord_bridge.py
#!/usr/bin/env python # # Copyright (c) 2018 Tristan Gosselin-Hane. # # This file is part of minecraft-discord-bridge # (see https://github.com/starcraft66/minecraft-discord-bridge). # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # ...
map_tab.py
import os import datetime from threading import Thread from PyQt5.QtCore import Qt from PyQt5.QtGui import QPixmap from PyQt5.QtWidgets import QHBoxLayout from PyQt5.QtWidgets import QLabel from PyQt5.QtWidgets import QPushButton from PyQt5.QtWidgets import QVBoxLayout from PyQt5.QtWidgets import QLineEdit from util i...
albobot.py
# -*- coding: utf-8 -*- # This is a simple echo bot using the decorator mechanism. # It echoes any incoming text messages. # Author: Sara Borroni <sara.borroni@pangeaformazione.it> # Contributor: Alessio Cimarelli <jenkin@dataninja.it> import requests, pickle, time, telebot from dateutil.parser import parse from thre...
tddd_train.py
from multiprocessing import Process from algs.TDDD.tddd_learner import TDDDLearner from configs.config_phaser import * from misc.utils import log_round_time def tddd_train(dic_exp_conf, dic_agent_conf, dic_traffic_env_conf, dic_path, round_number): inter_names = list(dic_traffic_env_conf["LANE_PHAS...
main.py
import threading #check_import import queue #check_import import traceback #check_import import signal #check_import import sys #check_import import time #check_import import os #check_import import json #check_import import copy #check_import from threading import Lock #check_import import subprocess #check_import im...
qapplet_threading.py
#!/usr/bin/env python3 import signal import gi gi.require_version('Gtk', '3.0') gi.require_version('AppIndicator3', '0.1') from gi.repository import Gtk, AppIndicator3, GObject, GLib import os import sys import time import subprocess import argparse from pathlib import Path from threading import Thread from PIL impo...
download_pages.py
#!/usr/bin/python # -*- coding: utf-8 -*- import os import time import sys, getopt #import csv #import requests import re #import hashlib import json import datetime import hashlib import threading from datetime import timedelta, date #import threading ##################### processoutput = os.pope...
proxy_checker.py
import py_console.colors as console import signal import sys import time import urllib2 import socket import threading from Queue import * class ProxyChecker: workingProxies = [] # Care shared object need lock queueProxies = None __lockPrint = threading.RLock() __lockWorkingProxies = threading.RLock(...
alphaInterface.py
from psychopy import visual, event import numpy as np import scipy.stats as st import threading # Interface arguments window_size = [1200, 700] checker_cycles = 4 # Number of times texture repeats in box checker_size = 250 checker_tex = np.array([[1, 1], [1, 1]]) # One black a...
logging.py
import time import os import threading import subprocess if __name__ == "__main__": t1 = threading.Thread(target=lambda: subprocess.run(["python3" ,"-u", "print_repeat.py", " >", "log.txt"])) t2 = threading.Thread(target=lambda: subprocess.run(["tail", "-f", "log.txt"])) t1.start() t2.start()
PythonCommandBase.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- from abc import ABCMeta, abstractclassmethod from time import sleep import threading import cv2 from .Keys import KeyPress, Button, Hat, Direction, Stick from . import CommandBase # the class For notifying stop signal is sent from Main window class StopThread(...
svc_checker.py
""" # ml.common.svc_checker.py @author: Jason Zhu @email: jason_zhuyx@hotmail.com @created: 2019-01-30 """ import copy import logging import re import threading import time from queue import Queue from urllib.parse import urlparse from ml.config import get_uint from ml.common.api import get_api_data from ml.utils.e...
feeder.py
from sklearn.model_selection import train_test_split from synthesizer.utils.text import text_to_sequence from synthesizer.infolog import log import tensorflow as tf import numpy as np import threading import time import os _batches_per_group = 64 class Feeder: """ Feeds batches of data into queue on a ba...
mux.py
from concurrent.futures import ThreadPoolExecutor import numpy import operator import random import sys from threading import Thread, Lock import time from timeit import default_timer as timer import traceback from apimux.log import logger from apimux.rwlock import ReadWriteLock from apimux import config class APIMu...
jobs.py
"""Sopel's Job Scheduler: internal tool for job management. .. important:: As of Sopel 5.3, this is an internal tool used by Sopel to manage internal jobs and should not be used by plugin authors. Its usage and documentation is for Sopel core development and advanced developers. It is subject to rapid...
execute.py
""" Once state information has been calculated, handle actually executing tools from various states, tracking results, and building implicit dataset collections from matched collections. """ import collections import logging from threading import Thread from six.moves.queue import Queue from galaxy.tools.actions impo...
quastParser.py
#!/usr/bin/env python from accessoryFunctions import * import os import quast __author__ = 'mikeknowles,akoziol' class Quast(object): def quastprocess(self): from threading import Thread # Find the fasta files for each sample # Only make as many threads are there are samples with fasta fi...
pistream.py
import sys import io import os import shutil from subprocess import Popen, PIPE from string import Template from struct import Struct from threading import Thread from time import sleep, time from http.server import HTTPServer, BaseHTTPRequestHandler from wsgiref.simple_server import make_server import picamera from w...
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...
AVR_Miner.py
#!/usr/bin/env python3 """ Duino-Coin Official AVR Miner 3.0 © MIT licensed https://duinocoin.com https://github.com/revoxhere/duino-coin Duino-Coin Team & Community 2019-2021 """ from os import _exit, mkdir from os import name as osname from os import path from os import system as ossystem from platform import machin...
GUI_URL.py
''' Created on May 28, 2019 Ch06 @author: Burkhard A. Meier ''' #====================== # imports #====================== import tkinter as tk from tkinter import ttk from tkinter import scrolledtext from tkinter import Menu from tkinter import messagebox as msg from tkinter import Spinbox from tkinter im...
autohost_manager.py
"""Autohost manager for Twitch streams Usage: * Install Python 3.7 or newer, and download this program. * Double-click on this script's icon - it should open up a small window. * Click "Get a token" to authenticate with Twitch * Paste in the token you get back (starting with "oauth:") and click Verify * Fill in your a...
rest_primitives.py
# coding=utf-8 # Licensed Materials - Property of IBM # Copyright IBM Corp. 2016,2017 """ Primitive objects for REST bindings. ******** Overview ******** Contains classes representing primitive Streams objects, such as :py:class:`Instance`, :py:class:`Job`, :py:class:`PE`, etc. """ from future.builtins import * im...
console.py
# Copyright (c) 2017 Computer Vision Center (CVC) at the Universitat Autonoma de # Barcelona (UAB), and the INTEL Visual Computing Lab. # # This work is licensed under the terms of the MIT license. # For a copy, see <https://opensource.org/licenses/MIT>. """CARLA client console""" import cmd import logging import su...
send_job_test.py
# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by app...
test_logging.py
# Copyright 2001-2019 by Vinay Sajip. All Rights Reserved. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose and without fee is hereby granted, # provided that the above copyright notice appear in all copies and that # both that copyright notice and this permissio...
py_gdb_tools_gdb.py
import atexit import socket SERIALIZE_VERSION = '2.0' _server_port = None _server_dones = {} def gdbprintln(text): def inner(): gdb.write('\n(pgt) ' + text + '\n(gdb) ') gdb.post_event(inner) def consume_socket(s): while s.recv(1024): pass def stop_server(port): gdbprintln('exitin...
crawlDou.py
import queue import threading from twisted.internet import reactor, defer from dou import Dou from douSection import DouSection from readDouJLFile import readDouJLFile from loadingWheel import loadingWheel from loadingBar import loadingBar @defer.inlineCallbacks def crawlDou(runner, data, secao): # get sections ...
ci_task_history_view.py
# coding=utf-8 # coding=utf-8 ''' Created on 2014-1-5 @author: ETHAN ''' from rest_framework import generics from doraemon.api.ci.serializer import ci_serializer from rest_framework.permissions import AllowAny from doraemon.ci.models import CITaskHistory from doraemon.api.ci.filters.ci_task_history_filter import CITas...
swaync.py
#!/usr/bin/env python3 from gi.repository import GLib import subprocess import threading from nwg_panel.tools import check_key, update_image import gi gi.require_version('Gtk', '3.0') gi.require_version('Gdk', '3.0') from gi.repository import Gtk, Gdk class SwayNC(Gtk.EventBox): def __init__(self, settings,...
qt.py
#!/usr/bin/env python # # Electrum - Lightweight Bitcoin Client # Copyright (C) 2015 Thomas Voegtlin # # 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...
tendaac1518_httpd.py
#!/usr/bin/env python3 # # Cross Platform and Multi Architecture Advanced Binary Emulation Framework # # 1. Download AC15 Firmware from https://down.tenda.com.cn/uploadfile/AC15/US_AC15V1.0BR_V15.03.05.19_multi_TD01.zip # 2. unzip # 3. binwalk -e US_AC15V1.0BR_V15.03.05.19_multi_TD01.bin # 4. locate squashfs-root # ...
qiqo_chat.py
import json import requests import threading import civictechprojects.models from django.conf import settings def get_user_qiqo_iframe(contributor): if not contributor.qiqo_uuid: SubscribeUserToQiqoChat(contributor) return settings.TEST_IFRAME_URL if not hasattr(settings, 'QIQO_IF...
driver.py
import os import sys import time import traceback import threading from packet import ScapyPacket from or_event import OrEvent from utils import Utils from logger import Logger def tobytes(s): if sys.version_info[0] < 3: return buffer(s) return s.encode() def isLinkUp(intf, dbg = False): flags_pa...
roof-monitor.py
#!/usr/bin/env python3 import argparse,array,can,json,os,queue,re,signal,time from threading import Thread flap_max_extend = 12 device_command_ids = { 'roof':0x64,'flap':0x65 } device_commands = { 'open': 0x00, 'close': 0x01, 'opening': 0x02, 'closing': 0x03, 'error': 0x04, 'heartbeat':0xfe, 'stop':0xff } incoming_...
java_gateway.py
# -*- coding: UTF-8 -*- """Module to interact with objects in a Java Virtual Machine from a Python Virtual Machine. Variables that might clash with the JVM start with an underscore (Java Naming Convention do not recommend to start with an underscore so clashes become unlikely). Created on Dec 3, 2009 :author: Barthe...
fed_server.py
# Copyright (c) 2021-2022, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ...
queue_manager.py
import json from collections import deque from os.path import exists from typing import List from PyQt5.QtCore import Qt from PyQt5.QtWidgets import QAbstractItemView, QListWidgetItem from multiprocess.context import Process import lib.logger as logging from lib.gui.helper import safe_process_stop from lib.gui.threa...
server.py
import os, sys, time, json, glob import falcon from logzero import logger as log from wsgiref import simple_server from watchdog.observers.polling import PollingObserver from watchdog.events import FileSystemEventHandler from threading import Event, Thread import vsc class VSCUpdater(object): def on_...
web_server.py
""" Web server module. Simply run import rdb rdb.web_server.start_server() to start up a remote web server instance. """ import cherrypy # cherrypy 3.2+ # import cherrypy.lib.auth_basic import jinja2 import threading import sys import traceback import socket import os import os.path import time _env = jinja2.Envi...
logevent_camera.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # + # import(s) # - import threading import time from OcsLogger import * from SALPY_camera import * # + # __doc__ string # - __doc__ = """Event logger for camera events in the OCS""" # + # dunder string(s) # - __author__ = "Philip N. Daly" __copyright__ = u"\N{COPYRIG...
word2vec_optimized.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...
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...
tests.py
from __future__ import absolute_import import sys import time from django.conf import settings from django.db import transaction, connection from django.db.utils import ConnectionHandler, DEFAULT_DB_ALIAS, DatabaseError from django.test import (TransactionTestCase, skipIfDBFeature, skipUnlessDBFeature) from djang...
ccnet.py
import sys import logging import site logging.error(site) logging.error(sys.path) logging.basicConfig(level=logging.DEBUG) import threading import serial import struct import binascii from functools import wraps import errno import os import signal import math import struct import traceback def return_buffer(data):...
cluster.py
# # General-purpose Photovoltaic Device Model - a drift diffusion base/Shockley-Read-Hall # model for 1st, 2nd and 3rd generation solar cells. # Copyright (C) 2008-2022 Roderick C. I. MacKenzie r.c.i.mackenzie at googlemail.com # # https://www.gpvdm.com # # This program is free software; you can redist...
multiprocessing_simple.py
#!/usr/bin/env python3 # encoding: utf-8 # # Copyright (c) 2008 Doug Hellmann All rights reserved. # """Creating and waiting for a process """ #end_pymotw_header import multiprocessing def worker(): """worker function""" print('Worker') if __name__ == '__main__': jobs = [] for i in range(5): ...
test_udp_stream.py
import socket import typing from tests.utils.skip import is_linux from tests.utils.timeout import time_limit import threading import time import unittest from pyais.util import FixedSizeDict from pyais.stream import OutOfOrderByteStream, UDPStream MESSAGES = [ b'!AIVDM,2,1,1,A,538CQ>02A;h?D9QC800pu8@T>0P4l9E8L000...
homework_3.py
from tkinter import * import time import threading from functools import partial import random def stopWatch(): global flag, record; hour, minute, second = int(record[0]), int(record[1]),int(record[2]); for hours in range(hour, 100): if flag != 0 : break; for minutes in range(m...
dqn_train.py
""" Copyright (c) College of Mechatronics and Control Engineering, Shenzhen University. All rights reserved. Description : dqn algorithm used for controling the steer to make a vehicle keep lane. Author:Team Li """ import tensorflow as tf import cv2, math, sys, random, threading from keep_lane.basic_net.dqn_utils im...
ftp.py
import ftplib import re from threading import Thread def thread(my_func): def wrapper(*args, **kwargs): my_thread = Thread(target=my_func, args=args, kwargs=kwargs) my_thread.start() return wrapper class FTPProtocol(object): ls_format = re.compile('^([^\s]+\s+){4}(\d+)\s([^\s]+\s+){3}(....
start.py
#!/usr/bin/env python import time import threading from . import pymatbridge try: import queue except ImportError: import Queue import argparse import json import logging import sys import os import zmq from threading import Thread from .pymatbridge import Matlab, socket_send connected_clients = {} response_...
client.py
import threading, time, sys, getopt, json, queue from config import * from plot_utils import * from rvs import * from msg import * from commer import PACKET_SIZE, CommerOnClient from flow_control import FlowControlClient class Client(): def __init__(self, _id, sid_ip_m, num_jobs_to_finish, serv_time_rv, size_inBs_rv...
livestream.py
# _____ ______ _____ # / ____/ /\ | ____ | __ \ # | | / \ | |__ | |__) | Caer - Modern Computer Vision # | | / /\ \ | __| | _ / Languages: Python, C, C++, Cuda # | |___ / ____ \ | |____ | | \ \ http://github.com/jasmcaus/caer # \_____\/_/ \_ \______ |_| \_\ # Lic...
test_changes.py
# -*- coding: utf-8 - # # This file is part of couchdbkit released under the MIT license. # See the NOTICE for more information. # from __future__ import absolute_import from six.moves import range __author__ = 'benoitc@e-engura.com (Benoît Chesneau)' import threading import time import unittest from couchdbkit impor...
netcat_light.py
# this is a very light version of netcat for when you are on the go # more functions will be added soon import sys import socket import getopt import threading import subprocess # global variables listen = False command = False upload = False execute = "" target = "" upload_destination = "" port = 0 def usage(): ...
generic.py
import pandas as pd import numpy as np import multiprocessing as mp import pyteomics.mass from ..constants import MAX_ION, ION_TYPES, MAX_FRAG_CHARGE, NLOSSES from .. import utils aa_comp = dict(pyteomics.mass.std_aa_comp) aa_comp["o"] = pyteomics.mass.Composition({"O": 1}) #translate2spectronaut = {"C": "C[Carbamido...
caffe_resnet_client.py
# Copyright 2016 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
preprocess.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright 2020 Wu Yi-Chiao (Nagoya University) # based on a Parallel WaveGAN script by Tomoki Hayashi (Nagoya University) # (https://github.com/kan-bayashi/ParallelWaveGAN) # based on sprocket-vc script by Kazuhiro Kobayashi (Nagoya University) # (https://github.com/k2k...
04_index_buffer.py
import sys, os #get path of script _script_path = os.path.realpath(__file__) _script_dir = os.path.dirname(_script_path) pyWolfPath = _script_dir if sys.platform == "linux" or sys.platform == "linux2": print "Linux not tested yet" elif sys.platform == "darwin": print "OS X not tested yet" elif sys.platform ==...
profiling.py
import json, threading, os, socket, urllib import tensorflow as tf from tensorflow.python.client import timeline from tensorboard import default, program class Timeliner: _timeline_dict = None options = tf.RunOptions(trace_level=tf.RunOptions.FULL_TRACE) run_metadata = tf.RunMetadata() def update_ti...
client.py
__author__ = 'tanel' import argparse from ws4py.client.threadedclient import WebSocketClient import time import threading import sys import urllib import Queue import json import time import os def rate_limited(maxPerSecond): minInterval = 1.0 / float(maxPerSecond) def decorate(func): lastTimeCalled =...
zeromq.py
# -*- coding: utf-8 -*- ''' Zeromq transport classes ''' # Import Python Libs from __future__ import absolute_import import os import copy import errno import hashlib import logging import weakref from random import randint # Import Salt Libs import salt.auth import salt.crypt import salt.utils import salt.utils.veri...
midi_hub.py
"""A module for interfacing with the MIDI environment.""" import abc from collections import defaultdict from collections import deque import re import threading import time # internal imports import mido from six.moves import queue as Queue import tensorflow as tf # TODO(adarob): Use flattened imports. from magenta...
server.py
""" Copyright (c) 2020, salesforce.com, inc. All rights reserved. SPDX-License-Identifier: BSD-3-Clause For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause """ import os import sys from http.server import HTTPServer, SimpleHTTPRequestHandler from multiprocessing...
cognet-checkpoint.py
import numpy as np import pandas as pd import random from quasinet.qnet import Qnet, qdistance, load_qnet, qdistance_matrix from quasinet.qsampling import qsample, targeted_qsample #from mpi4py.futures import MPIPoolExecutor import sys import subprocess from scipy.stats import entropy import multiprocessing as mp impor...
functional_tests.py
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. import json import logging import os.path import random import time from multiprocessing ...