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
59302cb71ef1169f6f174cd91f58303c62f870619ddc1ab7f93fa2d0164ddb22
@property def next_lesson(self): '\n Evaluate what lesson is the next on curriculum. Iterate\n through the list of lessons for today. Compare the current\n time with each lesson start time, return the upcoming one.\n Adjust for calendar timezone with 2hrs. If no lesson is found\n ...
Evaluate what lesson is the next on curriculum. Iterate through the list of lessons for today. Compare the current time with each lesson start time, return the upcoming one. Adjust for calendar timezone with 2hrs. If no lesson is found for today, iterate over the entire sorted curriculum and return the first lesson tha...
source/schedule.py
next_lesson
gustavakerstrom99/RobBotTheRobot
0
python
@property def next_lesson(self): '\n Evaluate what lesson is the next on curriculum. Iterate\n through the list of lessons for today. Compare the current\n time with each lesson start time, return the upcoming one.\n Adjust for calendar timezone with 2hrs. If no lesson is found\n ...
@property def next_lesson(self): '\n Evaluate what lesson is the next on curriculum. Iterate\n through the list of lessons for today. Compare the current\n time with each lesson start time, return the upcoming one.\n Adjust for calendar timezone with 2hrs. If no lesson is found\n ...
592f6c6b42d75a45132eeff90d20ba2b7839c7022faa27ad0ad9b48efe71f776
def aggregate_returns(returns: ReturnsSeries, start_dates: Sequence[datetime], end_dates: Sequence[datetime]) -> Sequence[float]: '\n Aggregates returns using custom start dates and end dates.\n\n Parameters\n ----------\n returns: ReturnsSeries\n returns to be aggregated\n start_dates: Sequen...
Aggregates returns using custom start dates and end dates. Parameters ---------- returns: ReturnsSeries returns to be aggregated start_dates: Sequence[datetime] list of start dates for aggregations end_dates: Sequence[datetime] list of end dates for aggregations (of the same length as start_dates) Returns...
qf_lib/common/utils/returns/custom_returns_aggregating.py
aggregate_returns
webclinic017/qf-lib
198
python
def aggregate_returns(returns: ReturnsSeries, start_dates: Sequence[datetime], end_dates: Sequence[datetime]) -> Sequence[float]: '\n Aggregates returns using custom start dates and end dates.\n\n Parameters\n ----------\n returns: ReturnsSeries\n returns to be aggregated\n start_dates: Sequen...
def aggregate_returns(returns: ReturnsSeries, start_dates: Sequence[datetime], end_dates: Sequence[datetime]) -> Sequence[float]: '\n Aggregates returns using custom start dates and end dates.\n\n Parameters\n ----------\n returns: ReturnsSeries\n returns to be aggregated\n start_dates: Sequen...
0572d8c9bb9f768615d75ba0293692d957ea62c06b413c73fd54dd8f5287e1ee
def custom_series_aggregation(series: QFSeries, start_dates: Sequence[datetime], end_dates: Sequence[datetime], func: Callable) -> Sequence[float]: '\n Aggregates returns using custom start dates and end dates.\n\n Parameters\n ----------\n series\n returns or prices to be aggregated\n start_d...
Aggregates returns using custom start dates and end dates. Parameters ---------- series returns or prices to be aggregated start_dates list of start dates for aggregations end_dates list of end dates for aggregations (of the same length as start_dates) func function to be called on each slice of the da...
qf_lib/common/utils/returns/custom_returns_aggregating.py
custom_series_aggregation
webclinic017/qf-lib
198
python
def custom_series_aggregation(series: QFSeries, start_dates: Sequence[datetime], end_dates: Sequence[datetime], func: Callable) -> Sequence[float]: '\n Aggregates returns using custom start dates and end dates.\n\n Parameters\n ----------\n series\n returns or prices to be aggregated\n start_d...
def custom_series_aggregation(series: QFSeries, start_dates: Sequence[datetime], end_dates: Sequence[datetime], func: Callable) -> Sequence[float]: '\n Aggregates returns using custom start dates and end dates.\n\n Parameters\n ----------\n series\n returns or prices to be aggregated\n start_d...
8032f8024840cf97eda9a3a1a5193e3c4edd717ce8ea1c1abae4e67105521109
def test_rucio_version(self): 'CLIENT(USER): Rucio version' cmd = 'bin/rucio --version' (exitcode, out, err) = execute(cmd) nose.tools.assert_true(('rucio' in err))
CLIENT(USER): Rucio version
lib/rucio/tests/test_bin_rucio.py
test_rucio_version
efajardo/rucio
0
python
def test_rucio_version(self): cmd = 'bin/rucio --version' (exitcode, out, err) = execute(cmd) nose.tools.assert_true(('rucio' in err))
def test_rucio_version(self): cmd = 'bin/rucio --version' (exitcode, out, err) = execute(cmd) nose.tools.assert_true(('rucio' in err))<|docstring|>CLIENT(USER): Rucio version<|endoftext|>
ec63e5a1c87503df6542c64428ccff144ed8489aa615cd24373ca88809f5ead8
def test_rucio_ping(self): 'CLIENT(USER): Rucio ping' cmd = ('rucio --host %s ping' % self.host) print((self.marker + cmd)) (exitcode, out, err) = execute(cmd)
CLIENT(USER): Rucio ping
lib/rucio/tests/test_bin_rucio.py
test_rucio_ping
efajardo/rucio
0
python
def test_rucio_ping(self): cmd = ('rucio --host %s ping' % self.host) print((self.marker + cmd)) (exitcode, out, err) = execute(cmd)
def test_rucio_ping(self): cmd = ('rucio --host %s ping' % self.host) print((self.marker + cmd)) (exitcode, out, err) = execute(cmd)<|docstring|>CLIENT(USER): Rucio ping<|endoftext|>
48fa1cd187f11cc0c10d8e30845fba892cab61b9a1d7359f188acef51b17ca53
def test_add_account(self): 'CLIENT(ADMIN): Add account' tmp_val = account_name_generator() cmd = ('rucio-admin account add %s' % tmp_val) print((self.marker + cmd)) (exitcode, out, err) = execute(cmd) print(out) nose.tools.assert_equal(('Added new account: %s\n' % tmp_val), out)
CLIENT(ADMIN): Add account
lib/rucio/tests/test_bin_rucio.py
test_add_account
efajardo/rucio
0
python
def test_add_account(self): tmp_val = account_name_generator() cmd = ('rucio-admin account add %s' % tmp_val) print((self.marker + cmd)) (exitcode, out, err) = execute(cmd) print(out) nose.tools.assert_equal(('Added new account: %s\n' % tmp_val), out)
def test_add_account(self): tmp_val = account_name_generator() cmd = ('rucio-admin account add %s' % tmp_val) print((self.marker + cmd)) (exitcode, out, err) = execute(cmd) print(out) nose.tools.assert_equal(('Added new account: %s\n' % tmp_val), out)<|docstring|>CLIENT(ADMIN): Add account<...
3a082d1a0780d2d20d4ac13f278b55c962a05aa5fd5a6aba2bff90bf0db5d15f
def test_whoami(self): 'CLIENT(USER): Rucio whoami' cmd = 'rucio whoami' print((self.marker + cmd)) (exitcode, out, err) = execute(cmd) print(out) nose.tools.assert_regexp_matches(out, re.compile('.*account.*'))
CLIENT(USER): Rucio whoami
lib/rucio/tests/test_bin_rucio.py
test_whoami
efajardo/rucio
0
python
def test_whoami(self): cmd = 'rucio whoami' print((self.marker + cmd)) (exitcode, out, err) = execute(cmd) print(out) nose.tools.assert_regexp_matches(out, re.compile('.*account.*'))
def test_whoami(self): cmd = 'rucio whoami' print((self.marker + cmd)) (exitcode, out, err) = execute(cmd) print(out) nose.tools.assert_regexp_matches(out, re.compile('.*account.*'))<|docstring|>CLIENT(USER): Rucio whoami<|endoftext|>
e67038b7ea297f5e262d627f093d0a1355939d80ab204fabdb1d4d7e106bd043
def test_add_identity(self): 'CLIENT(ADMIN): Add identity' tmp_val = account_name_generator() cmd = ('rucio-admin account add %s' % tmp_val) (exitcode, out, err) = execute(cmd) nose.tools.assert_equal(('Added new account: %s\n' % tmp_val), out) cmd = ('rucio-admin identity add --account %s --typ...
CLIENT(ADMIN): Add identity
lib/rucio/tests/test_bin_rucio.py
test_add_identity
efajardo/rucio
0
python
def test_add_identity(self): tmp_val = account_name_generator() cmd = ('rucio-admin account add %s' % tmp_val) (exitcode, out, err) = execute(cmd) nose.tools.assert_equal(('Added new account: %s\n' % tmp_val), out) cmd = ('rucio-admin identity add --account %s --type GSS --id example@example.co...
def test_add_identity(self): tmp_val = account_name_generator() cmd = ('rucio-admin account add %s' % tmp_val) (exitcode, out, err) = execute(cmd) nose.tools.assert_equal(('Added new account: %s\n' % tmp_val), out) cmd = ('rucio-admin identity add --account %s --type GSS --id example@example.co...
8c54298f96a6790957b063e18b514a42a2bc61ed3575082f9868e311c820573b
def test_del_identity(self): 'CLIENT(ADMIN): Test del identity' tmp_acc = account_name_generator() cmd = ('rucio-admin account add %s' % tmp_acc) (exitcode, out, err) = execute(cmd) cmd = ('rucio-admin identity add --account %s --type GSS --id example@example.com --email example@example.com' % tmp_a...
CLIENT(ADMIN): Test del identity
lib/rucio/tests/test_bin_rucio.py
test_del_identity
efajardo/rucio
0
python
def test_del_identity(self): tmp_acc = account_name_generator() cmd = ('rucio-admin account add %s' % tmp_acc) (exitcode, out, err) = execute(cmd) cmd = ('rucio-admin identity add --account %s --type GSS --id example@example.com --email example@example.com' % tmp_acc) (exitcode, out, err) = exe...
def test_del_identity(self): tmp_acc = account_name_generator() cmd = ('rucio-admin account add %s' % tmp_acc) (exitcode, out, err) = execute(cmd) cmd = ('rucio-admin identity add --account %s --type GSS --id example@example.com --email example@example.com' % tmp_acc) (exitcode, out, err) = exe...
4ddcf926592e19633383f27044b11ba0f76e38d1bde6dbf31d82b264f7d831da
def test_attributes(self): 'CLIENT(ADMIN): Add/List/Delete attributes' tmp_acc = account_name_generator() cmd = ('rucio-admin account add %s' % tmp_acc) (exitcode, out, err) = execute(cmd) cmd = 'rucio-admin account add-attribute {0} --key test_attribute_key --value true'.format(tmp_acc) (exitco...
CLIENT(ADMIN): Add/List/Delete attributes
lib/rucio/tests/test_bin_rucio.py
test_attributes
efajardo/rucio
0
python
def test_attributes(self): tmp_acc = account_name_generator() cmd = ('rucio-admin account add %s' % tmp_acc) (exitcode, out, err) = execute(cmd) cmd = 'rucio-admin account add-attribute {0} --key test_attribute_key --value true'.format(tmp_acc) (exitcode, out, err) = execute(cmd) print(out)...
def test_attributes(self): tmp_acc = account_name_generator() cmd = ('rucio-admin account add %s' % tmp_acc) (exitcode, out, err) = execute(cmd) cmd = 'rucio-admin account add-attribute {0} --key test_attribute_key --value true'.format(tmp_acc) (exitcode, out, err) = execute(cmd) print(out)...
1ff36cd56a4683a6c01b885462477edd3e54a6f6b5b8f255f6960020d7dc8806
def test_add_scope(self): 'CLIENT(ADMIN): Add scope' tmp_scp = scope_name_generator() tmp_acc = account_name_generator() cmd = ('rucio-admin account add %s' % tmp_acc) (exitcode, out, err) = execute(cmd) cmd = ('rucio-admin scope add --account %s --scope %s' % (tmp_acc, tmp_scp)) print((self...
CLIENT(ADMIN): Add scope
lib/rucio/tests/test_bin_rucio.py
test_add_scope
efajardo/rucio
0
python
def test_add_scope(self): tmp_scp = scope_name_generator() tmp_acc = account_name_generator() cmd = ('rucio-admin account add %s' % tmp_acc) (exitcode, out, err) = execute(cmd) cmd = ('rucio-admin scope add --account %s --scope %s' % (tmp_acc, tmp_scp)) print((self.marker + cmd)) (exitc...
def test_add_scope(self): tmp_scp = scope_name_generator() tmp_acc = account_name_generator() cmd = ('rucio-admin account add %s' % tmp_acc) (exitcode, out, err) = execute(cmd) cmd = ('rucio-admin scope add --account %s --scope %s' % (tmp_acc, tmp_scp)) print((self.marker + cmd)) (exitc...
e40873880388780f409e6f411bf7fef51d8590b8e6ce9bf6c36cba8e33709902
def test_add_rse(self): 'CLIENT(ADMIN): Add RSE' tmp_val = rse_name_generator() cmd = ('rucio-admin rse add %s' % tmp_val) print((self.marker + cmd)) (exitcode, out, err) = execute(cmd) print(out) nose.tools.assert_equal(('Added new RSE: %s\n' % tmp_val), out)
CLIENT(ADMIN): Add RSE
lib/rucio/tests/test_bin_rucio.py
test_add_rse
efajardo/rucio
0
python
def test_add_rse(self): tmp_val = rse_name_generator() cmd = ('rucio-admin rse add %s' % tmp_val) print((self.marker + cmd)) (exitcode, out, err) = execute(cmd) print(out) nose.tools.assert_equal(('Added new RSE: %s\n' % tmp_val), out)
def test_add_rse(self): tmp_val = rse_name_generator() cmd = ('rucio-admin rse add %s' % tmp_val) print((self.marker + cmd)) (exitcode, out, err) = execute(cmd) print(out) nose.tools.assert_equal(('Added new RSE: %s\n' % tmp_val), out)<|docstring|>CLIENT(ADMIN): Add RSE<|endoftext|>
2b7721d5a44a2e7aba3b3723e984665c088b9162caa65f3832218a8023219632
def test_list_rses(self): 'CLIENT(ADMIN): List RSEs' tmp_val = rse_name_generator() cmd = ('rucio-admin rse add %s' % tmp_val) (exitcode, out, err) = execute(cmd) cmd = 'rucio-admin rse list' print((self.marker + cmd)) (exitcode, out, err) = execute(cmd) print(out) nose.tools.assert_...
CLIENT(ADMIN): List RSEs
lib/rucio/tests/test_bin_rucio.py
test_list_rses
efajardo/rucio
0
python
def test_list_rses(self): tmp_val = rse_name_generator() cmd = ('rucio-admin rse add %s' % tmp_val) (exitcode, out, err) = execute(cmd) cmd = 'rucio-admin rse list' print((self.marker + cmd)) (exitcode, out, err) = execute(cmd) print(out) nose.tools.assert_regexp_matches(out, re.com...
def test_list_rses(self): tmp_val = rse_name_generator() cmd = ('rucio-admin rse add %s' % tmp_val) (exitcode, out, err) = execute(cmd) cmd = 'rucio-admin rse list' print((self.marker + cmd)) (exitcode, out, err) = execute(cmd) print(out) nose.tools.assert_regexp_matches(out, re.com...
64b8531d1f7301da044962158b30c30514b2b162024d54f17d46a6432446bdb0
def test_upload(self): 'CLIENT(USER): Upload' tmp_val = rse_name_generator() cmd = ('rucio-admin rse add %s' % tmp_val) (exitcode, out, err) = execute(cmd) cmd = 'rucio upload' print((self.marker + cmd)) (exitcode, out, err) = execute(cmd) print(out)
CLIENT(USER): Upload
lib/rucio/tests/test_bin_rucio.py
test_upload
efajardo/rucio
0
python
def test_upload(self): tmp_val = rse_name_generator() cmd = ('rucio-admin rse add %s' % tmp_val) (exitcode, out, err) = execute(cmd) cmd = 'rucio upload' print((self.marker + cmd)) (exitcode, out, err) = execute(cmd) print(out)
def test_upload(self): tmp_val = rse_name_generator() cmd = ('rucio-admin rse add %s' % tmp_val) (exitcode, out, err) = execute(cmd) cmd = 'rucio upload' print((self.marker + cmd)) (exitcode, out, err) = execute(cmd) print(out)<|docstring|>CLIENT(USER): Upload<|endoftext|>
16acb73837455cad33c396b812c077f16ccb933816532cc6fbfb3a6c9a1f25b2
def test_download(self): 'CLIENT(USER): Download' cmd = 'rucio download' print((self.marker + cmd)) (exitcode, out, err) = execute(cmd) print(out)
CLIENT(USER): Download
lib/rucio/tests/test_bin_rucio.py
test_download
efajardo/rucio
0
python
def test_download(self): cmd = 'rucio download' print((self.marker + cmd)) (exitcode, out, err) = execute(cmd) print(out)
def test_download(self): cmd = 'rucio download' print((self.marker + cmd)) (exitcode, out, err) = execute(cmd) print(out)<|docstring|>CLIENT(USER): Download<|endoftext|>
c6658e5d1feb389fe22e4c0ce76c71fe4341b33af64b0b903c4af743eb841277
def test_upload_file(self): 'CLIENT(USER): Rucio upload files' tmp_file1 = file_generator() tmp_file2 = file_generator() tmp_file3 = file_generator() cmd = 'rucio -v upload --rse {0} --scope {1} {2} {3} {4}'.format(self.def_rse, self.user, tmp_file1, tmp_file2, tmp_file3) print((self.marker + cm...
CLIENT(USER): Rucio upload files
lib/rucio/tests/test_bin_rucio.py
test_upload_file
efajardo/rucio
0
python
def test_upload_file(self): tmp_file1 = file_generator() tmp_file2 = file_generator() tmp_file3 = file_generator() cmd = 'rucio -v upload --rse {0} --scope {1} {2} {3} {4}'.format(self.def_rse, self.user, tmp_file1, tmp_file2, tmp_file3) print((self.marker + cmd)) (exitcode, out, err) = exe...
def test_upload_file(self): tmp_file1 = file_generator() tmp_file2 = file_generator() tmp_file3 = file_generator() cmd = 'rucio -v upload --rse {0} --scope {1} {2} {3} {4}'.format(self.def_rse, self.user, tmp_file1, tmp_file2, tmp_file3) print((self.marker + cmd)) (exitcode, out, err) = exe...
67875a7960f80d31ea26fd94354b2fd6fb3a271038d785fc36e12ccdda373944
def test_upload_file_guid(self): 'CLIENT(USER): Rucio upload file with guid' tmp_file1 = file_generator() tmp_guid = generate_uuid() cmd = 'rucio -v upload --rse {0} --guid {1} --scope {2} {3}'.format(self.def_rse, tmp_guid, self.user, tmp_file1) print((self.marker + cmd)) (exitcode, out, err) =...
CLIENT(USER): Rucio upload file with guid
lib/rucio/tests/test_bin_rucio.py
test_upload_file_guid
efajardo/rucio
0
python
def test_upload_file_guid(self): tmp_file1 = file_generator() tmp_guid = generate_uuid() cmd = 'rucio -v upload --rse {0} --guid {1} --scope {2} {3}'.format(self.def_rse, tmp_guid, self.user, tmp_file1) print((self.marker + cmd)) (exitcode, out, err) = execute(cmd) print(out) print(err)...
def test_upload_file_guid(self): tmp_file1 = file_generator() tmp_guid = generate_uuid() cmd = 'rucio -v upload --rse {0} --guid {1} --scope {2} {3}'.format(self.def_rse, tmp_guid, self.user, tmp_file1) print((self.marker + cmd)) (exitcode, out, err) = execute(cmd) print(out) print(err)...
e6436865700c8a1db5b1563e4da22d7aab10c783e92bee0f70fbe24691fc132f
def test_upload_repeated_file(self): 'CLIENT(USER): Rucio upload repeated files' tmp_file1 = file_generator() tmp_file2 = file_generator() tmp_file3 = file_generator() tmp_file1_name = path.basename(tmp_file1) cmd = 'rucio -v upload --rse {0} --scope {1} {2}'.format(self.def_rse, self.user, tmp_...
CLIENT(USER): Rucio upload repeated files
lib/rucio/tests/test_bin_rucio.py
test_upload_repeated_file
efajardo/rucio
0
python
def test_upload_repeated_file(self): tmp_file1 = file_generator() tmp_file2 = file_generator() tmp_file3 = file_generator() tmp_file1_name = path.basename(tmp_file1) cmd = 'rucio -v upload --rse {0} --scope {1} {2}'.format(self.def_rse, self.user, tmp_file1) print((self.marker + cmd)) (...
def test_upload_repeated_file(self): tmp_file1 = file_generator() tmp_file2 = file_generator() tmp_file3 = file_generator() tmp_file1_name = path.basename(tmp_file1) cmd = 'rucio -v upload --rse {0} --scope {1} {2}'.format(self.def_rse, self.user, tmp_file1) print((self.marker + cmd)) (...
3846db2c774b7909c377dda87ab2908deae938587d973b165494dd0541024786
def test_upload_repeated_file_dataset(self): 'CLIENT(USER): Rucio upload repeated files to dataset' tmp_file1 = file_generator() tmp_file2 = file_generator() tmp_file3 = file_generator() tmp_file1_name = path.basename(tmp_file1) tmp_file3_name = path.basename(tmp_file3) tmp_dsn = ((self.user...
CLIENT(USER): Rucio upload repeated files to dataset
lib/rucio/tests/test_bin_rucio.py
test_upload_repeated_file_dataset
efajardo/rucio
0
python
def test_upload_repeated_file_dataset(self): tmp_file1 = file_generator() tmp_file2 = file_generator() tmp_file3 = file_generator() tmp_file1_name = path.basename(tmp_file1) tmp_file3_name = path.basename(tmp_file3) tmp_dsn = ((self.user + ':DSet') + rse_name_generator()) cmd = 'rucio -...
def test_upload_repeated_file_dataset(self): tmp_file1 = file_generator() tmp_file2 = file_generator() tmp_file3 = file_generator() tmp_file1_name = path.basename(tmp_file1) tmp_file3_name = path.basename(tmp_file3) tmp_dsn = ((self.user + ':DSet') + rse_name_generator()) cmd = 'rucio -...
63f43aafc5958e1b84b8ce40761745978a33b5cd23d0d37d988bab8631a7be0d
def test_upload_file_dataset(self): 'CLIENT(USER): Rucio upload files to dataset' tmp_file1 = file_generator() tmp_file2 = file_generator() tmp_file3 = file_generator() tmp_file1_name = path.basename(tmp_file1) tmp_dsn = ((self.user + ':DSet') + rse_name_generator()) cmd = 'rucio -v upload -...
CLIENT(USER): Rucio upload files to dataset
lib/rucio/tests/test_bin_rucio.py
test_upload_file_dataset
efajardo/rucio
0
python
def test_upload_file_dataset(self): tmp_file1 = file_generator() tmp_file2 = file_generator() tmp_file3 = file_generator() tmp_file1_name = path.basename(tmp_file1) tmp_dsn = ((self.user + ':DSet') + rse_name_generator()) cmd = 'rucio -v upload --rse {0} --scope {1} {2} {3} {4} {5}'.format(...
def test_upload_file_dataset(self): tmp_file1 = file_generator() tmp_file2 = file_generator() tmp_file3 = file_generator() tmp_file1_name = path.basename(tmp_file1) tmp_dsn = ((self.user + ':DSet') + rse_name_generator()) cmd = 'rucio -v upload --rse {0} --scope {1} {2} {3} {4} {5}'.format(...
543c71b51d4f04ad35fa22504d7a5a3f248d3360dc7f9460b804f501b004f0a5
def test_upload_adds_md5digest(self): 'CLIENT(USER): Upload Checksums' filename = file_generator() tmp_file1_name = path.basename(filename) file_md5 = md5(filename) cmd = 'rucio -v upload --rse {0} --scope {1} {2}'.format(self.def_rse, self.user, filename) print((self.marker + cmd)) (exitcod...
CLIENT(USER): Upload Checksums
lib/rucio/tests/test_bin_rucio.py
test_upload_adds_md5digest
efajardo/rucio
0
python
def test_upload_adds_md5digest(self): filename = file_generator() tmp_file1_name = path.basename(filename) file_md5 = md5(filename) cmd = 'rucio -v upload --rse {0} --scope {1} {2}'.format(self.def_rse, self.user, filename) print((self.marker + cmd)) (exitcode, out, err) = execute(cmd) ...
def test_upload_adds_md5digest(self): filename = file_generator() tmp_file1_name = path.basename(filename) file_md5 = md5(filename) cmd = 'rucio -v upload --rse {0} --scope {1} {2}'.format(self.def_rse, self.user, filename) print((self.marker + cmd)) (exitcode, out, err) = execute(cmd) ...
f8895e87649d4d06cd5460a2364bbc3640005d04c0ad8c52ecde691c98802a6f
def test_create_dataset(self): 'CLIENT(USER): Rucio add dataset' tmp_name = ((self.user + ':DSet') + rse_name_generator()) cmd = ('rucio add-dataset ' + tmp_name) print((self.marker + cmd)) (exitcode, out, err) = execute(cmd) print(out, err) nose.tools.assert_not_equal(re.search(('Added ' + ...
CLIENT(USER): Rucio add dataset
lib/rucio/tests/test_bin_rucio.py
test_create_dataset
efajardo/rucio
0
python
def test_create_dataset(self): tmp_name = ((self.user + ':DSet') + rse_name_generator()) cmd = ('rucio add-dataset ' + tmp_name) print((self.marker + cmd)) (exitcode, out, err) = execute(cmd) print(out, err) nose.tools.assert_not_equal(re.search(('Added ' + tmp_name), out), None)
def test_create_dataset(self): tmp_name = ((self.user + ':DSet') + rse_name_generator()) cmd = ('rucio add-dataset ' + tmp_name) print((self.marker + cmd)) (exitcode, out, err) = execute(cmd) print(out, err) nose.tools.assert_not_equal(re.search(('Added ' + tmp_name), out), None)<|docstring...
80aee02280908a5fe52efeb03c6c47ac59e43913d0603a36152d491244a4f7b0
def test_add_files_to_dataset(self): 'CLIENT(USER): Rucio add files to dataset' tmp_file1 = file_generator() tmp_file2 = file_generator() tmp_dataset = ((self.user + ':DSet') + rse_name_generator()) cmd = 'rucio upload --rse {0} --scope {1} {2} {3}'.format(self.def_rse, self.user, tmp_file1, tmp_fil...
CLIENT(USER): Rucio add files to dataset
lib/rucio/tests/test_bin_rucio.py
test_add_files_to_dataset
efajardo/rucio
0
python
def test_add_files_to_dataset(self): tmp_file1 = file_generator() tmp_file2 = file_generator() tmp_dataset = ((self.user + ':DSet') + rse_name_generator()) cmd = 'rucio upload --rse {0} --scope {1} {2} {3}'.format(self.def_rse, self.user, tmp_file1, tmp_file2) print((self.marker + cmd)) (ex...
def test_add_files_to_dataset(self): tmp_file1 = file_generator() tmp_file2 = file_generator() tmp_dataset = ((self.user + ':DSet') + rse_name_generator()) cmd = 'rucio upload --rse {0} --scope {1} {2} {3}'.format(self.def_rse, self.user, tmp_file1, tmp_file2) print((self.marker + cmd)) (ex...
c08fde31b8628649e01a2dcf5dcdf9231d0dc3d15a3690186c63e422c6d5857e
def test_download_file(self): 'CLIENT(USER): Rucio download files' tmp_file1 = file_generator() cmd = 'rucio upload --rse {0} --scope {1} {2}'.format(self.def_rse, self.user, tmp_file1) print((self.marker + cmd)) (exitcode, out, err) = execute(cmd) print(out, err) cmd = 'rucio -v download --...
CLIENT(USER): Rucio download files
lib/rucio/tests/test_bin_rucio.py
test_download_file
efajardo/rucio
0
python
def test_download_file(self): tmp_file1 = file_generator() cmd = 'rucio upload --rse {0} --scope {1} {2}'.format(self.def_rse, self.user, tmp_file1) print((self.marker + cmd)) (exitcode, out, err) = execute(cmd) print(out, err) cmd = 'rucio -v download --dir /tmp {0}:{1}'.format(self.user, ...
def test_download_file(self): tmp_file1 = file_generator() cmd = 'rucio upload --rse {0} --scope {1} {2}'.format(self.def_rse, self.user, tmp_file1) print((self.marker + cmd)) (exitcode, out, err) = execute(cmd) print(out, err) cmd = 'rucio -v download --dir /tmp {0}:{1}'.format(self.user, ...
94e95970e12c2aba32806636a0a576c041c636d3b4526bd5810cb2f631c6be90
def test_download_succeeds_md5only(self): 'CLIENT(USER): Rucio download succeeds MD5 only' filename = file_generator() file_md5 = md5(filename) filesize = stat(filename).st_size lfn = {'name': filename[5:], 'scope': self.user, 'bytes': filesize, 'md5': file_md5} self.replica_client.add_replicas(...
CLIENT(USER): Rucio download succeeds MD5 only
lib/rucio/tests/test_bin_rucio.py
test_download_succeeds_md5only
efajardo/rucio
0
python
def test_download_succeeds_md5only(self): filename = file_generator() file_md5 = md5(filename) filesize = stat(filename).st_size lfn = {'name': filename[5:], 'scope': self.user, 'bytes': filesize, 'md5': file_md5} self.replica_client.add_replicas(files=[lfn], rse=self.def_rse) rse_settings ...
def test_download_succeeds_md5only(self): filename = file_generator() file_md5 = md5(filename) filesize = stat(filename).st_size lfn = {'name': filename[5:], 'scope': self.user, 'bytes': filesize, 'md5': file_md5} self.replica_client.add_replicas(files=[lfn], rse=self.def_rse) rse_settings ...
2dda0f28d0822e4de91e56b80f418882cdf1c3479d877a504d79fdd51e325e15
def test_download_fails_badmd5(self): 'CLIENT(USER): Rucio download fails on MD5 mismatch' filename = file_generator() file_md5 = md5(filename) filesize = stat(filename).st_size lfn = {'name': filename[5:], 'scope': self.user, 'bytes': filesize, 'md5': '0123456789abcdef0123456789abcdef'} self.re...
CLIENT(USER): Rucio download fails on MD5 mismatch
lib/rucio/tests/test_bin_rucio.py
test_download_fails_badmd5
efajardo/rucio
0
python
def test_download_fails_badmd5(self): filename = file_generator() file_md5 = md5(filename) filesize = stat(filename).st_size lfn = {'name': filename[5:], 'scope': self.user, 'bytes': filesize, 'md5': '0123456789abcdef0123456789abcdef'} self.replica_client.add_replicas(files=[lfn], rse=self.def_...
def test_download_fails_badmd5(self): filename = file_generator() file_md5 = md5(filename) filesize = stat(filename).st_size lfn = {'name': filename[5:], 'scope': self.user, 'bytes': filesize, 'md5': '0123456789abcdef0123456789abcdef'} self.replica_client.add_replicas(files=[lfn], rse=self.def_...
e68642f9823aeb8824305b60ea1b6d1fdc73b43edd7d2c4acde98e67b0d594b3
def test_download_dataset(self): 'CLIENT(USER): Rucio download dataset' tmp_file1 = file_generator() tmp_dataset = ((self.user + ':DSet') + rse_name_generator()) cmd = 'rucio upload --rse {0} --scope {1} {2}'.format(self.def_rse, self.user, tmp_file1) print((self.marker + cmd)) (exitcode, out, e...
CLIENT(USER): Rucio download dataset
lib/rucio/tests/test_bin_rucio.py
test_download_dataset
efajardo/rucio
0
python
def test_download_dataset(self): tmp_file1 = file_generator() tmp_dataset = ((self.user + ':DSet') + rse_name_generator()) cmd = 'rucio upload --rse {0} --scope {1} {2}'.format(self.def_rse, self.user, tmp_file1) print((self.marker + cmd)) (exitcode, out, err) = execute(cmd) print(out, err)...
def test_download_dataset(self): tmp_file1 = file_generator() tmp_dataset = ((self.user + ':DSet') + rse_name_generator()) cmd = 'rucio upload --rse {0} --scope {1} {2}'.format(self.def_rse, self.user, tmp_file1) print((self.marker + cmd)) (exitcode, out, err) = execute(cmd) print(out, err)...
30a0aab1b3473899ac81450fead0a0068ed0073b9602bf0bfa579792a992be95
def test_create_rule(self): 'CLIENT(USER): Rucio add rule' tmp_file1 = file_generator() cmd = 'rucio upload --rse {0} --scope {1} {2}'.format(self.def_rse, self.user, tmp_file1) print((self.marker + cmd)) (exitcode, out, err) = execute(cmd) print(out, err) tmp_rse = rse_name_generator() ...
CLIENT(USER): Rucio add rule
lib/rucio/tests/test_bin_rucio.py
test_create_rule
efajardo/rucio
0
python
def test_create_rule(self): tmp_file1 = file_generator() cmd = 'rucio upload --rse {0} --scope {1} {2}'.format(self.def_rse, self.user, tmp_file1) print((self.marker + cmd)) (exitcode, out, err) = execute(cmd) print(out, err) tmp_rse = rse_name_generator() cmd = 'rucio-admin rse add {0}...
def test_create_rule(self): tmp_file1 = file_generator() cmd = 'rucio upload --rse {0} --scope {1} {2}'.format(self.def_rse, self.user, tmp_file1) print((self.marker + cmd)) (exitcode, out, err) = execute(cmd) print(out, err) tmp_rse = rse_name_generator() cmd = 'rucio-admin rse add {0}...
0f4f4afd8d454aeb425e73e230dfa88fc056f134271ceddf3b5f19beb8b0afc9
def test_delete_rule(self): 'CLIENT(USER): rule deletion' self.account_client.set_account_limit('root', self.def_rse, (- 1)) tmp_file1 = file_generator() cmd = 'rucio upload --rse {0} --scope {1} {2}'.format(self.def_rse, self.user, tmp_file1) print((self.marker + cmd)) (exitcode, out, err) = ex...
CLIENT(USER): rule deletion
lib/rucio/tests/test_bin_rucio.py
test_delete_rule
efajardo/rucio
0
python
def test_delete_rule(self): self.account_client.set_account_limit('root', self.def_rse, (- 1)) tmp_file1 = file_generator() cmd = 'rucio upload --rse {0} --scope {1} {2}'.format(self.def_rse, self.user, tmp_file1) print((self.marker + cmd)) (exitcode, out, err) = execute(cmd) print(out, err...
def test_delete_rule(self): self.account_client.set_account_limit('root', self.def_rse, (- 1)) tmp_file1 = file_generator() cmd = 'rucio upload --rse {0} --scope {1} {2}'.format(self.def_rse, self.user, tmp_file1) print((self.marker + cmd)) (exitcode, out, err) = execute(cmd) print(out, err...
3f8c099a61e5a6d3b495c3064894a667b12cc4b45634a99f35d6f03bcaeec41f
def test_add_file_twice(self): 'CLIENT(USER): Add file twice' tmp_file1 = file_generator() cmd = 'rucio upload --rse {0} --scope {1} {2}'.format(self.def_rse, self.user, tmp_file1) print((self.marker + cmd)) (exitcode, out, err) = execute(cmd) cmd = 'rucio upload --rse {0} --scope {1} {2}'.forma...
CLIENT(USER): Add file twice
lib/rucio/tests/test_bin_rucio.py
test_add_file_twice
efajardo/rucio
0
python
def test_add_file_twice(self): tmp_file1 = file_generator() cmd = 'rucio upload --rse {0} --scope {1} {2}'.format(self.def_rse, self.user, tmp_file1) print((self.marker + cmd)) (exitcode, out, err) = execute(cmd) cmd = 'rucio upload --rse {0} --scope {1} {2}'.format(self.def_rse, self.user, tmp...
def test_add_file_twice(self): tmp_file1 = file_generator() cmd = 'rucio upload --rse {0} --scope {1} {2}'.format(self.def_rse, self.user, tmp_file1) print((self.marker + cmd)) (exitcode, out, err) = execute(cmd) cmd = 'rucio upload --rse {0} --scope {1} {2}'.format(self.def_rse, self.user, tmp...
301cf795bf90d38a853a291d61d9cde918ac89bc56244bf136ccfdb60b25f9d8
def test_add_delete_add_file(self): 'CLIENT(USER): Add/Delete/Add' tmp_file1 = file_generator() cmd = 'rucio upload --rse {0} --scope {1} {2}'.format(self.def_rse, self.user, tmp_file1) print((self.marker + cmd)) (exitcode, out, err) = execute(cmd) print(out, err) cmd = 'rucio list-rules {0}...
CLIENT(USER): Add/Delete/Add
lib/rucio/tests/test_bin_rucio.py
test_add_delete_add_file
efajardo/rucio
0
python
def test_add_delete_add_file(self): tmp_file1 = file_generator() cmd = 'rucio upload --rse {0} --scope {1} {2}'.format(self.def_rse, self.user, tmp_file1) print((self.marker + cmd)) (exitcode, out, err) = execute(cmd) print(out, err) cmd = 'rucio list-rules {0}:{1} | grep {0}:{1} | cut -f1 ...
def test_add_delete_add_file(self): tmp_file1 = file_generator() cmd = 'rucio upload --rse {0} --scope {1} {2}'.format(self.def_rse, self.user, tmp_file1) print((self.marker + cmd)) (exitcode, out, err) = execute(cmd) print(out, err) cmd = 'rucio list-rules {0}:{1} | grep {0}:{1} | cut -f1 ...
50984380c7403d97d546963963680c0774438bdeb2cbc716d3710edf523f902e
def test_attach_files_dataset(self): 'CLIENT(USER): Rucio attach files to dataset' tmp_file1 = file_generator() tmp_file2 = file_generator() tmp_file3 = file_generator() tmp_dsn = ((self.user + ':DSet') + rse_name_generator()) cmd = 'rucio upload --rse {0} --scope {1} {2} {3}'.format(self.def_rs...
CLIENT(USER): Rucio attach files to dataset
lib/rucio/tests/test_bin_rucio.py
test_attach_files_dataset
efajardo/rucio
0
python
def test_attach_files_dataset(self): tmp_file1 = file_generator() tmp_file2 = file_generator() tmp_file3 = file_generator() tmp_dsn = ((self.user + ':DSet') + rse_name_generator()) cmd = 'rucio upload --rse {0} --scope {1} {2} {3}'.format(self.def_rse, self.user, tmp_file1, tmp_dsn) print((...
def test_attach_files_dataset(self): tmp_file1 = file_generator() tmp_file2 = file_generator() tmp_file3 = file_generator() tmp_dsn = ((self.user + ':DSet') + rse_name_generator()) cmd = 'rucio upload --rse {0} --scope {1} {2} {3}'.format(self.def_rse, self.user, tmp_file1, tmp_dsn) print((...
27ff7369e02cdcd0544987565c809db4dc032dbb67904be0857a20b6c8f82fd6
def test_detach_files_dataset(self): 'CLIENT(USER): Rucio detach files to dataset' tmp_file1 = file_generator() tmp_file2 = file_generator() tmp_file3 = file_generator() tmp_dsn = ((self.user + ':DSet') + rse_name_generator()) cmd = 'rucio upload --rse {0} --scope {1} {2} {3} {4} {5}'.format(sel...
CLIENT(USER): Rucio detach files to dataset
lib/rucio/tests/test_bin_rucio.py
test_detach_files_dataset
efajardo/rucio
0
python
def test_detach_files_dataset(self): tmp_file1 = file_generator() tmp_file2 = file_generator() tmp_file3 = file_generator() tmp_dsn = ((self.user + ':DSet') + rse_name_generator()) cmd = 'rucio upload --rse {0} --scope {1} {2} {3} {4} {5}'.format(self.def_rse, self.user, tmp_file1, tmp_file2, t...
def test_detach_files_dataset(self): tmp_file1 = file_generator() tmp_file2 = file_generator() tmp_file3 = file_generator() tmp_dsn = ((self.user + ':DSet') + rse_name_generator()) cmd = 'rucio upload --rse {0} --scope {1} {2} {3} {4} {5}'.format(self.def_rse, self.user, tmp_file1, tmp_file2, t...
5950111e81135d118d4f9d5d4dbd2eacb78bccfd7d10813e666a50451b06dfa8
def test_attach_file_twice(self): 'CLIENT(USER): Rucio attach a file twice' tmp_file1 = file_generator() tmp_dsn = ((self.user + ':DSet') + rse_name_generator()) cmd = 'rucio upload --rse {0} --scope {1} {2} {3}'.format(self.def_rse, self.user, tmp_file1, tmp_dsn) print((self.marker + cmd)) (exi...
CLIENT(USER): Rucio attach a file twice
lib/rucio/tests/test_bin_rucio.py
test_attach_file_twice
efajardo/rucio
0
python
def test_attach_file_twice(self): tmp_file1 = file_generator() tmp_dsn = ((self.user + ':DSet') + rse_name_generator()) cmd = 'rucio upload --rse {0} --scope {1} {2} {3}'.format(self.def_rse, self.user, tmp_file1, tmp_dsn) print((self.marker + cmd)) (exitcode, out, err) = execute(cmd) print...
def test_attach_file_twice(self): tmp_file1 = file_generator() tmp_dsn = ((self.user + ':DSet') + rse_name_generator()) cmd = 'rucio upload --rse {0} --scope {1} {2} {3}'.format(self.def_rse, self.user, tmp_file1, tmp_dsn) print((self.marker + cmd)) (exitcode, out, err) = execute(cmd) print...
570e92104c3e3e2fe1950c408386b10f4ac62a90864399e2cf08f9af22e2ffef
def test_detach_non_existing_file(self): 'CLIENT(USER): Rucio detach a non existing file' tmp_file1 = file_generator() tmp_dsn = ((self.user + ':DSet') + rse_name_generator()) cmd = 'rucio upload --rse {0} --scope {1} {2} {3}'.format(self.def_rse, self.user, tmp_file1, tmp_dsn) print((self.marker + ...
CLIENT(USER): Rucio detach a non existing file
lib/rucio/tests/test_bin_rucio.py
test_detach_non_existing_file
efajardo/rucio
0
python
def test_detach_non_existing_file(self): tmp_file1 = file_generator() tmp_dsn = ((self.user + ':DSet') + rse_name_generator()) cmd = 'rucio upload --rse {0} --scope {1} {2} {3}'.format(self.def_rse, self.user, tmp_file1, tmp_dsn) print((self.marker + cmd)) (exitcode, out, err) = execute(cmd) ...
def test_detach_non_existing_file(self): tmp_file1 = file_generator() tmp_dsn = ((self.user + ':DSet') + rse_name_generator()) cmd = 'rucio upload --rse {0} --scope {1} {2} {3}'.format(self.def_rse, self.user, tmp_file1, tmp_dsn) print((self.marker + cmd)) (exitcode, out, err) = execute(cmd) ...
05322c720401f1a738578fffb6fd9943118d246032a45264ab3c067fbea801af
def __init__(self) -> None: '\n Instantiates the endpoint to update a unit in the database table unit.\n ' self.reqparser = reqparse.RequestParser() self.reqparser.add_argument('symbol', required=True, type=str, location=['form', 'json']) self.reqparser.add_argument('new_symbol', required=...
Instantiates the endpoint to update a unit in the database table unit.
Analytics/resources/units/update_unit.py
__init__
thanosbnt/SharingCitiesDashboard
4
python
def __init__(self) -> None: '\n \n ' self.reqparser = reqparse.RequestParser() self.reqparser.add_argument('symbol', required=True, type=str, location=['form', 'json']) self.reqparser.add_argument('new_symbol', required=False, type=str, location=['form', 'json']) self.reqparser.add_arg...
def __init__(self) -> None: '\n \n ' self.reqparser = reqparse.RequestParser() self.reqparser.add_argument('symbol', required=True, type=str, location=['form', 'json']) self.reqparser.add_argument('new_symbol', required=False, type=str, location=['form', 'json']) self.reqparser.add_arg...
52e532faacf5043e86ea22d5293723d74a107c7916716193c9e211818ddf28b2
@jwt_required def post(self) -> ({'message': str, 'symbol': str, 'description': str}, HTTPStatus): "\n Fetches a specified unit instance from the database by its symbol and updates the symbol and/or the description\n :post:\n :arg symbol: Symbol string of the unit eg 'kg'\n :a...
Fetches a specified unit instance from the database by its symbol and updates the symbol and/or the description :post: :arg symbol: Symbol string of the unit eg 'kg' :arg symbol: The new symbol string of the unit eg 'kg' :arg new_description: The new description of the unit :type symbol: ...
Analytics/resources/units/update_unit.py
post
thanosbnt/SharingCitiesDashboard
4
python
@jwt_required def post(self) -> ({'message': str, 'symbol': str, 'description': str}, HTTPStatus): "\n Fetches a specified unit instance from the database by its symbol and updates the symbol and/or the description\n :post:\n :arg symbol: Symbol string of the unit eg 'kg'\n :a...
@jwt_required def post(self) -> ({'message': str, 'symbol': str, 'description': str}, HTTPStatus): "\n Fetches a specified unit instance from the database by its symbol and updates the symbol and/or the description\n :post:\n :arg symbol: Symbol string of the unit eg 'kg'\n :a...
e55db34744d6ffea4c024cac92f991ebd4a121e73b2b0d648e1c42ec0a27f242
def getIdentifiers(self): "Return a dictionary of related identifiers organized by branched entity id.\n\n Returns:\n (dict): {entityId: {'idType1': ids, 'idType1': ids}, ... }\n " try: return (self.__glyD['identifiers'] if self.__glyD['identifiers'] else {}) except Exceptio...
Return a dictionary of related identifiers organized by branched entity id. Returns: (dict): {entityId: {'idType1': ids, 'idType1': ids}, ... }
rcsb/exdb/branch/GlycanProvider.py
getIdentifiers
rcsb/py-rcsb_exdb
0
python
def getIdentifiers(self): "Return a dictionary of related identifiers organized by branched entity id.\n\n Returns:\n (dict): {entityId: {'idType1': ids, 'idType1': ids}, ... }\n " try: return (self.__glyD['identifiers'] if self.__glyD['identifiers'] else {}) except Exceptio...
def getIdentifiers(self): "Return a dictionary of related identifiers organized by branched entity id.\n\n Returns:\n (dict): {entityId: {'idType1': ids, 'idType1': ids}, ... }\n " try: return (self.__glyD['identifiers'] if self.__glyD['identifiers'] else {}) except Exceptio...
79b4a7b8d5746524a07b984cb5cf8723c6c493f7346bb3450a27c23021d142cc
def update(self, cfgOb, fmt='json', indent=3): 'Update branched entity glycan accession mapping cache.\n\n Args:\n cfgObj (object): ConfigInfo() object instance\n\n Returns:\n (bool): True for success for False otherwise\n ' ok = False try: gU = GlycanUtils...
Update branched entity glycan accession mapping cache. Args: cfgObj (object): ConfigInfo() object instance Returns: (bool): True for success for False otherwise
rcsb/exdb/branch/GlycanProvider.py
update
rcsb/py-rcsb_exdb
0
python
def update(self, cfgOb, fmt='json', indent=3): 'Update branched entity glycan accession mapping cache.\n\n Args:\n cfgObj (object): ConfigInfo() object instance\n\n Returns:\n (bool): True for success for False otherwise\n ' ok = False try: gU = GlycanUtils...
def update(self, cfgOb, fmt='json', indent=3): 'Update branched entity glycan accession mapping cache.\n\n Args:\n cfgObj (object): ConfigInfo() object instance\n\n Returns:\n (bool): True for success for False otherwise\n ' ok = False try: gU = GlycanUtils...
41330cf3b566d6b1bd716fa34fb9fd3a4be5d72f8b596b6d74f0a950b613c861
def reload(self): 'Reload from the current cache file.' ok = False try: self.__glyD = self.__reload(fmt='json', useCache=True) ok = (self.__glyD is not None) except Exception as e: logger.exception('Failing with %s', str(e)) return ok
Reload from the current cache file.
rcsb/exdb/branch/GlycanProvider.py
reload
rcsb/py-rcsb_exdb
0
python
def reload(self): ok = False try: self.__glyD = self.__reload(fmt='json', useCache=True) ok = (self.__glyD is not None) except Exception as e: logger.exception('Failing with %s', str(e)) return ok
def reload(self): ok = False try: self.__glyD = self.__reload(fmt='json', useCache=True) ok = (self.__glyD is not None) except Exception as e: logger.exception('Failing with %s', str(e)) return ok<|docstring|>Reload from the current cache file.<|endoftext|>
febf0e18fe24aaca08290d999809905d9807845c4393652ed2b429f1017a86cb
def decrypt_p7s(data: bytes) -> str: '\n openssl cms -verify -in xxx.p7s -inform DER -noverify -outform DER -signer cert.pem -print\n ' p7 = crypto.load_pkcs7_data(crypto.FILETYPE_ASN1, BytesIO(data).getvalue()) bio_out = crypto._new_mem_buf() _lib.PKCS7_verify(p7._pkcs7, _ffi.NULL, _ffi.NULL, _ff...
openssl cms -verify -in xxx.p7s -inform DER -noverify -outform DER -signer cert.pem -print
projects/data_lake/hadoop_airflow/data-pipeline/src/security/decrypt_data.py
decrypt_p7s
brunocampos01/job-challenges
10
python
def decrypt_p7s(data: bytes) -> str: '\n \n ' p7 = crypto.load_pkcs7_data(crypto.FILETYPE_ASN1, BytesIO(data).getvalue()) bio_out = crypto._new_mem_buf() _lib.PKCS7_verify(p7._pkcs7, _ffi.NULL, _ffi.NULL, _ffi.NULL, bio_out, _lib.PKCS7_NOVERIFY) return crypto._bio_to_string(bio_out)
def decrypt_p7s(data: bytes) -> str: '\n \n ' p7 = crypto.load_pkcs7_data(crypto.FILETYPE_ASN1, BytesIO(data).getvalue()) bio_out = crypto._new_mem_buf() _lib.PKCS7_verify(p7._pkcs7, _ffi.NULL, _ffi.NULL, _ffi.NULL, bio_out, _lib.PKCS7_NOVERIFY) return crypto._bio_to_string(bio_out)<|docstring...
b65aa97b25d1c20f749dfb23d317240c380ade7e6e222959992677fcd861fe7f
def decrypt_p7b(data: bytes) -> str: '\n openssl pkcs7 -inform DER -outform PEM -in xxx.p7b -print\n ' with tempfile.NamedTemporaryFile() as temp: temp.write(data) temp.flush() return subprocess.check_output(['openssl', 'pkcs7', '-inform', 'DER', '-outform', 'PEM', '-in', temp.name...
openssl pkcs7 -inform DER -outform PEM -in xxx.p7b -print
projects/data_lake/hadoop_airflow/data-pipeline/src/security/decrypt_data.py
decrypt_p7b
brunocampos01/job-challenges
10
python
def decrypt_p7b(data: bytes) -> str: '\n \n ' with tempfile.NamedTemporaryFile() as temp: temp.write(data) temp.flush() return subprocess.check_output(['openssl', 'pkcs7', '-inform', 'DER', '-outform', 'PEM', '-in', temp.name, '-print']).decode('ISO-8859-1')
def decrypt_p7b(data: bytes) -> str: '\n \n ' with tempfile.NamedTemporaryFile() as temp: temp.write(data) temp.flush() return subprocess.check_output(['openssl', 'pkcs7', '-inform', 'DER', '-outform', 'PEM', '-in', temp.name, '-print']).decode('ISO-8859-1')<|docstring|>openssl pkc...
e9ffcda5a903ae5bdc3487382ea4acacde34dd07ffa57946dcffc39cc8c74b7c
def set_mutations(cls, mutations_string, comparator): 'Requires string MutataionsString and MutationComparator' cls.mutations = mutations_string.split(',') if (not comparator.are_mutations_valid(cls.mutations)): raise Exception(('Mutations are not valid %s' % cls.mutations_string))
Requires string MutataionsString and MutationComparator
Asi/test/test_xml_definitions.py
set_mutations
phac-nml/asipython
1
python
def set_mutations(cls, mutations_string, comparator): cls.mutations = mutations_string.split(',') if (not comparator.are_mutations_valid(cls.mutations)): raise Exception(('Mutations are not valid %s' % cls.mutations_string))
def set_mutations(cls, mutations_string, comparator): cls.mutations = mutations_string.split(',') if (not comparator.are_mutations_valid(cls.mutations)): raise Exception(('Mutations are not valid %s' % cls.mutations_string))<|docstring|>Requires string MutataionsString and MutationComparator<|endof...
f04db59a67c3b9a595ac73be6ddbd5c706e1a5a92f8ace7972a92ebf9e03ba75
def test_overlapping_ranges(self): 'Test overlapping ranges' try: transformer = XmlAsiTransformer(False) fd = open(os.path.join(self.module_path, 'test/data/HIVDB_overlappingRanges.xml'), 'r') transformer.transform(fd) except AsiParsingException as e: print(('test_overLapping...
Test overlapping ranges
Asi/test/test_xml_definitions.py
test_overlapping_ranges
phac-nml/asipython
1
python
def test_overlapping_ranges(self): try: transformer = XmlAsiTransformer(False) fd = open(os.path.join(self.module_path, 'test/data/HIVDB_overlappingRanges.xml'), 'r') transformer.transform(fd) except AsiParsingException as e: print(('test_overLapping_ranges:\n\t%s' % str(e))...
def test_overlapping_ranges(self): try: transformer = XmlAsiTransformer(False) fd = open(os.path.join(self.module_path, 'test/data/HIVDB_overlappingRanges.xml'), 'r') transformer.transform(fd) except AsiParsingException as e: print(('test_overLapping_ranges:\n\t%s' % str(e))...
2e03cd22ef77e8577119efd249827014ad4661a25d15038133b4817b8349a2f0
def test_multiple_global_range_tags(self): 'Test multiple global range tags' try: transformer = XmlAsiTransformer(self.validate_xml) fd = open(os.path.join(self.module_path, 'test/data/HIVDB_multipleGlobalRangeTags.xml'), 'r') transformer.transform(fd) except AsiParsingException as e...
Test multiple global range tags
Asi/test/test_xml_definitions.py
test_multiple_global_range_tags
phac-nml/asipython
1
python
def test_multiple_global_range_tags(self): try: transformer = XmlAsiTransformer(self.validate_xml) fd = open(os.path.join(self.module_path, 'test/data/HIVDB_multipleGlobalRangeTags.xml'), 'r') transformer.transform(fd) except AsiParsingException as e: print(('test_multiple_g...
def test_multiple_global_range_tags(self): try: transformer = XmlAsiTransformer(self.validate_xml) fd = open(os.path.join(self.module_path, 'test/data/HIVDB_multipleGlobalRangeTags.xml'), 'r') transformer.transform(fd) except AsiParsingException as e: print(('test_multiple_g...
30bb4a41c7ed0183c9fd7847e45082f9c06ee5d8f3732a68706066bb1a652189
def test_missing_drug_class_name(self): 'Test missing drug class name' try: transformer = XmlAsiTransformer(self.validate_xml) fd = open(os.path.join(self.module_path, 'test/data/HIVDB_missingDrugClassName.xml'), 'r') transformer.transform(fd) except AsiParsingException as e: ...
Test missing drug class name
Asi/test/test_xml_definitions.py
test_missing_drug_class_name
phac-nml/asipython
1
python
def test_missing_drug_class_name(self): try: transformer = XmlAsiTransformer(self.validate_xml) fd = open(os.path.join(self.module_path, 'test/data/HIVDB_missingDrugClassName.xml'), 'r') transformer.transform(fd) except AsiParsingException as e: print(('test_missing_drug_cla...
def test_missing_drug_class_name(self): try: transformer = XmlAsiTransformer(self.validate_xml) fd = open(os.path.join(self.module_path, 'test/data/HIVDB_missingDrugClassName.xml'), 'r') transformer.transform(fd) except AsiParsingException as e: print(('test_missing_drug_cla...
2e9436bba0d36995ebbe9061c7dee9df03196fa9aa7e635c89de8b0ab24a9c15
def test_missing_drug_class_name_alg_info(self): 'Test missing drug class name. Using get_algorithm_info' try: transformer = XmlAsiTransformer(self.validate_xml) fd = open(os.path.join(self.module_path, 'test/data/HIVDB_missingDrugClassName.xml'), 'r') transformer.get_algorithm_info(fd) ...
Test missing drug class name. Using get_algorithm_info
Asi/test/test_xml_definitions.py
test_missing_drug_class_name_alg_info
phac-nml/asipython
1
python
def test_missing_drug_class_name_alg_info(self): try: transformer = XmlAsiTransformer(self.validate_xml) fd = open(os.path.join(self.module_path, 'test/data/HIVDB_missingDrugClassName.xml'), 'r') transformer.get_algorithm_info(fd) except AsiParsingException as e: print(('tes...
def test_missing_drug_class_name_alg_info(self): try: transformer = XmlAsiTransformer(self.validate_xml) fd = open(os.path.join(self.module_path, 'test/data/HIVDB_missingDrugClassName.xml'), 'r') transformer.get_algorithm_info(fd) except AsiParsingException as e: print(('tes...
f53ef8e024eb1c764b3373c9c65ea100e6603daa33b6a032263301faade3f58a
def test_missing_drug_class_drug_list(self): 'Test missing drug class drug list' try: transformer = XmlAsiTransformer(self.validate_xml) fd = open(os.path.join(self.module_path, 'test/data/HIVDB_missingDrugClassDrugList.xml'), 'r') transformer.transform(fd) except AsiParsingException...
Test missing drug class drug list
Asi/test/test_xml_definitions.py
test_missing_drug_class_drug_list
phac-nml/asipython
1
python
def test_missing_drug_class_drug_list(self): try: transformer = XmlAsiTransformer(self.validate_xml) fd = open(os.path.join(self.module_path, 'test/data/HIVDB_missingDrugClassDrugList.xml'), 'r') transformer.transform(fd) except AsiParsingException as e: print(('test_missing...
def test_missing_drug_class_drug_list(self): try: transformer = XmlAsiTransformer(self.validate_xml) fd = open(os.path.join(self.module_path, 'test/data/HIVDB_missingDrugClassDrugList.xml'), 'r') transformer.transform(fd) except AsiParsingException as e: print(('test_missing...
41ad89105213b4ecffd8720f5c5d13c5440a7cc7eb23e753a361d3e8f3ec65f4
def test_missing_drug_class_drug_list_alg_info(self): 'Test missing drug class drug list. Using get_algorithm_info' try: transformer = XmlAsiTransformer(self.validate_xml) fd = open(os.path.join(self.module_path, 'test/data/HIVDB_missingDrugClassDrugList.xml'), 'r') transformer.get_algor...
Test missing drug class drug list. Using get_algorithm_info
Asi/test/test_xml_definitions.py
test_missing_drug_class_drug_list_alg_info
phac-nml/asipython
1
python
def test_missing_drug_class_drug_list_alg_info(self): try: transformer = XmlAsiTransformer(self.validate_xml) fd = open(os.path.join(self.module_path, 'test/data/HIVDB_missingDrugClassDrugList.xml'), 'r') transformer.get_algorithm_info(fd) except AsiParsingException as e: pr...
def test_missing_drug_class_drug_list_alg_info(self): try: transformer = XmlAsiTransformer(self.validate_xml) fd = open(os.path.join(self.module_path, 'test/data/HIVDB_missingDrugClassDrugList.xml'), 'r') transformer.get_algorithm_info(fd) except AsiParsingException as e: pr...
67623abc3cfad7fbd565563cf12bd6c20deb91de597ca2d5a8b2e33438b4d5e0
def test_multiple_comment_definition_tags(self): 'Test multiple comment definition tags' try: transformer = XmlAsiTransformer(self.validate_xml) fd = open(os.path.join(self.module_path, 'test/data/HIVDB_multipleCommentDefinitionTags.xml'), 'r') transformer.transform(fd) except AsiPar...
Test multiple comment definition tags
Asi/test/test_xml_definitions.py
test_multiple_comment_definition_tags
phac-nml/asipython
1
python
def test_multiple_comment_definition_tags(self): try: transformer = XmlAsiTransformer(self.validate_xml) fd = open(os.path.join(self.module_path, 'test/data/HIVDB_multipleCommentDefinitionTags.xml'), 'r') transformer.transform(fd) except AsiParsingException as e: print(('tes...
def test_multiple_comment_definition_tags(self): try: transformer = XmlAsiTransformer(self.validate_xml) fd = open(os.path.join(self.module_path, 'test/data/HIVDB_multipleCommentDefinitionTags.xml'), 'r') transformer.transform(fd) except AsiParsingException as e: print(('tes...
1aebea5d2b7f1387ad24ca24835412f0b69dd4aa4ced4d3463c34d2cab9f0b93
def test_multiple_comment_definition_tags_alg_info(self): 'Test multiple comment definition tags. Using get_algorithm_info' try: transformer = XmlAsiTransformer(self.validate_xml) fd = open(os.path.join(self.module_path, 'test/data/HIVDB_multipleCommentDefinitionTags.xml'), 'r') transfor...
Test multiple comment definition tags. Using get_algorithm_info
Asi/test/test_xml_definitions.py
test_multiple_comment_definition_tags_alg_info
phac-nml/asipython
1
python
def test_multiple_comment_definition_tags_alg_info(self): try: transformer = XmlAsiTransformer(self.validate_xml) fd = open(os.path.join(self.module_path, 'test/data/HIVDB_multipleCommentDefinitionTags.xml'), 'r') transformer.get_algorithm_info(fd) except AsiParsingException as e: ...
def test_multiple_comment_definition_tags_alg_info(self): try: transformer = XmlAsiTransformer(self.validate_xml) fd = open(os.path.join(self.module_path, 'test/data/HIVDB_multipleCommentDefinitionTags.xml'), 'r') transformer.get_algorithm_info(fd) except AsiParsingException as e: ...
d6b82bf73909c679f8021ec14969b949a13a17000326e45cf552dabe77c82fca
def test_missing_level_definition_order(self): 'Test missing_level_definition_order' try: transformer = XmlAsiTransformer(self.validate_xml) fd = open(os.path.join(self.module_path, 'test/data/HIVDB_missingLevelDefinitionOrder.xml'), 'r') transformer.transform(fd) except AsiParsingEx...
Test missing_level_definition_order
Asi/test/test_xml_definitions.py
test_missing_level_definition_order
phac-nml/asipython
1
python
def test_missing_level_definition_order(self): try: transformer = XmlAsiTransformer(self.validate_xml) fd = open(os.path.join(self.module_path, 'test/data/HIVDB_missingLevelDefinitionOrder.xml'), 'r') transformer.transform(fd) except AsiParsingException as e: print(('test_mi...
def test_missing_level_definition_order(self): try: transformer = XmlAsiTransformer(self.validate_xml) fd = open(os.path.join(self.module_path, 'test/data/HIVDB_missingLevelDefinitionOrder.xml'), 'r') transformer.transform(fd) except AsiParsingException as e: print(('test_mi...
38cf5d5155e945c38cbfec9ed214332b698e79b8347b429a4a573ee0df1bf637
def test_missing_level_definition_order_alg_info(self): 'Test missing_level_definition_order. Using get_algorithm_info' try: transformer = XmlAsiTransformer(self.validate_xml) fd = open(os.path.join(self.module_path, 'test/data/HIVDB_missingLevelDefinitionOrder.xml'), 'r') transformer.ge...
Test missing_level_definition_order. Using get_algorithm_info
Asi/test/test_xml_definitions.py
test_missing_level_definition_order_alg_info
phac-nml/asipython
1
python
def test_missing_level_definition_order_alg_info(self): try: transformer = XmlAsiTransformer(self.validate_xml) fd = open(os.path.join(self.module_path, 'test/data/HIVDB_missingLevelDefinitionOrder.xml'), 'r') transformer.get_algorithm_info(fd) except AsiParsingException as e: ...
def test_missing_level_definition_order_alg_info(self): try: transformer = XmlAsiTransformer(self.validate_xml) fd = open(os.path.join(self.module_path, 'test/data/HIVDB_missingLevelDefinitionOrder.xml'), 'r') transformer.get_algorithm_info(fd) except AsiParsingException as e: ...
9fe72f65fb4582d993bbe614f4ebe43ac9063504684fea8e95ddde4f23fd0303
def test_missing_level_definition_sir(self): 'Test missing_level_definition_sir' try: transformer = XmlAsiTransformer(self.validate_xml) fd = open(os.path.join(self.module_path, 'test/data/HIVDB_missingLevelDefinitionSIR.xml'), 'r') transformer.transform(fd) except AsiParsingExceptio...
Test missing_level_definition_sir
Asi/test/test_xml_definitions.py
test_missing_level_definition_sir
phac-nml/asipython
1
python
def test_missing_level_definition_sir(self): try: transformer = XmlAsiTransformer(self.validate_xml) fd = open(os.path.join(self.module_path, 'test/data/HIVDB_missingLevelDefinitionSIR.xml'), 'r') transformer.transform(fd) except AsiParsingException as e: print(('test_missin...
def test_missing_level_definition_sir(self): try: transformer = XmlAsiTransformer(self.validate_xml) fd = open(os.path.join(self.module_path, 'test/data/HIVDB_missingLevelDefinitionSIR.xml'), 'r') transformer.transform(fd) except AsiParsingException as e: print(('test_missin...
99eeba294fd7095720a4f4b438d5e3d75bd078e3e8ae30a2e4b1f1c4cb3dde52
def test_missing_level_definition_sir_alg_info(self): 'Test missing_level_definition_sir. Using get_algorithm_info' try: transformer = XmlAsiTransformer(self.validate_xml) fd = open(os.path.join(self.module_path, 'test/data/HIVDB_missingLevelDefinitionSIR.xml'), 'r') transformer.get_algo...
Test missing_level_definition_sir. Using get_algorithm_info
Asi/test/test_xml_definitions.py
test_missing_level_definition_sir_alg_info
phac-nml/asipython
1
python
def test_missing_level_definition_sir_alg_info(self): try: transformer = XmlAsiTransformer(self.validate_xml) fd = open(os.path.join(self.module_path, 'test/data/HIVDB_missingLevelDefinitionSIR.xml'), 'r') transformer.get_algorithm_info(fd) except AsiParsingException as e: p...
def test_missing_level_definition_sir_alg_info(self): try: transformer = XmlAsiTransformer(self.validate_xml) fd = open(os.path.join(self.module_path, 'test/data/HIVDB_missingLevelDefinitionSIR.xml'), 'r') transformer.get_algorithm_info(fd) except AsiParsingException as e: p...
86e5959a4636b383ea5a248990a652eb05377d3b3601960236da8b94de7590d5
def test_multiple_global_range_tags_alg_info(self): 'Test multiple global range tags. Using get_algorithm_info'
Test multiple global range tags. Using get_algorithm_info
Asi/test/test_xml_definitions.py
test_multiple_global_range_tags_alg_info
phac-nml/asipython
1
python
def test_multiple_global_range_tags_alg_info(self):
def test_multiple_global_range_tags_alg_info(self): <|docstring|>Test multiple global range tags. Using get_algorithm_info<|endoftext|>
89960a5118e50c0c0e3500988021d0820abb135ef407c4995274790a3225a0b8
def request(url): '\n Sends a request to a url\n\n :param url: \n\n ' if (not connected_to_internet()): raise ConnectionError('You need to have an internet connection to send requests.') response = requests.get(url) if response.ok: return response else: exception_str...
Sends a request to a url :param url:
morphapi/utils/webqueries.py
request
lidakanari/morphapi
7
python
def request(url): '\n Sends a request to a url\n\n :param url: \n\n ' if (not connected_to_internet()): raise ConnectionError('You need to have an internet connection to send requests.') response = requests.get(url) if response.ok: return response else: exception_str...
def request(url): '\n Sends a request to a url\n\n :param url: \n\n ' if (not connected_to_internet()): raise ConnectionError('You need to have an internet connection to send requests.') response = requests.get(url) if response.ok: return response else: exception_str...
e1098bdc1b47e9a1aaa8ef81b71f22bf1a74dd7d6b948d2c4529d58d71550fb5
def query_mouselight(query): '\n Sends a GET request, not currently used for anything.\n\n :param query: \n\n ' if (not connected_to_internet()): raise ConnectionError('You need an internet connection for API queries, sorry.') base_url = 'http://ml-neuronbrowser.janelia.org/' full_query...
Sends a GET request, not currently used for anything. :param query:
morphapi/utils/webqueries.py
query_mouselight
lidakanari/morphapi
7
python
def query_mouselight(query): '\n Sends a GET request, not currently used for anything.\n\n :param query: \n\n ' if (not connected_to_internet()): raise ConnectionError('You need an internet connection for API queries, sorry.') base_url = 'http://ml-neuronbrowser.janelia.org/' full_query...
def query_mouselight(query): '\n Sends a GET request, not currently used for anything.\n\n :param query: \n\n ' if (not connected_to_internet()): raise ConnectionError('You need an internet connection for API queries, sorry.') base_url = 'http://ml-neuronbrowser.janelia.org/' full_query...
75cd7b1ca1741a9b588c4f22430b2ad71fefcb7f1842d396ff34495f6cd31d0e
def post_mouselight(url, query=None, clean=False, attempts=3): '\n sends a POST request to a user URL. Query can be either a string (in which case clean should be False) or a dictionary.\n\n :param url: \n :param query: string or dictionary with query (Default value = None)\n :param clean: if not clea...
sends a POST request to a user URL. Query can be either a string (in which case clean should be False) or a dictionary. :param url: :param query: string or dictionary with query (Default value = None) :param clean: if not clean, the query is assumed to be in JSON format (Default value = False) :param attempts: numb...
morphapi/utils/webqueries.py
post_mouselight
lidakanari/morphapi
7
python
def post_mouselight(url, query=None, clean=False, attempts=3): '\n sends a POST request to a user URL. Query can be either a string (in which case clean should be False) or a dictionary.\n\n :param url: \n :param query: string or dictionary with query (Default value = None)\n :param clean: if not clea...
def post_mouselight(url, query=None, clean=False, attempts=3): '\n sends a POST request to a user URL. Query can be either a string (in which case clean should be False) or a dictionary.\n\n :param url: \n :param query: string or dictionary with query (Default value = None)\n :param clean: if not clea...
74f3aa53c0d735a981f2fc588cb076733c2a9883265091708071589f9b403edc
def read_route_line(route): '\n read route line in gaussian input/output and return functional basis_set\n and a dictionary of other route parameters\n\n Args:\n route (str) : the route line\n\n return\n functional (str) : the method (HF, PBE ...)\n basis_set (str) : the basis set\n...
read route line in gaussian input/output and return functional basis_set and a dictionary of other route parameters Args: route (str) : the route line return functional (str) : the method (HF, PBE ...) basis_set (str) : the basis set route (dict) : dictionary of parameters
pymatgen/io/gaussian.py
read_route_line
mailhexu/pymatgen
18
python
def read_route_line(route): '\n read route line in gaussian input/output and return functional basis_set\n and a dictionary of other route parameters\n\n Args:\n route (str) : the route line\n\n return\n functional (str) : the method (HF, PBE ...)\n basis_set (str) : the basis set\n...
def read_route_line(route): '\n read route line in gaussian input/output and return functional basis_set\n and a dictionary of other route parameters\n\n Args:\n route (str) : the route line\n\n return\n functional (str) : the method (HF, PBE ...)\n basis_set (str) : the basis set\n...
1b43cabd426f2ebbe631a2a6d2891a56fb10218f5066447667906cb7f4e46da7
@property def molecule(self): '\n Returns molecule associated with this GaussianInput.\n ' return self._mol
Returns molecule associated with this GaussianInput.
pymatgen/io/gaussian.py
molecule
mailhexu/pymatgen
18
python
@property def molecule(self): '\n \n ' return self._mol
@property def molecule(self): '\n \n ' return self._mol<|docstring|>Returns molecule associated with this GaussianInput.<|endoftext|>
e5e79d5ebe092aa16bde9dbfc3a4e95f22af2398646d103114c3e0e2053c0147
@staticmethod def parse_coords(coord_lines): '\n Helper method to parse coordinates.\n ' paras = {} var_pattern = re.compile('^([A-Za-z]+\\S*)[\\s=,]+([\\d\\-\\.]+)$') for l in coord_lines: m = var_pattern.match(l.strip()) if m: paras[m.group(1)] = float(m.group...
Helper method to parse coordinates.
pymatgen/io/gaussian.py
parse_coords
mailhexu/pymatgen
18
python
@staticmethod def parse_coords(coord_lines): '\n \n ' paras = {} var_pattern = re.compile('^([A-Za-z]+\\S*)[\\s=,]+([\\d\\-\\.]+)$') for l in coord_lines: m = var_pattern.match(l.strip()) if m: paras[m.group(1)] = float(m.group(2)) species = [] coords = ...
@staticmethod def parse_coords(coord_lines): '\n \n ' paras = {} var_pattern = re.compile('^([A-Za-z]+\\S*)[\\s=,]+([\\d\\-\\.]+)$') for l in coord_lines: m = var_pattern.match(l.strip()) if m: paras[m.group(1)] = float(m.group(2)) species = [] coords = ...
bc2b8bcd70d35bf52675b1489b3e890bf1dbbd0f1811bb39ae7afce7b7511ad6
@staticmethod def from_string(contents): '\n Creates GaussianInput from a string.\n\n Args:\n contents: String representing an Gaussian input file.\n\n Returns:\n GaussianInput object\n ' lines = [l.strip() for l in contents.split('\n')] link0_patt = re.comp...
Creates GaussianInput from a string. Args: contents: String representing an Gaussian input file. Returns: GaussianInput object
pymatgen/io/gaussian.py
from_string
mailhexu/pymatgen
18
python
@staticmethod def from_string(contents): '\n Creates GaussianInput from a string.\n\n Args:\n contents: String representing an Gaussian input file.\n\n Returns:\n GaussianInput object\n ' lines = [l.strip() for l in contents.split('\n')] link0_patt = re.comp...
@staticmethod def from_string(contents): '\n Creates GaussianInput from a string.\n\n Args:\n contents: String representing an Gaussian input file.\n\n Returns:\n GaussianInput object\n ' lines = [l.strip() for l in contents.split('\n')] link0_patt = re.comp...
5487b95ec22685b54783d2bbd71a19751c7c01884685011c290b6c201c2adf41
@staticmethod def from_file(filename): '\n Creates GaussianInput from a file.\n\n Args:\n filename: Gaussian input filename\n\n Returns:\n GaussianInput object\n ' with zopen(filename, 'r') as f: return GaussianInput.from_string(f.read())
Creates GaussianInput from a file. Args: filename: Gaussian input filename Returns: GaussianInput object
pymatgen/io/gaussian.py
from_file
mailhexu/pymatgen
18
python
@staticmethod def from_file(filename): '\n Creates GaussianInput from a file.\n\n Args:\n filename: Gaussian input filename\n\n Returns:\n GaussianInput object\n ' with zopen(filename, 'r') as f: return GaussianInput.from_string(f.read())
@staticmethod def from_file(filename): '\n Creates GaussianInput from a file.\n\n Args:\n filename: Gaussian input filename\n\n Returns:\n GaussianInput object\n ' with zopen(filename, 'r') as f: return GaussianInput.from_string(f.read())<|docstring|>Cre...
1b33dfc20ac918709e3c899aa5e13a17eae2a40f5c1da941f9b70fbc31fee509
def _find_nn_pos_before_site(self, siteindex): '\n Returns index of nearest neighbor atoms.\n ' alldist = [(self._mol.get_distance(siteindex, i), i) for i in range(siteindex)] alldist = sorted(alldist, key=(lambda x: x[0])) return [d[1] for d in alldist]
Returns index of nearest neighbor atoms.
pymatgen/io/gaussian.py
_find_nn_pos_before_site
mailhexu/pymatgen
18
python
def _find_nn_pos_before_site(self, siteindex): '\n \n ' alldist = [(self._mol.get_distance(siteindex, i), i) for i in range(siteindex)] alldist = sorted(alldist, key=(lambda x: x[0])) return [d[1] for d in alldist]
def _find_nn_pos_before_site(self, siteindex): '\n \n ' alldist = [(self._mol.get_distance(siteindex, i), i) for i in range(siteindex)] alldist = sorted(alldist, key=(lambda x: x[0])) return [d[1] for d in alldist]<|docstring|>Returns index of nearest neighbor atoms.<|endoftext|>
cccbf54013b2e2dd3e6689dd6a377aa33eab3e5be71d1f1f7da57236958d723e
def get_zmatrix(self): '\n Returns a z-matrix representation of the molecule.\n ' output = [] outputvar = [] for (i, site) in enumerate(self._mol): if (i == 0): output.append('{}'.format(site.specie)) elif (i == 1): nn = self._find_nn_pos_before_site...
Returns a z-matrix representation of the molecule.
pymatgen/io/gaussian.py
get_zmatrix
mailhexu/pymatgen
18
python
def get_zmatrix(self): '\n \n ' output = [] outputvar = [] for (i, site) in enumerate(self._mol): if (i == 0): output.append('{}'.format(site.specie)) elif (i == 1): nn = self._find_nn_pos_before_site(i) bondlength = self._mol.get_distanc...
def get_zmatrix(self): '\n \n ' output = [] outputvar = [] for (i, site) in enumerate(self._mol): if (i == 0): output.append('{}'.format(site.specie)) elif (i == 1): nn = self._find_nn_pos_before_site(i) bondlength = self._mol.get_distanc...
9bbfb33ae5bfac73811507d094ec59dd049761ed614c44d1427031b7b0ef6558
def get_cart_coords(self): '\n Return the cartesian coordinates of the molecule\n ' outs = [] to_s = (lambda x: ('%0.6f' % x)) for (i, site) in enumerate(self._mol): outs.append(' '.join([site.species_string, ' '.join([to_s(j) for j in site.coords])])) return '\n'.join(outs)
Return the cartesian coordinates of the molecule
pymatgen/io/gaussian.py
get_cart_coords
mailhexu/pymatgen
18
python
def get_cart_coords(self): '\n \n ' outs = [] to_s = (lambda x: ('%0.6f' % x)) for (i, site) in enumerate(self._mol): outs.append(' '.join([site.species_string, ' '.join([to_s(j) for j in site.coords])])) return '\n'.join(outs)
def get_cart_coords(self): '\n \n ' outs = [] to_s = (lambda x: ('%0.6f' % x)) for (i, site) in enumerate(self._mol): outs.append(' '.join([site.species_string, ' '.join([to_s(j) for j in site.coords])])) return '\n'.join(outs)<|docstring|>Return the cartesian coordinates of th...
cf556e0326311475fcedfb2c678e4169aba7bb1234b7fa7f135f690ef2a00086
def to_string(self, cart_coords=False): '\n Return GaussianInput string\n\n Option: whe cart_coords sets to True return the cartesian coordinates\n instead of the z-matrix\n\n ' def para_dict_to_string(para, joiner=' '): para_str = [('{}={}'.format(k, v) if v else k)...
Return GaussianInput string Option: whe cart_coords sets to True return the cartesian coordinates instead of the z-matrix
pymatgen/io/gaussian.py
to_string
mailhexu/pymatgen
18
python
def to_string(self, cart_coords=False): '\n Return GaussianInput string\n\n Option: whe cart_coords sets to True return the cartesian coordinates\n instead of the z-matrix\n\n ' def para_dict_to_string(para, joiner=' '): para_str = [('{}={}'.format(k, v) if v else k)...
def to_string(self, cart_coords=False): '\n Return GaussianInput string\n\n Option: whe cart_coords sets to True return the cartesian coordinates\n instead of the z-matrix\n\n ' def para_dict_to_string(para, joiner=' '): para_str = [('{}={}'.format(k, v) if v else k)...
8be33e42d986a1628f461a216485842fac055676ef0e00022f6f5e8cdd86e0aa
def write_file(self, filename, cart_coords=False): '\n Write the input string into a file\n\n Option: see __str__ method\n ' with zopen(filename, 'w') as f: f.write(self.to_string(cart_coords))
Write the input string into a file Option: see __str__ method
pymatgen/io/gaussian.py
write_file
mailhexu/pymatgen
18
python
def write_file(self, filename, cart_coords=False): '\n Write the input string into a file\n\n Option: see __str__ method\n ' with zopen(filename, 'w') as f: f.write(self.to_string(cart_coords))
def write_file(self, filename, cart_coords=False): '\n Write the input string into a file\n\n Option: see __str__ method\n ' with zopen(filename, 'w') as f: f.write(self.to_string(cart_coords))<|docstring|>Write the input string into a file Option: see __str__ method<|endoftext|>
6122ce099de5d0ce6a12f30865b2437983db7945c6fc7a65f94d22e82356d739
def as_dict(self): '\n Json-serializable dict representation.\n ' structure = self.final_structure d = {'has_gaussian_completed': self.properly_terminated, 'nsites': len(structure)} comp = structure.composition d['unit_cell_formula'] = comp.as_dict() d['reduced_cell_formula'] = Com...
Json-serializable dict representation.
pymatgen/io/gaussian.py
as_dict
mailhexu/pymatgen
18
python
def as_dict(self): '\n \n ' structure = self.final_structure d = {'has_gaussian_completed': self.properly_terminated, 'nsites': len(structure)} comp = structure.composition d['unit_cell_formula'] = comp.as_dict() d['reduced_cell_formula'] = Composition(comp.reduced_formula).as_dict...
def as_dict(self): '\n \n ' structure = self.final_structure d = {'has_gaussian_completed': self.properly_terminated, 'nsites': len(structure)} comp = structure.composition d['unit_cell_formula'] = comp.as_dict() d['reduced_cell_formula'] = Composition(comp.reduced_formula).as_dict...
3e4f42e4f3954f6ae471349beb152d810230fe23c35c8a08329d199ba7993718
def read_scan(self): '\n Read a potential energy surface from a gaussian scan calculation.\n\n Returns:\n\n A dict: {"energies": [ values ],\n "coords": {"d1": [ values ], "A2", [ values ], ... }}\n\n "energies" are the energies of all points of the potential ...
Read a potential energy surface from a gaussian scan calculation. Returns: A dict: {"energies": [ values ], "coords": {"d1": [ values ], "A2", [ values ], ... }} "energies" are the energies of all points of the potential energy surface. "coords" are the internal coordinates used to compute t...
pymatgen/io/gaussian.py
read_scan
mailhexu/pymatgen
18
python
def read_scan(self): '\n Read a potential energy surface from a gaussian scan calculation.\n\n Returns:\n\n A dict: {"energies": [ values ],\n "coords": {"d1": [ values ], "A2", [ values ], ... }}\n\n "energies" are the energies of all points of the potential ...
def read_scan(self): '\n Read a potential energy surface from a gaussian scan calculation.\n\n Returns:\n\n A dict: {"energies": [ values ],\n "coords": {"d1": [ values ], "A2", [ values ], ... }}\n\n "energies" are the energies of all points of the potential ...
d4a01f9bd3628ff3ee2e974f0c2df310809de768265a3aaf7d0b84179efcc8ab
def get_scan_plot(self, coords=None): '\n Get a matplotlib plot of the potential energy surface.\n\n Args:\n coords: internal coordinate name to use as abcissa.\n ' from pymatgen.util.plotting import pretty_plot plt = pretty_plot(12, 8) d = self.read_scan() if (coords...
Get a matplotlib plot of the potential energy surface. Args: coords: internal coordinate name to use as abcissa.
pymatgen/io/gaussian.py
get_scan_plot
mailhexu/pymatgen
18
python
def get_scan_plot(self, coords=None): '\n Get a matplotlib plot of the potential energy surface.\n\n Args:\n coords: internal coordinate name to use as abcissa.\n ' from pymatgen.util.plotting import pretty_plot plt = pretty_plot(12, 8) d = self.read_scan() if (coords...
def get_scan_plot(self, coords=None): '\n Get a matplotlib plot of the potential energy surface.\n\n Args:\n coords: internal coordinate name to use as abcissa.\n ' from pymatgen.util.plotting import pretty_plot plt = pretty_plot(12, 8) d = self.read_scan() if (coords...
ac5410dbebb95643d11020c0359439650cfbb79a4680d21f618e5f466d321e28
def save_scan_plot(self, filename='scan.pdf', img_format='pdf', coords=None): '\n Save matplotlib plot of the potential energy surface to a file.\n\n Args:\n filename: Filename to write to.\n img_format: Image format to use. Defaults to EPS.\n coords: internal coordina...
Save matplotlib plot of the potential energy surface to a file. Args: filename: Filename to write to. img_format: Image format to use. Defaults to EPS. coords: internal coordinate name to use as abcissa.
pymatgen/io/gaussian.py
save_scan_plot
mailhexu/pymatgen
18
python
def save_scan_plot(self, filename='scan.pdf', img_format='pdf', coords=None): '\n Save matplotlib plot of the potential energy surface to a file.\n\n Args:\n filename: Filename to write to.\n img_format: Image format to use. Defaults to EPS.\n coords: internal coordina...
def save_scan_plot(self, filename='scan.pdf', img_format='pdf', coords=None): '\n Save matplotlib plot of the potential energy surface to a file.\n\n Args:\n filename: Filename to write to.\n img_format: Image format to use. Defaults to EPS.\n coords: internal coordina...
ba8893129d4103ec27b76d74420745b9e5d38a7bec138fd0d1f9a3226f036863
def read_excitation_energies(self): '\n Read a excitation energies after a TD-DFT calculation.\n\n Returns:\n\n A list: A list of tuple for each transition such as\n [(energie (eV), lambda (nm), oscillatory strength), ... ]\n ' transitions = list() with zop...
Read a excitation energies after a TD-DFT calculation. Returns: A list: A list of tuple for each transition such as [(energie (eV), lambda (nm), oscillatory strength), ... ]
pymatgen/io/gaussian.py
read_excitation_energies
mailhexu/pymatgen
18
python
def read_excitation_energies(self): '\n Read a excitation energies after a TD-DFT calculation.\n\n Returns:\n\n A list: A list of tuple for each transition such as\n [(energie (eV), lambda (nm), oscillatory strength), ... ]\n ' transitions = list() with zop...
def read_excitation_energies(self): '\n Read a excitation energies after a TD-DFT calculation.\n\n Returns:\n\n A list: A list of tuple for each transition such as\n [(energie (eV), lambda (nm), oscillatory strength), ... ]\n ' transitions = list() with zop...
17b79241e67b201c2d913fdf5c9dbd750e6e4f8cd36bff4c345290949de8375e
def get_spectre_plot(self, sigma=0.05, step=0.01): '\n Get a matplotlib plot of the UV-visible spectra. Transition are plotted\n as vertical lines and as a sum of normal functions with sigma with. The\n broadening is applied in energy and the spectra is plotted as a function\n of the wav...
Get a matplotlib plot of the UV-visible spectra. Transition are plotted as vertical lines and as a sum of normal functions with sigma with. The broadening is applied in energy and the spectra is plotted as a function of the wavelength. Args: sigma: Full width at half maximum in eV for normal functions. step: b...
pymatgen/io/gaussian.py
get_spectre_plot
mailhexu/pymatgen
18
python
def get_spectre_plot(self, sigma=0.05, step=0.01): '\n Get a matplotlib plot of the UV-visible spectra. Transition are plotted\n as vertical lines and as a sum of normal functions with sigma with. The\n broadening is applied in energy and the spectra is plotted as a function\n of the wav...
def get_spectre_plot(self, sigma=0.05, step=0.01): '\n Get a matplotlib plot of the UV-visible spectra. Transition are plotted\n as vertical lines and as a sum of normal functions with sigma with. The\n broadening is applied in energy and the spectra is plotted as a function\n of the wav...
2c645d96eedcf7e487a6f6d0b6ebb81b199fc0cda8b62412cb941bf0896a4043
def save_spectre_plot(self, filename='spectre.pdf', img_format='pdf', sigma=0.05, step=0.01): '\n Save matplotlib plot of the spectre to a file.\n\n Args:\n filename: Filename to write to.\n img_format: Image format to use. Defaults to EPS.\n sigma: Full width at half ...
Save matplotlib plot of the spectre to a file. Args: filename: Filename to write to. img_format: Image format to use. Defaults to EPS. sigma: Full width at half maximum in eV for normal functions. step: bin interval in eV
pymatgen/io/gaussian.py
save_spectre_plot
mailhexu/pymatgen
18
python
def save_spectre_plot(self, filename='spectre.pdf', img_format='pdf', sigma=0.05, step=0.01): '\n Save matplotlib plot of the spectre to a file.\n\n Args:\n filename: Filename to write to.\n img_format: Image format to use. Defaults to EPS.\n sigma: Full width at half ...
def save_spectre_plot(self, filename='spectre.pdf', img_format='pdf', sigma=0.05, step=0.01): '\n Save matplotlib plot of the spectre to a file.\n\n Args:\n filename: Filename to write to.\n img_format: Image format to use. Defaults to EPS.\n sigma: Full width at half ...
57c29fbbd74cfadf5821708029fbcc9c8c601e9a482ed29b6d961b5098d3550c
def to_input(self, filename, mol=None, charge=None, spin_multiplicity=None, title=None, functional=None, basis_set=None, route_parameters=None, input_parameters=None, link0_parameters=None, dieze_tag=None, cart_coords=False): '\n Write a new input file using by default the last geometry read in the output\n ...
Write a new input file using by default the last geometry read in the output file and with the same calculation parameters. Arguments are the same as GaussianInput class. Returns gaunip (GaussianInput) : the gaussian input object
pymatgen/io/gaussian.py
to_input
mailhexu/pymatgen
18
python
def to_input(self, filename, mol=None, charge=None, spin_multiplicity=None, title=None, functional=None, basis_set=None, route_parameters=None, input_parameters=None, link0_parameters=None, dieze_tag=None, cart_coords=False): '\n Write a new input file using by default the last geometry read in the output\n ...
def to_input(self, filename, mol=None, charge=None, spin_multiplicity=None, title=None, functional=None, basis_set=None, route_parameters=None, input_parameters=None, link0_parameters=None, dieze_tag=None, cart_coords=False): '\n Write a new input file using by default the last geometry read in the output\n ...
5a63d54a2a47d684526ce3c8351df6ca69dbac777d605f37f62d1cbcd0c3b451
def parse_species(sp_str): '\n The species specification can take many forms. E.g.,\n simple integers representing atomic numbers ("8"),\n actual species string ("C") or a labelled species ("C1").\n Sometimes, the species string is also not properly capitalized,\n ...
The species specification can take many forms. E.g., simple integers representing atomic numbers ("8"), actual species string ("C") or a labelled species ("C1"). Sometimes, the species string is also not properly capitalized, e.g, ("c1"). This method should take care of these known formats.
pymatgen/io/gaussian.py
parse_species
mailhexu/pymatgen
18
python
def parse_species(sp_str): '\n The species specification can take many forms. E.g.,\n simple integers representing atomic numbers ("8"),\n actual species string ("C") or a labelled species ("C1").\n Sometimes, the species string is also not properly capitalized,\n ...
def parse_species(sp_str): '\n The species specification can take many forms. E.g.,\n simple integers representing atomic numbers ("8"),\n actual species string ("C") or a labelled species ("C1").\n Sometimes, the species string is also not properly capitalized,\n ...
300ac8dcc7faff9e4343662f5a342177dcc570509e013543d992579b5827daab
def floatList(l): ' return a list of float from a list of string ' return [float(v) for v in l]
return a list of float from a list of string
pymatgen/io/gaussian.py
floatList
mailhexu/pymatgen
18
python
def floatList(l): ' ' return [float(v) for v in l]
def floatList(l): ' ' return [float(v) for v in l]<|docstring|>return a list of float from a list of string<|endoftext|>
9d538fabb4a27e99938e0b07bfdf8acac8d9df23a77122391df6f191c965991c
def detect_faces(path): 'Detects faces in an image.' client = vision.ImageAnnotatorClient() with io.open(path, 'rb') as image_file: content = image_file.read() image = types.Image(content=content) response = client.face_detection(image=image) faces = response.face_annotations likelih...
Detects faces in an image.
face/face_detection.py
detect_faces
DisenWang/google_api
0
python
def detect_faces(path): client = vision.ImageAnnotatorClient() with io.open(path, 'rb') as image_file: content = image_file.read() image = types.Image(content=content) response = client.face_detection(image=image) faces = response.face_annotations likelihood_name = ('UNKNOWN', 'VERY...
def detect_faces(path): client = vision.ImageAnnotatorClient() with io.open(path, 'rb') as image_file: content = image_file.read() image = types.Image(content=content) response = client.face_detection(image=image) faces = response.face_annotations likelihood_name = ('UNKNOWN', 'VERY...
c5821370440576e908b3ecd352ffc575461ca41144c441abfd83d10e2f432a69
def mark_catchup_completed_if_possible(self, ledger_info: LedgerInfo): '\n Checks if the ledger is caught up to the the sequence number\n specified in the ConsistencyProof, if yes then mark the catchup as\n done for this ledger.\n :param ledger_info:\n :return: True if catchup is ...
Checks if the ledger is caught up to the the sequence number specified in the ConsistencyProof, if yes then mark the catchup as done for this ledger. :param ledger_info: :return: True if catchup is done, false otherwise
plenum/common/ledger_manager.py
mark_catchup_completed_if_possible
ArtObr/indy-plenum
0
python
def mark_catchup_completed_if_possible(self, ledger_info: LedgerInfo): '\n Checks if the ledger is caught up to the the sequence number\n specified in the ConsistencyProof, if yes then mark the catchup as\n done for this ledger.\n :param ledger_info:\n :return: True if catchup is ...
def mark_catchup_completed_if_possible(self, ledger_info: LedgerInfo): '\n Checks if the ledger is caught up to the the sequence number\n specified in the ConsistencyProof, if yes then mark the catchup as\n done for this ledger.\n :param ledger_info:\n :return: True if catchup is ...
053886900aa935ab6358c66d177ae7f57a9601ee7e2917230de552ee503facb6
def canProcessCatchupReply(self, catchupReply: CatchupRep) -> List[Tuple]: '\n Checks for any duplicates or gaps in txns, returns txns sorted by seq no\n ' ledgerId = getattr(catchupReply, f.LEDGER_ID.nm) ledgerState = self.getLedgerInfoByType(ledgerId).state if (ledgerState != LedgerState...
Checks for any duplicates or gaps in txns, returns txns sorted by seq no
plenum/common/ledger_manager.py
canProcessCatchupReply
ArtObr/indy-plenum
0
python
def canProcessCatchupReply(self, catchupReply: CatchupRep) -> List[Tuple]: '\n \n ' ledgerId = getattr(catchupReply, f.LEDGER_ID.nm) ledgerState = self.getLedgerInfoByType(ledgerId).state if (ledgerState != LedgerState.syncing): logger.debug('{} cannot process catchup reply {} sinc...
def canProcessCatchupReply(self, catchupReply: CatchupRep) -> List[Tuple]: '\n \n ' ledgerId = getattr(catchupReply, f.LEDGER_ID.nm) ledgerState = self.getLedgerInfoByType(ledgerId).state if (ledgerState != LedgerState.syncing): logger.debug('{} cannot process catchup reply {} sinc...
5d9fd8c1b9bf8d6341ceee950ae6f637d392d25789348ea9f027dbd551ca9567
@staticmethod def _get_merged_catchup_txns(existing_txns, new_txns): '\n Merge any newly received txns during catchup with already received txns\n :param existing_txns:\n :param new_txns:\n :return:\n ' idx_to_remove = [] for (i, (seq_no, _)) in enumerate(existing_txns): ...
Merge any newly received txns during catchup with already received txns :param existing_txns: :param new_txns: :return:
plenum/common/ledger_manager.py
_get_merged_catchup_txns
ArtObr/indy-plenum
0
python
@staticmethod def _get_merged_catchup_txns(existing_txns, new_txns): '\n Merge any newly received txns during catchup with already received txns\n :param existing_txns:\n :param new_txns:\n :return:\n ' idx_to_remove = [] for (i, (seq_no, _)) in enumerate(existing_txns): ...
@staticmethod def _get_merged_catchup_txns(existing_txns, new_txns): '\n Merge any newly received txns during catchup with already received txns\n :param existing_txns:\n :param new_txns:\n :return:\n ' idx_to_remove = [] for (i, (seq_no, _)) in enumerate(existing_txns): ...
9cab533ab4bc6784ee95b93ec13d8017bef20ca7453c1c11d30eaebac3a57387
async def test_async_setup_platform(): 'Test setup platform does nothing (it uses config entries).' (await switch.async_setup_platform(None, None, None))
Test setup platform does nothing (it uses config entries).
tests/components/smartthings/test_switch.py
test_async_setup_platform
MarvinT/home-assistant
0
python
async def test_async_setup_platform(): (await switch.async_setup_platform(None, None, None))
async def test_async_setup_platform(): (await switch.async_setup_platform(None, None, None))<|docstring|>Test setup platform does nothing (it uses config entries).<|endoftext|>
d8323e01b885305666015e866622827aeb46452489446f5de52a10d251a4ef91
async def test_entity_and_device_attributes(hass, device_factory): 'Test the attributes of the entity are correct.' device = device_factory('Switch_1', [Capability.switch], {Attribute.switch: 'on'}) entity_registry = (await hass.helpers.entity_registry.async_get_registry()) device_registry = (await hass...
Test the attributes of the entity are correct.
tests/components/smartthings/test_switch.py
test_entity_and_device_attributes
MarvinT/home-assistant
0
python
async def test_entity_and_device_attributes(hass, device_factory): device = device_factory('Switch_1', [Capability.switch], {Attribute.switch: 'on'}) entity_registry = (await hass.helpers.entity_registry.async_get_registry()) device_registry = (await hass.helpers.device_registry.async_get_registry()) ...
async def test_entity_and_device_attributes(hass, device_factory): device = device_factory('Switch_1', [Capability.switch], {Attribute.switch: 'on'}) entity_registry = (await hass.helpers.entity_registry.async_get_registry()) device_registry = (await hass.helpers.device_registry.async_get_registry()) ...
232798ae8d50210806ba733d3dca2579cffcdc9ac46dfb17785b10c54da379f9
async def test_turn_off(hass, device_factory): 'Test the switch turns of successfully.' device = device_factory('Switch_1', [Capability.switch], {Attribute.switch: 'on'}) (await setup_platform(hass, SWITCH_DOMAIN, device)) (await hass.services.async_call('switch', 'turn_off', {'entity_id': 'switch.switc...
Test the switch turns of successfully.
tests/components/smartthings/test_switch.py
test_turn_off
MarvinT/home-assistant
0
python
async def test_turn_off(hass, device_factory): device = device_factory('Switch_1', [Capability.switch], {Attribute.switch: 'on'}) (await setup_platform(hass, SWITCH_DOMAIN, device)) (await hass.services.async_call('switch', 'turn_off', {'entity_id': 'switch.switch_1'}, blocking=True)) state = hass....
async def test_turn_off(hass, device_factory): device = device_factory('Switch_1', [Capability.switch], {Attribute.switch: 'on'}) (await setup_platform(hass, SWITCH_DOMAIN, device)) (await hass.services.async_call('switch', 'turn_off', {'entity_id': 'switch.switch_1'}, blocking=True)) state = hass....
f20de5f2185b12d06c1dd5a9d2aa0f9309a674179dc9455aa89d4a7dba5dd228
async def test_turn_on(hass, device_factory): 'Test the switch turns of successfully.' device = device_factory('Switch_1', [Capability.switch], {Attribute.switch: 'off'}) (await setup_platform(hass, SWITCH_DOMAIN, device)) (await hass.services.async_call('switch', 'turn_on', {'entity_id': 'switch.switch...
Test the switch turns of successfully.
tests/components/smartthings/test_switch.py
test_turn_on
MarvinT/home-assistant
0
python
async def test_turn_on(hass, device_factory): device = device_factory('Switch_1', [Capability.switch], {Attribute.switch: 'off'}) (await setup_platform(hass, SWITCH_DOMAIN, device)) (await hass.services.async_call('switch', 'turn_on', {'entity_id': 'switch.switch_1'}, blocking=True)) state = hass.s...
async def test_turn_on(hass, device_factory): device = device_factory('Switch_1', [Capability.switch], {Attribute.switch: 'off'}) (await setup_platform(hass, SWITCH_DOMAIN, device)) (await hass.services.async_call('switch', 'turn_on', {'entity_id': 'switch.switch_1'}, blocking=True)) state = hass.s...
cbe069d9bfdaf5a0993f9e38abdd435f2f49c84f10b47365059e20e75958722a
async def test_update_from_signal(hass, device_factory): 'Test the switch updates when receiving a signal.' device = device_factory('Switch_1', [Capability.switch], {Attribute.switch: 'off'}) (await setup_platform(hass, SWITCH_DOMAIN, device)) (await device.switch_on(True)) async_dispatcher_send(has...
Test the switch updates when receiving a signal.
tests/components/smartthings/test_switch.py
test_update_from_signal
MarvinT/home-assistant
0
python
async def test_update_from_signal(hass, device_factory): device = device_factory('Switch_1', [Capability.switch], {Attribute.switch: 'off'}) (await setup_platform(hass, SWITCH_DOMAIN, device)) (await device.switch_on(True)) async_dispatcher_send(hass, SIGNAL_SMARTTHINGS_UPDATE, [device.device_id]) ...
async def test_update_from_signal(hass, device_factory): device = device_factory('Switch_1', [Capability.switch], {Attribute.switch: 'off'}) (await setup_platform(hass, SWITCH_DOMAIN, device)) (await device.switch_on(True)) async_dispatcher_send(hass, SIGNAL_SMARTTHINGS_UPDATE, [device.device_id]) ...
072093c6d2df120e3dfb8776796db460f16b5c826e2288b51c6117d1a1d67ce2
async def test_unload_config_entry(hass, device_factory): 'Test the switch is removed when the config entry is unloaded.' device = device_factory('Switch 1', [Capability.switch], {Attribute.switch: 'on'}) config_entry = (await setup_platform(hass, SWITCH_DOMAIN, device)) (await hass.config_entries.async...
Test the switch is removed when the config entry is unloaded.
tests/components/smartthings/test_switch.py
test_unload_config_entry
MarvinT/home-assistant
0
python
async def test_unload_config_entry(hass, device_factory): device = device_factory('Switch 1', [Capability.switch], {Attribute.switch: 'on'}) config_entry = (await setup_platform(hass, SWITCH_DOMAIN, device)) (await hass.config_entries.async_forward_entry_unload(config_entry, 'switch')) assert (not ...
async def test_unload_config_entry(hass, device_factory): device = device_factory('Switch 1', [Capability.switch], {Attribute.switch: 'on'}) config_entry = (await setup_platform(hass, SWITCH_DOMAIN, device)) (await hass.config_entries.async_forward_entry_unload(config_entry, 'switch')) assert (not ...
bacf2ca25d4d522337ca1782ff1926f3f6e9db59d2bf6c7193df1934f31f9657
def setup_logging(options, conf): '\n Sets up the logging options for a log with supplied name\n\n :param options: Mapping of typed option key/values\n :param conf: Mapping of untyped key/values from config file\n ' log_config = (options.get('log_config') or get_option(conf, 'log_config', default=No...
Sets up the logging options for a log with supplied name :param options: Mapping of typed option key/values :param conf: Mapping of untyped key/values from config file
melange/common/config.py
setup_logging
rackerlabs/melange
1
python
def setup_logging(options, conf): '\n Sets up the logging options for a log with supplied name\n\n :param options: Mapping of typed option key/values\n :param conf: Mapping of untyped key/values from config file\n ' log_config = (options.get('log_config') or get_option(conf, 'log_config', default=No...
def setup_logging(options, conf): '\n Sets up the logging options for a log with supplied name\n\n :param options: Mapping of typed option key/values\n :param conf: Mapping of untyped key/values from config file\n ' log_config = (options.get('log_config') or get_option(conf, 'log_config', default=No...
84a7d96efb4e4bf557a397fff405a44d2be2c3a7bf0ad477c1d11e6367999be8
def round_gp(self): 'Rounds the gas price to gwei' gp = (self.gas_price / 10000000.0) if ((gp >= 1) and (gp < 100)): gp = int(np.ceil(gp)) elif ((gp >= 100) and (gp < 2500)): gp = (gp / 10) gp = int(np.ceil(gp)) gp = (gp * 10) elif (gp >= 2500): gp = (gp / 100...
Rounds the gas price to gwei
egs/egs_ref.py
round_gp
ethgasstation/ethgasstation-adaptive-oracle
47
python
def round_gp(self): gp = (self.gas_price / 10000000.0) if ((gp >= 1) and (gp < 100)): gp = int(np.ceil(gp)) elif ((gp >= 100) and (gp < 2500)): gp = (gp / 10) gp = int(np.ceil(gp)) gp = (gp * 10) elif (gp >= 2500): gp = (gp / 100) gp = int(np.ceil(gp)...
def round_gp(self): gp = (self.gas_price / 10000000.0) if ((gp >= 1) and (gp < 100)): gp = int(np.ceil(gp)) elif ((gp >= 100) and (gp < 2500)): gp = (gp / 10) gp = int(np.ceil(gp)) gp = (gp * 10) elif (gp >= 2500): gp = (gp / 100) gp = int(np.ceil(gp)...
9b5ff50b0417012d5a2889b3b6277ec2d48c4880e6b6afb19c7636dfc2c93f0c
def _get_pending_tx_hashes(self, try_methods=True): 'gets pending transaction hashes and autodetects method for doing so' try: hashlist = [] if (self.pending_method == 'geth'): txpoolcontent = web3.txpool.content txpoolpending = txpoolcontent['pending'] for tx...
gets pending transaction hashes and autodetects method for doing so
egs/egs_ref.py
_get_pending_tx_hashes
ethgasstation/ethgasstation-adaptive-oracle
47
python
def _get_pending_tx_hashes(self, try_methods=True): try: hashlist = [] if (self.pending_method == 'geth'): txpoolcontent = web3.txpool.content txpoolpending = txpoolcontent['pending'] for tx_sequence in txpoolpending.values(): for tx_obj in tx...
def _get_pending_tx_hashes(self, try_methods=True): try: hashlist = [] if (self.pending_method == 'geth'): txpoolcontent = web3.txpool.content txpoolpending = txpoolcontent['pending'] for tx_sequence in txpoolpending.values(): for tx_obj in tx...
3db1d24c14bbae919c6d6d8064f990bb2fc7ede55ddc25f8f13da23ad7aafe1e
def append_current_txp(self): 'gets list of all txhash in txpool at block and appends to dataframe' current_block = web3.eth.blockNumber try: console.info((('getting txpool hashes at block ' + str(current_block)) + ' ...')) hashlist = self._get_pending_tx_hashes() txpool_current = pd...
gets list of all txhash in txpool at block and appends to dataframe
egs/egs_ref.py
append_current_txp
ethgasstation/ethgasstation-adaptive-oracle
47
python
def append_current_txp(self): current_block = web3.eth.blockNumber try: console.info((('getting txpool hashes at block ' + str(current_block)) + ' ...')) hashlist = self._get_pending_tx_hashes() txpool_current = pd.DataFrame(index=hashlist) txpool_current['block'] = current_...
def append_current_txp(self): current_block = web3.eth.blockNumber try: console.info((('getting txpool hashes at block ' + str(current_block)) + ' ...')) hashlist = self._get_pending_tx_hashes() txpool_current = pd.DataFrame(index=hashlist) txpool_current['block'] = current_...
c7d28abecf2517e7133e08cd719d829c5e721a95a861c17151dde376eb44ce3d
def make_txpool_block(self, block, alltx): 'gets txhash from all transactions in txpool at block and merges the data from alltx' txpool_block = self.txpool_df.loc[(self.txpool_df['block'] == block)] if (not txpool_block.empty): txpool_block = txpool_block.drop(['block'], axis=1) alltx.loc[(a...
gets txhash from all transactions in txpool at block and merges the data from alltx
egs/egs_ref.py
make_txpool_block
ethgasstation/ethgasstation-adaptive-oracle
47
python
def make_txpool_block(self, block, alltx): txpool_block = self.txpool_df.loc[(self.txpool_df['block'] == block)] if (not txpool_block.empty): txpool_block = txpool_block.drop(['block'], axis=1) alltx.loc[(alltx.index.isin(txpool_block.index), 'in_txp')] = block txpool_block = txpool...
def make_txpool_block(self, block, alltx): txpool_block = self.txpool_df.loc[(self.txpool_df['block'] == block)] if (not txpool_block.empty): txpool_block = txpool_block.drop(['block'], axis=1) alltx.loc[(alltx.index.isin(txpool_block.index), 'in_txp')] = block txpool_block = txpool...
95fee4334bc707d91689e48b6d7e621fefe59326dfe6f1e47151781aded443ca
def process_block_data(self, block_transactions_df, block_obj): 'gets block-level summary data and append to block dataframe' console.debug('Processing block data...') if (len(block_obj.transactions) > 0): block_transactions_df['weighted_fee'] = (block_transactions_df['round_gp_10gwei'] * block_tran...
gets block-level summary data and append to block dataframe
egs/egs_ref.py
process_block_data
ethgasstation/ethgasstation-adaptive-oracle
47
python
def process_block_data(self, block_transactions_df, block_obj): console.debug('Processing block data...') if (len(block_obj.transactions) > 0): block_transactions_df['weighted_fee'] = (block_transactions_df['round_gp_10gwei'] * block_transactions_df['gas_offered']) block_mingasprice = block...
def process_block_data(self, block_transactions_df, block_obj): console.debug('Processing block data...') if (len(block_obj.transactions) > 0): block_transactions_df['weighted_fee'] = (block_transactions_df['round_gp_10gwei'] * block_transactions_df['gas_offered']) block_mingasprice = block...
be47456a184558f7b554d6fbda97f5a3df0258d7d423ef8d470db7727d6fc510
def analyze_last200blocks(self, block): 'analyzes % of last 200 blocks by min mined gas price, summary stats ' blockdata = self.blockdata_df recent_blocks = blockdata.loc[((blockdata['block_number'] > (block - 200)), ['mingasprice', 'block_number', 'gaslimit', 'time_mined', 'speed'])] gaslimit = recent_...
analyzes % of last 200 blocks by min mined gas price, summary stats
egs/egs_ref.py
analyze_last200blocks
ethgasstation/ethgasstation-adaptive-oracle
47
python
def analyze_last200blocks(self, block): ' ' blockdata = self.blockdata_df recent_blocks = blockdata.loc[((blockdata['block_number'] > (block - 200)), ['mingasprice', 'block_number', 'gaslimit', 'time_mined', 'speed'])] gaslimit = recent_blocks['gaslimit'].mean() last10 = recent_blocks.sort_values('b...
def analyze_last200blocks(self, block): ' ' blockdata = self.blockdata_df recent_blocks = blockdata.loc[((blockdata['block_number'] > (block - 200)), ['mingasprice', 'block_number', 'gaslimit', 'time_mined', 'speed'])] gaslimit = recent_blocks['gaslimit'].mean() last10 = recent_blocks.sort_values('b...
667ce0256e8718188d56fcae546d1e1d5e2a0ee7beef756e2005a7bef3808330
def write_to_sql(self): 'write data to mysql for analysis' self.blockdata_df = self.blockdata_df.sort_values(by=['block_number'], ascending=False) self.blockdata_df = self.blockdata_df.head(1500) self.blockdata_df.to_sql(con=engine, name='blockdata2', if_exists='replace', index=False) console.info((...
write data to mysql for analysis
egs/egs_ref.py
write_to_sql
ethgasstation/ethgasstation-adaptive-oracle
47
python
def write_to_sql(self): self.blockdata_df = self.blockdata_df.sort_values(by=['block_number'], ascending=False) self.blockdata_df = self.blockdata_df.head(1500) self.blockdata_df.to_sql(con=engine, name='blockdata2', if_exists='replace', index=False) console.info((('wrote ' + str(len(self.blockdata...
def write_to_sql(self): self.blockdata_df = self.blockdata_df.sort_values(by=['block_number'], ascending=False) self.blockdata_df = self.blockdata_df.head(1500) self.blockdata_df.to_sql(con=engine, name='blockdata2', if_exists='replace', index=False) console.info((('wrote ' + str(len(self.blockdata...
fe86d9efa482b58236dacac41b2733e59740e39f7cdb3e5a0007755c73a49994
def prune(self, block): 'keep dataframes and databases from getting too big' console.info('pruning blockdata') deleteBlock = (block - 5000) self.blockdata_df = self.blockdata_df.loc[(self.blockdata_df['block_number'] > deleteBlock)]
keep dataframes and databases from getting too big
egs/egs_ref.py
prune
ethgasstation/ethgasstation-adaptive-oracle
47
python
def prune(self, block): console.info('pruning blockdata') deleteBlock = (block - 5000) self.blockdata_df = self.blockdata_df.loc[(self.blockdata_df['block_number'] > deleteBlock)]
def prune(self, block): console.info('pruning blockdata') deleteBlock = (block - 5000) self.blockdata_df = self.blockdata_df.loc[(self.blockdata_df['block_number'] > deleteBlock)]<|docstring|>keep dataframes and databases from getting too big<|endoftext|>
5f0b9865b5b0deaaf80ad116c0b9d84b100344c645791d7a19494cea41499d64
def load_txdata(self): 'load data from mysql into dataframes' try: ins = inspect(engine) if ('alltx' in ins.get_table_names()): alltx = pd.read_sql('SELECT * from alltx order by block_posted desc limit 100000', con=engine) alltx.set_index('index', drop=True, inplace=True)...
load data from mysql into dataframes
egs/egs_ref.py
load_txdata
ethgasstation/ethgasstation-adaptive-oracle
47
python
def load_txdata(self): try: ins = inspect(engine) if ('alltx' in ins.get_table_names()): alltx = pd.read_sql('SELECT * from alltx order by block_posted desc limit 100000', con=engine) alltx.set_index('index', drop=True, inplace=True) if ('level_0' in alltx.co...
def load_txdata(self): try: ins = inspect(engine) if ('alltx' in ins.get_table_names()): alltx = pd.read_sql('SELECT * from alltx order by block_posted desc limit 100000', con=engine) alltx.set_index('index', drop=True, inplace=True) if ('level_0' in alltx.co...
1f9667573f9cf9599f1fd5996cf4176f08b5adc2c9588a3695731ea8e4a2210d
def listen(self): 'listens for new pending tx and adds them to the alltx dataframe' current_block = web3.eth.blockNumber console.info((('listening for new transactions at block ' + str(current_block)) + '....')) self.new_tx_list = [] try: while True: if (self.process_block < (cur...
listens for new pending tx and adds them to the alltx dataframe
egs/egs_ref.py
listen
ethgasstation/ethgasstation-adaptive-oracle
47
python
def listen(self): current_block = web3.eth.blockNumber console.info((('listening for new transactions at block ' + str(current_block)) + '....')) self.new_tx_list = [] try: while True: if (self.process_block < (current_block - 5)): console.warn('blocks jumped, sk...
def listen(self): current_block = web3.eth.blockNumber console.info((('listening for new transactions at block ' + str(current_block)) + '....')) self.new_tx_list = [] try: while True: if (self.process_block < (current_block - 5)): console.warn('blocks jumped, sk...