return date based on filename
12824
def decode_file_name(aFilename)
      prefix,date,ext = aFilename.scan(/(.*?)\-(.*?)\.(.*)/).flatten
      return Time.from_date_numeric(date)
    end
270480
def get_filename(self, t):
		
		root, ext = os.path.splitext(self.base_filename)
		# remove seconds not significant to the period
		if self._period_seconds:
			t -= t % self._period_seconds
		# convert it to a datetime object for formatting
		dt = datetime.datetime.utcfromtimestamp(t)
		# append the datestring to the filename
		# workaround for datetime.strftime not handling '' properly
		appended_date = (
			dt.strftime(self._date_format)
			if self._date_format != '' else ''
		)
		if appended_date:
			# in the future, it would be nice for this format
			#  to be supplied as a parameter.
			result = root + ' ' + appended_date + ext
		else:
			result = self.base_filename
		return result
40519
String getTimeFileName() {
        SimpleDateFormat dateFormat = new SimpleDateFormat(wraper.formatter);
        return dateFormat.format(Calendar.getInstance().getTime());
    }
1024632
function getFullFilename(filename) {
  if (p.isAbsolute(filename)) {
    return filename
  }
  return p.join(process.cwd(), filename)
}
619571
def get_file_name(url):
  """"""
  return os.path.basename(urllib.parse.urlparse(url).path) or 'unknown_name'
79451
def filename_from_url(url):
    """"""
    fname = os.path.basename(urlparse.urlparse(url).path)
    if len(fname.strip(" \n\t.")) == 0:
        return None
    return fname
745881
def filter_filenames_by_info(self, filename_items):
        
        for filename, filename_info in filename_items:
            fend = filename_info.get('end_time')
            fstart = filename_info.setdefault('start_time', fend)
            if fend and fend < fstart:
                # correct for filenames with 1 date and 2 times
                fend = fend.replace(year=fstart.year,
                                    month=fstart.month,
                                    day=fstart.day)
                filename_info['end_time'] = fend
            if self.metadata_matches(filename_info):
                yield filename, filename_info
1206246
function isDateSame (date1, date2, format) {
  if (date1 && date2) {
    return toDateString(date1, format) === toDateString(date2, format)
  }
  return false
}
436078
def build_filename(self, binary):
        """"""
        try:
            # Get exact timestamp of the build to build the local file name
            folder = self.builds[self.build_index]
            timestamp = re.search(r'([\d\-]+)-\D.*', folder).group(1)
        except Exception:
            # If it's not available use the build's date
            timestamp = self.date.strftime('%Y-%m-%d')

        return '%(TIMESTAMP)s-%(BRANCH)s-%(NAME)s' % {
            'TIMESTAMP': timestamp,
            'BRANCH': self.branch,
            'NAME': binary}
800708
def extractDate(self, inp):
        """"""
        dates = self.extractDates(inp)
        for date in dates:
            return date
        return None
1255738
def _get_zip_filename(self):
        

        date = datetime.datetime.now().strftime('%Y_%m_%d-%H%M%S')
        zip_file = 'filemail_transfer_{date}.zip'.format(date=date)

        return zip_file
1058591
def filename_match(filename):
    
    if not options.filename:
        return True
    for pattern in options.filename:
        if fnmatch(filename, pattern):
            return True
91210
function(filename) {
    if (!filename || typeof filename === 'object') {
      return;
    }

    var match = filename.match(/[^\*]*/);

    if (match[0] !== filename) {
      return match.pop();
    }
  }
1102705
def timestamp_filename(basename, ext=None):
    
    dt = datetime.now().strftime('%Y%m%d-%H%M%S-%f')
    if ext:
        return '%s-%s.%s' % (basename, dt, ext)
    return '%s-%s' % (basename, dt)
97624
def fnFromDate(self, date):
        """"""
        fn = time.strftime('comics-%Y%m%d', date)
        fn = os.path.join(self.basepath, 'html', fn + ".html")
        fn = os.path.abspath(fn)
        return fn
874270
private String getFileName(String fileName) {

        if (fileName != null) {
            int index = fileName.indexOf(':');
            if (index < 0) {
                return fileName;
            } else {

                fileName = fileName.substring(index + 1);

                index = fileName.lastIndexOf('/');
                if (index < 0) {
                    return fileName;
                } else {
                    return fileName.substring(index + 1);
                }

            }
        }
        return null;
    }
513585
def _get_data(filenames):
    
    if filenames:
        data = ""
        for filename in filenames:
            with open(filename, "rb") as f:
                data += f.read()
    else:
        data = sys.stdin.read()

    return data