ced1a983c88c1d3879c25b83b94e3b8c8aa132f2,test/validate.py,,check_executive_term,#,337

Before Change


  end = check_date(term.get("end"))
  if start and end:
    if end < start:
      error(rtyaml.dump(term) + " has end before start.")

  if end.year > 2000:
    // Check party of current members (historical is too difficult and even recent ones incorrectly have Democratic instead of Democrat, which is inconsistent with the legislators files).
    if term.get("party") not in ("Republican", "Democrat"):

After Change


def check_executive_term(term, context):
  // Check type.
  if term.get("type") not in ("prez", "viceprez"):
    error(context, "Term has invalid "type".")

  // Check how.
  if term.get("how") not in ("election", "succession", "appointment"):
    error(context, "Term has invalid "how".")
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: unitedstates/congress-legislators
Commit Name: ced1a983c88c1d3879c25b83b94e3b8c8aa132f2
Time: 2018-12-16
Author: jt@occams.info
File Name: test/validate.py
Class Name:
Method Name: check_executive_term


Project Name: unitedstates/congress-legislators
Commit Name: 0c7eceb6693d5538f66b6375a8747e2677180ccd
Time: 2016-11-10
Author: jt@occams.info
File Name: test/validate.py
Class Name:
Method Name: check_id_types


Project Name: unitedstates/congress-legislators
Commit Name: ced1a983c88c1d3879c25b83b94e3b8c8aa132f2
Time: 2018-12-16
Author: jt@occams.info
File Name: test/validate.py
Class Name:
Method Name: check_id_types