<jupyter_start><jupyter_text>Summary Requirements:  - **python 3**  This notebook show how to make call to the AppNexus API.  Implemented functions:```python   def get_campaign(self, ids=None, one_id=None, advertiser_id=None, only_names=True):        """ cf https://wiki.appnexus.com/display/api/Campaign+Service"""    def get_pixel(self, ids=None, one_id=None, advertiser_id=None,                   advertiser_code=None, pixel_code=None, only_names=True):        """ cf https://wiki.appnexus.com/display/api/Conversion+Pixel+Service """    def get_device(self, one_id=None, device_type=None, only_names=True):        """ cf https://wiki.appnexus.com/display/api/Device+Model+Service """            def get_advertiser(self, ids=None, one_id=None, search_term=None, only_names=True):        """ cf https://wiki.appnexus.com/display/api/Advertiser+Service"""            def get_line_item(self, ids=None, one_id=None, advertiser_id=None, only_names=True):        """ cf https://wiki.appnexus.com/display/api/Line+Item+Service"""    def get_insertion_order(self, ids=None, one_id=None, advertiser_id=None, search_term=None, only_names=True):        """ cf https://wiki.appnexus.com/display/api/Insertion+Order+Service"""    def get_segment(self, ids=None, one_id=None, search_term=None, only_names=True):        """ cf https://wiki.appnexus.com/display/api/Segment+Service"""```<jupyter_code>from pynexus import AppNexusAPI

APPNEXUS_ACCOUNT = {
    "username": "",
    "password": ""
}
api = AppNexusAPI(**APPNEXUS_ACCOUNT)<jupyter_output><empty_output><jupyter_text>1. Make a request **Only the mapping *id -> name * **<jupyter_code>api.get_device(one_id=80)<jupyter_output><empty_output><jupyter_text>**Full response**<jupyter_code>api.get_device(one_id=80, only_names=False)<jupyter_output><empty_output><jupyter_text>2. Bulk requestIf you need to retrieve more than 100 mappings, you will need to make several call.  The `bulk_requests` function can to that for you<jupyter_code>pixels = AppNexusAPI.bulk_requests(api.get_pixel, range(0, 300))<jupyter_output>The installed widget Javascript is the wrong version.<jupyter_text>You may also want to retrieve all the elements, without specifying an id.  base the default `get` function will only return up to 100 elements, you can use the `bulk_request_get_all`to avoid hitting the limit.<jupyter_code># We limit here the number of calls to 10
names = AppNexusAPI.bulk_request_get_all(api.get_pixel, limit=10, only_names=True)
print('%d elements downloaded' % len(names))<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.12828560219693996, 'fraction_numerical': 0.00823852491173009, 'mean_word_length': 5.692913385826771, 'pattern_counts': {'":': 2, '<': 20, '<?xml version=': 0, '>': 21, 'https://': 7, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '5', 'dir': 'jupyter-structured-clean-dedup', 'id': '607527', 'license': 'Apache-2.0', 'n_tokens_mistral': 877, 'n_tokens_neox': 848, 'n_words': 179, 'path': 'examples/API.ipynb', 'repo_name': 've-interactive/Pynexus', 'size': '2549'}