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
class Service(JsonWebServiceBase): | |
""" | |
Base class for new-style REST API services. | |
Provide methods for arguments parsing and implementation finding. | |
""" | |
def __init__(self, uri): |
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
"""Example app to understand how ConfigMan can find all the configuration keys | |
an application needs. """ | |
from configman import ConfigurationManager, Namespace, RequiredConfig | |
from configman.converters import class_converter | |
class A(RequiredConfig): | |
"""Example class that can execute an action an has some required config.""" | |
required_config = Namespace() |
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
""" | |
elasticsearch challenge! | |
From this data set: | |
{ | |
'name': 'Adrian', | |
'sex': 'male', | |
'age': 'young' | |
}, |
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 base64 | |
import libtorrent as lt | |
import os | |
import shutil | |
import thread | |
import time | |
import tkFont | |
import urllib2 | |
from bs4 import BeautifulSoup | |
from Tkinter import * |
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 copy | |
import json | |
PARAM_TO_FIELD_MAPPING = { | |
# Processed crash keys. | |
'build_id': 'build', | |
'date': 'date_processed', | |
'platform': 'os_name', | |
'platform_version': 'os_version', |
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 datetime | |
import os | |
import requests | |
def look_for_module(dump, module, count_mode=False): | |
count = 0 | |
for thread in dump['threads']: | |
for frame in thread['frames']: |
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
#! /usr/bin/env python | |
# This Source Code Form is subject to the terms of the Mozilla Public | |
# License, v. 2.0. If a copy of the MPL was not distributed with this | |
# file, You can obtain one at http://mozilla.org/MPL/2.0/. | |
"""This app inserts a set of fake crash reports into elasticsearch, based | |
on date parameters. | |
This app can be invoked like this: | |
.../scripts/populate_elasticsearch_app.py --help |
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 socorro.external.es.supersearch import SuperSearch | |
def get_uuids(config): | |
api = SuperSearch(config=config) | |
params = { | |
'signature': '=my_sig', # signature is exactly "my_sig" | |
'_columns': ['uuid'], | |
'_results_number': 100, | |
'_results_offset': 0, | |
} |
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
2015-08-19 20:26:33,215 INFO - middleware - - MainThread - resource.fs.dump_field: upload_file_minidump | |
2015-08-19 20:26:33,216 INFO - middleware - - MainThread - resource.fs.dump_file_suffix: .dump | |
2015-08-19 20:26:33,216 INFO - middleware - - MainThread - resource.fs.fs_root: ./crashes | |
2015-08-19 20:26:33,216 INFO - middleware - - MainThread - resource.fs.json_file_suffix: .json | |
2015-08-19 20:26:33,216 INFO - middleware - - MainThread - resource.fs.jsonz_file_suffix: .jsonz | |
2015-08-19 20:26:33,216 INFO - middleware - - MainThread - resource.fs.name_branch_base: name | |
2015-08-19 20:26:33,216 INFO - middleware - - MainThread - resource.fs.umask: 18 |
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 requests | |
def main(): | |
url = 'https://crash-stats.mozilla.com/api/SuperSearch/' | |
params = { | |
'product': 'Firefox', | |
'_aggs.signature': [ | |
'_histogram.available_physical_memory', | |
'_histogram.available_virtual_memory', |
OlderNewer