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_core_components as dcc | |
| import dash_html_components as html | |
| from dash_html_components.Label import Label | |
| from pandas.io.formats import style | |
| import plotly.express as px | |
| import pandas as pd | |
| from dash.dependencies import Input, Output | |
| app = dash.Dash( |
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
| Virtualenv | Poetry | |
|---|---|---|
| virtualenv env | poetry init --no-interaction |
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
| repos: | |
| - repo: https://github.com/pre-commit/pre-commit-hooks | |
| rev: v4.0.1 | |
| hooks: | |
| - id: requirements-txt-fixer |
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
| # trainable property is available on model instances | |
| model.trainable = False | |
| # Also on individual layers | |
| layer.trainable = False |
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 tensorflow as tf | |
| # create and train a keras neural network | |
| classifier = tf.keras.models.Sequential([ | |
| tf.keras.layers.Dense(units=1, input_shape=[1]), | |
| tf.keras.layers.Dense(units=28, activation='relu'), | |
| tf.keras.layers.Dense(units=1) | |
| ]) | |
| classifier.compile(optimizer='sgd', loss='mean_squared_error') | |
| classifier.fit(x=[-1, 0, 1], y=[-3, -1, 1], epochs=5) |
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 aim.sdk.adapters.keras import AimCallback | |
| model.fit(x_train, y_train, epochs=epochs, callbacks=[ | |
| AimCallback(repo='/path/to/logs/dir', experiment='experiment_name') | |
| ]) | |
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 sys | |
| from PyQt5.QtWidgets import QApplication, QWidget, QLabel | |
| from PyQt5.QtGui import QIcon | |
| from PyQt5.QtCore import pyqtSlot | |
| def window(): | |
| app = QApplication(sys.argv) | |
| widget = QWidget() | |
| textLabel = QLabel(widget) |
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 django.urls import path | |
| from views import sum_odd_numbers | |
| urlpatterns = [ | |
| path("sum_odd_numbers/<int:n>", sum_odd_numbers), | |
| ] |
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
| INSTALLED_APPS = [ | |
| "django.contrib.admin", | |
| "django.contrib.auth", | |
| "django.contrib.contenttypes", | |
| "django.contrib.sessions", | |
| "django.contrib.messages", | |
| "django.contrib.staticfiles", | |
| # Your app | |
| "myawesomeapp", | |
| ] |
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 pipe import chain | |
| nested_list = [[1, 2, 3], [4, 5, 6], [7, [8, 9]]] | |
| unfolded_list = list(nested_list | |
| | chain | |
| ) | |
| print(unfolded_list) |