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
| // SPDX-License-Identifier: MIT | |
| pragma solidity ^0.6.0; | |
| interface AggregatorV3Interface { | |
| function decimals() | |
| external | |
| view | |
| returns ( | |
| uint8 |
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
| # Edited run_test() in ExampleTest class in bitcoin/test/functional/example_test.py | |
| # Test mines a new block on node1, sends block to node2 and checks to see if node2 recieved. | |
| def run_test(self): | |
| """Main test logic""" | |
| # Create P2P connections will wait for a verack to make sure the connection is fully up | |
| peer_messaging = self.nodes[0].add_p2p_connection(BaseNode()) | |
| # Generating a block on one of the nodes will get us out of IBD | |
| blocks = [int(self.nodes[0].generate(nblocks=1)[0], 16)] |
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 dash_core_components as dcc | |
| import dash_html_components as html | |
| from dash.dependencies import Input, Output | |
| from layouts import example_graph1, example_graph2 | |
| from app import app | |
| @app.callback( | |
| Output("tab-content", "children"), | |
| Input("tabs", "active_tab"), | |
| ) |
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 dash_core_components as dcc | |
| import dash_html_components as html | |
| import dash_bootstrap_components as dbc | |
| from app import app | |
| import plotly.express as px | |
| ##################################### | |
| # Add your data | |
| ##################################### |
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 dash_core_components as dcc | |
| import dash_html_components as html | |
| from dash.dependencies import Input, Output | |
| from app import app, server | |
| #import your navigation, styles and layouts from layouts.py here | |
| from layouts import nav_bar, layout1, layout2, CONTENT_STYLE | |
| import callbacks | |
| # Define basic structure of app: |
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 dash | |
| import dash_bootstrap_components as dbc | |
| #Instantiates the Dash app and identify the server | |
| app = dash.Dash(__name__, external_stylesheets=[dbc.themes.BOOTSTRAP]) | |
| server = app.server |
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
| # instantiate the model and fit the timeseries | |
| prophet = Prophet(weekly_seasonality=False, changepoint_range=1,changepoint_prior_scale=0.75) | |
| prophet.fit(ts) | |
| # create a future data frame | |
| future = prophet.make_future_dataframe(periods=25) | |
| forecast = prophet.predict(future) | |
| # display the most critical output columns from the forecast | |
| forecast[['ds','yhat','yhat_lower','yhat_upper']].head() |
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 fbprophet.plot import add_changepoints_to_plot | |
| a = add_changepoints_to_plot(fig.gca(),m,forcast) | |
| fig |
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 fbprophet import Prophet | |
| # instantiate the model and fit the timeseries | |
| prophet = Prophet() | |
| prophet.fit(ts) | |
| # create a future data frame | |
| future = prophet.make_future_dataframe(periods=25) | |
| forecast = prophet.predict(future) |
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 pandas as pd | |
| # read data from NY times | |
| df = pd.read_csv("https://raw.githubusercontent.com/nytimes/covid-19-data/master/us.csv") | |
| # engineer new cases | |
| df['new_cases'] = df.cases - df.cases.shift().fillna(0) | |
| # create pandas time series | |
| df.date = pd.to_datetime(df.date) |
NewerOlder