Spaces:
Runtime error
Runtime error
anonymousauthors
commited on
Commit
•
a70af0f
1
Parent(s):
a184ff1
Update secretlanguage.py
Browse files- secretlanguage.py +8 -8
secretlanguage.py
CHANGED
@@ -33,8 +33,6 @@ if (document.readyState === "complete") {
|
|
33 |
</script>
|
34 |
"""
|
35 |
|
36 |
-
# html = autompg.to_html(classes=['example', 'panel-df'])
|
37 |
-
|
38 |
import pandas as pd
|
39 |
|
40 |
class ReactiveTables(param.Parameterized):
|
@@ -62,9 +60,9 @@ class ReactiveTables(param.Parameterized):
|
|
62 |
self.old_data = pd.DataFrame(datas[self.name_])
|
63 |
return self.old_data, datas
|
64 |
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
|
69 |
@param.depends('name_', 'record_start_index', 'record_stop_index')
|
70 |
def table_ours(self):
|
@@ -77,9 +75,10 @@ class ReactiveTables(param.Parameterized):
|
|
77 |
@param.depends('name_', 'record_start_index', 'record_stop_index')
|
78 |
def notification(self):
|
79 |
datas = self.data()[1]
|
|
|
80 |
if datas:
|
81 |
if self.name_ in datas.keys():
|
82 |
-
return pn.pane.HTML(f'<h1>Found {self.name_}.</h1> <h2> {self.name_} has {
|
83 |
sizing_mode='stretch_width')
|
84 |
else:
|
85 |
return pn.pane.HTML(f'<h1>Sorry. {self.name_} is not in the dictionary.</h1>' ,
|
@@ -94,8 +93,9 @@ class ReactiveTables(param.Parameterized):
|
|
94 |
pn.Param(self, name="Settings", width=300, sizing_mode="fixed"),
|
95 |
pn.Column(
|
96 |
self.notification,
|
97 |
-
|
98 |
-
|
|
|
99 |
width=2000,
|
100 |
# sizing_mode='stretch_height'
|
101 |
)
|
|
|
33 |
</script>
|
34 |
"""
|
35 |
|
|
|
|
|
36 |
import pandas as pd
|
37 |
|
38 |
class ReactiveTables(param.Parameterized):
|
|
|
60 |
self.old_data = pd.DataFrame(datas[self.name_])
|
61 |
return self.old_data, datas
|
62 |
|
63 |
+
# @param.depends('name_')
|
64 |
+
# def summary(self):
|
65 |
+
# return self.data()[0].describe()
|
66 |
|
67 |
@param.depends('name_', 'record_start_index', 'record_stop_index')
|
68 |
def table_ours(self):
|
|
|
75 |
@param.depends('name_', 'record_start_index', 'record_stop_index')
|
76 |
def notification(self):
|
77 |
datas = self.data()[1]
|
78 |
+
_len = len(datas[self.name_]['tasks']) - 1
|
79 |
if datas:
|
80 |
if self.name_ in datas.keys():
|
81 |
+
return pn.pane.HTML(f'<h1>Found {self.name_}.</h1> <h2> {self.name_} has {_len} secret languages found by SecretFinding. Presenting the secret language from {self.record_start_index} to {min(self.record_stop_index, _len)}.</h2>' ,
|
82 |
sizing_mode='stretch_width')
|
83 |
else:
|
84 |
return pn.pane.HTML(f'<h1>Sorry. {self.name_} is not in the dictionary.</h1>' ,
|
|
|
93 |
pn.Param(self, name="Settings", width=300, sizing_mode="fixed"),
|
94 |
pn.Column(
|
95 |
self.notification,
|
96 |
+
# "## Description", self.summary,
|
97 |
+
# "## Table",
|
98 |
+
self.table_ours,
|
99 |
width=2000,
|
100 |
# sizing_mode='stretch_height'
|
101 |
)
|