code
stringlengths
3
6.57k
self.assertEqual(answer(vertices)
unittest.main()
logging.getLogger(__name__)
CONF.import_opt('use_local', 'compute.conductor.api', group='conductor')
IsolationTestCase(test.TestCase)
test_service_isolation(self)
self.flags(use_local=True, group='conductor')
self.useFixture(fixtures.ServiceFixture('compute')
test_rpc_consumer_isolation(self)
NeverCalled(object)
__getattribute__(*args)
NeverCalled()
server.start()
JsonTestCase(test.NoDBTestCase)
test_json_equal(self)
set(['Boston', 'Mumbai', 'Beijing', 'Perth'])
self.assertJsonEqual(expected, observed)
test_json_equal_fail_on_length(self)
self.assertJsonEqual(expected, observed)
self.assertEqual(e.mismatch.describe()
six.text_type(e)
six.text_type(e)
self.fail("This should have raised a mismatch exception")
test_json_equal_fail_on_inner(self)
self.assertJsonEqual(expected, observed)
self.assertEqual(e.mismatch.describe()
six.text_type(e)
six.text_type(e)
self.fail("This should have raised a mismatch exception")
BadLogTestCase(test.NoDBTestCase)
test_bad_debug_log(self)
MatchTypeTestCase(test.NoDBTestCase)
test_match_type_simple(self)
test.MatchType(dict)
self.assertEqual(matcher, {})
self.assertEqual(matcher, {"hello": "world"})
self.assertEqual(matcher, {"hello": ["world"]})
self.assertNotEqual(matcher, [])
self.assertNotEqual(matcher, [{"hello": "world"}])
self.assertNotEqual(matcher, 123)
self.assertNotEqual(matcher, "foo")
test_match_type_object(self)
Hello(object)
World(object)
test.MatchType(Hello)
self.assertEqual(matcher, Hello()
self.assertNotEqual(matcher, World()
self.assertNotEqual(matcher, 123)
self.assertNotEqual(matcher, "foo")
mlp_type1(KerasBaseExp)
initialize_model(self, in_dims, out_dims)
Input(shape=(d, )
len(input_layer)
Concatenate()
fc_branch(layer, self.decay)
Model(inputs=input_layer, outputs=final_type1(layer, out_dims)
Adam(lr=self.learning_rate)
self.model.compile(optimizer=opt, metrics=['accuracy'], loss='categorical_crossentropy')
EXP1(mlp_type1, exp_bag_of_strokes)
Copyright (c)
Mishra (@amishra2-infoblox)
Sethia (@vedantsethia)
import (absolute_import, division, print_function)
ImportError("Requests module not found")
Request(object)
__init__(self,baseUrl, token)
get(self,endpoint,data={})
format(self.token)
format(self.baseUrl, endpoint)
requests.get(url, json.dumps(data)
Exception("API request failed")
return (False, False, result.json()
return (True, False, result.content)
result.json()
return (True, False, meta)
create(self,endpoint,data={},body=True)
format(self.token)
format(self.baseUrl, endpoint)
if(body==True)
requests.post(url, json.dumps(data)
requests.post(url, headers=headers)
Exception("API request failed")
return (False, False, result.json()
return (True, False, result.content)
result.json()
return (True, False, meta)
update(self,endpoint,data={})
format(self.token)
format(self.baseUrl, endpoint)
requests.patch(url, json.dumps(data)
Exception("API request failed")
return (False, False, result.json()
return (True, False, result.content)
result.json()
return (True, False, meta)
put(self,endpoint,data={})
format(self.token)
format(self.baseUrl, endpoint)
requests.put(url, json.dumps(data)
Exception("API request failed")