source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
wrapper.py | from queue import Queue
from .factory import deserialize
from .factory.utils import Method
from simplejson import loads, dumps
from threading import Event, Thread, Lock
from .constructors import error, close
from .exception import RpcError, RpcTimeout, IllegalRequest
from ctypes import CDLL, c_char_p, c_void_p, c_doubl... |
test_middleware.py | # coding=utf-8
import threading
from qrpc.client import RpcClient
from qrpc.server import Server
def test_middleware():
HOST_POST = ('127.0.0.1', 8080)
server = Server()
@server.registe("service/hello", deprecated=True)
def test_hello(name=None):
if name:
return "hello " + name
... |
BS_no_circle.py | import cv2
from tkinter import Tk
from tkinter.filedialog import askopenfilename
import numpy as np
import threading
def main():
cap = cv2.VideoCapture(vid_path)
ret, previous_frame1 = cap.read()
fgbg = cv2.createBackgroundSubtractorMOG2()
hsv = np.zeros_like(previous_frame1)
hsv[...,1] ... |
screens.py | import asyncio
from weakref import ref
from decimal import Decimal
import re
import threading
import traceback, sys
from typing import TYPE_CHECKING, List, Optional
from kivy.app import App
from kivy.cache import Cache
from kivy.clock import Clock
from kivy.compat import string_types
from kivy.properties import (Objec... |
Application.py | from utils import ATestUtils
import serial
import sys
import os
import traceback
import multiprocessing
import platform
import signal
# Application类
class Application:
# 构造方法
def __init__(self, port, baud_rate, ATListFileNames, loopTimes):
self.port = port
self.baud_rate = baud_rate
s... |
conftest.py | # Copyright 2020 ScyllaDB
#
# 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, sof... |
extract_feature.py | # -*- coding: utf-8 -*-
"""
@author:XuMing(xuming624@qq.com)
@description:
"""
import os
from queue import Queue
from threading import Thread
import tensorflow as tf
import text2vec
from text2vec.bert import modeling
from text2vec.bert import tokenization
from text2vec.bert.graph import optimize_graph
class InputE... |
main.py | import requests, json, sqlite3, os, sys, psutil, threading, re, time, random, datetime, untangle, subprocess, textwrap
from lxml import html
from lxml import etree
from bs4 import BeautifulSoup
from io import BytesIO
from PIL import Image, ImageDraw, ImageFont
from colorama import Fore, Back, Style
config = json.loads... |
tcp_server.py | import socket
import threading
import SocketServer
class ThreadedTCPRequestHandler(SocketServer.BaseRequestHandler):
def handle(self):
print "Received a new request!"
data = self.request.recv(1024)
cur_thread = threading.current_thread()
response = "{}: {}".format(cur_thread.name, d... |
app.py | from src.kafka_module.kf_service import process_tesseract_ocr_kf, tesseract_ocr_request_worker
from anuvaad_auditor.loghandler import log_info
from anuvaad_auditor.loghandler import log_error
from flask import Flask
from flask.blueprints import Blueprint
from flask_cors import CORS
from src import routes
import config
... |
scCloudStorage.py | """
The Cloud Storage File.
"""
import time
import json
import string
from threading import Thread
from scratchconnect.CloudConnection import CloudConnection
from scratchconnect.scEncoder import Encoder
SUPPORTED_CHARS = list(string.ascii_uppercase + string.ascii_lowercase + string.digits + string.punctuat... |
wsdump.py | #!C:\Users\HP\dekatron\iotex_chart\venv\Scripts\python.exe
"""
wsdump.py
websocket - WebSocket client library for Python
Copyright 2021 engn33r
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
... |
presubmit_support.py | #!/usr/bin/env python
# Copyright (c) 2012 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.
"""Enables directory-specific presubmit checks to run at upload and/or commit.
"""
from __future__ import print_function
__versio... |
temp_heft_scheduler.py | import sys
import os
sys.path.append(os.getcwd())
import pyschedcl as fw
import logging
import argparse
import json
#import sys
import time
import datetime
#import plotly.plotly as py
from os import listdir
from os.path import isfile, join
import matplotlib.pyplot as plt
import networkx as nx
import csv
import random
i... |
runNetscope.py | # -*- coding: utf-8 -*-
"""
Netscope
"A web-based - offline - tool for visualizing neural network topologies.
It currently supports UC Berkeley's Caffe framework."
github.com/ethereon/netscope
****
Offline Version of Netscope
https://github.com/birolkuyumcu/offline-netscope
@author: bluekid70@gmail.com
"""
from PySid... |
test_asyncore.py | import asyncore
import unittest
import select
import os
import socket
import sys
import time
import errno
import struct
import threading
from test import support
from test.support import socket_helper
from io import BytesIO
if support.PGO:
raise unittest.SkipTest("test is not helpful for PGO")
... |
test_nanny.py | import asyncio
import gc
import logging
import multiprocessing as mp
import os
import random
import sys
from contextlib import suppress
from unittest import mock
import psutil
import pytest
pytestmark = pytest.mark.gpu
from tlz import first, valmap
from tornado.ioloop import IOLoop
import dask
from dask.utils impor... |
test_multiprocess.py | #!/usr/bin/env python
#
# Copyright (c) 2011, Willow Garage, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# n... |
testWebserver.py | # Python 3 server example
from http.server import BaseHTTPRequestHandler, HTTPServer
import time, threading
hostName = 'localhost' # This should be "frcvision.local" on the pi
serverPort = 1736
mostRecentCmd = None
class TestWebserver(BaseHTTPRequestHandler, HTTPServer):
def do_GET(self):
gl... |
plugin.py | import threading
from binascii import hexlify, unhexlify
from commerciumelectro.util import bfh, bh2u
from commerciumelectro.bitcoin import (b58_address_to_hash160, xpub_from_pubkey,
TYPE_ADDRESS, TYPE_SCRIPT, NetworkConstants)
from commerciumelectro.i18n import _
from commerciumelectro.... |
init_app.py | # Script run when first creating application
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
import threading
import argparse
import os
import pandas as pd
import tensorflow as tf
import numpy as np
import json
from im... |
check_update.py | import kivy
kivy.require('1.0.9')
from kivy.lang import Builder
from kivy.app import App
from kivy.uix.gridlayout import GridLayout
from kivy.uix.popup import Popup
from kivy.properties import *
from kivy.uix.progressbar import ProgressBar
from kivy.clock import Clock
from jnius import autoclass, cast
import urllib
... |
pesa2.py | # -*- coding: utf-8 -*-
#"""
#Created on Sun Jun 28 18:21:05 2020
#
#@author: Majdi Radaideh
#"""
from neorl.hybrid.pesacore.er import ExperienceReplay
from neorl.hybrid.pesacore.gwo import GWOmod
from neorl.hybrid.pesacore.de import DEmod
from neorl.hybrid.pesacore.xnes import XNESmod
from neorl.hybrid.pes... |
driver.py | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
# Copyright (c) 2010 Citrix Systems, Inc.
# Copyright (c) 2011 Piston Cloud Computing, Inc
# Copyright (c) 2012 Univer... |
client.py | from pythontools.core import logger, events
import socket, json, time, base64, traceback, getmac, math
from threading import Thread
from pythontools.dev import crypthography, dev
class Client:
def __init__(self, password, clientID, clientType, reconnect=True):
self.clientSocket = socket.socket(socket.AF_I... |
test_windows_events.py | import os
import signal
import socket
import sys
import time
import threading
import unittest
from unittest import mock
if sys.platform != 'win32':
raise unittest.SkipTest('Windows only')
import _overlapped
import _winapi
import asyncio
from asyncio import windows_events
from test.test_asyncio i... |
node.py | import socket
import threading
import os
import hashlib
import json
from pathlib import Path
import logging
import sys
import time
from watchdog.observers import Observer
from watchdog.events import PatternMatchingEventHandler
class Handler(PatternMatchingEventHandler):
def __init__(self,childS,dataFolder): ... |
email_processor.py | from datetime import datetime
import threading
import json
import imaplib
import os
import email
import time
import subprocess
import pty
import serial
from .oauth2 import *
class IridiumEmailProcessor(object):
def __init__(self, radio_keys_config, elasticsearch, downlink_parser_path):
# Connection to elas... |
keepkey.py | from binascii import hexlify, unhexlify
import traceback
import sys
from typing import NamedTuple, Any, Optional, Dict, Union, List, Tuple, TYPE_CHECKING
from electrum_firo.util import bfh, bh2u, UserCancelled, UserFacingException
from electrum_firo.bip32 import BIP32Node
from electrum_firo import constants
from elect... |
bruteForcer.py | import logging
import threading
import time
import random
from datetime import datetime
import json
import requests
from colorama import init,Fore
import os
print("Starting Chaos ;)")
f = open('codes.txt', 'a')
joinname = str(input("Input a Join Name: "))
threadamount = int(input("Input Number of threads:... |
test_urllib.py | """Regression tests for what was in Python 2's "urllib" module"""
import urllib.parse
import urllib.request
import urllib.error
import http.client
import email.message
import io
import unittest
from unittest.mock import patch
from test import support
import os
try:
import ssl
except ImportError:
... |
sign_old.py | from player import *
from threading import Thread
from elliptic import inv,mulp,add
import datetime
import time
def broadcast(players):
#players = ComputePlayer.ComputeList
#print(players[0].rec_port, players[1].rec_port)
t1 = Thread(target=players[0].prep_rec, args=())
t2 = Thread(target=players[1].s... |
install.py | # Date: 01/09/2019
# Author: Neowise
# Description: Install file
from time import sleep
from queue import Queue
from os.path import exists
from subprocess import Popen
from threading import Thread, RLock
class Install:
def __init__(self, path_to_req):
self.lock = RLock()
self.is_alive = True
... |
wandb_run.py | #
# -*- coding: utf-8 -*-
from __future__ import print_function
import atexit
from datetime import timedelta
import glob
import json
import logging
import numbers
import os
import platform
import re
import sys
import threading
import time
import traceback
from types import TracebackType
from typing import (
Any,
... |
docker.py | import os
import json
import sys
import uuid
import docker
import logging
import tempfile
import multiprocessing
from shutil import copyfile
from . import config as docker_config
from pywren_ibm_cloud.utils import version_str
from pywren_ibm_cloud.config import JOBS_PREFIX
from pywren_ibm_cloud.version import __version... |
run.py |
# coding: utf-8
"""
Usage:
python [options]
Options:
-h,--help 显示帮助
-i,--inference 推断 [default: False]
-a,--algorithm=<name> 算法 [default: ppo]
-c,--config-file=<file> 指定模型的超参数config文件 [default: None]
-e,--env=<file> 指定环境名称 [defaul... |
util.py |
import multiprocessing
try:
from setproctitle import setproctitle
PROCTITLE_LOADED = True
except ImportError:
PROCTITLE_LOADED = False
def connectAll(nodeList):
for i in range(len(nodeList)):
for j in range(len(nodeList)):
if i != j:
nodeList[i].connect(nodeList[... |
mqtt_state.py | import paho.mqtt.client as mqtt
from threading import Thread
import time
import queue
class MQTTState(object):
TOPIC_NAME = 'gaz/state'
TOPIC_QOS = 0
class MQTTStatePub(object):
def __init__(self, ip='127.0.0.1'):
self.client = mqtt.Client(client_id='state_pub')
self.client.connect(host=ip... |
jsfillmanContigFilterTestServer.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import datetime
import json
import os
import random as _random
import sys
import traceback
from getopt import getopt, GetoptError
from multiprocessing import Process
from os import environ
from wsgiref.simple_server import make_server
import requests as _requests
from json... |
job_api.py | import os
from threading import Thread, Event
from saucelab_api_client.category import Base
from saucelab_api_client.models.build import Build
from saucelab_api_client.models.job import JobSearch, Job, JobAssets
from saucelab_api_client.models.service import print_progress, get_dict_from_locals
class JobsApi(Base):
... |
test_cancellation.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... |
text.py | import threading
from telegram.ext.dispatcher import run_async
from Brain.Modules.help import get_help
from Brain.Utils.dbfuncs import user_collect, command_collect
from Brain.Utils.strings import logger
@run_async
def text_handler(update, context):
logger.info("into get_stats")
chat = update.effective_chat... |
auth.py | """
Gitflic authentication wrapper.
"""
import json
import os
import threading
from urllib.parse import quote_plus
import webbrowser
from enum import Enum
from typing import Union
import logging
import requests
from .exceptions import AuthError, GitflicExceptions
from .__version__ import __version__
from gitflic.Gitf... |
workers.py | # /*
# * Copyright 2010-2017 Amazon.com, Inc. or its affiliates. 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.
# * A copy of the License is located at
# *
# * http://aws.amazon.com/apache2.0
# *
# * or i... |
panes.py | # ===============================================================================
# Copyright 2015 Jake Ross
#
# 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... |
JsonRpc2Client.py | import threading, json, sys
from Utils import *
class JsonRpc2Client(object):
"""Simple Json RPC Client"""
class ClientException(Exception): pass
class RequestReplyException(Exception):
def __init__(self, message, reply, request = None):
Exception.__init__(self, message)
self._reply = reply
self._reque... |
stream_audio.py | #!/usr/bin/env python
# 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... |
lrcshowrs.py | # -*- coding: utf-8 -*-
import sys
from threading import Thread
from gi.repository import GLib
import dbus
import dbus.mainloop.glib
class LrcReceiver:
def __init__(self, update_callback, logger):
self.update_callback = update_callback
self.logger = logger
self.bus = None
self.... |
main.py | import discord
import os
import random
import requests
import sys
import threading
import time
import yaml
sys.path.append("./objection_engine")
from deletion import Deletion
from discord.ext import commands, tasks
from message import Message
from objection_engine.beans.comment import Comment
from objection_engine.re... |
local_state_collector.py | """Collecting the states of the local system"""
from datetime import datetime
import logging
import os
import re
import signal
import threading
import psutil
import yaml
from forch.proto.process_state_pb2 import ProcessState
from forch.proto.shared_constants_pb2 import State
from forch.proto.system_state_pb2 import ... |
secion15.py | # encoding:utf-8
#! python3
# section15.py -
import datetime,time,threading,subprocess
def showdatetime():
now=datetime.datetime.now()
print(now)
def unixtime2datetime():
now=datetime.datetime.fromtimestamp(time.time())
print(now)
def beforedate():
datedelta=datetime.timedelta(days=-10)
targe... |
netconsole.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import socket
import sys
import argparse
import termios
import fcntl
import os
import time
import signal
from datetime import datetime
from threading import Thread
HOST = '' # Symbolic name meaning all available interfaces
PORT = 6666 # Default netconsole client IN Port... |
tests.py | from __future__ import unicode_literals
from datetime import datetime
import threading
from django.core.exceptions import ObjectDoesNotExist, MultipleObjectsReturned
from django.db import connections, DEFAULT_DB_ALIAS
from django.db import DatabaseError
from django.db.models.fields import Field, FieldDoesNotExist
fro... |
game.py | import math
import os
import re
import threading
from datetime import datetime
from typing import Dict, List, Optional, Union
from kivy.clock import Clock
from katrain.core.constants import (
HOMEPAGE,
OUTPUT_DEBUG,
OUTPUT_INFO,
PLAYER_AI,
STATUS_ANALYSIS,
STATUS_INFO,
STATUS_TEACHING,
)
f... |
test_cluster_failures.py | import tempfile
import multiprocessing
import aiohttp
import requests
import time
from functional_tests import utils_proxy
from . import utils
def test_partial_network_failure():
"""
This test assumes that we have three nodes (A, B and C). We will simulate
that the network between A and C is broken, su... |
map_reduce.py | r"""
Parallel computations using RecursivelyEnumeratedSet and Map-Reduce
There is an efficient way to distribute computations on a set
`S` of objects defined by :func:`RecursivelyEnumeratedSet`
(see :mod:`sage.sets.recursively_enumerated_set` for more details)
over which one would like to perform the following kind of... |
saltmod.py | """
Control the Salt command interface
==================================
This state is intended for use from the Salt Master. It provides access to
sending commands down to minions as well as access to executing master-side
modules. These state functions wrap Salt's :ref:`Python API <python-api>`.
.. versionadde... |
reg_data_loader_onfly.py | from __future__ import print_function, division
import blosc
import torch
from torch.utils.data import Dataset
from .reg_data_utils import *
import SimpleITK as sitk
from multiprocessing import *
blosc.set_nthreads(1)
import progressbar as pb
class RegistrationDataset(Dataset):
"""registration dataset."""
def... |
util.py | #!/usr/bin/env python
# encoding: utf-8
"""Common utilities."""
from contextlib import contextmanager
from shutil import rmtree
from six.moves.queue import Queue
from tempfile import mkstemp
from threading import Thread
import logging as lg
import os
import os.path as osp
_logger = lg.getLogger(__name__)
class Hd... |
Arduino.pyw | # -*- coding: utf-8 -*-
"""
Created on Mon Oct 5 18:19:45 2020
@author: José Correia
"""
import serial
import serial.tools.list_ports
ports = list(serial.tools.list_ports.comports())
baud_rate = 9600
import time
from threading import Thread
from PyQt5 import QtWidgets, uic
from datetime import datetime
import sys
... |
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... |
StaryNight.py | import openrgb , time , sys , random, threading
from openrgb.utils import RGBColor , ModeData , DeviceType , ZoneType
def UserInput():
"""It will always return 5 things;\n
Color1, Color2, Speed, Devices for reversal, Devices that are enables"""
Color1 = Color2 = Speed = ReversedDevice = OnlySet = None
... |
a_threading.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# setting up modules used in the program
from socket import socket
from socket import *
import threading
import socket
import time
server_status = True
client_status = True
# create a server class
class Server(threading.Thread):
# initialize server socket
def ... |
Arp_Spoofing.py | #!/usr/bin/python
from scapy.all import *
import threading
import os
import sys
img = """\n
_______ _____ _____ _ ________ _____
|__ __| __ \ /\ / ____| |/ / ____| __ \
| | | |__) | / \ | | | ' /| |__ | |__) |
| | | _ / / /\ \| | | < | __| | _ /
| | | | \... |
plotting.py | """
vtk plotting module
"""
from multiprocessing import Process
import colorsys
import numpy as np
import vtkInterface
import imageio
import time
import logging
from PIL import Image
log = logging.getLogger(__name__)
log.setLevel('CRITICAL')
try:
import vtk
from vtk.util import numpy_support as VN
font_... |
catalog_collections.py | # cspell:ignore ftype, chksum
"""Catalog collections within the execution environment."""
import argparse
import hashlib
import json
import multiprocessing
import os
import re
import subprocess
import sys
from collections import Counter
from collections import OrderedDict
from datetime import datetime
from glob import... |
RPS_Battel.py | import tkinter as t
from os.path import join
from os import getcwd, _exit
from requests.exceptions import ConnectionError
from tkinter import messagebox
from firebase import firebase
from threading import Thread
class RPS_Battel:
""" game window"""
def __init__(s, my_key, my_name, p_key, p_name, app, link, o... |
RCservice.py | #! /usr/bin/env python
import NECreader
import socket
import threading
import time
HOST = '127.0.0.1'
PORT = 50007
DEBUG = True
class RCservice:
def __init__(s,host,port):
s.socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.socket.bind((host,port))
s.socket.listen(5)
s.clients = []
s.running = T... |
app.py | import configparser
from flask import Flask, redirect, render_template, request, session, url_for
import logging
import os
import requests
from requests_oauthlib import OAuth1Session
import time
import twitter
import threading as td
FORMAT = '%(asctime)s %(name)s %(levelname)s %(message)s'
logging.basicConfig(filename... |
update_instances.py | #!/usr/bin/env python3
#
# Copyright 2018 The Bazel 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 ... |
checkStatus.py | import threading
from time import sleep
from requests import get, exceptions
from src.fallback import cloudflare
from os import system, name
import socket
import json
import random
import sys
class checker():
def __init__(self, domainList, delayS):
self.domains = domainList
self.active... |
__init__.py | import time, threading, datetime
from essentials import tokening
EVERY_SECOND = "second"
EVERY_MINUTE = "minute"
EVERY_HOUR = "hour"
EVERY_DAY = "day"
EVERY_WEEK = "week"
EVERY_MONTH = "month"
EVERY_YEAR = "year"
class EventListener:
def __init__(self, viaDate=True):
self.events = {}
self.viaDate... |
main.py | from sys import stdout
from requests import post
from os import system, _exit, path
from random import choice, randint
from colors import green, red, reset
from time import time, sleep, strftime, gmtime
from threading import Thread, Lock, active_count
from string import ascii_letters, ascii_lowercase, digits
system('c... |
DatasetLoader.py | #!/usr/bin/python
#-*- coding: utf-8 -*-
import torch
import numpy
import random
import pdb
import os
import threading
import time
from queue import Queue
from dataLoader import *
import video2npy
class DatasetLoader(object):
def __init__(self, dataset_file_name, nPerEpoch, nBatchSize, maxFrames, nDataLoaderTh... |
entry_point.py | import getopt
import multiprocessing
import os
import sys
import time
import webbrowser
from cheroot.wsgi import Server as WSGIServer, PathInfoDispatcher
from .app import create_app
from .interpreter import Interpreter
def delayed_browser_open(openurl, port):
time.sleep(3)
webbrowser.open("http://" + openu... |
server.py | import logging
import tempfile
from http import HTTPStatus
import threading
from pathlib import Path
from typing import Dict
from filelock import Timeout, FileLock
from flask import Flask, request, jsonify
from ariadne.classifier import Classifier
from ariadne.protocol import parse_prediction_request, parse_training_... |
TSI-calibrate.py | import serial
import sys
import time
import numpy as np
import struct
import threading
import matplotlib.pyplot as plt
def readTSI(dev, bdrate, samplesNb, periodMs : int):
ser = serial.Serial(dev, bdrate, timeout=10)
command = "SSR" + str(periodMs).zfill(4)
ser.write(command.encode())
ser.write(b'\r')... |
HiFiGANDataset.py | import math
import os
import random
from multiprocessing import Manager
from multiprocessing import Process
import librosa
import soundfile as sf
import torch
from torch.utils.data import Dataset
from tqdm import tqdm
from Preprocessing.AudioPreprocessor import AudioPreprocessor
class HiFiGANDataset(Dataset):
... |
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... |
node.py | # Copyright 2019 Comcast Cable Communications Management, 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... |
pacemaker.py | """Pacemaker thread."""
import contextlib
import threading
from being.backends import CanBackend
from being.configuration import CONFIG
from being.logging import get_logger
INTERVAL = CONFIG['General']['INTERVAL']
class Once:
"""Value changed detector."""
def __init__(self, initial):
self.prev = ... |
SleepLogger.py | import numpy as np
import time
import threading
import h5py
import datetime
import logging
import config
import drivers.MMA as MMA
from drivers.OLED import OLED
from Stimulus import AudioStimulus
class SleepLogger:
def __init__(self):
"""
Sleep logger with adaptive sampling and various logging m... |
run.py | #!/usr/bin/env python
"""dMRI preprocessing workflow."""
from .. import config
def main():
"""Entry point."""
import os
import sys
import gc
from multiprocessing import Process, Manager
from .parser import parse_args
from ..utils.bids import write_derivative_description
parse_args()
... |
imgnet-val-resnet50.py | #!/usr/bin/env python2.7
from __future__ import division
# ---
# Keras implementation of testing ResNet-50 on ImageNet 2012 Val.
# Li Ding, Oct. 20, 2017
# ---
import numpy as np
import os
import tensorflow as tf
from keras.applications.resnet50 import ResNet50, preprocess_input, decode_predictions
import xmltodict
i... |
pantea.py | #!/usr/bin/env python
# -*- coding: utf-8 *-*
#
# Pantea v1.0
# Nima Ghotbi
# http://nima.cu.cc
#CONFIGS START
CONFIG_SOUNDPLAYER_CMD = "aplay -q [FILE]"
#CONFIGS END
import thread
import os
import sqlite3
import socket
import time
from struct import pack
from selenium import webdriver
import gtk
import gobject
impor... |
stream.py | from time import sleep
from tweepy import StreamListener, Stream
from macros import macros
from threading import Thread
from json import loads, dumps
# TODO
# ADD CUSTOM RESPONSES TO BEING @'ed!
# CLASS OUR STREAM LISTENER
class MyStreamListener(StreamListener):
""" def on_delete(self, status_id, user_id):
... |
multiprocess_example.py | from multiprocessing import Process
import time
def print_time(threadName, delay, iterations):
start = int(time.time())
for i in range(0,iterations):
time.sleep(delay)
seconds_elapsed = str(int(time.time()) - start)
print (threadName if threadName else seconds_elapsed)
processes = []
... |
collector_service.py | import os
import json
import time
import threading
import requests
# from kafka import KafkaProducer
def read_envoy_access_logs(app_no):
#work on more efficient reading of streaming logs
read_till_now = set()
while True:
stream = os.popen('kubectl logs -l app=cmpe-295-app-{} -c istio-proxy'.format... |
singleMachine.py | # Copyright (C) 2015-2016 Regents of the University of California
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... |
test_reset.py | import airsimneurips
import threading
import time
class ReproduceResetRaceCondition():
def __init__(self, drone_name = "drone_1"):
self.airsim_client = airsimneurips.MultirotorClient()
self.airsim_client_2 = airsimneurips.MultirotorClient()
self.airsim_client_3 = airsimneurips.MultirotorCli... |
Proyecto2_Sistop.py |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from tkinter import *
from tkinter import ttk
import threading
import time
import random
num_compradores_por_turno = 10
contador_compradores = 0
contador_compradorOnline = 0
contador_compradorFisico = 0
num_boletos = 10
mutex_compradoresOnline = threading.Semaphore(1)
mu... |
Task_Peer_Code_02NOV17.py | import socket
import threading
import shlex
import os
import platform
import time
ReqRFC_list = [8127, 8181, 8187, 8189, 8191, 8193, 8194, 8204, 8205, 8206, 8207, 8208, 8209, 8210, 8211, 8213, 8214, 8215, 8216, 8218, 8219, 8220, 8221, 8223, 8227, 8228, 8229, 8230, 8231, 8232, 8233, 8234, 8235, 8236, 8238, 823... |
validate.py | #!/usr/bin/env python3
import argparse
import os, atexit
import textwrap
import time
import tempfile
import threading, subprocess
import barrier, finishedSignal
import signal
import random
import time
from enum import Enum
from collections import defaultdict, OrderedDict
BARRIER_IP = 'localhost'
BARRIER_PORT = 10... |
9.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2012-2014 Matt Martz
# 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.or... |
GSM.py | import threading
import logging
import Queue
import sys
import os
import gammu
class GSM(object):
def __init__(self,piManager):
# create the object yo
logging.debug("Create the GSM object")
self.name = "GSM"
self.piManager = piManager
# Create the local queue
self.Queue = Queue.PriorityQueue()
# Conne... |
tb_gateway_service.py | # Copyright 2021. ThingsBoard
#
# 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 ... |
loopfinder.py | #!/usr/bin/env python2
'''
Usage: loopfinder.py [options] FILE OUT_DIR
Options:
--num-hashes NUM_HASHES More hashes => better matches [default: 120].
--min-time MIN_TIME Minimum time to match [default: 1].
--max-time MAX_TIME Maximum time to match [default: 10].
--time-distance TIME_DIST Testing testing [... |
test_livecli.py | # -*- coding: utf-8 -*-
import unittest
import time
import threading
import logging
from click.testing import CliRunner
from nseta.cli.livecli import live_quote, scan, news, top_picks
from nseta.common import urls
from nseta.scanner.stockscanner import *
from baseUnitTest import baseUnitTest
from nseta.scanner.scanne... |
conftest.py | # Copyright (c) 2011 Florian Mounier
# Copyright (c) 2011 Anshuman Bhaduri
# Copyright (c) 2014 Sean Vig
# Copyright (c) 2014-2015 Tycho Andersen
#
# 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 Soft... |
worker.py | """This module contains worker that makes non-blocking HTTP requests.
Copyright (c) 2022 https://reportportal.io .
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/L... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.