MCPcopy Create free account
hub / github.com/adobe/Marinus / swap_order

Function swap_order

python3_cron_scripts/common_crawl_graph.py:102–114  ·  view source on GitHub ↗

Common crawl optimizes search by working back to front ("org.example.www") This is a utility function for swapping the order back to the expected value ("www.example.org")

(value)

Source from the content-addressed store, hash-verified

100
101
102def swap_order(value):
103 """
104 Common crawl optimizes search by working back to front ("org.example.www")
105 This is a utility function for swapping the order back to the expected value ("www.example.org")
106 """
107 parts = value.split(".")
108
109 new_value = ""
110 for part in parts:
111 new_value = part + "." + new_value
112 new_value = new_value[:-1]
113
114 return new_value
115
116
117def parse_file(logger, vertices_file, reversed_zones, dns_manager):

Callers 1

parse_fileFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected