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 os, sys # Possible to import most packages; go to [Installed Packages] tab, type in the names | |
# delimited by comma of the packages you want to install. | |
# Click on [Add Package(s)] | |
# Then import those packages, e.g. import attrs | |
import logging | |
from logging import getLogger | |
logger = getLogger(__name__) | |
logging.basicConfig(level=logging.INFO, format='%(asctime)s %(levelname)-8s [%(filename)s:%(lineno)d] %(message)s', stream=sys.stdout) |
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
#!/bin/bash | |
# Function to create directories | |
create_directories() { | |
mkdir -p $PROJECT_NAME/{source,include,tests,build,docs,cmake} | |
} | |
# Function to create a README file | |
create_readme() { | |
cat << EOF > $PROJECT_NAME/README.md |
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 { describe, expect, test } from '@jest/globals'; | |
import { Secret } from './secret'; | |
describe('Secret<T> Class', () => { | |
// Test Case 1: Creating a Secret with an initial secret value | |
it('should create a Secret with an initial secret value', () => { | |
const secret = new Secret<string>('mySecret'); | |
expect(secret.toString()).toBe('Secret<string>'); | |
expect(secret.exposeSecret()).toBe('mySecret'); | |
}); |
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 ast | |
from ast import NodeVisitor | |
import inspect | |
import textwrap | |
from types import MethodType | |
from typing_extensions import Annotated | |
from abc import ABCMeta | |
from pydantic.main import ModelMetaclass | |
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
#include <algorithm> | |
#include <array> | |
#include <iostream> | |
#include <cassert> | |
#include <cstddef> | |
#include <typeinfo> | |
template <std::size_t N> | |
struct IsSizeEven : std::integral_constant<bool, (N % 2) == 0> | |
{ |
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 add_text_to_right_of_logo( | |
logo_filepath: str, | |
text_string: str, | |
output_filepath: str = None, | |
font_family_filepath: str = 'GlacialIndifference-Bold.otf', | |
text_color_in_hex: str = '#ffffff', | |
anchor_of_text: str = 'lm'): | |
logo = Image.open(logo_filepath) | |
font_size = 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
def _partial(func, *args, **keywords): | |
@wraps(func) # functools.wraps doesn't wrap func, so add it here | |
def newfunc(*fargs, **fkeywords): | |
newkeywords = {**keywords, **fkeywords} | |
return func(*args, *fargs, **newkeywords) | |
newfunc.func = func | |
newfunc.args = args | |
newfunc.keywords = keywords | |
return newfunc |
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 openpyxl.workbook import Workbook | |
from openpyxl import load_workbook | |
from openpyxl.utils.cell import range_boundaries | |
import pandas as pd | |
import numpy as np | |
def _parse_xlxs_merged_cells(filepath, how='top-left'): | |
""" | |
Takes in a Path-like object specifying the .xlsx file and returns a pandas DataFrame with unmerged cells' values | |
appropriately filled. |
NewerOlder