I hereby claim:
- I am aljiwala on github.
- I am aljiwala (https://keybase.io/aljiwala) on keybase.
- I have a public key ASAVREBd3BSfzkZGpjGWKOxdUJWDwHPjcJkfnyQ28YpjIAo
To claim this, I am signing this object:
# -*- coding: utf-8 -*- | |
"""Example Google style docstrings. | |
This module demonstrates documentation as specified by the `Google Python | |
Style Guide`_. Docstrings may extend over multiple lines. Sections are created | |
with a section header and a colon followed by a block of indented text. | |
Example: | |
Examples can be given using either the ``Example`` or ``Examples`` | |
sections. Sections support any reStructuredText formatting, including |
I hereby claim:
To claim this, I am signing this object:
def get_soup(url): | |
# Func which should return `BeautifulSoup` object. | |
pass | |
def get_meta_from_website(url, attrs=['description', 'keywords']): | |
""" | |
Should return meta data from given website URL. | |
* Receives: | |
- url (string) |
from re import match | |
from urllib.parse import urlparse | |
from urllib.parse import ParseResult | |
def get_parsed_url(url): | |
p = urlparse(url, 'http') | |
netloc = p.netloc or p.path | |
path = p.path if p.netloc else '' | |
if not netloc.startswith('www.'): | |
netloc = 'www.' + netloc |
import requests | |
from time import sleep | |
from bs4 import BeautifulSoup | |
def extract_from_ed_india(): | |
final = list() | |
pages = range(1, 32) | |
for i in pages: |
/* | |
* script to export data in all sheets in the current spreadsheet as individual csv files | |
* files will be named according to the name of the sheet | |
* author: Michael Derazon | |
*/ | |
function onOpen() { | |
var ss = SpreadsheetApp.getActiveSpreadsheet(); | |
var csvMenuEntries = [{name: "export as csv files", functionName: "saveAsCSV"}]; | |
ss.addMenu("csv", csvMenuEntries); |
# Built-in imports. | |
from sys import argv | |
from os.path import join as join_path | |
# Third party imports. | |
from pandas import read_csv | |
def get_row_count(src_filepath): | |
with open(src_filepath, 'r') as f: |
import sys, os, django | |
sys.path.append("/path/to/store") #here store is root folder(means parent). | |
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "store.settings") | |
django.setup() | |
from store_app.models import MyModel |
from rest_framework.generics import get_object_or_404 | |
class CaseInsensitiveLookupMixin(object): | |
""" | |
Apply this mixin to any view or viewset to get kwargs with lowercase | |
values. Based on a `lookup_field` attribute. | |
""" | |
def get_object(self): | |
queryset = self.get_queryset() # Get the base queryset |
from PIL import Image | |
from io import BytesIO | |
def compress_image(original_file, max_size, scale): | |
""" | |
It should compress the size of the given file with the particular `scale` | |
until `max_size` limit is achieved. | |
""" | |
assert(0.0 < scale < 1.0) |