This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
import json | |
import urllib.request | |
from hello.models import ContactOutcomes | |
from django.core.management.base import BaseCommand | |
APIKEY_VALUE = "39752e30-2ade-426a-955b-8e6daf9de1af" | |
APIKEY = "/profile?hapikey=" + APIKEY_VALUE | |
HS_API_URL = "http://api.hubapi.com" | |
xurl = "/contacts/v1/contact/vid/" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
print('Target Impression, Range: >=1') | |
target_impressions = int(input("Enter the Input:")) | |
print('Achieved Impression Range: >=0') | |
imp_ressions = int(input("Enter the Input: ")) | |
print('Date Range:') | |
days = int(input("Enter the Input: ")) | |
if target_impressions>0 and target_impressions and imp_ressions: | |
get_percent = (imp_ressions/target_impressions)*100 | |
print(get_percent) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
******************************************************************************************************************************* | |
# views.py | |
#imports | |
import json | |
import os | |
import pprint | |
import re | |
import copy | |
import math | |
import calendar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# lru cache: | |
# Problem: Implement a LRU Cache: | |
# - LRUCache(int capacity) Initialize the LRU cache with positive size capacity. | |
# - int get(int key) Return the value of the key if the key exists, otherwise return -1. | |
# - void put(int key, int value) Update the value of the key if the key exists. Otherwise, add the key-value pair to the cache. If the number of keys exceeds the capacity from this operation, evict the least recently used key. | |
from collections import OrderedDict |