This is a common case in django ORM.
from django.db import models
class Author(models.Model):| agyaml() { | |
| local key="$1" | |
| local root="${key%%.*}" | |
| find . -type f \( -name '*.yml' -o -name '*.yaml' \) -print0 | | |
| while IFS= read -r -d '' f; do | |
| if yq -e ".$key" "$f" >/dev/null 2>&1; then | |
| echo "==> $f" |
| #!/usr/bin/env python | |
| # coding: utf-8 | |
| import operator | |
| def dayOfYear(year, month, day): | |
| # we suppose input is always correct | |
| if year % 4 == 0 and (year % 100 != 0 or year % 400 == 0): | |
| monthDays = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31] | |
| else: |