source
stringlengths
3
86
python
stringlengths
75
1.04M
twitchy.py
# Boulderbot 1.5 # An IRC bot designed for Twitch.TV streams # # Please see the README for instructions on using Twitchy. # It is released under the BSD license; the full license # available in the LICENSE file. # CONFIGURATION Twitch_Username = 'Boulderbot' # Twitch.TV username for the bot, must be a registered use...
cmdlineframes.py
from __future__ import absolute_import, division, print_function # TODO: # - prompt user for missing symmetry # - cached scenes r""" Load mtz file for viewing reflections in a webbrowser using NGL. Webbrowser input is a javascript file that together with ngl.js displays reflections positioned in reciprocal space...
spigui.py
import time import struct import sys import os import re import threading from functools import partial import wx import wx.lib.newevent as NE from spidriver import SPIDriver PingEvent, EVT_PING = NE.NewEvent() def ping_thr(win): while True: wx.PostEvent(win, PingEvent()) time.sleep(1) class He...
references.py
import threading import sublime_plugin from ..libs import * from ..libs.view_helpers import * from ..libs.reference import * from ..libs import log from .base_command import TypeScriptBaseTextCommand from collections import defaultdict class TypescriptFindReferencesCommand(TypeScriptBaseTextCommand): """Find re...
email.py
# -*- coding:utf-8 -*- from flask import render_template from flask import current_app from flask_mail import Message from threading import Thread from app import mail def send_async_mail(app, msg): with app.app_context(): mail.send(msg) def send_mail(to, subject, template, **kw): app = current_app....
train.py
from __future__ import division, print_function import argparse import os import threading import time import numpy as np import tensorflow as tf from model import WCTModel from utils import get_files, get_img_random_crop parser = argparse.ArgumentParser() # Directories parser.add_argument('--checkpoint', type=str,...
worker.py
from contextlib import contextmanager import colorama 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, Dict, List, Iterator # Ray modules from ray.autoscaler._priv...
run_2.py
#import threading import multiprocessing #import queue from multiprocessing import Queue from src.services.train import train_context from src.services.get_corpus import corpus_generator, get_chunk from config import THREADS, CHUNK_SIZE, CORPUS_PATH import time train_queue = Queue() #queue.Queue() chuck_count = 0 de...
main.py
from trade_client import * from store_order import * from logger import logger from load_config import * from new_listings_scraper import * import globals from collections import defaultdict from datetime import datetime, time import time import threading import json from json import JSONEncoder import os.path impor...
test_connection_pool.py
from __future__ import with_statement import os import pytest import redis import time import re from threading import Thread from redis.connection import ssl_available from .conftest import skip_if_server_version_lt class DummyConnection(object): description_format = "DummyConnection<>" def __init__(self, ...
variable_scope.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...
utils.py
import errno import logging import os from abc import ABC, abstractmethod from toil.lib.threading import ExceptionalThread log = logging.getLogger(__name__) class WritablePipe(ABC): """ An object-oriented wrapper for os.pipe. Clients should subclass it, implement :meth:`.readFrom` to consume the readable...
multi_echo_server.py
import socket import time from multiprocessing import Process HOST = "" PORT = 8081 BUFFER_SIZE = 1024 def main(): with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s: s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) # bind socket to address s.bind((HOST, PORT)) #...
Fitter.py
from PySide2.QtCore import Signal, QObject, QThread from threading import Thread from easyCore.Fitting.Fitting import Fitter as CoreFitter from easyCore import borg class FitterLogic(QObject): """ Logic related to the fitter setup """ fitFinished = Signal() fitStarted = Signal() currentMinim...
mplayer.py
import os import select import subprocess import threading import time from platypush.context import get_bus from platypush.message.response import Response from platypush.plugins.media import PlayerState, MediaPlugin from platypush.message.event.media import MediaPlayEvent, MediaPlayRequestEvent, \ MediaPauseEven...
RoR2M.py
import win32com.client import subprocess import threading import requests import shutil import time import json import uuid import vdf import sys import os from zipfile import ZipFile from PyQt5.QtWidgets import QApplication, QWidget, QPushButton, QVBoxLayout, QHBoxLayout,\ QLineEdit, QFileDialog class IOManager:...
netcdf.py
#!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### # $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test NetCDF driver support. # Author: Frank Warmerdam <warmerdam@pobox.com> # #############################################################...
packages_analyzer.py
#!/usr/bin/env python """ 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")...
pd.py
# Copyright 1999-2017 Alibaba Group Holding 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 a...
coreserver.py
#!/usr/bin/env python # # CORE # Copyright (c)2010-2016 the Boeing Company. # See the LICENSE file included in this distribution. # # authors: Tom Goff <thomas.goff@boeing.com> # Jeff Ahrenholz <jeffrey.m.ahrenholz@boeing.com> # Rod Santiago # import SocketServer, sys, threading, time, traceback im...
_task.py
"""ESMValtool task definition.""" import contextlib import datetime import errno import logging import numbers import os import pprint import subprocess import threading import time from copy import deepcopy from multiprocessing import Pool, cpu_count import psutil import yaml from ._config import TAGS, replace_tags,...
ur3_rtq85_x.py
import math import time from robot_con.ur.robotiq import rtq_cbseries_gripper as r2f from robot_con.ur.robotiq import rtq_ft300 as rft from basis import robot_math as rm import drivers.urx.ur_robot as urrobot import robot_con.ur.program_builder as pb import threading import socket import struct import os import motion....
data_set_routes.py
import os import csv import zipfile import pickle import threading import pandas as pd import numpy as np import sys # For API import pysurveycto # Redis queue from rq import Queue from rq.job import Job from app.redis import conn # File reading utility from io import BytesIO from datetime import datetime from flask i...
piCamMovecpu.py
#!/usr/bin/python3 import threading, queue, time import picamera.array as picamarray, numpy, pathlib import numpy.ma as nma import png, io from pootlestuff import watchables as wv class piCamCPU(wv.watchablesmart): """ a base class for things that want to analyse images in detail for movement detection, expos...
pipeline.py
from multiprocessing import Process,Queue import multiprocessing as multiprocessing import importlib import hashlib import random import time import os import yaml def read_pipelines(fname): absdir=os.path.dirname(os.path.abspath(fname)) with open(fname) as f: pipelines=yaml.load(f, Loader=yaml.BaseLoa...
splunk_http_event_collector.py
"""splunk_http_event_collector.py Splunk HTTP event submission class Remember: Friends don't let friends send in non Common Information Model data: http://docs.splunk.com/Documentation/CIM/latest/User/Overview Please use CIM friendly field names when sending in data. """ import requests import json im...
stats_ops.py
import time from membase.api.rest_client import RestConnection, Bucket from membase.helper.rebalance_helper import RebalanceHelper from memcached.helper.data_helper import MemcachedClientHelper from basetestcase import BaseTestCase from mc_bin_client import MemcachedError from couchbase_helper.documentgenerator import ...
utility.py
from typing import Optional import torch.optim.lr_scheduler as lrs import torch.optim as optim import torch import imageio import numpy as np import matplotlib.pyplot as plt import os from math import log10, sqrt import time import datetime from multiprocessing import Process from multiprocessing import Queue import m...
testing.py
from __future__ import division # pylint: disable-msg=W0402 import random import re import string import sys import tempfile import warnings import inspect import os import subprocess import locale import unittest import traceback from datetime import datetime from functools import wraps, partial from contextlib impo...
test_table_read.py
import os from datetime import date from threading import Barrier, Thread import pandas as pd import pyarrow as pa import pyarrow.dataset as ds import pytest from pyarrow.fs import LocalFileSystem from deltalake import DeltaTable def test_read_simple_table_to_dict(): table_path = "../rust/tests/data/simple_tabl...
minion.py
# -*- coding: utf-8 -*- ''' Routines to set up a minion ''' # Import python libs from __future__ import absolute_import, print_function, with_statement, unicode_literals import functools import os import sys import copy import time import types import signal import random import logging import threading import tracebac...
test.py
# -*- coding: utf-8 -*- try: from thread import start_new_thread, get_ident except ImportError: # Python 3? from _thread import start_new_thread, get_ident import threading import unittest import time import sys import gc import lupa IS_PYTHON3 = sys.version_info[0] >= 3 try: _next = next except Nam...
mthread.py
import threading import time def s(): for i in range(1,10): print("\tcubes :",i**2,end='') time.sleep(1) def c(): for i in range(1,10): print('Square :',i**3,end='') time.sleep(1) if __name__=='__main__': tc=threading.Thread(target=c,args=()) ts=threading.Thread(targe...
foo.py
# Python 3.3.3 and 2.7.6 # python fo.py import threading from threading import Thread lock=threading.Lock() # Potentially useful thing: # In Python you "import" a global variable, instead of "export"ing it when you declare it # (This is probably an effort to make you feel bad about typing the word "global") i = 0 ...
winInputHook.py
#winInputHook.py #A part of NonVisual Desktop Access (NVDA) #Copyright (C) 2006-2008 NVDA Contributors <http://www.nvda-project.org/> #This file is covered by the GNU General Public License. #See the file COPYING for more details. import threading import comtypes.client import time from ctypes import * from ...
instance.py
''' Module that contains functions to generate or load instances. ''' from threading import Thread from queue import Queue from questionary import prompt, confirm from cli import createInstanceQuestions, validateChoices from knapsack import Knapsack from heuristic import solveInstance def generateInstances(): '...
logviewer.py
#!/usr/bin/env python from Tkinter import * from ScrolledText import * from tkFont import Font from Queue import Queue, Empty class LogWindow (Frame): def __init__ (self, master=None): Frame.__init__(self, master) self.master.title("Network Simulator Log") self.text = ScrolledText(self) self.text.pa...
reqlist.py
import threading import shlex from guppyproxy.util import max_len_str, query_to_str, display_error_box, display_info_box, display_req_context, display_multi_req_context, hostport, method_color, sc_color, DisableUpdates, host_color from guppyproxy.proxy import HTTPRequest, RequestContext, InvalidQuery, SocketClosed, ti...
fixtures.py
# -*- coding: utf-8 -*- import binascii from contextlib import contextmanager import hashlib import socket import struct import threading import time try: # py3 import socketserver except ImportError: # py2 import SocketServer as socketserver import pytest import httmock import mock import pushjack_...
nova_pid_viz.py
#!//usr/bin/env python3 # Leigh Oliver, 13 Jan. 2022 # Sorry I didn't document this import argparse from cmath import log from mailbox import linesep import struct import sys import time import traceback from threading import Event, Thread from itertools import count import can import pyqtgraph as pg from pyqtgraph.Qt...
test_db_connection.py
#!/usr/bin/env python # coding=utf-8 """ # pyORM : Test Suite for test_db_connection.py Summary : <summary of module/class being tested> Use Case : As a pyorm Developer I want Reusable generic database connection system So that My code can make the most efficient use of resources Testable Statements : C...
spyrelet.py
"""The base class for spyrelets and associated utility functions. The Spyrelet class is the base class for writing experimentation logic. These can be as simple or complex as desired and need to be Leave one blank line. The rest of this docstring should contain an overall description of the module or program. Option...
mp.py
import os import pickle import struct import sys from functools import partial from multiprocessing import Lock, Semaphore, Event as ProcessEvent from threading import Thread, Event as TrEvent, RLock as ThreadRLock from time import sleep, time from typing import List, Dict, Optional from multiprocessing import Process ...
executor-skeleton.py
#!/usr/bin/env python2.7 # A skeleton for writing a custom Mesos executor. # # For more information, see: # * https://github.com/apache/mesos/blob/0.22.2/src/python/interface/src/mesos/interface/__init__.py#L246-L310 # * https://github.com/apache/mesos/blob/0.22.2/include/mesos/mesos.proto#L262-L291 # from __future...
fifo_queue_test.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...
WDSFlask.py
from __future__ import with_statement import win32service from subprocess import Popen, PIPE import logging from logging.handlers import RotatingFileHandler from multiprocessing import Process, Lock from multiprocessing.pool import ThreadPool import os import base64 import win32serviceutil from flask import Flask, req...
wsdump.py
#!c:\users\eng\documents\project\venv\scripts\python.exe import argparse import code import sys import threading import time import ssl import gzip import zlib import six from six.moves.urllib.parse import urlparse import websocket try: import readline except ImportError: pass def get_encoding(): enco...
SpotifyCharts.py
import json import threading import re from queue import Queue from .crawler_base import SpotifyChartsBase from .compute_dates import returnDatesAndRegions from .compute_dates import whatDates from .log_config import logger from .write_to_outputs import writeToCSV from .write_to_outputs import writeToSQL...
pulseaudio.py
# coding: utf-8 """ PulseAudio interface. """ from gi.repository import GObject import pulsectl import threading from aspinwall.shell.interfaces import Interface class PulseAudioInterface(Interface): """ Interface for PulseAudio. Supports volume changes and muting. """ __gtype_name__ = 'PulseAudioInterface' lat...
test_work_planner.py
# Copyright (c) 2020 Seagate Technology LLC and/or its Affiliates # # 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 appl...
grpc_bridge_test.py
# Copyright 2020 Adap GmbH. 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 ag...
example20.py
""" 线程间通信(共享数据)非常简单因为可以共享同一个进程的内存 进程间通信(共享数据)比较麻烦因为操作系统会保护分配给进程的内存 要实现多进程间的通信通常可以用系统管道、套接字、三方服务来实现 multiprocessing.Queue 守护线程 - daemon thread 守护进程 - firewalld / httpd / mysqld 在系统停机的时候不保留的进程 - 不会因为进程还没有执行结束而阻碍系统停止 """ from threading import Thread from time import sleep def output(content): while True: pri...
test_logging.py
#!/usr/bin/env python # # Copyright 2001-2013 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 n...
URLParser.py
#!/usr/bin/python2.7 -tt from __future__ import unicode_literals import sys if sys.version_info < (2, 7): print "Must use python 2.7 or greater\n" sys.exit() try: import wx except ImportError: print "You do not appear to have wxpython installed.\n" print "Without wxpython, this program cannot run.\n" print "You...
lauecollect.py
#!/usr/bin/env python """Laue Data Collection Author: Friedrich Schotte Date created: 2007-08-22 Date last modified: 2018-09-13 """ from pdb import pm # for debugging # Beamline instrumentation from instrumentation import * from CA import caget,caput # General Python library functions from numpy import nan,isnan,inf,is...
ida_script.py
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import print_function import datetime import threading import xmlrpclib from SimpleXMLRPCServer import SimpleXMLRPCServer from xml.sax.saxutils import escape import idaapi import idautils import idc # Wait for any processing to get done idaapi.autoWait() ...
utils.py
# -*- coding: utf-8 -*- import logging import os import re import requests import time import zipfile from datetime import datetime from getpass import getpass from threading import Thread from tqdm import tqdm from plexapi import compat from plexapi.exceptions import NotFound # Search Types - Plex uses these to filte...
data_store_test.py
#!/usr/bin/env python # -*- mode: python; encoding: utf-8 -*- """These are basic tests for the data store abstraction. Implementations should be able to pass these tests to be conformant. """ import csv import functools import hashlib import logging import operator import os import random import string import tempf...
parallel.py
import functools from concurrent.futures import ProcessPoolExecutor, ThreadPoolExecutor from multiprocessing import Process from threading import Thread def parallelise(func=None, is_multiprocess=False): if func is None: return functools.partial(parallelise, is_multiprocess=is_multiprocess) PoolExecu...
VideoGet.py
from threading import Thread import cv2 import time class VideoGet: """ Class that continuously gets frames from a VideoCapture object with a dedicated thread. """ def __init__(self, src=0): self.stream = cv2.VideoCapture(src) (self.grabbed, self.frame) = self.stream.read() ...
vpp_transport_socket.py
# # VPP Unix Domain Socket Transport. # import socket import struct import threading import select import multiprocessing try: import queue as queue except ImportError: import Queue as queue import logging from . import vpp_papi class VppTransportSocketIOError(IOError): # TODO: Document different values o...
__main__.py
##################################################################### # # # /main.pyw # # # # Copyright 2014, Monash University ...
main.py
import requests import logging import datetime import os from multiprocessing import Process def get_url(): get_url.url = input('Enter url (full path): ') confirm_url = input('Confirm this url?(y/N): ') if confirm_url == 'y' or confirm_url == 'Y': main(get_url.url) elif confirm_url == 'n' or c...
buzz_plugin.py
# -*- coding: utf-8 -*- import threading from typing import List, Dict import pibooth import logging import usb.core import usb.util import traceback, sys, os import time LOGGER = logging.getLogger(__name__) class Buzz: def __init__(self): # ID 054c:1000 Sony Corp. Wireless Buzz! Receiver self....
test_connections.py
import socket import threading import ssl import OpenSSL import pytest from unittest import mock from mitmproxy import connections from mitmproxy import exceptions from mitmproxy.net import tcp from mitmproxy.net.http import http1 from mitmproxy.test import tflow from .net import tservers from pathod import test cla...
person_gen.py
import csv import random import multiprocessing from faker import Faker import sys #pylint: disable=no-member FNAME_PREFIX = "../files/person_" FNAME_SUFFIX = ".csv" BOOL_IND_SPLIT = {'likesports' : 50 , 'liketheatre' : 10 , 'likeconcerts': 20 , 'likevegas' : 20, 'likecruises': 5 , 'liketravel' : 40 } NUM_WORKERS ...
demo_hogwild.py
from __future__ import print_function import argparse import os import torch import torch.optim as optim import torch.nn as nn import torch.nn.functional as F import torch.multiprocessing as mp from torchvision import datasets, transforms from tensorboardX import GlobalSummaryWriter # Training settings parser = argpa...
views.py
from django.shortcuts import render, redirect, get_object_or_404 from django.http import HttpResponse, Http404 from django.utils import timezone from .models import Device, Scan, Host from .forms import ScanForm from .tasks import execute_scan from threading import Thread def index(request): scan_list = Scan.ob...
risk.py
""" Copyright 2019 Goldman Sachs. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software di...
utils.py
import datetime import math import random import re import time import traceback import unicodedata import urllib.parse from difflib import SequenceMatcher from functools import wraps from hashlib import md5 from io import BytesIO from string import punctuation, whitespace from threading import Thread import aiohttp i...
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...
remotecontrolreceiver.py
# Copyright (c) 2019, Bosch Engineering Center Cluj and BFMC organizers # 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, ...
kvm_player.py
import datetime import json import multiprocessing import os import re import shutil import socket import subprocess import unittest import warnings import requests import sys import time import yaml from kubernetes import client as kubeclient from app import generator, configs def is_virtinstall(): with open("...
fuzzer_wrapper.py
#!/usr/bin/env python3 """ Wraps afl-fuzz fuzzing calls. """ import argparse import json import shlex import time import os import shutil from shutil import copyfile parentdir = os.path.dirname(os.path.dirname(os.path.realpath(__file__))) os.sys.path.insert(0, parentdir) import signal import sys import multiprocessin...
FrameProcessor.py
from abc import ABC, abstractmethod from threading import Thread, Condition, Lock from typing import Optional, Callable from numpy import ndarray from livia.input.FrameInput import FrameInput from livia.output.FrameOutput import FrameOutput from livia.process.FrameProcessError import FrameProcessError from livia.proc...
utils.py
# Copyright 2020 The Tilt Brush Authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to ...
bash.py
import os from subprocess import PIPE, Popen from threading import Thread import sys from prudentia.utils import io class BashCmd(object): def __init__(self, *cmd_args): self.cmd_args = cmd_args self.env = os.environ.copy() self.cwd = os.getcwd() self.show_output = True se...
do_lock.py
import time, threading # 假定这是你的银行存款: balance = 0 lock = threading.Lock() def change_it(n): # 先存后取,结果应该为0: global balance balance = balance + n balance = balance - n def run_thread(n): for i in range(100000): # 先要获取锁: lock.acquire() try: # 放心地改吧: cha...
pivot.py
from ptrlib import * import time import threading rop_ret = 0x08048436 rop_pop_edi_ebp = 0x08048a8a rop_leave_ret = 0x08048696 log.level = ["warning"] system = 0x3ada0 def worker(): base = 0x804a0a0 #libc_system = 0xf7f7fcb0 - 945328 + 0x809c0#250368 libc_system = 0xf7f7fb00 - 0xd5b00 + system payloa...
tasks.py
''' Created on Jan 24, 2014 @author: dswd ''' import threading, time MAX_WAIT = 3600.0 class Task: def __init__(self, fn, args=None, kwargs=None, timeout=0, repeated=False, immediate=False): if not kwargs: kwargs = {} if not args: args = () self.timeout = timeout self.repeated = repeated self.fn = ...
meterpreter.py
#!/usr/bin/python # vim: tabstop=4 softtabstop=4 shiftwidth=4 noexpandtab import binascii import code import os import platform import random import select import socket import struct import subprocess import sys import threading import time import traceback try: import ctypes except ImportError: has_windll = False ...
dada_trigger.py
#!/usr/bin/env python3 # # dada_dbevent triggers import os import threading import socket import numpy as np from astropy.time import Time, TimeDelta from darc import DARCBase from darc import util from darc.definitions import TIME_UNIT, CONFIG_FILE class DADATriggerException(Exception): pass class DADATrigg...
_app.py
""" websocket - WebSocket client library for Python Copyright (C) 2010 Hiroki Ohtani(liris) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, ...
threaded_batched.py
import queue import sqlite3 import threading import multiprocessing from typing import List from commons import get_random_age, get_random_active, get_random_bool, get_random_area_code, create_table DB_NAME = "threaded_batched.db" q = queue.Queue() def consumer(): con = sqlite3.connect(DB_NAME, isolation_level...
app_router.py
# coding: utf-8 from __future__ import absolute_import from __future__ import division from __future__ import print_function import sys import time import threading import requests from leancloud import utils class AppRouter(object): def __init__(self, app_id, region): self.app_id = app_id sel...
test_cvideo.py
#!/usr/bin/python """ Test of video streaming via cvideo + OpenCV usage: ./test_cvideo.py <note> [<metalog> [<F>]] """ import sys import os import inspect BEBOP_ROOT = os.path.realpath(os.path.abspath(os.path.join(os.path.split(inspect.getfile( inspect.currentframe() ))[0],".."))) if BEBOP_ROOT not in sys.p...
modelVC.py
import cosine import nltk import numpy as np from threading import Thread import threading class summary: text="" n=0 weightGraph=[] def buildGraph(self,sentences,i,tImpWord): j=0 global n,weightGraph #print threading.currentThread() for j in range (i+1,n): weightGraph[i][j]=cosine.cosineS(sentenc...
main_window.py
import re import os import sys import time import datetime import traceback from decimal import Decimal import threading import electrum_vtc from electrum_vtc.bitcoin import TYPE_ADDRESS from electrum_vtc import WalletStorage, Wallet from electrum_vtc_gui.kivy.i18n import _ from electrum_vtc.paymentrequest import Invo...
main.py
from threading import Thread from extra import * import time import datetime import sys import queue from services import services import argparse def local_ip(): s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) s.connect(('8.8.8.8', 1)) return s.getsockname()[0] def dedicate_local_port(): s = s...
test_oas_cache.py
import threading from zds_client.oas import schema_fetcher def test_schema_fetch_twice(oas): schema = oas.fetch() assert isinstance(schema, dict) assert oas.mocker.call_count == 1 oas.fetch() # check that the cache is used assert oas.mocker.call_count == 1 def test_clear_caches_in_betwee...
test_nonasyncrunner.py
# emacs: -*- mode: python-mode; py-indent-offset: 4; tab-width: 4; indent-tabs-mode: nil; coding: utf-8 -*- # ex: set sts=4 ts=4 sw=4 et: # ## ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ## # # See COPYING file distributed along with the datalad package for the # copyright and license te...
Binance Detect Moonings.py
""" Disclaimer All investment strategies and investments involve risk of loss. Nothing contained in this program, scripts, code or repositoy should be construed as investment advice.Any reference to an investment's past or potential performance is not, and should not be construed as, a recommendation or as a guarantee...
morphable_graph_state_machine.py
import copy import threading import time from datetime import datetime import numpy as np import os import glob from anim_utils.animation_data.motion_state import MotionState, MotionStateInterface from vis_utils.scene.components import ComponentBase from transformations import euler_matrix from anim_utils.animation_dat...
http1.py
import Queue import threading from http_common import * import simple_http_client class Http1Worker(HttpWorker): version = "1.1" def __init__(self, logger, ip_manager, config, ssl_sock, close_cb, retry_task_cb, idle_cb, log_debug_data): super(Http1Worker, self).__init__(logger, ip_manager, config, ...
session_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...
server_ingester_test.py
# Copyright 2020 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...
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...
MagiskPatcher.py
#!/usr/bin/env python3 # 脚本 by affggh # Apcache 2.0 import os import sys import shutil import zipfile import subprocess import platform import requests if os.name == 'nt': import tkinter as tk if os.name == 'posix': from mttkinter import mtTkinter as tk # While Load some need thread funcion on Linux it wi...
compiler.py
#-*- coding: utf-8 -*- # stino/compiler.py import os import re import threading import subprocess import sublime from . import fileutil from . import textutil from . import constant from . import serial from . import base from . import preprocess from . import sketch from . import console ram_size_dict = {} ram_siz...
test_model.py
import pytest import threading import time import ml_datasets from thinc.api import ( CupyOps, prefer_gpu, Linear, Dropout, Model, Shim, change_attr_values, ) from thinc.api import set_dropout_rate, chain, Relu, Softmax, Adam import numpy from ..util import make_tempdir @pytest.fixture de...