source
stringlengths
3
86
python
stringlengths
75
1.04M
downloadclient.py
# Copyright 2018 CERN for the benefit of the ATLAS collaboration. # # 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...
server.py
''' Server-Class for the extractions of IoC's. ''' # pylint: disable=C0413, C0411 import os import sys import json import pytz import re import iocextract as ioce sys.path.append('..') from io import StringIO from threading import Thread from kafka.producer import KafkaProducer from kafka.consumer import KafkaCons...
update.py
#!/usr/bin/env python # coding:utf-8 import os import urllib2 import json import time import threading import zipfile import sys import platform from distutils.version import LooseVersion from instances import xlog import config import uuid import update_from_github #opener = urllib2.build_opener() #update_url = "h...
twisterlib.py
#!/usr/bin/env python3 # vim: set syntax=python ts=4 : # # Copyright (c) 2018 Intel Corporation # SPDX-License-Identifier: Apache-2.0 import os import contextlib import string import mmap import sys import re import subprocess import select import shutil import shlex import signal import threading import concurrent.fut...
test_cgo_engine.py
import json import os import sys import threading import unittest import logging import time import torch from pathlib import Path from nni.retiarii.execution.cgo_engine import CGOExecutionEngine from nni.retiarii.execution.logical_optimizer.logical_plan import LogicalPlan from nni.retiarii.execution.logical_optimize...
controlsd.py
#!/usr/bin/env python3 import os import gc import requests import threading from cereal import car, log from selfdrive.crash import client from common.android import ANDROID, get_sound_card_online from common.numpy_fast import clip from common.realtime import sec_since_boot, set_realtime_priority, set_core_affinity, Ra...
minion.py
# -*- coding: utf-8 -*- ''' Routines to set up a minion ''' # Import python libs from __future__ import absolute_import from __future__ import print_function import copy import errno import fnmatch import hashlib import logging import multiprocessing import os import re import salt import signal import sys import threa...
editwatcher.py
# coding=utf-8 import json import os.path import requests import time import threading # noinspection PyPackageRequirements import websocket # noinspection PyPackageRequirements from bs4 import BeautifulSoup from urllib.parse import urlparse import chatcommunicate import metasmoke from globalvars import GlobalVars impo...
gdal2tiles.py
#!/home/wilsonsf/environments/my_env/bin/python3 # -*- coding: utf-8 -*- # ****************************************************************************** # $Id$ # # Project: Google Summer of Code 2007, 2008 (http://code.google.com/soc/) # Support: BRGM (http://www.brgm.fr) # Purpose: Convert a raster into TMS (Tile...
nmos-test.py
# Copyright (C) 2018 Riedel Communications GmbH & Co. KG # # Modifications Copyright 2018 British Broadcasting Corporation # # 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...
main.py
import keyboard import time import os from win32gui import GetWindowText, GetForegroundWindow from pygame import mixer import datetime import threading import webbrowser import sys from prettytable import PrettyTable import random #import Finished #os change os.system("Cls") #clears screen os.system("title Geet -cli"...
multi_processing.py
#!/usr/bin/env python3 # FileName:multi_processing.py # -*- coding: utf-8 -*- """ multiprocessing 实现多进程""" from multiprocessing import Process import os # 子进程运行的代码 def run_proc(name): print('Run child process %s(%s)' % (name, os.getpid())) if __name__ == '__main__': print('Parent process %s' % os.getpid()...
d.light.py
#!/usr/bin/python import config from multiprocessing import Process, Manager, Event def scheduler(dummy,state,esnooze): import time from datetime import datetime, timedelta while True: now = datetime.now() at = datetime.strptime(state['alarmtime'],'%H:%M')-timedelta(minutes=state['brightentime']) if...
inference.py
""" Run inference over a test split """ import argparse import json import logging import logging.config import multiprocessing import os import sys import tensorflow as tf import matplotlib.pyplot as plt import models import datasets import tensortools as tt def decode_tfrecord(example, image_size): """ Dec...
server.py
from six.moves import BaseHTTPServer import errno import os import socket from six.moves.socketserver import ThreadingMixIn import ssl import sys import threading import time import traceback from six import binary_type, text_type import uuid from collections import OrderedDict from six.moves.queue import Queue from ...
main.py
# Copyright (c) 2021 W-Mai # # This software is released under the MIT License. # https://opensource.org/licenses/MIT from contextlib import closing import requests from PyQt6.QtCore import * from PyQt6.QtWidgets import * from PyQt6.QtGui import * import PyQt6.sip import sys import os import json from typing import ...
dropkick.py
# -*- coding: utf-8 -*- """ Automated QC classifier pipeline @author: C Heiser """ import argparse import sys import os, errno import numpy as np import matplotlib.pyplot as plt import scanpy as sc import time import threading from skimage.filters import threshold_li, threshold_otsu, threshold_mean from logistic impo...
parallel.py
# coding: utf-8 """ brownie.tests.parallel ~~~~~~~~~~~~~~~~~~~~~~ Tests for :mod:`brownie.parallel`. :copyright: 2010-2011 by Daniel Neuhäuser :license: BSD, see LICENSE.rst for details """ from __future__ import with_statement import time from threading import Thread from attest import Tests, As...
test_poll.py
# Test case for the os.poll() function import os import subprocess import random import select import threading import time import unittest from test.support import TESTFN, run_unittest, reap_threads, cpython_only import sys try: select.poll except AttributeError: raise unittest.SkipTest("select.poll not defi...
base_trade_app.py
import tkinter as tk from tkinter import ttk, font, messagebox import telethon from config import Config from functools import partial import threading import logging.handlers import sys import constants from styles import UI import utils import textwrap import os from sys import platform as _platform logger = logging...
evaluate_dist.py
import sys sys.path.append('.') import os import tqdm import torch import random import shutil import argparse import numpy as np import multiprocessing from collections import defaultdict from torch.utils.data import DataLoader from data.aug import ops from data.dataset import DOTA2 from data.aug.compose import ...
test_sessionmiddleware.py
import unittest import threading from bugsnag.sessiontracker import SessionTracker, SessionMiddleware from bugsnag.configuration import Configuration from bugsnag.event import Event class TestSessionMiddleware(unittest.TestCase): def setUp(self): self.config = Configuration() self.config.configur...
main.py
import datetime import queue import threading import jaydebeapi import jpype import requests import json token_ct = '###############################' dsn = '############################' uid = '########' pwd = '########' tbl_m = 'METRO_STATUS' tbl_w = 'WEATHER' jar = 'db2jcc4.jar' # location of the...
webserver.py
from threading import Thread import subprocess from slackclient import SlackClient from flask import Flask from flask import request from flask import jsonify app = Flask(__name__) slack_token = "<slack token>" sc = SlackClient(slack_token) def deploy(x): print("running deployment...") subprocess.call(["/bi...
train_mask_rcnn.py
"""Train Mask RCNN end to end.""" import argparse import os # disable autotune os.environ['MXNET_CUDNN_AUTOTUNE_DEFAULT'] = '0' os.environ['MXNET_GPU_MEM_POOL_TYPE'] = 'Round' os.environ['MXNET_GPU_MEM_POOL_ROUND_LINEAR_CUTOFF'] = '28' os.environ['MXNET_EXEC_BULK_EXEC_MAX_NODE_TRAIN_FWD'] = '999' os.environ['MXNET_EXE...
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...
Records.py
# This folder contains program to access the records of fee depositors # Importing necessary libraries print('Importing necessary libraries for deposit records...') import time import threading from Classes import * from tkinter import ttk from tkinter import * import pandas as pd from pandastable import Table table ...
osa_utils.py
#!/usr/bin/python3 """ (C) Copyright 2020-2021 Intel Corporation. SPDX-License-Identifier: BSD-2-Clause-Patent """ import ctypes import queue import time import threading import re from avocado import fail_on from ior_test_base import IorTestBase from mdtest_test_base import MdtestBase from command_utils import C...
stream_manager.py
from socket import * from struct import pack from threading import Thread from src.stream.protocol.packet import ServerboundPacket class StreamManager: def __init__(self, cefstream): self.cefstream = cefstream self.server = None self.client = None self.packets = [] def launc...
proxyScraper.py
import requests from bs4 import BeautifulSoup import threading import os import asyncio import argparse pathTextFile = '' proxyType = '' # From proxyscrape.com def proxyscrapeScraper(proxytype, timeout, country): response = requests.get("https://api.proxyscrape.com/?request=getproxies&proxytype=" + proxytype + "...
sunucu.py
import socket import threading sahip = socket.gethostbyname(socket.gethostname()) port = 8436 baglantilar = [] print(""" %@@@,,,*@@@ @@@@@@@@%,,,,,*@@@@@@@@* Red Arrow ağına hoşgeldiniz... ...
ultrasonic_sensor_base.py
import atexit import time from abc import abstractmethod from collections import deque from sched import scheduler from threading import Event, Lock, Thread import numpy as np from gpiozero import SmoothedInputDevice from pitop.common.common_ids import FirmwareDeviceID from pitop.common.firmware_device import ( F...
rc_driver_overtake.py
__author__ = 'robin' import threading import SocketServer import serial import cv2 import numpy as np import math # distance data measured by ultrasonic sensor sensor_data = " " class NeuralNetwork(object): def __init__(self): self.model = cv2.ANN_MLP() def create(self): layer_size = np.in...
pipereader.py
''' Created on Sep 16, 2015 @author: anotherpyr ''' from threading import Thread from Queue import Queue, Empty class PipeReader: def __init__(self, pipe): self.queue = Queue() self.pipe = pipe t = Thread(target=self.enqueue) t.daemon = True t.start() def enqueue...
Import.py
#!/usr/bin/env python # Copyright (c) 2019 Computer Vision Center (CVC) at the Universitat Autonoma de # Barcelona (UAB). # # This work is licensed under the terms of the MIT license. # For a copy, see <https://opensource.org/licenses/MIT>. """Import Assets to Carla""" from __future__ import print_function import e...
Transport.py
import os import RNS import time import math import threading import traceback from time import sleep import vendor.umsgpack as umsgpack class Transport: # Constants BROADCAST = 0x00; TRANSPORT = 0x01; RELAY = 0x02; TUNNEL = 0x03; types = [BROADCAST, TRANSPORT, RELAY, TUNNEL] REACHABI...
scrape_film.py
#!/usr/bin/env python3 from requests import Session from urllib.parse import unquote as decode_url from bs4 import BeautifulSoup from re import findall, search, match from string import ascii_lowercase as ELetters import threading from time import sleep, time import json class Scraper: """ docstring for Scraper ...
botany.py
#!/usr/bin/env python3 import time import pickle import json import os import random import getpass import threading import errno import uuid import sqlite3 import argparse from menu_screen import * # TODO: # - Switch from personal data file to table in DB class Plant(object): # This is your plant! stage_lis...
pip_gui.py
import os import shutil import subprocess import tempfile import threading import tkinter as tk from tkinter.messagebox import showerror from tkinter import ttk from typing import cast, Tuple from thonny import running, get_runner, get_workbench, ui_utils from thonny.common import InlineCommand from thonny.languages i...
monitor.py
import threading import time from random import choice from selenium import webdriver from modules.amazon import amazon from modules.cache import get_cache from modules.cache import save_cache def create_browser(headless : bool, proxy = None): options = webdriver.FirefoxOptions() if(proxy): webdriver...
harvis.py
import requests import time from colors import bcolors import threading import random import json import os import subprocess import sys from os import chmod from Crypto.PublicKey import RSA import logging import paramiko import config from threading import Thread from namecheap import Api import redirect_setup import ...
custom.py
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
xla_client_test.py
# Copyright 2017 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...
MessageServer.py
#!/usr/bin/python # -*- coding: utf-8 -*- ''' Copyright (C) 2011 cmikula In case of reuse of this source code please do not remove this copyright. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Fou...
achievement_gen.py
from faker import Faker import random import numpy as np import pymysql import sys import time # 生成随机姓名 def get_random_name(): return Faker().name() golad_list = [] def get_random_id(): id_list = [] num_list = "" for i in range(15): id_list.append(random.randint(1, 9)) for i in id_li...
test_imperative_data_loader_exit_func.py
# Copyright (c) 2020 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 appli...
gui_socket_client.py
import socket import time from tkinter import * import threading # methods # Quit functionality for GUI def quit(): global root root.destroy() # start the socket listener thread def start_thread(): print("start thread") global username global username_box global status_label global skip_bu...
compare_scans.py
import logging import sys import time from threading import Thread from pgnumbra.config import cfg_get, cfg_init from pgnumbra.console import print_status from pgnumbra.proxy import init_proxies from pgnumbra.utils import load_accounts_file logging.basicConfig(filename="compare_scans.log", level=logging.INFO, for...
worker.py
import multiprocessing import queue from queue import Queue import sys from spats_shape_seq.pair import Pair from spats_shape_seq.parse import FastqWriter, SamWriter from spats_shape_seq.util import _debug, _warn from spats_shape_seq.mask import PLUS_PLACEHOLDER, MINUS_PLACEHOLDER class SpatsWorker(object): '''...
mainscript.py
# # Parley Who Vertigo # Copyright 2016, 2017 Thomas Perl, Josef Who # # Permission to use, copy, modify, and/or distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS PROVIDED "AS ...
ps5000base.py
# -*- coding: utf-8 -*- # # Copyright (C) 2014-2017 Pico Technology Ltd. See LICENSE file for terms. # """ Python calls for ps5000 based PicoScope devices. """ from threading import * from picostatus import * from psutils import * from math import ceil from copy import deepcopy import numpy as np import sys import tim...
backend.py
from typing import List, Dict, Tuple, Iterator from json import dumps as jsonify from threading import Thread from queue import SimpleQueue as Queue, Empty as QueueEmpty from multiprocessing import Pipe from os import getpid from multiprocessing.util import _exit_function as multiprocessing_exit_function import atexit ...
countmerge.py
import sys import argparse from Queue import Empty from multiprocessing import Process, Queue from googlengram import indexing from representations import sparse_io_ref import ioutils YEARS = range(1900, 2001) def main(proc_num, queue, out_dir, in_dir): merged_index = ioutils.load_pickle(out_dir + "merged_index....
log_handler.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...
gdal2tiles.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # ****************************************************************************** # $Id$ # # Project: Google Summer of Code 2007, 2008 (http://code.google.com/soc/) # Support: BRGM (http://www.brgm.fr) # Purpose: Convert a raster into TMS (Tile Map Service) tiles in a di...
multi_threading_variable_share.py
import threading import time g_num = 0 def work1(num): global g_num for i in range(num): if mutex.acquire(True): g_num += 1 mutex.release() print('---in work1,g_num in %d---' % g_num) def work2(num): global g_num for i in range(num): if mutex.acquire(True...
vlc.py
import asynchat import asyncore import os import random import re import socket import subprocess import sys import threading import time import urllib.error import urllib.parse import urllib.request from syncplay import constants, utils from syncplay.messages import getMessage from syncplay.players.basePlayer import...
app.py
from __future__ import print_function from PIL import Image from PIL import ImageTk import Tkinter as tki import threading import datetime import imutils import cv2 import os class SpikeLive: def __init__(self, vs, outputPath): self.vs = vs self.outputPath = outputPath self.frame = None ...
generic_websocket.py
""" Module used as a interfeace to describe a generick websocket client """ import asyncio import websockets import socket import json import time from threading import Thread from pyee import EventEmitter from ..utils.custom_logger import CustomLogger # websocket exceptions from websockets.exceptions import Connect...
component_initialiser.py
import logging import multiprocessing from datetime import time from framework.config.config import Config from framework.db.command_register import CommandRegister from framework.db.config_manager import ConfigDB from framework.db.db import DB from framework.db.error_manager import ErrorDB from framework.db.mapping_m...
test_generator_mt19937.py
import sys import hashlib import pytest import numpy as np from numpy.linalg import LinAlgError from numpy.testing import ( assert_, assert_raises, assert_equal, assert_allclose, assert_warns, assert_no_warnings, assert_array_equal, assert_array_almost_equal, suppress_warnings) from numpy.random import G...
utils.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import threading import operator from random import random, randint, gauss, shuffle, choice from math import exp from scipy.spatial.distance import euclidean import numpy as np import numba as nb # class GOThread(threading.Thread): # def __init__(self, target, *a...
wsgi.py
""" Start Application Sequence: 1) bind sockets for flask to bokeh communications 2) start bokeh server (Tornado) running bokeh bkapp 3) start flask server (Tornado) running flask app """ import time import logging from threading import Thread from server.app import start_tornado from server.bkapp imp...
shell.py
""" Scrapy Shell See documentation in docs/topics/shell.rst """ from threading import Thread from scrapy.command import ScrapyCommand from scrapy.shell import Shell class Command(ScrapyCommand): requires_project = False default_settings = {'KEEP_ALIVE': True, 'LOGSTATS_INTERVAL': 0} def syntax(self):...
tymora.py
#!/usr/bin/env python3 import discord import asyncio import sys from concurrent.futures import ProcessPoolExecutor from multiprocessing import Process, Pipe from complex_dice import * from deck_of_many_things import * HELP_STR = """ Hi, I'm Tymora! I evaluate complex dice expressions that have absolutely no use whats...
udp_c_chatroom.py
""" author: Lewizo email: 615905244@qq.com env: Python3.8 socket udp & tcp & multiprocessing """ from socket import * from multiprocessing import * # import chatroom_ui import sys def menu(us): print(''' =============== 聊天室菜单 =============== 1 登录 2 注册账号...
inject.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # # lib/eapeak/inject.py # # 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 # notice, this list o...
robotRestSDK.py
import logging import threading import os from pyramid.config import Configurator from pyramid.response import Response from pyramid.events import NewRequest from wsgiref.simple_server import make_server import simplepybotsdk.configurations as configurations from simplepybotsdk.robotWebSocketSDK import RobotWebSocketSD...
flow_test.py
#!/usr/bin/env python # -*- encoding: utf-8 -*- """Tests for API client and flows-related API calls.""" from __future__ import absolute_import from __future__ import division from __future__ import unicode_literals import threading import time from absl import app from future.builtins import range from grr_api_clie...
get_realtime_data.py
import datetime as dt import hmac import json import os import signal import time from datetime import datetime as dtdt from hashlib import sha256 from secrets import token_hex from threading import Thread import websocket from lib import message, repository from lib.config import Bitflyer # ------------------------...
basesorter.py
""" Here a proposal for the futur Sorter with class approach. The main idea is to decompose all intermediate steps to get more flexibility: * setup the recording (traces, output folder, and so...) * set parameters * run the sorter (with futur possibility to make it in separate env/container) * get the result (...
email.py
#!/usr/bin/python # -*- coding: utf-8 -*- from threading import Thread from flask import current_app, render_template from flask.ext.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):...
hq_adapter.py
"""adapter for webthings gateway""" import functools from gateway_addon import Adapter, Database import time import asyncio from threading import Thread from pkg.hq_device import hq_Device print = functools.partial(print, flush=True)#allow direct print to log of gateway _TIMEOUT = 3 _POLL = 30 class hq_Adapter(...
test_cache.py
# This file is part of the MapProxy project. # Copyright (C) 2010 Omniscale <http://omniscale.de> # # 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...
mobile_monkey.py
''' mobile monkey ''' import time from typing import List from threading import Thread import config_reader as config import emulator_manager import api_commands from telnet_connector import TelnetAdb from telnet_connector import GsmProfile from telnet_connector import NetworkDelay from telnet_connector import NetworkS...
subprocess42.py
# Copyright 2013 The LUCI Authors. All rights reserved. # Use of this source code is governed under the Apache License, Version 2.0 # that can be found in the LICENSE file. """subprocess42 is the answer to life the universe and everything. It has the particularity of having a Popen implementation that can yield outpu...
tool.py
#!/usr/bin/env python3 # # Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import difflib import logging import multiprocessing import os import sys import time from queue import Empty from ty...
__init__.py
"""Regression test suite for magicbus. Run 'nosetests -s test/' to exercise all tests. """ from magicbus.compat import HTTPServer, HTTPConnection, HTTPHandler import os from subprocess import Popen import threading import time from magicbus.plugins import SimplePlugin def assertEqual(x, y, msg=None): if not x ...
Data.py
import sys from PyQt5 import QtCore, QtGui, QtWidgets from PyQt5.QtWidgets import * from PyQt5.QtCore import * import tkinter as tk from tkinter import filedialog import xml.dom.minidom import os import re import threading import copy import json import time import pandas as pd import xml.etree.ElementTree as ET clas...
test_io.py
"""Unit tests for the io module.""" # Tests of io are scattered over the test suite: # * test_bufio - tests file buffering # * test_memoryio - tests BytesIO and StringIO # * test_fileio - tests FileIO # * test_file - tests the file interface # * test_io - tests everything else in the io module # * test_univnew...
convert.py
import collections import os import sys import multiprocessing from multiprocessing import Semaphore from typing import Union import re import s3fs import numpy as np import zarr from netCDF4 import Dataset region = os.environ.get('AWS_DEFAULT_REGION') or 'us-west-2' # Some global that may be shared by different met...
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...
banjax_report_consumer.py
import datetime import threading import json from kafka import KafkaConsumer, KafkaProducer import time import logging import sys import types from baskerville.db import set_up_db from baskerville.models.config import KafkaConfig from baskerville.models.ip_cache import IPCache from baskerville.util.elastic_writer impo...
quokka_server.py
from flask import Flask, request from flask_cors import CORS from flask_restx import Api, Resource from quokka_server_utils import get_hostname_from_target, get_ip_address_from_target from DbHourlyTask import DbHourlyTask from apidoc_models import ApiModels import threading import atexit from flask_limiter import Lim...
program.py
import logging import queue import threading from uuid import UUID, uuid4 from opsi.webserver.schema import NodeTreeN from .manager import Manager from .pipeline import Node, Pipeline LOGGER = logging.getLogger(__name__) class Program: def __init__(self, lifespan): self.queue = queue.Queue() se...
raspberry_lamp.py
import subprocess import threading from time import sleep from threading import Thread import RPi.GPIO as GPIO import constants import firebase #from Subfact_ina219 import INA219 GPIO.setwarnings(False) GPIO.setmode(GPIO.BOARD) GPIO.setup(38, GPIO.OUT) GPIO.setup(40, GPIO.OUT) state=1 vcc=1 firebase = firebase.Fireba...
paralleletl.py
''' Usage: python etlmr.py [options] input_paths ''' # # Copyright (c) 2011 Xiufeng Liu (xiliu@cs.aau.dk) # # This file is free software: you may copy, redistribute and/or modify it # under the terms of the GNU General Public License version 2 # as published by the Free Software Foundation. # # This file is distrib...
__init__.py
### all the mongodb reading/writing code lives here now def load_db(): """ Load the database """ # Initialize database # Don't need to explicitly create tables with mongo, just indices confirm = raw_input('This will drop the database and reload. Are you sure you want to continue? [no] ') ...
SysUtil.py
import subprocess import random, string, os, socket, json, time from glob import glob from urllib import request import threading import configparser import yaml import logging import logging.config import fcntl import datetime USBDEVFS_RESET = 21780 try: logging.config.fileConfig("logging.ini") except: pass ...
modbus_connector.py
# Copyright 2022. 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 ...
zeromq.py
# -*- coding: utf-8 -*- ''' Zeromq transport classes ''' # Import Python Libs from __future__ import absolute_import, print_function, unicode_literals import os import sys import copy import errno import signal import hashlib import logging import weakref from random import randint # Import Salt Libs import salt.auth...
a3c-standard.py
import tensorflow as tf from time import sleep import threading import numpy as np from tensorflow.contrib import slim import time import scipy.signal import cv2 #import gym import csv from scipy.ndimage.filters import gaussian_filter1d from simulator import simulator num_workers = 6 environment = 'Doom_Basic' set_lea...
tasks.py
import functools import os import sys import threading import pkg_resources from .executor import Context, Tasks, TaskError from .paths import in_dir, paths_for_shell tasks = Tasks() @tasks.register('dependencies', 'additional_assets', 'bundles', 'collect_static_files', 'take_screenshots', 'compile...
main.py
"""Importing modules""" import ctypes import os import webbrowser import random from time import sleep import threading from multiprocessing import Process # <----------> if os.name != 'nt': exit("Not windows") # <----------> LOGIN_MSG = r""" ______ ______ ______ ______ __ __ ...
scheduler.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # vim: set ts=4 sw=4 et ai: """ | This file is part of the web2py Web Framework | Copyrighted by Massimo Di Pierro <mdipierro@cs.depaul.edu> | License: LGPLv3 (http://www.gnu.org/licenses/lgpl.html) Background processes made simple --------------------------------- """ fr...
wechat.py
# -*- coding: utf-8 -*- import os import io import re import json import time import random import asyncio import logging import hashlib import unittest import functools import threading import mimetypes import concurrent.futures from pprint import pprint from urllib.parse import urlparse, unquote from collections imp...
notificationicon.py
# Pure ctypes windows taskbar notification icon # via https://gist.github.com/jasonbot/5759510 import ctypes import ctypes.wintypes import os import uuid import time import gevent import threading try: from queue import Empty as queue_Empty # Python 3 except ImportError: from Queue import Empty as queue_Empty...
tests.py
import threading import time from unittest import mock from multiple_database.routers import TestRouter from djmodels.core.exceptions import FieldError from djmodels.db import ( DatabaseError, NotSupportedError, connection, connections, router, transaction, ) from djmodels.test import ( TransactionTestCas...
opencv_utilities.py
import ntpath from threading import Thread import cv2 as cv import numpy as np import definitions def getFaceFromImage(image): if isinstance(image, str): img = cv.imread(image) else: img = image gray_img = cv.cvtColor(img, cv.COLOR_BGR2GRAY) haar_classifier = cv.CascadeClassifier('/h...
train.py
import sys import os import logging import random import numpy as np from time import time from argparse import ArgumentParser from threading import Thread from clair.model import Clair import clair.utils as utils import clair.evaluate as evaluate import shared.param as param logging.basicConfig(format='%(message)s',...