docstr: Get an instance of this resource from user input. For example, a CPU resource
  might parse "10m" and return a CPU resource with 0.01 CPUs.
docstr_tok: ["Get","an","instance","of","this","resource","from","user","input",".","For","example",",","a","CPU","resource","might","parse","``","10m","''","and","return","a","CPU","resource","with","0.01","CPUs","."]
code: def from_spec(cls, spec: t.Any) -> T:
      """
      Get an instance of this resource from user input. For example, a CPU resource
      might parse "10m" and return a CPU resource with 0.01 CPUs.
      """
  
imports: from __future__ import annotations
  import functools
  import logging
  import math
  import os
  import re
  import typing
  from abc import ABC
  from abc import abstractmethod
  import psutil
  from ..exceptions import BentoMLConfigException
label_desc: Use image node_id 2 for calling the Resource obj's underlying member method code with example usage: obj.from_spec(cls, spec) without return types