Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(7)  |  Call(7)  |  Derive(0)  |  Import(0)

            @staticmethod
    def from_json(json):
        i = json.get('id', '')
        key = json.get('key', '')
        attributes = json.get('attributes', {})
        tags = json.get('tags', [])
        name = json.get('name', '')
        series = Series(i, key, name=name, attributes=attributes, tags=tags)
        return series
        


src/t/e/tempodb-python-HEAD/tempodb/client.py   tempodb-python(Download)
    def get_series(self, ids=[], keys=[], tags=[], attributes={}):
        params = self._normalize_params(ids, keys, tags, attributes)
        json = self.request('/series/', method='GET', params=params)
        series = [Series.from_json(s) for s in json]
        return series
 
        json = self.request('/series/', method='POST', params=params)
        series = Series.from_json(json)
        return series
 
    def update_series(self, series):
        json = self.request('/series/id/%s/' % (series.id,), method='PUT', params=series.to_json())
        series = Series.from_json(json)

src/t/e/tempodb-0.5.0/tempodb/client.py   tempodb(Download)
    def get_series(self, ids=[], keys=[], tags=[], attributes={}):
        params = self._normalize_params(ids, keys, tags, attributes)
        json = self.request('/series/', method='GET', params=params)
        series = [Series.from_json(s) for s in json]
        return series
 
        json = self.request('/series/', method='POST', params=params)
        series = Series.from_json(json)
        return series
 
    def update_series(self, series):
        json = self.request('/series/id/%s/' % (series.id,), method='PUT', params=series.to_json())
        series = Series.from_json(json)

src/t/e/tempodb-python-HEAD/tests/base/series_tests.py   tempodb-python(Download)
            "attributes": {"key1": "value1"}
        }
        series = Series.from_json(json)
        expected = Series('id', 'key', 'name', {'key1': 'value1'}, ['tag1', 'tag2'])
        self.assertEqual(series, expected)