791e09b24641b6d372ba08c59b6b801440c767b2,fileinfo.py,,,#,19
Before Change
if sys.version_info >= (3, 0):
raw_input = input
try_count = 16
while try_count:
file_name = raw_input("Enter a file name: ") // pick a file you have
fhand = open(file_name)
count = 0
for lines in fhand:
count = count + 1
fhand = open(file_name)
inp = fhand.read()
t_char = len(inp)
try_count >>= 1
try:
file_stats = os.stat(file_name)
print ("This is os.stat",file_stats)
break
except OSError:
print ("\nNameError : [%s] No such file or directory\n", file_name)
if try_count == 0:
print ("Trial limit exceeded \nExiting program")
sys.exit()
After Change
file_name = raw_input("Enter a file name: ") // pick a file you have
count = 0
t_char = 0
try:
with open(file_name) as f:
line = f.readline()
t_char += len(line)
while line:
count += 1
line = f.readline()
t_char += len(line)
except FileNotFoundError as e:
print(e)
sys.exit()
file_stats = os.stat(file_name)
// create a dictionary to hold file info
file_info = {
"fname": file_name,
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 7
Instances
Project Name: geekcomputers/Python
Commit Name: 791e09b24641b6d372ba08c59b6b801440c767b2
Time: 2019-08-14
Author: 35282147+Hong199@users.noreply.github.com
File Name: fileinfo.py
Class Name:
Method Name:
Project Name: geekcomputers/Python
Commit Name: 791e09b24641b6d372ba08c59b6b801440c767b2
Time: 2019-08-14
Author: 35282147+Hong199@users.noreply.github.com
File Name: fileinfo.py
Class Name:
Method Name:
Project Name: elfi-dev/elfi
Commit Name: eb48b9b095e2200e1f7acbc6f448ff39f88c4145
Time: 2017-07-13
Author: jarno.lintusaari@aalto.fi
File Name: elfi/model/elfi_model.py
Class Name: NodeReference
Method Name: _give_name
Project Name: brian-team/brian2
Commit Name: 2db605d4a44e33306af74892eecbfef75a1d44d8
Time: 2014-02-19
Author: dan.goodman@ens.fr
File Name: brian2/equations/equations.py
Class Name: Equations
Method Name: _sort_static_equations