SYMBOL INDEX (1197 symbols across 127 files) FILE: Data/stocksim.py function minutes (line 23) | def minutes(tm): function minutes_to_str (line 35) | def minutes_to_str(m): function read_history (line 43) | def read_history(filename): function csv_record (line 53) | def csv_record(fields): class StockTrack (line 57) | class StockTrack(object): method __init__ (line 58) | def __init__(self,name): method add_data (line 71) | def add_data(self,record): method reset (line 73) | def reset(self,time): method interpolate (line 92) | def interpolate(self,field): method update (line 104) | def update(self): method incr (line 114) | def incr(self,dt): method make_record (line 121) | def make_record(self): class MarketSimulator (line 125) | class MarketSimulator(object): method __init__ (line 126) | def __init__(self): method register (line 131) | def register(self,observer): method publish (line 134) | def publish(self,record): method add_history (line 137) | def add_history(self,filename): method reset (line 144) | def reset(self,time): method run (line 150) | def run(self,dt): class BasicPrinter (line 164) | class BasicPrinter(object): method update (line 165) | def update(self,record): class LogPrinter (line 168) | class LogPrinter(object): method __init__ (line 169) | def __init__(self,filename): method update (line 171) | def update(self,record): FILE: Solutions/1_1/art.py function draw (line 8) | def draw(rows, columns): FILE: Solutions/1_4/pcost.py function portfolio_cost (line 3) | def portfolio_cost(filename): FILE: Solutions/1_5/stock.py class Stock (line 3) | class Stock: method __init__ (line 4) | def __init__(self, name, shares, price): method cost (line 8) | def cost(self): FILE: Solutions/1_6/pcost.py function portfolio_cost (line 3) | def portfolio_cost(filename): FILE: Solutions/2_1/readrides.py function read_rides_as_tuples (line 5) | def read_rides_as_tuples(filename): function read_rides_as_dicts (line 22) | def read_rides_as_dicts(filename): class Row (line 44) | class Row: method __init__ (line 47) | def __init__(self, route, date, daytype, rides): function read_rides_as_instances (line 57) | def read_rides_as_instances(filename): FILE: Solutions/2_2/readport.py function read_portfolio (line 6) | def read_portfolio(filename): FILE: Solutions/2_2/readrides.py function read_rides_as_tuples (line 5) | def read_rides_as_tuples(filename): function read_rides_as_dicts (line 22) | def read_rides_as_dicts(filename): class Row (line 44) | class Row: method __init__ (line 47) | def __init__(self, route, date, daytype, rides): function read_rides_as_instances (line 57) | def read_rides_as_instances(filename): FILE: Solutions/2_4/mutint.py class MutInt (line 8) | class MutInt: method __init__ (line 11) | def __init__(self, value): method __str__ (line 14) | def __str__(self): method __repr__ (line 17) | def __repr__(self): method __format__ (line 20) | def __format__(self, fmt): method __add__ (line 24) | def __add__(self, other): method __iadd__ (line 36) | def __iadd__(self, other): method __eq__ (line 47) | def __eq__(self, other): method __lt__ (line 56) | def __lt__(self, other): method __int__ (line 65) | def __int__(self): method __float__ (line 68) | def __float__(self): FILE: Solutions/2_5/readrides.py function read_rides_as_tuples (line 6) | def read_rides_as_tuples(filename): function read_rides_as_dicts (line 23) | def read_rides_as_dicts(filename): class Row (line 45) | class Row: method __init__ (line 47) | def __init__(self, route, date, daytype, rides): function read_rides_as_instances (line 53) | def read_rides_as_instances(filename): function read_rides_as_columns (line 71) | def read_rides_as_columns(filename): class RideData (line 92) | class RideData(collections.abc.Sequence): method __init__ (line 93) | def __init__(self): method __len__ (line 100) | def __len__(self): method append (line 104) | def append(self, d): method __getitem__ (line 110) | def __getitem__(self, index): function read_rides_as_dicts (line 117) | def read_rides_as_dicts(filename): FILE: Solutions/2_6/colreader.py class DataCollection (line 7) | class DataCollection(collections.abc.Sequence): method __init__ (line 8) | def __init__(self, columns): method __len__ (line 12) | def __len__(self): method __getitem__ (line 15) | def __getitem__(self, index): function read_csv_as_columns (line 20) | def read_csv_as_columns(filename, types): FILE: Solutions/2_6/reader.py function read_csv_as_dicts (line 5) | def read_csv_as_dicts(filename, types): FILE: Solutions/3_1/stock.py class Stock (line 3) | class Stock: method __init__ (line 4) | def __init__(self, name, shares, price): method cost (line 9) | def cost(self): method sell (line 12) | def sell(self, nshares): function read_portfolio (line 15) | def read_portfolio(filename): function print_portfolio (line 29) | def print_portfolio(portfolio): FILE: Solutions/3_2/stock.py class Stock (line 3) | class Stock: method __init__ (line 4) | def __init__(self, name, shares, price): method cost (line 9) | def cost(self): method sell (line 12) | def sell(self, nshares): function read_portfolio (line 16) | def read_portfolio(filename): FILE: Solutions/3_2/tableformat.py function print_table (line 4) | def print_table(records, fields): FILE: Solutions/3_3/reader.py function read_csv_as_dicts (line 5) | def read_csv_as_dicts(filename, types): function read_csv_as_instances (line 18) | def read_csv_as_instances(filename, cls): FILE: Solutions/3_3/stock.py class Stock (line 3) | class Stock: method __init__ (line 5) | def __init__(self, name, shares, price): method from_row (line 11) | def from_row(cls, row): method cost (line 15) | def cost(self): method sell (line 18) | def sell(self, nshares): function read_portfolio (line 21) | def read_portfolio(filename): FILE: Solutions/3_3/tableformat.py function print_table (line 4) | def print_table(records, fields): FILE: Solutions/3_4/stock.py class Stock (line 3) | class Stock: method __init__ (line 6) | def __init__(self, name, shares, price): method from_row (line 12) | def from_row(cls, row): method shares (line 17) | def shares(self): method shares (line 20) | def shares(self, value): method price (line 28) | def price(self): method price (line 31) | def price(self, value): method cost (line 39) | def cost(self): method sell (line 42) | def sell(self, nshares): FILE: Solutions/3_5/reader.py function read_csv_as_dicts (line 5) | def read_csv_as_dicts(filename, types): function read_csv_as_instances (line 18) | def read_csv_as_instances(filename, cls): FILE: Solutions/3_5/stock.py class Stock (line 3) | class Stock: method __init__ (line 6) | def __init__(self, name, shares, price): method from_row (line 12) | def from_row(cls, row): method shares (line 17) | def shares(self): method shares (line 20) | def shares(self, value): method price (line 28) | def price(self): method price (line 31) | def price(self, value): method cost (line 39) | def cost(self): method sell (line 42) | def sell(self, nshares): FILE: Solutions/3_5/tableformat.py function print_table (line 3) | def print_table(records, fields, formatter): class TableFormatter (line 9) | class TableFormatter: method headings (line 10) | def headings(self, headers): method row (line 13) | def row(self, rowdata): class TextTableFormatter (line 16) | class TextTableFormatter(TableFormatter): method headings (line 17) | def headings(self, headers): method row (line 21) | def row(self, rowdata): class CSVTableFormatter (line 24) | class CSVTableFormatter(TableFormatter): method headings (line 25) | def headings(self, headers): method row (line 28) | def row(self, rowdata): class HTMLTableFormatter (line 31) | class HTMLTableFormatter(TableFormatter): method headings (line 32) | def headings(self, headers): method row (line 38) | def row(self, rowdata): function create_formatter (line 44) | def create_formatter(name): FILE: Solutions/3_6/reader.py function read_csv_as_dicts (line 5) | def read_csv_as_dicts(filename, types): function read_csv_as_instances (line 18) | def read_csv_as_instances(filename, cls): FILE: Solutions/3_6/stock.py class Stock (line 3) | class Stock: method __init__ (line 6) | def __init__(self, name, shares, price): method __repr__ (line 11) | def __repr__(self): method __eq__ (line 15) | def __eq__(self, other): method from_row (line 20) | def from_row(cls, row): method shares (line 25) | def shares(self): method shares (line 28) | def shares(self, value): method price (line 36) | def price(self): method price (line 39) | def price(self, value): method cost (line 47) | def cost(self): method sell (line 50) | def sell(self, nshares): FILE: Solutions/3_6/tableformat.py function print_table (line 3) | def print_table(records, fields, formatter): class TableFormatter (line 9) | class TableFormatter: method headings (line 10) | def headings(self, headers): method row (line 13) | def row(self, rowdata): class TextTableFormatter (line 16) | class TextTableFormatter(TableFormatter): method headings (line 17) | def headings(self, headers): method row (line 21) | def row(self, rowdata): class CSVTableFormatter (line 24) | class CSVTableFormatter(TableFormatter): method headings (line 25) | def headings(self, headers): method row (line 28) | def row(self, rowdata): class HTMLTableFormatter (line 31) | class HTMLTableFormatter(TableFormatter): method headings (line 32) | def headings(self, headers): method row (line 38) | def row(self, rowdata): function create_formatter (line 44) | def create_formatter(name): FILE: Solutions/3_7/reader.py class CSVParser (line 6) | class CSVParser(ABC): method parse (line 8) | def parse(self, filename): method make_record (line 19) | def make_record(self, headers, row): class DictCSVParser (line 22) | class DictCSVParser(CSVParser): method __init__ (line 23) | def __init__(self, types): method make_record (line 26) | def make_record(self, headers, row): class InstanceCSVParser (line 29) | class InstanceCSVParser(CSVParser): method __init__ (line 30) | def __init__(self, cls): method make_record (line 33) | def make_record(self, headers, row): function read_csv_as_dicts (line 36) | def read_csv_as_dicts(filename, types): function read_csv_as_instances (line 40) | def read_csv_as_instances(filename, cls): FILE: Solutions/3_7/stock.py class Stock (line 3) | class Stock: method __init__ (line 6) | def __init__(self, name, shares, price): method __repr__ (line 11) | def __repr__(self): method __eq__ (line 15) | def __eq__(self, other): method from_row (line 20) | def from_row(cls, row): method shares (line 25) | def shares(self): method shares (line 28) | def shares(self, value): method price (line 36) | def price(self): method price (line 39) | def price(self, value): method cost (line 47) | def cost(self): method sell (line 50) | def sell(self, nshares): FILE: Solutions/3_7/tableformat.py function print_table (line 4) | def print_table(records, fields, formatter): class TableFormatter (line 13) | class TableFormatter(ABC): method headings (line 15) | def headings(self, headers): method row (line 19) | def row(self, rowdata): class TextTableFormatter (line 22) | class TextTableFormatter(TableFormatter): method headings (line 23) | def headings(self, headers): method row (line 27) | def row(self, rowdata): class CSVTableFormatter (line 30) | class CSVTableFormatter(TableFormatter): method headings (line 31) | def headings(self, headers): method row (line 34) | def row(self, rowdata): class HTMLTableFormatter (line 37) | class HTMLTableFormatter(TableFormatter): method headings (line 38) | def headings(self, headers): method row (line 44) | def row(self, rowdata): function create_formatter (line 50) | def create_formatter(name): FILE: Solutions/3_8/reader.py class CSVParser (line 6) | class CSVParser(ABC): method parse (line 8) | def parse(self, filename): method make_record (line 19) | def make_record(self, headers, row): class DictCSVParser (line 22) | class DictCSVParser(CSVParser): method __init__ (line 23) | def __init__(self, types): method make_record (line 26) | def make_record(self, headers, row): class InstanceCSVParser (line 29) | class InstanceCSVParser(CSVParser): method __init__ (line 30) | def __init__(self, cls): method make_record (line 33) | def make_record(self, headers, row): function read_csv_as_dicts (line 36) | def read_csv_as_dicts(filename, types): function read_csv_as_instances (line 40) | def read_csv_as_instances(filename, cls): FILE: Solutions/3_8/stock.py class Stock (line 3) | class Stock: method __init__ (line 6) | def __init__(self, name, shares, price): method __repr__ (line 11) | def __repr__(self): method __eq__ (line 15) | def __eq__(self, other): method from_row (line 20) | def from_row(cls, row): method shares (line 25) | def shares(self): method shares (line 28) | def shares(self, value): method price (line 36) | def price(self): method price (line 39) | def price(self, value): method cost (line 47) | def cost(self): method sell (line 50) | def sell(self, nshares): class PortfolioFormatter (line 67) | class PortfolioFormatter(ColumnFormatMixin, TextTableFormatter): class PortfolioFormatter (line 73) | class PortfolioFormatter(UpperHeadersMixin, TextTableFormatter): FILE: Solutions/3_8/tableformat.py function print_table (line 4) | def print_table(records, fields, formatter): class TableFormatter (line 13) | class TableFormatter(ABC): method headings (line 15) | def headings(self, headers): method row (line 19) | def row(self, rowdata): class TextTableFormatter (line 23) | class TextTableFormatter(TableFormatter): method headings (line 24) | def headings(self, headers): method row (line 28) | def row(self, rowdata): class CSVTableFormatter (line 31) | class CSVTableFormatter(TableFormatter): method headings (line 32) | def headings(self, headers): method row (line 35) | def row(self, rowdata): class HTMLTableFormatter (line 38) | class HTMLTableFormatter(TableFormatter): method headings (line 39) | def headings(self, headers): method row (line 45) | def row(self, rowdata): class ColumnFormatMixin (line 51) | class ColumnFormatMixin: method row (line 53) | def row(self, rowdata): class UpperHeadersMixin (line 57) | class UpperHeadersMixin: method headings (line 58) | def headings(self, headers): function create_formatter (line 61) | def create_formatter(name, column_formats=None, upper_headers=False): FILE: Solutions/4_2/validate.py class Validator (line 1) | class Validator: method check (line 3) | def check(cls, value): class Typed (line 6) | class Typed(Validator): method check (line 9) | def check(cls, value): class Integer (line 14) | class Integer(Typed): class Float (line 17) | class Float(Typed): class String (line 20) | class String(Typed): class Positive (line 23) | class Positive(Validator): method check (line 25) | def check(cls, value): class NonEmpty (line 30) | class NonEmpty(Validator): method check (line 32) | def check(cls, value): class PositiveInteger (line 37) | class PositiveInteger(Integer, Positive): class PositiveFloat (line 40) | class PositiveFloat(Float, Positive): class NonEmptyString (line 43) | class NonEmptyString(String, NonEmpty): function add (line 48) | def add(x, y): class Stock (line 53) | class Stock: method __init__ (line 55) | def __init__(self, name, shares, price): method __repr__ (line 60) | def __repr__(self): method shares (line 64) | def shares(self): method shares (line 67) | def shares(self, value): method price (line 71) | def price(self): method price (line 74) | def price(self, value): method cost (line 78) | def cost(self): method sell (line 81) | def sell(self, nshares): FILE: Solutions/4_3/validate.py class Validator (line 1) | class Validator: method __init__ (line 2) | def __init__(self, name=None): method __set_name__ (line 5) | def __set_name__(self, cls, name): method check (line 9) | def check(cls, value): method __set__ (line 12) | def __set__(self, instance, value): class Typed (line 15) | class Typed(Validator): method check (line 18) | def check(cls, value): class Integer (line 23) | class Integer(Typed): class Float (line 26) | class Float(Typed): class String (line 29) | class String(Typed): class Positive (line 32) | class Positive(Validator): method check (line 34) | def check(cls, value): class NonEmpty (line 39) | class NonEmpty(Validator): method check (line 41) | def check(cls, value): class PositiveInteger (line 46) | class PositiveInteger(Integer, Positive): class PositiveFloat (line 49) | class PositiveFloat(Float, Positive): class NonEmptyString (line 52) | class NonEmptyString(String, NonEmpty): function add (line 57) | def add(x, y): class Stock (line 62) | class Stock: method __init__ (line 66) | def __init__(self, name, shares, price): method __repr__ (line 71) | def __repr__(self): method cost (line 75) | def cost(self): method sell (line 78) | def sell(self, nshares): FILE: Solutions/5_2/reader.py class CSVParser (line 8) | class CSVParser(ABC): method parse (line 10) | def parse(self, filename): method make_record (line 26) | def make_record(self, headers, row): class DictCSVParser (line 29) | class DictCSVParser(CSVParser): method __init__ (line 30) | def __init__(self, types): method make_record (line 33) | def make_record(self, headers, row): class InstanceCSVParser (line 36) | class InstanceCSVParser(CSVParser): method __init__ (line 37) | def __init__(self, cls): method make_record (line 40) | def make_record(self, headers, row): function read_csv_as_dicts (line 43) | def read_csv_as_dicts(filename, types): function read_csv_as_instances (line 47) | def read_csv_as_instances(filename, cls): FILE: Solutions/5_2/stock.py class Stock (line 3) | class Stock: method __init__ (line 6) | def __init__(self, name, shares, price): method __repr__ (line 11) | def __repr__(self): method __eq__ (line 15) | def __eq__(self, other): method from_row (line 20) | def from_row(cls, row): method shares (line 25) | def shares(self): method shares (line 28) | def shares(self, value): method price (line 36) | def price(self): method price (line 39) | def price(self, value): method cost (line 47) | def cost(self): method sell (line 50) | def sell(self, nshares): FILE: Solutions/5_3/reader.py function convert_csv (line 5) | def convert_csv(lines, converter, *, headers=None): function csv_as_dicts (line 11) | def csv_as_dicts(lines, types, *, headers=None): function csv_as_instances (line 17) | def csv_as_instances(lines, cls, *, headers=None): function read_csv_as_dicts (line 22) | def read_csv_as_dicts(filename, types, *, headers=None): function read_csv_as_instances (line 29) | def read_csv_as_instances(filename, cls, *, headers=None): FILE: Solutions/5_3/stock.py class Stock (line 3) | class Stock: method __init__ (line 6) | def __init__(self, name, shares, price): method __repr__ (line 11) | def __repr__(self): method __eq__ (line 15) | def __eq__(self, other): method from_row (line 20) | def from_row(cls, row): method shares (line 25) | def shares(self): method shares (line 28) | def shares(self, value): method price (line 36) | def price(self): method price (line 39) | def price(self, value): method cost (line 47) | def cost(self): method sell (line 50) | def sell(self, nshares): FILE: Solutions/5_4/typedproperty.py function typedproperty (line 3) | def typedproperty(name, expected_type): class Stock (line 25) | class Stock: method __init__ (line 29) | def __init__(self, name, shares, price): FILE: Solutions/5_5/reader.py function convert_csv (line 8) | def convert_csv(lines, converter, *, headers=None): function csv_as_dicts (line 22) | def csv_as_dicts(lines, types, *, headers=None): function csv_as_instances (line 26) | def csv_as_instances(lines, cls, *, headers=None): function read_csv_as_dicts (line 30) | def read_csv_as_dicts(filename, types, *, headers=None): function read_csv_as_instances (line 37) | def read_csv_as_instances(filename, cls, *, headers=None): FILE: Solutions/5_6/stock.py class Stock (line 3) | class Stock: method __init__ (line 6) | def __init__(self, name, shares, price): method __repr__ (line 11) | def __repr__(self): method __eq__ (line 15) | def __eq__(self, other): method from_row (line 20) | def from_row(cls, row): method shares (line 25) | def shares(self): method shares (line 28) | def shares(self, value): method price (line 36) | def price(self): method price (line 39) | def price(self, value): method cost (line 47) | def cost(self): method sell (line 50) | def sell(self, nshares): FILE: Solutions/5_6/teststock.py class TestStock (line 6) | class TestStock(unittest.TestCase): method test_create (line 7) | def test_create(self): method test_create_keyword (line 13) | def test_create_keyword(self): method test_cost (line 19) | def test_cost(self): method test_sell (line 23) | def test_sell(self): method test_from_row (line 28) | def test_from_row(self): method test_repr (line 34) | def test_repr(self): method test_eq (line 38) | def test_eq(self): method test_shares_badtype (line 44) | def test_shares_badtype(self): method test_shares_badvalue (line 49) | def test_shares_badvalue(self): method test_price_badtype (line 54) | def test_price_badtype(self): method test_price_badvalue (line 59) | def test_price_badvalue(self): method test_bad_attribute (line 64) | def test_bad_attribute(self): FILE: Solutions/6_1/stock.py class Stock (line 5) | class Stock(Structure): method cost (line 9) | def cost(self): method sell (line 12) | def sell(self, nshares): FILE: Solutions/6_1/structure.py class Structure (line 3) | class Structure: method __init__ (line 5) | def __init__(self, *args): method __setattr__ (line 11) | def __setattr__(self, name, value): method __repr__ (line 17) | def __repr__(self): FILE: Solutions/6_1/teststock.py class TestStock (line 6) | class TestStock(unittest.TestCase): method test_create (line 7) | def test_create(self): method test_create_keyword (line 13) | def test_create_keyword(self): method test_cost (line 19) | def test_cost(self): method test_sell (line 23) | def test_sell(self): method test_from_row (line 28) | def test_from_row(self): method test_repr (line 34) | def test_repr(self): method test_eq (line 38) | def test_eq(self): method test_shares_badtype (line 44) | def test_shares_badtype(self): method test_shares_badvalue (line 49) | def test_shares_badvalue(self): method test_price_badtype (line 54) | def test_price_badtype(self): method test_price_badvalue (line 59) | def test_price_badvalue(self): method test_bad_attribute (line 64) | def test_bad_attribute(self): FILE: Solutions/6_2/stock.py class Stock (line 5) | class Stock(Structure): method __init__ (line 7) | def __init__(self, name, shares, price): method cost (line 11) | def cost(self): method sell (line 14) | def sell(self, nshares): FILE: Solutions/6_2/structure.py class Structure (line 5) | class Structure: method _init (line 9) | def _init(): method __setattr__ (line 16) | def __setattr__(self, name, value): method __repr__ (line 22) | def __repr__(self): FILE: Solutions/6_2/teststock.py class TestStock (line 6) | class TestStock(unittest.TestCase): method test_create (line 7) | def test_create(self): method test_create_keyword (line 13) | def test_create_keyword(self): method test_cost (line 19) | def test_cost(self): method test_sell (line 23) | def test_sell(self): method test_from_row (line 28) | def test_from_row(self): method test_repr (line 34) | def test_repr(self): method test_eq (line 38) | def test_eq(self): method test_shares_badtype (line 44) | def test_shares_badtype(self): method test_shares_badvalue (line 49) | def test_shares_badvalue(self): method test_price_badtype (line 54) | def test_price_badtype(self): method test_price_badvalue (line 59) | def test_price_badvalue(self): method test_bad_attribute (line 64) | def test_bad_attribute(self): FILE: Solutions/6_3/stock.py class Stock (line 5) | class Stock(Structure): method __init__ (line 6) | def __init__(self, name, shares, price): method cost (line 10) | def cost(self): method sell (line 13) | def sell(self, nshares): FILE: Solutions/6_3/structure.py class Structure (line 6) | class Structure: method _init (line 10) | def _init(): method __setattr__ (line 17) | def __setattr__(self, name, value): method __repr__ (line 23) | def __repr__(self): method set_fields (line 28) | def set_fields(cls): FILE: Solutions/6_3/teststock.py class TestStock (line 6) | class TestStock(unittest.TestCase): method test_create (line 7) | def test_create(self): method test_create_keyword (line 13) | def test_create_keyword(self): method test_cost (line 19) | def test_cost(self): method test_sell (line 23) | def test_sell(self): method test_from_row (line 28) | def test_from_row(self): method test_repr (line 34) | def test_repr(self): method test_eq (line 38) | def test_eq(self): method test_shares_badtype (line 44) | def test_shares_badtype(self): method test_shares_badvalue (line 49) | def test_shares_badvalue(self): method test_price_badtype (line 54) | def test_price_badtype(self): method test_price_badvalue (line 59) | def test_price_badvalue(self): method test_bad_attribute (line 64) | def test_bad_attribute(self): FILE: Solutions/6_4/stock.py class Stock (line 5) | class Stock(Structure): method cost (line 9) | def cost(self): method sell (line 12) | def sell(self, nshares): FILE: Solutions/6_4/structure.py class Structure (line 3) | class Structure: method __setattr__ (line 6) | def __setattr__(self, name, value): method __repr__ (line 12) | def __repr__(self): method create_init (line 17) | def create_init(cls): FILE: Solutions/6_4/teststock.py class TestStock (line 6) | class TestStock(unittest.TestCase): method test_create (line 7) | def test_create(self): method test_create_keyword (line 13) | def test_create_keyword(self): method test_cost (line 19) | def test_cost(self): method test_sell (line 23) | def test_sell(self): method test_from_row (line 28) | def test_from_row(self): method test_repr (line 34) | def test_repr(self): method test_eq (line 38) | def test_eq(self): method test_shares_badtype (line 44) | def test_shares_badtype(self): method test_shares_badvalue (line 49) | def test_shares_badvalue(self): method test_price_badtype (line 54) | def test_price_badtype(self): method test_price_badvalue (line 59) | def test_price_badvalue(self): method test_bad_attribute (line 64) | def test_bad_attribute(self): FILE: Solutions/6_5/validate.py class Validator (line 1) | class Validator: method __init__ (line 2) | def __init__(self, name=None): method __set_name__ (line 5) | def __set_name__(self, cls, name): method check (line 9) | def check(cls, value): method __set__ (line 12) | def __set__(self, instance, value): class Typed (line 15) | class Typed(Validator): method check (line 18) | def check(cls, value): class Integer (line 23) | class Integer(Typed): class Float (line 26) | class Float(Typed): class String (line 29) | class String(Typed): class Positive (line 32) | class Positive(Validator): method check (line 34) | def check(cls, value): class NonEmpty (line 39) | class NonEmpty(Validator): method check (line 41) | def check(cls, value): class PositiveInteger (line 46) | class PositiveInteger(Integer, Positive): class PositiveFloat (line 49) | class PositiveFloat(Float, Positive): class NonEmptyString (line 52) | class NonEmptyString(String, NonEmpty): class ValidatedFunction (line 57) | class ValidatedFunction: method __init__ (line 58) | def __init__(self, func): method __call__ (line 64) | def __call__(self, *args, **kwargs): function add (line 79) | def add(x:Integer, y:Integer) -> Integer: class Stock (line 84) | class Stock: method __init__ (line 88) | def __init__(self, name, shares, price): method __repr__ (line 93) | def __repr__(self): method cost (line 97) | def cost(self): method sell (line 100) | def sell(self, nshares): FILE: Solutions/7_1/logcall.py function logged (line 3) | def logged(func): FILE: Solutions/7_1/sample.py function add (line 6) | def add(x,y): function sub (line 10) | def sub(x,y): FILE: Solutions/7_1/validate.py class Validator (line 3) | class Validator: method __init__ (line 4) | def __init__(self, name=None): method __set_name__ (line 7) | def __set_name__(self, cls, name): method check (line 11) | def check(cls, value): method __set__ (line 14) | def __set__(self, instance, value): class Typed (line 17) | class Typed(Validator): method check (line 20) | def check(cls, value): class Integer (line 25) | class Integer(Typed): class Float (line 28) | class Float(Typed): class String (line 31) | class String(Typed): class Positive (line 34) | class Positive(Validator): method check (line 36) | def check(cls, value): class NonEmpty (line 41) | class NonEmpty(Validator): method check (line 43) | def check(cls, value): class PositiveInteger (line 48) | class PositiveInteger(Integer, Positive): class PositiveFloat (line 51) | class PositiveFloat(Float, Positive): class NonEmptyString (line 54) | class NonEmptyString(String, NonEmpty): function isvalidator (line 60) | def isvalidator(item): function validated (line 63) | def validated(func): function add (line 102) | def add(x:Integer, y:Integer) -> Integer: function div (line 106) | def div(x:Integer, y:Integer) -> Integer: class Stock (line 109) | class Stock: method __init__ (line 113) | def __init__(self, name, shares, price): method __repr__ (line 118) | def __repr__(self): method cost (line 122) | def cost(self): method sell (line 126) | def sell(self, nshares:PositiveInteger): FILE: Solutions/7_2/logcall.py function logformat (line 5) | def logformat(fmt): FILE: Solutions/7_2/sample.py function add (line 6) | def add(x,y): function sub (line 10) | def sub(x,y): function mul (line 14) | def mul(x,y): FILE: Solutions/7_2/spam.py class Spam (line 3) | class Spam: method instance_method (line 5) | def instance_method(self): method class_method (line 10) | def class_method(cls): method static_method (line 15) | def static_method(): method property_method (line 20) | def property_method(self): FILE: Solutions/7_2/validate.py class Validator (line 3) | class Validator: method __init__ (line 4) | def __init__(self, name=None): method __set_name__ (line 7) | def __set_name__(self, cls, name): method check (line 11) | def check(cls, value): method __set__ (line 14) | def __set__(self, instance, value): class Typed (line 17) | class Typed(Validator): method check (line 20) | def check(cls, value): class Integer (line 25) | class Integer(Typed): class Float (line 28) | class Float(Typed): class String (line 31) | class String(Typed): class Positive (line 34) | class Positive(Validator): method check (line 36) | def check(cls, value): class NonEmpty (line 41) | class NonEmpty(Validator): method check (line 43) | def check(cls, value): class PositiveInteger (line 48) | class PositiveInteger(Integer, Positive): class PositiveFloat (line 51) | class PositiveFloat(Float, Positive): class NonEmptyString (line 54) | class NonEmptyString(String, NonEmpty): function isvalidator (line 61) | def isvalidator(item): function validated (line 64) | def validated(func): function enforce (line 101) | def enforce(**annotations): function add (line 136) | def add(x:Integer, y:Integer) -> Integer: function div (line 140) | def div(x:Integer, y:Integer) -> Integer: function sub (line 144) | def sub(x, y): class Stock (line 147) | class Stock: method __init__ (line 151) | def __init__(self, name, shares, price): method __repr__ (line 156) | def __repr__(self): method cost (line 160) | def cost(self): method sell (line 164) | def sell(self, nshares:PositiveInteger): FILE: Solutions/7_3/reader.py function convert_csv (line 8) | def convert_csv(lines, converter, *, headers=None): function csv_as_dicts (line 22) | def csv_as_dicts(lines, types, *, headers=None): function csv_as_instances (line 26) | def csv_as_instances(lines, cls, *, headers=None): function read_csv_as_dicts (line 30) | def read_csv_as_dicts(filename, types, *, headers=None): function read_csv_as_instances (line 37) | def read_csv_as_instances(filename, cls, *, headers=None): FILE: Solutions/7_3/stock.py class Stock (line 6) | class Stock(Structure): method cost (line 12) | def cost(self): method sell (line 15) | def sell(self, nshares: PositiveInteger): FILE: Solutions/7_3/structure.py class Structure (line 5) | class Structure: method __setattr__ (line 9) | def __setattr__(self, name, value): method __repr__ (line 15) | def __repr__(self): method from_row (line 20) | def from_row(cls, row): method create_init (line 25) | def create_init(cls): method __init_subclass__ (line 38) | def __init_subclass__(cls): function validate_attributes (line 42) | def validate_attributes(cls): FILE: Solutions/7_3/teststock.py class TestStock (line 6) | class TestStock(unittest.TestCase): method test_create (line 7) | def test_create(self): method test_create_keyword (line 13) | def test_create_keyword(self): method test_cost (line 19) | def test_cost(self): method test_sell (line 23) | def test_sell(self): method test_from_row (line 28) | def test_from_row(self): method test_repr (line 34) | def test_repr(self): method test_eq (line 38) | def test_eq(self): method test_shares_badtype (line 44) | def test_shares_badtype(self): method test_shares_badvalue (line 49) | def test_shares_badvalue(self): method test_price_badtype (line 54) | def test_price_badtype(self): method test_price_badvalue (line 59) | def test_price_badvalue(self): method test_bad_attribute (line 64) | def test_bad_attribute(self): FILE: Solutions/7_3/validate.py class Validator (line 3) | class Validator: method __init__ (line 4) | def __init__(self, name=None): method __set_name__ (line 7) | def __set_name__(self, cls, name): method check (line 11) | def check(cls, value): method __set__ (line 14) | def __set__(self, instance, value): class Typed (line 17) | class Typed(Validator): method check (line 20) | def check(cls, value): class Integer (line 25) | class Integer(Typed): class Float (line 28) | class Float(Typed): class String (line 31) | class String(Typed): class Positive (line 34) | class Positive(Validator): method check (line 36) | def check(cls, value): class NonEmpty (line 41) | class NonEmpty(Validator): method check (line 43) | def check(cls, value): class PositiveInteger (line 48) | class PositiveInteger(Integer, Positive): class PositiveFloat (line 51) | class PositiveFloat(Float, Positive): class NonEmptyString (line 54) | class NonEmptyString(String, NonEmpty): function isvalidator (line 60) | def isvalidator(item): function validated (line 63) | def validated(func): function enforce (line 100) | def enforce(**annotations): function add (line 135) | def add(x:Integer, y:Integer) -> Integer: function div (line 139) | def div(x:Integer, y:Integer) -> Integer: function sub (line 143) | def sub(x, y): class Stock (line 146) | class Stock: method __init__ (line 150) | def __init__(self, name, shares, price): method __repr__ (line 155) | def __repr__(self): method cost (line 159) | def cost(self): method sell (line 163) | def sell(self, nshares:PositiveInteger): FILE: Solutions/7_4/stock.py class Stock (line 6) | class Stock(Structure): method cost (line 12) | def cost(self): method sell (line 15) | def sell(self, nshares: PositiveInteger): FILE: Solutions/7_4/structure.py class Structure (line 5) | class Structure: method __setattr__ (line 9) | def __setattr__(self, name, value): method __repr__ (line 15) | def __repr__(self): method from_row (line 20) | def from_row(cls, row): method create_init (line 25) | def create_init(cls): method __init_subclass__ (line 38) | def __init_subclass__(cls): function validate_attributes (line 42) | def validate_attributes(cls): function typed_structure (line 71) | def typed_structure(clsname, **validators): FILE: Solutions/7_4/teststock.py class TestStock (line 6) | class TestStock(unittest.TestCase): method test_create (line 7) | def test_create(self): method test_create_keyword (line 13) | def test_create_keyword(self): method test_cost (line 19) | def test_cost(self): method test_sell (line 23) | def test_sell(self): method test_from_row (line 28) | def test_from_row(self): method test_repr (line 34) | def test_repr(self): method test_eq (line 38) | def test_eq(self): method test_shares_badtype (line 44) | def test_shares_badtype(self): method test_shares_badvalue (line 49) | def test_shares_badvalue(self): method test_price_badtype (line 54) | def test_price_badtype(self): method test_price_badvalue (line 59) | def test_price_badvalue(self): method test_bad_attribute (line 64) | def test_bad_attribute(self): FILE: Solutions/7_4/validate.py class Validator (line 3) | class Validator: method __init__ (line 4) | def __init__(self, name=None): method __set_name__ (line 7) | def __set_name__(self, cls, name): method check (line 11) | def check(cls, value): method __set__ (line 14) | def __set__(self, instance, value): class Typed (line 17) | class Typed(Validator): method check (line 20) | def check(cls, value): class Positive (line 33) | class Positive(Validator): method check (line 35) | def check(cls, value): class NonEmpty (line 40) | class NonEmpty(Validator): method check (line 42) | def check(cls, value): class PositiveInteger (line 47) | class PositiveInteger(Integer, Positive): class PositiveFloat (line 50) | class PositiveFloat(Float, Positive): class NonEmptyString (line 53) | class NonEmptyString(String, NonEmpty): function isvalidator (line 59) | def isvalidator(item): function validated (line 62) | def validated(func): function enforce (line 99) | def enforce(**annotations): function add (line 134) | def add(x:Integer, y:Integer) -> Integer: function div (line 138) | def div(x:Integer, y:Integer) -> Integer: function sub (line 142) | def sub(x, y): class Stock (line 145) | class Stock: method __init__ (line 149) | def __init__(self, name, shares, price): method __repr__ (line 154) | def __repr__(self): method cost (line 158) | def cost(self): method sell (line 162) | def sell(self, nshares:PositiveInteger): FILE: Solutions/7_5/mymeta.py class mytype (line 3) | class mytype(type): method __new__ (line 5) | def __new__(meta, name, bases, __dict__): class myobject (line 11) | class myobject(metaclass=mytype): class Stock (line 14) | class Stock(myobject): method __init__ (line 15) | def __init__(self,name,shares,price): method cost (line 19) | def cost(self): method sell (line 21) | def sell(self,nshares): class MyStock (line 24) | class MyStock(Stock): FILE: Solutions/7_6/reader.py function convert_csv (line 8) | def convert_csv(lines, converter, *, headers=None): function csv_as_dicts (line 22) | def csv_as_dicts(lines, types, *, headers=None): function csv_as_instances (line 26) | def csv_as_instances(lines, cls, *, headers=None): function read_csv_as_dicts (line 30) | def read_csv_as_dicts(filename, types, *, headers=None): function read_csv_as_instances (line 37) | def read_csv_as_instances(filename, cls, *, headers=None): FILE: Solutions/7_6/stock.py class Stock (line 5) | class Stock(Structure): method cost (line 11) | def cost(self): method sell (line 14) | def sell(self, nshares: PositiveInteger): FILE: Solutions/7_6/structure.py class StructureMeta (line 6) | class StructureMeta(type): method __prepare__ (line 8) | def __prepare__(meta, clsname, bases): method __new__ (line 12) | def __new__(meta, name, bases, methods): class Structure (line 16) | class Structure(metaclass=StructureMeta): method __setattr__ (line 20) | def __setattr__(self, name, value): method __repr__ (line 26) | def __repr__(self): method from_row (line 31) | def from_row(cls, row): method create_init (line 37) | def create_init(cls): method __init_subclass__ (line 50) | def __init_subclass__(cls): function validate_attributes (line 54) | def validate_attributes(cls): function typed_structure (line 83) | def typed_structure(clsname, **validators): FILE: Solutions/7_6/tableformat.py function print_table (line 4) | def print_table(records, fields, formatter): class TableFormatter (line 13) | class TableFormatter(ABC): method headings (line 15) | def headings(self, headers): method row (line 19) | def row(self, rowdata): class TextTableFormatter (line 22) | class TextTableFormatter(TableFormatter): method headings (line 23) | def headings(self, headers): method row (line 27) | def row(self, rowdata): class CSVTableFormatter (line 30) | class CSVTableFormatter(TableFormatter): method headings (line 31) | def headings(self, headers): method row (line 34) | def row(self, rowdata): class HTMLTableFormatter (line 37) | class HTMLTableFormatter(TableFormatter): method headings (line 38) | def headings(self, headers): method row (line 44) | def row(self, rowdata): class ColumnFormatMixin (line 50) | class ColumnFormatMixin: method row (line 52) | def row(self, rowdata): class UpperHeadersMixin (line 56) | class UpperHeadersMixin: method headings (line 57) | def headings(self, headers): function create_formatter (line 60) | def create_formatter(name, column_formats=None, upper_headers=False): FILE: Solutions/7_6/teststock.py class TestStock (line 6) | class TestStock(unittest.TestCase): method test_create (line 7) | def test_create(self): method test_create_keyword (line 13) | def test_create_keyword(self): method test_cost (line 19) | def test_cost(self): method test_sell (line 23) | def test_sell(self): method test_from_row (line 28) | def test_from_row(self): method test_repr (line 34) | def test_repr(self): method test_eq (line 38) | def test_eq(self): method test_shares_badtype (line 44) | def test_shares_badtype(self): method test_shares_badvalue (line 49) | def test_shares_badvalue(self): method test_price_badtype (line 54) | def test_price_badtype(self): method test_price_badvalue (line 59) | def test_price_badvalue(self): method test_bad_attribute (line 64) | def test_bad_attribute(self): FILE: Solutions/7_6/validate.py class Validator (line 3) | class Validator: method __init__ (line 4) | def __init__(self, name=None): method __set_name__ (line 7) | def __set_name__(self, cls, name): method check (line 11) | def check(cls, value): method __set__ (line 14) | def __set__(self, instance, value): method __init_subclass__ (line 20) | def __init_subclass__(cls): class Typed (line 23) | class Typed(Validator): method check (line 26) | def check(cls, value): class Positive (line 39) | class Positive(Validator): method check (line 41) | def check(cls, value): class NonEmpty (line 46) | class NonEmpty(Validator): method check (line 48) | def check(cls, value): class PositiveInteger (line 53) | class PositiveInteger(Integer, Positive): class PositiveFloat (line 56) | class PositiveFloat(Float, Positive): class NonEmptyString (line 59) | class NonEmptyString(String, NonEmpty): function isvalidator (line 65) | def isvalidator(item): function validated (line 68) | def validated(func): function enforce (line 105) | def enforce(**annotations): function add (line 140) | def add(x:Integer, y:Integer) -> Integer: function div (line 144) | def div(x:Integer, y:Integer) -> Integer: function sub (line 148) | def sub(x, y): class Stock (line 151) | class Stock: method __init__ (line 155) | def __init__(self, name, shares, price): method __repr__ (line 160) | def __repr__(self): method cost (line 164) | def cost(self): method sell (line 168) | def sell(self, nshares:PositiveInteger): FILE: Solutions/8_1/follow.py function follow (line 5) | def follow(filename): FILE: Solutions/8_1/reader.py function convert_csv (line 8) | def convert_csv(lines, converter, *, headers=None): function csv_as_dicts (line 22) | def csv_as_dicts(lines, types, *, headers=None): function csv_as_instances (line 26) | def csv_as_instances(lines, cls, *, headers=None): function read_csv_as_dicts (line 30) | def read_csv_as_dicts(filename, types, *, headers=None): function read_csv_as_instances (line 37) | def read_csv_as_instances(filename, cls, *, headers=None): FILE: Solutions/8_1/stock.py class Stock (line 6) | class Stock(Structure): method cost (line 12) | def cost(self): method sell (line 15) | def sell(self, nshares): FILE: Solutions/8_1/structure.py class StructureMeta (line 6) | class StructureMeta(type): method __prepare__ (line 8) | def __prepare__(meta, clsname, bases): method __new__ (line 12) | def __new__(meta, name, bases, methods): class Structure (line 16) | class Structure(metaclass=StructureMeta): method __setattr__ (line 20) | def __setattr__(self, name, value): method __repr__ (line 26) | def __repr__(self): method __iter__ (line 30) | def __iter__(self): method __eq__ (line 34) | def __eq__(self, other): method from_row (line 38) | def from_row(cls, row): method create_init (line 44) | def create_init(cls): method __init_subclass__ (line 57) | def __init_subclass__(cls): function validate_attributes (line 61) | def validate_attributes(cls): function typed_structure (line 90) | def typed_structure(clsname, **validators): FILE: Solutions/8_1/teststock.py class TestStock (line 6) | class TestStock(unittest.TestCase): method test_create (line 7) | def test_create(self): method test_create_keyword (line 13) | def test_create_keyword(self): method test_cost (line 19) | def test_cost(self): method test_sell (line 23) | def test_sell(self): method test_from_row (line 28) | def test_from_row(self): method test_repr (line 34) | def test_repr(self): method test_eq (line 38) | def test_eq(self): method test_shares_badtype (line 44) | def test_shares_badtype(self): method test_shares_badvalue (line 49) | def test_shares_badvalue(self): method test_price_badtype (line 54) | def test_price_badtype(self): method test_price_badvalue (line 59) | def test_price_badvalue(self): method test_bad_attribute (line 64) | def test_bad_attribute(self): FILE: Solutions/8_1/validate.py class Validator (line 3) | class Validator: method __init__ (line 4) | def __init__(self, name=None): method __set_name__ (line 7) | def __set_name__(self, cls, name): method check (line 11) | def check(cls, value): method __set__ (line 14) | def __set__(self, instance, value): method __init_subclass__ (line 20) | def __init_subclass__(cls): class Typed (line 23) | class Typed(Validator): method check (line 26) | def check(cls, value): class Positive (line 39) | class Positive(Validator): method check (line 41) | def check(cls, value): class NonEmpty (line 46) | class NonEmpty(Validator): method check (line 48) | def check(cls, value): class PositiveInteger (line 53) | class PositiveInteger(Integer, Positive): class PositiveFloat (line 56) | class PositiveFloat(Float, Positive): class NonEmptyString (line 59) | class NonEmptyString(String, NonEmpty): function isvalidator (line 65) | def isvalidator(item): function validated (line 68) | def validated(func): function enforce (line 105) | def enforce(**annotations): function add (line 140) | def add(x:Integer, y:Integer) -> Integer: function div (line 144) | def div(x:Integer, y:Integer) -> Integer: function sub (line 148) | def sub(x, y): class Stock (line 151) | class Stock: method __init__ (line 155) | def __init__(self, name, shares, price): method __repr__ (line 160) | def __repr__(self): method cost (line 164) | def cost(self): method sell (line 168) | def sell(self, nshares:PositiveInteger): FILE: Solutions/8_2/follow.py function follow (line 6) | def follow(filename): FILE: Solutions/8_2/structure.py class StructureMeta (line 6) | class StructureMeta(type): method __prepare__ (line 8) | def __prepare__(meta, clsname, bases): method __new__ (line 12) | def __new__(meta, name, bases, methods): class Structure (line 16) | class Structure(metaclass=StructureMeta): method __setattr__ (line 20) | def __setattr__(self, name, value): method __repr__ (line 26) | def __repr__(self): method __iter__ (line 30) | def __iter__(self): method __eq__ (line 34) | def __eq__(self, other): method from_row (line 38) | def from_row(cls, row): method create_init (line 43) | def create_init(cls): method __init_subclass__ (line 56) | def __init_subclass__(cls): function validate_attributes (line 60) | def validate_attributes(cls): function typed_structure (line 89) | def typed_structure(clsname, **validators): FILE: Solutions/8_2/tableformat.py function print_table (line 4) | def print_table(records, fields, formatter): class TableFormatter (line 13) | class TableFormatter(ABC): method headings (line 15) | def headings(self, headers): method row (line 19) | def row(self, rowdata): class TextTableFormatter (line 22) | class TextTableFormatter(TableFormatter): method headings (line 23) | def headings(self, headers): method row (line 27) | def row(self, rowdata): class CSVTableFormatter (line 30) | class CSVTableFormatter(TableFormatter): method headings (line 31) | def headings(self, headers): method row (line 34) | def row(self, rowdata): class HTMLTableFormatter (line 37) | class HTMLTableFormatter(TableFormatter): method headings (line 38) | def headings(self, headers): method row (line 44) | def row(self, rowdata): class ColumnFormatMixin (line 50) | class ColumnFormatMixin: method row (line 52) | def row(self, rowdata): class UpperHeadersMixin (line 56) | class UpperHeadersMixin: method headings (line 57) | def headings(self, headers): function create_formatter (line 60) | def create_formatter(name, column_formats=None, upper_headers=False): FILE: Solutions/8_2/ticker.py class Ticker (line 4) | class Ticker(Structure): FILE: Solutions/8_2/validate.py class Validator (line 3) | class Validator: method __init__ (line 4) | def __init__(self, name=None): method __set_name__ (line 7) | def __set_name__(self, cls, name): method check (line 11) | def check(cls, value): method __set__ (line 14) | def __set__(self, instance, value): method __init_subclass__ (line 20) | def __init_subclass__(cls): class Typed (line 23) | class Typed(Validator): method check (line 26) | def check(cls, value): class Positive (line 39) | class Positive(Validator): method check (line 41) | def check(cls, value): class NonEmpty (line 46) | class NonEmpty(Validator): method check (line 48) | def check(cls, value): class PositiveInteger (line 53) | class PositiveInteger(Integer, Positive): class PositiveFloat (line 56) | class PositiveFloat(Float, Positive): class NonEmptyString (line 59) | class NonEmptyString(String, NonEmpty): function isvalidator (line 65) | def isvalidator(item): function validated (line 68) | def validated(func): function enforce (line 105) | def enforce(**annotations): function add (line 140) | def add(x:Integer, y:Integer) -> Integer: function div (line 144) | def div(x:Integer, y:Integer) -> Integer: function sub (line 148) | def sub(x, y): class Stock (line 151) | class Stock: method __init__ (line 155) | def __init__(self, name, shares, price): method __repr__ (line 160) | def __repr__(self): method cost (line 164) | def cost(self): method sell (line 168) | def sell(self, nshares:PositiveInteger): FILE: Solutions/8_3/cofollow.py function follow (line 5) | def follow(filename, target): function consumer (line 18) | def consumer(func): function printer (line 28) | def printer(): FILE: Solutions/8_3/coticker.py class Ticker (line 4) | class Ticker(Structure): function to_csv (line 20) | def to_csv(target): function create_ticker (line 31) | def create_ticker(target): function negchange (line 37) | def negchange(target): function ticker (line 44) | def ticker(fmt, fields): FILE: Solutions/8_3/structure.py class StructureMeta (line 6) | class StructureMeta(type): method __prepare__ (line 8) | def __prepare__(meta, clsname, bases): method __new__ (line 12) | def __new__(meta, name, bases, methods): class Structure (line 16) | class Structure(metaclass=StructureMeta): method __setattr__ (line 20) | def __setattr__(self, name, value): method __repr__ (line 26) | def __repr__(self): method __iter__ (line 30) | def __iter__(self): method __eq__ (line 34) | def __eq__(self, other): method from_row (line 38) | def from_row(cls, row): method create_init (line 43) | def create_init(cls): method __init_subclass__ (line 56) | def __init_subclass__(cls): function validate_attributes (line 60) | def validate_attributes(cls): function typed_structure (line 89) | def typed_structure(clsname, **validators): FILE: Solutions/8_3/tableformat.py function print_table (line 4) | def print_table(records, fields, formatter): class TableFormatter (line 13) | class TableFormatter(ABC): method headings (line 15) | def headings(self, headers): method row (line 19) | def row(self, rowdata): class TextTableFormatter (line 22) | class TextTableFormatter(TableFormatter): method headings (line 23) | def headings(self, headers): method row (line 27) | def row(self, rowdata): class CSVTableFormatter (line 30) | class CSVTableFormatter(TableFormatter): method headings (line 31) | def headings(self, headers): method row (line 34) | def row(self, rowdata): class HTMLTableFormatter (line 37) | class HTMLTableFormatter(TableFormatter): method headings (line 38) | def headings(self, headers): method row (line 44) | def row(self, rowdata): class ColumnFormatMixin (line 50) | class ColumnFormatMixin: method row (line 52) | def row(self, rowdata): class UpperHeadersMixin (line 56) | class UpperHeadersMixin: method headings (line 57) | def headings(self, headers): function create_formatter (line 60) | def create_formatter(name, column_formats=None, upper_headers=False): FILE: Solutions/8_3/validate.py class Validator (line 3) | class Validator: method __init__ (line 4) | def __init__(self, name=None): method __set_name__ (line 7) | def __set_name__(self, cls, name): method check (line 11) | def check(cls, value): method __set__ (line 14) | def __set__(self, instance, value): method __init_subclass__ (line 20) | def __init_subclass__(cls): class Typed (line 23) | class Typed(Validator): method check (line 26) | def check(cls, value): class Positive (line 39) | class Positive(Validator): method check (line 41) | def check(cls, value): class NonEmpty (line 46) | class NonEmpty(Validator): method check (line 48) | def check(cls, value): class PositiveInteger (line 53) | class PositiveInteger(Integer, Positive): class PositiveFloat (line 56) | class PositiveFloat(Float, Positive): class NonEmptyString (line 59) | class NonEmptyString(String, NonEmpty): function isvalidator (line 65) | def isvalidator(item): function validated (line 68) | def validated(func): function enforce (line 105) | def enforce(**annotations): function add (line 140) | def add(x:Integer, y:Integer) -> Integer: function div (line 144) | def div(x:Integer, y:Integer) -> Integer: function sub (line 148) | def sub(x, y): class Stock (line 151) | class Stock: method __init__ (line 155) | def __init__(self, name, shares, price): method __repr__ (line 160) | def __repr__(self): method cost (line 164) | def cost(self): method sell (line 168) | def sell(self, nshares:PositiveInteger): FILE: Solutions/8_4/cofollow.py function follow (line 6) | def follow(filename,target): function consumer (line 19) | def consumer(func): function printer (line 29) | def printer(): FILE: Solutions/8_4/follow.py function follow (line 5) | def follow(filename): function splitter (line 21) | def splitter(lines): function make_records (line 26) | def make_records(rows,names): function unquote (line 30) | def unquote(records,keylist): function convert (line 36) | def convert(records,converter,keylist): function parse_stock_data (line 42) | def parse_stock_data(lines): FILE: Solutions/8_5/multitask.py function run (line 6) | def run(): function countdown (line 15) | def countdown(n): function countup (line 21) | def countup(n): FILE: Solutions/8_5/server.py function run (line 11) | def run(): function tcp_server (line 31) | def tcp_server(address, handler): function echo_handler (line 41) | def echo_handler(client, address): FILE: Solutions/8_6/asyncserver.py function run (line 12) | def run(): class GenSocket (line 32) | class GenSocket: method __init__ (line 33) | def __init__(self, sock): method accept (line 37) | def accept(self): method recv (line 43) | def recv(self, maxsize): method send (line 48) | def send(self, data): method __getattr__ (line 52) | def __getattr__(self, name): function tcp_server (line 55) | async def tcp_server(address, handler): function echo_handler (line 64) | async def echo_handler(client, address): FILE: Solutions/8_6/cofollow.py function follow (line 6) | def follow(filename,target): function receive (line 16) | def receive(expected_type): function consumer (line 24) | def consumer(func): function printer (line 34) | def printer(): FILE: Solutions/8_6/coticker.py class Ticker (line 5) | class Ticker(Structure): function to_csv (line 21) | def to_csv(target): function create_ticker (line 32) | def create_ticker(target): function negchange (line 38) | def negchange(target): function ticker (line 45) | def ticker(fmt, fields): FILE: Solutions/8_6/server.py function run (line 11) | def run(): class GenSocket (line 31) | class GenSocket: method __init__ (line 32) | def __init__(self, sock): method accept (line 35) | def accept(self): method recv (line 40) | def recv(self, maxsize): method send (line 44) | def send(self, data): method __getattr__ (line 48) | def __getattr__(self, name): function tcp_server (line 51) | def tcp_server(address, handler): function echo_handler (line 60) | def echo_handler(client, address): FILE: Solutions/8_6/structure.py class StructureMeta (line 6) | class StructureMeta(type): method __prepare__ (line 8) | def __prepare__(meta, clsname, bases): method __new__ (line 12) | def __new__(meta, name, bases, methods): class Structure (line 16) | class Structure(metaclass=StructureMeta): method __setattr__ (line 20) | def __setattr__(self, name, value): method __repr__ (line 26) | def __repr__(self): method __iter__ (line 30) | def __iter__(self): method __eq__ (line 34) | def __eq__(self, other): method from_row (line 38) | def from_row(cls, row): method create_init (line 43) | def create_init(cls): method __init_subclass__ (line 56) | def __init_subclass__(cls): function validate_attributes (line 60) | def validate_attributes(cls): function typed_structure (line 89) | def typed_structure(clsname, **validators): FILE: Solutions/8_6/tableformat.py function print_table (line 4) | def print_table(records, fields, formatter): class TableFormatter (line 13) | class TableFormatter(ABC): method headings (line 15) | def headings(self, headers): method row (line 19) | def row(self, rowdata): class TextTableFormatter (line 22) | class TextTableFormatter(TableFormatter): method headings (line 23) | def headings(self, headers): method row (line 27) | def row(self, rowdata): class CSVTableFormatter (line 30) | class CSVTableFormatter(TableFormatter): method headings (line 31) | def headings(self, headers): method row (line 34) | def row(self, rowdata): class HTMLTableFormatter (line 37) | class HTMLTableFormatter(TableFormatter): method headings (line 38) | def headings(self, headers): method row (line 44) | def row(self, rowdata): class ColumnFormatMixin (line 50) | class ColumnFormatMixin: method row (line 52) | def row(self, rowdata): class UpperHeadersMixin (line 56) | class UpperHeadersMixin: method headings (line 57) | def headings(self, headers): function create_formatter (line 60) | def create_formatter(name, column_formats=None, upper_headers=False): FILE: Solutions/8_6/validate.py class Validator (line 3) | class Validator: method __init__ (line 4) | def __init__(self, name=None): method __set_name__ (line 7) | def __set_name__(self, cls, name): method check (line 11) | def check(cls, value): method __set__ (line 14) | def __set__(self, instance, value): method __init_subclass__ (line 20) | def __init_subclass__(cls): class Typed (line 23) | class Typed(Validator): method check (line 26) | def check(cls, value): class Positive (line 39) | class Positive(Validator): method check (line 41) | def check(cls, value): class NonEmpty (line 46) | class NonEmpty(Validator): method check (line 48) | def check(cls, value): class PositiveInteger (line 53) | class PositiveInteger(Integer, Positive): class PositiveFloat (line 56) | class PositiveFloat(Float, Positive): class NonEmptyString (line 59) | class NonEmptyString(String, NonEmpty): function isvalidator (line 65) | def isvalidator(item): function validated (line 68) | def validated(func): function enforce (line 105) | def enforce(**annotations): function add (line 140) | def add(x:Integer, y:Integer) -> Integer: function div (line 144) | def div(x:Integer, y:Integer) -> Integer: function sub (line 148) | def sub(x, y): class Stock (line 151) | class Stock: method __init__ (line 155) | def __init__(self, name, shares, price): method __repr__ (line 160) | def __repr__(self): method cost (line 164) | def cost(self): method sell (line 168) | def sell(self, nshares:PositiveInteger): FILE: Solutions/9_1/simplemod.py function foo (line 6) | def foo(): class Spam (line 10) | class Spam: method yow (line 11) | def yow(self): FILE: Solutions/9_2/stock.py class Stock (line 5) | class Stock(Structure): method cost (line 11) | def cost(self): method sell (line 14) | def sell(self, nshares: PositiveInteger): FILE: Solutions/9_2/structly/reader.py function convert_csv (line 8) | def convert_csv(lines, converter, *, headers=None): function csv_as_dicts (line 22) | def csv_as_dicts(lines, types, *, headers=None): function csv_as_instances (line 26) | def csv_as_instances(lines, cls, *, headers=None): function read_csv_as_dicts (line 30) | def read_csv_as_dicts(filename, types, *, headers=None): function read_csv_as_instances (line 37) | def read_csv_as_instances(filename, cls, *, headers=None): FILE: Solutions/9_2/structly/structure.py class StructureMeta (line 6) | class StructureMeta(type): method __prepare__ (line 8) | def __prepare__(meta, clsname, bases): method __new__ (line 12) | def __new__(meta, name, bases, methods): class Structure (line 16) | class Structure(metaclass=StructureMeta): method __setattr__ (line 20) | def __setattr__(self, name, value): method __repr__ (line 26) | def __repr__(self): method __iter__ (line 30) | def __iter__(self): method __eq__ (line 34) | def __eq__(self, other): method from_row (line 38) | def from_row(cls, row): method create_init (line 43) | def create_init(cls): method __init_subclass__ (line 56) | def __init_subclass__(cls): function validate_attributes (line 60) | def validate_attributes(cls): function typed_structure (line 89) | def typed_structure(clsname, **validators): FILE: Solutions/9_2/structly/tableformat.py function print_table (line 4) | def print_table(records, fields, formatter): class TableFormatter (line 13) | class TableFormatter(ABC): method headings (line 15) | def headings(self, headers): method row (line 19) | def row(self, rowdata): class TextTableFormatter (line 23) | class TextTableFormatter(TableFormatter): method headings (line 24) | def headings(self, headers): method row (line 28) | def row(self, rowdata): class CSVTableFormatter (line 31) | class CSVTableFormatter(TableFormatter): method headings (line 32) | def headings(self, headers): method row (line 35) | def row(self, rowdata): class HTMLTableFormatter (line 38) | class HTMLTableFormatter(TableFormatter): method headings (line 39) | def headings(self, headers): method row (line 45) | def row(self, rowdata): class ColumnFormatMixin (line 51) | class ColumnFormatMixin: method row (line 53) | def row(self, rowdata): class UpperHeadersMixin (line 57) | class UpperHeadersMixin: method headings (line 58) | def headings(self, headers): function create_formatter (line 61) | def create_formatter(name, column_formats=None, upper_headers=False): FILE: Solutions/9_2/structly/validate.py class Validator (line 3) | class Validator: method __init__ (line 4) | def __init__(self, name=None): method __set_name__ (line 7) | def __set_name__(self, cls, name): method check (line 11) | def check(cls, value): method __set__ (line 14) | def __set__(self, instance, value): method __init_subclass__ (line 20) | def __init_subclass__(cls): class Typed (line 23) | class Typed(Validator): method check (line 26) | def check(cls, value): class Positive (line 39) | class Positive(Validator): method check (line 41) | def check(cls, value): class NonEmpty (line 46) | class NonEmpty(Validator): method check (line 48) | def check(cls, value): class PositiveInteger (line 53) | class PositiveInteger(Integer, Positive): class PositiveFloat (line 56) | class PositiveFloat(Float, Positive): class NonEmptyString (line 59) | class NonEmptyString(String, NonEmpty): function isvalidator (line 65) | def isvalidator(item): function validated (line 68) | def validated(func): function enforce (line 105) | def enforce(**annotations): function add (line 140) | def add(x:Integer, y:Integer) -> Integer: function div (line 144) | def div(x:Integer, y:Integer) -> Integer: function sub (line 148) | def sub(x, y): class Stock (line 151) | class Stock: method __init__ (line 155) | def __init__(self, name, shares, price): method __repr__ (line 160) | def __repr__(self): method cost (line 164) | def cost(self): method sell (line 168) | def sell(self, nshares:PositiveInteger): FILE: Solutions/9_3/stock.py class Stock (line 5) | class Stock(Structure): method cost (line 11) | def cost(self): method sell (line 14) | def sell(self, nshares: PositiveInteger): FILE: Solutions/9_3/structly/reader.py function convert_csv (line 8) | def convert_csv(lines, converter, *, headers=None): function csv_as_dicts (line 22) | def csv_as_dicts(lines, types, *, headers=None): function csv_as_instances (line 26) | def csv_as_instances(lines, cls, *, headers=None): function read_csv_as_dicts (line 30) | def read_csv_as_dicts(filename, types, *, headers=None): function read_csv_as_instances (line 37) | def read_csv_as_instances(filename, cls, *, headers=None): FILE: Solutions/9_3/structly/structure.py class StructureMeta (line 8) | class StructureMeta(type): method __prepare__ (line 10) | def __prepare__(meta, clsname, bases): method __new__ (line 14) | def __new__(meta, name, bases, methods): class Structure (line 18) | class Structure(metaclass=StructureMeta): method __setattr__ (line 22) | def __setattr__(self, name, value): method __repr__ (line 28) | def __repr__(self): method __iter__ (line 32) | def __iter__(self): method __eq__ (line 36) | def __eq__(self, other): method from_row (line 40) | def from_row(cls, row): method create_init (line 45) | def create_init(cls): method __init_subclass__ (line 58) | def __init_subclass__(cls): function validate_attributes (line 62) | def validate_attributes(cls): function typed_structure (line 91) | def typed_structure(clsname, **validators): FILE: Solutions/9_3/structly/tableformat/formats/csv.py class CSVTableFormatter (line 5) | class CSVTableFormatter(TableFormatter): method headings (line 6) | def headings(self, headers): method row (line 9) | def row(self, rowdata): FILE: Solutions/9_3/structly/tableformat/formats/html.py class HTMLTableFormatter (line 5) | class HTMLTableFormatter(TableFormatter): method headings (line 6) | def headings(self, headers): method row (line 12) | def row(self, rowdata): FILE: Solutions/9_3/structly/tableformat/formats/text.py class TextTableFormatter (line 5) | class TextTableFormatter(TableFormatter): method headings (line 6) | def headings(self, headers): method row (line 10) | def row(self, rowdata): FILE: Solutions/9_3/structly/tableformat/formatter.py function print_table (line 4) | def print_table(records, fields, formatter): class TableFormatter (line 13) | class TableFormatter(ABC): method headings (line 15) | def headings(self, headers): method row (line 19) | def row(self, rowdata): class ColumnFormatMixin (line 26) | class ColumnFormatMixin: method row (line 28) | def row(self, rowdata): class UpperHeadersMixin (line 32) | class UpperHeadersMixin: method headings (line 33) | def headings(self, headers): function create_formatter (line 36) | def create_formatter(name, column_formats=None, upper_headers=False): FILE: Solutions/9_3/structly/validate.py class Validator (line 3) | class Validator: method __init__ (line 4) | def __init__(self, name=None): method __set_name__ (line 7) | def __set_name__(self, cls, name): method check (line 11) | def check(cls, value): method __set__ (line 14) | def __set__(self, instance, value): method __init_subclass__ (line 20) | def __init_subclass__(cls): class Typed (line 23) | class Typed(Validator): method check (line 26) | def check(cls, value): class Positive (line 39) | class Positive(Validator): method check (line 41) | def check(cls, value): class NonEmpty (line 46) | class NonEmpty(Validator): method check (line 48) | def check(cls, value): class PositiveInteger (line 53) | class PositiveInteger(Integer, Positive): class PositiveFloat (line 56) | class PositiveFloat(Float, Positive): class NonEmptyString (line 59) | class NonEmptyString(String, NonEmpty): function isvalidator (line 65) | def isvalidator(item): function validated (line 68) | def validated(func): function enforce (line 105) | def enforce(**annotations): function add (line 140) | def add(x:Integer, y:Integer) -> Integer: function div (line 144) | def div(x:Integer, y:Integer) -> Integer: function sub (line 148) | def sub(x, y): class Stock (line 151) | class Stock: method __init__ (line 155) | def __init__(self, name, shares, price): method __repr__ (line 160) | def __repr__(self): method cost (line 164) | def cost(self): method sell (line 168) | def sell(self, nshares:PositiveInteger): FILE: Solutions/9_4/stock.py class Stock (line 5) | class Stock(Structure): method cost (line 11) | def cost(self): method sell (line 14) | def sell(self, nshares: PositiveInteger): FILE: Solutions/9_4/structly/reader.py function convert_csv (line 8) | def convert_csv(lines, converter, *, headers=None): function csv_as_dicts (line 22) | def csv_as_dicts(lines, types, *, headers=None): function csv_as_instances (line 26) | def csv_as_instances(lines, cls, *, headers=None): function read_csv_as_dicts (line 30) | def read_csv_as_dicts(filename, types, *, headers=None): function read_csv_as_instances (line 37) | def read_csv_as_instances(filename, cls, *, headers=None): FILE: Solutions/9_4/structly/structure.py class StructureMeta (line 8) | class StructureMeta(type): method __prepare__ (line 10) | def __prepare__(meta, clsname, bases): method __new__ (line 14) | def __new__(meta, name, bases, methods): class Structure (line 18) | class Structure(metaclass=StructureMeta): method __setattr__ (line 22) | def __setattr__(self, name, value): method __repr__ (line 28) | def __repr__(self): method __iter__ (line 32) | def __iter__(self): method __eq__ (line 36) | def __eq__(self, other): method from_row (line 40) | def from_row(cls, row): method create_init (line 45) | def create_init(cls): method __init_subclass__ (line 58) | def __init_subclass__(cls): function validate_attributes (line 62) | def validate_attributes(cls): function typed_structure (line 91) | def typed_structure(clsname, **validators): FILE: Solutions/9_4/structly/tableformat/formats/csv.py class CSVTableFormatter (line 5) | class CSVTableFormatter(TableFormatter): method headings (line 6) | def headings(self, headers): method row (line 9) | def row(self, rowdata): FILE: Solutions/9_4/structly/tableformat/formats/html.py class HTMLTableFormatter (line 5) | class HTMLTableFormatter(TableFormatter): method headings (line 6) | def headings(self, headers): method row (line 12) | def row(self, rowdata): FILE: Solutions/9_4/structly/tableformat/formats/text.py class TextTableFormatter (line 5) | class TextTableFormatter(TableFormatter): method headings (line 6) | def headings(self, headers): method row (line 10) | def row(self, rowdata): FILE: Solutions/9_4/structly/tableformat/formats/tsv.py class TSVTableFormatter (line 5) | class TSVTableFormatter(TableFormatter): method headings (line 6) | def headings(self, headers): method row (line 8) | def row(self, rowdata): FILE: Solutions/9_4/structly/tableformat/formatter.py function print_table (line 4) | def print_table(records, fields, formatter): class TableFormatter (line 13) | class TableFormatter(ABC): method __init_subclass__ (line 17) | def __init_subclass__(cls): method headings (line 22) | def headings(self, headers): method row (line 26) | def row(self, rowdata): class ColumnFormatMixin (line 29) | class ColumnFormatMixin: method row (line 31) | def row(self, rowdata): class UpperHeadersMixin (line 35) | class UpperHeadersMixin: method headings (line 36) | def headings(self, headers): function create_formatter (line 39) | def create_formatter(name, column_formats=None, upper_headers=False): FILE: Solutions/9_4/structly/validate.py class Validator (line 3) | class Validator: method __init__ (line 4) | def __init__(self, name=None): method __set_name__ (line 7) | def __set_name__(self, cls, name): method check (line 11) | def check(cls, value): method __set__ (line 14) | def __set__(self, instance, value): method __init_subclass__ (line 20) | def __init_subclass__(cls): class Typed (line 23) | class Typed(Validator): method check (line 26) | def check(cls, value): class Positive (line 39) | class Positive(Validator): method check (line 41) | def check(cls, value): class NonEmpty (line 46) | class NonEmpty(Validator): method check (line 48) | def check(cls, value): class PositiveInteger (line 53) | class PositiveInteger(Integer, Positive): class PositiveFloat (line 56) | class PositiveFloat(Float, Positive): class NonEmptyString (line 59) | class NonEmptyString(String, NonEmpty): function isvalidator (line 65) | def isvalidator(item): function validated (line 68) | def validated(func): function enforce (line 105) | def enforce(**annotations): function add (line 140) | def add(x:Integer, y:Integer) -> Integer: function div (line 144) | def div(x:Integer, y:Integer) -> Integer: function sub (line 148) | def sub(x, y): class Stock (line 151) | class Stock: method __init__ (line 155) | def __init__(self, name, shares, price): method __repr__ (line 160) | def __repr__(self): method cost (line 164) | def cost(self): method sell (line 168) | def sell(self, nshares:PositiveInteger):