query
stringlengths
9
3.4k
document
stringlengths
9
87.4k
metadata
dict
negatives
listlengths
4
101
negative_scores
listlengths
4
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Read any data that has been collected since the last call.
async def read(self) -> bytes: # NOTE(kgriffs): Yield to other tasks to give them a chance to # send us more body chunks if any are available. # # https://bugs.python.org/issue34476 # await asyncio.sleep(0) if self._chunk_pos >= len(self._chunks): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def collect(self):\n if self._completion_status is None or not self._completion_status.done:\n raise RuntimeError(\"No reading until done!\")\n self._completion_status = None\n\n yield from self._data", "def read(self):\n self._read(True)\n return self._readings", ...
[ "0.6824192", "0.66679394", "0.65908027", "0.65646493", "0.6316166", "0.6301715", "0.6260783", "0.62499213", "0.61752194", "0.6141177", "0.613967", "0.6104275", "0.6086361", "0.60820276", "0.6038793", "0.6038682", "0.6011587", "0.5987216", "0.59750587", "0.59735256", "0.596673...
0.0
-1
Finalize the encapsulated simulated request. This method causes the request event emitter to begin emitting ``'http.disconnect'`` events and then awaits the completion of the asyncio task that is running the simulated ASGI request.
async def finalize(self): self._req_event_emitter.disconnect() await self._task
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _finalize_request(self, request_no):\n now = _now()\n # Find request info in current requests\n request_info = self._current_requests.pop(request_no, None)\n if not request_info:\n logging.error(\"Couldn't finalize request #{} as it wasn't started \"\n \"or it was started lo...
[ "0.599261", "0.58126885", "0.57832295", "0.57138246", "0.56882215", "0.5686544", "0.5677415", "0.56466365", "0.5626848", "0.5616015", "0.5615296", "0.55539614", "0.55263776", "0.55126804", "0.5511265", "0.54770803", "0.5459623", "0.5418623", "0.54156804", "0.541335", "0.53688...
0.77098256
0
Simulate a request to a WSGI or ASGI application. Performs a request against a WSGI or ASGI application. In the case of
def simulate_request( app, method='GET', path='/', query_string=None, headers=None, content_type=None, body=None, json=None, file_wrapper=None, wsgierrors=None, params=None, params_csv=False, protocol='http', host=helpers.DEFAULT_HOST, remote_addr=None, ex...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def main():\r\n run_wsgi_app(app)", "def application(environ, start_response, app=[]):\n if not app:\n app.append(make_application())\n return app[0](environ, start_response)", "def test_get_wsgi_application(self):\n application = wsgi.get_wsgi_application()\n\n environ = RequestF...
[ "0.68284094", "0.6605171", "0.6591117", "0.6560543", "0.6491741", "0.6410489", "0.64080065", "0.6362514", "0.6343776", "0.63280624", "0.6317552", "0.6280429", "0.62708604", "0.6255619", "0.62199986", "0.621414", "0.61968637", "0.6143944", "0.6143615", "0.61340964", "0.6124544...
0.63396287
9
Simulate a request to an ASGI application.
async def _simulate_request_asgi( app, method='GET', path='/', query_string=None, headers=None, content_type=None, body=None, json=None, params=None, params_csv=True, protocol='http', host=helpers.DEFAULT_HOST, remote_addr=None, extras=None, http_version='1.1'...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_basic_asgi_call(self):\n app = otel_asgi.OpenTelemetryMiddleware(simple_asgi)\n self.seed_app(app)\n self.send_default_request()\n outputs = self.get_all_output()\n self.validate_outputs(outputs)", "def test_basic_asgi_call(self):\n app = otel_asgi.OpenTelemetry...
[ "0.6697261", "0.6697261", "0.6463477", "0.64476454", "0.62754405", "0.6240101", "0.6212896", "0.61975616", "0.6176701", "0.6165948", "0.61617255", "0.61466104", "0.6127736", "0.6127736", "0.6127736", "0.6011134", "0.5981526", "0.59622854", "0.5924651", "0.5876444", "0.587383"...
0.696744
0
Simulate a GET request to an ASGI application.
async def simulate_get(self, path='/', **kwargs) -> _ResultBase: return await self.simulate_request('GET', path, **kwargs)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def simulate_get(app, path, **kwargs) -> _ResultBase:\n\n return simulate_request(app, 'GET', path, **kwargs)", "def do_GET(self):\r\n self._send_handler_response('GET')", "def get(self, url, **kwargs):\n logging.info('OUTGOING HTTP GET: %s' % url)\n try:\n return self.wrappe...
[ "0.7688709", "0.7209827", "0.6882398", "0.6874337", "0.68675745", "0.68609643", "0.6680741", "0.66037524", "0.6595958", "0.6551402", "0.6513743", "0.650689", "0.6501855", "0.64850557", "0.6384635", "0.6384379", "0.6379069", "0.6353283", "0.63353187", "0.63148445", "0.62826747...
0.64601225
14
Simulate a GET request to an ASGI application with a streamed response.
def simulate_get_stream(self, path='/', **kwargs): kwargs['_stream_result'] = True return _AsyncContextManager(self.simulate_request('GET', path, **kwargs))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def simulate_get(app, path, **kwargs) -> _ResultBase:\n\n return simulate_request(app, 'GET', path, **kwargs)", "def get(*args, **kwargs):\n\n response = yield from aiohttp.request('GET', *args, **kwargs)\n return (yield from response.read())", "def do_GET(self):\r\n self._send_handler_response...
[ "0.69662255", "0.6964644", "0.6791128", "0.6653924", "0.6492846", "0.64581084", "0.6262218", "0.61936045", "0.61565524", "0.6127867", "0.6102314", "0.6101945", "0.6099907", "0.60994047", "0.6095092", "0.6094662", "0.6078649", "0.6070515", "0.6067862", "0.60598123", "0.6054354...
0.6659492
3
Simulate a WebSocket connection to an ASGI application. All keyword arguments are passed through to
def simulate_ws(self, path='/', **kwargs): scope = helpers.create_scope_ws(path=path, **kwargs) ws = helpers.ASGIWebSocketSimulator() task_req = create_task(self.app(scope, ws._emit, ws._collect)) return _WSContextManager(ws, task_req)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def test_websocket_application():\n application = URLRouter([path(\"testws/<str:message>/\", KwargsWebSocketApp())])\n communicator = WebsocketCommunicator(application, \"/testws/test/\")\n connected, subprotocol = await communicator.connect()\n # Test connection\n assert connected\n assert...
[ "0.68903196", "0.6744548", "0.6687273", "0.6501984", "0.624338", "0.6031254", "0.5900592", "0.58548105", "0.58494914", "0.58494365", "0.58278435", "0.5824977", "0.58083946", "0.57835615", "0.5777688", "0.57113034", "0.5706925", "0.56735003", "0.5667869", "0.566028", "0.562728...
0.5730795
15
Simulate a HEAD request to an ASGI application.
async def simulate_head(self, path='/', **kwargs) -> _ResultBase: return await self.simulate_request('HEAD', path, **kwargs)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def simulate_head(app, path, **kwargs) -> _ResultBase:\n return simulate_request(app, 'HEAD', path, **kwargs)", "def do_HEAD(self):\n self.do_GET(True)", "def do_HEAD(self):\n self.log.debug('do_HEAD called')\n self.HeadGet('HEAD')", "def HEAD(self, req):\r\n resp = req.get_response(se...
[ "0.81544644", "0.77035207", "0.75598407", "0.749035", "0.7483409", "0.73954153", "0.73515546", "0.7336531", "0.7186591", "0.717927", "0.70954436", "0.7069544", "0.7047983", "0.7047983", "0.7047983", "0.7047983", "0.7008836", "0.69955856", "0.6982015", "0.6925413", "0.6874912"...
0.7014018
16
Simulate a POST request to an ASGI application.
async def simulate_post(self, path='/', **kwargs) -> _ResultBase: return await self.simulate_request('POST', path, **kwargs)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def simulate_post(app, path, **kwargs) -> _ResultBase:\n return simulate_request(app, 'POST', path, **kwargs)", "def do_POST(self):\r\n self._send_handler_response('POST')", "async def test_post_form_urlencoded(app, aiohttp_server):\n server = await aiohttp_server(app)\n url = \"http://localhos...
[ "0.7567842", "0.68630046", "0.6829685", "0.6728402", "0.6693517", "0.6613696", "0.6525269", "0.65113217", "0.64988035", "0.64452595", "0.6435002", "0.63261384", "0.63139784", "0.6299051", "0.6291908", "0.62749785", "0.6258384", "0.6258113", "0.62297994", "0.62297213", "0.6220...
0.6058574
24
Simulate a PUT request to an ASGI application.
async def simulate_put(self, path='/', **kwargs) -> _ResultBase: return await self.simulate_request('PUT', path, **kwargs)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def simulate_put(app, path, **kwargs) -> _ResultBase:\n return simulate_request(app, 'PUT', path, **kwargs)", "def put(self, *args, **kwargs):\n self.request(\"put\", *args, **kwargs)", "def do_PUT(self,):\n self.http_method = 'PUT'\n # Nothing to do for now.\n pass", "def _put...
[ "0.8130414", "0.72275764", "0.7175433", "0.71189624", "0.6995265", "0.69159925", "0.69084567", "0.68669564", "0.68038714", "0.6794044", "0.6616889", "0.6588042", "0.6564535", "0.65348846", "0.65348846", "0.65348846", "0.65310556", "0.6496377", "0.6471326", "0.6454387", "0.645...
0.69048744
7
Simulate an OPTIONS request to an ASGI application.
async def simulate_options(self, path='/', **kwargs) -> _ResultBase: return await self.simulate_request('OPTIONS', path, **kwargs)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def simulate_options(app, path, **kwargs) -> _ResultBase:\n return simulate_request(app, 'OPTIONS', path, **kwargs)", "def OPTIONS(self, req):\r\n resp = req.get_response(self.app)\r\n return resp", "def handleHttpOptions():\n response = flask.Response(\"\", mimetype=\"application/json\")\n...
[ "0.7786664", "0.76917243", "0.7064275", "0.69728106", "0.6958719", "0.6952357", "0.678636", "0.67658037", "0.6603403", "0.64874357", "0.6471302", "0.6311861", "0.623971", "0.61870867", "0.6117714", "0.6087566", "0.6036492", "0.59955215", "0.5879537", "0.5852436", "0.5721634",...
0.6828279
6
Simulate a PATCH request to an ASGI application.
async def simulate_patch(self, path='/', **kwargs) -> _ResultBase: return await self.simulate_request('PATCH', path, **kwargs)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def simulate_patch(app, path, **kwargs) -> _ResultBase:\n return simulate_request(app, 'PATCH', path, **kwargs)", "def patch(self, *args, **kwargs):\n self.request(\"patch\", *args, **kwargs)", "def simulate_patch(self, path='/', **kwargs):\n return self.simulate_request('PATCH', path, **kwarg...
[ "0.8286581", "0.7499736", "0.73026884", "0.70985633", "0.70926195", "0.7085156", "0.6907411", "0.6900558", "0.68608654", "0.6830805", "0.6811523", "0.68058413", "0.6804034", "0.673692", "0.67207915", "0.6695585", "0.6695585", "0.6695585", "0.6695585", "0.6695585", "0.6695585"...
0.7162519
3
Simulate a DELETE request to an ASGI application.
async def simulate_delete(self, path='/', **kwargs) -> _ResultBase: return await self.simulate_request('DELETE', path, **kwargs)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def simulate_delete(app, path, **kwargs) -> _ResultBase:\n return simulate_request(app, 'DELETE', path, **kwargs)", "def do_DELETE(self,):\n self.http_method = 'DELETE'\n self.response()", "def delete(self, *args, **kwargs):\n self.request(\"delete\", *args, **kwargs)", "def delete(se...
[ "0.8164449", "0.74072415", "0.7320336", "0.72981447", "0.72860307", "0.724793", "0.72134966", "0.7212368", "0.71407527", "0.71187055", "0.71111995", "0.7101029", "0.7100111", "0.69844186", "0.6937107", "0.69221526", "0.6919563", "0.6910702", "0.68807673", "0.6874072", "0.6870...
0.6999327
13
Simulate a request to an ASGI application.
async def simulate_request(self, *args, **kwargs) -> _ResultBase: if self._default_headers: # NOTE(kgriffs): Handle the case in which headers is explicitly # set to None. additional_headers = kwargs.get('headers', {}) or {} merged_headers = self._default_headers...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def _simulate_request_asgi(\n app,\n method='GET',\n path='/',\n query_string=None,\n headers=None,\n content_type=None,\n body=None,\n json=None,\n params=None,\n params_csv=True,\n protocol='http',\n host=helpers.DEFAULT_HOST,\n remote_addr=None,\n extras=None,\n ...
[ "0.696744", "0.6697261", "0.6697261", "0.6463477", "0.64476454", "0.62754405", "0.6240101", "0.6212896", "0.61975616", "0.6176701", "0.61617255", "0.61466104", "0.6127736", "0.6127736", "0.6127736", "0.6011134", "0.5981526", "0.59622854", "0.5924651", "0.5876444", "0.587383",...
0.6165948
10
Simulate a GET request to a WSGI or ASGI application.
def simulate_get(app, path, **kwargs) -> _ResultBase: return simulate_request(app, 'GET', path, **kwargs)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def do_GET(self):\r\n self._send_handler_response('GET')", "def get(self, url, **kwargs):\n logging.info('OUTGOING HTTP GET: %s' % url)\n try:\n return self.wrapped_app.get(url, **kwargs)\n except webtest.AppError as e:\n raise VirtualAppError(msg='HTTP GET faile...
[ "0.7422761", "0.71843797", "0.7106445", "0.70900655", "0.6984407", "0.6970873", "0.6878353", "0.6760326", "0.67270213", "0.6703166", "0.6636329", "0.66259116", "0.6616825", "0.66046745", "0.65231144", "0.6460621", "0.6452677", "0.644508", "0.6409575", "0.63991606", "0.6382206...
0.78489506
0
Simulate a HEAD request to a WSGI or ASGI application.
def simulate_head(app, path, **kwargs) -> _ResultBase: return simulate_request(app, 'HEAD', path, **kwargs)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def do_HEAD(self):\n self.do_GET(True)", "def HEAD(self, req):\r\n resp = req.get_response(self.app)\r\n\r\n return HTTPOk(headers=resp.headers)", "def do_HEAD(self):\n self.log.debug('do_HEAD called')\n self.HeadGet('HEAD')", "def head(self, url, *args, **kwargs):\n with LO...
[ "0.78091705", "0.7650182", "0.7624783", "0.7595388", "0.753932", "0.75186324", "0.7429734", "0.7328362", "0.73160917", "0.72809213", "0.713504", "0.71180564", "0.71009296", "0.7089121", "0.7067554", "0.70673203", "0.70619255", "0.7036367", "0.7036367", "0.7036367", "0.7036367...
0.8178949
0
Simulate a POST request to a WSGI or ASGI application.
def simulate_post(app, path, **kwargs) -> _ResultBase: return simulate_request(app, 'POST', path, **kwargs)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def do_POST(self):\r\n self._send_handler_response('POST')", "def post(self, *args, **kwargs):\n self.request(\"post\", *args, **kwargs)", "def do_POST(self): # pylint: disable=invalid-name\n self.handle_request()", "def do_POST(self,):\n self.http_method = 'POST'\n ...
[ "0.71617234", "0.7045804", "0.6867098", "0.6853614", "0.6829674", "0.6813335", "0.6783007", "0.6774898", "0.6717171", "0.6653153", "0.6608424", "0.66032755", "0.6583824", "0.6545123", "0.65369654", "0.6514101", "0.65099627", "0.6505311", "0.6446184", "0.63772756", "0.63557357...
0.77779883
0
Simulate a PUT request to a WSGI or ASGI application.
def simulate_put(app, path, **kwargs) -> _ResultBase: return simulate_request(app, 'PUT', path, **kwargs)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def do_PUT(self,):\n self.http_method = 'PUT'\n # Nothing to do for now.\n pass", "def put(self, *args, **kwargs):\n self.request(\"put\", *args, **kwargs)", "def _put(self, *args, **kwargs):\n return self._request('put', *args, **kwargs)", "def simulate_put(self, path='/',...
[ "0.7430654", "0.7420765", "0.7254375", "0.72292215", "0.7130859", "0.7076189", "0.70692164", "0.7004767", "0.696957", "0.69484067", "0.692274", "0.69176435", "0.68755746", "0.683001", "0.6824943", "0.68128455", "0.67805594", "0.6752393", "0.6752393", "0.6752393", "0.6705847",...
0.82123727
0
Simulate an OPTIONS request to a WSGI or ASGI application.
def simulate_options(app, path, **kwargs) -> _ResultBase: return simulate_request(app, 'OPTIONS', path, **kwargs)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def OPTIONS(self, req):\r\n resp = req.get_response(self.app)\r\n return resp", "def handleHttpOptions():\n response = flask.Response(\"\", mimetype=\"application/json\")\n response.headers.add(\"Access-Control-Request-Methods\", \"GET,POST,OPTIONS\")\n return response", "def do_OPTIONS(...
[ "0.7863422", "0.73523796", "0.7177669", "0.71471834", "0.70651054", "0.6973183", "0.6879857", "0.6852321", "0.68058544", "0.6744779", "0.6601881", "0.6532627", "0.6517702", "0.6396257", "0.62983924", "0.6216214", "0.61781067", "0.61551476", "0.612352", "0.58386046", "0.578458...
0.7776818
1
Simulate a PATCH request to a WSGI or ASGI application.
def simulate_patch(app, path, **kwargs) -> _ResultBase: return simulate_request(app, 'PATCH', path, **kwargs)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def patch(self, *args, **kwargs):\n self.request(\"patch\", *args, **kwargs)", "def simulate_patch(self, path='/', **kwargs):\n return self.simulate_request('PATCH', path, **kwargs)", "def test_client_can_do_patch_request(self):\n response = self.httpbin_4.test_requests_patch_method()\n ...
[ "0.77237695", "0.7579202", "0.74945503", "0.7375038", "0.7336147", "0.71931046", "0.709597", "0.7059055", "0.70421225", "0.70336956", "0.6954821", "0.6954437", "0.69469035", "0.69469035", "0.69469035", "0.69469035", "0.69469035", "0.69469035", "0.69469035", "0.69469035", "0.6...
0.843222
0
Simulate a DELETE request to a WSGI or ASGI application.
def simulate_delete(app, path, **kwargs) -> _ResultBase: return simulate_request(app, 'DELETE', path, **kwargs)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def do_DELETE(self,):\n self.http_method = 'DELETE'\n self.response()", "def delete(self, url):\n return self.request(url, \"DELETE\")", "def delete(self, *args, **kwargs):\n self.request(\"delete\", *args, **kwargs)", "def _delete(self, url):\n return self._request(url, me...
[ "0.7512464", "0.73937106", "0.7383249", "0.7367261", "0.73230493", "0.7305496", "0.72956675", "0.72301793", "0.72071403", "0.7176349", "0.7168482", "0.7161482", "0.7146861", "0.7128366", "0.71066153", "0.7064168", "0.7042529", "0.7008366", "0.6931621", "0.6908701", "0.6888692...
0.81882477
0
Simulate a GET request to a WSGI application.
def simulate_get(self, path='/', **kwargs) -> _ResultBase: return self.simulate_request('GET', path, **kwargs)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def simulate_get(app, path, **kwargs) -> _ResultBase:\n\n return simulate_request(app, 'GET', path, **kwargs)", "def do_GET(self):\r\n self._send_handler_response('GET')", "def get(self, url, **kwargs):\n logging.info('OUTGOING HTTP GET: %s' % url)\n try:\n return self.wrappe...
[ "0.7414067", "0.70905364", "0.6966913", "0.68963903", "0.6782912", "0.67710394", "0.6763647", "0.6644425", "0.6612385", "0.65589654", "0.65490484", "0.6548749", "0.653869", "0.65330756", "0.64896387", "0.63865507", "0.6371429", "0.6362631", "0.6334786", "0.63281626", "0.62953...
0.6088177
34
Simulate a HEAD request to a WSGI application.
def simulate_head(self, path='/', **kwargs) -> _ResultBase: return self.simulate_request('HEAD', path, **kwargs)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def simulate_head(app, path, **kwargs) -> _ResultBase:\n return simulate_request(app, 'HEAD', path, **kwargs)", "def do_HEAD(self):\n self.do_GET(True)", "def HEAD(self, req):\r\n resp = req.get_response(self.app)\r\n\r\n return HTTPOk(headers=resp.headers)", "def head(self, url, *arg...
[ "0.7908282", "0.7551596", "0.7536846", "0.7451651", "0.73988074", "0.7387592", "0.7380635", "0.73752433", "0.7091619", "0.700157", "0.6942704", "0.69363654", "0.6855727", "0.67979395", "0.67689836", "0.6768478", "0.6755241", "0.67435205", "0.67435205", "0.67435205", "0.674352...
0.6762781
16
Simulate a POST request to a WSGI application.
def simulate_post(self, path='/', **kwargs) -> _ResultBase: return self.simulate_request('POST', path, **kwargs)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def simulate_post(app, path, **kwargs) -> _ResultBase:\n return simulate_request(app, 'POST', path, **kwargs)", "def do_POST(self):\r\n self._send_handler_response('POST')", "def post_app(request):\n return Response({\"Post executado\"}, status=status.HTTP_200_OK)", "def post(self, *args, **kwar...
[ "0.7369135", "0.6875777", "0.66234535", "0.6511627", "0.6471913", "0.6466773", "0.6410837", "0.63744384", "0.6299342", "0.6294219", "0.62914264", "0.62774044", "0.6254116", "0.62469804", "0.62400424", "0.622621", "0.61498666", "0.61446804", "0.61404383", "0.61332", "0.6097913...
0.5792
40
Simulate a PUT request to a WSGI application.
def simulate_put(self, path='/', **kwargs) -> _ResultBase: return self.simulate_request('PUT', path, **kwargs)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def simulate_put(app, path, **kwargs) -> _ResultBase:\n return simulate_request(app, 'PUT', path, **kwargs)", "def do_PUT(self,):\n self.http_method = 'PUT'\n # Nothing to do for now.\n pass", "def put(self, *args, **kwargs):\n self.request(\"put\", *args, **kwargs)", "def PUT(...
[ "0.7857318", "0.695292", "0.6949761", "0.6900196", "0.68887955", "0.68399256", "0.6778951", "0.676933", "0.6731947", "0.668466", "0.6678236", "0.66361004", "0.6608237", "0.6584145", "0.65096", "0.65074146", "0.65074146", "0.65074146", "0.64896715", "0.6464989", "0.64510846", ...
0.65861607
13
Simulate an OPTIONS request to a WSGI application.
def simulate_options(self, path='/', **kwargs) -> _ResultBase: return self.simulate_request('OPTIONS', path, **kwargs)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def OPTIONS(self, req):\r\n resp = req.get_response(self.app)\r\n return resp", "def simulate_options(app, path, **kwargs) -> _ResultBase:\n return simulate_request(app, 'OPTIONS', path, **kwargs)", "def handleHttpOptions():\n response = flask.Response(\"\", mimetype=\"application/json\")\n...
[ "0.7714373", "0.7465679", "0.72053254", "0.6988005", "0.69523615", "0.67809653", "0.673419", "0.6707717", "0.65450895", "0.6466334", "0.6328043", "0.6310527", "0.62664926", "0.6206735", "0.6079744", "0.60293096", "0.5989365", "0.5927499", "0.5806252", "0.57818246", "0.5755045...
0.64899015
9
Simulate a PATCH request to a WSGI application.
def simulate_patch(self, path='/', **kwargs) -> _ResultBase: return self.simulate_request('PATCH', path, **kwargs)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def simulate_patch(app, path, **kwargs) -> _ResultBase:\n return simulate_request(app, 'PATCH', path, **kwargs)", "def patch(self, *args, **kwargs):\n self.request(\"patch\", *args, **kwargs)", "def simulate_patch(self, path='/', **kwargs):\n return self.simulate_request('PATCH', path, **kwarg...
[ "0.8154428", "0.73881894", "0.72425157", "0.7032009", "0.69893557", "0.69432026", "0.6927841", "0.68865746", "0.68196744", "0.67764145", "0.6765585", "0.67158455", "0.66943085", "0.66934305", "0.6676714", "0.6676714", "0.6676714", "0.6673792", "0.66581106", "0.66523695", "0.6...
0.69515896
5
Simulate a DELETE request to a WSGI application.
def simulate_delete(self, path='/', **kwargs) -> _ResultBase: return self.simulate_request('DELETE', path, **kwargs)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def simulate_delete(app, path, **kwargs) -> _ResultBase:\n return simulate_request(app, 'DELETE', path, **kwargs)", "def DELETE(url, mime_type='text/html'):\n def_app = DefaultHttpRequestHandler()\n return def_app.RequestMap(url, methods=['DELETE'], produces=mime_type)", "def delete(self, url):\n ...
[ "0.7797188", "0.71777534", "0.71736985", "0.70925444", "0.70724267", "0.70549405", "0.704958", "0.69685084", "0.6963123", "0.69502246", "0.68928", "0.6853945", "0.6848925", "0.6831778", "0.6790113", "0.6769437", "0.6737311", "0.6704643", "0.66841", "0.65644574", "0.6560369", ...
0.65388966
22
Simulate a request to a WSGI application.
def simulate_request(self, *args, **kwargs) -> _ResultBase: if self._default_headers: # NOTE(kgriffs): Handle the case in which headers is explicitly # set to None. additional_headers = kwargs.get('headers', {}) or {} merged_headers = self._default_headers.copy(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def main():\r\n run_wsgi_app(app)", "def test_get_wsgi_application(self):\n application = wsgi.get_wsgi_application()\n\n environ = RequestFactory()._base_environ(\n PATH_INFO=\"/taric_books/\",\n CONTENT_TYPE=\"text/html; charset=utf-8\",\n REQUEST_METHOD=\"GET\...
[ "0.7307371", "0.7021598", "0.69710606", "0.68984705", "0.6853446", "0.67806476", "0.67583996", "0.66636604", "0.6617578", "0.660725", "0.64848566", "0.64848566", "0.64848566", "0.6472964", "0.6458941", "0.64460766", "0.6415451", "0.6404258", "0.63989335", "0.63785857", "0.634...
0.0
-1
d = pd.read_csv("queryExamples.csv", sep=';', header=0, dtype=str) dt = np.asarray(d) exID = int(exID) return (dt[exID, 0], dt[exID, 2], dt[exID, 1], dt[exID, 3], dt[exID, 4])
def loadExample(self, exID): return ""
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def FindIdxValues(X):\n data = X.select_dtypes(include=[\"float64\"])\n idx = np.argwhere(~np.isnan(data.values))\n idx[:, 1] += 4 # add ID variable columns\n StoE = pd.read_csv(\"msresist/data/MS/CPTAC/IDtoExperiment.csv\")\n assert all(StoE.iloc[:, 0] == data.columns), \"Sample labels don't match...
[ "0.57570755", "0.5555972", "0.55552924", "0.5460718", "0.5453514", "0.54446", "0.5435614", "0.5430254", "0.54152614", "0.5390983", "0.5363977", "0.53600717", "0.53240967", "0.5307169", "0.5247071", "0.52451223", "0.5243506", "0.5241698", "0.5207887", "0.52031714", "0.5197458"...
0.0
-1
d = pd.read_csv("queryExamples.csv", sep=';', header=0, dtype=str) dt = np.asarray(d)
def getExampleQueries(self, selectedID = 0): return ""
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def csv_2_numpy(file, path=INPUT_PATH, sep=',', type='int8'):\n file_path = path + file\n reader = csv.reader(open(file_path, \"r\"), delimiter=sep)\n x = list(reader)\n dataset = numpy.array(x).astype(type)\n return dataset", "def line_to_data(line, np_array=True, dtype=int):\n if np_array:\n ...
[ "0.6832343", "0.6506066", "0.64984345", "0.647986", "0.6379363", "0.63469446", "0.63033277", "0.63006586", "0.61761343", "0.6145286", "0.61397374", "0.6042658", "0.6030253", "0.6016271", "0.6007008", "0.60067964", "0.5982973", "0.59794915", "0.5955656", "0.59441096", "0.59338...
0.0
-1
descriptorsDir = "descriptorsCSV/" descriptors = [f for f in listdir(descriptorsDir) if isfile(join(descriptorsDir, f))] html = ""
def getDescriptors(self, dsc = ""): return ""
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def findhtml(pathused,ticker,typ):\n\n allfiles = [] # initializing the return list\n pathused += \"/\"+ticker.upper()+\"/\"+typ # since SEC_edgar has a standard way to store files as its the Ticker and inside \n # sec-edgar-filings ==> AAPL ==> 10-K \n \n for ...
[ "0.592098", "0.5837011", "0.57708496", "0.57358974", "0.56856805", "0.56537116", "0.5609058", "0.55295724", "0.55270106", "0.5513947", "0.5473819", "0.54421717", "0.5438239", "0.54315954", "0.53197914", "0.5316276", "0.5309928", "0.5302465", "0.52725977", "0.52526444", "0.524...
0.0
-1
set session for current user
def set_current_user(self, user): self.session['u'] = user.get().key.urlsafe()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def do_login(user):\n session[CURRENT_USER_KEY] = user.id", "def set_su_user(self, su_user):\n self.request.session[AUTH_SESSION_KEY] = su_user.id\n self.request.session[AUTH_HASH_SESSION_KEY] = su_user.get_session_auth_hash()\n if su_user.id != self.auth_user.id:\n self.reques...
[ "0.740831", "0.71369225", "0.70445764", "0.6964448", "0.6953895", "0.6869955", "0.6834737", "0.68247133", "0.6789445", "0.6729116", "0.6723161", "0.6709489", "0.6669265", "0.6656851", "0.66272396", "0.66168904", "0.66127384", "0.6612591", "0.66067016", "0.6592191", "0.6569845...
0.7985505
0
set session for current school that user choose when login
def set_current_school(self, school_key): self.session['s'] = school_key
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def choose_school():\n if current_user.is_administrator():\n schools = School.query.order_by(School.long_name)\n else:\n schools = current_user.schools_coached\n\n # if initial get request, render add_school.html\n return render_template('choose_school.html', schools=schools)", "def set...
[ "0.6246114", "0.6165318", "0.60238373", "0.59813094", "0.5963209", "0.58441776", "0.58033544", "0.5755063", "0.5727515", "0.5708403", "0.56811965", "0.56026447", "0.5592895", "0.5572259", "0.55581385", "0.54835755", "0.5440814", "0.5436401", "0.54343957", "0.5427836", "0.5427...
0.7416146
0
set session for current admin
def setup_admin_session(self, user): self.session['ad'] = user.get().key.urlsafe()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_current_user(self, user):\n self.session['u'] = user.get().key.urlsafe()", "def login(test_app):\n from flask_monitoringdashboard import config\n\n with test_app.session_transaction() as sess:\n sess[config.link + '_logged_in'] = True\n sess[config.link + '_admin'] = True", "...
[ "0.64475083", "0.640205", "0.63752884", "0.6369683", "0.63622195", "0.62239605", "0.6216995", "0.6164825", "0.61162066", "0.60842025", "0.6078582", "0.60669124", "0.6065299", "0.60632056", "0.60338914", "0.6033646", "0.6027066", "0.6002428", "0.5977556", "0.59413683", "0.5925...
0.743749
0
Logout and delete all session
def get(self, *args, **kwargs): for key in self.session.keys(): del self.session[key] self.redirect("/admin/authentication/login")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def logout(self):\n self.session.disconnect()", "def do_logout():\n del session[CURRENT_USER_KEY]", "def logout():\n _cookies = ['user', 'pass', 'hash']\n for cookie in _cookies:\n util.web.delete_cookie(cookie)", "def logout(self):\n pass", "def logout():\n rin...
[ "0.80323476", "0.8031286", "0.79632694", "0.7731124", "0.76978016", "0.7690662", "0.76204586", "0.7595756", "0.7579269", "0.7578065", "0.75664246", "0.7563226", "0.75515246", "0.75192845", "0.75122255", "0.75072306", "0.75061965", "0.7460927", "0.7455791", "0.7447719", "0.743...
0.0
-1
Returns tuple, x position of center, y position of center
def findEgg(self, image, lower, upper): lower = np.array(lower) upper = np.array(upper) shapeMask = cv2.inRange(image, lower, upper) # find the contours in the mask cnts = cv2.findContours(shapeMask.copy(), cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE) cnts = imutils.grab_contours(cnts) # loop over the...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def center(self) -> Tuple[int, int]:\n center_x = int((self.x1 + self.x2) // 2)\n center_y = int((self.y1 + self.y2) // 2)\n return (center_x, center_y)", "def center(self):\n xc = (self.x.max() + self.x.min())/2.\n yc = (self.y.max() + self.y.min())/2.\n return (xc, yc)...
[ "0.8680406", "0.8341965", "0.8323294", "0.82362115", "0.80616033", "0.8031392", "0.80029976", "0.7967143", "0.7940467", "0.787328", "0.7865948", "0.78087837", "0.7706403", "0.7674429", "0.76208365", "0.7598615", "0.75848573", "0.757273", "0.75388604", "0.75382733", "0.7524019...
0.0
-1
Just generate all possible payloads and return them in a list. Ignore the `incomings` parameter because there are no inputs.
def process(self, incomings): payloads = [] payloads.append(["../../../../../../../../var/www/attacker.com/public_html/", "image.jpg"]) payloads.append(["L2V0Yy9wYXNzd2Q="]) payloads.append(["TDJWMFl5OXdZWE56ZDJRPQ%3D%3D"]) #Contains the various types of directory pathing ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generate_payload(self):\n payload = []\n for i in range(self.elements_per_update):\n payload.append({\n \"uuid\": str(uuid.uuid4()),\n \"symbol\": self.symbols[i % len(self.symbols)],\n \"price\": random.randint(self.min_price, self.max_pric...
[ "0.6261763", "0.6098073", "0.5758599", "0.5671333", "0.5661374", "0.54746294", "0.54583114", "0.54393774", "0.53984535", "0.53903353", "0.53893536", "0.5371747", "0.53708667", "0.5354138", "0.53407294", "0.5324242", "0.5261285", "0.5215311", "0.51777387", "0.5169679", "0.5144...
0.0
-1
generate a gaussian kernel
def gaussian_kernel(kernel_size: (int, tuple, list), width: float): kernel_size = np.asarray(to_list(kernel_size, 2), np.float) half_ksize = (kernel_size - 1) / 2.0 x, y = np.mgrid[-half_ksize[0]:half_ksize[0] + 1, -half_ksize[1]:half_ksize[1] + 1] kernel = np.exp(-(x ** 2 + y ** 2) / (2 * width ** 2)...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def makeGaussianKernel(sigma: float) -> np.ndarray:\n\n # Your code here.\n kernel_size = 8*sigma+1\n kernel = np.zeros([kernel_size,kernel_size], dtype=float)\n center = kernel_size//2\n \n \n s = 2*(sigma**2)\n sum_val = 0\n for i in range(0,kernel_size):\n for j in range(0,kern...
[ "0.77656406", "0.7668909", "0.76349425", "0.7562456", "0.7491493", "0.74768865", "0.74616927", "0.74480236", "0.7444865", "0.74286896", "0.74195147", "0.7407134", "0.7398218", "0.7387571", "0.7384498", "0.73416746", "0.72804046", "0.72344667", "0.7227005", "0.72260153", "0.71...
0.741546
11
generate anisotropic gaussian kernel
def anisotropic_gaussian_kernel(kernel_size: (int, tuple, list), theta: float, l1: float, l2: float): def gmdistribution(mu, sigma): half_k = (kernel_size - 1) / 2.0 x, y = np.mgrid[-half_k[0]:half_k[0] + 1, -half_k[1]:half_k[1] + 1] X = np.expand_dims(np.stack([y, x], axi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def makeGaussianKernel(sigma: float) -> np.ndarray:\n\n # Your code here.\n kernel_size = 8*sigma+1\n kernel = np.zeros([kernel_size,kernel_size], dtype=float)\n center = kernel_size//2\n \n \n s = 2*(sigma**2)\n sum_val = 0\n for i in range(0,kernel_size):\n for j in range(0,kern...
[ "0.77107793", "0.7641565", "0.7404558", "0.73151636", "0.7284177", "0.7278752", "0.7257874", "0.725323", "0.7217436", "0.72001195", "0.71902305", "0.7181965", "0.71761817", "0.7167993", "0.71560705", "0.7080714", "0.7077858", "0.7072405", "0.7039239", "0.7037398", "0.70350915...
0.65793484
62
Estimated CRF, transform irradiance L to RGB image. If `crf_table` is inverted, transform RGB image to irradiance L.
def camera_response_function(inputs, crf_table, max_val=1): inputs_norm = np.clip(inputs / max_val, 0, 1) quant = crf_table.shape[0] - 1 inputs_index = (inputs_norm * quant).astype('int32') ret = [] for i in inputs_index.flatten(): ret.append(crf_table[i]) return np.reshape(ret, inputs.shape)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def crf_refine(label,\n img,\n crf_theta_slider_value,\n crf_mu_slider_value,\n crf_downsample_factor,\n gt_prob):\n\n Horig = label.shape[0]\n Worig = label.shape[1]\n\n l_unique = np.unique(label.flatten())#.tolist()\n scale = 1+(5 * (np.array(img.shape).max() / 3000))\n logging.inf...
[ "0.543145", "0.54256666", "0.54248387", "0.537617", "0.5180758", "0.5143052", "0.50994086", "0.5099363", "0.5006858", "0.49987954", "0.49229413", "0.49061176", "0.4905395", "0.48856765", "0.48807964", "0.48664606", "0.4861298", "0.48559242", "0.48515674", "0.48475456", "0.483...
0.52573466
4
Consolidates based on filing type upto the given transaction id of a filing.
def get_revision(filing_id, business_id): business = Business.find_by_internal_id(business_id) filing = Filing.find_by_id(filing_id) revision_json = {} revision_json['filing'] = {} if filing.filing_type == 'incorporationApplication': revision_json['filing'] = \ ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def consolidate(self, *args, **kwargs):\n kwargs['mode'] = 'consolidate'\n kwargs['mix_before'] = (0, 0)\n kwargs['air_gap'] = 0\n kwargs['disposal_vol'] = 0\n return self.transfer(*args, **kwargs)", "def merge_supplier_transaction(cleaned_supplier_data, cleaned_transaction_dat...
[ "0.49317023", "0.47416252", "0.45447615", "0.4507857", "0.44511983", "0.4415977", "0.43252644", "0.43213362", "0.43195716", "0.43165377", "0.43093824", "0.42502373", "0.42033148", "0.42021173", "0.42003173", "0.41973242", "0.41731387", "0.416284", "0.41517442", "0.41230783", ...
0.0
-1
Consolidates incorporation application upto the given transaction id of a filing.
def get_ia_revision(filing, business) -> dict: ia_json = {} ia_json['business'] = \ VersionedBusinessDetailsService.get_business_revision(filing.transaction_id, business) ia_json['incorporationApplication'] = {} ia_json['incorporationApplication']['offices'] = \ ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def consolidate(self, *args, **kwargs):\n kwargs['mode'] = 'consolidate'\n kwargs['mix_before'] = (0, 0)\n kwargs['air_gap'] = 0\n kwargs['disposal_vol'] = 0\n return self.transfer(*args, **kwargs)", "def apply(self, transaction, context):\n\n header = transaction.header...
[ "0.51854515", "0.4774149", "0.47555128", "0.45698297", "0.4471355", "0.44628233", "0.4445196", "0.44214734", "0.44129953", "0.44041756", "0.43950042", "0.43621913", "0.43494466", "0.43302774", "0.42848316", "0.42814407", "0.42765537", "0.42567483", "0.4235328", "0.4192869", "...
0.0
-1
Consolidates change of directors upto the given transaction id of a filing.
def get_cod_revision(filing, business) -> dict: cod_json = {} cod_json['business'] = \ VersionedBusinessDetailsService.get_business_revision(filing.transaction_id, business) cod_json['changeOfDirectors'] = {} cod_json['changeOfDirectors']['directors'] = \ Version...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def action_process(self):\n self.check_difference_balance()\n for statement in self:\n statement_lines = statement.credit_move_line_ids + statement.debit_move_line_ids\n for statement_line in statement_lines:\n if statement_line.move_line_id:\n ...
[ "0.48786485", "0.47393093", "0.46903118", "0.4683563", "0.4673902", "0.46331817", "0.4600814", "0.45809242", "0.44975787", "0.4429772", "0.44205922", "0.4400462", "0.43680486", "0.43663508", "0.43542743", "0.43518484", "0.43416554", "0.43398026", "0.43324035", "0.43308827", "...
0.0
-1
Consolidates change of address upto the given transaction id of a filing.
def get_coa_revision(filing, business) -> dict: coa_json = {} coa_json['business'] = \ VersionedBusinessDetailsService.get_business_revision(filing.transaction_id, business) coa_json['changeOfAddress'] = {} coa_json['changeOfAddress']['offices'] = \ VersionedBusi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ship_to_pickup_address(self, address):\n self._set('shipping', 'pickup_address_id', address.id)", "def deposit_to_account(list_of_all_accounts_known, ID_account_to_deposit_to, money_amount_to_deposit):\n for account in list_of_all_accounts_known:\n if ID_account_to_deposit_to == acco...
[ "0.50302166", "0.49903312", "0.4896131", "0.48416403", "0.47821873", "0.47475737", "0.47422007", "0.4726105", "0.47027257", "0.46690908", "0.4667114", "0.46177053", "0.46153784", "0.45717567", "0.45618382", "0.45515", "0.45197892", "0.4490286", "0.44608918", "0.44540498", "0....
0.0
-1
Consolidates annual report upto the given transaction id of a filing.
def get_ar_revision(filing, business) -> dict: ar_json = {} ar_json['business'] = \ VersionedBusinessDetailsService.get_business_revision(filing.transaction_id, business) ar_json['annualReport'] = {} if business.last_ar_date: ar_json['annualReport']['annualRepor...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def prep_incorp_filing(session, identifier, payment_id, option, legal_type=None):\n business = create_business(identifier, legal_type=legal_type, legal_name=LEGAL_NAME)\n filing_template = copy.deepcopy(INCORPORATION_FILING_TEMPLATE)\n filing_template['filing']['business'] = {'identifier': business.identi...
[ "0.5235263", "0.50493723", "0.50060093", "0.49657115", "0.49402353", "0.4779273", "0.47779074", "0.47531906", "0.47376817", "0.47280854", "0.46448475", "0.4634219", "0.46263924", "0.46233433", "0.4618344", "0.46152997", "0.46138", "0.46027547", "0.4588643", "0.45828047", "0.4...
0.0
-1
Retrieve header from filing.
def get_header_revision(filing) -> dict: _header = filing.json['filing']['header'] return _header
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_header(self):\n return self._header", "def header(self):\n return self[0]", "def getHeader():\n return _HEADER", "def header(self):\r\n return self.__header", "def getHeader(self):\n return self.data.header", "def _get_header(self, header):\n if header is Non...
[ "0.75873977", "0.7430095", "0.7323195", "0.7295065", "0.7293838", "0.7291236", "0.72339875", "0.72339875", "0.72339875", "0.7061032", "0.70011765", "0.6993449", "0.6981213", "0.69021666", "0.68439883", "0.6841015", "0.6840614", "0.68289", "0.67658603", "0.6764321", "0.6752381...
0.7422671
2
Consolidates company details upto the given transaction id of a filing.
def get_company_details_revision(filing_id, business_id) -> dict: company_profile_json = {} business = Business.find_by_internal_id(business_id) filing = Filing.find_by_id(filing_id) company_profile_json['business'] = \ VersionedBusinessDetailsService.get_business_revision(fi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def prep_alteration_filing(session, identifier, option, company_name):\n business = create_business(identifier, legal_type=Business.LegalTypes.BCOMP.value, legal_name=company_name)\n filing_template = copy.deepcopy(ALTERATION_FILING_TEMPLATE)\n filing_template['filing']['business'] = \\\n {'identif...
[ "0.53339934", "0.5223322", "0.5197929", "0.5141939", "0.5136625", "0.48747456", "0.48442817", "0.48181129", "0.4786767", "0.47192055", "0.46794316", "0.46114996", "0.45652616", "0.4548141", "0.45259282", "0.4521646", "0.45143613", "0.45140252", "0.44780788", "0.44776148", "0....
0.4687291
10
Consolidates the business info as of a particular transaction.
def get_business_revision(transaction_id, business) -> dict: business_version = version_class(Business) business_revision = db.session.query(business_version) \ .filter(business_version.transaction_id <= transaction_id) \ .filter(business_version.operation_type != 2) \ ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __preprocess_transactions(self):\n\n p_bar = tqdm(range(14), desc=\"Preprocessing transactions\", leave=False)\n\n try:\n # 0. If optional fields not in the transactions add missing\n optional_fields = [\n \"Sector\",\n \"Industry\",\n ...
[ "0.54886127", "0.53659767", "0.5251373", "0.5233803", "0.5204309", "0.51957595", "0.5115674", "0.5096284", "0.5044581", "0.5029625", "0.49510285", "0.489361", "0.48638722", "0.48422092", "0.484127", "0.4826738", "0.48115295", "0.48094976", "0.48029786", "0.47919956", "0.47744...
0.0
-1
Return business version object associated with a given transaction id for a business.
def get_business_revision_obj(transaction_id, business): business_version = version_class(Business) business_revision = db.session.query(business_version) \ .filter(business_version.transaction_id <= transaction_id) \ .filter(business_version.operation_type != 2) \ .f...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_business_revision(transaction_id, business) -> dict:\n business_version = version_class(Business)\n business_revision = db.session.query(business_version) \\\n .filter(business_version.transaction_id <= transaction_id) \\\n .filter(business_version.operation_type != 2) \...
[ "0.7636616", "0.6377281", "0.6335256", "0.63015807", "0.6286003", "0.6253474", "0.6029115", "0.5956254", "0.5956254", "0.5956254", "0.593759", "0.5815979", "0.5777107", "0.5764829", "0.57134163", "0.55761206", "0.5534498", "0.5525413", "0.55233735", "0.5461759", "0.5421985", ...
0.8101256
0
Get business info with last value of dissolution_date or restoration_expiry_date.
def find_last_value_from_business_revision(transaction_id, business_id, is_dissolution_date=False, is_restoration_expiry_date=False) -> dict: business_version = version_class(Business) query = db.session.query(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_adv_acct_business(clean_data, all_slot_coupons, this_advertiser):\n business_id = clean_data['business_id']\n if business_id:\n business = Business.objects.get(id=business_id)\n elif all_slot_coupons:\n # Select the business with the most recently added slot_time_frame.\n busi...
[ "0.63183683", "0.59914434", "0.53736246", "0.5331287", "0.5306034", "0.5255722", "0.51936203", "0.51891106", "0.51854855", "0.51780736", "0.51550066", "0.5148936", "0.5130781", "0.50994205", "0.5098762", "0.5097678", "0.50936073", "0.50932556", "0.50902474", "0.50853217", "0....
0.6853517
0
Consolidates the business info as of a particular transaction.
def get_business_revision_after_filing(filing_id, business_id) -> dict: business = Business.find_by_internal_id(business_id) filing = Filing.find_by_id(filing_id) business_version = version_class(Business) business_revision = db.session.query(business_version) \ .filter(busin...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __preprocess_transactions(self):\n\n p_bar = tqdm(range(14), desc=\"Preprocessing transactions\", leave=False)\n\n try:\n # 0. If optional fields not in the transactions add missing\n optional_fields = [\n \"Sector\",\n \"Industry\",\n ...
[ "0.5488286", "0.5367723", "0.5251625", "0.52338696", "0.5204787", "0.51965904", "0.5116716", "0.50968915", "0.50451744", "0.50295514", "0.49521682", "0.4893911", "0.48631588", "0.48414692", "0.4840194", "0.48270077", "0.4810524", "0.48089162", "0.48022336", "0.47932863", "0.4...
0.0
-1
Consolidates all office changes upto the given transaction id.
def get_office_revision(transaction_id, business_id) -> dict: offices_json = {} address_version = version_class(Address) offices_version = version_class(Office) offices = db.session.query(offices_version) \ .filter(offices_version.transaction_id <= transaction_id) \ ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def all_transactions(self):\n self._update()\n with self.all_tx_lock:\n all_tx_copy = copy.deepcopy(self._all_transactions)\n return all_tx_copy", "def clean_transactions(transactions):\n\n #Preprocessing\n df = create_datetime_col(transactions)\n\n #Dropping transactions...
[ "0.50735056", "0.5040346", "0.4986473", "0.49364966", "0.48510218", "0.4845584", "0.4815689", "0.47919053", "0.47557163", "0.4748652", "0.4742432", "0.4703487", "0.46967387", "0.4665292", "0.46559128", "0.4577299", "0.45496902", "0.45431966", "0.4524736", "0.45118833", "0.449...
0.4638672
15
Consolidates all party changes upto the given transaction id.
def get_party_role_revision(transaction_id, business_id, is_ia_or_after=False, role=None) -> dict: party_role_version = version_class(PartyRole) party_roles = db.session.query(party_role_version)\ .filter(party_role_version.transaction_id <= transaction_id) \ .filter(party_role_v...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def consolidate(self, *args, **kwargs):\n kwargs['mode'] = 'consolidate'\n kwargs['mix_before'] = (0, 0)\n kwargs['air_gap'] = 0\n kwargs['disposal_vol'] = 0\n return self.transfer(*args, **kwargs)", "def _merge_block(internal_transactions, transactions, whitelist):\n transa...
[ "0.52449286", "0.5035682", "0.50141925", "0.50126517", "0.4967316", "0.48978275", "0.48791042", "0.48038042", "0.47823894", "0.4781556", "0.47617856", "0.47498944", "0.47413868", "0.4725821", "0.47131774", "0.4705725", "0.46827042", "0.46808237", "0.46777833", "0.46600205", "...
0.0
-1
Consolidates all share classes upto the given transaction id.
def get_share_class_revision(transaction_id, business_id) -> dict: share_class_version = version_class(ShareClass) share_classes_list = db.session.query(share_class_version) \ .filter(share_class_version.transaction_id <= transaction_id) \ .filter(share_class_version.operation_ty...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def group_by_namespace(self):\n package = self.container.config.output.package\n groups = collections.group_by(self.container, key=get_target_namespace)\n for namespace, classes in groups.items():\n self.assign(classes, package, namespace or \"\")", "def group_by_strong_components...
[ "0.5139013", "0.50330913", "0.48715967", "0.48479706", "0.48171863", "0.4742321", "0.46083876", "0.45552248", "0.4535983", "0.4531581", "0.45151782", "0.44682208", "0.4465922", "0.44380042", "0.44106326", "0.44035476", "0.44020128", "0.4396122", "0.43579513", "0.43411663", "0...
0.5442146
0
Consolidates all share series under the share class upto the given transaction id.
def get_share_series_revision(transaction_id, share_class_id) -> dict: share_series_version = version_class(ShareSeries) share_series_list = db.session.query(share_series_version) \ .filter(share_series_version.transaction_id <= transaction_id) \ .filter(share_series_version.oper...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_share_class_revision(transaction_id, business_id) -> dict:\n share_class_version = version_class(ShareClass)\n share_classes_list = db.session.query(share_class_version) \\\n .filter(share_class_version.transaction_id <= transaction_id) \\\n .filter(share_class_version.o...
[ "0.5190824", "0.5187994", "0.5142222", "0.5073142", "0.4927391", "0.49156842", "0.48170972", "0.48046333", "0.47612914", "0.4756013", "0.46777904", "0.46077105", "0.45642272", "0.45364735", "0.45220184", "0.44816855", "0.4480779", "0.44729975", "0.44729114", "0.44596547", "0....
0.55091697
0
Consolidates all name translations upto the given transaction id.
def get_name_translations_revision(transaction_id, business_id) -> dict: name_translations_version = version_class(Alias) name_translations_list = db.session.query(name_translations_version) \ .filter(name_translations_version.transaction_id <= transaction_id) \ .filter(name_tran...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_name_translations_before_revision(transaction_id, business_id) -> dict:\n name_translations_version = version_class(Alias)\n name_translations_list = db.session.query(name_translations_version) \\\n .filter(name_translations_version.transaction_id <= transaction_id) \\\n ...
[ "0.55154634", "0.54775083", "0.5125466", "0.48724905", "0.48452628", "0.48440036", "0.47670454", "0.47247544", "0.46813482", "0.46743435", "0.4670805", "0.46494198", "0.4585894", "0.45795876", "0.45453605", "0.447221", "0.44493878", "0.44377983", "0.43929964", "0.43859535", "...
0.5474167
2
Consolidates all name translations before deletion given a transaction id.
def get_name_translations_before_revision(transaction_id, business_id) -> dict: name_translations_version = version_class(Alias) name_translations_list = db.session.query(name_translations_version) \ .filter(name_translations_version.transaction_id <= transaction_id) \ .filter(na...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_translated_ids(id, event=True):", "def remove_transcripts_from_store(_step, subs_id):\r\n filename = 'subs_{0}.srt.sjson'.format(subs_id.strip())\r\n content_location = StaticContent.compute_location(\r\n world.scenario_dict['COURSE'].id,\r\n filename\r\n )\r\n try:\r\n ...
[ "0.6055344", "0.55234", "0.545676", "0.5236792", "0.5174594", "0.513172", "0.5046025", "0.4999335", "0.49556133", "0.491088", "0.48742318", "0.48695627", "0.4771532", "0.47713655", "0.47671568", "0.47589326", "0.47411644", "0.47401896", "0.46936035", "0.46862566", "0.46729362...
0.49059632
10
Consolidates all resolutions upto the given transaction id.
def get_resolution_dates_revision(transaction_id, business_id) -> dict: resolution_version = version_class(Resolution) resolution_list = db.session.query(resolution_version) \ .filter(resolution_version.transaction_id <= transaction_id) \ .filter(resolution_version.operation_type...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def transform_datasource(transaction_id):\n from .models import UploadTransaction\n tx = UploadTransaction.objects.get(tx_id=transaction_id)\n tx.run()\n # return tx", "def aggregateTxnsByRoutes(self, txnSubCollection, ancestry):\n from xpedite.types.route import conflateRoutes\n srcRouteMap = ...
[ "0.5312851", "0.50690717", "0.47930416", "0.4660941", "0.4579437", "0.4526906", "0.45195293", "0.44836763", "0.44236094", "0.44093966", "0.43754494", "0.4348329", "0.43352583", "0.43277034", "0.43260756", "0.43129936", "0.42875925", "0.42719135", "0.42505714", "0.4243466", "0...
0.42772335
17
Return the party member as a json object.
def party_role_revision_json(transaction_id, party_role_revision, is_ia_or_after) -> dict: cessation_date = datetime.date(party_role_revision.cessation_date).isoformat()\ if party_role_revision.cessation_date else None party_revision = VersionedBusinessDetailsService.get_party_revision(trans...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_person_like_json(self):\n return json.dumps(self.get_person())", "def test_party_json(session):\n party = MhrParty(\n id=1000,\n party_type = MhrPartyTypes.OWNER_BUS,\n status_type = MhrOwnerStatusTypes.ACTIVE,\n business_name='BUSINESS',\n email_id='test@gmai...
[ "0.67256284", "0.6194612", "0.6118959", "0.61017704", "0.6004083", "0.59829235", "0.5981926", "0.59675497", "0.58262146", "0.58163095", "0.5804764", "0.5765838", "0.5736367", "0.5731408", "0.5728028", "0.57178354", "0.5710809", "0.56677073", "0.5652171", "0.5628076", "0.56238...
0.0
-1
Consolidates all party changes upto the given transaction id.
def get_party_revision(transaction_id, party_id) -> dict: party_version = version_class(Party) party = db.session.query(party_version) \ .filter(party_version.transaction_id <= transaction_id) \ .filter(party_version.operation_type != 2) \ .filter(party_version.id == ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def consolidate(self, *args, **kwargs):\n kwargs['mode'] = 'consolidate'\n kwargs['mix_before'] = (0, 0)\n kwargs['air_gap'] = 0\n kwargs['disposal_vol'] = 0\n return self.transfer(*args, **kwargs)", "def _merge_block(internal_transactions, transactions, whitelist):\n transa...
[ "0.5245135", "0.50370425", "0.5016701", "0.5013465", "0.49686235", "0.48996598", "0.4880607", "0.4806052", "0.47830546", "0.478216", "0.47636852", "0.4749744", "0.47431743", "0.47264412", "0.47150174", "0.47077274", "0.46826148", "0.46816784", "0.4679912", "0.46609294", "0.46...
0.0
-1
Return the party member by type as a json object.
def party_revision_type_json(party_revision, is_ia_or_after) -> dict: member = {} if party_revision.party_type == Party.PartyTypes.PERSON.value: member = { 'officer': { 'firstName': party_revision.first_name, 'lastName': party_revision....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_person_like_json(self):\n return json.dumps(self.get_person())", "def json(self):\n return {'name': self.neighbourhood_group, 'neighbourhood': self.room_type}", "def to_json(self):\r\n return {'type': self.type, 'name': self.name}", "def test_party_json(session):\n party = Mhr...
[ "0.59179246", "0.5765067", "0.5714951", "0.5656859", "0.5601924", "0.5516952", "0.5516952", "0.55098546", "0.54318315", "0.5260781", "0.52107835", "0.52107835", "0.52107835", "0.52107835", "0.5145145", "0.5145117", "0.5118637", "0.5068482", "0.50048494", "0.4981137", "0.49722...
0.65182054
0
Return the party member as a json object.
def party_revision_json(transaction_id, party_revision, is_ia_or_after) -> dict: member = VersionedBusinessDetailsService.party_revision_type_json(party_revision, is_ia_or_after) if party_revision.delivery_address_id: address_revision = VersionedBusinessDetailsService.get_address_revision( ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_person_like_json(self):\n return json.dumps(self.get_person())", "def test_party_json(session):\n party = MhrParty(\n id=1000,\n party_type = MhrPartyTypes.OWNER_BUS,\n status_type = MhrOwnerStatusTypes.ACTIVE,\n business_name='BUSINESS',\n email_id='test@gmai...
[ "0.67284685", "0.6194194", "0.611997", "0.61034185", "0.6006451", "0.59830326", "0.598254", "0.58288425", "0.58197945", "0.5802139", "0.57688975", "0.57374674", "0.57333785", "0.57320225", "0.5719263", "0.57135916", "0.56694216", "0.56546605", "0.5631167", "0.562607", "0.5608...
0.59668255
7
Consolidates all party changes upto the given transaction id.
def get_address_revision(transaction_id, address_id) -> dict: address_version = version_class(Address) address = db.session.query(address_version) \ .filter(address_version.transaction_id <= transaction_id) \ .filter(address_version.operation_type != 2) \ .filter(addr...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def consolidate(self, *args, **kwargs):\n kwargs['mode'] = 'consolidate'\n kwargs['mix_before'] = (0, 0)\n kwargs['air_gap'] = 0\n kwargs['disposal_vol'] = 0\n return self.transfer(*args, **kwargs)", "def _merge_block(internal_transactions, transactions, whitelist):\n transa...
[ "0.5244963", "0.5036844", "0.50164324", "0.50134957", "0.49683398", "0.48991808", "0.488158", "0.48052537", "0.4783525", "0.47817028", "0.47629765", "0.4749287", "0.47427288", "0.47258097", "0.4714521", "0.47077513", "0.4681658", "0.46814072", "0.46796298", "0.46607122", "0.4...
0.0
-1
Return a dict of this object, with keys in JSON format.
def address_revision_json(address_revision): country_description = '' if address_revision.country: country_description = pycountry.countries.search_fuzzy(address_revision.country)[0].name return { 'streetAddress': address_revision.street, 'streetAddressAdditio...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def json(self):\n return json.dumps(self, default=lambda o: o.__dict__,\n sort_keys=True, indent=4)", "def to_json(self) -> Dict[str, Any]:\n return self.__dict__", "def json(self):\n return {\n 'id': self.id,\n 'name': self.name\n }", ...
[ "0.8144109", "0.8142001", "0.8105588", "0.796904", "0.7954904", "0.7867204", "0.78586286", "0.7856205", "0.7856205", "0.785492", "0.785492", "0.785492", "0.7854319", "0.7854319", "0.7854319", "0.783863", "0.783863", "0.783863", "0.783863", "0.7835416", "0.7831754", "0.78317...
0.0
-1
Return the share_class as a json object.
def share_class_revision_json(share_class_revision) -> dict: share_class = { 'id': share_class_revision.id, 'name': share_class_revision.name, 'priority': share_class_revision.priority, 'hasMaximumShares': share_class_revision.max_share_flag, 'maxNumbe...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_json(self):\n obj_dict = self.__dict__\n obj_dict[\"_class_\"] = self.__class__.__name__\n return obj_dict", "def cls2json(self):\n return json.dumps(self.__dict__)", "def cls2json(self):\n return json.dumps(self.__dict__)", "def to_dict(self):\n result = supe...
[ "0.64385223", "0.64294195", "0.64294195", "0.6168101", "0.599551", "0.5803228", "0.57021445", "0.57014143", "0.5676124", "0.5641927", "0.5622269", "0.5605307", "0.55982053", "0.55899024", "0.55899024", "0.55899024", "0.5582552", "0.55741054", "0.5545515", "0.5539542", "0.5539...
0.692662
0
Return the share series revision as a json object.
def share_series_revision_json(share_series_revision) -> dict: share_series = { 'id': share_series_revision.id, 'name': share_series_revision.name, 'priority': share_series_revision.priority, 'hasMaximumShares': share_series_revision.max_share_flag, 'm...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_share_series_revision(transaction_id, share_class_id) -> dict:\n share_series_version = version_class(ShareSeries)\n share_series_list = db.session.query(share_series_version) \\\n .filter(share_series_version.transaction_id <= transaction_id) \\\n .filter(share_series_v...
[ "0.708846", "0.6720135", "0.6084429", "0.58188486", "0.5759813", "0.5623428", "0.5623428", "0.5560211", "0.55411124", "0.55097365", "0.5487668", "0.54803145", "0.54494274", "0.5414318", "0.539694", "0.5353764", "0.52968645", "0.5291189", "0.52851427", "0.5240236", "0.52177316...
0.8145801
0
Return the name translation revision as a json object.
def name_translations_json(name_translation_revision) -> dict: name_translation = { 'id': str(name_translation_revision.id), 'name': name_translation_revision.alias, 'type': name_translation_revision.type } return name_translation
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def revision_name(self):\n return self._revision_name", "def get_name_translations_revision(transaction_id, business_id) -> dict:\n name_translations_version = version_class(Alias)\n name_translations_list = db.session.query(name_translations_version) \\\n .filter(name_translation...
[ "0.63252676", "0.6090434", "0.59809774", "0.59141386", "0.5811075", "0.5675912", "0.5657325", "0.5536982", "0.54140645", "0.5410727", "0.54099125", "0.5404105", "0.53842735", "0.5366681", "0.5348114", "0.53427243", "0.53400004", "0.5282428", "0.5273558", "0.5273386", "0.52596...
0.81740797
0
Return the resolution revision as a json object.
def resolution_json(resolution_revision) -> dict: resolution = { 'id': resolution_revision.id, 'date': resolution_revision.resolution_date.strftime('%B %-d, %Y'), 'type': resolution_revision.resolution_type } return resolution
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_json(self):\n return {\n 'revision': self.revision,\n 'active': self.active,\n 'archived_at': self.archived_at\n }", "def revision(self):\n return self._revision", "def revision(self):\n return self._revision", "def get_revision(self) -> str...
[ "0.6687245", "0.6393448", "0.6393448", "0.62428397", "0.62007344", "0.6174118", "0.6029406", "0.6012772", "0.59804827", "0.5977369", "0.59660566", "0.5938327", "0.5914053", "0.58789593", "0.5854711", "0.58510196", "0.58412087", "0.5827877", "0.5823848", "0.57971644", "0.57879...
0.7941922
0
Return the business revision as a json object.
def business_revision_json(business_revision, business_json): business_json['hasRestrictions'] = business_revision.restriction_ind business_json['dissolutionDate'] = LegislationDatetime.format_as_legislation_date( business_revision.dissolution_date) if business_revision.dissolution_date else...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_json(self):\n return {\n 'revision': self.revision,\n 'active': self.active,\n 'archived_at': self.archived_at\n }", "def get_cod_revision(filing, business) -> dict:\n cod_json = {}\n\n cod_json['business'] = \\\n VersionedBusinessDet...
[ "0.73196644", "0.7150604", "0.6965336", "0.69643956", "0.6898412", "0.6647638", "0.6617927", "0.64494884", "0.6417139", "0.6356839", "0.6356563", "0.6326582", "0.618475", "0.61779064", "0.6150429", "0.6115579", "0.61032957", "0.6018561", "0.6018561", "0.6005441", "0.59775114"...
0.76480556
0
Return incorporation agreement from filing json.
def get_incorporation_agreement_json(filing): return filing.json['filing']['incorporationApplication'].get('incorporationAgreement', {})
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_agreement(self):\n pass", "def agreements():\n pass", "def reconcile_somef_data(data):\n out = {}\n for key, value in data.items():\n # for now, we are not exporting provenance keys. Ignore all keys like somef_provenance\n if \"somef\" not in key:\n ...
[ "0.56559736", "0.55618954", "0.5244109", "0.5151223", "0.5143148", "0.5112683", "0.5045774", "0.49902293", "0.4906993", "0.48691648", "0.48342612", "0.4829858", "0.48195443", "0.48008758", "0.478164", "0.47634107", "0.47534582", "0.47188726", "0.47175965", "0.4712452", "0.465...
0.7839245
0
Return name request from filing json.
def get_name_request_revision(filing): return filing.json['filing']['incorporationApplication'].get('nameRequest', {})
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def name(self):\r\n return self.data[\"name\"]", "def name(self) -> str:\n\t\treturn self._raw_result['name']", "def name(self):\n return self.raw.get(\"name\")", "def name(self):\n return self._data.get('name')", "def name(self):\n return self._data.get('name')", "def name(se...
[ "0.6360576", "0.614522", "0.606821", "0.60068506", "0.60068506", "0.60066885", "0.6003148", "0.5909763", "0.5893203", "0.5820227", "0.57792675", "0.5760327", "0.5744369", "0.571816", "0.56807256", "0.5665313", "0.56221956", "0.5590636", "0.5578593", "0.55743855", "0.5563658",...
0.64409065
0
Return contact point from filing json.
def get_contact_point_revision(filing): return filing.json['filing']['incorporationApplication'].get('contactPoint', {})
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def contact_point(self) -> object:\n return self._contact_point", "def get_contact_points(contact_points_path, json_name='contact_points.json',\n dataset_type='ycb', use_clustering=True,\n use_filter_penetration=True,\n inf_penetration_chec...
[ "0.6430361", "0.63854986", "0.59952515", "0.59549403", "0.5636144", "0.55968314", "0.5538288", "0.544604", "0.5436567", "0.5314432", "0.5294083", "0.52843034", "0.5142142", "0.51301235", "0.5117246", "0.51044", "0.50873756", "0.5062358", "0.5023777", "0.50134194", "0.5011443"...
0.6746772
0
Configures cleaned file system schema
def getFilePath( source, paper, month, day, year ): attributes = { SOURCE : source, PAPER : paper, MONTH : month, DAY : day, YEAR : year } return "\\".join( [ settings.CLEAN_STORE ] + [ attributes[...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dev_clean():\n clean_files(\"csv\", True)\n clean_files(\"jsontxt\", True)", "def setup_schema(command, conf, vars):", "def clean():\n user_init.clean_setup()", "def clean():\n clean_files()", "def sanitize_config(config):\n\tif not 'dbfile' in config.keys():\n\t\tconfig['dbfile'] = DEFAULT...
[ "0.61135614", "0.60262734", "0.5725205", "0.56841063", "0.56512666", "0.55450356", "0.5523136", "0.5521303", "0.55139273", "0.54976046", "0.5485929", "0.5448757", "0.5442812", "0.54370314", "0.54358655", "0.54351366", "0.54351366", "0.5428525", "0.5426912", "0.5400248", "0.53...
0.0
-1
Given a sourceDirectory, returns the registered schema. MUST Register schema here!
def getSchema( sourceDirectory ): if( sourceDirectory == settings.LEXISNEXIS_FILETAG ): return LexisNexisSchema() raise Exception( "Filer for source <%s> is not registered in getSchema( source )." % ( sourceDirectory ) )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_source_schema(cls) -> dict:\n source_schema = get_base_schema(\n root=True,\n id_=\"source.schema.json\",\n title=\"Source data schema\",\n description=\"Schema for the source data, files and directories\",\n version=\"0.1.0\",\n )\n ...
[ "0.65721476", "0.6316953", "0.6152082", "0.59883946", "0.59503275", "0.58201414", "0.562178", "0.56007177", "0.5588063", "0.55684656", "0.5486071", "0.54797757", "0.54383653", "0.53457683", "0.53429353", "0.5330753", "0.5323797", "0.5298691", "0.5294363", "0.5268257", "0.5266...
0.77906126
0
Constructs a new model instance.
def __init__(self, params, config=None): super(NizzaModel, self).__init__( model_fn=self.nizza_model_fn, params=params, config=config)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def MakeModel(self):\n pass", "def create_model(self):\n pass", "def create_model(self):\n pass", "def create_model(self):\n model = solph.Model(self.es)\n return model", "def make_model():\n m = model_class(*argv[2:-1])\n modelobj[\"model\"] = m", "def in...
[ "0.7899202", "0.7808241", "0.7808241", "0.7705843", "0.7621898", "0.755002", "0.7448681", "0.7389971", "0.7365762", "0.73443246", "0.7253948", "0.7253948", "0.72371763", "0.7213994", "0.71964335", "0.7186855", "0.7179065", "0.71506745", "0.7128975", "0.7128975", "0.7128975", ...
0.0
-1
This is the model_fn for nizza models. Subclasses should not override this function directly, but rather control its behavior by implementing `precompute()` and `compute_loss()`
def nizza_model_fn(self, features, mode, params): precomputed = self.precompute(features, mode, params) loss = self.compute_loss(features, mode, params, precomputed) train_op = tf.contrib.layers.optimize_loss( loss=loss, global_step=tf.train.get_global_step(), optimizer=tf.train.Adam...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def compute_loss(self, features, mode, params, precomputed):\n raise NotImplementedError(\"Model does not implement loss.\")", "def model_fn(self, features, labels, mode, params, config):\n raise NotImplementedError()", "def build_model_fn(self):\n # Define the model_fn we want to return\n ...
[ "0.6493121", "0.64661187", "0.63006353", "0.6268264", "0.6256369", "0.62445", "0.6237785", "0.6226766", "0.6207205", "0.6190259", "0.6169209", "0.6139843", "0.61165994", "0.61126524", "0.6089907", "0.60873324", "0.60776514", "0.6052805", "0.60448414", "0.60442406", "0.6020787...
0.7382619
0
This is a helper function for alignment models for embeddings. This function returns an embedding for features[name] of size params.name_embed_size assuming a vocab size of params.name_vocab_size. features[feature_name] has to be an integer tensor of shape [batch_size, max_sequence_length].
def embed(self, features, feature_name, params): with tf.variable_scope("%s_embed" % feature_name): embed_matrix = tf.get_variable("embedding_matrix", [getattr(params, "%s_vocab_size" % feature_name), getattr(params, "%s_embed_size" % feature_name)]) return tf.nn.embedding_look...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def build_embedding_layer(inputs_, vocab_size, embed_size):\n embedding = tf.Variable(tf.random_uniform((vocab_size, embed_size), -1, 1))\n embed = tf.nn.embedding_lookup(embedding, inputs_)\n \n return embed", "def embed_features(batch, f_size):\n for f in range(Config.num_feature):\n ...
[ "0.6896678", "0.66577274", "0.6655466", "0.6557072", "0.6546917", "0.6513097", "0.6508412", "0.6499041", "0.648341", "0.6480802", "0.63810956", "0.6362331", "0.6333119", "0.62890506", "0.6286926", "0.62582594", "0.6158827", "0.61498016", "0.61458313", "0.61418664", "0.6091481...
0.7802241
0
Implemnenting this function can bundle the computation of variables which are used for both decoding (alignment/translation) and training. The return value of that function is passed to compute_loss() etc. as the `precomputed` argumemnt.
def precompute(self, features, mode, params): return None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def precalculate():\n pass", "def precalculate():\n pass", "def E_step_precompute(self, model_params, my_suff_stat, my_data):", "def pre_forward(self, *args, **kwargs):\n batch_size = args[0].shape[0]\n if not self.instantiated:\n self.hidden_dim = args[0].shape[-1]\n ...
[ "0.6046909", "0.6046909", "0.5747046", "0.5558208", "0.5538616", "0.54545367", "0.54432714", "0.54280794", "0.541424", "0.5409307", "0.5395517", "0.53825015", "0.5354495", "0.5351136", "0.52674043", "0.52538127", "0.5232878", "0.52251", "0.52243966", "0.5220421", "0.5217032",...
0.5792342
2
Computes the training loss for the alignment model. For example, you could implement crossentropy loss as loss_num, loss_den = common_utils.padded_cross_entropy( precomputed, features["targets"], params.label_smoothing) loss = loss_num / tf.maximum(1.0, loss_den) return loss assuming that precomputed holds the logits f...
def compute_loss(self, features, mode, params, precomputed): raise NotImplementedError("Model does not implement loss.")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def compute_loss(self):\n self.test_logits = self.compute_logits()\n loss = tf.nn.sparse_softmax_cross_entropy_with_logits(\n labels=self.data.test_labels, logits=self.test_logits)\n cross_entropy_loss = tf.reduce_mean(loss)\n regularization = tf.reduce_sum(\n tf.get_collection(tf.GraphKe...
[ "0.712148", "0.70395255", "0.7023037", "0.6964694", "0.6878926", "0.6830145", "0.6824834", "0.6801352", "0.6765133", "0.67370236", "0.67324895", "0.67233557", "0.67031574", "0.67031574", "0.6662697", "0.6619361", "0.6566079", "0.6541267", "0.6530644", "0.6516976", "0.6510028"...
0.7048177
1
Implementing this function makes the model usable for translation, eg. for use in SGNMT via the nizza predictor. This function must return a distribution log P(f_j|f_1^j_1, e_1^I) such that summing over all target words yields log P(f_1^J|e_1^J). For example, This often requires maginalizing over the alignments.
def predict_next_word(self, features, params, precomputed): raise NotImplementedError("Model does not implement word prediction.")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def compute_log_probs(self, phrases, save_to_file=None):\n # Co-ocurrence for source and target phrase\n tgt_src_cnt = defaultdict(lambda: defaultdict(int))\n \n # ocurrence for target (English)\n tgt_cnt = defaultdict(int)\n\n # Compute frequency and co-occurence\n ...
[ "0.6477803", "0.6240592", "0.61621064", "0.6086333", "0.6047775", "0.60093266", "0.5995965", "0.5995107", "0.5966389", "0.59642804", "0.59056777", "0.5902837", "0.58759403", "0.58725774", "0.5862674", "0.5825452", "0.58017606", "0.58002657", "0.5793231", "0.57751673", "0.5762...
0.0
-1
Mark a hyperparameter as having a simple monotonic increasing relationship with both CPU time and the goodness of the model.
def patience_param(x): # -- TODO: make this do something! return x
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mark(self) -> None:\n self.zero = self._monotonic_ms()", "def preformance(self, perf):\n self.perf = perf", "def __init__(self, time_constant: float, sampling_time: float):\n self.alpha = sampling_time / (time_constant + sampling_time)\n self.state = None", "def E_step_precompute(self...
[ "0.56833273", "0.5587425", "0.55274343", "0.55222327", "0.5340982", "0.52688646", "0.5254172", "0.5253672", "0.5252122", "0.5175494", "0.51732254", "0.51373166", "0.50936973", "0.5061794", "0.5060478", "0.50589293", "0.50571275", "0.5055805", "0.50344336", "0.5032078", "0.502...
0.48939082
43
Mark a hyperparameter as having a simple monotonic decreasing relationship with both CPU time and the goodness of the model.
def inv_patience_param(x): # -- TODO: make this do something! return x
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def preformance(self, perf):\n self.perf = perf", "def __init__(self, time_constant: float, sampling_time: float):\n self.alpha = sampling_time / (time_constant + sampling_time)\n self.state = None", "def E_step_precompute(self, model_params, my_suff_stat, my_data):", "def mark(self) -> None:\n ...
[ "0.5497046", "0.5494867", "0.5455038", "0.53865165", "0.5378648", "0.53281236", "0.532049", "0.5289464", "0.5282969", "0.5282969", "0.5274334", "0.52491134", "0.518313", "0.51513946", "0.5125276", "0.51124686", "0.50949377", "0.50924283", "0.5072421", "0.5062427", "0.5047174"...
0.0
-1
The combination of penalty='l1' and loss='hinge' is not supported penalty='l2' and loss='hinge' is only supported when dual='true' penalty='l1' is only supported when dual='false'.
def _svm_loss_penalty_dual(name): return hp.choice(name, [ ('hinge', 'l2', True), ('squared_hinge', 'l2', True), ('squared_hinge', 'l1', False), ('squared_hinge', 'l2', False) ])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def l2_training_penalty(batched_out: base.Output):\n if isinstance(batched_out, base.OutputWithPrior):\n return 0.5 * jnp.mean(jnp.square(batched_out.train))\n else:\n logging.warning('L2 weight penalty only works for OutputWithPrior.')\n return 0.", "def test_hinge_loss_backward():\n from your_cod...
[ "0.6574107", "0.58923316", "0.57923156", "0.57098234", "0.5634288", "0.56300277", "0.55809635", "0.5567596", "0.5531175", "0.55264515", "0.55053544", "0.5501286", "0.54875517", "0.54657626", "0.546015", "0.54392153", "0.5435707", "0.5426929", "0.54195803", "0.5418796", "0.538...
0.75576925
0
Return a pyll graph with hyperparamters that will construct a sklearn.svm.SVC model with a user specified kernel. See help(hpsklearn.components._svm_hp_space) for info on additional SVM arguments.
def svc_kernel(name, kernel, random_state=None, probability=False, **kwargs): def _name(msg): return '%s.%s_%s' % (name, kernel, msg) hp_space = _svm_hp_space(_name, kernel=kernel, **kwargs) hp_space.update(_svc_hp_space(_name, random_state, probability)) return scope.sklearn_SVC(**hp_space)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_svm_hyperparams():\n NUM_ITERS = 10\n # coefs = np.arange(-5, 5).astype(np.float)\n coefs = np.linspace(0.25, 1, 10)\n Cs = np.power(2, coefs)\n results = []\n\n for _ in range(NUM_ITERS):\n data = FaceDataset(\"embeddings/dev\", n=50)\n train_data, train_labels = data.trai...
[ "0.73476094", "0.70958614", "0.6964052", "0.67831784", "0.67662734", "0.66739416", "0.65586966", "0.64921445", "0.64792943", "0.63226485", "0.6296224", "0.62792623", "0.610844", "0.61017793", "0.61011374", "0.6083185", "0.6076828", "0.6073266", "0.6069783", "0.6007494", "0.59...
0.71698
1
Return a pyll graph with hyperparamters that will construct a sklearn.svm.SVR model with a user specified kernel.
def svr_kernel(name, kernel, epsilon=None, **kwargs): def _name(msg): return '%s.%s_%s' % (name, kernel, msg) hp_space = _svm_hp_space(_name, kernel=kernel, **kwargs) hp_space.update(_svr_hp_space(_name, epsilon)) return scope.sklearn_SVR(**hp_space)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def svm():", "def __init__(self, kernel='poly', degree=3, verbose=False, gamma='auto', reg=1/1000, random_state=0):\n print(\"Initialize model SVM\")\n # Check if gamma='auto' is useful\n self.kernel = kernel\n self.random_state = random_state\n self.model = SVC(gamma=gamma, ke...
[ "0.69277614", "0.6893122", "0.68732125", "0.6781692", "0.6691403", "0.6546042", "0.64860064", "0.6480777", "0.6352892", "0.632312", "0.6207076", "0.61844045", "0.6074828", "0.60648793", "0.60161895", "0.5979811", "0.5845912", "0.580389", "0.57575077", "0.5752655", "0.5745429"...
0.71148735
0
Generic preprocessing appropriate for a wide variety of data
def any_preprocessing(name): return hp.choice('%s' % name, [ [pca(name + '.pca')], [standard_scaler(name + '.standard_scaler')], [min_max_scaler(name + '.min_max_scaler')], [normalizer(name + '.normalizer')], # -- not putting in one-hot because it can make vectors huge ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def preprocess(data):\n raise NotImplementedError", "def preprocess(self, data, label):\n\t\traise NotImplementedError", "def preprocess(self):", "def preprocess(self,data):\n preprocessObj = PreprocessData()\n preprocess_data = preprocessObj.preprocess(data)\n return preprocess_data"...
[ "0.83073246", "0.7156899", "0.70585245", "0.6997039", "0.6968472", "0.6931928", "0.69065046", "0.6890153", "0.67705256", "0.67405057", "0.67354226", "0.67354226", "0.67354226", "0.66801184", "0.6675895", "0.6633443", "0.6612644", "0.6601693", "0.65921974", "0.6591618", "0.657...
0.5916439
66
Generic preprocessing appropriate for text data
def any_text_preprocessing(name): return hp.choice('%s' % name, [ [tfidf(name + '.tfidf')], ])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def preprocess(data):\n raise NotImplementedError", "def preprocess(self, text):\r\n return text", "def _preprocess(self):\n self.data['sentences'] = self.data['text'].apply(self._tokenize_sent)\n self.data['nouns'] = self.data['sentences'].apply(self._get_nouns)\n # self._get_fr...
[ "0.7779607", "0.7526521", "0.7176781", "0.7096829", "0.7073286", "0.6976883", "0.6929176", "0.6907419", "0.687628", "0.68656975", "0.67926234", "0.6746842", "0.6743114", "0.6733834", "0.6726861", "0.6723832", "0.67099166", "0.66652983", "0.6643692", "0.65456325", "0.65281934"...
0.6244845
44
Call an arbitrary management method on this entity
def call(self, operation, expect=error.OK, **arguments): request = self._node.request( operation=operation, type=self.type, identity=self.identity, **arguments) return self._node.call(request, expect=expect).body
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def run_manage(self, expanded, unexpanded) :\n\t\treturn self.manage_view_properties(expanded, unexpanded, \"/manage\", roles = \"Manager\")", "def management(self):\r\n return management.Management(self)", "def manage(ctx, user_cmd):\n ScalingoInterface(ctx.obj).manage_py(user_cmd)", "def __getatt...
[ "0.6228392", "0.61691713", "0.59387267", "0.55060166", "0.5382175", "0.5382175", "0.5302523", "0.5181179", "0.5172928", "0.51687676", "0.5075816", "0.5048617", "0.504479", "0.50290024", "0.50237244", "0.5021495", "0.5004086", "0.4995686", "0.49407494", "0.4918267", "0.4901621...
0.0
-1
Read the remote entity attributes into the local attributes.
def read(self): self.attributes = self.call('READ', expect=error.OK)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def read_attributes(self, dataset):\n if 'attributes' in self.configs:\n for key, value in self.configs['attributes'].items():\n setattr(dataset, key, value)", "def _read_local(self):\n\n self.attributions = np.genfromtxt(\n self.attributions_path, dtype=float, ...
[ "0.5523847", "0.55163735", "0.5404263", "0.53723055", "0.5261947", "0.52431804", "0.5242798", "0.5209427", "0.51474196", "0.5137612", "0.51318413", "0.50730455", "0.50500995", "0.5048805", "0.5024441", "0.49533403", "0.49302346", "0.49292526", "0.49168682", "0.49107", "0.4903...
0.5443011
2
Update the remote entity attributes from the local attributes.
def update(self): self.attributes = self.call('UPDATE', expect=error.OK, body=self.attributes)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update(self) -> None:\n self._api.update()\n if self.available:\n self._attr_native_value = self._api.data[self.entity_description.key]\n else:\n self._attr_native_value = None", "def _async_update_attrs(self) -> None:\n self._attr_is_on = self.entity_descrip...
[ "0.62692803", "0.58587396", "0.5731269", "0.5658316", "0.5653894", "0.5645511", "0.56131625", "0.5568307", "0.5567129", "0.55060637", "0.54385704", "0.54360443", "0.5434658", "0.5410549", "0.5394486", "0.5393542", "0.5386407", "0.5382385", "0.5378643", "0.5375315", "0.5351614...
0.6422116
0
Delete the remote entity
def delete(self): self.call('DELETE', expect=error.NO_CONTENT)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_otoroshi_controllers_adminapi_tcp_service_api_controller_delete_entity_action(self):\n pass", "def delete(self, obj):", "def delete(self):\n ...", "def remove(self):\n instance = self.get_object() \n instance.delete() \n return self.response(status='Successfully De...
[ "0.7196658", "0.70685035", "0.7056511", "0.7055168", "0.7014683", "0.69954413", "0.6993684", "0.6924908", "0.6901423", "0.6901423", "0.6901423", "0.6901423", "0.6825376", "0.681299", "0.681299", "0.6777683", "0.67732435", "0.67707646", "0.6770634", "0.6756004", "0.67313147", ...
0.6575764
36
Return a Node connected with the given parameters, see L{connection}
def connect(cls, url=None, router=None, timeout=10, ssl_domain=None, sasl=None, edge_router=None): url_ = Url(url) # Convert string to Url class. if url_.path is not None: path = url_.path elif router: path = '_topo/0/%s/$management' % router elif edge_r...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_node(conn, name):\n datacenter_id = get_datacenter_id()\n\n for item in conn.list_servers(datacenter_id)[\"items\"]:\n if item[\"properties\"][\"name\"] == name:\n node = {\"id\": item[\"id\"]}\n node.update(item[\"properties\"])\n return node", "def connect_...
[ "0.618464", "0.61416286", "0.6074083", "0.60132295", "0.6008891", "0.59954274", "0.5794639", "0.57695985", "0.5758491", "0.5756829", "0.5743585", "0.56941", "0.5691204", "0.56248885", "0.5612602", "0.5611256", "0.56028306", "0.5598274", "0.558752", "0.55844176", "0.5578297", ...
0.53575635
40
Create a management node proxy using the given connection.
def __init__(self, connection, path, locales=None): self.name = self.identity = 'self' self.type = 'org.amqp.management' # AMQP management node type self.locales = locales self.locales = locales self.url = Url(connection.url) self.url.path = path self.client = S...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def _create_proxy(self):\n self._proxy = await self._controller.fopen_tcp_proxy(\n Cellular._DRONE_WEB_API_PORT\n )\n\n self._drone_http_url = f\"http://{self._proxy.address}:{self._proxy.port}\"\n\n if self._autoconfigure and self._user_apc_token is None:\n ...
[ "0.6048795", "0.58742714", "0.5802584", "0.5657759", "0.5605936", "0.5493677", "0.54126096", "0.5399687", "0.5381373", "0.53703874", "0.53361976", "0.53073025", "0.52932906", "0.5273362", "0.5243213", "0.52396035", "0.5215712", "0.5199959", "0.51762295", "0.51659554", "0.5154...
0.5361504
10
Shut down the node
def close(self): if self.client: self.client.connection.close() self.client = None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def shutdown(self) -> None:", "def shutdown(self) -> None:", "def shutdown(self):", "def shutdown(self, *args):\n return _SALOMERuntime.PythonNode_shutdown(self, *args)", "def shutdown(self):\n ...", "def shutdown(self, *args):\n return _SALOMERuntime.SalomeNode_shutdown(self, *args)...
[ "0.75445867", "0.75445867", "0.7528702", "0.7525221", "0.74484587", "0.7446821", "0.7276193", "0.72565746", "0.72565746", "0.72565746", "0.7210875", "0.71629465", "0.71189094", "0.7095154", "0.70900863", "0.7088388", "0.7069015", "0.7035386", "0.6970288", "0.69025195", "0.689...
0.0
-1
Check a management response message for errors and correlation ID.
def check_response(response, expect=error.OK): code = response.properties.get('statusCode') if code != expect: if 200 <= code <= 299: raise ValueError("Response was %s(%s) but expected %s(%s): %s" % ( code, error.STATUS_TEXT[code], expect, error.STATUS_TEX...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_response_errors(self, resp):\n return True", "def validate_reply(request, reply):\n assert isinstance(reply, dict) and 'id' in reply\n assert ('result' in reply) != ('error' in reply)\n assert reply['id'] == request['id'] or \\\n reply['id'] == '00' and 'error...
[ "0.63983744", "0.6147145", "0.6012438", "0.5871563", "0.5813378", "0.5793791", "0.579217", "0.5788185", "0.5732082", "0.5707856", "0.5679702", "0.5675938", "0.5664866", "0.5634316", "0.5605626", "0.56005645", "0.5583741", "0.5568571", "0.55622566", "0.55569047", "0.55382013",...
0.61792576
1
Make a L{proton.Message} containining a management request.
def request(self, body=None, **properties): if self.locales: properties.setdefault('locales', self.locales) request = proton.Message() request.properties = clean_dict(properties) request.body = body or {} return request
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def construct_message(self):\n msg_type = self.msg_type\n if msg_type == \"PUBMSG\":\n msg_type = \"PRIVMSG\"\n ret = \"{} {}\".format(msg_type, self.target)\n if self.content:\n ret += \" :{}\".format(self.content)\n return ret + \"\\r\\n\"", "def makeAMQ...
[ "0.62443095", "0.5764357", "0.5720762", "0.5711052", "0.56360126", "0.5537137", "0.552277", "0.5499183", "0.5487821", "0.545782", "0.54448134", "0.5425465", "0.54167366", "0.54080194", "0.54045284", "0.5402524", "0.53995603", "0.5392736", "0.5373429", "0.53681254", "0.5349975...
0.5406406
14
Construct a request for the managment node itself
def node_request(self, body=None, **properties): return self.request(body, name=self.name, type=self.type, **properties)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def newRequest(self):\n return Request( )", "def newMCRequest(self, request):\n raise NotImplementedError", "def createRequest(self):\n self.get_bmc_website()\n self.__createChangeRequest = Create(self.browser)\n self.__createChangeRequest.createNCR()", "def req():\n ret...
[ "0.6537257", "0.6405457", "0.6351566", "0.6287773", "0.61076057", "0.6059556", "0.6055695", "0.6024805", "0.59167784", "0.5776078", "0.57564014", "0.57313454", "0.57100374", "0.56927186", "0.5671444", "0.5669032", "0.5644252", "0.5641237", "0.5638615", "0.5605619", "0.5604527...
0.58303213
9
Send a management request message, wait for a response.
def call(self, request, expect=error.OK): response = self.client.call(request) self.check_response(response, expect=expect) return response
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def _send_request(self, command, waitResponse=False):\n # Make sure we're connected.\n await self._perform_connect()\n \n while self._timeout > 0:\n self.logger.debug('waiting for previous command response')\n await asyncio.sleep(1)\n \n self.logger.de...
[ "0.6157053", "0.611986", "0.59369206", "0.5933973", "0.5905822", "0.5852787", "0.58384734", "0.5809734", "0.5773247", "0.5763428", "0.5689041", "0.5659244", "0.5653349", "0.5627476", "0.559565", "0.5584633", "0.5567643", "0.55364376", "0.55341464", "0.55341464", "0.55341464",...
0.0
-1
Return an iterator that yields a dictionary for each result.
def iter_dicts(self, clean=False): for r in self.results: if clean: yield clean_dict(zip(self.attribute_names, r)) else: yield dict(zip(self.attribute_names, r))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def iter_dict(self):\n\n itr = iter(self)\n\n headers = next(itr)\n\n for row in itr:\n yield dict(zip(headers, row))", "def __iter__(self) -> iter:\n return iter(self._dict)", "def __iter__(self):\n for key, value in self.read():\n yield key, value", "def proce...
[ "0.70707095", "0.6937773", "0.69119906", "0.685489", "0.67938584", "0.67819273", "0.66642076", "0.66412884", "0.6634738", "0.65794516", "0.65755105", "0.6557807", "0.6552341", "0.6529979", "0.65247136", "0.65218616", "0.64761126", "0.64640063", "0.641072", "0.63832486", "0.63...
0.6707882
6