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 bz2 | |
with bz2.BZ2File("test.bz2", "r") as fp: | |
i = 0 | |
for l in fp: | |
print(l) |
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
Категорія | ІПН | Назва | Посада | ПІБ | Дата народження | Дата призначення | Дата звільнення | Дата відповіді | Лінк на відповідь/лінк на сайт | Дата народження | Дата призначення | Декларація 2010 | Декларація 2011 | Декларація 2012 | Декларація 2013 | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Стратегічні державні підприємтсва | ||||||||||||||||
4687867 | Український державний науково-дослідний проектний інститут азотної промисловості і продуктів органічного синтезу, м. Дніпродзержинськ | Директор | Барабаш Олександр Іванович | 13.08.1962 | 04.02.2009 | 26.12.2014 | https://drive.google.com/file/d/0B96kVmiv1cb7OXd1TW9aV1BrcmV4bzJpVzBxSU02RWNXbHJN/view?usp=sharing |
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
In [1]: from unicodecsv import DictReader | |
In [2]: fp = open("problematic.csv", "r") | |
In [3]: r = DictReader(fp) | |
In [4]: r.next() # First row is not interesting | |
Out[4]: | |
{u'\u0406\u041f\u041d': u'', | |
u'\u0414\u0430\u0442\u0430 \u0432\u0456\u0434\u043f\u043e\u0432\u0456\u0434\u0456': u'', |
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
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
# All Vagrant configuration is done below. The "2" in Vagrant.configure | |
# configures the configuration version (we support older styles for | |
# backwards compatibility). Please don't change it unless you know what | |
# you're doing. | |
Vagrant.configure(2) do |config| | |
#Django Frontend | |
config.vm.network "forwarded_port", guest: 8000, host: 8080 |
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
{"sentence": [["Гучне", [[["adj", "post"], ["s", "nmbr"], ["n", "gndr"], ["v_naz", "CAse"], ["compb", "forms"]], [["adj", "post"], ["s", "nmbr"], ["n", "gndr"], ["v_zna", "CAse"], ["compb", "forms"]]]], ["затримання", [[["noun", "post"], ["s", "nmbr"], ["n", "gndr"], ["v_naz", "CAse"], ["inanim", "ANim"]], [["noun", "post"], ["s", "nmbr"], ["n", "gndr"], ["v_rod", "CAse"], ["inanim", "ANim"]], [["noun", "post"], ["s", "nmbr"], ["n", "gndr"], ["v_zna", "CAse"], ["inanim", "ANim"]], [["noun", "post"], ["p", "nmbr"], ["v_naz", "CAse"], ["inanim", "ANim"]], [["noun", "post"], ["p", "nmbr"], ["v_zna", "CAse"], ["inanim", "ANim"]]]], ["підполковника", [[["noun", "post"], ["s", "nmbr"], ["m", "gndr"], ["v_rod", "CAse"], ["anim", "ANim"]], [["noun", "post"], ["s", "nmbr"], ["m", "gndr"], ["v_zna", "CAse"], ["anim", "ANim"]]]], ["Нацгвардії", []], ["за", [[["prep", "post"], ["rv_rod", "req_case"], ["rv_zna", "req_case"], ["rv_oru", "req_case"]]]], ["хабар", [[["noun", "post"], ["s", "nmbr"], ["m", "gndr"], ["v_naz", " |
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
<root> | |
<id>A</id> | |
<author_surname></author_surname> | |
<author_name></author_name> | |
<title>На болото в Закарпатті повернулися вода та бобри</title> | |
<publ_in>Львівська газета</publ_in> | |
<url>http://www.gazeta.lviv.ua/ecology/37205</url> | |
<publ_part></publ_part> | |
<publ_place></publ_place> | |
<publisher></publisher> |
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
--- misc.py~ 2010-10-25 14:07:30.000000000 +0300 | |
+++ misc.py 2010-10-25 14:13:56.000000000 +0300 | |
@@ -1,5 +1,6 @@ | |
from coffin import template | |
-from jinja2 import Markup | |
+from jinja2 import Markup, nodes | |
+from jinja2.ext import Extension | |
register = template.Library() | |
@register.filter(jinja2_only=True) |
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
from coffin.template import Template as JTemplate | |
from django.template.loaders import app_directories, filesystem | |
from django.template import TemplateDoesNotExist | |
# integrate jinja instead of django template language to take advantage of | |
# all django helper function like direct_to_template | |
def _render_or_die(source, origin): | |
"""helper function for loaders below. Makes a simple check if | |
passed template seems to be jinja one and raising exception otherwise""" |
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
from django.db.models.query import QuerySet | |
old_get = QuerySet.get | |
def new_get(self, *args, **kwargs): | |
if len(kwargs) == 1: | |
for field_name in kwargs: | |
if "__" in field_name: | |
field_name, kind = field_name.split("__") | |
if kind != 'exact': | |
continue |
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
from amazonproduct import API | |
import os | |
from hashlib import md5 | |
old_fetch = API._fetch | |
old_build_url = API._build_url | |
old_init = API.__init__ | |
def new_fetch(self, url): |