<commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-

import sys, os
import urllib, urllib2
import logging
import re

CINE35_URL="http://cine35.com/"

FIND_MOVIE_REGEXP = """<form method="GET" action="Film.asp">(.*?)</form>"""
MOVIE_INFO_REGEXP = """<option value="(.*?)">(.*?)</option>"""

MOVIE_DETAIL_URL = "http://www.cine35.com/Film.asp?Code=%s"

def get_url_data(url):
	
	u = urllib2.urlopen(url)
	data = u.read()
	info = u.info()
	u.close()

	data = data.decode("cp1252").encode('utf-8')  

	return data
	
def get_all_movie():
	
	# 2. Get raw data from allocine
	data = get_url_data(CINE35_URL)
	
	# 3. Get 
	match_form = re.search(FIND_MOVIE_REGEXP, data, re.DOTALL | re.MULTILINE )
	movies_data = match_form.group(0)
	
	match_list = re.findall(MOVIE_INFO_REGEXP, movies_data, re.DOTALL | re.MULTILINE | re.I)

	
	return match_list

def search_movie(movie_title):
	
	movie_list = get_all_movie()<commit_msg>get all movie en convertissant les titre en unicode<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-

import sys, os
import urllib, urllib2
import logging
import re

CINE35_URL="http://cine35.com/"

FIND_MOVIE_REGEXP = """<form method="GET" action="Film.asp">(.*?)</form>"""
MOVIE_INFO_REGEXP = """<option value="(.*?)">(.*?)</option>"""

MOVIE_DETAIL_URL = "http://www.cine35.com/Film.asp?Code=%s"

def get_url_data(url):
	
	u = urllib2.urlopen(url)
	data = u.read()
	info = u.info()
	u.close()

	data = data.decode("cp1252").encode('utf-8')  

	return data
	
def get_all_movie():
	
	# 2. Get raw data from allocine
	data = get_url_data(CINE35_URL)
	
	# 3. Get 
	match_form = re.search(FIND_MOVIE_REGEXP, data, re.DOTALL | re.MULTILINE )
	movies_data = match_form.group(0)
	
	match_list = re.findall(MOVIE_INFO_REGEXP, movies_data, re.DOTALL | re.MULTILINE | re.I)

	return match_list

def get_all_movie_unicode():

	movies_from_cine35 = get_all_movie()
	u_movies_from_cine35 =  [(x.decode('utf-8'),y.decode('utf-8')) for  x, y in movies_from_cine35]
	return u_movies_from_cine35

def search_movie(movie_title):
	
	movie_list = get_all_movie()
{'fraction_non_alphanumeric': 0.16514203177660086, 'fraction_numerical': 0.023110255175734232, 'mean_word_length': 4.601078167115903, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3584092', 'n_tokens_mistral': 934, 'n_tokens_neox': 842, 'n_words': 156}