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 six | |
if six.PY2: | |
from collections import Iterator | |
elif six.PY3: | |
from collections.abc import Iterator | |
# https://github.com/turicas/rows/tree/05cea12a42cc46ebc6ac3d33614a3e77c497e6d4 | |
# https://github.com/turicas/rows/blob/05cea12a42cc46ebc6ac3d33614a3e77c497e6d4/rows/plugins/utils.py#L35-L51 |
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
# encoding=utf8 | |
from django.conf import settings | |
from django.utils import timezone | |
from django.core.files import File | |
from django.core.files.base import ContentFile | |
from django.core.management.base import BaseCommand, CommandError | |
from combo.models import CandidateCV | |
from django.contrib.auth.models import User |
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 nltk | |
from nltk.corpus import stopwords | |
from nltk.tokenize import word_tokenize | |
nltk.download('stopwords') | |
nltk.download('punkt') | |
punctuations = ['(',')',';',':','[',']',','] | |
stop_words = stopwords.words('portuguese') |
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
pdfReader = PyPDF2.PdfFileReader(absolute_file_name) | |
num_pages = pdfReader.numPages | |
count = 0 | |
text_from_pdf = "" | |
while count < num_pages: | |
pageObj = pdfReader.getPage(count) | |
count +=1 | |
text_from_pdf += pageObj.extractText() |
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 sys | |
for index, item in enumerate(range(0,100000000)): | |
# efeito loading | |
current = index + 1 | |
filled_length = int(100 * current // total_items) | |
bar = '*' * filled_length + '-' * (100 - filled_length) | |
percent = 100 * (current / total_items) | |
percent = ("{0:." + '1' + "f}").format(100 * (current / float(total_items))) |
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
new_candidates = CompanyCandidate.objects.filter(company=obj,date__range=[date_initial, date_end]) | |
truncate_newcand = connection.ops.date_trunc_sql('month', 'date') | |
context['new_candidates_total'] = len(new_candidates) | |
context['new_candidates_ext'] = new_candidates.extra({'month': truncate_newcand}).values( | |
'month').annotate(jcount=Count('pk')).order_by('month') |
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 export_job_agenda(request, job): | |
# import ipdb; ipdb.set_trace() | |
job_object = get_object_or_404(Job, pk=job) | |
schedule = Schedule.objects.filter(job=job_object) | |
list_schedule = [] | |
# para cada agendamento | |
for sc in schedule: |
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 export_job_agenda(request, job): | |
# import ipdb; ipdb.set_trace() | |
job_object = get_object_or_404(Job, pk=job) | |
schedule = Schedule.objects.filter(job=job_object) | |
list_schedule = [] | |
# para cada agendamento | |
for sc in schedule: |
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 export_job_agenda(request, job): | |
# import ipdb; ipdb.set_trace() | |
job_object = get_object_or_404(Job, pk=job) | |
schedule = Schedule.objects.filter(job=job_object) | |
list_schedule = [] | |
# para cada agendamento | |
for sc in schedule: |
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 export_job_agenda(request, job): | |
# import ipdb; ipdb.set_trace() | |
job_object = get_object_or_404(Job, pk=job) | |
schedule = Schedule.objects.filter(job=job_object) | |
list_schedule = [] | |
# para cada agendamento | |
for sc in schedule: |