This file contains 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 asyncio | |
from fastapi import FastAPI | |
from pydantic import BaseModel | |
from typing import List | |
import sqlalchemy | |
from sqlalchemy.ext.asyncio import create_async_engine | |
engine = create_async_engine( | |
"sqlite+aiosqlite:///simulations.db", echo=True, future=True | |
) |
This file contains 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 | |
from pyrfc import Connection, ABAPApplicationError, ABAPRuntimeError, LogonError, CommunicationError | |
class RFC_Handle(object): | |
def __init__(self): | |
self.conn = None | |
def login(self, sap_id, sap_pwd): | |
try: |
This file contains 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 | |
from pyrfc import Connection, ABAPApplicationError, ABAPRuntimeError, LogonError, CommunicationError | |
class RFC_Handle(object): | |
def __init__(self): | |
self.conn = None | |
def login(self, sap_id, sap_pwd): | |
try: |
This file contains 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 pyrfc import Connection, ABAPApplicationError, ABAPRuntimeError, LogonError, CommunicationError | |
class RFC_Handle(object): | |
def __init__(self): | |
self.conn = None | |
def login(self, sap_id, sap_pwd): | |
try: | |
self.sap_id = sap_id |
This file contains 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 handle_last_index(elements, last_index): | |
grouped = [] | |
for i, _ in enumerate(last_index): | |
if i == 0: | |
grouped.append(' '.join(elements[:last_index[i] + 1])) | |
elif i == len(last_index) - 1: | |
grouped.append(' '.join(elements[last_index[i - 1] + 1:])) | |
else: | |
grouped.append(' '.join(elements[last_index[i - 1] + 1:last_index[i] + 1])) |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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 scipy.spatial.distance import pdist, squareform | |
import numpy as np | |
from numbapro import jit, float32 | |
def distcorr(X, Y): | |
""" Compute the distance correlation function | |
>>> a = [1,2,3,4,5] | |
>>> b = np.array([1,2,9,4,4]) |