Spaces:
Sleeping
Sleeping
remove unnecessary code
Browse files
app.py
CHANGED
|
@@ -45,6 +45,7 @@ max_mean_line_length = st.sidebar.slider("Maximum average line length", 0, 2000,
|
|
| 45 |
st.sidebar.markdown("Printed files have `max_line_length` and `average_line_length` larger than the selected values.\
|
| 46 |
`alphanumeric_fraction` is smaller than the selected value.")
|
| 47 |
|
|
|
|
| 48 |
samples = load_data(chosen_language, chosen_ext)
|
| 49 |
|
| 50 |
samples = samples.filter(
|
|
@@ -56,8 +57,6 @@ if not_lexable:
|
|
| 56 |
samples = samples.filter(lambda x: not x["lexable"])
|
| 57 |
|
| 58 |
max_docs = len(samples)
|
| 59 |
-
samples = samples.add_column("idx", range(len(samples)))
|
| 60 |
-
|
| 61 |
|
| 62 |
if max_docs > 0:
|
| 63 |
col_1, _ = st.columns([3, 3])
|
|
@@ -70,7 +69,6 @@ if max_docs > 0:
|
|
| 70 |
step=1,
|
| 71 |
)
|
| 72 |
|
| 73 |
-
# info about the chosen example
|
| 74 |
example = samples[index_example]
|
| 75 |
|
| 76 |
st.markdown("#### File content:")
|
|
|
|
| 45 |
st.sidebar.markdown("Printed files have `max_line_length` and `average_line_length` larger than the selected values.\
|
| 46 |
`alphanumeric_fraction` is smaller than the selected value.")
|
| 47 |
|
| 48 |
+
# load and filter dataset
|
| 49 |
samples = load_data(chosen_language, chosen_ext)
|
| 50 |
|
| 51 |
samples = samples.filter(
|
|
|
|
| 57 |
samples = samples.filter(lambda x: not x["lexable"])
|
| 58 |
|
| 59 |
max_docs = len(samples)
|
|
|
|
|
|
|
| 60 |
|
| 61 |
if max_docs > 0:
|
| 62 |
col_1, _ = st.columns([3, 3])
|
|
|
|
| 69 |
step=1,
|
| 70 |
)
|
| 71 |
|
|
|
|
| 72 |
example = samples[index_example]
|
| 73 |
|
| 74 |
st.markdown("#### File content:")
|