class_docstr: Data Model
class_docstr_tok: ["Data","Model"]
docstr: Create an instance from a dictionary while ignoring unnecessary keys
docstr_tok: ["Create","an","instance","from","a","dictionary","while","ignoring","unnecessary","keys"]
code: def from_dict(cls, dct, strict=False):
      """
      Create an instance from a dictionary while ignoring unnecessary keys
      """
      allowed_keys = cls._get_data_props().values()
      invalid_keys = set(dct).difference(allowed_keys)
      if strict and invalid_keys:
          raise ValueError("Invalid keys %s" % tuple(invalid_keys))
      return cls(
          **{
              cls.normalize_key(key): value
              for key, value in dct.items()
              if key not in invalid_keys
          }
      )
  
imports: import keyword
  import enum
  import json
  from datetime import datetime
  import jsonschema
  from enum import Enum
  import six
label_desc: Use image node_id 8 for calling the DataModel obj's underlying member method code with example usage: obj.from_dict(cls, dct, strict) and returns: cls