Sets up the sort.
    Returns the FileID of the sorted file
198620
def setup(job, input_file_id, n, down_checkpoints):
    
    # Write the input file to the file store
    job.fileStore.logToMaster("Starting the merge sort")
    return job.addChildJobFn(down,
                             input_file_id, n,
                             down_checkpoints=down_checkpoints,
                             memory='600M').rv()
270072
public function set_sortorder($sortorder) {
        $oldorder = $this->file_record->sortorder;
        $filerecord = new stdClass;
        $filerecord->sortorder = $sortorder;
        $this->update($filerecord);
        if (!$this->is_directory()) {
            // Callback for file sort order change.
            if ($pluginsfunction = get_plugins_with_function('after_file_sorted')) {
                foreach ($pluginsfunction as $plugintype => $plugins) {
                    foreach ($plugins as $pluginfunction) {
                        $pluginfunction($this->file_record, $oldorder, $sortorder);
                    }
                }
            }
        }
    }
1281155
def set_diff(self, file_diff):
        
        self.file_diff = file_diff
        self.__record_progress(Status.START_UPLOAD)
139032
def setSortData( self, column, data ):
        
        self.setData(column, self.SortRole, wrapVariant(data))
986169
def _sort(self):
        
        self.versions = OrderedDict(sorted(self.versions.items(), key=lambda v: v[0]))
1329081
def file_sort(my_list):
    

    def alphanum_key(key):
        """
        Split the key into str/int parts
        """
        return [int(s) if s.isdigit() else s for s in re.split("([0-9]+)", key)]

    my_list.sort(key=alphanum_key)
    return my_list
1013076
function(fileId) {
        var pos = fileId.indexOf('/')
        return {
            group: fileId.substring(0, pos),
            filename: fileId.substring(pos + 1)
        }
    }
85385
def sort_by(self, attr_name, reverse=False):
        
        try:
            d = dict()
            for abspath, winfile in self.files.items():
                d[abspath] = getattr(winfile, attr_name)
            self.order = [item[0] for item in sorted(
                list(d.items()), key=lambda t: t[1], reverse = reverse)]
        except AttributeError:
            raise ValueError("valid sortable attributes are: "
                             "abspath, dirname, basename, fname, ext, "
                             "size_on_disk, atime, ctime, mtime;")
382662
def set_sort_cb(self, w, index):
        """"""
        name = self.sort_options[index]
        self.t_.set(sort_order=name)
1018591
public function onSetSorting()
    {
        $sortBy = Input::get('sortBy', $this->getSortBy());
        $sortDirection = Input::get('sortDirection', $this->getSortDirection());
        $path = Input::get('path');

        $this->setSortBy($sortBy);
        $this->setSortDirection($sortDirection);
        $this->setCurrentFolder($path);

        $this->prepareVars();

        return [
            '#'.$this->getId('item-list') => $this->makePartial('item-list'),
            '#'.$this->getId('folder-path') => $this->makePartial('folder-path')
        ];
    }
459602
def file_sort(files)
      models = files.find_all { |file| file =~ Core::Check::MODEL_FILES }
      mailers = files.find_all { |file| file =~ Core::Check::MAILER_FILES }
      helpers = files.find_all { |file| file =~ Core::Check::HELPER_FILES }
      others = files.find_all { |file| file !~ Core::Check::MAILER_FILES && file !~ Core::Check::MODEL_FILES && file !~ Core::Check::HELPER_FILES }
      models + mailers + helpers + others
    end
23757
def set_sort(self, request):
        
        # Look for 'sort' in get request. If not available use default.
        sort_request = request.GET.get(self.sort_parameter, self.default_sort)
        if sort_request.startswith('-'):
            sort_order = '-'
            sort_field = sort_request.split('-')[1]
        else:
            sort_order = ''
            sort_field = sort_request
        # Invalid sort requests fail silently
        if not sort_field in self._allowed_sort_fields:
            sort_order = self.default_sort_order
            sort_field = self.default_sort_field
        return (sort_order, sort_field)
1127632
public final int compareTo(String fileName, final long position) {
        final int val = this.fileName.compareTo(fileName);

        if (val == 0) {
            return (int) (this.position - position);
        }
        return val;
    }
401538
public void sort() {
		Collections.sort(list);
		int i=1;
		for (StructureInterface interf:list) {
			interf.setId(i);
			i++;
		}
	}
1281572
public static void sortFile(File sortDir, File inputFile, File outputFile, Comparator<String> comparator,
                                boolean skipHeader, long maxBytes, int mergeFactor) {
        // validation
        if(comparator == null) {
            comparator = Lexical.ascending();
        }

        // steps
        List<File> splitFiles = split(sortDir, inputFile, maxBytes, skipHeader);
        List<File> sortedFiles = sort(sortDir, splitFiles, comparator);
        merge(sortDir, sortedFiles, outputFile, comparator, mergeFactor);
    }
678747
def sort_name(self):
        
        if self._record and self._record.sort_name:
            return self._record.sort_name
        return self.name
593688
function initSortMethod() {
        var sortMethod = PreferencesManager.getViewState(_WORKING_SET_SORT_PREF);

        if (!sortMethod) {
            sortMethod = _convertSortPref(PreferencesManager.getViewState(_LEGACY_SORT_PREF));
        }

        if (!sortMethod) {
            sortMethod = Commands.CMD_WORKINGSET_SORT_BY_ADDED;
        }
        return sortMethod;
    }