Persist the request metadata in self._vcr_request
484684
def request(self, method, url, body=None, headers=None, *args, **kwargs):
        ''''''
        self._vcr_request = Request(
            method=method,
            uri=self._uri(url),
            body=body,
            headers=headers or {}
        )
        log.debug('Got {}'.format(self._vcr_request))

        # Note: The request may not actually be finished at this point, so
        # I'm not sending the actual request until getresponse().  This
        # allows me to compare the entire length of the response to see if it
        # exists in the cassette.

        self._sock = VCRFakeSocket()
1045096
def _WriteStorageMetadata(self):
    """"""
    self._cursor.execute(self._CREATE_METADATA_TABLE_QUERY)

    query = 'INSERT INTO metadata (key, value) VALUES (?, ?)'

    key = 'format_version'
    value = '{0:d}'.format(self._FORMAT_VERSION)
    self._cursor.execute(query, (key, value))

    key = 'compression_format'
    value = self.compression_format
    self._cursor.execute(query, (key, value))

    key = 'serialization_format'
    value = self.serialization_format
    self._cursor.execute(query, (key, value))

    key = 'storage_type'
    value = self.storage_type
    self._cursor.execute(query, (key, value))
1275690
def persistant_info(request, message, extra_tags='', fail_silently=False, *args, **kwargs):
    
    add_message(request, INFO_PERSISTENT, message, extra_tags=extra_tags,
                fail_silently=fail_silently, *args, **kwargs)
513781
def _continued_query(self, query_params, key="pages"):
        
        query_params.update(self.__title_query_param())

        last_cont = dict()
        prop = query_params.get("prop")

        while True:
            params = query_params.copy()
            params.update(last_cont)

            request = self.mediawiki.wiki_request(params)

            if "query" not in request:
                break

            pages = request["query"][key]
            if "generator" in query_params:
                for datum in pages.values():
                    yield datum
            elif isinstance(pages, list):
                for datum in list(enumerate(pages)):
                    yield datum[1]
            else:
                for datum in pages[self.pageid].get(prop, list()):
                    yield datum

            if "continue" not in request or request["continue"] == last_cont:
                break

            last_cont = request["continue"]
715984
def save(self, create_multiple_renditions=True,
        preserve_source_rendition=True,
        encode_to=enums.EncodeToEnum.FLV):
        
        if is_ftp_connection(self.connection) and len(self.assets) > 0:
            self.connection.post(xml=self.to_xml(), assets=self.assets)
        elif not self.id and self._filename:
            self.id = self.connection.post('create_video', self._filename,
                create_multiple_renditions=create_multiple_renditions,
                preserve_source_rendition=preserve_source_rendition,
                encode_to=encode_to,
                video=self._to_dict())
        elif not self.id and len(self.renditions) > 0:
            self.id = self.connection.post('create_video',
                video=self._to_dict())
        elif self.id:
            data = self.connection.post('update_video', video=self._to_dict())
            if data:
                self._load(data)
744720
def determine_metadata(self, request, view):
        """"""
        metadata = super(
            DynamicMetadata,
            self).determine_metadata(
            request,
            view)
        metadata['features'] = getattr(view, 'features', [])
        if hasattr(view, 'get_serializer'):
            serializer = view.get_serializer(dynamic=False)
            if hasattr(serializer, 'get_name'):
                metadata['resource_name'] = serializer.get_name()
            if hasattr(serializer, 'get_plural_name'):
                metadata['resource_name_plural'] = serializer.get_plural_name()
        metadata['properties'] = self.get_serializer_info(serializer)
        return metadata
1027650
def set_playback(self, playback):
        """"""
        req_url = ENDPOINTS["setPlayback"].format(self._ip_address)
        params = {"playback": playback}
        return request(req_url, params=params)
726334
def cache_persist(self):
        
        filename = self.get_cache_location()
        pickle.dump(self.categories, open(filename, 'wb'))
144290
def save_metadata(self, phase, data_name):
        
        with open("{}/.metadata".format(make_path(phase)), "w+") as f:
            f.write("pipeline={}\nphase={}\ndata={}".format(self.pipeline_name, phase.phase_name,
                                                            data_name))
500335
def _update_metadata_for_video(self, metadata_href, video):
        '''
        
        '''
        current_metadata = self.clarify_client.get_metadata(metadata_href)
        cur_data = current_metadata.get('data')

        if cur_data.get('updated_at') != video['updated_at']:
            self.log('Updating metadata for video {0}'.format(video['id']))
            if not self.dry_run:
                metadata = self._metadata_from_video(video)
                self.clarify_client.update_metadata(metadata_href, metadata=metadata)
            self.sync_stats['updated'] += 1
63173
public void setMetadata(com.google.api.ads.admanager.axis.v201805.VideoMetadata metadata) {
        this.metadata = metadata;
    }
1248671
def persist(self):
        """"""

        self.persisted_nodes = self.graph.dump_nodes()
        self.persisted_streamers = self.graph.dump_streamers()
        self.persisted_exists = True
        self.persisted_constants = self._sensor_log.dump_constants()
686885
def save(self, *args, **kwargs):
        """"""

        super(MP4, self).save(*args, **kwargs)
631861
def on_execute__set_video_config(self, request):
        '''
        
        '''
        data = decode_content_data(request)
        compare_fields = ['device_name', 'width', 'height', 'name', 'fourcc',
                          'framerate']
        if data['video_config'] is None or not data['video_config'].shape[0]:
            i = None
        else:
            for i, row in self.parent.video_mode_slave.configs.iterrows():
                if (row[compare_fields] ==
                        data['video_config'][compare_fields]).all():
                    break
            else:
                i = None
        if i is None:
            logger.error('Unsupported video config:\n%s', data['video_config'])
            logger.error('Video configs:\n%s',
                         self.parent.video_mode_slave.configs)
            self.parent.video_mode_slave.config_combo.set_active(0)
        else:
            logger.error('Set video config (%d):\n%s', i + 1,
                         data['video_config'])
            self.parent.video_mode_slave.config_combo.set_active(i + 1)
412786
def persist(self, ttl=None, **kwargs):
        """"""
        from ..container import container_map
        from ..container.persist import PersistStore
        import time
        if 'original_tok' in self.metadata:
            raise ValueError('Cannot persist a source taken from the persist '
                             'store')
        method = container_map[self.container]._persist
        store = PersistStore()
        out = method(self, path=store.getdir(self), **kwargs)
        out.description = self.description
        metadata = {'timestamp': time.time(),
                    'original_metadata': self.metadata,
                    'original_source': self.__getstate__(),
                    'original_name': self.name,
                    'original_tok': self._tok,
                    'persist_kwargs': kwargs,
                    'ttl': ttl,
                    'cat': {} if self.cat is None else self.cat.__getstate__()}
        out.metadata = metadata
        out.name = self.name
        store.add(self._tok, out)
        return out
917347
def update_metadata(self, bucket, label, params):
        '''
        '''
        if self.mode !="r":
            try:
                payload = self._get_bucket_md(bucket)
            except OFSFileNotFound:
                # No MD found... create it
                payload = {}
                for l in self.list_labels(bucket):
                    payload[l] = {}
                    payload[l]['_label'] = l
                if not self.quiet:
                    print("Had to create md file for %s" % bucket)
            except OFSException as e:
                raise OFSException(e)
            if not label in payload:
                payload[label] = {}
            payload[label].update(params)
            self.put_stream(bucket, MD_FILE, json.dumps(payload).encode('utf-8'), params={}, replace=True, add_md=False)
            return payload[label]
        else:
            raise OFSException("Cannot update MD in archive in 'r' mode")
331866
def put_metadata(metadata_dict, address=None, tx_hash=None, block_hash=None, api_key=None, private=True, coin_symbol='btc'):
    '''
    
    '''
    assert is_valid_coin_symbol(coin_symbol), coin_symbol
    assert api_key
    assert metadata_dict and isinstance(metadata_dict, dict), metadata_dict

    kwarg = get_valid_metadata_identifier(
        coin_symbol=coin_symbol,
        address=address,
        tx_hash=tx_hash,
        block_hash=block_hash,
        )

    url = make_url(coin_symbol, meta=True, **kwarg)

    params = {'token': api_key}
    if private:
        params['private'] = 'true'

    r = requests.put(url, json=metadata_dict, params=params, verify=True, timeout=TIMEOUT_IN_SECONDS)
    return get_valid_json(r, allow_204=True)