Module Import alias Import alias Import alias Import alias Import alias Import alias Import alias Import alias Import alias ImportFrom alias TryExcept body ImportFrom alias handlers ExceptHandler type NameLoad body ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias FunctionDef arguments args defaults body Expr Str If Call NameLoad body Assign NameStore Call AttributeLoad Str attr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Return TupleLoad NameLoad Call NameLoad NameLoad Str orelse Assign NameStore Call AttributeLoad NameLoad attr Return TupleLoad AttributeLoad NameLoad attr NameLoad decorator_list ClassDef bases AttributeLoad NameLoad attr body FunctionDef arguments args NameParam defaults body Assign TupleStore AttributeStore NameLoad attr AttributeStore NameLoad attr Call NameLoad Assign NameStore Call NameLoad Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Str Str SubscriptLoad AttributeLoad NameLoad attr Index Str Expr Call AttributeLoad NameLoad attr Str Str SubscriptLoad AttributeLoad NameLoad attr Index Str Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Expr Call AttributeLoad AttributeLoad NameLoad attr attr decorator_list FunctionDef arguments args NameParam defaults body Assign TupleStore NameStore NameStore NameStore Call AttributeLoad NameLoad attr ListLoad Str keyword NameLoad decorator_list FunctionDef arguments args NameParam defaults body Assert CompareEq Call AttributeLoad NameLoad attr Call NameLoad Assert CompareEq Call AttributeLoad NameLoad attr Call NameLoad decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore ListLoad Str Str Assign NameStore Str Assign NameStore Dict Assign TupleStore NameStore NameStore NameStore Call AttributeLoad NameLoad attr NameLoad keyword NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assert CompareIn Str NameLoad NameLoad Assert CompareIn Str NameLoad NameLoad Assert CompareIn Str NameLoad NameLoad Assert CompareIn NameLoad SubscriptLoad NameLoad Index Str Assign NameStore ListLoad Str Str SubscriptLoad NameLoad Index Str Assign TupleStore NameStore NameStore NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assert CompareIn NameLoad SubscriptLoad NameLoad Index Str Assign NameStore ListLoad Str Str SubscriptLoad NameLoad Index Str Assign NameStore Str Assign TupleStore NameStore NameStore NameStore Call AttributeLoad NameLoad attr NameLoad keyword NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Str SubscriptLoad NameLoad Index Str Assert CompareIn NameLoad SubscriptLoad NameLoad Index Str Assign NameStore ListLoad Str Str SubscriptLoad NameLoad Index Str Assign TupleStore NameStore NameStore NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assert CompareIn NameLoad SubscriptLoad NameLoad Index Str Assign NameStore ListLoad Str Str SubscriptLoad NameLoad Index Str Assign TupleStore NameStore NameStore NameStore Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Str Assign NameStore ListLoad Str Str SubscriptLoad NameLoad Index Str Assign TupleStore NameStore NameStore NameStore Call AttributeLoad NameLoad attr NameLoad keyword NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Str Expr Call AttributeLoad NameLoad attr NameLoad Num decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Str Assign NameStore Str Assign NameStore Str Assign NameStore ListLoad Str Str NameLoad Str NameLoad Assign NameStore NameLoad FunctionDef arguments args NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr Str NameLoad AttributeLoad NameLoad attr If NameLoad body Return Call AttributeLoad NameLoad attr Num orelse Return NameLoad decorator_list Assign TupleStore NameStore NameStore NameStore Call AttributeLoad NameLoad attr NameLoad keyword NameLoad Assign NameStore Call NameLoad NameLoad Assert NameLoad NameLoad Expr Call AttributeLoad NameLoad attr Num Assign NameStore ListLoad Str Str NameLoad Assign TupleStore NameStore NameStore NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call NameLoad NameLoad Expr Call AttributeLoad NameLoad attr NameLoad NameLoad Assign NameStore ListLoad Str Str Str Str NameLoad Assign TupleStore NameStore NameStore NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore GeneratorExp Call NameLoad NameLoad comprehension NameStore Call AttributeLoad NameLoad attr Str Assign NameStore Call NameLoad ListComp NameLoad comprehension NameStore NameLoad NameLoad Assert CompareIn NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore BinOpMod Str NameLoad Assign NameStore BinOpMod Str NameLoad Expr Call AttributeLoad NameLoad attr ListLoad Str Str Str NameLoad NameLoad Str Expr Call AttributeLoad NameLoad attr Num Assign TupleStore NameStore NameStore NameStore Call AttributeLoad NameLoad attr ListLoad Str Str BinOpAdd Str NameLoad Assert CompareIn NameLoad NameLoad TupleLoad NameLoad NameLoad Assign TupleStore NameStore NameStore NameStore Call AttributeLoad NameLoad attr ListLoad Str Str NameLoad Assert CompareIn NameLoad NameLoad TupleLoad NameLoad NameLoad Assign NameStore ListLoad Str Str Expr Call AttributeLoad NameLoad attr BinOpAdd ListLoad Str Str NameLoad NameLoad Assign TupleStore NameStore NameStore NameStore Call AttributeLoad NameLoad attr ListLoad Str Str NameLoad For NameStore NameLoad body Assert CompareIn NameLoad NameLoad TupleLoad NameLoad NameLoad Assign NameStore ListLoad Str Str Expr Call AttributeLoad NameLoad attr BinOpAdd ListLoad Str Str NameLoad NameLoad Assign TupleStore NameStore NameStore NameStore Call AttributeLoad NameLoad attr ListLoad Str Str NameLoad For NameStore NameLoad body Assert CompareIn NameLoad NameLoad TupleLoad NameLoad NameLoad For NameStore NameLoad body Assert CompareNotIn NameLoad NameLoad TupleLoad NameLoad NameLoad Expr Call AttributeLoad NameLoad attr ListLoad Str Str NameLoad Assign TupleStore NameStore NameStore NameStore Call AttributeLoad NameLoad attr ListLoad Str Str NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Str decorator_list FunctionDef arguments args NameParam defaults body Assign TupleStore NameStore NameStore Call NameLoad Expr Call AttributeLoad NameLoad attr ListLoad Str Str NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assert CompareIn Str NameLoad NameLoad Assert CompareIn Str NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr Assign SubscriptStore NameLoad Index Str BinOpMod Str NameLoad Assign TupleStore NameStore NameStore Call NameLoad Expr Call AttributeLoad NameLoad attr NameLoad NameLoad Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr ListLoad Str Str AttributeLoad NameLoad attr Assign TupleStore NameStore NameStore NameStore Call AttributeLoad NameLoad attr ListLoad Str Str Call NameLoad SubscriptLoad NameLoad Index Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assert CompareIn Str NameLoad NameLoad Assert CompareIn Str SubscriptLoad NameLoad Index Str NameLoad Expr Call AttributeLoad NameLoad attr SubscriptLoad SubscriptLoad NameLoad Index Str Index Str SubscriptLoad NameLoad Index Str Assert CompareIn Str SubscriptLoad NameLoad Index Str Expr Call AttributeLoad NameLoad attr SubscriptLoad SubscriptLoad NameLoad Index Str Index Str SubscriptLoad NameLoad Index Str Assign NameStore Str Assign NameStore Str Assign NameStore ListLoad Dict Str Str Str Dict Str ListLoad Dict Str Str Expr Call AttributeLoad NameLoad attr ListLoad Str Str Call NameLoad SubscriptLoad NameLoad Index Str NameLoad NameLoad keyword Call AttributeLoad NameLoad attr NameLoad Assign TupleStore NameStore NameStore NameStore Call AttributeLoad NameLoad attr ListLoad Str Str Call NameLoad SubscriptLoad NameLoad Index Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assert CompareIn Str NameLoad NameLoad Assert CompareIn Str SubscriptLoad NameLoad Index Str NameLoad Expr Call AttributeLoad NameLoad attr SubscriptLoad SubscriptLoad NameLoad Index Str Index Str SubscriptLoad NameLoad Index Str Assert CompareIn Str SubscriptLoad NameLoad Index Str NameLoad Expr Call AttributeLoad NameLoad attr SubscriptLoad SubscriptLoad NameLoad Index Str Index Str NameLoad Assert CompareIn Str SubscriptLoad NameLoad Index Str NameLoad Expr Call AttributeLoad NameLoad attr SubscriptLoad SubscriptLoad NameLoad Index Str Index Str NameLoad Assert CompareIn Str SubscriptLoad NameLoad Index Str NameLoad Expr Call AttributeLoad NameLoad attr SubscriptLoad SubscriptLoad NameLoad Index Str Index Str NameLoad Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr TryFinally body Expr Call AttributeLoad NameLoad attr ListLoad Str Str Call NameLoad SubscriptLoad NameLoad Index Str NameLoad Assign NameStore Dict With Call NameLoad NameLoad NameStore body Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assert CompareIn Str NameLoad Expr Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Str NameLoad finalbody Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr ListLoad Str Str Call NameLoad SubscriptLoad NameLoad Index Str Assign TupleStore NameStore NameStore NameStore Call AttributeLoad NameLoad attr ListLoad Str Str Call NameLoad SubscriptLoad NameLoad Index Str keyword NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Num decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults NameLoad NameLoad NameLoad body Expr Str Assign NameStore BinOpAdd ListLoad Str Str AttributeLoad AttributeLoad NameLoad attr attr NameLoad If NameLoad body Assign NameStore BinOpAdd ListLoad Str Call AttributeLoad Str attr SubscriptLoad AttributeLoad NameLoad attr Index Str Call AttributeLoad Str attr SubscriptLoad AttributeLoad NameLoad attr Index Str NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad keyword AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr If NameLoad body Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str orelse Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Assign NameStore AttributeLoad NameLoad attr If NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad Num NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Str Return TupleLoad Call AttributeLoad NameLoad attr Str Call AttributeLoad NameLoad attr Str NameLoad decorator_list FunctionDef arguments args NameParam defaults body Return Call AttributeLoad Call NameLoad Call AttributeLoad Call NameLoad BinOpAdd Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr attr Str attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Assign NameStore Dict For NameStore Call AttributeLoad NameLoad attr Str body Assign NameStore Call AttributeLoad NameLoad attr Str Call AttributeLoad Call NameLoad NameLoad attr Assign NameStore SubscriptLoad NameLoad Index Num Assign NameStore Call AttributeLoad Str attr SubscriptLoad NameLoad Slice Num If NameLoad body Assign SubscriptStore NameLoad Index NameLoad NameLoad Return NameLoad decorator_list decorator_list If CompareEq NameLoad Str body Expr Call AttributeLoad NameLoad attr
N/A N/A json N/A os N/A random N/A re N/A socket N/A subprocess N/A time N/A tempfile N/A unittest contextlib contextmanager N/A N/A configparser ConfigParser N/A N/A N/A ImportError N/A ConfigParser ConfigParser hashlib md5 dogapi.common is_p3k dogshell.common find_localhost get_temp_file N/A N/A N/A N/A N/A Return a (fn, fp) pair N/A N/A is_p3k N/A N/A fn N/A N/A /tmp/{0}-{1} format N/A N/A time time N/A N/A random random N/A N/A fn N/A open fn w+ N/A N/A tf N/A N/A tempfile NamedTemporaryFile N/A N/A N/A tf name tf N/A TestDogshell N/A N/A unittest TestCase N/A setUp N/A N/A self N/A N/A N/A N/A N/A self config_fn N/A self config_file N/A get_temp_file N/A config N/A ConfigParser N/A N/A N/A config add_section Connection N/A N/A N/A config set Connection apikey N/A N/A os environ N/A DATADOG_API_KEY N/A N/A N/A config set Connection appkey N/A N/A os environ N/A DATADOG_APP_KEY N/A N/A N/A config write N/A self config_file N/A N/A N/A N/A self config_file flush N/A test_config_args N/A N/A self N/A N/A N/A N/A out err return_code N/A N/A self dogshell N/A --help use_cl_args True N/A test_find_localhost N/A N/A self N/A N/A N/A N/A N/A N/A socket getfqdn N/A find_localhost N/A N/A N/A N/A socket getfqdn N/A find_localhost N/A test_comment N/A N/A self N/A N/A N/A cmd N/A comment post N/A comment_msg yo dudes N/A post_data N/A N/A N/A out err return_code N/A N/A self dogshell cmd stdin comment_msg N/A post_data N/A N/A self parse_response out N/A N/A id post_data post_data N/A N/A url post_data post_data N/A N/A message post_data post_data N/A N/A comment_msg N/A post_data N/A message N/A cmd N/A comment show N/A post_data N/A id N/A N/A out err return_code N/A N/A self dogshell cmd N/A show_data N/A N/A self parse_response out N/A N/A comment_msg N/A show_data N/A message N/A cmd N/A comment update N/A post_data N/A id N/A new_comment nothing much N/A N/A out err return_code N/A N/A self dogshell cmd stdin new_comment N/A update_data N/A N/A self parse_response out N/A N/A N/A self assertEquals N/A update_data N/A id N/A post_data N/A id N/A N/A new_comment N/A update_data N/A message N/A cmd N/A comment show N/A post_data N/A id N/A N/A out err return_code N/A N/A self dogshell cmd N/A show_data2 N/A N/A self parse_response out N/A N/A new_comment N/A show_data2 N/A message N/A cmd N/A comment delete N/A post_data N/A id N/A N/A out err return_code N/A N/A self dogshell cmd N/A N/A N/A self assertEquals out N/A cmd N/A comment show N/A post_data N/A id N/A N/A out err return_code N/A N/A self dogshell cmd check_return_code False N/A N/A N/A self assertEquals out N/A N/A N/A self assertEquals return_code 1 N/A test_event N/A N/A self N/A N/A N/A title  Testing events from dogshell N/A body %%%
*Cool!*
%%%
 N/A tags tag:a,tag:b N/A cmd N/A event post title --tags tags N/A event_id None match_permalink N/A N/A out N/A N/A N/A match N/A N/A re match .*/event/jump_to\?event_id=([0-9]*) out N/A re DOTALL N/A match N/A N/A N/A N/A match group 1 N/A N/A None N/A N/A N/A out err return_code N/A N/A self dogshell cmd stdin body N/A event_id N/A match_permalink out N/A event_id out N/A N/A N/A time sleep 2 N/A cmd N/A event show event_id N/A N/A out err return_code N/A N/A self dogshell cmd N/A event_id2 N/A match_permalink out N/A N/A N/A self assertEquals event_id event_id2 N/A cmd N/A event stream 30m --tags tags N/A N/A out err return_code N/A N/A self dogshell cmd N/A event_ids N/A N/A match_permalink l N/A l N/A N/A out split N/A event_ids N/A set N/A e N/A e event_ids e N/A N/A event_id event_ids N/A test_metrics N/A N/A self N/A N/A N/A unique N/A N/A self get_unique N/A metric N/A test.dogapi.test_metric_%s unique N/A host N/A test.dogapi.test_host_%s unique N/A N/A N/A self dogshell N/A metric post --host host metric 1 N/A N/A N/A time sleep 15 N/A N/A out err return_code N/A N/A self dogshell N/A search query N/A hosts: host N/A N/A host out N/A host out N/A N/A out err return_code N/A N/A self dogshell N/A search query unique N/A N/A host out N/A host out N/A tags0 N/A t0 t1 N/A N/A N/A self dogshell N/A N/A tag add host tags0 N/A N/A out err return_code N/A N/A self dogshell N/A tag show host N/A t tags0 N/A N/A N/A t out N/A t out N/A tags1 N/A t2 t3 N/A N/A N/A self dogshell N/A N/A tag replace host tags1 N/A N/A out err return_code N/A N/A self dogshell N/A tag show host N/A t tags1 N/A N/A N/A t out N/A t out N/A t tags0 N/A N/A N/A t out N/A t out N/A N/A N/A self dogshell N/A tag detach host N/A N/A out err return_code N/A N/A self dogshell N/A tag show host N/A N/A N/A self assertEquals out N/A test_dashes N/A N/A self N/A N/A N/A N/A name temp0 N/A get_temp_file N/A N/A N/A self dogshell N/A dashboard new_file name N/A dash N/A N/A json load temp0 N/A N/A id dash dash N/A N/A title dash dash N/A unique N/A N/A self get_unique N/A N/A dash N/A title N/A dash title %s unique N/A N/A name temp1 N/A get_temp_file N/A N/A N/A json dump dash temp1 N/A N/A N/A temp1 flush N/A N/A N/A self dogshell N/A dashboard push N/A temp1 name N/A N/A out _ _ N/A N/A self dogshell N/A dashboard show N/A str N/A dash N/A id N/A out N/A N/A json loads out N/A N/A dash out out N/A N/A id N/A out N/A dash out N/A N/A N/A self assertEquals N/A N/A out N/A dash N/A id N/A dash N/A id N/A N/A title N/A out N/A dash N/A N/A N/A self assertEquals N/A N/A out N/A dash N/A title N/A dash N/A title N/A new_title new_title N/A new_desc new_desc N/A new_dash N/A N/A title definition blerg N/A requests N/A N/A q avg:system.load.15{web,env:prod} N/A N/A N/A self dogshell N/A dashboard update N/A str N/A dash N/A id new_title new_desc stdin N/A N/A json dumps new_dash N/A N/A out _ _ N/A N/A self dogshell N/A dashboard show N/A str N/A dash N/A id N/A out N/A N/A json loads out N/A N/A dash out out N/A N/A id N/A out N/A dash out N/A N/A N/A self assertEquals N/A N/A out N/A dash N/A id N/A dash N/A id N/A N/A title N/A out N/A dash out N/A N/A N/A self assertEquals N/A N/A out N/A dash N/A title new_title N/A N/A description N/A out N/A dash out N/A N/A N/A self assertEquals N/A N/A out N/A dash N/A description new_desc N/A N/A graphs N/A out N/A dash out N/A N/A N/A self assertEquals N/A N/A out N/A dash N/A graphs new_dash N/A N/A fd updated_file N/A N/A tempfile mkstemp N/A N/A N/A N/A N/A self dogshell N/A dashboard pull N/A str N/A dash N/A id updated_file N/A updated_dash N/A N/A N/A open updated_file f N/A N/A updated_dash N/A N/A json load f N/A N/A dash out N/A N/A N/A self assertEquals N/A out N/A dash updated_dash N/A N/A N/A N/A os unlink updated_file N/A N/A N/A self dogshell N/A dashboard delete N/A str N/A dash N/A id N/A N/A out err return_code N/A N/A self dogshell N/A dashboard show N/A str N/A dash N/A id check_return_code False N/A N/A N/A self assertNotEquals return_code 0 N/A dogshell N/A N/A self args stdin check_return_code use_cl_args N/A None True False N/A N/A  Helper function to call the dog shell command
         N/A cmd N/A N/A dog --config N/A N/A self config_file name args N/A use_cl_args N/A N/A cmd N/A N/A dog N/A N/A --api-key={0} format N/A N/A os environ N/A DATADOG_API_KEY N/A N/A --application-key={0} format N/A N/A os environ N/A DATADOG_APP_KEY args N/A proc N/A N/A subprocess Popen cmd stdout N/A subprocess PIPE stderr N/A subprocess PIPE stdin N/A subprocess PIPE N/A stdin N/A N/A N/A out err N/A N/A proc communicate N/A N/A stdin encode utf-8 N/A N/A N/A out err N/A N/A proc communicate N/A N/A N/A proc wait N/A return_code N/A proc returncode N/A check_return_code N/A N/A N/A N/A self assertEquals return_code 0 err N/A N/A N/A self assertEquals err N/A N/A N/A N/A out decode utf-8 N/A N/A err decode utf-8 return_code N/A get_unique N/A N/A self N/A N/A N/A N/A N/A N/A md5 N/A N/A N/A str N/A N/A N/A time time N/A N/A random random encode utf-8 hexdigest N/A parse_response N/A N/A self out N/A N/A N/A data N/A N/A line N/A N/A out split N/A N/A parts N/A N/A re split \s+ N/A N/A N/A str line strip N/A key N/A parts N/A 0 N/A val N/A N/A join N/A parts N/A 1 N/A key N/A N/A N/A data N/A key val N/A data N/A N/A N/A N/A __name__ __main__ N/A N/A N/A N/A unittest main