This file contains 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
A | |
A + Certified | |
A-110 | |
A-122 | |
A-123 | |
A-133 | |
A-frames | |
A-GPS | |
A/B Testing | |
A/R analysis |
This file contains 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
To sell only the stocks that are not there in this week's new strategy and keep the stocks that still remain, you can modify the code as follows: | |
```python | |
import backtrader as bt | |
import pandas as pd | |
# Define the strategy | |
class MyStrategy(bt.Strategy): | |
def __init__(self): |
This file contains 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 logging | |
import collections | |
import threading | |
import time | |
from collections import defaultdict | |
def log_info(message, logger): | |
logger.info(message) | |
time.sleep(3) |
This file contains 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 logging | |
import time | |
import threading | |
from collections import defaultdict | |
def log_info(message,logger): | |
logger.info(message) | |
time.sleep(3) | |
logger.info(message) |
This file contains 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 logging | |
import time | |
import threading | |
import io | |
def log_info(message,logger): | |
logger.info(message) | |
time.sleep(3) | |
logger.info(message) |
This file contains 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 logging | |
import time | |
import threading | |
logger = logging.getLogger() | |
# Set up logging | |
logging.basicConfig( | |
level=logging.INFO, format="%(asctime)s %(message)s", datefmt="%Y-%m-%d %H:%M:%S" | |
) |
This file contains 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
CREATE OR REPLACE FUNCTION schema.ddl_issue() | |
RETURNS event_trigger | |
LANGUAGE plpgsql | |
AS $function$ | |
DECLARE r RECORD; | |
BEGIN | |
FOR r IN SELECT * FROM pg_event_trigger_ddl_commands() LOOP | |
IF ( r.objid::regclass::text = 'schema.tablename' ) | |
THEN | |
RAISE EXCEPTION 'You are not allowed to change %', r.object_identity; |
This file contains 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 upload_gziped_df(bucketName, filename, df): | |
csv_buffer = io.BytesIO() | |
df.to_csv(csv_buffer, index=False, compression="gzip", encoding="utf-8") | |
# write stream to S3 | |
s3 = boto3.client("s3") | |
metadata = { | |
"Content-Encoding": "gzip", | |
} | |
s3.put_object( |
This file contains 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 botocore.client import Config | |
import boto3 | |
def gen_url(key): | |
""" | |
given the name of the file generates a signed download url for the file | |
:param key: filename in s3 | |
:return: presigned URL that has AWS4-HMAC-SHA256 | |
""" | |
expTime = 86400 | |
This file contains 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
server { | |
listen 80; | |
server_name utils.infoassistants.com; | |
location / { | |
proxy_pass http://localhost:3500; | |
proxy_set_header Host $host; | |
proxy_set_header X-Real-IP $remote_addr; | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
proxy_set_header X-Forwarded-Proto $scheme; |
NewerOlder