Get metadata for games (only ladder data right now).
552403
def get_metadata(session, games):
    """"""
    for data in games.values():
        parsed = make_scrape_request(session, data['url'])
    return {
        'ladders': get_ladders_metadata(session, parsed)
    }
1177516
def GetMetricMetadata():
  """"""
  return [
      stats_utils.CreateCounterMetadata("grr_client_unknown"),
      stats_utils.CreateCounterMetadata("grr_decoding_error"),
      stats_utils.CreateCounterMetadata("grr_decryption_error"),
      stats_utils.CreateCounterMetadata("grr_authenticated_messages"),
      stats_utils.CreateCounterMetadata("grr_unauthenticated_messages"),
      stats_utils.CreateCounterMetadata("grr_rsa_operations"),
      stats_utils.CreateCounterMetadata(
          "grr_encrypted_cipher_cache", fields=[("type", str)]),
  ]
97198
def metadata(self):
        
        resp = self.r_session.get(self.database_url)
        resp.raise_for_status()
        return response_to_json_dict(resp)
913439
def get_admin_metadata(self):
        """"""
        logger.debug("Getting admin metdata")
        text = self.get_text(self.get_admin_metadata_key())
        return json.loads(text)
878618
def _get_meta_data(self):
        """"""
        return {
            "comment": self.request.headers.get("comment", ""),
            "author": self.get_current_user() or self.settings.get('annonymous_user')
        }
1206557
def get_lobbies(session, game_id):
    """"""
    if isinstance(game_id, str):
        game_id = lookup_game_id(game_id)
    lobbies = _make_request(session, LOBBY_URL, game_id)
    for lobby in lobbies:
        # pylint: disable=len-as-condition
        if len(lobby['ladders']) > 0:
            lobby['ladders'] = lobby['ladders'][:-1].split('|')
    return lobbies
388402
def as_dict(self):
        
        drepr = super(PlayMeta, self).as_dict()
        drepr["details"] = [meta.as_dict() for meta in self._metas]
        return drepr
181751
def get_metadata(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 or not private, 'Cannot see private metadata without an API key'

    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 api_key else {'private': 'true'}

    r = requests.get(url, params=params, verify=True, timeout=TIMEOUT_IN_SECONDS)
    response_dict = get_valid_json(r)

    return response_dict
1310508
def fetch_metadata(self):
        """"""
        try:
            table = self.get_sqla_table_object()
        except Exception as e:
            logging.exception(e)
            raise Exception(_(
                "Table [{}] doesn't seem to exist in the specified database, "
                "couldn't fetch column information").format(self.table_name))

        M = SqlMetric  # noqa
        metrics = []
        any_date_col = None
        db_engine_spec = self.database.db_engine_spec
        db_dialect = self.database.get_dialect()
        dbcols = (
            db.session.query(TableColumn)
            .filter(TableColumn.table == self)
            .filter(or_(TableColumn.column_name == col.name
                        for col in table.columns)))
        dbcols = {dbcol.column_name: dbcol for dbcol in dbcols}

        for col in table.columns:
            try:
                datatype = col.type.compile(dialect=db_dialect).upper()
            except Exception as e:
                datatype = 'UNKNOWN'
                logging.error(
                    'Unrecognized data type in {}.{}'.format(table, col.name))
                logging.exception(e)
            dbcol = dbcols.get(col.name, None)
            if not dbcol:
                dbcol = TableColumn(column_name=col.name, type=datatype)
                dbcol.sum = dbcol.is_num
                dbcol.avg = dbcol.is_num
                dbcol.is_dttm = dbcol.is_time
                db_engine_spec.alter_new_orm_column(dbcol)
            else:
                dbcol.type = datatype
            dbcol.groupby = True
            dbcol.filterable = True
            self.columns.append(dbcol)
            if not any_date_col and dbcol.is_time:
                any_date_col = col.name

        metrics.append(M(
            metric_name='count',
            verbose_name='COUNT(*)',
            metric_type='count',
            expression='COUNT(*)',
        ))
        if not self.main_dttm_col:
            self.main_dttm_col = any_date_col
        self.add_missing_metrics(metrics)
        db.session.merge(self)
        db.session.commit()
180642
def get_metadata(self):
        
        inspect_data = self.inspect(refresh=True)
        inspect_to_container_metadata(self.metadata, inspect_data, self.image)

        return self.metadata
199823
def get_player_stats(self, player_key, board_key):
        
        player_stats_url = self.api_path + 'player/' + player_key + '/league/' + board_key + '/stats/'
        response = self.get_response(player_stats_url)
        return response
979602
def attrs(self):
        """"""
        ret = dict(self.__dict__) # obtain copy of internal __dict__
        del ret["_matches"] # match history is specifically distinguished from player information (and stored separately)
        if self.type != c.COMPUTER: # difficulty only matters for computer playres
            del ret["difficulty"]
        return ret
798050
def get_metadata(headers):
  """"""
  return dict((k, v) for k, v in headers.iteritems()
              if any(k.lower().startswith(valid) for valid in _GCS_METADATA))
555418
def metadata(self):
        
        from ambry.metadata.schema import Top  # cross-module import
        top = Top()
        top.build_from_db(self.dataset)
        return top
1300035
def standings(date=datetime.now()):
    
    data = mlbgame.info.standings(date)
    return mlbgame.info.Standings(data)
126221
def games(self, platform):
        
        platform = platform.lower()
        data_list = self.db.get_data(self.games_path, platform=platform)
        data_list = data_list.get('Data') or {}
        return [Game(self.db.game, **i) for i in data_list.get('Game') or {}]
1061655
def get_metadata(self, dataset_identifier, content_type="json"):
        '''
        
        '''
        resource = _format_old_api_request(dataid=dataset_identifier, content_type=content_type)
        return self._perform_request("get", resource)