How to use the jovian.utils.api.post_block function in jovian

To help you get started, we’ve selected a few jovian examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github JovianML / jovian-py / jovian / utils / records.py View on Github external
def log_record(record_type, data=None, verbose=True, **data_args):
    """Create records with the given data & type"""
    global _data_blocks
    # Create the combined data dictionary
    data = _parse_data(data, data_args)
    if data is None and verbose:
        log('Nothing to record. Skipping..', error=True)
        return
    # Send to API endpoint
    res = api.post_block(data, record_type)
    tracking_slug = res['tracking']['trackingSlug']
    # Save to data block
    _data_blocks.append((tracking_slug, record_type, data))
    if verbose:
        log(record_type.capitalize() + ' logged.')