hexsha
string | size
int64 | ext
string | lang
string | max_stars_repo_path
string | max_stars_repo_name
string | max_stars_repo_head_hexsha
string | max_stars_repo_licenses
list | max_stars_count
int64 | max_stars_repo_stars_event_min_datetime
string | max_stars_repo_stars_event_max_datetime
string | max_issues_repo_path
string | max_issues_repo_name
string | max_issues_repo_head_hexsha
string | max_issues_repo_licenses
list | max_issues_count
int64 | max_issues_repo_issues_event_min_datetime
string | max_issues_repo_issues_event_max_datetime
string | max_forks_repo_path
string | max_forks_repo_name
string | max_forks_repo_head_hexsha
string | max_forks_repo_licenses
list | max_forks_count
int64 | max_forks_repo_forks_event_min_datetime
string | max_forks_repo_forks_event_max_datetime
string | content
string | avg_line_length
float64 | max_line_length
int64 | alphanum_fraction
float64 | qsc_code_num_words_quality_signal
int64 | qsc_code_num_chars_quality_signal
float64 | qsc_code_mean_word_length_quality_signal
float64 | qsc_code_frac_words_unique_quality_signal
float64 | qsc_code_frac_chars_top_2grams_quality_signal
float64 | qsc_code_frac_chars_top_3grams_quality_signal
float64 | qsc_code_frac_chars_top_4grams_quality_signal
float64 | qsc_code_frac_chars_dupe_5grams_quality_signal
float64 | qsc_code_frac_chars_dupe_6grams_quality_signal
float64 | qsc_code_frac_chars_dupe_7grams_quality_signal
float64 | qsc_code_frac_chars_dupe_8grams_quality_signal
float64 | qsc_code_frac_chars_dupe_9grams_quality_signal
float64 | qsc_code_frac_chars_dupe_10grams_quality_signal
float64 | qsc_code_frac_chars_replacement_symbols_quality_signal
float64 | qsc_code_frac_chars_digital_quality_signal
float64 | qsc_code_frac_chars_whitespace_quality_signal
float64 | qsc_code_size_file_byte_quality_signal
float64 | qsc_code_num_lines_quality_signal
float64 | qsc_code_num_chars_line_max_quality_signal
float64 | qsc_code_num_chars_line_mean_quality_signal
float64 | qsc_code_frac_chars_alphabet_quality_signal
float64 | qsc_code_frac_chars_comments_quality_signal
float64 | qsc_code_cate_xml_start_quality_signal
float64 | qsc_code_frac_lines_dupe_lines_quality_signal
float64 | qsc_code_cate_autogen_quality_signal
float64 | qsc_code_frac_lines_long_string_quality_signal
float64 | qsc_code_frac_chars_string_length_quality_signal
float64 | qsc_code_frac_chars_long_word_length_quality_signal
float64 | qsc_code_frac_lines_string_concat_quality_signal
float64 | qsc_code_cate_encoded_data_quality_signal
float64 | qsc_code_frac_chars_hex_words_quality_signal
float64 | qsc_code_frac_lines_prompt_comments_quality_signal
float64 | qsc_code_frac_lines_assert_quality_signal
float64 | qsc_codepython_cate_ast_quality_signal
float64 | qsc_codepython_frac_lines_func_ratio_quality_signal
float64 | qsc_codepython_cate_var_zero_quality_signal
bool | qsc_codepython_frac_lines_pass_quality_signal
float64 | qsc_codepython_frac_lines_import_quality_signal
float64 | qsc_codepython_frac_lines_simplefunc_quality_signal
float64 | qsc_codepython_score_lines_no_logic_quality_signal
float64 | qsc_codepython_frac_lines_print_quality_signal
float64 | qsc_code_num_words
int64 | qsc_code_num_chars
int64 | qsc_code_mean_word_length
int64 | qsc_code_frac_words_unique
null | qsc_code_frac_chars_top_2grams
int64 | qsc_code_frac_chars_top_3grams
int64 | qsc_code_frac_chars_top_4grams
int64 | qsc_code_frac_chars_dupe_5grams
int64 | qsc_code_frac_chars_dupe_6grams
int64 | qsc_code_frac_chars_dupe_7grams
int64 | qsc_code_frac_chars_dupe_8grams
int64 | qsc_code_frac_chars_dupe_9grams
int64 | qsc_code_frac_chars_dupe_10grams
int64 | qsc_code_frac_chars_replacement_symbols
int64 | qsc_code_frac_chars_digital
int64 | qsc_code_frac_chars_whitespace
int64 | qsc_code_size_file_byte
int64 | qsc_code_num_lines
int64 | qsc_code_num_chars_line_max
int64 | qsc_code_num_chars_line_mean
int64 | qsc_code_frac_chars_alphabet
int64 | qsc_code_frac_chars_comments
int64 | qsc_code_cate_xml_start
int64 | qsc_code_frac_lines_dupe_lines
int64 | qsc_code_cate_autogen
int64 | qsc_code_frac_lines_long_string
int64 | qsc_code_frac_chars_string_length
int64 | qsc_code_frac_chars_long_word_length
int64 | qsc_code_frac_lines_string_concat
null | qsc_code_cate_encoded_data
int64 | qsc_code_frac_chars_hex_words
int64 | qsc_code_frac_lines_prompt_comments
int64 | qsc_code_frac_lines_assert
int64 | qsc_codepython_cate_ast
int64 | qsc_codepython_frac_lines_func_ratio
int64 | qsc_codepython_cate_var_zero
int64 | qsc_codepython_frac_lines_pass
int64 | qsc_codepython_frac_lines_import
int64 | qsc_codepython_frac_lines_simplefunc
int64 | qsc_codepython_score_lines_no_logic
int64 | qsc_codepython_frac_lines_print
int64 | effective
string | hits
int64 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
52deb96a0502822c9ce5621f2986c2f9ac1e91d5
| 53
|
py
|
Python
|
django_floc_disable/__init__.py
|
nhymxu/django-floc-disable
|
ac98ad18e14d56d1fd52ddab85e54a8c8cf2da3b
|
[
"MIT"
] | 1
|
2021-05-15T12:35:27.000Z
|
2021-05-15T12:35:27.000Z
|
django_floc_disable/__init__.py
|
nhymxu/django-floc-disable
|
ac98ad18e14d56d1fd52ddab85e54a8c8cf2da3b
|
[
"MIT"
] | 2
|
2021-05-12T13:33:44.000Z
|
2021-05-13T14:11:47.000Z
|
django_floc_disable/__init__.py
|
nhymxu/django-floc-disable
|
ac98ad18e14d56d1fd52ddab85e54a8c8cf2da3b
|
[
"MIT"
] | null | null | null |
from django_floc_disable._version import __version__
| 26.5
| 52
| 0.90566
| 7
| 53
| 5.857143
| 0.857143
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.075472
| 53
| 1
| 53
| 53
| 0.836735
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
52ed097c74b35158f93e5394028b16f64472f4d5
| 19,804
|
py
|
Python
|
dotastats/migrations/0001_initial.py
|
romanalexander/opendota
|
e0ad79db9b425055a5a3ed40be793ddfb082ecd8
|
[
"MIT"
] | 14
|
2016-08-31T15:21:59.000Z
|
2021-03-24T07:11:07.000Z
|
dotastats/migrations/0001_initial.py
|
romanalexander/opendota
|
e0ad79db9b425055a5a3ed40be793ddfb082ecd8
|
[
"MIT"
] | 1
|
2017-09-07T01:13:49.000Z
|
2017-09-07T01:13:49.000Z
|
dotastats/migrations/0001_initial.py
|
romanalexander/opendota
|
e0ad79db9b425055a5a3ed40be793ddfb082ecd8
|
[
"MIT"
] | 6
|
2016-09-06T04:45:28.000Z
|
2019-07-19T17:13:41.000Z
|
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'SteamPlayer'
db.create_table('dotastats_steamplayer', (
('steamid', self.gf('django.db.models.fields.BigIntegerField')(unique=True, primary_key=True)),
('last_refresh', self.gf('django.db.models.fields.DateTimeField')(auto_now=True, auto_now_add=True, db_index=True, blank=True)),
('personaname', self.gf('django.db.models.fields.TextField')()),
('profileurl', self.gf('django.db.models.fields.TextField')(blank=True)),
('avatar', self.gf('django.db.models.fields.TextField')(blank=True)),
('avatarmedium', self.gf('django.db.models.fields.TextField')(blank=True)),
('avatarfull', self.gf('django.db.models.fields.TextField')(blank=True)),
('lastlogoff', self.gf('django.db.models.fields.DateTimeField')(null=True)),
))
db.send_create_signal('dotastats', ['SteamPlayer'])
# Adding model 'Items'
db.create_table('dotastats_items', (
('item_id', self.gf('django.db.models.fields.IntegerField')(primary_key=True)),
('client_name', self.gf('django.db.models.fields.TextField')()),
))
db.send_create_signal('dotastats', ['Items'])
# Adding model 'Heroes'
db.create_table('dotastats_heroes', (
('hero_id', self.gf('django.db.models.fields.IntegerField')(primary_key=True)),
('client_name', self.gf('django.db.models.fields.TextField')()),
('dota2_name', self.gf('django.db.models.fields.TextField')()),
))
db.send_create_signal('dotastats', ['Heroes'])
# Adding model 'MatchHistoryQueue'
db.create_table('dotastats_matchhistoryqueue', (
('match_id', self.gf('django.db.models.fields.BigIntegerField')(unique=True, primary_key=True)),
('last_refresh', self.gf('django.db.models.fields.DateTimeField')(auto_now=True, auto_now_add=True, blank=True)),
('match_seq_num', self.gf('django.db.models.fields.BigIntegerField')()),
('start_time', self.gf('django.db.models.fields.DateTimeField')()),
('lobby_type', self.gf('django.db.models.fields.IntegerField')()),
))
db.send_create_signal('dotastats', ['MatchHistoryQueue'])
# Adding model 'MatchHistoryQueuePlayers'
db.create_table('dotastats_matchhistoryqueueplayers', (
('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
('match_history_queue', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['dotastats.MatchHistoryQueue'])),
('account_id', self.gf('django.db.models.fields.related.ForeignKey')(related_name='+', null=True, db_column='account_id', to=orm['dotastats.SteamPlayer'])),
('player_slot', self.gf('django.db.models.fields.IntegerField')()),
('hero_id', self.gf('django.db.models.fields.related.ForeignKey')(related_name='+', db_column='hero_id', to=orm['dotastats.Heroes'])),
('is_bot', self.gf('django.db.models.fields.BooleanField')(default=False)),
))
db.send_create_signal('dotastats', ['MatchHistoryQueuePlayers'])
# Adding unique constraint on 'MatchHistoryQueuePlayers', fields ['match_history_queue', 'hero_id', 'player_slot']
db.create_unique('dotastats_matchhistoryqueueplayers', ['match_history_queue_id', 'hero_id', 'player_slot'])
# Adding model 'MatchDetails'
db.create_table('dotastats_matchdetails', (
('match_id', self.gf('django.db.models.fields.BigIntegerField')(unique=True, primary_key=True)),
('last_refresh', self.gf('django.db.models.fields.DateTimeField')(auto_now=True, auto_now_add=True, blank=True)),
('match_seq_num', self.gf('django.db.models.fields.BigIntegerField')()),
('season', self.gf('django.db.models.fields.IntegerField')()),
('radiant_win', self.gf('django.db.models.fields.BooleanField')(default=False)),
('duration', self.gf('django.db.models.fields.IntegerField')()),
('start_time', self.gf('django.db.models.fields.DateTimeField')()),
('tower_status_radiant', self.gf('django.db.models.fields.IntegerField')()),
('tower_status_dire', self.gf('django.db.models.fields.IntegerField')()),
('barracks_status_radiant', self.gf('django.db.models.fields.IntegerField')()),
('barracks_status_dire', self.gf('django.db.models.fields.IntegerField')()),
('cluster', self.gf('django.db.models.fields.IntegerField')()),
('first_blood_time', self.gf('django.db.models.fields.IntegerField')()),
('lobby_type', self.gf('django.db.models.fields.IntegerField')()),
('human_players', self.gf('django.db.models.fields.IntegerField')()),
('leagueid', self.gf('django.db.models.fields.IntegerField')()),
('positive_votes', self.gf('django.db.models.fields.IntegerField')()),
('negative_votes', self.gf('django.db.models.fields.IntegerField')()),
('game_mode', self.gf('django.db.models.fields.IntegerField')()),
))
db.send_create_signal('dotastats', ['MatchDetails'])
# Adding model 'MatchPicksBans'
db.create_table('dotastats_matchpicksbans', (
('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
('match_details', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['dotastats.MatchDetails'])),
('is_pick', self.gf('django.db.models.fields.BooleanField')(default=False)),
('hero_id', self.gf('django.db.models.fields.related.ForeignKey')(related_name='+', db_column='hero_id', to=orm['dotastats.Heroes'])),
('team', self.gf('django.db.models.fields.IntegerField')()),
('order', self.gf('django.db.models.fields.IntegerField')()),
))
db.send_create_signal('dotastats', ['MatchPicksBans'])
# Adding unique constraint on 'MatchPicksBans', fields ['match_details', 'hero_id', 'order']
db.create_unique('dotastats_matchpicksbans', ['match_details_id', 'hero_id', 'order'])
# Adding model 'MatchDetailsPlayerEntry'
db.create_table('dotastats_matchdetailsplayerentry', (
('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
('match_details', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['dotastats.MatchDetails'])),
('account_id', self.gf('django.db.models.fields.related.ForeignKey')(related_name='+', null=True, db_column='account_id', to=orm['dotastats.SteamPlayer'])),
('player_slot', self.gf('django.db.models.fields.IntegerField')()),
('hero_id', self.gf('django.db.models.fields.related.ForeignKey')(related_name='+', db_column='hero_id', to=orm['dotastats.Heroes'])),
('item_0', self.gf('django.db.models.fields.related.ForeignKey')(related_name='+', null=True, db_column='item_0', to=orm['dotastats.Items'])),
('item_1', self.gf('django.db.models.fields.related.ForeignKey')(related_name='+', null=True, db_column='item_1', to=orm['dotastats.Items'])),
('item_2', self.gf('django.db.models.fields.related.ForeignKey')(related_name='+', null=True, db_column='item_2', to=orm['dotastats.Items'])),
('item_3', self.gf('django.db.models.fields.related.ForeignKey')(related_name='+', null=True, db_column='item_3', to=orm['dotastats.Items'])),
('item_4', self.gf('django.db.models.fields.related.ForeignKey')(related_name='+', null=True, db_column='item_4', to=orm['dotastats.Items'])),
('item_5', self.gf('django.db.models.fields.related.ForeignKey')(related_name='+', null=True, db_column='item_5', to=orm['dotastats.Items'])),
('kills', self.gf('django.db.models.fields.IntegerField')()),
('deaths', self.gf('django.db.models.fields.IntegerField')()),
('assists', self.gf('django.db.models.fields.IntegerField')()),
('leaver_status', self.gf('django.db.models.fields.IntegerField')(null=True)),
('gold', self.gf('django.db.models.fields.IntegerField')()),
('last_hits', self.gf('django.db.models.fields.IntegerField')()),
('denies', self.gf('django.db.models.fields.IntegerField')()),
('gold_per_min', self.gf('django.db.models.fields.IntegerField')()),
('xp_per_min', self.gf('django.db.models.fields.IntegerField')()),
('gold_spent', self.gf('django.db.models.fields.IntegerField')()),
('hero_damage', self.gf('django.db.models.fields.IntegerField')()),
('tower_damage', self.gf('django.db.models.fields.IntegerField')()),
('hero_healing', self.gf('django.db.models.fields.IntegerField')()),
('level', self.gf('django.db.models.fields.IntegerField')()),
('ability_upgrades', self.gf('django.db.models.fields.TextField')(null=True)),
('is_bot', self.gf('django.db.models.fields.BooleanField')(default=False)),
))
db.send_create_signal('dotastats', ['MatchDetailsPlayerEntry'])
# Adding unique constraint on 'MatchDetailsPlayerEntry', fields ['match_details', 'hero_id', 'player_slot']
db.create_unique('dotastats_matchdetailsplayerentry', ['match_details_id', 'hero_id', 'player_slot'])
def backwards(self, orm):
# Removing unique constraint on 'MatchDetailsPlayerEntry', fields ['match_details', 'hero_id', 'player_slot']
db.delete_unique('dotastats_matchdetailsplayerentry', ['match_details_id', 'hero_id', 'player_slot'])
# Removing unique constraint on 'MatchPicksBans', fields ['match_details', 'hero_id', 'order']
db.delete_unique('dotastats_matchpicksbans', ['match_details_id', 'hero_id', 'order'])
# Removing unique constraint on 'MatchHistoryQueuePlayers', fields ['match_history_queue', 'hero_id', 'player_slot']
db.delete_unique('dotastats_matchhistoryqueueplayers', ['match_history_queue_id', 'hero_id', 'player_slot'])
# Deleting model 'SteamPlayer'
db.delete_table('dotastats_steamplayer')
# Deleting model 'Items'
db.delete_table('dotastats_items')
# Deleting model 'Heroes'
db.delete_table('dotastats_heroes')
# Deleting model 'MatchHistoryQueue'
db.delete_table('dotastats_matchhistoryqueue')
# Deleting model 'MatchHistoryQueuePlayers'
db.delete_table('dotastats_matchhistoryqueueplayers')
# Deleting model 'MatchDetails'
db.delete_table('dotastats_matchdetails')
# Deleting model 'MatchPicksBans'
db.delete_table('dotastats_matchpicksbans')
# Deleting model 'MatchDetailsPlayerEntry'
db.delete_table('dotastats_matchdetailsplayerentry')
models = {
'dotastats.heroes': {
'Meta': {'object_name': 'Heroes'},
'client_name': ('django.db.models.fields.TextField', [], {}),
'dota2_name': ('django.db.models.fields.TextField', [], {}),
'hero_id': ('django.db.models.fields.IntegerField', [], {'primary_key': 'True'})
},
'dotastats.items': {
'Meta': {'object_name': 'Items'},
'client_name': ('django.db.models.fields.TextField', [], {}),
'item_id': ('django.db.models.fields.IntegerField', [], {'primary_key': 'True'})
},
'dotastats.matchdetails': {
'Meta': {'ordering': "('match_id',)", 'object_name': 'MatchDetails'},
'barracks_status_dire': ('django.db.models.fields.IntegerField', [], {}),
'barracks_status_radiant': ('django.db.models.fields.IntegerField', [], {}),
'cluster': ('django.db.models.fields.IntegerField', [], {}),
'duration': ('django.db.models.fields.IntegerField', [], {}),
'first_blood_time': ('django.db.models.fields.IntegerField', [], {}),
'game_mode': ('django.db.models.fields.IntegerField', [], {}),
'human_players': ('django.db.models.fields.IntegerField', [], {}),
'last_refresh': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'auto_now_add': 'True', 'blank': 'True'}),
'leagueid': ('django.db.models.fields.IntegerField', [], {}),
'lobby_type': ('django.db.models.fields.IntegerField', [], {}),
'match_id': ('django.db.models.fields.BigIntegerField', [], {'unique': 'True', 'primary_key': 'True'}),
'match_seq_num': ('django.db.models.fields.BigIntegerField', [], {}),
'negative_votes': ('django.db.models.fields.IntegerField', [], {}),
'positive_votes': ('django.db.models.fields.IntegerField', [], {}),
'radiant_win': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'season': ('django.db.models.fields.IntegerField', [], {}),
'start_time': ('django.db.models.fields.DateTimeField', [], {}),
'tower_status_dire': ('django.db.models.fields.IntegerField', [], {}),
'tower_status_radiant': ('django.db.models.fields.IntegerField', [], {})
},
'dotastats.matchdetailsplayerentry': {
'Meta': {'ordering': "('player_slot',)", 'unique_together': "(('match_details', 'hero_id', 'player_slot'),)", 'object_name': 'MatchDetailsPlayerEntry'},
'ability_upgrades': ('django.db.models.fields.TextField', [], {'null': 'True'}),
'account_id': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'+'", 'null': 'True', 'db_column': "'account_id'", 'to': "orm['dotastats.SteamPlayer']"}),
'assists': ('django.db.models.fields.IntegerField', [], {}),
'deaths': ('django.db.models.fields.IntegerField', [], {}),
'denies': ('django.db.models.fields.IntegerField', [], {}),
'gold': ('django.db.models.fields.IntegerField', [], {}),
'gold_per_min': ('django.db.models.fields.IntegerField', [], {}),
'gold_spent': ('django.db.models.fields.IntegerField', [], {}),
'hero_damage': ('django.db.models.fields.IntegerField', [], {}),
'hero_healing': ('django.db.models.fields.IntegerField', [], {}),
'hero_id': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'+'", 'db_column': "'hero_id'", 'to': "orm['dotastats.Heroes']"}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'is_bot': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'item_0': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'+'", 'null': 'True', 'db_column': "'item_0'", 'to': "orm['dotastats.Items']"}),
'item_1': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'+'", 'null': 'True', 'db_column': "'item_1'", 'to': "orm['dotastats.Items']"}),
'item_2': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'+'", 'null': 'True', 'db_column': "'item_2'", 'to': "orm['dotastats.Items']"}),
'item_3': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'+'", 'null': 'True', 'db_column': "'item_3'", 'to': "orm['dotastats.Items']"}),
'item_4': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'+'", 'null': 'True', 'db_column': "'item_4'", 'to': "orm['dotastats.Items']"}),
'item_5': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'+'", 'null': 'True', 'db_column': "'item_5'", 'to': "orm['dotastats.Items']"}),
'kills': ('django.db.models.fields.IntegerField', [], {}),
'last_hits': ('django.db.models.fields.IntegerField', [], {}),
'leaver_status': ('django.db.models.fields.IntegerField', [], {'null': 'True'}),
'level': ('django.db.models.fields.IntegerField', [], {}),
'match_details': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['dotastats.MatchDetails']"}),
'player_slot': ('django.db.models.fields.IntegerField', [], {}),
'tower_damage': ('django.db.models.fields.IntegerField', [], {}),
'xp_per_min': ('django.db.models.fields.IntegerField', [], {})
},
'dotastats.matchhistoryqueue': {
'Meta': {'object_name': 'MatchHistoryQueue'},
'last_refresh': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'auto_now_add': 'True', 'blank': 'True'}),
'lobby_type': ('django.db.models.fields.IntegerField', [], {}),
'match_id': ('django.db.models.fields.BigIntegerField', [], {'unique': 'True', 'primary_key': 'True'}),
'match_seq_num': ('django.db.models.fields.BigIntegerField', [], {}),
'start_time': ('django.db.models.fields.DateTimeField', [], {})
},
'dotastats.matchhistoryqueueplayers': {
'Meta': {'ordering': "('player_slot',)", 'unique_together': "(('match_history_queue', 'hero_id', 'player_slot'),)", 'object_name': 'MatchHistoryQueuePlayers'},
'account_id': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'+'", 'null': 'True', 'db_column': "'account_id'", 'to': "orm['dotastats.SteamPlayer']"}),
'hero_id': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'+'", 'db_column': "'hero_id'", 'to': "orm['dotastats.Heroes']"}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'is_bot': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'match_history_queue': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['dotastats.MatchHistoryQueue']"}),
'player_slot': ('django.db.models.fields.IntegerField', [], {})
},
'dotastats.matchpicksbans': {
'Meta': {'ordering': "('order',)", 'unique_together': "(('match_details', 'hero_id', 'order'),)", 'object_name': 'MatchPicksBans'},
'hero_id': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'+'", 'db_column': "'hero_id'", 'to': "orm['dotastats.Heroes']"}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'is_pick': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'match_details': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['dotastats.MatchDetails']"}),
'order': ('django.db.models.fields.IntegerField', [], {}),
'team': ('django.db.models.fields.IntegerField', [], {})
},
'dotastats.steamplayer': {
'Meta': {'object_name': 'SteamPlayer'},
'avatar': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
'avatarfull': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
'avatarmedium': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
'last_refresh': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}),
'lastlogoff': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}),
'personaname': ('django.db.models.fields.TextField', [], {}),
'profileurl': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
'steamid': ('django.db.models.fields.BigIntegerField', [], {'unique': 'True', 'primary_key': 'True'})
}
}
complete_apps = ['dotastats']
| 72.014545
| 185
| 0.61432
| 2,098
| 19,804
| 5.629171
| 0.06816
| 0.103641
| 0.180186
| 0.257409
| 0.833362
| 0.825233
| 0.788654
| 0.618205
| 0.558764
| 0.487807
| 0
| 0.001716
| 0.175975
| 19,804
| 275
| 186
| 72.014545
| 0.721981
| 0.057716
| 0
| 0.25
| 0
| 0
| 0.55022
| 0.372626
| 0
| 0
| 0
| 0
| 0
| 1
| 0.008929
| false
| 0
| 0.017857
| 0
| 0.040179
| 0
| 0
| 0
| 0
| null | 0
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
5e0162db74e57eb3ecbec3d64657852719779813
| 1,912
|
py
|
Python
|
backend/task/migrations/0006_auto_20210608_1738.py
|
DRP-33/drp-name-in-progress
|
47518bb77090a9fbd87561c4fc37850008e1c782
|
[
"MIT"
] | null | null | null |
backend/task/migrations/0006_auto_20210608_1738.py
|
DRP-33/drp-name-in-progress
|
47518bb77090a9fbd87561c4fc37850008e1c782
|
[
"MIT"
] | null | null | null |
backend/task/migrations/0006_auto_20210608_1738.py
|
DRP-33/drp-name-in-progress
|
47518bb77090a9fbd87561c4fc37850008e1c782
|
[
"MIT"
] | null | null | null |
# Generated by Django 3.2.3 on 2021-06-08 15:38
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('task', '0005_auto_20210603_1558'),
]
operations = [
migrations.AlterField(
model_name='task',
name='acceptor_id',
field=models.BigIntegerField(blank=True, null=True),
),
migrations.AlterField(
model_name='task',
name='d_latitude',
field=models.DecimalField(blank=True, decimal_places=6, max_digits=10, null=True),
),
migrations.AlterField(
model_name='task',
name='d_longitude',
field=models.DecimalField(blank=True, decimal_places=6, max_digits=10, null=True),
),
migrations.AlterField(
model_name='task',
name='delivery_addr',
field=models.CharField(blank=True, max_length=100, null=True),
),
migrations.AlterField(
model_name='task',
name='phone_number',
field=models.CharField(blank=True, max_length=16, null=True),
),
migrations.AlterField(
model_name='task',
name='s_latitude',
field=models.DecimalField(blank=True, decimal_places=6, max_digits=10, null=True),
),
migrations.AlterField(
model_name='task',
name='s_longitude',
field=models.DecimalField(blank=True, decimal_places=6, max_digits=10, null=True),
),
migrations.AlterField(
model_name='task',
name='store_addr',
field=models.CharField(blank=True, max_length=100, null=True),
),
migrations.AlterField(
model_name='task',
name='title',
field=models.CharField(blank=True, max_length=50, null=True),
),
]
| 32.40678
| 94
| 0.572176
| 199
| 1,912
| 5.336683
| 0.286432
| 0.169492
| 0.211864
| 0.245763
| 0.780603
| 0.780603
| 0.745763
| 0.6742
| 0.6742
| 0.585687
| 0
| 0.04003
| 0.307531
| 1,912
| 58
| 95
| 32.965517
| 0.762085
| 0.023536
| 0
| 0.634615
| 1
| 0
| 0.083646
| 0.012332
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.019231
| 0
| 0.076923
| 0
| 0
| 0
| 0
| null | 0
| 1
| 1
| 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
5e218a8c7b58cdcae336573ab9c01d05875bae7d
| 104
|
py
|
Python
|
website/CustomFilters.py
|
sousic/flask.huny.kr
|
53a8f5af1fa63b290a4e97278a86328758e97d43
|
[
"MIT"
] | null | null | null |
website/CustomFilters.py
|
sousic/flask.huny.kr
|
53a8f5af1fa63b290a4e97278a86328758e97d43
|
[
"MIT"
] | null | null | null |
website/CustomFilters.py
|
sousic/flask.huny.kr
|
53a8f5af1fa63b290a4e97278a86328758e97d43
|
[
"MIT"
] | null | null | null |
# -*- coding: UTF-8 -*-
# 숫자 포멧팅
def filter_number_format(value):
return "{:,}".format(int(value))
| 17.333333
| 36
| 0.605769
| 14
| 104
| 4.357143
| 0.857143
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.011494
| 0.163462
| 104
| 5
| 37
| 20.8
| 0.689655
| 0.269231
| 0
| 0
| 0
| 0
| 0.054795
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.5
| false
| 0
| 0
| 0.5
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 1
| 0
|
0
| 5
|
eaeacd0953c33b1e5c5c615eef66bdea563340c3
| 58
|
py
|
Python
|
src/flask_flamegraph/__init__.py
|
dorianbrown/flask-flamegraph
|
71a29ac6085a3b1dca8231e63cc009b8f3d8052d
|
[
"MIT"
] | 5
|
2019-03-27T04:17:07.000Z
|
2021-08-13T16:43:09.000Z
|
src/flask_flamegraph/__init__.py
|
dorianbrown/flask-flamegraph
|
71a29ac6085a3b1dca8231e63cc009b8f3d8052d
|
[
"MIT"
] | null | null | null |
src/flask_flamegraph/__init__.py
|
dorianbrown/flask-flamegraph
|
71a29ac6085a3b1dca8231e63cc009b8f3d8052d
|
[
"MIT"
] | 2
|
2019-03-27T06:42:18.000Z
|
2021-12-08T14:43:16.000Z
|
from flask_flamegraph.wsgi import FlaskFlamegraph # noqa
| 29
| 57
| 0.844828
| 7
| 58
| 6.857143
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.12069
| 58
| 1
| 58
| 58
| 0.941176
| 0.068966
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
d8242d1b658b32ae5ca53b3da153d3f1f188e58e
| 26
|
py
|
Python
|
vaccineAvailabilityNotifier/client/resources.py
|
bhaskernitt/vaccine-availability-notifier
|
20d020b2050ca76dca190dc6e767dcc5697339b8
|
[
"MIT"
] | null | null | null |
vaccineAvailabilityNotifier/client/resources.py
|
bhaskernitt/vaccine-availability-notifier
|
20d020b2050ca76dca190dc6e767dcc5697339b8
|
[
"MIT"
] | null | null | null |
vaccineAvailabilityNotifier/client/resources.py
|
bhaskernitt/vaccine-availability-notifier
|
20d020b2050ca76dca190dc6e767dcc5697339b8
|
[
"MIT"
] | null | null | null |
class Resources:
pass
| 8.666667
| 16
| 0.692308
| 3
| 26
| 6
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.269231
| 26
| 2
| 17
| 13
| 0.947368
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0.5
| 0
| 0
| 0.5
| 0
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| 0
| 0
|
0
| 5
|
dc2921eef97407f0eabc3633af58e4b2a6f74d78
| 401
|
py
|
Python
|
posthog/queries/abstract_test/test_breakdown_filtering.py
|
FarazPatankar/posthog
|
dddf2644376d0fd6836ed96c139f6a825c74202f
|
[
"MIT"
] | 7,409
|
2020-02-09T23:18:10.000Z
|
2022-03-31T22:36:25.000Z
|
posthog/queries/abstract_test/test_breakdown_filtering.py
|
FarazPatankar/posthog
|
dddf2644376d0fd6836ed96c139f6a825c74202f
|
[
"MIT"
] | 5,709
|
2020-02-09T23:26:13.000Z
|
2022-03-31T20:20:01.000Z
|
posthog/queries/abstract_test/test_breakdown_filtering.py
|
FarazPatankar/posthog
|
dddf2644376d0fd6836ed96c139f6a825c74202f
|
[
"MIT"
] | 647
|
2020-02-13T17:50:55.000Z
|
2022-03-31T11:24:19.000Z
|
from abc import ABC, abstractmethod
class AbstractBreakdownTest(ABC):
@abstractmethod
def test_breakdown_event_property(self):
pass
@abstractmethod
def test_breakdown_person_property_property(self):
pass
@abstractmethod
def test_breakdown_cohort_property(self):
pass
@abstractmethod
def test_breakdown_multiple_property(self):
pass
| 20.05
| 54
| 0.720698
| 41
| 401
| 6.731707
| 0.390244
| 0.246377
| 0.304348
| 0.434783
| 0.5
| 0.5
| 0.5
| 0
| 0
| 0
| 0
| 0
| 0.229426
| 401
| 19
| 55
| 21.105263
| 0.893204
| 0
| 0
| 0.571429
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.285714
| false
| 0.285714
| 0.071429
| 0
| 0.428571
| 0
| 0
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
| 0
|
0
| 5
|
dc5e208d5bcc7f9f24a4067fe64dbb4958c9500f
| 112
|
py
|
Python
|
test.py
|
speciallan/mmdetection
|
786a6b4eb9f0b9bb3fd5b3ab81ede7d1b23573d6
|
[
"Apache-2.0"
] | null | null | null |
test.py
|
speciallan/mmdetection
|
786a6b4eb9f0b9bb3fd5b3ab81ede7d1b23573d6
|
[
"Apache-2.0"
] | null | null | null |
test.py
|
speciallan/mmdetection
|
786a6b4eb9f0b9bb3fd5b3ab81ede7d1b23573d6
|
[
"Apache-2.0"
] | null | null | null |
#!/usr/bin/env python
# -*- coding:utf-8 -*-
# Author:Speciallan
import torch
print(torch.cuda.is_available())
| 16
| 32
| 0.696429
| 16
| 112
| 4.8125
| 0.9375
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.01
| 0.107143
| 112
| 7
| 32
| 16
| 0.76
| 0.526786
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.5
| 0
| 0.5
| 0.5
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 1
|
0
| 5
|
dc7b6af32531b6716c513549a5c72dd2eb6673b2
| 51
|
py
|
Python
|
uniluganobot/interfaces/telegram/commands/__init__.py
|
ilredeitopi/uniluganobot
|
637469b6976703a0baa70b3592970e60f7412f09
|
[
"MIT"
] | null | null | null |
uniluganobot/interfaces/telegram/commands/__init__.py
|
ilredeitopi/uniluganobot
|
637469b6976703a0baa70b3592970e60f7412f09
|
[
"MIT"
] | null | null | null |
uniluganobot/interfaces/telegram/commands/__init__.py
|
ilredeitopi/uniluganobot
|
637469b6976703a0baa70b3592970e60f7412f09
|
[
"MIT"
] | null | null | null |
from .command import Command
from . import plugins
| 17
| 28
| 0.803922
| 7
| 51
| 5.857143
| 0.571429
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.156863
| 51
| 2
| 29
| 25.5
| 0.953488
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
f4ada28f5cbae0e040c693f50bad4d4f6ffefa6d
| 848
|
py
|
Python
|
tests/deserialize-test.py
|
pyKilt/qs_params
|
228a7ed980750bebf24caad4a7ad6bd025290a02
|
[
"MIT"
] | null | null | null |
tests/deserialize-test.py
|
pyKilt/qs_params
|
228a7ed980750bebf24caad4a7ad6bd025290a02
|
[
"MIT"
] | null | null | null |
tests/deserialize-test.py
|
pyKilt/qs_params
|
228a7ed980750bebf24caad4a7ad6bd025290a02
|
[
"MIT"
] | null | null | null |
from qserious import deserialize
result_1 = {
'hola': 'caracola',
'adios': 'caracol',
'foo': 'bar',
'nested': {'value': 'foobar'}
}
result_2 = {
'origin': {
'url': 'https://www.example.com/item/item_id'
}
}
def test_dots():
qs = r'hola=caracola&adios=caracol&foo=bar&nested.value=foobar'
assert deserialize(qs) == result_1
def test_brackets():
qs = r'hola=caracola&adios=caracol&foo=bar&nested[value]=foobar'
assert deserialize(qs) == result_1
def test_brackets_start():
qs = r'hola=caracola&adios=caracol&foo=bar&[nested]value=foobar'
assert deserialize(qs) == result_1
def test_url():
qs = r'origin[url]=https%3A%2F%2Fwww.example.com%2Fitem%2Fitem_id'
result = deserialize(qs)
assert result == {
'origin': {'url': 'https://www.example.com/item/item_id'}
}
| 22.315789
| 70
| 0.639151
| 114
| 848
| 4.640351
| 0.315789
| 0.05293
| 0.128544
| 0.181474
| 0.729679
| 0.729679
| 0.729679
| 0.729679
| 0.729679
| 0.500945
| 0
| 0.014514
| 0.1875
| 848
| 37
| 71
| 22.918919
| 0.753266
| 0
| 0
| 0.111111
| 0
| 0
| 0.427391
| 0.265643
| 0
| 0
| 0
| 0
| 0.148148
| 1
| 0.148148
| false
| 0
| 0.037037
| 0
| 0.185185
| 0
| 0
| 0
| 0
| null | 0
| 0
| 1
| 0
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
f4b7cf2650eb107402a3f3f41d8b4afc889c97cf
| 42
|
py
|
Python
|
tempdb.py
|
Zackyy1/seljankaadmaker
|
a63aa55c83f7123ae01fc3e4702a482a15bea6c2
|
[
"MIT"
] | null | null | null |
tempdb.py
|
Zackyy1/seljankaadmaker
|
a63aa55c83f7123ae01fc3e4702a482a15bea6c2
|
[
"MIT"
] | null | null | null |
tempdb.py
|
Zackyy1/seljankaadmaker
|
a63aa55c83f7123ae01fc3e4702a482a15bea6c2
|
[
"MIT"
] | null | null | null |
db={
"smth":{"id":"23123213123"}
}
| 10.5
| 32
| 0.452381
| 4
| 42
| 4.75
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.34375
| 0.238095
| 42
| 4
| 33
| 10.5
| 0.25
| 0
| 0
| 0
| 0
| 0
| 0.425
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
f4dab02a7b7c4bd96ad5855bc76f095f2d7c9b20
| 41
|
py
|
Python
|
python_demo_v1/study/study_hello_world.py
|
renhongl/python_demo
|
039d0e046885dd3890526ae91efa2d601f6f9b73
|
[
"MIT"
] | 1
|
2019-11-29T02:47:19.000Z
|
2019-11-29T02:47:19.000Z
|
python_demo_v1/study/study_hello_world.py
|
renhongl/python_demo
|
039d0e046885dd3890526ae91efa2d601f6f9b73
|
[
"MIT"
] | null | null | null |
python_demo_v1/study/study_hello_world.py
|
renhongl/python_demo
|
039d0e046885dd3890526ae91efa2d601f6f9b73
|
[
"MIT"
] | null | null | null |
"""This is test"""
print('hello world')
| 10.25
| 20
| 0.609756
| 6
| 41
| 4.166667
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.146341
| 41
| 3
| 21
| 13.666667
| 0.714286
| 0.292683
| 0
| 0
| 0
| 0
| 0.478261
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0
| 0
| 0
| 1
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 1
|
0
| 5
|
f4e640c5cf169fd5a0eb3b4e981419c5503985c8
| 149
|
py
|
Python
|
FusionIIIT/applications/research_procedures/admin.py
|
sabhishekpratap5/sonarcubeTest2
|
9bd8105e457f6feb8c38fa94b335e54783fca99e
|
[
"bzip2-1.0.6"
] | 29
|
2019-02-20T15:35:33.000Z
|
2022-03-22T11:10:57.000Z
|
FusionIIIT/applications/research_procedures/admin.py
|
sabhishekpratap5/sonarcubeTest2
|
9bd8105e457f6feb8c38fa94b335e54783fca99e
|
[
"bzip2-1.0.6"
] | 409
|
2019-01-17T19:30:51.000Z
|
2022-03-31T16:28:45.000Z
|
FusionIIIT/applications/research_procedures/admin.py
|
sabhishekpratap5/sonarcubeTest2
|
9bd8105e457f6feb8c38fa94b335e54783fca99e
|
[
"bzip2-1.0.6"
] | 456
|
2019-01-12T11:01:13.000Z
|
2022-03-30T17:06:52.000Z
|
from django.contrib import admin
from applications.research_procedures.models import Patent
# Register your models here.
admin.site.register(Patent)
| 29.8
| 58
| 0.845638
| 20
| 149
| 6.25
| 0.7
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.09396
| 149
| 5
| 59
| 29.8
| 0.925926
| 0.174497
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.666667
| 0
| 0.666667
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
76291d14d1b616002f36ac968f5b1abddb521dce
| 203
|
py
|
Python
|
surface_coatings/monomers/__init__.py
|
daico007/surface_coatings
|
fde9086931c7612a74b59975479f76c6b35b2812
|
[
"MIT"
] | null | null | null |
surface_coatings/monomers/__init__.py
|
daico007/surface_coatings
|
fde9086931c7612a74b59975479f76c6b35b2812
|
[
"MIT"
] | 1
|
2021-10-07T20:38:41.000Z
|
2021-10-07T20:38:41.000Z
|
surface_coatings/monomers/__init__.py
|
daico007/surface_coatings
|
fde9086931c7612a74b59975479f76c6b35b2812
|
[
"MIT"
] | null | null | null |
from .azpma import AzPMA
from .sbma import SBMA
from .methacrylate import Methacrylate
from .methylstyrene_initiator import MethylStyrene
from .triazolebiotin import TriazoleBiotin
from .mpc import MPC
| 25.375
| 50
| 0.847291
| 25
| 203
| 6.84
| 0.36
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.123153
| 203
| 7
| 51
| 29
| 0.960674
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
52042e72e18658e559277393937185fa312aad5e
| 4,502
|
py
|
Python
|
SurrogateModule.py
|
vishalbelsare/NolinearTimeSeriesAnalysis
|
282b0e8d731cdfd7300adb70b533e692387457a2
|
[
"Unlicense"
] | 18
|
2017-04-29T18:22:31.000Z
|
2022-01-14T00:10:30.000Z
|
SurrogateModule.py
|
narayan83/NolinearTimeSeriesAnalysis
|
282b0e8d731cdfd7300adb70b533e692387457a2
|
[
"Unlicense"
] | 1
|
2020-03-01T05:48:32.000Z
|
2020-03-01T09:16:22.000Z
|
SurrogateModule.py
|
narayan83/NolinearTimeSeriesAnalysis
|
282b0e8d731cdfd7300adb70b533e692387457a2
|
[
"Unlicense"
] | 9
|
2016-12-21T14:38:58.000Z
|
2021-06-04T08:02:25.000Z
|
#AUTHOR : NARAYAN P SUBRAMANIYAM
#based on *Surrogate time series* by Schreiber and Schmitz (https://www.sciencedirect.com/science/article/abs/pii/S0167278900000439)
#TFT version is based on Nakamura et al.
import numpy
def UnivariateSurrogates(data_f,MaxIter):
xs=data_f.copy()
xs.sort() #sorted amplitude stored
pwx=numpy.abs(numpy.fft.fft(data_f)) # amplitude of fourier transform of orig
data_f.shape = (-1,1)
xsur = numpy.random.permutation(data_f) #random permutation as starting point
xsur.shape = (1,-1)
for i in range(MaxIter):
fftsurx = pwx*numpy.exp(1j*numpy.angle(numpy.fft.fft(xsur)))
xoutb = numpy.real(numpy.fft.ifft(fftsurx))
ranks = xoutb.argsort(axis=1)
xsur[:,ranks] = xs
return(xsur)
def BivariateSurrogates(data_f,MaxIter):
M = data_f.shape[1]
sorted_original = data_f.copy()
sorted_original.sort(axis=1)
fourier_transform = numpy.fft.fft(data_f)
original_fourier_amps = numpy.abs(fourier_transform)
original_fourier_phase = numpy.angle(fourier_transform)
phix = original_fourier_phase
niterations = 120
xsur = numpy.random.permutation(data_f).transpose()
for i in xrange(niterations):
phisx = numpy.angle(numpy.fft.fft(xsur))
alpha = numpy.zeros((M,1))
for cc in range(1,int(numpy.ceil(M/2)),1):
alpha[cc] = numpy.arctan(numpy.sum(numpy.sin(phisx[:,cc]-phix[:,cc]))/numpy.sum(numpy.cos(phisx[:,cc]-phix[:,cc])))
if numpy.sum(numpy.cos(alpha[cc]+phix[:,cc]-phisx[:,cc])) < 0:
alpha[cc] = alpha[cc]-numpy.pi
alpha[M-1-cc+1] = -alpha[cc]
alpha.shape = (1,-1)
tmpx = numpy.tile(alpha,(2,1))
phases = phix + tmpx
fftsurx = original_fourier_amps*numpy.exp(1j * phases)
xoutb = numpy.real(numpy.fft.ifft(fftsurx,axis=1))
ranks = xoutb.argsort(axis=1)
for k in xrange(sorted_original.shape[0]):
xsur[k,ranks[k,:]] = sorted_original[k,:]
return(xsur)
def UnivariateSurrogatesTFT(data_f,MaxIter,fc):
xs=data_f.copy()
xs.sort() #sorted amplitude stored
pwx=numpy.abs(numpy.fft.fft(data_f)) # amplitude of fourier transform of orig
phi = numpy.angle(numpy.fft.fft(data_f))
Len=phi.shape[1]
data_f.shape=(-1,1)
xsur = numpy.random.permutation(data_f) #random permutation as starting point
xsur.shape = (1,-1)
Fc = numpy.round(fc*data_f.shape[0])
for i in range(MaxIter):
phi_surr = numpy.angle(numpy.fft.fft(xsur))
phi_surr[0,1:Fc] = phi[0,1:Fc]
phi_surr[0,Len-Fc+1:Len] = phi[0,Len-Fc+1:Len]
phi_surr[0,0] = 0.0
phi_surr[0,Len/2] = 0.0
fftsurx = pwx*numpy.exp(1j*phi_surr)
xoutb = numpy.real(numpy.fft.ifft(fftsurx))
ranks = xoutb.argsort(axis=1)
xsur[:,ranks] = xs
return(xsur)
def BivariateSurrogatesTFT(data_f,MaxIter,fc):
M = data_f.shape[1]
Fc = numpy.round(fc*M)
sorted_original = data_f.copy()
sorted_original.sort(axis=1)
fourier_transform = numpy.fft.fft(data_f)
original_fourier_amps = numpy.abs(fourier_transform)
original_fourier_phase = numpy.angle(fourier_transform)
phix = original_fourier_phase
xsur = numpy.random.permutation(data_f.transpose()).transpose()
for i in xrange(MaxIter):
phisx = numpy.angle(numpy.fft.fft(xsur))
phisx[:,1:Fc] = phix[:,1:Fc]
phisx[:,M-Fc+1:M] = phix[:,M-Fc+1:M]
phisx[0,0] = 0
phisx[1,0] = 0
phisx[:,M/2] = phix[:,M/2]
alpha = numpy.zeros((M,1))
for cc in range(1,int(numpy.ceil(M/2)),1):
alpha[cc] = numpy.arctan(numpy.sum(numpy.sin(phisx[:,cc]-phix[:,cc]))/numpy.sum(numpy.cos(phisx[:,cc]-phix[:,cc])))
if numpy.sum(numpy.cos(alpha[cc]+phix[:,cc]-phisx[:,cc])) < 0:
alpha[cc] = alpha[cc]-numpy.pi
alpha[M-1-cc+1] = -alpha[cc]
alpha.shape = (1,-1)
tmpx = numpy.tile(alpha,(2,1))
phases = phix + tmpx
fftsurx = original_fourier_amps*numpy.exp(1j * phases)
xoutb = numpy.real(numpy.fft.ifft(fftsurx,axis=1))
ranks = xoutb.argsort(axis=1)
for k in xrange(sorted_original.shape[0]):
xsur[k,ranks[k,:]] = sorted_original[k,:]
return(xsur)
| 37.831933
| 132
| 0.599289
| 647
| 4,502
| 4.080371
| 0.162287
| 0.041667
| 0.0375
| 0.028409
| 0.810227
| 0.739394
| 0.710606
| 0.657576
| 0.657576
| 0.657576
| 0
| 0.028182
| 0.251222
| 4,502
| 118
| 133
| 38.152542
| 0.754969
| 0.088183
| 0
| 0.723404
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.042553
| false
| 0
| 0.010638
| 0
| 0.053191
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 1
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
521c6e6a5aaa9b73e79eec8d60c36f803d227c9c
| 59
|
py
|
Python
|
etc/python_version.py
|
gerrymanoim/libpy
|
ffe19d53aa9602893aecc2dd8c9feda90e06b262
|
[
"Apache-2.0"
] | 71
|
2020-06-26T00:36:33.000Z
|
2021-12-02T13:57:02.000Z
|
etc/python_version.py
|
stefan-jansen/libpy
|
e174ee103db76a9d0fcd29165d54c676ed1f2629
|
[
"Apache-2.0"
] | 32
|
2020-06-26T18:59:15.000Z
|
2022-03-01T19:02:44.000Z
|
etc/python_version.py
|
gerrymanoim/libpy
|
ffe19d53aa9602893aecc2dd8c9feda90e06b262
|
[
"Apache-2.0"
] | 24
|
2020-06-26T17:01:57.000Z
|
2022-02-15T00:25:27.000Z
|
import sys
print(' '.join(map(str, sys.version_info[:2])))
| 19.666667
| 47
| 0.677966
| 10
| 59
| 3.9
| 0.9
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.018519
| 0.084746
| 59
| 2
| 48
| 29.5
| 0.703704
| 0
| 0
| 0
| 0
| 0
| 0.016949
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.5
| 0
| 0.5
| 0.5
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 1
|
0
| 5
|
524ca1d9c636e4e662561f9288ffad901bf1eda9
| 690
|
py
|
Python
|
tests/kyu_5_tests/test_rgb_to_hex_conversion.py
|
the-zebulan/CodeWars
|
1eafd1247d60955a5dfb63e4882e8ce86019f43a
|
[
"MIT"
] | 40
|
2016-03-09T12:26:20.000Z
|
2022-03-23T08:44:51.000Z
|
tests/kyu_5_tests/test_rgb_to_hex_conversion.py
|
akalynych/CodeWars
|
1eafd1247d60955a5dfb63e4882e8ce86019f43a
|
[
"MIT"
] | null | null | null |
tests/kyu_5_tests/test_rgb_to_hex_conversion.py
|
akalynych/CodeWars
|
1eafd1247d60955a5dfb63e4882e8ce86019f43a
|
[
"MIT"
] | 36
|
2016-11-07T19:59:58.000Z
|
2022-03-31T11:18:27.000Z
|
import unittest
from katas.kyu_5.rgb_to_hex_conversion import rgb
class RGBToHexTestCase(unittest.TestCase):
def test_equals(self):
self.assertEqual(rgb(0, 0, 0), '000000')
def test_equals_2(self):
self.assertEqual(rgb(1, 2, 3), '010203')
def test_equals_3(self):
self.assertEqual(rgb(-20, 275, 125), '00FF7D')
def test_equals_4(self):
self.assertEqual(rgb(148, 0, 211), '9400D3')
def test_equals_5(self):
self.assertEqual(rgb(254, 253, 252), 'FEFDFC')
def test_equals_6(self):
self.assertEqual(rgb(255, 255, 255), 'FFFFFF')
def test_equals_7(self):
self.assertEqual(rgb(255, 255, 300), 'FFFFFF')
| 25.555556
| 54
| 0.650725
| 99
| 690
| 4.363636
| 0.414141
| 0.113426
| 0.210648
| 0.356481
| 0.12963
| 0.12963
| 0
| 0
| 0
| 0
| 0
| 0.137112
| 0.207246
| 690
| 26
| 55
| 26.538462
| 0.652651
| 0
| 0
| 0
| 0
| 0
| 0.06087
| 0
| 0
| 0
| 0
| 0
| 0.411765
| 1
| 0.411765
| false
| 0
| 0.117647
| 0
| 0.588235
| 0
| 0
| 0
| 0
| null | 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| 1
| 0
|
0
| 5
|
52743ef233ac8699343149604e21dacd457b5b49
| 117
|
py
|
Python
|
dev/__init__.py
|
Nanda-G/bot
|
0db6538ca146870ac5023e1f762cf4d5ece47ad4
|
[
"MIT"
] | 5
|
2020-07-19T19:07:27.000Z
|
2021-12-15T11:30:03.000Z
|
dev/__init__.py
|
Nanda-G/bot
|
0db6538ca146870ac5023e1f762cf4d5ece47ad4
|
[
"MIT"
] | 136
|
2020-07-25T19:29:37.000Z
|
2022-03-09T15:16:49.000Z
|
dev/__init__.py
|
Nanda-G/bot
|
0db6538ca146870ac5023e1f762cf4d5ece47ad4
|
[
"MIT"
] | 5
|
2020-07-19T18:12:03.000Z
|
2021-02-22T10:35:11.000Z
|
"""Commands for bot operations"""
from .botstats import command_increment, print_botstats
from .groups import groups
| 29.25
| 55
| 0.811966
| 15
| 117
| 6.2
| 0.733333
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.111111
| 117
| 3
| 56
| 39
| 0.894231
| 0.230769
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0.5
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 1
|
0
| 5
|
5295f151c47fc873e4d47ed9dfbfa3aa9543950e
| 209
|
py
|
Python
|
pyhtmlgui/lib/__init__.py
|
dirk-makerhafen/pyHtmlGui
|
41c9f3080a2c815bd664bf6d7213d19745c092be
|
[
"MIT"
] | 1
|
2022-03-30T19:25:32.000Z
|
2022-03-30T19:25:32.000Z
|
pyhtmlgui/lib/__init__.py
|
dirk-makerhafen/pyHtmlGui
|
41c9f3080a2c815bd664bf6d7213d19745c092be
|
[
"MIT"
] | null | null | null |
pyhtmlgui/lib/__init__.py
|
dirk-makerhafen/pyHtmlGui
|
41c9f3080a2c815bd664bf6d7213d19745c092be
|
[
"MIT"
] | null | null | null |
from .weakFunctionReferences import WeakFunctionReferences
from .browser import Browser
from .observable import Observable
from .observableDict import ObservableDict
from .observableList import ObservableList
| 34.833333
| 58
| 0.880383
| 20
| 209
| 9.2
| 0.35
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.095694
| 209
| 5
| 59
| 41.8
| 0.973545
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
bfe503f606c4c3cdb41c060ade76aedf18c31c68
| 127
|
py
|
Python
|
project/test_simple.py
|
RyanBalfanz/drone-quick-start
|
ce014c96d7dee0892f3f9928bb4fd5255e202761
|
[
"Unlicense"
] | 1
|
2017-05-04T08:49:56.000Z
|
2017-05-04T08:49:56.000Z
|
project/test_simple.py
|
RyanBalfanz/drone-quick-start
|
ce014c96d7dee0892f3f9928bb4fd5255e202761
|
[
"Unlicense"
] | null | null | null |
project/test_simple.py
|
RyanBalfanz/drone-quick-start
|
ce014c96d7dee0892f3f9928bb4fd5255e202761
|
[
"Unlicense"
] | null | null | null |
from django.test import TestCase
class SimpleTestCase(TestCase):
def test_should_pass(self):
self.assertEqual(True, True)
| 18.142857
| 32
| 0.795276
| 17
| 127
| 5.823529
| 0.764706
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.11811
| 127
| 6
| 33
| 21.166667
| 0.883929
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.25
| 1
| 0.25
| false
| 0.25
| 0.25
| 0
| 0.75
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 1
| 0
|
0
| 5
|
871e1560ea2cc5033619e7d0cca57d2058683c0e
| 21,270
|
py
|
Python
|
pola/rpc_api/tests/test_views.py
|
rodkiewicz/pola-backend
|
e26df1cea07b43c8b4272739234b7e78e2ce08c9
|
[
"BSD-3-Clause"
] | null | null | null |
pola/rpc_api/tests/test_views.py
|
rodkiewicz/pola-backend
|
e26df1cea07b43c8b4272739234b7e78e2ce08c9
|
[
"BSD-3-Clause"
] | null | null | null |
pola/rpc_api/tests/test_views.py
|
rodkiewicz/pola-backend
|
e26df1cea07b43c8b4272739234b7e78e2ce08c9
|
[
"BSD-3-Clause"
] | null | null | null |
import io
import json
import requests
from test_plus.test import TestCase
from ai_pics.models import AIAttachment, AIPics
from company.factories import CompanyFactory
from product.factories import ProductFactory
from product.models import Product
from report.factories import ReportFactory
from report.models import Attachment, Report
class JsonRequestMixin:
def json_request(self, url, data=None, **kwargs):
body = json.dumps(data)
return self.client.post(url, body, content_type="application/json", **kwargs)
def _create_image(width=100, height=None, color='blue', image_format='JPEG', image_palette='RGB'):
# ImageField (both django's and factory_boy's) require PIL.
# Try to import it along one of its known installation paths.
from PIL import Image
height = height or width
thumb_io = io.BytesIO()
with Image.new(image_palette, (width, height), color) as thumb:
thumb.save(thumb_io, format=image_format)
return thumb_io.getvalue()
class TestGetByCodeV4(TestCase, JsonRequestMixin):
url = '/a/v4/get_by_code'
def test_should_return_200_for_non_ean_13(self):
response = self.json_request(
self.url + "?device_id=TEST-DEVICE-ID&code=123",
)
self.assertEqual(200, response.status_code)
def test_should_return_200_when_ai_not_supported(self):
response = self.json_request(
self.url + "?device_id=TEST-DEVICE-ID&code=123&noai=false",
)
self.assertEqual(200, response.status_code)
def test_should_return_200_when_polish_product(self):
response = self.json_request(self.url + "?device_id=TEST-DEVICE-ID&code=5900049011829")
self.assertEqual(200, response.status_code, response.content)
def test_should_return_200_when_product_without_company(self):
p = Product(code=5900049011829)
p.name = "test-product"
p.save()
response = self.json_request(self.url + "?device_id=TEST-DEVICE-ID&code=" + str(p.code))
self.assertEqual(200, response.status_code, response.content)
def test_should_return_200_when_polish_and_known_product(self):
c = CompanyFactory(
plCapital=100,
plWorkers=0,
plRnD=100,
plRegistered=100,
plNotGlobEnt=100,
description="TEST",
sources="TEST|BBBB",
verified=True,
is_friend=True,
plCapital_notes="AAA",
plWorkers_notes="BBB",
plRnD_notes="CCC",
plRegistered_notes="DDD",
plNotGlobEnt_notes="EEE",
)
p = ProductFactory.create(code=5900049011829, company=c, brand=None)
response = self.json_request(self.url + "?device_id=TEST-DEVICE-ID&code=" + str(p.code))
self.assertEqual(200, response.status_code, response.content)
self.maxDiff = None
self.assertEqual(
{
"product_id": p.pk,
"code": "5900049011829",
"name": c.common_name,
"card_type": "type_white",
"altText": None,
"report": {
"text": "Zg\u0142o\u015b je\u015bli posiadasz bardziej aktualne dane na temat tego produktu",
"button_text": "Zg\u0142o\u015b",
"button_type": "type_white",
},
"companies": [
{
"name": c.official_name,
"plCapital": 100,
"plCapital_notes": "AAA",
"plWorkers": 0,
"plWorkers_notes": "BBB",
"plRnD": 100,
"plRnD_notes": "CCC",
"plRegistered": 100,
"plRegistered_notes": "DDD",
"plNotGlobEnt": 100,
"plNotGlobEnt_notes": "EEE",
"plScore": 70,
"is_friend": True,
"friend_text": "To jest przyjaciel Poli",
"description": "TEST",
"sources": {"TEST": "BBBB"},
}
],
"donate": {
"show_button": True,
"url": "https://klubjagiellonski.pl/zbiorka/wspieraj-aplikacje-pola/",
"title": "Potrzebujemy 1 zł",
},
},
json.loads(response.content),
)
def test_should_return_200_when_multiple_companies(self):
c1 = CompanyFactory(
plCapital=100,
plWorkers=0,
plRnD=100,
plRegistered=100,
plNotGlobEnt=100,
description="TEST",
sources="TEST|BBBB",
verified=True,
is_friend=True,
plCapital_notes="AAA",
plWorkers_notes="BBB",
plRnD_notes="CCC",
plRegistered_notes="DDD",
plNotGlobEnt_notes="EEE",
)
c2 = CompanyFactory(
plCapital=100,
plWorkers=0,
plRnD=100,
plRegistered=100,
plNotGlobEnt=100,
description="TEST",
sources="TEST|BBBB",
verified=True,
is_friend=True,
plCapital_notes="AAA",
plWorkers_notes="BBB",
plRnD_notes="CCC",
plRegistered_notes="DDD",
plNotGlobEnt_notes="EEE",
)
p = ProductFactory.create(code=5900049011829, company=c1, brand__company=c2)
response = self.json_request(self.url + "?device_id=TEST-DEVICE-ID&code=" + str(p.code))
self.assertEqual(200, response.status_code, response.content)
self.maxDiff = None
self.assertEqual(
{
"product_id": p.id,
"code": "5900049011829",
"name": 'Marka własna - Sieć Lidl',
"card_type": "type_white",
"altText": None,
"report": {
"text": "Zg\u0142o\u015b je\u015bli posiadasz bardziej aktualne dane na temat tego produktu",
"button_text": "Zg\u0142o\u015b",
"button_type": "type_white",
},
"companies": [
{
"name": c1.official_name,
"plCapital": 100,
"plCapital_notes": "AAA",
"plWorkers": 0,
"plWorkers_notes": "BBB",
"plRnD": 100,
"plRnD_notes": "CCC",
"plRegistered": 100,
"plRegistered_notes": "DDD",
"plNotGlobEnt": 100,
"plNotGlobEnt_notes": "EEE",
"plScore": 70,
"is_friend": True,
"friend_text": "To jest przyjaciel Poli",
"description": "TEST",
"sources": {"TEST": "BBBB"},
},
{
"name": c2.official_name,
"plCapital": 100,
"plCapital_notes": "AAA",
"plWorkers": 0,
"plWorkers_notes": "BBB",
"plRnD": 100,
"plRnD_notes": "CCC",
"plRegistered": 100,
"plRegistered_notes": "DDD",
"plNotGlobEnt": 100,
"plNotGlobEnt_notes": "EEE",
"plScore": 70,
"is_friend": True,
"friend_text": "To jest przyjaciel Poli",
"description": "TEST",
"sources": {"TEST": "BBBB"},
},
],
"donate": {
"show_button": True,
"url": "https://klubjagiellonski.pl/zbiorka/wspieraj-aplikacje-pola/",
"title": "Potrzebujemy 1 zł",
},
},
json.loads(response.content),
)
class TestAddAiPics(TestCase, JsonRequestMixin):
url = '/a/v3/add_ai_pics'
def test_should_create_simple_report(self):
p = ProductFactory.create(ai_pics_count=0)
response = self.json_request(
self.url + "?device_id=TEST-DEVICE-ID",
data={
'product_id': p.pk,
'files_count': 1,
'file_ext': "png",
"mime_type": 'image/jpeg',
'original_width': 1000,
'original_height': 2000,
'width': 100,
'height': 200,
'device_name': 'TEST-device',
'flash_used': True,
'was_portrait': False,
},
)
self.assertEqual(200, response.status_code)
response_data = response.json()
self.assertEqual(len(response_data['signed_requests']), 1)
signed_url: str = response_data['signed_requests'][0]
self.assertTrue(signed_url.startswith("http://minio:9000"))
# Valid signed URL
response = requests.put(
signed_url, data=_create_image(), headers={"x-amz-acl": "public-read", 'Content-Type': 'image/jpeg'}
)
self.assertEqual(200, response.status_code, response.text)
# Assert AIPics
self.assertEqual(AIPics.objects.count(), 1)
ai_pics: AIPics = AIPics.objects.first()
self.assertEqual(p.pk, ai_pics.product_id)
self.assertEqual("TEST-DEVICE-ID", ai_pics.client)
self.assertEqual(1000, ai_pics.original_width)
self.assertEqual(2000, ai_pics.original_height)
self.assertEqual(100, ai_pics.width)
self.assertEqual(200, ai_pics.height)
self.assertEqual(True, ai_pics.flash_used)
self.assertEqual(False, ai_pics.was_portrait)
# Assert AIAttachment
self.assertEqual(1, AIAttachment.objects.count())
ai_attachment: AIAttachment = AIAttachment.objects.first()
self.assertTrue(ai_attachment.attachment.name.endswith("png"))
self.assertEqual(0, ai_attachment.file_no)
self.assertEqual(200, requests.get(ai_attachment.get_absolute_url()).status_code)
# Assert product
self.assertEqual(1, Product.objects.get(pk=p.pk).ai_pics_count)
def test_should_limit_file_count(self):
p = ProductFactory.create(ai_pics_count=0)
response = self.json_request(
self.url + "?device_id=TEST-DEVICE-ID",
data={
'product_id': p.pk,
'files_count': 50,
'file_ext': "png",
"mime_type": 'image/jpeg',
'original_width': 1000,
'original_height': 2000,
'width': 100,
'height': 200,
'device_name': 'TEST-device',
'flash_used': True,
'was_portrait': False,
},
)
self.assertEqual(403, response.status_code)
self.assertEqual("Forbidden", response.reason_phrase)
class TestGetByCodeV3(TestCase, JsonRequestMixin):
url = '/a/v3/get_by_code'
def test_should_return_200_for_non_ean_13(self):
response = self.json_request(
self.url + "?device_id=TEST-DEVICE-ID&code=123",
)
self.assertEqual(200, response.status_code)
def test_should_return_200_when_ai_not_supported(self):
response = self.json_request(
self.url + "?device_id=TEST-DEVICE-ID&code=123&noai=false",
)
self.assertEqual(200, response.status_code)
def test_should_return_200_when_polish_product(self):
response = self.json_request(self.url + "?device_id=TEST-DEVICE-ID&code=5900049011829")
self.assertEqual(200, response.status_code, response.content)
def test_should_return_200_when_product_without_company(self):
p = Product(code=5900049011829)
p.name = "test-product"
p.save()
response = self.json_request(self.url + "?device_id=TEST-DEVICE-ID&code=" + str(p.code))
self.assertEqual(200, response.status_code, response.content)
def test_should_return_200_when_polish_and_known_product(self):
c = CompanyFactory(
plCapital=100,
plWorkers=0,
plRnD=100,
plRegistered=100,
plNotGlobEnt=100,
description="TEST",
sources="TEST|BBBB",
verified=True,
is_friend=True,
plCapital_notes="AAA",
plWorkers_notes="BBB",
plRnD_notes="CCC",
plRegistered_notes="DDD",
plNotGlobEnt_notes="EEE",
)
p = ProductFactory.create(code=5900049011829, company=c, brand=None)
response = self.json_request(self.url + "?device_id=TEST-DEVICE-ID&code=" + str(p.code))
self.assertEqual(200, response.status_code, response.content)
self.maxDiff = None
self.assertEqual(
{
"product_id": p.id,
"code": "5900049011829",
"name": c.official_name,
"card_type": "type_white",
"plScore": 70,
"altText": None,
"plCapital": 100,
"plCapital_notes": "AAA",
"plWorkers": 0,
"plWorkers_notes": "BBB",
"plRnD": 100,
"plRnD_notes": "CCC",
"plRegistered": 100,
"plRegistered_notes": "DDD",
"plNotGlobEnt": 100,
"plNotGlobEnt_notes": "EEE",
"report_text": "Zg\u0142o\u015b je\u015bli posiadasz bardziej aktualne dane na temat tego produktu",
"report_button_text": "Zg\u0142o\u015b",
"report_button_type": "type_white",
"is_friend": True,
"friend_text": "To jest przyjaciel Poli",
"description": "TEST",
"sources": {"TEST": "BBBB"},
"donate": {
"show_button": True,
"url": "https://klubjagiellonski.pl/zbiorka/wspieraj-aplikacje-pola/",
"title": "Potrzebujemy 1 zł",
},
},
json.loads(response.content),
)
def test_should_return_200_when_one_comand_in_brand_and_product(self):
c1 = CompanyFactory(
plCapital=100,
plWorkers=0,
plRnD=100,
plRegistered=100,
plNotGlobEnt=100,
description="TEST",
sources="TEST|BBBB",
verified=True,
is_friend=True,
plCapital_notes="AAA",
plWorkers_notes="BBB",
plRnD_notes="CCC",
plRegistered_notes="DDD",
plNotGlobEnt_notes="EEE",
)
p = ProductFactory.create(code=5900049011829, company=c1, brand__company=c1)
response = self.json_request(self.url + "?device_id=TEST-DEVICE-ID&code=" + str(p.code))
self.assertEqual(200, response.status_code, response.content)
self.maxDiff = None
self.assertEqual(
{
'altText': None,
'card_type': 'type_white',
'code': '5900049011829',
'description': 'TEST',
'donate': {
'show_button': True,
'title': 'Potrzebujemy 1 zł',
'url': 'https://klubjagiellonski.pl/zbiorka/wspieraj-aplikacje-pola/',
},
'friend_text': 'To jest przyjaciel Poli',
'is_friend': True,
'name': 'company_official_125',
'plCapital': 100,
'plCapital_notes': 'AAA',
'plNotGlobEnt': 100,
'plNotGlobEnt_notes': 'EEE',
'plRegistered': 100,
'plRegistered_notes': 'DDD',
'plRnD': 100,
'plRnD_notes': 'CCC',
'plScore': 70,
'plWorkers': 0,
'plWorkers_notes': 'BBB',
'product_id': p.pk,
'report_button_text': 'Zgłoś',
'report_button_type': 'type_white',
'report_text': 'Zgłoś jeśli posiadasz bardziej aktualne dane na temat tego produktu',
'sources': {'TEST': 'BBBB'},
},
json.loads(response.content),
)
class TestCreateReportV3(TestCase, JsonRequestMixin):
url = '/a/v3/create_report'
def test_should_create_report(self):
p = ProductFactory.create(ai_pics_count=0)
response = self.json_request(
self.url + "?device_id=TEST-DEVICE-ID",
data={
'description': "test-description",
'product_id': p.pk,
'files_count': 1,
'file_ext': 'jpg',
'mime_type': 'image/jpeg',
},
)
self.assertEqual(200, response.status_code)
response_data = response.json()
self.assertEqual(len(response_data['signed_requests']), 1)
signed_url: str = response_data['signed_requests'][0]
self.assertTrue(signed_url.startswith("http://minio:9000"))
# Valid signed URL
response = requests.put(
signed_url, data=_create_image(), headers={"x-amz-acl": "public-read", 'Content-Type': 'image/jpeg'}
)
self.assertEqual(200, response.status_code, response.text)
# Assert Report
self.assertEqual(Report.objects.count(), 1)
report: Report = Report.objects.get(pk=response_data['id'])
self.assertEqual(p.pk, report.product_id)
self.assertEqual("test-description", report.description)
self.assertEqual("TEST-DEVICE-ID", report.client)
self.assertEqual(Report.OPEN, report.status())
# Assert Attachment
self.assertEqual(1, Attachment.objects.count())
report = Attachment.objects.first()
self.assertTrue(report.attachment.name.endswith("jpg"))
self.assertEqual(200, requests.get(report.get_absolute_url()).status_code)
def test_should_limit_file_count(self):
p = ProductFactory.create(ai_pics_count=0)
response = self.json_request(
self.url + "?device_id=TEST-DEVICE-ID",
data={
'description': "test-description",
'product_id': p.pk,
'files_count': 50,
'file_ext': 'jpg',
'mime_type': 'image/jpeg',
},
)
self.assertEqual(403, response.status_code)
self.assertEqual("Forbidden", response.reason_phrase)
class TestGetByCodeV2(TestCase, JsonRequestMixin):
url = '/a/v2/get_by_code'
def test_should_return_200_for_non_ean_13(self):
response = self.json_request(
self.url + "?device_id=TEST-DEVICE-ID&code=123",
)
self.assertEqual(200, response.status_code)
def test_should_return_200_when_polish_and_known_product(self):
c = CompanyFactory.create(
plCapital=100,
plWorkers=0,
plRnD=100,
plRegistered=100,
plNotGlobEnt=100,
description="KOTEK",
sources="KOTEK|BBBB",
verified=True,
is_friend=True,
plCapital_notes="AA",
plWorkers_notes="BBB",
plRnD_notes="CCC",
plRegistered_notes="DDD",
plNotGlobEnt_notes="EEEE",
)
p = ProductFactory.create(code=5900049011829, company=c, brand=None)
response = self.json_request(self.url + "?device_id=TEST-DEVICE-ID&code=" + str(p.code))
self.assertEqual(200, response.status_code)
class TestCreateReportV2(TestCase, JsonRequestMixin):
url = '/a/v2/create_report'
def test_should_return_200_for_non_ean_13(self):
response = self.json_request(
self.url + "?device_id=TEST-DEVICE-ID&report_id=123", data={'description': "test-description"}
)
self.assertEqual(200, response.status_code)
class TestUpdateReportV2(TestCase, JsonRequestMixin):
url = '/a/v2/update_report'
def test_should_return_200_for_non_ean_13(self):
report = ReportFactory.create(client="TEST-DEVICE-ID")
response = self.json_request(
self.url + "?device_id=TEST-DEVICE-ID&&report_id=" + str(report.pk),
data={'description': "test-description"},
)
self.assertEqual(200, response.status_code)
class TestAttachFileV2(TestCase, JsonRequestMixin):
url = '/a/v2/attach_file'
def test_should_return_200_for_non_ean_13(self):
report = ReportFactory.create(client="TEST-DEVICE-ID")
response = self.json_request(
self.url + "?device_id=TEST-DEVICE-ID&report_id=" + str(report.pk),
data={'file_ext': 'png', 'mime_type': 'AAA'},
)
self.assertEqual(200, response.status_code)
| 37.513228
| 116
| 0.542924
| 2,103
| 21,270
| 5.284831
| 0.113172
| 0.068832
| 0.026993
| 0.035631
| 0.798362
| 0.73223
| 0.726291
| 0.725841
| 0.712885
| 0.708656
| 0
| 0.045188
| 0.34142
| 21,270
| 566
| 117
| 37.579505
| 0.748215
| 0.010907
| 0
| 0.670061
| 0
| 0
| 0.200542
| 0.033717
| 0
| 0
| 0
| 0
| 0.112016
| 1
| 0.046843
| false
| 0
| 0.022403
| 0
| 0.107943
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
872e76902f13f07645ab182facd89674bc4c4526
| 41
|
py
|
Python
|
tests/core_tests.py
|
sColin16/gearbox_py
|
e9c8fb8a07c9342f15e0d0df0a746b6fb3de8dfc
|
[
"MIT"
] | null | null | null |
tests/core_tests.py
|
sColin16/gearbox_py
|
e9c8fb8a07c9342f15e0d0df0a746b6fb3de8dfc
|
[
"MIT"
] | null | null | null |
tests/core_tests.py
|
sColin16/gearbox_py
|
e9c8fb8a07c9342f15e0d0df0a746b6fb3de8dfc
|
[
"MIT"
] | null | null | null |
"""Tests for the gearbox core module."""
| 20.5
| 40
| 0.682927
| 6
| 41
| 4.666667
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.146341
| 41
| 1
| 41
| 41
| 0.8
| 0.829268
| 0
| null | 0
| null | 0
| 0
| null | 0
| 0
| 0
| null | 1
| null | true
| 0
| 0
| null | null | null | 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
87524b55e78ede0956adf4e645e3ff12b57f8cf8
| 1,058
|
py
|
Python
|
src/constants.py
|
Naddy7706/Electric
|
2501a1e87f78b81bdd5c85fbc4f9d44609a8598d
|
[
"Apache-2.0"
] | null | null | null |
src/constants.py
|
Naddy7706/Electric
|
2501a1e87f78b81bdd5c85fbc4f9d44609a8598d
|
[
"Apache-2.0"
] | null | null | null |
src/constants.py
|
Naddy7706/Electric
|
2501a1e87f78b81bdd5c85fbc4f9d44609a8598d
|
[
"Apache-2.0"
] | null | null | null |
from utils import get_architecture
from time import strftime
import platform
import sys
import os
__version__ = '1.0.0a'
# Install Debug Headers
install_debug_headers = [
f"Attaching debugger at {strftime('%H:%M:%S')} on install::initialization",
f"Electric is running on {platform.platform()}",
f"User machine name: {platform.node()}",
f"Command line: \"{' '.join(sys.argv)}\"",
f"Arguments: \"{' '.join(sys.argv[1:])}\"",
f"Current directory: {os.getcwd()}",
f"Electric version: {__version__}",
f"System architecture detected: {get_architecture()}"
]
# Uninstall Debug Headers
uninstall_debug_headers = [
f"Attaching debugger at {strftime('%H:%M:%S')} on uninstall::initialization",
f"Electric is running on {platform.platform()}",
f"User domain name: {platform.node()}",
f"Command line: \"{' '.join(sys.argv)}\"",
f"Arguments: \"{' '.join(sys.argv[1:])}\"",
f"Current directory: {os.getcwd()}",
f"Electric version: {__version__}",
f"System architecture detected: {get_architecture()}"
]
| 32.060606
| 81
| 0.661626
| 133
| 1,058
| 5.120301
| 0.338346
| 0.070485
| 0.064611
| 0.064611
| 0.737151
| 0.737151
| 0.737151
| 0.737151
| 0.737151
| 0.737151
| 0
| 0.005599
| 0.155955
| 1,058
| 32
| 82
| 33.0625
| 0.756999
| 0.042533
| 0
| 0.461538
| 0
| 0
| 0.587129
| 0.132673
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.192308
| 0
| 0.192308
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
877b146a582cd54dabeca89ac4fb0202cdbaa9b3
| 42
|
py
|
Python
|
emdee/_emdeeExceptions.py
|
rpconnol/emdee
|
6f93c30c4ae3042b5c0dd539f1aeecc49e946000
|
[
"MIT"
] | 1
|
2019-03-25T17:56:51.000Z
|
2019-03-25T17:56:51.000Z
|
emdee/_emdeeExceptions.py
|
rpconnol/emdee
|
6f93c30c4ae3042b5c0dd539f1aeecc49e946000
|
[
"MIT"
] | null | null | null |
emdee/_emdeeExceptions.py
|
rpconnol/emdee
|
6f93c30c4ae3042b5c0dd539f1aeecc49e946000
|
[
"MIT"
] | null | null | null |
class NonzeroRunCount(Exception):
pass
| 21
| 33
| 0.785714
| 4
| 42
| 8.25
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.142857
| 42
| 2
| 34
| 21
| 0.916667
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0.5
| 0
| 0
| 0.5
| 0
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| 0
| 0
|
0
| 5
|
5e68421005c127d7e7b147cfc97106027ca96e35
| 99
|
py
|
Python
|
user_session/admin.py
|
hens-virtuella-varld/django-limit-online-user-number
|
1816b45fb149a4b4288d5ef37f65c5f48e83ec1a
|
[
"MIT"
] | null | null | null |
user_session/admin.py
|
hens-virtuella-varld/django-limit-online-user-number
|
1816b45fb149a4b4288d5ef37f65c5f48e83ec1a
|
[
"MIT"
] | null | null | null |
user_session/admin.py
|
hens-virtuella-varld/django-limit-online-user-number
|
1816b45fb149a4b4288d5ef37f65c5f48e83ec1a
|
[
"MIT"
] | null | null | null |
from django.contrib import admin
from .models import UserSession
admin.site.register(UserSession)
| 19.8
| 32
| 0.838384
| 13
| 99
| 6.384615
| 0.692308
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.10101
| 99
| 4
| 33
| 24.75
| 0.932584
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.666667
| 0
| 0.666667
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
0d7b3d967c728fe12c8a0240217cf8cfe3b3393c
| 37,218
|
py
|
Python
|
client/dialogues.py
|
remremrem/EV-Tribute
|
c7dd412eedad4b8eba0cf2d4c95d539d4b80c852
|
[
"MIT"
] | 1
|
2015-06-23T03:48:03.000Z
|
2015-06-23T03:48:03.000Z
|
client/dialogues.py
|
remremrem/EV-Tribute
|
c7dd412eedad4b8eba0cf2d4c95d539d4b80c852
|
[
"MIT"
] | null | null | null |
client/dialogues.py
|
remremrem/EV-Tribute
|
c7dd412eedad4b8eba0cf2d4c95d539d4b80c852
|
[
"MIT"
] | null | null | null |
import math
import pyglet
import rabbyt
from pyglet.gl import *
from glart import *
from sounds import *
class MapDialogue:
def __init__(self,window):
self.window = window
self.width = 500
self.height = 500
self.margin = [(window[0] - self.width) / 2 ,(window[1] - self.height) / 2]
self.corners = [(self.margin[0], self.margin[1]), (self.margin[0], window[1] - self.margin[1]),
(window[0] - self.margin[0], window[1] -self.margin[1]), (window[0] - self.margin[0], self.margin[1])]
self.center = (window[0]/2, window[1]/2)
self.open = 0
self.maplocation = [0,0]
self.zoom = 3
self.selected = None
self.active = None
self.activelinks = []
self.batch = pyglet.graphics.Batch()
self.buttons = {"ZOOM": OGLButton(label="ZOOM", height=20, width=62,
center=(self.corners[0][0]+50,self.corners[0][1]+20),batch = self.batch, font_size=10),
"OUT": OGLButton(label="OUT", height=20, width=62,
center=(self.corners[0][0]+125,self.corners[0][1]+20),batch = self.batch, font_size=10),
"CONFIRM": OGLButton(label="CONFIRM", height=20, width=70,
center=(self.corners[0][0]+300,self.corners[0][1]+20),batch = self.batch, font_size=10),
"ABORT": OGLButton(label="ABORT", height=20, width=70,
center=(self.corners[0][0]+375,self.corners[0][1]+20),batch = self.batch, font_size=10)}
def draw(self,systemdict,linkdict):
thick=2
glBegin(GL_QUADS)
#glColor3f(0.0, 0.0, 0.0)
#glVertex2f(self.corners[0][0], self.corners[0][1])
#glVertex2f(self.corners[1][0], self.corners[1][1])
#glVertex2f(self.corners[2][0], self.corners[2][1])
#glVertex2f(self.corners[3][0], self.corners[3][1])
glColor3f(0.1, 0.1, 0.1) #start border
glVertex2f(self.corners[0][0], self.corners[0][1])
glVertex2f(self.corners[1][0], self.corners[1][1])
glVertex2f(self.corners[1][0] + thick, self.corners[1][1])
glVertex2f(self.corners[0][0] + thick, self.corners[0][1])
glVertex2f(self.corners[1][0], self.corners[1][1])
glVertex2f(self.corners[2][0], self.corners[2][1])
glVertex2f(self.corners[2][0], self.corners[2][1] - thick)
glVertex2f(self.corners[1][0], self.corners[1][1] - thick)
glVertex2f(self.corners[2][0], self.corners[2][1])
glVertex2f(self.corners[3][0], self.corners[3][1])
glVertex2f(self.corners[3][0] - thick, self.corners[3][1])
glVertex2f(self.corners[2][0] - thick, self.corners[2][1])
glVertex2f(self.corners[3][0], self.corners[3][1])
glVertex2f(self.corners[0][0], self.corners[0][1])
glVertex2f(self.corners[0][0], self.corners[0][1] + thick)
glVertex2f(self.corners[3][0], self.corners[3][1] + thick)
glEnd()
glPointSize(7.0)
glBegin(GL_POINTS)
glColor3f(0.247, 0.463, 0.682)
for item in systemdict:
system = systemdict.get(item)
x = self.maplocation[0] + self.center[0] + system.location[0]*self.zoom
y = self.maplocation[1] + self.center[1] + system.location[1]*self.zoom
system.icon = [x,y]
#print "SYSTEM" + system
if system.active == 1:
glColor3f(1.0, 0.678, 1.0)
elif item == self.selected:
glColor3f(0.463, 0.678, 1.0)
glVertex2f(x, y)
glColor3f(0.247, 0.463, 0.682)
glEnd()
glLineWidth(1.0)
glBegin(GL_LINES)
glColor3f(0.25, 0.468, 0.69)
for item in linkdict:
link = linkdict.get(item)
ax = self.maplocation[0] + self.center[0] + link.start[0] * self.zoom
ay = self.maplocation[1] + self.center[1] + link.start[1] * self.zoom
bx = self.maplocation[0] + self.center[0] + link.end[0] * self.zoom
by = self.maplocation[1] + self.center[1] + link.end[1] * self.zoom
if link.active == 1:
glColor3f(0.4196, 0.1373, 0.5569)
elif link.plotted == 1:
glColor3f(0.0, 1.0, 0.498)
glVertex2f(ax, ay)
glVertex2f(bx, by)
glColor3f(0.25, 0.468, 0.69)
glEnd()
for button in self.buttons:
self.buttons.get(button).draw()
self.batch.draw()
def buttonEvent(self, event):
if event == "ZOOM":
pass
if event == "OUT":
pass
if event == "CONFIRM":
self.open = 0
return 1
if event == "ABORT":
self.open = 0
return None
def highlightLinks(self, linkdict, activesystem):
for link in linkdict:
if (linkdict.get(link).name == str(self.selected)+activesystem or
linkdict.get(link).name == activesystem+str(self.selected)):
linkdict.get(link).active = 1
else: linkdict.get(link).active = 0
def handleEvent(self, event, systemdict, selectedsystem, activesystem, linkdict, x, y, sounds):
if event == "mouse_left":
value = None
wasbutton = 0
for button in self.buttons:
if (x - self.buttons.get(button).center[0] in
range(self.buttons.get(button).width * -1, self.buttons.get(button).width) and
y - self.buttons.get(button).center[1] in
range(self.buttons.get(button).height * -1, self.buttons.get(button).height)):
value = self.buttonEvent(button)
wasbutton = 1
sounds.menu1.play()
if wasbutton == 0:
for system in systemdict:
if (x - systemdict.get(system).icon[0] in range(-7,7) and
y - systemdict.get(system).icon[1] in range(-7,7)):
if system == self.selected:
self.selected = None
value = None
elif systemdict.get(system).selected != self.selected:
self.selected = system
value = None
break
self.highlightLinks(linkdict, activesystem)
if value == None:
return selectedsystem
if value == 1:
return self.selected
class DockDialogue:
def __init__(self,window):
self.window = window
self.width = 400
self.height = 400
self.margin = [(window[0] - self.width) / 2 ,(window[1] - self.height) / 2]
self.corners = [(self.margin[0], self.margin[1]), (self.margin[0], window[1] - self.margin[1]),
(window[0] - self.margin[0], window[1] -self.margin[1]), (window[0] - self.margin[0], self.margin[1])]
self.center = (window[0]/2, window[1]/2)
self.open = 0
self.batch = pyglet.graphics.Batch()
self.buttons = {"ANTIMATTER": OGLButton(label="ANTIMATTER", height=20, width=50,
center=(self.corners[2][0]-50,self.corners[2][1]-150),batch = self.batch),
"JOBS": OGLButton(label="JOBS", height=20, width=50,
center=(self.corners[2][0]-50,self.corners[2][1]-180),batch = self.batch),
"OUTFIT": OGLButton(label="OUTFIT", height=20, width=50,
center=(self.corners[2][0]-50,self.corners[2][1]-210),batch = self.batch),
"EMBARK": OGLButton(label="EMBARK", height=20, width=50,
center=(self.corners[2][0]-50,self.corners[2][1]-240),batch = self.batch)}
def draw(self):
thick=2
glBegin(GL_QUADS) #start background
glColor3f(0.0, 0.0, 0.0)
glVertex2f(self.corners[0][0], self.corners[0][1])
glVertex2f(self.corners[1][0], self.corners[1][1])
glVertex2f(self.corners[2][0], self.corners[2][1])
glVertex2f(self.corners[3][0], self.corners[3][1])
glColor3f(0.4, 0.5, 0.2) #start border
glVertex2f(self.corners[0][0], self.corners[0][1])
glVertex2f(self.corners[1][0], self.corners[1][1])
glVertex2f(self.corners[1][0] + thick, self.corners[1][1])
glVertex2f(self.corners[0][0] + thick, self.corners[0][1])
glVertex2f(self.corners[1][0], self.corners[1][1])
glVertex2f(self.corners[2][0], self.corners[2][1])
glVertex2f(self.corners[2][0], self.corners[2][1] - thick)
glVertex2f(self.corners[1][0], self.corners[1][1] - thick)
glVertex2f(self.corners[2][0], self.corners[2][1])
glVertex2f(self.corners[3][0], self.corners[3][1])
glVertex2f(self.corners[3][0] - thick, self.corners[3][1])
glVertex2f(self.corners[2][0] - thick, self.corners[2][1])
glVertex2f(self.corners[3][0], self.corners[3][1])
glVertex2f(self.corners[0][0], self.corners[0][1])
glVertex2f(self.corners[0][0], self.corners[0][1] + thick)
glVertex2f(self.corners[3][0], self.corners[3][1] + thick)
glEnd()
for button in self.buttons:
self.buttons.get(button).draw()
self.batch.draw()
def handleEvent(self, event, x, y, sounds):
if event == "mouse_left":
for button in self.buttons:
if (x - self.buttons.get(button).center[0] in
range(self.buttons.get(button).width * -1, self.buttons.get(button).width) and
y - self.buttons.get(button).center[1] in
range(self.buttons.get(button).height * -1, self.buttons.get(button).height)):
sounds.menu1.play()
return button
class MenuDialogue:
def __init__(self,window):
self.docked = 0
self.window = window
self.width = 250
self.height = 300
self.margin = [(window[0] - self.width) / 2 ,(window[1] - self.height) / 2]
self.corners = [(self.margin[0], self.margin[1]), (self.margin[0], window[1] - self.margin[1]),
(window[0] - self.margin[0], window[1] -self.margin[1]), (window[0] - self.margin[0], self.margin[1])]
self.center = (window[0]/2, window[1]/2)
self.open = 0
self.batch = pyglet.graphics.Batch()
self.buttons = {"BACK": OGLButton(label="BACK", height=30, width=70,
center=(self.center[0],self.center[1]+50),batch = self.batch),
"OPTIONS": OGLButton(label="OPTIONS", height=30, width=70,
center=(self.center[0],self.center[1]),batch = self.batch),
"QUIT": OGLButton(label="QUIT", height=30, width=70,
center=(self.center[0],self.center[1]-50),batch = self.batch)}
def draw(self):
thick=2
glBegin(GL_QUADS) #start background
if self.docked == 1:
glColor3f(0.0, 0.0, 0.0)
glVertex2f(self.corners[0][0], self.corners[0][1])
glVertex2f(self.corners[1][0], self.corners[1][1])
glVertex2f(self.corners[2][0], self.corners[2][1])
glVertex2f(self.corners[3][0], self.corners[3][1])
glColor3f(0.4, 0.5, 0.2) #start border
glVertex2f(self.corners[0][0], self.corners[0][1])
glVertex2f(self.corners[1][0], self.corners[1][1])
glVertex2f(self.corners[1][0] + thick, self.corners[1][1])
glVertex2f(self.corners[0][0] + thick, self.corners[0][1])
glVertex2f(self.corners[1][0], self.corners[1][1])
glVertex2f(self.corners[2][0], self.corners[2][1])
glVertex2f(self.corners[2][0], self.corners[2][1] - thick)
glVertex2f(self.corners[1][0], self.corners[1][1] - thick)
glVertex2f(self.corners[2][0], self.corners[2][1])
glVertex2f(self.corners[3][0], self.corners[3][1])
glVertex2f(self.corners[3][0] - thick, self.corners[3][1])
glVertex2f(self.corners[2][0] - thick, self.corners[2][1])
glVertex2f(self.corners[3][0], self.corners[3][1])
glVertex2f(self.corners[0][0], self.corners[0][1])
glVertex2f(self.corners[0][0], self.corners[0][1] + thick)
glVertex2f(self.corners[3][0], self.corners[3][1] + thick)
glEnd()
for button in self.buttons:
self.buttons.get(button).draw()
self.batch.draw()
def handleEvent(self, event, x, y, sounds):
if event == "mouse_left":
for button in self.buttons:
if (x - self.buttons.get(button).center[0] in
range(self.buttons.get(button).width * -1, self.buttons.get(button).width) and
y - self.buttons.get(button).center[1] in
range(self.buttons.get(button).height * -1, self.buttons.get(button).height)):
sounds.menu1.play()
return button
class OptionsDialogue:
def __init__(self,window):
self.docked = 0
self.window = window
self.width = window[0]-40
self.height = window[1]-40
self.margin = [(window[0] - self.width) / 2 ,(window[1] - self.height) / 2]
self.corners = [(self.margin[0], self.margin[1]), (self.margin[0], window[1] - self.margin[1]),
(window[0] - self.margin[0], window[1] -self.margin[1]), (window[0] - self.margin[0], self.margin[1])]
self.center = (window[0]/2, window[1]/2)
self.open = 0
self.batch = pyglet.graphics.Batch()
self.labels = {"OPTIONS": pyglet.text.Label('OPTIONS',
font_name = 'verdana', font_size = 26,
bold = 0, color = (200, 100, 100, 255),
anchor_x = 'center', anchor_y = 'center',
x = self.width/2,
y = self.height - 100, batch = self.batch),
"MODE": pyglet.text.Label('Screen Mode',
font_name = 'verdana', font_size = 12,
bold = 0, color = (200, 100, 100, 255),
anchor_x = 'right', anchor_y = 'center',
x = self.width/2-100,
y = self.height - 200, batch = self.batch),
"RESOLUTION": pyglet.text.Label('Resolution',
font_name = 'verdana', font_size = 12,
bold = 0, color = (200, 100, 100, 255),
anchor_x = 'right', anchor_y = 'center',
x = self.width/2-100,
y = self.height - 260, batch = self.batch),
"FX VOLUME": pyglet.text.Label('FX Volume',
font_name = 'verdana', font_size = 12,
bold = 0, color = (200, 100, 100, 255),
anchor_x = 'right', anchor_y = 'center',
x = self.width/2-100,
y = self.height - 320, batch = self.batch),
"FX VALUE": pyglet.text.Label('80',
font_name = 'verdana', font_size = 12,
bold = 0, color = (200, 100, 100, 255),
anchor_x = 'center', anchor_y = 'center',
x = self.width/2,
y = self.height - 320, batch = self.batch),
"MUSIC VOLUME": pyglet.text.Label('Music Volume',
font_name = 'verdana', font_size = 12,
bold = 0, color = (200, 100, 100, 255),
anchor_x = 'right', anchor_y = 'center',
x = self.width/2-100,
y = self.height - 380, batch = self.batch),
"MUSIC VALUE": pyglet.text.Label('80',
font_name = 'verdana', font_size = 12,
bold = 0, color = (200, 100, 100, 255),
anchor_x = 'center', anchor_y = 'center',
x = self.width/2,
y = self.height - 380, batch = self.batch)}
self.buttons = {"FULLSCREEN": OGLButton(label="WINDOWED", height=34, width=100,
center=(self.width/2 , self.height - 200), batch=self.batch),
"RESOLUTION": OGLButton(label="800x600", height=34, width=100,
center=(self.width/2 , self.height - 260), batch=self.batch),
"FXUP": OGLButton(label="UP", height=30, width=40,
center=(self.width/2+50 , self.height - 320), batch=self.batch),
"FXDOWN": OGLButton(label="DOWN", height=30, width=40,
center=(self.width/2-50 , self.height - 320), batch=self.batch),
"FXMUTE": OGLButton(label="MUTE", height=24, width=40,
center=(self.width/2+120 , self.height - 320), batch=self.batch),
"MUSICUP": OGLButton(label="UP", height=30, width=40,
center=(self.width/2+50 , self.height - 380), batch=self.batch),
"MUSICDOWN": OGLButton(label="DOWN", height=30, width=40,
center=(self.width/2-50 , self.height - 380), batch=self.batch),
"MUSICMUTE": OGLButton(label="MUTE", height=24, width=40,
center=(self.width/2+120 , self.height - 380), batch=self.batch),
"CONTROLS": OGLButton(label="CONTROLS", height=34, width=100,
center=(self.width/2 , self.height - 440), batch=self.batch),
"BACK": OGLButton(label="BACK", height=40, width=100,
center=(self.width-80 , 60), batch=self.batch)}
def draw(self):
thick=2
glBegin(GL_QUADS) #start background
if self.docked == 1:
glColor3f(0.0, 0.0, 0.0)
glVertex2f(self.corners[0][0], self.corners[0][1])
glVertex2f(self.corners[1][0], self.corners[1][1])
glVertex2f(self.corners[2][0], self.corners[2][1])
glVertex2f(self.corners[3][0], self.corners[3][1])
glColor3f(0.4, 0.5, 0.2) #start border
glVertex2f(self.corners[0][0], self.corners[0][1])
glVertex2f(self.corners[1][0], self.corners[1][1])
glVertex2f(self.corners[1][0] + thick, self.corners[1][1])
glVertex2f(self.corners[0][0] + thick, self.corners[0][1])
glVertex2f(self.corners[1][0], self.corners[1][1])
glVertex2f(self.corners[2][0], self.corners[2][1])
glVertex2f(self.corners[2][0], self.corners[2][1] - thick)
glVertex2f(self.corners[1][0], self.corners[1][1] - thick)
glVertex2f(self.corners[2][0], self.corners[2][1])
glVertex2f(self.corners[3][0], self.corners[3][1])
glVertex2f(self.corners[3][0] - thick, self.corners[3][1])
glVertex2f(self.corners[2][0] - thick, self.corners[2][1])
glVertex2f(self.corners[3][0], self.corners[3][1])
glVertex2f(self.corners[0][0], self.corners[0][1])
glVertex2f(self.corners[0][0], self.corners[0][1] + thick)
glVertex2f(self.corners[3][0], self.corners[3][1] + thick)
glEnd()
for button in self.buttons:
self.buttons.get(button).draw()
self.batch.draw()
def handleEvent(self, event, x, y, sounds):
if event == "mouse_left":
for button in self.buttons:
if (x - self.buttons.get(button).center[0] in
range(self.buttons.get(button).width * -1, self.buttons.get(button).width) and
y - self.buttons.get(button).center[1] in
range(self.buttons.get(button).height * -1, self.buttons.get(button).height)):
sounds.menu1.play()
return button
class ControlsDialogue:
def __init__(self,window):
self.docked = 0
self.window = window
self.width = window[0]-40
self.height = window[1]-40
self.margin = [(window[0] - self.width) / 2 ,(window[1] - self.height) / 2]
self.corners = [(self.margin[0], self.margin[1]), (self.margin[0], window[1] - self.margin[1]),
(window[0] - self.margin[0], window[1] -self.margin[1]), (window[0] - self.margin[0], self.margin[1])]
self.center = (window[0]/2, window[1]/2)
self.open = 0
self.batch = pyglet.graphics.Batch()
self.labels = {"[up]": (pyglet.text.Label('UP',
font_name = 'verdana', font_size = 12,
bold = 1, color = (200, 100, 100, 255),
anchor_x = 'left', anchor_y = 'center',
x = 150,
y = self.height - 60, batch = self.batch)),
"[down]": (pyglet.text.Label('DOWN',
font_name = 'verdana', font_size = 12,
bold = 1, color = (200, 100, 100, 255),
anchor_x = 'left', anchor_y = 'center',
x = 150,
y = self.height - 85, batch = self.batch)),
"[left]": (pyglet.text.Label('LEFT',
font_name = 'verdana', font_size = 12,
bold = 1, color = (200, 100, 100, 255),
anchor_x = 'left', anchor_y = 'center',
x = 150,
y = self.height - 110, batch = self.batch)),
"[right]": (pyglet.text.Label('RIGHT',
font_name = 'verdana', font_size = 12,
bold = 1, color = (200, 100, 100, 255),
anchor_x = 'left', anchor_y = 'center',
x = 150,
y = self.height - 135, batch = self.batch)),
"[primary fire]": (pyglet.text.Label('SPACE',
font_name = 'verdana', font_size = 12,
bold = 1, color = (200, 100, 100, 255),
anchor_x = 'left', anchor_y = 'center',
x = 150,
y = self.height - 160, batch = self.batch)),
"[secondary fire]": (pyglet.text.Label('LCTRL',
font_name = 'verdana', font_size = 12,
bold = 1, color = (200, 100, 100, 255),
anchor_x = 'left', anchor_y = 'center',
x = 150,
y = self.height - 185, batch = self.batch)),
"[cycle secondary]": (pyglet.text.Label('W',
font_name = 'verdana', font_size = 12,
bold = 1, color = (200, 100, 100, 255),
anchor_x = 'left', anchor_y = 'center',
x = 150,
y = self.height - 210, batch = self.batch)),
"[target]": (pyglet.text.Label('TAB',
font_name = 'verdana', font_size = 12,
bold = 1, color = (200, 100, 100, 255),
anchor_x = 'left', anchor_y = 'center',
x = 150,
y = self.height - 235, batch = self.batch)),
"[target nearest]": (pyglet.text.Label('Q',
font_name = 'verdana', font_size = 12,
bold = 1, color = (200, 100, 100, 255),
anchor_x = 'left', anchor_y = 'center',
x = 150,
y = self.height - 260, batch = self.batch)),
"[land]": (pyglet.text.Label('L',
font_name = 'verdana', font_size = 12,
bold = 1, color = (200, 100, 100, 255),
anchor_x = 'left', anchor_y = 'center',
x = 150,
y = self.height - 285, batch = self.batch)),
"[cycle planets]": (pyglet.text.Label('SEMICOLON',
font_name = 'verdana', font_size = 12,
bold = 1, color = (200, 100, 100, 255),
anchor_x = 'left', anchor_y = 'center',
x = 150,
y = self.height - 310, batch = self.batch)),
"[map]": (pyglet.text.Label('M',
font_name = 'verdana', font_size = 12,
bold = 1, color = (200, 100, 100, 255),
anchor_x = 'left', anchor_y = 'center',
x = 500,
y = self.height - 60, batch = self.batch)),
"[jump]": (pyglet.text.Label('J',
font_name = 'verdana', font_size = 12,
bold = 1, color = (200, 100, 100, 255),
anchor_x = 'left', anchor_y = 'center',
x = 500,
y = self.height - 85, batch = self.batch)),
"[board]": (pyglet.text.Label('B',
font_name = 'verdana', font_size = 12,
bold = 1, color = (200, 100, 100, 255),
anchor_x = 'left', anchor_y = 'center',
x = 500,
y = self.height - 110, batch = self.batch)),
"[booster]": (pyglet.text.Label('E',
font_name = 'verdana', font_size = 12,
bold = 1, color = (200, 100, 100, 255),
anchor_x = 'left', anchor_y = 'center',
x = 500,
y = self.height - 135, batch = self.batch)),
"[stats]": (pyglet.text.Label('SLASH',
font_name = 'verdana', font_size = 12,
bold = 1, color = (200, 100, 100, 255),
anchor_x = 'left', anchor_y = 'center',
x = 500,
y = self.height - 160, batch = self.batch)),
"[missions]": (pyglet.text.Label('I',
font_name = 'verdana', font_size = 12,
bold = 1, color = (200, 100, 100, 255),
anchor_x = 'left', anchor_y = 'center',
x = 500,
y = self.height - 185, batch = self.batch)),
"[global chat]": (pyglet.text.Label('RETURN',
font_name = 'verdana', font_size = 12,
bold = 1, color = (200, 100, 100, 255),
anchor_x = 'left', anchor_y = 'center',
x = 500,
y = self.height - 210, batch = self.batch)),
"[group chat]": (pyglet.text.Label('BACKSLASH',
font_name = 'verdana', font_size = 12,
bold = 1, color = (200, 100, 100, 255),
anchor_x = 'left', anchor_y = 'center',
x = 500,
y = self.height - 235, batch = self.batch)),
"[gov chat]": (pyglet.text.Label('BRACKETLEFT',
font_name = 'verdana', font_size = 12,
bold = 1, color = (200, 100, 100, 255),
anchor_x = 'left', anchor_y = 'center',
x = 500,
y = self.height - 260, batch = self.batch))}
self.buttons = {"BACK": OGLButton(label="Back", height=40, width=100,
center=(self.width - 70 , 60), batch=self.batch),
"SAVE": OGLButton(label="Save", height=40, width=100,
center=(70 , 60), batch=self.batch),
"[up]": OGLButton(label="Thrust", height=15, width=100,
center=(70 , self.height - 60), batch=self.batch),
"[down]": OGLButton(label="180", height=15, width=100,
center=(70 , self.height - 85), batch=self.batch),
"[left]": OGLButton(label="Left", height=15, width=100,
center=(70 , self.height - 110), batch=self.batch),
"[right]": OGLButton(label="Right", height=15, width=100,
center=(70 , self.height - 135), batch=self.batch),
"[primary fire]": OGLButton(label="Primary", height=15, width=100,
center=(70 , self.height - 160), batch=self.batch),
"[secondary fire]": OGLButton(label="Secondary", height=15, width=100,
center=(70 , self.height - 185), batch=self.batch),
"[cycle secondary]": OGLButton(label="Cycle Weapon", height=15, width=100,
center=(70 , self.height - 210), batch=self.batch),
"[target]": OGLButton(label="Target", height=15, width=100,
center=(70 , self.height - 235), batch=self.batch),
"[target nearest]": OGLButton(label="Target Nearest", height=15, width=100,
center=(70 , self.height - 260), batch=self.batch),
"[land]": OGLButton(label="Land", height=15, width=100,
center=(70 , self.height - 285), batch=self.batch),
"[cycle planets]": OGLButton(label="Cycle Planets", height=15, width=100,
center=(70 , self.height - 310), batch=self.batch),
"[map]": OGLButton(label="Map", height=15, width=100,
center=(420 , self.height - 60), batch=self.batch),
"[jump]": OGLButton(label="Jump", height=15, width=100,
center=(420 , self.height - 85), batch=self.batch),
"[board]": OGLButton(label="Board", height=15, width=100,
center=(420 , self.height - 110), batch=self.batch),
"[booster]": OGLButton(label="Booster", height=15, width=100,
center=(420 , self.height - 135), batch=self.batch),
"[stats]": OGLButton(label="Player Stats", height=15, width=100,
center=(420 , self.height - 160), batch=self.batch),
"[missions]": OGLButton(label="Mission Info", height=15, width=100,
center=(420 , self.height - 185), batch=self.batch),
"[global chat]": OGLButton(label="Global Chat", height=15, width=100,
center=(420 , self.height - 210), batch=self.batch),
"[group chat]": OGLButton(label="Group Chat", height=15, width=100,
center=(420 , self.height - 235), batch=self.batch),
"[gov chat]": OGLButton(label="Gov Chat", height=15, width=100,
center=(420 , self.height - 260), batch=self.batch)}
def draw(self):
thick=2
glBegin(GL_QUADS) #start background
if self.docked == 1:
glColor3f(0.0, 0.0, 0.0)
glVertex2f(self.corners[0][0], self.corners[0][1])
glVertex2f(self.corners[1][0], self.corners[1][1])
glVertex2f(self.corners[2][0], self.corners[2][1])
glVertex2f(self.corners[3][0], self.corners[3][1])
glColor3f(0.4, 0.5, 0.2) #start border
glVertex2f(self.corners[0][0], self.corners[0][1])
glVertex2f(self.corners[1][0], self.corners[1][1])
glVertex2f(self.corners[1][0] + thick, self.corners[1][1])
glVertex2f(self.corners[0][0] + thick, self.corners[0][1])
glVertex2f(self.corners[1][0], self.corners[1][1])
glVertex2f(self.corners[2][0], self.corners[2][1])
glVertex2f(self.corners[2][0], self.corners[2][1] - thick)
glVertex2f(self.corners[1][0], self.corners[1][1] - thick)
glVertex2f(self.corners[2][0], self.corners[2][1])
glVertex2f(self.corners[3][0], self.corners[3][1])
glVertex2f(self.corners[3][0] - thick, self.corners[3][1])
glVertex2f(self.corners[2][0] - thick, self.corners[2][1])
glVertex2f(self.corners[3][0], self.corners[3][1])
glVertex2f(self.corners[0][0], self.corners[0][1])
glVertex2f(self.corners[0][0], self.corners[0][1] + thick)
glVertex2f(self.corners[3][0], self.corners[3][1] + thick)
glEnd()
for button in self.buttons:
self.buttons.get(button).draw()
self.batch.draw()
def handleEvent(self, event, x, y, sounds):
if event == "mouse_left":
for button in self.buttons:
if (x - self.buttons.get(button).center[0] in
range(self.buttons.get(button).width * -1, self.buttons.get(button).width) and
y - self.buttons.get(button).center[1] in
range(self.buttons.get(button).height * -1, self.buttons.get(button).height)):
sounds.menu1.play()
return button
| 59.07619
| 126
| 0.445403
| 3,966
| 37,218
| 4.143469
| 0.057741
| 0.147934
| 0.127792
| 0.100408
| 0.817927
| 0.811112
| 0.80454
| 0.750137
| 0.684902
| 0.664395
| 0
| 0.087712
| 0.415525
| 37,218
| 629
| 127
| 59.170111
| 0.667724
| 0.009968
| 0
| 0.647469
| 0
| 0
| 0.041459
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.029668
| false
| 0.00349
| 0.010471
| 0
| 0.062827
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 1
| 1
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
0d9fb784c7b905623b0655ef75ee74796f333c79
| 172
|
py
|
Python
|
config/templates/etc/gunicorn.conf.py
|
MinchinWeb/papermerge
|
8a5f73207413a3ea8989d277e140d448baa35ca4
|
[
"Apache-2.0"
] | 1
|
2021-01-24T14:59:52.000Z
|
2021-01-24T14:59:52.000Z
|
config/templates/etc/gunicorn.conf.py
|
MinchinWeb/papermerge
|
8a5f73207413a3ea8989d277e140d448baa35ca4
|
[
"Apache-2.0"
] | null | null | null |
config/templates/etc/gunicorn.conf.py
|
MinchinWeb/papermerge
|
8a5f73207413a3ea8989d277e140d448baa35ca4
|
[
"Apache-2.0"
] | null | null | null |
{{notice}}
workers = 4
errorlog = "{{proj_root}}/run/log/gunicorn.error"
accesslog = "{{proj_root}}/run/log/gunicorn.access"
loglevel = "debug"
bind = ["127.0.0.1:9001"]
| 19.111111
| 51
| 0.668605
| 25
| 172
| 4.52
| 0.76
| 0.141593
| 0.19469
| 0.247788
| 0.389381
| 0
| 0
| 0
| 0
| 0
| 0
| 0.071429
| 0.104651
| 172
| 8
| 52
| 21.5
| 0.662338
| 0
| 0
| 0
| 0
| 0
| 0.534884
| 0.424419
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| null | 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
2188595d8c480134ee036376c72bd1b8a44d7416
| 148
|
py
|
Python
|
app/menu/__init__.py
|
mozerpol/mozerpolWebsite
|
c4546bde0727df67c8bd7904d5b4ee9a938e5db0
|
[
"MIT"
] | null | null | null |
app/menu/__init__.py
|
mozerpol/mozerpolWebsite
|
c4546bde0727df67c8bd7904d5b4ee9a938e5db0
|
[
"MIT"
] | null | null | null |
app/menu/__init__.py
|
mozerpol/mozerpolWebsite
|
c4546bde0727df67c8bd7904d5b4ee9a938e5db0
|
[
"MIT"
] | null | null | null |
# W folderze menu zostal stworzony schemat menu naszej stronki
from flask import Blueprint
menu = Blueprint('menu', __name__)
from . import views
| 21.142857
| 62
| 0.783784
| 20
| 148
| 5.6
| 0.7
| 0.232143
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.162162
| 148
| 6
| 63
| 24.666667
| 0.903226
| 0.405405
| 0
| 0
| 0
| 0
| 0.046512
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.666667
| 0
| 0.666667
| 0.666667
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 1
|
0
| 5
|
21937dda067282e528ecdd25ce85c402be11fa73
| 246
|
py
|
Python
|
structural/composite/imilitary_unit.py
|
plocinskipiotr/Design_Patterns
|
8e9433dccef7bb49d9fbe4f248cb93da465bd880
|
[
"MIT"
] | null | null | null |
structural/composite/imilitary_unit.py
|
plocinskipiotr/Design_Patterns
|
8e9433dccef7bb49d9fbe4f248cb93da465bd880
|
[
"MIT"
] | null | null | null |
structural/composite/imilitary_unit.py
|
plocinskipiotr/Design_Patterns
|
8e9433dccef7bb49d9fbe4f248cb93da465bd880
|
[
"MIT"
] | null | null | null |
""" Interface military unit """
from abc import ABCMeta, abstractmethod
class IMilitaryUnit(metaclass=ABCMeta):
""" Interface military unit """
@staticmethod
@abstractmethod
def become_order():
"""becoming an order"""
| 18.923077
| 39
| 0.674797
| 23
| 246
| 7.173913
| 0.73913
| 0.206061
| 0.254545
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.211382
| 246
| 12
| 40
| 20.5
| 0.850515
| 0.268293
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.2
| true
| 0
| 0.2
| 0
| 0.6
| 0
| 1
| 0
| 0
| null | 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 0
|
0
| 5
|
219b79b9e4cca8b32e54b5bf41b002a82005325a
| 2,737
|
py
|
Python
|
model/SubNet.py
|
seekerzz/PaintsTensorFlow
|
6780e3e195f64f92be0d8678d10853bf39e6c370
|
[
"MIT"
] | 6
|
2019-05-07T03:09:59.000Z
|
2021-03-31T03:39:05.000Z
|
model/SubNet.py
|
seekerzz/PaintsTensorFlow
|
6780e3e195f64f92be0d8678d10853bf39e6c370
|
[
"MIT"
] | null | null | null |
model/SubNet.py
|
seekerzz/PaintsTensorFlow
|
6780e3e195f64f92be0d8678d10853bf39e6c370
|
[
"MIT"
] | 3
|
2019-07-28T19:11:08.000Z
|
2020-09-28T16:37:49.000Z
|
import tensorflow as tf
from tensorflow import keras
class genConv2dLayer(tf.keras.Model):
def __init__(self, filters, k, s, applyBatNorm=True, name=None):
super(genConv2dLayer, self).__init__(name=name)
self.applyBn = applyBatNorm
initializer = tf.random_normal_initializer(0., 0.02)
filters = int(filters)
self.conv = keras.layers.Conv2D(filters=filters, kernel_size=k, strides=s, padding="SAME",
kernel_initializer=initializer)
if self.applyBn:
self.bn = keras.layers.BatchNormalization(momentum=0.9,
epsilon=1e-5,
scale=True)
def call(self, inputs, training):
tensor = self.conv(inputs)
if self.applyBn:
tensor = self.bn(tensor, training=training)
tensor = tf.nn.leaky_relu(tensor)
return tensor
class genDeConv2dLayer(tf.keras.Model):
def __init__(self, filters, k, s, name=None):
super(genDeConv2dLayer, self).__init__(name=name)
initializer = tf.random_normal_initializer(0., 0.02)
self.concat = tf.concat
filters = int(filters)
self.up_conv = keras.layers.Conv2DTranspose(filters=filters, kernel_size=k, strides=s, padding="SAME",
kernel_initializer=initializer)
self.bn = keras.layers.BatchNormalization(momentum=0.9,
epsilon=1e-5,
scale=True)
def call(self, x1, x2, training):
inputs = self.concat([x1, x2], -1)
tensor = self.up_conv(inputs)
tensor = self.bn(tensor, training=training)
tensor = tf.nn.relu(tensor)
return tensor
class DiscConv2d(tf.keras.Model):
def __init__(self, filters, k, s, applyBatNorm=True):
super(DiscConv2d, self).__init__()
self.applyBn = applyBatNorm
initializer = tf.random_normal_initializer(0., 0.02)
filters = int(filters)
self.conv = keras.layers.Conv2D(filters=filters, kernel_size=k, strides=s, padding="SAME",
kernel_initializer=initializer)
if self.applyBn:
self.bn = keras.layers.BatchNormalization(momentum=0.9,
epsilon=1e-5,
scale=True)
def call(self, inputs, training):
tensor = self.conv(inputs)
if self.applyBn:
tensor = self.bn(tensor, training=training)
tensor = tf.nn.leaky_relu(tensor)
return tensor
| 40.25
| 110
| 0.556814
| 287
| 2,737
| 5.170732
| 0.209059
| 0.044474
| 0.03504
| 0.030323
| 0.77965
| 0.758086
| 0.758086
| 0.758086
| 0.731132
| 0.679919
| 0
| 0.021229
| 0.345999
| 2,737
| 67
| 111
| 40.850746
| 0.807821
| 0
| 0
| 0.690909
| 0
| 0
| 0.004384
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.109091
| false
| 0
| 0.036364
| 0
| 0.254545
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
21aa68a36645236b3586b9a769e8bebd78da8202
| 107
|
py
|
Python
|
notebook/python_sandbox/pkg_sample/pkg/pack1/mod1_1.py
|
xyise/xyise
|
e2bc1c2e824da4fc5cd1d81aaef76a1ad147fb01
|
[
"Apache-2.0"
] | null | null | null |
notebook/python_sandbox/pkg_sample/pkg/pack1/mod1_1.py
|
xyise/xyise
|
e2bc1c2e824da4fc5cd1d81aaef76a1ad147fb01
|
[
"Apache-2.0"
] | null | null | null |
notebook/python_sandbox/pkg_sample/pkg/pack1/mod1_1.py
|
xyise/xyise
|
e2bc1c2e824da4fc5cd1d81aaef76a1ad147fb01
|
[
"Apache-2.0"
] | null | null | null |
import pkg.pack1.mod1_2 as mod1_2
class c1_1:
def __init__(self, xx: mod1_2.c1_2):
self.x = 4
| 17.833333
| 40
| 0.654206
| 22
| 107
| 2.772727
| 0.681818
| 0.245902
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.148148
| 0.242991
| 107
| 5
| 41
| 21.4
| 0.604938
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.25
| false
| 0
| 0.25
| 0
| 0.75
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 1
| 0
|
0
| 5
|
21b9c8db501f95bbc3acfc6bed278263bc3c69d4
| 9,276
|
py
|
Python
|
My_Tool/feature_contriburion_analyse.py
|
nightinwhite/DL_Tools
|
a9510eedc4746effc7ee073bb4af8ce185d28202
|
[
"Apache-2.0"
] | 1
|
2018-01-04T01:41:56.000Z
|
2018-01-04T01:41:56.000Z
|
My_Tool/feature_contriburion_analyse.py
|
nightinwhite/DL_Tools
|
a9510eedc4746effc7ee073bb4af8ce185d28202
|
[
"Apache-2.0"
] | null | null | null |
My_Tool/feature_contriburion_analyse.py
|
nightinwhite/DL_Tools
|
a9510eedc4746effc7ee073bb4af8ce185d28202
|
[
"Apache-2.0"
] | null | null | null |
#coding:utf-8
from My_Tool.feature_extract_visualization import *
import os
from PIL import Image
l1 = Feature_Extract_Visualization_Layer(None,(3,3),"VALID",(2,2),None)
l2 = Feature_Extract_Visualization_Layer(None,(3,3),"VALID",(1,1),[l1])
l3 = Feature_Extract_Visualization_Layer(None,(3,3),"SAME", (1,1),[l2])
l4 = Feature_Extract_Visualization_Layer(None,(3,3),"VALID",(2,2),[l3])
l5 = Feature_Extract_Visualization_Layer(None,(1,1),"VALID",(1,1),[l4])
l6 = Feature_Extract_Visualization_Layer(None,(3,3),"VALID",(1,1),[l5])
l7 = Feature_Extract_Visualization_Layer(None,(3,3),"VALID",(2,2),[l6])
#mixed 5b
l8_0 = Feature_Extract_Visualization_Layer(None,(1,1),"SAME",(1,1),[l7])
l8_1_0 = Feature_Extract_Visualization_Layer(None,(1,1),"SAME",(1,1),[l7])
l8_1_1 = Feature_Extract_Visualization_Layer(None,(5,5),"SAME",(1,1),[l8_1_0])
l8_2_0 = Feature_Extract_Visualization_Layer(None,(1,1),"SAME",(1,1),[l7])
l8_2_1 = Feature_Extract_Visualization_Layer(None,(3,3),"SAME",(1,1),[l8_2_0])
l8_2_2 = Feature_Extract_Visualization_Layer(None,(3,3),"SAME",(1,1),[l8_2_1])
l8_3_0 = Feature_Extract_Visualization_Layer(None,(3,3),"SAME",(1,1),[l7])
l8_3_1 = Feature_Extract_Visualization_Layer(None,(1,1),"SAME",(1,1),[l8_3_0])
#合并
l8 = Feature_Extract_Visualization_Layer(None,(1,1),"SAME",(1,1),[l8_0,l8_1_1,l8_2_2,l8_3_1])
#mixed 5c
l9_0 = Feature_Extract_Visualization_Layer(None,(1,1),"SAME",(1,1),[l8])
l9_1_0 = Feature_Extract_Visualization_Layer(None,(1,1),"SAME",(1,1),[l8])
l9_1_1 = Feature_Extract_Visualization_Layer(None,(5,5),"SAME",(1,1),[l9_1_0])
l9_2_0 = Feature_Extract_Visualization_Layer(None,(1,1),"SAME",(1,1),[l8])
l9_2_1 = Feature_Extract_Visualization_Layer(None,(3,3),"SAME",(1,1),[l9_2_0])
l9_2_2 = Feature_Extract_Visualization_Layer(None,(3,3),"SAME",(1,1),[l9_2_1])
l9_3_0 = Feature_Extract_Visualization_Layer(None,(3,3),"SAME",(1,1),[l8])
l9_3_1 = Feature_Extract_Visualization_Layer(None,(1,1),"SAME",(1,1),[l9_3_0])
#合并
l9 = Feature_Extract_Visualization_Layer(None,(1,1),"SAME",(1,1),[l9_0,l9_1_1,l9_2_2,l9_3_1])
#mixed 5d
l10_0 = Feature_Extract_Visualization_Layer(None,(1,1),"SAME",(1,1),[l9])
l10_1_0 = Feature_Extract_Visualization_Layer(None,(1,1),"SAME",(1,1),[l9])
l10_1_1 = Feature_Extract_Visualization_Layer(None,(5,5),"SAME",(1,1),[l10_1_0])
l10_2_0 = Feature_Extract_Visualization_Layer(None,(1,1),"SAME",(1,1),[l9])
l10_2_1 = Feature_Extract_Visualization_Layer(None,(3,3),"SAME",(1,1),[l10_2_0])
l10_2_2 = Feature_Extract_Visualization_Layer(None,(3,3),"SAME",(1,1),[l10_2_1])
l10_3_0 = Feature_Extract_Visualization_Layer(None,(3,3),"SAME",(1,1),[l9])
l10_3_1 = Feature_Extract_Visualization_Layer(None,(1,1),"SAME",(1,1),[l10_3_0])
#合并
l10 = Feature_Extract_Visualization_Layer(None,(1,1),"SAME",(1,1),[l10_0,l10_1_1,l10_2_2,l10_3_1])
#mixed 6a
l11_0 = Feature_Extract_Visualization_Layer(None,(3,3),"VALID",(2,2),[l10])
l11_1_0 = Feature_Extract_Visualization_Layer(None,(1,1),"SAME",(1,1),[l10])
l11_1_1 = Feature_Extract_Visualization_Layer(None,(3,3),"SAME",(1,1),[l11_1_0])
l11_1_2 = Feature_Extract_Visualization_Layer(None,(3,3),"VALID",(2,2),[l11_1_1])
l11_2 = Feature_Extract_Visualization_Layer(None,(3,3),"VALID",(2,2),[l10])
#合并
l11 = Feature_Extract_Visualization_Layer(None,(1,1),"SAME",(1,1),[l11_0,l11_1_2,l11_2])
#mixed 6b
l12_0 = Feature_Extract_Visualization_Layer(None,(1,1),"SAME",(1,1),[l11])
l12_1_0 = Feature_Extract_Visualization_Layer(None,(1,1),"SAME",(1,1),[l11])
l12_1_1 = Feature_Extract_Visualization_Layer(None,(1,7),"SAME",(1,1),[l12_1_0])
l12_1_2 = Feature_Extract_Visualization_Layer(None,(7,1),"SAME",(1,1),[l12_1_1])
l12_2_0 = Feature_Extract_Visualization_Layer(None,(1,1),"SAME",(1,1),[l11])
l12_2_1 = Feature_Extract_Visualization_Layer(None,(1,7),"SAME",(1,1),[l12_2_0])
l12_2_2 = Feature_Extract_Visualization_Layer(None,(7,1),"SAME",(1,1),[l12_2_1])
l12_2_3 = Feature_Extract_Visualization_Layer(None,(1,7),"SAME",(1,1),[l12_2_2])
l12_2_4 = Feature_Extract_Visualization_Layer(None,(7,1),"SAME",(1,1),[l12_2_3])
l12_3_0 = Feature_Extract_Visualization_Layer(None,(3,3),"SAME",(1,1),[l11])
l12_3_1 = Feature_Extract_Visualization_Layer(None,(1,1),"SAME",(1,1),[l12_3_0])
#合并
l12 = Feature_Extract_Visualization_Layer(None,(1,1),"SAME",(1,1),[l12_0,l12_1_2,l12_2_4,l12_3_1])
#mixed 6c
l13_0 = Feature_Extract_Visualization_Layer(None,(1,1),"SAME",(1,1),[l12])
l13_1_0 = Feature_Extract_Visualization_Layer(None,(1,1),"SAME",(1,1),[l12])
l13_1_1 = Feature_Extract_Visualization_Layer(None,(1,7),"SAME",(1,1),[l13_1_0])
l13_1_2 = Feature_Extract_Visualization_Layer(None,(7,1),"SAME",(1,1),[l13_1_1])
l13_2_0 = Feature_Extract_Visualization_Layer(None,(1,1),"SAME",(1,1),[l12])
l13_2_1 = Feature_Extract_Visualization_Layer(None,(1,7),"SAME",(1,1),[l13_2_0])
l13_2_2 = Feature_Extract_Visualization_Layer(None,(7,1),"SAME",(1,1),[l13_2_1])
l13_2_3 = Feature_Extract_Visualization_Layer(None,(1,7),"SAME",(1,1),[l13_2_2])
l13_2_4 = Feature_Extract_Visualization_Layer(None,(7,1),"SAME",(1,1),[l13_2_3])
l13_3_0 = Feature_Extract_Visualization_Layer(None,(3,3),"SAME",(1,1),[l12])
l13_3_1 = Feature_Extract_Visualization_Layer(None,(1,1),"SAME",(1,1),[l13_3_0])
#合并
l13 = Feature_Extract_Visualization_Layer(None,(1,1),"SAME",(1,1),[l13_0,l13_1_2,l13_2_4,l13_3_1])
#mixed 6d
l14_0 = Feature_Extract_Visualization_Layer(None,(1,1),"SAME",(1,1),[l13])
l14_1_0 = Feature_Extract_Visualization_Layer(None,(1,1),"SAME",(1,1),[l13])
l14_1_1 = Feature_Extract_Visualization_Layer(None,(1,7),"SAME",(1,1),[l14_1_0])
l14_1_2 = Feature_Extract_Visualization_Layer(None,(7,1),"SAME",(1,1),[l14_1_1])
l14_2_0 = Feature_Extract_Visualization_Layer(None,(1,1),"SAME",(1,1),[l13])
l14_2_1 = Feature_Extract_Visualization_Layer(None,(1,7),"SAME",(1,1),[l14_2_0])
l14_2_2 = Feature_Extract_Visualization_Layer(None,(7,1),"SAME",(1,1),[l14_2_1])
l14_2_3 = Feature_Extract_Visualization_Layer(None,(1,7),"SAME",(1,1),[l14_2_2])
l14_2_4 = Feature_Extract_Visualization_Layer(None,(7,1),"SAME",(1,1),[l14_2_3])
l14_3_0 = Feature_Extract_Visualization_Layer(None,(3,3),"SAME",(1,1),[l13])
l14_3_1 = Feature_Extract_Visualization_Layer(None,(1,1),"SAME",(1,1),[l14_3_0])
#合并
l14 = Feature_Extract_Visualization_Layer(None,(1,1),"SAME",(1,1),[l14_0,l14_1_2,l14_2_4,l14_3_1])
imgs_path = "/home/night/data/VISUAL_NODE/I0_Train_imgs.npy"
ori_imgs = np.load(imgs_path)
arr_path = "/home/night/data/VISUAL_NODE/"
arr_to_layer_dict = {"I0_Conv2d_p1_3x3.npy": l1,
"I0_Conv2d_p2_3x3.npy": l2,
"I0_Conv2d_p3_3x3.npy": l3,
"I0_MaxPool_p4_3x3.npy": l4,
"I0_Conv2d_p5_1x1.npy": l5,
"I0_Conv2d_p6_3x3.npy": l6,
"I0_MaxPool_p7_3x3.npy": l7,
"I0_Mixed_p8_a.npy": l8,
"I0_Mixed_p8_b.npy": l9,
"I0_Mixed_p8_c.npy": l10,
}
parent_dir = "visualization_graphs/"
if os.path.exists(parent_dir) == False:
os.mkdir(parent_dir)
save_path_all = os.path.join(parent_dir, "features_contribution_analyse")
if os.path.exists(save_path_all) == False:
os.mkdir(save_path_all)
for arr_name in arr_to_layer_dict.keys():
tmp_features = np.load(os.path.join(arr_path,arr_name))
tmp_save_path = os.path.join(save_path_all, arr_name)
if os.path.exists(tmp_save_path) == False:
os.mkdir(tmp_save_path)
tmp_features = tmp_features[0]
for i in range(tmp_features.shape[0]):
tmp_img_features = tmp_features[i,:,:,:]
tmp_img_max_list = np.max(tmp_img_features,axis=(0,1))
tmp_index_list = np.arange(0,len(tmp_img_max_list))
tmp_img_max_list = np.stack([tmp_img_max_list,tmp_index_list],axis=1)
tmp_img_max_list = sorted(tmp_img_max_list,key=lambda a:a[0])
tmp_img_max_list = np.asarray(tmp_img_max_list)
max_num = 10
tmp_img_max_list = tmp_img_max_list[-max_num:]
idx_s = []
for idx in tmp_img_max_list:
idx_s.append(int(idx[1]))
for j in idx_s:
print i, j
tmp_save_path_i = os.path.join(tmp_save_path, "{0}/".format(j))
if os.path.exists(tmp_save_path_i) == False:
os.mkdir(tmp_save_path_i)
tmp_feature = tmp_features[i, :, :, j]
_, tmp_img_h, tmp_img_w, tmp_img_c = ori_imgs.shape
tmp_arg_max = np.argmax(tmp_feature)
tmp_i = tmp_arg_max / tmp_feature.shape[1]
tmp_j = tmp_arg_max % tmp_feature.shape[1]
x_min, y_min, x_max, y_max = arr_to_layer_dict[arr_name].map_to_ori_image(tmp_i, tmp_j)
# print x_min, y_min, x_max, y_max
if x_min < 0:
x_min = 0
if y_min < 0:
y_min = 0
if x_max >= tmp_img_h:
x_max = tmp_img_h - 1
if y_max >= tmp_img_w:
y_max = tmp_img_w - 1
tmp_img = ori_imgs[i, x_min:x_max, y_min:y_max, :]
tmp_img = (tmp_img - np.min(tmp_img)) / (np.max(tmp_img) - np.min(tmp_img)) * 255.
tmp_img = np.asarray(tmp_img, np.uint8)
tmp_img = Image.fromarray(tmp_img)
tmp_img = tmp_img.resize((64, 64))
tmp_img.save(os.path.join(tmp_save_path_i, "{0}.png".format(i)))
| 56.218182
| 99
| 0.693726
| 1,694
| 9,276
| 3.403778
| 0.079103
| 0.040583
| 0.360562
| 0.421783
| 0.731356
| 0.707596
| 0.672737
| 0.648456
| 0.633715
| 0.633715
| 0
| 0.111645
| 0.125162
| 9,276
| 164
| 100
| 56.560976
| 0.598891
| 0.012398
| 0
| 0
| 0
| 0
| 0.07021
| 0.018263
| 0
| 0
| 0
| 0
| 0
| 0
| null | null | 0
| 0.021127
| null | null | 0.007042
| 0
| 0
| 0
| null | 0
| 1
| 1
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
df03ea7abf5d780f1ca81d6bedbb5df480cb3d64
| 124
|
py
|
Python
|
gdrive_backup/tasks.py
|
jonesim/django-gdrive-backup
|
c7008cf8ed62ffef2af4047c8fd19c7267bc6965
|
[
"MIT"
] | 5
|
2020-11-04T06:14:36.000Z
|
2022-02-04T14:14:36.000Z
|
gdrive_backup/tasks.py
|
jonesim/django-gdrive-backup
|
c7008cf8ed62ffef2af4047c8fd19c7267bc6965
|
[
"MIT"
] | 1
|
2021-07-10T09:24:12.000Z
|
2022-01-19T09:28:01.000Z
|
gdrive_backup/tasks.py
|
jonesim/django-gdrive-backup
|
c7008cf8ed62ffef2af4047c8fd19c7267bc6965
|
[
"MIT"
] | null | null | null |
from celery import shared_task
from .backup import Backup
@shared_task
def backup():
Backup().backup_db_and_folders()
| 15.5
| 36
| 0.774194
| 18
| 124
| 5.055556
| 0.555556
| 0.21978
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.145161
| 124
| 7
| 37
| 17.714286
| 0.858491
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.2
| true
| 0
| 0.4
| 0
| 0.6
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
df0e0734bdce86e7c9e70219795b21a3f311a47e
| 20
|
py
|
Python
|
hello_world.py
|
nts2pd/profiles-rest-api
|
76abb1dc1001b5e3129b20a7274f74cb740cebe1
|
[
"MIT"
] | null | null | null |
hello_world.py
|
nts2pd/profiles-rest-api
|
76abb1dc1001b5e3129b20a7274f74cb740cebe1
|
[
"MIT"
] | 5
|
2021-03-19T11:59:23.000Z
|
2022-02-10T09:42:37.000Z
|
hello_world.py
|
nts2pd/profiles-rest-api
|
76abb1dc1001b5e3129b20a7274f74cb740cebe1
|
[
"MIT"
] | null | null | null |
print('howdy yall')
| 10
| 19
| 0.7
| 3
| 20
| 4.666667
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.1
| 20
| 1
| 20
| 20
| 0.777778
| 0
| 0
| 0
| 0
| 0
| 0.5
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0
| 0
| 0
| 1
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 1
|
0
| 5
|
df3c81417c2dc5ab6293da5ea6be0445e5e7a053
| 119
|
py
|
Python
|
ajax_upload/settings.py
|
ixc/django-ajax-upload-widget
|
8fc94328ce59cb7a9e3414bfe0fd1c79a6afec22
|
[
"BSD-3-Clause"
] | 1
|
2019-08-31T08:47:20.000Z
|
2019-08-31T08:47:20.000Z
|
ajax_upload/settings.py
|
ixc/django-ajax-upload-widget
|
8fc94328ce59cb7a9e3414bfe0fd1c79a6afec22
|
[
"BSD-3-Clause"
] | null | null | null |
ajax_upload/settings.py
|
ixc/django-ajax-upload-widget
|
8fc94328ce59cb7a9e3414bfe0fd1c79a6afec22
|
[
"BSD-3-Clause"
] | 2
|
2015-08-11T16:59:48.000Z
|
2021-01-04T08:32:18.000Z
|
from django.conf import settings
FILE_FIELD_MAX_LENGTH = getattr(settings, 'AJAX_UPLOAD_FILE_FIELD_MAX_LENGTH', 255)
| 23.8
| 83
| 0.840336
| 18
| 119
| 5.111111
| 0.722222
| 0.195652
| 0.26087
| 0.391304
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.027778
| 0.092437
| 119
| 4
| 84
| 29.75
| 0.824074
| 0
| 0
| 0
| 0
| 0
| 0.277311
| 0.277311
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.5
| 0
| 0.5
| 0
| 1
| 0
| 0
| null | 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
10ccec5896bfb3eabd4701ab7a3b6d8ab0a6061e
| 83
|
py
|
Python
|
getnet/services/cards/__init__.py
|
ramon/getnet-py
|
21daec202fe48d6ec051bf37e0c4760af8bbf25a
|
[
"MIT"
] | 1
|
2020-07-25T20:02:52.000Z
|
2020-07-25T20:02:52.000Z
|
getnet/services/cards/__init__.py
|
ramon/getnet-py
|
21daec202fe48d6ec051bf37e0c4760af8bbf25a
|
[
"MIT"
] | 5
|
2019-11-24T16:24:11.000Z
|
2021-02-22T16:10:05.000Z
|
getnet/services/cards/__init__.py
|
ramon/getnet-py
|
21daec202fe48d6ec051bf37e0c4760af8bbf25a
|
[
"MIT"
] | 3
|
2020-07-25T23:00:59.000Z
|
2022-02-15T02:37:27.000Z
|
"""
Getnet Card Safe Service Module
"""
from .service import Status, Service, Card
| 16.6
| 42
| 0.73494
| 11
| 83
| 5.545455
| 0.727273
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.156627
| 83
| 4
| 43
| 20.75
| 0.871429
| 0.373494
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
10da6ae9dbbf7f4c1703819f5f80a0d9eef23a1d
| 14,104
|
py
|
Python
|
Scripts/read_Reanalysis.py
|
zmlabe/AMIP_Simu
|
6370626fe81baf5c2280dab95fdab08a873f3a84
|
[
"MIT"
] | null | null | null |
Scripts/read_Reanalysis.py
|
zmlabe/AMIP_Simu
|
6370626fe81baf5c2280dab95fdab08a873f3a84
|
[
"MIT"
] | null | null | null |
Scripts/read_Reanalysis.py
|
zmlabe/AMIP_Simu
|
6370626fe81baf5c2280dab95fdab08a873f3a84
|
[
"MIT"
] | 3
|
2019-09-23T07:32:57.000Z
|
2021-02-12T19:26:45.000Z
|
"""
Script reads in monthly data reanalysis (ERA-Interim or ERAi) on grid of
1.9 x 2.5 (latitude,longitude). Data was interpolated on the model grid using
a bilinear interpolation scheme.
Notes
-----
Author : Zachary Labe
Date : 19 February 2019
Usage
-----
[1] readDataR(variable,level,detrend,sliceeq)
[2] readDataRMeans(variable)
"""
def readDataR(variable,level,detrend,sliceeq):
"""
Function reads monthly data from ERA-Interim
Parameters
----------
variable : string
variable name to read
level : string
Height of variable (surface or profile)
detrend : binary
True/False whether to remove a linear trend at all grid points
sliceeq : binary
True/False whether to slice at the equator for only northern hemisphere
Returns
-------
lat : 1d numpy array
latitudes
lon : 1d numpy array
longitudes
time : 1d numpy array
standard time (months since 1979-1-1, 00:00:00)
lev : 1d numpy array
levels (17)
var : 4d numpy array or 5d numpy array
[year,month,lat,lon] or [year,month,level,lat,lon]
Usage
-----
lat,lon,time,lev,var = readDataR(variable,level,detrend)
"""
print('\n>>> Using readDataR function! \n')
###########################################################################
###########################################################################
###########################################################################
### Import modules
import numpy as np
from netCDF4 import Dataset
import calc_Detrend as DT
### Declare knowns
months = 12
years = np.arange(1979,2016+1,1)
if variable == 'SNC':
years = np.arange(1979,2015+1,1)
### Directory for experiments (remote server - Seley)
directorydata = '/seley/zlabe/ERAI/'
###########################################################################
###########################################################################
###########################################################################
### Read in lat,lon,time from known file
if level == 'surface': # 3d variables
if variable == 'SNC': # Snow data only through 2015!
dataq = Dataset(directorydata + 'SNC_1979-2016.nc') # 1979-2015
time = dataq.variables['time'][:]
lev = 'surface'
lat = dataq.variables['latitude'][:]
lon = dataq.variables['longitude'][:]
dataq.close()
else:
dataq = Dataset(directorydata + 'T2M_1979-2016.nc')
time = dataq.variables['time'][:]
lev = 'surface'
lat = dataq.variables['latitude'][:]
lon = dataq.variables['longitude'][:]
dataq.close()
###########################################################################
###########################################################################
if sliceeq == False:
### Create empty variable
varq = np.empty((time.shape[0],lat.shape[0],lon.shape[0]))
varq[:,:,:] = np.nan ### fill with nans
elif sliceeq == True:
### Slice for Northern Hemisphere
latq = np.where(lat >= 0)[0]
lat = lat[latq]
### Create empty variable
varq = np.empty((time.shape[0],lat.shape[0],lon.shape[0]))
varq[:,:,:] = np.nan ### fill with nans
print('SLICE for Northern Hemisphere!')
else:
print(ValueError('Selected wrong slicing!'))
###########################################################################
###########################################################################
elif level == 'profile': # 4d variables
dataq = Dataset(directorydata + 'TEMP_1979-2016.nc')
time = dataq.variables['time'][:]
lev = dataq.variables['level'][:]
lat = dataq.variables['latitude'][:]
lon = dataq.variables['longitude'][:]
dataq.close()
###########################################################################
###########################################################################
if sliceeq == False:
### Create empty variable
varq = np.empty((time.shape[0],lev.shape[0],
lat.shape[0],lon.shape[0]))
varq[:,:,:,:] = np.nan ### fill with nans
elif sliceeq == True:
### Slice for Northern Hemisphere
latq = np.where(lat >= 0)[0]
lat = lat[latq]
### Create empty variable
varq = np.empty((time.shape[0],lev.shape[0],
lat.shape[0],lon.shape[0]))
varq[:,:,:,:] = np.nan ### fill with nans
print('SLICE for Northern Hemisphere!')
else:
print(ValueError('Selected wrong slicing!'))
###########################################################################
###########################################################################
else:
print(ValueError('Selected wrong height - (surface or profile!)!'))
###########################################################################
###########################################################################
### Path name for file for each ensemble member
filename = directorydata + variable + '_1979-2016.nc'
###########################################################################
###########################################################################
### Read in Data
if sliceeq == False:
if level == 'surface': # 3d variables
data = Dataset(filename,'r')
varq[:,:,:] = data.variables[variable][:]
print('Completed: Read data %s!' % (variable))
elif level == 'profile': # 4d variables
data = Dataset(filename,'r')
varq[:,:,:,:] = data.variables[variable][:]
data.close()
print('Completed: Read data %s!' % (variable))
else:
print(ValueError('Selected wrong height - (surface or profile!)!'))
###########################################################################
###########################################################################
elif sliceeq == True:
if level == 'surface': # 3d variables
data = Dataset(filename,'r')
varq[:,:,:] = data.variables[variable][:,latq,:]
data.close()
print('Completed: Read data %s!' % (variable))
elif level == 'profile': # 4d variables
data = Dataset(filename,'r')
varq[:,:,:,:] = data.variables[variable][:,:,latq,:]
data.close()
print('Completed: Read data %s!' % (variable))
else:
print(ValueError('Selected wrong height - (surface or profile!)!'))
###########################################################################
###########################################################################
###########################################################################
### Reshape to split years and months
if level == 'surface': # 3d variables
var = np.reshape(varq,(varq.shape[0]//12,months,
lat.shape[0],lon.shape[0]))
elif level == 'profile': # 4d variables
var = np.reshape(varq,(varq.shape[0]//12,months,lev.shape[0],
lat.shape[0],lon.shape[0]))
else:
print(ValueError('Selected wrong height - (surface or profile!)!'))
print('\nCompleted: Reshaped %s array!' % (variable))
### Save computer memory
del varq
###########################################################################
###########################################################################
###########################################################################
### Convert units
if variable in ('TEMP','T2M'):
var = var - 273.15 # Kelvin to degrees Celsius
print('Completed: Changed units (K to C)!')
elif variable == 'SWE':
var = var*1000. # Meters to Millimeters
print('Completed: Changed units (m to mm)!')
elif variable in ('Z1000','Z850','Z700','Z500','Z300','Z200','Z50','Z30','THICK'):
var = var/9.80665 # m^2/s^2 divide by gravity m/s^2 to m
print('Completed: Changed units (m^2/s^2 to m)!')
elif variable == 'SLP':
var = var/100. # Pa to hPa
print('Completed: Changed units (Pa to hPa)!')
###########################################################################
###########################################################################
###########################################################################
### Missing data (fill value to nans)
var[np.where(var <= -8.99999987e+33)] = np.nan
var[np.where(var >= 8.99999987e+33)] = np.nan
print('Completed: Filled missing data to nan!')
### Detrend data if turned on
if detrend == True:
var = DT.detrendDataR(var,level,'monthly')
print('\n>>> Completed: Finished readDataR function!')
return lat,lon,time,lev,var
###############################################################################
def readDataRMeans(variable):
"""
Function reads monthly data from ERA-Interim. Average
is taken over the polar cap (65-90, 0-360) and weighted
by cosine of latitude. Variables are all 4d.
Parameters
----------
variable : string
variable name to read
Returns
-------
lat : 1d numpy array
latitudes
lon : 1d numpy array
longitudes
lev : 1d numpy array
levels (17)
var : 3d numpy array
[year,month,lev]
Usage
-----
lat,lon,time,lev,var = readDataRMeans(variable)
"""
print('\n>>> Using readDataRMeans function! \n')
###########################################################################
###########################################################################
###########################################################################
### Import modules
import numpy as np
from netCDF4 import Dataset
import calc_Detrend as DT
### Declare knowns
months = 12
years = np.arange(1979,2016+1,1)
### Directory for experiments (remote server - Seley)
directorydata = '/seley/zlabe/ERAI/'
###########################################################################
###########################################################################
dataq = Dataset(directorydata + 'TEMP_1979-2016.nc')
time = dataq.variables['time'][:]
lev = dataq.variables['level'][:]
lat = dataq.variables['latitude'][:]
lon = dataq.variables['longitude'][:]
dataq.close()
###########################################################################
###########################################################################
varq = np.empty((time.shape[0],lev.shape[0]))
varq[:,:] = np.nan ### fill with nans
###########################################################################
###########################################################################
### Path name for file for each ensemble member
filename = directorydata + variable + '_mean_1979-2016.nc'
###########################################################################
###########################################################################
### Read in Data
data = Dataset(filename,'r')
varq[:,:] = data.variables[variable][:]
data.close()
###########################################################################
###########################################################################
###########################################################################
### Reshape to split years and months
var = np.reshape(varq,(varq.shape[0]//12,months,lev.shape[0]))
### Save computer memory
del varq
###########################################################################
###########################################################################
###########################################################################
### Convert units
if variable in ('TEMP','T2M'):
var = var - 273.15 # Kelvin to degrees Celsius
print('Completed: Changed units (K to C)!')
elif variable == 'SWE':
var = var*1000. # Meters to Millimeters
print('Completed: Changed units (m to mm)!')
elif variable in ('Z1000','Z850','Z700','Z500','Z300','Z200','Z50','Z30',
'GEOP'):
var = var/9.80665 # m^2/s^2 divide by gravity m/s^2 to m
print('Completed: Changed units (m^2/s^2 to m)!')
elif variable == 'SLP':
var = var/100. # Pa to hPa
print('Completed: Changed units (Pa to hPa)!')
###########################################################################
###########################################################################
###########################################################################
### Missing data (fill value to nans)
var[np.where(var <= -8.99999987e+33)] = np.nan
var[np.where(var >= 8.99999987e+33)] = np.nan
print('Completed: Filled missing data to nan!')
print('\n>>> Completed: Finished readDataRMeans function!')
return lat,lon,lev,var
#### Test function -- no need to use
#variable = 'Z500'
#level = 'surface'
#detrend = True
#sliceeq = False
#
#lat,lon,time,lev,var = readDataR(variable,level,detrend,sliceeq)
#lat,lon,lev,var = readDataRMeans('TEMP')
| 39.396648
| 96
| 0.392371
| 1,186
| 14,104
| 4.658516
| 0.189713
| 0.027149
| 0.030407
| 0.037647
| 0.783891
| 0.742443
| 0.717104
| 0.678733
| 0.673122
| 0.628597
| 0
| 0.030643
| 0.241066
| 14,104
| 358
| 97
| 39.396648
| 0.485519
| 0.205048
| 0
| 0.810458
| 0
| 0
| 0.191929
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.013072
| false
| 0
| 0.039216
| 0
| 0.065359
| 0.176471
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
10ddb928ef8e9aaf7d41c9e36bbc108016906c1a
| 88
|
py
|
Python
|
menace/bots/__init__.py
|
mscroggs/MENACE_science_festival
|
6b5be34933c04f497eb17eefb5c59ff5a246ab3c
|
[
"MIT"
] | 1
|
2017-11-15T01:24:55.000Z
|
2017-11-15T01:24:55.000Z
|
menace/bots/__init__.py
|
mscroggs/MENACE_science_festival
|
6b5be34933c04f497eb17eefb5c59ff5a246ab3c
|
[
"MIT"
] | null | null | null |
menace/bots/__init__.py
|
mscroggs/MENACE_science_festival
|
6b5be34933c04f497eb17eefb5c59ff5a246ab3c
|
[
"MIT"
] | null | null | null |
from .rando import Rando
from .humans import QuiteGood, Good
from .menace import MENACE
| 22
| 35
| 0.806818
| 13
| 88
| 5.461538
| 0.538462
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.147727
| 88
| 3
| 36
| 29.333333
| 0.946667
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
8051cbc57f87f8a8dd6df0fb9d7f34ddefd9b945
| 75
|
py
|
Python
|
src/pyensae/finance/__init__.py
|
mohamedelkansouli/Ensae_py2
|
e54a05f90c6aa6e2a5065eac9f9ec10aca64b46a
|
[
"MIT"
] | 28
|
2015-07-19T21:20:51.000Z
|
2022-02-16T11:50:53.000Z
|
src/pyensae/finance/__init__.py
|
mohamedelkansouli/Ensae_py2
|
e54a05f90c6aa6e2a5065eac9f9ec10aca64b46a
|
[
"MIT"
] | 34
|
2015-06-16T15:38:25.000Z
|
2021-12-29T11:04:01.000Z
|
src/pyensae/finance/__init__.py
|
mohamedelkansouli/Ensae_py2
|
e54a05f90c6aa6e2a5065eac9f9ec10aca64b46a
|
[
"MIT"
] | 27
|
2015-01-13T08:24:22.000Z
|
2022-03-31T14:51:23.000Z
|
"""
@file
@brief shortcuts to finance
"""
from .astock import StockPrices
| 10.714286
| 31
| 0.72
| 9
| 75
| 6
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.16
| 75
| 6
| 32
| 12.5
| 0.857143
| 0.44
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
3398d2e72b9ac5070ed7f3aa1e3f16fa6419e933
| 200
|
py
|
Python
|
edit/datasets/__init__.py
|
tpoisonooo/basicVSR_mge
|
53df836a7dcc075083ef7c9ff7cabea69fec3192
|
[
"Apache-2.0"
] | 28
|
2021-03-23T09:00:33.000Z
|
2022-03-10T03:55:00.000Z
|
edit/datasets/__init__.py
|
tpoisonooo/basicVSR_mge
|
53df836a7dcc075083ef7c9ff7cabea69fec3192
|
[
"Apache-2.0"
] | 2
|
2021-04-17T20:08:55.000Z
|
2022-02-01T17:48:55.000Z
|
edit/datasets/__init__.py
|
tpoisonooo/basicVSR_mge
|
53df836a7dcc075083ef7c9ff7cabea69fec3192
|
[
"Apache-2.0"
] | 5
|
2021-05-19T07:35:56.000Z
|
2022-01-13T02:11:50.000Z
|
from .builder import build_dataset
from .sr_folder_dataset import SRFolderDataset
from .sr_manytoone_dataset import SRManyToOneDataset
from .sr_manytomany_dataset import SRManyToManyDataset
import os
| 33.333333
| 54
| 0.89
| 25
| 200
| 6.84
| 0.52
| 0.105263
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.09
| 200
| 5
| 55
| 40
| 0.93956
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
33a0eb4076cbc7faab9402d1adf27649d99841f5
| 41
|
py
|
Python
|
doclib/manager/errors/document_error.py
|
mark-ep/doclib
|
17b3ae2036d744a5224172e62e53307a3b69677e
|
[
"MIT"
] | null | null | null |
doclib/manager/errors/document_error.py
|
mark-ep/doclib
|
17b3ae2036d744a5224172e62e53307a3b69677e
|
[
"MIT"
] | 4
|
2017-08-13T11:06:33.000Z
|
2017-08-13T11:16:16.000Z
|
doclib/manager/errors/document_error.py
|
mark-ep/doclib
|
17b3ae2036d744a5224172e62e53307a3b69677e
|
[
"MIT"
] | null | null | null |
class DocumentError(Exception):
pass
| 13.666667
| 31
| 0.756098
| 4
| 41
| 7.75
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.170732
| 41
| 2
| 32
| 20.5
| 0.911765
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0.5
| 0
| 0
| 0.5
| 0
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| 0
| 0
|
0
| 5
|
33c8ac04a8652b2eb02b7e61da1e792e5e6a9e2d
| 132
|
py
|
Python
|
minpkg/hello.py
|
felipaoo/minpkg
|
24059a38dd3739b66a29277159b44a2a228b2385
|
[
"MIT"
] | null | null | null |
minpkg/hello.py
|
felipaoo/minpkg
|
24059a38dd3739b66a29277159b44a2a228b2385
|
[
"MIT"
] | null | null | null |
minpkg/hello.py
|
felipaoo/minpkg
|
24059a38dd3739b66a29277159b44a2a228b2385
|
[
"MIT"
] | 1
|
2020-01-17T18:41:21.000Z
|
2020-01-17T18:41:21.000Z
|
import sys
def say_hello():
return "hello!"
def say_goodbye():
return "Goodbye!!"
def say_my_name():
return "python"
| 12
| 22
| 0.643939
| 18
| 132
| 4.5
| 0.555556
| 0.222222
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.219697
| 132
| 10
| 23
| 13.2
| 0.786408
| 0
| 0
| 0
| 0
| 0
| 0.159091
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.428571
| true
| 0
| 0.142857
| 0.428571
| 1
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| 1
| 0
| 0
|
0
| 5
|
33e2d7bebbb5b29db2375a2bba087789ccee3c5e
| 3,452
|
py
|
Python
|
src/einsteinpy/coordinates/conversion.py
|
Bhavam/einsteinpy
|
4df5a19e51da5aabff19c50e231d6f8b83e3d5a7
|
[
"MIT"
] | 1
|
2020-02-22T18:56:04.000Z
|
2020-02-22T18:56:04.000Z
|
src/einsteinpy/coordinates/conversion.py
|
Bhavam/einsteinpy
|
4df5a19e51da5aabff19c50e231d6f8b83e3d5a7
|
[
"MIT"
] | null | null | null |
src/einsteinpy/coordinates/conversion.py
|
Bhavam/einsteinpy
|
4df5a19e51da5aabff19c50e231d6f8b83e3d5a7
|
[
"MIT"
] | null | null | null |
import numpy as np
from .utils import (
bl_to_cartesian_fast,
cartesian_to_bl_fast,
cartesian_to_spherical_fast,
spherical_to_cartesian_fast,
)
class CartesianConversion:
def __init__(self, x, y, z, v_x=None, v_y=None, v_z=None):
self.x_si = x
self.y_si = y
self.z_si = z
self.vx_si = v_x
self.vy_si = v_y
self.vz_si = v_z
self._velocities_provided = not (
(v_x is None) or (v_y is None) or (v_z is None)
)
def values(self):
if self._velocities_provided:
return self.x_si, self.y_si, self.z_si, self.vx_si, self.vy_si, self.vz_si
return self.x_si, self.y_si, self.z_si
def convert_spherical(self):
return cartesian_to_spherical_fast(
self.x_si,
self.y_si,
self.z_si,
self.vx_si,
self.vy_si,
self.vz_si,
self._velocities_provided,
)
def convert_bl(self, a):
return cartesian_to_bl_fast(
self.x_si,
self.y_si,
self.z_si,
a,
self.vx_si,
self.vy_si,
self.vz_si,
self._velocities_provided,
)
class SphericalConversion:
def __init__(self, r, theta, phi, v_r=None, v_t=None, v_p=None):
self.r_si = r
self.t_si = theta
self.p_si = phi
self.vr_si = v_r
self.vt_si = v_t
self.vp_si = v_p
self._velocities_provided = not (
(v_r is None) or (v_t is None) or (v_p is None)
)
def values(self):
if self._velocities_provided:
return self.r_si, self.t_si, self.p_si, self.vr_si, self.vt_si, self.vp_si
return self.r_si, self.t_si, self.p_si
def convert_cartesian(self):
return spherical_to_cartesian_fast(
self.r_si,
self.t_si,
self.p_si,
self.vr_si,
self.vt_si,
self.vp_si,
self._velocities_provided,
)
def convert_bl(self, a):
transformed_cartesian = self.convert_cartesian()
cart = CartesianConversion(*transformed_cartesian)
return cart.convert_bl(a)
class BoyerLindquistConversion:
def __init__(self, r, theta, phi, v_r=None, v_t=None, v_p=None, a=0.0):
self.r_si = r
self.t_si = theta
self.p_si = phi
self.vr_si = v_r
self.vt_si = v_t
self.vp_si = v_p
self.a_si = a
self._velocities_provided = not (
(v_r is None) or (v_t is None) or (v_p is None)
)
def values(self):
if self._velocities_provided:
return (
self.r_si,
self.t_si,
self.p_si,
self.vr_si,
self.vt_si,
self.vp_si,
self.a_si,
)
return self.r_si, self.t_si, self.p_si, self.a_si
def convert_cartesian(self):
return bl_to_cartesian_fast(
self.r_si,
self.t_si,
self.p_si,
self.a_si,
self.vr_si,
self.vt_si,
self.vp_si,
self._velocities_provided,
)
def convert_spherical(self):
transformed_cartesian = self.convert_cartesian()
cart = CartesianConversion(*transformed_cartesian)
return cart.convert_spherical()
| 26.96875
| 86
| 0.547509
| 491
| 3,452
| 3.503055
| 0.09776
| 0.163953
| 0.127907
| 0.031395
| 0.762209
| 0.747093
| 0.713372
| 0.713372
| 0.713372
| 0.699419
| 0
| 0.000915
| 0.366744
| 3,452
| 127
| 87
| 27.181102
| 0.78591
| 0
| 0
| 0.621622
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.108108
| false
| 0
| 0.018018
| 0.036036
| 0.261261
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
33f8597e3428f445f3711f6bb2392a34a255ea3e
| 823
|
py
|
Python
|
test/modbus_mocks.py
|
vmacari/pymodbus
|
ec97e2f2b50c6db0a932f44e550a5dee60bf0970
|
[
"BSD-3-Clause"
] | 1,125
|
2017-05-11T06:11:36.000Z
|
2022-03-31T02:59:45.000Z
|
test/modbus_mocks.py
|
vmacari/pymodbus
|
ec97e2f2b50c6db0a932f44e550a5dee60bf0970
|
[
"BSD-3-Clause"
] | 575
|
2017-05-12T02:46:55.000Z
|
2022-03-31T16:00:33.000Z
|
test/modbus_mocks.py
|
vmacari/pymodbus
|
ec97e2f2b50c6db0a932f44e550a5dee60bf0970
|
[
"BSD-3-Clause"
] | 516
|
2017-05-19T14:06:06.000Z
|
2022-03-31T06:10:13.000Z
|
from pymodbus.interfaces import IModbusSlaveContext
#---------------------------------------------------------------------------#
# Mocks
#---------------------------------------------------------------------------#
class mock(object): pass
class MockContext(IModbusSlaveContext):
def __init__(self, valid=False, default=True):
self.valid = valid
self.default = default
def validate(self, fx, address, count):
return self.valid
def getValues(self, fx, address, count):
return [self.default] * count
def setValues(self, fx, address, count):
pass
class FakeList(object):
''' todo, replace with magic mock '''
def __init__(self, size):
self.size = size
def __len__(self):
return self.size
def __iter__(self):
return []
| 23.514286
| 77
| 0.518834
| 77
| 823
| 5.337662
| 0.428571
| 0.065693
| 0.094891
| 0.131387
| 0.136253
| 0.136253
| 0
| 0
| 0
| 0
| 0
| 0
| 0.212637
| 823
| 34
| 78
| 24.205882
| 0.634259
| 0.227218
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.029412
| 0
| 1
| 0.368421
| false
| 0.105263
| 0.052632
| 0.210526
| 0.789474
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 1
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 1
| 0
|
0
| 5
|
d502d46a6516419b626c0789b4d8efa5334f7a6b
| 73,322
|
py
|
Python
|
src/pyMeComTEC_autogen.py
|
JulienKluge/pyMeComTEC
|
315e785facda69df31ab58d32efdc6473d7c1a0a
|
[
"MIT"
] | 1
|
2022-03-12T01:53:20.000Z
|
2022-03-12T01:53:20.000Z
|
src/pyMeComTEC_autogen.py
|
JulienKluge/pyMeComTEC
|
315e785facda69df31ab58d32efdc6473d7c1a0a
|
[
"MIT"
] | null | null | null |
src/pyMeComTEC_autogen.py
|
JulienKluge/pyMeComTEC
|
315e785facda69df31ab58d32efdc6473d7c1a0a
|
[
"MIT"
] | null | null | null |
#autogenerated content
from enum import Enum
from pyMeComTEC_Helper import MeComError, MeComException, MeParFlags, MeParType
class _TEC_autogen:
def __init__(self):
raise Exception("This is a autogenerated class not meant to be instantiated")
def find_meparid(self, needle):
if type(needle) == int:
for tp in self.TEC_PARAMETERS:
if (tp["id"] == needle):
return tp
elif type(needle) == str:
for tp in self.TEC_PARAMETERS:
if (tp["name"].lower() == needle.lower()):
return tp
return None
TEC_PARAMETERS = [
{"prefix": "COM", "id": 100, "name": "DeviceType", "type": int, "mepar_type": MeParType.INT32, "readonly": True},
{"prefix": "COM", "id": 101, "name": "HardwareVersion", "type": int, "mepar_type": MeParType.INT32, "readonly": True},
{"prefix": "COM", "id": 102, "name": "SerialNumber", "type": int, "mepar_type": MeParType.INT32, "readonly": True},
{"prefix": "COM", "id": 103, "name": "FirmwareVersion", "type": int, "mepar_type": MeParType.INT32, "readonly": True},
{"prefix": "COM", "id": 104, "name": "DeviceStatus", "type": int, "mepar_type": MeParType.INT32, "readonly": True},
{"prefix": "COM", "id": 105, "name": "ErrorNumber", "type": int, "mepar_type": MeParType.INT32, "readonly": True},
{"prefix": "COM", "id": 106, "name": "ErrorInstance", "type": int, "mepar_type": MeParType.INT32, "readonly": True},
{"prefix": "COM", "id": 107, "name": "ErrorParameter", "type": int, "mepar_type": MeParType.INT32, "readonly": True},
{"prefix": "COM", "id": 108, "name": "ParameterSystemFlashSaveOff", "type": int, "mepar_type": MeParType.INT32, "readonly": False},
{"prefix": "COM", "id": 109, "name": "ParameterSystemFlashStatus", "type": int, "mepar_type": MeParType.INT32, "readonly": True},
{"prefix": "TEC", "id": 1000, "name": "ObjectTemperature", "type": float, "mepar_type": MeParType.FLOAT32, "readonly": True},
{"prefix": "TEC", "id": 1001, "name": "SinkTemperature", "type": float, "mepar_type": MeParType.FLOAT32, "readonly": True},
{"prefix": "TEC", "id": 1010, "name": "TargetObjectTemperature", "type": float, "mepar_type": MeParType.FLOAT32, "readonly": True},
{"prefix": "TEC", "id": 1011, "name": "RampNominalObjectTemperature", "type": float, "mepar_type": MeParType.FLOAT32, "readonly": True},
{"prefix": "TEC", "id": 1012, "name": "ThermalPowerModelCurrent", "type": float, "mepar_type": MeParType.FLOAT32, "readonly": True},
{"prefix": "TEC", "id": 1020, "name": "ActualOutputCurrent", "type": float, "mepar_type": MeParType.FLOAT32, "readonly": True},
{"prefix": "TEC", "id": 1021, "name": "ActualOutputVoltage", "type": float, "mepar_type": MeParType.FLOAT32, "readonly": True},
{"prefix": "TEC", "id": 1030, "name": "PIDLowerLimitation", "type": float, "mepar_type": MeParType.FLOAT32, "readonly": True},
{"prefix": "TEC", "id": 1031, "name": "PIDUpperLimitation", "type": float, "mepar_type": MeParType.FLOAT32, "readonly": True},
{"prefix": "TEC", "id": 1032, "name": "PIDControlVariable", "type": float, "mepar_type": MeParType.FLOAT32, "readonly": True},
{"prefix": "TEC", "id": 1040, "name": "ObjectSensorRawADCValue", "type": int, "mepar_type": MeParType.INT32, "readonly": True},
{"prefix": "TEC", "id": 1041, "name": "SinkSensorRawADCValue", "type": int, "mepar_type": MeParType.INT32, "readonly": True},
{"prefix": "TEC", "id": 1042, "name": "ObjectSensorResistance", "type": float, "mepar_type": MeParType.FLOAT32, "readonly": True},
{"prefix": "TEC", "id": 1043, "name": "SinkSensorResitance", "type": float, "mepar_type": MeParType.FLOAT32, "readonly": True},
{"prefix": "TEC", "id": 1044, "name": "SinkSensorTemperature", "type": float, "mepar_type": MeParType.FLOAT32, "readonly": True},
{"prefix": "TEC", "id": 1050, "name": "FirmwareVersion", "type": int, "mepar_type": MeParType.INT32, "readonly": True},
{"prefix": "TEC", "id": 1051, "name": "FirmwareBuildNumber", "type": int, "mepar_type": MeParType.INT32, "readonly": True},
{"prefix": "TEC", "id": 1052, "name": "HardwareVersion", "type": int, "mepar_type": MeParType.INT32, "readonly": True},
{"prefix": "TEC", "id": 1053, "name": "SerialNumber", "type": int, "mepar_type": MeParType.INT32, "readonly": True},
{"prefix": "TEC", "id": 1060, "name": "DriverInputVoltage", "type": float, "mepar_type": MeParType.FLOAT32, "readonly": True},
{"prefix": "TEC", "id": 1061, "name": "MedVInternalSupply", "type": float, "mepar_type": MeParType.FLOAT32, "readonly": True},
{"prefix": "TEC", "id": 1062, "name": "3VInternalSupply", "type": float, "mepar_type": MeParType.FLOAT32, "readonly": True},
{"prefix": "TEC", "id": 1063, "name": "BasePlateTemperature", "type": float, "mepar_type": MeParType.FLOAT32, "readonly": True},
{"prefix": "TEC", "id": 1070, "name": "ErrorNumber", "type": int, "mepar_type": MeParType.INT32, "readonly": True},
{"prefix": "TEC", "id": 1071, "name": "ErrorInstance", "type": int, "mepar_type": MeParType.INT32, "readonly": True},
{"prefix": "TEC", "id": 1072, "name": "ErrorParameter", "type": int, "mepar_type": MeParType.INT32, "readonly": True},
{"prefix": "TEC", "id": 1090, "name": "ParallelActualOutputCurrent", "type": float, "mepar_type": MeParType.FLOAT32, "readonly": True},
{"prefix": "TEC", "id": 1080, "name": "DriverStatus", "type": int, "mepar_type": MeParType.INT32, "readonly": True},
{"prefix": "TEC", "id": 1081, "name": "ParameterSystemFlashStatus", "type": int, "mepar_type": MeParType.INT32, "readonly": True},
{"prefix": "TEC", "id": 1100, "name": "FanRelativeCoolingPower", "type": float, "mepar_type": MeParType.FLOAT32, "readonly": True},
{"prefix": "TEC", "id": 1101, "name": "FanNominalFanSpeed", "type": float, "mepar_type": MeParType.FLOAT32, "readonly": True},
{"prefix": "TEC", "id": 1102, "name": "FanActualFanSpeed", "type": float, "mepar_type": MeParType.FLOAT32, "readonly": True},
{"prefix": "TEC", "id": 1103, "name": "FanActualPwmLevel", "type": float, "mepar_type": MeParType.FLOAT32, "readonly": True},
{"prefix": "TEC", "id": 1200, "name": "TemperatureIsStable", "type": int, "mepar_type": MeParType.INT32, "readonly": True},
{"prefix": "TEC", "id": 2000, "name": "OutputStageInputSelection", "type": int, "mepar_type": MeParType.INT32, "readonly": False},
{"prefix": "TEC", "id": 2010, "name": "OutputStageEnable", "type": int, "mepar_type": MeParType.INT32, "readonly": False},
{"prefix": "TEC", "id": 2020, "name": "SetStaticCurrent", "type": float, "mepar_type": MeParType.FLOAT32, "readonly": False},
{"prefix": "TEC", "id": 2021, "name": "SetStaticVoltage", "type": float, "mepar_type": MeParType.FLOAT32, "readonly": False},
{"prefix": "TEC", "id": 2030, "name": "CurrentLimitation", "type": float, "mepar_type": MeParType.FLOAT32, "readonly": False},
{"prefix": "TEC", "id": 2031, "name": "VoltageLimitation", "type": float, "mepar_type": MeParType.FLOAT32, "readonly": False},
{"prefix": "TEC", "id": 2032, "name": "CurrentErrorThreshold", "type": float, "mepar_type": MeParType.FLOAT32, "readonly": False},
{"prefix": "TEC", "id": 2033, "name": "VoltageErrorThreshold", "type": float, "mepar_type": MeParType.FLOAT32, "readonly": False},
{"prefix": "TEC", "id": 2040, "name": "GeneralOperatingMode", "type": int, "mepar_type": MeParType.INT32, "readonly": False},
{"prefix": "TEC", "id": 2051, "name": "DeviceAddress", "type": int, "mepar_type": MeParType.INT32, "readonly": False},
{"prefix": "TEC", "id": 2050, "name": "RS485CH1BaudRate", "type": int, "mepar_type": MeParType.INT32, "readonly": False},
{"prefix": "TEC", "id": 2052, "name": "RS485CH1ResponseDelay", "type": int, "mepar_type": MeParType.INT32, "readonly": False},
{"prefix": "TEC", "id": 2060, "name": "ComWatchDogTimeout", "type": float, "mepar_type": MeParType.FLOAT32, "readonly": False},
{"prefix": "TEC", "id": 3000, "name": "TargetObjectTemp", "type": float, "mepar_type": MeParType.FLOAT32, "readonly": False},
{"prefix": "TEC", "id": 3003, "name": "CoarseTempRamp", "type": float, "mepar_type": MeParType.FLOAT32, "readonly": False},
{"prefix": "TEC", "id": 3002, "name": "ProximityWidth", "type": float, "mepar_type": MeParType.FLOAT32, "readonly": False},
{"prefix": "TEC", "id": 3010, "name": "Kp", "type": float, "mepar_type": MeParType.FLOAT32, "readonly": False},
{"prefix": "TEC", "id": 3011, "name": "Ti", "type": float, "mepar_type": MeParType.FLOAT32, "readonly": False},
{"prefix": "TEC", "id": 3012, "name": "Td", "type": float, "mepar_type": MeParType.FLOAT32, "readonly": False},
{"prefix": "TEC", "id": 3013, "name": "DPartDampPT1", "type": float, "mepar_type": MeParType.FLOAT32, "readonly": False},
{"prefix": "TEC", "id": 3020, "name": "ModelizationMode", "type": int, "mepar_type": MeParType.INT32, "readonly": False},
{"prefix": "TEC", "id": 3030, "name": "PeltierMaxCurrent", "type": float, "mepar_type": MeParType.FLOAT32, "readonly": False},
{"prefix": "TEC", "id": 3031, "name": "PeltierMaxVoltage", "type": float, "mepar_type": MeParType.FLOAT32, "readonly": False},
{"prefix": "TEC", "id": 3032, "name": "PeltierCoolingCapacity", "type": float, "mepar_type": MeParType.FLOAT32, "readonly": False},
{"prefix": "TEC", "id": 3033, "name": "PeltierDeltaTemperature", "type": float, "mepar_type": MeParType.FLOAT32, "readonly": False},
{"prefix": "TEC", "id": 3034, "name": "PeltierPositiveCurrentIs", "type": int, "mepar_type": MeParType.INT32, "readonly": False},
{"prefix": "TEC", "id": 3040, "name": "ResistorResistance", "type": float, "mepar_type": MeParType.FLOAT32, "readonly": False},
{"prefix": "TEC", "id": 3041, "name": "ResistorMaxCurrent", "type": float, "mepar_type": MeParType.FLOAT32, "readonly": False},
{"prefix": "TEC", "id": 4001, "name": "TemperatureOffset", "type": float, "mepar_type": MeParType.FLOAT32, "readonly": False},
{"prefix": "TEC", "id": 4002, "name": "TemperatureGain", "type": float, "mepar_type": MeParType.FLOAT32, "readonly": False},
{"prefix": "TEC", "id": 4010, "name": "LowerErrorThreshold", "type": float, "mepar_type": MeParType.FLOAT32, "readonly": False},
{"prefix": "TEC", "id": 4011, "name": "UpperErrorThreshold", "type": float, "mepar_type": MeParType.FLOAT32, "readonly": False},
{"prefix": "TEC", "id": 4012, "name": "MaxTempChange", "type": float, "mepar_type": MeParType.FLOAT32, "readonly": False},
{"prefix": "TEC", "id": 4020, "name": "NTCLowerPointTemperature", "type": float, "mepar_type": MeParType.FLOAT32, "readonly": False},
{"prefix": "TEC", "id": 4021, "name": "NTCLowerPointResistance", "type": float, "mepar_type": MeParType.FLOAT32, "readonly": False},
{"prefix": "TEC", "id": 4022, "name": "NTCMiddlePointTemperature", "type": float, "mepar_type": MeParType.FLOAT32, "readonly": False},
{"prefix": "TEC", "id": 4023, "name": "NTCMiddlePointResistance", "type": float, "mepar_type": MeParType.FLOAT32, "readonly": False},
{"prefix": "TEC", "id": 4024, "name": "NTCUpperPointTemperature", "type": float, "mepar_type": MeParType.FLOAT32, "readonly": False},
{"prefix": "TEC", "id": 4025, "name": "NTCUpperPointResistance", "type": float, "mepar_type": MeParType.FLOAT32, "readonly": False},
{"prefix": "TEC", "id": 4040, "name": "StabilityTemperatureWindow", "type": float, "mepar_type": MeParType.FLOAT32, "readonly": False},
{"prefix": "TEC", "id": 4041, "name": "StabilityMinTimeInWindow", "type": float, "mepar_type": MeParType.FLOAT32, "readonly": False},
{"prefix": "TEC", "id": 4042, "name": "StabilityMaxStabiTime", "type": float, "mepar_type": MeParType.FLOAT32, "readonly": False},
{"prefix": "TEC", "id": 4030, "name": "MeasLowestResistance", "type": float, "mepar_type": MeParType.FLOAT32, "readonly": True},
{"prefix": "TEC", "id": 4031, "name": "MeasHighestResistance", "type": float, "mepar_type": MeParType.FLOAT32, "readonly": True},
{"prefix": "TEC", "id": 4032, "name": "MeasTempAtLowestResistance", "type": float, "mepar_type": MeParType.FLOAT32, "readonly": True},
{"prefix": "TEC", "id": 4033, "name": "MeasTempAtHighestResistance", "type": float, "mepar_type": MeParType.FLOAT32, "readonly": True},
{"prefix": "TEC", "id": 5001, "name": "TemperatureOffset", "type": float, "mepar_type": MeParType.FLOAT32, "readonly": False},
{"prefix": "TEC", "id": 5002, "name": "TemperatureGain", "type": float, "mepar_type": MeParType.FLOAT32, "readonly": False},
{"prefix": "TEC", "id": 5010, "name": "LowerErrorThreshold", "type": float, "mepar_type": MeParType.FLOAT32, "readonly": False},
{"prefix": "TEC", "id": 5011, "name": "UpperErrorThreshold", "type": float, "mepar_type": MeParType.FLOAT32, "readonly": False},
{"prefix": "TEC", "id": 5012, "name": "MaxTempChange", "type": float, "mepar_type": MeParType.FLOAT32, "readonly": False},
{"prefix": "TEC", "id": 5020, "name": "NTCLowerPointTemperature", "type": float, "mepar_type": MeParType.FLOAT32, "readonly": False},
{"prefix": "TEC", "id": 5021, "name": "NTCLowerPointResistance", "type": float, "mepar_type": MeParType.FLOAT32, "readonly": False},
{"prefix": "TEC", "id": 5022, "name": "NTCMiddlePointTemperature", "type": float, "mepar_type": MeParType.FLOAT32, "readonly": False},
{"prefix": "TEC", "id": 5023, "name": "NTCMiddlePointResistance", "type": float, "mepar_type": MeParType.FLOAT32, "readonly": False},
{"prefix": "TEC", "id": 5024, "name": "NTCUpperPointTemperature", "type": float, "mepar_type": MeParType.FLOAT32, "readonly": False},
{"prefix": "TEC", "id": 5025, "name": "NTCUpperPointResistance", "type": float, "mepar_type": MeParType.FLOAT32, "readonly": False},
{"prefix": "TEC", "id": 5030, "name": "SinkTemperatureSelection", "type": int, "mepar_type": MeParType.INT32, "readonly": False},
{"prefix": "TEC", "id": 5031, "name": "FixedTemperature", "type": float, "mepar_type": MeParType.FLOAT32, "readonly": False},
{"prefix": "TEC", "id": 5040, "name": "MeasLowestResistance", "type": float, "mepar_type": MeParType.FLOAT32, "readonly": True},
{"prefix": "TEC", "id": 5041, "name": "MeasHighestResistance", "type": float, "mepar_type": MeParType.FLOAT32, "readonly": True},
{"prefix": "TEC", "id": 5042, "name": "MeasTempAtLowestResistance", "type": float, "mepar_type": MeParType.FLOAT32, "readonly": True},
{"prefix": "TEC", "id": 5043, "name": "MeasTempAtHighestResistance", "type": float, "mepar_type": MeParType.FLOAT32, "readonly": True},
{"prefix": "TEC", "id": 6000, "name": "ObjMeasPGAGain", "type": int, "mepar_type": MeParType.INT32, "readonly": False},
{"prefix": "TEC", "id": 6001, "name": "ObjMeasCurrentSource", "type": int, "mepar_type": MeParType.INT32, "readonly": False},
{"prefix": "TEC", "id": 6002, "name": "ObjMeasADCRs", "type": float, "mepar_type": MeParType.FLOAT32, "readonly": False},
{"prefix": "TEC", "id": 6003, "name": "ObjMeasADCCalibOffset", "type": float, "mepar_type": MeParType.FLOAT32, "readonly": False},
{"prefix": "TEC", "id": 6004, "name": "ObjMeasADCCalibGain", "type": float, "mepar_type": MeParType.FLOAT32, "readonly": False},
{"prefix": "TEC", "id": 6005, "name": "ObjMeasSensorTypeSelection", "type": int, "mepar_type": MeParType.INT32, "readonly": False},
{"prefix": "TEC", "id": 6010, "name": "SinMeasADCRv", "type": float, "mepar_type": MeParType.FLOAT32, "readonly": False},
{"prefix": "TEC", "id": 6013, "name": "SinMeasADCVps", "type": float, "mepar_type": MeParType.FLOAT32, "readonly": False},
{"prefix": "TEC", "id": 6011, "name": "SinMeasADCCalibOffset", "type": float, "mepar_type": MeParType.FLOAT32, "readonly": False},
{"prefix": "TEC", "id": 6012, "name": "SinMeasADCCalibGain", "type": float, "mepar_type": MeParType.FLOAT32, "readonly": False},
{"prefix": "TEC", "id": 6020, "name": "DisplayType", "type": int, "mepar_type": MeParType.INT32, "readonly": False},
{"prefix": "TEC", "id": 6023, "name": "AlternativeMode", "type": int, "mepar_type": MeParType.INT32, "readonly": False},
{"prefix": "TEC", "id": 6024, "name": "DisplayLineDefText", "type": str, "mepar_type": MeParType.LATIN1, "readonly": False},
{"prefix": "TEC", "id": 6025, "name": "DisplayLineAltText", "type": str, "mepar_type": MeParType.LATIN1, "readonly": False},
{"prefix": "TEC", "id": 6026, "name": "DisplayLineAltMode", "type": str, "mepar_type": MeParType.LATIN1, "readonly": False},
{"prefix": "TEC", "id": 6100, "name": "PbcFunction", "type": int, "mepar_type": MeParType.INT32, "readonly": False},
{"prefix": "TEC", "id": 6110, "name": "ChangeButtonLowTemperature", "type": float, "mepar_type": MeParType.FLOAT32, "readonly": False},
{"prefix": "TEC", "id": 6111, "name": "ChangeButtonHighTemperature", "type": float, "mepar_type": MeParType.FLOAT32, "readonly": False},
{"prefix": "TEC", "id": 6112, "name": "ChangeButtonStepSize", "type": float, "mepar_type": MeParType.FLOAT32, "readonly": False},
{"prefix": "TEC", "id": 6200, "name": "FanControlEnable", "type": int, "mepar_type": MeParType.INT32, "readonly": False},
{"prefix": "TEC", "id": 6210, "name": "FanActualTempSource", "type": int, "mepar_type": MeParType.INT32, "readonly": False},
{"prefix": "TEC", "id": 6211, "name": "FanTargetTemp", "type": float, "mepar_type": MeParType.FLOAT32, "readonly": False},
{"prefix": "TEC", "id": 6212, "name": "FanTempKp", "type": float, "mepar_type": MeParType.FLOAT32, "readonly": False},
{"prefix": "TEC", "id": 6213, "name": "FanTempTi", "type": float, "mepar_type": MeParType.FLOAT32, "readonly": False},
{"prefix": "TEC", "id": 6214, "name": "FanTempTd", "type": float, "mepar_type": MeParType.FLOAT32, "readonly": False},
{"prefix": "TEC", "id": 6220, "name": "FanSpeedMin", "type": float, "mepar_type": MeParType.FLOAT32, "readonly": False},
{"prefix": "TEC", "id": 6221, "name": "FanSpeedMax", "type": float, "mepar_type": MeParType.FLOAT32, "readonly": False},
{"prefix": "TEC", "id": 6222, "name": "FanSpeedKp", "type": float, "mepar_type": MeParType.FLOAT32, "readonly": False},
{"prefix": "TEC", "id": 6223, "name": "FanSpeedTi", "type": float, "mepar_type": MeParType.FLOAT32, "readonly": False},
{"prefix": "TEC", "id": 6224, "name": "FanSpeedTd", "type": float, "mepar_type": MeParType.FLOAT32, "readonly": False},
{"prefix": "TEC", "id": 6225, "name": "FanSpeedBypass", "type": int, "mepar_type": MeParType.INT32, "readonly": False},
{"prefix": "TEC", "id": 6230, "name": "PwmFrequency", "type": int, "mepar_type": MeParType.INT32, "readonly": False},
{"prefix": "TEC", "id": 6300, "name": "MiscActObjectTempSource", "type": int, "mepar_type": MeParType.INT32, "readonly": False},
{"prefix": "TEC", "id": 6310, "name": "MiscDelayTillReset", "type": float, "mepar_type": MeParType.FLOAT32, "readonly": False},
{"prefix": "TEC", "id": 6320, "name": "MiscError108Delay", "type": int, "mepar_type": MeParType.INT32, "readonly": False},
{"prefix": "TEC", "id": 50000, "name": "LiveEnable", "type": int, "mepar_type": MeParType.INT32, "readonly": False},
{"prefix": "TEC", "id": 50001, "name": "LiveSetCurrent", "type": float, "mepar_type": MeParType.FLOAT32, "readonly": False},
{"prefix": "TEC", "id": 50002, "name": "LiveSetVoltage", "type": float, "mepar_type": MeParType.FLOAT32, "readonly": False},
{"prefix": "TEC", "id": 50010, "name": "SineRampStartPoint", "type": int, "mepar_type": MeParType.INT32, "readonly": False},
{"prefix": "TEC", "id": 50011, "name": "ObjectTargetTempSourceSelection", "type": int, "mepar_type": MeParType.INT32, "readonly": False},
{"prefix": "TEC", "id": 50012, "name": "ObjectTargetTemperature", "type": float, "mepar_type": MeParType.FLOAT32, "readonly": False},
{"prefix": "TEC", "id": 51000, "name": "AtmAutoTuningStart", "type": int, "mepar_type": MeParType.INT32, "readonly": False},
{"prefix": "TEC", "id": 51001, "name": "AtmAutoTuningCancel", "type": int, "mepar_type": MeParType.INT32, "readonly": False},
{"prefix": "TEC", "id": 51002, "name": "AtmThermalModelSpeed", "type": int, "mepar_type": MeParType.INT32, "readonly": False},
{"prefix": "TEC", "id": 51010, "name": "AtmTuningParameter2A", "type": float, "mepar_type": MeParType.FLOAT32, "readonly": True},
{"prefix": "TEC", "id": 51011, "name": "AtmTuningParameter2D", "type": float, "mepar_type": MeParType.FLOAT32, "readonly": True},
{"prefix": "TEC", "id": 51012, "name": "AtmTuningParameterKu", "type": float, "mepar_type": MeParType.FLOAT32, "readonly": True},
{"prefix": "TEC", "id": 51013, "name": "AtmTuningParameterTu", "type": float, "mepar_type": MeParType.FLOAT32, "readonly": True},
{"prefix": "TEC", "id": 51014, "name": "AtmPIDParameterKp", "type": float, "mepar_type": MeParType.FLOAT32, "readonly": True},
{"prefix": "TEC", "id": 51015, "name": "AtmPIDParameterTi", "type": float, "mepar_type": MeParType.FLOAT32, "readonly": True},
{"prefix": "TEC", "id": 51016, "name": "AtmPIDParameterTd", "type": float, "mepar_type": MeParType.FLOAT32, "readonly": True},
{"prefix": "TEC", "id": 51022, "name": "AtmSlowPIParameterKp", "type": float, "mepar_type": MeParType.FLOAT32, "readonly": True},
{"prefix": "TEC", "id": 51023, "name": "AtmSlowPIParameterTi", "type": float, "mepar_type": MeParType.FLOAT32, "readonly": True},
{"prefix": "TEC", "id": 51024, "name": "AtmPIDDPartDamping", "type": float, "mepar_type": MeParType.FLOAT32, "readonly": True},
{"prefix": "TEC", "id": 51017, "name": "AtmCoarseTempRamp", "type": float, "mepar_type": MeParType.FLOAT32, "readonly": True},
{"prefix": "TEC", "id": 51018, "name": "AtmProximityWidth", "type": float, "mepar_type": MeParType.FLOAT32, "readonly": True},
{"prefix": "TEC", "id": 51020, "name": "AtmTuningStatus", "type": int, "mepar_type": MeParType.INT32, "readonly": True},
{"prefix": "TEC", "id": 51021, "name": "AtmTuningProgress", "type": float, "mepar_type": MeParType.FLOAT32, "readonly": True},
{"prefix": "TEC", "id": 52000, "name": "LutTableStart", "type": int, "mepar_type": MeParType.INT32, "readonly": False},
{"prefix": "TEC", "id": 52001, "name": "LutTableStop", "type": int, "mepar_type": MeParType.INT32, "readonly": False},
{"prefix": "TEC", "id": 52002, "name": "LutTableStatus", "type": int, "mepar_type": MeParType.INT32, "readonly": False},
{"prefix": "TEC", "id": 52003, "name": "LutCurrentTableLine", "type": int, "mepar_type": MeParType.INT32, "readonly": False},
{"prefix": "TEC", "id": 52010, "name": "LutTableIDSelection", "type": int, "mepar_type": MeParType.INT32, "readonly": False},
{"prefix": "TEC", "id": 52012, "name": "LutNrOfRepetitions", "type": int, "mepar_type": MeParType.INT32, "readonly": False},
{"prefix": "TEC", "id": 52100, "name": "PbcEnableFunction", "type": int, "mepar_type": MeParType.INT32, "readonly": False},
{"prefix": "TEC", "id": 52101, "name": "PbcSetOutputToPushPull", "type": int, "mepar_type": MeParType.INT32, "readonly": False},
{"prefix": "TEC", "id": 52102, "name": "PbcSetOutputStates", "type": int, "mepar_type": MeParType.INT32, "readonly": False},
{"prefix": "TEC", "id": 52103, "name": "PbcReadInputStates", "type": int, "mepar_type": MeParType.INT32, "readonly": False},
{"prefix": "TEC", "id": 52200, "name": "ExternalActualObjectTemperature", "type": float, "mepar_type": MeParType.FLOAT32, "readonly": False}
]
TEC_ERRORS = {
0: "No Error",
1: "Processor Error:\nMCU system malfunction",
2: "Processor Error:\nMCU system malfunction",
3: "Processor Error:\nMCU system malfunction",
4: "Processor Error:\nMCU system malfunction",
5: "Processor Error:\nMCU system malfunction",
6: "Processor Error:\nMCU system malfunction",
7: "Processor Error:\nMCU system malfunction",
8: "Processor Error:\nMCU system malfunction",
9: "Processor Error:\nMCU system malfunction",
10: "Processor Error:\nMCU system malfunction",
11: "LTR-1200 Emergency Stop",
12: "LTR-1200 HMI Free Timeout",
20: "Parameter Error:\nInternal parameter system malfunction",
21: "Parameter Error:\nInternal parameter system malfunction",
22: "Parameter Error:\nParameter set corrupt (Configuration flash empty or defect)\n\nLoad .ini file saved prior to FW update, or Default.ini",
23: "Parameter Error:\nParameter set incompatible with current firmware version\n\nLoad .ini file saved prior to FW update, or Default.ini",
24: "Parameter Error:\nFirmware does not recognize valid device",
25: "Parameter Error:\nInternal parameter system malfunction (Access to a non-existing instance)",
26: "Parameter Error:\nInternal limit system malfunction",
27: "Parameter Error:\nParameter write or read wrong datatype function used",
28: "Parameter Error:\nParameter write value out of range",
29: "Parameter Error:\nParameter save to flash called from interrupt.",
30: "Power Supply Error:\nInput voltage net < Hard Limit",
31: "Power Supply Error:\nInput voltage net > Hard Limit",
32: "Power Supply Error:\nInternal Medium Voltage power net < Hard Limit",
33: "Power Supply Error:\nInternal Medium Voltage power net > Hard Limit",
36: "Power Supply Error:\nInternal 3.3V power net < Hard Limit",
37: "Power Supply Error:\nInternal 3.3V power net > Hard Limit",
50: "Flash Error:\nOn-board flash failure\nWrite Timeout",
51: "Flash Error:\nOn-board flash failure\nErase Timeout",
52: "Flash Error:\nOn-board flash failure\nInvalid Address",
53: "UART Error:\nSend buffer overflow error",
60: "Temperature Error:\nDevice running too hot",
61: "External Hardware Error:\nCommunication error with I/O hardware during factory test",
100: "TEC Power Output Error:\nOvercurrent (positive) at OUT+\n[Channel CHx according to instance]\n\nCurrent > 'Current Error Threshold' [user set]",
101: "TEC Power Output Error:\nOvercurrent (negative) at OUT+\n[Channel CHx according to instance]\n\n|Current| > 'Current Error Threshold' [user set]",
102: "TEC Power Output Error:\nOvercurrent (positive) at OUT-\n[Channel CHx according to instance]\n\nCurrent > 'Current Error Threshold' [user set]",
103: "TEC Power Output Error:\nOvercurrent (negative) at OUT-\n[Channel CHx according to instance]\n\n|Current| > 'Current Error Threshold' [user set]",
104: "TEC Power Output Error:\nOvervoltage at OUT+\n[Channel CHx according to instance]\n\nVoltage > 'Voltage Error Threshold' [user set]",
105: "TEC Power Output Error:\nOvervoltage at OUT-\n[Channel CHx according to instance]\n\nVoltage > 'Voltage Error Threshold' [user set]",
106: "TEC Power Output Error:\nResidual current too high. The Current difference between OUT+ and OUT- is too big.\nLAbs(I+ - I-) > Imax *0.1\n\nCheck output cables for insulation defects",
107: "TEC Power Output Error:\nOverall current monitoring\nFast switch off (reacts within 10 us)",
108: "TEC Power Output Error:\nOutput Stage is in saturation for more than 1ms (by default)\n\nCheck input current is sufficient and Vout not set too close to Vin. Try to reduce the 'Current Limitation' or 'Voltage Limitation' in the Operation tab!",
109: "TEC Power Output Error:\nCurrents through Drivers OUT+ and OUT- too unequal\n[Channel CHx according to instance]\n\nLeak current at output, faulty current detection",
110: "TEC Power Output Error:\nAllowed total output power reached\n\nReduce Output Power",
111: "TEC Power Output Error:\nThe connected load has a too low resistance in compare to the input voltage.\n\nReduce the output current or input voltage.\nExample calculation for I out > (IMAX * 2/3):\nMinR = (VIN * 13%) / (IMAX * 2/3)",
120: "Current Measurement Error:\nOffset during initialization of OUT+ current monitor too high\n[Channel CHx according to instance]",
121: "Current Measurement Error:\nOffset during initialization of OUT+ current monitor too low\n[Channel CHx according to instance]",
122: "Current Measurement Error:\nOffset during initialization of OUT- current monitor too high\n[Channel CHx according to instance]",
123: "Current Measurement Error:\nOffset during initialization of OUT- current monitor too low\n[Channel CHx according to instance]",
130: "Object Temperature Measurement Circuit Initialization failure:\nWrong detected ready signal",
131: "Object Temperature Measurement Circuit failure:\nConfiguration read back failed",
132: "Object Temperature Measurement Error:\nExternal ADC supply voltage out of range\n(-5% < AVDD < +5%)",
133: "Object Temperature Measurement Error:\n23bit ADC raw value below safety margin\n(< 500000 [6%])",
134: "Object Temperature Measurement Error:\n23bit ADC raw value above safety margin\n(> 8350000 [99.5%]).\nOr the measured resistance is > 1MOhm.",
137: "Object Temperature Measurement Error:\nMeasured object temperature < 'Lower Error Threshold' [user set]",
138: "Object Temperature Measurement Error:\nMeasured object temperature > 'Upper Error Threshold' [user set]",
139: "Object Temperature Measurement Error:\nChange in measured object temperature too fast (outpacing thermal inertia)\n\n(Value > 'Max Temp Change' [user set])",
150: "Object Temperature Measurement Circuit failure:\nReady signal is out of synchronization",
151: "Object Temperature Measurement Circuit failure:\nSeveral times the same ADC value read",
152: "Object Temperature Measurement Circuit failure:\nADS Self Check failed\nIRs out of range",
153: "Object Temperature Measurement Circuit failure:\nADS Self Check failed\nVRef out of range",
140: "Sink Temperature Measurement Error:\n12bit ADC raw value below safety margin\n(< 40 [1%])",
141: "Sink Temperature Measurement Error:\n12bit ADC raw value above safety margin\n(> 4050 [99%])",
142: "Sink Temperature Measurement Error:\nMeasured sink temperature < 'Lower Error Threshold' [user set]",
143: "Sink Temperature Measurement Error:\nMeasured sink temperature > 'Upper Error Threshold' [user set]",
144: "Sink Temperature Measurement Error:\nChange in measured sink temperature too fast (outpacing thermal inertia)\n\n(Value > 'Max Temp Change' [user set])",
160: "InterBoard Connection Error:\n[1089-based Master only]\nNo slave device detected via IBC\n\nNo device, no cable?",
161: "InterBoard Connection Error:\n[1089-based Master only]\nDetected slave is not a TEC-1089",
162: "InterBoard Connection Error:\n[1089-based Master only]\nMaster and slave have different FW version",
163: "InterBoard Connection Error:\n[1089-based Master only]\nMaster and slave have different FW build",
164: "InterBoard Connection Error:\n[1089-based Master only]\nMore than 3 Communication errors per parameter set (time out, checksum, address, acknowledge,...)\n\nKeep IBC cable short",
165: "InterBoard Connection Error:\n[1089-based Slave only] (and only visible when slave being monitored):\nSlave is in error mode due to error occurred in master device\n\nPlease diagnose master",
170: "Auto Tune Progress Error:\nLess than 3% of progress advancement in 5/60 minutes",
171: "Auto Tune Error:\nAuto tuning failures at three consecutive attempts due to more than 40% discrepancy in temperature",
172: "Auto Tune Error:\nAuto tuning failures at three consecutive attempts due to more than 40% discrepancy in waveform period",
173: "Auto Tune Error:\nThe Temperature Controller is in its limitation or is not running.\n\nMake sure the Temperature Controller is Running and the Temperature has equalized before you start the Auto Tuning.",
175: "Fan Control Error:\nFan Speed Regulation runs in limitation\nActual Fan Speed < 60% of Nominal Fan Speed\nwhile 12s",
176: "Fan Control Error:\nFan is blocked\nNo rotation while 10s",
180: "Lookup Table Error:\nUnknown Instruction",
181: "Lookup Table Error:\nMisuse of an Instruction",
182: "Temperature Stability not reached in specified time.",
183: "Communication Watchdog",
184: "Display Format Argument String Syntax Error",
}
def Get_COM_DeviceType(self, channel = 1):
return self._read_value(100, MeParType.INT32, channel)
def Get_COM_HardwareVersion(self, channel = 1):
return self._read_value(101, MeParType.INT32, channel)
def Get_COM_SerialNumber(self, channel = 1):
return self._read_value(102, MeParType.INT32, channel)
def Get_COM_FirmwareVersion(self, channel = 1):
return self._read_value(103, MeParType.INT32, channel)
def Get_COM_DeviceStatus(self, channel = 1):
return self._read_value(104, MeParType.INT32, channel)
def Get_COM_ErrorNumber(self, channel = 1):
return self._read_value(105, MeParType.INT32, channel)
def Get_COM_ErrorInstance(self, channel = 1):
return self._read_value(106, MeParType.INT32, channel)
def Get_COM_ErrorParameter(self, channel = 1):
return self._read_value(107, MeParType.INT32, channel)
def Get_COM_ParameterSystemFlashSaveOff(self, channel = 1):
return self._read_value(108, MeParType.INT32, channel)
def Set_COM_ParameterSystemFlashSaveOff(self, value, channel = 1, fire_and_forget = False):
return self._write_value(108, MeParType.INT32, value, channel, fire_and_forget)
def Get_COM_ParameterSystemFlashStatus(self, channel = 1):
return self._read_value(109, MeParType.INT32, channel)
def Get_TEC_ObjectTemperature(self, channel = 1):
return self._read_value(1000, MeParType.FLOAT32, channel)
def Get_TEC_SinkTemperature(self, channel = 1):
return self._read_value(1001, MeParType.FLOAT32, channel)
def Get_TEC_TargetObjectTemperature(self, channel = 1):
return self._read_value(1010, MeParType.FLOAT32, channel)
def Get_TEC_RampNominalObjectTemperature(self, channel = 1):
return self._read_value(1011, MeParType.FLOAT32, channel)
def Get_TEC_ThermalPowerModelCurrent(self, channel = 1):
return self._read_value(1012, MeParType.FLOAT32, channel)
def Get_TEC_ActualOutputCurrent(self, channel = 1):
return self._read_value(1020, MeParType.FLOAT32, channel)
def Get_TEC_ActualOutputVoltage(self, channel = 1):
return self._read_value(1021, MeParType.FLOAT32, channel)
def Get_TEC_PIDLowerLimitation(self, channel = 1):
return self._read_value(1030, MeParType.FLOAT32, channel)
def Get_TEC_PIDUpperLimitation(self, channel = 1):
return self._read_value(1031, MeParType.FLOAT32, channel)
def Get_TEC_PIDControlVariable(self, channel = 1):
return self._read_value(1032, MeParType.FLOAT32, channel)
def Get_TEC_ObjectSensorRawADCValue(self, channel = 1):
return self._read_value(1040, MeParType.INT32, channel)
def Get_TEC_SinkSensorRawADCValue(self, channel = 1):
return self._read_value(1041, MeParType.INT32, channel)
def Get_TEC_ObjectSensorResistance(self, channel = 1):
return self._read_value(1042, MeParType.FLOAT32, channel)
def Get_TEC_SinkSensorResitance(self, channel = 1):
return self._read_value(1043, MeParType.FLOAT32, channel)
def Get_TEC_SinkSensorTemperature(self, channel = 1):
return self._read_value(1044, MeParType.FLOAT32, channel)
def Get_TEC_FirmwareVersion(self, channel = 1):
return self._read_value(1050, MeParType.INT32, channel)
def Get_TEC_FirmwareBuildNumber(self, channel = 1):
return self._read_value(1051, MeParType.INT32, channel)
def Get_TEC_HardwareVersion(self, channel = 1):
return self._read_value(1052, MeParType.INT32, channel)
def Get_TEC_SerialNumber(self, channel = 1):
return self._read_value(1053, MeParType.INT32, channel)
def Get_TEC_DriverInputVoltage(self, channel = 1):
return self._read_value(1060, MeParType.FLOAT32, channel)
def Get_TEC_MedVInternalSupply(self, channel = 1):
return self._read_value(1061, MeParType.FLOAT32, channel)
def Get_TEC_3VInternalSupply(self, channel = 1):
return self._read_value(1062, MeParType.FLOAT32, channel)
def Get_TEC_BasePlateTemperature(self, channel = 1):
return self._read_value(1063, MeParType.FLOAT32, channel)
def Get_TEC_ErrorNumber(self, channel = 1):
return self._read_value(1070, MeParType.INT32, channel)
def Get_TEC_ErrorInstance(self, channel = 1):
return self._read_value(1071, MeParType.INT32, channel)
def Get_TEC_ErrorParameter(self, channel = 1):
return self._read_value(1072, MeParType.INT32, channel)
def Get_TEC_ParallelActualOutputCurrent(self, channel = 1):
return self._read_value(1090, MeParType.FLOAT32, channel)
def Get_TEC_DriverStatus(self, channel = 1):
return self._read_value(1080, MeParType.INT32, channel)
def Get_TEC_ParameterSystemFlashStatus(self, channel = 1):
return self._read_value(1081, MeParType.INT32, channel)
def Get_TEC_FanRelativeCoolingPower(self, channel = 1):
return self._read_value(1100, MeParType.FLOAT32, channel)
def Get_TEC_FanNominalFanSpeed(self, channel = 1):
return self._read_value(1101, MeParType.FLOAT32, channel)
def Get_TEC_FanActualFanSpeed(self, channel = 1):
return self._read_value(1102, MeParType.FLOAT32, channel)
def Get_TEC_FanActualPwmLevel(self, channel = 1):
return self._read_value(1103, MeParType.FLOAT32, channel)
def Get_TEC_TemperatureIsStable(self, channel = 1):
return self._read_value(1200, MeParType.INT32, channel)
def Get_TEC_OutputStageInputSelection(self, channel = 1):
return self._read_value(2000, MeParType.INT32, channel)
def Set_TEC_OutputStageInputSelection(self, value, channel = 1, fire_and_forget = False):
return self._write_value(2000, MeParType.INT32, value, channel, fire_and_forget)
def Get_TEC_OutputStageEnable(self, channel = 1):
return self._read_value(2010, MeParType.INT32, channel)
def Set_TEC_OutputStageEnable(self, value, channel = 1, fire_and_forget = False):
return self._write_value(2010, MeParType.INT32, value, channel, fire_and_forget)
def Get_TEC_SetStaticCurrent(self, channel = 1):
return self._read_value(2020, MeParType.FLOAT32, channel)
def Set_TEC_SetStaticCurrent(self, value, channel = 1, fire_and_forget = False):
return self._write_value(2020, MeParType.FLOAT32, value, channel, fire_and_forget)
def Get_TEC_SetStaticVoltage(self, channel = 1):
return self._read_value(2021, MeParType.FLOAT32, channel)
def Set_TEC_SetStaticVoltage(self, value, channel = 1, fire_and_forget = False):
return self._write_value(2021, MeParType.FLOAT32, value, channel, fire_and_forget)
def Get_TEC_CurrentLimitation(self, channel = 1):
return self._read_value(2030, MeParType.FLOAT32, channel)
def Set_TEC_CurrentLimitation(self, value, channel = 1, fire_and_forget = False):
return self._write_value(2030, MeParType.FLOAT32, value, channel, fire_and_forget)
def Get_TEC_VoltageLimitation(self, channel = 1):
return self._read_value(2031, MeParType.FLOAT32, channel)
def Set_TEC_VoltageLimitation(self, value, channel = 1, fire_and_forget = False):
return self._write_value(2031, MeParType.FLOAT32, value, channel, fire_and_forget)
def Get_TEC_CurrentErrorThreshold(self, channel = 1):
return self._read_value(2032, MeParType.FLOAT32, channel)
def Set_TEC_CurrentErrorThreshold(self, value, channel = 1, fire_and_forget = False):
return self._write_value(2032, MeParType.FLOAT32, value, channel, fire_and_forget)
def Get_TEC_VoltageErrorThreshold(self, channel = 1):
return self._read_value(2033, MeParType.FLOAT32, channel)
def Set_TEC_VoltageErrorThreshold(self, value, channel = 1, fire_and_forget = False):
return self._write_value(2033, MeParType.FLOAT32, value, channel, fire_and_forget)
def Get_TEC_GeneralOperatingMode(self, channel = 1):
return self._read_value(2040, MeParType.INT32, channel)
def Set_TEC_GeneralOperatingMode(self, value, channel = 1, fire_and_forget = False):
return self._write_value(2040, MeParType.INT32, value, channel, fire_and_forget)
def Get_TEC_DeviceAddress(self, channel = 1):
return self._read_value(2051, MeParType.INT32, channel)
def Set_TEC_DeviceAddress(self, value, channel = 1, fire_and_forget = False):
return self._write_value(2051, MeParType.INT32, value, channel, fire_and_forget)
def Get_TEC_RS485CH1BaudRate(self, channel = 1):
return self._read_value(2050, MeParType.INT32, channel)
def Set_TEC_RS485CH1BaudRate(self, value, channel = 1, fire_and_forget = False):
return self._write_value(2050, MeParType.INT32, value, channel, fire_and_forget)
def Get_TEC_RS485CH1ResponseDelay(self, channel = 1):
return self._read_value(2052, MeParType.INT32, channel)
def Set_TEC_RS485CH1ResponseDelay(self, value, channel = 1, fire_and_forget = False):
return self._write_value(2052, MeParType.INT32, value, channel, fire_and_forget)
def Get_TEC_ComWatchDogTimeout(self, channel = 1):
return self._read_value(2060, MeParType.FLOAT32, channel)
def Set_TEC_ComWatchDogTimeout(self, value, channel = 1, fire_and_forget = False):
return self._write_value(2060, MeParType.FLOAT32, value, channel, fire_and_forget)
def Get_TEC_TargetObjectTemp(self, channel = 1):
return self._read_value(3000, MeParType.FLOAT32, channel)
def Set_TEC_TargetObjectTemp(self, value, channel = 1, fire_and_forget = False):
return self._write_value(3000, MeParType.FLOAT32, value, channel, fire_and_forget)
def Get_TEC_CoarseTempRamp(self, channel = 1):
return self._read_value(3003, MeParType.FLOAT32, channel)
def Set_TEC_CoarseTempRamp(self, value, channel = 1, fire_and_forget = False):
return self._write_value(3003, MeParType.FLOAT32, value, channel, fire_and_forget)
def Get_TEC_ProximityWidth(self, channel = 1):
return self._read_value(3002, MeParType.FLOAT32, channel)
def Set_TEC_ProximityWidth(self, value, channel = 1, fire_and_forget = False):
return self._write_value(3002, MeParType.FLOAT32, value, channel, fire_and_forget)
def Get_TEC_Kp(self, channel = 1):
return self._read_value(3010, MeParType.FLOAT32, channel)
def Set_TEC_Kp(self, value, channel = 1, fire_and_forget = False):
return self._write_value(3010, MeParType.FLOAT32, value, channel, fire_and_forget)
def Get_TEC_Ti(self, channel = 1):
return self._read_value(3011, MeParType.FLOAT32, channel)
def Set_TEC_Ti(self, value, channel = 1, fire_and_forget = False):
return self._write_value(3011, MeParType.FLOAT32, value, channel, fire_and_forget)
def Get_TEC_Td(self, channel = 1):
return self._read_value(3012, MeParType.FLOAT32, channel)
def Set_TEC_Td(self, value, channel = 1, fire_and_forget = False):
return self._write_value(3012, MeParType.FLOAT32, value, channel, fire_and_forget)
def Get_TEC_DPartDampPT1(self, channel = 1):
return self._read_value(3013, MeParType.FLOAT32, channel)
def Set_TEC_DPartDampPT1(self, value, channel = 1, fire_and_forget = False):
return self._write_value(3013, MeParType.FLOAT32, value, channel, fire_and_forget)
def Get_TEC_ModelizationMode(self, channel = 1):
return self._read_value(3020, MeParType.INT32, channel)
def Set_TEC_ModelizationMode(self, value, channel = 1, fire_and_forget = False):
return self._write_value(3020, MeParType.INT32, value, channel, fire_and_forget)
def Get_TEC_PeltierMaxCurrent(self, channel = 1):
return self._read_value(3030, MeParType.FLOAT32, channel)
def Set_TEC_PeltierMaxCurrent(self, value, channel = 1, fire_and_forget = False):
return self._write_value(3030, MeParType.FLOAT32, value, channel, fire_and_forget)
def Get_TEC_PeltierMaxVoltage(self, channel = 1):
return self._read_value(3031, MeParType.FLOAT32, channel)
def Set_TEC_PeltierMaxVoltage(self, value, channel = 1, fire_and_forget = False):
return self._write_value(3031, MeParType.FLOAT32, value, channel, fire_and_forget)
def Get_TEC_PeltierCoolingCapacity(self, channel = 1):
return self._read_value(3032, MeParType.FLOAT32, channel)
def Set_TEC_PeltierCoolingCapacity(self, value, channel = 1, fire_and_forget = False):
return self._write_value(3032, MeParType.FLOAT32, value, channel, fire_and_forget)
def Get_TEC_PeltierDeltaTemperature(self, channel = 1):
return self._read_value(3033, MeParType.FLOAT32, channel)
def Set_TEC_PeltierDeltaTemperature(self, value, channel = 1, fire_and_forget = False):
return self._write_value(3033, MeParType.FLOAT32, value, channel, fire_and_forget)
def Get_TEC_PeltierPositiveCurrentIs(self, channel = 1):
return self._read_value(3034, MeParType.INT32, channel)
def Set_TEC_PeltierPositiveCurrentIs(self, value, channel = 1, fire_and_forget = False):
return self._write_value(3034, MeParType.INT32, value, channel, fire_and_forget)
def Get_TEC_ResistorResistance(self, channel = 1):
return self._read_value(3040, MeParType.FLOAT32, channel)
def Set_TEC_ResistorResistance(self, value, channel = 1, fire_and_forget = False):
return self._write_value(3040, MeParType.FLOAT32, value, channel, fire_and_forget)
def Get_TEC_ResistorMaxCurrent(self, channel = 1):
return self._read_value(3041, MeParType.FLOAT32, channel)
def Set_TEC_ResistorMaxCurrent(self, value, channel = 1, fire_and_forget = False):
return self._write_value(3041, MeParType.FLOAT32, value, channel, fire_and_forget)
def Get_TEC_TemperatureOffset(self, channel = 1):
return self._read_value(4001, MeParType.FLOAT32, channel)
def Set_TEC_TemperatureOffset(self, value, channel = 1, fire_and_forget = False):
return self._write_value(4001, MeParType.FLOAT32, value, channel, fire_and_forget)
def Get_TEC_TemperatureGain(self, channel = 1):
return self._read_value(4002, MeParType.FLOAT32, channel)
def Set_TEC_TemperatureGain(self, value, channel = 1, fire_and_forget = False):
return self._write_value(4002, MeParType.FLOAT32, value, channel, fire_and_forget)
def Get_TEC_LowerErrorThreshold(self, channel = 1):
return self._read_value(4010, MeParType.FLOAT32, channel)
def Set_TEC_LowerErrorThreshold(self, value, channel = 1, fire_and_forget = False):
return self._write_value(4010, MeParType.FLOAT32, value, channel, fire_and_forget)
def Get_TEC_UpperErrorThreshold(self, channel = 1):
return self._read_value(4011, MeParType.FLOAT32, channel)
def Set_TEC_UpperErrorThreshold(self, value, channel = 1, fire_and_forget = False):
return self._write_value(4011, MeParType.FLOAT32, value, channel, fire_and_forget)
def Get_TEC_MaxTempChange(self, channel = 1):
return self._read_value(4012, MeParType.FLOAT32, channel)
def Set_TEC_MaxTempChange(self, value, channel = 1, fire_and_forget = False):
return self._write_value(4012, MeParType.FLOAT32, value, channel, fire_and_forget)
def Get_TEC_NTCLowerPointTemperature(self, channel = 1):
return self._read_value(4020, MeParType.FLOAT32, channel)
def Set_TEC_NTCLowerPointTemperature(self, value, channel = 1, fire_and_forget = False):
return self._write_value(4020, MeParType.FLOAT32, value, channel, fire_and_forget)
def Get_TEC_NTCLowerPointResistance(self, channel = 1):
return self._read_value(4021, MeParType.FLOAT32, channel)
def Set_TEC_NTCLowerPointResistance(self, value, channel = 1, fire_and_forget = False):
return self._write_value(4021, MeParType.FLOAT32, value, channel, fire_and_forget)
def Get_TEC_NTCMiddlePointTemperature(self, channel = 1):
return self._read_value(4022, MeParType.FLOAT32, channel)
def Set_TEC_NTCMiddlePointTemperature(self, value, channel = 1, fire_and_forget = False):
return self._write_value(4022, MeParType.FLOAT32, value, channel, fire_and_forget)
def Get_TEC_NTCMiddlePointResistance(self, channel = 1):
return self._read_value(4023, MeParType.FLOAT32, channel)
def Set_TEC_NTCMiddlePointResistance(self, value, channel = 1, fire_and_forget = False):
return self._write_value(4023, MeParType.FLOAT32, value, channel, fire_and_forget)
def Get_TEC_NTCUpperPointTemperature(self, channel = 1):
return self._read_value(4024, MeParType.FLOAT32, channel)
def Set_TEC_NTCUpperPointTemperature(self, value, channel = 1, fire_and_forget = False):
return self._write_value(4024, MeParType.FLOAT32, value, channel, fire_and_forget)
def Get_TEC_NTCUpperPointResistance(self, channel = 1):
return self._read_value(4025, MeParType.FLOAT32, channel)
def Set_TEC_NTCUpperPointResistance(self, value, channel = 1, fire_and_forget = False):
return self._write_value(4025, MeParType.FLOAT32, value, channel, fire_and_forget)
def Get_TEC_StabilityTemperatureWindow(self, channel = 1):
return self._read_value(4040, MeParType.FLOAT32, channel)
def Set_TEC_StabilityTemperatureWindow(self, value, channel = 1, fire_and_forget = False):
return self._write_value(4040, MeParType.FLOAT32, value, channel, fire_and_forget)
def Get_TEC_StabilityMinTimeInWindow(self, channel = 1):
return self._read_value(4041, MeParType.FLOAT32, channel)
def Set_TEC_StabilityMinTimeInWindow(self, value, channel = 1, fire_and_forget = False):
return self._write_value(4041, MeParType.FLOAT32, value, channel, fire_and_forget)
def Get_TEC_StabilityMaxStabiTime(self, channel = 1):
return self._read_value(4042, MeParType.FLOAT32, channel)
def Set_TEC_StabilityMaxStabiTime(self, value, channel = 1, fire_and_forget = False):
return self._write_value(4042, MeParType.FLOAT32, value, channel, fire_and_forget)
def Get_TEC_MeasLowestResistance(self, channel = 1):
return self._read_value(4030, MeParType.FLOAT32, channel)
def Get_TEC_MeasHighestResistance(self, channel = 1):
return self._read_value(4031, MeParType.FLOAT32, channel)
def Get_TEC_MeasTempAtLowestResistance(self, channel = 1):
return self._read_value(4032, MeParType.FLOAT32, channel)
def Get_TEC_MeasTempAtHighestResistance(self, channel = 1):
return self._read_value(4033, MeParType.FLOAT32, channel)
def Get_TEC_TemperatureOffset(self, channel = 1):
return self._read_value(5001, MeParType.FLOAT32, channel)
def Set_TEC_TemperatureOffset(self, value, channel = 1, fire_and_forget = False):
return self._write_value(5001, MeParType.FLOAT32, value, channel, fire_and_forget)
def Get_TEC_TemperatureGain(self, channel = 1):
return self._read_value(5002, MeParType.FLOAT32, channel)
def Set_TEC_TemperatureGain(self, value, channel = 1, fire_and_forget = False):
return self._write_value(5002, MeParType.FLOAT32, value, channel, fire_and_forget)
def Get_TEC_LowerErrorThreshold(self, channel = 1):
return self._read_value(5010, MeParType.FLOAT32, channel)
def Set_TEC_LowerErrorThreshold(self, value, channel = 1, fire_and_forget = False):
return self._write_value(5010, MeParType.FLOAT32, value, channel, fire_and_forget)
def Get_TEC_UpperErrorThreshold(self, channel = 1):
return self._read_value(5011, MeParType.FLOAT32, channel)
def Set_TEC_UpperErrorThreshold(self, value, channel = 1, fire_and_forget = False):
return self._write_value(5011, MeParType.FLOAT32, value, channel, fire_and_forget)
def Get_TEC_MaxTempChange(self, channel = 1):
return self._read_value(5012, MeParType.FLOAT32, channel)
def Set_TEC_MaxTempChange(self, value, channel = 1, fire_and_forget = False):
return self._write_value(5012, MeParType.FLOAT32, value, channel, fire_and_forget)
def Get_TEC_NTCLowerPointTemperature(self, channel = 1):
return self._read_value(5020, MeParType.FLOAT32, channel)
def Set_TEC_NTCLowerPointTemperature(self, value, channel = 1, fire_and_forget = False):
return self._write_value(5020, MeParType.FLOAT32, value, channel, fire_and_forget)
def Get_TEC_NTCLowerPointResistance(self, channel = 1):
return self._read_value(5021, MeParType.FLOAT32, channel)
def Set_TEC_NTCLowerPointResistance(self, value, channel = 1, fire_and_forget = False):
return self._write_value(5021, MeParType.FLOAT32, value, channel, fire_and_forget)
def Get_TEC_NTCMiddlePointTemperature(self, channel = 1):
return self._read_value(5022, MeParType.FLOAT32, channel)
def Set_TEC_NTCMiddlePointTemperature(self, value, channel = 1, fire_and_forget = False):
return self._write_value(5022, MeParType.FLOAT32, value, channel, fire_and_forget)
def Get_TEC_NTCMiddlePointResistance(self, channel = 1):
return self._read_value(5023, MeParType.FLOAT32, channel)
def Set_TEC_NTCMiddlePointResistance(self, value, channel = 1, fire_and_forget = False):
return self._write_value(5023, MeParType.FLOAT32, value, channel, fire_and_forget)
def Get_TEC_NTCUpperPointTemperature(self, channel = 1):
return self._read_value(5024, MeParType.FLOAT32, channel)
def Set_TEC_NTCUpperPointTemperature(self, value, channel = 1, fire_and_forget = False):
return self._write_value(5024, MeParType.FLOAT32, value, channel, fire_and_forget)
def Get_TEC_NTCUpperPointResistance(self, channel = 1):
return self._read_value(5025, MeParType.FLOAT32, channel)
def Set_TEC_NTCUpperPointResistance(self, value, channel = 1, fire_and_forget = False):
return self._write_value(5025, MeParType.FLOAT32, value, channel, fire_and_forget)
def Get_TEC_SinkTemperatureSelection(self, channel = 1):
return self._read_value(5030, MeParType.INT32, channel)
def Set_TEC_SinkTemperatureSelection(self, value, channel = 1, fire_and_forget = False):
return self._write_value(5030, MeParType.INT32, value, channel, fire_and_forget)
def Get_TEC_FixedTemperature(self, channel = 1):
return self._read_value(5031, MeParType.FLOAT32, channel)
def Set_TEC_FixedTemperature(self, value, channel = 1, fire_and_forget = False):
return self._write_value(5031, MeParType.FLOAT32, value, channel, fire_and_forget)
def Get_TEC_MeasLowestResistance(self, channel = 1):
return self._read_value(5040, MeParType.FLOAT32, channel)
def Get_TEC_MeasHighestResistance(self, channel = 1):
return self._read_value(5041, MeParType.FLOAT32, channel)
def Get_TEC_MeasTempAtLowestResistance(self, channel = 1):
return self._read_value(5042, MeParType.FLOAT32, channel)
def Get_TEC_MeasTempAtHighestResistance(self, channel = 1):
return self._read_value(5043, MeParType.FLOAT32, channel)
def Get_TEC_ObjMeasPGAGain(self, channel = 1):
return self._read_value(6000, MeParType.INT32, channel)
def Set_TEC_ObjMeasPGAGain(self, value, channel = 1, fire_and_forget = False):
return self._write_value(6000, MeParType.INT32, value, channel, fire_and_forget)
def Get_TEC_ObjMeasCurrentSource(self, channel = 1):
return self._read_value(6001, MeParType.INT32, channel)
def Set_TEC_ObjMeasCurrentSource(self, value, channel = 1, fire_and_forget = False):
return self._write_value(6001, MeParType.INT32, value, channel, fire_and_forget)
def Get_TEC_ObjMeasADCRs(self, channel = 1):
return self._read_value(6002, MeParType.FLOAT32, channel)
def Set_TEC_ObjMeasADCRs(self, value, channel = 1, fire_and_forget = False):
return self._write_value(6002, MeParType.FLOAT32, value, channel, fire_and_forget)
def Get_TEC_ObjMeasADCCalibOffset(self, channel = 1):
return self._read_value(6003, MeParType.FLOAT32, channel)
def Set_TEC_ObjMeasADCCalibOffset(self, value, channel = 1, fire_and_forget = False):
return self._write_value(6003, MeParType.FLOAT32, value, channel, fire_and_forget)
def Get_TEC_ObjMeasADCCalibGain(self, channel = 1):
return self._read_value(6004, MeParType.FLOAT32, channel)
def Set_TEC_ObjMeasADCCalibGain(self, value, channel = 1, fire_and_forget = False):
return self._write_value(6004, MeParType.FLOAT32, value, channel, fire_and_forget)
def Get_TEC_ObjMeasSensorTypeSelection(self, channel = 1):
return self._read_value(6005, MeParType.INT32, channel)
def Set_TEC_ObjMeasSensorTypeSelection(self, value, channel = 1, fire_and_forget = False):
return self._write_value(6005, MeParType.INT32, value, channel, fire_and_forget)
def Get_TEC_SinMeasADCRv(self, channel = 1):
return self._read_value(6010, MeParType.FLOAT32, channel)
def Set_TEC_SinMeasADCRv(self, value, channel = 1, fire_and_forget = False):
return self._write_value(6010, MeParType.FLOAT32, value, channel, fire_and_forget)
def Get_TEC_SinMeasADCVps(self, channel = 1):
return self._read_value(6013, MeParType.FLOAT32, channel)
def Set_TEC_SinMeasADCVps(self, value, channel = 1, fire_and_forget = False):
return self._write_value(6013, MeParType.FLOAT32, value, channel, fire_and_forget)
def Get_TEC_SinMeasADCCalibOffset(self, channel = 1):
return self._read_value(6011, MeParType.FLOAT32, channel)
def Set_TEC_SinMeasADCCalibOffset(self, value, channel = 1, fire_and_forget = False):
return self._write_value(6011, MeParType.FLOAT32, value, channel, fire_and_forget)
def Get_TEC_SinMeasADCCalibGain(self, channel = 1):
return self._read_value(6012, MeParType.FLOAT32, channel)
def Set_TEC_SinMeasADCCalibGain(self, value, channel = 1, fire_and_forget = False):
return self._write_value(6012, MeParType.FLOAT32, value, channel, fire_and_forget)
def Get_TEC_DisplayType(self, channel = 1):
return self._read_value(6020, MeParType.INT32, channel)
def Set_TEC_DisplayType(self, value, channel = 1, fire_and_forget = False):
return self._write_value(6020, MeParType.INT32, value, channel, fire_and_forget)
def Get_TEC_AlternativeMode(self, channel = 1):
return self._read_value(6023, MeParType.INT32, channel)
def Set_TEC_AlternativeMode(self, value, channel = 1, fire_and_forget = False):
return self._write_value(6023, MeParType.INT32, value, channel, fire_and_forget)
def Get_TEC_DisplayLineDefText(self, channel = 1):
return self._read_value(6024, MeParType.INT32, channel)
def Set_TEC_DisplayLineDefText(self, value, channel = 1, fire_and_forget = False):
return self._write_value(6024, MeParType.INT32, value, channel, fire_and_forget)
def Get_TEC_DisplayLineAltText(self, channel = 1):
return self._read_value(6025, MeParType.INT32, channel)
def Set_TEC_DisplayLineAltText(self, value, channel = 1, fire_and_forget = False):
return self._write_value(6025, MeParType.INT32, value, channel, fire_and_forget)
def Get_TEC_DisplayLineAltMode(self, channel = 1):
return self._read_value(6026, MeParType.INT32, channel)
def Set_TEC_DisplayLineAltMode(self, value, channel = 1, fire_and_forget = False):
return self._write_value(6026, MeParType.INT32, value, channel, fire_and_forget)
def Get_TEC_PbcFunction(self, channel = 1):
return self._read_value(6100, MeParType.INT32, channel)
def Set_TEC_PbcFunction(self, value, channel = 1, fire_and_forget = False):
return self._write_value(6100, MeParType.INT32, value, channel, fire_and_forget)
def Get_TEC_ChangeButtonLowTemperature(self, channel = 1):
return self._read_value(6110, MeParType.FLOAT32, channel)
def Set_TEC_ChangeButtonLowTemperature(self, value, channel = 1, fire_and_forget = False):
return self._write_value(6110, MeParType.FLOAT32, value, channel, fire_and_forget)
def Get_TEC_ChangeButtonHighTemperature(self, channel = 1):
return self._read_value(6111, MeParType.FLOAT32, channel)
def Set_TEC_ChangeButtonHighTemperature(self, value, channel = 1, fire_and_forget = False):
return self._write_value(6111, MeParType.FLOAT32, value, channel, fire_and_forget)
def Get_TEC_ChangeButtonStepSize(self, channel = 1):
return self._read_value(6112, MeParType.FLOAT32, channel)
def Set_TEC_ChangeButtonStepSize(self, value, channel = 1, fire_and_forget = False):
return self._write_value(6112, MeParType.FLOAT32, value, channel, fire_and_forget)
def Get_TEC_FanControlEnable(self, channel = 1):
return self._read_value(6200, MeParType.INT32, channel)
def Set_TEC_FanControlEnable(self, value, channel = 1, fire_and_forget = False):
return self._write_value(6200, MeParType.INT32, value, channel, fire_and_forget)
def Get_TEC_FanActualTempSource(self, channel = 1):
return self._read_value(6210, MeParType.INT32, channel)
def Set_TEC_FanActualTempSource(self, value, channel = 1, fire_and_forget = False):
return self._write_value(6210, MeParType.INT32, value, channel, fire_and_forget)
def Get_TEC_FanTargetTemp(self, channel = 1):
return self._read_value(6211, MeParType.FLOAT32, channel)
def Set_TEC_FanTargetTemp(self, value, channel = 1, fire_and_forget = False):
return self._write_value(6211, MeParType.FLOAT32, value, channel, fire_and_forget)
def Get_TEC_FanTempKp(self, channel = 1):
return self._read_value(6212, MeParType.FLOAT32, channel)
def Set_TEC_FanTempKp(self, value, channel = 1, fire_and_forget = False):
return self._write_value(6212, MeParType.FLOAT32, value, channel, fire_and_forget)
def Get_TEC_FanTempTi(self, channel = 1):
return self._read_value(6213, MeParType.FLOAT32, channel)
def Set_TEC_FanTempTi(self, value, channel = 1, fire_and_forget = False):
return self._write_value(6213, MeParType.FLOAT32, value, channel, fire_and_forget)
def Get_TEC_FanTempTd(self, channel = 1):
return self._read_value(6214, MeParType.FLOAT32, channel)
def Set_TEC_FanTempTd(self, value, channel = 1, fire_and_forget = False):
return self._write_value(6214, MeParType.FLOAT32, value, channel, fire_and_forget)
def Get_TEC_FanSpeedMin(self, channel = 1):
return self._read_value(6220, MeParType.FLOAT32, channel)
def Set_TEC_FanSpeedMin(self, value, channel = 1, fire_and_forget = False):
return self._write_value(6220, MeParType.FLOAT32, value, channel, fire_and_forget)
def Get_TEC_FanSpeedMax(self, channel = 1):
return self._read_value(6221, MeParType.FLOAT32, channel)
def Set_TEC_FanSpeedMax(self, value, channel = 1, fire_and_forget = False):
return self._write_value(6221, MeParType.FLOAT32, value, channel, fire_and_forget)
def Get_TEC_FanSpeedKp(self, channel = 1):
return self._read_value(6222, MeParType.FLOAT32, channel)
def Set_TEC_FanSpeedKp(self, value, channel = 1, fire_and_forget = False):
return self._write_value(6222, MeParType.FLOAT32, value, channel, fire_and_forget)
def Get_TEC_FanSpeedTi(self, channel = 1):
return self._read_value(6223, MeParType.FLOAT32, channel)
def Set_TEC_FanSpeedTi(self, value, channel = 1, fire_and_forget = False):
return self._write_value(6223, MeParType.FLOAT32, value, channel, fire_and_forget)
def Get_TEC_FanSpeedTd(self, channel = 1):
return self._read_value(6224, MeParType.FLOAT32, channel)
def Set_TEC_FanSpeedTd(self, value, channel = 1, fire_and_forget = False):
return self._write_value(6224, MeParType.FLOAT32, value, channel, fire_and_forget)
def Get_TEC_FanSpeedBypass(self, channel = 1):
return self._read_value(6225, MeParType.INT32, channel)
def Set_TEC_FanSpeedBypass(self, value, channel = 1, fire_and_forget = False):
return self._write_value(6225, MeParType.INT32, value, channel, fire_and_forget)
def Get_TEC_PwmFrequency(self, channel = 1):
return self._read_value(6230, MeParType.INT32, channel)
def Set_TEC_PwmFrequency(self, value, channel = 1, fire_and_forget = False):
return self._write_value(6230, MeParType.INT32, value, channel, fire_and_forget)
def Get_TEC_MiscActObjectTempSource(self, channel = 1):
return self._read_value(6300, MeParType.INT32, channel)
def Set_TEC_MiscActObjectTempSource(self, value, channel = 1, fire_and_forget = False):
return self._write_value(6300, MeParType.INT32, value, channel, fire_and_forget)
def Get_TEC_MiscDelayTillReset(self, channel = 1):
return self._read_value(6310, MeParType.FLOAT32, channel)
def Set_TEC_MiscDelayTillReset(self, value, channel = 1, fire_and_forget = False):
return self._write_value(6310, MeParType.FLOAT32, value, channel, fire_and_forget)
def Get_TEC_MiscError108Delay(self, channel = 1):
return self._read_value(6320, MeParType.INT32, channel)
def Set_TEC_MiscError108Delay(self, value, channel = 1, fire_and_forget = False):
return self._write_value(6320, MeParType.INT32, value, channel, fire_and_forget)
def Get_TEC_LiveEnable(self, channel = 1):
return self._read_value(50000, MeParType.INT32, channel)
def Set_TEC_LiveEnable(self, value, channel = 1, fire_and_forget = False):
return self._write_value(50000, MeParType.INT32, value, channel, fire_and_forget)
def Get_TEC_LiveSetCurrent(self, channel = 1):
return self._read_value(50001, MeParType.FLOAT32, channel)
def Set_TEC_LiveSetCurrent(self, value, channel = 1, fire_and_forget = False):
return self._write_value(50001, MeParType.FLOAT32, value, channel, fire_and_forget)
def Get_TEC_LiveSetVoltage(self, channel = 1):
return self._read_value(50002, MeParType.FLOAT32, channel)
def Set_TEC_LiveSetVoltage(self, value, channel = 1, fire_and_forget = False):
return self._write_value(50002, MeParType.FLOAT32, value, channel, fire_and_forget)
def Get_TEC_SineRampStartPoint(self, channel = 1):
return self._read_value(50010, MeParType.INT32, channel)
def Set_TEC_SineRampStartPoint(self, value, channel = 1, fire_and_forget = False):
return self._write_value(50010, MeParType.INT32, value, channel, fire_and_forget)
def Get_TEC_ObjectTargetTempSourceSelection(self, channel = 1):
return self._read_value(50011, MeParType.INT32, channel)
def Set_TEC_ObjectTargetTempSourceSelection(self, value, channel = 1, fire_and_forget = False):
return self._write_value(50011, MeParType.INT32, value, channel, fire_and_forget)
def Get_TEC_ObjectTargetTemperature(self, channel = 1):
return self._read_value(50012, MeParType.FLOAT32, channel)
def Set_TEC_ObjectTargetTemperature(self, value, channel = 1, fire_and_forget = False):
return self._write_value(50012, MeParType.FLOAT32, value, channel, fire_and_forget)
def Get_TEC_AtmAutoTuningStart(self, channel = 1):
return self._read_value(51000, MeParType.INT32, channel)
def Set_TEC_AtmAutoTuningStart(self, value, channel = 1, fire_and_forget = False):
return self._write_value(51000, MeParType.INT32, value, channel, fire_and_forget)
def Get_TEC_AtmAutoTuningCancel(self, channel = 1):
return self._read_value(51001, MeParType.INT32, channel)
def Set_TEC_AtmAutoTuningCancel(self, value, channel = 1, fire_and_forget = False):
return self._write_value(51001, MeParType.INT32, value, channel, fire_and_forget)
def Get_TEC_AtmThermalModelSpeed(self, channel = 1):
return self._read_value(51002, MeParType.INT32, channel)
def Set_TEC_AtmThermalModelSpeed(self, value, channel = 1, fire_and_forget = False):
return self._write_value(51002, MeParType.INT32, value, channel, fire_and_forget)
def Get_TEC_AtmTuningParameter2A(self, channel = 1):
return self._read_value(51010, MeParType.FLOAT32, channel)
def Get_TEC_AtmTuningParameter2D(self, channel = 1):
return self._read_value(51011, MeParType.FLOAT32, channel)
def Get_TEC_AtmTuningParameterKu(self, channel = 1):
return self._read_value(51012, MeParType.FLOAT32, channel)
def Get_TEC_AtmTuningParameterTu(self, channel = 1):
return self._read_value(51013, MeParType.FLOAT32, channel)
def Get_TEC_AtmPIDParameterKp(self, channel = 1):
return self._read_value(51014, MeParType.FLOAT32, channel)
def Get_TEC_AtmPIDParameterTi(self, channel = 1):
return self._read_value(51015, MeParType.FLOAT32, channel)
def Get_TEC_AtmPIDParameterTd(self, channel = 1):
return self._read_value(51016, MeParType.FLOAT32, channel)
def Get_TEC_AtmSlowPIParameterKp(self, channel = 1):
return self._read_value(51022, MeParType.FLOAT32, channel)
def Get_TEC_AtmSlowPIParameterTi(self, channel = 1):
return self._read_value(51023, MeParType.FLOAT32, channel)
def Get_TEC_AtmPIDDPartDamping(self, channel = 1):
return self._read_value(51024, MeParType.FLOAT32, channel)
def Get_TEC_AtmCoarseTempRamp(self, channel = 1):
return self._read_value(51017, MeParType.FLOAT32, channel)
def Get_TEC_AtmProximityWidth(self, channel = 1):
return self._read_value(51018, MeParType.FLOAT32, channel)
def Get_TEC_AtmTuningStatus(self, channel = 1):
return self._read_value(51020, MeParType.INT32, channel)
def Get_TEC_AtmTuningProgress(self, channel = 1):
return self._read_value(51021, MeParType.FLOAT32, channel)
def Get_TEC_LutTableStart(self, channel = 1):
return self._read_value(52000, MeParType.INT32, channel)
def Set_TEC_LutTableStart(self, value, channel = 1, fire_and_forget = False):
return self._write_value(52000, MeParType.INT32, value, channel, fire_and_forget)
def Get_TEC_LutTableStop(self, channel = 1):
return self._read_value(52001, MeParType.INT32, channel)
def Set_TEC_LutTableStop(self, value, channel = 1, fire_and_forget = False):
return self._write_value(52001, MeParType.INT32, value, channel, fire_and_forget)
def Get_TEC_LutTableStatus(self, channel = 1):
return self._read_value(52002, MeParType.INT32, channel)
def Set_TEC_LutTableStatus(self, value, channel = 1, fire_and_forget = False):
return self._write_value(52002, MeParType.INT32, value, channel, fire_and_forget)
def Get_TEC_LutCurrentTableLine(self, channel = 1):
return self._read_value(52003, MeParType.INT32, channel)
def Set_TEC_LutCurrentTableLine(self, value, channel = 1, fire_and_forget = False):
return self._write_value(52003, MeParType.INT32, value, channel, fire_and_forget)
def Get_TEC_LutTableIDSelection(self, channel = 1):
return self._read_value(52010, MeParType.INT32, channel)
def Set_TEC_LutTableIDSelection(self, value, channel = 1, fire_and_forget = False):
return self._write_value(52010, MeParType.INT32, value, channel, fire_and_forget)
def Get_TEC_LutNrOfRepetitions(self, channel = 1):
return self._read_value(52012, MeParType.INT32, channel)
def Set_TEC_LutNrOfRepetitions(self, value, channel = 1, fire_and_forget = False):
return self._write_value(52012, MeParType.INT32, value, channel, fire_and_forget)
def Get_TEC_PbcEnableFunction(self, channel = 1):
return self._read_value(52100, MeParType.INT32, channel)
def Set_TEC_PbcEnableFunction(self, value, channel = 1, fire_and_forget = False):
return self._write_value(52100, MeParType.INT32, value, channel, fire_and_forget)
def Get_TEC_PbcSetOutputToPushPull(self, channel = 1):
return self._read_value(52101, MeParType.INT32, channel)
def Set_TEC_PbcSetOutputToPushPull(self, value, channel = 1, fire_and_forget = False):
return self._write_value(52101, MeParType.INT32, value, channel, fire_and_forget)
def Get_TEC_PbcSetOutputStates(self, channel = 1):
return self._read_value(52102, MeParType.INT32, channel)
def Set_TEC_PbcSetOutputStates(self, value, channel = 1, fire_and_forget = False):
return self._write_value(52102, MeParType.INT32, value, channel, fire_and_forget)
def Get_TEC_PbcReadInputStates(self, channel = 1):
return self._read_value(52103, MeParType.INT32, channel)
def Set_TEC_PbcReadInputStates(self, value, channel = 1, fire_and_forget = False):
return self._write_value(52103, MeParType.INT32, value, channel, fire_and_forget)
def Get_TEC_ExternalActualObjectTemperature(self, channel = 1):
return self._read_value(52200, MeParType.FLOAT32, channel)
def Set_TEC_ExternalActualObjectTemperature(self, value, channel = 1, fire_and_forget = False):
return self._write_value(52200, MeParType.FLOAT32, value, channel, fire_and_forget)
| 70.637765
| 258
| 0.708819
| 9,066
| 73,322
| 5.536289
| 0.08405
| 0.094358
| 0.057499
| 0.063118
| 0.765301
| 0.75528
| 0.654965
| 0.566026
| 0.542875
| 0.538572
| 0
| 0.056167
| 0.154019
| 73,322
| 1,037
| 259
| 70.705882
| 0.753003
| 0.000286
| 0
| 0.065574
| 1
| 0.030445
| 0.236825
| 0.018281
| 0
| 0
| 0
| 0
| 0
| 1
| 0.338407
| false
| 0.003513
| 0.002342
| 0.336066
| 0.683841
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 1
| 0
|
0
| 5
|
d5158cadc8b7ab16f4751985e99b1ca121f82a5d
| 4,688
|
py
|
Python
|
micromagnetictests/calculatortests/cubicanisotropy.py
|
ubermag/micromagnetictests
|
60ad592b146f1ca5c35c897b64f281d62fa77699
|
[
"BSD-3-Clause"
] | 2
|
2021-05-27T05:00:39.000Z
|
2022-01-16T15:01:39.000Z
|
micromagnetictests/calculatortests/cubicanisotropy.py
|
ubermag/micromagnetictests
|
60ad592b146f1ca5c35c897b64f281d62fa77699
|
[
"BSD-3-Clause"
] | 6
|
2021-06-25T09:42:35.000Z
|
2022-03-15T00:09:10.000Z
|
micromagnetictests/calculatortests/cubicanisotropy.py
|
ubermag/micromagnetictests
|
60ad592b146f1ca5c35c897b64f281d62fa77699
|
[
"BSD-3-Clause"
] | 1
|
2021-07-04T15:39:10.000Z
|
2021-07-04T15:39:10.000Z
|
import pytest
import numpy as np
import discretisedfield as df
import micromagneticmodel as mm
class TestCubicAnisotropy:
@pytest.fixture(autouse=True)
def _setup_calculator(self, calculator):
self.calculator = calculator
def setup(self):
p1 = (-7e-9, 0, 0)
p2 = (7e-9, 5e-9, 4e-9)
self.region = df.Region(p1=p1, p2=p2)
self.cell = (1e-9, 1e-9, 2e-9)
self.subregions = {'r1': df.Region(p1=(-7e-9, 0, 0),
p2=(0, 5e-9, 4e-9)),
'r2': df.Region(p1=(0, 0, 0),
p2=(7e-9, 5e-9, 4e-9))}
def test_scalar_vector_vector(self):
name = 'cubicanisotropy_scalar_vector_vector'
mesh = df.Mesh(region=self.region, cell=self.cell)
K = 1e5
u1 = (0, 0, 1)
u2 = (0, 1, 0)
Ms = 1e6
system = mm.System(name=name)
system.energy = mm.CubicAnisotropy(K=K, u1=u1, u2=u2)
def m_fun(pos):
x, y, z = pos
if x <= 0:
return (0, 0.2, 1)
else:
return (0, 1, 0.2)
system.m = df.Field(mesh, dim=3, value=m_fun, norm=Ms)
md = self.calculator.MinDriver()
md.drive(system)
value = system.m((-1e-9, 2e-9, 2e-9))
assert np.linalg.norm(np.subtract(value, (0, 0, Ms))) < 1e-3
value = system.m((1e-9, 2e-9, 2e-9))
assert np.linalg.norm(np.subtract(value, (0, Ms, 0))) < 1e-3
self.calculator.delete(system)
def test_field_vector_vector(self):
name = 'cubicanisotropy_field_vector_vector'
mesh = df.Mesh(region=self.region, cell=self.cell)
def K_fun(pos):
x, y, z = pos
if x <= 0:
return 0
else:
return 1e5
K = df.Field(mesh, dim=1, value=K_fun)
u1 = (0, 0, 1)
u2 = (0, 1, 0)
Ms = 1e6
system = mm.System(name=name)
system.energy = mm.CubicAnisotropy(K=K, u1=u1, u2=u2)
system.m = df.Field(mesh, dim=3, value=(0, 0.3, 1), norm=Ms)
md = self.calculator.MinDriver()
md.drive(system)
value = system.m((-2e-9, 1e-9, 1e-9))
assert np.linalg.norm(np.cross(value, (0, 0.3*Ms, Ms))) < 1e-3
value = system.m((2e-9, 2e-9, 2e-9))
assert np.linalg.norm(np.subtract(value, (0, 0, Ms))) < 1e-3
self.calculator.delete(system)
def test_field_field_field(self):
name = 'cubicanisotropy_field_field_field'
mesh = df.Mesh(region=self.region, cell=self.cell)
def K_fun(pos):
x, y, z = pos
if -2e-9 <= x <= 2e-9:
return 0
else:
return 1e5
def u1_fun(pos):
x, y, z = pos
if x <= 0:
return (0, 1, 0)
else:
return (0, 0, 1)
def u2_fun(pos):
x, y, z = pos
if x <= 0:
return (0, 0, 1)
else:
return (0, 1, 0)
K = df.Field(mesh, dim=1, value=K_fun)
u1 = df.Field(mesh, dim=3, value=u1_fun)
u2 = df.Field(mesh, dim=3, value=u2_fun)
Ms = 1e6
system = mm.System(name=name)
system.energy = mm.CubicAnisotropy(K=K, u1=u1, u2=u2)
system.m = df.Field(mesh, dim=3, value=(0, 0.3, 1), norm=Ms)
md = self.calculator.MinDriver()
md.drive(system)
value = system.m((0, 0, 0))
assert np.linalg.norm(np.cross(value, (0, 0.3*Ms, Ms))) < 1e-3
value = system.m((3e-9, 2e-9, 2e-9))
assert np.linalg.norm(np.subtract(value, (0, 0, Ms))) < 1e-3
value = system.m((-3e-9, 2e-9, 2e-9))
assert np.linalg.norm(np.subtract(value, (0, 0, Ms))) < 1e-3
self.calculator.delete(system)
def test_dict_vector_vector(self):
name = 'cubicanisotropy_dict_vector_vector'
mesh = df.Mesh(region=self.region, cell=self.cell,
subregions=self.subregions)
K = {'r1': 0, 'r2': 1e5}
u1 = (0, 0, 1)
u2 = (0, 1, 0)
Ms = 1e6
system = mm.System(name=name)
system.energy = mm.CubicAnisotropy(K=K, u1=u1, u2=u2)
system.m = df.Field(mesh, dim=3, value=(0, 0.3, 1), norm=Ms)
md = self.calculator.MinDriver()
md.drive(system)
value = system.m((-2e-9, 1e-9, 1e-9))
assert np.linalg.norm(np.cross(value, (0, 0.3*Ms, Ms))) < 1e-3
value = system.m((2e-9, 2e-9, 2e-9))
assert np.linalg.norm(np.subtract(value, (0, 0, Ms))) < 1e-3
self.calculator.delete(system)
| 29.118012
| 70
| 0.503626
| 694
| 4,688
| 3.350144
| 0.103746
| 0.019785
| 0.022366
| 0.069677
| 0.804301
| 0.744946
| 0.709677
| 0.709677
| 0.698065
| 0.667097
| 0
| 0.081653
| 0.344283
| 4,688
| 160
| 71
| 29.3
| 0.674691
| 0
| 0
| 0.627119
| 0
| 0
| 0.031143
| 0.029437
| 0
| 0
| 0
| 0
| 0.076271
| 1
| 0.09322
| false
| 0
| 0.033898
| 0
| 0.220339
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 1
| 1
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
1d228d25944ae9779b427d146fda27fec786203c
| 649
|
py
|
Python
|
debug-scraper.py
|
waldosax/PlexSports
|
404058921e4be02b93ad155bdaef768ff917620e
|
[
"MIT"
] | 5
|
2021-07-09T01:05:47.000Z
|
2021-09-06T02:23:12.000Z
|
debug-scraper.py
|
waldosax/PlexSports
|
404058921e4be02b93ad155bdaef768ff917620e
|
[
"MIT"
] | 1
|
2022-01-08T04:04:56.000Z
|
2022-01-08T04:04:56.000Z
|
debug-scraper.py
|
waldosax/PlexSports
|
404058921e4be02b93ad155bdaef768ff917620e
|
[
"MIT"
] | null | null | null |
# Boostrap necessary modules for debugging Plex Metadata agent
import os, sys, types, functools
from pprint import pprint
import bootstrapper
import localscanner
PlexSportsAgent = bootstrapper.BootstrapAgent()
if __name__ == "__main__":
# argv1 = argv[1]
# argv1 = "Z:\\Staging\\Sports"
# argv1 = "L:\\Staging\\Sports"
argv1 = "F:\\Code\\Plex\\PlexSportsLibrary"
root = argv1
#franchises = PlexSportsAgent.Teams.GetFranchises("MLB")
#franchises = PlexSportsAgent.Teams.GetFranchises("NBA")
franchises = PlexSportsAgent.Teams.GetFranchises("NFL")
#franchises = PlexSportsAgent.Teams.GetFranchises("NHL")
pass
| 25.96
| 63
| 0.725732
| 66
| 649
| 7.015152
| 0.621212
| 0.215983
| 0.259179
| 0.37149
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.010949
| 0.155624
| 649
| 25
| 64
| 25.96
| 0.833942
| 0.46379
| 0
| 0
| 0
| 0
| 0.138801
| 0.104101
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0.1
| 0.4
| 0
| 0.4
| 0.1
| 0
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| 0
|
0
| 5
|
1d568a4e381951bc457bea8bc882c9a7b3ff2f4a
| 18,332
|
py
|
Python
|
scrapy_proj/openrecipes/spiders/backtoherroots_spider.py
|
fictivekin/openrecipes
|
82b5c080168439b328f76a115aa2011fa4601384
|
[
"Apache-2.0"
] | 300
|
2015-01-05T05:37:34.000Z
|
2022-03-05T16:24:37.000Z
|
scrapy_proj/openrecipes/spiders/backtoherroots_spider.py
|
fictivekin/openrecipes
|
82b5c080168439b328f76a115aa2011fa4601384
|
[
"Apache-2.0"
] | 11
|
2015-05-14T04:15:22.000Z
|
2018-01-27T17:22:32.000Z
|
scrapy_proj/openrecipes/spiders/backtoherroots_spider.py
|
fictivekin/openrecipes
|
82b5c080168439b328f76a115aa2011fa4601384
|
[
"Apache-2.0"
] | 100
|
2015-01-11T23:14:29.000Z
|
2022-03-25T06:03:48.000Z
|
from scrapy.contrib.spiders import CrawlSpider
from scrapy.selector import HtmlXPathSelector
from openrecipes.items import RecipeItem, RecipeItemLoader
class BacktoherrootsMixin(object):
source = 'backtoherroots'
def parse_item(self, response):
hxs = HtmlXPathSelector(response)
base_path = '//html'
recipes_scopes = hxs.select(base_path)
name_path = './/p[@id="title"]/text()'
description_path = "descendant-or-self::p[@class and contains(concat(' ', normalize-space(@class), ' '), ' summary ')]/text()"
image_path = './/img[@class="photo"]/@src'
prepTime_path = './/span[@class="preptime"]/text()'
cookTime_path = './/span[@class="cooktime"]/text()'
recipeYield_path = './/p[@id="ingr_header"]/span[@class="single_recipe_text"]/text()'
ingredients_path = './/li[@class="ingredient"]/text()'
recipes = []
for r_scope in recipes_scopes:
il = RecipeItemLoader(item=RecipeItem())
il.add_value('source', self.source)
il.add_value('name', r_scope.select(name_path).extract())
il.add_value('image', r_scope.select(image_path).extract())
il.add_value('url', response.url)
il.add_value('description', r_scope.select(description_path).extract())
il.add_value('prepTime', r_scope.select(prepTime_path).extract())
il.add_value('cookTime', r_scope.select(cookTime_path).extract())
il.add_value('recipeYield', r_scope.select(recipeYield_path).extract())
ingredient_scopes = r_scope.select(ingredients_path)
ingredients = []
for i_scope in ingredient_scopes:
ingredients.append(i_scope.extract())
il.add_value('ingredients', ingredients)
recipes.append(il.load_item())
return recipes
class BacktoherrootscrawlSpider(CrawlSpider, BacktoherrootsMixin):
name = "backtoherroots.com"
allowed_domains = ["backtoherroots.com", "www.recipage.com"]
urls = [
'http://www.recipage.com/recipes/6029332.html',
'http://www.recipage.com/recipes/6017153.html',
'http://www.recipage.com/recipes/6002821.html',
'http://www.recipage.com/recipes/6006480.html',
'http://www.recipage.com/recipes/6031769.html',
'http://www.recipage.com/recipes/6034510.html',
'http://www.recipage.com/recipes/6001225.html',
'http://www.recipage.com/recipes/6003965.html',
'http://www.recipage.com/recipes/6002321.html',
'http://www.recipage.com/recipes/6001301.html',
'http://www.recipage.com/recipes/6044259.html',
'http://www.recipage.com/recipes/6002884.html',
'http://www.recipage.com/recipes/6002113.html',
'http://www.recipage.com/recipes/6024725.html',
'http://www.recipage.com/recipes/6022195.html',
'http://www.recipage.com/recipes/6031400.html',
'http://www.recipage.com/recipes/6030133.html',
'http://www.recipage.com/recipes/6000759.html',
'http://www.recipage.com/recipes/6024618.html',
'http://www.recipage.com/recipes/6030965.html',
'http://www.recipage.com/recipes/6004060.html',
'http://www.recipage.com/recipes/6037953.html',
'http://www.recipage.com/recipes/6019682.html',
'http://www.recipage.com/recipes/6007413.html',
'http://www.recipage.com/recipes/6036072.html',
'http://www.recipage.com/recipes/6023553.html',
'http://www.recipage.com/recipes/6000615.html',
'http://www.recipage.com/recipes/6044208.html',
'http://www.recipage.com/recipes/6001323.html',
'http://www.recipage.com/recipes/6039246.html',
'http://www.recipage.com/recipes/6043278.html',
'http://www.recipage.com/recipes/6004858.html',
'http://www.recipage.com/recipes/6005461.html',
'http://www.recipage.com/recipes/6000757.html',
'http://www.recipage.com/recipes/6001298.html',
'http://www.recipage.com/recipes/6041108.html',
'http://www.recipage.com/recipes/6030547.html',
'http://www.recipage.com/recipes/6004338.html',
'http://www.recipage.com/recipes/6005221.html',
'http://www.recipage.com/recipes/6005066.html',
'http://www.recipage.com/recipes/6006099.html',
'http://www.recipage.com/recipes/6005354.html',
'http://www.recipage.com/recipes/6035576.html',
'http://www.recipage.com/recipes/6045198.html',
'http://www.recipage.com/recipes/6000753.html',
'http://www.recipage.com/recipes/6000617.html',
'http://www.recipage.com/recipes/6004401.html',
'http://www.recipage.com/recipes/6005006.html',
'http://www.recipage.com/recipes/6001302.html',
'http://www.recipage.com/recipes/6005505.html',
'http://www.recipage.com/recipes/6004078.html',
'http://www.recipage.com/recipes/6033228.html',
'http://www.recipage.com/recipes/6045235.html',
'http://www.recipage.com/recipes/6016515.html',
'http://www.recipage.com/recipes/6001303.html',
'http://www.recipage.com/recipes/6001228.html',
'http://www.recipage.com/recipes/6002108.html',
'http://www.recipage.com/recipes/6000756.html',
'http://www.recipage.com/recipes/6027939.html',
'http://www.recipage.com/recipes/6012962.html',
'http://www.recipage.com/recipes/6007156.html',
'http://www.recipage.com/recipes/6001002.html',
'http://www.recipage.com/recipes/6001337.html',
'http://www.recipage.com/recipes/6002107.html',
'http://www.recipage.com/recipes/6006732.html',
'http://www.recipage.com/recipes/6017111.html',
'http://www.recipage.com/recipes/6014267.html',
'http://www.recipage.com/recipes/6002109.html',
'http://www.recipage.com/recipes/6001300.html',
'http://www.recipage.com/recipes/6026089.html',
'http://www.recipage.com/recipes/6000754.html',
'http://www.recipage.com/recipes/6003959.html',
'http://www.recipage.com/recipes/6004366.html',
'http://www.recipage.com/recipes/6001325.html',
'http://www.recipage.com/recipes/6035569.html',
'http://www.recipage.com/recipes/6039634.html',
'http://www.recipage.com/recipes/6017862.html',
'http://www.recipage.com/recipes/6039396.html',
'http://www.recipage.com/recipes/6033454.html',
'http://www.recipage.com/recipes/6018581.html',
'http://www.recipage.com/recipes/6025272.html',
'http://www.recipage.com/recipes/6018582.html',
'http://www.recipage.com/recipes/6002101.html',
'http://www.recipage.com/recipes/6002243.html',
'http://www.recipage.com/recipes/6002102.html',
'http://www.recipage.com/recipes/6000750.html',
'http://www.recipage.com/recipes/6040607.html',
'http://www.recipage.com/recipes/6001242.html',
'http://www.recipage.com/recipes/6030195.html',
'http://www.recipage.com/recipes/6000752.html',
'http://www.recipage.com/recipes/6042229.html',
'http://www.recipage.com/recipes/6001332.html',
'http://www.recipage.com/recipes/6038919.html',
'http://www.recipage.com/recipes/6001322.html',
'http://www.recipage.com/recipes/6030135.html',
'http://www.recipage.com/recipes/6032274.html',
'http://www.recipage.com/recipes/6006011.html',
'http://www.recipage.com/recipes/6016398.html',
'http://www.recipage.com/recipes/6002904.html',
'http://www.recipage.com/recipes/6001223.html',
'http://www.recipage.com/recipes/6045313.html',
'http://www.recipage.com/recipes/6003509.html',
'http://www.recipage.com/recipes/6001334.html',
'http://www.recipage.com/recipes/6003988.html',
'http://www.recipage.com/recipes/6011962.html',
'http://www.recipage.com/recipes/6036101.html',
'http://www.recipage.com/recipes/6000614.html',
'http://www.recipage.com/recipes/6002264.html',
'http://www.recipage.com/recipes/6019858.html',
'http://www.recipage.com/recipes/6022752.html',
'http://www.recipage.com/recipes/6026339.html',
'http://www.recipage.com/recipes/6037949.html',
'http://www.recipage.com/recipes/6002761.html',
'http://www.recipage.com/recipes/6006093.html',
'http://www.recipage.com/recipes/6002110.html',
'http://www.recipage.com/recipes/6030542.html',
'http://www.recipage.com/recipes/6001246.html',
'http://www.recipage.com/recipes/6001245.html',
'http://www.recipage.com/recipes/6029582.html',
'http://www.recipage.com/recipes/6001328.html',
'http://www.recipage.com/recipes/6028078.html',
'http://www.recipage.com/recipes/6001336.html',
'http://www.recipage.com/recipes/6001244.html',
'http://www.recipage.com/recipes/6001320.html',
'http://www.recipage.com/recipes/6000613.html',
'http://www.recipage.com/recipes/6024479.html',
'http://www.recipage.com/recipes/6001324.html',
'http://www.recipage.com/recipes/6000612.html',
'http://www.recipage.com/recipes/6014284.html',
'http://www.recipage.com/recipes/6002716.html',
'http://www.recipage.com/recipes/6019963.html',
'http://www.recipage.com/recipes/6004969.html',
'http://www.recipage.com/recipes/6036498.html',
'http://www.recipage.com/recipes/6042732.html',
'http://www.recipage.com/recipes/6030972.html',
'http://www.recipage.com/recipes/6001227.html',
'http://www.recipage.com/recipes/6006098.html',
'http://www.recipage.com/recipes/6016197.html',
'http://www.recipage.com/recipes/6002376.html',
'http://www.recipage.com/recipes/6030548.html',
'http://www.recipage.com/recipes/6021944.html',
'http://www.recipage.com/recipes/6019211.html',
'http://www.recipage.com/recipes/6006753.html',
'http://www.recipage.com/recipes/6038352.html',
'http://www.recipage.com/recipes/6001001.html',
'http://www.recipage.com/recipes/6007176.html',
'http://www.recipage.com/recipes/6018160.html',
'http://www.recipage.com/recipes/6014855.html',
'http://www.recipage.com/recipes/6029828.html',
'http://www.recipage.com/recipes/6001304.html',
'http://www.recipage.com/recipes/6029334.html',
'http://www.recipage.com/recipes/6022880.html',
'http://www.recipage.com/recipes/6006184.html',
'http://www.recipage.com/recipes/6028910.html',
'http://www.recipage.com/recipes/6004711.html',
'http://www.recipage.com/recipes/6010774.html',
'http://www.recipage.com/recipes/6031402.html',
'http://www.recipage.com/recipes/6022543.html',
'http://www.recipage.com/recipes/6025992.html',
'http://www.recipage.com/recipes/6002114.html',
'http://www.recipage.com/recipes/6033047.html',
'http://www.recipage.com/recipes/6018029.html',
'http://www.recipage.com/recipes/6001563.html',
'http://www.recipage.com/recipes/6045237.html',
'http://www.recipage.com/recipes/6013195.html',
'http://www.recipage.com/recipes/6001239.html',
'http://www.recipage.com/recipes/6038422.html',
'http://www.recipage.com/recipes/6000747.html',
'http://www.recipage.com/recipes/6000793.html',
'http://www.recipage.com/recipes/6002898.html',
'http://www.recipage.com/recipes/6004311.html',
'http://www.recipage.com/recipes/6016658.html',
'http://www.recipage.com/recipes/6031405.html',
'http://www.recipage.com/recipes/6010166.html',
'http://www.recipage.com/recipes/6019699.html',
'http://www.recipage.com/recipes/6000792.html',
'http://www.recipage.com/recipes/6021361.html',
'http://www.recipage.com/recipes/6001299.html',
'http://www.recipage.com/recipes/6026703.html',
'http://www.recipage.com/recipes/6002258.html',
'http://www.recipage.com/recipes/6012859.html',
'http://www.recipage.com/recipes/6001308.html',
'http://www.recipage.com/recipes/6000760.html',
'http://www.recipage.com/recipes/6044641.html',
'http://www.recipage.com/recipes/6031856.html',
'http://www.recipage.com/recipes/6001241.html',
'http://www.recipage.com/recipes/6021435.html',
'http://www.recipage.com/recipes/6000791.html',
'http://www.recipage.com/recipes/6000763.html',
'http://www.recipage.com/recipes/6000762.html',
'http://www.recipage.com/recipes/6004378.html',
'http://www.recipage.com/recipes/6001240.html',
'http://www.recipage.com/recipes/6001326.html',
'http://www.recipage.com/recipes/6004361.html',
'http://www.recipage.com/recipes/6030959.html',
'http://www.recipage.com/recipes/6030551.html',
'http://www.recipage.com/recipes/6004359.html',
'http://www.recipage.com/recipes/6001309.html',
'http://www.recipage.com/recipes/6001329.html',
'http://www.recipage.com/recipes/6005292.html',
'http://www.recipage.com/recipes/6007046.html',
'http://www.recipage.com/recipes/6042719.html',
'http://www.recipage.com/recipes/6042427.html',
'http://www.recipage.com/recipes/6003888.html',
'http://www.recipage.com/recipes/6010776.html',
'http://www.recipage.com/recipes/6004272.html',
'http://www.recipage.com/recipes/6005383.html',
'http://www.recipage.com/recipes/6001305.html',
'http://www.recipage.com/recipes/6001306.html',
'http://www.recipage.com/recipes/6033967.html',
'http://www.recipage.com/recipes/6001318.html',
'http://www.recipage.com/recipes/6038022.html',
'http://www.recipage.com/recipes/6045236.html',
'http://www.recipage.com/recipes/6001321.html',
'http://www.recipage.com/recipes/6030403.html',
'http://www.recipage.com/recipes/6004790.html',
'http://www.recipage.com/recipes/6027929.html',
'http://www.recipage.com/recipes/6018423.html',
'http://www.recipage.com/recipes/6004493.html',
'http://www.recipage.com/recipes/6000751.html',
'http://www.recipage.com/recipes/6005347.html',
'http://www.recipage.com/recipes/6001333.html',
'http://www.recipage.com/recipes/6002105.html',
'http://www.recipage.com/recipes/6003717.html',
'http://www.recipage.com/recipes/6005273.html',
'http://www.recipage.com/recipes/6002982.html',
'http://www.recipage.com/recipes/6001237.html',
'http://www.recipage.com/recipes/6014982.html',
'http://www.recipage.com/recipes/6000749.html',
'http://www.recipage.com/recipes/6006761.html',
'http://www.recipage.com/recipes/6000790.html',
'http://www.recipage.com/recipes/6000788.html',
'http://www.recipage.com/recipes/6000787.html',
'http://www.recipage.com/recipes/6002112.html',
'http://www.recipage.com/recipes/6000765.html',
'http://www.recipage.com/recipes/6028893.html',
'http://www.recipage.com/recipes/6045233.html',
'http://www.recipage.com/recipes/6001335.html',
'http://www.recipage.com/recipes/6007174.html',
'http://www.recipage.com/recipes/6001307.html',
'http://www.recipage.com/recipes/6044818.html',
'http://www.recipage.com/recipes/6016611.html',
'http://www.recipage.com/recipes/6002104.html',
'http://www.recipage.com/recipes/6019824.html',
'http://www.recipage.com/recipes/6021946.html',
'http://www.recipage.com/recipes/6003001.html',
'http://www.recipage.com/recipes/6002103.html',
'http://www.recipage.com/recipes/6000761.html',
'http://www.recipage.com/recipes/6000611.html',
'http://www.recipage.com/recipes/6001000.html',
'http://www.recipage.com/recipes/6028553.html',
'http://www.recipage.com/recipes/6000758.html',
'http://www.recipage.com/recipes/6035311.html',
'http://www.recipage.com/recipes/6018756.html',
'http://www.recipage.com/recipes/6041163.html',
'http://www.recipage.com/recipes/6004090.html',
'http://www.recipage.com/recipes/6037684.html',
'http://www.recipage.com/recipes/6003038.html',
'http://www.recipage.com/recipes/6001564.html',
'http://www.recipage.com/recipes/6016249.html',
'http://www.recipage.com/recipes/6013622.html',
'http://www.recipage.com/recipes/6032270.html',
'http://www.recipage.com/recipes/6004195.html',
'http://www.recipage.com/recipes/6001243.html',
'http://www.recipage.com/recipes/6004143.html',
'http://www.recipage.com/recipes/6037799.html',
'http://www.recipage.com/recipes/6009688.html',
'http://www.recipage.com/recipes/6043807.html',
'http://www.recipage.com/recipes/6028885.html',
'http://www.recipage.com/recipes/6000789.html',
'http://www.recipage.com/recipes/6000755.html',
'http://www.recipage.com/recipes/6000764.html',
'http://www.recipage.com/recipes/6001327.html',
'http://www.recipage.com/recipes/6005314.html',
'http://www.recipage.com/recipes/6005567.html',
'http://www.recipage.com/recipes/6001319.html',
'http://www.recipage.com/recipes/6044583.html',
'http://www.recipage.com/recipes/6014854.html',
'http://www.recipage.com/recipes/6004895.html',
'http://www.recipage.com/recipes/6002106.html',
'http://www.recipage.com/recipes/6000616.html',
'http://www.recipage.com/recipes/6000748.html',
'http://www.recipage.com/recipes/6017678.html',
'http://www.recipage.com/recipes/6025072.html',
'http://www.recipage.com/recipes/6007469.html',
'http://www.recipage.com/recipes/6000999.html',
]
def start_requests(self):
requests = []
for url in self.urls:
request = self.make_requests_from_url(url)
request.callback = self.parse_item
requests.append(request)
return requests
| 51.785311
| 134
| 0.641828
| 2,254
| 18,332
| 5.19787
| 0.164153
| 0.269461
| 0.34295
| 0.439399
| 0.716541
| 0.705446
| 0
| 0
| 0
| 0
| 0
| 0.131477
| 0.169376
| 18,332
| 353
| 135
| 51.932011
| 0.637946
| 0
| 0
| 0
| 0
| 0.003012
| 0.711434
| 0.01451
| 0
| 0
| 0
| 0
| 0
| 1
| 0.006024
| false
| 0
| 0.009036
| 0
| 0.039157
| 0
| 0
| 0
| 0
| null | 1
| 1
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
1d6422f0738c95e4fa7f934c2886e195c760b27f
| 283
|
py
|
Python
|
test_integration/pipelines/qasp/qasp_prototype/node/external/pdex_logs.py
|
amzn/rheoceros
|
5e8f79d97f8b21d693d3c869b0df70de3d5fd068
|
[
"Apache-2.0",
"MIT-0"
] | 4
|
2022-03-24T04:39:02.000Z
|
2022-03-31T16:41:50.000Z
|
test_integration/pipelines/qasp/qasp_prototype/node/external/pdex_logs.py
|
amzn/rheoceros
|
5e8f79d97f8b21d693d3c869b0df70de3d5fd068
|
[
"Apache-2.0",
"MIT-0"
] | null | null | null |
test_integration/pipelines/qasp/qasp_prototype/node/external/pdex_logs.py
|
amzn/rheoceros
|
5e8f79d97f8b21d693d3c869b0df70de3d5fd068
|
[
"Apache-2.0",
"MIT-0"
] | null | null | null |
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: MIT-0
from intelliflow.api_ext import *
def create(app: AWSApplication) -> MarshalerNode:
return app.glue_table(database="dex-ml-beta", table_name="pdex_logs", id="pdex_external")
| 31.444444
| 93
| 0.759717
| 40
| 283
| 5.25
| 0.925
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.004
| 0.116608
| 283
| 8
| 94
| 35.375
| 0.836
| 0.342756
| 0
| 0
| 0
| 0
| 0.180328
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.333333
| false
| 0
| 0.333333
| 0.333333
| 1
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 1
| 1
| 1
| 0
|
0
| 5
|
1d64fd85beec18b4df97045f9240c0972f34c683
| 9,390
|
py
|
Python
|
datahub/company/test/test_company_views_account_manager.py
|
alixedi/data-hub-api-cd-poc
|
a5e5ea45bb496c0d2a06635864514af0c7d4291a
|
[
"MIT"
] | null | null | null |
datahub/company/test/test_company_views_account_manager.py
|
alixedi/data-hub-api-cd-poc
|
a5e5ea45bb496c0d2a06635864514af0c7d4291a
|
[
"MIT"
] | 16
|
2020-04-01T15:25:35.000Z
|
2020-04-14T14:07:30.000Z
|
datahub/company/test/test_company_views_account_manager.py
|
alixedi/data-hub-api-cd-poc
|
a5e5ea45bb496c0d2a06635864514af0c7d4291a
|
[
"MIT"
] | null | null | null |
import pytest
from rest_framework import status
from rest_framework.reverse import reverse
from rest_framework.settings import api_settings
from datahub.company.constants import OneListTierID
from datahub.company.models import CompanyPermission, OneListTier
from datahub.company.test.factories import AdviserFactory, CompanyFactory, SubsidiaryFactory
from datahub.core.test_utils import (
APITestMixin,
create_test_user,
random_obj_for_model,
random_obj_for_queryset,
)
@pytest.fixture
def international_trade_adviser():
"""An adviser with permission to change regional account managers."""
permission_codenames = [
CompanyPermission.change_company,
CompanyPermission.change_regional_account_manager,
]
return create_test_user(permission_codenames=permission_codenames, dit_team=None)
def _random_non_ita_one_list_tier():
queryset = OneListTier.objects.exclude(
pk=OneListTierID.tier_d_international_trade_advisers.value,
)
return random_obj_for_queryset(queryset)
class TestSelfAssignCompanyAccountManagerView(APITestMixin):
"""
Tests for the self-assign company account manager view.
(Implemented in CompanyViewSet.self_assign_account_manager().)
"""
@staticmethod
def _get_url(company):
return reverse('api-v4:company:self-assign-account-manager', kwargs={'pk': company.pk})
def test_returns_401_if_unauthenticated(self, api_client):
"""Test that a 401 is returned if no credentials are provided."""
company = CompanyFactory()
url = self._get_url(company)
response = api_client.post(url)
assert response.status_code == status.HTTP_401_UNAUTHORIZED
@pytest.mark.parametrize(
'permission_codenames',
(
(),
(CompanyPermission.change_company,),
(CompanyPermission.change_regional_account_manager,),
),
)
def test_returns_403_if_without_permission(self, permission_codenames):
"""
Test that a 403 is returned if the user does not have all of the required
permissions.
"""
company = CompanyFactory()
user = create_test_user(permission_codenames=permission_codenames, dit_team=None)
api_client = self.create_api_client(user=user)
url = self._get_url(company)
response = api_client.post(url)
assert response.status_code == status.HTTP_403_FORBIDDEN
@pytest.mark.parametrize(
'company_factory',
(
pytest.param(
lambda: CompanyFactory(one_list_account_owner=None, one_list_tier=None),
id='no-existing-account-manager',
),
pytest.param(
lambda: CompanyFactory(
one_list_account_owner=AdviserFactory(),
one_list_tier_id=OneListTierID.tier_d_international_trade_advisers.value,
),
id='existing-international-trade-adviser-account-manager',
),
),
)
@pytest.mark.django_db
def test_assigns_account_manager(self, company_factory, international_trade_adviser):
"""
Test that an account manager can be assigned to:
- a company not on the One List
- a company on the One List tier 'Tier D - International Trade Adviser Accounts'
"""
company = company_factory()
api_client = self.create_api_client(user=international_trade_adviser)
url = self._get_url(company)
response = api_client.post(url)
assert response.status_code == status.HTTP_204_NO_CONTENT
company.refresh_from_db()
assert company.one_list_account_owner == international_trade_adviser
assert company.one_list_tier_id == OneListTierID.tier_d_international_trade_advisers.value
assert company.modified_by == international_trade_adviser
@pytest.mark.parametrize(
'company_factory,expected_errors',
(
pytest.param(
lambda: SubsidiaryFactory(
global_headquarters__one_list_tier=random_obj_for_model(OneListTier),
global_headquarters__one_list_account_owner=AdviserFactory(),
),
{
api_settings.NON_FIELD_ERRORS_KEY: [
"A lead adviser can't be set on a subsidiary of a One List company.",
],
},
id='subsidiary-of-one-list-company',
),
pytest.param(
lambda: CompanyFactory(
one_list_tier=_random_non_ita_one_list_tier(),
one_list_account_owner=AdviserFactory(),
),
{
api_settings.NON_FIELD_ERRORS_KEY: [
"A lead adviser can't be set for companies on this One List tier.",
],
},
id='already-on-another-one-list-tier',
),
),
)
@pytest.mark.django_db
def test_validation(self, company_factory, expected_errors, international_trade_adviser):
"""
Test that an account manager can't be assigned to:
- a company on a One List tier other than 'Tier D - International Trade Adviser Accounts'
- a company on that is a subsidiary of any One List company
"""
company = company_factory()
api_client = self.create_api_client(user=international_trade_adviser)
url = self._get_url(company)
response = api_client.post(url)
assert response.status_code == status.HTTP_400_BAD_REQUEST
assert response.json() == expected_errors
class TestRemoveCompanyAccountManagerView(APITestMixin):
"""
Tests for the remove company account manager view.
(Implemented in CompanyViewSet.remove_account_manager().)
"""
@staticmethod
def _get_url(company):
return reverse('api-v4:company:remove-account-manager', kwargs={'pk': company.pk})
def test_returns_401_if_unauthenticated(self, api_client):
"""Test that a 401 is returned if no credentials are provided."""
company = CompanyFactory()
url = self._get_url(company)
response = api_client.post(url)
assert response.status_code == status.HTTP_401_UNAUTHORIZED
@pytest.mark.parametrize(
'permission_codenames',
(
(),
(CompanyPermission.change_company,),
(CompanyPermission.change_regional_account_manager,),
),
)
def test_returns_403_if_without_permission(self, permission_codenames):
"""
Test that a 403 is returned if the user does not have all of the required
permissions.
"""
company = CompanyFactory()
user = create_test_user(permission_codenames=permission_codenames, dit_team=None)
api_client = self.create_api_client(user=user)
url = self._get_url(company)
response = api_client.post(url)
assert response.status_code == status.HTTP_403_FORBIDDEN
@pytest.mark.parametrize(
'company_factory',
(
pytest.param(
lambda: CompanyFactory(one_list_account_owner=None, one_list_tier=None),
id='no-existing-account-manager',
),
pytest.param(
lambda: CompanyFactory(
one_list_account_owner=AdviserFactory(),
one_list_tier_id=OneListTierID.tier_d_international_trade_advisers.value,
),
id='existing-international-trade-adviser-account-manager',
),
),
)
@pytest.mark.django_db
def test_removes_account_manager_and_tier(self, company_factory, international_trade_adviser):
"""
Test that an account manager can be removed from:
- a company not on the One List
- a company on the One List tier 'Tier D - International Trade Adviser Accounts'
"""
company = company_factory()
api_client = self.create_api_client(user=international_trade_adviser)
url = self._get_url(company)
response = api_client.post(url)
assert response.status_code == status.HTTP_204_NO_CONTENT
company.refresh_from_db()
assert company.one_list_account_owner is None
assert company.one_list_tier is None
assert company.modified_by == international_trade_adviser
@pytest.mark.django_db
def test_cannot_remove_account_manager_for_other_tiers(self, international_trade_adviser):
"""
Test that an account manager can't be removed from a company on a One List tier other
than 'Tier D - International Trade Adviser Accounts'.
"""
company = CompanyFactory(
one_list_tier=_random_non_ita_one_list_tier(),
one_list_account_owner=AdviserFactory(),
)
api_client = self.create_api_client(user=international_trade_adviser)
url = self._get_url(company)
response = api_client.post(url)
assert response.status_code == status.HTTP_400_BAD_REQUEST
assert response.json() == {
api_settings.NON_FIELD_ERRORS_KEY: [
"A lead adviser can't be removed from companies on this One List tier.",
],
}
| 37.410359
| 98
| 0.652822
| 1,042
| 9,390
| 5.583493
| 0.148752
| 0.039704
| 0.035923
| 0.029392
| 0.794775
| 0.775009
| 0.75232
| 0.72482
| 0.72482
| 0.704881
| 0
| 0.007305
| 0.271033
| 9,390
| 250
| 99
| 37.56
| 0.842659
| 0.133759
| 0
| 0.636872
| 0
| 0
| 0.07662
| 0.041931
| 0
| 0
| 0
| 0
| 0.089385
| 1
| 0.067039
| false
| 0
| 0.044693
| 0.011173
| 0.145251
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
d525cbf44fd23b7c0c45ef4e4f15dba6d91022f4
| 10,222
|
py
|
Python
|
tests/test_admin.py
|
Thermondo/django-heroku-connect
|
609ad3206731af3f6414a604a3559ffb559f0e26
|
[
"Apache-2.0"
] | 18
|
2017-11-30T12:52:56.000Z
|
2021-06-30T21:37:28.000Z
|
tests/test_admin.py
|
thermondo/django-heroku-connect
|
609ad3206731af3f6414a604a3559ffb559f0e26
|
[
"Apache-2.0"
] | 105
|
2017-12-01T10:46:14.000Z
|
2021-11-22T13:54:31.000Z
|
tests/test_admin.py
|
Thermondo/django-heroku-connect
|
609ad3206731af3f6414a604a3559ffb559f0e26
|
[
"Apache-2.0"
] | 5
|
2019-07-23T12:28:49.000Z
|
2020-10-12T18:28:24.000Z
|
import pytest
from django.contrib.admin import AdminSite
from django.urls import reverse
from heroku_connect import admin
from heroku_connect.models import (
TRIGGER_LOG_ACTION,
TRIGGER_LOG_STATE,
TriggerLog,
TriggerLogArchive,
)
from heroku_connect.utils import WriteAlgorithm, get_unique_connection_write_mode
from tests.conftest import make_trigger_log
from tests.testapp.models import NumberModel
class TestGenericLogModelAdmin:
@pytest.fixture
def admin(self):
return admin.GenericLogModelAdmin(TriggerLog, AdminSite())
@pytest.fixture
def admin_list_url(self):
route_name = "admin:{0.app_label}_{0.model_name}".format(TriggerLog._meta)
return reverse(route_name + "_changelist")
def test_table_name_link(self, admin, admin_list_url):
log = TriggerLog(id=0, table_name="TABLE", record_id=100)
assert (admin_list_url + "?table_name=TABLE") in admin.table_name_link(log)
def test_record_id_link(self, admin, admin_list_url):
log = TriggerLog(id=0, table_name="TABLE", record_id=100)
assert admin_list_url in admin.record_id_link(log)
assert "table_name=TABLE" in admin.record_id_link(log)
assert "record_id=100" in admin.record_id_link(log)
def test_action_label(self, admin):
log = TriggerLog(
id=0, table_name="TABLE", record_id=100, action=TRIGGER_LOG_ACTION["INSERT"]
)
assert log.get_action_display() in admin.action_label(log)
def test_state_label(self, admin):
log = TriggerLog(
id=0, table_name="TABLE", record_id=100, action=TRIGGER_LOG_ACTION["INSERT"]
)
assert log.get_state_display() in admin.state_label(log)
@pytest.mark.django_db
class TestAdminActions:
@staticmethod
def admin_changelist_url(model):
return reverse(
"admin:{meta.app_label}_{meta.model_name}_changelist".format(
meta=model._meta
)
)
@staticmethod
def action_post_data(action, queryset):
return {
"action": action.__name__,
"_selected_action": queryset.values_list("pk", flat=True),
}
def test_ignore_failed_logs(self, admin_client):
failed_logs = TriggerLog.objects.bulk_create(
[
make_trigger_log(
state=TRIGGER_LOG_STATE["FAILED"],
record_id=i,
action=action,
)
for i, action in enumerate(TRIGGER_LOG_ACTION.values())
]
)
succeeded = make_trigger_log(state=TRIGGER_LOG_STATE["SUCCESS"])
succeeded.save()
admin_client.post(
self.admin_changelist_url(TriggerLog),
data=self.action_post_data(
admin.TriggerLogAdmin.ignore_failed_logs_action,
TriggerLog.objects.all(),
),
)
for failed_log in failed_logs:
failed_log.refresh_from_db()
assert failed_log.state == TRIGGER_LOG_STATE["IGNORED"]
succeeded.refresh_from_db()
assert succeeded.state == TRIGGER_LOG_STATE["SUCCESS"]
def test_retry_failed_logs(self, admin_client, set_write_mode_merge):
failed_logs = TriggerLog.objects.bulk_create(
[
make_trigger_log(
state=TRIGGER_LOG_STATE["FAILED"],
record_id=i,
action=action,
)
for i, action in enumerate(TRIGGER_LOG_ACTION.values())
]
)
succeeded = make_trigger_log(state=TRIGGER_LOG_STATE["SUCCESS"])
succeeded.save()
admin_client.post(
self.admin_changelist_url(TriggerLog),
data=self.action_post_data(
admin.TriggerLogAdmin.retry_failed_logs_action, TriggerLog.objects.all()
),
)
for failed_log in failed_logs:
failed_log.refresh_from_db()
assert failed_log.state == TRIGGER_LOG_STATE["NEW"]
succeeded.refresh_from_db()
assert succeeded.state == TRIGGER_LOG_STATE["SUCCESS"]
@pytest.mark.parametrize("log_action", TRIGGER_LOG_ACTION.values())
def test_retry_failed_logs_ordered_write(
self,
log_action,
admin_client,
set_write_mode_ordered,
hc_capture_stored_procedures,
):
assert get_unique_connection_write_mode() == WriteAlgorithm.ORDERED_WRITES
testrecord = NumberModel.objects.create()
failed_log = make_trigger_log(
state=TRIGGER_LOG_STATE["FAILED"],
table_name="number_object__c",
record_id=testrecord.id,
action=log_action,
)
failed_log.save()
succeeded = make_trigger_log(state=TRIGGER_LOG_STATE["SUCCESS"])
succeeded.save()
qs = TriggerLog.objects.all()
assert qs.count() == 2
assert set(qs.values_list("state", flat=True)) == {
TRIGGER_LOG_STATE["SUCCESS"],
TRIGGER_LOG_STATE["FAILED"],
}
admin_client.post(
self.admin_changelist_url(TriggerLog),
data=self.action_post_data(
admin.TriggerLogAdmin.retry_failed_logs_action, TriggerLog.objects.all()
),
)
if log_action == "DELETE":
assert qs.count() == 2
assert set(qs.values_list("state", flat=True)) == {
TRIGGER_LOG_STATE["SUCCESS"],
TRIGGER_LOG_STATE["NEW"],
}
else:
assert qs.count() == 3
assert set(qs.values_list("state", flat=True)) == {
TRIGGER_LOG_STATE["SUCCESS"],
TRIGGER_LOG_STATE["REQUEUED"],
TRIGGER_LOG_STATE["NEW"],
}
succeeded.refresh_from_db()
assert succeeded.state == TRIGGER_LOG_STATE["SUCCESS"]
def test_retry_failed_logs_in_archive(self, admin_client, set_write_mode_merge):
failed_logs = TriggerLogArchive.objects.bulk_create(
[
make_trigger_log(
is_archived=True,
state=TRIGGER_LOG_STATE["FAILED"],
record_id=i,
action=action,
)
for i, action in enumerate(TRIGGER_LOG_ACTION.values())
]
)
succeeded = make_trigger_log(
is_archived=True, state=TRIGGER_LOG_STATE["SUCCESS"]
)
succeeded.save()
admin_client.post(
self.admin_changelist_url(TriggerLogArchive),
data=self.action_post_data(
admin.TriggerLogAdmin.retry_failed_logs_action,
TriggerLogArchive.objects.all(),
),
)
for failed_log in failed_logs:
failed_log.refresh_from_db()
assert failed_log.state == TRIGGER_LOG_STATE["REQUEUED"]
new_trigger_log = TriggerLog.objects.get(
table_name=failed_log.table_name,
record_id=failed_log.record_id,
action=failed_log.action,
)
assert new_trigger_log.state == TRIGGER_LOG_STATE["NEW"]
succeeded.refresh_from_db()
assert succeeded.state == TRIGGER_LOG_STATE["SUCCESS"]
@pytest.mark.parametrize("log_action", TRIGGER_LOG_ACTION.values())
def test_retry_failed_logs_in_archive_ordered_write(
self,
log_action,
admin_client,
set_write_mode_ordered,
hc_capture_stored_procedures,
):
assert get_unique_connection_write_mode() == WriteAlgorithm.ORDERED_WRITES
testrecord = NumberModel.objects.create()
failed_log = make_trigger_log(
is_archived=True,
state=TRIGGER_LOG_STATE["FAILED"],
table_name="number_object__c",
record_id=testrecord.id,
action=log_action,
)
failed_log.save()
succeeded = make_trigger_log(
is_archived=True, state=TRIGGER_LOG_STATE["SUCCESS"]
)
succeeded.save()
assert TriggerLog.objects.count() == 0
assert TriggerLogArchive.objects.count() == 2
assert set(TriggerLogArchive.objects.values_list("state", flat=True)) == {
TRIGGER_LOG_STATE["SUCCESS"],
TRIGGER_LOG_STATE["FAILED"],
}
admin_client.post(
self.admin_changelist_url(TriggerLogArchive),
data=self.action_post_data(
admin.TriggerLogAdmin.retry_failed_logs_action,
TriggerLogArchive.objects.all(),
),
)
assert TriggerLog.objects.get().state == TRIGGER_LOG_STATE["NEW"]
assert TriggerLogArchive.objects.count() == 2
assert set(TriggerLogArchive.objects.values_list("state", flat=True)) == {
TRIGGER_LOG_STATE["SUCCESS"],
TRIGGER_LOG_STATE["REQUEUED"],
}
succeeded.refresh_from_db()
assert succeeded.state == TRIGGER_LOG_STATE["SUCCESS"]
def test_retry_failed_logs_ordered_write_field_subset(
self, admin_client, set_write_mode_ordered, hc_capture_stored_procedures
):
assert get_unique_connection_write_mode() == WriteAlgorithm.ORDERED_WRITES
testrecord = NumberModel.objects.create()
failed_log = make_trigger_log(
state=TRIGGER_LOG_STATE["FAILED"],
table_name="number_object__c",
record_id=testrecord.id,
action="UPDATE",
values='"a_number__c"=>"333"',
)
failed_log.save()
admin_client.post(
self.admin_changelist_url(TriggerLog),
data=self.action_post_data(
admin.TriggerLogAdmin.retry_failed_logs_action, TriggerLog.objects.all()
),
)
qs = TriggerLog.objects.all()
assert qs.count() == 2
assert set(qs.values_list("state", flat=True)) == {
TRIGGER_LOG_STATE["REQUEUED"],
TRIGGER_LOG_STATE["NEW"],
}
new_log = qs.exclude(id=failed_log.id).get()
assert set(new_log.values_as_dict.keys()) == {"a_number__c"}
| 34.073333
| 88
| 0.613872
| 1,114
| 10,222
| 5.268402
| 0.109515
| 0.09712
| 0.109899
| 0.071562
| 0.777304
| 0.758392
| 0.749872
| 0.735219
| 0.730789
| 0.71818
| 0
| 0.004286
| 0.292409
| 10,222
| 299
| 89
| 34.187291
| 0.807134
| 0
| 0
| 0.600791
| 0
| 0
| 0.053708
| 0.008315
| 0
| 0
| 0
| 0
| 0.130435
| 1
| 0.055336
| false
| 0
| 0.031621
| 0.011858
| 0.110672
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
d52a5de3897e962ccab2004e283a820844a2a865
| 5,126
|
py
|
Python
|
cplxmodule/tests/test_cplxparameter.py
|
veya2ztn/mltool
|
4ed151152845ebe3de128e1f53c478581c1492e4
|
[
"IJG"
] | 86
|
2019-04-25T06:23:40.000Z
|
2022-03-31T07:33:03.000Z
|
cplxmodule/tests/test_cplxparameter.py
|
veya2ztn/mltool
|
4ed151152845ebe3de128e1f53c478581c1492e4
|
[
"IJG"
] | 20
|
2020-04-14T12:51:21.000Z
|
2022-01-08T11:33:03.000Z
|
cplxmodule/tests/test_cplxparameter.py
|
veya2ztn/mltool
|
4ed151152845ebe3de128e1f53c478581c1492e4
|
[
"IJG"
] | 27
|
2019-04-26T13:48:01.000Z
|
2022-03-07T07:33:02.000Z
|
import pytest
import torch
from cplxmodule import cplx
from cplxmodule.nn import CplxParameter
def test_loading():
shape = 11, 13, 7
# load complex parameter in full
state_dict = {"real": torch.randn(*shape), "imag": torch.randn(*shape)}
par = CplxParameter(cplx.Cplx(
real=torch.ones(*shape),
imag=torch.zeros(*shape)
))
par.load_state_dict(state_dict, strict=True)
assert torch.allclose(par.real, state_dict["real"])
assert torch.allclose(par.imag, state_dict["imag"])
# no effect if parameter ot components are missing entirely
par.load_state_dict({}, strict=False)
assert torch.allclose(par.real, state_dict["real"])
assert torch.allclose(par.imag, state_dict["imag"])
with pytest.raises(RuntimeError, match=r"Missing key\(s\)"):
par.load_state_dict({}, strict=True)
# promote real tensor
state_dict = {"": torch.randn(*shape)}
par = CplxParameter(cplx.Cplx(
real=torch.ones(*shape),
imag=torch.zeros(*shape)
))
par.load_state_dict(state_dict, strict=True)
assert torch.allclose(par.real, state_dict[""])
assert torch.allclose(par.imag, torch.zeros_like(state_dict[""]))
def make_module(*shape):
module = torch.nn.Module()
module.mod = torch.nn.Module()
module.mod.par = CplxParameter(cplx.Cplx(
real=torch.ones(*shape),
imag=torch.zeros(*shape)
))
return module
def test_nested_loading():
shape = 11, 13, 7
# load complex parameter in full
base = CplxParameter(cplx.randn(*shape))
state_dict = {f"mod.par.{k}": v for k, v in base.state_dict().items()}
module = make_module(*shape)
module.load_state_dict(state_dict, strict=True)
assert torch.allclose(module.mod.par.real, base.real)
assert torch.allclose(module.mod.par.imag, base.imag)
# no effect if parameter ot components are missing entirely
module.load_state_dict({}, strict=False)
assert torch.allclose(module.mod.par.real, base.real)
assert torch.allclose(module.mod.par.imag, base.imag)
with pytest.raises(RuntimeError, match=r"Missing key\(s\)"):
module.load_state_dict({}, strict=True)
# promote real tensor
base = CplxParameter(cplx.Cplx(torch.randn(*shape)))
module = make_module(*shape)
module.load_state_dict({"mod.par": base.real}, strict=True)
assert torch.allclose(module.mod.par.real, base.real)
assert torch.allclose(module.mod.par.imag, base.imag)
def test_malformed():
shape = 11, 13, 7
# parital complex parameter
par = CplxParameter(cplx.randn(*shape))
with pytest.raises(RuntimeError, match=r"Complex parameter requires both"):
par.load_state_dict({"real": torch.randn(*shape)})
with pytest.raises(RuntimeError, match=r"Complex parameter requires both"):
par.load_state_dict({"imag": torch.randn(*shape)})
with pytest.raises(RuntimeError, match=r"disallows redundant"):
par.load_state_dict({
"real": torch.randn(*shape),
"imag": torch.randn(*shape),
"bar": torch.randn(*shape),
"foo": torch.randn(*shape),
}, strict=True)
with pytest.raises(RuntimeError, match=r"size mismatch for"):
par.load_state_dict({
"real": torch.randn(1, 1), "imag": torch.randn(1, 1),
}, strict=True)
with pytest.raises(RuntimeError, match=r"size mismatch for"):
par.load_state_dict({
"": torch.randn(1, 1),
}, strict=True)
def test_nested_malformed():
shape = 11, 13, 7
# parital complex parameter
module = make_module(*shape)
with pytest.raises(RuntimeError, match=r"Complex parameter requires both"):
module.load_state_dict({"mod.par.real": torch.randn(*shape)})
with pytest.raises(RuntimeError, match=r"Complex parameter requires both"):
module.load_state_dict({"mod.par.imag": torch.randn(*shape)})
# redundant keys pertaining to the complex parameter are forbidden
with pytest.raises(RuntimeError, match=r"disallows redundant"):
module.load_state_dict({
"mod.par.real": torch.randn(*shape),
"mod.par.imag": torch.randn(*shape),
"mod.par.bar": torch.randn(*shape),
"mod.par.foo": torch.randn(*shape),
}, strict=True)
# redundant keys unrelated to the complex parameter are ignored
module.load_state_dict({
"mod.par.real": torch.zeros(*shape),
"mod.par.imag": torch.ones(*shape),
"bar": torch.randn(*shape),
"foo": torch.randn(*shape),
}, strict=False)
with pytest.raises(RuntimeError, match=r"size mismatch for"):
module.load_state_dict({
"mod.par.real": torch.randn(1, 1),
"mod.par.imag": torch.randn(1, 1),
}, strict=True)
with pytest.raises(RuntimeError, match=r"size mismatch for"):
module.load_state_dict({
"mod.par": torch.randn(1, 1),
}, strict=True)
assert torch.allclose(module.mod.par.real, torch.zeros(*shape))
assert torch.allclose(module.mod.par.imag, torch.ones(*shape))
| 33.285714
| 79
| 0.653531
| 676
| 5,126
| 4.863905
| 0.118343
| 0.087591
| 0.075122
| 0.10219
| 0.871959
| 0.819343
| 0.76764
| 0.752737
| 0.634124
| 0.601277
| 0
| 0.007839
| 0.203668
| 5,126
| 153
| 80
| 33.503268
| 0.797648
| 0.077253
| 0
| 0.556604
| 0
| 0
| 0.098538
| 0
| 0
| 0
| 0
| 0
| 0.132075
| 1
| 0.04717
| false
| 0
| 0.037736
| 0
| 0.09434
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 1
| 1
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
d5336c72378705f74f35253cb907a0a704ee588c
| 710
|
py
|
Python
|
bittrex_api/models/v3/cancel_order_type.py
|
goshiz/py_bittrex_api
|
de5f92c3c44d740d566b6d8a3a3b9cbde0db4314
|
[
"MIT"
] | 18
|
2020-07-02T14:17:09.000Z
|
2022-01-12T16:18:08.000Z
|
bittrex_api/models/v3/cancel_order_type.py
|
goshiz/py_bittrex_api
|
de5f92c3c44d740d566b6d8a3a3b9cbde0db4314
|
[
"MIT"
] | 15
|
2020-06-30T08:08:20.000Z
|
2021-09-12T20:11:16.000Z
|
bittrex_api/models/v3/cancel_order_type.py
|
goshiz/py_bittrex_api
|
de5f92c3c44d740d566b6d8a3a3b9cbde0db4314
|
[
"MIT"
] | 8
|
2020-12-29T08:08:20.000Z
|
2022-01-12T21:06:22.000Z
|
# --------------------------------------------------------------- Imports ---------------------------------------------------------------- #
# System
from enum import Enum
# ---------------------------------------------------------------------------------------------------------------------------------------- #
# -------------------------------------------------------- class: CancelOrderType -------------------------------------------------------- #
class CancelOrderType(Enum):
ORDER = 'ORDER'
CONDITIONAL_ORDER = 'CONDITIONAL_ORDER'
# ---------------------------------------------------------------------------------------------------------------------------------------- #
| 44.375
| 140
| 0.167606
| 17
| 710
| 6.882353
| 0.529412
| 0.34188
| 0.358974
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.085915
| 710
| 16
| 141
| 44.375
| 0.180277
| 0.784507
| 0
| 0
| 0
| 0
| 0.153846
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.25
| 0
| 1
| 0
| 1
| 0
| 0
| null | 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
|
0
| 5
|
d55376e84f09f962e52cba02d2f54cab19594176
| 91
|
py
|
Python
|
napatrackmater/__init__.py
|
Kapoorlabs-CAPED/NapaTrackMater
|
c4e82de83d06f74c43b681df68937f30bd551e94
|
[
"BSD-3-Clause"
] | 8
|
2021-05-09T09:05:18.000Z
|
2021-12-25T15:07:51.000Z
|
napatrackmater/__init__.py
|
Kapoorlabs-CAPED/NapaTrackMater
|
c4e82de83d06f74c43b681df68937f30bd551e94
|
[
"BSD-3-Clause"
] | 6
|
2021-01-20T10:35:54.000Z
|
2022-03-12T01:03:00.000Z
|
napatrackmater/__init__.py
|
Kapoorlabs-CAPED/NapaTrackMater
|
c4e82de83d06f74c43b681df68937f30bd551e94
|
[
"BSD-3-Clause"
] | 4
|
2021-01-16T06:39:09.000Z
|
2022-03-22T06:51:39.000Z
|
from .bTrackmate import *
from .napari_animation import *
from .version import __version__
| 22.75
| 32
| 0.813187
| 11
| 91
| 6.272727
| 0.545455
| 0.289855
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.131868
| 91
| 3
| 33
| 30.333333
| 0.873418
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
63901d11396ae6d2848aba5f30ead1ba08d404a9
| 100
|
py
|
Python
|
app/donations/__init__.py
|
chinmaya-dev/ttbdonation
|
1ea4cb2c279db86465040b68f1fa48dbb5f7e17c
|
[
"MIT"
] | null | null | null |
app/donations/__init__.py
|
chinmaya-dev/ttbdonation
|
1ea4cb2c279db86465040b68f1fa48dbb5f7e17c
|
[
"MIT"
] | 11
|
2019-12-26T17:21:03.000Z
|
2022-03-21T22:17:07.000Z
|
app/donations/__init__.py
|
chinmaya-dev/ttbdonation
|
1ea4cb2c279db86465040b68f1fa48dbb5f7e17c
|
[
"MIT"
] | null | null | null |
from flask import Blueprint
bp = Blueprint('donation', __name__)
from app.donations import routes
| 16.666667
| 36
| 0.79
| 13
| 100
| 5.769231
| 0.769231
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.14
| 100
| 5
| 37
| 20
| 0.872093
| 0
| 0
| 0
| 0
| 0
| 0.08
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.666667
| 0
| 0.666667
| 0.666667
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 1
|
0
| 5
|
63c66ce49147de88db160744e40a5264560707f5
| 163
|
py
|
Python
|
grating_coupler_meep/__init__.py
|
joamatab/grating_coupler_meep
|
c4cc443012dfe50dd2971133f8a40629c8a4e20b
|
[
"MIT"
] | null | null | null |
grating_coupler_meep/__init__.py
|
joamatab/grating_coupler_meep
|
c4cc443012dfe50dd2971133f8a40629c8a4e20b
|
[
"MIT"
] | null | null | null |
grating_coupler_meep/__init__.py
|
joamatab/grating_coupler_meep
|
c4cc443012dfe50dd2971133f8a40629c8a4e20b
|
[
"MIT"
] | null | null | null |
"""grating_coupler_meep - grating coupler meep"""
__version__ = "0.0.1"
__author__ = "Simon Bilodeau <<46427609+simbilod@users.noreply.github.com>>"
__all__ = []
| 27.166667
| 76
| 0.730061
| 20
| 163
| 5.25
| 0.8
| 0.266667
| 0.342857
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.075342
| 0.104294
| 163
| 5
| 77
| 32.6
| 0.643836
| 0.263804
| 0
| 0
| 0
| 0
| 0.578947
| 0.403509
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| null | 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
892f23aa269c5c64cbbfe3a772b0e59b4afd91ec
| 1,505
|
py
|
Python
|
2011_07_12/test_expressao_matematica.py
|
samisafatli/dojo
|
3751f8413e70da84e928e037193e8cb03f6b3e65
|
[
"MIT"
] | 114
|
2015-03-10T22:17:42.000Z
|
2022-03-09T17:49:48.000Z
|
2011_07_12/test_expressao_matematica.py
|
samisafatli/dojo
|
3751f8413e70da84e928e037193e8cb03f6b3e65
|
[
"MIT"
] | 9
|
2018-09-04T12:49:59.000Z
|
2019-11-17T21:29:51.000Z
|
2011_07_12/test_expressao_matematica.py
|
samisafatli/dojo
|
3751f8413e70da84e928e037193e8cb03f6b3e65
|
[
"MIT"
] | 39
|
2015-01-29T01:20:56.000Z
|
2022-02-17T16:26:25.000Z
|
import unittest
from expressao_matematica import expressao_matematica
class ExpressaoNumericaTestCase(unittest.TestCase):
def test_leitura_de_um_numero_de_um_digito(self):
self.assertEquals(expressao_matematica('1'), 1)
self.assertEquals(expressao_matematica('2'), 2)
def test_soma_com_um_digito(self):
self.assertEquals(expressao_matematica('1+1'), 2)
self.assertEquals(expressao_matematica('1+2'), 3)
def test_soma_com_dois_digitos(self):
self.assertEquals(expressao_matematica('1+11'), 12)
self.assertEquals(expressao_matematica('10+11'), 21)
def test_soma_com_espaco(self):
self.assertEquals(expressao_matematica('10 + 3'), 13)
def test_soma_com_tres_numeros(self):
self.assertEquals(expressao_matematica('10 + 3 + 4'), 17)
def test_subtracao_um_digito(self):
self.assertEquals(expressao_matematica('2-1'), 1)
def test_subtracao_dois_digitos(self):
self.assertEquals(expressao_matematica('12-1'), 11)
def test_subtracao_tres_digitos(self):
self.assertEquals(expressao_matematica('12-2-1'), 9)
def test_soma_1_mais_1_e_subtrai_1(self):
self.assertEquals(expressao_matematica('1+1-1'), 1)
def test_subtrai_1_de_1_e_soma_1(self):
self.assertEquals(expressao_matematica('1-1+1'), 1)
def test_multiplics_2_por_2(self):
self.assertEquals(expressao_matematica('2*2'), 4)
if __name__ == '__main__':
unittest.main()
| 34.204545
| 65
| 0.710299
| 199
| 1,505
| 5.005025
| 0.221106
| 0.305221
| 0.351406
| 0.491968
| 0.636546
| 0.563253
| 0.482932
| 0.200803
| 0.200803
| 0.10241
| 0
| 0.05153
| 0.174751
| 1,505
| 43
| 66
| 35
| 0.750403
| 0
| 0
| 0
| 0
| 0
| 0.044548
| 0
| 0
| 0
| 0
| 0
| 0.466667
| 1
| 0.366667
| false
| 0
| 0.066667
| 0
| 0.466667
| 0
| 0
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
8975454119ec0c2f68db5218d8fbeebdf992b65b
| 406
|
py
|
Python
|
apps/API/serializers/__init__.py
|
ExpoAshique/ProveBanking__s
|
f0b45fffea74d00d14014be27aa50fe5f42f6903
|
[
"MIT"
] | null | null | null |
apps/API/serializers/__init__.py
|
ExpoAshique/ProveBanking__s
|
f0b45fffea74d00d14014be27aa50fe5f42f6903
|
[
"MIT"
] | null | null | null |
apps/API/serializers/__init__.py
|
ExpoAshique/ProveBanking__s
|
f0b45fffea74d00d14014be27aa50fe5f42f6903
|
[
"MIT"
] | null | null | null |
from project_serializers import *
from proposed_serializers import *
from request_serializers import *
from location_serializers import *
from role_serializers import *
from division_serializers import *
from user_serializers import *
from vendor_serializers import *
from category_serializers import *
from search_serializer import *
from aggregator_serializers import *
from channel_serializers import *
| 31.230769
| 36
| 0.852217
| 48
| 406
| 6.958333
| 0.333333
| 0.55988
| 0.628743
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.118227
| 406
| 12
| 37
| 33.833333
| 0.932961
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| null | 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
89ab0eaf6f3969da66e2dcfd9b792ee82618c409
| 66
|
py
|
Python
|
sciliners/__init__.py
|
toddrjen/sciliners
|
067a4fea71ab390e6a0aec006f265fe61c3a5768
|
[
"BSD-3-Clause"
] | null | null | null |
sciliners/__init__.py
|
toddrjen/sciliners
|
067a4fea71ab390e6a0aec006f265fe61c3a5768
|
[
"BSD-3-Clause"
] | null | null | null |
sciliners/__init__.py
|
toddrjen/sciliners
|
067a4fea71ab390e6a0aec006f265fe61c3a5768
|
[
"BSD-3-Clause"
] | null | null | null |
# -*- coding: utf-8 -*-
from signal import *
from stats import *
| 13.2
| 23
| 0.621212
| 9
| 66
| 4.555556
| 0.777778
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.019231
| 0.212121
| 66
| 4
| 24
| 16.5
| 0.769231
| 0.318182
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
984f3ed66fc6191c48b3c424338f4d26414e0349
| 301
|
py
|
Python
|
orbital_transfer_pathfinder/lib/orbitalmechanics/__init__.py
|
TheOGZer0/orbital-transfer-pathfinder
|
4327e368f7a9c3809546fccdae283e63d37f595b
|
[
"MIT"
] | null | null | null |
orbital_transfer_pathfinder/lib/orbitalmechanics/__init__.py
|
TheOGZer0/orbital-transfer-pathfinder
|
4327e368f7a9c3809546fccdae283e63d37f595b
|
[
"MIT"
] | 4
|
2021-08-31T14:35:16.000Z
|
2021-09-03T20:49:17.000Z
|
orbital_transfer_pathfinder/lib/orbitalmechanics/__init__.py
|
m-jeu/orbital-transfer-pathfinder
|
4327e368f7a9c3809546fccdae283e63d37f595b
|
[
"MIT"
] | null | null | null |
from .bodies import CentralBody, CentralBodyInOrbit
from .orbits import Orbit
from .manoeuvres import ProRetroGradeManoeuvre, InclinationAndProRetroGradeManoeuvre, InclinationChange
from .orbitcollections import OrbitCollection
from .visualization import visualize_orbits
from .known_objects import *
| 43
| 103
| 0.877076
| 28
| 301
| 9.357143
| 0.607143
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.089701
| 301
| 6
| 104
| 50.166667
| 0.956204
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
987bd6c7367dae1e3c734acee4943983b1c8e9e3
| 414
|
py
|
Python
|
jiminy/gym/spaces/__init__.py
|
sibeshkar/jiminy
|
7754f86fb0f246e7d039ea0cbfd9950fcae4adfb
|
[
"MIT"
] | 3
|
2020-03-16T13:50:40.000Z
|
2021-06-09T05:26:13.000Z
|
jiminy/gym/spaces/__init__.py
|
sibeshkar/jiminy
|
7754f86fb0f246e7d039ea0cbfd9950fcae4adfb
|
[
"MIT"
] | null | null | null |
jiminy/gym/spaces/__init__.py
|
sibeshkar/jiminy
|
7754f86fb0f246e7d039ea0cbfd9950fcae4adfb
|
[
"MIT"
] | null | null | null |
from jiminy.gym.spaces.box import Box
from jiminy.gym.spaces.discrete import Discrete
from jiminy.gym.spaces.multi_discrete import MultiDiscrete
from jiminy.gym.spaces.multi_binary import MultiBinary
from jiminy.gym.spaces.prng import seed
from jiminy.gym.spaces.tuple_space import Tuple
from jiminy.gym.spaces.dict_space import Dict
__all__ = ["Box", "Discrete", "MultiDiscrete", "MultiBinary", "Tuple", "Dict"]
| 41.4
| 78
| 0.811594
| 60
| 414
| 5.466667
| 0.283333
| 0.213415
| 0.277439
| 0.405488
| 0.146341
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.089372
| 414
| 9
| 79
| 46
| 0.870027
| 0
| 0
| 0
| 0
| 0
| 0.10628
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.875
| 0
| 0.875
| 0
| 0
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
9883d097c1a00ec6754ec75493a4e64ed1cbbf31
| 87
|
py
|
Python
|
level0/question79.py
|
kevin00000000/Python-programming-exercises
|
87546906d817263ae7ddbd0276f0bb36e0d63c41
|
[
"MIT"
] | null | null | null |
level0/question79.py
|
kevin00000000/Python-programming-exercises
|
87546906d817263ae7ddbd0276f0bb36e0d63c41
|
[
"MIT"
] | null | null | null |
level0/question79.py
|
kevin00000000/Python-programming-exercises
|
87546906d817263ae7ddbd0276f0bb36e0d63c41
|
[
"MIT"
] | null | null | null |
import random
print(random.sample([i for i in range(1, 1001) if i%5==0 and i%7==0], 5))
| 43.5
| 73
| 0.666667
| 21
| 87
| 2.761905
| 0.714286
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.133333
| 0.137931
| 87
| 2
| 73
| 43.5
| 0.64
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.5
| 0
| 0.5
| 0.5
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 1
|
0
| 5
|
98b7db2263021f457ebdf18b45c1a96ab4b64f0c
| 315
|
py
|
Python
|
securityheaders/checkers/cors/exposeheaders/checker.py
|
th3cyb3rc0p/securityheaders
|
941264be581dc01afe28f6416f2d7bed79aecfb3
|
[
"Apache-2.0"
] | 151
|
2018-07-29T22:34:43.000Z
|
2022-03-22T05:08:27.000Z
|
securityheaders/checkers/cors/exposeheaders/checker.py
|
th3cyb3rc0p/securityheaders
|
941264be581dc01afe28f6416f2d7bed79aecfb3
|
[
"Apache-2.0"
] | 5
|
2019-04-24T07:31:36.000Z
|
2021-04-15T14:31:23.000Z
|
securityheaders/checkers/cors/exposeheaders/checker.py
|
th3cyb3rc0p/securityheaders
|
941264be581dc01afe28f6416f2d7bed79aecfb3
|
[
"Apache-2.0"
] | 42
|
2018-07-31T08:18:59.000Z
|
2022-03-28T08:18:32.000Z
|
from securityheaders.models.cors import AccessControlExposeHeaders
from securityheaders.checkers import Checker
class AccessControlExposeHeadersChecker(Checker):
def __init__(self):
pass
def getexposeheaders(self, headers):
return self.extractheader(headers, AccessControlExposeHeaders)
| 26.25
| 70
| 0.796825
| 27
| 315
| 9.148148
| 0.666667
| 0.153846
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.149206
| 315
| 11
| 71
| 28.636364
| 0.921642
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.285714
| false
| 0.142857
| 0.285714
| 0.142857
| 0.857143
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 1
| 0
|
0
| 5
|
7f595ceebd115fd20ef003bc71203cf961610e1f
| 242
|
py
|
Python
|
addons/owncloud/settings/__init__.py
|
gaybro8777/osf.io
|
30408511510a40bc393565817b343ef5fd76ab14
|
[
"Apache-2.0"
] | 628
|
2015-01-15T04:33:22.000Z
|
2022-03-30T06:40:10.000Z
|
addons/owncloud/settings/__init__.py
|
gaybro8777/osf.io
|
30408511510a40bc393565817b343ef5fd76ab14
|
[
"Apache-2.0"
] | 4,712
|
2015-01-02T01:41:53.000Z
|
2022-03-30T14:18:40.000Z
|
addons/owncloud/settings/__init__.py
|
Johnetordoff/osf.io
|
de10bf249c46cede04c78f7e6f7e352c69e6e6b5
|
[
"Apache-2.0"
] | 371
|
2015-01-12T16:14:08.000Z
|
2022-03-31T18:58:29.000Z
|
import logging
from addons.owncloud.settings.defaults import * # noqa
logger = logging.getLogger(__name__)
try:
from addons.owncloud.settings.local import * # noqa
except ImportError:
logger.warn('No local.py settings file found')
| 26.888889
| 56
| 0.760331
| 31
| 242
| 5.806452
| 0.645161
| 0.111111
| 0.2
| 0.288889
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.14876
| 242
| 8
| 57
| 30.25
| 0.873786
| 0.03719
| 0
| 0
| 0
| 0
| 0.134783
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.571429
| 0
| 0.571429
| 0
| 0
| 0
| 0
| null | 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
7f60f7db7c6f1d1b93dc056609ed270bd692f53d
| 192
|
py
|
Python
|
controller/_utils.py
|
adc21/snap-controller
|
e1c6131859d6ec602e5c8521de41e6e4c9608554
|
[
"MIT"
] | 2
|
2021-04-21T15:22:23.000Z
|
2021-05-12T01:45:43.000Z
|
controller/_utils.py
|
adc21/snap-controller
|
e1c6131859d6ec602e5c8521de41e6e4c9608554
|
[
"MIT"
] | null | null | null |
controller/_utils.py
|
adc21/snap-controller
|
e1c6131859d6ec602e5c8521de41e6e4c9608554
|
[
"MIT"
] | null | null | null |
import re
from typing import Pattern, AnyStr
from .types import SnapDirPrefixType
def get_dir_regex(prefix: SnapDirPrefixType) -> Pattern[AnyStr]:
return re.compile(f'{prefix}([0-9]+)')
| 24
| 64
| 0.755208
| 26
| 192
| 5.5
| 0.692308
| 0.181818
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.011905
| 0.125
| 192
| 7
| 65
| 27.428571
| 0.839286
| 0
| 0
| 0
| 0
| 0
| 0.08377
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.2
| false
| 0
| 0.6
| 0.2
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 1
| 0
|
0
| 5
|
7f8b497d2f6333855b30241842563667d22f5cd6
| 52
|
py
|
Python
|
hello_world.py
|
sofiasheikh05/stat624demo
|
e053d34829b98875cc61a5de78d20fb49886d239
|
[
"MIT"
] | null | null | null |
hello_world.py
|
sofiasheikh05/stat624demo
|
e053d34829b98875cc61a5de78d20fb49886d239
|
[
"MIT"
] | null | null | null |
hello_world.py
|
sofiasheikh05/stat624demo
|
e053d34829b98875cc61a5de78d20fb49886d239
|
[
"MIT"
] | null | null | null |
echo "print("Hello World")"
echo "print("Update")"
| 13
| 27
| 0.653846
| 7
| 52
| 4.857143
| 0.714286
| 0.529412
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.115385
| 52
| 3
| 28
| 17.333333
| 0.73913
| 0
| 0
| 0
| 0
| 0
| 0.27451
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | null | 0
| 0
| null | null | 1
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 1
|
0
| 5
|
7f90881dca12b10cda25056ff24c06229950f394
| 158
|
py
|
Python
|
src/titiler/mosaic/titiler/mosaic/__init__.py
|
NLTGit/titiler
|
1879706478834f5e7cc565950f4e389ef073ced4
|
[
"MIT"
] | 288
|
2019-12-05T18:19:51.000Z
|
2022-03-31T16:43:18.000Z
|
src/titiler/mosaic/titiler/mosaic/__init__.py
|
NLTGit/titiler
|
1879706478834f5e7cc565950f4e389ef073ced4
|
[
"MIT"
] | 228
|
2020-03-26T13:48:05.000Z
|
2022-03-31T20:16:55.000Z
|
src/titiler/mosaic/titiler/mosaic/__init__.py
|
NLTGit/titiler
|
1879706478834f5e7cc565950f4e389ef073ced4
|
[
"MIT"
] | 73
|
2020-04-29T13:49:35.000Z
|
2022-03-25T13:09:16.000Z
|
"""titiler.mosaic"""
from . import errors, factory, version # noqa
from .factory import MosaicTilerFactory # noqa
from .version import __version__ # noqa
| 26.333333
| 47
| 0.746835
| 18
| 158
| 6.333333
| 0.5
| 0.192982
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.158228
| 158
| 5
| 48
| 31.6
| 0.857143
| 0.189873
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
7fa526885099aafe33f9dc340207afc2523a8c99
| 1,647
|
py
|
Python
|
troubleshoot_margin.py
|
ronaldderksen/pycryptobot
|
01a11e3fe121360b1a4138ed193fdc3d05e5857a
|
[
"Apache-2.0"
] | null | null | null |
troubleshoot_margin.py
|
ronaldderksen/pycryptobot
|
01a11e3fe121360b1a4138ed193fdc3d05e5857a
|
[
"Apache-2.0"
] | null | null | null |
troubleshoot_margin.py
|
ronaldderksen/pycryptobot
|
01a11e3fe121360b1a4138ed193fdc3d05e5857a
|
[
"Apache-2.0"
] | null | null | null |
import sys
sys.path.append('.')
from models.helper.MarginHelper import calculate_margin
# Scenario 1.1: Coinbase Pro passing in actual free in quote currency
buy_size = 1500
buy_fee = 2.99
buy_filled = 5.98802395
buy_price = 250.00
sell_percent = 100
sell_size = 5.98800000
sell_filled = 5.98800000
sell_price = 250.69
sell_fee = 3.00
sell_taker_fee_rate = 0 # not used if sell_fee is set
actual_margin, actual_profit, actual_sell_fee = calculate_margin(buy_size, buy_filled, buy_price, buy_fee, sell_percent, sell_price, sell_fee, sell_taker_fee_rate, True)
print ("---\n")
# Scenario 1.2: Coinbase Pro passing in actual free in quote currency
buy_size = 157.72000000
buy_fee = 0.55
buy_filled = 1.13463691
buy_price = 138.52
sell_percent = 100
sell_filled = 1.13460000
sell_price = 138.97
sell_size = 1.13460000
sell_taker_fee_rate_rate = 0 # not used if sell_taker_fee_rate is supplied, which is the fee rate
sell_fee = 0.55
actual_margin, actual_profit, actual_sell_fee = calculate_margin(buy_size, buy_filled, buy_price, buy_fee, sell_percent, sell_price, sell_fee, sell_taker_fee_rate, True)
print ("---\n")
# Scenario 2.1: Coinbase Pro passing in exchange fee rate
buy_size = 1500
buy_fee = 2.99
buy_filled = 5.98802395
buy_price = 250.00
sell_percent = 100
sell_size = 5.98800000
sell_filled = 5.98800000
sell_price = 250.69
sell_fee = 0 # not used if sell_taker_fee_rate is supplied, which is the fee rate
sell_taker_fee_rate = 0.002
actual_margin, actual_profit, actual_sell_fee = calculate_margin(buy_size, buy_filled, buy_price, buy_fee, sell_percent, sell_price, sell_fee, sell_taker_fee_rate, True)
print ("---\n")
| 27
| 169
| 0.779599
| 290
| 1,647
| 4.117241
| 0.217241
| 0.064489
| 0.080402
| 0.107203
| 0.791457
| 0.752094
| 0.733668
| 0.733668
| 0.733668
| 0.733668
| 0
| 0.11744
| 0.136612
| 1,647
| 61
| 170
| 27
| 0.722222
| 0.214329
| 0
| 0.589744
| 0
| 0
| 0.012422
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.051282
| 0
| 0.051282
| 0.076923
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
7fae43b91d54133a912a5cd63b38cf195050690d
| 749
|
py
|
Python
|
projetos/aula/operators/comparison-operators.py
|
GiuseppeMP/udacity-fundamentos-ia-machine-learning
|
7a19e33eced412d3bfa7462a00d1bca89a3c77ee
|
[
"MIT"
] | null | null | null |
projetos/aula/operators/comparison-operators.py
|
GiuseppeMP/udacity-fundamentos-ia-machine-learning
|
7a19e33eced412d3bfa7462a00d1bca89a3c77ee
|
[
"MIT"
] | null | null | null |
projetos/aula/operators/comparison-operators.py
|
GiuseppeMP/udacity-fundamentos-ia-machine-learning
|
7a19e33eced412d3bfa7462a00d1bca89a3c77ee
|
[
"MIT"
] | null | null | null |
'''> Greater that - True if left operand is greater than the right x > y
< Less that - True if left operand is less than the right x < y
== Equal to - True if both operands are equal x == y
!= Not equal to - True if operands are not equal x != y
>= Greater than or equal to - True if left operand is greater than or equal to the right x >= y
<= Less than or equal to - True if left operand is less than or equal to the right x <= y'''
x = 10
y = 12
# Output: x > y is False
print('x > y is',x>y)
# Output: x < y is True
print('x < y is',x<y)
# Output: x == y is False
print('x == y is',x==y)
# Output: x != y is True
print('x != y is',x!=y)
# Output: x >= y is False
print('x >= y is',x>=y)
# Output: x <= y is True
print('x <= y is',x<=y)
| 26.75
| 95
| 0.612817
| 155
| 749
| 2.96129
| 0.16129
| 0.104575
| 0.104575
| 0.130719
| 0.814815
| 0.738562
| 0.721133
| 0.572985
| 0.472767
| 0.333333
| 0
| 0.00708
| 0.245661
| 749
| 27
| 96
| 27.740741
| 0.80531
| 0.815754
| 0
| 0
| 0
| 0
| 0.317647
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0.75
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
|
0
| 5
|
f6d7918092e9367717b7cda5c20662140d320568
| 65
|
py
|
Python
|
attacks/poisoning/poisoning_lib/__init__.py
|
shawnclq/Adversarial-Threat-Detector
|
fb5cc98ed46138e6630989721f6b4481cf1879a5
|
[
"MIT"
] | null | null | null |
attacks/poisoning/poisoning_lib/__init__.py
|
shawnclq/Adversarial-Threat-Detector
|
fb5cc98ed46138e6630989721f6b4481cf1879a5
|
[
"MIT"
] | null | null | null |
attacks/poisoning/poisoning_lib/__init__.py
|
shawnclq/Adversarial-Threat-Detector
|
fb5cc98ed46138e6630989721f6b4481cf1879a5
|
[
"MIT"
] | null | null | null |
from attacks.poisoning.poisoning_lib.poisonfrog import PoisonFrog
| 65
| 65
| 0.907692
| 8
| 65
| 7.25
| 0.75
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.046154
| 65
| 1
| 65
| 65
| 0.935484
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
f6eeb545859a404a8ba7b28bf707f3739bbf1c01
| 55
|
py
|
Python
|
videoprocessing.py
|
pashadude/bbaacdmcga
|
748f16e3fcf0759301626e468e673452558d52a3
|
[
"MIT"
] | null | null | null |
videoprocessing.py
|
pashadude/bbaacdmcga
|
748f16e3fcf0759301626e468e673452558d52a3
|
[
"MIT"
] | null | null | null |
videoprocessing.py
|
pashadude/bbaacdmcga
|
748f16e3fcf0759301626e468e673452558d52a3
|
[
"MIT"
] | null | null | null |
import pandas as pd
import argparse
import youtube_dl
| 11
| 19
| 0.836364
| 9
| 55
| 5
| 0.777778
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.163636
| 55
| 4
| 20
| 13.75
| 0.978261
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
63e065e910181ae0a95e69b26844c181dc037c39
| 76
|
py
|
Python
|
robots/big/strategies/2019/test/test_absrot/t1.py
|
memristor/mep2
|
bc5cddacba3d740f791f3454b8cb51bda83ce202
|
[
"MIT"
] | 5
|
2018-11-27T15:15:00.000Z
|
2022-02-10T21:44:13.000Z
|
robots/big/strategies/2019/test/test_absrot/t1.py
|
memristor/mep2
|
bc5cddacba3d740f791f3454b8cb51bda83ce202
|
[
"MIT"
] | 2
|
2018-10-20T15:48:40.000Z
|
2018-11-20T05:11:33.000Z
|
robots/big/strategies/2019/test/test_absrot/t1.py
|
memristor/mep2
|
bc5cddacba3d740f791f3454b8cb51bda83ce202
|
[
"MIT"
] | 1
|
2020-02-07T12:44:47.000Z
|
2020-02-07T12:44:47.000Z
|
weight=1
def run():
r.absrot(90)
r.absrot(0)
r.absrot(-90)
r.absrot(90)
| 10.857143
| 14
| 0.631579
| 16
| 76
| 3
| 0.5
| 0.583333
| 0.5625
| 0.416667
| 0.666667
| 0
| 0
| 0
| 0
| 0
| 0
| 0.123077
| 0.144737
| 76
| 6
| 15
| 12.666667
| 0.615385
| 0
| 0
| 0.333333
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.166667
| false
| 0
| 0
| 0
| 0.166667
| 0
| 1
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
63fd930ca9eb6f7a13a53328dac0d6336ec344c0
| 6,503
|
py
|
Python
|
snakemake/wrappers/.snakemake.i6mz_o2d.merge_bams_wrapper.py
|
saketkc/EE-546-project
|
fb7eacd90f6c0a2cb3061837ec5427a14f521aa5
|
[
"BSD-2-Clause"
] | 1
|
2020-11-02T07:05:09.000Z
|
2020-11-02T07:05:09.000Z
|
snakemake/wrappers/.snakemake.i6mz_o2d.merge_bams_wrapper.py
|
saketkc/EE-546-project
|
fb7eacd90f6c0a2cb3061837ec5427a14f521aa5
|
[
"BSD-2-Clause"
] | null | null | null |
snakemake/wrappers/.snakemake.i6mz_o2d.merge_bams_wrapper.py
|
saketkc/EE-546-project
|
fb7eacd90f6c0a2cb3061837ec5427a14f521aa5
|
[
"BSD-2-Clause"
] | null | null | null |
######## Snakemake header ########
import sys; sys.path.append("/home/cmb-panasas2/skchoudh/software_frozen/anaconda27/envs/riboraptor/lib/python3.5/site-packages"); import pickle; snakemake = pickle.loads(b'\x80\x03csnakemake.script\nSnakemake\nq\x00)\x81q\x01}q\x02(X\x07\x00\x00\x00threadsq\x03K\x01X\t\x00\x00\x00resourcesq\x04csnakemake.io\nResources\nq\x05)\x81q\x06(K\x01K\x01e}q\x07(X\x06\x00\x00\x00_nodesq\x08K\x01X\x06\x00\x00\x00_coresq\tK\x01X\x06\x00\x00\x00_namesq\n}q\x0b(h\x08K\x00N\x86q\x0ch\tK\x01N\x86q\ruubX\x06\x00\x00\x00outputq\x0ecsnakemake.io\nOutputFiles\nq\x0f)\x81q\x10X\x12\x00\x00\x00bams/SRX399822.bamq\x11a}q\x12h\n}q\x13sbX\t\x00\x00\x00wildcardsq\x14csnakemake.io\nWildcards\nq\x15)\x81q\x16X\t\x00\x00\x00SRX399822q\x17a}q\x18(h\n}q\x19X\x06\x00\x00\x00sampleq\x1aK\x00N\x86q\x1bsX\x06\x00\x00\x00sampleq\x1ch\x17ubX\x04\x00\x00\x00ruleq\x1dX\n\x00\x00\x00merge_bamsq\x1eX\x06\x00\x00\x00configq\x1f}q X\x0b\x00\x00\x00config_pathq!X\x1b\x00\x00\x00configs/GRCz10_SRP034750.pyq"sX\x05\x00\x00\x00inputq#csnakemake.io\nInputFiles\nq$)\x81q%(X\x17\x00\x00\x00bams_srr/SRR1062455.bamq&X\x17\x00\x00\x00bams_srr/SRR1062456.bamq\'X\x17\x00\x00\x00bams_srr/SRR1062457.bamq(X\x17\x00\x00\x00bams_srr/SRR1062458.bamq)X\x17\x00\x00\x00bams_srr/SRR1062459.bamq*X\x17\x00\x00\x00bams_srr/SRR1062460.bamq+X\x17\x00\x00\x00bams_srr/SRR1062461.bamq,X\x17\x00\x00\x00bams_srr/SRR1062462.bamq-X\x17\x00\x00\x00bams_srr/SRR1062463.bamq.X\x17\x00\x00\x00bams_srr/SRR1062464.bamq/X\x17\x00\x00\x00bams_srr/SRR1062465.bamq0X\x17\x00\x00\x00bams_srr/SRR1062466.bamq1X\x17\x00\x00\x00bams_srr/SRR1062467.bamq2X\x17\x00\x00\x00bams_srr/SRR1062468.bamq3X\x17\x00\x00\x00bams_srr/SRR1062469.bamq4X\x17\x00\x00\x00bams_srr/SRR1062470.bamq5X\x17\x00\x00\x00bams_srr/SRR1062471.bamq6X\x17\x00\x00\x00bams_srr/SRR1062472.bamq7X\x17\x00\x00\x00bams_srr/SRR1062473.bamq8X\x17\x00\x00\x00bams_srr/SRR1062474.bamq9X\x17\x00\x00\x00bams_srr/SRR1062475.bamq:X\x17\x00\x00\x00bams_srr/SRR1062476.bamq;X\x17\x00\x00\x00bams_srr/SRR1062477.bamq<X\x17\x00\x00\x00bams_srr/SRR1062478.bamq=X\x17\x00\x00\x00bams_srr/SRR1062479.bamq>X\x17\x00\x00\x00bams_srr/SRR1062480.bamq?X\x17\x00\x00\x00bams_srr/SRR1062481.bamq@X\x17\x00\x00\x00bams_srr/SRR1062482.bamqAX\x17\x00\x00\x00bams_srr/SRR1062483.bamqBX\x17\x00\x00\x00bams_srr/SRR1062484.bamqCX\x17\x00\x00\x00bams_srr/SRR1062485.bamqDX\x17\x00\x00\x00bams_srr/SRR1062486.bamqEX\x17\x00\x00\x00bams_srr/SRR1062487.bamqFX\x17\x00\x00\x00bams_srr/SRR1062488.bamqGX\x17\x00\x00\x00bams_srr/SRR1062489.bamqHX\x17\x00\x00\x00bams_srr/SRR1062490.bamqIX\x17\x00\x00\x00bams_srr/SRR1062491.bamqJX\x17\x00\x00\x00bams_srr/SRR1062492.bamqKX\x17\x00\x00\x00bams_srr/SRR1062493.bamqLX\x17\x00\x00\x00bams_srr/SRR1062494.bamqMX\x17\x00\x00\x00bams_srr/SRR1062495.bamqNX\x17\x00\x00\x00bams_srr/SRR1062496.bamqOX\x17\x00\x00\x00bams_srr/SRR1062497.bamqPX\x17\x00\x00\x00bams_srr/SRR1062498.bamqQX\x17\x00\x00\x00bams_srr/SRR1062499.bamqRX\x17\x00\x00\x00bams_srr/SRR1062500.bamqSX\x17\x00\x00\x00bams_srr/SRR1062501.bamqTX\x17\x00\x00\x00bams_srr/SRR1062502.bamqUX\x17\x00\x00\x00bams_srr/SRR1062503.bamqVX\x17\x00\x00\x00bams_srr/SRR1062504.bamqWX\x17\x00\x00\x00bams_srr/SRR1062505.bamqXX\x17\x00\x00\x00bams_srr/SRR1062506.bamqYX\x17\x00\x00\x00bams_srr/SRR1062507.bamqZX\x17\x00\x00\x00bams_srr/SRR1062508.bamq[X\x17\x00\x00\x00bams_srr/SRR1062509.bamq\\X\x17\x00\x00\x00bams_srr/SRR1062510.bamq]X\x17\x00\x00\x00bams_srr/SRR1062511.bamq^X\x17\x00\x00\x00bams_srr/SRR1062512.bamq_X\x17\x00\x00\x00bams_srr/SRR1062513.bamq`X\x17\x00\x00\x00bams_srr/SRR1062514.bamqaX\x17\x00\x00\x00bams_srr/SRR1062515.bamqbX\x17\x00\x00\x00bams_srr/SRR1062516.bamqcX\x17\x00\x00\x00bams_srr/SRR1062517.bamqdX\x17\x00\x00\x00bams_srr/SRR1062518.bamqeX\x17\x00\x00\x00bams_srr/SRR1062519.bamqfX\x17\x00\x00\x00bams_srr/SRR1062520.bamqgX\x17\x00\x00\x00bams_srr/SRR1062521.bamqhX\x17\x00\x00\x00bams_srr/SRR1062522.bamqiX\x17\x00\x00\x00bams_srr/SRR1062523.bamqjX\x17\x00\x00\x00bams_srr/SRR1062524.bamqkX\x17\x00\x00\x00bams_srr/SRR1062525.bamqlX\x17\x00\x00\x00bams_srr/SRR1062526.bamqmX\x17\x00\x00\x00bams_srr/SRR1062527.bamqnX\x17\x00\x00\x00bams_srr/SRR1062528.bamqoX\x17\x00\x00\x00bams_srr/SRR1062529.bamqpX\x17\x00\x00\x00bams_srr/SRR1062530.bamqqX\x17\x00\x00\x00bams_srr/SRR1062531.bamqrX\x17\x00\x00\x00bams_srr/SRR1062532.bamqsX\x17\x00\x00\x00bams_srr/SRR1062533.bamqtX\x17\x00\x00\x00bams_srr/SRR1062534.bamquX\x17\x00\x00\x00bams_srr/SRR1062535.bamqvX\x17\x00\x00\x00bams_srr/SRR1062536.bamqwX\x17\x00\x00\x00bams_srr/SRR1062537.bamqxX\x17\x00\x00\x00bams_srr/SRR1062538.bamqyX\x17\x00\x00\x00bams_srr/SRR1062539.bamqzX\x17\x00\x00\x00bams_srr/SRR1062540.bamq{X\x17\x00\x00\x00bams_srr/SRR1062541.bamq|X\x17\x00\x00\x00bams_srr/SRR1062542.bamq}X\x17\x00\x00\x00bams_srr/SRR1062543.bamq~X\x17\x00\x00\x00bams_srr/SRR1062544.bamq\x7fX\x17\x00\x00\x00bams_srr/SRR1062545.bamq\x80X\x17\x00\x00\x00bams_srr/SRR1062546.bamq\x81X\x17\x00\x00\x00bams_srr/SRR1062547.bamq\x82X\x17\x00\x00\x00bams_srr/SRR1062548.bamq\x83X\x17\x00\x00\x00bams_srr/SRR1062549.bamq\x84X\x17\x00\x00\x00bams_srr/SRR1062550.bamq\x85X\x17\x00\x00\x00bams_srr/SRR1062551.bamq\x86X\x17\x00\x00\x00bams_srr/SRR1062552.bamq\x87X\x17\x00\x00\x00bams_srr/SRR1062553.bamq\x88X\x17\x00\x00\x00bams_srr/SRR1062554.bamq\x89e}q\x8ah\n}q\x8bsbX\x03\x00\x00\x00logq\x8ccsnakemake.io\nLog\nq\x8d)\x81q\x8e}q\x8fh\n}q\x90sbX\x06\x00\x00\x00paramsq\x91csnakemake.io\nParams\nq\x92)\x81q\x93X\x04\x00\x00\x00/tmpq\x94a}q\x95(X\x07\x00\x00\x00tmp_dirq\x96h\x94h\n}q\x97h\x96K\x00N\x86q\x98subub.'); from snakemake.logging import logger; logger.printshellcmds = True
######## Original script #########
import os
import tempfile
from snakemake.shell import shell
if len(snakemake.input) > 1:
with tempfile.TemporaryDirectory(dir=snakemake.params.tmp_dir) as temp_dir:
cmd = ' -in '.join(snakemake.input)
shell(r'''bamtools merge -in {cmd} -out {snakemake.output}.unsorted \
&& samtools sort -@ {snakemake.threads} \
-T {temp_dir}/{snakemake.wildcards.sample}_merge_bam \
-o {snakemake.output} {snakemake.output}.unsorted \
&& samtools index {snakemake.output} \
&& yes | rm -rf {snakemake.output}.unsorted''')
elif len(snakemake.input) == 1:
source = os.path.abspath(str(snakemake.input[0]))
destination = os.path.abspath(str(snakemake.output))
shell('''cp {source} {destination} && cp {source}.bai {destination}.bai''')
| 295.590909
| 5,610
| 0.808242
| 1,093
| 6,503
| 4.704483
| 0.300091
| 0.145858
| 0.255348
| 0.311163
| 0.472579
| 0.38273
| 0.126021
| 0
| 0
| 0
| 0
| 0.291944
| 0.030294
| 6,503
| 21
| 5,611
| 309.666667
| 0.52347
| 0.005075
| 0
| 0
| 0
| 0.117647
| 0.229717
| 0.183245
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.235294
| 0
| 0.235294
| 0.058824
| 0
| 0
| 0
| null | 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
1206ca0c7d06ad7aeceb708d94bfed284ffde7bb
| 1,194
|
py
|
Python
|
generated-libraries/python/netapp/job/job_state.py
|
radekg/netapp-ontap-lib-get
|
6445ebb071ec147ea82a486fbe9f094c56c5c40d
|
[
"MIT"
] | 2
|
2017-03-28T15:31:26.000Z
|
2018-08-16T22:15:18.000Z
|
generated-libraries/python/netapp/job/job_state.py
|
radekg/netapp-ontap-lib-get
|
6445ebb071ec147ea82a486fbe9f094c56c5c40d
|
[
"MIT"
] | null | null | null |
generated-libraries/python/netapp/job/job_state.py
|
radekg/netapp-ontap-lib-get
|
6445ebb071ec147ea82a486fbe9f094c56c5c40d
|
[
"MIT"
] | null | null | null |
class JobState(basestring):
"""
Jobs execute as self-contained state machines. They follow a
series of careful steps from creation to destruction. These
steps are dictated by the states that they find themselves in as
well as the allowable list of states they may transition into.
The state can be an indicator of whether a job is executing and
if not, why that is the case.
Possible values:
<ul>
<li> "initial" - Initializing,
<li> "queued" - Queued,
<li> "running" - Running,
<li> "waiting" - Waiting For Another Job,
<li> "pausing" - Entering Paused State,
<li> "paused" - Paused,
<li> "quitting" - Entering Quit State,
<li> "success" - Succeeded,
<li> "failure" - Failed,
<li> "reschedule" - Forcing Reschedule,
<li> "error" - Internal Error,
<li> "quit" - Quit,
<li> "dead" - Died,
<li> "unknown" - Unknown,
<li> "restart" - Forcing Restart,
<li> "dormant" - Waiting For External Event
</ul>
"""
@staticmethod
def get_api_name():
return "job-state"
| 35.117647
| 68
| 0.569514
| 138
| 1,194
| 4.913043
| 0.630435
| 0.029499
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.327471
| 1,194
| 33
| 69
| 36.181818
| 0.844334
| 0.81072
| 0
| 0
| 0
| 0
| 0.078947
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.25
| true
| 0
| 0
| 0.25
| 0.75
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| 1
| 1
| 0
|
0
| 5
|
125d305209c4f88f5b105cf888af20129ef72619
| 114
|
py
|
Python
|
bind_manager_v3/modules/__init__.py
|
the-elven-archer/bind_manager
|
8c56bb8602bd823a44cf2531960f2fad0e2bb7db
|
[
"Apache-2.0"
] | null | null | null |
bind_manager_v3/modules/__init__.py
|
the-elven-archer/bind_manager
|
8c56bb8602bd823a44cf2531960f2fad0e2bb7db
|
[
"Apache-2.0"
] | null | null | null |
bind_manager_v3/modules/__init__.py
|
the-elven-archer/bind_manager
|
8c56bb8602bd823a44cf2531960f2fad0e2bb7db
|
[
"Apache-2.0"
] | null | null | null |
#!/usr/bin/env python2
from .main import *
from .models import *
from .config import *
from .dns_tools import *
| 14.25
| 24
| 0.710526
| 17
| 114
| 4.705882
| 0.647059
| 0.375
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.010638
| 0.175439
| 114
| 7
| 25
| 16.285714
| 0.840426
| 0.184211
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
89c323d0246387f48f8398ca74abdec9a5b62f0e
| 52
|
py
|
Python
|
pm4pymdl/objects/ocel/importer/__init__.py
|
dorian1000/pm4py-mdl
|
71e0c2425abb183da293a58d31e25e50137c774f
|
[
"MIT"
] | 5
|
2021-01-31T22:45:29.000Z
|
2022-02-22T14:26:06.000Z
|
pm4pymdl/objects/ocel/importer/__init__.py
|
Javert899/pm4py-mdl
|
4cc875999100f3f1ad60b925a20e40cf52337757
|
[
"MIT"
] | 3
|
2021-07-07T15:32:55.000Z
|
2021-07-07T16:15:36.000Z
|
pm4pymdl/objects/ocel/importer/__init__.py
|
dorian1000/pm4py-mdl
|
71e0c2425abb183da293a58d31e25e50137c774f
|
[
"MIT"
] | 9
|
2020-09-23T15:34:11.000Z
|
2022-03-17T09:15:40.000Z
|
from pm4pymdl.objects.ocel.importer import importer
| 26
| 51
| 0.865385
| 7
| 52
| 6.428571
| 0.857143
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.020833
| 0.076923
| 52
| 1
| 52
| 52
| 0.916667
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
89cc2087fbd1fffb68db41e0958d1fcee2c43315
| 422
|
bzl
|
Python
|
private/versions.bzl
|
mandrean/rules_jvm_external
|
68764532c794b1a3c5fbb62fca3f560341528cc1
|
[
"Apache-2.0"
] | 1
|
2021-06-12T14:56:38.000Z
|
2021-06-12T14:56:38.000Z
|
private/versions.bzl
|
mandrean/rules_jvm_external
|
68764532c794b1a3c5fbb62fca3f560341528cc1
|
[
"Apache-2.0"
] | null | null | null |
private/versions.bzl
|
mandrean/rules_jvm_external
|
68764532c794b1a3c5fbb62fca3f560341528cc1
|
[
"Apache-2.0"
] | null | null | null |
_COURSIER_CLI_VERSION = "2.12"
_COURSIER_VERSION = "1.1.0-M9"
COURSIER_CLI_SHA256 = "8e7333506bb0db2a262d747873a434a476570dd09b30b61bcbac95aff18a8a9b"
COURSIER_CLI_MAVEN_PATH = "io/get-coursier/coursier-cli_{COURSIER_CLI_VERSION}/{COURSIER_VERSION}/coursier-cli_{COURSIER_CLI_VERSION}-{COURSIER_VERSION}-standalone.jar".format(
COURSIER_CLI_VERSION = _COURSIER_CLI_VERSION,
COURSIER_VERSION = _COURSIER_VERSION,
)
| 52.75
| 176
| 0.838863
| 49
| 422
| 6.693878
| 0.346939
| 0.301829
| 0.27439
| 0.317073
| 0.393293
| 0.393293
| 0.268293
| 0
| 0
| 0
| 0
| 0.126582
| 0.063981
| 422
| 7
| 177
| 60.285714
| 0.703797
| 0
| 0
| 0
| 0
| 0.142857
| 0.511848
| 0.483412
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
89df73eaf74daa6814ec883f28a27c0b445b19ef
| 284
|
py
|
Python
|
tests/transactions/serializers/test_ipfs.py
|
supaiku0/python-crypto
|
112bfe2f7f581d317d6be65c0c38dad5c9689f5c
|
[
"MIT"
] | null | null | null |
tests/transactions/serializers/test_ipfs.py
|
supaiku0/python-crypto
|
112bfe2f7f581d317d6be65c0c38dad5c9689f5c
|
[
"MIT"
] | null | null | null |
tests/transactions/serializers/test_ipfs.py
|
supaiku0/python-crypto
|
112bfe2f7f581d317d6be65c0c38dad5c9689f5c
|
[
"MIT"
] | 1
|
2021-12-21T15:09:05.000Z
|
2021-12-21T15:09:05.000Z
|
import pytest
from crypto.transactions.serializer import Serializer
@pytest.mark.skip(reason='not implemented - missing fixture')
def test_serializer(transaction_type_5):
result = Serializer(transaction_type_5).serialize()
assert result == transaction_type_5['serialized']
| 28.4
| 61
| 0.799296
| 34
| 284
| 6.470588
| 0.647059
| 0.204545
| 0.218182
| 0.236364
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.011858
| 0.109155
| 284
| 9
| 62
| 31.555556
| 0.857708
| 0
| 0
| 0
| 0
| 0
| 0.151408
| 0
| 0
| 0
| 0
| 0
| 0.166667
| 1
| 0.166667
| false
| 0
| 0.333333
| 0
| 0.5
| 0
| 0
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
c39a6a06aa5e2ff68726f8f629d6823ba993f565
| 98
|
py
|
Python
|
prev_res/util/test.py
|
shiinoandra/DeepLecture
|
6232a45bc4372b137f25c734c33c90423ac42976
|
[
"Apache-2.0"
] | null | null | null |
prev_res/util/test.py
|
shiinoandra/DeepLecture
|
6232a45bc4372b137f25c734c33c90423ac42976
|
[
"Apache-2.0"
] | null | null | null |
prev_res/util/test.py
|
shiinoandra/DeepLecture
|
6232a45bc4372b137f25c734c33c90423ac42976
|
[
"Apache-2.0"
] | null | null | null |
import spell
print spell.correction("numbrt tan fresh nalli is waiting on nou cold nit husband")
| 24.5
| 83
| 0.795918
| 16
| 98
| 4.875
| 0.9375
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.153061
| 98
| 3
| 84
| 32.666667
| 0.939759
| 0
| 0
| 0
| 0
| 0
| 0.581633
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | null | 0
| 0.5
| null | null | 0.5
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| 0
| 1
|
0
| 5
|
c3b8a24c7df9e21358f70917391fc2af56d6eba8
| 212
|
py
|
Python
|
results/sanity.py
|
ranjitjhala/vera
|
4bf257d06397f8516a230ee44ede410152543726
|
[
"BSD-3-Clause"
] | 4
|
2020-06-20T11:48:20.000Z
|
2020-09-26T03:42:10.000Z
|
results/sanity.py
|
ranjitjhala/vera
|
4bf257d06397f8516a230ee44ede410152543726
|
[
"BSD-3-Clause"
] | null | null | null |
results/sanity.py
|
ranjitjhala/vera
|
4bf257d06397f8516a230ee44ede410152543726
|
[
"BSD-3-Clause"
] | 2
|
2021-04-28T03:11:02.000Z
|
2022-01-06T22:00:42.000Z
|
import os
print("Running sanity checks")
os.system("stack test --ta '-p Sanity' &> verify_sanity.txt")
#os.system("./mach jstests test262/harness/nans.js")
print("---> Wrote output to results/verify_sanity.txt")
| 35.333333
| 61
| 0.726415
| 32
| 212
| 4.75
| 0.71875
| 0.105263
| 0.197368
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.015625
| 0.09434
| 212
| 5
| 62
| 42.4
| 0.776042
| 0.240566
| 0
| 0
| 0
| 0
| 0.71875
| 0.15625
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.25
| 0
| 0.25
| 0.5
| 0
| 0
| 0
| null | 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 1
|
0
| 5
|
c3cb5ad05de24883e8b94174711d8e208c97bc52
| 163
|
py
|
Python
|
website/admin.py
|
ishika4242/portfolio
|
dff74d13d91e9d7dccec9677d3804aa5b7cad7e7
|
[
"Apache-2.0"
] | null | null | null |
website/admin.py
|
ishika4242/portfolio
|
dff74d13d91e9d7dccec9677d3804aa5b7cad7e7
|
[
"Apache-2.0"
] | null | null | null |
website/admin.py
|
ishika4242/portfolio
|
dff74d13d91e9d7dccec9677d3804aa5b7cad7e7
|
[
"Apache-2.0"
] | null | null | null |
from django.contrib import admin
from .models import Workings, Servicing
# Register your models here.
admin.site.register(Servicing)
admin.site.register(Workings)
| 27.166667
| 39
| 0.822086
| 22
| 163
| 6.090909
| 0.545455
| 0.134328
| 0.253731
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.09816
| 163
| 6
| 40
| 27.166667
| 0.911565
| 0.159509
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.5
| 0
| 0.5
| 0
| 1
| 0
| 0
| null | 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
c3d39b9d50c9d1048f46ea829baebb67446c8ed0
| 2,260
|
py
|
Python
|
sound/tests/test_snd.py
|
gbeckers/sound
|
eb3c6a97974c6a9c1d86d37278048d7838a906c1
|
[
"BSD-3-Clause"
] | 1
|
2021-03-08T14:57:50.000Z
|
2021-03-08T14:57:50.000Z
|
sound/tests/test_snd.py
|
gbeckers/sound
|
eb3c6a97974c6a9c1d86d37278048d7838a906c1
|
[
"BSD-3-Clause"
] | null | null | null |
sound/tests/test_snd.py
|
gbeckers/sound
|
eb3c6a97974c6a9c1d86d37278048d7838a906c1
|
[
"BSD-3-Clause"
] | null | null | null |
import unittest
import numpy as np
from sound import Snd
# frames, fs, startdatetime='NaT',
# origintime=0.0, metadata=None, dtype=None,
# scalingfactor=None, encoding=None, unit=None):
class TestSnd(unittest.TestCase):
def test_numpyframes(self):
frames = np.array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9],
dtype='float64').reshape(-1,1)
snd = Snd(frames=frames, fs=10)
self.assertTrue((snd.read_frames() == frames).all())
def test_numpyframes1d(self):
frames = np.array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9], dtype='float64')
snd = Snd(frames=frames, fs=10)
self.assertTrue((snd.read_frames() == frames.reshape(-1,1)).all())
def test_nchannels(self):
frames = np.array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9], dtype='float64')
snd = Snd(frames=frames, fs=10)
self.assertEqual(snd.nchannels, 1)
frames = np.array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9],
dtype='float64').reshape(-1, 1)
snd = Snd(frames=frames, fs=10)
self.assertEqual(snd.nchannels, 1)
frames = np.array([[0, 1], [2, 3], [4, 5], [6, 7], [8, 9]],
dtype='float64')
snd = Snd(frames=frames, fs=10)
self.assertEqual(snd.nchannels, 2)
frames = np.array([[0, 1, 2, 3], [4, 5, 6, 7]],
dtype='float64')
snd = Snd(frames=frames, fs=10)
self.assertEqual(snd.nchannels, 4)
def test_nframes(self):
frames = np.array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9], dtype='float64')
snd = Snd(frames=frames, fs=10)
self.assertEqual(snd.nframes, 10)
frames = np.array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9],
dtype='float64').reshape(-1, 1)
snd = Snd(frames=frames, fs=10)
self.assertEqual(snd.nframes, 10)
frames = np.array([[0, 1], [2, 3], [4, 5], [6, 7], [8, 9]],
dtype='float64')
snd = Snd(frames=frames, fs=10)
self.assertEqual(snd.nframes, 5)
frames = np.array([[0, 1, 2, 3], [4, 5, 6, 7]],
dtype='float64')
snd = Snd(frames=frames, fs=10)
self.assertEqual(snd.nframes, 2)
| 35.873016
| 74
| 0.509292
| 319
| 2,260
| 3.589342
| 0.147335
| 0.125764
| 0.113537
| 0.122271
| 0.776419
| 0.776419
| 0.776419
| 0.776419
| 0.776419
| 0.776419
| 0
| 0.10129
| 0.314159
| 2,260
| 62
| 75
| 36.451613
| 0.637419
| 0.069027
| 0
| 0.688889
| 0
| 0
| 0.033445
| 0
| 0
| 0
| 0
| 0
| 0.222222
| 1
| 0.088889
| false
| 0
| 0.066667
| 0
| 0.177778
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
c3ea02134faa7ac6dd32c810a46e333be066e163
| 72
|
py
|
Python
|
EduCDM/FuzzyCDF/__init__.py
|
zelo2/EduCDM
|
d725dc50ec677dfe409d88a3ffea6dce8effad62
|
[
"Apache-2.0"
] | 36
|
2021-04-28T03:22:03.000Z
|
2022-03-30T16:54:44.000Z
|
EduCDM/FuzzyCDF/__init__.py
|
zelo2/EduCDM
|
d725dc50ec677dfe409d88a3ffea6dce8effad62
|
[
"Apache-2.0"
] | 21
|
2021-03-18T14:10:11.000Z
|
2022-01-29T14:12:45.000Z
|
EduCDM/FuzzyCDF/__init__.py
|
zelo2/EduCDM
|
d725dc50ec677dfe409d88a3ffea6dce8effad62
|
[
"Apache-2.0"
] | 36
|
2021-03-17T14:43:18.000Z
|
2022-03-29T07:52:26.000Z
|
# coding: utf-8
# 2021/3/28 @ liujiayu
from .FuzzyCDF import FuzzyCDF
| 12
| 30
| 0.708333
| 11
| 72
| 4.636364
| 0.909091
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.135593
| 0.180556
| 72
| 5
| 31
| 14.4
| 0.728814
| 0.472222
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
c3edd57c667573b402c18d8a164ebc80a3ecf159
| 54
|
py
|
Python
|
simple_component/__init__.py
|
simcesplatform/Simple-Component
|
c98deae2c4b958ef2f24d953286415f88c1076cb
|
[
"MIT"
] | null | null | null |
simple_component/__init__.py
|
simcesplatform/Simple-Component
|
c98deae2c4b958ef2f24d953286415f88c1076cb
|
[
"MIT"
] | null | null | null |
simple_component/__init__.py
|
simcesplatform/Simple-Component
|
c98deae2c4b958ef2f24d953286415f88c1076cb
|
[
"MIT"
] | null | null | null |
"""Add submodules to the python path."""
import init
| 13.5
| 40
| 0.703704
| 8
| 54
| 4.75
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.166667
| 54
| 3
| 41
| 18
| 0.844444
| 0.62963
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
615470ed46239c37494929f1a1c4ce93e4328aa4
| 104
|
py
|
Python
|
Mailbox/admin.py
|
Positron11/Corkran
|
53f463ca4f02e2617205bf67c123923dda2ce403
|
[
"MIT"
] | null | null | null |
Mailbox/admin.py
|
Positron11/Corkran
|
53f463ca4f02e2617205bf67c123923dda2ce403
|
[
"MIT"
] | 3
|
2020-06-23T17:13:11.000Z
|
2021-04-08T19:57:20.000Z
|
Mailbox/admin.py
|
Positron11/Corkran
|
53f463ca4f02e2617205bf67c123923dda2ce403
|
[
"MIT"
] | null | null | null |
from django.contrib import admin
from .models import NewCommentMail
admin.site.register(NewCommentMail)
| 26
| 35
| 0.855769
| 13
| 104
| 6.846154
| 0.692308
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.086538
| 104
| 4
| 35
| 26
| 0.936842
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.666667
| 0
| 0.666667
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
6170ca4c76887114a83f6520c4f7fc88ba65bbea
| 77
|
py
|
Python
|
toshl/__init__.py
|
noamelf/toshl-python
|
bb5215ae7b43a76f7f82223a3704822f0574504d
|
[
"MIT"
] | null | null | null |
toshl/__init__.py
|
noamelf/toshl-python
|
bb5215ae7b43a76f7f82223a3704822f0574504d
|
[
"MIT"
] | null | null | null |
toshl/__init__.py
|
noamelf/toshl-python
|
bb5215ae7b43a76f7f82223a3704822f0574504d
|
[
"MIT"
] | null | null | null |
from .category import Category
from .tags import Tag
from .entry import Entry
| 25.666667
| 30
| 0.818182
| 12
| 77
| 5.25
| 0.5
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.142857
| 77
| 3
| 31
| 25.666667
| 0.954545
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
4ee321b2f9c8dae847945f0f6327395149b4053b
| 127
|
py
|
Python
|
tensortest/tensorlib.py
|
thanhkaist/tensortest
|
325bef153c64bb0105123a0b7dbe529323652226
|
[
"MIT"
] | 1
|
2020-04-04T14:19:51.000Z
|
2020-04-04T14:19:51.000Z
|
tensortest/tensorlib.py
|
thanhkaist/tensortest
|
325bef153c64bb0105123a0b7dbe529323652226
|
[
"MIT"
] | null | null | null |
tensortest/tensorlib.py
|
thanhkaist/tensortest
|
325bef153c64bb0105123a0b7dbe529323652226
|
[
"MIT"
] | null | null | null |
def foo():
return "foo 1"
def bar():
return "bar 1"
if __name__ == "__main__":
print(foo())
print(bar())
| 12.7
| 26
| 0.519685
| 17
| 127
| 3.411765
| 0.529412
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.022472
| 0.299213
| 127
| 10
| 27
| 12.7
| 0.629213
| 0
| 0
| 0
| 0
| 0
| 0.140625
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.285714
| true
| 0
| 0
| 0.285714
| 0.571429
| 0.285714
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| 1
| 1
| 0
|
0
| 5
|
f61dd49a3979f14bb7cc4a17190cf0ad0d703d7b
| 110
|
py
|
Python
|
bot/setup.py
|
rcdelga/Discord-Bot
|
d676718253b06721831201f595b3c2235ca6a4fa
|
[
"Unlicense"
] | null | null | null |
bot/setup.py
|
rcdelga/Discord-Bot
|
d676718253b06721831201f595b3c2235ca6a4fa
|
[
"Unlicense"
] | 11
|
2020-10-30T21:31:53.000Z
|
2021-05-03T05:21:30.000Z
|
bot/setup.py
|
rcdelga/Discord-Bot
|
d676718253b06721831201f595b3c2235ca6a4fa
|
[
"Unlicense"
] | 1
|
2021-08-16T01:49:09.000Z
|
2021-08-16T01:49:09.000Z
|
from setuptools import setup, find_packages
setup(name='TGABot', version='0.1', packages=find_packages())
| 27.5
| 62
| 0.754545
| 15
| 110
| 5.4
| 0.733333
| 0.296296
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.020408
| 0.109091
| 110
| 3
| 63
| 36.666667
| 0.806122
| 0
| 0
| 0
| 0
| 0
| 0.084112
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.5
| 0
| 0.5
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
f628ae8369a2f75ed2647b6f1b231745883e0c88
| 4,401
|
py
|
Python
|
pyuvs/anc/templates.py
|
kconnour/maven-iuvs
|
fc6ff5d6b7799c78b2ccf34e4316fc151ec87ee8
|
[
"BSD-3-Clause"
] | null | null | null |
pyuvs/anc/templates.py
|
kconnour/maven-iuvs
|
fc6ff5d6b7799c78b2ccf34e4316fc151ec87ee8
|
[
"BSD-3-Clause"
] | null | null | null |
pyuvs/anc/templates.py
|
kconnour/maven-iuvs
|
fc6ff5d6b7799c78b2ccf34e4316fc151ec87ee8
|
[
"BSD-3-Clause"
] | null | null | null |
"""The templates module loads ancillary spectral templates.
"""
from pyuvs.anc._arrays import _AncillaryArray, _AncillaryFileLoader
class CO2PlusFDB(_AncillaryArray):
"""Create the CO:sub:2:sup:+:Fox-DB band system template.
This class will read in the template. It otherwise acts like a
numpy.ndarray.
Notes
-----
The wavelengths where this template is defined can be found in
:class:`MUVWavelengthCenters`.
"""
def __new__(cls):
anc = _AncillaryFileLoader('muv_templates.npy')
array = anc.load_dict()['co2p_fdb']
return super().__new__(cls, array, anc.path)
class CO2PlusUltravioletDoublet(_AncillaryArray):
"""Create the CO:sub:2:sup:+: ultraviolet doublet template.
This class will read in the template. It otherwise acts like a
numpy.ndarray.
Notes
-----
The wavelengths where this template is defined can be found in
:class:`MUVWavelengthCenters`.
"""
def __new__(cls):
anc = _AncillaryFileLoader('muv_templates.npy')
array = anc.load_dict()['co2p_uvd']
return super().__new__(cls, array, anc.path)
class COCameronBands(_AncillaryArray):
"""Create the CO Cameron band system template.
This class will read in the template. It otherwise acts like a
numpy.ndarray.
Notes
-----
The wavelengths where this template is defined can be found in
:class:`MUVWavelengthCenters`.
"""
def __new__(cls):
anc = _AncillaryFileLoader('muv_templates.npy')
array = anc.load_dict()['co_cameron_bands']
return super().__new__(cls, array, anc.path)
class COPlus1NG(_AncillaryArray):
"""Create the CO:sup:+:1NG band system template.
This class will read in the template. It otherwise acts like a
numpy.ndarray.
Notes
-----
The wavelengths where this template is defined can be found in
:class:`MUVWavelengthCenters`.
"""
def __new__(cls):
anc = _AncillaryFileLoader('muv_templates.npy')
array = anc.load_dict()['cop_1ng']
return super().__new__(cls, array, anc.path)
class N2VergardKaplan(_AncillaryArray):
"""Create the N:sub:2:Vergard-Kaplan band system template.
This class will read in the template. It otherwise acts like a
numpy.ndarray.
Notes
-----
The wavelengths where this template is defined can be found in
:class:`MUVWavelengthCenters`.
"""
def __new__(cls):
anc = _AncillaryFileLoader('muv_templates.npy')
array = anc.load_dict()['n2_vk']
return super().__new__(cls, array, anc.path)
class NitricOxideNightglow(_AncillaryArray):
"""Create the nitric oxide nightglow template.
This class will read in the template. It otherwise acts like a
numpy.ndarray.
Notes
-----
The wavelengths where this template is defined can be found in
:class:`MUVWavelengthCenters`.
"""
def __new__(cls):
anc = _AncillaryFileLoader('muv_templates.npy')
array = anc.load_dict()['no_nightglow']
return super().__new__(cls, array, anc.path)
class SolarContinuum(_AncillaryArray):
"""Create the solar continuum template.
This class will read in the template. It otherwise acts like a
numpy.ndarray.
Notes
-----
The wavelengths where this template is defined can be found in
:class:`MUVWavelengthCenters`.
"""
def __new__(cls):
anc = _AncillaryFileLoader('muv_templates.npy')
array = anc.load_dict()['solar_continuum']
return super().__new__(cls, array, anc.path)
class MUVWavelengthCenters(_AncillaryArray):
"""Create the center wavelengths used in the mid-ultraviolet channel.
This class reads in the center wavelengths. It otherwise acts like a
numpy.ndarray.
"""
def __new__(cls):
anc = _AncillaryFileLoader('muv_wavelengths.npy')
array = anc.load_dict()['wavelength_centers']
return super().__new__(cls, array, anc.path)
class MUVWavelengthEdges(_AncillaryArray):
"""Create the edge wavelengths used in the mid-ultraviolet channel.
This class reads in the edge wavelengths. It otherwise acts like a
numpy.ndarray.
"""
def __new__(cls):
anc = _AncillaryFileLoader('muv_wavelengths.npy')
array = anc.load_dict()['wavelength_edges']
return super().__new__(cls, array, anc.path)
| 28.211538
| 73
| 0.677573
| 531
| 4,401
| 5.387947
| 0.173258
| 0.037749
| 0.072352
| 0.059769
| 0.791681
| 0.791681
| 0.791681
| 0.759175
| 0.664103
| 0.664103
| 0
| 0.003502
| 0.221313
| 4,401
| 155
| 74
| 28.393548
| 0.831339
| 0.453761
| 0
| 0.586957
| 0
| 0
| 0.123936
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.195652
| false
| 0
| 0.021739
| 0
| 0.608696
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 1
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
|
0
| 5
|
f659019c354593373c61040cc2d31791e57cdcdd
| 9
|
py
|
Python
|
test_data/parse_retree/expected/formatted_value/at_the_beginning/source.py
|
aas-core-works/aas-core-codegen
|
afec2cf363b6cb69816e7724a2b58626e2165869
|
[
"MIT"
] | 5
|
2021-12-29T12:55:34.000Z
|
2022-03-01T17:57:21.000Z
|
test_data/parse_retree/expected/formatted_value/at_the_beginning/source.py
|
aas-core-works/aas-core-codegen
|
afec2cf363b6cb69816e7724a2b58626e2165869
|
[
"MIT"
] | 10
|
2021-12-29T02:15:55.000Z
|
2022-03-09T11:04:22.000Z
|
test_data/parse_retree/expected/formatted_value/at_the_beginning/source.py
|
aas-core-works/aas-core-codegen
|
afec2cf363b6cb69816e7724a2b58626e2165869
|
[
"MIT"
] | 2
|
2021-12-29T01:42:12.000Z
|
2022-02-15T13:46:33.000Z
|
f"{x}ab"
| 4.5
| 8
| 0.444444
| 3
| 9
| 1.333333
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.111111
| 9
| 1
| 9
| 9
| 0.5
| 0
| 0
| 0
| 0
| 0
| 0.555556
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 1
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
9cc9317c5d18203bb208124149b657aec0cef515
| 100
|
py
|
Python
|
datasets/boids/__init__.py
|
ezhan94/multiagent-programmatic-supervision
|
a1d9152d4c8a287474953cba093c28fef2a05979
|
[
"MIT"
] | 51
|
2019-02-21T23:36:13.000Z
|
2022-03-23T02:41:24.000Z
|
datasets/bball/__init__.py
|
ezhan94/gen-MA-BC
|
a1d9152d4c8a287474953cba093c28fef2a05979
|
[
"MIT"
] | 2
|
2020-03-20T18:14:55.000Z
|
2020-08-12T08:10:21.000Z
|
datasets/boids/__init__.py
|
ezhan94/multiagent-programmatic-supervision
|
a1d9152d4c8a287474953cba093c28fef2a05979
|
[
"MIT"
] | 11
|
2019-02-25T15:41:57.000Z
|
2022-03-23T02:57:28.000Z
|
from .core import fetch, preprocess, normalize, unnormalize
from .visualize import display, animate
| 33.333333
| 59
| 0.82
| 12
| 100
| 6.833333
| 0.833333
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.12
| 100
| 2
| 60
| 50
| 0.931818
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
9cef1468b89c130e871804ed69afd001d7c500d6
| 337
|
py
|
Python
|
problems/155.Min_Stack/solution.py
|
subramp-prep/leetcode
|
d125201d9021ab9b1eea5e5393c2db4edd84e740
|
[
"Unlicense"
] | null | null | null |
problems/155.Min_Stack/solution.py
|
subramp-prep/leetcode
|
d125201d9021ab9b1eea5e5393c2db4edd84e740
|
[
"Unlicense"
] | null | null | null |
problems/155.Min_Stack/solution.py
|
subramp-prep/leetcode
|
d125201d9021ab9b1eea5e5393c2db4edd84e740
|
[
"Unlicense"
] | null | null | null |
class MinStack(object):
def __init__(self):
self.stack = []
def push(self, x):
self.stack.append((x, min(self.getMin(), x)))
def pop(self):
self.stack.pop()
def top(self):
return self.stack[-1][0]
def getMin(self):
return self.stack[-1][1] if self.stack else float('inf')
| 19.823529
| 64
| 0.554896
| 48
| 337
| 3.8125
| 0.4375
| 0.295082
| 0.142077
| 0.20765
| 0.218579
| 0
| 0
| 0
| 0
| 0
| 0
| 0.016393
| 0.275964
| 337
| 16
| 65
| 21.0625
| 0.733607
| 0
| 0
| 0
| 0
| 0
| 0.008902
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.454545
| false
| 0
| 0
| 0.181818
| 0.727273
| 0
| 0
| 0
| 0
| null | 1
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 1
| 0
|
0
| 5
|
9cf0b61431566386ff1f849bb8ae2d835469f046
| 7,205
|
py
|
Python
|
analysis/All3_efficiency.py
|
Harshavardhan-BV/Cancer-compe-strat
|
e4decacd5779e85a68c81d0ce3bedf42dea2964f
|
[
"MIT"
] | 1
|
2020-10-18T15:54:26.000Z
|
2020-10-18T15:54:26.000Z
|
analysis/All3_efficiency.py
|
Harshavardhan-BV/Cancer-compe-strat
|
e4decacd5779e85a68c81d0ce3bedf42dea2964f
|
[
"MIT"
] | null | null | null |
analysis/All3_efficiency.py
|
Harshavardhan-BV/Cancer-compe-strat
|
e4decacd5779e85a68c81d0ce3bedf42dea2964f
|
[
"MIT"
] | null | null | null |
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import common_fn as cf
import seaborn as sns
import os
plt.rcParams["svg.hashsalt"]=0
# O2 efficiency
## Tp:T+:T- 1:1:1 x 666 (total ~2000)
### High test efficiency
pre_path='EnvEq/All3/'
parm_format='{}'
parm_name='o2-efficiency'
cf.mkdirs(pre_path=pre_path,parm_name=parm_name)
cases=pd.read_csv('../input/EnvEq/All3/o2-efficiency/All3_o2-eff_cases.csv')
parms_array='Case'+cases.Case
cf.timeseries(pre_path=pre_path,parm_name=parm_name,parm_array=parms_array,parm_format=parm_format)
df=cf.eq_values(pre_path=pre_path,parm_name=parm_name,parm_array=parms_array,parm_format=parm_format)
## Tp:T+:T- 1:8:1 x 200 (total 2000)
post_path='0.8Tp-'
cf.timeseries(pre_path=pre_path,parm_name=parm_name,parm_array=parms_array,parm_format=parm_format,post_path=post_path)
df=cf.eq_values(pre_path=pre_path,parm_name=parm_name,parm_array=parms_array,parm_format=parm_format,post_path=post_path)
# test efficiency
parm_name='test-efficiency'
cf.mkdirs(pre_path=pre_path,parm_name=parm_name)
## Tp:T+:T- 1:1:1 x 666 (total ~2000)
### Null o2 efficiency
cases=pd.read_csv('../input/EnvEq/All3/test-efficiency/All3_test-eff_cases.csv')
parms_array='Case'+cases.Case[0:len(cases)//2]
cf.timeseries(pre_path=pre_path,parm_name=parm_name,parm_array=parms_array,parm_format=parm_format)
df=cf.eq_values(pre_path=pre_path,parm_name=parm_name,parm_array=parms_array,parm_format=parm_format)
os.rename('../figures/'+pre_path+parm_name+'/timeseries.svg','../figures/'+pre_path+parm_name+'/o2-null_timeseries.svg')
os.rename('../analysed_data/'+pre_path+parm_name+'/eq_values.csv','../analysed_data/'+pre_path+parm_name+'/o2-null_eq_values.csv')
## High o2 efficiency
parms_array='Case'+cases.Case[len(cases)//2:]
parms_array=parms_array.reset_index(drop=True)
cf.timeseries(pre_path=pre_path,parm_name=parm_name,parm_array=parms_array,parm_format=parm_format)
df=cf.eq_values(pre_path=pre_path,parm_name=parm_name,parm_array=parms_array,parm_format=parm_format)
os.rename('../figures/'+pre_path+parm_name+'/timeseries.svg','../figures/'+pre_path+parm_name+'/o2-HE_timeseries.svg')
os.rename('../analysed_data/'+pre_path+parm_name+'/eq_values.csv','../analysed_data/'+pre_path+parm_name+'/o2-HE_eq_values.csv')
## Tp:T+:T- 1:8:1 x 200 (total 2000)
### Null o2 efficiency
post_path='0.8Tp-'
parms_array='Case'+cases.Case[0:len(cases)//2]
cf.timeseries(pre_path=pre_path,parm_name=parm_name,parm_array=parms_array,parm_format=parm_format,post_path=post_path)
df=cf.eq_values(pre_path=pre_path,parm_name=parm_name,parm_array=parms_array,parm_format=parm_format,post_path=post_path)
os.rename('../figures/'+pre_path+parm_name+'/'+post_path+'timeseries.svg','../figures/'+pre_path+parm_name+'/'+post_path+'o2-null_timeseries.svg')
os.rename('../analysed_data/'+pre_path+parm_name+'/'+post_path+'eq_values.csv','../analysed_data/'+pre_path+parm_name+'/'+post_path+'o2-null_eq_values.csv')
## High o2 efficiency
parms_array='Case'+cases.Case[len(cases)//2:]
parms_array=parms_array.reset_index(drop=True)
cf.timeseries(pre_path=pre_path,parm_name=parm_name,parm_array=parms_array,parm_format=parm_format,post_path=post_path)
df=cf.eq_values(pre_path=pre_path,parm_name=parm_name,parm_array=parms_array,parm_format=parm_format,post_path=post_path)
os.rename('../figures/'+pre_path+parm_name+'/'+post_path+'timeseries.svg','../figures/'+pre_path+parm_name+'/'+post_path+'o2-HE_timeseries.svg')
os.rename('../analysed_data/'+pre_path+parm_name+'/'+post_path+'eq_values.csv','../analysed_data/'+pre_path+parm_name+'/'+post_path+'o2-HE_eq_values.csv')
# Combination of o2 and test efficieny
parm_name='efficiency'
cf.mkdirs(pre_path=pre_path,parm_name=parm_name)
parm_name_array=['O2_Eff','Test_Eff','TotCell']
ratios=['','0.8Tp-']
totcell=['1000','2000','4000']
o2_cases=['o2_Null','o2_HE','o2_LE']
test_cases=['test_HE','test_LE']
plot_parm='TotCell'
parms_array=[]
for o2case in o2_cases:
for testcase in test_cases:
for tc in totcell:
parms_array.append([o2case,testcase,tc])
for ratio in ratios:
post_path=ratio+'Case-'
cf.timeseries(pre_path=pre_path,parm_name=parm_name,parm_array=parms_array,parm_format=parm_format,post_path=post_path)
df=cf.eq_values(pre_path=pre_path,parm_name=parm_name,parm_name_array=parm_name_array,parm_array=parms_array,parm_format=parm_format,post_path=post_path)
df = df.astype({'Tpos_eq': float,'Tpro_eq': float,'Tneg_eq': float}) #i dont understand y the eq values are being objects, hacky fix
for o2case in o2_cases:
for testcase in test_cases:
df1=df.loc[(df['Test_Eff']==testcase) & (df['O2_Eff']==o2case),:].copy()
cf.eqratio_v_parm_bar(df=df1,plot_parm=plot_parm,pre_path=pre_path,parm_name=parm_name,post_path=post_path)
os.rename('../figures/'+pre_path+parm_name+'/'+post_path+'bar_finratio-vs-'+plot_parm+'.svg','../figures/'+pre_path+parm_name+'/'+post_path+o2case+'-'+testcase+'-bar_finratio-vs-'+plot_parm+'.svg')
# Efficiency of o2 and test different for different cell types (now only considering if T- can rescue where Tp is suppressed by T+)
parm_name='efficiency-mixed'
cf.mkdirs(pre_path=pre_path,parm_name=parm_name)
parm_name_array=['Tpos_o2_Eff','Tpos_test_Eff','Tpro_o2_Eff','Tpro_test_Eff','Tneg_o2_Eff','TotCell']
Tpos_o2_cases=['Tpos_o2_Null','Tpos_o2_LE']
Tpostestcase='Tpos_test_HE'
Tpro_o2_cases=['Tpro_o2_Null','Tpro_o2_LE']
Tprotestcase='Tpro_test_LE'
Tneg_o2_cases=['Tneg_o2_Null','Tneg_o2_HE','Tneg_o2_LE']
parms_array=[]
custom_title=[]
for Tposo2case in Tpos_o2_cases:
for Tproo2case in Tpro_o2_cases:
for Tnego2case in Tneg_o2_cases:
for tc in totcell:
if((Tposo2case=='Tpos_o2_LE') and (Tproo2case=='Tpro_o2_LE')):
continue
parms_array.append([Tposo2case,Tpostestcase,Tproo2case,Tprotestcase,Tnego2case,tc])
custom_title.append(Tposo2case+'-'+Tnego2case+'-'+tc)
for ratio in ratios:
post_path=ratio+'Case-'
cf.timeseries(pre_path=pre_path,parm_name=parm_name,parm_array=parms_array,parm_format=parm_format,post_path=post_path,custom_title=custom_title)
df=cf.eq_values(pre_path=pre_path,parm_name=parm_name,parm_name_array=parm_name_array,parm_array=parms_array,parm_format=parm_format,post_path=post_path)
df = df.astype({'Tpos_eq': float,'Tpro_eq': float,'Tneg_eq': float}) #i dont understand y the eq values are being objects, hacky fix
for Tposo2case in Tpos_o2_cases:
for Tproo2case in Tpro_o2_cases:
for Tnego2case in Tneg_o2_cases:
if((Tposo2case=='Tpos_o2_LE') and (Tproo2case=='Tpro_o2_LE')):
continue
df1=df.loc[(df['Tpos_o2_Eff']==Tposo2case) & (df['Tpro_o2_Eff']==Tproo2case) & (df['Tneg_o2_Eff']==Tnego2case),:].copy()
cf.eqratio_v_parm_bar(df=df1,plot_parm=plot_parm,pre_path=pre_path,parm_name=parm_name,post_path=post_path)
os.rename('../figures/'+pre_path+parm_name+'/'+post_path+'bar_finratio-vs-'+plot_parm+'.svg','../figures/'+pre_path+parm_name+'/'+post_path+Tposo2case+'-'+Tproo2case+'-'+Tnego2case+'-bar_finratio-vs-'+plot_parm+'.svg')
| 56.732283
| 234
| 0.755586
| 1,209
| 7,205
| 4.165426
| 0.105873
| 0.117554
| 0.091739
| 0.125099
| 0.78336
| 0.767077
| 0.757149
| 0.746029
| 0.73749
| 0.73749
| 0
| 0.023083
| 0.086051
| 7,205
| 126
| 235
| 57.18254
| 0.741686
| 0.07703
| 0
| 0.540816
| 0
| 0
| 0.189369
| 0.033676
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.061224
| 0
| 0.061224
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
141e6292983744a7f114176dcc33a7f2873f4067
| 344
|
py
|
Python
|
doc/main.py
|
stharrold/doc
|
a96647f0bd090069112be9f097db0ec5cc5a052b
|
[
"MIT"
] | null | null | null |
doc/main.py
|
stharrold/doc
|
a96647f0bd090069112be9f097db0ec5cc5a052b
|
[
"MIT"
] | 3
|
2015-04-18T21:44:59.000Z
|
2015-05-01T01:24:11.000Z
|
doc/main.py
|
stharrold/doc
|
a96647f0bd090069112be9f097db0ec5cc5a052b
|
[
"MIT"
] | null | null | null |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Top-level script for documentation utilites.
"""
# Import standard packages.
from __future__ import absolute_import, division, print_function
# Import local packages.
from . import utils
def main():
# TODO: for top-level scripts.
return None
if __name__ == '__main__':
main()
| 16.380952
| 64
| 0.688953
| 43
| 344
| 5.186047
| 0.744186
| 0.071749
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.003571
| 0.186047
| 344
| 20
| 65
| 17.2
| 0.792857
| 0.479651
| 0
| 0
| 0
| 0
| 0.047904
| 0
| 0
| 0
| 0
| 0.05
| 0
| 1
| 0.166667
| true
| 0
| 0.333333
| 0.166667
| 0.666667
| 0.166667
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| 1
| 1
| 1
| 0
|
0
| 5
|
14763e2dd64d0fdc52106ceafe15d4da5b9708c1
| 51
|
py
|
Python
|
Python How to/Python How to/07_Random_Number_0_And_1/main.py
|
jmmedel/Python-How-To-tutorial-
|
03a9675a7c744c85fd2412b313f4d9d4b833ebe3
|
[
"MIT"
] | null | null | null |
Python How to/Python How to/07_Random_Number_0_And_1/main.py
|
jmmedel/Python-How-To-tutorial-
|
03a9675a7c744c85fd2412b313f4d9d4b833ebe3
|
[
"MIT"
] | null | null | null |
Python How to/Python How to/07_Random_Number_0_And_1/main.py
|
jmmedel/Python-How-To-tutorial-
|
03a9675a7c744c85fd2412b313f4d9d4b833ebe3
|
[
"MIT"
] | null | null | null |
import numpy as np
print(np.random.randint(2))
| 17
| 28
| 0.705882
| 9
| 51
| 4
| 0.888889
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.02381
| 0.176471
| 51
| 2
| 29
| 25.5
| 0.833333
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.5
| 0
| 0.5
| 0.5
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 1
|
0
| 5
|
1484ab82f9f20c4b270e86bb7ae548fcc1614f08
| 346
|
py
|
Python
|
abstractions/python/kiota/abstractions/authentication/__init__.py
|
jasonjoh/kiota
|
d1ac436e01e0e1527403d819c2773e4dc33058b1
|
[
"MIT"
] | null | null | null |
abstractions/python/kiota/abstractions/authentication/__init__.py
|
jasonjoh/kiota
|
d1ac436e01e0e1527403d819c2773e4dc33058b1
|
[
"MIT"
] | null | null | null |
abstractions/python/kiota/abstractions/authentication/__init__.py
|
jasonjoh/kiota
|
d1ac436e01e0e1527403d819c2773e4dc33058b1
|
[
"MIT"
] | null | null | null |
from .access_token_provider import AccessTokenProvider
from .allowed_hosts_validator import AllowedHostsValidator
from .anonymous_authentication_provider import AnonymousAuthenticationProvider
from .authentication_provider import AuthenticationProvider
from .base_bearer_token_authentication_provider import BaseBearerTokenAuthenticationProvider
| 57.666667
| 92
| 0.927746
| 31
| 346
| 10
| 0.548387
| 0.180645
| 0.270968
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.057803
| 346
| 5
| 93
| 69.2
| 0.95092
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| null | 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
14a01b4e1b1173fadb36a94781c60bc7cd3b5fbd
| 3,584
|
py
|
Python
|
atom/nucleus/python/test/test_notification_api.py
|
sumit4-ttn/SDK
|
b3ae385e5415e47ac70abd0b3fdeeaeee9aa7cff
|
[
"Apache-2.0"
] | null | null | null |
atom/nucleus/python/test/test_notification_api.py
|
sumit4-ttn/SDK
|
b3ae385e5415e47ac70abd0b3fdeeaeee9aa7cff
|
[
"Apache-2.0"
] | null | null | null |
atom/nucleus/python/test/test_notification_api.py
|
sumit4-ttn/SDK
|
b3ae385e5415e47ac70abd0b3fdeeaeee9aa7cff
|
[
"Apache-2.0"
] | null | null | null |
# coding: utf-8
"""
Hydrogen Atom API
The Hydrogen Atom API # noqa: E501
OpenAPI spec version: 1.7.0
Contact: info@hydrogenplatform.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import unittest
import nucleus_api
from nucleus_api.api.notification_api import NotificationApi # noqa: E501
from nucleus_api.rest import ApiException
class TestNotificationApi(unittest.TestCase):
"""NotificationApi unit test stubs"""
def setUp(self):
self.api = nucleus_api.api.notification_api.NotificationApi() # noqa: E501
def tearDown(self):
pass
def test_create_notification_client_using_post(self):
"""Test case for create_notification_client_using_post
Create a Notification Client # noqa: E501
"""
pass
def test_create_notification_setting_using_post(self):
"""Test case for create_notification_setting_using_post
Create a Notification Setting # noqa: E501
"""
pass
def test_create_notification_using_post(self):
"""Test case for create_notification_using_post
Create a Notification # noqa: E501
"""
pass
def test_delete_notification_client_using_delete(self):
"""Test case for delete_notification_client_using_delete
Delete a Notification Client # noqa: E501
"""
pass
def test_delete_notification_setting_using_delete(self):
"""Test case for delete_notification_setting_using_delete
Delete a Notification Setting # noqa: E501
"""
pass
def test_delete_notification_using_delete(self):
"""Test case for delete_notification_using_delete
Delete a Notification # noqa: E501
"""
pass
def test_get_notification_all_using_get(self):
"""Test case for get_notification_all_using_get
Get All Notification # noqa: E501
"""
pass
def test_get_notification_client_all_using_get(self):
"""Test case for get_notification_client_all_using_get
List all Notification Client # noqa: E501
"""
pass
def test_get_notification_client_using_get(self):
"""Test case for get_notification_client_using_get
Retrieve a Notification Client # noqa: E501
"""
pass
def test_get_notification_setting_all_using_get(self):
"""Test case for get_notification_setting_all_using_get
List all Notification Setting # noqa: E501
"""
pass
def test_get_notification_setting_using_get(self):
"""Test case for get_notification_setting_using_get
Retrieve a Notification Setting # noqa: E501
"""
pass
def test_get_notification_using_get(self):
"""Test case for get_notification_using_get
Get a Notification # noqa: E501
"""
pass
def test_update_notification_client_using_put(self):
"""Test case for update_notification_client_using_put
Update a Notification Client # noqa: E501
"""
pass
def test_update_notification_setting_using_put(self):
"""Test case for update_notification_setting_using_put
Update a Notification Setting # noqa: E501
"""
pass
def test_update_notification_using_put(self):
"""Test case for update_notification_using_put
Update a Notification # noqa: E501
"""
pass
if __name__ == '__main__':
unittest.main()
| 25.6
| 83
| 0.674107
| 424
| 3,584
| 5.34434
| 0.153302
| 0.063548
| 0.072816
| 0.099294
| 0.802736
| 0.639894
| 0.624007
| 0.531774
| 0.191968
| 0
| 0
| 0.02192
| 0.261719
| 3,584
| 139
| 84
| 25.784173
| 0.834467
| 0.452846
| 0
| 0.380952
| 1
| 0
| 0.005013
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.404762
| false
| 0.380952
| 0.119048
| 0
| 0.547619
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 1
| 0
|
0
| 5
|
14ab6de36795cdabab575166a1afa2586b008dd3
| 1,186
|
py
|
Python
|
ex12.py
|
alimadeoliveiranatalia/Python
|
e80b0a32416a6b46512518c8c9fa5a08950860cf
|
[
"MIT"
] | null | null | null |
ex12.py
|
alimadeoliveiranatalia/Python
|
e80b0a32416a6b46512518c8c9fa5a08950860cf
|
[
"MIT"
] | null | null | null |
ex12.py
|
alimadeoliveiranatalia/Python
|
e80b0a32416a6b46512518c8c9fa5a08950860cf
|
[
"MIT"
] | null | null | null |
codigo = int(input('Informe o código, por favor'))
if codigo == 1:
salario = float(input('Informe o salário, por favor'))
print('Escrituário')
aumento = salario*(0.5)
novo_salario = salario+aumento
print('O Aumento foi de R$',aumento)
print('Seu salário ajustado é de R$',novo_salario)
if codigo == 2:
salario = float(input('Informe o salário, por favor'))
print('Secretária')
aumento = salario*(0.35)
novo_salario = salario+aumento
print('O aumento foi de R$',aumento)
print('Seu salário ajustado é de R$',novo_salario)
if codigo ==3:
salario = float(input('Informe o salário, por favor'))
print('Caixa')
aumento = salario*(0.2)
novo_salario = salario+aumento
print('O aumento foi de R$', aumento)
print('Seu salário ajustado é de R$',novo_salario)
if codigo == 4:
salario = float(input('Informe o salário, por favor'))
print('Gerente')
aumento = salario*(0.1)
novo_salario = salario+aumento
print('O aumento foi de R$', aumento)
print('Seu salário ajustado é de R$',novo_salario)
if codigo == 5:
print('Diretor')
print('Infelizmente veu salário não pode ser ajustado. Lamento.')
| 35.939394
| 69
| 0.663575
| 170
| 1,186
| 4.582353
| 0.229412
| 0.112965
| 0.08344
| 0.123235
| 0.72914
| 0.72914
| 0.72914
| 0.72914
| 0.72914
| 0.498074
| 0
| 0.014831
| 0.204047
| 1,186
| 33
| 69
| 35.939394
| 0.810381
| 0
| 0
| 0.46875
| 0
| 0
| 0.357203
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0.4375
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
|
0
| 5
|
14ae4c8c7c8c07ace288e73587115099d869bd26
| 10,330
|
py
|
Python
|
myuw/test/dao/test_grad.py
|
timtim17/myuw
|
d59702a8095daf049d7e57cbb1f7f2a5bebc69af
|
[
"Apache-2.0"
] | null | null | null |
myuw/test/dao/test_grad.py
|
timtim17/myuw
|
d59702a8095daf049d7e57cbb1f7f2a5bebc69af
|
[
"Apache-2.0"
] | null | null | null |
myuw/test/dao/test_grad.py
|
timtim17/myuw
|
d59702a8095daf049d7e57cbb1f7f2a5bebc69af
|
[
"Apache-2.0"
] | null | null | null |
# Copyright 2022 UW-IT, University of Washington
# SPDX-License-Identifier: Apache-2.0
from datetime import date, datetime, timedelta
from django.test import TestCase
from django.conf import settings
from django.test.utils import override_settings
from myuw.dao.grad import get_grad_degree_for_current_user,\
get_grad_committee_for_current_user, get_grad_leave_for_current_user,\
get_grad_petition_for_current_user, leave_to_json, petition_to_json,\
is_before_eof_2weeks_since_decision_date, degree_to_json,\
committee_to_json
from myuw.test import get_request_with_date, get_request_with_user
from uw_grad.util import fdao_grad_override
@fdao_grad_override
class TestDaoGrad(TestCase):
def test_get_grad_committee(self):
req = get_request_with_user("seagrad")
committee_reqs = get_grad_committee_for_current_user(req)
self.assertIsNotNone(committee_reqs)
self.assertEquals(len(committee_reqs), 3)
json_data = committee_to_json(committee_reqs)
self.assertIsNotNone(json_data)
self.assertEquals(len(json_data), 3)
self.assertEquals(len(json_data[1]['members']), 3)
self.assertEquals(len(json_data[2]['members']), 4)
req = get_request_with_user("botgrad")
committee_reqs = get_grad_committee_for_current_user(req)
self.assertEquals(len(committee_reqs), 0)
self.assertIsNone(committee_to_json(committee_reqs))
def test_get_grad_degree(self):
req = get_request_with_user("tacgrad")
degree_reqs = get_grad_degree_for_current_user(req)
self.assertIsNotNone(degree_reqs)
self.assertEquals(len(degree_reqs), 0)
self.assertIsNone(degree_to_json(degree_reqs, req))
req = get_request_with_user("seagrad")
degree_reqs = get_grad_degree_for_current_user(req)
self.assertIsNotNone(degree_reqs)
self.assertEquals(len(degree_reqs), 8)
now_request = get_request_with_date("2013-04-24")
json_data = degree_to_json(degree_reqs, now_request)
self.assertEquals(len(json_data), 8)
degree = json_data[4]
self.assertEquals(degree["status"], "Withdrawn")
now_request = get_request_with_date("2013-04-25")
json_data = degree_to_json(degree_reqs, now_request)
self.assertEquals(len(json_data), 7)
degree = json_data[4]
self.assertEquals(degree["status"], "Candidacy Granted")
now_request = get_request_with_date("2013-08-27")
json_data = degree_to_json(degree_reqs, now_request)
self.assertEquals(len(json_data), 7)
degree = json_data[0]
self.assertTrue(degree["status"].startswith("Awaiting "))
degree = json_data[1]
self.assertTrue(degree["status"].startswith("Awaiting "))
degree = json_data[2]
self.assertTrue(degree["status"].startswith("Awaiting "))
degree = json_data[3]
self.assertEquals(degree["status"], "Recommended by Dept")
degree = json_data[4]
self.assertEquals(degree["status"], "Candidacy Granted")
degree = json_data[5]
self.assertEquals(degree["status"], "Graduated by Grad School")
degree = json_data[6]
self.assertEquals(degree["status"], "Did Not Graduate")
# after the end of following term
now_request = get_request_with_date("2013-08-28")
json_data = degree_to_json(degree_reqs, now_request)
self.assertEquals(len(json_data), 4)
degree = json_data[0]
self.assertTrue(degree["status"].startswith("Awaiting "))
degree = json_data[1]
self.assertTrue(degree["status"].startswith("Awaiting "))
degree = json_data[2]
self.assertTrue(degree["status"].startswith("Awaiting "))
degree = json_data[3]
self.assertEquals(degree["status"], "Recommended by Dept")
def test_is_before_eof_2weeks_since_decision_date(self):
self.assertTrue(is_before_eof_2weeks_since_decision_date(
datetime(2013, 2, 10, 0, 0, 0),
datetime(2013, 2, 24, 0, 0, 0)))
self.assertFalse(is_before_eof_2weeks_since_decision_date(
datetime(2013, 2, 10, 0, 0, 0),
datetime(2013, 2, 25, 0, 0, 0)))
self.assertTrue(is_before_eof_2weeks_since_decision_date(
datetime(2013, 6, 10, 0, 0, 0),
datetime(2013, 6, 10, 0, 0, 0)))
self.assertTrue(is_before_eof_2weeks_since_decision_date(
None,
datetime(2013, 6, 10, 0, 0, 0)))
def test_get_grad_leave(self):
req = get_request_with_user("botgrad")
leave_reqs = get_grad_leave_for_current_user(req)
self.assertIsNotNone(leave_reqs)
self.assertEquals(len(leave_reqs), 0)
self.assertIsNone(leave_to_json(leave_reqs, req))
req = get_request_with_user("seagrad")
leave_reqs = get_grad_leave_for_current_user(req)
self.assertIsNotNone(leave_reqs)
self.assertEquals(len(leave_reqs), 5)
now_request = get_request_with_date("2012-12-07")
json_data = leave_to_json(leave_reqs, now_request)
self.assertEquals(len(json_data), 5)
leave = json_data[2]
self.assertEquals(leave["status"], "Paid")
leave = json_data[3]
self.assertEquals(leave["status"], "Denied")
# denied shows until eof 2012 autumn
leave = json_data[4]
self.assertEquals(leave["status"], "Approved")
# the 1st approved shows until eof last instruction 2012 autumn
# the 2nd approved shows until eof last instruction 2013 spring
self.assertEquals(len(leave["terms"]), 2)
now_request = get_request_with_date("2012-12-08")
json_data = leave_to_json(leave_reqs, now_request)
self.assertEquals(len(json_data), 5)
leave = json_data[2]
self.assertEquals(leave["status"], "Paid")
# paid shows until eof 2013 winter
leave = json_data[4]
self.assertEquals(leave["status"], "Approved")
self.assertEquals(len(leave["terms"]), 2)
now_request = get_request_with_date("2013-01-07")
json_data = leave_to_json(leave_reqs, now_request)
self.assertEquals(len(json_data), 4)
leave = json_data[2]
self.assertEquals(leave["status"], "Paid")
# paid shows until eof 2013 winter
leave = json_data[3]
self.assertEquals(leave["status"], "Approved")
# the end of winter 2013
now_request = get_request_with_date("2013-03-27")
json_data = leave_to_json(leave_reqs, now_request)
self.assertEquals(len(json_data), 3)
leave = json_data[0]
self.assertEquals(leave["status"], "Requested")
leave = json_data[1]
self.assertEquals(leave["status"], "Withdrawn")
leave = json_data[2]
self.assertEquals(leave["status"], "Approved")
self.assertEquals(len(leave["terms"]), 1)
# this approved shows until eof last instruction 2013 spring
now_request = get_request_with_date("2013-06-07")
json_data = leave_to_json(leave_reqs, now_request)
self.assertEquals(len(json_data), 3)
leave = json_data[0]
self.assertEquals(leave["status"], "Requested")
leave = json_data[1]
self.assertEquals(leave["status"], "Withdrawn")
leave = json_data[2]
self.assertEquals(leave["status"], "Approved")
self.assertEquals(len(leave["terms"]), 1)
# this approved shows until eof last instruction 2013 spring
now_request = get_request_with_date("2013-06-08")
json_data = leave_to_json(leave_reqs, now_request)
self.assertEquals(len(json_data), 2)
leave = json_data[0]
self.assertEquals(leave["status"], "Requested")
leave = json_data[1]
self.assertEquals(leave["status"], "Withdrawn")
# withdrawn shows until eof 2013 summer
now_request = get_request_with_date("2013-08-28")
json_data = leave_to_json(leave_reqs, now_request)
self.assertEquals(len(json_data), 1)
leave = json_data[0]
self.assertEquals(leave["status"], "Requested")
# requested always shows
req = get_request_with_user("tacgrad")
leave_reqs = get_grad_leave_for_current_user(req)
self.assertIsNotNone(leave_reqs)
self.assertEquals(len(leave_reqs), 7)
now_request = get_request_with_date("2014-06-19")
json_data = leave_to_json(leave_reqs, now_request)
self.assertIsNone(json_data, 0)
def test_get_grad_petition(self):
req = get_request_with_user("botgrad")
petition_reqs = get_grad_petition_for_current_user(req)
self.assertEquals(len(petition_reqs), 0)
self.assertIsNone(petition_to_json(petition_reqs, req))
req = get_request_with_user("seagrad")
petition_reqs = get_grad_petition_for_current_user(req)
self.assertIsNotNone(petition_reqs)
self.assertEquals(len(petition_reqs), 7)
now_request = get_request_with_date("2013-04-10")
json_data = petition_to_json(petition_reqs, now_request)
self.assertEquals(len(json_data), 7)
peti = json_data[0]
self.assertEqual(peti["dept_recommend"], "Pending")
self.assertEqual(peti["gradschool_decision"], "Pending")
peti = json_data[1]
self.assertEquals(peti["decision_date"], "2013-04-10T00:00:00")
self.assertEqual(peti["dept_recommend"], "Withdraw")
self.assertEqual(peti["gradschool_decision"], "Withdraw")
now_request = get_request_with_date("2013-04-25")
json_data = petition_to_json(petition_reqs, now_request)
self.assertEquals(len(json_data), 3)
peti = json_data[0]
self.assertEqual(peti["dept_recommend"], "Pending")
self.assertEqual(peti["gradschool_decision"], "Pending")
peti = json_data[1]
self.assertIsNone(peti["decision_date"])
self.assertEqual(peti["dept_recommend"], "Deny")
self.assertEqual(peti["gradschool_decision"], "Pending")
peti = json_data[2]
self.assertIsNone(peti["decision_date"])
self.assertEqual(peti["dept_recommend"], "Approve")
self.assertEqual(peti["gradschool_decision"], "Pending")
| 44.718615
| 74
| 0.671249
| 1,324
| 10,330
| 4.940332
| 0.102719
| 0.081945
| 0.084238
| 0.056261
| 0.843602
| 0.79682
| 0.729093
| 0.69286
| 0.625745
| 0.601284
| 0
| 0.0386
| 0.217522
| 10,330
| 230
| 75
| 44.913043
| 0.77063
| 0.052372
| 0
| 0.651282
| 0
| 0
| 0.102199
| 0
| 0
| 0
| 0
| 0
| 0.451282
| 1
| 0.025641
| false
| 0
| 0.035897
| 0
| 0.066667
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 1
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
211d0cece4f1fe60181596c3d1e89dda12fe9763
| 116
|
py
|
Python
|
app/Sqs.py
|
LouisDG6/SQS_backend
|
ab9844f179c01462617f5338e0e9f1e8ad757087
|
[
"MIT"
] | null | null | null |
app/Sqs.py
|
LouisDG6/SQS_backend
|
ab9844f179c01462617f5338e0e9f1e8ad757087
|
[
"MIT"
] | null | null | null |
app/Sqs.py
|
LouisDG6/SQS_backend
|
ab9844f179c01462617f5338e0e9f1e8ad757087
|
[
"MIT"
] | null | null | null |
"""Sqs Model."""
from masoniteorm.models import Model
class Sqs(Model):
"""Sqs Model."""
__table__="sqss"
| 14.5
| 36
| 0.637931
| 14
| 116
| 5
| 0.642857
| 0.342857
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.181034
| 116
| 8
| 37
| 14.5
| 0.736842
| 0.181034
| 0
| 0
| 0
| 0
| 0.047059
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.333333
| 0
| 1
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.