id int64 1 6.07M | name stringlengths 1 295 | code stringlengths 12 426k | language stringclasses 1
value | source_file stringlengths 5 202 | start_line int64 1 158k | end_line int64 1 158k | repo dict |
|---|---|---|---|---|---|---|---|
1,801 | view_type | def view_type(self):
return "Run History Line Plot" | python | wandb/apis/reports/_panels.py | 221 | 222 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,802 | __init__ | def __init__(
self,
title=None,
x=None,
y=None,
z=None,
range_x=(None, None),
range_y=(None, None),
range_z=(None, None),
log_x=None,
log_y=None,
log_z=None,
running_ymin=None,
running_ymax=None,
running_ymean=None,
legend_template=None,
gradient=None,
font_size=None,
regression=None,
*args,
**kwargs,
):
super().__init__(*args, **kwargs)
self.title = title
self.x = x
self.y = y
self.z = z
self.range_x = range_x
self.range_y = range_y
self.range_z = range_z
self.log_x = log_x
self.log_y = log_y
self.log_z = log_z
self.running_ymin = running_ymin
self.running_ymax = running_ymax
self.running_ymean = running_ymean
self.legend_template = legend_template
self.gradient = gradient
self.font_size = font_size
self.regression = regression | python | wandb/apis/reports/_panels.py | 276 | 315 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,803 | x | def x(self):
json_path = self._get_path("x")
value = nested_get(self, json_path)
return self.panel_metrics_helper.special_back_to_front(value) | python | wandb/apis/reports/_panels.py | 318 | 321 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,804 | x | def x(self, value):
json_path = self._get_path("x")
value = self.panel_metrics_helper.special_front_to_back(value)
nested_set(self, json_path, value) | python | wandb/apis/reports/_panels.py | 324 | 327 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,805 | y | def y(self):
json_path = self._get_path("y")
value = nested_get(self, json_path)
return self.panel_metrics_helper.special_back_to_front(value) | python | wandb/apis/reports/_panels.py | 330 | 333 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,806 | y | def y(self, value):
json_path = self._get_path("y")
value = self.panel_metrics_helper.special_front_to_back(value)
nested_set(self, json_path, value) | python | wandb/apis/reports/_panels.py | 336 | 339 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,807 | z | def z(self):
json_path = self._get_path("z")
value = nested_get(self, json_path)
return self.panel_metrics_helper.special_back_to_front(value) | python | wandb/apis/reports/_panels.py | 342 | 345 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,808 | z | def z(self, value):
json_path = self._get_path("z")
value = self.panel_metrics_helper.special_front_to_back(value)
nested_set(self, json_path, value) | python | wandb/apis/reports/_panels.py | 348 | 351 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,809 | view_type | def view_type(self) -> str:
return "Scatter Plot" | python | wandb/apis/reports/_panels.py | 354 | 355 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,810 | __init__ | def __init__(
self,
title=None,
metrics=None,
orientation="h",
range_x=(None, None),
title_x=None,
title_y=None,
groupby=None,
groupby_aggfunc=None,
groupby_rangefunc=None,
max_runs_to_show=None,
max_bars_to_show=None,
custom_expressions=None,
legend_template=None,
font_size=None,
line_titles=None,
line_colors=None,
*args,
**kwargs,
):
super().__init__(*args, **kwargs)
self.title = title
self.metrics = metrics
self.orientation = orientation
self.range_x = range_x
self.title_x = title_x
self.title_y = title_y
self.groupby = groupby
self.groupby_aggfunc = groupby_aggfunc
self.groupby_rangefunc = groupby_rangefunc
self.max_runs_to_show = max_runs_to_show
self.max_bars_to_show = max_bars_to_show
self.custom_expressions = custom_expressions
self.legend_template = legend_template
self.font_size = font_size
self.line_titles = line_titles
self.line_colors = line_colors | python | wandb/apis/reports/_panels.py | 416 | 453 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,811 | metrics | def metrics(self):
json_path = self._get_path("metrics")
value = nested_get(self, json_path)
if value is None:
return value
return [self.panel_metrics_helper.back_to_front(v) for v in value] | python | wandb/apis/reports/_panels.py | 456 | 461 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,812 | metrics | def metrics(self, value):
json_path = self._get_path("metrics")
if value is not None:
if not isinstance(value, list):
value = [value]
value = [self.panel_metrics_helper.front_to_back(v) for v in value]
nested_set(self, json_path, value) | python | wandb/apis/reports/_panels.py | 464 | 470 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,813 | orientation | def orientation(self):
json_path = self._get_path("orientation")
value = nested_get(self, json_path)
return "v" if value is True else "h" | python | wandb/apis/reports/_panels.py | 473 | 476 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,814 | orientation | def orientation(self, value):
json_path = self._get_path("orientation")
value = True if value == "v" else False
nested_set(self, json_path, value) | python | wandb/apis/reports/_panels.py | 479 | 482 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,815 | view_type | def view_type(self) -> str:
return "Bar Chart" | python | wandb/apis/reports/_panels.py | 485 | 486 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,816 | __init__ | def __init__(
self,
title=None,
metric=None,
groupby_aggfunc=None,
groupby_rangefunc=None,
custom_expressions=None,
legend_template=None,
font_size=None,
*args,
**kwargs,
):
super().__init__(*args, **kwargs)
self.title = title
self.metric = coalesce(metric, "")
self.groupby_aggfunc = groupby_aggfunc
self.groupby_rangefunc = groupby_rangefunc
self.custom_expressions = custom_expressions
self.legend_template = legend_template
self.font_size = font_size | python | wandb/apis/reports/_panels.py | 514 | 533 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,817 | metric | def metric(self):
json_path = self._get_path("metric")
value = nested_get(self, json_path)[0]
return self.panel_metrics_helper.back_to_front(value) | python | wandb/apis/reports/_panels.py | 536 | 539 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,818 | metric | def metric(self, new_metrics):
json_path = self._get_path("metric")
new_metrics = self.panel_metrics_helper.front_to_back(new_metrics)
nested_set(self, json_path, [new_metrics]) | python | wandb/apis/reports/_panels.py | 542 | 545 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,819 | view_type | def view_type(self) -> str:
return "Scalar Chart" | python | wandb/apis/reports/_panels.py | 548 | 549 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,820 | __init__ | def __init__(self, diff=None, *args, **kwargs):
super().__init__(*args, **kwargs)
self.diff = diff | python | wandb/apis/reports/_panels.py | 558 | 560 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,821 | view_type | def view_type(self) -> str:
return "Code Comparer" | python | wandb/apis/reports/_panels.py | 563 | 564 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,822 | __init__ | def __init__(self, columns=None, title=None, font_size=None, *args, **kwargs):
super().__init__(*args, **kwargs)
self.columns = coalesce(columns, [])
self.title = title
self.font_size = font_size | python | wandb/apis/reports/_panels.py | 583 | 587 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,823 | columns | def columns(self):
json_path = self._get_path("columns")
specs = nested_get(self, json_path)
return [PCColumn.from_json(cspec) for cspec in specs] | python | wandb/apis/reports/_panels.py | 590 | 593 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,824 | columns | def columns(self, new_columns):
json_path = self._get_path("columns")
cols = []
for c in new_columns:
if isinstance(c, PCColumn):
cols.append(c)
else:
cols.append(PCColumn(c))
specs = [c.spec for c in cols]
nested_set(self, json_path, specs) | python | wandb/apis/reports/_panels.py | 596 | 605 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,825 | view_type | def view_type(self) -> str:
return "Parallel Coordinates Plot" | python | wandb/apis/reports/_panels.py | 608 | 609 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,826 | __init__ | def __init__(self, with_respect_to=None, *args, **kwargs):
super().__init__(*args, **kwargs)
self.with_respect_to = coalesce(with_respect_to, "Created Timestamp") | python | wandb/apis/reports/_panels.py | 615 | 617 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,827 | with_respect_to | def with_respect_to(self):
json_path = self._get_path("with_respect_to")
value = nested_get(self, json_path)
return self.panel_metrics_helper.back_to_front(value) | python | wandb/apis/reports/_panels.py | 620 | 623 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,828 | with_respect_to | def with_respect_to(self, value):
json_path = self._get_path("with_respect_to")
value = self.panel_metrics_helper.front_to_back(value)
nested_set(self, json_path, value) | python | wandb/apis/reports/_panels.py | 626 | 629 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,829 | view_type | def view_type(self) -> str:
return "Parameter Importance" | python | wandb/apis/reports/_panels.py | 632 | 633 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,830 | __init__ | def __init__(self, diff_only=None, *args, **kwargs):
super().__init__(*args, **kwargs)
self.diff_only = diff_only | python | wandb/apis/reports/_panels.py | 637 | 639 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,831 | view_type | def view_type(self) -> str:
return "Run Comparer" | python | wandb/apis/reports/_panels.py | 647 | 648 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,832 | __init__ | def __init__(self, num_columns=None, media_keys=None, *args, **kwargs):
super().__init__(*args, **kwargs)
self.num_columns = num_columns
self.media_keys = media_keys | python | wandb/apis/reports/_panels.py | 674 | 677 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,833 | view_type | def view_type(self) -> str:
return "Media Browser" | python | wandb/apis/reports/_panels.py | 680 | 681 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,834 | __init__ | def __init__(self, markdown=None, *args, **kwargs):
super().__init__(*args, **kwargs)
self.markdown = markdown | python | wandb/apis/reports/_panels.py | 687 | 689 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,835 | view_type | def view_type(self) -> str:
return "Markdown Panel" | python | wandb/apis/reports/_panels.py | 692 | 693 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,836 | view_type | def view_type(self) -> str:
return "Confusion Matrix" | python | wandb/apis/reports/_panels.py | 698 | 699 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,837 | view_type | def view_type(self) -> str:
return "Data Frame Table" | python | wandb/apis/reports/_panels.py | 704 | 705 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,838 | view_type | def view_type(self) -> str:
return "Multi Run Table" | python | wandb/apis/reports/_panels.py | 710 | 711 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,839 | view_type | def view_type(self) -> str:
return "Vega" | python | wandb/apis/reports/_panels.py | 716 | 717 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,840 | __init__ | def __init__(self, query=None, chart_name="", user_fields=None, *args, **kwargs):
super().__init__(*args, **kwargs)
self.spec["config"] = {"transform": {"name": "tableWithLeafColNames"}}
self.query = coalesce(query, {})
self.chart_name = chart_name
self.user_fields = coalesce(user_fields, {}) | python | wandb/apis/reports/_panels.py | 725 | 730 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,841 | view_type | def view_type(self) -> str:
return "Vega2" | python | wandb/apis/reports/_panels.py | 733 | 734 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,842 | query | def query(self):
d = nested_get(self, self._get_path("query"))
fields = d[0]["fields"]
query = {o["name"]: o.get("args") for o in fields}
query = {
k: v[0]["value"] if v is not None else None
for k, v in query.items()
if k not in ("id", "name")
}
return query | python | wandb/apis/reports/_panels.py | 737 | 746 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,843 | query | def query(self, d):
def make_fields(d):
fields = []
for k, v in d.items():
if v is None:
field = {"name": k, "fields": []}
else:
field = {
"name": k,
"fields": [],
"args": [{"name": "keys", "value": v}],
}
fields.append(field)
if "id" not in d:
fields.append({"name": "id", "fields": []})
if "name" not in d:
fields.append({"name": "name", "fields": []})
return fields
query = {
"args": [
{"name": "runSets", "value": "${runSets}"},
{"name": "limit", "value": 500},
],
"name": "runSets",
}
query["fields"] = make_fields(d)
query = [query]
nested_set(self, self._get_path("query"), query) | python | wandb/apis/reports/_panels.py | 749 | 777 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,844 | make_fields | def make_fields(d):
fields = []
for k, v in d.items():
if v is None:
field = {"name": k, "fields": []}
else:
field = {
"name": k,
"fields": [],
"args": [{"name": "keys", "value": v}],
}
fields.append(field)
if "id" not in d:
fields.append({"name": "id", "fields": []})
if "name" not in d:
fields.append({"name": "name", "fields": []})
return fields | python | wandb/apis/reports/_panels.py | 750 | 766 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,845 | view_type | def view_type(self) -> str:
return "Vega3" | python | wandb/apis/reports/_panels.py | 782 | 783 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,846 | view_type | def view_type(self) -> str:
return "Weave" | python | wandb/apis/reports/_panels.py | 788 | 789 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,847 | __init__ | def __init__(self, table_name, *args, **kwargs):
super().__init__(*args, **kwargs)
self._spec["config"] = self._default_config()
self.table_name = table_name | python | wandb/apis/reports/_panels.py | 797 | 800 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,848 | from_json | def from_json(cls, spec):
table_name = spec["config"]["panel2Config"]["exp"]["fromOp"]["inputs"]["key"][
"val"
]
return cls(table_name) | python | wandb/apis/reports/_panels.py | 803 | 807 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,849 | view_type | def view_type(self) -> str:
return "Weave" | python | wandb/apis/reports/_panels.py | 810 | 811 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,850 | _default_config | def _default_config():
return {
"panel2Config": {
"exp": {
"nodeType": "output",
"type": {
"type": "tagged",
"tag": {
"type": "tagged",
"tag": {
"type": "typedDict",
"propertyTypes": {
"entityName": "string",
"projectName": "string",
},
},
"value": {
"type": "typedDict",
"propertyTypes": {
"project": "project",
"filter": "string",
"order": "string",
},
},
},
"value": {
"type": "list",
"objectType": {
"type": "tagged",
"tag": {
"type": "typedDict",
"propertyTypes": {"run": "run"},
},
"value": {
"type": "union",
"members": [
{
"type": "file",
"extension": "json",
"wbObjectType": {
"type": "table",
"columnTypes": {},
},
},
"none",
],
},
},
"maxLength": 50,
},
},
"fromOp": {
"name": "pick",
"inputs": {
"obj": {
"nodeType": "output",
"type": {
"type": "tagged",
"tag": {
"type": "tagged",
"tag": {
"type": "typedDict",
"propertyTypes": {
"entityName": "string",
"projectName": "string",
},
},
"value": {
"type": "typedDict",
"propertyTypes": {
"project": "project",
"filter": "string",
"order": "string",
},
},
},
"value": {
"type": "list",
"objectType": {
"type": "tagged",
"tag": {
"type": "typedDict",
"propertyTypes": {"run": "run"},
},
"value": {
"type": "union",
"members": [
{
"type": "typedDict",
"propertyTypes": {
"_wandb": {
"type": "typedDict",
"propertyTypes": {
"runtime": "number"
},
}
},
},
{
"type": "typedDict",
"propertyTypes": {
"_step": "number",
"table": {
"type": "file",
"extension": "json",
"wbObjectType": {
"type": "table",
"columnTypes": {},
},
},
"_wandb": {
"type": "typedDict",
"propertyTypes": {
"runtime": "number"
},
},
"_runtime": "number",
"_timestamp": "number",
},
},
],
},
},
"maxLength": 50,
},
},
"fromOp": {
"name": "run-summary",
"inputs": {
"run": {
"nodeType": "var",
"type": {
"type": "tagged",
"tag": {
"type": "tagged",
"tag": {
"type": "typedDict",
"propertyTypes": {
"entityName": "string",
"projectName": "string",
},
},
"value": {
"type": "typedDict",
"propertyTypes": {
"project": "project",
"filter": "string",
"order": "string",
},
},
},
"value": {
"type": "list",
"objectType": "run",
"maxLength": 50,
},
},
"varName": "runs",
}
},
},
},
"key": {
"nodeType": "const",
"type": "string",
"val": "",
},
},
},
"__userInput": True,
}
}
} | python | wandb/apis/reports/_panels.py | 814 | 986 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,851 | __init__ | def __init__(self, artifact, tab="overview", *args, **kwargs):
super().__init__(*args, **kwargs)
self._spec["config"] = self._default_config()
self.artifact = artifact
self.tab = tab | python | wandb/apis/reports/_panels.py | 998 | 1,002 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,852 | from_json | def from_json(cls, spec):
artifact = spec["config"]["panel2Config"]["exp"]["fromOp"]["inputs"][
"artifactName"
]["val"]
tab = spec["config"]["panel2Config"]["panelConfig"]["tabConfigs"]["overview"][
"selectedTab"
]
return cls(artifact, tab) | python | wandb/apis/reports/_panels.py | 1,005 | 1,012 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,853 | view_type | def view_type(self) -> str:
return "Weave" | python | wandb/apis/reports/_panels.py | 1,015 | 1,016 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,854 | _default_config | def _default_config():
return {
"panel2Config": {
"exp": {
"nodeType": "output",
"type": {
"type": "tagged",
"tag": {
"type": "tagged",
"tag": {
"type": "typedDict",
"propertyTypes": {
"entityName": "string",
"projectName": "string",
},
},
"value": {
"type": "typedDict",
"propertyTypes": {
"project": "project",
"artifactName": "string",
},
},
},
"value": "artifact",
},
"fromOp": {
"name": "project-artifact",
"inputs": {
"project": {
"nodeType": "var",
"type": {
"type": "tagged",
"tag": {
"type": "typedDict",
"propertyTypes": {
"entityName": "string",
"projectName": "string",
},
},
"value": "project",
},
"varName": "project",
},
"artifactName": {
"nodeType": "const",
"type": "string",
"val": "",
},
},
},
"__userInput": True,
},
"panelInputType": {
"type": "tagged",
"tag": {
"type": "tagged",
"tag": {
"type": "typedDict",
"propertyTypes": {
"entityName": "string",
"projectName": "string",
},
},
"value": {
"type": "typedDict",
"propertyTypes": {
"project": "project",
"artifactName": "string",
},
},
},
"value": "artifact",
},
"panelConfig": {
"tabConfigs": {"overview": {"selectedTab": "overview"}}
},
}
} | python | wandb/apis/reports/_panels.py | 1,019 | 1,097 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,855 | __init__ | def __init__(self, artifact, version, file, *args, **kwargs):
super().__init__(*args, **kwargs)
self._spec["config"] = self._default_config()
self.artifact = artifact
self.version = version
self.file = file | python | wandb/apis/reports/_panels.py | 1,109 | 1,114 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,856 | from_json | def from_json(cls, spec):
artifact = spec["config"]["panel2Config"]["exp"]["fromOp"]["inputs"][
"artifactVersion"
]["fromOp"]["inputs"]["artifactName"]["val"]
version = spec["config"]["panel2Config"]["exp"]["fromOp"]["inputs"][
"artifactVersion"
]["fromOp"]["inputs"]["artifactVersionAlias"]["val"]
file = spec["config"]["panel2Config"]["exp"]["fromOp"]["inputs"]["path"]["val"]
return cls(artifact, version, file) | python | wandb/apis/reports/_panels.py | 1,117 | 1,125 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,857 | view_type | def view_type(self) -> str:
return "Weave" | python | wandb/apis/reports/_panels.py | 1,128 | 1,129 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,858 | _default_config | def _default_config():
return {
"panel2Config": {
"exp": {
"nodeType": "output",
"type": {
"type": "tagged",
"tag": {
"type": "tagged",
"tag": {
"type": "typedDict",
"propertyTypes": {
"entityName": "string",
"projectName": "string",
},
},
"value": {
"type": "typedDict",
"propertyTypes": {
"project": "project",
"artifactName": "string",
"artifactVersionAlias": "string",
},
},
},
"value": {
"type": "file",
"extension": "json",
"wbObjectType": {"type": "table", "columnTypes": {}},
},
},
"fromOp": {
"name": "artifactVersion-file",
"inputs": {
"artifactVersion": {
"nodeType": "output",
"type": {
"type": "tagged",
"tag": {
"type": "tagged",
"tag": {
"type": "typedDict",
"propertyTypes": {
"entityName": "string",
"projectName": "string",
},
},
"value": {
"type": "typedDict",
"propertyTypes": {
"project": "project",
"artifactName": "string",
"artifactVersionAlias": "string",
},
},
},
"value": "artifactVersion",
},
"fromOp": {
"name": "project-artifactVersion",
"inputs": {
"project": {
"nodeType": "var",
"type": {
"type": "tagged",
"tag": {
"type": "typedDict",
"propertyTypes": {
"entityName": "string",
"projectName": "string",
},
},
"value": "project",
},
"varName": "project",
},
"artifactName": {
"nodeType": "const",
"type": "string",
"val": "",
},
"artifactVersionAlias": {
"nodeType": "const",
"type": "string",
"val": "",
},
},
},
},
"path": {"nodeType": "const", "type": "string", "val": ""},
},
},
"__userInput": True,
}
}
} | python | wandb/apis/reports/_panels.py | 1,132 | 1,227 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,859 | __init__ | def __init__(
self,
runsets=None,
panels=None,
custom_run_colors=None,
active_runset=None,
*args,
**kwargs,
):
super().__init__(*args, **kwargs)
self._spec = self._default_panel_grid_spec()
self.runsets = coalesce(runsets, self._default_runsets())
self.panels = coalesce(panels, self._default_panels())
self.custom_run_colors = coalesce(custom_run_colors, {})
self.active_runset = active_runset | python | wandb/apis/reports/_blocks.py | 51 | 65 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,860 | active_runset | def active_runset(self):
json_path = self._get_path("active_runset")
index = nested_get(self, json_path)
if index is None:
return None
else:
return self.runsets[index].name | python | wandb/apis/reports/_blocks.py | 68 | 74 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,861 | active_runset | def active_runset(self, name):
json_path = self._get_path("active_runset")
index = None
for i, rs in enumerate(self.runsets):
if rs.name == name:
index = i
break
nested_set(self, json_path, index) | python | wandb/apis/reports/_blocks.py | 77 | 84 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,862 | panels | def panels(self):
json_path = self._get_path("panels")
specs = nested_get(self, json_path)
panels = []
for pspec in specs:
cls = panel_mapping.get(pspec["viewType"], UnknownPanel)
if cls is UnknownPanel:
termwarn(
inspect.cleandoc(
f"""
UNKNOWN PANEL DETECTED
This can happen if we have added new panels, but you are using an older version of the SDK.
If your report is loading normally, you can safely ignore this message (but we recommend not touching UnknownPanel)
If you think this is an error, please file a bug report including your SDK version ({wandb_ver}) and this spec ({pspec})
"""
)
)
if cls is WeavePanel:
for cls in weave_panels:
try:
cls.from_json(pspec)
except Exception:
pass
else:
break
panels.append(cls.from_json(pspec))
return panels | python | wandb/apis/reports/_blocks.py | 87 | 113 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,863 | panels | def panels(self, new_panels):
json_path = self._get_path("panels")
new_specs = [p.spec for p in fix_collisions(new_panels)]
nested_set(self, json_path, new_specs) | python | wandb/apis/reports/_blocks.py | 116 | 119 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,864 | runsets | def runsets(self):
json_path = self._get_path("runsets")
specs = nested_get(self, json_path)
return [Runset.from_json(spec) for spec in specs] | python | wandb/apis/reports/_blocks.py | 122 | 125 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,865 | runsets | def runsets(self, new_runsets):
json_path = self._get_path("runsets")
new_specs = [rs.spec for rs in new_runsets]
nested_set(self, json_path, new_specs) | python | wandb/apis/reports/_blocks.py | 128 | 131 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,866 | custom_run_colors | def custom_run_colors(self):
json_path = self._get_path("custom_run_colors")
id_colors = nested_get(self, json_path)
def is_groupid(s):
for rs in self.runsets:
if rs.spec["id"] in s:
return True
return False
def groupid_to_ordertuple(groupid):
rs = self.runsets[0]
if "-run:" in groupid:
id, rest = groupid.split("-run:", 1)
else:
id, rest = groupid.split("-", 1)
kvs = rest.split("-")
kvs = [rs.pm_query_generator.pc_back_to_front(v) for v in kvs]
keys, ordertuple = zip(*[kv.split(":") for kv in kvs])
rs_name = self._get_rs_by_id(id).name
return (rs_name, *ordertuple)
def run_id_to_name(id):
for rs in self.runsets:
try:
run = PublicApi().run(f"{rs.entity}/{rs.project}/{id}")
except Exception:
pass
else:
return run.name
raise ValueError("Unable to find this run!")
color_settings = {}
for id, c in id_colors.items():
if id == "ref":
continue
if is_groupid(id):
key = groupid_to_ordertuple(id)
else:
key = run_id_to_name(id)
color_settings[key] = c
return color_settings | python | wandb/apis/reports/_blocks.py | 134 | 175 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,867 | is_groupid | def is_groupid(s):
for rs in self.runsets:
if rs.spec["id"] in s:
return True
return False | python | wandb/apis/reports/_blocks.py | 138 | 142 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,868 | groupid_to_ordertuple | def groupid_to_ordertuple(groupid):
rs = self.runsets[0]
if "-run:" in groupid:
id, rest = groupid.split("-run:", 1)
else:
id, rest = groupid.split("-", 1)
kvs = rest.split("-")
kvs = [rs.pm_query_generator.pc_back_to_front(v) for v in kvs]
keys, ordertuple = zip(*[kv.split(":") for kv in kvs])
rs_name = self._get_rs_by_id(id).name
return (rs_name, *ordertuple) | python | wandb/apis/reports/_blocks.py | 144 | 154 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,869 | run_id_to_name | def run_id_to_name(id):
for rs in self.runsets:
try:
run = PublicApi().run(f"{rs.entity}/{rs.project}/{id}")
except Exception:
pass
else:
return run.name
raise ValueError("Unable to find this run!") | python | wandb/apis/reports/_blocks.py | 156 | 164 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,870 | custom_run_colors | def custom_run_colors(self, new_custom_run_colors):
json_path = self._get_path("custom_run_colors")
color_settings = {}
def ordertuple_to_groupid(ordertuple):
rs_name, rest = ordertuple[0], ordertuple[1:]
rs = self._get_rs_by_name(rs_name)
id = rs.spec["id"]
keys = [rs.pm_query_generator.pc_front_to_back(k) for k in rs.groupby]
kvs = [f"{k}:{v}" for k, v in zip(keys, rest)]
linked = "-".join(kvs)
return f"{id}-{linked}"
def run_name_to_id(name):
for rs in self.runsets:
runs = PublicApi().runs(
path=f"{rs.entity}/{rs.project}", filters={"display_name": name}
)
if len(runs) > 1:
termwarn(
"Multiple runs with the same name found! Using the first one."
)
for run in runs:
if run.name == name:
return run.id
raise ValueError("Unable to find this run!")
for name, c in new_custom_run_colors.items():
if isinstance(name, tuple):
key = ordertuple_to_groupid(name)
else:
key = run_name_to_id(name)
color_settings[key] = c
nested_set(self, json_path, color_settings) | python | wandb/apis/reports/_blocks.py | 178 | 211 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,871 | ordertuple_to_groupid | def ordertuple_to_groupid(ordertuple):
rs_name, rest = ordertuple[0], ordertuple[1:]
rs = self._get_rs_by_name(rs_name)
id = rs.spec["id"]
keys = [rs.pm_query_generator.pc_front_to_back(k) for k in rs.groupby]
kvs = [f"{k}:{v}" for k, v in zip(keys, rest)]
linked = "-".join(kvs)
return f"{id}-{linked}" | python | wandb/apis/reports/_blocks.py | 182 | 189 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,872 | run_name_to_id | def run_name_to_id(name):
for rs in self.runsets:
runs = PublicApi().runs(
path=f"{rs.entity}/{rs.project}", filters={"display_name": name}
)
if len(runs) > 1:
termwarn(
"Multiple runs with the same name found! Using the first one."
)
for run in runs:
if run.name == name:
return run.id
raise ValueError("Unable to find this run!") | python | wandb/apis/reports/_blocks.py | 191 | 203 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,873 | _get_rs_by_id | def _get_rs_by_id(self, id):
for rs in self.runsets:
if rs.spec["id"] == id:
return rs | python | wandb/apis/reports/_blocks.py | 213 | 216 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,874 | _get_rs_by_name | def _get_rs_by_name(self, name):
for rs in self.runsets:
if rs.name == name:
return rs | python | wandb/apis/reports/_blocks.py | 218 | 221 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,875 | _default_panel_grid_spec | def _default_panel_grid_spec():
return {
"type": "panel-grid",
"children": [{"text": ""}],
"metadata": {
"openViz": True,
"panels": {
"views": {"0": {"name": "Panels", "defaults": [], "config": []}},
"tabs": ["0"],
},
"panelBankConfig": {
"state": 0,
"settings": {
"autoOrganizePrefix": 2,
"showEmptySections": False,
"sortAlphabetically": False,
},
"sections": [
{
"name": "Hidden Panels",
"isOpen": False,
"panels": [],
"type": "flow",
"flowConfig": {
"snapToColumns": True,
"columnsPerPage": 3,
"rowsPerPage": 2,
"gutterWidth": 16,
"boxWidth": 460,
"boxHeight": 300,
},
"sorted": 0,
"localPanelSettings": {
"xAxis": "_step",
"smoothingWeight": 0,
"smoothingType": "exponential",
"ignoreOutliers": False,
"xAxisActive": False,
"smoothingActive": False,
},
}
],
},
"panelBankSectionConfig": {
"name": "Report Panels",
"isOpen": False,
"panels": [],
"type": "grid",
"flowConfig": {
"snapToColumns": True,
"columnsPerPage": 3,
"rowsPerPage": 2,
"gutterWidth": 16,
"boxWidth": 460,
"boxHeight": 300,
},
"sorted": 0,
"localPanelSettings": {
"xAxis": "_step",
"smoothingWeight": 0,
"smoothingType": "exponential",
"ignoreOutliers": False,
"xAxisActive": False,
"smoothingActive": False,
},
},
"customRunColors": {},
"runSets": [],
"openRunSet": 0,
"name": "unused-name",
},
} | python | wandb/apis/reports/_blocks.py | 224 | 295 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,876 | _default_runsets | def _default_runsets():
return [Runset()] | python | wandb/apis/reports/_blocks.py | 298 | 299 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,877 | _default_panels | def _default_panels():
return [] | python | wandb/apis/reports/_blocks.py | 302 | 303 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,878 | from_json | def from_json(cls, spec: dict) -> "Union[CheckedList, OrderedList, UnorderedList]":
items = []
for item in spec["children"]:
text = []
for elem in item["children"][0]["children"]:
if elem.get("type") == "latex":
text.append(InlineLaTeX(elem["content"]))
elif elem.get("type") == "link":
text.append(Link(elem["children"][0]["text"], elem["url"]))
elif elem.get("inlineCode"):
text.append(InlineCode(elem["text"]))
elif elem.get("text"):
text.append(elem["text"])
items.append(text)
checked = [item.get("checked") for item in spec["children"]]
ordered = spec.get("ordered")
# NAND: Either checked or ordered or neither (unordered), never both
if all(x is None for x in checked):
checked = None
if checked is not None and ordered is not None:
raise ValueError(
"Lists can be checked, ordered or neither (unordered), but not both!"
)
if checked:
return CheckedList(items, checked)
elif ordered:
return OrderedList(items)
else:
return UnorderedList(items) | python | wandb/apis/reports/_blocks.py | 308 | 338 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,879 | __init__ | def __init__(self, items=None, checked=None, *args, **kwargs):
super().__init__(*args, **kwargs)
if items is not None and checked is not None and len(items) != len(checked):
raise ValueError("Items and checked lists must be the same length!")
self.items = coalesce(items, [""])
self.checked = coalesce(checked, [False for _ in self.items]) | python | wandb/apis/reports/_blocks.py | 345 | 351 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,880 | spec | def spec(self) -> dict:
children = []
for item, check in zip(self.items, self.checked):
if isinstance(item, list):
content = [
t.spec if not isinstance(t, str) else {"text": t} for t in item
]
else:
content = [{"text": item}]
children.append(
{
"type": "list-item",
"children": [{"type": "paragraph", "children": content}],
"checked": check,
}
)
return {"type": "list", "children": children} | python | wandb/apis/reports/_blocks.py | 354 | 371 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,881 | __init__ | def __init__(self, items=None, *args, **kwargs):
super().__init__(*args, **kwargs)
self.items = coalesce(items, [""]) | python | wandb/apis/reports/_blocks.py | 377 | 379 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,882 | spec | def spec(self) -> dict:
children = []
for item in self.items:
if isinstance(item, list):
content = [
t.spec if not isinstance(t, str) else {"text": t} for t in item
]
else:
content = [{"text": item}]
children.append(
{
"type": "list-item",
"children": [{"type": "paragraph", "children": content}],
"ordered": True,
}
)
return {"type": "list", "ordered": True, "children": children} | python | wandb/apis/reports/_blocks.py | 382 | 399 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,883 | __init__ | def __init__(self, items=None, *args, **kwargs):
super().__init__(*args, **kwargs)
self.items = coalesce(items, [""]) | python | wandb/apis/reports/_blocks.py | 405 | 407 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,884 | spec | def spec(self) -> dict:
children = []
for item in self.items:
if isinstance(item, list):
content = [
t.spec if not isinstance(t, str) else {"text": t} for t in item
]
else:
content = [{"text": item}]
children.append(
{
"type": "list-item",
"children": [{"type": "paragraph", "children": content}],
}
)
return {"type": "list", "children": children} | python | wandb/apis/reports/_blocks.py | 410 | 426 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,885 | from_json | def from_json(cls, spec: dict) -> "Union[H1,H2,H3]":
level = spec["level"]
level_mapping = {1: H1, 2: H2, 3: H3}
if level not in level_mapping:
raise ValueError(f"`level` must be one of {list(level_mapping.keys())}")
if isinstance(spec["children"], str):
text = spec["children"]
else:
text = []
for elem in spec["children"]:
if elem.get("type") == "latex":
text.append(InlineLaTeX(elem["content"]))
elif elem.get("type") == "link":
text.append(Link(elem["children"][0]["text"], elem["url"]))
elif elem.get("inlineCode"):
text.append(InlineCode(elem["text"]))
elif elem.get("text"):
text.append(elem["text"])
if not isinstance(text, list):
text = [text]
return level_mapping[level](text) | python | wandb/apis/reports/_blocks.py | 431 | 452 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,886 | __init__ | def __init__(self, text="", *args, **kwargs):
super().__init__(*args, **kwargs)
self.text = text | python | wandb/apis/reports/_blocks.py | 458 | 460 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,887 | spec | def spec(self) -> dict:
if isinstance(self.text, list):
content = [
t.spec if not isinstance(t, str) else {"text": t} for t in self.text
]
else:
content = [{"text": self.text}]
return {
"type": "heading",
"children": content,
"level": 1,
} | python | wandb/apis/reports/_blocks.py | 463 | 474 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,888 | __init__ | def __init__(self, text="", *args, **kwargs):
super().__init__(*args, **kwargs)
self.text = text | python | wandb/apis/reports/_blocks.py | 480 | 482 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,889 | spec | def spec(self) -> dict:
if isinstance(self.text, list):
content = [
t.spec if not isinstance(t, str) else {"text": t} for t in self.text
]
else:
content = [{"text": self.text}]
return {
"type": "heading",
"children": content,
"level": 2,
} | python | wandb/apis/reports/_blocks.py | 485 | 496 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,890 | __init__ | def __init__(self, text="", *args, **kwargs):
super().__init__(*args, **kwargs)
self.text = text | python | wandb/apis/reports/_blocks.py | 502 | 504 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,891 | spec | def spec(self) -> dict:
if isinstance(self.text, list):
content = [
t.spec if not isinstance(t, str) else {"text": t} for t in self.text
]
else:
content = [{"text": self.text}]
return {
"type": "heading",
"children": content,
"level": 3,
} | python | wandb/apis/reports/_blocks.py | 507 | 518 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,892 | __init__ | def __init__(self, text="", *args, **kwargs):
super().__init__(*args, **kwargs)
self.text = text | python | wandb/apis/reports/_blocks.py | 524 | 526 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,893 | from_json | def from_json(cls, spec: dict) -> "BlockQuote":
text = spec["children"][0]["text"]
return cls(text) | python | wandb/apis/reports/_blocks.py | 529 | 531 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,894 | spec | def spec(self) -> dict:
return {"type": "block-quote", "children": [{"text": self.text}]} | python | wandb/apis/reports/_blocks.py | 534 | 535 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,895 | __init__ | def __init__(self, text=" ", *args, **kwargs):
super().__init__(*args, **kwargs)
self.text = text | python | wandb/apis/reports/_blocks.py | 541 | 543 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,896 | __post_init__ | def __post_init__(self) -> None:
if isinstance(self.text, str):
self.text = self.text.split("\n") | python | wandb/apis/reports/_blocks.py | 545 | 547 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,897 | from_json | def from_json(cls, spec: dict) -> "CalloutBlock":
text = [child["children"][0]["text"] for child in spec["children"]]
return cls(text) | python | wandb/apis/reports/_blocks.py | 550 | 552 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,898 | spec | def spec(self) -> dict:
return {
"type": "callout-block",
"children": [
{"type": "callout-line", "children": [{"text": text}]}
for text in self.text
],
} | python | wandb/apis/reports/_blocks.py | 555 | 562 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,899 | __init__ | def __init__(self, code=" ", language=None, *args, **kwargs):
super().__init__(*args, **kwargs)
self.code = code
self.language = coalesce(language, "python") | python | wandb/apis/reports/_blocks.py | 569 | 572 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,900 | __post_init__ | def __post_init__(self) -> None:
if isinstance(self.code, str):
self.code = self.code.split("\n") | python | wandb/apis/reports/_blocks.py | 574 | 576 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.