This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from typing import Self, Type | |
| from zarr.abc.codec import ArrayBytesCodec | |
| from zarr.core import NDBuffer | |
| from zarr.core.buffer.cpu import Buffer | |
| from zarr.core.array_spec import ArraySpec | |
| import numpy as np | |
| from zarr.registry import register_codec | |
| from numcodecs.abc import Codec |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # This code adds custom REST api handler at runtime to a running Streamlit app | |
| # | |
| from tornado.web import Application, RequestHandler | |
| from tornado.routing import Rule, PathMatches | |
| import gc | |
| import streamlit as st | |
| @st.cache_resource() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from contextlib import AbstractContextManager | |
| from future.utils import raise_from | |
| class ExceptionContext(AbstractContextManager) : | |
| def __init__(self, context): | |
| self.context = context | |
| def __exit__(self, exc_type, exc_val, exc_tb): | |
| if exc_val != None : |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| javascript:(function(){ | |
| var click = function(e){e.click()}; | |
| var nbInvite = 0; | |
| var exec = function() { | |
| var invites = document.querySelectorAll("button[type='submit'][class*='_qfo']"); | |
| nbInvite += invites.length; | |
| [].forEach.call(invites, click); | |
| alert("Termine : " + nbInvite + " personnes invitees"); | |
| }; | |
| exec(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| javascript:(function(){ | |
| var click = function(e){e.click()}; | |
| var nbInvite = 0; | |
| var exec = function() { | |
| var invites = document.querySelectorAll("button[type='submit'][class*='_qfo']"); | |
| nbInvite += invites.length; | |
| [].forEach.call(invites, click); | |
| }; | |
| exec(); | |
| })(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| javascript:(function(){ | |
| var click = function(e){e.click()}; | |
| var nbInvite = 0; | |
| var exec = function() { | |
| var invites = document.evaluate("a[contains('Invit')]", document, null, XPathResult.ANY_TYPE, null); | |
| var invite | |
| nbInvite += 1; | |
| while ((invite = invites.iterateNext()) != null) { | |
| invite.click(); | |
| nbInvite += 1; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Smart JunitRunner that autowires fields together for @Autowire (Spring) fields, | |
| * or create empty mock otherwize. | |
| * The properties marked with @AutoMock will be autwired with other properties | |
| * marked with @AutoMock or new empty mock. | |
| */ | |
| public class AutoMockTestRunner extends BlockJUnit4ClassRunner { | |
| @Retention(RUNTIME) | |
| @Target(FIELD) |