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
# | |
# SPDX-FileCopyrightText: 2021 Splunk, Inc. <[email protected]> | |
# SPDX-License-Identifier: LicenseRef-Splunk-8-2021 | |
# | |
# | |
import import_declare_test # noqa: F401 # isort: skip | |
import logging |
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 json | |
import time | |
import requests | |
while True: | |
event = { | |
"index": "main", | |
"event": {"name": "goodbye", "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 json | |
import time | |
import requests | |
while True: | |
event = { | |
"index": "main", | |
"event": {"name": "goodbye", "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 | |
from datetime import date, datetime | |
from flask import jsonify | |
from typing import Generator, List | |
from github import Github | |
from github.Referrer import Referrer | |
from github.Repository import Repository | |
from google.cloud import firestore |
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
Country | Capital | Quantity | |
---|---|---|---|
United States | Washington D.C. | 155 | |
Philippines | Manila | 141 | |
Mexico | Mexico City | 120 | |
Kuwait | Kuwait City | 118 | |
Indonesia | Jakarta | 110 | |
Japan | Tokyo | 104 | |
Chile | Santiago | 103 | |
Malaysia | Kuala Lumpur | 103 | |
Thailand | Bangkok | 103 |
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 collections | |
CountryCityCoords = collections.namedtuple( | |
"CountryCityCoords", ["country_name", "capital_name", "capital_lat", "capital_lng"] | |
) | |
class StarbucksCitySearcher(object): | |
def __init__(self, e: CountryCityCoords): | |
self.lat = float(e.capital_lat) |
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 get_near_coords(lat: float, lng: float, offset=0.1): | |
for r in [offset, -offset]: | |
yield (lat + r, lng) | |
for r in [offset, -offset]: | |
yield (lat, lng + r) |
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 json | |
import pika | |
from scrapy.utils.serialize import ScrapyJSONEncoder | |
class RabbitMQItemPublisherPipeline(object): | |
def __init__(self, host, port, user, password, virtual_host, exchange, routing_key, queue): | |
self.host = host | |
self.port = port |
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 json | |
from celery import Celery | |
from celery import bootsteps | |
from kombu import Consumer, Exchange, Queue | |
queue = Queue("input.queue", Exchange("default"), "input.key") | |
app = Celery(broker="amqp://") |
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 celery import Celery | |
app = Celery( | |
"app", | |
broker="amqp://guest@localhost//", | |
backend="rpc", | |
) | |
@app.task | |
def add(x, y): |
NewerOlder