Skip to content

Instantly share code, notes, and snippets.

View lmazuel's full-sized avatar

Laurent Mazuel lmazuel

View GitHub Profile
@lmazuel
lmazuel / mvad_polling.py
Last active March 17, 2023 03:15
MVAD Polling
class MVADPolling(LongRunningOperation):
"""Implements MVAD train polling."""
def __init__(self):
self._model_id = None
def can_poll(self, pipeline_response: "PipelineResponseType") -> bool:
# This method is used for algorithm chaining, in MVAD we don't need
# it since this is the only one we will register
return True
@lmazuel
lmazuel / setuptopyproj.py
Created January 27, 2023 23:37
Setup.py to pyproject.toml
# Just having fun, don't take this to seriously :p
import sys
import importlib
def new_module(mod_name):
spec = importlib.machinery.ModuleSpec(mod_name,None)
return importlib.util.module_from_spec(spec)
@lmazuel
lmazuel / cadl_fun.md
Last active December 14, 2022 03:12
CADL Model fun

Syntax 1

op (one: int32, two: int32): void;

Send JSON:

{"one": 12, "two": 47}
@lmazuel
lmazuel / update_labels.py
Created September 2, 2022 18:23
Push labels on Github
import sys
from github import Github, GithubException
REPOS = [
"Azure/azure-sdk-for-python",
"Azure/azure-sdk-for-net",
"Azure/azure-sdk-for-js",
"Azure/azure-sdk-for-java",
@lmazuel
lmazuel / dpg_process.md
Last active August 30, 2022 16:21
Process for issue declaration for CADL and DPG related issues

When creating an issue for DPG:

enum AppConfigurationEventTypes {
modified;
deleted;
}
model AppConfigurationBase<TResource> {
@doc("The key used to identify the key-value that was {name}.", TResource)
key?: string;
@doc("The label, if any, used to identify the key-value that was {name}.", TResource)
label?: string;
@lmazuel
lmazuel / swagger_hell.json
Last active February 7, 2022 23:29
Swagger and flattening
{
"swagger": "2.0",
"info": {
"title": "AutoRest Resource Flattening Test Service",
"description": "Resource Flattening for AutoRest",
"version": "1.0.0"
},
"host": "localhost:3000",
"schemes": ["http"],
"produces": ["application/json"],
@lmazuel
lmazuel / test_llc.py
Created July 2, 2021 23:03
LLC test example
# --------------------------------------------------------------------------
#
# Copyright (c) Microsoft Corporation. All rights reserved.
#
# The MIT License (MIT)
#
# 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, distribute, sublicense, and/or
@lmazuel
lmazuel / result.txt
Created May 21, 2021 21:24
Required query params
Found 398 specs
Names {
isGroupbySite: 2,
nextPartitionKey: 2,
nextRowKey: 2,
query: 37,
errorBucket: 1,
farmerId: 8,
boundaryId: 3,
otherFarmerId: 1,
@lmazuel
lmazuel / llv_view.py
Last active May 12, 2021 17:33
LLC view brainstorm
# from m4
intpu = "code-model-+no-tags.yuaml"
model = yaml.parse(input)
main_view : LLCClientView = process_model(model)
# from Swagger