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 import_submodules(module: ModuleType, level: int = 1, modules_only: bool = True) -> List[str]: | |
| """Import all submodules of a module, recursively. | |
| Args: | |
| modules_only: If set to True, only modules are imported. If False, packages are | |
| imported as well. | |
| module: Module/package which sub-modules should be imported. | |
| level: Limit import depth. Set to zero or negative to import all level. | |
| For example the following structure is present: | |
| .. code-block:: |
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 | |
| import numpy as np | |
| days = pd.date_range('2021-01-01', '2021-12-31', freq='d') | |
| # items | |
| items = [] | |
| item_ids = range(100) |
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 nbformat | |
| import os | |
| from nbconvert.preprocessors import ExecutePreprocessor, CellExecutionError | |
| from nbconvert import HTMLExporter | |
| from nbconvert.writers import FilesWriter | |
| import papermill.parameterize | |
| def prepare_metadata(nb): | |
| if not hasattr(nb.metadata, 'papermill'): |
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
| // ==UserScript== | |
| // @name Mark All Read | |
| // @namespace Yammer | |
| // @description Marks all incoming messages as read | |
| // @include https://www.yammer.com/* | |
| // @version 1 | |
| // @grant none | |
| // ==/UserScript== | |
| var limit = 300; |
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
| public class SolrUnityModule | |
| { | |
| public static void RegisterSolrOperations(UnityContainer container, bool registerPostOperations) | |
| { | |
| //register regular implementation | |
| var solrConfig = (SolrConfigurationSection)ConfigurationManager.GetSection("solr"); | |
| new SolrNetContainerConfiguration().ConfigureContainer(solrConfig.SolrServers, container); | |
| //PostConnection registration | |
| if (registerPostOperations) |