This file contains hidden or 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
def dictify(a, b): | |
return dict(map(lambda k, v: (k, v), a, b)) |
This file contains hidden or 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
class Keeper(object): | |
_instances = list() | |
def __new__(cls): | |
obj = object.__new__(cls) | |
cls.__init__(obj) | |
cls._instances.append(obj) | |
@classmethod | |
def list_instances(self): |
This file contains hidden or 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
<!doctype html> | |
<html> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> | |
<meta name="keywords" content=""> | |
<meta name="description" content=""> | |
<title></title> | |
<link type="text/css" rel="stylesheet" href=""> | |
<script type="text/javascript" src=""></script> |
This file contains hidden or 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
#container{width:100%;height:20px;} | |
#left{width:300px;float:left;} | |
#main{margin:0 200px 0 300px;text-align:right;padding-right:20px;} | |
#right2{width:200px;float:right;} | |
<div id="container"> | |
<div id="left">Col1</div> | |
<div id="right2">Col3</div> | |
<div id="main">Rubber col2</div> | |
</div> |
This file contains hidden or 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
from django.template import Library, Node | |
register = Library() | |
@register.simple_tag | |
def number_human(value, separator=',', precision=2, delimeter_count=3, decimal_separator='.'): | |
""" Converts an integer or floating-point number or a string to a string | |
containing the delimiter character (default comma) | |
after every delimeter_count digits (by default 3 digits). |
This file contains hidden or 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
# coding: utf-8 | |
from weasyprint import HTML, CSS | |
def get_page_body(boxes): | |
for box in boxes: | |
if box.element_tag == 'body': | |
return box |
This file contains hidden or 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
# coding: utf-8 | |
from django.contrib import auth | |
from django.conf import settings | |
from django.core.exceptions import PermissionDenied | |
from django.shortcuts import redirect | |
User = auth.get_user_model() |
This file contains hidden or 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
# coding: utf-8 | |
from funcparserlib.lexer import make_tokenizer, Spec | |
from funcparserlib.parser import (maybe, many, eof, skip, oneplus, fwd, | |
name_parser_vars, memoize, SyntaxError) | |
from funcparserlib.util import pretty_tree | |
from funcparserlib.contrib.common import unarg, flatten, n, op, op_, sometoks | |
from funcparserlib.contrib.lexer import (make_comment, make_multiline_comment, | |
newline, space) |
This file contains hidden or 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
# coding: utf-8 | |
from __future__ import absolute_import | |
import os.path | |
from io import BytesIO | |
from openpyxl.xml.constants import (PACKAGE_WORKSHEET_RELS, | |
REL_NS, | |
PACKAGE_RELS, | |
PACKAGE_IMAGES, |
This file contains hidden or 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
# -*- coding: utf-8 -*- | |
__all__ = ( | |
'MyError', | |
'Parent', | |
'First', | |
'Second', | |
'A', | |
) |
OlderNewer