Get the name of the JSON resource so the schema
matches the source. The .json extension is added
if it's missing from the filename.

@param {String} str File name
@return {String} The name of the file only.
186673
function getName(str) {
	var name = path.basename(str);
	if (name.lastIndexOf('.') === -1) {
		name += '.json';
	}
	return name;
}
553253
def jsonstrlen(self, name, path=Path.rootPath()):
        
        return self.execute_command('JSON.STRLEN', name, str_path(path))
527119
def get_json(filename):
    
    check_if_this_file_exist(filename)

    #Process this function
    filename = os.path.abspath(filename)
    s = command_line(['exiftool', '-G', '-j', '-sort', filename])
    if s:
        #convert bytes to string
        s = s.decode('utf-8').rstrip('\r\n')
        return json.loads(s)
    else:
        return s
705354
function getName(script) {
  var script = path.basename(script, path.extname(script)).replace(/[^a-zA-Z0-9]/g, '.')
    , parts = script.split('.')
    , name = parts.shift();

  if (parts.length) {
    for (var p in parts) {
      name += parts[p].charAt(0).toUpperCase() + parts[p].substr(1, parts[p].length);
    }
  }

  return name;
}
1123169
function keyname(str) {
  return path.basename(path.normalize(str), path.extname(str));
}
1009147
function getCodeFromNode(node, renameSources, options) {
    const code_map = getCodeMap(node);
    const rename = renameSources;
    const objMap = code_map.map.toJSON();
    let i, n;

    if (rename) {
        if ('string' === typeof rename) {
            for (i = 0, n = objMap.sources.length; i < n; i++) {
                objMap.sources[i] = rename + objMap.sources[i];
            }
        } else if ('function' === typeof rename) {
            for (i = 0, n = objMap.sources.length; i < n; i++) {
                objMap.sources[i] = rename(objMap.sources[i]);
            }
        } else {
            console.warn('unexpected type of rename: ' + typeof rename);
        }
    }

    return node.toString() +
        convert.fromObject(objMap)
            .toComment(options)
            .replace(/charset=utf-8;/gm, '')
            .replace('data:application/json;', 'data:application/json;charset=utf-8;') + '\n';
}
902101
public String getFileName(String strClassName, String strPackage, CodeType codeType, ClassProject recClassProject)
    {
    	boolean bResourceListBundle = ResourceTypeField.LIST_RESOURCE_BUNDLE.equals(this.getRecord(ProgramControl.PROGRAM_CONTROL_FILE).getField(ProgramControl.CLASS_RESOURCE_TYPE).toString());
    	codeType = bResourceListBundle ? CodeType.RESOURCE_CODE : CodeType.RESOURCE_PROPERTIES;
    	// For now, put this type of resource in the main code base
    	codeType = CodeType.THICK;
    	String strFileName = super.getFileName(strClassName, strPackage, codeType, recClassProject);
    	if (!bResourceListBundle)
    		strFileName.replace(".java", ".properties");
    	return strFileName;
    }
912663
function determineFilename(file) {
    var filename,
        filenameMatch;

    if (file.hasOwnProperty('httpVersion')) {
        // it's an http response
        // first let's check if there's a content-disposition header...
        if (file.headers['content-disposition']) {
            filenameMatch = /filename=(.*)/.exec(file.headers['content-disposition']);
            filename = filenameMatch[1];
        }
        if (!filename) {
            // try to get the path of the request url
            filename = path.basename(file.client._httpMessage.path);
        }
    } else if (file.path) {
        // it looks like a file, let's just get the path
        filename = path.basename(file.path);
    }
    return filename || 'untitled document';
}
658708
@JsonProperty
  @Override
  public String getName()
  {
    String name = this.name;
    if (Strings.isNullOrEmpty(name)) {
      name = delegate.getName();
    }
    return name;
  }
165268
function (str) {
        // here:xx:xxx??inline
        var matches = /^<!--\s*here\:(.*?)\s*-->$/.exec(str.trim())
        if (!matches || !matches[1]) return null
        var expr = matches[1]
        var parts = expr.split('??')
        var query = querystring.parse(parts[1] || '')
        var isInline = ('inline' in query) && query.inline != 'false'
        var isWrapping = query.wrap !== 'false'
        var namespace = ''
        var reg

        expr = parts[0]
        parts = expr.split(':')
        if (parts.length > 1) {
            namespace = parts.shift()
        }
        reg = new RegExp(parts.pop())

        return {
            regexp: reg,          // resource match validate regexp
            namespace: namespace, // resource namespace match
            inline: isInline,      // whether inline resource or not
            wrap: isWrapping
        }
    }
973856
static function parse_json_string($json_str, $filename = null)
	{
		$data = json_decode($json_str, TRUE, 512, JSON_BIGINT_AS_STRING);
		$error = json_last_error();
		if ($error !== JSON_ERROR_NONE) {
			throw new JsonException($filename !== null ? json_last_error_msg().' ('.$filename.')' : json_last_error_msg(), $error);
		}
		return $data;
	}
1147822
function getTypingNamesFromJson(jsonPath, filesToWatch) {
                if (host.fileExists(jsonPath)) {
                    filesToWatch.push(jsonPath);
                }
                var result = ts.readConfigFile(jsonPath, function (path) { return host.readFile(path); });
                if (result.config) {
                    var jsonConfig = result.config;
                    if (jsonConfig.dependencies) {
                        mergeTypings(ts.getOwnKeys(jsonConfig.dependencies));
                    }
                    if (jsonConfig.devDependencies) {
                        mergeTypings(ts.getOwnKeys(jsonConfig.devDependencies));
                    }
                    if (jsonConfig.optionalDependencies) {
                        mergeTypings(ts.getOwnKeys(jsonConfig.optionalDependencies));
                    }
                    if (jsonConfig.peerDependencies) {
                        mergeTypings(ts.getOwnKeys(jsonConfig.peerDependencies));
                    }
                }
            }
1313998
protected String getJSIncludeFile(String fileName) {

        StringBuffer result = new StringBuffer(8);
        result.append("<script type=\"text/javascript\" src=\"");
        result.append(fileName);
        result.append("\"></script>");
        return result.toString();
    }
1269648
public static String extractMetricName(String[] strs) {
        if (strs.length < 6) return null;
        return strs[strs.length - 1];
    }
1135006
function getFromFileNameV2 (filename) {
	var result = mime.getType(filename);

	// Add charset just in case for some buggy browsers.
	if (result === 'application/javascript' || result === 'application/json' || result === 'text/plain') {
		result += '; charset=UTF-8';
	}

	return result;
}
45310
function getFileByName(filename){
    if(!isLoaded[filename]){
        isLoaded[filename] = true;
        let CIniUserMgr	= CreateFile(filename);
        if (CIniUserMgr.IsHave()) {
            iniList[filename] = CIniUserMgr;
        }
    }
    return iniList[filename];
}
538609
function(str) {
    return (_.startsWith(str, '"') && _.endsWith(str, '"') && !_.includes(_.trim(str, '"'), '"')) ||
      (_.startsWith(str, "'") && _.endsWith(str, "'") && !_.includes(_.trim(str, "'"), "'"))
  }