667d856a2fc27732d745cd7d926e9739ad12995c,example/ctr/ctr/train.py,,train,#,183

Before Change


        elif args.role == "trainer" or args.role == "TRAINER":
            logger.info("download the training materials")
            file_index = args.trainer_id % 10
            address = "https://paddle-ctr-data.bj.bcebos.com/dac" + str(file_index) + ".tar.gz"
            cmd = "cd /workspace/ctr/data/ && curl -o dac.tar.gz " + address + " && tar zxf dac.tar.gz && rm dac.tar.gz"
            exit_code = subprocess.call(cmd, shell=True)
            if exit_code != 0:
                raise Exception("The download command failed, please check the network settings")
            logger.info("run trainer")

After Change


        // comma separated ips of all pservers, needed by trainer and

        args.endpoints = os.getenv("PADDLE_PSERVERS", "")
        ep_list = args.endpoints.split(",")
        args.trainers = int(os.getenv("PADDLE_TRAINERS_NUM", "1"))
        args.pserver_id = int(os.getenv("PADDLE_PSERVER_ID", "0"))
        for ep in ep_list:
            if os.getenv("POD_IP", "localhost") in ep:
                args.current_endpoint = ep
                break
        args.role = os.getenv("TRAINING_ROLE", "TRAINER")
        args.trainer_id = int(os.getenv("PADDLE_TRAINER_ID", "0"))
        args.is_local = bool(int(os.getenv("PADDLE_IS_LOCAL", 0)))
    if args.is_local:
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 6

Instances


Project Name: PaddlePaddle/edl
Commit Name: 667d856a2fc27732d745cd7d926e9739ad12995c
Time: 2019-09-28
Author: wangjiawei04@baidu.com
File Name: example/ctr/ctr/train.py
Class Name:
Method Name: train


Project Name: GoogleCloudPlatform/python-docs-samples
Commit Name: 442efa40a52831655aa025cd60a5c6bc064c6ca2
Time: 2020-04-08
Author: tmatsuo@google.com
File Name: iam/api-client/access_test.py
Class Name:
Method Name: test_member


Project Name: GoogleCloudPlatform/python-docs-samples
Commit Name: 6e45bc9291e6d06383da38ed3b2265d0d2cc8f5c
Time: 2020-04-27
Author: tmatsuo@google.com
File Name: iam/api-client/service_accounts_test.py
Class Name:
Method Name: test_service_accounts