Return sources for file name

 @param [String] file_name

 @return [Enumerable<CLI::Source>]

 @api private

 ignore :reek:UtilityFunction
324629
def sources(file_name)
      files =
        if File.directory?(file_name)
          Dir.glob(File.join(file_name, '**/*.rb')).sort
        elsif File.file?(file_name)
          [file_name]
        else
          Dir.glob(file_name).sort
        end

      files.map(&Source::File.method(:new))
    end
12852
def file_name(self, file_name):
        
        if not self.can_update():
            self._tcex.handle_error(910, [self.type])

        self._data['fileName'] = file_name
        request = {'fileName': file_name}
        return self.tc_requests.update(self.api_type, self.api_sub_type, self.unique_id, request)
196925
def file_names(self) -> Iterable[str]:
        
        if self.is_sharded():
            yield from ShardedFile(self.filename_spec).get_filenames()
        elif self.filename_spec:
            yield self.filename_spec
1108395
def getFilesForName(name):
    
    if not os.path.exists(name):
        # check for glob chars
        if containsAny(name, "*?[]"):
            files = glob.glob(name)
            list = []
            for file in files:
                list.extend(getFilesForName(file))
            return list

        # try to find module or package
        name = _get_modpkg_path(name)
        if not name:
            return []

    if os.path.isdir(name):
        # find all python files in directory
        list = []
        os.path.walk(name, _visit_pyfiles, list)
        return list
    elif os.path.exists(name):
        # a single file
        return [name]

    return []
841771
def parse_file(self, name):
        
        with open(name, "rb") as fp:
            return self.parse(fp.read())
926782
def canonic(self, file_name):
        
        if file_name == "<" + file_name[1:-1] + ">":
            return file_name
        c_file_name = self.file_name_cache.get(file_name)
        if not c_file_name:
            c_file_name = os.path.abspath(file_name)
            c_file_name = os.path.normcase(c_file_name)
            self.file_name_cache[file_name] = c_file_name
        return c_file_name
92835
def get_full_filename_by_suffixes(dir_src, suffixes):
        # type: (AnyStr, Union[AnyStr, List[AnyStr]]) -> Optional[List[AnyStr]]
        
        file_names = FileClass.get_filename_by_suffixes(dir_src, suffixes)
        if file_names is None:
            return None
        return list(dir_src + os.sep + name for name in file_names)
834638
def rpc_get_names(self, filename, source, offset):
        
        source = get_source(source)
        if hasattr(self.backend, "rpc_get_names"):
            return self.backend.rpc_get_names(filename, source, offset)
        else:
            raise Fault("get_names not implemented by current backend",
                        code=400)
372638
def lint_file_paths(files, ext)
        file_list = files.map { |f| f[:filename] }.compact
        # Lints accept files differently
        ext == :ruby ? file_list.join(' ') : file_list.join(',')
      end
301681
public static function getAssetFolderName($file_name)
    {
        $file_extension = strtolower(substr(strrchr($file_name,"."), 1));
        if (preg_match('/jpg|jpeg|gif|png|ico/', $file_extension)) {
            return 'img';
        }
        if ($file_extension === 'js') {
            return 'js';
        }
        if ($file_extension === 'css') {
            return 'css';
        }
        if ($file_extension === 'pdf') {
            return 'pdf';
        }
        return false;
    }
989144
def find_lints(ruby, source_map)
      rubocop = ::RuboCop::CLI.new

      filename =
        if document.file
          "#{document.file}.rb"
        else
          'ruby_script.rb'
        end

      with_ruby_from_stdin(ruby) do
        extract_lints_from_offenses(lint_file(rubocop, filename), source_map)
      end
    end
71405
public SourceFile getSourceFile(File file) throws IOException
	{
		SourceFile source = sourceFiles.get(file);

		if (source == null)
		{
			source = new SourceFile(file);
			sourceFiles.put(file, source);
		}

		return source;
	}
1001047
def source_file_name(self):
        
        try:
            fname = inspect.getsourcefile(self.code_obj)
        except TypeError:
            # In some cases the object is something complex like a cython
            # object that can't be easily introspected. An it's better to
            # return the source code file of the object as None, than crash
            pass
        else:
            if fname:
                fname = os.path.relpath(fname, BASE_PATH)
                return fname
548654
def source_files(self):
        """"""
        if 'srcs' in self.params and self.params['srcs'] is not None:
            return util.flatten(self.params['srcs'])
93098
def get(**file_finder_args)
      @cache.fetch(file_finder_args) do
        args = file_finder_args.dup
        args[:exclude] = @defaults[:exclude] + (args[:exclude] || [])
        args[:exclude].uniq!
        CachingFileFinder.new(**args)
      end
    end
798124
private File[] getSources(final List<File> sourceList) {
    final File[] sortedSources = new File[sourceList.size()];
    sourceList.toArray(sortedSources);
    Arrays.sort(sortedSources, new Comparator<File>() {
      @Override
      public int compare(final File o1, final File o2) {
        return o1.getName().compareTo(o2.getName());
      }
    });
    return sortedSources;
  }
1261202
def source_file(self):
        
        if self._filename is None:
            self._filename = self._as_in_memory_geotiff()._filename
        return self._filename