An asset is a Python function with the @dg.asset decorator. The function's name becomes the asset key, the function body computes the asset, and whatever it returns is handed to an IO manager, which stores it so other assets can read it later.
Dagster only sees what you register. Put every asset in a dg.Definitions object at the top level of the module: defs = dg.Definitions(assets=[...]). Forget the decorator and Definitions receives a plain function and refuses to load. Forget Definitions and there is nothing to load at all.
The convention in current docs is import dagster as dg. To give an asset a key that differs from the function name, pass name=. To group keys under a path, pass key_prefix=: key_prefix=["shop"] gives shop/raw_orders. In a real project, dg loads definitions from src/<project>/defs/; this workspace keeps everything in definitions.py.
A complete code location with one asset. Reload definitions and it appears in the graph.