1329a9243a164e33f6e5b5e40c9e1ed98a798804,backend/server.py,,ParseEventFilesSpec,#Any#,48

Before Change


    return files
  for specification in logdir.split(","):
    // If it"s a gcs or hdfs path, don"t split on colon
    if (io_wrapper.IsGCSPath(specification) or
        specification.startswith("hdfs://")):
      run_name = None
      path = specification
    // If the spec looks like /foo:bar/baz, then we assume it"s a path with a
    // colon.
    elif ":" in specification and specification[0] != "/":
      // We split at most once so run_name:/path:with/a/colon will work.
      run_name, _, path = specification.partition(":")
    else:
      run_name = None
      path = specification
    if not (io_wrapper.IsGCSPath(path) or path.startswith("hdfs://")):
      path = os.path.realpath(path)
    files[path] = run_name
  return files

After Change


  if logdir is None:
    return files
  // Make sure keeping consistent with ParseURI in core/lib/io/path.cc
  uri_pattern = re.compile("[a-zA-Z][0-9a-zA-Z.]://.*")
  for specification in logdir.split(","):
    // Check if the spec contains group. A spec start with xyz:// is regarded as
    // URI path spec instead of group spec. If the spec looks like /foo:bar/baz,
    // then we assume it"s a path with a colon.
    if uri_pattern.match(specification) is None and \
       ":" in specification and specification[0] != "/":
      // We split at most once so run_name:/path:with/a/colon will work.
      run_name, _, path = specification.partition(":")
    else:
      run_name = None
      path = specification
    if uri_pattern.match(path) is None:
      path = os.path.realpath(path)
    files[path] = run_name
  return files
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 9

Instances


Project Name: tensorflow/tensorboard
Commit Name: 1329a9243a164e33f6e5b5e40c9e1ed98a798804
Time: 2016-11-09
Author: bsteiner@google.com
File Name: backend/server.py
Class Name:
Method Name: ParseEventFilesSpec


Project Name: Qiskit/qiskit-aqua
Commit Name: b51789878359e051338c91b8f1f0a916a1e6e65b
Time: 2019-09-22
Author: rmax@ethz.ch
File Name: qiskit/aqua/algorithms/adaptive/vqe_adapt/vqe_adapt.py
Class Name: VQEAdapt
Method Name: _run


Project Name: tensorflow/tensorboard
Commit Name: b2e3c2471d140ea4f03f40d0c64f2c63610023c9
Time: 2016-11-04
Author: lliang.he@gmail.com
File Name: backend/server.py
Class Name:
Method Name: ParseEventFilesSpec