source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
settings.py | from datetime import date
import time
import webbrowser
import tkinter as tk
import tkinter.ttk as ttk
from tkinter import messagebox
import threading
from pathlib import Path
import api.remarkable_client
from api.remarkable_client import RemarkableClient
import utils.config as cfg
from model.item_manager import ItemM... |
providers.py | import json
import asyncio
import threading
from datetime import datetime
from urllib.parse import urlparse
from aiohttp import ClientSession
from backend import config, storage, const
class BaseJSONProvider:
def __init__(self, url, prov_id=None, headers=None):
self._url = urlparse(url)
self._id ... |
test_basic.py | # coding: utf-8
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import collections
from concurrent.futures import ThreadPoolExecutor
import json
import logging
import os
import random
import re
import setproctitle
import shutil
import six
import socket
impor... |
test_memusage.py | import decimal
import gc
import itertools
import multiprocessing
import weakref
import sqlalchemy as sa
from sqlalchemy import ForeignKey
from sqlalchemy import inspect
from sqlalchemy import Integer
from sqlalchemy import MetaData
from sqlalchemy import select
from sqlalchemy import String
from sqlalchemy import test... |
test_viz.py | """
Copyright (c) 2021, Ouster, Inc.
All rights reserved.
"""
import weakref
from typing import TYPE_CHECKING, Tuple
import pytest
import numpy as np
import random
from ouster import client
# test env may not have opengl, but all test modules are imported during
# collection. Import is still needed to typecheck
if... |
mastermind.py | import logging
import threading
from typing import Union, List, Dict, Tuple, Any
import astropy.units as u
from pyobs.modules import Module
from pyobs.object import get_object
from pyobs.events.taskfinished import TaskFinishedEvent
from pyobs.events.taskstarted import TaskStartedEvent
from pyobs.interfaces import IFit... |
pipeline.py | import queue
import threading
from abc import abstractmethod, ABC
from typing import Generator, List
class PipelinePacket:
def __init__(self, label, data):
self.label = label
self.data = data
class PipelineStep(ABC):
def __init__(self, labels: List[str] or None):
self.q_in = None
... |
algo04_sarsa.py | import os
import pickle
import argparse
import threading
import click
import matplotlib.pyplot as plt
import numpy as np
from matplotlib import animation
from notebooks.helpers import hldit
from notebooks.algo.agent import PolicyBasedTrader
from notebooks.algo.environment import Environment
from notebooks.cardrive.vi... |
util.py | import math
import os, pickle
import random
import copy
import time
import numpy as np
import settings
from warnings import warn
def get_pairwise_distance_mudra(r):
pair_dis = np.abs(r - r[:, None])
pair_dis = np.reshape(pair_dis,len(r)*len(r))
pair_dis.sort()
pair_dis = pair_dis[len(r):]
return ... |
example_binance_jex.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# File: example_binance_jex.py
#
# Part of ‘UNICORN Binance WebSocket API’
# Project website: https://github.com/oliver-zehentleitner/unicorn-binance-websocket-api
# Documentation: https://oliver-zehentleitner.github.io/unicorn-binance-websocket-api
# PyPI: https://pypi.... |
stacksurveillance.py | """
Class to watch the calling thread and report what it's doing.
https://stackoverflow.com/questions/45290223/check-what-thread-is-currently-doing-in-python
"""
import threading
import sys
import time
class StackSurveillance:
def __init__(self, thread=threading.current_thread(), file=sys.stderr, interval=60.0... |
chatovod2xmpp.py | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
import socket
import time
import random
import traceback
from hashlib import sha1
from base64 import b64encode, b64decode
from threading import RLock, Thread
from urllib2 import unquote, quote, urlopen
import chatovod
from pyjabberd_utilites import load_config, node_read... |
test_utils.py | # Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
app_utils.py | # import the necessary packages
from threading import Thread
import datetime
import cv2
class FPS:
def __init__(self):
# store the start time, end time, and total number of frames
# that were examined between the start and end intervals
self._start = None
self._end = None
se... |
network.py | from threading import Thread
import socket
import select
import time
import os
import clingo
import argparse
from PyQt5.QtCore import *
class VisualizerSocket(object):
def __init__(self, default_host = '127.0.0.1', default_port = 5000, socket_name = 'socket'):
self._host = default_host
se... |
email.py | from threading import Thread
from flask import current_app, render_template
from flask.ext.mail import Message
from . import mail
import os
def send_async_email(app, msg):
with app.app_context():
mail.send(msg)
def send_email(to, subject, template, **kwargs):
app = current_app._get_current_object()
... |
ultrasound.py | import time
import RPi.GPIO as GPIO
import datetime as dt
import math
import sys
from multiprocessing import Process, Value, Array
import Adafruit_DHT
import speed_of_sound
import kalman
x_est, error_est = kalman.kalman(0.02, 0.02, 0.01, 0.005, 0.0001)
c_in_us = Value('d', speed_of_sound.calculate_c(22, 50) / 1e6)
... |
testDigitsReplacement.py | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
from socket import *
import threading
import random
import time
import sys
import hashlib
import ssl
PROXY_ADDRESS = ('127.0.0.1', 8080)
PROXY_SSL = False
PROXY_MEGABYTES = 32
port = None
port_set_event = threading.Event()
test_path = "/what?ever=42"
... |
tello.py | #!/usr/bin/python3
import os
import threading
import socket
import time
import cgi
import cgitb
# import face_recognition
cgitb.enable()
print("Content-type:text/html\n")
form = cgi.FieldStorage()
command = form.getvalue("command")
class Tello(object):
def __init__(self):
self.tello_ip = '192.168.10.1'
... |
teradeep.py | import setproctitle #Set process name to something easily killable
from threading import Thread
import cv2
import os
import subprocess #so I can run subprocesses in the background if I want
#import ConfigParser #To read the config file modified by menu.py
from subprocess import call #to call a process in the foreground... |
gui.py | import json
import os
import sys
import threading
import time
import webbrowser
import mailpile.auth
import mailpile.util
from mailpile.commands import Quit
from mailpile.i18n import gettext as _
from mailpile.safe_popen import Popen, PIPE, MakePopenSafe, MakePopenUnsafe
from mailpile.ui import Session
from mailpile.u... |
tests.py | #!env/bin/python
"""Tucker Sync test module.
Main test suite for the algorithm, server and client.
WARNING:
DATA LOSS!
Do not run tests against a production database with live data.
All database tables will be dropped and then created after tests.
Leaving the database ready for production with fresh ... |
app.py | # ElectrumSV - lightweight Bitcoin client
# Copyright (C) 2019-2020 The ElectrumSV Developers
#
# 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 limita... |
vpn_status.py | # -*- coding: utf-8 -*-
"""
Drop-in replacement for i3status run_watch VPN module.
Expands on the i3status module by displaying the name of the connected vpn
using pydbus. Asynchronously updates on dbus signals unless check_pid is True.
Configuration parameters:
cache_timeout: How often to refresh in seconds when... |
detect_hands.py | import cv2
import numpy as np
import mediapipe as mp
import time
import threading
class HandDetector():
def __init__(self, static_mode = False, maxHands = 2, complexity=1, detectionCon = 0.5, trackCon = 0.5):
self.static_mode = static_mode
self.maxHands = maxHands
self.complexity = complexi... |
test.py | import json
import os.path as p
import random
import subprocess
import threading
import logging
import time
from random import randrange
import pika
import pytest
from google.protobuf.internal.encoder import _VarintBytes
from helpers.client import QueryRuntimeException
from helpers.cluster import ClickHouseCluster
fro... |
chatServer.py | import os
import sys
import time
import queue
import train
import requests
import datetime
import threading
import jieba
import http.server
from os import path
from hparams import Hparams
from cgi import parse_header
from urllib.parse import parse_qs
from chat_settings import ChatSettings
from chat import ChatSession
... |
validation_tester.py | ''' Tester module for testing Validation Provider '''
import threading
import time
from math import floor
from random import random, randint
import requests
import karmaserver.utils as utils
from karmaserver.constants import ENDPOINT, MINIMUM_VOTES, VOTES_TO_DISPUTED
from karmaserver.tests.test import TestAbstract
f... |
client.py | # -*- coding: utf-8 -*-
#
# Copyright (C) 2007-2009 Christopher Lenz
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
from datetime import datetime
import doctest
import os
import os.path
import shutil
from StringIO im... |
utils.py | """
Helpful functions that don't belong in a more specific submodule.
"""
import importlib
import logging
import os
import pkgutil
import signal
import uuid
from contextlib import contextmanager
from inspect import isclass, isfunction
from multiprocessing import Process
from ophyd.signal import EpicsSignalBase
logger... |
lab12.py | """
This file compiles the code in Web Browser Engineering,
up to and including Chapter 12 (Scheduling and Threading),
without exercises.
"""
import argparse
import dukpy
import functools
import socket
import ssl
import time
import threading
import tkinter
import tkinter.font
from lab10 import request
class Timer:
... |
test_smr.py | import logging
import threading
import time
import unittest
from multiprocessing import Process
from test.instantiation import fakeslm_instantiation
from test.onboarding import fakeslm_onboarding
from test.terminating import fakeslm_termination
from test.updating import fakeslm_updating
from manobase.messaging import... |
oms_events.py | #!/usr/bin/env python
"""
@package ion.agents.platform.rsn.simulator.oms_events
@file ion/agents/platform/rsn/simulator/oms_events.py
@author Carlos Rueda
@brief OMS simulator event definitions and supporting functions.
Demo program included that allows to run both a listener server and a
notif... |
tasks.py | # -*- coding: utf-8 -*-
"""
Created on Wed Jun 24 10:37:57 2020
@author: OPEGLAB
"""
# coding: utf-8
# Library that depends on the pyLab library and that contains the main program/functions
# for driving the LEC devices at diferent modes.
import numpy as np
from time import sleep, time
from pyInstruments.instrument... |
kb_PICRUSt2Server.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... |
test_memory.py | import ctypes
import gc
import pickle
import threading
import unittest
import fastrlock
import pytest
import cupy.cuda
from cupy.cuda import device
from cupy.cuda import memory
from cupy.cuda import stream as stream_module
from cupy import testing
class MockMemory(memory.Memory):
cur_ptr = 1
def __init__(s... |
get_coords.py | import requests
import json
from selenium import webdriver
import csv
from time import sleep
from datetime import date,timedelta
from threading import Thread
from concurrent.futures import ThreadPoolExecutor
import os
from reverse_geocoding import *
import urllib3
urllib3.disable_warnings()
progress_count = 0
#Bus i... |
test.py | import json
import os.path as p
import random
import socket
import threading
import time
import logging
import io
import string
import ast
import math
import avro.schema
import avro.io
import avro.datafile
from confluent_kafka.avro.cached_schema_registry_client import CachedSchemaRegistryClient
from confluent_kafka.av... |
frontend_test.py | #!/usr/bin/env python
"""Unittest for grr http server."""
import hashlib
import os
import socket
import threading
import ipaddr
import portpicker
import requests
import logging
from grr.client import comms
from grr.client.client_actions import standard
from grr.lib import action_mocks
from grr.lib import aff4
fro... |
test_weakref.py | import gc
import sys
import unittest
import collections
import weakref
import operator
import contextlib
import copy
import threading
import time
import random
from test import support
from test.support import script_helper
# Used in ReferencesTestCase.test_ref_created_during_del() .
ref_from_del = None
# Used by Fi... |
datasets.py | import glob
import math
import os
import random
import shutil
import time
from itertools import repeat
from multiprocessing.pool import ThreadPool
from pathlib import Path
from threading import Thread
import cv2
import numpy as np
import torch
from PIL import Image, ExifTags
from torch.utils.data import Dataset
from t... |
schedule.py | #!/usr/bin/env python3
"""Module for the scheduling of observations."""
__author__ = 'Philipp Engel'
__copyright__ = 'Copyright (c) 2019, Hochschule Neubrandenburg'
__license__ = 'BSD-2-Clause'
import copy
import logging
import threading
import time
from typing import Any, Callable, Dict, List
import arrow
from c... |
a3c_for_pendulum.py | import threading
import multiprocessing
import tensorflow as tf
import numpy as np
import gym
import os
import shutil
import matplotlib.pyplot as plt
import time
GAME = 'Pendulum-v0'
OUTPUT_GRAPH = True
LOG_DIR = './log'
N_WORKERS = multiprocessing.cpu_count()
MAX_EP_STEP = 200
MAX_GLOBAL_EP = 4000 # 2000 4000
GLOBA... |
suit.py | #!/usr/bin/env python
# coding=utf-8
import time
import functools
import threading
try:
from webcrawl.queue.lib import queue
except:
import Queue as queue
threading.queue = queue
import weakref
import traceback
import sys
import handler
from . import CFG
from .. import singleton
from ..util import transfer
fr... |
Problem3_4.py | # -*- coding: utf-8 -*-
from RobotTracker import *
import time
from threading import Thread, Event
def Problem3():
repeatCounter = 0
time.sleep(1)
counter = 0
oneFound = False
twoFound = False
threeFound = False
fourFound = False
####################################################... |
core.py | # -*- coding: utf-8 -*-
##############################################
# The MIT License (MIT)
# Copyright (c) 2014 Kevin Walchko
# see LICENSE for full details
##############################################
#
#
import threading
import time
from pygecko.network.ip import get_ip
# from pygecko.network.transport import A... |
jcatlett_ContigFilterServer.py | #!/usr/bin/env python
from wsgiref.simple_server import make_server
import sys
import json
import traceback
import datetime
from multiprocessing import Process
from getopt import getopt, GetoptError
from jsonrpcbase import JSONRPCService, InvalidParamsError, KeywordError,\
JSONRPCError, ServerError, InvalidRequestE... |
app.py | from flask import Flask, render_template, request, redirect, abort
from flask_limiter import Limiter
from flask_limiter.util import get_remote_address
from os import environ
from distutils.util import strtobool
from threading import Thread
pastey_version = "0.3"
loaded_config = {}
loaded_themes = []
app = Flask(__nam... |
mangle.py | """Formatting and file mangling support."""
import functools
import multiprocessing
import os
import re
import signal
import traceback
from datetime import datetime
from snakeoil.cli.exceptions import UserException
from snakeoil.mappings import OrderedSet
copyright_regex = re.compile(
r'^# Copyright (?P<date>(?P... |
test_index.py | """
For testing index operations, including `create_index`, `describe_index` and `drop_index` interfaces
"""
import logging
import pytest
import time
import pdb
import threading
from multiprocessing import Pool, Process
import numpy
import sklearn.preprocessing
from milvus import IndexType, MetricType
from utils imp... |
test_client.py | import asyncio
import concurrent.futures
import copy
import datetime
import functools
import os
import re
import threading
import warnings
from base64 import b64decode, b64encode
from queue import Empty
from unittest.mock import MagicMock, Mock
import nbformat
import pytest
import xmltodict # type: ignore
from ipytho... |
evaluator_c4.py | """
Python 3.9 класс арены для сопоставления
Название файла evalator_c4.py
класс арены для сопоставления текущей нейронной сети с нейронной сетью из предыдущей итерации, и сохраняет
нейронную сеть, которая выигрывает большинство игр
Version: 0.1
Author: Andrej Marinchenko
Date: 2021-12-20
"""
#!/usr/bin/env python
i... |
framereader.py | # pylint: skip-file
import json
import os
import pickle
import struct
import subprocess
import tempfile
import threading
from enum import IntEnum
from functools import wraps
import numpy as np
from lru import LRU
import _io
from tools.lib.cache import cache_path_for_file_path
from tools.lib.exceptions import DataUnre... |
funcs.py |
__copyright__ = "Copyright 2013-2016, http://radical.rutgers.edu"
__license__ = "MIT"
import os
import stat
import time
import queue
import threading as mt
import subprocess
import radical.utils as ru
from .... import pilot as rp
from ... import utils as rpu
from ... import states as rps
from ... i... |
models.py | # -*- coding: utf-8 -*-
"""
Data models for the Deis API.
"""
from __future__ import unicode_literals
import base64
import etcd
import importlib
import logging
import os
import re
import subprocess
import time
import threading
from django.conf import settings
from django.contrib.auth import get_user_model
from djang... |
iris_matching.py | import os
from kn_iris.feature_vec import *
import pickle, numpy as np, re
import threading
try:
import queue
que=queue.Queue()
except ImportError:
from multiprocessing import Queue
que=Queue()
from scipy.spatial import distance
try:
import itertools.imap as map
except ImportError:
pass
i... |
subprocess_env.py | from multiprocessing.connection import Connection, Pipe
from multiprocessing.context import Process
from typing import Union, Any, Callable
from gym import Env
class SubprocessEnv(Env):
def __init__(self, factory: Callable[[], Env], blocking: bool = True):
self._blocking = blocking
self._parent_c... |
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... |
exptRun.py | from scipy.ndimage.measurements import find_objects
import torch.multiprocessing as mp
import psycopg2 as pgdatabase
import torch
import argparse
import os
import sys
import time
import math
import pickle
import h5py
from pathlib import Path
from functools import partial
from torchvision import transforms,... |
simple_cmd_server.py | #!/usr/bin/env python
"""
Intended target: OSMC device
"""
from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer
import os
from Speaker.SwitchSpeaker import SwitchSpeaker
from Logging.LogClient import LogClient
from harmony.Harmony import HarmonyClient
from harmony.HarmonyChecker import HarmonyChecker
from Kod... |
timed_subprocess.py | # -*- coding: utf-8 -*-
'''For running command line executables with a timeout'''
from __future__ import absolute_import
import subprocess
import threading
import salt.exceptions
from salt.ext import six
class TimedProc(object):
'''
Create a TimedProc object, calls subprocess.Popen with passed args and **kwa... |
fleetspeak_client.py | #!/usr/bin/env python
"""Fleetspeak-facing client related functionality.
This module contains glue code necessary for Fleetspeak and the GRR client
to work together.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
import logging
import pdb
import plat... |
connection.py | # Copyright (c) 2015 Canonical Ltd
# Copyright (c) 2015 Mirantis inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Un... |
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... |
installer.py | import requests, getpass, threading, time, os
def getupdate():
try:
r = requests.get('https://pastebin.com/raw/rvDvVu5p').json()
downloadurl = r['Download1']
url = r['DURL']
d = [downloadurl, url]
return d
except:
print('Error while getting update...')
... |
dhtml2text.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import urllib.request
import urllib.error
import os
from tkinter import *
from tkinter.filedialog import askdirectory
import html2text
import threading
import chardet
class DownloadTools:
def __init__(self):
self.__log_util = LogUtils()
self.__setup... |
CpuUsage.py | import os, sys
parentPath = os.path.abspath("..")
if parentPath not in sys.path:
sys.path.insert(0, parentPath)
from widgets.Label import Label
from widgets.Image import Image
import gi
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk, GObject, Gdk
import datetime
import psutil
import time
import threa... |
io.py | # Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... |
lan_sc2_env.py | # Copyright 2017 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 ... |
client.py | import json
import base64
import aiohttp
import asyncio
import threading
from uuid import uuid4
from time import timezone, sleep
from typing import BinaryIO, Union
from time import time as timestamp
from locale import getdefaultlocale as locale
from .lib.util import exceptions, headers, device, objects, helpers
from ... |
word2vec_optimized.py | # Copyright 2015 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... |
example.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
import flask
from flask import Flask, render_template
from flask_googlemaps import GoogleMaps
from flask_googlemaps import Map
from flask_googlemaps import icons
import os
import re
import sys
import struct
import json
import requests
import argparse
import getpass
import thre... |
embedding_lstm.py | # Copyright 2019 The ASReview 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 applicabl... |
multiprocess_test.py | from multiprocessing import Process, Lock
from multiprocessing.sharedctypes import Value, Array
from ctypes import Structure, c_double
import numpy as np
import ctypes
class Point(Structure):
_fields_ = [('x', c_double), ('y', c_double)]
# _fields_ = np.array([[1.875,-6.25], [-5.75,2.0], [2.375,9.5]])
def mod... |
graph_digest_benchmark.py | #!/usr/bin/env python
'''
This benchmark will produce graph digests for all of the
downloadable ontologies available in Bioportal.
'''
from __future__ import print_function
from rdflib import Namespace, Graph
from rdflib.compare import to_isomorphic
from six.moves.urllib.request import urlopen
from six.moves import... |
process.py | from random import uniform
import time
from threading import Thread, Lock
from queue import Queue
import Algorithmia
from src.utils import create_producer, create_consumer, credential_auth
from uuid import uuid4
import json
MAX_SECONDS = 120
class CheckableVariable(object):
def __init__(self, default_value):
... |
datasets.py | import glob
import math
import os
import random
import shutil
import time
from pathlib import Path
from threading import Thread
import cv2
import numpy as np
import torch
from PIL import Image, ExifTags
from torch.utils.data import Dataset
from tqdm import tqdm
from yolov5processor.utils.general import xyxy2xywh, xyw... |
threadpool.py | """
Generic thread pool class. Modeled after Java's ThreadPoolExecutor.
Please note that this ThreadPool does *not* fully implement the PEP 3148
ThreadPool!
"""
from threading import Thread, Lock, currentThread
from weakref import ref
import logging
from ambari_agent.ExitHelper import ExitHelper
try:
from queue i... |
utils.py | # 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
# d... |
watcher.py | import logging
import os.path
import threading
import time
try:
from watchdog.events import FileSystemEventHandler
from watchdog.observers import Observer
from watchdog.observers.polling import PollingObserver
can_watch = True
except ImportError:
Observer = None
FileSystemEventHandler = object
... |
test_logging.py | # Copyright 2001-2014 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... |
tftevdev.py | #!/usr/bin/python
##################################################################################
# IMPORTS
##################################################################################
import evdev
import pygame
from Queue import Queue
from threading import Thread, Event
from pygame.locals import *
from tftuti... |
elfin_gui.py | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Fri Jul 28 12:18:05 2017
@author: Cong Liu
Software License Agreement (BSD License)
Copyright (c) 2017, Han's Robot Co., Ltd.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provide... |
network.py | # Electrum - Lightweight Bitcoin Client
# Copyright (c) 2011-2016 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 limitation the rig... |
test.py | import gzip
import json
import logging
import os
import io
import random
import threading
import time
import helpers.client
import pytest
from helpers.cluster import ClickHouseCluster, ClickHouseInstance
MINIO_INTERNAL_PORT = 9001
SCRIPT_DIR = os.path.dirname(os.path.realpath(__file__))
CONFIG_PATH = os.path.join(SC... |
game_service.py | from abc import ABC, abstractmethod
import threading
import pytesseract
from PIL import ImageGrab
import cv2
from imposters_mark.services.screen_service import ScreenService
from imposters_mark.entities.stats import Stats
from imposters_mark.entities.player import Player
class _PytesseractHelper(object):
def __... |
Timer_rai.py | # Copyright (C) 2020 by ZestIOT. All rights reserved. The information in this
# document is the property of ZestIOT. Except as specifically authorized in
# writing by ZestIOT, the receiver of this document shall keep the information
# contained herein confidential and shall protect the same in whole or in par... |
test_store.py | # Unit test suite for the RedisStore class.
# This test suite now runs in its own docker container. To build the image, run
# docker build -f Dockerfile-test -t abaco/testsuite .
# from within the tests directory.
#
# To run the tests execute, first start the development stack using:
# 1. export abaco_path=$(pwd)
... |
demo.py | #!/usr/bin/env python
# coding=utf-8
import tensorflow as tf
import bottle
from bottle import route, run
import threading
import json
import numpy as np
from prepro import convert_to_features, word_tokenize
from time import sleep
import math
'''
This file is taken and modified from R-Net by Minsangkim142
https://git... |
views.py | import datetime
import logging
import re
import threading
from typing import Optional, List
import pytz
import simplejson as json
from django.contrib.auth.decorators import login_required
from laboratory.decorators import group_required
from django.core.exceptions import ValidationError
from django.db import transacti... |
email.py | from threading import Thread
from flask import current_app, render_template
from flask_mail import Message
from . import mail
def send_async_email(app, msg):
with app.app_context():
mail.send(msg)
def send_email(to, subject, template, **kwargs):
app = current_app._get_current_object()
msg = Mess... |
running.py | # -*- coding: utf-8 -*-
"""Code for maintaining the background process and for running
user programs
Commands get executed via shell, this way the command line in the
shell becomes kind of title for the execution.
"""
import collections
import logging
import os.path
import re
import shlex
import signal
import sub... |
libs_cli.py | #!/usr/bin/python3
"""
libs_cli.py
This is a command line interface to run a minimal LIBS test using an OceanOptics FLAME-T spectrometer and a 1064nm MicroJewel laser. This code is designed to be
run on a BeagleBone Black.
"""
import struct
import pathlib
import readline
import threading
from argparse import Argument... |
main_vec.py | import argparse
import math
from collections import namedtuple
from itertools import count
import numpy as np
from eval import eval_model_q
import copy
import torch
from ddpg_vec import DDPG
from ddpg_vec_hetero import DDPGH
import random
from replay_memory import ReplayMemory, Transition
from utils import *
import os... |
freetests.py | #!/usr/bin/env python3
# coding: utf-8
# Copyright 2013 Abram Hindle
#
# 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 ... |
master.py | # -*- coding: utf-8 -*-
'''
This module contains all of the routines needed to set up a master server, this
involves preparing the three listeners and the workers needed by the master.
'''
# Import python libs
from __future__ import absolute_import, with_statement, print_function, unicode_literals
import copy
import c... |
C2Server.py | #!/usr/bin/env python3
import os, sys, datetime, time, base64, logging, signal, re, ssl, traceback, threading
from urllib.request import urlopen, Request
from urllib.error import HTTPError, URLError
from urllib.parse import urlparse
from poshc2.server.Implant import Implant
from poshc2.server.Tasks import newTask
from... |
controller.py | # Electron Cash - lightweight Bitcoin client
# Copyright (C) 2019, 2020 Axel Gembe <derago@gmail.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 withou... |
word2vec.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... |
new-demo.py | import glob
from test import *
import time
import numpy as np
import torch.multiprocessing as mp
import queue as Queue
from multiprocessing import Pool
import itertools
from multiprocessing.dummy import Pool as ThreadPool
from pathos.multiprocessing import ProcessingPool
# import model as modellib
from imageai.Det... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.