def wrapper(*args, **kwargs): if args: data = marshal(first(args), schema, before=True) rmap = f(data, **kwargs) body = marshal(rmap['body'], schema) return merge(rmap, {'body': body}) else: rmap = f(*args, **kwargs) body = marshal(rmap['body'], schema) return merge(rmap, {'body': body})
def direct_iti(): departurePoint = request.args.get('fromPlace', '') depLat,depLon = parse_commas(departurePoint) endPoint = request.args.get('toPlace', '') endLat,endLon = parse_commas(endPoint) if 'err' == depLat or 'err' == endLat: return "Erreur Argument !" itiList = [] iti = sendRequest(depLat, depLon, endLat, endLon, "toPark") itiList.append(functions.merge([iti])) return jsonify(results=itiList)
def route(): itiList = [] departurePoint = request.args.get('fromPlace', '') depLat,depLon = parse_commas(departurePoint) endPoint = request.args.get('toPlace', '') endLat,endLon = parse_commas(endPoint) if 'err' == depLat or 'err' == endLat: return "Erreur Argument !" parkingList = functions.closestParking(depLat, depLon) for parking in parkingList: park_iti = sendRequest(depLat, depLon, parking['posx'], parking['posy'], "toPark") dest_iti = sendRequest(parking['posx'], parking['posy'], endLat, endLon) itiList.append(functions.merge([park_iti, dest_iti])) return jsonify(results=itiList)
original_data[original_data == 0.0000] = np.nan original_data = torch.Tensor(original_data) original_data = normalize_series(original_data, mean_pose=mean_pose, data_max_val=max_val) estimates = np.empty((0, 200, 30)) criterion = nn.MSELoss() for window in split_data: window = torch.Tensor(window).unsqueeze(0) window = window.float() window = normalize_series(window, mean_pose=mean_pose, data_max_val=max_val) window = window.to(device) estimate = net(window) estimate = torch.Tensor.cpu(estimate) estimate = torch.detach(estimate).numpy() estimates = np.append(estimates, estimate, axis=0) estimated = merge(estimates, padding=1, result_dim=(0, 30)) original_data = original_data.numpy() gap_filled = gap_fill(original_data, estimated) # np.save('A001P001T028_gaps', original_data) np.save('A001P001T028_gap_filled', gap_filled) np.save('A001P001T028_estimated', estimated)
word = functions.goodletter(word_to_guess, letter) if word=="-"*len(word_to_guess) and letter and len(letter)==1: count+=1 if not letter or len(letter)>1: print "Invalid!" else: print word print "Left:",values.retries-count, "retries." #GAME2 #TODO: Merge GAME1 and GAME2 while count<values.retries: letter=raw_input("Type a letter: ") word1 = functions.goodletter(word_to_guess, letter) word = functions.merge(word, word1, "-") if word1=="-"*len(word_to_guess) and letter and len(letter)==1: count+=1 if not letter or len(letter)>1: print "Invalid!" else: print word print "Left:",values.retries-count, "retries." #win/lose if word==word_to_guess: print "You win." score+=count break if word!=word_to_guess: print "You lose.\nThe word was", word_to_guess
import argparse from functions import merge if __name__ == '__main__': parser = argparse.ArgumentParser( description='Merging multiple MSDN product key export XMLs.') parser.add_argument('INPUT', nargs='*', help='Input files') parser.add_argument('--output', default='output.xml', help='Output path, default output.xml') args = parser.parse_args() docs = args.INPUT if not docs: print('No input file specified.') exit() out = args.output merge(docs, out)
import easygui as eg from functions import merge if __name__ == '__main__': input_files = eg.fileopenbox('Open', filetypes='*.xml', multiple=True) if not input_files: eg.msgbox('Please select XMLs.') exit() output_file = eg.filesavebox('Save', filetypes='*.xml', default='output.xml') if not output_file: eg.msgbox('Please select save path.') exit() merge(input_files, output_file) eg.msgbox('Files merged.')