body_hash stringlengths 64 64 | body stringlengths 23 109k | docstring stringlengths 1 57k | path stringlengths 4 198 | name stringlengths 1 115 | repository_name stringlengths 7 111 | repository_stars float64 0 191k | lang stringclasses 1
value | body_without_docstring stringlengths 14 108k | unified stringlengths 45 133k |
|---|---|---|---|---|---|---|---|---|---|
148da82e30401d00dfbec24c1a53b548c1f1c91c99cfd9e099ee1c0eb87d6100 | def test_loading_settings_onto_instrument(self):
'\n Tests storing and reading of parameters.\n Tests for different types of parameters including\n - array\n - float\n - int\n - dict\n - bool\n '
arr = np.linspace(12, 42, 11)
self.mock_parabola.array_l... | Tests storing and reading of parameters.
Tests for different types of parameters including
- array
- float
- int
- dict
- bool | pycqed/tests/test_hdf5_datasaving_loading.py | test_loading_settings_onto_instrument | nuttamas/PycQED_py3 | 60 | python | def test_loading_settings_onto_instrument(self):
'\n Tests storing and reading of parameters.\n Tests for different types of parameters including\n - array\n - float\n - int\n - dict\n - bool\n '
arr = np.linspace(12, 42, 11)
self.mock_parabola.array_l... | def test_loading_settings_onto_instrument(self):
'\n Tests storing and reading of parameters.\n Tests for different types of parameters including\n - array\n - float\n - int\n - dict\n - bool\n '
arr = np.linspace(12, 42, 11)
self.mock_parabola.array_l... |
73a81367dd9e5a88045ef947c3b9231a99783f5eed7f1ba879db778df6dc8e88 | def setUp(self):
'Sets up the needed objects used throughout the test.'
self._resolver_context = context.Context()
test_file = self._GetTestFilePath(['syslog.rc4'])
self._SkipIfPathNotExists(test_file)
path_spec = os_path_spec.OSPathSpec(location=test_file)
self._encrypted_stream_path_spec = enc... | Sets up the needed objects used throughout the test. | tests/vfs/encrypted_stream_file_system.py | setUp | Acidburn0zzz/dfvfs | 1 | python | def setUp(self):
self._resolver_context = context.Context()
test_file = self._GetTestFilePath(['syslog.rc4'])
self._SkipIfPathNotExists(test_file)
path_spec = os_path_spec.OSPathSpec(location=test_file)
self._encrypted_stream_path_spec = encrypted_stream_path_spec.EncryptedStreamPathSpec(encryp... | def setUp(self):
self._resolver_context = context.Context()
test_file = self._GetTestFilePath(['syslog.rc4'])
self._SkipIfPathNotExists(test_file)
path_spec = os_path_spec.OSPathSpec(location=test_file)
self._encrypted_stream_path_spec = encrypted_stream_path_spec.EncryptedStreamPathSpec(encryp... |
e25a5060d1400f78356cbc8b45a763dc0c04266e543839aa6c585b36ee900a81 | def testOpenAndClose(self):
'Test the open and close functionality.'
file_system = encrypted_stream_file_system.EncryptedStreamFileSystem(self._resolver_context)
self.assertIsNotNone(file_system)
file_system.Open(self._encrypted_stream_path_spec)
file_system.Close() | Test the open and close functionality. | tests/vfs/encrypted_stream_file_system.py | testOpenAndClose | Acidburn0zzz/dfvfs | 1 | python | def testOpenAndClose(self):
file_system = encrypted_stream_file_system.EncryptedStreamFileSystem(self._resolver_context)
self.assertIsNotNone(file_system)
file_system.Open(self._encrypted_stream_path_spec)
file_system.Close() | def testOpenAndClose(self):
file_system = encrypted_stream_file_system.EncryptedStreamFileSystem(self._resolver_context)
self.assertIsNotNone(file_system)
file_system.Open(self._encrypted_stream_path_spec)
file_system.Close()<|docstring|>Test the open and close functionality.<|endoftext|> |
4560a2544a99e8e1e1387a1beb755e29240474922d47d711ff76ce5ce47dc146 | def testFileEntryExistsByPathSpec(self):
'Test the file entry exists by path specification functionality.'
file_system = encrypted_stream_file_system.EncryptedStreamFileSystem(self._resolver_context)
self.assertIsNotNone(file_system)
file_system.Open(self._encrypted_stream_path_spec)
self.assertTrue... | Test the file entry exists by path specification functionality. | tests/vfs/encrypted_stream_file_system.py | testFileEntryExistsByPathSpec | Acidburn0zzz/dfvfs | 1 | python | def testFileEntryExistsByPathSpec(self):
file_system = encrypted_stream_file_system.EncryptedStreamFileSystem(self._resolver_context)
self.assertIsNotNone(file_system)
file_system.Open(self._encrypted_stream_path_spec)
self.assertTrue(file_system.FileEntryExistsByPathSpec(self._encrypted_stream_pat... | def testFileEntryExistsByPathSpec(self):
file_system = encrypted_stream_file_system.EncryptedStreamFileSystem(self._resolver_context)
self.assertIsNotNone(file_system)
file_system.Open(self._encrypted_stream_path_spec)
self.assertTrue(file_system.FileEntryExistsByPathSpec(self._encrypted_stream_pat... |
441a0a84c3bff9cda99d952aeb8624b47d1c6a02fc2f6c60bbbab95e4f591590 | def testGetFileEntryByPathSpec(self):
'Tests the GetFileEntryByPathSpec function.'
file_system = encrypted_stream_file_system.EncryptedStreamFileSystem(self._resolver_context)
self.assertIsNotNone(file_system)
file_system.Open(self._encrypted_stream_path_spec)
file_entry = file_system.GetFileEntryBy... | Tests the GetFileEntryByPathSpec function. | tests/vfs/encrypted_stream_file_system.py | testGetFileEntryByPathSpec | Acidburn0zzz/dfvfs | 1 | python | def testGetFileEntryByPathSpec(self):
file_system = encrypted_stream_file_system.EncryptedStreamFileSystem(self._resolver_context)
self.assertIsNotNone(file_system)
file_system.Open(self._encrypted_stream_path_spec)
file_entry = file_system.GetFileEntryByPathSpec(self._encrypted_stream_path_spec)
... | def testGetFileEntryByPathSpec(self):
file_system = encrypted_stream_file_system.EncryptedStreamFileSystem(self._resolver_context)
self.assertIsNotNone(file_system)
file_system.Open(self._encrypted_stream_path_spec)
file_entry = file_system.GetFileEntryByPathSpec(self._encrypted_stream_path_spec)
... |
50d59fb99f8a5d018e497b0a1e32859639562c89bd2cbd522a837c14ba5d3e4c | def testGetRootFileEntry(self):
'Test the get root file entry functionality.'
file_system = encrypted_stream_file_system.EncryptedStreamFileSystem(self._resolver_context)
self.assertIsNotNone(file_system)
file_system.Open(self._encrypted_stream_path_spec)
file_entry = file_system.GetRootFileEntry()
... | Test the get root file entry functionality. | tests/vfs/encrypted_stream_file_system.py | testGetRootFileEntry | Acidburn0zzz/dfvfs | 1 | python | def testGetRootFileEntry(self):
file_system = encrypted_stream_file_system.EncryptedStreamFileSystem(self._resolver_context)
self.assertIsNotNone(file_system)
file_system.Open(self._encrypted_stream_path_spec)
file_entry = file_system.GetRootFileEntry()
self.assertIsNotNone(file_entry)
self... | def testGetRootFileEntry(self):
file_system = encrypted_stream_file_system.EncryptedStreamFileSystem(self._resolver_context)
self.assertIsNotNone(file_system)
file_system.Open(self._encrypted_stream_path_spec)
file_entry = file_system.GetRootFileEntry()
self.assertIsNotNone(file_entry)
self... |
7aedc32b522a89b1a95847871ea5e6310615d394da3f047438350b50358d2c5f | def g_r(wr, Y, weights, q, lambda_h, lambda_J, r):
'optimized version of g_r_slow'
(B, N) = Y.shape
h_r = wr[:q]
J_r = np.reshape(wr[q:], (q, q, (N - 1)))
indices = np.concatenate([np.arange(r), np.arange((r + 1), N)])
fval = 0
for i in range(B):
seq = Y[(i, indices)]
logPot ... | optimized version of g_r_slow | scripts/plmDCA.py | g_r | bhedelius/Python-plmDCA | 0 | python | def g_r(wr, Y, weights, q, lambda_h, lambda_J, r):
(B, N) = Y.shape
h_r = wr[:q]
J_r = np.reshape(wr[q:], (q, q, (N - 1)))
indices = np.concatenate([np.arange(r), np.arange((r + 1), N)])
fval = 0
for i in range(B):
seq = Y[(i, indices)]
logPot = (h_r + np.sum(J_r[(:, seq, np... | def g_r(wr, Y, weights, q, lambda_h, lambda_J, r):
(B, N) = Y.shape
h_r = wr[:q]
J_r = np.reshape(wr[q:], (q, q, (N - 1)))
indices = np.concatenate([np.arange(r), np.arange((r + 1), N)])
fval = 0
for i in range(B):
seq = Y[(i, indices)]
logPot = (h_r + np.sum(J_r[(:, seq, np... |
05d94dc7e590bc78608ec3e2ecc47ddf29d03814a5ebfed09f23a55493986fa1 | def g_r_grad(wr, Y, weights, q, lambda_h, lambda_J, r):
'optimized version of the gradient of g_r_slow'
(B, N) = Y.shape
h_r = wr[:q]
J_r = np.reshape(wr[q:], (q, q, (N - 1)))
indices = np.concatenate([np.arange(r), np.arange((r + 1), N)])
grad1 = np.zeros(q)
grad2 = np.zeros((q, q, (N - 1))... | optimized version of the gradient of g_r_slow | scripts/plmDCA.py | g_r_grad | bhedelius/Python-plmDCA | 0 | python | def g_r_grad(wr, Y, weights, q, lambda_h, lambda_J, r):
(B, N) = Y.shape
h_r = wr[:q]
J_r = np.reshape(wr[q:], (q, q, (N - 1)))
indices = np.concatenate([np.arange(r), np.arange((r + 1), N)])
grad1 = np.zeros(q)
grad2 = np.zeros((q, q, (N - 1)))
for i in range(B):
seq = Y[(i, in... | def g_r_grad(wr, Y, weights, q, lambda_h, lambda_J, r):
(B, N) = Y.shape
h_r = wr[:q]
J_r = np.reshape(wr[q:], (q, q, (N - 1)))
indices = np.concatenate([np.arange(r), np.arange((r + 1), N)])
grad1 = np.zeros(q)
grad2 = np.zeros((q, q, (N - 1)))
for i in range(B):
seq = Y[(i, in... |
64f035ae1b12aef8d37e644b781ecd49958cdeddc817b2f6b78eea933d84a930 | def delete_student_section_attendance_event_by_id(self, id, **kwargs):
"Deletes an existing resource using the resource identifier. # noqa: E501\n\n The DELETE operation is used to delete an existing resource by identifier. If the resource doesn't exist, an error will result (the resource will not be found)... | Deletes an existing resource using the resource identifier. # noqa: E501
The DELETE operation is used to delete an existing resource by identifier. If the resource doesn't exist, an error will result (the resource will not be found). # noqa: E501
This method makes a synchronous HTTP request by default. To make an
as... | src/v5.1/resources/swagger_client/api/student_section_attendance_events_api.py | delete_student_section_attendance_event_by_id | xmarcosx/edfi-notebook | 2 | python | def delete_student_section_attendance_event_by_id(self, id, **kwargs):
"Deletes an existing resource using the resource identifier. # noqa: E501\n\n The DELETE operation is used to delete an existing resource by identifier. If the resource doesn't exist, an error will result (the resource will not be found)... | def delete_student_section_attendance_event_by_id(self, id, **kwargs):
"Deletes an existing resource using the resource identifier. # noqa: E501\n\n The DELETE operation is used to delete an existing resource by identifier. If the resource doesn't exist, an error will result (the resource will not be found)... |
67b46b6bc1ef47d14f72a6a0d19b4179171c182196ec7d4041e6aacd514b9b4b | def delete_student_section_attendance_event_by_id_with_http_info(self, id, **kwargs):
"Deletes an existing resource using the resource identifier. # noqa: E501\n\n The DELETE operation is used to delete an existing resource by identifier. If the resource doesn't exist, an error will result (the resource wil... | Deletes an existing resource using the resource identifier. # noqa: E501
The DELETE operation is used to delete an existing resource by identifier. If the resource doesn't exist, an error will result (the resource will not be found). # noqa: E501
This method makes a synchronous HTTP request by default. To make an
as... | src/v5.1/resources/swagger_client/api/student_section_attendance_events_api.py | delete_student_section_attendance_event_by_id_with_http_info | xmarcosx/edfi-notebook | 2 | python | def delete_student_section_attendance_event_by_id_with_http_info(self, id, **kwargs):
"Deletes an existing resource using the resource identifier. # noqa: E501\n\n The DELETE operation is used to delete an existing resource by identifier. If the resource doesn't exist, an error will result (the resource wil... | def delete_student_section_attendance_event_by_id_with_http_info(self, id, **kwargs):
"Deletes an existing resource using the resource identifier. # noqa: E501\n\n The DELETE operation is used to delete an existing resource by identifier. If the resource doesn't exist, an error will result (the resource wil... |
3a792616ea3bcd0c3cd5db6b87556573d930b972e8ab6fd0225e4f2e1804b0f1 | def deletes_student_section_attendance_events(self, **kwargs):
'Retrieves deleted resources based on change version. # noqa: E501\n\n The DELETES operation is used to retrieve deleted resources. # noqa: E501\n This method makes a synchronous HTTP request by default. To make an\n asynchronous ... | Retrieves deleted resources based on change version. # noqa: E501
The DELETES operation is used to retrieve deleted resources. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.deletes_student_section_attendance_eve... | src/v5.1/resources/swagger_client/api/student_section_attendance_events_api.py | deletes_student_section_attendance_events | xmarcosx/edfi-notebook | 2 | python | def deletes_student_section_attendance_events(self, **kwargs):
'Retrieves deleted resources based on change version. # noqa: E501\n\n The DELETES operation is used to retrieve deleted resources. # noqa: E501\n This method makes a synchronous HTTP request by default. To make an\n asynchronous ... | def deletes_student_section_attendance_events(self, **kwargs):
'Retrieves deleted resources based on change version. # noqa: E501\n\n The DELETES operation is used to retrieve deleted resources. # noqa: E501\n This method makes a synchronous HTTP request by default. To make an\n asynchronous ... |
70be9e917856aee922c901e17c77a8d63f03256ec394bb44fb74e39d1744966b | def deletes_student_section_attendance_events_with_http_info(self, **kwargs):
'Retrieves deleted resources based on change version. # noqa: E501\n\n The DELETES operation is used to retrieve deleted resources. # noqa: E501\n This method makes a synchronous HTTP request by default. To make an\n ... | Retrieves deleted resources based on change version. # noqa: E501
The DELETES operation is used to retrieve deleted resources. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.deletes_student_section_attendance_eve... | src/v5.1/resources/swagger_client/api/student_section_attendance_events_api.py | deletes_student_section_attendance_events_with_http_info | xmarcosx/edfi-notebook | 2 | python | def deletes_student_section_attendance_events_with_http_info(self, **kwargs):
'Retrieves deleted resources based on change version. # noqa: E501\n\n The DELETES operation is used to retrieve deleted resources. # noqa: E501\n This method makes a synchronous HTTP request by default. To make an\n ... | def deletes_student_section_attendance_events_with_http_info(self, **kwargs):
'Retrieves deleted resources based on change version. # noqa: E501\n\n The DELETES operation is used to retrieve deleted resources. # noqa: E501\n This method makes a synchronous HTTP request by default. To make an\n ... |
4d84e1aea01d7ff2227e7b2f14fc9a84d5821c7309b613bf08be9596e483d9e1 | def get_student_section_attendance_events(self, **kwargs):
'Retrieves specific resources using the resource\'s property values (using the "Get" pattern). # noqa: E501\n\n This GET operation provides access to resources using the "Get" search pattern. The values of any properties of the resource that are sp... | Retrieves specific resources using the resource's property values (using the "Get" pattern). # noqa: E501
This GET operation provides access to resources using the "Get" search pattern. The values of any properties of the resource that are specified will be used to return all matching results (if it exists). # noqa... | src/v5.1/resources/swagger_client/api/student_section_attendance_events_api.py | get_student_section_attendance_events | xmarcosx/edfi-notebook | 2 | python | def get_student_section_attendance_events(self, **kwargs):
'Retrieves specific resources using the resource\'s property values (using the "Get" pattern). # noqa: E501\n\n This GET operation provides access to resources using the "Get" search pattern. The values of any properties of the resource that are sp... | def get_student_section_attendance_events(self, **kwargs):
'Retrieves specific resources using the resource\'s property values (using the "Get" pattern). # noqa: E501\n\n This GET operation provides access to resources using the "Get" search pattern. The values of any properties of the resource that are sp... |
bfe138139dcc1a72f653fafd8fb4d2d1d0829c96a3180bdb434eaaac08ad6c97 | def get_student_section_attendance_events_with_http_info(self, **kwargs):
'Retrieves specific resources using the resource\'s property values (using the "Get" pattern). # noqa: E501\n\n This GET operation provides access to resources using the "Get" search pattern. The values of any properties of the resou... | Retrieves specific resources using the resource's property values (using the "Get" pattern). # noqa: E501
This GET operation provides access to resources using the "Get" search pattern. The values of any properties of the resource that are specified will be used to return all matching results (if it exists). # noqa... | src/v5.1/resources/swagger_client/api/student_section_attendance_events_api.py | get_student_section_attendance_events_with_http_info | xmarcosx/edfi-notebook | 2 | python | def get_student_section_attendance_events_with_http_info(self, **kwargs):
'Retrieves specific resources using the resource\'s property values (using the "Get" pattern). # noqa: E501\n\n This GET operation provides access to resources using the "Get" search pattern. The values of any properties of the resou... | def get_student_section_attendance_events_with_http_info(self, **kwargs):
'Retrieves specific resources using the resource\'s property values (using the "Get" pattern). # noqa: E501\n\n This GET operation provides access to resources using the "Get" search pattern. The values of any properties of the resou... |
5c4151f115e348fb73746048ce6ccf50a2b6d03a03a87be8528fffa33aa4071a | def get_student_section_attendance_events_by_id(self, id, **kwargs):
'Retrieves a specific resource using the resource\'s identifier (using the "Get By Id" pattern). # noqa: E501\n\n This GET operation retrieves a resource by the specified resource identifier. # noqa: E501\n This method makes a sync... | Retrieves a specific resource using the resource's identifier (using the "Get By Id" pattern). # noqa: E501
This GET operation retrieves a resource by the specified resource identifier. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=T... | src/v5.1/resources/swagger_client/api/student_section_attendance_events_api.py | get_student_section_attendance_events_by_id | xmarcosx/edfi-notebook | 2 | python | def get_student_section_attendance_events_by_id(self, id, **kwargs):
'Retrieves a specific resource using the resource\'s identifier (using the "Get By Id" pattern). # noqa: E501\n\n This GET operation retrieves a resource by the specified resource identifier. # noqa: E501\n This method makes a sync... | def get_student_section_attendance_events_by_id(self, id, **kwargs):
'Retrieves a specific resource using the resource\'s identifier (using the "Get By Id" pattern). # noqa: E501\n\n This GET operation retrieves a resource by the specified resource identifier. # noqa: E501\n This method makes a sync... |
8a19490a8f65abf826def673d71aa1736b4bd4f3b8d02326d8a6ddef34646bac | def get_student_section_attendance_events_by_id_with_http_info(self, id, **kwargs):
'Retrieves a specific resource using the resource\'s identifier (using the "Get By Id" pattern). # noqa: E501\n\n This GET operation retrieves a resource by the specified resource identifier. # noqa: E501\n This meth... | Retrieves a specific resource using the resource's identifier (using the "Get By Id" pattern). # noqa: E501
This GET operation retrieves a resource by the specified resource identifier. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=T... | src/v5.1/resources/swagger_client/api/student_section_attendance_events_api.py | get_student_section_attendance_events_by_id_with_http_info | xmarcosx/edfi-notebook | 2 | python | def get_student_section_attendance_events_by_id_with_http_info(self, id, **kwargs):
'Retrieves a specific resource using the resource\'s identifier (using the "Get By Id" pattern). # noqa: E501\n\n This GET operation retrieves a resource by the specified resource identifier. # noqa: E501\n This meth... | def get_student_section_attendance_events_by_id_with_http_info(self, id, **kwargs):
'Retrieves a specific resource using the resource\'s identifier (using the "Get By Id" pattern). # noqa: E501\n\n This GET operation retrieves a resource by the specified resource identifier. # noqa: E501\n This meth... |
7277f731cfa923af9286d164165e22831821c3be704b135a47e62b6a0217ae8f | def post_student_section_attendance_event(self, student_section_attendance_event, **kwargs):
'Creates or updates resources based on the natural key values of the supplied resource. # noqa: E501\n\n The POST operation can be used to create or update resources. In database terms, this is often referred to as ... | Creates or updates resources based on the natural key values of the supplied resource. # noqa: E501
The POST operation can be used to create or update resources. In database terms, this is often referred to as an "upsert" operation (insert + update). Clients should NOT include the resource "id" in the JSON body becau... | src/v5.1/resources/swagger_client/api/student_section_attendance_events_api.py | post_student_section_attendance_event | xmarcosx/edfi-notebook | 2 | python | def post_student_section_attendance_event(self, student_section_attendance_event, **kwargs):
'Creates or updates resources based on the natural key values of the supplied resource. # noqa: E501\n\n The POST operation can be used to create or update resources. In database terms, this is often referred to as ... | def post_student_section_attendance_event(self, student_section_attendance_event, **kwargs):
'Creates or updates resources based on the natural key values of the supplied resource. # noqa: E501\n\n The POST operation can be used to create or update resources. In database terms, this is often referred to as ... |
747ae93e498d5fe94abaf6671b28931bc397785e7aeadc9100d2f927620ce267 | def post_student_section_attendance_event_with_http_info(self, student_section_attendance_event, **kwargs):
'Creates or updates resources based on the natural key values of the supplied resource. # noqa: E501\n\n The POST operation can be used to create or update resources. In database terms, this is often ... | Creates or updates resources based on the natural key values of the supplied resource. # noqa: E501
The POST operation can be used to create or update resources. In database terms, this is often referred to as an "upsert" operation (insert + update). Clients should NOT include the resource "id" in the JSON body becau... | src/v5.1/resources/swagger_client/api/student_section_attendance_events_api.py | post_student_section_attendance_event_with_http_info | xmarcosx/edfi-notebook | 2 | python | def post_student_section_attendance_event_with_http_info(self, student_section_attendance_event, **kwargs):
'Creates or updates resources based on the natural key values of the supplied resource. # noqa: E501\n\n The POST operation can be used to create or update resources. In database terms, this is often ... | def post_student_section_attendance_event_with_http_info(self, student_section_attendance_event, **kwargs):
'Creates or updates resources based on the natural key values of the supplied resource. # noqa: E501\n\n The POST operation can be used to create or update resources. In database terms, this is often ... |
366a11888ffa6220ae6e2fb6233a94cfbf3f10ab9092a2f60e808641f8cc66ed | def put_student_section_attendance_event(self, id, student_section_attendance_event, **kwargs):
'Updates or creates a resource based on the resource identifier. # noqa: E501\n\n The PUT operation is used to update or create a resource by identifier. If the resource doesn\'t exist, the resource will be creat... | Updates or creates a resource based on the resource identifier. # noqa: E501
The PUT operation is used to update or create a resource by identifier. If the resource doesn't exist, the resource will be created using that identifier. Additionally, natural key values cannot be changed using this operation, and will not ... | src/v5.1/resources/swagger_client/api/student_section_attendance_events_api.py | put_student_section_attendance_event | xmarcosx/edfi-notebook | 2 | python | def put_student_section_attendance_event(self, id, student_section_attendance_event, **kwargs):
'Updates or creates a resource based on the resource identifier. # noqa: E501\n\n The PUT operation is used to update or create a resource by identifier. If the resource doesn\'t exist, the resource will be creat... | def put_student_section_attendance_event(self, id, student_section_attendance_event, **kwargs):
'Updates or creates a resource based on the resource identifier. # noqa: E501\n\n The PUT operation is used to update or create a resource by identifier. If the resource doesn\'t exist, the resource will be creat... |
c4766ae0e0dd9e1c099fd956b6349ed4d3ddf07cd5c16de8f64699f2efbc6b39 | def put_student_section_attendance_event_with_http_info(self, id, student_section_attendance_event, **kwargs):
'Updates or creates a resource based on the resource identifier. # noqa: E501\n\n The PUT operation is used to update or create a resource by identifier. If the resource doesn\'t exist, the resourc... | Updates or creates a resource based on the resource identifier. # noqa: E501
The PUT operation is used to update or create a resource by identifier. If the resource doesn't exist, the resource will be created using that identifier. Additionally, natural key values cannot be changed using this operation, and will not ... | src/v5.1/resources/swagger_client/api/student_section_attendance_events_api.py | put_student_section_attendance_event_with_http_info | xmarcosx/edfi-notebook | 2 | python | def put_student_section_attendance_event_with_http_info(self, id, student_section_attendance_event, **kwargs):
'Updates or creates a resource based on the resource identifier. # noqa: E501\n\n The PUT operation is used to update or create a resource by identifier. If the resource doesn\'t exist, the resourc... | def put_student_section_attendance_event_with_http_info(self, id, student_section_attendance_event, **kwargs):
'Updates or creates a resource based on the resource identifier. # noqa: E501\n\n The PUT operation is used to update or create a resource by identifier. If the resource doesn\'t exist, the resourc... |
9d098a2e73e21161f2b9bb63fa884e6c4f8f98cff9f0eab27932085b16b46c5f | @property
def blueprint(self) -> Blueprint:
'Return blueprint that this entity represents'
return TorsionStiffnessItemBlueprint() | Return blueprint that this entity represents | src/sima/riflex/torsionstiffnessitem.py | blueprint | SINTEF/simapy | 0 | python | @property
def blueprint(self) -> Blueprint:
return TorsionStiffnessItemBlueprint() | @property
def blueprint(self) -> Blueprint:
return TorsionStiffnessItemBlueprint()<|docstring|>Return blueprint that this entity represents<|endoftext|> |
5e5149e585a844ec44a1f1b5771ba391b0e59935253d06f2742e72d9a772344a | @name.setter
def name(self, value: str):
'Set name'
self.__name = str(value) | Set name | src/sima/riflex/torsionstiffnessitem.py | name | SINTEF/simapy | 0 | python | @name.setter
def name(self, value: str):
self.__name = str(value) | @name.setter
def name(self, value: str):
self.__name = str(value)<|docstring|>Set name<|endoftext|> |
a9610f8f0ea0f2d82a99114070999eaa47d1c3f8adaedd20569b377fa63a8527 | @description.setter
def description(self, value: str):
'Set description'
self.__description = str(value) | Set description | src/sima/riflex/torsionstiffnessitem.py | description | SINTEF/simapy | 0 | python | @description.setter
def description(self, value: str):
self.__description = str(value) | @description.setter
def description(self, value: str):
self.__description = str(value)<|docstring|>Set description<|endoftext|> |
04883e50e332e89ed063cc3ea9e9aa0051221a57d8a6d5d8ed3d15e1a386e480 | @_id.setter
def _id(self, value: str):
'Set _id'
self.___id = str(value) | Set _id | src/sima/riflex/torsionstiffnessitem.py | _id | SINTEF/simapy | 0 | python | @_id.setter
def _id(self, value: str):
self.___id = str(value) | @_id.setter
def _id(self, value: str):
self.___id = str(value)<|docstring|>Set _id<|endoftext|> |
4b20dcfbfd371cd3587389a3c3386e7420fb909dae4b3692a5880e8da15d9f65 | @scriptableValues.setter
def scriptableValues(self, value: List[ScriptableValue]):
'Set scriptableValues'
if (not isinstance(value, Sequence)):
raise Exception('Expected sequense, but was ', type(value))
self.__scriptableValues = value | Set scriptableValues | src/sima/riflex/torsionstiffnessitem.py | scriptableValues | SINTEF/simapy | 0 | python | @scriptableValues.setter
def scriptableValues(self, value: List[ScriptableValue]):
if (not isinstance(value, Sequence)):
raise Exception('Expected sequense, but was ', type(value))
self.__scriptableValues = value | @scriptableValues.setter
def scriptableValues(self, value: List[ScriptableValue]):
if (not isinstance(value, Sequence)):
raise Exception('Expected sequense, but was ', type(value))
self.__scriptableValues = value<|docstring|>Set scriptableValues<|endoftext|> |
afb5848e434213b0aff551e9fd107a516a634728ab4b4a50a5864d801364c389 | @property
def torsionMoment(self) -> float:
'Torsion moment'
return self.__torsionMoment | Torsion moment | src/sima/riflex/torsionstiffnessitem.py | torsionMoment | SINTEF/simapy | 0 | python | @property
def torsionMoment(self) -> float:
return self.__torsionMoment | @property
def torsionMoment(self) -> float:
return self.__torsionMoment<|docstring|>Torsion moment<|endoftext|> |
12981d7451bfd0af2d001b6b40a9aa74db9f2275ecc535bfa57593e1b2634868 | @torsionMoment.setter
def torsionMoment(self, value: float):
'Set torsionMoment'
self.__torsionMoment = float(value) | Set torsionMoment | src/sima/riflex/torsionstiffnessitem.py | torsionMoment | SINTEF/simapy | 0 | python | @torsionMoment.setter
def torsionMoment(self, value: float):
self.__torsionMoment = float(value) | @torsionMoment.setter
def torsionMoment(self, value: float):
self.__torsionMoment = float(value)<|docstring|>Set torsionMoment<|endoftext|> |
f8775a0d97e2de42657d64ca90aa657af7dc9be5645d09d12a3716db5f109990 | @property
def torsionAngle(self) -> float:
'Torsion angle/length'
return self.__torsionAngle | Torsion angle/length | src/sima/riflex/torsionstiffnessitem.py | torsionAngle | SINTEF/simapy | 0 | python | @property
def torsionAngle(self) -> float:
return self.__torsionAngle | @property
def torsionAngle(self) -> float:
return self.__torsionAngle<|docstring|>Torsion angle/length<|endoftext|> |
3805b419c77a349dda2331982754d382f61b137d90cd7417e126c062ece422c6 | @torsionAngle.setter
def torsionAngle(self, value: float):
'Set torsionAngle'
self.__torsionAngle = float(value) | Set torsionAngle | src/sima/riflex/torsionstiffnessitem.py | torsionAngle | SINTEF/simapy | 0 | python | @torsionAngle.setter
def torsionAngle(self, value: float):
self.__torsionAngle = float(value) | @torsionAngle.setter
def torsionAngle(self, value: float):
self.__torsionAngle = float(value)<|docstring|>Set torsionAngle<|endoftext|> |
1e75a2ff79158be66310e32a9c08b9d44b4f12cc9f702a7eb14cc8f92567c242 | def make_encoder(opt, embeddings, intent_size, output_size, use_history=False, hidden_depth=1, identity=None, hidden_size=None):
'\n Various encoder dispatcher function.\n Args:\n opt: the option in current environment.\n embeddings (Embeddings): vocab embeddings for this encoder.\n '
dia... | Various encoder dispatcher function.
Args:
opt: the option in current environment.
embeddings (Embeddings): vocab embeddings for this encoder. | craigslistbargain/neural/dsac_model_builder.py | make_encoder | ijcai2022-5500/alpha_nego | 0 | python | def make_encoder(opt, embeddings, intent_size, output_size, use_history=False, hidden_depth=1, identity=None, hidden_size=None):
'\n Various encoder dispatcher function.\n Args:\n opt: the option in current environment.\n embeddings (Embeddings): vocab embeddings for this encoder.\n '
dia... | def make_encoder(opt, embeddings, intent_size, output_size, use_history=False, hidden_depth=1, identity=None, hidden_size=None):
'\n Various encoder dispatcher function.\n Args:\n opt: the option in current environment.\n embeddings (Embeddings): vocab embeddings for this encoder.\n '
dia... |
73dd53eff536be79838401e9f35ea647e3ae0c17df16df01ab3e6b8de791b27c | def make_decoder(input_size, intent_size, price_size, hidden_size, is_actor=True, hidden_depth=2, num_quantiles=32):
'\n Various decoder dispatcher function.\n Args:\n opt: the option in current environment.\n embeddings (Embeddings): vocab embeddings for this decoder.\n '
if is_actor:
... | Various decoder dispatcher function.
Args:
opt: the option in current environment.
embeddings (Embeddings): vocab embeddings for this decoder. | craigslistbargain/neural/dsac_model_builder.py | make_decoder | ijcai2022-5500/alpha_nego | 0 | python | def make_decoder(input_size, intent_size, price_size, hidden_size, is_actor=True, hidden_depth=2, num_quantiles=32):
'\n Various decoder dispatcher function.\n Args:\n opt: the option in current environment.\n embeddings (Embeddings): vocab embeddings for this decoder.\n '
if is_actor:
... | def make_decoder(input_size, intent_size, price_size, hidden_size, is_actor=True, hidden_depth=2, num_quantiles=32):
'\n Various decoder dispatcher function.\n Args:\n opt: the option in current environment.\n embeddings (Embeddings): vocab embeddings for this decoder.\n '
if is_actor:
... |
bdbd288d5dcb14292822c8bebea04de77104d2abaeded96db7275f3f641763c9 | def record_time_interval(section, start_time, line_break=False):
'Record a time interval since the last timestamp'
end_time = time.time()
delta = (end_time - start_time)
if (delta < 1):
delta *= 1000
units = 'ms'
else:
units = 's'
if line_break:
logger.info('PROCE... | Record a time interval since the last timestamp | src/utils.py | record_time_interval | acwooding/dimension_reduction | 4 | python | def record_time_interval(section, start_time, line_break=False):
end_time = time.time()
delta = (end_time - start_time)
if (delta < 1):
delta *= 1000
units = 'ms'
else:
units = 's'
if line_break:
logger.info('PROCESS_TIME:{:>36} {} {}\n'.format(section, round(... | def record_time_interval(section, start_time, line_break=False):
end_time = time.time()
delta = (end_time - start_time)
if (delta < 1):
delta *= 1000
units = 'ms'
else:
units = 's'
if line_break:
logger.info('PROCESS_TIME:{:>36} {} {}\n'.format(section, round(... |
f4f18c03a043195e580eb758e75250222186957bcefeae8f4715a6197f7ed4e8 | def usage():
' This script requires several input arguments to work correctly. Check they exist, otherwise print usage and exit.\n '
if (not (len(sys.argv) == 4)):
print('===============================================================================================================================')
... | This script requires several input arguments to work correctly. Check they exist, otherwise print usage and exit. | star_file_tools/remap_optics_groups.py | usage | akeszei/em_toolkit | 0 | python | def usage():
' \n '
if (not (len(sys.argv) == 4)):
print('===============================================================================================================================')
print(' Remap the optics group assigment of particles based on a micrograph name match criteria:')
... | def usage():
' \n '
if (not (len(sys.argv) == 4)):
print('===============================================================================================================================')
print(' Remap the optics group assigment of particles based on a micrograph name match criteria:')
... |
245b6b93341fc0143f22d9a5a2ba0c06d6fbf78ab15d9b4704f97f530d629dc1 | def header_length(file):
" For an input .STAR file, define the length of the header and\n return the last line in the header. Header length is determined by\n finding the highest line number starting with '_' character\n "
with open(file, 'r') as f:
line_num = 0
header_lines = [... | For an input .STAR file, define the length of the header and
return the last line in the header. Header length is determined by
finding the highest line number starting with '_' character | star_file_tools/remap_optics_groups.py | header_length | akeszei/em_toolkit | 0 | python | def header_length(file):
" For an input .STAR file, define the length of the header and\n return the last line in the header. Header length is determined by\n finding the highest line number starting with '_' character\n "
with open(file, 'r') as f:
line_num = 0
header_lines = [... | def header_length(file):
" For an input .STAR file, define the length of the header and\n return the last line in the header. Header length is determined by\n finding the highest line number starting with '_' character\n "
with open(file, 'r') as f:
line_num = 0
header_lines = [... |
b6ef74fc8f64c79eb36762fc419e411134ccce1af269d7a63ce4419c3fbeff61 | def find_star_column(file, column_type, header_length):
" For an input .STAR file, search through the header and find the column numbers assigned to a given column_type (e.g. 'rlnMicrographName', ...)\n "
column_num = None
with open(file, 'r') as f:
line_num = 0
for line in f:
... | For an input .STAR file, search through the header and find the column numbers assigned to a given column_type (e.g. 'rlnMicrographName', ...) | star_file_tools/remap_optics_groups.py | find_star_column | akeszei/em_toolkit | 0 | python | def find_star_column(file, column_type, header_length):
" \n "
column_num = None
with open(file, 'r') as f:
line_num = 0
for line in f:
line_num += 1
if (column_type in line):
column_num = int(line.split()[1].replace('#', ))
if (line_num... | def find_star_column(file, column_type, header_length):
" \n "
column_num = None
with open(file, 'r') as f:
line_num = 0
for line in f:
line_num += 1
if (column_type in line):
column_num = int(line.split()[1].replace('#', ))
if (line_num... |
01ac0cc00b754f8ff8f51a3e247c905da848eaee088a4a0724c77fdbc2ceda8b | def find_star_info(line, column):
" For a given .STAR file line entry, extract the data at the given column index.\n If the column does not exist (e.g. for a header line read in), return 'False'\n "
line_to_list = line.split()
try:
column_value = line_to_list[(column - 1)]
return c... | For a given .STAR file line entry, extract the data at the given column index.
If the column does not exist (e.g. for a header line read in), return 'False' | star_file_tools/remap_optics_groups.py | find_star_info | akeszei/em_toolkit | 0 | python | def find_star_info(line, column):
" For a given .STAR file line entry, extract the data at the given column index.\n If the column does not exist (e.g. for a header line read in), return 'False'\n "
line_to_list = line.split()
try:
column_value = line_to_list[(column - 1)]
return c... | def find_star_info(line, column):
" For a given .STAR file line entry, extract the data at the given column index.\n If the column does not exist (e.g. for a header line read in), return 'False'\n "
line_to_list = line.split()
try:
column_value = line_to_list[(column - 1)]
return c... |
9bcb26c8d20837ff1a3eb9eff68c186bc0f2b9ebaa20730bd82d244056d9ea05 | def extract_mic_name(input_string):
" Parse the entry for 'rlnMicrographName' to extract only the micrograph name without any path names etc...\n "
mic_name = os.path.basename(input_string)
return mic_name | Parse the entry for 'rlnMicrographName' to extract only the micrograph name without any path names etc... | star_file_tools/remap_optics_groups.py | extract_mic_name | akeszei/em_toolkit | 0 | python | def extract_mic_name(input_string):
" \n "
mic_name = os.path.basename(input_string)
return mic_name | def extract_mic_name(input_string):
" \n "
mic_name = os.path.basename(input_string)
return mic_name<|docstring|>Parse the entry for 'rlnMicrographName' to extract only the micrograph name without any path names etc...<|endoftext|> |
c0eeceac260f130fa7d772c2341b5be8f549a0be7f0b91c903a58ac7045b1c64 | def get_container_pipeline() -> RenderingPipeline:
'Returns setup for container'
return RenderingPipeline(pipes=[apply_attributes, render_container_children], name='container pipeline') | Returns setup for container | pyviews/containers.py | get_container_pipeline | eumis/pyviews | 6 | python | def get_container_pipeline() -> RenderingPipeline:
return RenderingPipeline(pipes=[apply_attributes, render_container_children], name='container pipeline') | def get_container_pipeline() -> RenderingPipeline:
return RenderingPipeline(pipes=[apply_attributes, render_container_children], name='container pipeline')<|docstring|>Returns setup for container<|endoftext|> |
894942dd6546ab4880aca424c6039fbcfbd5421073079852d9a48e33cbc14ffb | def render_container_children(node, context: RenderingContext):
'Renders container children'
render_children(node, context, get_child_context) | Renders container children | pyviews/containers.py | render_container_children | eumis/pyviews | 6 | python | def render_container_children(node, context: RenderingContext):
render_children(node, context, get_child_context) | def render_container_children(node, context: RenderingContext):
render_children(node, context, get_child_context)<|docstring|>Renders container children<|endoftext|> |
f90a249e810fff568f2b978d8002b2be8bd73a7bedbc7d855942f51d19583a6e | def get_view_pipeline() -> RenderingPipeline:
'Returns setup for container'
return RenderingPipeline(pipes=[apply_attributes, render_view_content, rerender_on_view_change], name='view pipeline') | Returns setup for container | pyviews/containers.py | get_view_pipeline | eumis/pyviews | 6 | python | def get_view_pipeline() -> RenderingPipeline:
return RenderingPipeline(pipes=[apply_attributes, render_view_content, rerender_on_view_change], name='view pipeline') | def get_view_pipeline() -> RenderingPipeline:
return RenderingPipeline(pipes=[apply_attributes, render_view_content, rerender_on_view_change], name='view pipeline')<|docstring|>Returns setup for container<|endoftext|> |
b530d6bf9a1d9a27966eeec630b79f66650269b1d7b9b7e79a3c5f26d7d40d9f | def render_view_content(node: View, context: RenderingContext):
'Finds view by name attribute and renders it as view node child'
if node.name:
child_context = get_child_context(node.xml_node, node, context)
content = render_view(node.name, child_context)
node.add_child(content) | Finds view by name attribute and renders it as view node child | pyviews/containers.py | render_view_content | eumis/pyviews | 6 | python | def render_view_content(node: View, context: RenderingContext):
if node.name:
child_context = get_child_context(node.xml_node, node, context)
content = render_view(node.name, child_context)
node.add_child(content) | def render_view_content(node: View, context: RenderingContext):
if node.name:
child_context = get_child_context(node.xml_node, node, context)
content = render_view(node.name, child_context)
node.add_child(content)<|docstring|>Finds view by name attribute and renders it as view node chil... |
35f1adfb4c2773444c7285468578c592a29adc687115d89aba33fa015d489a84 | def rerender_on_view_change(node: View, context: RenderingContext):
'Subscribes to name change and renders new view'
node.observe('name', (lambda _, __: _rerender_view(node, context))) | Subscribes to name change and renders new view | pyviews/containers.py | rerender_on_view_change | eumis/pyviews | 6 | python | def rerender_on_view_change(node: View, context: RenderingContext):
node.observe('name', (lambda _, __: _rerender_view(node, context))) | def rerender_on_view_change(node: View, context: RenderingContext):
node.observe('name', (lambda _, __: _rerender_view(node, context)))<|docstring|>Subscribes to name change and renders new view<|endoftext|> |
77a8833b3c3c695f4283b5c21ba161b54b109c7cbf94242a9e9f0bf7edf92b11 | def get_for_pipeline() -> RenderingPipeline:
'Returns setup for For node'
return RenderingPipeline(pipes=[apply_attributes, render_for_items, rerender_on_items_change], name='for pipeline') | Returns setup for For node | pyviews/containers.py | get_for_pipeline | eumis/pyviews | 6 | python | def get_for_pipeline() -> RenderingPipeline:
return RenderingPipeline(pipes=[apply_attributes, render_for_items, rerender_on_items_change], name='for pipeline') | def get_for_pipeline() -> RenderingPipeline:
return RenderingPipeline(pipes=[apply_attributes, render_for_items, rerender_on_items_change], name='for pipeline')<|docstring|>Returns setup for For node<|endoftext|> |
bf805ab2225d4a7fdda3ac2542056e6e384c83031cb1ab1ad1f27c40421058fb | def render_for_items(node: For, context: RenderingContext):
'Renders For children'
_render_for_children(node, node.items, context) | Renders For children | pyviews/containers.py | render_for_items | eumis/pyviews | 6 | python | def render_for_items(node: For, context: RenderingContext):
_render_for_children(node, node.items, context) | def render_for_items(node: For, context: RenderingContext):
_render_for_children(node, node.items, context)<|docstring|>Renders For children<|endoftext|> |
b967fc6ce0be9b760ccc725eccef60c3d207d4c422c87d05cc1827d336572801 | def rerender_on_items_change(node: For, context: RenderingContext):
'Subscribes to items change and updates children'
node.observe('items', (lambda _, __: _on_items_changed(node, context))) | Subscribes to items change and updates children | pyviews/containers.py | rerender_on_items_change | eumis/pyviews | 6 | python | def rerender_on_items_change(node: For, context: RenderingContext):
node.observe('items', (lambda _, __: _on_items_changed(node, context))) | def rerender_on_items_change(node: For, context: RenderingContext):
node.observe('items', (lambda _, __: _on_items_changed(node, context)))<|docstring|>Subscribes to items change and updates children<|endoftext|> |
2fa80f49db4099b0242a47e6729b1daf30734529719b1fefcf95f53d7d362236 | def get_if_pipeline() -> RenderingPipeline:
'Returns setup for For node'
return RenderingPipeline(pipes=[apply_attributes, render_if, rerender_on_condition_change], name='if pipeline') | Returns setup for For node | pyviews/containers.py | get_if_pipeline | eumis/pyviews | 6 | python | def get_if_pipeline() -> RenderingPipeline:
return RenderingPipeline(pipes=[apply_attributes, render_if, rerender_on_condition_change], name='if pipeline') | def get_if_pipeline() -> RenderingPipeline:
return RenderingPipeline(pipes=[apply_attributes, render_if, rerender_on_condition_change], name='if pipeline')<|docstring|>Returns setup for For node<|endoftext|> |
a876b4bf95db8bcefa8ebdd85a38bddc8b07b6098c9ab99f64e96a26bf139d0f | def render_if(node: If, context: RenderingContext):
'Renders children nodes if condition is true'
if node.condition:
render_children(node, context, get_child_context) | Renders children nodes if condition is true | pyviews/containers.py | render_if | eumis/pyviews | 6 | python | def render_if(node: If, context: RenderingContext):
if node.condition:
render_children(node, context, get_child_context) | def render_if(node: If, context: RenderingContext):
if node.condition:
render_children(node, context, get_child_context)<|docstring|>Renders children nodes if condition is true<|endoftext|> |
55795c178c30f9521717c9fb3b789cacb4334b2f2d4e183c26af8604ffa289c5 | def rerender_on_condition_change(node: If, context: RenderingContext):
'Rerenders if on condition change'
node.observe('condition', (lambda _, __: _on_condition_change(node, context))) | Rerenders if on condition change | pyviews/containers.py | rerender_on_condition_change | eumis/pyviews | 6 | python | def rerender_on_condition_change(node: If, context: RenderingContext):
node.observe('condition', (lambda _, __: _on_condition_change(node, context))) | def rerender_on_condition_change(node: If, context: RenderingContext):
node.observe('condition', (lambda _, __: _on_condition_change(node, context)))<|docstring|>Rerenders if on condition change<|endoftext|> |
85f6ff763074a8f0ce50f851c23bb1f9c84ad7b4070238746205e123b0be2447 | @property
def name(self) -> str:
'Returns view name'
return self._name | Returns view name | pyviews/containers.py | name | eumis/pyviews | 6 | python | @property
def name(self) -> str:
return self._name | @property
def name(self) -> str:
return self._name<|docstring|>Returns view name<|endoftext|> |
8051b6504e35aa421c935d52b7d0631a20afb1654355695ae6e3b2a06ef1842d | @property
def items(self):
'Returns items'
return self._items | Returns items | pyviews/containers.py | items | eumis/pyviews | 6 | python | @property
def items(self):
return self._items | @property
def items(self):
return self._items<|docstring|>Returns items<|endoftext|> |
d70e649ab0d64457b0a7a37de15a47e651392d3ae6f6c3ba3bd17b043343cea2 | @property
def condition(self):
'Returns condition'
return self._condition | Returns condition | pyviews/containers.py | condition | eumis/pyviews | 6 | python | @property
def condition(self):
return self._condition | @property
def condition(self):
return self._condition<|docstring|>Returns condition<|endoftext|> |
2edea4ede59b64e625a1469fee2e83ba204ecb7963dd9a152c7d25748f10d936 | def shuffle(random_state, *args):
'\n random_state: int\n args: List[Tensor]\n\n returns: List[Tensor]\n '
torch.manual_seed(random_state)
size = args[0].size(0)
perm = torch.randperm(size)
res = [x[perm] for x in args]
return res | random_state: int
args: List[Tensor]
returns: List[Tensor] | scripts/helper_utils/pre_process.py | shuffle | hemanthkandula/CLAN | 4 | python | def shuffle(random_state, *args):
'\n random_state: int\n args: List[Tensor]\n\n returns: List[Tensor]\n '
torch.manual_seed(random_state)
size = args[0].size(0)
perm = torch.randperm(size)
res = [x[perm] for x in args]
return res | def shuffle(random_state, *args):
'\n random_state: int\n args: List[Tensor]\n\n returns: List[Tensor]\n '
torch.manual_seed(random_state)
size = args[0].size(0)
perm = torch.randperm(size)
res = [x[perm] for x in args]
return res<|docstring|>random_state: int
args: List[Tensor]
ret... |
5de064c0bcacc13ef5866adece3e3743383460a2c26d4cbe419c350b224ea7bd | def load_senti_corpus(path, vocab, encoding='utf-8', maxlen=512, random_state=None, labels=['__pos__', '__neg__']):
'\n path: str\n vocab: Vocab\n encoding: str\n maxlen: int\n random_state: int\n labels: List[str]\n\n returns: LongTensor of shape (size, maxlen), LongTensor of shape (size,)\n ... | path: str
vocab: Vocab
encoding: str
maxlen: int
random_state: int
labels: List[str]
returns: LongTensor of shape (size, maxlen), LongTensor of shape (size,) | scripts/helper_utils/pre_process.py | load_senti_corpus | hemanthkandula/CLAN | 4 | python | def load_senti_corpus(path, vocab, encoding='utf-8', maxlen=512, random_state=None, labels=['__pos__', '__neg__']):
'\n path: str\n vocab: Vocab\n encoding: str\n maxlen: int\n random_state: int\n labels: List[str]\n\n returns: LongTensor of shape (size, maxlen), LongTensor of shape (size,)\n ... | def load_senti_corpus(path, vocab, encoding='utf-8', maxlen=512, random_state=None, labels=['__pos__', '__neg__']):
'\n path: str\n vocab: Vocab\n encoding: str\n maxlen: int\n random_state: int\n labels: List[str]\n\n returns: LongTensor of shape (size, maxlen), LongTensor of shape (size,)\n ... |
2aaaab8c88f34114af85d8f5073a211212c1cff2a9d38538db97f8651304bb83 | def load_lm_corpus(path, vocab, encoding='utf-8', random_state=None):
'\n path: str\n vocab: Vocab\n encoding: str\n random_state: int (optional)\n\n returns: torch.LongTensor of shape (corpus_size,)\n '
if (random_state is None):
with open(path, 'r', encoding=encoding) as f:
... | path: str
vocab: Vocab
encoding: str
random_state: int (optional)
returns: torch.LongTensor of shape (corpus_size,) | scripts/helper_utils/pre_process.py | load_lm_corpus | hemanthkandula/CLAN | 4 | python | def load_lm_corpus(path, vocab, encoding='utf-8', random_state=None):
'\n path: str\n vocab: Vocab\n encoding: str\n random_state: int (optional)\n\n returns: torch.LongTensor of shape (corpus_size,)\n '
if (random_state is None):
with open(path, 'r', encoding=encoding) as f:
... | def load_lm_corpus(path, vocab, encoding='utf-8', random_state=None):
'\n path: str\n vocab: Vocab\n encoding: str\n random_state: int (optional)\n\n returns: torch.LongTensor of shape (corpus_size,)\n '
if (random_state is None):
with open(path, 'r', encoding=encoding) as f:
... |
373601f2be42101d37484bac1ea8926144789ffad913378d2daa249c4e25fdcc | def load_vectors_with_vocab(path, vocab, maxload=(- 1)):
'\n path: str\n vocab: Vocab\n maxload: int\n '
count = 0
with open(path, 'r', encoding='utf-8', newline='\n', errors='ignore') as fin:
(n, d) = map(int, fin.readline().split(' '))
x = np.zeros([len(vocab), d])
word... | path: str
vocab: Vocab
maxload: int | scripts/helper_utils/pre_process.py | load_vectors_with_vocab | hemanthkandula/CLAN | 4 | python | def load_vectors_with_vocab(path, vocab, maxload=(- 1)):
'\n path: str\n vocab: Vocab\n maxload: int\n '
count = 0
with open(path, 'r', encoding='utf-8', newline='\n', errors='ignore') as fin:
(n, d) = map(int, fin.readline().split(' '))
x = np.zeros([len(vocab), d])
word... | def load_vectors_with_vocab(path, vocab, maxload=(- 1)):
'\n path: str\n vocab: Vocab\n maxload: int\n '
count = 0
with open(path, 'r', encoding='utf-8', newline='\n', errors='ignore') as fin:
(n, d) = map(int, fin.readline().split(' '))
x = np.zeros([len(vocab), d])
word... |
7d5f6e43f9b1693d91134458ff38b13d11ebe12ced168b44780672603f08a701 | def load_lexicon(path, src_vocab, trg_vocab, encoding='utf-8', verbose=False):
'\n path: str\n src_vocab: Vocab\n trg_vocab: Vocab\n encoding: str\n verbose: bool\n\n returns: collections.defautldict\n '
lexicon = collections.defaultdict(set)
vocab = set()
with open(path, 'r', encod... | path: str
src_vocab: Vocab
trg_vocab: Vocab
encoding: str
verbose: bool
returns: collections.defautldict | scripts/helper_utils/pre_process.py | load_lexicon | hemanthkandula/CLAN | 4 | python | def load_lexicon(path, src_vocab, trg_vocab, encoding='utf-8', verbose=False):
'\n path: str\n src_vocab: Vocab\n trg_vocab: Vocab\n encoding: str\n verbose: bool\n\n returns: collections.defautldict\n '
lexicon = collections.defaultdict(set)
vocab = set()
with open(path, 'r', encod... | def load_lexicon(path, src_vocab, trg_vocab, encoding='utf-8', verbose=False):
'\n path: str\n src_vocab: Vocab\n trg_vocab: Vocab\n encoding: str\n verbose: bool\n\n returns: collections.defautldict\n '
lexicon = collections.defaultdict(set)
vocab = set()
with open(path, 'r', encod... |
a1be048c9075456a154a9ff3dc31520d23b4a8ca1f62e06efed2902f9d174e49 | def _match_all_files(file_path: Text) -> Text:
'Return expression to match all files at given path.'
return (file_path + '*') | Return expression to match all files at given path. | tensorflow_model_analysis/writers/metrics_plots_and_validations_writer.py | _match_all_files | TheWayOfTheRob/model-analysis | 1 | python | def _match_all_files(file_path: Text) -> Text:
return (file_path + '*') | def _match_all_files(file_path: Text) -> Text:
return (file_path + '*')<|docstring|>Return expression to match all files at given path.<|endoftext|> |
e102e10040195f69d51313b06bc6e2af9068e84803d54cc6b4498a76b7bad071 | def _parquet_column_iterator(paths: Iterable[str], column_name: str) -> Iterator[pa.Buffer]:
'Yields values from a bytes column in a set of parquet file partitions.'
dataset = pa.parquet.ParquetDataset(paths)
table = dataset.read(columns=[column_name])
for record_batch in table.to_batches():
val... | Yields values from a bytes column in a set of parquet file partitions. | tensorflow_model_analysis/writers/metrics_plots_and_validations_writer.py | _parquet_column_iterator | TheWayOfTheRob/model-analysis | 1 | python | def _parquet_column_iterator(paths: Iterable[str], column_name: str) -> Iterator[pa.Buffer]:
dataset = pa.parquet.ParquetDataset(paths)
table = dataset.read(columns=[column_name])
for record_batch in table.to_batches():
value_array = record_batch.column(0)
for value in value_array:
... | def _parquet_column_iterator(paths: Iterable[str], column_name: str) -> Iterator[pa.Buffer]:
dataset = pa.parquet.ParquetDataset(paths)
table = dataset.read(columns=[column_name])
for record_batch in table.to_batches():
value_array = record_batch.column(0)
for value in value_array:
... |
71e61bae1ee6a93102e2eaab6785247f36a645f92ed78a57e431f5cad560802a | def _raw_value_iterator(paths: Iterable[Text], output_file_format: Text) -> Iterator[Union[(pa.Buffer, bytes)]]:
'Returns an iterator of raw per-record values from supported file formats.\n\n When reading parquet format files, values from the column with name\n _SERIALIZED_VALUE_PARQUET_COLUMN_NAME will be read.\... | Returns an iterator of raw per-record values from supported file formats.
When reading parquet format files, values from the column with name
_SERIALIZED_VALUE_PARQUET_COLUMN_NAME will be read.
Args:
paths: The paths from which to read records
output_file_format: The format of the files from which to read records... | tensorflow_model_analysis/writers/metrics_plots_and_validations_writer.py | _raw_value_iterator | TheWayOfTheRob/model-analysis | 1 | python | def _raw_value_iterator(paths: Iterable[Text], output_file_format: Text) -> Iterator[Union[(pa.Buffer, bytes)]]:
'Returns an iterator of raw per-record values from supported file formats.\n\n When reading parquet format files, values from the column with name\n _SERIALIZED_VALUE_PARQUET_COLUMN_NAME will be read.\... | def _raw_value_iterator(paths: Iterable[Text], output_file_format: Text) -> Iterator[Union[(pa.Buffer, bytes)]]:
'Returns an iterator of raw per-record values from supported file formats.\n\n When reading parquet format files, values from the column with name\n _SERIALIZED_VALUE_PARQUET_COLUMN_NAME will be read.\... |
bbc94cfa813fdbd2225d7c3ecd04bfd946f5c168f12c962a7faffb7aebbc54de | def load_and_deserialize_metrics(output_path: Text, output_file_format: Text='', slice_specs: Optional[Iterable[slicer.SingleSliceSpec]]=None) -> Iterator[metrics_for_slice_pb2.MetricsForSlice]:
"Read and deserialize the MetricsForSlice records.\n\n Args:\n output_path: Path or pattern to search for metrics fil... | Read and deserialize the MetricsForSlice records.
Args:
output_path: Path or pattern to search for metrics files under. If a
directory is passed, files matching 'metrics*' will be searched for.
output_file_format: Optional file extension to filter files by.
slice_specs: A set of SingleSliceSpecs to use for f... | tensorflow_model_analysis/writers/metrics_plots_and_validations_writer.py | load_and_deserialize_metrics | TheWayOfTheRob/model-analysis | 1 | python | def load_and_deserialize_metrics(output_path: Text, output_file_format: Text=, slice_specs: Optional[Iterable[slicer.SingleSliceSpec]]=None) -> Iterator[metrics_for_slice_pb2.MetricsForSlice]:
"Read and deserialize the MetricsForSlice records.\n\n Args:\n output_path: Path or pattern to search for metrics files... | def load_and_deserialize_metrics(output_path: Text, output_file_format: Text=, slice_specs: Optional[Iterable[slicer.SingleSliceSpec]]=None) -> Iterator[metrics_for_slice_pb2.MetricsForSlice]:
"Read and deserialize the MetricsForSlice records.\n\n Args:\n output_path: Path or pattern to search for metrics files... |
505e8faaa31f3426de1b5d3c06ab2e879ba84e9c273ecf0957755b5306ae2a86 | def load_and_deserialize_plots(output_path: Text, output_file_format: Text='', slice_specs: Optional[Iterable[slicer.SingleSliceSpec]]=None) -> Iterator[metrics_for_slice_pb2.PlotsForSlice]:
"Read and deserialize the PlotsForSlice records.\n\n Args:\n output_path: Path or pattern to search for plots files under... | Read and deserialize the PlotsForSlice records.
Args:
output_path: Path or pattern to search for plots files under. If a directory
is passed, files matching 'plots*' will be searched for.
output_file_format: Optional file extension to filter files by.
slice_specs: A set of SingleSliceSpecs to use for filteri... | tensorflow_model_analysis/writers/metrics_plots_and_validations_writer.py | load_and_deserialize_plots | TheWayOfTheRob/model-analysis | 1 | python | def load_and_deserialize_plots(output_path: Text, output_file_format: Text=, slice_specs: Optional[Iterable[slicer.SingleSliceSpec]]=None) -> Iterator[metrics_for_slice_pb2.PlotsForSlice]:
"Read and deserialize the PlotsForSlice records.\n\n Args:\n output_path: Path or pattern to search for plots files under. ... | def load_and_deserialize_plots(output_path: Text, output_file_format: Text=, slice_specs: Optional[Iterable[slicer.SingleSliceSpec]]=None) -> Iterator[metrics_for_slice_pb2.PlotsForSlice]:
"Read and deserialize the PlotsForSlice records.\n\n Args:\n output_path: Path or pattern to search for plots files under. ... |
3829ea553803d22471d8a932d13b05c68681c27b97a960dff2ac8a07d375f40d | def load_and_deserialize_validation_result(output_path: Text, output_file_format: Text='') -> validation_result_pb2.ValidationResult:
"Read and deserialize the ValidationResult record.\n\n Args:\n output_path: Path or pattern to search for validation file under. If a\n directory is passed, a file matching ... | Read and deserialize the ValidationResult record.
Args:
output_path: Path or pattern to search for validation file under. If a
directory is passed, a file matching 'validations*' will be searched for.
output_file_format: Optional file extension to filter file by.
Returns:
ValidationResult proto. | tensorflow_model_analysis/writers/metrics_plots_and_validations_writer.py | load_and_deserialize_validation_result | TheWayOfTheRob/model-analysis | 1 | python | def load_and_deserialize_validation_result(output_path: Text, output_file_format: Text=) -> validation_result_pb2.ValidationResult:
"Read and deserialize the ValidationResult record.\n\n Args:\n output_path: Path or pattern to search for validation file under. If a\n directory is passed, a file matching 'v... | def load_and_deserialize_validation_result(output_path: Text, output_file_format: Text=) -> validation_result_pb2.ValidationResult:
"Read and deserialize the ValidationResult record.\n\n Args:\n output_path: Path or pattern to search for validation file under. If a\n directory is passed, a file matching 'v... |
f9924b3675dafb5d3d0f94d77d4d429db33a7c2ad5fbb1d6fc35f7c957ae5f02 | def _convert_to_array_value(array: np.ndarray) -> metrics_for_slice_pb2.ArrayValue:
'Converts NumPy array to ArrayValue.'
result = metrics_for_slice_pb2.ArrayValue()
result.shape[:] = array.shape
if (array.dtype == 'int32'):
result.data_type = metrics_for_slice_pb2.ArrayValue.INT32
resul... | Converts NumPy array to ArrayValue. | tensorflow_model_analysis/writers/metrics_plots_and_validations_writer.py | _convert_to_array_value | TheWayOfTheRob/model-analysis | 1 | python | def _convert_to_array_value(array: np.ndarray) -> metrics_for_slice_pb2.ArrayValue:
result = metrics_for_slice_pb2.ArrayValue()
result.shape[:] = array.shape
if (array.dtype == 'int32'):
result.data_type = metrics_for_slice_pb2.ArrayValue.INT32
result.int32_values[:] = array.flatten()
... | def _convert_to_array_value(array: np.ndarray) -> metrics_for_slice_pb2.ArrayValue:
result = metrics_for_slice_pb2.ArrayValue()
result.shape[:] = array.shape
if (array.dtype == 'int32'):
result.data_type = metrics_for_slice_pb2.ArrayValue.INT32
result.int32_values[:] = array.flatten()
... |
fba667013d93743d1f430a0774a426c6bcd149e1b08669ffcd02761a4ba2ff01 | def convert_slice_metrics_to_proto(metrics: Tuple[(slicer.SliceKeyType, Dict[(Any, Any)])], add_metrics_callbacks: List[types.AddMetricsCallbackType]) -> metrics_for_slice_pb2.MetricsForSlice:
'Converts the given slice metrics into serialized proto MetricsForSlice.\n\n Args:\n metrics: The slice metrics.\n a... | Converts the given slice metrics into serialized proto MetricsForSlice.
Args:
metrics: The slice metrics.
add_metrics_callbacks: A list of metric callbacks. This should be the same
list as the one passed to tfma.Evaluate().
Returns:
The MetricsForSlice proto.
Raises:
TypeError: If the type of the feature... | tensorflow_model_analysis/writers/metrics_plots_and_validations_writer.py | convert_slice_metrics_to_proto | TheWayOfTheRob/model-analysis | 1 | python | def convert_slice_metrics_to_proto(metrics: Tuple[(slicer.SliceKeyType, Dict[(Any, Any)])], add_metrics_callbacks: List[types.AddMetricsCallbackType]) -> metrics_for_slice_pb2.MetricsForSlice:
'Converts the given slice metrics into serialized proto MetricsForSlice.\n\n Args:\n metrics: The slice metrics.\n a... | def convert_slice_metrics_to_proto(metrics: Tuple[(slicer.SliceKeyType, Dict[(Any, Any)])], add_metrics_callbacks: List[types.AddMetricsCallbackType]) -> metrics_for_slice_pb2.MetricsForSlice:
'Converts the given slice metrics into serialized proto MetricsForSlice.\n\n Args:\n metrics: The slice metrics.\n a... |
365bfc4e951cf7afd6ee40bf096cf25259989dcf6fb4c45148e8bc982a277bf5 | def convert_slice_plots_to_proto(plots: Tuple[(slicer.SliceKeyType, Dict[(Any, Any)])], add_metrics_callbacks: List[types.AddMetricsCallbackType]) -> metrics_for_slice_pb2.PlotsForSlice:
'Converts the given slice plots into PlotsForSlice proto.\n\n Args:\n plots: The slice plots.\n add_metrics_callbacks: A l... | Converts the given slice plots into PlotsForSlice proto.
Args:
plots: The slice plots.
add_metrics_callbacks: A list of metric callbacks. This should be the same
list as the one passed to tfma.Evaluate().
Returns:
The PlotsForSlice proto. | tensorflow_model_analysis/writers/metrics_plots_and_validations_writer.py | convert_slice_plots_to_proto | TheWayOfTheRob/model-analysis | 1 | python | def convert_slice_plots_to_proto(plots: Tuple[(slicer.SliceKeyType, Dict[(Any, Any)])], add_metrics_callbacks: List[types.AddMetricsCallbackType]) -> metrics_for_slice_pb2.PlotsForSlice:
'Converts the given slice plots into PlotsForSlice proto.\n\n Args:\n plots: The slice plots.\n add_metrics_callbacks: A l... | def convert_slice_plots_to_proto(plots: Tuple[(slicer.SliceKeyType, Dict[(Any, Any)])], add_metrics_callbacks: List[types.AddMetricsCallbackType]) -> metrics_for_slice_pb2.PlotsForSlice:
'Converts the given slice plots into PlotsForSlice proto.\n\n Args:\n plots: The slice plots.\n add_metrics_callbacks: A l... |
5fac467cb386a708e3cc6370e04cbcc0b6750fe3fb7f5ab4b6f61c0fed82cae9 | def MetricsPlotsAndValidationsWriter(output_paths: Dict[(Text, Text)], eval_config: config.EvalConfig, add_metrics_callbacks: Optional[List[types.AddMetricsCallbackType]]=None, metrics_key: Text=constants.METRICS_KEY, plots_key: Text=constants.PLOTS_KEY, validations_key: Text=constants.VALIDATIONS_KEY, output_file_form... | Returns metrics and plots writer.
Note, sharding will be enabled by default if a output_file_format is provided.
The files will be named <output_path>-SSSSS-of-NNNNN.<output_file_format>
where SSSSS is the shard number and NNNNN is the number of shards.
Args:
output_paths: Output paths keyed by output key (e.g. 'me... | tensorflow_model_analysis/writers/metrics_plots_and_validations_writer.py | MetricsPlotsAndValidationsWriter | TheWayOfTheRob/model-analysis | 1 | python | def MetricsPlotsAndValidationsWriter(output_paths: Dict[(Text, Text)], eval_config: config.EvalConfig, add_metrics_callbacks: Optional[List[types.AddMetricsCallbackType]]=None, metrics_key: Text=constants.METRICS_KEY, plots_key: Text=constants.PLOTS_KEY, validations_key: Text=constants.VALIDATIONS_KEY, output_file_form... | def MetricsPlotsAndValidationsWriter(output_paths: Dict[(Text, Text)], eval_config: config.EvalConfig, add_metrics_callbacks: Optional[List[types.AddMetricsCallbackType]]=None, metrics_key: Text=constants.METRICS_KEY, plots_key: Text=constants.PLOTS_KEY, validations_key: Text=constants.VALIDATIONS_KEY, output_file_form... |
7e665d5ac55dc2311b35a01806271ff7eb7c3eb7d29d42ab1244eb31010a72aa | @beam.ptransform_fn
@beam.typehints.with_output_types(beam.pvalue.PDone)
def _WriteMetricsPlotsAndValidations(evaluation: evaluator.Evaluation, output_paths: Dict[(Text, Text)], eval_config: config.EvalConfig, add_metrics_callbacks: List[types.AddMetricsCallbackType], metrics_key: Text, plots_key: Text, validations_key... | PTransform to write metrics and plots. | tensorflow_model_analysis/writers/metrics_plots_and_validations_writer.py | _WriteMetricsPlotsAndValidations | TheWayOfTheRob/model-analysis | 1 | python | @beam.ptransform_fn
@beam.typehints.with_output_types(beam.pvalue.PDone)
def _WriteMetricsPlotsAndValidations(evaluation: evaluator.Evaluation, output_paths: Dict[(Text, Text)], eval_config: config.EvalConfig, add_metrics_callbacks: List[types.AddMetricsCallbackType], metrics_key: Text, plots_key: Text, validations_key... | @beam.ptransform_fn
@beam.typehints.with_output_types(beam.pvalue.PDone)
def _WriteMetricsPlotsAndValidations(evaluation: evaluator.Evaluation, output_paths: Dict[(Text, Text)], eval_config: config.EvalConfig, add_metrics_callbacks: List[types.AddMetricsCallbackType], metrics_key: Text, plots_key: Text, validations_key... |
1ab91fb50e7af7b7ed969255d12d7fbc871ac394ad7fb191becb07e7bd83df27 | def parse_argument():
'\n Parse input arguments.\n\n Returns:\n - parsed arguments\n '
parser = argparse.ArgumentParser(description='Populate FoodON.')
parser.add_argument('--config_file', default=DEFAULT_CONFIG_FILE, help='Path to the .ini configuration file.')
return parser.parse_args(... | Parse input arguments.
Returns:
- parsed arguments | populate_foodon.py | parse_argument | g-simmons/LOVE | 7 | python | def parse_argument():
'\n Parse input arguments.\n\n Returns:\n - parsed arguments\n '
parser = argparse.ArgumentParser(description='Populate FoodON.')
parser.add_argument('--config_file', default=DEFAULT_CONFIG_FILE, help='Path to the .ini configuration file.')
return parser.parse_args(... | def parse_argument():
'\n Parse input arguments.\n\n Returns:\n - parsed arguments\n '
parser = argparse.ArgumentParser(description='Populate FoodON.')
parser.add_argument('--config_file', default=DEFAULT_CONFIG_FILE, help='Path to the .ini configuration file.')
return parser.parse_args(... |
eb7065fb6d3cc412d171d6a673844c9761cf0fc3f142e9c3fe3077f2a91ed6ea | def main():
'\n Main function.\n '
args = parse_argument()
configparser = ConfigParser(args.config_file)
set_logging(configparser.getstr('logfile'))
parse_foodon = ParseFoodOn(configparser.getstr('foodon_parse_config'))
classes_dict = parse_foodon.get_candidate_classes()
(classes_dict_... | Main function. | populate_foodon.py | main | g-simmons/LOVE | 7 | python | def main():
'\n \n '
args = parse_argument()
configparser = ConfigParser(args.config_file)
set_logging(configparser.getstr('logfile'))
parse_foodon = ParseFoodOn(configparser.getstr('foodon_parse_config'))
classes_dict = parse_foodon.get_candidate_classes()
(classes_dict_skeleton, cand... | def main():
'\n \n '
args = parse_argument()
configparser = ConfigParser(args.config_file)
set_logging(configparser.getstr('logfile'))
parse_foodon = ParseFoodOn(configparser.getstr('foodon_parse_config'))
classes_dict = parse_foodon.get_candidate_classes()
(classes_dict_skeleton, cand... |
1a7f60b75b51a489cbc72149a63dc907bd5b65eaab4160e2d1c09b645028cc7a | def _getDigest(self, line, mode):
'\n specify what part in the line to be processed and highlighted\n Args:\n mode: 0, return the full path\n 1, return the name only\n 2, return the directory name\n '
return line[:line.find('\t')] | specify what part in the line to be processed and highlighted
Args:
mode: 0, return the full path
1, return the name only
2, return the directory name | plugged/LeaderF/autoload/leaderf/python/leaderf/tagExpl.py | _getDigest | CHANTXU64/.vim | 1,914 | python | def _getDigest(self, line, mode):
'\n specify what part in the line to be processed and highlighted\n Args:\n mode: 0, return the full path\n 1, return the name only\n 2, return the directory name\n '
return line[:line.find('\t')] | def _getDigest(self, line, mode):
'\n specify what part in the line to be processed and highlighted\n Args:\n mode: 0, return the full path\n 1, return the name only\n 2, return the directory name\n '
return line[:line.find('\t')]<|docstring|>spe... |
5fa069979b6998924382ceeb41fe85a549680010e7b2d35e0c0ad9edb5c228f4 | def _getDigestStartPos(self, line, mode):
'\n return the start position of the digest returned by _getDigest()\n Args:\n mode: 0, return the start postion of full path\n 1, return the start postion of name only\n 2, return the start postion of directory nam... | return the start position of the digest returned by _getDigest()
Args:
mode: 0, return the start postion of full path
1, return the start postion of name only
2, return the start postion of directory name | plugged/LeaderF/autoload/leaderf/python/leaderf/tagExpl.py | _getDigestStartPos | CHANTXU64/.vim | 1,914 | python | def _getDigestStartPos(self, line, mode):
'\n return the start position of the digest returned by _getDigest()\n Args:\n mode: 0, return the start postion of full path\n 1, return the start postion of name only\n 2, return the start postion of directory nam... | def _getDigestStartPos(self, line, mode):
'\n return the start position of the digest returned by _getDigest()\n Args:\n mode: 0, return the start postion of full path\n 1, return the start postion of name only\n 2, return the start postion of directory nam... |
973bbdf5232434a6e7a570bfcef3e478d55e5b336d74c4c03f288f4c6c2092af | def parse(self, response):
'\n `parse` should always `yield` Meeting items.\n\n Change the `_parse_title`, `_parse_start`, etc methods to fit your scraping\n needs.\n '
self.links = self._parse_all_links(response)
for date in self.links.keys():
if ('Agenda' in self.links[... | `parse` should always `yield` Meeting items.
Change the `_parse_title`, `_parse_start`, etc methods to fit your scraping
needs. | city_scrapers/spiders/il_corrections.py | parse | yijun-li-20/city-scrapers | 255 | python | def parse(self, response):
'\n `parse` should always `yield` Meeting items.\n\n Change the `_parse_title`, `_parse_start`, etc methods to fit your scraping\n needs.\n '
self.links = self._parse_all_links(response)
for date in self.links.keys():
if ('Agenda' in self.links[... | def parse(self, response):
'\n `parse` should always `yield` Meeting items.\n\n Change the `_parse_title`, `_parse_start`, etc methods to fit your scraping\n needs.\n '
self.links = self._parse_all_links(response)
for date in self.links.keys():
if ('Agenda' in self.links[... |
4befdf727207fdc2f86e05839947f87cf25441d872f40b4bd038de50cb46c501 | def _parse_pdf(self, response):
'Parse dates and details from schedule PDF'
lp = LAParams(line_margin=0.1)
out_str = StringIO()
extract_text_to_fp(BytesIO(response.body), out_str, laparams=lp)
pdf_text = out_str.getvalue()
return pdf_text.lower() | Parse dates and details from schedule PDF | city_scrapers/spiders/il_corrections.py | _parse_pdf | yijun-li-20/city-scrapers | 255 | python | def _parse_pdf(self, response):
lp = LAParams(line_margin=0.1)
out_str = StringIO()
extract_text_to_fp(BytesIO(response.body), out_str, laparams=lp)
pdf_text = out_str.getvalue()
return pdf_text.lower() | def _parse_pdf(self, response):
lp = LAParams(line_margin=0.1)
out_str = StringIO()
extract_text_to_fp(BytesIO(response.body), out_str, laparams=lp)
pdf_text = out_str.getvalue()
return pdf_text.lower()<|docstring|>Parse dates and details from schedule PDF<|endoftext|> |
916ba2c26b8f5eeb34edd5edc0a5405665855512fd6eaf6190ffaa4e2aed5ee2 | def _parse_title(self, pdf_text):
'Parse or generate meeting title.'
title = 'Adult Advisory Board Meeting'
if ('subcommittee' in pdf_text):
title = "Adult Advisory Board / Women's Subcommittee Meeting"
return title | Parse or generate meeting title. | city_scrapers/spiders/il_corrections.py | _parse_title | yijun-li-20/city-scrapers | 255 | python | def _parse_title(self, pdf_text):
title = 'Adult Advisory Board Meeting'
if ('subcommittee' in pdf_text):
title = "Adult Advisory Board / Women's Subcommittee Meeting"
return title | def _parse_title(self, pdf_text):
title = 'Adult Advisory Board Meeting'
if ('subcommittee' in pdf_text):
title = "Adult Advisory Board / Women's Subcommittee Meeting"
return title<|docstring|>Parse or generate meeting title.<|endoftext|> |
614f2240ba232c0d602b799ba326c01d1efc299dfb20f2af98444e08f0d8117a | def _parse_times(self, date, pdf_text, start=True):
'Parse start datetime as a naive datetime object.'
times = re.findall('(\\d{1,2}:\\d{2} ?(am|a\\.m\\.|pm|p\\.m\\.))', pdf_text)
if start:
try:
start_time = times[0][0].replace('.', '')
except IndexError:
start_time =... | Parse start datetime as a naive datetime object. | city_scrapers/spiders/il_corrections.py | _parse_times | yijun-li-20/city-scrapers | 255 | python | def _parse_times(self, date, pdf_text, start=True):
times = re.findall('(\\d{1,2}:\\d{2} ?(am|a\\.m\\.|pm|p\\.m\\.))', pdf_text)
if start:
try:
start_time = times[0][0].replace('.', )
except IndexError:
start_time = '12:00am'
return self._try_time_format(date... | def _parse_times(self, date, pdf_text, start=True):
times = re.findall('(\\d{1,2}:\\d{2} ?(am|a\\.m\\.|pm|p\\.m\\.))', pdf_text)
if start:
try:
start_time = times[0][0].replace('.', )
except IndexError:
start_time = '12:00am'
return self._try_time_format(date... |
af71ff15cc810d3b02f5faea23c98691dc5279814145d407429d8d0345dfc61e | def _try_time_format(self, date, time):
'Try time formatting with and without spacing'
try:
time_object = datetime.strptime(f'{date} {time}', '%B %d, %Y %I:%M%p')
except ValueError:
time_object = datetime.strptime(f'{date} {time}', '%B %d, %Y %I:%M %p')
return time_object | Try time formatting with and without spacing | city_scrapers/spiders/il_corrections.py | _try_time_format | yijun-li-20/city-scrapers | 255 | python | def _try_time_format(self, date, time):
try:
time_object = datetime.strptime(f'{date} {time}', '%B %d, %Y %I:%M%p')
except ValueError:
time_object = datetime.strptime(f'{date} {time}', '%B %d, %Y %I:%M %p')
return time_object | def _try_time_format(self, date, time):
try:
time_object = datetime.strptime(f'{date} {time}', '%B %d, %Y %I:%M%p')
except ValueError:
time_object = datetime.strptime(f'{date} {time}', '%B %d, %Y %I:%M %p')
return time_object<|docstring|>Try time formatting with and without spacing<|end... |
f392bc81d14d36090a73d57c9482dac3c4aa8262161c5868b5a233e090b5a682 | def _parse_location(self, pdf_text):
'Parse or generate location.'
location_lookup = {'logan correctional center': {'address': '1096 1350th St, Lincoln, IL 62656', 'name': 'Logan Correctional Center'}, 'vandalia correctional center': {'address': 'US-51, Vandalia, IL 62471', 'name': 'Vandalia Correctional Center... | Parse or generate location. | city_scrapers/spiders/il_corrections.py | _parse_location | yijun-li-20/city-scrapers | 255 | python | def _parse_location(self, pdf_text):
location_lookup = {'logan correctional center': {'address': '1096 1350th St, Lincoln, IL 62656', 'name': 'Logan Correctional Center'}, 'vandalia correctional center': {'address': 'US-51, Vandalia, IL 62471', 'name': 'Vandalia Correctional Center'}, 'thompson center': {'addr... | def _parse_location(self, pdf_text):
location_lookup = {'logan correctional center': {'address': '1096 1350th St, Lincoln, IL 62656', 'name': 'Logan Correctional Center'}, 'vandalia correctional center': {'address': 'US-51, Vandalia, IL 62471', 'name': 'Vandalia Correctional Center'}, 'thompson center': {'addr... |
020a4f21b1624ed6dcb82bf3cb38d8df2497c310a8797724d019de8b31be4e3f | def _parse_all_links(self, response):
' Gather dates, links '
link_dict = defaultdict(dict)
for link in response.css('a'):
date = link.re_first('((Jan(uary)?|Feb(ruary)?|Mar(ch)?|Apr(il)?|\n May|Jun(e)?|Jul(y)?|Aug(ust)?|Sep(tember)?|Oct(ober)?|Nov(ember)?|\n Dec(ember)?)\\s+\\... | Gather dates, links | city_scrapers/spiders/il_corrections.py | _parse_all_links | yijun-li-20/city-scrapers | 255 | python | def _parse_all_links(self, response):
' '
link_dict = defaultdict(dict)
for link in response.css('a'):
date = link.re_first('((Jan(uary)?|Feb(ruary)?|Mar(ch)?|Apr(il)?|\n May|Jun(e)?|Jul(y)?|Aug(ust)?|Sep(tember)?|Oct(ober)?|Nov(ember)?|\n Dec(ember)?)\\s+\\d{1,2},\\s+\\d{4})|... | def _parse_all_links(self, response):
' '
link_dict = defaultdict(dict)
for link in response.css('a'):
date = link.re_first('((Jan(uary)?|Feb(ruary)?|Mar(ch)?|Apr(il)?|\n May|Jun(e)?|Jul(y)?|Aug(ust)?|Sep(tember)?|Oct(ober)?|Nov(ember)?|\n Dec(ember)?)\\s+\\d{1,2},\\s+\\d{4})|... |
dc0e84aed0806e944ac0a0618d71d5cbefd4ed57ab59523e47198d5126a2ed4a | def _parse_links(self, date):
'Parse or generate links.'
link_list = []
for (key, value) in self.links[date].items():
link_list.append({'title': key, 'href': value})
return link_list | Parse or generate links. | city_scrapers/spiders/il_corrections.py | _parse_links | yijun-li-20/city-scrapers | 255 | python | def _parse_links(self, date):
link_list = []
for (key, value) in self.links[date].items():
link_list.append({'title': key, 'href': value})
return link_list | def _parse_links(self, date):
link_list = []
for (key, value) in self.links[date].items():
link_list.append({'title': key, 'href': value})
return link_list<|docstring|>Parse or generate links.<|endoftext|> |
a6a4a0d62bee26a65a388f7347e2df2239568a4cf18f44381c4685473e4d7f76 | def get_version(path):
'Get the version info from the mpld3 package without importing it'
import ast
with open(path) as init_file:
module = ast.parse(init_file.read())
version = (ast.literal_eval(node.value) for node in ast.walk(module) if (isinstance(node, ast.Assign) and (node.targets[0].id ==... | Get the version info from the mpld3 package without importing it | setup.py | get_version | ManuelZierl/slurmpy | 79 | python | def get_version(path):
import ast
with open(path) as init_file:
module = ast.parse(init_file.read())
version = (ast.literal_eval(node.value) for node in ast.walk(module) if (isinstance(node, ast.Assign) and (node.targets[0].id == '__version__')))
try:
return next(version)
except... | def get_version(path):
import ast
with open(path) as init_file:
module = ast.parse(init_file.read())
version = (ast.literal_eval(node.value) for node in ast.walk(module) if (isinstance(node, ast.Assign) and (node.targets[0].id == '__version__')))
try:
return next(version)
except... |
659bd6c1796158d60048100256e647ee9f967af8fc099ddc56366ef91f2e62e5 | def serialize(self):
'Serialize the struct into protobuf string'
job_config = self.get_proto_job_config()
return job_config.SerializeToString() | Serialize the struct into protobuf string | python/ray/job_config.py | serialize | scrarlet/ray | 3 | python | def serialize(self):
job_config = self.get_proto_job_config()
return job_config.SerializeToString() | def serialize(self):
job_config = self.get_proto_job_config()
return job_config.SerializeToString()<|docstring|>Serialize the struct into protobuf string<|endoftext|> |
bedb693eaee805bcf993ce49086148b29759651f1fa31ce437d013b188a334b5 | def get_proto_job_config(self):
'Return the prototype structure of JobConfig'
if (self._cached_pb is None):
self._cached_pb = ray.gcs_utils.JobConfig()
if (self.ray_namespace is None):
self._cached_pb.ray_namespace = str(uuid.uuid4())
else:
self._cached_pb.ray_nam... | Return the prototype structure of JobConfig | python/ray/job_config.py | get_proto_job_config | scrarlet/ray | 3 | python | def get_proto_job_config(self):
if (self._cached_pb is None):
self._cached_pb = ray.gcs_utils.JobConfig()
if (self.ray_namespace is None):
self._cached_pb.ray_namespace = str(uuid.uuid4())
else:
self._cached_pb.ray_namespace = self.ray_namespace
for key i... | def get_proto_job_config(self):
if (self._cached_pb is None):
self._cached_pb = ray.gcs_utils.JobConfig()
if (self.ray_namespace is None):
self._cached_pb.ray_namespace = str(uuid.uuid4())
else:
self._cached_pb.ray_namespace = self.ray_namespace
for key i... |
4cca0aca3eae408b5d37d8ffe3b1fa84f0cc4efe4c420a945794725102947627 | def get_runtime_env_uris(self):
'Get the uris of runtime environment'
if self.runtime_env.get('uris'):
return self.runtime_env.get('uris')
return [] | Get the uris of runtime environment | python/ray/job_config.py | get_runtime_env_uris | scrarlet/ray | 3 | python | def get_runtime_env_uris(self):
if self.runtime_env.get('uris'):
return self.runtime_env.get('uris')
return [] | def get_runtime_env_uris(self):
if self.runtime_env.get('uris'):
return self.runtime_env.get('uris')
return []<|docstring|>Get the uris of runtime environment<|endoftext|> |
61f4c2449d6dfbd39a294a811c52d615892cb91b09c2804b4f2c2d8fb07ca301 | def get_serialized_runtime_env(self) -> str:
'Return the JSON-serialized parsed runtime env dict'
return self._parsed_runtime_env.serialize() | Return the JSON-serialized parsed runtime env dict | python/ray/job_config.py | get_serialized_runtime_env | scrarlet/ray | 3 | python | def get_serialized_runtime_env(self) -> str:
return self._parsed_runtime_env.serialize() | def get_serialized_runtime_env(self) -> str:
return self._parsed_runtime_env.serialize()<|docstring|>Return the JSON-serialized parsed runtime env dict<|endoftext|> |
115de9370d9f40f3b0d2d2d33e7c48a2b44d19360c6fd21649b520908d203fc3 | def is_task_executor_process(task: Task, process: psutil.Process):
'\n check the process if task executor or not by command\n :param task:\n :param process:\n :return:\n '
try:
cmdline = process.cmdline()
except Exception as e:
schedule_logger(task.f_job_id).warning(e)
... | check the process if task executor or not by command
:param task:
:param process:
:return: | python/fate_flow/utils/process_utils.py | is_task_executor_process | PromiseChan/FATE-Flow | 22 | python | def is_task_executor_process(task: Task, process: psutil.Process):
'\n check the process if task executor or not by command\n :param task:\n :param process:\n :return:\n '
try:
cmdline = process.cmdline()
except Exception as e:
schedule_logger(task.f_job_id).warning(e)
... | def is_task_executor_process(task: Task, process: psutil.Process):
'\n check the process if task executor or not by command\n :param task:\n :param process:\n :return:\n '
try:
cmdline = process.cmdline()
except Exception as e:
schedule_logger(task.f_job_id).warning(e)
... |
3d46c4770c2425bd2a90edecde26ad6d752ea335608638896c8a4ba9b6680c4a | def help(self):
'help() gets invoked when we get the ``results`` message\n with no arguments'
parts = []
for choice in Choice.objects.all():
part = ('%s: %d' % (choice.name, choice.votes))
parts.append(part)
msg = '; '.join(parts)
self.respond(msg) | help() gets invoked when we get the ``results`` message
with no arguments | voting/handlers.py | help | dragGH102/rapidsms-example-with-rest-services | 0 | python | def help(self):
'help() gets invoked when we get the ``results`` message\n with no arguments'
parts = []
for choice in Choice.objects.all():
part = ('%s: %d' % (choice.name, choice.votes))
parts.append(part)
msg = '; '.join(parts)
self.respond(msg) | def help(self):
'help() gets invoked when we get the ``results`` message\n with no arguments'
parts = []
for choice in Choice.objects.all():
part = ('%s: %d' % (choice.name, choice.votes))
parts.append(part)
msg = '; '.join(parts)
self.respond(msg)<|docstring|>help() gets invo... |
5a5ab440899d4468dc0a5b8a4278f302aa67cce32018238d66b459c9313d7b60 | def handle(self, text):
"This gets called if any arguments are given along with\n ``RESULTS``, but we don't care; just call help() as if they\n passed no arguments"
self.help() | This gets called if any arguments are given along with
``RESULTS``, but we don't care; just call help() as if they
passed no arguments | voting/handlers.py | handle | dragGH102/rapidsms-example-with-rest-services | 0 | python | def handle(self, text):
"This gets called if any arguments are given along with\n ``RESULTS``, but we don't care; just call help() as if they\n passed no arguments"
self.help() | def handle(self, text):
"This gets called if any arguments are given along with\n ``RESULTS``, but we don't care; just call help() as if they\n passed no arguments"
self.help()<|docstring|>This gets called if any arguments are given along with
``RESULTS``, but we don't care; just call help() as if... |
5c91f7761e57677856dd94061d3febacc3a18df72b4470977c323e966b89fb86 | def help(self):
'Respond with the valid commands. Example response:\n ``Valid commands: VOTE <Moe|Larry|Curly>``\n '
choices = '|'.join(Choice.objects.values_list('name', flat=True))
self.respond(('Valid commands: VOTE <%s>' % choices)) | Respond with the valid commands. Example response:
``Valid commands: VOTE <Moe|Larry|Curly>`` | voting/handlers.py | help | dragGH102/rapidsms-example-with-rest-services | 0 | python | def help(self):
'Respond with the valid commands. Example response:\n ``Valid commands: VOTE <Moe|Larry|Curly>``\n '
choices = '|'.join(Choice.objects.values_list('name', flat=True))
self.respond(('Valid commands: VOTE <%s>' % choices)) | def help(self):
'Respond with the valid commands. Example response:\n ``Valid commands: VOTE <Moe|Larry|Curly>``\n '
choices = '|'.join(Choice.objects.values_list('name', flat=True))
self.respond(('Valid commands: VOTE <%s>' % choices))<|docstring|>Respond with the valid commands. Example re... |
9d3df847bade95093d86451b6e621a109397cb909aef103a9df4eb2ea81b3715 | def bash(command, terminal=None, *args, **kwargs):
'Execute command in a terminal.'
if (terminal is None):
terminal = current().context.terminal
r = terminal(command, *args, **kwargs)
return r | Execute command in a terminal. | tests/steps.py | bash | roshanths/altinity-dashboard | 1 | python | def bash(command, terminal=None, *args, **kwargs):
if (terminal is None):
terminal = current().context.terminal
r = terminal(command, *args, **kwargs)
return r | def bash(command, terminal=None, *args, **kwargs):
if (terminal is None):
terminal = current().context.terminal
r = terminal(command, *args, **kwargs)
return r<|docstring|>Execute command in a terminal.<|endoftext|> |
b75d8276e5dcfef822f54b0a9b74d19efecd569a1788785126a6cc0e36694db4 | @TextStep(Given)
def open_terminal(self, command=['/bin/bash'], timeout=100):
'Open host terminal.'
with Shell(command=command) as terminal:
terminal.timeout = timeout
terminal('echo 1')
try:
(yield terminal)
finally:
with Cleanup('closing terminal'):
... | Open host terminal. | tests/steps.py | open_terminal | roshanths/altinity-dashboard | 1 | python | @TextStep(Given)
def open_terminal(self, command=['/bin/bash'], timeout=100):
with Shell(command=command) as terminal:
terminal.timeout = timeout
terminal('echo 1')
try:
(yield terminal)
finally:
with Cleanup('closing terminal'):
terminal.... | @TextStep(Given)
def open_terminal(self, command=['/bin/bash'], timeout=100):
with Shell(command=command) as terminal:
terminal.timeout = timeout
terminal('echo 1')
try:
(yield terminal)
finally:
with Cleanup('closing terminal'):
terminal.... |
9018320b2278feb22e20bdff99adcb338f01b327054d20321df8d4f9d0700092 | @TestStep(Given)
def webdriver(self, browser='chrome', selenium_hub_url='http://127.0.0.1:4444/wd/hub', timeout=300, local=None, local_webdriver_path=None):
'Create webdriver instance.'
driver = None
start_time = time.time()
try_number = 0
try:
with Given('I create new webdriver instance'):
... | Create webdriver instance. | tests/steps.py | webdriver | roshanths/altinity-dashboard | 1 | python | @TestStep(Given)
def webdriver(self, browser='chrome', selenium_hub_url='http://127.0.0.1:4444/wd/hub', timeout=300, local=None, local_webdriver_path=None):
driver = None
start_time = time.time()
try_number = 0
try:
with Given('I create new webdriver instance'):
if local:
... | @TestStep(Given)
def webdriver(self, browser='chrome', selenium_hub_url='http://127.0.0.1:4444/wd/hub', timeout=300, local=None, local_webdriver_path=None):
driver = None
start_time = time.time()
try_number = 0
try:
with Given('I create new webdriver instance'):
if local:
... |
54e341d9aac53d9fe2c1fc3fc44cd3cbbcc91d9c10c6c4265e59f96a02e308d8 | @TestStep(Given)
def alert(self, message, sleep=0.25):
'Create alert popup in the browser window.'
driver: WebDriver = self.context.driver
driver.execute_script(f'alert("{message}");')
time.sleep(sleep)
driver.switch_to.alert.accept() | Create alert popup in the browser window. | tests/steps.py | alert | roshanths/altinity-dashboard | 1 | python | @TestStep(Given)
def alert(self, message, sleep=0.25):
driver: WebDriver = self.context.driver
driver.execute_script(f'alert("{message}");')
time.sleep(sleep)
driver.switch_to.alert.accept() | @TestStep(Given)
def alert(self, message, sleep=0.25):
driver: WebDriver = self.context.driver
driver.execute_script(f'alert("{message}");')
time.sleep(sleep)
driver.switch_to.alert.accept()<|docstring|>Create alert popup in the browser window.<|endoftext|> |
34be1be4fad13a24bcea188e0e938bb78e860ebfa2684db34592c8e0f7560277 | @TestStep(Given)
def wait_for_element_to_be_clickable(self, timeout=None, poll_frequency=None, select_type=None, element=None):
'An Expectation for checking an element is visible and enabled such that\n you can click it.\n select_type - option that follows after SelectBy. (Examples: CSS, ID, XPATH, NAME)\n ... | An Expectation for checking an element is visible and enabled such that
you can click it.
select_type - option that follows after SelectBy. (Examples: CSS, ID, XPATH, NAME)
element - locator in string format(Example: "organizationId"). | tests/steps.py | wait_for_element_to_be_clickable | roshanths/altinity-dashboard | 1 | python | @TestStep(Given)
def wait_for_element_to_be_clickable(self, timeout=None, poll_frequency=None, select_type=None, element=None):
'An Expectation for checking an element is visible and enabled such that\n you can click it.\n select_type - option that follows after SelectBy. (Examples: CSS, ID, XPATH, NAME)\n ... | @TestStep(Given)
def wait_for_element_to_be_clickable(self, timeout=None, poll_frequency=None, select_type=None, element=None):
'An Expectation for checking an element is visible and enabled such that\n you can click it.\n select_type - option that follows after SelectBy. (Examples: CSS, ID, XPATH, NAME)\n ... |
02b44b1391c253ef879f96424d3ec5ebf1a454b2355d7beed4df056bc2de4e9b | @TestStep(Given)
def wait_for_element_to_be_invisible(self, select_type=None, element=None):
'An Expectation for checking that an element is either invisible or not\n present on the DOM. Locator is used to find the element.\n '
driver = self.context.driver
wait = WebDriverWait(driver, 60)
wait.unt... | An Expectation for checking that an element is either invisible or not
present on the DOM. Locator is used to find the element. | tests/steps.py | wait_for_element_to_be_invisible | roshanths/altinity-dashboard | 1 | python | @TestStep(Given)
def wait_for_element_to_be_invisible(self, select_type=None, element=None):
'An Expectation for checking that an element is either invisible or not\n present on the DOM. Locator is used to find the element.\n '
driver = self.context.driver
wait = WebDriverWait(driver, 60)
wait.unt... | @TestStep(Given)
def wait_for_element_to_be_invisible(self, select_type=None, element=None):
'An Expectation for checking that an element is either invisible or not\n present on the DOM. Locator is used to find the element.\n '
driver = self.context.driver
wait = WebDriverWait(driver, 60)
wait.unt... |
a10853ffe54fec87ab8d360ca194e4e0d0b91a72ca49fbb9caf7f3b6c5c5548c | @TestStep(Given)
def wait_for_element_to_be_visible(self, select_type=None, element=None, timeout=30):
'An expectation for checking that an element is present on the DOM of a\n page and visible. Visibility means that the element is not only displayed\n but also has a height and width that is greater than 0.\n... | An expectation for checking that an element is present on the DOM of a
page and visible. Visibility means that the element is not only displayed
but also has a height and width that is greater than 0.
select_type - option that follows after SelectBy. (Examples: CSS, ID, XPATH, NAME)
element - locator in string format(E... | tests/steps.py | wait_for_element_to_be_visible | roshanths/altinity-dashboard | 1 | python | @TestStep(Given)
def wait_for_element_to_be_visible(self, select_type=None, element=None, timeout=30):
'An expectation for checking that an element is present on the DOM of a\n page and visible. Visibility means that the element is not only displayed\n but also has a height and width that is greater than 0.\n... | @TestStep(Given)
def wait_for_element_to_be_visible(self, select_type=None, element=None, timeout=30):
'An expectation for checking that an element is present on the DOM of a\n page and visible. Visibility means that the element is not only displayed\n but also has a height and width that is greater than 0.\n... |
6134519dba06679dd7ffa122c34316b666047db792b24d9d6c19a4642c06ec79 | @TestStep(When)
def run_adash_on_chrome(self):
'Run Altinity dashboard url on Chrome.'
driver: WebDriver = self.context.driver
open_altinity_dashboard = 'http://0.0.0.0:8080'
with Given('Adash is running in the VM'):
with When('start the chrome with Adash url and find `Details` element'):
... | Run Altinity dashboard url on Chrome. | tests/steps.py | run_adash_on_chrome | roshanths/altinity-dashboard | 1 | python | @TestStep(When)
def run_adash_on_chrome(self):
driver: WebDriver = self.context.driver
open_altinity_dashboard = 'http://0.0.0.0:8080'
with Given('Adash is running in the VM'):
with When('start the chrome with Adash url and find `Details` element'):
for attempt in retries(count=5, t... | @TestStep(When)
def run_adash_on_chrome(self):
driver: WebDriver = self.context.driver
open_altinity_dashboard = 'http://0.0.0.0:8080'
with Given('Adash is running in the VM'):
with When('start the chrome with Adash url and find `Details` element'):
for attempt in retries(count=5, t... |
4a45476e74825cea21b8b7d56f318e4fad6660c5b1195849ae70e54d9ece821b | @TestStep(When)
def delete_cho_remove_ch(self, timeout=15):
'Delete ClickHouse Operator and Installation from Altinity dashboard.'
driver: WebDriver = self.context.driver
cho_tab = '/html/body/div[1]/div/div/div/nav/ul/li[2]/a'
ch_install = '/html/body/div[1]/div/div/div/nav/ul/li[3]/a'
chi_toggle_b... | Delete ClickHouse Operator and Installation from Altinity dashboard. | tests/steps.py | delete_cho_remove_ch | roshanths/altinity-dashboard | 1 | python | @TestStep(When)
def delete_cho_remove_ch(self, timeout=15):
driver: WebDriver = self.context.driver
cho_tab = '/html/body/div[1]/div/div/div/nav/ul/li[2]/a'
ch_install = '/html/body/div[1]/div/div/div/nav/ul/li[3]/a'
chi_toggle_btn = '/html/body/div[1]/div/main/section/table/tbody/tr[1]/td[7]/div'
... | @TestStep(When)
def delete_cho_remove_ch(self, timeout=15):
driver: WebDriver = self.context.driver
cho_tab = '/html/body/div[1]/div/div/div/nav/ul/li[2]/a'
ch_install = '/html/body/div[1]/div/div/div/nav/ul/li[3]/a'
chi_toggle_btn = '/html/body/div[1]/div/main/section/table/tbody/tr[1]/td[7]/div'
... |
d756e46185daf8aa20465ec410a282d1abf941df292147ec03c64c046fc8f18e | @TestStep(When)
def deploy_cho_install_ch(self, timeout=15):
'Deploy ClickHouse Operator on Altinity dashboard.'
driver: WebDriver = self.context.driver
cho_tab = '/html/body/div[1]/div/div/div/nav/ul/li[2]/a'
add_cho = '/html/body/div[1]/div/main/section/div/div[2]/button'
select_ns = "//*[@id='pf-... | Deploy ClickHouse Operator on Altinity dashboard. | tests/steps.py | deploy_cho_install_ch | roshanths/altinity-dashboard | 1 | python | @TestStep(When)
def deploy_cho_install_ch(self, timeout=15):
driver: WebDriver = self.context.driver
cho_tab = '/html/body/div[1]/div/div/div/nav/ul/li[2]/a'
add_cho = '/html/body/div[1]/div/main/section/div/div[2]/button'
select_ns = "//*[@id='pf-context-selector-toggle-id-0']"
select_default_... | @TestStep(When)
def deploy_cho_install_ch(self, timeout=15):
driver: WebDriver = self.context.driver
cho_tab = '/html/body/div[1]/div/div/div/nav/ul/li[2]/a'
add_cho = '/html/body/div[1]/div/main/section/div/div[2]/button'
select_ns = "//*[@id='pf-context-selector-toggle-id-0']"
select_default_... |
709315b985dee51dbe31d40add98135909659ba823ebc916d1910fdeca88cb5f | @TestStep(Finally)
def halt_vagrant(self):
'Halt the running vagrant VM.'
with Finally('I halt the vm'):
os.system('vagrant halt') | Halt the running vagrant VM. | tests/steps.py | halt_vagrant | roshanths/altinity-dashboard | 1 | python | @TestStep(Finally)
def halt_vagrant(self):
with Finally('I halt the vm'):
os.system('vagrant halt') | @TestStep(Finally)
def halt_vagrant(self):
with Finally('I halt the vm'):
os.system('vagrant halt')<|docstring|>Halt the running vagrant VM.<|endoftext|> |
73bc547e014b5ddaf47e48bfe6983d85691d616691aded61773ad5ebe399efd1 | @commands.command(aliases=['p'])
async def ping(self, ctx):
"Get the bot's current websocket and API latency."
start_time = time.time()
message = (await ctx.send(embed=nextcord.Embed(title='Testing Ping...', color=nextcord.Color.random())))
end_time = time.time()
(await message.edit(embed=nextcord.E... | Get the bot's current websocket and API latency. | cogs/mod.py | ping | TechnoFrost27/MainesianUtilities | 0 | python | @commands.command(aliases=['p'])
async def ping(self, ctx):
start_time = time.time()
message = (await ctx.send(embed=nextcord.Embed(title='Testing Ping...', color=nextcord.Color.random())))
end_time = time.time()
(await message.edit(embed=nextcord.Embed(title=f'Latency: {round((self.bot.latency * 1... | @commands.command(aliases=['p'])
async def ping(self, ctx):
start_time = time.time()
message = (await ctx.send(embed=nextcord.Embed(title='Testing Ping...', color=nextcord.Color.random())))
end_time = time.time()
(await message.edit(embed=nextcord.Embed(title=f'Latency: {round((self.bot.latency * 1... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.