Skip to content

Commit

Permalink
update doctests
Browse files Browse the repository at this point in the history
  • Loading branch information
mscarey committed Oct 11, 2021
1 parent f5f7f56 commit 5352e16
Show file tree
Hide file tree
Showing 8 changed files with 109 additions and 506 deletions.
2 changes: 1 addition & 1 deletion authorityspoke/decisions.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from typing import Optional, Sequence, Tuple, Union

from anchorpoint.textselectors import TextQuoteSelector, TextPositionSelector
from justopinion.decisions import Decision
from justopinion.decisions import Decision, CAPCitation

from nettlesome.terms import Comparable, ContextRegister, Explanation
from nettlesome.factors import Factor
Expand Down
8 changes: 4 additions & 4 deletions authorityspoke/io/loaders.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,12 +114,12 @@ def read_anchored_holdings_from_file(
>>> filepath = filepaths.make_filepath(filename="holding_mazza_alaluf.yaml")
>>> with open(filepath, "r") as f:
... yaml.safe_load(f)
{'holdings': [{'inputs': [{'type': 'fact', 'content': "{Mazza-Alaluf} used Mazza-Alaluf's business {Turismo Costa Brava} to commit the New York offense of engaging in the business of receiving money for transmission or transmitting the same, without a license therefor"}], 'outputs': [{'type': 'fact', 'content': 'Mazza-Alaluf operated Turismo Costa Brava without an appropriate money transmitting license in a State where such operation was punishable as a misdemeanor or a felony under State law', 'anchors': "we conclude that sufficient evidence supports Mazza-Alaluf's convictions under 18 U.S.C. § 1960(b)(1)(A) for conspiring to operate and operating a money transmitting business without appropriate state licenses.", 'name': 'operated without license'}], 'enactments': [{'node': '/us/usc/t18/s1960/b/1', 'anchors': 'state money transmitting licenses, see |18 U.S.C. § 1960(b)(1)(A)|', 'exact': 'is operated without an appropriate money transmitting license in a State where such operation is punishable as a misdemeanor or a felony under State law, whether or not the defendant knew that the operation was required to be licensed or that the operation was so punishable', 'name': 'state money transmitting license provision'}], 'universal': True}, {'inputs': ['operated without license', {'type': 'fact', 'content': 'Mazza-Alaluf operated Turismo Costa Brava as a business', 'anchors': 'Mazza-Alaluf does not contest that he owned and managed Turismo'}, {'type': 'fact', 'content': 'Turismo Costa Brava was a money transmitting business', 'anchors': 'record evidence that Turismo conducted substantial money transmitting business in the three states'}], 'despite': [{'type': 'fact', 'content': 'Turismo Costa Brava was a domestic financial institution', 'truth': False, 'anchors': 'without respect to whether or not Turismo was a "domestic financial institution"'}], 'outputs': [{'type': 'fact', 'content': 'Mazza-Alaluf committed the offense of conducting a money transmitting business without a license required by state law', 'anchors': 'a crime to operate a money transmitting business without appropriate state licenses,'}], 'enactments': ['state money transmitting license provision'], 'enactments_despite': [{'node': '/us/usc/t31/s5312/b/1', 'anchors': ['§ 5312(b)(1) (defining "domestic financial institution")']}], 'anchors': [{'prefix': 'Accordingly, we conclude that the', 'suffix': 'In any event'}], 'universal': True, 'mandatory': True}]}
[{'inputs': [{'type': 'fact', 'content': "{Mazza-Alaluf} used Mazza-Alaluf's business {Turismo Costa Brava} to commit the New York offense of engaging in the business of receiving money for transmission or transmitting the same, without a license therefor"}], 'outputs': [{'type': 'fact', 'content': 'Mazza-Alaluf operated Turismo Costa Brava without an appropriate money transmitting license in a State where such operation was punishable as a misdemeanor or a felony under State law', 'anchors': {'quotes': [{'exact': "we conclude that sufficient evidence supports Mazza-Alaluf's convictions under 18 U.S.C. § 1960(b)(1)(A) for conspiring to operate and operating a money transmitting business without appropriate state licenses."}]}, 'name': 'operated without license'}], 'enactments': [{'name': 'state money transmitting license provision', 'enactment': {'node': '/us/usc/t18/s1960/b/1'}, 'anchors': {'quotes': ['state money transmitting licenses, see |18 U.S.C. § 1960(b)(1)(A)|']}, 'selection': {'quotes': [{'exact': 'is operated without an appropriate money transmitting license in a State where such operation is punishable as a misdemeanor or a felony under State law, whether or not the defendant knew that the operation was required to be licensed or that the operation was so punishable'}]}}], 'universal': True}, {'inputs': ['operated without license', {'type': 'fact', 'content': 'Mazza-Alaluf operated Turismo Costa Brava as a business', 'anchors': {'quotes': 'Mazza-Alaluf does not contest that he owned and managed Turismo'}}, {'type': 'fact', 'content': 'Turismo Costa Brava was a money transmitting business', 'anchors': {'quotes': 'record evidence that Turismo conducted substantial money transmitting business in the three states'}}], 'despite': [{'type': 'fact', 'content': 'Turismo Costa Brava was a domestic financial institution', 'truth': False, 'anchors': {'quotes': 'without respect to whether or not Turismo was a "domestic financial institution"'}}], 'outputs': [{'type': 'fact', 'content': 'Mazza-Alaluf committed the offense of conducting a money transmitting business without a license required by state law', 'anchors': {'quotes': 'a crime to operate a money transmitting business without appropriate state licenses,'}}], 'enactments': ['state money transmitting license provision'], 'enactments_despite': [{'enactment': {'node': '/us/usc/t31/s5312/b/1'}, 'anchors': {'quotes': ['§ 5312(b)(1) (defining "domestic financial institution")']}}], 'anchors': {'quotes': [{'prefix': 'Accordingly, we conclude that the', 'suffix': 'In any event'}]}, 'universal': True, 'mandatory': True}]
>>> result = read_anchored_holdings_from_file(filepath=filepath, client=fake_client)
>>> selector = result.named_anchors["the fact it was false that <Turismo Costa Brava> was a domestic financial institution"][0]
>>> selector.exact
>>> selection = result.get_term_anchors("the fact it was false that <Turismo Costa Brava> was a domestic financial institution")
>>> selection.quotes[0].exact
'without respect to whether or not Turismo was a "domestic financial institution"'
>>> print(result.holdings[0].outputs[0])
>>> print(result.holdings[0].holding.outputs[0])
the fact that <Mazza-Alaluf> operated <Turismo Costa Brava> without an appropriate money transmitting license in a State where such operation was punishable as a misdemeanor or a felony under State law
"""
raw_holdings = load_holdings(
Expand Down

0 comments on commit 5352e16

Please sign in to comment.