this task has filename.
764611
public boolean inspectAnotherSameInfo(@NonNull DownloadTask task, @NonNull BreakpointInfo info,
                                          long instanceLength) {
        if (!task.isFilenameFromResponse()) return false;

        final BreakpointStore store = OkDownload.with().breakpointStore();
        final BreakpointInfo anotherInfo = store.findAnotherInfoFromCompare(task, info);
        if (anotherInfo == null) return false;

        store.remove(anotherInfo.getId());

        if (anotherInfo.getTotalOffset()
                <= OkDownload.with().downloadStrategy().reuseIdledSameInfoThresholdBytes()) {
            return false;
        }

        if (anotherInfo.getEtag() != null && !anotherInfo.getEtag().equals(info.getEtag())) {
            return false;
        }

        if (anotherInfo.getTotalLength() != instanceLength) {
            return false;
        }

        if (anotherInfo.getFile() == null || !anotherInfo.getFile().exists()) return false;

        info.reuseBlocks(anotherInfo);

        Util.d(TAG, "Reuse another same info: " + info);
        return true;
    }
1000597
def download(self, resource, filename, **kw):
        
        params = kw.pop('params', {})
        task = self.make_request(
            TaskRunFailed,
            method='create',
            resource=resource,
            params=params)

        return DownloadTask(
            filename=filename, task=task)
606500
def file_name(self, resource):
        """"""
        warnings.warn(
            "file_name is deprecated; use resource_name instead",
            DeprecationWarning, stacklevel=2)
        return self.resource_name(resource)
1041206
private String getSourceSetNameFromFile(File file) {
    Path absolutePath = Paths.get(file.getAbsolutePath());
    Path basePath = Paths.get(task.getProject().file("src").getAbsolutePath());

    return basePath.relativize(absolutePath).toString().split(Matcher.quoteReplacement(File.separator))[0];
  }
893790
function registerTask(file, options) {
  const task = require(file.path);
  const taskName = path.basename(file.path, file.ext);
  const taskObject = parseTaskObject(task, options);

  // Register this task with Gulp.
  gulp.task.call(gulp, taskName, taskObject);

  debug(`registered "${taskName}" task`);
}
11209
def [](task_name, scopes=nil)
      task_name = task_name.to_s
      self.lookup(task_name, scopes) or
        enhance_with_matching_rule(task_name) or
        synthesize_file_task(task_name) or
        fail "Don't know how to build task '#{task_name}'"
    end
1060067
def filename(self):
        """"""
        if self._filename is None:
            if os.path.splitext(self.destination)[1]:
                # If the filename has been given make use of it
                target_file = self.destination
            else:
                # Otherwise create it from the build details
                target_file = os.path.join(self.destination,
                                           self.build_filename(self.binary))

            self._filename = os.path.abspath(target_file)

        return self._filename
210956
public static String getFileNameOr(TaskResponse response, NameGenerator nameGenerator) {
        String name = getFileName(response);
        if (null == name) {
            name = nameGenerator.name();
        }
        return name;
    }
327489
def _task_file_exists(self, task_fs):
        
        for filename in ["task.{}".format(ext) for ext in self.get_available_task_file_extensions()]:
            if task_fs.exists(filename):
                return True
        return False
14806
def on_taskend(self, task):
        
        key = 'timer' if task.elapsed else 'end'
        filename = self.files.get(key)

        if filename:
            self._play_sound(filename)
829395
def get_task_filelist(cls, task_factory, courseid, taskid):
        
        task_fs = task_factory.get_task_fs(courseid, taskid)
        if not task_fs.exists():
            return []

        tmp_out = {}
        entries = task_fs.list(True, True, True)
        for entry in entries:
            if os.path.splitext(entry)[0] == "task" and os.path.splitext(entry)[1][1:] in task_factory.get_available_task_file_extensions():
                continue

            data = entry.split("/")
            is_directory = False
            if data[-1] == "":
                is_directory = True
                data = data[0:len(data)-1]
            cur_pos = 0
            tree_pos = tmp_out
            while cur_pos != len(data):
                if data[cur_pos] not in tree_pos:
                    tree_pos[data[cur_pos]] = {} if is_directory or cur_pos != len(data) - 1 else None
                tree_pos = tree_pos[data[cur_pos]]
                cur_pos += 1

        def recur_print(current, level, current_name):
            iteritems = sorted(current.items())
            # First, the files
            recur_print.flattened += [(level, False, f, current_name+"/"+f) for f, t in iteritems if t is None]
            # Then, the dirs
            for name, sub in iteritems:
                if sub is not None:
                    recur_print.flattened.append((level, True, name, current_name+"/"+name+"/"))
                    recur_print(sub, level + 1, current_name + "/" + name)
        recur_print.flattened = []
        recur_print(tmp_out, 0, '')
        return recur_print.flattened
827402
def from_file(cls, filename):
        """"""
        try:
            with open(filename, "r") as fh:
                return cls.from_dict(yaml.safe_load(fh))
        except Exception as exc:
            print("Error while reading TaskManager parameters from %s\n" % filename)
            raise
1138946
public CollectionRequest<Attachment> findByTask(String task) {
    
        String path = String.format("/tasks/%s/attachments", task);
        return new CollectionRequest<Attachment>(this, Attachment.class, path, "GET");
    }
692066
function loadTask(fileName, taskName) {
  const taskModule = require('./tools/gulp-tasks/' + fileName);
  const task = taskName ? taskModule[taskName] : taskModule;
  return task(gulp);
}
900925
def set_project_filenames(self, recent_files):
        """"""
        if (self.current_active_project
                and self.is_valid_project(
                        self.current_active_project.root_path)):
            self.current_active_project.set_recent_files(recent_files)
1102000
def file_name(self, value):
        
        if isinstance(value, FileName):
            self._file_name = value
        else:
            self._file_name = FileName(value)
391383
def identify_raw_files(task: Task, test_mode: bool = False) -> List[str]:
    
    raw_files = set()
    all_sets = [task.test,] if test_mode else [task.train, task.dev, task.test]
    for file_sets in all_sets:
        for file_set in file_sets:
            for fname in file_set[:2]:
                raw_file = fname.split("/", 1)[0]
                if raw_file not in RAW_FILES:
                    raise RuntimeError("Unknown raw file %s found in path %s" % (raw_file, fname))
                raw_files.add(raw_file)
    return sorted(raw_files)