Returns a case from the given file.
355914
def _parse_rdf(self, file):
        
        store = Graph()
        store.parse(file)

        print len(store)
799862
def from_file(cls, f):
        
        word2index = {}
        counts = Counter()
        for i, line in enumerate(f):
            word, count_str = line.split('\t')
            word = word.decode('utf-8')
            word2index[word] = i
            counts[word] = float(count_str)
            if i == 0:
                unk = word
        return cls.from_dict(word2index, unk, counts)
151793
public static String getFileExtension(File file) {

		String fileName = file.getName();
		String extension = null;

		int extensionIndex = fileName.lastIndexOf(".");
		if (extensionIndex > -1) {
			extension = fileName.substring(extensionIndex + 1);
		}

		return extension;
	}
1293886
def decode_from_file(path: str) -> Iterable:
    """"""
    with open(path, 'rb') as f:
        b = f.read()
    return decode(b)
635202
@Nullable
    public static String getFileExtension(@NotNull String fileName) {
        @Nullable
        final String fileExt = FilenameUtils.getExtension(fileName);
        return StringUtils.isNoneEmpty(fileExt) ? StringUtils.lowerCase(fileExt) : null;
    }
581369
def get_file_string(filepath):
    """"""
    with open(os.path.abspath(filepath)) as f:
        return f.read()
1082893
def parse_file(self,filename):
        """"""
        try:
            return self.rProgram.ignore(cStyleComment).parseFile(filename, parseAll=True)
        except SemanticException as err:
            print(err)
            exit(3)
        except ParseException as err:
            print(err)
            exit(3)
1332213
def _get_extension(file):
    
    if isinstance(file, str):
        return os.path.splitext(file)[-1]
    elif isinstance(file, bytes):
        kind = imghdr.what(io.BytesIO(file))
        return ('.' + kind) if kind else ''
    elif isinstance(file, io.IOBase) and file.seekable():
        kind = imghdr.what(file)
        return ('.' + kind) if kind is not None else ''
    elif getattr(file, 'name', None):
        # Note: ``file.name`` works for :tl:`InputFile` and some `IOBase`
        return _get_extension(file.name)
    else:
        return ''
658997
String convertCase(String str) {
        if (str == null) {
            return null;
        }
        return sensitive ? str : str.toLowerCase();
    }
943192
def GetSubFileEntryByName(self, name, case_sensitive=True):
    
    name_lower = name.lower()
    matching_sub_file_entry = None

    for sub_file_entry in self.sub_file_entries:
      if sub_file_entry.name == name:
        return sub_file_entry

      if not case_sensitive and sub_file_entry.name.lower() == name_lower:
        if not matching_sub_file_entry:
          matching_sub_file_entry = sub_file_entry

    return matching_sub_file_entry
210246
def create(pattern, casesensitive=True):
        """"""
        casesensitive = determine_casesensitive(casesensitive)
        if "?" in pattern or "*" in pattern:
            return FNMatcher(pattern, casesensitive)
        else:
            return ConstantMatcher(pattern, casesensitive)
769812
def from_file(self, filename):
        
        with gzip.open(filename, 'rb') as f:
            self.parse(f.read())
562533
String convertCase(String s, String sample, Language lang) {
    return CaseConversionHelper.convertCase(match.getCaseConversionType(), s, sample, lang);
  }
237955
function getFile (str) {
  var ret = null
  var match = /[0-9]+,[0-9]+,.*/.test(str)
  if (!match) {
    return null
  }
  var a = str.split(',')
  if (a && a[2]) {
    ret = a[2]
    return ret
  } else {
    return null
  }
  if (isNaN(ret)) {
    return null
  }
  return ret
}
1138260
public boolean accept(File file) {
        if (caseSensitive) {
            return file.getName().startsWith(string0);
        } else {
            return file.getName().toLowerCase().startsWith(string0.toLowerCase());
        }
    }
9922
def single_case(self, i, case):
        """"""

        # Pop a previous case if we have consecutive ones.
        if self.single_stack:
            self.single_stack.pop()
        self.single_stack.append(case)
        try:
            t = next(i)
            if self.use_format and t in _CURLY_BRACKETS:
                self.handle_format(t, i)
            elif t == '\\':
                try:
                    t = next(i)
                    self.reference(t, i)
                except StopIteration:
                    self.result.append(t)
                    raise
            elif self.single_stack:
                self.result.append(self.convert_case(t, self.get_single_stack()))
        except StopIteration:
            pass
809960
@Override
    public boolean accept(File file) {
        String name = file.getName();
        if (FilenameUtils.wildcardMatch(name, wildcards, caseSensitivity)) {
            return true;
        }
        return false;
    }