fea0351e92bf4f060371ad62907d26ef25c25a50,src/python/pants/option/arg_splitter.py,ArgSplitter,__init__,#ArgSplitter#Any#,31

Before Change



    // Note: This algorithm for finding the lead scopes relies on the fact that enclosing
    // scopes are earlier than enclosed scopes in the list.
    leaf_scopes = set()
    for scope in known_scopes:
      if scope:
        outer_scope, _, _ = scope.rpartition(".")
        if outer_scope in leaf_scopes:
          leaf_scopes.discard(outer_scope)
        leaf_scopes.add(scope)
    for scope in leaf_scopes:
      self._known_scoping_prefixes["{0}-".format(scope.replace(".", "-"))] = scope

After Change


    // the new options system easier, as old-style flags will still work.

    // Check for prefixes in reverse order, so we match the longest prefix first.
    self._known_scoping_prefixes = [("{0}-".format(scope.replace(".", "-")), scope)
                                    for scope in filter(None, sorted(self._known_scopes, reverse=True))]

  @property
  def is_help(self):
    return self._is_help
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: pantsbuild/pants
Commit Name: fea0351e92bf4f060371ad62907d26ef25c25a50
Time: 2014-10-10
Author: benjy@foursquare.com
File Name: src/python/pants/option/arg_splitter.py
Class Name: ArgSplitter
Method Name: __init__


Project Name: apache/incubator-mxnet
Commit Name: e2cbf6605e1a6f15777099f56821b42159605335
Time: 2020-08-12
Author: lausen@amazon.com
File Name: python/mxnet/gluon/trainer.py
Class Name: Trainer
Method Name: __init__


Project Name: pantsbuild/pants
Commit Name: aa23024157360be890e9c50368ff54ca05ef7218
Time: 2019-05-18
Author: stuhood@gmail.com
File Name: src/python/pants/goal/context.py
Class Name: Context
Method Name: targets