I hereby claim:
- I am piraka9011 on github.
- I am piraka9011 (https://keybase.io/piraka9011) on keybase.
- I have a public key ASDd9K7I5IP02lGwyyIffqaVXQhE-pXhF2nMYj5vjT9xMQo
To claim this, I am signing this object:
| { | |
| '$metadata': { | |
| httpStatusCode: 200, | |
| requestId: 'dcc840e7-ec47-4211-a7fe-3256ccc45ea5', | |
| extendedRequestId: undefined, | |
| cfId: undefined, | |
| attempts: 1, | |
| totalRetryDelay: 0 | |
| }, | |
| MessageId: '0101018c3f47fd6b-249a9b20-99a7-4aa7-8d14-756ef149ea1a-000000' |
| from datetime import datetime | |
| from django.db import models | |
| from django_filters import FilterSet | |
| from django_filters.filters import Filter | |
| from my_app.models import MyModel # FIXME | |
| class UnixEpochDateFilter(Filter): | |
| def filter(self, qs, value): |
| from typing import Any, Optional | |
| from urllib.parse import urlparse, urlunparse | |
| from xml.etree import ElementTree | |
| from botocore.auth import S3SigV4Auth | |
| from botocore.awsrequest import AWSRequest | |
| from botocore.credentials import Credentials | |
| from django.conf import settings | |
| from requests import Response, request |
| // See https://vercel.com/docs/workflow-collaboration/comments/specialized-usage#using-a-content-security-policy | |
| const VERCEL_BASE_CSP = 'https://vercel.live/ https://vercel.com https://*.vercel.com' | |
| const VERCEL_CSP_DEFAULT_SRC = `${VERCEL_BASE_CSP} wss://*.pusher.com`; | |
| const VERCEL_CSP_IMG_SRC = `${VERCEL_BASE_CSP} https://sockjs-mt1.pusher.com/`; | |
| const GOOGLE_FONTS_BASE_CSP = 'https://*.gstatic.com'; | |
| const ContentSecurityPolicy = ` | |
| default-src 'self' *.mixpanel.com *.stripe.com *.sentry.io ${VERCEL_CSP_DEFAULT_SRC} ${GOOGLE_FONTS_BASE_CSP}; | |
| style-src 'self' 'unsafe-inline'; | |
| script-src 'self' '${process.env.VERCEL_ENV === "preview" ? 'unsafe-inline' : 'unsafe-eval'}' *.mixpanel.com *.stripe.com ${VERCEL_BASE_CSP}; | |
| img-src 'self' ${VERCEL_CSP_IMG_SRC} data: blob:; |
| def start_or_create_ec2_instance(self, instance_id=None, region_name="us-west-2", **kwargs): | |
| session = boto3.session.Session(region_name=region_name) | |
| ssm = session.client("ssm") | |
| # Default to open SSH security groups | |
| sg_id_region_map = { | |
| "us-west-2": "sg-xxxx", | |
| "us-east-1": "sg-xxxx", | |
| } | |
| # Default to public subnets | |
| subnet_id_region_map = { |
| import boto3 | |
| from tqdm import tqdm | |
| # Estimate from the S3 console | |
| NUM_OBJECTS = 17292115 | |
| def list_objects_parallel(bucket, prefix): | |
| objects = [] | |
| pbar = tqdm(total=NUM_OBJECTS) |
| from torch.quantization import quantize_dynamic | |
| from torch.utils.mobile_optimizer import optimize_for_mobile | |
| from nemo.collections.asr.models import EncDecCTCModelBPE | |
| # from nemo.collections.asr.parts.preprocessing import FilterbankFeatures | |
| from omegaconf import OmegaConf | |
| import torch | |
| import torchaudio | |
| import math | |
| import random |
| """This is a full example of a trace sampler that filters transactions for: | |
| 1. Django views/routes/urls (whatever you want to call them) | |
| 2. Celery tasks | |
| Generally, you would put this in your `settings.py` file, but you can put format it as needed for your project of course. | |
| We are assuming you use `django-environ` for secrets management. | |
| """ | |
| import environ | |
| import sentry_sdk |
| import os | |
| import wave | |
| if __name__ == '__main__': | |
| directory = '/Users/allabana/tarteel_ws/tarteel-recordings/media' | |
| (_, _, filenames) = next(os.walk(directory)) | |
| bad_files = [] | |
| for filename in filenames: | |
| wave_filename = os.path.join(directory, filename) | |
| try: |
I hereby claim:
To claim this, I am signing this object: