source
stringlengths
3
86
python
stringlengths
75
1.04M
dronecsv.py
#! /usr/bin/env python3 # -*- coding: utf-8 -*- """ @author: keykeerati @date: 2021/12/06 """ import rospy from time import time, sleep from datetime import datetime from ar_track_alvar_msgs.msg import AlvarMarkers from controldrone import * from callback import get_drone_location N = 4 goal = dict() for i in rang...
test_sonyflake.py
import threading from datetime import datetime, timedelta, timezone from random import randint from time import sleep from unittest import TestCase from sonyflake.sonyflake import ( BIT_LEN_SEQUENCE, SONYFLAKE_EPOCH, SonyFlake, lower_16bit_private_ip, ) class SonyFlakeTestCase(TestCase): def setU...
houndify.py
############################################################################## # Copyright 2019 SoundHound, Incorporated. All rights reserved. ############################################################################## import base64 import hashlib import hmac import http.client import json import threading import t...
test_ipc.py
import multiprocessing as mp import itertools import traceback import pickle import numpy as np from numba import cuda from numba.cuda.testing import (skip_on_arm, skip_on_cudasim, skip_under_cuda_memcheck, ContextResettingTestCase, ForeignArray) import ...
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...
import_thread.py
from collections import defaultdict import threading import traceback import redis import ray from ray import ray_constants from ray import cloudpickle as pickle from ray import profiling import logging logger = logging.getLogger(__name__) class ImportThread: """A thread used to import exports from the driver...
test_subprocess.py
import unittest from unittest import mock from test import support import subprocess import sys import platform import signal import io import os import errno import tempfile import time import selectors import sysconfig import select import shutil import threading import gc import textwrap try: import ctypes exce...
test_remote.py
# -*- coding: utf-8 -*- import logging import os import socket import sys import time from copy import deepcopy from multiprocessing import Queue from threading import Thread import env import pytest import plumbum from plumbum import ( NOHUP, CommandNotFound, ProcessExecutionError, ProcessTimedOut, ...
sb.py
# -*- coding: utf-8 -*- ''' Selfbot Edition Special Thanks to: • Arifistifik • Team Newbie Corps™ Supported By: • We Bare Bears Corps™ • B-G-N Squad ©2020 Recode By BAI ''' from important import * import youtube_dl import requests import humanize import html5lib from gtts import gTTS from bs4 import BeautifulSou...
save_context_test.py
# Copyright 2020 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
motor_server.py
#!/usr/bin/env python2 # -*- coding: utf-8 -*- """ Motor controller module for DiddyBorg """ from multiprocessing.connection import Listener, Client, AuthenticationError from os import getpid, path, system from signal import signal, SIGTERM from threading import Thread, Event, active_count from smbus import SMBus I2C...
test_labbook_lock.py
# Copyright (c) 2017 FlashX, LLC # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distrib...
vocab_batcher.py
# Copyright 2017 Google 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 # # Unless required by applicable law or agreed to in writing, ...
test_operator.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...
email.py
# -*- coding: utf-8 -*- """ ------------------------------------------------- File Name: email Description : 电子邮件支持函数 Author : Liangz Date: 2018/11/8 ------------------------------------------------- Change Activity: 2018/11/8: ------------------------------------...
build.py
## @file # build a platform or a module # # Copyright (c) 2014, Hewlett-Packard Development Company, L.P.<BR> # Copyright (c) 2007 - 2021, Intel Corporation. All rights reserved.<BR> # Copyright (c) 2018, Hewlett Packard Enterprise Development, L.P.<BR> # Copyright (c) 2020 - 2021, ARM Limited. All rights reserved....
client.py
import socket import threading from getpass import getpass client = socket.socket(socket.AF_INET,socket.SOCK_STREAM) client.connect(("127.0.0.1",5555)) nickname = input("Choose a nickname: ") if nickname == "admin": password = getpass("Enter the admin's password: ") stop = False def receive(): while...
runner.py
#!/usr/bin/env python3 # Copyright 2010 The Emscripten Authors. All rights reserved. # Emscripten is available under two separate licenses, the MIT license and the # University of Illinois/NCSA Open Source License. Both these licenses can be # found in the LICENSE file. """This is the Emscripten test runner. To run ...
PythonExecutor.py
#!/usr/bin/python2 """ 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"); y...
test_examples.py
import pytest from bluesky.examples import (simple_scan, sleepy, wait_one, wait_multiple, conditional_pause, checkpoint_forever, simple_scan_saving, stepscan, fly_gen, conditional_break, ) from bluesk...
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...
test_partition.py
import threading import time from multiprocessing import Pool, Process import pytest from utils import util_pymilvus as ut from common.constants import default_entities, default_fields from common.common_type import CaseLabel from utils.util_log import test_log as log # TIMEOUT = 120 default_nb = ut.default_nb default...
__init__.py
# # Copyright (c) 2010-2011 Brian E. Granger & Min Ragan-Kelley # # This file is part of pyzmq. # # pyzmq is free software; you can redistribute it and/or modify it under # the terms of the Lesser GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, ...
models.py
"""Database models for the reader app.""" from __future__ import annotations from hashlib import blake2b from io import BytesIO from os import path, remove from pathlib import PurePath from shutil import rmtree from threading import Thread from typing import Any, List, Tuple from zipfile import ZipFile from django.c...
prepro.py
#! /usr/bin/python # -*- coding: utf-8 -*- import copy import threading import time import numpy as np import scipy import scipy.ndimage as ndi import skimage from scipy import linalg from scipy.ndimage.filters import gaussian_filter from scipy.ndimage.interpolation import map_coordinates from six.moves import r...
EigerClient.py
import requests, json, os import numpy from base64 import b64encode, b64decode from threading import Thread import logging, time logging.basicConfig() log = logging.getLogger(__name__) def threaded(fn): """ To use as decorator to make a function call threaded. """ def wrapper(*args, **kwargs): ...
tmp.py
#!/usr/bin/env python # -*- encoding: utf-8 -*- # A tiny Batch weB vulnerability Scanner # my[at]lijiejie.com http://www.lijiejie.com import urlparse import requests import logging import re import threading import Queue from bs4 import BeautifulSoup import multiprocessing import time from string import Template i...
weixin.py
#!/usr/bin/env python # coding: utf-8 import qrcode import urllib import urllib2 import cookielib import requests import xml.dom.minidom import json import time import re import sys import os import random import multiprocessing import platform import logging from collections import defaultdict from urlparse import url...
tests.py
from __future__ import absolute_import import sys import time import unittest from django.conf import settings from django.db import transaction, connection from django.db.utils import ConnectionHandler, DEFAULT_DB_ALIAS, DatabaseError from django.test import (TransactionTestCase, skipIfDBFeature, skipUnlessDBFea...
env_action.py
############################################################################## # Copyright (c) 2016 Huawei Technologies Co.,Ltd and others. # # All rights reserved. This program and the accompanying materials # are made available under the terms of the Apache License, Version 2.0 # which accompanies this distribution, ...
wsdump.py
#!/Users/auderouaux/Documents/untitled folder/sqreen-technical-exercise/exercise/venv/bin/python3 import argparse import code import sys import threading import time import ssl import six from six.moves.urllib.parse import urlparse import websocket try: import readline except ImportError: pass def get_enc...
proc.py
from builtins import object import multiprocessing class Result(object): def ready(self): raise NotImplementedError() def get(self): raise NotImplementedError() class ForkResult(Result): def __init__(self, queue, p): self.queue = queue self.p = p def ready(self): ...
RedClientHandler.py
import asyncio import json import logging import websockets import threading import time class RedClientHandler: def __init__(self, serverMgr, ws): self.ws = ws self.serverMgr = serverMgr self.running = True self.behaviorHandlerThread = threading.Thread(target = self.behaviorHandl...
installwizard.py
import os import sys import threading import traceback from PyQt5.QtCore import * from PyQt5.QtGui import * from PyQt5.QtWidgets import * from electrum_vtc import Wallet, WalletStorage from electrum_vtc.util import UserCancelled, InvalidPassword from electrum_vtc.base_wizard import BaseWizard, HWD_SETUP_DECRYPT_WALL...
utill.py
import time from threading import Thread from IPython.display import clear_output __author__ = 'Haryo Bagas Assyafah' __copyright__ = 'Copyright 2020 Bear Au Jus - ジュースとくま' __credits__ = ['Haryo Bagas Assyafah'] __license__ = "MIT" __version__ = "1.0" __maintainer__ = "Haryo Bagas Assyafah" __email__ = "hary...
reshell.py
from os import path from threading import Thread from libs.c64 import encrypt from libs.config import alias, gget, color from libs.myapp import delay_send, get_system_code, has_env, is_windows, send from libs.reverse_client_bash import main as bind from webshell_plugins.upload import run as upload def get_php(ip, po...
compile_json.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import sys import Queue import threading import pykeyvi import argparse import os import gzip import unicodedata, re control_chars = ''.join(map(unichr, range(0,32))) control_char_re = re.compile('[%s]' % re.escape(control_chars)) def remove_control_chars(s): return ...
qiushibaike.py
#-*-coding=utf8-*- import requests from lxml import etree from queue import Queue import threading # 多线程队列 class Qiubai(object): def __init__(self): self.url="https://www.qiushibaike.com/8hr/page/{}/" self.headers={"User-Agent": "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like ...
test_runner_local.py
import os import threading import time from unittest import TestCase import psutil from galaxy import job_metrics from galaxy import model from galaxy.jobs.runners import local from galaxy.util import bunch from ..tools_support import ( UsesApp, UsesTools ) class TestLocalJobRunner(TestCase, UsesApp, UsesTo...
HeartbeatComputationLayer.py
import multiprocessing import threading from math import pow import time from fractions import Fraction as Fr from PiCN.Processes import LayerProcess from PiCN.Packets import Name, Interest, Content, Nack, NackReason from PiCN.Playground.Heartbeats.Layers.PacketEncoding.Heartbeat import Heartbeat class He...
setup.py
#!/usr/bin/env python3 # Copyright 2004-present Facebook. All Rights Reserved. # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. """Miscellaneous I/O utility functions for setting up the render pipeline. Abstracts over the setup that has...
run.py
# encoding:utf-8 # date:2020-12-6 # author: x.l.eric # function: run server & client & model_inference import os import time import threading from threading import current_thread, Lock def run_one_process(command,process_id): print("command : {}, process_id : {}".format(command,process_id)) os.system(command)...
test_messaging.py
# Copyright (c) 2017-2018 CRS4 # # Permission is hereby granted, free of charge, to any person obtaining a copy of # this software and associated documentation files (the "Software"), to deal in # the Software without restriction, including without limitation the rights to use, # copy, modify, merge, publish, distribut...
web.py
# Electrum ABC - lightweight eCash client # Copyright (C) 2020 The Electrum ABC developers # Copyright (C) 2011 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 restr...
jobStoreTest.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...
strongLens_rate_cosmos.py
import sys, os from math import * import numpy as np from astropy.table import Table from get_csection_wmag import cross_section from gnfwLens import lens_stat_gnfw from get_concentration import concentration from multiprocessing import Process, Queue, Value, Array import time, os, random # Read from MICE catalogue ...
vehicle_handler.py
import abc import time from threading import Thread from donkeycar_memory_handler import Memory from log_handler import LogHandler logger = LogHandler().get_logger(__name__) class AbstractVehicleHandler(abc.ABC): def __init__(self, *args, **kwargs): pass @abc.abstractmethod def add(self,*args, *...
application.py
from flask import Flask, render_template, url_for, flash, redirect from forms import RegistrationForm, LoginForm, RegistrationForm_Advertiser import requests from monkeylearn import MonkeyLearn from flask_login import LoginManager from threading import Thread import time from Filter_ads import FilterAds application = ...
tf_util.py
import numpy as np import tensorflow as tf # pylint: ignore-module import copy import os import functools import collections import multiprocessing def switch(condition, then_expression, else_expression): """Switches between two operations depending on a scalar value (int or bool). Note that both `then_expres...
dns.py
import threading import socket import socketserver import redis import json from functools import reduce strict_redis = redis.StrictRedis(host='localhost', port=6379, db=0) class Scanner: """scan bytes""" __mark_offset_byte, __mark_offset_bit = 0, 0 def __init__(self, data: bytes, offset_byte=0, offset_...
jobStoreTest.py
# Copyright (C) 2015-2021 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...
main.py
import sys import pygame import math from pygame import gfxdraw import argparse import cv2 import os from easing_functions import * from pycoral.adapters.common import input_size from pycoral.adapters.detect import get_objects from pycoral.utils.dataset import read_label_file from pycoral.utils.edgetpu import make_in...
hogwild_trainer.py
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved import copy import torch import torch.multiprocessing as mp from pytext.common.constants import Stage from pytext.config.pytext_config import ConfigBase from pytext.metric_reporters import MetricReporter from pytext.trainers...
threadingTest.py
import time import threading # 新线程执行的代码: def loop(): print('thread %s is running...' % threading.current_thread().name) n = 0 while n < 5: n = n + 1 print('thread %s >>> %s' % (threading.current_thread().name, n)) time.sleep(1) print('thread %s ended.' % threading.current_threa...
tunnel.py
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
Single_vs_Accum_SP.py
import random from multiprocessing import Process, Lock import pickle import os import matplotlib from sklearn.model_selection import ShuffleSplit, StratifiedShuffleSplit from AdaFairSP import AdaFairSP matplotlib.use('Agg') import sys sys.path.insert(0, 'DataPreprocessing') import time from load_compas_data impo...
Translator.py
import asyncio import hashlib import json import threading import urllib.parse import requests from parsimonious import ParseError, VisitationError from pyseeyou import format from Util import Configuration, GearbotLogging, Emoji, Utils LANGS = dict() LANG_NAMES = dict(en_US= "English") LANG_CODES = dict(English="en...
make_common_features.py
###################################################################################################### ## ## make_common_features.py: calculate common features from network adjency matrix ## avg_deg_centrality, avg_clustering_coeff, avg_shortest_paths, ## avg_eccentricity, avg_node_closeness_centrality, ##...
log_printer.py
from __future__ import absolute_import from __future__ import unicode_literals import sys from collections import namedtuple from itertools import cycle from threading import Thread from docker.errors import APIError from six.moves import _thread as thread from six.moves.queue import Empty from six.moves.queue import...
log_window.py
# flake8: noqa: E402 # Required to allow use of gi.require_version import os import threading import time import gi from pygtail import Pygtail gi.require_version("Gtk", "3.0") from gi.repository import GLib from gi.repository import Gtk as gtk from ...utils import Utils # File paths ASSETS_DIR = os.path.join(Util...
maven_cleaner.py
import os import sys from threading import Thread try: from queue import Queue # python 3 from urllib.request import urlretrieve except: from Queue import Queue # python 2 from urllib import urlretrieve home = os.path.expanduser("~") maven_home = os.path.join(home, '.m2/repository') print('MAVEN HOME: %s' %...
processify.py
import os import sys import traceback from functools import wraps from multiprocessing import Process, Queue ''' found this awesome processify function here: https://gist.github.com/schlamar/2311116 ''' def processify(func): '''Decorator to run a function as a process. Be sure that every argument...
cli.py
import logging import os import time from collections import namedtuple import asyncio import numpy as np import click import six # bug with pyinstaller without this from pytictoc import TicToc from translation import get_pinyin, get_all_phrase_translations, contains_chinese, get_translate_fn from ocr im...
gui.py
from gfx import gfxControl from gfx_model import DANGER, WARNING, SAFE from pidar import MRS6000 from time import sleep import toml from playsound import playsound from threading import Thread def sound_alarm(name): playsound(name+'.wav') def main(): config = toml.load('config.toml') sensor = config['sens...
firehose.py
#! /usr/bin/env awx-python # # !!! READ BEFORE POINTING THIS AT YOUR FOOT !!! # # This script attempts to connect to an AWX database and insert (by default) # a billion main_jobevent rows as screamingly fast as possible. # # tl;dr for best results, feed it high IOPS. # # this script exists *solely* for the purpose of ...
thready.py
import threading def task(f,params): t = threading.Thread(target=f,args=params) return t def fib(x): return 1 if x<=2 else fib(x-1)+fib(x-2) import threadpool as tp pool = tp.ThreadPool(8) # async map function with multithreading support. # returned mapresult is a map with integer indices. def amap(f,pl...
connections.py
import socket import queue import threading import logging import binascii from abc import ABC, abstractmethod from udsoncan.Request import Request from udsoncan.Response import Response from udsoncan.exceptions import TimeoutException class BaseConnection(ABC): def __init__(self, name=None): if nam...
add_code_to_python_process.py
r''' Copyright: Brainwy Software Ltda. License: EPL. ============= Works for Windows relying on a fork of winappdbg which works in py2/3 (at least for the part we're interested in). See: https://github.com/fabioz/winappdbg (py3 branch). Note that the official branch for winappdbg is: https://github.com/MarioVilas/wi...
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.fu...
mock_ami.py
import socket import threading from rx import Observable class AMIMock(object): thread = None def __init__(self): self.socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) def start(self): self.socket.bind((socket.gethostname(), 0,)) self.thread = threading.Thread(target=s...
runner.py
# ___________________________________________________________________________ # # Prescient # Copyright 2020 National Technology & Engineering Solutions of Sandia, LLC # (NTESS). Under the terms of Contract DE-NA0003525 with NTESS, the U.S. # Government retains certain rights in this software. # This software is ...
exeTest.py
import os import threading import time import psutil class logClass: def start(self): self.stat = True def end(self): self.stat = False def log(self): l=open('../../data/dockTest/usage.csv', 'w') l.write('time,cpu,mem\n') while self.stat: l.write(str(tim...
sleepSort.py
#!/usr/bin/env python3 import time import threading def sleep(i): time.sleep(i) print(i) def sleepSort(v): for i in range(len(v)): newThread = threading.Thread(target=sleep, args=(v[i],)) newThread.start() return None def main(): v = [5,2,6,1,4,3] sleepSort(v); def test(): ...
webserver.py
''' Copyright (c) 2019 Modul 9/HiFiBerry Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribu...
main.py
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'mainwindow.ui' # # Created by: PyQt5 UI code generator 5.11.3 # # WARNING! All changes made in this file will be lost! from PyQt5 import QtCore, QtGui, QtWidgets from PyQt5.QtWidgets import QTableWidgetItem,QFileDialog, QAbstractItemView fr...
dir_list.py
#!/usr/bin/python3 # -*- coding: utf-8 -*- # This is a part of CMSeeK, check the LICENSE file for more information # Copyright (c) 2018 - 2020 Tuhinshubhra import threading import cmseekdb.basic as cmseek joom_dir_found = 0 joom_dirs = [] def check_directory(url,file,ua): global joom_dir_found, joom_dirs fil...
masker.py
from mask.configuration.operations import * from mask.database.database_gateway import DatabaseGateway from mask.rules.rule import Rule from mask.rules.rules_factory import RulesFactory import argparse import sys import threading def main(arguments) -> None: configuration_settings: dict = get_configuration_setti...
manager.py
from threading import Thread from conpaas.core.expose import expose from conpaas.core.manager import BaseManager from conpaas.core.https.server import HttpJsonResponse, HttpErrorResponse from conpaas.services.helloworld.agent import client class HelloWorldManager(BaseManager): # Manager states - Used by the fr...
reosploit.py
#!/bin/env python3 import requests import json import sys import os from colorama import Fore, init, Back, Style init() import socket import random import netaddr import pyshark import argparse import threading from queue import Queue import time import cv2 from scapy.all import * def setargs(): global args parser = ...
decorators.py
import sys import time import threading import re from itertools import cycle from functools import wraps, lru_cache from copy import copy import numpy as np from pysprint.config import _get_config_value from pysprint.utils.misc import run_from_ipython __all__ = [ '_progress', 'inplacify', '_mutually_ex...
common.py
from bs4 import BeautifulSoup as bs import threading import time import numpy as np import sys from io import StringIO import scrapeconfig as cng import consoleconfig as ccng import os def print_html(html_test): '''To print html containers returned by beautifulsoup4''' try: strhtml = st...
wifiConnection.py
""" Holds all the data and commands needed to fly a Bebop drone. Author: Amy McGovern, dramymcgovern@gmail.com """ from zeroconf import ServiceBrowser, Zeroconf from datetime import datetime import time import socket import ipaddress import json from pyparrot.utils.colorPrint import color_print import struct import t...
thread.py
# import stdlib # import loguru import threading import time # logger = loguru.logger __threads = {} __threads_should_close = False def __thread_func(func, args, name): logger.info("thread " + name + " start") while not __threads_should_close: func(*args) logger.info("thread " + name + " stop") d...
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...
audio_capture.py
#!/usr/bin/env python import threading import wave import pyaudio class AudioRecorder(object): # Audio class based on pyAudio and Wave def __init__(self, input_device_index: int): self.open = True self.rate = 44100 self.frames_per_buffer = 1024 self.channels = 2 self...
test_waitable.py
# Copyright 2018 Open Source Robotics Foundation, 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 # # Unless required by applicable law...
ws28xx.py
# Copyright 2013 Matthew Wall # See the file LICENSE.txt for your full rights. # # Thanks to Eddie De Pieri for the first Python implementation for WS-28xx. # Eddie did the difficult work of decompiling HeavyWeather then converting # and reverse engineering into a functional Python implementation. Eddie's # work was b...
run_generation.py
# Parts of this file were adopted from https://github.com/huggingface/transformers. # See the original copyright notice below. # Copyright 2018 Google AI, Google Brain and Carnegie Mellon University Authors and the HuggingFace Inc. team. # Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved. # # Licensed unde...
wallet_multiwallet.py
#!/usr/bin/env python3 # Copyright (c) 2017-2019 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test multiwallet. Verify that a lotusd node can load multiple wallet files """ import os import shutil...
walkthrough.py
import sys,os,tempfile import option import grapeConfig import grapeGit as git import utility import re import threading try: import Tkinter as Tk TkinterImportError = None except ImportError as e: TkinterImportError = e class Walkthrough(option.Option): """ grape w(alkthrough) Usage: grape-...
web_service.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...
redis_killer.py
#!/usr/bin/env python3 import os from threading import Thread import time import signal from rq import Worker, Queue from rq.job import Job import logging logging.basicConfig(level=logging.DEBUG) kill_key = "rq:jobs:kill" class KillJob(Job): """Patch rq.Job, adding Job kill support This starts a Thread to ...
api.py
from inference import app,env_bigquery_df import logging from google.cloud import bigquery import os import collections from google.cloud import storage import re import spacy from pathlib import Path import threading from sklearn.feature_extraction.text import CountVectorizer from sklearn.feature_extraction.text impo...
neo4j-facebook.py
#!/usr/bin/python from __future__ import division from py2neo import neo4j, node, rel, cypher from threading import Thread from collections import OrderedDict import facebook, sys, time, json # Configuration YOUR_NAME = "YOUR_NAME" YOUR_FB_TOKEN = "YOUR_FACEBOOK_ACCESS_TOKEN" # IMPORTANT: IF YOU'RE RUNNING ON AN EC2....
test_util.py
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
utils.py
#!/usr/bin/env python import os import re import glob import fnmatch import subprocess as sp import sys import shutil import contextlib from collections import Counter, Iterable, defaultdict, namedtuple from itertools import product, chain, groupby import logging import datetime from threading import Event, Thread fro...
foo.py
# Python 3.3.3 and 2.7.6 # python fo.py from threading import Thread # Potentially useful thing: # In Python you "import" a global variable, instead of "export"ing it when you declare it # (This is probably an effort to make you feel bad about typing the word "global") i = 0 def incrementingFunction(): glob...
toast.py
# -*- mode: python; coding: utf-8 -*- # Copyright 2013-2020 Chris Beaumont and the AAS WorldWide Telescope project # Licensed under the MIT License. """Computations for the TOAST projection scheme and tile pyramid format. TODO this all needs to be ported to modern Toasty infrastructure and wwt_data_formats. """ from...
utils.py
# Copyright (c) MONAI Consortium # 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, so...
wbench-gui.py
import subprocess import logging from logging.handlers import RotatingFileHandler from flask import Flask, render_template, request, url_for from flask.ext.script import Manager from flask.ext.bootstrap import Bootstrap from flask.ext.moment import Moment from flask.ext.wtf import Form from wtforms import StringField, ...