A "Best of the Best Practices" (BOBP) guide to developing in Python.
- "Build tools for others that you want to be built for you." - Kenneth Reitz
- "Simplicity is alway better than functionality." - Pieter Hintjens
def primes(max) | |
nums = Array.new(max + 1, 1) | |
nums[0] = nums[1] = 0 | |
(2..Math.sqrt(max)).each do |sieve| | |
if nums[sieve] == 1 | |
(2 * sieve).step(max, sieve).each do |num| | |
nums[num] = 0 | |
end | |
end |
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 | |
# | |
# Unless required by applicable law or agreed to in writing, software | |
# distributed under the License is distributed on an "AS IS" BASIS, |
import argparse | |
import psutil | |
import tensorflow as tf | |
from typing import Dict, Any, Callable, Tuple | |
## Data Input Function | |
def data_input_fn(data_param, | |
batch_size:int=None, | |
shuffle=False) -> Callable[[], Tuple]: | |
"""Return the input function to get the test data. |
import re, strutils, strformat, tables, sequtils, math | |
type | |
Header* = object | |
doc: string | |
level: int | |
MarkdownTokenType* {.pure.} = enum | |
Header |