OUTPUT: files which are globally compatible
550741
@Override public void lcompute() {
    _ok = new int[_files.length][H2O.CLOUD.size()];
    for (int i = 0; i < _files.length; ++i) {
      File f = new File(_files[i]);
      if (f.exists() && (f.length()==_sizes[i]))
        _ok[i][H2O.SELF.index()] = 1;
    }
    tryComplete();
  }
313920
function getSourceFilesFromGlob(globPattern, ignoreGlobs) {
    return new Promise((fulfil, reject) => {
        glob(globPattern, { ignore: ignoreGlobs }, (err, files) => {
            if (err) {
                reject(err);
            } else {
                fulfil(files);
            }
        });
    });
}
526067
def compile_files(args, mem_test=False):
    ''' 
    '''
    for filename in args:
        if not os.path.isfile(filename):
            print('The file doesn\'t exits')
            return
        build_and_run_file(filename)
        print("")
1118215
def output_files(self):
        
        for item in self.source_files:
            yield os.path.join(self.address.repo, self.address.path, item)
861099
def run_for_output(raw_output, threads, allresults)
      # check output files exist
      output_files = {}
      @target.output.each_pair do |key, glob|
        files = Dir[glob]
        size = files.reduce(1) { |sum, f| sum * File.size(f)}
        if files.empty? || size==0
          error = "output files for #{key} matching #{glob} do not exist" +
                  " or are empty"
          raise ObjectiveHandlerError, error
        end
        output_files[key] = files.map { |f| File.expand_path(f) }
      end

      # run all objectives for output
      results = {}
      @objectives.each_pair do |name, objective|
        results[name] = self.run_objective(objective, name, raw_output,
                                           output_files, threads)
      end

      if allresults
        return { :results => results,
                 :reduced => self.dimension_reduce(results) }
      else
        results.each_value do |value|
          return value.kind_of?(Hash) ? value[:result] : value
        end
      end
    end
888309
function compileAllFiles (src, isDebug, options)
{
    glob(src,
        function (err, files)
        {
            if (err) throw err;

            for (var i = 0, l = files.length; i < l; i++)
            {
                // only start compilation at root files
                if (sassHelpers.isRootFile(files[i]))
                {
                    compileSingleFile(files[i], isDebug, options);
                }
            }
        }
    );
}
247083
function getFeatureFiles(args, ignoreArg) {
  var files = [];
  var patterns = args.length ? args : ['.'];

  patterns.forEach(function(pattern) {
    // First we need to fix up the pattern so that it only matches .feature files
    // and it's in the format that glob expects it to be
    var fixedPattern;
    if (pattern == '.') {
      fixedPattern = '**/*.feature';
    } else if (pattern.match(/.*\/\*\*/)) {
      fixedPattern = pattern + '/**.feature';
    } else if (pattern.match(/.*\.feature/)) {
      fixedPattern = pattern;
    } else {
      try {
        if (fs.statSync(pattern).isDirectory()) {
          fixedPattern = path.join(pattern, '**/*.feature');
        }
      } catch(e) {
        // Don't show the fs callstack, we will print a custom error message bellow instead
      }
    }

    if (!fixedPattern) {
      logger.boldError(`Invalid format of the feature file path/pattern: "${pattern}".\nTo run the linter please specify an existing feature file, directory or glob.`);
      process.exit(1);
      return; // This line will only be hit by tests that stub process.exit
    }

    var globOptions = {ignore: getIgnorePatterns(ignoreArg)};
    files = files.concat(glob.sync(fixedPattern, globOptions));
  });
  return _.uniq(files);
}
231593
def format_listall_output(format_file, format_item_dir, format, rule, option_prefix = None, template = None, skip_options = False):
    
    # Set the list of keys if printing from a file spec
    # _LINE_(whatever)_EOL_
    # _ITEM_(resource)_METI_
    # _KEY_(path_to_value)
    if format_file and os.path.isfile(format_file):
        if not template:
            with open(format_file, 'rt') as f:
                template = f.read()
        # Optional files
        if not skip_options:
            re_option = re.compile(r'(%_OPTION_\((.*?)\)_NOITPO_)')
            optional_files = re_option.findall(template)
            for optional_file in optional_files:
                if optional_file[1].startswith(option_prefix + '-'):
                    with open(os.path.join(format_item_dir, optional_file[1].strip()), 'rt') as f:
                        template = template.replace(optional_file[0].strip(), f.read())
        # Include files if needed
        re_file = re.compile(r'(_FILE_\((.*?)\)_ELIF_)')
        while True:
            requested_files = re_file.findall(template)
            available_files = os.listdir(format_item_dir) if format_item_dir else []
            for requested_file in requested_files:
                if requested_file[1].strip() in available_files:
                    with open(os.path.join(format_item_dir, requested_file[1].strip()), 'rt') as f:
                        template = template.replace(requested_file[0].strip(), f.read())
            # Find items and keys to be printed
            re_line = re.compile(r'(_ITEM_\((.*?)\)_METI_)')
            re_key = re.compile(r'_KEY_\(*(.*?)\)', re.DOTALL|re.MULTILINE) # Remove the multiline ?
            lines = re_line.findall(template)
            for (i, line) in enumerate(lines):
                lines[i] = line + (re_key.findall(line[1]),)
            requested_files = re_file.findall(template)
            if len(requested_files) == 0:
                break
    elif format and format[0] == 'csv':
        keys = rule.keys
        line = ', '.join('_KEY_(%s)' % k for k in keys)
        lines = [ (line, line, keys) ]
        template = line
    return (lines, template)
139634
def include(d, e):
    """"""

    return (d, [f for f in glob.glob('%s/%s' % (d, e)) if os.path.isfile(f)])
632476
def globalsfilter(input_dict, check_all=False, filters=None,
                  exclude_private=None, exclude_capitalized=None,
                  exclude_uppercase=None, exclude_unsupported=None,
                  excluded_names=None):
    """"""
    output_dict = {}
    for key, value in list(input_dict.items()):
        excluded = (exclude_private and key.startswith('_')) or \
                   (exclude_capitalized and key[0].isupper()) or \
                   (exclude_uppercase and key.isupper()
                    and len(key) > 1 and not key[1:].isdigit()) or \
                   (key in excluded_names) or \
                   (exclude_unsupported and \
                    not is_supported(value, check_all=check_all,
                                     filters=filters))
        if not excluded:
            output_dict[key] = value
    return output_dict
19281
def require_compatible_version(compatible_version, word="File"):
    """"""
    if isinstance(compatible_version, str):
        compatible_version = parse_version(compatible_version)
    elif not isinstance(compatible_version, Version):
        raise ValueError("Type of `compatible_version` not understood.")
    
    current_version = parse_version(CURRENT_VERSION)
    if current_version < compatible_version:
        raise VersionError("{0} written for version >= {1}, this is {2}.".format(
            word, str(compatible_version), CURRENT_VERSION
        ))
409863
def existing_config_files():
    
    global _ETC_PATHS
    global _MAIN_CONFIG_FILE
    global _CONFIG_VAR_INCLUDE
    global _CONFIG_FILTER

    config_files = []
    for possible in _ETC_PATHS:
        config_files = config_files + glob.glob("%s%s" % (possible, _MAIN_CONFIG_FILE))
    
    if _CONFIG_VAR_INCLUDE != "":
        main_config = Configuration("general", {
            _CONFIG_VAR_INCLUDE:""
        }, _MAIN_CONFIG_FILE)

        if main_config.CONFIG_DIR != "":
            for possible in _ETC_PATHS:
                config_files = config_files + glob.glob("%s%s/%s" % (possible, main_config.CONFIG_DIR, _CONFIG_FILTER))
            
    return config_files
256153
def filespecs(self):
    """"""
    filespecs = {'globs': self._file_globs}
    exclude_filespecs = self._exclude_filespecs
    if exclude_filespecs:
      filespecs['exclude'] = exclude_filespecs
    return filespecs
532259
def select_interpreter_for_targets(self, targets):
    """"""

    tgts_by_compatibilities, total_filter_set = self.partition_targets_by_compatibility(targets)
    allowed_interpreters = set(self.setup(filters=total_filter_set))

    # Constrain allowed_interpreters based on each target's compatibility requirements.
    for compatibility in tgts_by_compatibilities:
      compatible_with_target = set(self._matching(allowed_interpreters, compatibility))
      allowed_interpreters &= compatible_with_target

    if not allowed_interpreters:
      # Create a helpful error message.
      all_interpreter_version_strings = sorted({
        interpreter.version_string
        # NB: self.setup() requires filters to be passed, or else it will use the global interpreter
        # constraints. We allow any interpreter other than CPython 3.0-3.3, which is known to choke
        # with Pants.
        for interpreter in self.setup(filters=("CPython<3", "CPython>=3.3", "PyPy"))
      })
      unique_compatibilities = {tuple(c) for c in tgts_by_compatibilities.keys()}
      unique_compatibilities_strs = [','.join(x) for x in unique_compatibilities if x]
      tgts_by_compatibilities_strs = [t[0].address.spec for t in tgts_by_compatibilities.values()]
      raise self.UnsatisfiableInterpreterConstraintsError(dedent("""\
        Unable to detect a suitable interpreter for compatibilities: {} (Conflicting targets: {})

        Pants detected these interpreter versions on your system: {}

        Possible ways to fix this:
        * Modify your Python interpreter constraints by following https://www.pantsbuild.org/python_readme.html#configure-the-python-version.
        * Ensure the targeted Python version is installed and discoverable.
        * Modify Pants' interpreter search paths via --pants-setup-interpreter-search-paths.""".format(
          ' && '.join(sorted(unique_compatibilities_strs)),
          ', '.join(tgts_by_compatibilities_strs),
          ', '.join(all_interpreter_version_strings)
        )))
    # Return the lowest compatible interpreter.
    return min(allowed_interpreters)
1104467
def globfilter(filenames, patterns, *, flags=0):
    """"""

    matches = []

    flags = _flag_transform(flags)
    unix = _wcparse.is_unix_style(flags)
    obj = _wcparse.compile(_wcparse.split(patterns, flags), flags)

    for filename in filenames:
        if not unix:
            filename = util.norm_slash(filename)
        if obj.match(filename):
            matches.append(filename)
    return matches
57413
def xymatch(outfile, filenames, tol=2):
    """"""
    import math
    import sys
    output={}
    files=[]
    for filename in filenames:
        this_file=read(filename)
        ## match files based on the 'X' and 'Y' column.
        ## if those don't exist then skip this file
        if not this_file['data'].has_key('X') or not this_file['data'].has_key('Y'):
            continue
        if not output.has_key('data'):
            output=this_file
            continue
        delete_list=[]
        for keyword in this_file['header']:
            if not keyword in output['header']:
                output['header'][keyword]=this_file['header'][keyword]
        for col in this_file['data'].keys():
            if not output['data'].has_key(col):
                output['order'].append(col)
                output['data'][col]=[]
                output['order'].append(col)
                if this_file['format'].has_key(col):
                    output['format'][col]=this_file['format'][col]
                else:
                    output['format'][col]='%10s'
                ### pad previously values with empties.. 
                for i in range(len(output['data']['X'])):
                    output['data'][col].append(None)
        for i in xrange(len(output['data']['X'])):
            x1=float(output['data']['X'][i])
            y1=float(output['data']['Y'][i])
            matched=False
            for j in xrange(len(this_file['data']['X'])):
                x2=float(this_file['data']['X'][j])
                y2=float(this_file['data']['Y'][j])
                if ( ((x1-x2)**2+(y1-y2)**2) < tol**2):
                    for col in this_file['data'].keys():
                        if output['data'][col][i] is None:
                            output['data'][col][i]=this_file['data'][col][j]
                    matched=True
                    break
            if not matched:
                delete_list.append(i)

        delete_list.sort()
        delete_list.reverse()
        for i in delete_list:
            for col in output['data'].keys():
                del output['data'][col][i]


    write(outfile,output)
272478
def apply_global_fixes(source, options, where='global', filename=''):
    
    if any(code_match(code, select=options.select, ignore=options.ignore)
           for code in ['E101', 'E111']):
        source = reindent(source,
                          indent_size=options.indent_size)

    for (code, function) in global_fixes():
        if code_match(code, select=options.select, ignore=options.ignore):
            if options.verbose:
                print('--->  Applying {0} fix for {1}'.format(where,
                                                              code.upper()),
                      file=sys.stderr)
            source = function(source,
                              aggressive=options.aggressive)

    source = fix_2to3(source,
                      aggressive=options.aggressive,
                      select=options.select,
                      ignore=options.ignore,
                      filename=filename)

    return source