Skip to content

Instantly share code, notes, and snippets.

load("//tensorflow/lite:build_def.bzl", "tflite_copts")
load("//tensorflow/lite/micro:build_def.bzl", "micro_copts")
load("//tensorflow/lite:special_rules.bzl", "tflite_portable_test_suite_combined")
load("//tensorflow:tensorflow.bzl", "tf_opts_nortti_if_android")
load("//tensorflow:tensorflow.bzl", "get_compatible_with_portable")
package(
default_visibility = [
"//visibility:public",
],
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import asyncio
loop = asyncio.get_event_loop()
async def f1():
for _ in range(10):
await asyncio.sleep(1)
print("task 1 is done")
from functools import wraps
import timeit
from config import logger
from contextlib import contextmanager
@contextmanager
def measure_time_to(message):
"""
Logs the time it takes to execute the block inside the with statement.
@tcwalther
tcwalther / delayedinterrupt.py
Last active February 2, 2024 14:59
DelayedInterrupt class - delaying the handling of process signals in Python
import signal
import logging
# class based on: http://stackoverflow.com/a/21919644/487556
class DelayedInterrupt(object):
def __init__(self, signals):
if not isinstance(signals, list) and not isinstance(signals, tuple):
signals = [signals]
self.sigs = signals
# the data model is based on
# http://railscasts.com/episodes/154-polymorphic-association-revised
class Article < ActiveRecord::Base
has_many :comments, as: :commentable
# example for a custom function that is always the same for each "commentable"
def most_important_comment
comments.first
end
thomas-mbp:veewee thomas$ veewee vbox validate 'windows'
WARNING: Could not load IOV methods. Check your GSSAPI C library for an update
WARNING: Could not load AEAD methods. Check your GSSAPI C library for an update
WARNING: Nokogiri was built against LibXML version 2.8.0, but has dynamically loaded 2.9.0
Waiting for winrm login on 127.0.0.1 with user vagrant to windows on port => 5985 to work, timeout=10000 sec
.
Executing winrm command: whoami
vagrant-2012\vagrant
Checking user - OK
Executing winrm command: ruby --version > %TEMP%\devnull && echo %ERRORLEVEL%
thomas-mbp:veewee thomas$ veewee vbox build 'windows' --force
WARNING: Could not load IOV methods. Check your GSSAPI C library for an update
WARNING: Could not load AEAD methods. Check your GSSAPI C library for an update
WARNING: Nokogiri was built against LibXML version 2.8.0, but has dynamically loaded 2.9.0
Downloading vbox guest additions iso v 4.3.8 - http://download.virtualbox.org/virtualbox/4.3.8/VBoxGuestAdditions_4.3.8.iso
Checking if isofile VBoxGuestAdditions_4.3.8.iso already exists.
Full path: /Users/thomas/Programmierung/veewee/iso/VBoxGuestAdditions_4.3.8.iso
The isofile VBoxGuestAdditions_4.3.8.iso already exists.
Building Box windows with Definition windows: