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
import pandas as pd | |
df2 = pd.DataFrame( | |
{u"Paises": | |
[u"Áustria", u"Bélgica", "Dinamarca", "Finlandia", u"França", "Alemanha", u"Grécia", "Irlanda", u"Itália", "Holanda", "Portugal", "Espanha", u"Suécia"], | |
u"Carvão": [3.6, 3.2, 3.6, 3.2, 3.2, 3.2, 3.5, 3.2, 3.6, 3.2, 3.6, 3.6, 3.2], | |
"CCGas": [3.4, 2.8, 2.9, 2.6, 3.2, 3.5, 3.5, 3.2, 3.4, 2.6, 3.4, 3.5, 3.3], | |
"Bioenergia": [3.6, 3.7, 3.9, 3.9, 4.0, 4.3, 4.0, 4.5, 4.0, 4.0, 4.3, 4.3, 3.4]}) | |
df2 = df2.set_index(['Paises']) |
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 | |
import numpy | |
from dry.helpers import humanize_time | |
from user.models import User | |
from form.models import Form | |
from ..models import Harvest | |
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
mydict = {} | |
mydict[59] = 150 | |
for restrict in Restrict.objects.filter(question_parent=form.id): | |
new_restrict = Restrict() | |
new_restrict.question = mydict[restrict.id] | |
new_restrict..... | |
new_restrict.save() | |
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 xml.etree import ElementTree as ET | |
import requests | |
import json | |
import xmltodict | |
class buscaCliente(object): | |
def __init__(self, serv_id, codigo, descricao): | |
self.serv_id=serv_id |
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
drwxr-xr-x 8 prod prod 4096 Oct 29 16:19 ./ | |
drwxr-xr-x 8 prod prod 4096 Oct 28 18:11 ../ | |
drwxr-xr-x 2 prod prod 4096 Oct 28 18:10 branches/ | |
-rw-r--r-- 1 prod prod 306 Oct 28 18:11 config | |
-rw-r--r-- 1 prod prod 73 Oct 28 18:10 description | |
-rw-r--r-- 1 root root 112 Oct 29 13:03 FETCH_HEAD | |
-rw-r--r-- 1 prod prod 28 Oct 28 18:11 HEAD | |
drwxr-xr-x 2 prod prod 4096 Oct 28 18:10 hooks/ | |
-rw-r--r-- 1 root root 357088 Oct 29 15:59 index | |
drwxr-xr-x 2 prod prod 4096 Oct 28 18:10 info/ |
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
for i in range(0, len(listaDadosCaixa), 2): | |
try: | |
boleto.drawBoletoCarneDuplo( | |
listaDadosCaixa[i], | |
listaDadosCaixa[i + 1] | |
) | |
boleto.nextPage() | |
except IndexError: | |
boleto.drawBoletoCarneDuplo( | |
listaDadosCaixa[i] |
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
for i in range(0, len(listaDadosCaixa), 2): | |
try: | |
boleto.drawBoletoCarneDuplo( | |
listaDadosCaixa[i], | |
listaDadosCaixa[i + 1] | |
) | |
boleto.nextPage() | |
except IndexError: | |
boleto.drawBoletoCarneDuplo( | |
listaDadosCaixa[i] |
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
if (retornar == 2) { | |
if ((now.format("YYYY-MM-DD") == r_agendado.format("YYYY-MM-DD"))) { | |
console.log('1') | |
console.log(now.format("YYYY-MM-DD"), r_agendado.format("YYYY-MM-DD")) | |
retornar = r_agendado.format("DD/MM hh:mm") | |
editar = "<div class='btn-group'><buttonvalue="+pk+" id='bnt_editar_chamado"+pk+"' type='button' class='btn btn-info'><i class='fa fa-stack-exchange'></i></button></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
#!/bin/bash | |
cd /home/fred/projetos/python/datagoal-2.0.0/datagoal/ | |
NEW_RELIC_CONFIG_FILE=newrelic.ini /home/fred/.virtualenvs/datagoal/bin/newrelic-admin run-program /home/fred/.virtualenvs/datagoal/bin/gunicorn -c /home/fred/projetos/python/datagoal-2.0.0/deploy/gunicorn-fred.conf.py datagoal.wsgi:application |
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
import itertools | |
import re | |
iplist = [] | |
with open('level3.db.new') as myfile: | |
for line in myfile.readlines(): | |
if line.startswith('member'): | |
iplist.append(re.findall(r'[0-9]+(?:\.[0-9]+){3}(?:\/[0-9]+)', line)) |