




import json

import requests

from .fetch_github_info import AUTHENTICATED_USER_ENDPOINT, fetch_github_info



def    UpperCAmelCase__	(  lowerCamelCase ):




  class  __lowerCAmelCase							:






         def __init__( self:       Tuple							,       _lowerCAmelCase:       str					):
           assert isinstance(_lowerCAmelCase							,       (bytes, str)					)
           lowercase     :List[Any]   						=    content






         def        SCREAMING_SNAKE_CASE     ( self:       str					):
           return json.loads(self.content					)

  def mock_response(*lowerCamelCase,      **lowerCamelCase ):
    assert args[0] == AUTHENTICATED_USER_ENDPOINT
    assert "Authorization" in kwargs["headers"]
    assert kwargs["headers"]["Authorization"].startswith("token " )
    assert "Accept" in kwargs["headers"]
    return FakeResponse(B"{\"login\":\"test\",\"id\":1}" )

  monkeypatch.setattr(lowerCamelCase,      "get",      lowerCamelCase )
  lowercase     :List[Any]   						=    fetch_github_info("token" )
  assert result["login"] == "test"
  assert result["id"] == 1









from unittest.mock import patch

import datasets
from datasets import Dataset



def    UpperCAmelCase__	(  ):
  lowercase     :Any   						=    Dataset.from_dict({"col_1": [3, 2, 0, 1]} )

  with patch("tqdm.auto.tqdm" ) as mock_tqdm:
    datasets.disable_progress_bar()
    dset.map(lambda lowerCamelCase : {"col_2": x["col_1"] + 1} )
    mock_tqdm.assert_not_called()

    mock_tqdm.reset_mock()

    datasets.enable_progress_bar()
    dset.map(lambda lowerCamelCase : {"col_2": x["col_1"] + 1} )
    mock_tqdm.assert_called()



