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 React, { Component } from "react"; | |
| import instance from "../axiosInstanceReact"; | |
| class Home extends Component { | |
| constructor(props) { | |
| super(props); | |
| this.state = {}; | |
| } | |
| async componentDidMount() { |
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 numpy as np | |
| from sklearn.cluster import DBSCAN | |
| from sklearn import metrics | |
| from sklearn.datasets.samples_generator import make_blobs | |
| from sklearn.preprocessing import StandardScaler | |
| centers = [[1, 1], [-1, -1], [1, -1]] | |
| X, labels_true = make_blobs(n_samples=750, centers=centers, cluster_std=0.4, | |
| random_state=0) | |
| X = StandardScaler().fit_transform(X) |
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
| from sklearn.neighbors.nearest_centroid import NearestCentroid | |
| import numpy as np | |
| X = np.array([[-1, -1], [-2, -1], [-3, -2], [1, 1], [2, 1], [3, 2]]) | |
| y = np.array([1, 1, 1, 2, 2, 2]) | |
| clf = NearestCentroid() | |
| clf.fit(X, y) | |
| print(clf.predict([[-0.8, -1]])) |
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 time | |
| import math | |
| def time_since(val: str) -> str: | |
| '''Returning since time''' | |
| sec = math.floor(time.time() - float(val)) | |
| interval = sec // 31536000 | |
| if interval > 1: | |
| return f'{math.floor(interval)} years ago' |
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 arithmetic_arranger(data, cond=False): | |
| if len(data) > 5: | |
| raise ValueError('Too many problems') | |
| req = '' | |
| req1 = '' | |
| req2 = '' | |
| req3 = '' |