instruction stringlengths 0 1k | input stringlengths 1 1k | output stringlengths 10 6.51k |
|---|---|---|
w_costs_filter = False
if is_opening:
self.temp_selected_statuses = self.selected_statuses.copy()
@rx.event
def toggle_region_filter(self):
is_opening = not self.show_region_filter
self.show_region_filter = is_opening
self.show_status_filter = False
self.show... |
@rx.event
def toggle_temp_region(self, region: str):
if region in self.temp_selected_regions:
self.temp_selected_regions.remove(region)
else:
self.temp_selected_regions.add(region)
@rx.event
def set_temp_min_cost(self, value: str):
self.temp_min_cost_st... | if status in self.temp_selected_statuses:
self.temp_selected_statuses.remove(status)
else:
self.temp_selected_statuses.add(status) |
ening = not self.show_region_filter
self.show_region_filter = is_opening
self.show_status_filter = False
self.show_costs_filter = False
if is_opening:
self.temp_selected_regions = self.selected_regions.copy()
@rx.event
def toggle_costs_filter(self):
is_openin... |
@rx.event
def set_temp_min_cost(self, value: str):
self.temp_min_cost_str = value
@rx.event
def set_temp_max_cost(self, value: str):
self.temp_max_cost_str = value
@rx.event
def apply_status_filter(self):
self.selected_statuses = self.temp_selected_statuses.copy()
... | def toggle_temp_region(self, region: str):
if region in self.temp_selected_regions:
self.temp_selected_regions.remove(region)
else:
self.temp_selected_regions.add(region) |
ow_region_filter = is_opening
self.show_status_filter = False
self.show_costs_filter = False
if is_opening:
self.temp_selected_regions = self.selected_regions.copy()
@rx.event
def toggle_costs_filter(self):
is_opening = not self.show_costs_filter
self.show_co... |
@rx.event
def set_temp_min_cost(self, value: str):
self.temp_min_cost_str = value
@rx.event
def set_temp_max_cost(self, value: str):
self.temp_max_cost_str = value
@rx.event
def apply_status_filter(self):
self.selected_statuses = self.temp_selected_statuses.copy()
... | if region in self.temp_selected_regions:
self.temp_selected_regions.remove(region)
else:
self.temp_selected_regions.add(region) |
elected_regions.copy()
@rx.event
def toggle_costs_filter(self):
is_opening = not self.show_costs_filter
self.show_costs_filter = is_opening
self.show_status_filter = False
self.show_region_filter = False
if is_opening:
self.temp_min_cost_str = (
... |
@rx.event
def set_temp_max_cost(self, value: str):
self.temp_max_cost_str = value
@rx.event
def apply_status_filter(self):
self.selected_statuses = self.temp_selected_statuses.copy()
self.show_status_filter = False
self.current_page = 1
@rx.event
def apply_reg... | def set_temp_min_cost(self, value: str):
self.temp_min_cost_str = value |
gle_costs_filter(self):
is_opening = not self.show_costs_filter
self.show_costs_filter = is_opening
self.show_status_filter = False
self.show_region_filter = False
if is_opening:
self.temp_min_cost_str = (
str(self.min_cost) if self.min_cost is not Non... |
@rx.event
def set_temp_max_cost(self, value: str):
self.temp_max_cost_str = value
@rx.event
def apply_status_filter(self):
self.selected_statuses = self.temp_selected_statuses.copy()
self.show_status_filter = False
self.current_page = 1
@rx.event
def apply_reg... | self.temp_min_cost_str = value |
elf.show_costs_filter
self.show_costs_filter = is_opening
self.show_status_filter = False
self.show_region_filter = False
if is_opening:
self.temp_min_cost_str = (
str(self.min_cost) if self.min_cost is not None else ""
)
self.temp_max_... |
@rx.event
def apply_status_filter(self):
self.selected_statuses = self.temp_selected_statuses.copy()
self.show_status_filter = False
self.current_page = 1
@rx.event
def apply_region_filter(self):
self.selected_regions = self.temp_selected_regions.copy()
self.sh... | def set_temp_max_cost(self, value: str):
self.temp_max_cost_str = value |
ter = is_opening
self.show_status_filter = False
self.show_region_filter = False
if is_opening:
self.temp_min_cost_str = (
str(self.min_cost) if self.min_cost is not None else ""
)
self.temp_max_cost_str = (
str(self.max_cost) i... |
@rx.event
def apply_status_filter(self):
self.selected_statuses = self.temp_selected_statuses.copy()
self.show_status_filter = False
self.current_page = 1
@rx.event
def apply_region_filter(self):
self.selected_regions = self.temp_selected_regions.copy()
self.sh... | self.temp_max_cost_str = value |
False
self.show_region_filter = False
if is_opening:
self.temp_min_cost_str = (
str(self.min_cost) if self.min_cost is not None else ""
)
self.temp_max_cost_str = (
str(self.max_cost) if self.max_cost is not None else ""
)
... |
@rx.event
def apply_region_filter(self):
self.selected_regions = self.temp_selected_regions.copy()
self.show_region_filter = False
self.current_page = 1
@rx.event
def apply_costs_filter(self):
new_min_cost = None
new_max_cost = None
try:
if ... | def apply_status_filter(self):
self.selected_statuses = self.temp_selected_statuses.copy()
self.show_status_filter = False
self.current_page = 1 |
= False
if is_opening:
self.temp_min_cost_str = (
str(self.min_cost) if self.min_cost is not None else ""
)
self.temp_max_cost_str = (
str(self.max_cost) if self.max_cost is not None else ""
)
@rx.event
def toggle_temp_stat... |
self.show_status_filter = False
self.current_page = 1
@rx.event
def apply_region_filter(self):
self.selected_regions = self.temp_selected_regions.copy()
self.show_region_filter = False
self.current_page = 1
@rx.event
def apply_costs_filter(self):
new_mi... | self.selected_statuses = self.temp_selected_statuses.copy() |
(
str(self.min_cost) if self.min_cost is not None else ""
)
self.temp_max_cost_str = (
str(self.max_cost) if self.max_cost is not None else ""
)
@rx.event
def toggle_temp_status(self, status: str):
if status in self.temp_selected_statu... |
self.current_page = 1
@rx.event
def apply_region_filter(self):
self.selected_regions = self.temp_selected_regions.copy()
self.show_region_filter = False
self.current_page = 1
@rx.event
def apply_costs_filter(self):
new_min_cost = None
new_max_cost = Non... | self.show_status_filter = False |
self.min_cost is not None else ""
)
self.temp_max_cost_str = (
str(self.max_cost) if self.max_cost is not None else ""
)
@rx.event
def toggle_temp_status(self, status: str):
if status in self.temp_selected_statuses:
self.temp_selected_stat... |
@rx.event
def apply_region_filter(self):
self.selected_regions = self.temp_selected_regions.copy()
self.show_region_filter = False
self.current_page = 1
@rx.event
def apply_costs_filter(self):
new_min_cost = None
new_max_cost = None
try:
if ... | self.current_page = 1 |
)
self.temp_max_cost_str = (
str(self.max_cost) if self.max_cost is not None else ""
)
@rx.event
def toggle_temp_status(self, status: str):
if status in self.temp_selected_statuses:
self.temp_selected_statuses.remove(status)
else:
... |
@rx.event
def apply_costs_filter(self):
new_min_cost = None
new_max_cost = None
try:
if self.temp_min_cost_str:
new_min_cost = float(self.temp_min_cost_str)
except ValueError:
pass
try:
if self.temp_max_cost_str:
... | def apply_region_filter(self):
self.selected_regions = self.temp_selected_regions.copy()
self.show_region_filter = False
self.current_page = 1 |
tr = (
str(self.max_cost) if self.max_cost is not None else ""
)
@rx.event
def toggle_temp_status(self, status: str):
if status in self.temp_selected_statuses:
self.temp_selected_statuses.remove(status)
else:
self.temp_selected_statuses.add(st... |
self.show_region_filter = False
self.current_page = 1
@rx.event
def apply_costs_filter(self):
new_min_cost = None
new_max_cost = None
try:
if self.temp_min_cost_str:
new_min_cost = float(self.temp_min_cost_str)
except ValueError:
... | self.selected_regions = self.temp_selected_regions.copy() |
None else ""
)
@rx.event
def toggle_temp_status(self, status: str):
if status in self.temp_selected_statuses:
self.temp_selected_statuses.remove(status)
else:
self.temp_selected_statuses.add(status)
@rx.event
def toggle_temp_region(self, region: str)... |
self.current_page = 1
@rx.event
def apply_costs_filter(self):
new_min_cost = None
new_max_cost = None
try:
if self.temp_min_cost_str:
new_min_cost = float(self.temp_min_cost_str)
except ValueError:
pass
try:
if... | self.show_region_filter = False |
t
def toggle_temp_status(self, status: str):
if status in self.temp_selected_statuses:
self.temp_selected_statuses.remove(status)
else:
self.temp_selected_statuses.add(status)
@rx.event
def toggle_temp_region(self, region: str):
if region in self.temp_selecte... |
@rx.event
def apply_costs_filter(self):
new_min_cost = None
new_max_cost = None
try:
if self.temp_min_cost_str:
new_min_cost = float(self.temp_min_cost_str)
except ValueError:
pass
try:
if self.temp_max_cost_str:
... | self.current_page = 1 |
: str):
if status in self.temp_selected_statuses:
self.temp_selected_statuses.remove(status)
else:
self.temp_selected_statuses.add(status)
@rx.event
def toggle_temp_region(self, region: str):
if region in self.temp_selected_regions:
self.temp_selected... |
@rx.event
def reset_status_filter(self):
self.temp_selected_statuses = set()
self.selected_statuses = set()
self.show_status_filter = False
self.current_page = 1
@rx.event
def reset_region_filter(self):
self.temp_selected_regions = set()
self.selected_r... | def apply_costs_filter(self):
new_min_cost = None
new_max_cost = None
try:
if self.temp_min_cost_str:
new_min_cost = float(self.temp_min_cost_str)
except ValueError:
pass
try:
if self.temp_max_cost_str:
new_max_c... |
_selected_statuses:
self.temp_selected_statuses.remove(status)
else:
self.temp_selected_statuses.add(status)
@rx.event
def toggle_temp_region(self, region: str):
if region in self.temp_selected_regions:
self.temp_selected_regions.remove(region)
else:
... |
new_max_cost = None
try:
if self.temp_min_cost_str:
new_min_cost = float(self.temp_min_cost_str)
except ValueError:
pass
try:
if self.temp_max_cost_str:
new_max_cost = float(self.temp_max_cost_str)
except ValueE... | new_min_cost = None |
self.temp_selected_statuses.remove(status)
else:
self.temp_selected_statuses.add(status)
@rx.event
def toggle_temp_region(self, region: str):
if region in self.temp_selected_regions:
self.temp_selected_regions.remove(region)
else:
self.temp_select... |
try:
if self.temp_min_cost_str:
new_min_cost = float(self.temp_min_cost_str)
except ValueError:
pass
try:
if self.temp_max_cost_str:
new_max_cost = float(self.temp_max_cost_str)
except ValueError:
pass
... | new_max_cost = None |
)
else:
self.temp_selected_statuses.add(status)
@rx.event
def toggle_temp_region(self, region: str):
if region in self.temp_selected_regions:
self.temp_selected_regions.remove(region)
else:
self.temp_selected_regions.add(region)
@rx.event
def... |
except ValueError:
pass
try:
if self.temp_max_cost_str:
new_max_cost = float(self.temp_max_cost_str)
except ValueError:
pass
self.min_cost = new_min_cost
self.max_cost = new_max_cost
self.show_costs_filter = False
... | if self.temp_min_cost_str:
new_min_cost = float(self.temp_min_cost_str) |
ted_statuses.add(status)
@rx.event
def toggle_temp_region(self, region: str):
if region in self.temp_selected_regions:
self.temp_selected_regions.remove(region)
else:
self.temp_selected_regions.add(region)
@rx.event
def set_temp_min_cost(self, value: str):
... |
except ValueError:
pass
try:
if self.temp_max_cost_str:
new_max_cost = float(self.temp_max_cost_str)
except ValueError:
pass
self.min_cost = new_min_cost
self.max_cost = new_max_cost
self.show_costs_filter = False
... | new_min_cost = float(self.temp_min_cost_str) |
emp_selected_regions:
self.temp_selected_regions.remove(region)
else:
self.temp_selected_regions.add(region)
@rx.event
def set_temp_min_cost(self, value: str):
self.temp_min_cost_str = value
@rx.event
def set_temp_max_cost(self, value: str):
self.temp_ma... |
except ValueError:
pass
self.min_cost = new_min_cost
self.max_cost = new_max_cost
self.show_costs_filter = False
self.current_page = 1
@rx.event
def reset_status_filter(self):
self.temp_selected_statuses = set()
self.selected_statuses = set()... | if self.temp_max_cost_str:
new_max_cost = float(self.temp_max_cost_str) |
_selected_regions.remove(region)
else:
self.temp_selected_regions.add(region)
@rx.event
def set_temp_min_cost(self, value: str):
self.temp_min_cost_str = value
@rx.event
def set_temp_max_cost(self, value: str):
self.temp_max_cost_str = value
@rx.event
def a... |
except ValueError:
pass
self.min_cost = new_min_cost
self.max_cost = new_max_cost
self.show_costs_filter = False
self.current_page = 1
@rx.event
def reset_status_filter(self):
self.temp_selected_statuses = set()
self.selected_statuses = set()... | new_max_cost = float(self.temp_max_cost_str) |
@rx.event
def set_temp_min_cost(self, value: str):
self.temp_min_cost_str = value
@rx.event
def set_temp_max_cost(self, value: str):
self.temp_max_cost_str = value
@rx.event
def apply_status_filter(self):
self.selected_statuses = self.temp_selected_statuses.copy()
... |
self.max_cost = new_max_cost
self.show_costs_filter = False
self.current_page = 1
@rx.event
def reset_status_filter(self):
self.temp_selected_statuses = set()
self.selected_statuses = set()
self.show_status_filter = False
self.current_page = 1
@rx.e... | self.min_cost = new_min_cost |
cost(self, value: str):
self.temp_min_cost_str = value
@rx.event
def set_temp_max_cost(self, value: str):
self.temp_max_cost_str = value
@rx.event
def apply_status_filter(self):
self.selected_statuses = self.temp_selected_statuses.copy()
self.show_status_filter = False
... |
self.show_costs_filter = False
self.current_page = 1
@rx.event
def reset_status_filter(self):
self.temp_selected_statuses = set()
self.selected_statuses = set()
self.show_status_filter = False
self.current_page = 1
@rx.event
def reset_region_filter(self... | self.max_cost = new_max_cost |
temp_min_cost_str = value
@rx.event
def set_temp_max_cost(self, value: str):
self.temp_max_cost_str = value
@rx.event
def apply_status_filter(self):
self.selected_statuses = self.temp_selected_statuses.copy()
self.show_status_filter = False
self.current_page = 1
@r... |
self.current_page = 1
@rx.event
def reset_status_filter(self):
self.temp_selected_statuses = set()
self.selected_statuses = set()
self.show_status_filter = False
self.current_page = 1
@rx.event
def reset_region_filter(self):
self.temp_selected_regions =... | self.show_costs_filter = False |
t
def set_temp_max_cost(self, value: str):
self.temp_max_cost_str = value
@rx.event
def apply_status_filter(self):
self.selected_statuses = self.temp_selected_statuses.copy()
self.show_status_filter = False
self.current_page = 1
@rx.event
def apply_region_filter(sel... |
@rx.event
def reset_status_filter(self):
self.temp_selected_statuses = set()
self.selected_statuses = set()
self.show_status_filter = False
self.current_page = 1
@rx.event
def reset_region_filter(self):
self.temp_selected_regions = set()
self.selected_r... | self.current_page = 1 |
str):
self.temp_max_cost_str = value
@rx.event
def apply_status_filter(self):
self.selected_statuses = self.temp_selected_statuses.copy()
self.show_status_filter = False
self.current_page = 1
@rx.event
def apply_region_filter(self):
self.selected_regions = self.... |
@rx.event
def reset_region_filter(self):
self.temp_selected_regions = set()
self.selected_regions = set()
self.show_region_filter = False
self.current_page = 1
@rx.event
def reset_costs_filter(self):
self.temp_min_cost_str = ""
self.temp_max_cost_str = ... | def reset_status_filter(self):
self.temp_selected_statuses = set()
self.selected_statuses = set()
self.show_status_filter = False
self.current_page = 1 |
value
@rx.event
def apply_status_filter(self):
self.selected_statuses = self.temp_selected_statuses.copy()
self.show_status_filter = False
self.current_page = 1
@rx.event
def apply_region_filter(self):
self.selected_regions = self.temp_selected_regions.copy()
se... |
self.selected_statuses = set()
self.show_status_filter = False
self.current_page = 1
@rx.event
def reset_region_filter(self):
self.temp_selected_regions = set()
self.selected_regions = set()
self.show_region_filter = False
self.current_page = 1
@rx.... | self.temp_selected_statuses = set() |
lter(self):
self.selected_statuses = self.temp_selected_statuses.copy()
self.show_status_filter = False
self.current_page = 1
@rx.event
def apply_region_filter(self):
self.selected_regions = self.temp_selected_regions.copy()
self.show_region_filter = False
self.c... |
self.show_status_filter = False
self.current_page = 1
@rx.event
def reset_region_filter(self):
self.temp_selected_regions = set()
self.selected_regions = set()
self.show_region_filter = False
self.current_page = 1
@rx.event
def reset_costs_filter(self):... | self.selected_statuses = set() |
ses = self.temp_selected_statuses.copy()
self.show_status_filter = False
self.current_page = 1
@rx.event
def apply_region_filter(self):
self.selected_regions = self.temp_selected_regions.copy()
self.show_region_filter = False
self.current_page = 1
@rx.event
def ... |
self.current_page = 1
@rx.event
def reset_region_filter(self):
self.temp_selected_regions = set()
self.selected_regions = set()
self.show_region_filter = False
self.current_page = 1
@rx.event
def reset_costs_filter(self):
self.temp_min_cost_str = ""
... | self.show_status_filter = False |
self.show_status_filter = False
self.current_page = 1
@rx.event
def apply_region_filter(self):
self.selected_regions = self.temp_selected_regions.copy()
self.show_region_filter = False
self.current_page = 1
@rx.event
def apply_costs_filter(self):
new_mi... |
@rx.event
def reset_region_filter(self):
self.temp_selected_regions = set()
self.selected_regions = set()
self.show_region_filter = False
self.current_page = 1
@rx.event
def reset_costs_filter(self):
self.temp_min_cost_str = ""
self.temp_max_cost_str = ... | self.current_page = 1 |
self.current_page = 1
@rx.event
def apply_region_filter(self):
self.selected_regions = self.temp_selected_regions.copy()
self.show_region_filter = False
self.current_page = 1
@rx.event
def apply_costs_filter(self):
new_min_cost = None
new_max_cost = None... |
@rx.event
def reset_costs_filter(self):
self.temp_min_cost_str = ""
self.temp_max_cost_str = ""
self.min_cost = None
self.max_cost = None
self.show_costs_filter = False
self.current_page = 1
@rx.event
def reset_all_filters(self):
"""Reset all fi... | def reset_region_filter(self):
self.temp_selected_regions = set()
self.selected_regions = set()
self.show_region_filter = False
self.current_page = 1 |
event
def apply_region_filter(self):
self.selected_regions = self.temp_selected_regions.copy()
self.show_region_filter = False
self.current_page = 1
@rx.event
def apply_costs_filter(self):
new_min_cost = None
new_max_cost = None
try:
if self.temp_... |
self.selected_regions = set()
self.show_region_filter = False
self.current_page = 1
@rx.event
def reset_costs_filter(self):
self.temp_min_cost_str = ""
self.temp_max_cost_str = ""
self.min_cost = None
self.max_cost = None
self.show_costs_filter =... | self.temp_selected_regions = set() |
self.selected_regions = self.temp_selected_regions.copy()
self.show_region_filter = False
self.current_page = 1
@rx.event
def apply_costs_filter(self):
new_min_cost = None
new_max_cost = None
try:
if self.temp_min_cost_str:
new_min_cost ... |
self.show_region_filter = False
self.current_page = 1
@rx.event
def reset_costs_filter(self):
self.temp_min_cost_str = ""
self.temp_max_cost_str = ""
self.min_cost = None
self.max_cost = None
self.show_costs_filter = False
self.current_page = 1
... | self.selected_regions = set() |
p_selected_regions.copy()
self.show_region_filter = False
self.current_page = 1
@rx.event
def apply_costs_filter(self):
new_min_cost = None
new_max_cost = None
try:
if self.temp_min_cost_str:
new_min_cost = float(self.temp_min_cost_str)
... |
self.current_page = 1
@rx.event
def reset_costs_filter(self):
self.temp_min_cost_str = ""
self.temp_max_cost_str = ""
self.min_cost = None
self.max_cost = None
self.show_costs_filter = False
self.current_page = 1
@rx.event
def reset_all_filters(... | self.show_region_filter = False |
how_region_filter = False
self.current_page = 1
@rx.event
def apply_costs_filter(self):
new_min_cost = None
new_max_cost = None
try:
if self.temp_min_cost_str:
new_min_cost = float(self.temp_min_cost_str)
except ValueError:
pass
... |
@rx.event
def reset_costs_filter(self):
self.temp_min_cost_str = ""
self.temp_max_cost_str = ""
self.min_cost = None
self.max_cost = None
self.show_costs_filter = False
self.current_page = 1
@rx.event
def reset_all_filters(self):
"""Reset all fi... | self.current_page = 1 |
rrent_page = 1
@rx.event
def apply_costs_filter(self):
new_min_cost = None
new_max_cost = None
try:
if self.temp_min_cost_str:
new_min_cost = float(self.temp_min_cost_str)
except ValueError:
pass
try:
if self.temp_max_c... |
@rx.event
def reset_all_filters(self):
"""Reset all filters and search."""
self.search_owner = ""
self.selected_statuses = set()
self.selected_regions = set()
self.min_cost = None
self.max_cost = None
self.temp_selected_statuses = set()
self.temp... | def reset_costs_filter(self):
self.temp_min_cost_str = ""
self.temp_max_cost_str = ""
self.min_cost = None
self.max_cost = None
self.show_costs_filter = False
self.current_page = 1 |
apply_costs_filter(self):
new_min_cost = None
new_max_cost = None
try:
if self.temp_min_cost_str:
new_min_cost = float(self.temp_min_cost_str)
except ValueError:
pass
try:
if self.temp_max_cost_str:
new_max_cost ... |
self.temp_max_cost_str = ""
self.min_cost = None
self.max_cost = None
self.show_costs_filter = False
self.current_page = 1
@rx.event
def reset_all_filters(self):
"""Reset all filters and search."""
self.search_owner = ""
self.selected_statuses = ... | self.temp_min_cost_str = "" |
w_min_cost = None
new_max_cost = None
try:
if self.temp_min_cost_str:
new_min_cost = float(self.temp_min_cost_str)
except ValueError:
pass
try:
if self.temp_max_cost_str:
new_max_cost = float(self.temp_max_cost_str)
... |
self.min_cost = None
self.max_cost = None
self.show_costs_filter = False
self.current_page = 1
@rx.event
def reset_all_filters(self):
"""Reset all filters and search."""
self.search_owner = ""
self.selected_statuses = set()
self.selected_regions ... | self.temp_max_cost_str = "" |
st = None
try:
if self.temp_min_cost_str:
new_min_cost = float(self.temp_min_cost_str)
except ValueError:
pass
try:
if self.temp_max_cost_str:
new_max_cost = float(self.temp_max_cost_str)
except ValueError:
p... |
self.max_cost = None
self.show_costs_filter = False
self.current_page = 1
@rx.event
def reset_all_filters(self):
"""Reset all filters and search."""
self.search_owner = ""
self.selected_statuses = set()
self.selected_regions = set()
self.min_cost... | self.min_cost = None |
if self.temp_min_cost_str:
new_min_cost = float(self.temp_min_cost_str)
except ValueError:
pass
try:
if self.temp_max_cost_str:
new_max_cost = float(self.temp_max_cost_str)
except ValueError:
pass
self.min_cost = n... |
self.show_costs_filter = False
self.current_page = 1
@rx.event
def reset_all_filters(self):
"""Reset all filters and search."""
self.search_owner = ""
self.selected_statuses = set()
self.selected_regions = set()
self.min_cost = None
self.max_cost... | self.max_cost = None |
tr:
new_min_cost = float(self.temp_min_cost_str)
except ValueError:
pass
try:
if self.temp_max_cost_str:
new_max_cost = float(self.temp_max_cost_str)
except ValueError:
pass
self.min_cost = new_min_cost
self.max_... |
self.current_page = 1
@rx.event
def reset_all_filters(self):
"""Reset all filters and search."""
self.search_owner = ""
self.selected_statuses = set()
self.selected_regions = set()
self.min_cost = None
self.max_cost = None
self.temp_selected_stat... | self.show_costs_filter = False |
t(self.temp_min_cost_str)
except ValueError:
pass
try:
if self.temp_max_cost_str:
new_max_cost = float(self.temp_max_cost_str)
except ValueError:
pass
self.min_cost = new_min_cost
self.max_cost = new_max_cost
self.show_c... |
@rx.event
def reset_all_filters(self):
"""Reset all filters and search."""
self.search_owner = ""
self.selected_statuses = set()
self.selected_regions = set()
self.min_cost = None
self.max_cost = None
self.temp_selected_statuses = set()
self.temp... | self.current_page = 1 |
ValueError:
pass
try:
if self.temp_max_cost_str:
new_max_cost = float(self.temp_max_cost_str)
except ValueError:
pass
self.min_cost = new_min_cost
self.max_cost = new_max_cost
self.show_costs_filter = False
self.current_... |
@rx.event
def close_filter_dropdowns(self):
self.show_status_filter = False
self.show_region_filter = False
self.show_costs_filter = False
@rx.event
def download_csv(self):
"""Download the filtered and sorted data as CSV."""
df = pd.DataFrame(self.filtered_and_... | def reset_all_filters(self):
"""Reset all filters and search."""
self.search_owner = ""
self.selected_statuses = set()
self.selected_regions = set()
self.min_cost = None
self.max_cost = None
self.temp_selected_statuses = set()
self.temp_selected_regions = ... |
new_max_cost = float(self.temp_max_cost_str)
except ValueError:
pass
self.min_cost = new_min_cost
self.max_cost = new_max_cost
self.show_costs_filter = False
self.current_page = 1
@rx.event
def reset_status_filter(self):
self.temp_sele... |
self.selected_statuses = set()
self.selected_regions = set()
self.min_cost = None
self.max_cost = None
self.temp_selected_statuses = set()
self.temp_selected_regions = set()
self.temp_min_cost_str = ""
self.temp_max_cost_str = ""
self.show_status_... | self.search_owner = "" |
float(self.temp_max_cost_str)
except ValueError:
pass
self.min_cost = new_min_cost
self.max_cost = new_max_cost
self.show_costs_filter = False
self.current_page = 1
@rx.event
def reset_status_filter(self):
self.temp_selected_statuses = set()
s... |
self.selected_regions = set()
self.min_cost = None
self.max_cost = None
self.temp_selected_statuses = set()
self.temp_selected_regions = set()
self.temp_min_cost_str = ""
self.temp_max_cost_str = ""
self.show_status_filter = False
self.show_region... | self.selected_statuses = set() |
xcept ValueError:
pass
self.min_cost = new_min_cost
self.max_cost = new_max_cost
self.show_costs_filter = False
self.current_page = 1
@rx.event
def reset_status_filter(self):
self.temp_selected_statuses = set()
self.selected_statuses = set()
s... |
self.min_cost = None
self.max_cost = None
self.temp_selected_statuses = set()
self.temp_selected_regions = set()
self.temp_min_cost_str = ""
self.temp_max_cost_str = ""
self.show_status_filter = False
self.show_region_filter = False
self.show_cost... | self.selected_regions = set() |
self.min_cost = new_min_cost
self.max_cost = new_max_cost
self.show_costs_filter = False
self.current_page = 1
@rx.event
def reset_status_filter(self):
self.temp_selected_statuses = set()
self.selected_statuses = set()
self.show_status_filter = False
... |
self.max_cost = None
self.temp_selected_statuses = set()
self.temp_selected_regions = set()
self.temp_min_cost_str = ""
self.temp_max_cost_str = ""
self.show_status_filter = False
self.show_region_filter = False
self.show_costs_filter = False
self... | self.min_cost = None |
cost
self.max_cost = new_max_cost
self.show_costs_filter = False
self.current_page = 1
@rx.event
def reset_status_filter(self):
self.temp_selected_statuses = set()
self.selected_statuses = set()
self.show_status_filter = False
self.current_page = 1
@... |
self.temp_selected_statuses = set()
self.temp_selected_regions = set()
self.temp_min_cost_str = ""
self.temp_max_cost_str = ""
self.show_status_filter = False
self.show_region_filter = False
self.show_costs_filter = False
self.current_page = 1
sel... | self.max_cost = None |
new_max_cost
self.show_costs_filter = False
self.current_page = 1
@rx.event
def reset_status_filter(self):
self.temp_selected_statuses = set()
self.selected_statuses = set()
self.show_status_filter = False
self.current_page = 1
@rx.event
def reset_region... |
self.temp_selected_regions = set()
self.temp_min_cost_str = ""
self.temp_max_cost_str = ""
self.show_status_filter = False
self.show_region_filter = False
self.show_costs_filter = False
self.current_page = 1
self.selected_rows = set()
self.sort_co... | self.temp_selected_statuses = set() |
= False
self.current_page = 1
@rx.event
def reset_status_filter(self):
self.temp_selected_statuses = set()
self.selected_statuses = set()
self.show_status_filter = False
self.current_page = 1
@rx.event
def reset_region_filter(self):
self.temp_selected_re... |
self.temp_min_cost_str = ""
self.temp_max_cost_str = ""
self.show_status_filter = False
self.show_region_filter = False
self.show_costs_filter = False
self.current_page = 1
self.selected_rows = set()
self.sort_column = None
self.sort_ascending = T... | self.temp_selected_regions = set() |
@rx.event
def reset_status_filter(self):
self.temp_selected_statuses = set()
self.selected_statuses = set()
self.show_status_filter = False
self.current_page = 1
@rx.event
def reset_region_filter(self):
self.temp_selected_regions = set()
self.selected_regions... |
self.temp_max_cost_str = ""
self.show_status_filter = False
self.show_region_filter = False
self.show_costs_filter = False
self.current_page = 1
self.selected_rows = set()
self.sort_column = None
self.sort_ascending = True
@rx.event
def close_fil... | self.temp_min_cost_str = "" |
r(self):
self.temp_selected_statuses = set()
self.selected_statuses = set()
self.show_status_filter = False
self.current_page = 1
@rx.event
def reset_region_filter(self):
self.temp_selected_regions = set()
self.selected_regions = set()
self.show_region_fi... |
self.show_status_filter = False
self.show_region_filter = False
self.show_costs_filter = False
self.current_page = 1
self.selected_rows = set()
self.sort_column = None
self.sort_ascending = True
@rx.event
def close_filter_dropdowns(self):
self.sh... | self.temp_max_cost_str = "" |
statuses = set()
self.selected_statuses = set()
self.show_status_filter = False
self.current_page = 1
@rx.event
def reset_region_filter(self):
self.temp_selected_regions = set()
self.selected_regions = set()
self.show_region_filter = False
self.current_pa... |
self.show_region_filter = False
self.show_costs_filter = False
self.current_page = 1
self.selected_rows = set()
self.sort_column = None
self.sort_ascending = True
@rx.event
def close_filter_dropdowns(self):
self.show_status_filter = False
self.sh... | self.show_status_filter = False |
tatuses = set()
self.show_status_filter = False
self.current_page = 1
@rx.event
def reset_region_filter(self):
self.temp_selected_regions = set()
self.selected_regions = set()
self.show_region_filter = False
self.current_page = 1
@rx.event
def reset_cost... |
self.show_costs_filter = False
self.current_page = 1
self.selected_rows = set()
self.sort_column = None
self.sort_ascending = True
@rx.event
def close_filter_dropdowns(self):
self.show_status_filter = False
self.show_region_filter = False
self.sh... | self.show_region_filter = False |
_filter = False
self.current_page = 1
@rx.event
def reset_region_filter(self):
self.temp_selected_regions = set()
self.selected_regions = set()
self.show_region_filter = False
self.current_page = 1
@rx.event
def reset_costs_filter(self):
self.temp_min_co... |
self.current_page = 1
self.selected_rows = set()
self.sort_column = None
self.sort_ascending = True
@rx.event
def close_filter_dropdowns(self):
self.show_status_filter = False
self.show_region_filter = False
self.show_costs_filter = False
@rx.event
... | self.show_costs_filter = False |
ge = 1
@rx.event
def reset_region_filter(self):
self.temp_selected_regions = set()
self.selected_regions = set()
self.show_region_filter = False
self.current_page = 1
@rx.event
def reset_costs_filter(self):
self.temp_min_cost_str = ""
self.temp_max_cost_... |
self.selected_rows = set()
self.sort_column = None
self.sort_ascending = True
@rx.event
def close_filter_dropdowns(self):
self.show_status_filter = False
self.show_region_filter = False
self.show_costs_filter = False
@rx.event
def download_csv(self):
... | self.current_page = 1 |
reset_region_filter(self):
self.temp_selected_regions = set()
self.selected_regions = set()
self.show_region_filter = False
self.current_page = 1
@rx.event
def reset_costs_filter(self):
self.temp_min_cost_str = ""
self.temp_max_cost_str = ""
self.min_cost... |
self.sort_column = None
self.sort_ascending = True
@rx.event
def close_filter_dropdowns(self):
self.show_status_filter = False
self.show_region_filter = False
self.show_costs_filter = False
@rx.event
def download_csv(self):
"""Download the filtered and ... | self.selected_rows = set() |
self.temp_selected_regions = set()
self.selected_regions = set()
self.show_region_filter = False
self.current_page = 1
@rx.event
def reset_costs_filter(self):
self.temp_min_cost_str = ""
self.temp_max_cost_str = ""
self.min_cost = None
self.max_cost = Non... |
self.sort_ascending = True
@rx.event
def close_filter_dropdowns(self):
self.show_status_filter = False
self.show_region_filter = False
self.show_costs_filter = False
@rx.event
def download_csv(self):
"""Download the filtered and sorted data as CSV."""
d... | self.sort_column = None |
()
self.selected_regions = set()
self.show_region_filter = False
self.current_page = 1
@rx.event
def reset_costs_filter(self):
self.temp_min_cost_str = ""
self.temp_max_cost_str = ""
self.min_cost = None
self.max_cost = None
self.show_costs_filter... |
@rx.event
def close_filter_dropdowns(self):
self.show_status_filter = False
self.show_region_filter = False
self.show_costs_filter = False
@rx.event
def download_csv(self):
"""Download the filtered and sorted data as CSV."""
df = pd.DataFrame(self.filtered_and_... | self.sort_ascending = True |
self.show_region_filter = False
self.current_page = 1
@rx.event
def reset_costs_filter(self):
self.temp_min_cost_str = ""
self.temp_max_cost_str = ""
self.min_cost = None
self.max_cost = None
self.show_costs_filter = False
self.current_page = 1
@r... |
@rx.event
def download_csv(self):
"""Download the filtered and sorted data as CSV."""
df = pd.DataFrame(self.filtered_and_sorted_data)
display_columns = [
col.lower().replace(" ", "_") for col in self.column_names if col != "Edit"
]
if "last_edited" not in d... | def close_filter_dropdowns(self):
self.show_status_filter = False
self.show_region_filter = False
self.show_costs_filter = False |
self.current_page = 1
@rx.event
def reset_costs_filter(self):
self.temp_min_cost_str = ""
self.temp_max_cost_str = ""
self.min_cost = None
self.max_cost = None
self.show_costs_filter = False
self.current_page = 1
@rx.event
def reset_all_filters(self):
... |
self.show_region_filter = False
self.show_costs_filter = False
@rx.event
def download_csv(self):
"""Download the filtered and sorted data as CSV."""
df = pd.DataFrame(self.filtered_and_sorted_data)
display_columns = [
col.lower().replace(" ", "_") for col in... | self.show_status_filter = False |
def reset_costs_filter(self):
self.temp_min_cost_str = ""
self.temp_max_cost_str = ""
self.min_cost = None
self.max_cost = None
self.show_costs_filter = False
self.current_page = 1
@rx.event
def reset_all_filters(self):
"""Reset all filters and search."... |
self.show_costs_filter = False
@rx.event
def download_csv(self):
"""Download the filtered and sorted data as CSV."""
df = pd.DataFrame(self.filtered_and_sorted_data)
display_columns = [
col.lower().replace(" ", "_") for col in self.column_names if col != "Edit"
... | self.show_region_filter = False |
self.temp_min_cost_str = ""
self.temp_max_cost_str = ""
self.min_cost = None
self.max_cost = None
self.show_costs_filter = False
self.current_page = 1
@rx.event
def reset_all_filters(self):
"""Reset all filters and search."""
self.search_owner = ""
... |
@rx.event
def download_csv(self):
"""Download the filtered and sorted data as CSV."""
df = pd.DataFrame(self.filtered_and_sorted_data)
display_columns = [
col.lower().replace(" ", "_") for col in self.column_names if col != "Edit"
]
if "last_edited" not in d... | self.show_costs_filter = False |
cost_str = ""
self.min_cost = None
self.max_cost = None
self.show_costs_filter = False
self.current_page = 1
@rx.event
def reset_all_filters(self):
"""Reset all filters and search."""
self.search_owner = ""
self.selected_statuses = set()
self.sele... | def download_csv(self):
"""Download the filtered and sorted data as CSV."""
df = pd.DataFrame(self.filtered_and_sorted_data)
display_columns = [
col.lower().replace(" ", "_") for col in self.column_names if col != "Edit"
]
if "last_edited" not in df.columns and "last_... | |
sts_filter = False
self.current_page = 1
@rx.event
def reset_all_filters(self):
"""Reset all filters and search."""
self.search_owner = ""
self.selected_statuses = set()
self.selected_regions = set()
self.min_cost = None
self.max_cost = None
self.... |
display_columns = [
col.lower().replace(" ", "_") for col in self.column_names if col != "Edit"
]
if "last_edited" not in df.columns and "last_edited" in display_columns:
display_columns.remove("last_edited")
if "costs" in df.columns and "costs" in display_column... | df = pd.DataFrame(self.filtered_and_sorted_data) |
.event
def reset_all_filters(self):
"""Reset all filters and search."""
self.search_owner = ""
self.selected_statuses = set()
self.selected_regions = set()
self.min_cost = None
self.max_cost = None
self.temp_selected_statuses = set()
self.temp_selected... |
if "last_edited" not in df.columns and "last_edited" in display_columns:
display_columns.remove("last_edited")
if "costs" in df.columns and "costs" in display_columns:
pass
column_mapping = {
"owner": "Owner",
"status": "Status",
"regi... | display_columns = [
col.lower().replace(" ", "_") for col in self.column_names if col != "Edit"
] |
f.selected_statuses = set()
self.selected_regions = set()
self.min_cost = None
self.max_cost = None
self.temp_selected_statuses = set()
self.temp_selected_regions = set()
self.temp_min_cost_str = ""
self.temp_max_cost_str = ""
self.show_status_filter = Fal... |
if "costs" in df.columns and "costs" in display_columns:
pass
column_mapping = {
"owner": "Owner",
"status": "Status",
"region": "Region",
"stability": "Stability",
"costs": "Costs",
"last_edited": "Last edited",
... | if "last_edited" not in df.columns and "last_edited" in display_columns:
display_columns.remove("last_edited") |
self.temp_selected_statuses = set()
self.temp_selected_regions = set()
self.temp_min_cost_str = ""
self.temp_max_cost_str = ""
self.show_status_filter = False
self.show_region_filter = False
self.show_costs_filter = False
self.current_page = 1
self.select... |
column_mapping = {
"owner": "Owner",
"status": "Status",
"region": "Region",
"stability": "Stability",
"costs": "Costs",
"last_edited": "Last edited",
}
df_display = df[[key for key in column_mapping if key in df.columns]]
... | if "costs" in df.columns and "costs" in display_columns:
pass |
self.temp_min_cost_str = ""
self.temp_max_cost_str = ""
self.show_status_filter = False
self.show_region_filter = False
self.show_costs_filter = False
self.current_page = 1
self.selected_rows = set()
self.sort_column = None
self.sort_ascending = True... |
df_display = df[[key for key in column_mapping if key in df.columns]]
df_display.columns = [column_mapping[col] for col in df_display.columns]
stream = io.StringIO()
df_display.to_csv(stream, index=False)
return rx.download(
data=stream.getvalue(),
filena... | column_mapping = {
"owner": "Owner",
"status": "Status",
"region": "Region",
"stability": "Stability",
"costs": "Costs",
"last_edited": "Last edited",
} |
rows = set()
self.sort_column = None
self.sort_ascending = True
@rx.event
def close_filter_dropdowns(self):
self.show_status_filter = False
self.show_region_filter = False
self.show_costs_filter = False
@rx.event
def download_csv(self):
"""Download the f... |
df_display.columns = [column_mapping[col] for col in df_display.columns]
stream = io.StringIO()
df_display.to_csv(stream, index=False)
return rx.download(
data=stream.getvalue(),
filename="details_export.csv",
)
| df_display = df[[key for key in column_mapping if key in df.columns]] |
e
@rx.event
def close_filter_dropdowns(self):
self.show_status_filter = False
self.show_region_filter = False
self.show_costs_filter = False
@rx.event
def download_csv(self):
"""Download the filtered and sorted data as CSV."""
df = pd.DataFrame(self.filtered_and... |
stream = io.StringIO()
df_display.to_csv(stream, index=False)
return rx.download(
data=stream.getvalue(),
filename="details_export.csv",
)
| df_display.columns = [column_mapping[col] for col in df_display.columns] |
ilter = False
self.show_region_filter = False
self.show_costs_filter = False
@rx.event
def download_csv(self):
"""Download the filtered and sorted data as CSV."""
df = pd.DataFrame(self.filtered_and_sorted_data)
display_columns = [
col.lower().replace(" ", "_... |
df_display.to_csv(stream, index=False)
return rx.download(
data=stream.getvalue(),
filename="details_export.csv",
)
| stream = io.StringIO() |
from text_annotation_app.components.ner_display import ner_component
from text_annotation_app.states.ner_state import NerState
def index() -> rx.Component:
"""The main page of the app."""
return rx.el.div(
ner_component(),
on_mount=NerState.process_text_on_load,
class_name="min-h-scr... | import reflex as rx | |
import reflex as rx
from text_annotation_app.states.ner_state import (
EntityInfo,
NerState,
Segment,
)
def entity_button(entity: EntityInfo) -> rx.Component:
"""Creates a button for an entity type with a remove option."""
is_selected = NerState.selected_label_name == entity["name"]
base_cl... | from typing import Tuple | |
from typing import Tuple
|
from text_annotation_app.states.ner_state import (
EntityInfo,
NerState,
Segment,
)
def entity_button(entity: EntityInfo) -> rx.Component:
"""Creates a button for an entity type with a remove option."""
is_selected = NerState.selected_label_name == entity["name"]
base_classes = f"px-3 py-1 {... | import reflex as rx |
from typing import Tuple
import reflex as rx
|
def entity_button(entity: EntityInfo) -> rx.Component:
"""Creates a button for an entity type with a remove option."""
is_selected = NerState.selected_label_name == entity["name"]
base_classes = f"px-3 py-1 {entity['color']} {entity['text_color']} rounded-md text-sm flex items-center transition-all durat... | from text_annotation_app.states.ner_state import (
EntityInfo,
NerState,
Segment,
) |
from typing import Tuple
import reflex as rx
from text_annotation_app.states.ner_state import (
EntityInfo,
NerState,
Segment,
)
def entity_button(entity: EntityInfo) -> rx.Component:
"""Creates a button for an entity type with a remove option."""
|
base_classes = f"px-3 py-1 {entity['color']} {entity['text_color']} rounded-md text-sm flex items-center transition-all duration-150 ease-in-out"
selected_class_str = f"{base_classes} scale-105 shadow-md border-2 border-black"
unselected_class_str = (
f"{base_classes} hover:scale-105 shadow-sm bord... | is_selected = NerState.selected_label_name == entity["name"] |
from typing import Tuple
import reflex as rx
from text_annotation_app.states.ner_state import (
EntityInfo,
NerState,
Segment,
)
def entity_button(entity: EntityInfo) -> rx.Component:
"""Creates a button for an entity type with a remove option."""
is_selected = NerState.selected_label_name == en... |
selected_class_str = f"{base_classes} scale-105 shadow-md border-2 border-black"
unselected_class_str = (
f"{base_classes} hover:scale-105 shadow-sm border-2 border-transparent"
)
return rx.el.div(
rx.el.span(
entity["name"],
class_name="font-semibold mr-2 cursor... | base_classes = f"px-3 py-1 {entity['color']} {entity['text_color']} rounded-md text-sm flex items-center transition-all duration-150 ease-in-out" |
from typing import Tuple
import reflex as rx
from text_annotation_app.states.ner_state import (
EntityInfo,
NerState,
Segment,
)
def entity_button(entity: EntityInfo) -> rx.Component:
"""Creates a button for an entity type with a remove option."""
is_selected = NerState.selected_label_name == en... |
unselected_class_str = (
f"{base_classes} hover:scale-105 shadow-sm border-2 border-transparent"
)
return rx.el.div(
rx.el.span(
entity["name"],
class_name="font-semibold mr-2 cursor-pointer flex-grow",
on_click=lambda: NerState.select_label(entity["name"... | selected_class_str = f"{base_classes} scale-105 shadow-md border-2 border-black" |
from typing import Tuple
import reflex as rx
from text_annotation_app.states.ner_state import (
EntityInfo,
NerState,
Segment,
)
def entity_button(entity: EntityInfo) -> rx.Component:
"""Creates a button for an entity type with a remove option."""
is_selected = NerState.selected_label_name == en... |
return rx.el.div(
rx.el.span(
entity["name"],
class_name="font-semibold mr-2 cursor-pointer flex-grow",
on_click=lambda: NerState.select_label(entity["name"]),
),
rx.el.button(
"X",
on_click=lambda: NerState.remove_label(entity["na... | unselected_class_str = (
f"{base_classes} hover:scale-105 shadow-sm border-2 border-transparent"
) |
mibold mr-2 cursor-pointer flex-grow",
on_click=lambda: NerState.select_label(entity["name"]),
),
rx.el.button(
"X",
on_click=lambda: NerState.remove_label(entity["name"]),
class_name="ml-1 text-xs font-bold text-black/50 hover:text-black p-0.5 rounded-ful... |
is_selected = NerState.new_label_selected_color_index == index
base_class = "w-6 h-6 rounded cursor-pointer transition-all duration-150 ease-in-out border-2"
selected_class = f"{base_class} border-black scale-110"
unselected_class = f"{base_class} border-transparent hover:scale-105"
return rx.el.di... | bg_color = color_pair[0] |
ex-grow",
on_click=lambda: NerState.select_label(entity["name"]),
),
rx.el.button(
"X",
on_click=lambda: NerState.remove_label(entity["name"]),
class_name="ml-1 text-xs font-bold text-black/50 hover:text-black p-0.5 rounded-full w-4 h-4 flex items-center j... |
base_class = "w-6 h-6 rounded cursor-pointer transition-all duration-150 ease-in-out border-2"
selected_class = f"{base_class} border-black scale-110"
unselected_class = f"{base_class} border-transparent hover:scale-105"
return rx.el.div(
class_name=rx.cond(
is_selected,
... | is_selected = NerState.new_label_selected_color_index == index |
["name"]),
),
rx.el.button(
"X",
on_click=lambda: NerState.remove_label(entity["name"]),
class_name="ml-1 text-xs font-bold text-black/50 hover:text-black p-0.5 rounded-full w-4 h-4 flex items-center justify-center leading-none bg-white/40 hover:bg-white/70 transition... |
selected_class = f"{base_class} border-black scale-110"
unselected_class = f"{base_class} border-transparent hover:scale-105"
return rx.el.div(
class_name=rx.cond(
is_selected,
f"{selected_class} {bg_color}",
f"{unselected_class} {bg_color}",
),
o... | base_class = "w-6 h-6 rounded cursor-pointer transition-all duration-150 ease-in-out border-2" |
remove_label(entity["name"]),
class_name="ml-1 text-xs font-bold text-black/50 hover:text-black p-0.5 rounded-full w-4 h-4 flex items-center justify-center leading-none bg-white/40 hover:bg-white/70 transition-colors flex-shrink-0",
title=f"Remove {entity['name']} label",
),
clas... |
unselected_class = f"{base_class} border-transparent hover:scale-105"
return rx.el.div(
class_name=rx.cond(
is_selected,
f"{selected_class} {bg_color}",
f"{unselected_class} {bg_color}",
),
on_click=lambda: NerState.set_new_label_color_index(index),
... | selected_class = f"{base_class} border-black scale-110" |
ext-xs font-bold text-black/50 hover:text-black p-0.5 rounded-full w-4 h-4 flex items-center justify-center leading-none bg-white/40 hover:bg-white/70 transition-colors flex-shrink-0",
title=f"Remove {entity['name']} label",
),
class_name=rx.cond(
is_selected,
selecte... |
return rx.el.div(
class_name=rx.cond(
is_selected,
f"{selected_class} {bg_color}",
f"{unselected_class} {bg_color}",
),
on_click=lambda: NerState.set_new_label_color_index(index),
title=f"Select {bg_color}",
)
def add_label_form() -> rx.Comp... | unselected_class = f"{base_class} border-transparent hover:scale-105" |
d mb-2 px-4",
),
),
rx.el.div(
rx.foreach(NerState.entities, entity_button),
rx.el.button(
"Download Annotations",
on_click=rx.download(
data=NerState.a... |
is_whitespace = segment["text"].strip() == ""
base_component = rx.el.span(segment["text"])
labeled_class = (
segment["bg_color"]
+ " "
+ segment["text_color"]
+ " py-0.5 rounded-sm cursor-pointer"
)
labeled_component = rx.el.span(
segment["text"],
rx.... | is_label_selected = NerState.selected_label_name is not None |
rx.el.div(
rx.foreach(NerState.entities, entity_button),
rx.el.button(
"Download Annotations",
on_click=rx.download(
data=NerState.annotated_text_json,
filename="annotat... |
base_component = rx.el.span(segment["text"])
labeled_class = (
segment["bg_color"]
+ " "
+ segment["text_color"]
+ " py-0.5 rounded-sm cursor-pointer"
)
labeled_component = rx.el.span(
segment["text"],
rx.el.span(
segment["label_name"],
... | is_whitespace = segment["text"].strip() == "" |
erState.entities, entity_button),
rx.el.button(
"Download Annotations",
on_click=rx.download(
data=NerState.annotated_text_json,
filename="annotated_text.json",
),
... |
labeled_class = (
segment["bg_color"]
+ " "
+ segment["text_color"]
+ " py-0.5 rounded-sm cursor-pointer"
)
labeled_component = rx.el.span(
segment["text"],
rx.el.span(
segment["label_name"],
class_name="text-[0.6rem] font-bold opacity... | base_component = rx.el.span(segment["text"]) |
rx.el.button(
"Download Annotations",
on_click=rx.download(
data=NerState.annotated_text_json,
filename="annotated_text.json",
),
class_name="bg-green-600 hover:bg... |
labeled_component = rx.el.span(
segment["text"],
rx.el.span(
segment["label_name"],
class_name="text-[0.6rem] font-bold opacity-70 align-super",
),
class_name=labeled_class,
title=segment["label_name"],
)
hoverable_component = rx.el.span(
... | labeled_class = (
segment["bg_color"]
+ " "
+ segment["text_color"]
+ " py-0.5 rounded-sm cursor-pointer"
) |
rState.annotated_text_json,
filename="annotated_text.json",
),
class_name="bg-green-600 hover:bg-green-700 text-white font-semibold px-3 py-1 rounded text-sm transition-colors shadow-sm ml-auto",
),
class... |
hoverable_component = rx.el.span(
segment["text"],
class_name="hover:bg-gray-200 rounded-sm cursor-pointer transition-colors",
)
styled_component = rx.cond(
segment["label_name"] is not None,
labeled_component,
rx.cond(
is_label_selected & ~is_whitespace,... | labeled_component = rx.el.span(
segment["text"],
rx.el.span(
segment["label_name"],
class_name="text-[0.6rem] font-bold opacity-70 align-super",
),
class_name=labeled_class,
title=segment["label_name"],
) |
orm(),
class_name="bg-gray-100 border-b border-gray-300 rounded-t-lg shadow-sm sticky top-0 z-10",
)
def render_segment(segment: Segment) -> rx.Component:
"""Renders a single text segment, making it clickable if a label is selected."""
is_label_selected = NerState.selected_label_name is not None
... |
on_click_event = rx.cond(
is_label_selected & ~is_whitespace,
NerState.apply_label(segment["id"]),
rx.noop(),
)
clickable_component = rx.el.span(
styled_component,
on_click=on_click_event,
class_name=rx.cond(segment["label_name"] is not None, "", "inline"),
... | styled_component = rx.cond(
segment["label_name"] is not None,
labeled_component,
rx.cond(
is_label_selected & ~is_whitespace,
hoverable_component,
base_component,
),
) |
cted."""
is_label_selected = NerState.selected_label_name is not None
is_whitespace = segment["text"].strip() == ""
base_component = rx.el.span(segment["text"])
labeled_class = (
segment["bg_color"]
+ " "
+ segment["text_color"]
+ " py-0.5 rounded-sm cursor-pointer"
)... |
clickable_component = rx.el.span(
styled_component,
on_click=on_click_event,
class_name=rx.cond(segment["label_name"] is not None, "", "inline"),
)
return clickable_component
def text_display() -> rx.Component:
"""Displays the processed text with highlighted entities."""
r... | on_click_event = rx.cond(
is_label_selected & ~is_whitespace,
NerState.apply_label(segment["id"]),
rx.noop(),
) |
rx.el.span(segment["text"])
labeled_class = (
segment["bg_color"]
+ " "
+ segment["text_color"]
+ " py-0.5 rounded-sm cursor-pointer"
)
labeled_component = rx.el.span(
segment["text"],
rx.el.span(
segment["label_name"],
class_name="tex... |
return clickable_component
def text_display() -> rx.Component:
"""Displays the processed text with highlighted entities."""
return rx.el.div(
rx.el.p(
rx.foreach(NerState.display_segments, render_segment),
class_name="text-lg text-gray-800 whitespace-pre-wrap",
),
... | clickable_component = rx.el.span(
styled_component,
on_click=on_click_event,
class_name=rx.cond(segment["label_name"] is not None, "", "inline"),
) |
an(
segment["text"],
rx.el.span(
segment["label_name"],
class_name="text-[0.6rem] font-bold opacity-70 align-super",
),
class_name=labeled_class,
title=segment["label_name"],
)
hoverable_component = rx.el.span(
segment["text"],
clas... |
def ner_component() -> rx.Component:
"""The main component combining the header and text display."""
return rx.el.div(
header_bar(),
text_display(),
class_name="max-w-5xl mx-auto my-8 shadow-lg rounded-lg font-sans",
)
| def text_display() -> rx.Component:
"""Displays the processed text with highlighted entities."""
return rx.el.div(
rx.el.p(
rx.foreach(NerState.display_segments, render_segment),
class_name="text-lg text-gray-800 whitespace-pre-wrap",
),
class_name="p-6 bg-white b... |
",
)
styled_component = rx.cond(
segment["label_name"] is not None,
labeled_component,
rx.cond(
is_label_selected & ~is_whitespace,
hoverable_component,
base_component,
),
)
on_click_event = rx.cond(
is_label_selected & ~is_whit... | def ner_component() -> rx.Component:
"""The main component combining the header and text display."""
return rx.el.div(
header_bar(),
text_display(),
class_name="max-w-5xl mx-auto my-8 shadow-lg rounded-lg font-sans",
) | |
import re
from typing import (
List,
Optional,
Tuple,
TypedDict,
)
import reflex as rx
_COLOR_CYCLE: List[Tuple[str, str]] = [
("bg-blue-500", "text-white"),
("bg-green-600", "text-white"),
("bg-red-500", "text-white"),
("bg-orange-500", "text-white"),
("bg-purple-500", "text-whit... | import json | |
import json
import re
|
import reflex as rx
_COLOR_CYCLE: List[Tuple[str, str]] = [
("bg-blue-500", "text-white"),
("bg-green-600", "text-white"),
("bg-red-500", "text-white"),
("bg-orange-500", "text-white"),
("bg-purple-500", "text-white"),
("bg-pink-500", "text-white"),
("bg-yellow-400", "text-black"),
("... | from typing import (
List,
Optional,
Tuple,
TypedDict,
) |
import json
import re
from typing import (
List,
Optional,
Tuple,
TypedDict,
)
|
_COLOR_CYCLE: List[Tuple[str, str]] = [
("bg-blue-500", "text-white"),
("bg-green-600", "text-white"),
("bg-red-500", "text-white"),
("bg-orange-500", "text-white"),
("bg-purple-500", "text-white"),
("bg-pink-500", "text-white"),
("bg-yellow-400", "text-black"),
("bg-teal-500", "text-w... | import reflex as rx |
import json
import re
from typing import (
List,
Optional,
Tuple,
TypedDict,
)
import reflex as rx
_COLOR_CYCLE: List[Tuple[str, str]] = [
("bg-blue-500", "text-white"),
("bg-green-600", "text-white"),
("bg-red-500", "text-white"),
("bg-orange-500", "text-white"),
("bg-purple-500",... |
class Segment(TypedDict):
id: int
text: str
label_name: str
bg_color: Optional[str]
text_color: Optional[str]
class NerState(rx.State):
"""State for the Named Entity Recognition display."""
_raw_text: str = 'Sia Kate Isobelle Furler (/\'siːə/ SEE-ə; born 18 December 1975) is an Austral... | class EntityInfo(TypedDict):
name: str
color: str
text_color: str
keywords: List[str] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.