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()
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 6

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: okfn-brasil/serenata-de-amor
Commit Name: e4d5b98f9d2ef79279300d1074cbaacde8e816dc
Time: 2016-11-20
Author: cuducos@gmail.com
File Name: src/fetch_sex_places.py
Class Name:
Method Name: sex_places_neraby


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: theislab/scanpy
Commit Name: 37ef2c69f22a6e2d1232782dd3e192a003731a75
Time: 2020-11-25
Author: michal.klein@protonmail.com
File Name: scanpy/readwrite.py
Class Name:
Method Name: _download