Module Import alias Import alias Import alias Import alias Import alias ImportFrom alias ImportFrom alias ClassDef bases AttributeLoad NameLoad attr body Assign NameStore Str Assign NameStore ListLoad ListLoad TupleLoad NameLoad Dict FunctionDef arguments args NameParam NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str Str Str Expr Call AttributeLoad NameLoad attr NameLoad Lambda arguments args defaults Call AttributeLoad NameLoad attr Str Str decorator_list Call AttributeLoad NameLoad attr Str keyword Lambda arguments args defaults NameLoad FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore NameLoad Assign NameStore ListLoad Str Str Str Str Str Str Assign NameStore ListLoad Str Str Assign NameStore Str Assign NameStore Str Assign NameStore Call AttributeLoad NameLoad attr For NameStore Call NameLoad NameLoad body Assign NameStore Call AttributeLoad Call AttributeLoad NameLoad attr BinOpAdd NameLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr For NameStore Call NameLoad NameLoad body Assign NameStore Call AttributeLoad Call AttributeLoad NameLoad attr BinOpAdd NameLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr BinOpAdd NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr Return TupleLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad BinOpAdd NameLoad NameLoad Return BinOpAdd NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad NameLoad attr NameLoad NameLoad Return BinOpAdd NameLoad NameLoad decorator_list With Call AttributeLoad NameLoad attr Str NameLoad body With Call AttributeLoad NameLoad attr Str NameLoad body With Call AttributeLoad NameLoad attr Str NameLoad body Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad NameLoad decorator_list Call AttributeLoad NameLoad attr Str keyword Lambda arguments args defaults NameLoad FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign AttributeStore AttributeLoad NameLoad attr attr AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr decorator_list Call AttributeLoad NameLoad attr Str FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign AttributeStore AttributeLoad NameLoad attr attr AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore ListLoad Num FunctionDef arguments args NameParam defaults body AugAssignAdd SubscriptStore NameLoad Index Num Num Assign NameStore Call NameLoad Assign AttributeStore NameLoad attr AttributeLoad NameLoad attr Raise NameLoad decorator_list Assign AttributeStore AttributeLoad NameLoad attr attr NameLoad Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Num Num decorator_list Call AttributeLoad NameLoad attr Str FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign AttributeStore AttributeLoad NameLoad attr attr AttributeLoad AttributeLoad NameLoad attr attr FunctionDef arguments args NameParam defaults body Raise Call NameLoad decorator_list Expr Call AttributeLoad AttributeLoad NameLoad attr attr Assign AttributeStore AttributeLoad NameLoad attr attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Lambda arguments args defaults Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr decorator_list Call AttributeLoad NameLoad attr Str decorator_list
N/A N/A errno N/A hashlib N/A mock N/A os N/A unittest codalab.common PreconditionViolation codalab.lib path_util PathUtilTest N/A N/A unittest TestCase N/A N/A test_path /my/test/path N/A mkdir_calls N/A N/A N/A test_path N/A test_get_relative_path N/A N/A self mock_os N/A N/A N/A 
    Test that get_relative_path checks if the root is a prefix of the path,
    and if so, returns the path's suffix.
     N/A N/A N/A self assertEqual N/A N/A path_util get_relative_path asdf asdfblah blah N/A N/A N/A self assertRaises PreconditionViolation N/A N/A N/A N/A N/A N/A path_util get_relative_path asdfg asdfblah N/A N/A N/A mock patch codalab.lib.path_util.os new_callable N/A N/A N/A N/A None test_hash_directory N/A N/A self mock_os N/A N/A N/A 
    Test the two-level hashing scheme, mocking out all filesystem operations.
     N/A tester self N/A directories N/A asdf blah this is not sorted N/A files N/A foo bar N/A relative_prefix relative- N/A contents_hash_prefix contents-hash- N/A directory_hash N/A N/A hashlib sha1 N/A directory N/A sorted directories N/A N/A path_hash N/A N/A N/A N/A hashlib sha1 N/A relative_prefix directory hexdigest N/A N/A N/A directory_hash update path_hash N/A file_hash N/A N/A hashlib sha1 N/A file_name N/A sorted files N/A N/A name_hash N/A N/A N/A N/A hashlib sha1 N/A relative_prefix file_name hexdigest N/A N/A N/A file_hash update name_hash N/A N/A N/A file_hash update N/A contents_hash_prefix file_name N/A overall_hash N/A N/A hashlib sha1 N/A N/A N/A overall_hash update N/A N/A directory_hash hexdigest N/A N/A N/A overall_hash update N/A N/A file_hash hexdigest N/A expected_hash N/A N/A overall_hash hexdigest mock_recursive_ls N/A N/A path N/A N/A N/A N/A N/A tester assertEqual path N/A self test_path N/A N/A directories files N/A mock_get_relative_path N/A N/A root path N/A N/A N/A N/A N/A tester assertEqual root N/A self test_path N/A N/A N/A tester assertIn path N/A directories files N/A N/A relative_prefix path N/A mock_hash_file_contents N/A N/A path N/A N/A N/A N/A N/A tester assertIn path files N/A N/A contents_hash_prefix path N/A N/A N/A N/A mock patch codalab.lib.path_util.recursive_ls mock_recursive_ls N/A N/A N/A N/A mock patch codalab.lib.path_util.get_relative_path mock_get_relative_path N/A N/A N/A N/A mock patch codalab.lib.path_util.hash_file_contents mock_hash_file_contents N/A N/A actual_hash N/A N/A path_util hash_directory N/A self test_path N/A N/A N/A self assertEqual actual_hash expected_hash N/A N/A N/A mock patch codalab.lib.path_util.os new_callable N/A N/A N/A N/A None test_make_directory N/A N/A self mock_os N/A N/A N/A 
    Check that make_directory calls normalize and then creates the directory.
     N/A N/A N/A mock_os path join N/A N/A os path join N/A N/A N/A path_util make_directory N/A self test_path N/A N/A N/A self assertEqual N/A N/A mock_os mkdir call_args_list N/A self mkdir_calls N/A N/A N/A mock patch codalab.lib.path_util.os test_make_directory_if_exists N/A N/A self mock_os N/A N/A N/A 
    Check that make_directory still works if the directory exists.
     N/A N/A N/A mock_os path join N/A N/A os path join N/A failures N/A 0 mkdir_when_directory_exists N/A N/A path N/A N/A N/A N/A failures N/A 0 1 N/A error N/A OSError N/A N/A error errno N/A errno EEXIST N/A error N/A N/A N/A N/A mock_os mkdir side_effect mkdir_when_directory_exists N/A N/A N/A path_util make_directory N/A self test_path N/A N/A N/A self assertEqual N/A N/A mock_os mkdir call_args_list N/A self mkdir_calls N/A N/A N/A self assertEqual N/A failures N/A 0 1 N/A N/A N/A mock patch codalab.lib.path_util.os test_make_directory_with_failures N/A N/A self mock_os N/A N/A N/A 
    Check that make_directory still works if the directory exists.
     N/A N/A N/A mock_os path join N/A N/A os path join mkdir_with_other_failure N/A N/A path N/A N/A N/A N/A OSError N/A N/A N/A N/A N/A mock_os mkdir reset_mock N/A N/A N/A mock_os mkdir side_effect mkdir_with_other_failure N/A N/A N/A self assertRaises OSError N/A N/A N/A N/A N/A N/A path_util make_directory N/A self test_path N/A N/A N/A self assertEqual N/A N/A mock_os mkdir call_args_list N/A self mkdir_calls N/A N/A N/A mock patch codalab.lib.path_util.os N/A