SMC
Expertise - Passion - Automation
{ | |
"$schema": "https://json-schema.org/draft/2019-09/schema", | |
"title": "AssetAdministrationShellEnvironment", | |
"$id": "http://www.admin-shell.io/schema/json/v2.0.1", | |
"type": "object", | |
"required": [ | |
"assetAdministrationShells", | |
"submodels", | |
"assets", | |
"conceptDescriptions" |
#!/bin/bash | |
PY_ROOT=$(cd "$(dirname "$0")";cd ../..; pwd) | |
MYPY_BIN=${PY_ROOT}/.venv/bin/mypy | |
basepath=`pwd` | |
OUTPUT=`$MYPY_BIN $*` |
import { observable, makeObservable, autorun, runInAction } from 'mobx'; | |
function assignValueToMember(self: object, memberName: string, version: number) { | |
console.log('\n'); | |
// @ts-ignore | |
const dispose = autorun(() => console.log(`autorun ${memberName} == ${self[memberName]}`)); | |
console.log(`assign ${memberName} = ${version}`); | |
runInAction(() => { | |
// @ts-ignore | |
self[memberName] = version; |
from unittest.mock import patch | |
from inspect import getfullargspec, ArgSpec | |
import invoke | |
def fix_annotations(): | |
""" | |
Pyinvoke doesnt accept annotations by default, this fix that | |
Based on: https://github.com/pyinvoke/invoke/pull/606 |
import re | |
import xml.etree.ElementTree as ET | |
import sys | |
# from pprint import pprint | |
from collections import ChainMap | |
def xml_to_dict_recursive(root): | |
if len(root.getchildren()) == 0: | |
return {root.tag: root.text} |
There are no mypy stubfiles for pymongo. However, there is a PR that contains stubs
Here is a tar file with the stubs:
pymongo-stubs.zip
import { reaction } from 'mobx'; | |
import { Store } from '../store/Store'; | |
// when parcel reloads the page, we have to unsubscribe the old listener... | |
let oldListener: any; | |
// this is inspired by https://hackernoon.com/how-to-decouple-state-and-ui-a-k-a-you-dont-need-componentwillmount-cc90b787aa37 | |
// TODO this is way to simple!!!!!! | |
export class MiniRouter { | |
constructor(private readonly store: Pick<Store, 'view'>) { |
import { toDateOrNull } from '../toDate'; | |
function substituteQuotedCharacters(inner: string) { | |
return inner.replace(/\\./g, function(s) { | |
switch (s[1]) { | |
case 'n': | |
return '\n'; | |
case 't': | |
return '\t'; | |
case 'r': |
/** | |
* Tries to return a valid date or null. It can parse (valid) date strings as well as numbers. | |
* @param date a valid date or null | |
*/ | |
/** | |
* Tries to return a valid date or null. It can parse (valid) date strings as well as numbers. | |
* | |
* @param val | |
* @param defaultValue | |
* @returns {any} |