third_party/blink/renderer/build/scripts/update_css_ranking.py
def update_css_ranking(css_ranking_file, css_ranking_api):
    """Create the css_properties_ranking.json5 for uses in Computed Style grouping

    Args:
        css_ranking_file: file directory to css_properties_ranking.json5
        css_ranking_api: url to CSS ranking api

    """
    css_ranking = json.loads(urlopen(css_ranking_api).read())
    css_ranking_content = {"properties": {}, "data": []}
    css_ranking_content["data"] = [
        property_["property_name"] for property_ in sorted(
            css_ranking, key=lambda x: -float(x["day_percentage"]))
    ]

    reformat_properties_name(css_ranking_content["data"])

    with open(css_ranking_file, "w") as fw:
        fw.write(
            "// The popularity ranking of all css properties the first properties is the most\n"
        )
        fw.write(
            "// used property according to: https://www.chromestatus.com/metrics/css/popularity\n"
        )
        json.dump(css_ranking_content, fw, indent=4, sort_keys=False)
Create the css_properties_ranking.json5 for uses in Computed Style grouping

    Args:
        css_ranking_file: file directory to css_properties_ranking.json5
        css_ranking_api: url to CSS ranking api

    
Create the css_properties_ranking.json5 for uses in Computed Style grouping
Create the css_properties_ranking . json5 for uses in Computed Style grouping
def update_css_ranking(css_ranking_file, css_ranking_api):
    css_ranking = json.loads(urlopen(css_ranking_api).read())
    css_ranking_content = {"properties": {}, "data": []}
    css_ranking_content["data"] = [
        property_["property_name"] for property_ in sorted(
            css_ranking, key=lambda x: -float(x["day_percentage"]))
    ]
    reformat_properties_name(css_ranking_content["data"])
    with open(css_ranking_file, "w") as fw:
        fw.write(
            "// The popularity ranking of all css properties the first properties is the most\n"
        )
        fw.write(
            "// used property according to: https://www.chromestatus.com/metrics/css/popularity\n"
        )
        json.dump(css_ranking_content, fw, indent=4, sort_keys=False)
def update_css_ranking ( css_ranking_file , css_ranking_api ) : css_ranking = json . loads ( urlopen ( css_ranking_api ) . read ( ) ) css_ranking_content = { "properties" : { } , "data" : [ ] } css_ranking_content [ "data" ] = [ property_ [ "property_name" ] for property_ in sorted ( css_ranking , key = lambda x : - float ( x [ "day_percentage" ] ) ) ] reformat_properties_name ( css_ranking_content [ "data" ] ) with open ( css_ranking_file , "w" ) as fw : fw . write ( "// The popularity ranking of all css properties the first properties is the most\n" ) fw . write ( "// used property according to: https://www.chromestatus.com/metrics/css/popularity\n" ) json . dump ( css_ranking_content , fw , indent = 4 , sort_keys = False )
Create the css_properties_ranking.json5 for uses in Computed Style grouping
Create the css_properties_ranking . json5 for uses in Computed Style grouping
"""Create the css_properties_ranking.json5 for uses in Computed Style grouping

    Args:
        css_ranking_file: file directory to css_properties_ranking.json5
        css_ranking_api: url to CSS ranking api

    """
css_ranking_file
file directory to css_properties_ranking.json5
file directory to css_properties_ranking . json5
css_ranking_api
url to CSS ranking api
url to CSS ranking api