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
@echo OFF | |
set POWERSHELL_SCRIPT=^ | |
$securePwd = Read-Host "Enter passphrase" -AsSecureString; ^ | |
$plainPwd =[Runtime.InteropServices.Marshal]::PtrToStringAuto([Runtime.InteropServices.Marshal]::SecureStringToBSTR($securePwd));^ | |
Write-Host $plainPwd | |
for /f %%a in ('powershell -Command "&{%POWERSHELL_SCRIPT%}"') do ( | |
set "USER_SECRET=%%~a" | |
set "ARTIFACTS_SECRET=%%~a" | |
) |
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
class Node: | |
""" | |
Simple class definition for a Node, in case of trees where nodes may have more | |
than two children, a `children` list could be used to contain these references instead. | |
The important thing to note about this representation is that the attributes | |
`left` and `right` will become references to other instances of the `Node` class. | |
For example, when we insert a new left child into the tree we create another | |
instance of `Node` and modify `self.left` in the root to reference the new |
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 | |
class Node: | |
def __init__(self, value): | |
self.value = value | |
self.next = None | |
class DoubleNode: | |
def __init__(self, value): |
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 | |
import collections | |
_ntuple_diskusage = collections.namedtuple('usage', 'total used free') | |
__doc__ = """ | |
Function to return the disk usage for a given path. Works for both Windows & Linux/MaxOS systems. | |
Returns: | |
Named Tuple: (usage.total, usage.used, usage.free) | |
""" |
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
class BaseDataStructure: | |
def __init__(self): | |
self._items = [] | |
def isEmpty(self): | |
return self._items == [] | |
def peek(self): | |
return self._items[len(self._items) - 1] |