Format $scheme_file_name to be used as a slug variable.
427569
def slugify(scheme_file):
    """"""
    scheme_file_name = os.path.basename(scheme_file)
    if scheme_file_name.endswith('.yaml'):
        scheme_file_name = scheme_file_name[:-5]
    return scheme_file_name.lower().replace(' ', '-')
431343
def sanitize_name(name, prefer = nil)
      path = name.to_s

      # Check if we haven't got an extension
      # we'll assume you're looking for prefer or "html" otherwise
      path += ".#{prefer || 'html'}" unless File.basename(path).include?(".")

      path
    end
490389
def url_to_filename(url):
    
    # remove leading/trailing slash
    if url.startswith('/'):
        url = url[1:]
    if url.endswith('/'):
        url = url[:-1]
    # remove pardir symbols to prevent unwilling filesystem access
    url = remove_pardir_symbols(url)
    # replace dots to underscore in filename part
    url = replace_dots_to_underscores_at_last(url)
    return url
112763
protected static function normalizeScheme(?string $scheme): string
    {
        if (!static::isValidScheme($scheme)) {
            $message = sprintf('Invalid URI scheme: %s', VarPrinter::toString($scheme));
            throw new DomainException($message);
        }

        return strtolower($scheme);
    }
1304334
def format(filename=nil, line=nil)
      out = ""
      if filename
        out = Util::OS.windows? ? filename.gsub('/', '\\') : filename
        if line
          out += ":#{line}:"
        end
      end
      paint(:magenta, out)
    end
468646
def _safe_name(file_name, sep):
    """"""
    file_name = stringify(file_name)
    if file_name is None:
        return
    file_name = ascii_text(file_name)
    file_name = category_replace(file_name, UNICODE_CATEGORIES)
    file_name = collapse_spaces(file_name)
    if file_name is None or not len(file_name):
        return
    return file_name.replace(WS, sep)
347341
function(filepath, fn) {
      fn = fn || lazy.dashify;
      if (typeof filepath === 'undefined') {
        var ctx = this.context();
        filepath = ctx.slug || this.path;
      }
      return fn(filepath);
    }
791192
def file_name
      name = ""
      name += @user.nickname
      name += "-"
      name += @organization.name.parameterize
      name += "-"
      name += token
      name + ".zip"
    end
915621
def slug(s, remove_whitespace=True, lowercase=True):
    """"""
    res = ''.join(c for c in unicodedata.normalize('NFD', s)
                  if unicodedata.category(c) != 'Mn')
    if lowercase:
        res = res.lower()
    for c in string.punctuation:
        res = res.replace(c, '')
    res = re.sub('\s+', '' if remove_whitespace else ' ', res)
    res = res.encode('ascii', 'ignore').decode('ascii')
    assert re.match('[ A-Za-z0-9]*$', res)
    return res
589689
public function getFilename()
    {
        if (isset($this->viewVars['_filename'])) {
            return $this->viewVars['_filename'] . '.xlsx';
        }

        return Inflector::slug(str_replace('.xlsx', '', $this->request->url)) . '.xlsx';
    }
732830
def _sanitizeFilename(filename):
    """"""
    global _sanitize_trans
    out = filename.translate(_sanitize_trans)
    # leading dot becomes "_"
    if out and out[0] == '.':
        out = out[1:]
    return out
1299023
def with_scheme(self, scheme):
        """"""
        # N.B. doesn't cleanup query/fragment
        if not isinstance(scheme, str):
            raise TypeError("Invalid scheme type")
        if not self.is_absolute():
            raise ValueError("scheme replacement is not allowed " "for relative URLs")
        return URL(self._val._replace(scheme=scheme.lower()), encoded=True)
888206
def format_sourcefile_name(self, fileName, runSet):
        '''
        
        '''
        if fileName.startswith(runSet.common_prefix):
            fileName = fileName[len(runSet.common_prefix):]
        return fileName.ljust(runSet.max_length_of_filename + 4)
314319
def format_file_url_params(file_urls):
        '''
            
        '''
        file_urls_payload = {}
        if file_urls:
            for idx, fileurl in enumerate(file_urls):
                file_urls_payload["file_url[" + str(idx) + "]"] = fileurl
        return file_urls_payload
251439
public static function sanitize_filename($i, $allow_subdirs = false, $allowabsolute = false) {
		$i = trim($i);
		$replacements = ['../', './'];
		if ($allow_subdirs === false) {
			$replacements[] = '/';
		}
		if ($allowabsolute !== true && $i{0} === '/') {
			$i = substr($i, 1);
		}
		return str_replace($replacements, '', $i);
	}
465907
def _append_filename_extension(self, response: BaseResponse):
        ''''''
        if not self._filename:
            return

        if response.request.url_info.scheme not in ('http', 'https'):
            return

        if not re.search(r'\.[hH][tT][mM][lL]?$', self._filename) and \
                HTMLReader.is_response(response):
            self._filename += '.html'
        elif not re.search(r'\.[cC][sS][sS]$', self._filename) and \
                CSSReader.is_response(response):
            self._filename += '.css'
1246274
def get_scheme_files(patterns=None):
    """"""
    patterns = patterns or ['*']
    pattern_list = ['{}.yaml'.format(pattern) for pattern in patterns]
    scheme_files = []
    for scheme_path in get_scheme_dirs():
        for pattern in pattern_list:
            file_paths = glob(os.path.join(scheme_path, pattern))
            scheme_files.extend(file_paths)

    return scheme_files