def __init__(self, uid=None, upstream=None):
        """
        Find the record of the given model specified by self.MODEL_NAME. The record can be looked up
        in a few ways, depending on which argument is specified (uid or upstream). If both are specified,
        then the upstream argument will be ignored.

        Args:
            uid: The database identifier of the record to fetch, which can be specified either as the
                primary id (i.e. 8) or the model prefix plus the primary id (i.e. B-8).
                Could also be the record's name if it has a name attribute (not all models do)
                and if so will be converted to the record ID.
            upstream: If set, then the record will be searched on its upstream_identifier attribute.
        """
        # self.attrs will store the actual record's attributes. Initialize value now to empty dict
        # since it is expected to be set already in self.__setattr__().
        self.__dict__["attrs"] = {}

        # rec_id could be the record's name. Check for that scenario, and convert to record ID if
        # necessary.
        if uid:
            rec_id = self.__class__.replace_name_with_id(uid)
            rec_json = self._get(rec_id=rec_id)
        elif upstream:
            rec_json = self._get(upstream=upstream)
        else:
            raise ValueError("Either the 'uid' or 'upstream' parameter must be set.")
        # Convert None values to empty string
        for key in rec_json:
            if rec_json[key] == None:
                rec_json[key] = ""
        self.rec_id = rec_json["id"]
        self.__dict__["attrs"] = rec_json
def __init__ ( self , uid = None , upstream = None ) : self . __dict__ [ "attrs" ] = { } if uid : rec_id = self . __class__ . replace_name_with_id ( uid ) rec_json = self . _get ( rec_id = rec_id ) elif upstream : rec_json = self . _get ( upstream = upstream ) else : raise ValueError ( "Either the 'uid' or 'upstream' parameter must be set." ) for key in rec_json : if rec_json [ key ] == None : rec_json [ key ] = "" self . rec_id = rec_json [ "id" ] self . __dict__ [ "attrs" ] = rec_json
Find the record of the given model specified by self.MODEL_NAME. The record can be looked up
        in a few ways, depending on which argument is specified (uid or upstream). If both are specified,
        then the upstream argument will be ignored.

        Args:
            uid: The database identifier of the record to fetch, which can be specified either as the
                primary id (i.e. 8) or the model prefix plus the primary id (i.e. B-8).
                Could also be the record's name if it has a name attribute (not all models do)
                and if so will be converted to the record ID.
            upstream: If set, then the record will be searched on its upstream_identifier attribute.