<commit_before>from django.shortcuts import render
from django.http import HttpResponse
from django.template import RequestContext, loader

from .tools import get_point_cloud

# Create your views here.

def fetch_point_cloud(request):
  import json
  from voxel_globe.serializers.numpyjson import NumpyAwareJSONEncoder
  import numpy as np

  request_data = request.POST
  voxel_world_id = int(request_data["voxelWorldId"])
  number_points = int(request_data.get("points", 100))
  try:
    points = get_point_cloud(voxel_world_id)
  except:
    ## Hack-a-code
    np.random.seed(voxel_world_id)
    latitude = float(request_data.get("latitude", 40.423256522222))+(np.random.rand(number_points)*2-1)*0.01
    longitude = float(request_data.get("longitude", -86.913520311111))+(np.random.rand(number_points)*2-1)*0.01
    altitude =  float(request_data.get("altitude", 200))+(np.random.rand(number_points)*2-1)*50
    color = 0<commit_msg>Changed fetch_point_cloud to GET instead of POST<commit_after>from django.shortcuts import render
from django.http import HttpResponse
from django.template import RequestContext, loader

from .tools import get_point_cloud

# Create your views here.

def fetch_point_cloud(request):
  import json
  from voxel_globe.serializers.numpyjson import NumpyAwareJSONEncoder
  import numpy as np

  request_data = request.GET
  voxel_world_id = int(request_data["voxelWorldId"])
  number_points = int(request_data.get("points", 100))
  try:
    points = get_point_cloud(voxel_world_id)
  except:
    ## Hack-a-code
    np.random.seed(voxel_world_id)
    latitude = float(request_data.get("latitude", 40.423256522222))+(np.random.rand(number_points)*2-1)*0.01
    longitude = float(request_data.get("longitude", -86.913520311111))+(np.random.rand(number_points)*2-1)*0.01
    altitude =  float(request_data.get("altitude", 200))+(np.random.rand(number_points)*2-1)*50
    color = 0
{'fraction_non_alphanumeric': 0.11425576519916142, 'fraction_numerical': 0.051362683438155136, 'mean_word_length': 5.427609427609427, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '7466712', 'n_tokens_mistral': 712, 'n_tokens_neox': 646, 'n_words': 119}