Spaces:
Running
on
Zero
Running
on
Zero
Update my_functions.py
Browse files- my_functions.py +8 -10
my_functions.py
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
import yfinance as yf
|
2 |
|
3 |
-
#
|
4 |
product_catalog = {
|
5 |
"807ZPKBL9V": "SuperWidget",
|
6 |
"1234567890": "MegaGadget"
|
@@ -23,15 +23,12 @@ def get_stock_price(ticker: str) -> float:
|
|
23 |
return float('nan')
|
24 |
|
25 |
# ----------------------------------------------------
|
26 |
-
#
|
27 |
# ----------------------------------------------------
|
28 |
def analyze_mco_architecture(framework_version: str, detail_level: int = 3) -> str:
|
29 |
"""
|
30 |
MCO ์ํคํ
์ฒ(ํจ์ JSON + Python ๋ชจ๋) ๊ตฌ์กฐ๋ฅผ ๋ถ์ ๋ฐ ์์ฝํด์ฃผ๋ ํจ์.
|
31 |
-
framework_version: (์: 'v2.1')
|
32 |
-
detail_level: ๋ถ์ ์์ธ๋ (1~5)
|
33 |
"""
|
34 |
-
# ์
๋ ฅ ๋ฒ์ ๋ณด์
|
35 |
if detail_level < 1:
|
36 |
detail_level = 1
|
37 |
elif detail_level > 5:
|
@@ -47,11 +44,12 @@ def analyze_mco_architecture(framework_version: str, detail_level: int = 3) -> s
|
|
47 |
return analysis
|
48 |
|
49 |
# ----------------------------------------------------
|
50 |
-
#
|
|
|
51 |
# ----------------------------------------------------
|
52 |
-
def
|
53 |
"""
|
54 |
-
|
|
|
55 |
"""
|
56 |
-
|
57 |
-
return product_catalog.get(product_id, "Unknown product")
|
|
|
1 |
import yfinance as yf
|
2 |
|
3 |
+
# ์ํ์ฉ Catalog
|
4 |
product_catalog = {
|
5 |
"807ZPKBL9V": "SuperWidget",
|
6 |
"1234567890": "MegaGadget"
|
|
|
23 |
return float('nan')
|
24 |
|
25 |
# ----------------------------------------------------
|
26 |
+
# MCO ์ํคํ
์ฒ ๋ถ์์ฉ ํจ์ (์์)
|
27 |
# ----------------------------------------------------
|
28 |
def analyze_mco_architecture(framework_version: str, detail_level: int = 3) -> str:
|
29 |
"""
|
30 |
MCO ์ํคํ
์ฒ(ํจ์ JSON + Python ๋ชจ๋) ๊ตฌ์กฐ๋ฅผ ๋ถ์ ๋ฐ ์์ฝํด์ฃผ๋ ํจ์.
|
|
|
|
|
31 |
"""
|
|
|
32 |
if detail_level < 1:
|
33 |
detail_level = 1
|
34 |
elif detail_level > 5:
|
|
|
44 |
return analysis
|
45 |
|
46 |
# ----------------------------------------------------
|
47 |
+
# [์ถ๊ฐ] functionName(...)
|
48 |
+
# - ๋ชจ๋ธ์ด functionName(string="AAPL")๋ผ๊ณ ์ฝํ๋ฉด ๋ด๋ถ์ ์ผ๋ก get_stock_price(ticker=string)์ ํธ์ถ.
|
49 |
# ----------------------------------------------------
|
50 |
+
def functionName(string: str) -> float:
|
51 |
"""
|
52 |
+
์์ ํธํ์ฉ ํจ์.
|
53 |
+
๋ชจ๋ธ์ด functionName(string="...")์ ํธ์ถํ๋ฉด, get_stock_price(ticker=...)๋ฅผ ๋์ ํธ์ถํ์ฌ ๋ฐํ.
|
54 |
"""
|
55 |
+
return get_stock_price(ticker=string)
|
|