This file contains 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
// Package logconfig initializes a default application structured logger. | |
package logconfig | |
import ( | |
"log/slog" | |
"os" | |
) | |
const ( | |
ErrorKey = "err" |
This file contains 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
package someapp | |
import ( | |
"errors" | |
"github.com/google/go-cmp/cmp" | |
"reflect" | |
"testing" | |
) | |
// AssertEqual evaluates two equivalent types to see if a difference exists. |
This file contains 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
// Package retry supports retrying operations supported within the [RetryOperation] type set. | |
package retry | |
import ( | |
"fmt" | |
"log/slog" | |
"os" | |
"time" | |
) |
This file contains 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
import csv | |
import sys | |
def print_csv_stats(file_path: str): | |
"""Parses a CSV file and prints some info to stdout, including: | |
- row count | |
- column count | |
- duplicate column count | |
- populated column count |
This file contains 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
version: 1 | |
disable_existing_loggers: false | |
handlers: | |
console: | |
class: logging.StreamHandler | |
formatter: json | |
stream: ext://sys.stdout | |
formatters: | |
json: | |
'()': pythonjsonlogger.jsonlogger.JsonFormatter |
This file contains 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
import os | |
# base resource directory for "file fixtures" (sample transactions) | |
resources_directory = os.path.join( | |
os.path.dirname(os.path.realpath(__file__)), | |
"resources", | |
) |
This file contains 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 ubi/ubi8 AS builder | |
LABEL name="Awesome App" \ | |
maintainer="Awesome Team" \ | |
summary="The Awesome Application" \ | |
vendor="Awesome Vendor" \ | |
version=${buildnumber} \ | |
description="A ubi8 base image with python39 installed and configured for managing the Awesome App." |
This file contains 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
import time | |
import logging | |
logger = logging.getLogger(__name__) | |
def logging_retry(retry=False, max_retries=10, retry_interval=10): | |
""" | |
smoketest decorator provides task logging with timing information and optional retries. | |
Retries, if enabled are limited to `max_retries`. The duration between each retry is calculated as | |
retry_interval = retry_attempt * retry_interval |
This file contains 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
fmt: | |
go fmt ./... | |
.PHONY:fmt | |
lint: fmt | |
revive ./... | |
.PHONY:lint | |
vet: fmt | |
go vet ./... |
This file contains 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
import json | |
from fhir.resources.patient import Patient | |
from fhir.resources import construct_fhir_element | |
from jsonpath_ng import jsonpath, parse | |
from jsonpath_ng.ext import parser | |
with open('Patient.json', 'r') as f: | |
pat_dict = json.load(f) | |
patient: Patient = construct_fhir_element("Patient", pat_dict) |
NewerOlder