e77a650432097e3eeb867dfe4fec5235450414bf,src/python/pants/backend/graph_info/tasks/list_owners.py,ListOwners,console_output,#ListOwners#Any#,25

Before Change


    if not sources:
      raise TaskError("No source was specified")
    elif len(sources) > 1:
      raise TaskError("Too many sources specified.")
    lazy_source_mapper = LazySourceMapper(self.context.address_mapper, self.context.build_graph)
    for source in sources:
      target_addresses_for_source = lazy_source_mapper.target_addresses_for_source(source)
      for address in target_addresses_for_source:

After Change


    if not sources:
      raise TaskError("No source was specified")
    lazy_source_mapper = LazySourceMapper(self.context.address_mapper, self.context.build_graph)
    owner_info = {}
    for source in sources:
      owner_info[source] = []
      target_addresses_for_source = lazy_source_mapper.target_addresses_for_source(source)
      for address in target_addresses_for_source:
        owner_info[source].append(address.spec)
    if self.get_options().output_format == "json":
      yield json.dumps(owner_info, indent=4, separators=(",", ": "))
    else:
      if len(sources) > 1:
        raise TaskError("Too many sources specified for {} output format."
                        .format(self.get_options().output_format))
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 4

Instances


Project Name: pantsbuild/pants
Commit Name: e77a650432097e3eeb867dfe4fec5235450414bf
Time: 2016-03-06
Author: cheister@gmail.com
File Name: src/python/pants/backend/graph_info/tasks/list_owners.py
Class Name: ListOwners
Method Name: console_output


Project Name: tensorflow/tensorboard
Commit Name: 1780833b30d953509200bf9560be2ba42fabe9ff
Time: 2020-01-06
Author: cais@google.com
File Name: tensorboard/plugins/debugger_v2/debug_data_provider.py
Class Name: LocalDebuggerV2DataProvider
Method Name: read_blob


Project Name: apache/incubator-tvm
Commit Name: a7bf97936ce51e5ece2f66d7fa9602b35a3aa1fa
Time: 2020-12-02
Author: lianminzheng@gmail.com
File Name: python/tvm/auto_scheduler/relay_integration.py
Class Name:
Method Name: auto_schedule_topi


Project Name: monkeylearn/monkeylearn-python
Commit Name: b487ce6f4a70d115df00a1b2b62ee7368ae43bf0
Time: 2015-11-20
Author: rstecanella@tryolabs.com
File Name: monkeylearn/utils.py
Class Name: HandleErrorsMixin
Method Name: handle_errors