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
3abc7d925777e8ec9f86ea59bf36e7c8c12dc06e
421
py
Python
FreeTAKServer/model/ReceiveConnectionsProcess.py
logikal/FreeTakServer
c0916ce65781b5c60079d6440e52db8fc6ee0467
[ "MIT" ]
27
2020-05-01T01:45:59.000Z
2020-07-03T00:17:13.000Z
FreeTAKServer/model/ReceiveConnectionsProcess.py
logikal/FreeTakServer
c0916ce65781b5c60079d6440e52db8fc6ee0467
[ "MIT" ]
34
2020-04-26T11:25:52.000Z
2020-07-03T21:06:34.000Z
FreeTAKServer/model/ReceiveConnectionsProcess.py
logikal/FreeTakServer
c0916ce65781b5c60079d6440e52db8fc6ee0467
[ "MIT" ]
15
2020-05-01T01:46:07.000Z
2020-07-03T12:14:04.000Z
####################################################### # # ReceiveConnectionsProcess.py # Python implementation of the Class ReceiveConnectionsProcess # Generated by Enterprise Architect # Created on: 21-May-2020 9:47:41 AM # Original author: Natha Paquette # ####################################################### class ReceiveConnectionsProcess: def __init__(self): self.receiveConnections = ""
30.071429
62
0.548694
32
421
7.09375
0.875
0.264317
0
0
0
0
0
0
0
0
0
0.030303
0.137767
421
13
63
32.384615
0.595041
0.463183
0
0
1
0
0
0
0
0
0
0
0
1
0.333333
false
0
0
0
0.666667
0
0
0
0
null
1
0
0
0
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
0
0
0
1
0
0
4
3ae6bd04cde51077e5a125685ba8b9f4001297a8
313
py
Python
modules/lib/wifi/__init__.py
yansinan/pycameresp
e239b4db110bffeb6bbdae6930d2b78562d21e35
[ "MIT" ]
28
2021-01-19T10:53:20.000Z
2022-03-24T13:57:09.000Z
modules/lib/wifi/__init__.py
yansinan/pycameresp
e239b4db110bffeb6bbdae6930d2b78562d21e35
[ "MIT" ]
5
2021-02-28T23:00:23.000Z
2022-03-30T07:36:21.000Z
modules/lib/wifi/__init__.py
yansinan/pycameresp
e239b4db110bffeb6bbdae6930d2b78562d21e35
[ "MIT" ]
9
2021-02-28T23:01:37.000Z
2022-03-24T13:57:18.000Z
# Distributed under MIT License # Copyright (c) 2021 Remi BERTHOLET """ Class to manage wifi and access point """ # from wifi.hostname import * from wifi.accesspoint import * from wifi.station import * from wifi.wifi import * AUTHMODE = {0: b"open", 1: b"WEP", 2: b"WPA-PSK", 3: b"WPA2-PSK", 4: b"WPA/WPA2-PSK"}
31.3
85
0.696486
52
313
4.192308
0.634615
0.146789
0.192661
0
0
0
0
0
0
0
0
0.041825
0.159744
313
9
86
34.777778
0.787072
0.41853
0
0
0
0
0.196532
0
0
0
0
0
0
1
0
false
0
0.75
0
0.75
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
0
0
1
0
1
0
0
4
aaf474960b0118f2247e4af0cf5a6c1010eed3b4
8,589
py
Python
device_e2e/sync/test_sync_send_message.py
dt-boringtao/azure-iot-sdk-python
35a09679bdf4d7a727391b265a8f1fbb99a30c45
[ "MIT" ]
null
null
null
device_e2e/sync/test_sync_send_message.py
dt-boringtao/azure-iot-sdk-python
35a09679bdf4d7a727391b265a8f1fbb99a30c45
[ "MIT" ]
null
null
null
device_e2e/sync/test_sync_send_message.py
dt-boringtao/azure-iot-sdk-python
35a09679bdf4d7a727391b265a8f1fbb99a30c45
[ "MIT" ]
null
null
null
# Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. import pytest import logging import json import time import utils from azure.iot.device.exceptions import OperationCancelled, ClientError logger = logging.getLogger(__name__) logger.setLevel(level=logging.INFO) @pytest.mark.describe("Client send_message method") class TestSendMessage(object): @pytest.mark.it("Can send a simple message") @pytest.mark.quicktest_suite def test_sync_send_message_simple(self, client, random_message, service_helper, leak_tracker): leak_tracker.set_initial_object_list() client.send_message(random_message) event = service_helper.wait_for_eventhub_arrival(random_message.message_id) assert json.dumps(event.message_body) == random_message.data leak_tracker.check_for_leaks() @pytest.mark.it("Connects the transport if necessary") @pytest.mark.quicktest_suite def test_sync_connect_if_necessary(self, client, random_message, service_helper, leak_tracker): leak_tracker.set_initial_object_list() client.disconnect() assert not client.connected client.send_message(random_message) assert client.connected event = service_helper.wait_for_eventhub_arrival(random_message.message_id) assert json.dumps(event.message_body) == random_message.data leak_tracker.check_for_leaks() @pytest.mark.it("Raises correct exception for un-serializable payload") def test_sync_bad_payload_raises(self, client, leak_tracker): leak_tracker.set_initial_object_list() # There's no way to serialize a function. def thing_that_cant_serialize(): pass with pytest.raises(ClientError) as e_info: client.send_message(thing_that_cant_serialize) assert isinstance(e_info.value.__cause__, TypeError) # TODO; investigate this leak # leak_tracker.check_for_leaks() @pytest.mark.it("Can send a JSON-formatted string that isn't wrapped in a Message object") def test_sync_sends_json_string(self, client, service_helper, leak_tracker): leak_tracker.set_initial_object_list() message = json.dumps(utils.get_random_dict()) client.send_message(message) event = service_helper.wait_for_eventhub_arrival(None) assert json.dumps(event.message_body) == message leak_tracker.check_for_leaks() @pytest.mark.it("Can send a random string that isn't wrapped in a Message object") def test_sync_sends_random_string(self, client, service_helper, leak_tracker): leak_tracker.set_initial_object_list() message = utils.get_random_string(16) client.send_message(message) event = service_helper.wait_for_eventhub_arrival(None) assert event.message_body == message leak_tracker.check_for_leaks() @pytest.mark.dropped_connection @pytest.mark.describe("Client send_message method with dropped connections") @pytest.mark.keep_alive(5) class TestSendMessageDroppedConnection(object): @pytest.mark.it("Sends if connection drops before sending") @pytest.mark.uses_iptables def test_sync_sends_if_drop_before_sending( self, client, random_message, dropper, service_helper, executor, leak_tracker ): leak_tracker.set_initial_object_list() assert client.connected dropper.drop_outgoing() send_task = executor.submit(client.send_message, random_message) while client.connected: time.sleep(1) assert not send_task.done() dropper.restore_all() while not client.connected: time.sleep(1) send_task.result() event = service_helper.wait_for_eventhub_arrival(random_message.message_id) assert json.dumps(event.message_body) == random_message.data random_message = None # so this doesn't get tagged as a leak leak_tracker.check_for_leaks() @pytest.mark.it("Sends if connection rejects send") @pytest.mark.uses_iptables def test_sync_sends_if_reject_before_sending( self, client, random_message, dropper, service_helper, executor, leak_tracker ): leak_tracker.set_initial_object_list() assert client.connected dropper.reject_outgoing() send_task = executor.submit(client.send_message, random_message) while client.connected: time.sleep(1) assert not send_task.done() dropper.restore_all() while not client.connected: time.sleep(1) send_task.result() event = service_helper.wait_for_eventhub_arrival(random_message.message_id) assert json.dumps(event.message_body) == random_message.data random_message = None # so this doesn't get tagged as a leak leak_tracker.check_for_leaks() @pytest.mark.describe("Client send_message with reconnect disabled") @pytest.mark.keep_alive(5) @pytest.mark.connection_retry(False) class TestSendMessageRetryDisabled(object): @pytest.fixture(scope="function", autouse=True) def reconnect_after_test(self, dropper, client): yield dropper.restore_all() client.connect() assert client.connected @pytest.mark.it("Can send a simple message") def test_sync_send_message_simple_with_retry_disabled( self, client, random_message, service_helper, leak_tracker ): leak_tracker.set_initial_object_list() client.send_message(random_message) event = service_helper.wait_for_eventhub_arrival(random_message.message_id) assert json.dumps(event.message_body) == random_message.data leak_tracker.check_for_leaks() @pytest.mark.it("Automatically connects if transport manually disconnected before sending") def test_sync_connect_if_necessary_with_retry_disabled( self, client, random_message, service_helper, leak_tracker ): leak_tracker.set_initial_object_list() client.disconnect() assert not client.connected client.send_message(random_message) assert client.connected event = service_helper.wait_for_eventhub_arrival(random_message.message_id) assert json.dumps(event.message_body) == random_message.data leak_tracker.check_for_leaks() @pytest.mark.it("Automatically connects if transport automatically disconnected before sending") @pytest.mark.uses_iptables def test_sync_connects_after_automatic_disconnect_with_retry_disabled( self, client, random_message, dropper, service_helper, leak_tracker ): leak_tracker.set_initial_object_list() assert client.connected dropper.drop_outgoing() while client.connected: time.sleep(1) assert not client.connected dropper.restore_all() client.send_message(random_message) assert client.connected event = service_helper.wait_for_eventhub_arrival(random_message.message_id) assert json.dumps(event.message_body) == random_message.data leak_tracker.check_for_leaks() @pytest.mark.it("Fails if connection disconnects before sending") @pytest.mark.uses_iptables def test_sync_fails_if_disconnect_before_sending_with_retry_disabled( self, client, random_message, dropper, executor, leak_tracker ): leak_tracker.set_initial_object_list() assert client.connected dropper.drop_outgoing() send_task = executor.submit(client.send_message, random_message) while client.connected: time.sleep(1) with pytest.raises(OperationCancelled): send_task.result() random_message = None # So this doesn't get tagged as a leak # TODO: investigate this leak # leak_tracker.check_for_leaks() @pytest.mark.it("Fails if connection drops before sending") @pytest.mark.uses_iptables def test_sync_fails_if_drop_before_sending_with_retry_disabled( self, client, random_message, dropper, leak_tracker ): leak_tracker.set_initial_object_list() assert client.connected dropper.drop_outgoing() with pytest.raises(OperationCancelled): client.send_message(random_message) assert not client.connected random_message = None # So this doesn't get tagged as a leak # TODO: investigate this leak # leak_tracker.check_for_leaks()
33.814961
100
0.719525
1,071
8,589
5.462185
0.156863
0.08
0.04359
0.045128
0.78359
0.776752
0.743248
0.717265
0.684103
0.667863
0
0.001465
0.205146
8,589
253
101
33.948617
0.855427
0.05996
0
0.678363
0
0
0.087604
0
0
0
0
0.003953
0.146199
1
0.081871
false
0.005848
0.035088
0
0.134503
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
0
0
0
4
c914c4ee3440cedd3b76ea9df5ff71cf4046f7fc
345
py
Python
authors/pagination.py
zhpeng811/social.distance
d7a15cae817fc1aed31c460577de22a37bdfb6d3
[ "W3C-20150513" ]
6
2021-12-01T01:29:22.000Z
2021-12-07T02:13:33.000Z
authors/pagination.py
zhpeng811/social.distance
d7a15cae817fc1aed31c460577de22a37bdfb6d3
[ "W3C-20150513" ]
7
2021-09-26T22:17:58.000Z
2021-11-19T04:03:16.000Z
authors/pagination.py
CMPUT404Fall2021-6803d618/social.distance
d7a15cae817fc1aed31c460577de22a37bdfb6d3
[ "W3C-20150513" ]
null
null
null
from social_distance.pagination import PageSizePagination class AuthorsPagination(PageSizePagination): type = 'authors' class FollowingsPagination(PageSizePagination): type = 'followings' class FollowersPagination(PageSizePagination): type = 'followers' class InboxObjectsPagination(PageSizePagination): type = 'inbox_objects'
28.75
57
0.805797
27
345
10.222222
0.62963
0.318841
0
0
0
0
0
0
0
0
0
0
0.121739
345
12
58
28.75
0.910891
0
0
0
0
0
0.112717
0
0
0
0
0
0
1
0
false
0
0.111111
0
1
0
1
0
1
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
0
0
0
0
0
1
0
0
4
c929f841f6b842f44e55cab97caa12186bf37a8b
96
py
Python
scan_models/apps.py
jessielaf/django-scan-models
ec32ee49c42cb5e567cbae8b9bff2eb3cc18261a
[ "MIT" ]
29
2020-03-18T19:37:18.000Z
2021-12-07T09:36:51.000Z
scan_models/apps.py
jessielaf/django-scan-models
ec32ee49c42cb5e567cbae8b9bff2eb3cc18261a
[ "MIT" ]
null
null
null
scan_models/apps.py
jessielaf/django-scan-models
ec32ee49c42cb5e567cbae8b9bff2eb3cc18261a
[ "MIT" ]
null
null
null
from django.apps import AppConfig class ScanModelsConfig(AppConfig): name = "scan_models"
16
34
0.770833
11
96
6.636364
0.909091
0
0
0
0
0
0
0
0
0
0
0
0.15625
96
5
35
19.2
0.901235
0
0
0
0
0
0.114583
0
0
0
0
0
0
1
0
false
0
0.333333
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
0
0
1
0
1
0
0
4
c931207a5b860f590da67c6957e6733cb11b4ba4
33,840
py
Python
sphinx_aimms_theme/AIMMSLexer.py
aimms/sphinx-aimms-theme
5cc16b48efcda8d415faa759dfa5fa334a2c53d3
[ "MIT" ]
null
null
null
sphinx_aimms_theme/AIMMSLexer.py
aimms/sphinx-aimms-theme
5cc16b48efcda8d415faa759dfa5fa334a2c53d3
[ "MIT" ]
null
null
null
sphinx_aimms_theme/AIMMSLexer.py
aimms/sphinx-aimms-theme
5cc16b48efcda8d415faa759dfa5fa334a2c53d3
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- """ pygments.lexers.aimms ~~~~~~~~~~~~~~~~~~~~ Lexers for the AIMMS language. <https://aimms.com/> :version: 18 Oct 2018 :copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re from pygments.lexer import RegexLexer, bygroups, using, this, words from pygments.token import Text, Comment, Operator, Keyword, Name, String, \ Number, Punctuation, Token, Whitespace, Error __all__ = ['AIMMSLexer'] # Here is the regex to find every identifier declaration, used later on the get_tokens_unprocessed id_re = re.compile(r'(?i)(Set|Calendar|Horizon|index|Parameter|ElementParameter|StringParameter|UnitParameter|Variable|elementvariable|complementarityvariable|Constraint|Arc|Node|uncertaintyvariable|uncertaintyconstraint|Activity|Resource|MathematicalProgram|Macro|Model|Assertion|DatabaseTable|DatabaseProcedure|File|Procedure|Function|Quantity|Convention|LibraryModule|Module|Section|Declaration|ExternalProcedure|File)(?:\s+)(\w+)(\s*\{|\s*;|\s*:)') # Create new Tokens for main identifier types (Parameters,EP,SP,Set, Variable, Constraint, etc.) Token.Name.Set Token.Name.Parameter Token.Name.StringParameter Token.Name.UnitParameter Token.Name.ElementParameter Token.Name.Variable Token.Name.Constraint Token.Name.MathematicalProgram Token.Name.Quantity Token.Name.DatabaseTable Token.Name.Convention Token.Name.Index Token.Name.Procedure Token.Name.Calendar def switcher(argument): Types = { "Set":Name.Set, "Parameter":Name.Parameter, "StringParameter":Name.StringParameter, "UnitParameter":Name.UnitParameter, "ElementParameter":Name.ElementParameter, "Variable":Name.Variable, "Constraint":Name.Constraint, "MathematicalProgram":Name.MathematicalProgram, "Quantity":Name.Quantity, "DatabaseTable":Name.DatabaseTable, "Calendar":Name.Calendar, "Convention":Name.Convention, "Procedure":Name.Procedure, "Index":Name.Index} return Types.get(argument, Name.Variable) class AIMMSLexer(RegexLexer): """ For AIMMS source code. .. versionadded:: 0.1 """ name = 'AIMMS' aliases = ['aimms'] filenames = ['*.aimms','*.ams'] tokens = { 'root': [ (r'\n', Text), (r'\s+', Text.Whitespace), #Comments inside procedures (r'!.*?\n', Comment.Single), (r'/[*](.|\n)*?[*]/', Comment.Multiline), #For AMS files, forces a Comment attribute block to be just a comment, nothing else, weather it is Comment: ... or Comment: {...} (r'(Comment\s*:\s+{?)((.|\n)+?)([};])\n',bygroups(Name.Attribute, Comment.Multiline, Name.Attribute)), #For AMS files, matches all Attributes from any Identifier declaration (r'(\w+)(:)(\s+)', bygroups(Name.Attribute,Operator,Text.Whitespace)), #For AMS Files, matches all function arguments pre formatted (r'(\b\w+)(\s+:\s+\b|\s+:\s+\B)', bygroups(Name.Argument, Text)), # AllKeywords: to be blue! # TODO: put this list outside (words(('from','Adjustable','affine','AIMMS','and','append','apply','arc','argmax','argmin','array','ASCII','assert','assertion','Atleast', 'Atmost','Automatic','backup','binary','Block','boolean','Bounded','bounds','Box','break','by','calendar','Chance','checking', 'cleandependents','cleanup','code','CoefficientRange','Coefficients','Coldim','ColsPerLine','Columns','comment','Complementarity', 'composite','constant','constraint','constraints','Contiguous','convention','conversions','ConvexHull','ConvexHullEx','COP','count', 'cross','CSP','data','database','decimals','declaration','default','definition','delta','dense','Dependency','device','direction', 'disk','display','Distribution','do','double','elementnumber','Ellipsoid','else','elseif','empty','EmptyElementAllowed','encoding', 'EndBlock','endfor','endfunction','endif','EndLibraryModule','endmodel','endmodule','endprocedure','endrepeat','endsection', 'endswitch','endwhile','error','exactly','exec','exists','FailCount','file','filedate','filtering','For','ForAll','fortran', 'FortranConventions','free','function','Gaussian','halt','handle','horizon','identifier','identifiers','if','in','inactive', 'IncludeInCutPool','IncludeInLazyConstraintPool','index','indicator','IndicatorConstraint','indices','inf','inline','inout','input', 'insert','integer','integer16','integer32','integer8','interface','Intersection','IsDiversificationFilter','IsRangeFilter','Level', 'levels','library','LibraryModule','loopcount','LP','LS','macro','main','mathematical','maximize','maxint','MCP','merge','method', 'minimize','MINLP','MIP','MIQCP','MIQP','mode','model','module','MPCC','na','NBest','negative','netinflow','netoutflow','network', 'NLP','NLS','node','nondefault','none','nonnegative','nonpositive','nosave','not','nth','off','on','onerror','only','onlyif', 'option','Optional','options','or','ordinalnumber','output','parallel','parameter','parameters','penalty','positive','prefix', 'procedure','prod','program','property','protected','public','put','putclose','putft','puthd','putpage','QCP','QP','quantity', 'raise','Random','raw','read','ReadOnly','Rebuild','ReducedCost','relation','repeat','replace','retainspecials','RetainsValue', 'return','RightHandSideRange','RMINLP','RMIP','Rowdim','Rows','section','semicontinuous','sequential','set','ShadowPrice', 'ShadowPriceRange','skip','solve','Sort','sos1','sos2','source','sparse','stochastic','string','subject','subset','suffix','sum', 'support','switch','Symmetric','table','tags','tensor','then','to','transitionOnlyNext','truncate','tuple','type','Uncertain', 'undf','Unicode','Unimodal','Union','unordered','update','user','UseResultSet','Utf8','ValueRange','variable','variables', 'violation','void','WarnOnly','when','where','while','window','with','work','write','xor','zero'), prefix=r'(?i)',suffix=r'\b'), Keyword.Reserved), # AllPredeclaredIdentifiers: to be red! # TODO: put this list outside (words(('Aimms_predefined','Predeclared_Identifiers','System_Settings_Related_Identifiers','AllSymbols','IndexSymbols', 'AllAimmsStringConstantElements','IndexAimmsStringConstantElements','AimmsStringConstants','AllOptions','IndexOptions', 'AllPredeclaredIdentifiers','IndexPredeclaredIdentifiers','AllKeywords','IndexKeywords','AllSolvers','IndexSolvers', 'AllGMPExtensions','IndexGMPExtensions','AllColors','IndexColors','AllCharacterEncodings','IndexCharacterEncodings', 'ASCIICharacterEncodings','IndexASCIICharacterEncodings','UnicodeCharacterEncodings','IndexUnicodeCharacterEncodings', 'ASCIIUnicodeCharacterEncodings','IndexASCIIUnicodeCharacterEncodings','AllAvailableCharacterEncodings', 'IndexAvailableCharacterEncodings','AllAuthorizationLevels','IndexAuthorizationLevels','CurrentAuthorizationLevel','CurrentUser', 'CurrentGroup','ProfilerData','CurrentSolver','CurrentDefaultCaseType','Language_Related_Identifiers','AggregationTypes', 'IndexAggregationTypes','AllAttributeNames','IndexAttributeNames','AllColumnTypes','IndexColumnTypes','AllIdentifierTypes', 'IndexIdentifierTypes','AllIsolationLevels','IndexIsolationLevels','AllFileAttributes','IndexFileAttributes', 'AllDataColumnCharacteristics','IndexDataColumnCharacteristics','AllDatabaseInterfaces','IndexDatabaseInterfaces', 'AllDatasourceProperties','IndexDatasourceProperties','AllMathematicalProgrammingTypes','IndexMathematicalProgrammingTypes', 'AllMatrixManipulationDirections','IndexMatrixManipulationDirections','AllMatrixManipulationProgrammingTypes', 'IndexMatrixManipulationProgrammingTypes','AllRowColumnStatuses','IndexRowColumnStatusess','AllRowTypes','IndexRowTypes', 'AllMathematicalProgrammingRowTypes','IndexMathematicalProgrammingRowTypes','AllConstraintProgrammingRowTypes', 'IndexConstraintProgrammingRowTypes','AllSolutionStates','IndexSolutionStates','AllBasicValues','IndexBasicValues', 'AllChanceApproximationTypes','IndexChanceApproximationTypes','AllSolverInterrupts','IndexSolverInterrupts','AllExecutionStatuses', 'IndexExecutionStatus','AllStochasticGenerationModes','IndexStochasticGenerationModes','AllIntrinsics','IndexIntrinsics', 'AllProfilerTypes','IndexProfilerTypes','AllSuffixNames','IndexSuffixNames','AllDifferencingModes','IndexDifferencingModes', 'AllCaseComparisonModes','IndexCaseComparisonModes','AllValueKeywords','IndexValueKeywords','AllViolationTypes', 'IndexViolationTypes','ContinueAbort','IndexContinueAbort','DiskWindowVoid','IndexDiskWindowVoid','Integers','IndexIntegers', 'MaximizingMinimizing','IndexMaximizingMinimizing','CreatePresolvedLevels','IndexCreatePresolvedLevels','MergeReplace', 'IndexMergeReplace','DatabaseWriteModes','IndexDatabaseWriteModes','OnOff','IndexOnOff','TimeslotCharacteristics', 'IndexTimeslotCharacteristics','YesNo','IndexYesNo','Model_Related_Identifiers','AllAssertions','IndexAssertions','AllConstraints', 'IndexConstraints','AllConventions','IndexConventions','AllDatabaseTables','IndexDatabaseTables','AllDefinedParameters', 'IndexDefinedParameters','AllDefinedSets','IndexDefinedSets','AllFiles','IndexFiles','AllFunctions','IndexFunctions', 'AllGeneratedMathematicalPrograms','IndexGeneratedMathematicalPrograms','AllIdentifiers','IndexIdentifiers', 'SecondIndexIdentifiers','AllIndices','IndexIndices','AllIntegerVariables','IndexIntegerVariables','AllMacros','IndexMacros', 'AllMathematicalPrograms','IndexMathematicalPrograms','AllNonlinearConstraints','IndexNonlinearConstraints','AllParameters', 'IndexParameters','AllProcedures','IndexProcedures','AllQuantities','IndexQuantities','AllSections','IndexSections','AllSets', 'IndexSets','AllSolverSessionCompletionObjects','IndexSolverSessionCompletionObjects','AllSolverSessions','IndexSolverSessions', 'AllGMPEvents','IndexGMPEvents','AllStochasticParameters','IndexStochasticParameters','AllStochasticVariables', 'IndexStochasticVariables','AllStochasticConstraints','IndexStochasticConstraints','AllSubsetsOfAllIdentifiers', 'IndexSubsetsOfAllIdentifiers','AllUpdatableIdentifiers','IndexUpdatableIdentifiers','AllUncertainParameters', 'IndexUncertainParameters','AllUncertaintyConstraints','IndexUncertaintyConstraints','AllVariables','IndexVariables', 'AllVariablesConstraints','IndexVariablesConstraints','Execution_State_Related_Identifiers','AllProgressCategories', 'IndexProgressCategories','AllStochasticScenarios','IndexStochasticScenarios','CurrentAutoUpdatedDefinitions', 'IndexCurrentAutoUpdatedDefinitions','CurrentErrorMessage','CurrentFile','CurrentFileName','CurrentGeneratedMathematicalProgram', 'CurrentInputs','IndexCurrentInputs','CurrentPageNumber','CurrentMatrixBlockSizes','ODBCDateTimeFormat','CurrentMatrixRowCount', 'CurrentMatrixColumnCount','Case_Management_Related_Identifiers','AllCases','IndexCases','AllCaseTypes','IndexCaseTypes', 'AllDataCategories','IndexDataCategories','AllDataFiles','IndexDataFiles','AllDataSets','IndexDataSets','CurrentCase', 'CurrentCaseSelection','IndexCurrentCaseSelection','CurrentDataset','DataManagementMonitorID','CurrentCaseFileContentType', 'AllCaseFileContentTypes','IndexCaseFileContentTypes','CaseFileURL','Date_Time_Related_Identifiers','AllAbbrMonths', 'IndexAbbrMonths','AllAbbrWeekdays','IndexAbbrWeekdays','AllMonths','IndexMonths','AllTimeZones','IndexTimeZones','AllWeekdays', 'IndexWeekdays','LocaleAllAbbrMonths','LocaleIndexAbbrMonths','LocaleAllAbbrWeekdays','LocaleIndexAbbrWeekdays','LocaleAllMonths', 'LocaleIndexMonths','LocaleAllWeekdays','LocaleIndexWeekdays','LocaleLongDateFormat','LocaleShortDateFormat','LocaleTimeFormat', 'LocaleTimeZoneName','LocaleTimeZoneNameDST','ConstraintProgramming','cp','ErrorHandling','errh','errh::ErrorHandlingIdentifiers', 'errh::AllErrorSeverities','errh::IndexErrorSeverities','errh::AllErrorCategories','errh::IndexErrorCategories','errh::ErrorCodes', 'errh::IndexErrorCodes','errh::PendingErrors','errh::IndexPendingErrors'), prefix=r'\b(?i)', suffix=r'\b'), Name.Builtin), #Matches any string (r'\"(?:[^"\\]|\\.)*\"', String.Double), (r'\'(?:[^\'\\]|\\.)*\'', String.Single), #Matches any punctuation (parentheses, curly brackets, etc.) (r'[()\[\]{},;:]+', Punctuation), #AllIntrinsic functions: to be red! # TODO: put this list outside (words(('ActiveCard','Card','ConvertUnit','DistributionCumulative','DistributionDensity','DistributionDeviation', 'DistributionInverseCumulative','DistributionInverseDensity','DistributionKurtosis','DistributionMean','DistributionSkewness', 'DistributionVariance','Element','EvaluateUnit','First','FormatString','Last','Ord','Unit','Val','Aggregate', 'AttributeContainsString','AttributeLength','AttributeToString','callerLine','callerNode','callerAttribute', 'callerNumberOfLocations','CaseCompareIdentifier','CaseCreateDifferenceFile','CloseDataSource','cp::ActivityBegin', 'cp::ActivityEnd','cp::ActivityLength','cp::ActivitySize','cp::AllDifferent','cp::Alternative','cp::Span','cp::Synchronize', 'cp::BeginAtBegin','cp::BeginAtEnd','cp::BeginBeforeBegin','cp::BeginBeforeEnd','cp::EndAtBegin','cp::EndAtEnd', 'cp::EndBeforeBegin','cp::EndBeforeEnd','cp::BeginOfNext','cp::BeginOfPrevious','cp::EndOfNext','cp::EndOfPrevious', 'cp::LengthOfNext','cp::LengthOfPrevious','cp::SizeOfNext','cp::SizeOfPrevious','cp::GroupOfNext','cp::GroupOfPrevious', 'cp::BinPacking','cp::Cardinality','cp::Count','cp::Channel','cp::Lexicographic','cp::ParallelSchedule','cp::Sequence', 'cp::SequentialSchedule','CreateTimeTable','ConstraintVariables','ConvertReferenceDate','CloneElement','FileRead','FindNthString', 'FindReplaceNthString','FindReplaceStrings','FindString','StringOccurrences','RegexSearch','CurrentToMoment','CurrentToString', 'CurrentToTimeSlot','DaylightsavingEndDate','DaylightsavingStartDate','DeclaredSubset','DomainIndex','IndexRange', 'ListExpressionSubstitutions','LoadDatabaseStructure','DirectoryGetFiles','DirectoryGetSubdirectories','DirectSQL','Disaggregate', 'ElementCast','ElementRange','EnvironmentGetString','EnvironmentSetString','errh::Adapt','errh::Attribute','errh::Category', 'errh::Code','errh::Column','errh::CreationTime','errh::Filename','errh::InsideCategory','errh::IsMarkedAsHandled','errh::Line', 'errh::MarkAsHandled','errh::Message','errh::Multiplicity','errh::Node','errh::NumberOfLocations','errh::Severity', 'spreadsheet::AddNewSheet','spreadsheet::AssignParameter','spreadsheet::AssignSet','spreadsheet::AssignTable', 'spreadsheet::AssignValue','spreadsheet::ClearRange','spreadsheet::CloseWorkbook','spreadsheet::ColumnName', 'spreadsheet::ColumnNumber','spreadsheet::CopyRange','spreadsheet::CreateWorkbook','spreadsheet::DeleteSheet', 'spreadsheet::GetAllSheets','spreadsheet::Print','spreadsheet::RetrieveParameter','spreadsheet::RetrieveSet', 'spreadsheet::RetrieveTable','spreadsheet::RetrieveValue','spreadsheet::RunMacro','spreadsheet::SaveWorkbook', 'spreadsheet::SetActiveSheet','spreadsheet::SetOption','spreadsheet::SetUpdateLinksBehavior','spreadsheet::SetVisibility', 'FindUsedElements','GenerateCUT','GMP::Coefficient::Get','GMP::Coefficient::GetQuadratic','GMP::Coefficient::Set', 'GMP::Coefficient::SetMulti','GMP::Coefficient::SetQuadratic','GMP::Column::Add','GMP::Column::Delete','GMP::Column::Freeze', 'GMP::Column::FreezeMulti','GMP::Column::GetLowerbound','GMP::Column::GetName','GMP::Column::GetScale','GMP::Column::GetStatus', 'GMP::Column::GetType','GMP::Column::GetUpperbound','GMP::Column::SetAsObjective','GMP::Column::SetLowerbound', 'GMP::Column::SetLowerboundMulti','GMP::Column::SetType','GMP::Column::SetUpperbound','GMP::Column::SetUpperboundMulti', 'GMP::Column::Unfreeze','GMP::Column::UnfreezeMulti','GMP::Instance::AddIntegerEliminationRows', 'GMP::Instance::CalculateSubGradient','GMP::Instance::Copy','GMP::Instance::CreateFeasibility','GMP::Instance::CreateDual', 'GMP::Instance::CreateMasterMip','GMP::Instance::CreatePresolved','GMP::SolverSession::CreateProgressCategory', 'GMP::Instance::CreateProgressCategory','GMP::Instance::CreateSolverSession','GMP::Stochastic::CreateBendersRootproblem', 'GMP::Instance::Delete','GMP::Instance::DeleteIntegerEliminationRows','GMP::Instance::DeleteSolverSession', 'GMP::Instance::FindApproximatelyFeasibleSolution','GMP::Instance::FixColumns','GMP::Instance::Generate', 'GMP::Instance::GenerateRobustCounterpart','GMP::Instance::GenerateStochasticProgram', 'GMP::SolverSession::GetCallbackInterruptStatus','GMP::SolverSession::WaitForCompletion', 'GMP::SolverSession::WaitForSingleCompletion','GMP::SolverSession::ExecutionStatus','GMP::Instance::GetColumnNumbers', 'GMP::Instance::GetDirection','GMP::Instance::GetBestBound','GMP::Instance::GetMathematicalProgrammingType', 'GMP::Instance::GetMemoryUsed','GMP::Instance::GetNumberOfColumns','GMP::Instance::GetNumberOfIndicatorRows', 'GMP::Instance::GetNumberOfIntegerColumns','GMP::Instance::GetNumberOfNonlinearColumns', 'GMP::Instance::GetNumberOfNonlinearNonzeros','GMP::Instance::GetNumberOfNonlinearRows','GMP::Instance::GetNumberOfNonzeros', 'GMP::Instance::GetNumberOfRows','GMP::Instance::GetNumberOfSOS1Rows','GMP::Instance::GetNumberOfSOS2Rows', 'GMP::Instance::GetObjective','GMP::Instance::GetOptionValue','GMP::Instance::GetRowNumbers', 'GMP::Instance::GetObjectiveColumnNumber','GMP::Instance::GetObjectiveRowNumber','GMP::Instance::GetSolver', 'GMP::Instance::GetSymbolicMathematicalProgram','GMP::Instance::MemoryStatistics','GMP::Instance::Rename', 'GMP::Instance::SetCallbackAddCut','GMP::Instance::SetCallbackAddLazyConstraint','GMP::Instance::SetCallbackBranch', 'GMP::Instance::SetCallbackHeuristic','GMP::Instance::SetCallbackIncumbent','GMP::Instance::SetCallbackIterations', 'GMP::Instance::SetCallbackNewIncumbent','GMP::Instance::SetCallbackStatusChange','GMP::Instance::SetCallbackTime', 'GMP::Instance::SetCutoff','GMP::Instance::SetDirection','GMP::Instance::SetMathematicalProgrammingType','GMP::Instance::SetSolver', 'GMP::Instance::SetStartingPointSelection','GMP::Instance::Solve','GMP::Stochastic::GetObjectiveBound', 'GMP::Stochastic::GetRelativeWeight','GMP::Stochastic::GetRepresentativeScenario','GMP::Stochastic::UpdateBendersSubproblem', 'GMP::Linearization::Add','GMP::Linearization::AddSingle','GMP::Linearization::Delete','GMP::Linearization::GetDeviation', 'GMP::Linearization::GetDeviationBound','GMP::Linearization::GetLagrangeMultiplier','GMP::Linearization::GetType', 'GMP::Linearization::GetWeight','GMP::Linearization::RemoveDeviation','GMP::Linearization::SetDeviationBound', 'GMP::Linearization::SetType','GMP::Linearization::SetWeight','GMP::ProgressWindow::DeleteCategory', 'GMP::ProgressWindow::DisplayLine','GMP::ProgressWindow::DisplayProgramStatus','GMP::ProgressWindow::DisplaySolver', 'GMP::ProgressWindow::DisplaySolverStatus','GMP::ProgressWindow::FreezeLine','GMP::ProgressWindow::UnfreezeLine', 'GMP::ProgressWindow::Transfer','GMP::QuadraticCoefficient::Get','GMP::QuadraticCoefficient::Set','GMP::Row::Activate', 'GMP::Stochastic::AddBendersFeasibilityCut','GMP::Stochastic::AddBendersOptimalityCut', 'GMP::Stochastic::BendersFindFeasibilityReference','GMP::Stochastic::MergeSolution','GMP::Row::Add','GMP::Row::Deactivate', 'GMP::Row::Delete','GMP::Row::DeleteIndicatorCondition','GMP::Row::Generate','GMP::Row::GetConvex','GMP::Row::GetIndicatorColumn', 'GMP::Row::GetIndicatorCondition','GMP::Row::GetLeftHandSide','GMP::Row::GetName','GMP::Row::GetRelaxationOnly', 'GMP::Row::GetRightHandSide','GMP::Row::GetScale','GMP::Row::GetStatus','GMP::Row::GetType','GMP::Row::SetConvex', 'GMP::Row::SetPoolType','GMP::Row::SetPoolTypeMulti','GMP::Row::SetIndicatorCondition','GMP::Row::SetLeftHandSide', 'GMP::Row::SetRelaxationOnly','GMP::Row::SetRightHandSide','GMP::Row::SetRightHandSideMulti','GMP::Row::SetType', 'GMP::Solution::Check','GMP::Solution::ConstraintListing','GMP::Solution::Copy','GMP::Solution::Count','GMP::Solution::Delete', 'GMP::Solution::DeleteAll','GMP::Solution::GetColumnValue','GMP::Solution::GetTimeUsed','GMP::Solution::GetDistance', 'GMP::Solution::GetFirstOrderDerivative','GMP::Solution::GetIterationsUsed','GMP::Solution::GetNodesUsed', 'GMP::Solution::GetBestBound','GMP::Solution::GetMemoryUsed','GMP::Solution::GetObjective','GMP::Solution::GetPenalizedObjective', 'GMP::Solution::GetProgramStatus','GMP::Solution::GetRowValue','GMP::Solution::GetSolutionsSet','GMP::Solution::GetSolverStatus', 'GMP::Solution::IsDualDegenerated','GMP::Solution::IsInteger','GMP::Solution::IsPrimalDegenerated','GMP::Solution::SetMIPStartFlag', 'GMP::Solution::Move','GMP::Solution::RandomlyGenerate','GMP::Solution::RetrieveFromModel', 'GMP::Solution::RetrieveFromSolverSession','GMP::Solution::SendToModel','GMP::Solution::SendToModelSelection', 'GMP::Solution::SendToSolverSession','GMP::Solution::SetIterationCount','GMP::Solution::SetColumnValue', 'GMP::Solution::SetRowValue','GMP::Solution::SetObjective','GMP::Solution::SetProgramStatus','GMP::Solution::SetSolverStatus', 'GMP::Solution::UpdatePenaltyWeights','GMP::Solution::ConstructMean','GMP::SolverSession::AsynchronousExecute', 'GMP::SolverSession::Execute','GMP::SolverSession::Interrupt','GMP::SolverSession::AddLinearization', 'GMP::SolverSession::AddBendersOptimalityCut','GMP::SolverSession::AddBendersFeasibilityCut', 'GMP::SolverSession::GenerateBranchLowerBound','GMP::SolverSession::GenerateBranchUpperBound', 'GMP::SolverSession::GenerateBranchRow','GMP::SolverSession::GenerateCut','GMP::SolverSession::GenerateBinaryEliminationRow', 'GMP::SolverSession::GetCandidateObjective','GMP::SolverSession::GetTimeUsed','GMP::SolverSession::GetHost', 'GMP::SolverSession::GetInstance','GMP::SolverSession::GetIterationsUsed','GMP::SolverSession::GetNodesLeft', 'GMP::SolverSession::GetNodesUsed','GMP::SolverSession::GetNodeNumber','GMP::SolverSession::GetNodeObjective', 'GMP::SolverSession::GetNumberOfBranchNodes','GMP::SolverSession::GetBestBound','GMP::SolverSession::GetMemoryUsed', 'GMP::SolverSession::GetObjective','GMP::SolverSession::GetOptionValue','GMP::SolverSession::GetProgramStatus', 'GMP::SolverSession::GetSolver','GMP::SolverSession::GetSolverStatus','GMP::SolverSession::RejectIncumbent','GMP::Event::Create', 'GMP::Event::Delete','GMP::Event::Reset','GMP::Event::Set','GMP::SolverSession::SetObjective','GMP::SolverSession::SetOptionValue', 'GMP::Instance::SetTimeLimit','GMP::Instance::SetIterationLimit','GMP::Instance::SetMemoryLimit','GMP::Instance::SetOptionValue', 'GMP::Tuning::SolveSingleMPS','GMP::Tuning::TuneMultipleMPS','GMP::Tuning::TuneSingleGMP','GMP::Solver::InitializeEnvironment', 'GMP::Solver::FreeEnvironment','GMP::Solver::GetAsynchronousSessionsLimit','GMP::Robust::EvaluateAdjustableVariables', 'GMP::Benders::CreateMasterProblem','GMP::Benders::CreateSubProblem','GMP::Benders::UpdateSubProblem', 'GMP::Benders::AddOptimalityCut','GMP::Benders::AddFeasibilityCut','GMP::Column::SetDecomposition', 'GMP::Column::SetDecompositionMulti','GenerateXML','GetDatasourceProperty','ReadGeneratedXML','ReadXML','ReferencedIdentifiers', 'WriteXML','IdentifierAttributes','IdentifierDimension','IdentifierElementRange','IsRuntimeIdentifier','IdentifierMemory', 'IdentifierMemoryStatistics','IdentifierText','IdentifierType','IdentifierUnit','SaveDatabaseStructure','ScalarValue', 'SectionIdentifiers','SubRange','MemoryInUse','CommitTransaction','RollbackTransaction','MemoryStatistics','me::AllowedAttribute', 'me::ChangeType','me::ChangeTypeAllowed','me::Children','me::ChildTypeAllowed','me::Compile','me::Create','me::CreateLibrary', 'me::Delete','me::ExportNode','me::GetAttribute','me::ImportLibrary','me::ImportNode','me::IsRunnable','me::Move','me::Parent', 'me::Rename','me::SetAnnotation','me::SetAttribute','MomentToString','MomentToTimeSlot','OptionGetValue','OptionGetKeywords', 'OptionGetDefaultString','OptionGetString','OptionSetString','OptionSetValue','PeriodToString','ProfilerContinue','ProfilerPause', 'ProfilerRestart','RestoreInactiveElements','RetrieveCurrentVariableValues','SetAddRecursive','SetElementAdd','SetElementRename', 'SQLColumnData','SQLCreateConnectionString','SQLDriverName','SQLNumberOfColumns','SQLNumberOfDrivers','SQLNumberOfTables', 'SQLNumberOfViews','SQLTableName','SQLViewName','StartTransaction','StringToElement','StringToMoment','StringToTimeSlot', 'TestDatabaseColumn','TestDatabaseTable','TestDataSource','TestDate','TimeslotCharacteristic','TimeslotToMoment','TimeslotToString', 'TimeZoneOffset','VariableConstraints','Execute','GetAnnotationValues','PageOpen','PageOpenSingle','PageClose','PageGetActive', 'PageSetFocus','PageGetFocus','PageSetCursor','PageRefreshAll','PageGetChild','PageGetParent','PageGetNext','PageGetPrevious', 'PageGetNextInTreeWalk','PageGetUsedIdentifiers','PageGetTitle','PageGetAll','PageCopyTableToClipboard','PageCopyTableToExcel', 'PageCopyTableToSpreadsheet','PrintPage','PrintPageCount','PrintStartReport','PrintEndReport','PrinterSetupDialog', 'PrinterGetCurrentName','PivotTableReloadState','PivotTableSaveState','PivotTableDeleteState','FileSelect','FileSelectNew', 'FileDelete','FileExists','FileCopy','FileMove','FileView','FileEdit','FilePrint','FileTime','FileTouch','FileAppend','FileGetSize', 'DirectorySelect','DirectoryCreate','DirectoryDelete','DirectoryExists','DirectoryCopy','DirectoryMove','DirectoryGetCurrent', 'DirectoryOfLibraryProject','DialogProgress','DialogMessage','DialogError','StatusMessage','DialogAsk','DialogGetString', 'DialogGetDate','DialogGetNumber','DialogGetElement','DialogGetElementByText','DialogGetElementByData','DialogGetPassword', 'DialogGetColor','CaseNew','CaseFind','CaseCreate','CaseLoadCurrent','CaseMerge','CaseLoadIntoCurrent','CaseSelect','CaseSelectNew', 'CaseSetCurrent','CaseSave','CaseSaveAll','CaseSaveAs','CaseSelectMultiple','CaseGetChangedStatus','CaseSetChangedStatus', 'CaseDelete','CaseGetType','CaseGetDatasetReference','CaseWriteToSingleFile','CaseReadFromSingleFile','DatasetNew','DatasetFind', 'DatasetCreate','DatasetLoadCurrent','DatasetMerge','DatasetLoadIntoCurrent','DatasetSelect','DatasetSelectNew','DatasetSetCurrent', 'DatasetSave','DatasetSaveAll','DatasetSaveAs','DatasetGetChangedStatus','DatasetSetChangedStatus','DatasetDelete', 'DatasetGetCategory','DataFileGetName','DataFileGetAcronym','DataFileSetAcronym','DataFileGetComment','DataFileSetComment', 'DataFileGetPath','DataFileGetTime','DataFileGetOwner','DataFileGetGroup','DataFileReadPermitted','DataFileWritePermitted', 'DataFileExists','DataFileCopy','DataCategoryContents','CaseTypeContents','CaseTypeCategories','OpenDocument', 'TestInternetConnection','GeoFindCoordinates','ShowHelpTopic','Delay','ScheduleAt','ExitAimms','SessionArgument', 'SessionHasVisibleGUI','ProjectDeveloperMode','DebuggerBreakpoint','ShowProgressWindow','ShowMessageWindow','SolverGetControl', 'SolverReleaseControl','ProfilerStart','IdentifierGetUsedInformation','IdentifierShowAttributes','IdentifierShowTreeLocation', 'DataManagerImport','DataManagerExport','DataManagerFileNew','DataManagerFileOpen','DataManagerFileGetCurrent','DataImport220', 'DataManagementExit','CaseFileSave','CaseFileLoad','CaseFileMerge','CaseFileGetContentType','CaseFileSectionSave', 'CaseFileSectionLoad','CaseFileSectionMerge','CaseFileSectionGetContentType','CaseFileSectionExists','CaseFileSectionRemove', 'CaseFileURLtoElement','CaseFileSetCurrent','CaseDialogConfirmAndSave','CaseCommandLoadAsActive','CaseCommandMergeIntoActive', 'CaseCommandLoadIntoActive','CaseCommandSave','CaseCommandSaveAs','CaseCommandNew','CaseDialogSelectMultiple', 'CaseDialogSelectForLoad','CaseDialogSelectForSave','DataChangeMonitorCreate','DataChangeMonitorReset', 'DataChangeMonitorHasChanged','DataChangeMonitorDelete','SecurityGetUsers','SecurityGetGroups','UserColorAdd','UserColorDelete', 'UserColorGetRGB','UserColorModify','LicenseNumber','LicenseType','LicenseStartDate','LicenseExpirationDate', 'LicenseMaintenanceExpirationDate','AimmsRevisionString','HistogramCreate','HistogramDelete','HistogramSetDomain', 'HistogramAddObservation','HistogramAddObservations','HistogramGetFrequencies','HistogramGetBounds','HistogramGetObservationCount', 'HistogramGetAverage','HistogramGetDeviation','HistogramGetSkewness','HistogramGetKurtosis','DateDifferenceDays', 'DateDifferenceYearFraction','PriceFractional','PriceDecimal','RateEffective','RateNominal','DepreciationLinearLife', 'DepreciationLinearRate','DepreciationNonLinearSumOfYear','DepreciationNonLinearLife','DepreciationNonLinearFactor', 'DepreciationNonLinearRate','DepreciationSum','InvestmentConstantPresentValue','InvestmentConstantFutureValue', 'InvestmentConstantPeriodicPayment','InvestmentConstantInterestPayment','InvestmentConstantPrincipalPayment', 'InvestmentConstantCumulativePrincipalPayment','InvestmentConstantCumulativeInterestPayment','InvestmentConstantNumberPeriods', 'InvestmentConstantRateAll','InvestmentConstantRate','InvestmentVariablePresentValue','InvestmentVariablePresentValueInperiodic', 'InvestmentSingleFutureValue','InvestmentVariableInternalRateReturnAll','InvestmentVariableInternalRateReturn', 'InvestmentVariableInternalRateReturnInperiodicAll','InvestmentVariableInternalRateReturnInperiodic', 'InvestmentVariableInternalRateReturnModified','SecurityDiscountedPrice','SecurityDiscountedRedemption','SecurityDiscountedYield', 'SecurityDiscountedRate','TreasuryBillPrice','TreasuryBillYield','TreasuryBillBondEquivalent','SecurityMaturityPrice', 'SecurityMaturityCouponRate','SecurityMaturityYield','SecurityMaturityAccruedInterest','SecurityCouponNumber', 'SecurityCouponPreviousDate','SecurityCouponNextDate','SecurityCouponDays','SecurityCouponDaysPreSettlement', 'SecurityCouponDaysPostSettlement','SecurityPeriodicPrice','SecurityPeriodicRedemption','SecurityPeriodicCouponRate', 'SecurityPeriodicYieldAll','SecurityPeriodicYield','SecurityPeriodicAccruedInterest','SecurityPeriodicDuration', 'SecurityPeriodicDurationModified','Abs','AtomicUnit','Ceil','Character','CharacterNumber','Cube','Degrees','Div','Exp','Floor', 'Log','Log10','Mapval','Max','Min','Mod','Power','Radians','Round','Sign','Sqr','Sqrt','StringCapitalize','StringLength', 'StringToLower','StringToUnit','StringToUpper','SubString','Trunc','Binomial','NegativeBinomial','Poisson','Geometric', 'HyperGeometric','Uniform','Normal','LogNormal','Triangular','Exponential','Weibull','Beta','Gamma','Logistic','Pareto', 'ExtremeValue','Precision','Factorial','Combination','Permutation','Errorf','Cos','Sin','Tan','ArcCos','ArcSin','ArcTan','Cosh', 'Sinh','Tanh','ArcCosh','ArcSinh','ArcTanh' ), prefix=r'\b(?i)', suffix=r'\b'), Name.Builtin), #Highlights mathematical operators (r'(\+|\-|\*|/|\*\*|=|<=|>=|==|\||\^|<|>|\!|\.\.|:=|\&|\!=|<<|>>|;|\$|\#|\%|\@|\…)', Operator), #For AMS files, matches all function arguments #(r'(\w+\s+)(:)([^=:].*,|[^=:].*;|,|;|\n.*})', bygroups(Name.Argument,Operator,Text)), #Identifiers prefix match: if ANYTHING starts with a EP_ or P_ or ... it is parameter (green) or element parameter (blue), etc. (r'(?i)(\bP_\w+\b)', bygroups(Name.Parameter)), (r'(?i)(\bP01_\w+\b)', bygroups(Name.Parameter)), (r'(?i)(\bEP_\w+\b)', bygroups(Name.ElementParameter)), (r'(?i)(\bS_\w+\b)', bygroups(Name.Set)), (r'(?i)(\bCal_\w+\b)', bygroups(Name.Set)), (r'(?i)(\bSP_\w+\b)', bygroups(Name.StringParameter)), (r'(?i)(\bV_\w+\b)', bygroups(Name.Variable)), (r'(?i)(\bV01_\w+\b)', bygroups(Name.Variable)), (r'(?i)(\bEV_\w+\b)', bygroups(Name.Variable)), (r'(?i)(\bC_\w+\b)', bygroups(Name.Constraint)), (r'(?i)(\bMP_\w+\b)', bygroups(Name.MathematicalProgram)), (r'(?i)(\bDBT_\w+\b)', bygroups(Name.DatabaseTable)), (r'(?i)(\bPR_\w+\b)', bygroups(Name.Variable)), (r'(?i)(\bCNV_\w+\b)', bygroups(Name.Convention)), (r'(?i)(\bI_\w+\b)', bygroups(Name.Index)), #Clean every unmatched # character, after everything is matched (r'#',Text), (r'(\w+|(\.(?!\.)))', Text) ] } def get_tokens_unprocessed(self,text): # for AMS files: catch any identifier declaration, and highlight every reference in the rest of the file. In other words, every user defined identifier is triggered :) Because I can. m = id_re.findall(text) # Ok, we found all matches from the big identifiers list. thus we end up with a list like this: # m = [first_match, second_match, ...] and nth_match = (id_type,id_name,id_operator) = ('Parameter', 'OD', ';') id_nametype = {} for i in m: id_nametype[i[1]] = i[0] #print "I'm in get_tokens_unprocessed" for index, token, value in RegexLexer.get_tokens_unprocessed(self, text): # if the item is part of the declared (detected) identifiers, attach the appropriate token, thanks to the switcher :) if any(item == value for item in id_nametype.keys()): yield index, switcher(id_nametype[value]), value # if the item is not detected as an function argument and is part of the Identifier type list, attach a 'kd' token elif (not (token is Name.Argument) and any(item == value for item in id_nametype.values())): yield index, Keyword.Declaration, value else: yield index, token ,value
202.634731
18,251
0.756678
2,658
33,840
9.612114
0.542889
0.025833
0.008141
0.00822
0.021527
0.018513
0.017457
0.00728
0.004853
0
0
0.001195
0.060343
33,840
166
18,252
203.855422
0.802189
0.060018
0
0
0
0.011236
0.752041
0.433425
0
0
0
0.006024
0.033708
1
0.022472
false
0.011236
0.044944
0
0.134831
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
0
0
0
0
0
0
1
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
c95b605b872c31bfe6c2f4605e653ecc5180048a
1,047
py
Python
tests/v1/test_logs_geo_ip_parser.py
MichaelTROEHLER/datadog-api-client-python
12c46626622fb1277bb1e172753b342c671348bd
[ "Apache-2.0" ]
null
null
null
tests/v1/test_logs_geo_ip_parser.py
MichaelTROEHLER/datadog-api-client-python
12c46626622fb1277bb1e172753b342c671348bd
[ "Apache-2.0" ]
null
null
null
tests/v1/test_logs_geo_ip_parser.py
MichaelTROEHLER/datadog-api-client-python
12c46626622fb1277bb1e172753b342c671348bd
[ "Apache-2.0" ]
null
null
null
# coding: utf-8 # Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. # This product includes software developed at Datadog (https://www.datadoghq.com/). # Copyright 2019-Present Datadog, Inc. from __future__ import absolute_import import sys import unittest import datadog_api_client.v1 try: from datadog_api_client.v1.model import logs_geo_ip_parser_type except ImportError: logs_geo_ip_parser_type = sys.modules[ 'datadog_api_client.v1.model.logs_geo_ip_parser_type'] from datadog_api_client.v1.model.logs_geo_ip_parser import LogsGeoIPParser class TestLogsGeoIPParser(unittest.TestCase): """LogsGeoIPParser unit test stubs""" def setUp(self): pass def tearDown(self): pass def testLogsGeoIPParser(self): """Test LogsGeoIPParser""" # FIXME: construct object with mandatory attributes with example values # model = LogsGeoIPParser() # noqa: E501 pass if __name__ == '__main__': unittest.main()
26.846154
108
0.74021
134
1,047
5.514925
0.58209
0.054127
0.086604
0.097429
0.201624
0.14479
0.102842
0.102842
0.102842
0
0
0.016393
0.184336
1,047
38
109
27.552632
0.848946
0.383954
0
0.157895
0
0
0.093949
0.08121
0
0
0
0.026316
0
1
0.157895
false
0.157895
0.368421
0
0.578947
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
0
0
1
1
0
1
0
0
4
c98029c02eee286bcbf17735ac7df0f4f085d16b
477
py
Python
solrdataimport/exportclient.py
pisceanfoot/solrdataimport
a7f97cda5eb4ff569e67e5636a9217e9fe1a5fb5
[ "Apache-2.0" ]
2
2018-03-13T02:08:08.000Z
2019-07-08T03:33:26.000Z
solrdataimport/exportclient.py
pisceanfoot/solrdataimport
a7f97cda5eb4ff569e67e5636a9217e9fe1a5fb5
[ "Apache-2.0" ]
null
null
null
solrdataimport/exportclient.py
pisceanfoot/solrdataimport
a7f97cda5eb4ff569e67e5636a9217e9fe1a5fb5
[ "Apache-2.0" ]
1
2019-07-08T03:33:32.000Z
2019-07-08T03:33:32.000Z
# -*- coding:utf-8 -*- from __future__ import absolute_import, division, print_function, unicode_literals, \ with_statement class ExportClient(object): def prepare(self): raise NotImplementedError() def send(self, cassDataRows): raise NotImplementedError() def sent(self): raise NotImplementedError() def rollback(self): raise NotImplementedError() def deleteByQuery(self, row): raise NotImplementedError()
22.714286
85
0.683438
45
477
7.066667
0.622222
0.377358
0.339623
0.292453
0
0
0
0
0
0
0
0.002703
0.224319
477
20
86
23.85
0.856757
0.041929
0
0.384615
0
0
0
0
0
0
0
0
0
1
0.384615
false
0
0.076923
0
0.538462
0.076923
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
0
0
0
0
0
0
4
a313bc0ed79294b521b29ce41ac8cefa1e47599e
174
py
Python
bb_django/mysite/bb/forms.py
ttrautmann/bb_website
ce9eb5e892c9851180f711907eb41176f067d433
[ "MIT" ]
null
null
null
bb_django/mysite/bb/forms.py
ttrautmann/bb_website
ce9eb5e892c9851180f711907eb41176f067d433
[ "MIT" ]
1
2020-02-24T04:15:59.000Z
2020-02-24T04:15:59.000Z
bb_django/mysite/bb/forms.py
ttrautmann/bb_website
ce9eb5e892c9851180f711907eb41176f067d433
[ "MIT" ]
null
null
null
from django import forms from .models import Throw class ThrowsForm(forms.ModelForm): class Meta: model = Throw fields = ('player', 'result', 'round')
17.4
46
0.649425
20
174
5.65
0.75
0
0
0
0
0
0
0
0
0
0
0
0.247126
174
9
47
19.333333
0.862595
0
0
0
0
0
0.097701
0
0
0
0
0
0
1
0
false
0
0.333333
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
0
0
1
0
1
0
0
4
a36f7e9e1fe792bf3555c5a349b6ef62e5e4e26e
49
py
Python
dynix_ng/state/memory.py
Eigenbahn/dynix-ng
897d33ae709ce9205a3c50afc7da7069caf7301e
[ "MIT" ]
1
2021-06-12T03:54:06.000Z
2021-06-12T03:54:06.000Z
dynix_ng/state/memory.py
Eigenbahn/dynix-ng
897d33ae709ce9205a3c50afc7da7069caf7301e
[ "MIT" ]
1
2021-06-12T04:21:11.000Z
2021-07-05T06:17:50.000Z
dynix_ng/state/memory.py
Eigenbahn/dynix-ng
897d33ae709ce9205a3c50afc7da7069caf7301e
[ "MIT" ]
null
null
null
def init(): global session session = {}
9.8
18
0.55102
5
49
5.4
0.8
0
0
0
0
0
0
0
0
0
0
0
0.326531
49
4
19
12.25
0.818182
0
0
0
0
0
0
0
0
0
0
0
0
1
0.333333
false
0
0
0
0.333333
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
1
0
0
0
0
0
0
0
4
6e60fcfdec27c8ab747787a283e0e6236ebd4770
224
py
Python
dec_wave.py
facmachado/wavecodec
c2c1c511137940eee9824c482f13ffb328aa19a3
[ "MIT" ]
null
null
null
dec_wave.py
facmachado/wavecodec
c2c1c511137940eee9824c482f13ffb328aa19a3
[ "MIT" ]
null
null
null
dec_wave.py
facmachado/wavecodec
c2c1c511137940eee9824c482f13ffb328aa19a3
[ "MIT" ]
null
null
null
#!/usr/bin/python3 # # Copyright (c) 2020 Flavio Augusto (@facmachado) # # This software may be modified and distributed under the terms # of the MIT license. See the LICENSE file for details. # import sys, wave, numpy
20.363636
64
0.723214
33
224
4.909091
0.909091
0
0
0
0
0
0
0
0
0
0
0.027473
0.1875
224
10
65
22.4
0.862637
0.821429
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
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
0
1
0
1
0
1
0
0
4
6e6eca1673685b85325ba87d02b5af7080bbfbff
419
py
Python
hadoop_script_2.0/common/tool/HadoopTool.py
jiandequn/code
676bae6523a26b4d8b01914f6b963112054461a3
[ "Apache-2.0" ]
2
2019-01-17T01:55:59.000Z
2019-04-18T02:06:53.000Z
sx_hadoop_script_2.0/common/tool/HadoopTool.py
sunnyJam/code
676bae6523a26b4d8b01914f6b963112054461a3
[ "Apache-2.0" ]
1
2022-02-09T22:28:06.000Z
2022-02-09T22:28:06.000Z
sx_hadoop_script_2.0/common/tool/HadoopTool.py
sunnyJam/code
676bae6523a26b4d8b01914f6b963112054461a3
[ "Apache-2.0" ]
null
null
null
#!/usr/bin/env python # -*- coding: utf-8 -*- class HadoopUtil(object): def __init__(self,console): self.console = console; pass def cp(self,src,dest): #复制 self.console.cmd("hadoop fs -cp -p %s %s" % (src,dest)) def mkdir(self,path):#创建目录 self.console.cmd("hadoop fs -mkdir -p %s" % path) def rm(self,path):#移除 self.console.cmd("hadoop fs -rm -R -f %s" %path);
27.933333
63
0.575179
64
419
3.703125
0.484375
0.232068
0.177215
0.253165
0.278481
0
0
0
0
0
0
0.003155
0.243437
419
14
64
29.928571
0.74448
0.119332
0
0
0
0
0.181319
0
0
0
0
0
0
1
0.4
false
0.1
0
0
0.5
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
1
0
0
0
0
0
4
6eb3151fb2fe698e9cadb60f609036f37a544c68
580
py
Python
src/pylomin/data_porters/data_porter.py
siahuat0727/pylomin
94a05dbfa5146fa2cc787363fc36774b563a6f39
[ "MIT" ]
3
2021-12-01T02:06:35.000Z
2021-12-01T15:20:53.000Z
src/pylomin/data_porters/data_porter.py
siahuat0727/pylomin
94a05dbfa5146fa2cc787363fc36774b563a6f39
[ "MIT" ]
null
null
null
src/pylomin/data_porters/data_porter.py
siahuat0727/pylomin
94a05dbfa5146fa2cc787363fc36774b563a6f39
[ "MIT" ]
null
null
null
class DataPorter: def __init__(self, model, **kwargs): self.model = model self.computing_device = kwargs.get('computing_device', 'cpu') @staticmethod def get_direct_parameters(module): # TODO: Don't access protected attribute (check if name contains dot?) return module._parameters.items() # pylint: disable=protected-access @staticmethod def get_direct_buffers(module): # TODO: Don't access protected attribute (check if name contains dot?) return module._buffers.items() # pylint: disable=protected-access
38.666667
78
0.691379
68
580
5.720588
0.455882
0.046272
0.092545
0.123393
0.539846
0.37018
0.37018
0.37018
0.37018
0.37018
0
0
0.212069
580
14
79
41.428571
0.851204
0.35
0
0.2
0
0
0.051075
0
0
0
0
0.071429
0
1
0.3
false
0
0
0.2
0.6
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
0
0
1
1
0
0
4
6eefed186c2e2a022e5cd041c85e082b1e4f15d7
683
py
Python
tests/data/src/csnAll.py
xplanes/CSnake
3cd7a2f5c23787262c42fe3c2763201afa1bdef4
[ "BSD-4-Clause" ]
4
2016-02-16T06:45:24.000Z
2021-08-09T14:59:12.000Z
tests/data/src/csnAll.py
xplanes/CSnake
3cd7a2f5c23787262c42fe3c2763201afa1bdef4
[ "BSD-4-Clause" ]
5
2015-08-04T14:42:35.000Z
2016-03-18T09:08:01.000Z
tests/data/src/csnAll.py
xplanes/CSnake
3cd7a2f5c23787262c42fe3c2763201afa1bdef4
[ "BSD-4-Clause" ]
5
2015-10-15T10:12:52.000Z
2021-11-08T15:20:46.000Z
# Project variable definitions import csnCilab import csnBuild def dummyLib(): import DummyLib.csnDummyLib return DummyLib.csnDummyLib.dummyLib def cxxTest(): return csnCilab.LoadThirdPartyModule('CxxTest', 'csnCxxTest').cxxTest def two(): return csnCilab.LoadThirdPartyModule('Two', 'csnTwo').two def three(): return csnCilab.LoadThirdPartyModule('Three', 'csnThree').three def four(): return csnCilab.LoadThirdPartyModule('Four', 'csnFour').four # Toolkit header ------------------------------------------------------------------------- toolkit = csnBuild.Project("TestToolkit", "library") toolkit.AddCustomCommand( csnCilab.CreateToolkitHeader )
28.458333
90
0.676428
59
683
7.830508
0.423729
0.121212
0.294372
0
0
0
0
0
0
0
0
0
0.115666
683
23
91
29.695652
0.764901
0.171303
0
0
0
0
0.120782
0
0
0
0
0
0
1
0.333333
false
0
0.2
0.266667
0.866667
0
0
0
0
null
0
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
1
0
0
0
1
1
0
0
4
42ba5cf241be09da83c279658d5b49420c231094
213
py
Python
code/code/code/test1/hcj_undergraduate_code/data/dataloader/__init__.py
ChunjunHu/SemanticSegmentationofCropRemoteSensingBasedonDeepLearning
740f88f6e11ef7e9b84949441d74f19ec06e56d2
[ "MIT" ]
2
2022-01-06T02:26:24.000Z
2022-01-28T00:04:35.000Z
code/code/code/test1/hcj_undergraduate_code/data/dataloader/__init__.py
ChunjunHu/SemanticSegmentationofCropRemoteSensingBasedonDeepLearning
740f88f6e11ef7e9b84949441d74f19ec06e56d2
[ "MIT" ]
null
null
null
code/code/code/test1/hcj_undergraduate_code/data/dataloader/__init__.py
ChunjunHu/SemanticSegmentationofCropRemoteSensingBasedonDeepLearning
740f88f6e11ef7e9b84949441d74f19ec06e56d2
[ "MIT" ]
null
null
null
''' Author : now more Connect : lin.honghui@qq.com LastEditors : now more Description : make_dataloader LastEditTime: 2019-07-03 13:15:34 ''' from .build import make_dataloader,make_inference_dataloader
21.3
60
0.751174
29
213
5.37931
0.793103
0.089744
0
0
0
0
0
0
0
0
0
0.077778
0.15493
213
10
60
21.3
0.788889
0.666667
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
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
4
42f1e43e5d6da323c252818c6850097995cf0338
221
py
Python
auth/constants.py
Yassineelkasmy/fastalab-backend
409a0e2ef45eaf42aa854075e7eb8f5a48b8abd0
[ "MIT" ]
null
null
null
auth/constants.py
Yassineelkasmy/fastalab-backend
409a0e2ef45eaf42aa854075e7eb8f5a48b8abd0
[ "MIT" ]
null
null
null
auth/constants.py
Yassineelkasmy/fastalab-backend
409a0e2ef45eaf42aa854075e7eb8f5a48b8abd0
[ "MIT" ]
null
null
null
from datetime import timedelta SECRET_KEY = "09d25e094faa6ca2556c818166b7a9563b93f7099f6f0f4caa6cf63b88e8d3e7" ALGORITHM = "HS256" TOKEN_EXPIRES_TIME = timedelta(minutes=5) REFRESH_TOKEN_EXPIRES_TIME = timedelta(hours=12)
44.2
79
0.868778
22
221
8.454545
0.772727
0.129032
0.172043
0.268817
0
0
0
0
0
0
0
0.223301
0.067873
221
5
80
44.2
0.679612
0
0
0
0
0
0.310811
0.288288
0
0
0
0
0
1
0
false
0
0.2
0
0.2
0
1
0
0
null
0
0
1
0
0
0
0
0
0
0
1
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
4
6e3ecd5b7db7fcd16b2d7331d3c6179769db90a8
4,238
py
Python
main.py
astirn/local-latent-features-cell-images
1c14c94140cae91c9d882e801304e590dd6982b5
[ "MIT" ]
null
null
null
main.py
astirn/local-latent-features-cell-images
1c14c94140cae91c9d882e801304e590dd6982b5
[ "MIT" ]
null
null
null
main.py
astirn/local-latent-features-cell-images
1c14c94140cae91c9d882e801304e590dd6982b5
[ "MIT" ]
null
null
null
import os from test_mode import test_mode from utils import load_partitioned_data, split_data from models import AutoEncoder, VariationalAutoEncoder, train, generate_latent_matrix # real run? if not test_mode(): # load all partitioned data data = load_partitioned_data() # result directory RESULT_DIR = os.path.join(os.getcwd(), 'ResultsReal') # number of epochs N_EPOCHS = 250 # local run else: # load some partitioned data data = load_partitioned_data(n_files=80) # result directory RESULT_DIR = os.path.join(os.getcwd(), 'ResultsTest') # number of epochs N_EPOCHS = 3 # split the data i_train, i_valid = split_data(data.shape[0], 0.1) # get input channels n_channels = data.shape[-1] # declare architectures architectures = [{'conv_layers': [{'k_size': 9, 'out_chan': n_channels * 2}, {'k_size': 6, 'out_chan': n_channels * 4}, {'k_size': 3, 'out_chan': n_channels * 8}], 'full_layers': [3000, 2000]}, {'conv_layers': [{'k_size': 6, 'out_chan': n_channels * 2}, {'k_size': 3, 'out_chan': n_channels * 4}], 'full_layers': [2000]} ] # loop over the architectures for i in range(len(architectures)): # build AE model save_dir = os.path.join(RESULT_DIR, 'AE', 'Gauss', 'Arch{:d}'.format(i + 1)) ae = AutoEncoder(input_dim=list(data.shape[1:]), latent_dim=1000, conv_layers=architectures[i]['conv_layers'], full_layers=architectures[i]['full_layers'], lr=1e-4, px_z='Gaussian', batch_size=100, n_epochs=N_EPOCHS, save_dir=save_dir) # train the model and generate latent space train(ae, data[i_train], data[i_valid]) generate_latent_matrix(ae, data) # build AE model save_dir = os.path.join(RESULT_DIR, 'AE', 'Bern', 'Arch{:d}'.format(i + 1)) ae = AutoEncoder(input_dim=list(data.shape[1:]), latent_dim=1000, conv_layers=architectures[i]['conv_layers'], full_layers=architectures[i]['full_layers'], lr=1e-4, px_z='Bernoulli', batch_size=100, n_epochs=N_EPOCHS, save_dir=save_dir) # train the model and generate latent space train(ae, data[i_train], data[i_valid]) generate_latent_matrix(ae, data) # build VAE model save_dir = os.path.join(RESULT_DIR, 'VAE', 'Gauss', 'Arch{:d}'.format(i + 1)) vae = VariationalAutoEncoder(input_dim=list(data.shape[1:]), latent_dim=1000, conv_layers=architectures[i]['conv_layers'], full_layers=architectures[i]['full_layers'], lr=1e-5, px_z='Gaussian', full_var=False, batch_size=100, n_epochs=N_EPOCHS, save_dir=save_dir) # train the model and generate latent space train(vae, data[i_train], data[i_valid]) generate_latent_matrix(vae, data) # build VAE model save_dir = os.path.join(RESULT_DIR, 'VAE', 'Bern', 'Arch{:d}'.format(i + 1)) vae = VariationalAutoEncoder(input_dim=list(data.shape[1:]), latent_dim=1000, conv_layers=architectures[i]['conv_layers'], full_layers=architectures[i]['full_layers'], lr=1e-4, px_z='Bernoulli', full_var=False, batch_size=100, n_epochs=N_EPOCHS, save_dir=save_dir) # train the model and generate latent space train(vae, data[i_train], data[i_valid]) generate_latent_matrix(vae, data) print('All done!')
36.534483
85
0.523596
488
4,238
4.313525
0.204918
0.039905
0.07601
0.037055
0.768646
0.747743
0.703088
0.652732
0.652732
0.612827
0
0.028327
0.366918
4,238
115
86
36.852174
0.756243
0.107126
0
0.608108
1
0
0.086899
0
0
0
0
0
0
1
0
false
0
0.054054
0
0.054054
0.013514
0
0
0
null
0
0
0
0
1
1
0
0
1
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
4
6e47ee800595bb4ad2b4fe9dc783bebbb3b72143
1,522
py
Python
tests/integration/cloud_governance/test_environment_variables.py
athiruma/cloud-governance
0515975090046266bce70990e4e269ae6ab03296
[ "Apache-2.0" ]
null
null
null
tests/integration/cloud_governance/test_environment_variables.py
athiruma/cloud-governance
0515975090046266bce70990e4e269ae6ab03296
[ "Apache-2.0" ]
1
2022-02-02T17:38:05.000Z
2022-02-02T17:38:05.000Z
tests/integration/cloud_governance/test_environment_variables.py
athiruma/cloud-governance
0515975090046266bce70990e4e269ae6ab03296
[ "Apache-2.0" ]
null
null
null
import os def __get_test_environment_variables(): test_environment_variable = {} test_environment_variable['KEY_TEST'] = os.environ.get("KEY_TEST", '') test_environment_variable['REGION'] = os.environ.get("REGION", '') test_environment_variable['BUCKET'] = os.environ.get('BUCKET', '') # ElasticSearch test_environment_variable['elasticsearch'] = os.environ.get('ELASTICSEARCH', 'elasticsearch.intlab.perf-infra.lab.eng.rdu2.redhat.com') test_environment_variable['elasticsearch_port'] = os.environ.get('ELASTICSEARCH_PORT', '80') test_environment_variable['timeout'] = int(os.environ.get('TIMEOUT', '2000')) # ElasticSearch url if test_environment_variable.get('elasticsearch_password', ''): test_environment_variable['elasticsearch_url'] = f"http://{test_environment_variable.get('elasticsearch_user', '')}:{test_environment_variable.get('elasticsearch_password', '')}@{test_environment_variable.get('elasticsearch', '')}:{test_environment_variable.get('elasticsearch_port', '')}" else: if test_environment_variable['elasticsearch'] and test_environment_variable.get('elasticsearch_port', ''): test_environment_variable['elasticsearch_url'] = f"http://{test_environment_variable.get('elasticsearch', '')}:{test_environment_variable.get('elasticsearch_port', '')}" else: test_environment_variable['elasticsearch_url'] = '' return test_environment_variable test_environment_variable = __get_test_environment_variables()
56.37037
297
0.745072
162
1,522
6.598765
0.216049
0.322732
0.451824
0.218896
0.530402
0.49392
0.367633
0.367633
0.367633
0.279701
0
0.00517
0.110381
1,522
26
298
58.538462
0.784343
0.020368
0
0.111111
0
0.055556
0.426747
0.204301
0
0
0
0
0
1
0.055556
false
0.111111
0.055556
0
0.166667
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
0
0
1
0
0
0
0
0
4
2811908234b628e9de9a5580b41b523228c0ffd7
194
py
Python
python/basic-python/guided_exercises/ch1_variables/var_and_data.py
codingandcommunity/rise_high
042d07cee1119b46f723a9c763b8ee3d0fc4ac2c
[ "MIT" ]
2
2019-08-12T23:19:48.000Z
2019-08-15T00:24:01.000Z
python/basic-python/guided_exercises/ch1_variables/var_and_data.py
codingandcommunity/rise_high
042d07cee1119b46f723a9c763b8ee3d0fc4ac2c
[ "MIT" ]
null
null
null
python/basic-python/guided_exercises/ch1_variables/var_and_data.py
codingandcommunity/rise_high
042d07cee1119b46f723a9c763b8ee3d0fc4ac2c
[ "MIT" ]
null
null
null
# define variable 'name' and set it equal to your name # print the message "Hi, my name is" and your name to the terminal # get the type of the variable 'name' and print it to the terminal
38.8
67
0.721649
36
194
3.888889
0.527778
0.171429
0.214286
0
0
0
0
0
0
0
0
0
0.226804
194
5
68
38.8
0.933333
0.938144
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
0
0
0
null
0
1
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
4
284e88d55f9aff00196815ed1e28db544161af72
11
py
Python
agrid/__init__.py
TobbeTripitaka/grid
5d0d918513a13b89f03b31163de71e08e96032db
[ "MIT" ]
15
2019-03-12T00:18:28.000Z
2021-11-07T20:42:03.000Z
.history/README_20200519103634.md
EvanthiosPapadopoulos/Python3
ab773fd458e365c1510f98ecac65965234c881e8
[ "MIT" ]
8
2019-05-03T23:19:43.000Z
2021-11-02T02:01:28.000Z
.history/README_20200519103634.md
EvanthiosPapadopoulos/Python3
ab773fd458e365c1510f98ecac65965234c881e8
[ "MIT" ]
3
2019-08-06T06:31:08.000Z
2021-10-22T03:11:25.000Z
# Python 3
5.5
10
0.636364
2
11
3.5
1
0
0
0
0
0
0
0
0
0
0
0.125
0.272727
11
1
11
11
0.75
0.727273
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
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
4
285b50f9b460edb730a1b170846679413a6c6f3d
99
py
Python
customers/customerauth/apps.py
nkmrohit/python
bd644d51909cda548684b5da98eab998564f3568
[ "Apache-2.0" ]
null
null
null
customers/customerauth/apps.py
nkmrohit/python
bd644d51909cda548684b5da98eab998564f3568
[ "Apache-2.0" ]
null
null
null
customers/customerauth/apps.py
nkmrohit/python
bd644d51909cda548684b5da98eab998564f3568
[ "Apache-2.0" ]
null
null
null
from django.apps import AppConfig class CustomerauthConfig(AppConfig): name = 'customerauth'
16.5
36
0.777778
10
99
7.7
0.9
0
0
0
0
0
0
0
0
0
0
0
0.151515
99
5
37
19.8
0.916667
0
0
0
0
0
0.121212
0
0
0
0
0
0
1
0
false
0
0.333333
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
0
0
1
0
1
0
0
4
2865ea53b533de2b1b0b54094bd1d62782f5dca7
193
py
Python
umol/app/catalog.py
UMOL/umol-py
521c2beeec4b4f6f916d4ba439c60cc0904dd4ea
[ "MIT" ]
null
null
null
umol/app/catalog.py
UMOL/umol-py
521c2beeec4b4f6f916d4ba439c60cc0904dd4ea
[ "MIT" ]
null
null
null
umol/app/catalog.py
UMOL/umol-py
521c2beeec4b4f6f916d4ba439c60cc0904dd4ea
[ "MIT" ]
null
null
null
""" Return a dict of mapping of string name to actual app's main function date: 06/21/2017 """ from . import diffusion def catalog(): return { "diffusion": diffusion.main, }
14.846154
41
0.647668
27
193
4.62963
0.814815
0
0
0
0
0
0
0
0
0
0
0.054795
0.243523
193
12
42
16.083333
0.80137
0.450777
0
0
0
0
0.091837
0
0
0
0
0
0
1
0.2
true
0
0.2
0.2
0.6
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
0
1
0
0
1
1
0
0
4
286a572234303720b8a6a98c809654783638791c
179
py
Python
work2/__init__.py
arfu2016/DuReader
66934852c508bff5540596aa71d5ce40c828b37d
[ "Apache-2.0" ]
null
null
null
work2/__init__.py
arfu2016/DuReader
66934852c508bff5540596aa71d5ce40c828b37d
[ "Apache-2.0" ]
null
null
null
work2/__init__.py
arfu2016/DuReader
66934852c508bff5540596aa71d5ce40c828b37d
[ "Apache-2.0" ]
null
null
null
""" @Project : DuReader @Module : __init__.py.py @Author : Deco [deco@cubee.com] @Created : 8/13/18 10:48 AM @Desc : sentence embedding nonparametric parametric """
19.888889
34
0.653631
23
179
4.913043
0.913043
0
0
0
0
0
0
0
0
0
0
0.06338
0.206704
179
9
35
19.888889
0.732394
0.955307
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
1
0
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
4
287032f6bb7799601c030bfeb0e5febdee1a5763
851
py
Python
twitch/helix/resources/clips.py
jawills/Twitch-Python
9dca3058d17f27130d0dc11327d479fc9ead30ae
[ "MIT" ]
null
null
null
twitch/helix/resources/clips.py
jawills/Twitch-Python
9dca3058d17f27130d0dc11327d479fc9ead30ae
[ "MIT" ]
null
null
null
twitch/helix/resources/clips.py
jawills/Twitch-Python
9dca3058d17f27130d0dc11327d479fc9ead30ae
[ "MIT" ]
null
null
null
from typing import Optional, List import twitch.helix as helix from twitch.api import API from twitch.helix.resources.resource import T from .resource import Resource class Clips(Resource['helix.Clip']): def __init__(self, api: API, **kwargs: Optional): super().__init__(api=api, path='clips') self._kwargs = kwargs if len(kwargs) > 0: self._data = [helix.Clip(api=self._api, data=clip) for clip in self._api.get(self._path, params=kwargs)['data']] def top(self, **kwargs) -> List['helix.Clip']: return [helix.Clip(api=self._api, data=clip) for clip in self._api.get(f'{self._path}', params=kwargs)['data']] def _can_paginate(self) -> bool: return False def _handle_pagination_response(self, response: dict) -> List[T]: pass
30.392857
75
0.633373
115
851
4.504348
0.356522
0.067568
0.046332
0.061776
0.281853
0.281853
0.177606
0.177606
0.177606
0.177606
0
0.001534
0.233843
851
27
76
31.518519
0.792945
0
0
0
0
0
0.052879
0
0
0
0
0
0
1
0.210526
false
0.052632
0.263158
0.105263
0.631579
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
0
0
0
1
0
1
0
1
1
0
0
4
95733137fa45107e4544273ad67a9fa34bfec24d
6,447
py
Python
Cap1yCap2.py
CURepublicana/Python
6af01f5960bb6c6423b9f57d2c9089d501ff7c69
[ "Apache-2.0" ]
null
null
null
Cap1yCap2.py
CURepublicana/Python
6af01f5960bb6c6423b9f57d2c9089d501ff7c69
[ "Apache-2.0" ]
null
null
null
Cap1yCap2.py
CURepublicana/Python
6af01f5960bb6c6423b9f57d2c9089d501ff7c69
[ "Apache-2.0" ]
null
null
null
#Las palabras clave de Python #Al igual que muchos de los otros lenguajes de programación que va a utilizar, #Python tiene algunas palabras clave que son específicas sólo para él y que no #se puede utilizar en otras partes del código. Estas palabras clave dan #comandos al compilador para que sepa cómo reaccionar a los códigos que #está escribiendo. Por eso están reservados; Si usted comienza a utilizarlos en #otras partes del código, usted va a confundir al compilador y podría tener #algunos problemas con el código que trabaja la manera que usted quisiera. #NO USAR CLASS|FUNCTION|PROGRAM|DEF|INT|FLOAT #Nombrar los identificadores #Mientras está trabajando dentro de Python, o cualquier otro lenguaje de #programación, hay muchos identificadores con los que trabajará. Estos van por #muchos nombres diferentes, incluyendo clases, entidades, funciones y #variables. Cuando intenta nombrar uno de estos identificadores, podrá utilizar #la misma información y reglas para cada uno de ellos. Algunas de las reglas #que debe seguir cuando trabaja en python incluyen: #Puede utilizar una amplia gama de opciones de nomenclatura, incluidas las #letras minúsculas y minúsculas, así como los números y el símbolo de #subrayado. Usted puede utilizar cualquier combinación de estos que usted #quisiera, usted apenas necesita cerciorarse de que usted no agrega en espacios #en el nombre si usted tiene más de una palabra para ella. #Sus identificadores no deben comenzar con un número. Puede tener un número #en otro lugar del código, no puede ser el primer carácter en el nombre #Hay algunas otras cosas que usted debe considerar al nombrar los #identificadores también, aunque éstos no afectarían el código de una manera de #darle un error, siguen siendo importantes hacer las cosas más fáciles. Por #ejemplo, desea asegurarse de que el nombre es fácil de leer porque desea #permitir que otros lean el código sin tener problemas para entender lo que está #intentando hacer. Escoger un nombre que sea descriptivo puede ayudar #también porque le permitirá recordar lo que quería hacer el identificador en #primer lugar. #NO USAR LA SIGUIENTES VARIABLES COMO #1VALOR ERROR #VAR ERROR #int ERROR #$VALOR ERROR #_Valor Valido #PrimeraLetraEnMayuscula Valido #camelCaseEjemplo Valido #Flujo de control en Python #El flujo de control es importante dentro de un lenguaje de codificación, ya que #le ayuda a determinar cómo debe escribir el código que desea haber #hecho. Para Python, va a leer los códigos de arriba a abajo, de una manera #similar a la que leería un libro en casa. Y para asegurarse de que va a #mantener el código funcionando tan bien como sea posible, debe escribir las #diferentes partes como si fuera una lista de supermercado. Algunas personas #les gusta escribir todos los comandos justo al lado del otro y hacer un lío, pero #esto no sólo es difícil de leer, pero también hace que el código causa más #errores. Escriba cada una de las partes del código en una línea separada para #ayudar al flujo de control a ir lo más suavemente posible y para asegurarse de #que otros puedan leerlo correctamente. #Declaraciones #Las declaraciones pueden ser realmente útiles dentro de su código porque le #ayudan a escribir su código. Estas serán las cadenas de código que escribirá #para decirle al compilador lo que le gustaría haber hecho cuando se ejecutó el #código. Siempre y cuando se configuran de una manera que el compilador es #capaz de entender, usted va a obtener un buen código que funcionará bien en el #equipo. La declaración puede ser corta, sólo tiene unas pocas líneas en ellos o #pueden ser realmente largas y contienen un bloque completo de código. #Comentarios #Hay veces en que usted querrá escribir comentarios dentro de su código. Estos #son útiles porque pueden ayudarle a nombrar el código o dejar otra #información en el código para que otros programadores son capaces de llegar #a él y entender lo que está sucediendo dentro del código. Encontrará que el #compilador buscará el signo de comentario (que es el signo #) y luego saltará #el comentario y pasará a la siguiente línea del código. Esto significa que los #comentarios no afectarán a lo que se ejecuta dentro del código, sino que estará #allí para que otros lo utilicen. #TODO ESTO ES UN COMENTARIO ... INCLUSO LA PALABRA RESERVADA TO DO #Funciones en Python #Cuando hablamos de una función dentro de nuestro lenguaje de codificación, #estamos hablando de un bloque de código que puede reutilizar y que se #utilizará para realizar una sola acción. Las funciones le ayudarán a reutilizar #su código mucho mejor que antes y proporcionará más eficiencia en todo el #código. Hay muchas funciones que ya están dentro del código de Python, pero #obtienes la ventaja de crear algunas de las tuyas propias si quieres agregarlas #en ti mismo. #DEF F(X) # * Necesita usar la palabra clave "def"para comenzar el bloque de la # * función. Entonces necesitaría tener el nombre de la función así como algunos # * paréntesis para sostener los parámetros que usted utilizará más adelante. # * Cualquier argumento de entrada debe colocarse en esos paréntesis desde # arriba. También puede utilizarlos para los parámetros. # * La primera declaración que está dentro de la función se permite que sea # sólo una instrucción opcional si usted necesita. # * El bloque de código que se encuentra dentro de todas las funciones se # iniciará con dos puntos y luego se indentará. #!/usr/bin/python # Function definition is here def printme( str ): "This prints a passed string into this function" print str return; # Now you can call printme function printme("I'm first call to user defined function!") printme("Again second call to the same function") #Variables #Las variables son básicamente las ubicaciones en la memoria de nuestro #ordenador que están reservadas para almacenar algunos valores. Cada vez que #decida crear una nueva variable, se va a reservar un poco de espacio dentro #de su memoria. Dependiendo del tipo de datos que coloque en la variable, su #intérprete podrá decidir dónde se almacenará para que lo encuentre más #adelante. Esto facilita la asignación de todos los tipos de datos a las variables, #incluidos los caracteres, los decimales y los enteros. #!/usr/bin/python counter = 100 # An integer assignment miles = 1000.0 # A floating point name = "John" # A string print counter print miles print name
52.844262
83
0.794168
1,037
6,447
4.936355
0.380906
0.015628
0.008791
0.006251
0.016409
0
0
0
0
0
0
0.001684
0.171087
6,447
121
84
53.280992
0.956213
0.922445
0
0
0
0
0.323232
0
0
0
0
0.008264
0
0
null
null
0.083333
0
null
null
0.666667
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
1
0
0
1
0
0
0
1
0
4
95876740a17994e4e79f72d671f46fbaf99c2b47
256
py
Python
src/charma/persons/images/__init__.py
mononobi/charma-server
ed90f5ec0b5ff3996232d5fe49a4f77f96d82ced
[ "BSD-3-Clause" ]
1
2020-01-16T23:36:10.000Z
2020-01-16T23:36:10.000Z
src/charma/persons/images/__init__.py
mononobi/imovie-server
ed90f5ec0b5ff3996232d5fe49a4f77f96d82ced
[ "BSD-3-Clause" ]
24
2020-06-08T18:27:04.000Z
2021-06-06T12:01:39.000Z
src/charma/persons/images/__init__.py
mononobi/charma-server
ed90f5ec0b5ff3996232d5fe49a4f77f96d82ced
[ "BSD-3-Clause" ]
1
2020-12-20T05:29:04.000Z
2020-12-20T05:29:04.000Z
# -*- coding: utf-8 -*- """ persons images package. """ from pyrin.packaging.base import Package class PersonsImagesPackage(Package): """ persons images package class. """ NAME = __name__ COMPONENT_NAME = 'persons.images.component'
16
47
0.664063
26
256
6.346154
0.576923
0.236364
0.242424
0
0
0
0
0
0
0
0
0.004902
0.203125
256
15
48
17.066667
0.803922
0.296875
0
0
0
0
0.152866
0.152866
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
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
4
958d6a1f53bb4dea9d526d01edaecbbc6d5d2e6c
70
py
Python
aurora/optim/__init__.py
upul/Aurora
415a80ac5f7083475baca4a2d187cd102ba7a6c5
[ "Apache-2.0" ]
111
2017-06-10T13:20:20.000Z
2022-03-14T00:05:19.000Z
aurora/optim/__init__.py
upul/Aurora
415a80ac5f7083475baca4a2d187cd102ba7a6c5
[ "Apache-2.0" ]
1
2018-03-04T12:42:49.000Z
2018-03-16T03:15:44.000Z
aurora/optim/__init__.py
upul/Aurora
415a80ac5f7083475baca4a2d187cd102ba7a6c5
[ "Apache-2.0" ]
10
2018-02-23T12:02:29.000Z
2020-10-19T21:58:56.000Z
from .sgd import SGD from .adam import Adam __all__ = ['SGD', 'Adam']
17.5
25
0.685714
11
70
4
0.454545
0
0
0
0
0
0
0
0
0
0
0
0.171429
70
4
25
17.5
0.758621
0
0
0
0
0
0.098592
0
0
0
0
0
0
1
0
false
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
0
0
1
0
1
0
0
4
958f4888bda169c9690756ba2af2c37914bbecd1
593
py
Python
IoTPy/core/pwm.py
nodesign/weioVanilla
e6285bb95832b52cc90b811414a80aec65293355
[ "BSD-3-Clause" ]
null
null
null
IoTPy/core/pwm.py
nodesign/weioVanilla
e6285bb95832b52cc90b811414a80aec65293355
[ "BSD-3-Clause" ]
null
null
null
IoTPy/core/pwm.py
nodesign/weioVanilla
e6285bb95832b52cc90b811414a80aec65293355
[ "BSD-3-Clause" ]
null
null
null
class PWM: def __enter__(self): raise NotImplementedError() def __exit__(self, exc_type, exc_value, traceback): raise NotImplementedError() def set_frequency(self, freq): raise NotImplementedError() def set_period(self, period_us): raise NotImplementedError() def set_duty_cycle(self, duty_cycle): raise NotImplementedError() def set_pulse_time(self, pulse_us): raise NotImplementedError() class PWM_Producer: def PWM(self, name, freq=100, polarity=1, *args, **kwargs): raise NotImplementedError()
21.178571
63
0.674536
65
593
5.846154
0.430769
0.442105
0.355263
0.315789
0
0
0
0
0
0
0
0.008811
0.234401
593
27
64
21.962963
0.828194
0
0
0.4375
0
0
0
0
0
0
0
0
0
1
0.4375
false
0
0
0
0.5625
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
0
0
0
0
0
0
4
95cf03b442c11338fd524d5650499a400b87413c
416
py
Python
swig-2.0.4/Examples/test-suite/python/array_member_runme.py
vidkidz/crossbridge
ba0bf94aee0ce6cf7eb5be882382e52bc57ba396
[ "MIT" ]
1
2016-04-09T02:58:13.000Z
2016-04-09T02:58:13.000Z
swig-2.0.4/Examples/test-suite/python/array_member_runme.py
vidkidz/crossbridge
ba0bf94aee0ce6cf7eb5be882382e52bc57ba396
[ "MIT" ]
null
null
null
swig-2.0.4/Examples/test-suite/python/array_member_runme.py
vidkidz/crossbridge
ba0bf94aee0ce6cf7eb5be882382e52bc57ba396
[ "MIT" ]
null
null
null
from array_member import * f = Foo() f.data = cvar.global_data for i in range(0,8): if get_value(f.data,i) != get_value(cvar.global_data,i): raise RuntimeError, "Bad array assignment" for i in range(0,8): set_value(f.data,i,-i) cvar.global_data = f.data for i in range(0,8): if get_value(f.data,i) != get_value(cvar.global_data,i): raise RuntimeError, "Bad array assignment"
18.909091
60
0.661058
74
416
3.581081
0.310811
0.09434
0.211321
0.124528
0.735849
0.735849
0.686792
0.686792
0.686792
0.686792
0
0.018127
0.204327
416
21
61
19.809524
0.782477
0
0
0.583333
0
0
0.096618
0
0
0
0
0
0
0
null
null
0
0.083333
null
null
0
0
0
0
null
0
1
0
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
4
250c99f13bc3465ea042c06972d34ee990021d87
336
py
Python
agents/random.py
AIcrowd/rl-workshop
6561ecb728342cb77f82806f4f7fb0213529963c
[ "CC0-1.0" ]
23
2020-01-23T12:11:48.000Z
2021-06-29T05:49:48.000Z
agents/random.py
AIcrowd/rl-workshop
6561ecb728342cb77f82806f4f7fb0213529963c
[ "CC0-1.0" ]
3
2021-09-08T01:36:17.000Z
2022-03-12T00:12:57.000Z
agents/random.py
AIcrowd/rl-workshop
6561ecb728342cb77f82806f4f7fb0213529963c
[ "CC0-1.0" ]
23
2020-02-11T11:00:50.000Z
2021-11-02T08:00:14.000Z
# Below are implementations of some standard RL agents class RandomAgent(): """Random agent""" def __init__(self, env): self.env = env def act(self, state): return self.env.action_space.sample() def reset(self): pass def learn(self, state, action, reward, next_state, done): pass
21
61
0.622024
43
336
4.72093
0.651163
0.103448
0
0
0
0
0
0
0
0
0
0
0.270833
336
15
62
22.4
0.828571
0.196429
0
0.222222
0
0
0
0
0
0
0
0
0
1
0.444444
false
0.222222
0
0.111111
0.666667
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
0
0
0
1
0
1
0
1
1
0
0
4
2512faa594830070620c2954852f575f23c1fb59
832
py
Python
src/shape_constraint_detectors/StringLanguageInDetectorSHACLLanguageIn.py
IDLabResearch/lovstats
dd33183574eed692ee89059ff3c6494160dfb8a9
[ "MIT" ]
1
2018-12-11T13:57:38.000Z
2018-12-11T13:57:38.000Z
src/shape_constraint_detectors/StringLanguageInDetectorSHACLLanguageIn.py
IDLabResearch/lovstats
dd33183574eed692ee89059ff3c6494160dfb8a9
[ "MIT" ]
null
null
null
src/shape_constraint_detectors/StringLanguageInDetectorSHACLLanguageIn.py
IDLabResearch/lovstats
dd33183574eed692ee89059ff3c6494160dfb8a9
[ "MIT" ]
null
null
null
from StringLanguageInDetector import StringLanguageInDetector class StringLanguageInDetectorSHACLLanguageIn(StringLanguageInDetector): """ This class implements the detection of the language-in constraint sh:languageIn. For further information have a look at the parent class. """ def __init__(self): super(StringLanguageInDetectorSHACLLanguageIn, self).__init__() self.number = 0 def count(self, s, p, o, s_blank, o_l, o_blank, statement): if p == 'http://www.w3.org/ns/shacl#languageIn': self.number += 1 def getName(self): return "stringLanguageInLODStatsDetectorSHACLLanguageIn" def getVersion(self): return "stringLanguageInLODStatsDetectorSHACLLanguageIn-v1" def compute(self): self.setNumberStringLanguageIn(self.number)
30.814815
84
0.71875
82
832
7.158537
0.621951
0.051107
0.194208
0
0
0
0
0
0
0
0
0.006006
0.199519
832
26
85
32
0.875375
0.164663
0
0
0
0
0.199405
0.144345
0
0
0
0
0
1
0.357143
false
0
0.071429
0.142857
0.642857
0
0
0
0
null
0
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
1
0
0
0
1
1
0
0
4
25461fbc4c73e4894cd603e7e43af4e8731e74d7
193
py
Python
test/plugins/init.py
fenwar/limbo
a6e42ad90daa3691c2dce846023662e0a650171b
[ "MIT" ]
369
2015-02-24T05:35:22.000Z
2021-11-12T11:26:27.000Z
test/plugins/init.py
fenwar/limbo
a6e42ad90daa3691c2dce846023662e0a650171b
[ "MIT" ]
124
2015-02-24T03:13:44.000Z
2022-02-08T15:04:08.000Z
test/plugins/init.py
fenwar/limbo
a6e42ad90daa3691c2dce846023662e0a650171b
[ "MIT" ]
157
2015-02-28T16:33:16.000Z
2022-03-01T22:36:12.000Z
HAVE_RUN_INIT = "False" def on_init(server): global HAVE_RUN_INIT HAVE_RUN_INIT = "True" def on_message(msg, server): if msg["text"] == u"test_init": return HAVE_RUN_INIT
19.3
35
0.673575
31
193
3.83871
0.516129
0.235294
0.369748
0
0
0
0
0
0
0
0
0
0.212435
193
9
36
21.444444
0.782895
0
0
0
0
0
0.11399
0
0
0
0
0
0
1
0.285714
false
0
0
0
0.428571
0
0
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
0
null
0
0
0
0
0
1
0
0
0
0
0
0
0
4
c256e7980960e0b4ddbfb50c449f6b15df319347
136
py
Python
mldata/tests/test_clearner.py
wuhaifengdhu/MLData
04c174c6ce4a6634d8c885b42a87eee8b0a7c76a
[ "Apache-2.0" ]
null
null
null
mldata/tests/test_clearner.py
wuhaifengdhu/MLData
04c174c6ce4a6634d8c885b42a87eee8b0a7c76a
[ "Apache-2.0" ]
1
2018-03-20T09:21:38.000Z
2018-03-20T09:21:38.000Z
mldata/tests/test_clearner.py
wuhaifengdhu/MLData
04c174c6ce4a6634d8c885b42a87eee8b0a7c76a
[ "Apache-2.0" ]
null
null
null
from mldata.lib.cleaner import Cleaner def test_cleaner(): cleaner = Cleaner([12, '', "null", 4, 6.0]) print(cleaner.clean())
19.428571
47
0.647059
19
136
4.578947
0.736842
0.321839
0
0
0
0
0
0
0
0
0
0.044643
0.176471
136
6
48
22.666667
0.732143
0
0
0
0
0
0.029412
0
0
0
0
0
0
1
0.25
false
0
0.25
0
0.5
0.25
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
0
0
0
4
c29ae30b85d38c722defbcb5d40476a7490b403e
158
py
Python
src/tests/test_index.py
rombr/plarin-test-task
6eab8879d33d2220488899d4599c63256e5e4f7b
[ "Apache-2.0" ]
null
null
null
src/tests/test_index.py
rombr/plarin-test-task
6eab8879d33d2220488899d4599c63256e5e4f7b
[ "Apache-2.0" ]
null
null
null
src/tests/test_index.py
rombr/plarin-test-task
6eab8879d33d2220488899d4599c63256e5e4f7b
[ "Apache-2.0" ]
null
null
null
def test_read_main(test_client): response = test_client.get("/") assert response.status_code == 200 assert response.json() == {"Hello": "World"}
26.333333
48
0.670886
20
158
5.05
0.7
0.19802
0
0
0
0
0
0
0
0
0
0.022901
0.170886
158
5
49
31.6
0.748092
0
0
0
0
0
0.070064
0
0
0
0
0
0.5
1
0.25
false
0
0
0
0.25
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
1
0
1
0
0
0
0
0
0
0
4
c2b730516414b635e8bb42134ab87638b8e72e62
15
py
Python
tests/test_toop.py
Genza999/toop
d0c71de33efe2cdfc730d7cc569de4854b2cb011
[ "MIT" ]
null
null
null
tests/test_toop.py
Genza999/toop
d0c71de33efe2cdfc730d7cc569de4854b2cb011
[ "MIT" ]
null
null
null
tests/test_toop.py
Genza999/toop
d0c71de33efe2cdfc730d7cc569de4854b2cb011
[ "MIT" ]
null
null
null
# tests needed
7.5
14
0.733333
2
15
5.5
1
0
0
0
0
0
0
0
0
0
0
0
0.2
15
1
15
15
0.916667
0.8
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
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
4
c2ef7e3bf6acc6bc716c01e8c60665eb6c900b66
73
py
Python
oaatoperator/__init__.py
kawaja/oaat-operator
e3ce56e2b94f922075b402c71e102aec6ae2276b
[ "MIT" ]
1
2021-10-08T06:01:40.000Z
2021-10-08T06:01:40.000Z
oaatoperator/__init__.py
kawaja/oaat-operator
e3ce56e2b94f922075b402c71e102aec6ae2276b
[ "MIT" ]
55
2020-09-05T04:18:26.000Z
2022-03-18T14:11:20.000Z
oaatoperator/__init__.py
kawaja/oaat-operator
e3ce56e2b94f922075b402c71e102aec6ae2276b
[ "MIT" ]
null
null
null
# build scripts will add __version__ at end of this file # flake8: noqa
18.25
56
0.753425
12
73
4.25
1
0
0
0
0
0
0
0
0
0
0
0.017241
0.205479
73
3
57
24.333333
0.862069
0.917808
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
1
0
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
4
6c010ce233d1a9b3d79a223f387370c6e38020f4
316
py
Python
test_TTD.py
arice84/bootcamp
73a5517bcf282fdb2bd8808eb2bfb839eaceadf1
[ "CC-BY-4.0", "MIT" ]
null
null
null
test_TTD.py
arice84/bootcamp
73a5517bcf282fdb2bd8808eb2bfb839eaceadf1
[ "CC-BY-4.0", "MIT" ]
null
null
null
test_TTD.py
arice84/bootcamp
73a5517bcf282fdb2bd8808eb2bfb839eaceadf1
[ "CC-BY-4.0", "MIT" ]
null
null
null
import pytest import TTD def test_n_neg(): assert TTD.n_neg('E') == 1 assert TTD.n_neg('D') == 1 assert TTD.n_neg('') == 0 assert TTD.n_neg('ACKLWTTAE') == 1 assert TTD.n_neg('DEDE') == 4 assert TTD.n_neg('acklwttae') == 1 pytest.raises(RuntimeError, "TTD.n_neg('Z')") return None
21.066667
49
0.60443
52
316
3.5
0.384615
0.175824
0.269231
0.428571
0.478022
0.252747
0
0
0
0
0
0.024292
0.218354
316
14
50
22.571429
0.712551
0
0
0
0
0
0.120253
0
0
0
0
0
0.545455
1
0.090909
true
0
0.181818
0
0.363636
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
0
1
0
0
0
0
0
0
4
6c1a401a40a6f2993f5632bdc3f50357e3af69b5
264
py
Python
pyramid_api_example/views/exceptions_view.py
dimkonko/pyramid_api_example
b3bfb8dbe623544af9b147081d3e25c75a191c24
[ "MIT" ]
null
null
null
pyramid_api_example/views/exceptions_view.py
dimkonko/pyramid_api_example
b3bfb8dbe623544af9b147081d3e25c75a191c24
[ "MIT" ]
null
null
null
pyramid_api_example/views/exceptions_view.py
dimkonko/pyramid_api_example
b3bfb8dbe623544af9b147081d3e25c75a191c24
[ "MIT" ]
null
null
null
import logging import pyramid.httpexceptions as exc from pyramid.view import exception_view_config @exception_view_config(Exception) def failed_validation(exception, request): logging.error(exception, exc_info=True) raise exc.HTTPInternalServerError()
22
46
0.82197
32
264
6.59375
0.59375
0.123223
0.180095
0.265403
0
0
0
0
0
0
0
0
0.113636
264
11
47
24
0.901709
0
0
0
0
0
0
0
0
0
0
0
0
1
0.142857
false
0
0.428571
0
0.571429
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
0
0
0
0
0
1
0
1
0
0
4
6c4c928aa2f32d45270f8304b546f7d467a79069
319
py
Python
projects/fizzbuzz/python/LoganShy/fizzTest.py
algetty/methods
9a149842f745ef26fa48f0556fe43b9337798e2f
[ "MIT" ]
9
2019-01-15T16:03:56.000Z
2019-05-30T01:00:49.000Z
projects/fizzbuzz/python/LoganShy/fizzTest.py
algetty/methods
9a149842f745ef26fa48f0556fe43b9337798e2f
[ "MIT" ]
34
2019-01-30T19:02:38.000Z
2019-04-23T21:20:36.000Z
projects/fizzbuzz/python/LoganShy/fizzTest.py
algetty/methods
9a149842f745ef26fa48f0556fe43b9337798e2f
[ "MIT" ]
27
2019-01-15T23:37:21.000Z
2019-12-26T20:18:24.000Z
import unittest from fizzbuzz import inpTest class TestMethods(unittest.TestCase): def test_Fizz(self): self.assertEqual(inpTest(3), 1) def test_Buzz(self): self.assertEqual(inpTest(5), 1) def test_Bazz(self): self.assertEqual(inpTest(7), 1) # assertEqual (type(main.))
19.9375
43
0.658307
40
319
5.175
0.525
0.101449
0.275362
0.376812
0
0
0
0
0
0
0
0.024292
0.225705
319
16
44
19.9375
0.813765
0.07837
0
0
0
0
0
0
0
0
0
0
0.333333
1
0.333333
false
0
0.222222
0
0.666667
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
0
0
1
0
0
0
0
1
0
0
4
6c57787adb8e5bc989e359c7fdbbd1571eee0cf9
209
py
Python
PyPractice/Q15.py
coedfetr/STTP-python
607d5c03e233dd7c6938ea2495a04701dcf5aed6
[ "Apache-2.0" ]
null
null
null
PyPractice/Q15.py
coedfetr/STTP-python
607d5c03e233dd7c6938ea2495a04701dcf5aed6
[ "Apache-2.0" ]
null
null
null
PyPractice/Q15.py
coedfetr/STTP-python
607d5c03e233dd7c6938ea2495a04701dcf5aed6
[ "Apache-2.0" ]
4
2015-12-24T05:34:46.000Z
2020-03-10T03:39:16.000Z
import re def correct(string): string = re.sub(r'[.]([a-zA-Z])', r'. \1', string) string = re.sub(r'( )+', r'\1', string) return string print correct("This is very funny and cool.Indeed!")
26.125
59
0.574163
33
209
3.636364
0.606061
0.2
0.233333
0.283333
0.3
0
0
0
0
0
0
0.012195
0.215311
209
8
59
26.125
0.719512
0
0
0
0
0
0.309524
0
0
0
0
0
0
0
null
null
0
0.166667
null
null
0.166667
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
1
0
0
0
0
0
0
0
0
4
6c599bf50cb56bfdad53d885680b2555a38b5a58
116
py
Python
minimalist_cms/cms_pagetree/__init__.py
wullerot/django-minimalist-cms
bd6795d9647f9db1d98e83398238c0e63aca3c1b
[ "MIT" ]
null
null
null
minimalist_cms/cms_pagetree/__init__.py
wullerot/django-minimalist-cms
bd6795d9647f9db1d98e83398238c0e63aca3c1b
[ "MIT" ]
null
null
null
minimalist_cms/cms_pagetree/__init__.py
wullerot/django-minimalist-cms
bd6795d9647f9db1d98e83398238c0e63aca3c1b
[ "MIT" ]
null
null
null
from __future__ import unicode_literals default_app_config = 'minimalist_cms.cms_pagetree.apps.CMSPageTreeConfig'
23.2
73
0.87069
14
116
6.571429
0.928571
0
0
0
0
0
0
0
0
0
0
0
0.077586
116
4
74
29
0.859813
0
0
0
0
0
0.431034
0.431034
0
0
0
0
0
1
0
false
0
0.5
0
0.5
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
1
null
0
0
0
0
0
0
0
0
1
0
0
0
0
4
6c8739ada1744ac8b29a09afc31e0fdceab85665
284
py
Python
Estruturas-Sequenciais/ex04.py
ErickdeSouzaDias/Python-Brasil
eede727c91e0a293096779c907af2d56c86fe048
[ "MIT" ]
null
null
null
Estruturas-Sequenciais/ex04.py
ErickdeSouzaDias/Python-Brasil
eede727c91e0a293096779c907af2d56c86fe048
[ "MIT" ]
null
null
null
Estruturas-Sequenciais/ex04.py
ErickdeSouzaDias/Python-Brasil
eede727c91e0a293096779c907af2d56c86fe048
[ "MIT" ]
null
null
null
#Faça um Programa que peça as 4 notas bimestrais e mostre a média. n1 = float(input('Digite a 1º nota: ')) n2 = float(input('Digite a 2º nota: ')) n3 = float(input('Digite a 3º nota: ')) n4 = float(input('Digite a 4º nota: ')) media = (n1+n2+n3+n4)/4 print(f'A média é {media:.2f}.')
35.5
66
0.65493
54
284
3.444444
0.555556
0.215054
0.344086
0.365591
0
0
0
0
0
0
0
0.063559
0.169014
284
7
67
40.571429
0.724576
0.228873
0
0
0
0
0.431193
0
0
0
0
0
0
1
0
false
0
0
0
0
0.166667
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
0
0
0
0
0
4
665a23d6fc6875453742793ca4637246298fa0d4
1,491
py
Python
oknlp/algorithm/postagging/bert_postagging/class_list.py
PLNUHT/ink
3542bdfbd7281118c62e0b1ab965dc7ddf279a6d
[ "MIT" ]
6
2021-09-01T02:47:48.000Z
2021-12-21T18:40:05.000Z
oknlp/algorithm/postagging/bert_postagging/class_list.py
PLNUHT/ink
3542bdfbd7281118c62e0b1ab965dc7ddf279a6d
[ "MIT" ]
1
2021-08-10T06:06:23.000Z
2021-08-10T06:06:23.000Z
oknlp/algorithm/postagging/bert_postagging/class_list.py
thunlp/oknlp
3542bdfbd7281118c62e0b1ab965dc7ddf279a6d
[ "MIT" ]
2
2020-08-10T15:13:41.000Z
2021-02-01T03:01:37.000Z
# 'ctb6' classlist = ['O', 'E-NR', 'E-OD', 'B-SP', 'S-AS', 'I-P', 'I-JJ', 'E-IJ', 'S-OD', 'I-OD', 'I-VA', 'E-ETC', 'B-CC', 'S-MSP', 'B-LC', 'E-VA', 'E-VC', 'E-DT', 'I-VC', 'S-PN', 'E-MSP', 'I-PU', 'E-VE', 'B-DT', 'S-CC', 'S-DT', 'S-DER', 'B-AD', 'S-VV', 'S-NR', 'B-OD', 'S-VE', 'B-NN-SHORT', 'S-LB', 'S-CS', 'I-CC', 'E-PN', 'E-P', 'I-NN', 'S-DEC', 'E-PU', 'I-M', 'B-PU', 'I-PN', 'I-NN', 'B-M', 'I-DT', 'S-SB', 'B-CS', 'S-SP', 'I-CD', 'B-VE', 'S-ON', 'B-PN', 'B-P', 'S-VC', 'B-VA', 'S-FW', 'B-ON', 'S-NT-SHORT', 'E-NN-SHORT', 'I-VV', 'S-DEG', 'E-ON', 'S-NT', 'S-IJ', 'S-AD', 'IFW', 'I-AD', 'B-CD', 'S-LC', 'E-CD', 'E-JJ', 'B-IJ', 'E-NN', 'E-SP', 'S-P', 'S-VA', 'S-ETC', 'B-VV', 'E-CS', 'S-CD', 'E-M', 'B-MSP', 'S-JJ', 'E-LC', 'S-PU', 'B-ETC', 'I-NT', 'E-CC', 'B-NN', 'S-BA', 'E-NT', 'E-AD', 'I-NR', 'B-NT', 'I-CS', 'B-JJ', 'S-M', 'S-X', 'S-DEV', 'S-NR-SHORT', 'B-NR', 'I-NN-SHORT', 'B-VC', 'E-FW', 'E-VV', 'B-FW'] # 'ud1' # classlist = ['O', 'B-PART', 'M-ADV', 'B-CONJ', 'E-SYM', 'S-PROPN', 'S-PUNCT', 'B-ADP', 'S-PART', 'B-PUNCT', 'B-PRON', 'E-PRON', 'B-NOUN', 'E-ADP', 'E-NOUN', 'M-SYM', 'S-ADV', 'B-AUX', 'E-VERB', 'M-NUM', 'M-VERB', 'S-ADP', 'E-AUX', 'B-X', 'E-ADV', 'E-PROPN', 'S-AUX', 'M-X', 'S-VERB', 'B-PROPN', 'M-DET', 'M-PUNCT', 'E-PUNCT', 'S-DET', 'B-SYM', 'M-ADJ', 'S-NOUN', 'S-NUM', 'B-NUM', 'E-DET', 'B-VERB', 'S-CONJ', 'M-NOUN', 'S-SYM', 'E-NUM', 'B-ADJ', 'M-PART', 'S-PRON', 'E-ADJ', 'E-X', 'M-ADP', 'E-PART', 'M-PROPN', 'M-CONJ', 'S-X', 'B-ADV', 'S-ADJ', 'E-CONJ', 'B-DET']
248.5
903
0.424547
340
1,491
1.861765
0.170588
0.014218
0.015798
0
0
0
0
0
0
0
0
0.001522
0.118712
1,491
5
904
298.2
0.480213
0.38833
0
0
0
0
0.506064
0
0
0
0
0
0
1
0
false
0
0
0
0
0
0
0
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
1
1
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
666c94dfb04c8005dacffdc0cffe23c31e4d221e
4,069
py
Python
DailyProgrammer/DP20150520W.py
DayGitH/Python-Challenges
bc32f1332a92fcc2dfa6f5ea4d95f8a8d64c3edf
[ "MIT" ]
2
2020-12-23T18:59:22.000Z
2021-04-14T13:16:09.000Z
DailyProgrammer/DP20150520W.py
DayGitH/Python-Challenges
bc32f1332a92fcc2dfa6f5ea4d95f8a8d64c3edf
[ "MIT" ]
null
null
null
DailyProgrammer/DP20150520W.py
DayGitH/Python-Challenges
bc32f1332a92fcc2dfa6f5ea4d95f8a8d64c3edf
[ "MIT" ]
null
null
null
""" [Weekly #23] Computational Complexity and Algorithm Design https://www.reddit.com/r/dailyprogrammer/comments/36iufn/weekly_23_computational_complexity_and_algorithm/ # [](#WeeklyIcon) Dynamic Programming and Algorithm Design Programming is fundamentally tied to computer science, which involves the design and optimization of algorithms to solve certain problems. In the world of "big data", tweaking and streamlining algorithms to work as quickly as possible is an important process in designing an algorithm, especially over large, inter-connected data sets. A set of notations usually referred to as [**big-O notation**](http://en.wikipedia.org/wiki/Big_O_notation), so named for the big letter O which is a core component of the notation (believe it or not). This notation describes how the processing time and working space grows, as the size of the input data set grows. For example, if an algorithm runs in O(*f*(n)) time, then the running time of the algorithm with respect to input size n grows no quicker than *f*(n), ignoring any constant multiples. An example of this is sorting data (there's a [pre-existing Weekly thread just on sorting here](http://www.reddit.com/r/dailyprogrammer/comments/2emixb/)). The simple naïve algorithms for sorting typically run in O(n^(2)) time in the worst-case scenario. This includes algorithms such as insertion sort. However, a bit of clever thinking allowed algorithms such as quick-sort to be developed, which uses a [divide and conquer](http://en.wikibooks.org/wiki/Algorithms/Divide_and_Conquer) approach to make the process simpler, thereby reducing the time complexity to O(n log n) - which runs much faster when your data to be sorted is large. We've recently had a spate of challenges which require a bit of algorithm design, so unbeknownst to you, you've already done some of this work. The specific challenges are these five; check them out if you've not already: * [[Hard] Unpacking a Sentence in a Box](http://www.reddit.com/r/dailyprogrammer/comments/322hh0/20150410_challenge_209_hard_unpacking_a_sentence/) * [[Intermediate] The Lazy Typist](http://www.reddit.com/r/dailyprogrammer/comments/351b0o/) * [[Hard] Stepstring discrepancy](http://www.reddit.com/r/dailyprogrammer/comments/358pfk/) * [[Intermediate] Pile of Paper](http://www.reddit.com/r/dailyprogrammer/comments/35s2ds/) * [[Hard] Chester, the greedy Pomeranian](http://www.reddit.com/r/dailyprogrammer/comments/3629st/) If you write an inefficient algorithm to solve these challenges, it might take forever to complete! Techniques such as dynamic programming study algorithms, and specifically those that break problems down into easier-to-solve sub-problems which can be solved quicker individually than as a whole. There's also a certain class of problems (NP) for which you physically can't solve efficiently using this approach; this includes problems such as the infamous [travelling salesman problem](http://mathworld.wolfram.com/TravelingSalesmanProblem.html) and [boolean 3-SAT](http://math.stackexchange.com/questions/86210/what-is-the-3sat-problem), for which no exact efficient solution has been found; and indeed [probably won't be found](http://www.claymath.org/millenium-problems/p-vs-np-problem). In today's Weekly discussion, discuss anything that interests you, or that you know of, relating to algorithm design, or any interesting algorithmic approaches you took to solving any particular DailyProgrammer challenge set to date! ### Challenge Solution Order In yesterday's challenge, we trialled ordering the solution submissions by *new* rather than by *best*. What are your opinions on this? How did you think it went? Should we make this the norm? ### IRC We have an [IRC channel on Freenode](http://www.reddit.com/r/dailyprogrammer/comments/2dtqr7/), at **#reddit-dailyprogrammer**. Join the channel and lurk with us! ### Previously... The previous weekly thread was [**Machine Learning**](http://www.reddit.com/r/dailyprogrammer/comments/3206mk/). """ def main(): pass if __name__ == "__main__": main()
73.981818
119
0.788892
633
4,069
5.034755
0.461295
0.025416
0.033888
0.036712
0.138688
0.138688
0.100408
0
0
0
0
0.014037
0.124601
4,069
54
120
75.351852
0.880685
0.982305
0
0
0
0
0.125
0
0
0
0
0
0
1
0.25
true
0.25
0
0
0.25
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
1
0
0
0
0
0
4
6672ab6b955f4f8df7e4ee98e32322f2008e8958
1,057
py
Python
tests/ci_tests/unit/ui/test_ui_driver.py
bgoldbeck/ldraw
61a3fde105d0c0841a571037537ec3347bae8808
[ "MIT" ]
2
2019-02-02T16:45:15.000Z
2019-03-13T19:40:40.000Z
tests/ci_tests/unit/ui/test_ui_driver.py
bgoldbeck/ldraw
61a3fde105d0c0841a571037537ec3347bae8808
[ "MIT" ]
24
2019-01-31T05:10:11.000Z
2019-03-12T15:25:22.000Z
tests/ci_tests/unit/ui/test_ui_driver.py
bgoldbeck/lego-scan
61a3fde105d0c0841a571037537ec3347bae8808
[ "MIT" ]
5
2019-03-20T16:15:46.000Z
2019-07-20T22:36:57.000Z
# Copyright (C) 2018 - This notice is to be included in all relevant source files. # "Brandon Goldbeck" <bpg@pdx.edu> # “Anthony Namba” <anamba@pdx.edu> # “Brandon Le” <lebran@pdx.edu> # “Ann Peake” <peakean@pdx.edu> # “Sohan Tamang” <sohan@pdx.edu> # “An Huynh” <an35@pdx.edu> # “Theron Anderson” <atheron@pdx.edu> # This software is licensed under the MIT License. See LICENSE file for the full text. import unittest from src.ui.ui_driver import UIDriver from src.lscan import LScan from src.ui.application_state import ApplicationState from src.ui.main_frame import MainFrame class UIDriverTest(unittest.TestCase): def setUp(self): # self.ui_driver = UIDriver(None) # Commented out because the wx.timer was messing it up pass def tearDown(self): pass def testInitialized(self): # self.assertIsNone(self.ui_driver.root_frame) # self.assertEqual(self.ui_driver.application_state, ApplicationState.WAITING_INPUT) # self.assertEqual(self.ui_driver.instance, self.ui_driver) pass
35.233333
92
0.719962
149
1,057
5.033557
0.57047
0.056
0.08
0.056
0.072
0
0
0
0
0
0
0.00692
0.179754
1,057
30
93
35.233333
0.858131
0.619678
0
0.25
0
0
0
0
0
0
0
0
0
1
0.25
false
0.25
0.416667
0
0.75
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
0
0
0
1
0
1
1
0
1
0
0
4
66788e90b57315d3bac01e6e13f6299353a27719
227
py
Python
inventory/templatetags/graph_extras.py
ktt-ol/ktt-inventory-system
329b2fe1443e75d005fe3cea6cc6f13f746524f4
[ "0BSD" ]
2
2016-07-02T21:55:29.000Z
2019-04-26T16:01:56.000Z
inventory/templatetags/graph_extras.py
ktt-ol/ktt-inventory-system
329b2fe1443e75d005fe3cea6cc6f13f746524f4
[ "0BSD" ]
3
2015-05-09T22:45:15.000Z
2021-09-10T16:20:40.000Z
inventory/templatetags/graph_extras.py
ktt-ol/ktt-inventory-system
329b2fe1443e75d005fe3cea6cc6f13f746524f4
[ "0BSD" ]
3
2015-02-15T22:50:06.000Z
2018-06-08T17:01:29.000Z
from django import template from django.template.defaultfilters import stringfilter register = template.Library() @register.filter(name='graphescape') @stringfilter def graphescape(value): return value.replace('"', '\\"')
25.222222
55
0.770925
24
227
7.291667
0.625
0.114286
0
0
0
0
0
0
0
0
0
0
0.101322
227
8
56
28.375
0.857843
0
0
0
0
0
0.066079
0
0
0
0
0
0
1
0.142857
false
0
0.285714
0.142857
0.571429
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
0
1
1
0
0
4
66a3eeb3b7fa4ca8d8b150c0cd97e9eac5269d55
13
py
Python
expriment.py
ShahramSeyedi/football
0bc55fc1eb7de887c74495dd44ae76a1483bf8a6
[ "Apache-2.0" ]
null
null
null
expriment.py
ShahramSeyedi/football
0bc55fc1eb7de887c74495dd44ae76a1483bf8a6
[ "Apache-2.0" ]
null
null
null
expriment.py
ShahramSeyedi/football
0bc55fc1eb7de887c74495dd44ae76a1483bf8a6
[ "Apache-2.0" ]
null
null
null
Expriment...
6.5
12
0.692308
1
13
9
1
0
0
0
0
0
0
0
0
0
0
0
0.076923
13
1
13
13
0.75
0
0
0
0
0
0
0
0
0
0
0
0
0
null
null
0
0
null
null
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
1
0
0
0
0
0
0
0
0
4
66cfb8d5444bb9a9c11f4f4a7e4e000d5672a40a
29
py
Python
adrh-web/_version.py
esserafael/PythonStuff
97900e48f989b64ccde02f5d676f7f823ec0eed7
[ "MIT" ]
1
2020-08-03T00:19:05.000Z
2020-08-03T00:19:05.000Z
adrh-web/_version.py
esserafael/PythonStuff
97900e48f989b64ccde02f5d676f7f823ec0eed7
[ "MIT" ]
1
2021-08-23T20:43:21.000Z
2021-08-23T20:43:21.000Z
adrh-web/_version.py
esserafael/python-learning-stuff
97900e48f989b64ccde02f5d676f7f823ec0eed7
[ "MIT" ]
null
null
null
__version__ = "0.1.8-alpha"
14.5
28
0.655172
5
29
3
1
0
0
0
0
0
0
0
0
0
0
0.12
0.137931
29
1
29
29
0.48
0
0
0
0
0
0.392857
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
0
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
4
66d7b758f29b1d33560d3350792012cad72ef80e
97
py
Python
tests/bot.py
ninchat/ninchat-python
7e5fcadb7389ca8c7722c32d69839289675d7baa
[ "BSD-2-Clause" ]
null
null
null
tests/bot.py
ninchat/ninchat-python
7e5fcadb7389ca8c7722c32d69839289675d7baa
[ "BSD-2-Clause" ]
4
2017-10-12T21:05:12.000Z
2018-05-17T22:19:08.000Z
tests/bot.py
ninchat/ninchat-python
7e5fcadb7389ca8c7722c32d69839289675d7baa
[ "BSD-2-Clause" ]
null
null
null
import logging from ninchat.bot.asyncio.main import main if __name__ == "__main__": main()
13.857143
41
0.721649
13
97
4.769231
0.692308
0
0
0
0
0
0
0
0
0
0
0
0.175258
97
6
42
16.166667
0.775
0
0
0
0
0
0.082474
0
0
0
0
0
0
1
0
true
0
0.5
0
0.5
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
0
0
0
4
66ddb326b123dfd4ca297dfe64d0d026fa61a189
81
py
Python
systest/rexursivescan_for_doctest/test_doctest.py
ben5962/pytddmon
42e51590ca10be7048028467a85d6657ecb9ebc4
[ "MIT" ]
12
2015-02-18T11:33:59.000Z
2022-01-22T15:35:05.000Z
systest/rexursivescan_for_doctest/test_doctest.py
ben5962/pytddmon
42e51590ca10be7048028467a85d6657ecb9ebc4
[ "MIT" ]
12
2015-02-18T10:26:51.000Z
2020-10-15T17:53:12.000Z
systest/rexursivescan_for_doctest/test_doctest.py
ben5962/pytddmon
42e51590ca10be7048028467a85d6657ecb9ebc4
[ "MIT" ]
6
2015-12-19T18:07:20.000Z
2020-10-15T16:50:52.000Z
def id_function(x): """ >>> id_function(10) 10 """ return x
10.125
23
0.45679
10
81
3.5
0.6
0.571429
0
0
0
0
0
0
0
0
0
0.078431
0.37037
81
7
24
11.571429
0.607843
0.271605
0
0
0
0
0
0
0
0
0
0
0
1
0.5
false
0
0
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
1
0
0
0
0
0
0
0
4
66e65fd6a97bd97614b7dce1253a330eba068e8c
1,918
py
Python
game/player.py
willdzeng/ticket_to_ride
59ebcd65707faa4471c367fc7b5ae5852f0ad6d2
[ "BSD-3-Clause" ]
1
2021-07-11T20:31:07.000Z
2021-07-11T20:31:07.000Z
game/player.py
willdzeng/ticket_to_ride
59ebcd65707faa4471c367fc7b5ae5852f0ad6d2
[ "BSD-3-Clause" ]
null
null
null
game/player.py
willdzeng/ticket_to_ride
59ebcd65707faa4471c367fc7b5ae5852f0ad6d2
[ "BSD-3-Clause" ]
3
2020-08-03T21:51:05.000Z
2022-03-31T22:25:58.000Z
class Player: """ A player. In addition to being a token that allows moves to happen, also has events that trigger on certain game states. """ def __init__(self, name, print_debug=False): self.name = name self.print_debug = print_debug def __str__(self): return self.name def initialize_game(self,game): pass def take_turn(self, game): pass def game_ended(self, game): pass def debug_print(self, game): """ Prints extra debug information. :param game: :return: A string to print with debug information. """ return "" def on_action_complete(self, game, result): """ A callback that is performed on the player after the player performs an action. :param game: :param result: The result of the action, which will be a tuple with a boolean for success and a failure cause. """ pass def select_destinations(self, game, destinations): """ Selects up to three but at least one of the the destinations this player has drawn. :param game: :param destinations: A list of the destinations to select from. :return: A sublist of the destinations passed in with at least one element. """ # TODO: In game, make sure that the returned destinations were in the parameter return destinations def select_starting_destinations(self, game, destinations): """ Selects up to three but at least one of the the destinations this player has drawn. :param game: :param destinations: A list of the destinations to select from. :return: A sublist of the destinations passed in with at least one element. """ # TODO: In game, make sure that the returned destinations were in the parameter return destinations
30.444444
118
0.635558
253
1,918
4.73913
0.332016
0.046706
0.033361
0.037531
0.500417
0.500417
0.500417
0.500417
0.500417
0.500417
0
0
0.30292
1,918
62
119
30.935484
0.896784
0.550574
0
0.3
0
0
0
0
0
0
0
0.032258
0
1
0.45
false
0.2
0
0.05
0.7
0.15
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
0
1
0
0
4
dd26206d53ca057d9016d3d4d82265f04b72cf37
5,645
py
Python
SBaaS_thermodynamics/stage03_quantification_dG_p_postgresql_models.py
dmccloskey/SBaaS_thermodynamics
0eeed0191f952ea0226ab8bbc234a30638fb2f9f
[ "MIT" ]
null
null
null
SBaaS_thermodynamics/stage03_quantification_dG_p_postgresql_models.py
dmccloskey/SBaaS_thermodynamics
0eeed0191f952ea0226ab8bbc234a30638fb2f9f
[ "MIT" ]
null
null
null
SBaaS_thermodynamics/stage03_quantification_dG_p_postgresql_models.py
dmccloskey/SBaaS_thermodynamics
0eeed0191f952ea0226ab8bbc234a30638fb2f9f
[ "MIT" ]
null
null
null
#SBaaS base from SBaaS_base.postgresql_orm_base import * class data_stage03_quantification_dG_p(Base): __tablename__ = 'data_stage03_quantification_dG_p' id = Column(Integer, Sequence('data_stage03_quantification_dG_p_id_seq'), primary_key=True) experiment_id = Column(String(50)) model_id = Column(String(50)) sample_name_abbreviation = Column(String(100)) time_point = Column(String(10)) pathway_id = Column(String(100)) dG_p = Column(Float); dG_p_var = Column(Float); dG_p_units = Column(String(50)); dG_p_lb = Column(Float); dG_p_ub = Column(Float); used_ = Column(Boolean); comment_ = Column(Text); __table_args__ = (UniqueConstraint('experiment_id','sample_name_abbreviation','time_point','pathway_id'), ) def __init__(self, row_dict_I, ): self.pathway_id=row_dict_I['pathway_id']; self.time_point=row_dict_I['time_point']; self.sample_name_abbreviation=row_dict_I['sample_name_abbreviation']; self.model_id=row_dict_I['model_id']; self.experiment_id=row_dict_I['experiment_id']; self.used_=row_dict_I['used_']; self.dG_p_ub=row_dict_I['dG_p_ub']; self.comment_=row_dict_I['comment_']; self.dG_p_lb=row_dict_I['dG_p_lb']; self.dG_p_units=row_dict_I['dG_p_units']; self.dG_p_var=row_dict_I['dG_p_var']; self.dG_p=row_dict_I['dG_p']; def __set__row__(self,experiment_id_I,model_id_I,sample_name_abbreviation_I, time_point_I,pathway_id_I, dG_p_I,dG_p_var_I,dG_p_units_I,dG_p_lb_I, dG_p_ub_I,used_I,comment_I,): self.experiment_id = experiment_id_I; self.model_id = model_id_I; self.sample_name_abbreviation = sample_name_abbreviation_I; self.time_point = time_point_I; self.pathway_id = pathway_id_I; self.dG_p = dG_p_I; self.dG_p_var = dG_p_var_I; self.dG_p_units = dG_p_units_I; self.dG_p_lb = dG_p_lb_I; self.dG_p_ub = dG_p_ub_I; self.used_ = used_I; self.comment_ = comment_I; def __repr__dict__(self): return {'id':self.id, 'experiment_id':self.experiment_id, 'model_id':self.model_id, 'sample_name_abbreviation':self.sample_name_abbreviation, 'time_point':self.time_point, 'pathway_id':self.pathway_id, 'dG_p':self.dG_p, 'dG_p_var':self.dG_p_var, 'dG_p_units':self.dG_p_units, 'dG_p_lb':self.dG_p_lb, 'dG_p_ub':self.dG_p_ub, 'used_':self.used_, 'comment_':self.comment_} def __repr__json__(self): return json.dumps(self.__repr__dict__()) class data_stage03_quantification_dG0_p(Base): __tablename__ = 'data_stage03_quantification_dG0_p' id = Column(Integer, Sequence('data_stage03_quantification_dG0_p_id_seq'), primary_key=True) experiment_id = Column(String(50)) model_id = Column(String(50)) sample_name_abbreviation = Column(String(100)) time_point = Column(String(10)) pathway_id = Column(String(100)) dG0_p = Column(Float); dG0_p_var = Column(Float); dG0_p_units = Column(String(50)); dG0_p_lb = Column(Float); dG0_p_ub = Column(Float); used_ = Column(Boolean); comment_ = Column(Text); __table_args__ = (UniqueConstraint('experiment_id','sample_name_abbreviation','time_point','pathway_id'), ) def __init__(self, row_dict_I, ): self.comment_=row_dict_I['comment_']; self.used_=row_dict_I['used_']; self.dG0_p_ub=row_dict_I['dG0_p_ub']; self.dG0_p_lb=row_dict_I['dG0_p_lb']; self.dG0_p_units=row_dict_I['dG0_p_units']; self.dG0_p_var=row_dict_I['dG0_p_var']; self.dG0_p=row_dict_I['dG0_p']; self.pathway_id=row_dict_I['pathway_id']; self.time_point=row_dict_I['time_point']; self.sample_name_abbreviation=row_dict_I['sample_name_abbreviation']; self.model_id=row_dict_I['model_id']; self.experiment_id=row_dict_I['experiment_id']; def __set__row__(self,experiment_id_I,model_id_I,sample_name_abbreviation_I, time_point_I,pathway_id_I, dG0_p_I,dG0_p_var_I,dG0_p_units_I,dG0_p_lb_I, dG0_p_ub_I,used_I,comment_I,): self.experiment_id = experiment_id_I; self.model_id = model_id_I; self.sample_name_abbreviation = sample_name_abbreviation_I; self.time_point = time_point_I; self.pathway_id = pathway_id_I; self.dG0_p = dG0_p_I; self.dG0_p_var = dG0_p_var_I; self.dG0_p_units = dG0_p_units_I; self.dG0_p_lb = dG0_p_lb_I; self.dG0_p_ub = dG0_p_ub_I; self.used_ = used_I; self.comment_ = comment_I; def __repr__dict__(self): return {'id':self.id, 'experiment_id':self.experiment_id, 'model_id':self.model_id, 'sample_name_abbreviation':self.sample_name_abbreviation, 'time_point':self.time_point, 'pathway_id':self.pathway_id, 'dG0_p':self.dG0_p, 'dG0_p_var':self.dG0_p_var, 'dG0_p_units':self.dG0_p_units, 'dG0_p_lb':self.dG0_p_lb, 'dG0_p_ub':self.dG0_p_ub, 'used_':self.used_, 'comment_':self.comment_} def __repr__json__(self): return json.dumps(self.__repr__dict__())
40.321429
109
0.638264
827
5,645
3.775091
0.068924
0.04132
0.066624
0.019218
0.904228
0.827034
0.700192
0.668161
0.636771
0.636771
0
0.019668
0.252436
5,645
140
110
40.321429
0.720142
0.001771
0
0.589147
0
0
0.129193
0.051109
0
0
0
0
0
1
0.062016
false
0
0.007752
0.031008
0.348837
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
0
0
0
0
0
0
0
0
0
0
4
dd309a051d2f9cb46a5c3ef34742c04cb08ce0fe
188
py
Python
slr/submission_app/views.py
iamvineettiwari012/WSoC-TestRepo1
917ad850c3eaf62a8c07f45d19f5dac3fa053af0
[ "Apache-2.0" ]
null
null
null
slr/submission_app/views.py
iamvineettiwari012/WSoC-TestRepo1
917ad850c3eaf62a8c07f45d19f5dac3fa053af0
[ "Apache-2.0" ]
null
null
null
slr/submission_app/views.py
iamvineettiwari012/WSoC-TestRepo1
917ad850c3eaf62a8c07f45d19f5dac3fa053af0
[ "Apache-2.0" ]
null
null
null
from django.shortcuts import render from django.views.generic import TemplateView app_name = 'submission_app' class Index(TemplateView): template_name = 'submission_app/index.html'
20.888889
47
0.803191
24
188
6.125
0.625
0.136054
0.231293
0
0
0
0
0
0
0
0
0
0.12234
188
8
48
23.5
0.890909
0
0
0
0
0
0.208556
0.13369
0
0
0
0
0
1
0
false
0
0.4
0
0.8
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
0
0
1
0
0
0
0
4
dd59490626c3985f138b1372790597ee5a4976f1
64
py
Python
klasses/java_lang_Runtime.py
MrHamdulay/myjvm
03fbe54139a7fa77bd89b2305ba251ae85009ee8
[ "MIT" ]
2
2016-08-29T16:50:52.000Z
2017-02-22T09:34:00.000Z
klasses/java_lang_Runtime.py
MrHamdulay/myjvm
03fbe54139a7fa77bd89b2305ba251ae85009ee8
[ "MIT" ]
null
null
null
klasses/java_lang_Runtime.py
MrHamdulay/myjvm
03fbe54139a7fa77bd89b2305ba251ae85009ee8
[ "MIT" ]
null
null
null
def availableProcessors(klass, vm, method, frame): return 1
21.333333
50
0.734375
8
64
5.875
1
0
0
0
0
0
0
0
0
0
0
0.018868
0.171875
64
2
51
32
0.867925
0
0
0
0
0
0
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
0
0
0
4
dd6e6c13ebdae3cede9629a7f80af9ab3dd10763
81
py
Python
src/backend/hse/apps.py
AndreyBakurskii/Coursework
638f9ded4444ebc15a4857f56dafe27fa4e11704
[ "MIT" ]
null
null
null
src/backend/hse/apps.py
AndreyBakurskii/Coursework
638f9ded4444ebc15a4857f56dafe27fa4e11704
[ "MIT" ]
null
null
null
src/backend/hse/apps.py
AndreyBakurskii/Coursework
638f9ded4444ebc15a4857f56dafe27fa4e11704
[ "MIT" ]
null
null
null
from django.apps import AppConfig class HseConfig(AppConfig): name = 'hse'
13.5
33
0.728395
10
81
5.9
0.9
0
0
0
0
0
0
0
0
0
0
0
0.185185
81
5
34
16.2
0.893939
0
0
0
0
0
0.037037
0
0
0
0
0
0
1
0
false
0
0.333333
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
0
0
1
0
1
0
0
4
dd77c1bf51bdf88a2c1b75ed06a1667cdfd586d8
223
py
Python
01-blockchain/utility/__init__.py
TranXuanHoang/Python
6e62282540a7f1e2b2d0dff99b1803715bf6c4b0
[ "CNRI-Python" ]
null
null
null
01-blockchain/utility/__init__.py
TranXuanHoang/Python
6e62282540a7f1e2b2d0dff99b1803715bf6c4b0
[ "CNRI-Python" ]
null
null
null
01-blockchain/utility/__init__.py
TranXuanHoang/Python
6e62282540a7f1e2b2d0dff99b1803715bf6c4b0
[ "CNRI-Python" ]
null
null
null
from utility.hash_util import hash_block, hash_string_256 from utility.printable import Printable from utility.verification import Verification __all__ = ['hash_block', 'hash_string_256', 'Printable', 'Verification']
37.166667
73
0.807175
28
223
6.035714
0.392857
0.195266
0.153846
0.224852
0.260355
0
0
0
0
0
0
0.030303
0.112108
223
5
74
44.6
0.823232
0
0
0
0
0
0.211009
0
0
0
0
0
0
1
0
false
0
0.75
0
0.75
0.25
1
0
0
null
0
0
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
4
06f1780e13bef490f1f459114b2332cfc41ee770
350
py
Python
core/activity.py
hyouv/Darknights-server
5ec9041339d9db1ef17ae2889939f16bb51c4171
[ "Apache-2.0" ]
112
2021-09-11T14:26:23.000Z
2022-03-28T14:29:59.000Z
core/activity.py
hyouv/Darknights-server
5ec9041339d9db1ef17ae2889939f16bb51c4171
[ "Apache-2.0" ]
7
2021-09-11T14:59:54.000Z
2022-01-24T21:25:01.000Z
core/activity.py
hyouv/Darknights-server
5ec9041339d9db1ef17ae2889939f16bb51c4171
[ "Apache-2.0" ]
33
2021-09-11T14:56:26.000Z
2022-03-20T20:55:58.000Z
#!/usr/bin/env python # -*- coding: utf-8 -*- # Description: Activity System from bottle import * import json @route('/activity/getActivityCheckInReward', method='POST') def checkIn(): return json.loads('{"result":0}') @route('/activity/gridGacha/gacha', method='POST') def gridGacha(): return json.loads('{"result":0}')
20.588235
60
0.645714
40
350
5.65
0.65
0.115044
0.115044
0.185841
0.19469
0
0
0
0
0
0
0.010274
0.165714
350
16
61
21.875
0.763699
0.202857
0
0.25
0
0
0.35
0.226923
0
0
0
0
0
1
0.25
true
0
0.25
0.25
0.75
0
0
0
0
null
0
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
1
0
0
1
0
0
0
4
06f6b2aae22faed1e639495c572e8bd5697c8faf
159
py
Python
Search/models.py
xcamilox/searchengine
ad5e6d661ccb83ab383ac4dd11d8766e8c7606e2
[ "Apache-2.0" ]
null
null
null
Search/models.py
xcamilox/searchengine
ad5e6d661ccb83ab383ac4dd11d8766e8c7606e2
[ "Apache-2.0" ]
null
null
null
Search/models.py
xcamilox/searchengine
ad5e6d661ccb83ab383ac4dd11d8766e8c7606e2
[ "Apache-2.0" ]
null
null
null
from django.db import models from astroquery.utils import TableList # Create your models here. class Catalog(models.Model): tables = models.TextField()
17.666667
38
0.767296
21
159
5.809524
0.761905
0
0
0
0
0
0
0
0
0
0
0
0.157233
159
8
39
19.875
0.910448
0.150943
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0.5
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
0
0
1
0
1
0
0
4
661978e294dba98050cde23946867c9079648e2e
106
py
Python
tests/test_day00.py
rouge8/advent-of-code-2021
1515ed32ca355b4838c83e125e474fe7a45ef1ad
[ "MIT" ]
null
null
null
tests/test_day00.py
rouge8/advent-of-code-2021
1515ed32ca355b4838c83e125e474fe7a45ef1ad
[ "MIT" ]
null
null
null
tests/test_day00.py
rouge8/advent-of-code-2021
1515ed32ca355b4838c83e125e474fe7a45ef1ad
[ "MIT" ]
null
null
null
from advent_of_code_2021.day00 import part1 DATA = [] def test_part1(): assert part1(DATA) == None
13.25
43
0.707547
16
106
4.4375
0.8125
0.253521
0
0
0
0
0
0
0
0
0
0.104651
0.188679
106
7
44
15.142857
0.72093
0
0
0
0
0
0
0
0
0
0
0
0.25
1
0.25
false
0
0.25
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
1
0
0
0
0
0
0
0
4
663474ae8e107dc45d5361c4df5b29f86454c250
166
py
Python
service/flask_app/wsgi.py
dnck/flask-postgres-nginx-docker-compose-example-app
f0666b355a7ce026d5081c540277e5bfd3722477
[ "MIT" ]
1
2019-08-29T09:05:05.000Z
2019-08-29T09:05:05.000Z
service/flask_app/wsgi.py
dnck/flask-postgres-nginx-docker-compose-example-app
f0666b355a7ce026d5081c540277e5bfd3722477
[ "MIT" ]
null
null
null
service/flask_app/wsgi.py
dnck/flask-postgres-nginx-docker-compose-example-app
f0666b355a7ce026d5081c540277e5bfd3722477
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- """ Module for running the production http server """ from views import APP as application if __name__ == "__main__": application.run()
16.6
45
0.674699
21
166
4.952381
0.952381
0
0
0
0
0
0
0
0
0
0
0.007407
0.186747
166
9
46
18.444444
0.762963
0.409639
0
0
0
0
0.088889
0
0
0
0
0
0
1
0
true
0
0.333333
0
0.333333
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
0
0
0
4
6641fc7c2f593e75ab4f9faea682a64df80b0738
215
py
Python
wiebetaaltwat/models.py
thaliawww/eetFestijn
6da04cb626f66b3aef55dbea6ca690ced674dd8f
[ "CC0-1.0" ]
1
2018-10-11T16:46:40.000Z
2018-10-11T16:46:40.000Z
wiebetaaltwat/models.py
thaliawww/eetFestijn
6da04cb626f66b3aef55dbea6ca690ced674dd8f
[ "CC0-1.0" ]
47
2018-06-11T13:55:41.000Z
2019-10-23T19:29:37.000Z
wiebetaaltwat/models.py
thaliawww/eetFestijn
6da04cb626f66b3aef55dbea6ca690ced674dd8f
[ "CC0-1.0" ]
null
null
null
from django.db import models class Participant(models.Model): wbw_id = models.CharField(unique=True, max_length=40) name = models.CharField(max_length=200) def __str__(self): return self.name
21.5
57
0.716279
30
215
4.9
0.733333
0.204082
0
0
0
0
0
0
0
0
0
0.028571
0.186047
215
9
58
23.888889
0.811429
0
0
0
0
0
0
0
0
0
0
0
0
1
0.166667
false
0
0.166667
0.166667
1
0
0
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
0
1
1
0
0
4
66454f6062a6e04c0340e3f3140348d21fd38dcc
60
py
Python
agents/deep_q_learning/config.py
pedMatias/matias_hfo
6d88e1043a1455f5c1f6cc11b9380869772f4176
[ "MIT" ]
1
2021-06-03T20:03:50.000Z
2021-06-03T20:03:50.000Z
agents/deep_q_learning/config.py
pedMatias/matias_hfo
6d88e1043a1455f5c1f6cc11b9380869772f4176
[ "MIT" ]
null
null
null
agents/deep_q_learning/config.py
pedMatias/matias_hfo
6d88e1043a1455f5c1f6cc11b9380869772f4176
[ "MIT" ]
1
2021-03-14T01:22:33.000Z
2021-03-14T01:22:33.000Z
MODEL_DIR = "/matias_project/agents/deep_q_learning/models"
30
59
0.833333
9
60
5.111111
1
0
0
0
0
0
0
0
0
0
0
0
0.05
60
1
60
60
0.807018
0
0
0
0
0
0.75
0.75
0
0
0
0
0
1
0
false
0
0
0
0
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
1
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
b075c48066e34a6ee2938a82b6432ae0e77e59e0
153
py
Python
spinta/dimensions/param/components.py
atviriduomenys/spinta
77a10e201f8cdc63143fce7996fd0898acb1ff58
[ "MIT" ]
2
2019-03-14T06:41:14.000Z
2019-03-26T11:48:14.000Z
spinta/dimensions/param/components.py
sirex/spinta
77a10e201f8cdc63143fce7996fd0898acb1ff58
[ "MIT" ]
44
2019-04-05T15:52:45.000Z
2022-03-30T07:41:33.000Z
spinta/dimensions/param/components.py
sirex/spinta
77a10e201f8cdc63143fce7996fd0898acb1ff58
[ "MIT" ]
1
2019-04-01T09:54:27.000Z
2019-04-01T09:54:27.000Z
from typing import Any from typing import Dict from spinta.core.ufuncs import Env class ParamBuilder(Env): pass ResolvedParams = Dict[str, Any]
12.75
34
0.75817
22
153
5.272727
0.636364
0.172414
0.275862
0
0
0
0
0
0
0
0
0
0.183007
153
11
35
13.909091
0.928
0
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0.166667
0.5
0
0.666667
0
1
0
0
null
0
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
0
1
1
0
0
0
0
4
b08db3dba4d94ec051b58830bb269fb617bb5e74
96
py
Python
airflow_dbt/hooks/__init__.py
dinigo/airflow-dbt
ce732b2e16bd9a4e4fc39543147ff1f384b7c7fa
[ "MIT" ]
null
null
null
airflow_dbt/hooks/__init__.py
dinigo/airflow-dbt
ce732b2e16bd9a4e4fc39543147ff1f384b7c7fa
[ "MIT" ]
null
null
null
airflow_dbt/hooks/__init__.py
dinigo/airflow-dbt
ce732b2e16bd9a4e4fc39543147ff1f384b7c7fa
[ "MIT" ]
null
null
null
from .base import DbtBaseHook from .cli import DbtCliHook from .google import DbtCloudBuildHook
24
37
0.84375
12
96
6.75
0.666667
0
0
0
0
0
0
0
0
0
0
0
0.125
96
3
38
32
0.964286
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
0
0
0
4
b0cf9651cef29feff6fb2ddf4f9712afcd98afb0
64
py
Python
src/__init__.py
damiancs/WaterCapacitySolver
c9c71cc3b87d9aaea89c0956b7b90b48407fb424
[ "MIT" ]
null
null
null
src/__init__.py
damiancs/WaterCapacitySolver
c9c71cc3b87d9aaea89c0956b7b90b48407fb424
[ "MIT" ]
null
null
null
src/__init__.py
damiancs/WaterCapacitySolver
c9c71cc3b87d9aaea89c0956b7b90b48407fb424
[ "MIT" ]
null
null
null
# coding=utf-8 """ Init file for WaterCapacitySolver module. """
16
41
0.71875
8
64
5.75
1
0
0
0
0
0
0
0
0
0
0
0.017857
0.125
64
4
42
16
0.803571
0.859375
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
1
0
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
4
b0df63aa1cf67c1a6191179bab6d57abd1052152
276
py
Python
sigmapiweb/apps/Scholarship/admin.py
sigmapi-gammaiota/sigmapi-web
4648112c8ed65694a2d07aa3af9573868cf72b45
[ "MIT" ]
8
2018-01-19T15:27:24.000Z
2022-02-04T05:57:01.000Z
sigmapiweb/apps/Scholarship/admin.py
sigmapi-gammaiota/sigmapi-web
4648112c8ed65694a2d07aa3af9573868cf72b45
[ "MIT" ]
71
2017-07-17T04:44:35.000Z
2022-02-19T19:33:24.000Z
sigmapiweb/apps/Scholarship/admin.py
sigmapi-gammaiota/sigmapi-web
4648112c8ed65694a2d07aa3af9573868cf72b45
[ "MIT" ]
6
2019-04-12T03:18:12.000Z
2021-09-28T23:33:12.000Z
""" Admin config for Scholarship app. """ from common.utils import register_model_admins from .models import AcademicResource, LibraryItem, StudyHoursRecord, TrackedUser register_model_admins( AcademicResource, LibraryItem, StudyHoursRecord, TrackedUser, )
18.4
80
0.778986
26
276
8.115385
0.653846
0.123223
0.180095
0.511848
0
0
0
0
0
0
0
0
0.155797
276
14
81
19.714286
0.905579
0.119565
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.25
0
0.25
0
1
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
0
0
0
1
0
0
0
0
0
0
4
7c0970dc8d7bed81fabb0c952676923db0cee5b1
96
py
Python
wechat/FileHelper.py
Anthlay/FUN_TOOLS
8706ac48d432e7752bea654857725542dc1a4897
[ "Apache-2.0" ]
1
2020-12-21T04:12:44.000Z
2020-12-21T04:12:44.000Z
wechat/FileHelper.py
Anthlay/FUN_TOOLS
8706ac48d432e7752bea654857725542dc1a4897
[ "Apache-2.0" ]
2
2021-03-31T19:32:43.000Z
2021-12-13T20:32:30.000Z
wechat/FileHelper.py
Anthlay/FUN_TOOLS
8706ac48d432e7752bea654857725542dc1a4897
[ "Apache-2.0" ]
null
null
null
import itchat itchat.send('hello stranger!',toUserName='filehelper') itchat.auto_login(True)
13.714286
54
0.78125
12
96
6.166667
0.833333
0
0
0
0
0
0
0
0
0
0
0
0.083333
96
6
55
16
0.840909
0
0
0
0
0
0.263158
0
0
0
0
0
0
1
0
true
0
0.333333
0
0.333333
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
0
0
0
4
7c0bf96fb98b0976e21149bae066e338323cf18a
324
py
Python
python/run-length-encoding/run_length_encoding.py
RockLloque/Exercism
c437dd6cf3246576900c76c2dba775b6647e3347
[ "MIT" ]
null
null
null
python/run-length-encoding/run_length_encoding.py
RockLloque/Exercism
c437dd6cf3246576900c76c2dba775b6647e3347
[ "MIT" ]
null
null
null
python/run-length-encoding/run_length_encoding.py
RockLloque/Exercism
c437dd6cf3246576900c76c2dba775b6647e3347
[ "MIT" ]
null
null
null
import re def decode(string): string = re.sub(r'([a-z])([a-z])', r'\g<1>1\2', string) return re.sub(r'(\d+)(\D)' , lambda x: x.group(2) * int(x.group(1)),string) def encode(string): string= re.sub(r'(.)\1*', lambda m: str(len(m.group(0))) + m.group(1), string) return re.sub(r'1(\D)', r'\1', string)
40.5
83
0.546296
63
324
2.809524
0.365079
0.112994
0.135593
0.19209
0.40678
0
0
0
0
0
0
0.037175
0.169753
324
8
84
40.5
0.620818
0
0
0
0
0
0.135385
0
0
0
0
0
0
1
0.285714
false
0
0.142857
0
0.714286
0
0
0
0
null
0
0
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
1
0
0
0
0
1
0
0
4
7c0d4eb57905e6b395a17775c73c552c8f8cdd82
154
py
Python
rlutils/infra/samplers/__init__.py
vermouth1992/rl-util
4c06ab8f5c96a44e58f88cf30146bcb837057112
[ "Apache-2.0" ]
null
null
null
rlutils/infra/samplers/__init__.py
vermouth1992/rl-util
4c06ab8f5c96a44e58f88cf30146bcb837057112
[ "Apache-2.0" ]
null
null
null
rlutils/infra/samplers/__init__.py
vermouth1992/rl-util
4c06ab8f5c96a44e58f88cf30146bcb837057112
[ "Apache-2.0" ]
null
null
null
from .base import Sampler from .trajectory import TrajectorySampler from .batch import BatchSampler from .batch_frame_stack import BatchFrameStackSampler
30.8
53
0.87013
18
154
7.333333
0.611111
0.136364
0
0
0
0
0
0
0
0
0
0
0.103896
154
4
54
38.5
0.956522
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
0
0
0
4
9fcefdba65f6d36ad7470d8e0d972d0237b6b1c0
490
py
Python
wego/helpers/__init__.py
hedou/wego
4c9bd6957c9c30de676a3efa011fb1dd584030c4
[ "Apache-2.0" ]
98
2016-08-11T15:21:08.000Z
2021-07-28T05:46:37.000Z
wego/helpers/__init__.py
hedou/wego
4c9bd6957c9c30de676a3efa011fb1dd584030c4
[ "Apache-2.0" ]
2
2016-10-19T05:27:14.000Z
2018-03-09T01:47:47.000Z
wego/helpers/__init__.py
hedou/wego
4c9bd6957c9c30de676a3efa011fb1dd584030c4
[ "Apache-2.0" ]
32
2016-09-23T15:06:32.000Z
2020-09-29T09:23:53.000Z
# -*- coding: utf-8 -*- """ wego.helpers is compatibility for web framework such as tornado, django and flask Each helper must contain the following functions: class YourHelper(wego.helper.BaseHelper): def wego_get_current_url(self, request): pass def wego_set_session(self, request, key, value): pass def wego_get_session(self, request, key): pass def wego_redirect(self, request, url): pass """ from .base_helper import BaseHelper
19.6
81
0.687755
65
490
5.046154
0.630769
0.085366
0.10061
0.128049
0
0
0
0
0
0
0
0.002625
0.222449
490
24
82
20.416667
0.858268
0.9
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
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
0
1
0
1
0
1
0
0
4
9fd199cf27d7f1bfed4419e3ac3bdb5d35ba614c
153
py
Python
packs/consul/actions/list_datacenters.py
userlocalhost2000/st2contrib
1a5f759e76401743ed9023d298a3d767e3885db1
[ "Apache-2.0" ]
164
2015-01-17T16:08:33.000Z
2021-08-03T02:34:07.000Z
packs/consul/actions/list_datacenters.py
userlocalhost2000/st2contrib
1a5f759e76401743ed9023d298a3d767e3885db1
[ "Apache-2.0" ]
442
2015-01-01T11:19:01.000Z
2017-09-06T23:26:17.000Z
packs/consul/actions/list_datacenters.py
userlocalhost2000/st2contrib
1a5f759e76401743ed9023d298a3d767e3885db1
[ "Apache-2.0" ]
202
2015-01-13T00:37:40.000Z
2020-11-07T11:30:10.000Z
from lib import action class ConsulListDatacentersAction(action.ConsulBaseAction): def run(self): return self.consul.catalog.datacenters()
21.857143
59
0.764706
16
153
7.3125
0.875
0
0
0
0
0
0
0
0
0
0
0
0.156863
153
6
60
25.5
0.906977
0
0
0
0
0
0
0
0
0
0
0
0
1
0.25
false
0
0.25
0.25
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
0
0
0
4
9fda58090ef333392f75cf8c8b98444a75fe0d24
8,752
py
Python
tests/test_datetime.py
sanjaymsh/Fiona
7be39538f7317efec3e60b8dc722af7e8fea6d52
[ "BSD-3-Clause" ]
null
null
null
tests/test_datetime.py
sanjaymsh/Fiona
7be39538f7317efec3e60b8dc722af7e8fea6d52
[ "BSD-3-Clause" ]
null
null
null
tests/test_datetime.py
sanjaymsh/Fiona
7be39538f7317efec3e60b8dc722af7e8fea6d52
[ "BSD-3-Clause" ]
1
2021-04-12T05:38:58.000Z
2021-04-12T05:38:58.000Z
""" See also test_rfc3339.py for datetime parser tests. """ import fiona import pytest import tempfile, shutil import os from fiona.errors import DriverSupportError from .conftest import requires_gpkg GDAL_MAJOR_VER = fiona.get_gdal_version_num() // 1000000 GEOMETRY_TYPE = "Point" GEOMETRY_EXAMPLE = {"type": "Point", "coordinates": [1, 2]} DRIVER_FILENAME = { "ESRI Shapefile": "test.shp", "GPKG": "test.gpkg", "GeoJSON": "test.geojson", "MapInfo File": "test.tab", } DATE_EXAMPLE = "2018-03-25" DATETIME_EXAMPLE = "2018-03-25T22:49:05" TIME_EXAMPLE = "22:49:05" class TestDateFieldSupport: def write_data(self, driver): filename = DRIVER_FILENAME[driver] temp_dir = tempfile.mkdtemp() path = os.path.join(temp_dir, filename) schema = { "geometry": GEOMETRY_TYPE, "properties": { "date": "date", } } records = [ { "geometry": GEOMETRY_EXAMPLE, "properties": { "date": DATE_EXAMPLE, } }, { "geometry": GEOMETRY_EXAMPLE, "properties": { "date": None, } }, ] with fiona.Env(), fiona.open(path, "w", driver=driver, schema=schema) as collection: collection.writerecords(records) with fiona.Env(), fiona.open(path, "r") as collection: schema = collection.schema features = list(collection) shutil.rmtree(temp_dir) return schema, features def test_shapefile(self): driver = "ESRI Shapefile" schema, features = self.write_data(driver) assert schema["properties"]["date"] == "date" assert features[0]["properties"]["date"] == DATE_EXAMPLE assert features[1]["properties"]["date"] is None @requires_gpkg def test_gpkg(self): driver = "GPKG" schema, features = self.write_data(driver) assert schema["properties"]["date"] == "date" assert features[0]["properties"]["date"] == DATE_EXAMPLE assert features[1]["properties"]["date"] is None def test_geojson(self): # GDAL 1: date field silently converted to string # GDAL 1: date string format uses / instead of - driver = "GeoJSON" schema, features = self.write_data(driver) if GDAL_MAJOR_VER >= 2: assert schema["properties"]["date"] == "date" assert features[0]["properties"]["date"] == DATE_EXAMPLE else: assert schema["properties"]["date"] == "str" assert features[0]["properties"]["date"] == "2018/03/25" assert features[1]["properties"]["date"] is None def test_mapinfo(self): driver = "MapInfo File" schema, features = self.write_data(driver) assert schema["properties"]["date"] == "date" assert features[0]["properties"]["date"] == DATE_EXAMPLE assert features[1]["properties"]["date"] is None class TestDatetimeFieldSupport: def write_data(self, driver): filename = DRIVER_FILENAME[driver] temp_dir = tempfile.mkdtemp() path = os.path.join(temp_dir, filename) schema = { "geometry": GEOMETRY_TYPE, "properties": { "datetime": "datetime", } } records = [ { "geometry": GEOMETRY_EXAMPLE, "properties": { "datetime": DATETIME_EXAMPLE, } }, { "geometry": GEOMETRY_EXAMPLE, "properties": { "datetime": None, } }, ] with fiona.Env(), fiona.open(path, "w", driver=driver, schema=schema) as collection: collection.writerecords(records) with fiona.Env(), fiona.open(path, "r") as collection: schema = collection.schema features = list(collection) shutil.rmtree(temp_dir) return schema, features def test_shapefile(self): # datetime is silently converted to date driver = "ESRI Shapefile" with pytest.raises(DriverSupportError): schema, features = self.write_data(driver) # assert schema["properties"]["datetime"] == "date" # assert features[0]["properties"]["datetime"] == "2018-03-25" # assert features[1]["properties"]["datetime"] is None @requires_gpkg def test_gpkg(self): # GDAL 1: datetime silently downgraded to date driver = "GPKG" if GDAL_MAJOR_VER >= 2: schema, features = self.write_data(driver) assert schema["properties"]["datetime"] == "datetime" assert features[0]["properties"]["datetime"] == DATETIME_EXAMPLE assert features[1]["properties"]["datetime"] is None else: with pytest.raises(DriverSupportError): schema, features = self.write_data(driver) def test_geojson(self): # GDAL 1: datetime silently converted to string # GDAL 1: date string format uses / instead of - driver = "GeoJSON" schema, features = self.write_data(driver) if GDAL_MAJOR_VER >= 2: assert schema["properties"]["datetime"] == "datetime" assert features[0]["properties"]["datetime"] == DATETIME_EXAMPLE else: assert schema["properties"]["datetime"] == "str" assert features[0]["properties"]["datetime"] == "2018/03/25 22:49:05" assert features[1]["properties"]["datetime"] is None def test_mapinfo(self): driver = "MapInfo File" schema, features = self.write_data(driver) assert schema["properties"]["datetime"] == "datetime" assert features[0]["properties"]["datetime"] == DATETIME_EXAMPLE assert features[1]["properties"]["datetime"] is None class TestTimeFieldSupport: def write_data(self, driver): filename = DRIVER_FILENAME[driver] temp_dir = tempfile.mkdtemp() path = os.path.join(temp_dir, filename) schema = { "geometry": GEOMETRY_TYPE, "properties": { "time": "time", } } records = [ { "geometry": GEOMETRY_EXAMPLE, "properties": { "time": TIME_EXAMPLE, } }, { "geometry": GEOMETRY_EXAMPLE, "properties": { "time": None, } }, ] with fiona.Env(), fiona.open(path, "w", driver=driver, schema=schema) as collection: collection.writerecords(records) with fiona.Env(), fiona.open(path, "r") as collection: schema = collection.schema features = list(collection) shutil.rmtree(temp_dir) return schema, features def test_shapefile(self): # no support for time fields driver = "ESRI Shapefile" with pytest.raises(DriverSupportError): self.write_data(driver) @requires_gpkg def test_gpkg(self): # GDAL 2: time field is silently converted to string # GDAL 1: time field dropped completely driver = "GPKG" with pytest.raises(DriverSupportError): schema, features = self.write_data(driver) # if GDAL_MAJOR_VER >= 2: # assert schema["properties"]["time"] == "str" # assert features[0]["properties"]["time"] == TIME_EXAMPLE # assert features[1]["properties"]["time"] is None # else: # assert "time" not in schema["properties"] def test_geojson(self): # GDAL 1: time field silently converted to string driver = "GeoJSON" schema, features = self.write_data(driver) if GDAL_MAJOR_VER >= 2: assert schema["properties"]["time"] == "time" else: assert schema["properties"]["time"] == "str" assert features[0]["properties"]["time"] == TIME_EXAMPLE assert features[1]["properties"]["time"] is None def test_mapinfo(self): # GDAL 2: null time is converted to 00:00:00 (regression?) driver = "MapInfo File" schema, features = self.write_data(driver) assert schema["properties"]["time"] == "time" assert features[0]["properties"]["time"] == TIME_EXAMPLE if GDAL_MAJOR_VER >= 2: assert features[1]["properties"]["time"] == "00:00:00" else: assert features[1]["properties"]["time"] is None
32.535316
92
0.559644
876
8,752
5.488584
0.124429
0.072795
0.06406
0.051373
0.827371
0.728993
0.701747
0.648503
0.618968
0.611481
0
0.020521
0.315128
8,752
268
93
32.656716
0.781615
0.108318
0
0.681592
0
0
0.138742
0
0
0
0
0
0.164179
1
0.074627
false
0
0.029851
0
0.134328
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
0
0
0
0
0
0
0
0
0
0
4
b02dee7b85acaefae1ced1f2e3b2aa408184d79c
284
py
Python
src/mqttpacket/v311/_errors.py
jlitzingerdev/mqttpacket
d6fbb84ef24c5c5bc9798692206e074a2dbf3af6
[ "MIT" ]
null
null
null
src/mqttpacket/v311/_errors.py
jlitzingerdev/mqttpacket
d6fbb84ef24c5c5bc9798692206e074a2dbf3af6
[ "MIT" ]
1
2021-06-01T22:38:18.000Z
2021-06-01T22:38:18.000Z
src/mqttpacket/v311/_errors.py
jlitzingerdev/mqttpacket
d6fbb84ef24c5c5bc9798692206e074a2dbf3af6
[ "MIT" ]
1
2020-03-15T03:57:21.000Z
2020-03-15T03:57:21.000Z
""" Copyright 2018 Jason Litzinger See LICENSE for details. """ class MQTTParseError(Exception): """Parse error""" class MQTTMoreDataNeededError(Exception): """Parse Error when more data is needed.""" class MQTTInvalidPacketError(Exception): """Invalid packet"""
17.75
47
0.707746
28
284
7.178571
0.785714
0.139303
0.189055
0
0
0
0
0
0
0
0
0.016949
0.169014
284
15
48
18.933333
0.834746
0.422535
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0
0
1
0
1
0
0
null
0
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
4
c6640dc3c16241806bcb10ac8374a46f7386e914
309
py
Python
execeptions.py
LucaDiBona/zw
a7040c533588096c7e840adc63012ccbbde80146
[ "MIT" ]
1
2022-03-29T11:58:57.000Z
2022-03-29T11:58:57.000Z
execeptions.py
LucaDiBona/zw
a7040c533588096c7e840adc63012ccbbde80146
[ "MIT" ]
null
null
null
execeptions.py
LucaDiBona/zw
a7040c533588096c7e840adc63012ccbbde80146
[ "MIT" ]
null
null
null
class InvalidWordErr(Exception): def __init__(self,message="Invalid Word"): self.message = message super().__init__(self.message) class TargetNotFoundErr(Exception): def __init__(self,message="Target not found"): self.message = message super().__init__(self.message)
28.090909
50
0.686084
33
309
5.939394
0.424242
0.336735
0.306122
0.204082
0.663265
0.387755
0.387755
0
0
0
0
0
0.197411
309
11
51
28.090909
0.790323
0
0
0.5
0
0
0.090323
0
0
0
0
0
0
1
0.25
false
0
0
0
0.5
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
0
0
0
0
0
0
4
c6837115f1ff20afd6cc8ef96385cc8f2bd551dd
408
py
Python
tests/test_unittest.py
scottwedge/python-sample-ci
f944eb4b19caa17e61ffcf79e330a905eaac9169
[ "MIT" ]
null
null
null
tests/test_unittest.py
scottwedge/python-sample-ci
f944eb4b19caa17e61ffcf79e330a905eaac9169
[ "MIT" ]
1
2020-01-28T18:58:56.000Z
2020-01-28T18:58:56.000Z
tests/test_unittest.py
scottwedge/python-sample-ci
f944eb4b19caa17e61ffcf79e330a905eaac9169
[ "MIT" ]
2
2018-02-26T18:59:53.000Z
2020-01-28T18:52:49.000Z
import unittest, os class Example(unittest.TestCase): def test_sum(self): self.assertEqual(1+1, 2, "SUM unittest failed") def test_subtract(self): self.assertEqual(2-1, 1, "SUBTRACT unittest failed") def test_multiply(self): self.assertEqual(1*2, 2, "MULTIPLY unittest failed") def test_division(self): self.assertEqual(2/2, 1, "DIVISION unittest failed")
27.2
60
0.671569
55
408
4.909091
0.309091
0.103704
0.281481
0.233333
0
0
0
0
0
0
0
0.037152
0.208333
408
14
61
29.142857
0.798762
0
0
0
0
0
0.223039
0
0
0
0
0
0.4
1
0.4
false
0
0.1
0
0.6
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
0
0
1
0
0
0
0
1
0
0
4
c6946c2fb2254680b481fc26f9cb0732351f5b5a
23
py
Python
aliyun-python-sdk-ivpd/aliyunsdkivpd/__init__.py
yndu13/aliyun-openapi-python-sdk
12ace4fb39fe2fb0e3927a4b1b43ee4872da43f5
[ "Apache-2.0" ]
1,001
2015-07-24T01:32:41.000Z
2022-03-25T01:28:18.000Z
aliyun-python-sdk-ivpd/aliyunsdkivpd/__init__.py
yndu13/aliyun-openapi-python-sdk
12ace4fb39fe2fb0e3927a4b1b43ee4872da43f5
[ "Apache-2.0" ]
363
2015-10-20T03:15:00.000Z
2022-03-08T12:26:19.000Z
aliyun-python-sdk-ivpd/aliyunsdkivpd/__init__.py
yndu13/aliyun-openapi-python-sdk
12ace4fb39fe2fb0e3927a4b1b43ee4872da43f5
[ "Apache-2.0" ]
682
2015-09-22T07:19:02.000Z
2022-03-22T09:51:46.000Z
__version__ = '1.0.6.1'
23
23
0.652174
5
23
2.2
0.8
0
0
0
0
0
0
0
0
0
0
0.190476
0.086957
23
1
23
23
0.333333
0
0
0
0
0
0.291667
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
0
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
4
c6a0cf8fbc7c58d38b4bc7ff61e3994fe0dc8690
31
py
Python
leetcode/130.py
pingrunhuang/CodeChallenge
a8e5274e04c47d851836197907266418af4f1a22
[ "MIT" ]
null
null
null
leetcode/130.py
pingrunhuang/CodeChallenge
a8e5274e04c47d851836197907266418af4f1a22
[ "MIT" ]
null
null
null
leetcode/130.py
pingrunhuang/CodeChallenge
a8e5274e04c47d851836197907266418af4f1a22
[ "MIT" ]
null
null
null
""" 130. Surrounded Regions """
10.333333
23
0.645161
3
31
6.666667
1
0
0
0
0
0
0
0
0
0
0
0.111111
0.129032
31
3
24
10.333333
0.62963
0.741935
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
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
4
c6be71dc37366f3c2a2904a3773c963c8e8dcf0f
71,523
py
Python
inputcreate.py
milanboers/kaggle-airbnb
3ca7ea3b9a5404285d1b56ebb6300fa71d9ff452
[ "MIT" ]
null
null
null
inputcreate.py
milanboers/kaggle-airbnb
3ca7ea3b9a5404285d1b56ebb6300fa71d9ff452
[ "MIT" ]
null
null
null
inputcreate.py
milanboers/kaggle-airbnb
3ca7ea3b9a5404285d1b56ebb6300fa71d9ff452
[ "MIT" ]
null
null
null
import csv import numpy as np import pandas from datetime import date from agebuckets import getbucket from pandas.tseries.holiday import USFederalHolidayCalendar from sklearn.preprocessing import scale def realage(age): return -1 if age == '' or float(age) > 110 or float(age) < 5 else float(age) def scaled(ds): d = (np.max(ds) - np.min(ds)) / 2 return (ds - np.min(ds)) / np.float32(d) - 1 def scaledWmm(ds, mini, maxi): d = (maxi - mini) / 2.0 return (ds - mini) / np.float32(d) - 1 # Scaled all values except NaT, makes NaT the average value def scaledWithNaT(ds): filtered = ds[ds > 0] d = (np.max(filtered) - np.min(filtered)) / 2.0 n = (ds - np.min(filtered)) / np.float32(d) - 1 filteredn = n[ds > 0] return np.where(ds < 0, np.average(filteredn).repeat(ds.size), n) def scaleCat(ds): return scaled(np.array(ds).astype(np.float32)) def inputcreate(filename): users = [] # Read training file with open(filename, 'rb') as csvfile: reader = csv.reader(csvfile, delimiter=',') reader.next() for row in reader: users.append(row) users = np.array(users) # Create input matrix numusers = np.empty((users.shape[0], 969)) starti = 0 # Remove id column ids = users[:,0] users = users[:,1:] # Account created to timestamp times = pandas.to_datetime(users[:,0], format='%Y-%m-%d') numusers[:,starti] = scaledWmm(times.astype(np.int64), 1262304000000000000, 1412035200000000000) starti += 1 # First active firstactivetimes = pandas.to_datetime(users[:,1], format='%Y%m%d%H%M%S') numusers[:,starti] = scaledWmm(firstactivetimes.astype(np.int64), 1237437175000000000, 1412121541000000000) starti += 1 # TODO: kijken of dit beter kan # Date first booking #dfb = pandas.to_datetime(users[:,2], format='%Y-%m-%d', errors='coerce').astype(np.int64) #numusers[:,2] = scaledWithNaT(dfb) # Date first booking (1 if date, 0 otherwise) #numusers[:,3] = scaleCat(dfb >= 0) # Gender gender = users[:,3] # Unknown numusers[:,starti] = scaleCat(gender == '-unknown-') starti += 1 # Male numusers[:,starti] = scaleCat(gender == 'MALE') starti += 1 # Female numusers[:,starti] = scaleCat(gender == 'FEMALE') starti += 1 # Other numusers[:,starti] = scaleCat(gender == 'OTHER') starti += 1 # Age ages = users[:,4] ages = np.array([realage(x) for x in ages]) numusers[:,starti] = scaledWithNaT(ages) starti += 1 # Age given numusers[:,starti] = scaleCat(ages != -1) starti += 1 # Signup method = facebook signupmethod = users[:,5] numusers[:,starti] = scaleCat(signupmethod == 'facebook') starti += 1 # Signup method = basic numusers[:,starti] = scaleCat(signupmethod == 'basic') starti += 1 # Signup method = google numusers[:,starti] = scaleCat(signupmethod == 'google') starti += 1 # Signup flows signupflows = users[:,6] distinctflows = ['0', '8', '12', '21', '23', '25'] for flow in distinctflows: numusers[:,starti] = scaleCat(signupflows == flow) starti += 1 # Languages languages = users[:,7] distinctlanguages = ['ca', 'cs', 'da', 'de', 'el', 'en', 'es', 'fi', 'fr', 'hu', 'id', 'it', 'ja', 'ko', 'nl', 'no', 'pl', 'pt', 'ru', 'sv', 'th', 'tr', 'zh'] for language in distinctlanguages: numusers[:,starti] = scaleCat(languages == language) starti += 1 # Affiliate channel affiliatechannels = users[:,8] distinctchannels = ['content', 'direct', 'other', 'remarketing', 'sem-brand', 'sem-non-brand', 'seo'] for channel in distinctchannels: numusers[:,starti] = scaleCat(affiliatechannels == channel) starti += 1 # Affiliate provider affiliateproviders = users[:,9] distinctproviders = ['baidu', 'bing', 'craigslist', 'daum', 'direct', 'email-marketing', 'facebook', 'facebook-open-graph', 'google', 'gsp', 'meetup', 'naver', 'other', 'padmapper', 'vast', 'yahoo', 'yandex'] for provider in distinctproviders: numusers[:,starti] = scaleCat(affiliateproviders == provider) starti += 1 # First affiliate tracked firsttracked = users[:,10] distincttracked = ['', 'linked', 'local ops', 'marketing', 'omg', 'product', 'tracked-other', 'untracked'] for track in distincttracked: numusers[:,starti] = scaleCat(firsttracked == track) starti += 1 # Signup app signupapp = users[:,11] distinctsingapp = ['Android', 'Moweb', 'Web', 'iOS'] for app in distinctsingapp: numusers[:,starti] = scaleCat(signupapp == app) starti += 1 # First device type firstdevicetype = users[:,12] distinctfdt = ['Android Phone', 'Android Tablet', 'Desktop (Other)', 'Mac Desktop', 'Other/Unknown', 'SmartPhone (Other)', 'Windows Desktop', 'iPad', 'iPhone'] for fdt in distinctfdt: numusers[:,starti] = scaleCat(firstdevicetype == fdt) starti += 1 # First browser firstbrowser = users[:,13] distinctfirstbrowser = ['-unknown-', 'AOL Explorer', 'Android Browser', 'Apple Mail', 'BlackBerry Browser', 'Chrome', 'Chrome Mobile', 'Chromium', 'CometBird', 'IE', 'IE Mobile', 'Safari', 'SeaMonkey', 'Silk', 'SiteKiosk', 'Sogou Explorer', 'Yandex.Browser', 'wOSBrowser'] for fb in distinctfirstbrowser: numusers[:,starti] = scaleCat(firstbrowser == fb) starti += 1 # Add age/gender bucket features bucketdata = [] for user in users: a = realage(user[4]) g = user[3] bucketdata.append(getbucket(a, g)) numusers[:,starti:starti+14] = np.array(bucketdata) starti += 14 # Day of week for account created weekdaydata = [] for time in times: weekdaydata.append([1 if i == time.weekday() else -1 for i in range(7)]) numusers[:,starti:starti+7] = np.array(weekdaydata) starti += 7 # Month for account created monthdata = [] for time in times: monthdata.append([1 if i == time.month else -1 for i in range(12)]) numusers[:,starti:starti+12] = np.array(monthdata) starti += 12 # Day of week for first active actstamps = pandas.to_datetime(users[:,1]) actweekday = [] for time in actstamps: actweekday.append([1 if i == time.weekday() else -1 for i in range(7)]) numusers[:,starti:starti+7] = np.array(actweekday) starti += 7 # Month for first active actmonth = [] for time in actstamps: actmonth.append([1 if i == time.month else -1 for i in range(12)]) numusers[:,starti:starti+12] = np.array(actmonth) starti += 12 langmap = { 'eng': 'en', 'deu': 'de', 'spa': 'es', 'fra': 'fr', 'ita': 'it', 'nld': 'nl', 'por': 'pt', } countriesbylang = dict() # Countries.csv with open('countries.csv', 'rb') as csvfile: reader = csv.reader(csvfile, delimiter=',') reader.next() for row in reader: countriesbylang[langmap[row[5]]] = row # Languages ls = set(['de','es','fr','it','nl','pt','en']) # Distance to native language country distance_kms = [] # Size of native language country distance_size = [] # Native language country info available? distance_avb = [] distance_lev = [] for language in languages: if language in ls: distance = float(countriesbylang[language][3]) size = float(countriesbylang[language][4]) levenshtein = float(countriesbylang[language][6]) distance_kms.append(distance) distance_size.append(size) distance_lev.append(levenshtein) distance_avb.append(1) else: # Average distance distance_kms.append(6687.0631) # Average size distance_size.append(1681120.143) distance_lev.append(72.14142857) distance_avb.append(-1) numusers[:,starti] = scaledWmm(np.array(distance_kms), 0, 8636.631) numusers[:,starti+1] = scaledWmm(np.array(distance_size), 41543, 9826675) numusers[:,starti+2] = scaledWmm(np.array(distance_lev), 0, 95.45) numusers[:,starti+3] = np.array(distance_avb) starti += 4 keyswithsessions = set() #keyswithbrs = set() sessions = dict() # Read sessions file print "Reading session file" i = 0 with open('sessions.csv', 'rb') as csvfile: reader = csv.reader(csvfile, delimiter=',') reader.next() for row in reader: if not row[0] in sessions: keyswithsessions.add(row[0]) sessions[row[0]] = [] #if row[2] == 'booking_request': # keyswithbrs.add(row[0]) duo1.add((row[2], row[3])) sessions[row[0]].append(row) i += 1 print i, "sessions" # Add sessions to numusers distincttriads = [('', 'message_post', 'message_post'), ('10', 'message_post', 'message_post'), ('11', 'message_post', 'message_post'), ('12', 'message_post', 'message_post'), ('15', 'message_post', 'message_post'), ('about_us', '-unknown-', '-unknown-'), ('accept_decline', 'view', 'host_respond_page'), ('account', '-unknown-', '-unknown-'), ('acculynk_bin_check_failed', '-unknown-', '-unknown-'), ('acculynk_bin_check_success', '-unknown-', '-unknown-'), ('acculynk_load_pin_pad', '-unknown-', '-unknown-'), ('acculynk_pin_pad_error', '-unknown-', '-unknown-'), ('acculynk_pin_pad_inactive', '-unknown-', '-unknown-'), ('acculynk_pin_pad_success', '-unknown-', '-unknown-'), ('acculynk_session_obtained', '-unknown-', '-unknown-'), ('active', '-unknown-', '-unknown-'), ('add_business_address_colorbox', '-unknown-', '-unknown-'), ('add_guest_colorbox', '-unknown-', '-unknown-'), ('add_guests', '-unknown-', '-unknown-'), ('add_note', 'submit', 'wishlist_note'), ('agree_terms_check', '-unknown-', '-unknown-'), ('agree_terms_uncheck', '-unknown-', '-unknown-'), ('airbnb_picks', 'view', 'airbnb_picks_wishlists'), ('airbrb', '-unknown-', '-unknown-'), ('ajax_check_dates', 'click', 'change_contact_host_dates'), ('ajax_get_referrals_amt', '-unknown-', '-unknown-'), ('ajax_get_results', 'click', 'view_search_results'), ('ajax_google_translate', '-unknown-', '-unknown-'), ('ajax_google_translate_description', '-unknown-', '-unknown-'), ('ajax_google_translate_reviews', 'click', 'translate_listing_reviews'), ('ajax_image_upload', '-unknown-', '-unknown-'), ('ajax_ldp', '-unknown-', '-unknown-'), ('ajax_lwlb_contact', 'click', 'contact_host'), ('ajax_payout_edit', '-unknown-', '-unknown-'), ('ajax_payout_options_by_country', '-unknown-', '-unknown-'), ('ajax_payout_split_edit', '-unknown-', '-unknown-'), ('ajax_photo_widget', '-unknown-', '-unknown-'), ('ajax_photo_widget_form_iframe', '-unknown-','-unknown-'), ('ajax_price_and_availability', 'click', 'alteration_field'), ('ajax_referral_banner_experiment_type', '-unknown-', '-unknown-'), ('ajax_referral_banner_type', '-unknown-', '-unknown-'), ('ajax_refresh_subtotal', 'click', 'change_trip_characteristics'), ('ajax_send_message', '-unknown-', '-unknown-'), ('ajax_special_offer_dates_available', 'click', 'special_offer_field'), ('ajax_statsd', '-unknown-', '-unknown-'), ('ajax_worth', 'submit', 'calculate_worth'), ('apply', '-unknown-', '-unknown-'), ('apply_code', '-unknown-','-unknown-'), ('apply_coupon_click', 'click', 'apply_coupon_click'), ('apply_coupon_click_success', 'click', 'apply_coupon_click_success'), ('apply_coupon_error', 'click', 'apply_coupon_error'), ('apply_coupon_error_type', '-unknown-', '-unknown-'), ('apply_reservation', 'submit', 'apply_coupon'), ('approve', '-unknown-', '-unknown-'), ('approve', 'submit', 'host_respond'), ('ask_question', 'submit', 'contact_host'), ('at_checkpoint', 'booking_request', 'at_checkpoint'), ('authenticate', 'submit', 'login'), ('authenticate', 'view', 'login_page'), ('authorize', '-unknown-', '-unknown-'), ('available', '-unknown-', '-unknown-'), ('available', 'data', 'trip_availability'), ('badge', '-unknown-', '-unknown-'), ('become_user', '-unknown-', '-unknown-'), ('book', 'view', 'p4'), ('booking', 'booking_response', 'booking'), ('braintree_client_token', '', ''), ('business_travel', '-unknown-', '-unknown-'), ('calendar_tab_inner2', '-unknown-', '-unknown-'), ('callback', 'partner_callback', 'oauth_response'), ('campaigns', '', ''), ('campaigns', '-unknown-', '-unknown-'), ('cancel', 'submit', 'guest_cancellation'), ('cancellation_policies', 'view', 'cancellation_policies'), ('cancellation_policy_click', 'click', 'cancellation_policy_click'), ('change', 'view', 'change_or_alter'), ('change_availability', '-unknown-', '-unknown-'), ('change_availability', 'submit', 'change_availability'), ('change_currency', '-unknown-', '-unknown-'), ('change_default_payout', '-unknown-', '-unknown-'), ('change_password', 'submit', 'change_password'), ('check', '', ''), ('city_count', '-unknown-', '-unknown-'), ('clear_reservation', '-unknown-', '-unknown-'), ('click', '-unknown-', '-unknown-'), ('click', 'click', 'book_it'), ('click', 'click', 'cancellation_policy'), ('click', 'click', 'click_about_host'), ('click', 'click', 'click_amenities'), ('click', 'click', 'click_reviews'), ('click', 'click', 'complete_booking'), ('click', 'click', 'contact_host'), ('click', 'click', 'instant_book'), ('click', 'click', 'move_map'), ('click', 'click', 'photos'), ('click', 'click', 'request_to_book'), ('click', 'click', 'share'), ('clickthrough', '-unknown-', '-unknown-'), ('collections', '-unknown-', '-unknown-'), ('collections', 'view', 'user_wishlists'), ('complete', '-unknown-', '-unknown-'), ('complete_redirect', '-unknown-', '-unknown-'), ('complete_status', '-unknown-', '-unknown-'), ('concierge', '-unknown-', '-unknown-'), ('confirm_email', '-unknown-', '-unknown-'), ('confirm_email', 'click', 'confirm_email'), ('confirm_email', 'click', 'confirm_email_link'), ('confirmation', '-unknown-', '-unknown-'), ('connect', '-unknown-', '-unknown-'), ('connect', 'submit', 'oauth_login'), ('contact_new', '-unknown-', '-unknown-'), ('countries', '-unknown-', '-unknown-'), ('country_options', '-unknown-', '-unknown-'), ('coupon_code_click', 'click', 'coupon_code_click'), ('coupon_field_focus', 'click', 'coupon_field_focus'), ('create', '-unknown-', '-unknown-'), ('create', 'submit', 'create_alteration_request'), ('create', 'submit', 'create_listing'), ('create', 'submit', 'create_payment_instrument'), ('create', 'submit', 'create_phone_numbers'), ('create', 'submit', 'create_user'), ('create', 'submit', 'signup'), ('create', 'view', 'list_your_space'), ('create_ach', '-unknown-', '-unknown-'), ('create_airbnb', '-unknown-', '-unknown-'), ('create_multiple', '-unknown-', '-unknown-'), ('create_paypal', '-unknown-', '-unknown-'), ('currencies', '', ''), ('currencies', '-unknown-', '-unknown-'), ('custom_recommended_destinations', '-unknown-', '-unknown-'), ('dashboard', 'view', 'dashboard'), ('deactivate', '-unknown-', '-unknown-'), ('deactivated', 'view', 'host_standard_suspension'), ('deauthorize', '-unknown-', '-unknown-'), ('decision_tree', '-unknown-', '-unknown-'), ('delete', '-unknown-', '-unknown-'), ('delete', '-unknown-', 'phone_numbers'), ('delete', '-unknown-', 'reservations'), ('delete', 'submit', 'deactivate_user_account'), ('delete', 'submit', 'delete_listing'), ('delete', 'submit', 'delete_listing_description'), ('delete', 'submit', 'delete_phone_numbers'), ('department', '-unknown-', '-unknown-'), ('departments', '-unknown-', '-unknown-'), ('desks', '-unknown-', '-unknown-'), ('destroy', '-unknown-', '-unknown-'), ('destroy', 'submit', 'delete_payment_instrument'), ('detect_fb_session', '-unknown-', '-unknown-'), ('disaster_action', '', ''), ('domains', '-unknown-', '-unknown-'), ('edit', '-unknown-', '-unknown-'), ('edit', 'view', 'edit_profile'), ('edit_verification', 'view', 'profile_verifications'), ('email_by_key', '-unknown-', '-unknown-'), ('email_itinerary_colorbox', '-unknown-', '-unknown-'), ('email_share', 'submit', 'email_wishlist'), ('email_wishlist', 'click', 'email_wishlist_button'), ('endpoint_error', '-unknown-', '-unknown-'), ('envoy_bank_details_redirect', '-unknown-', '-unknown-'), ('envoy_form','-unknown-', '-unknown-'), ('events', '-unknown-', '-unknown-'), ('facebook_auto_login', '-unknown-', '-unknown-'), ('faq', '-unknown-', '-unknown-'), ('faq_category', '-unknown-', '-unknown-'), ('faq_experiment_ids', '-unknown-', '-unknown-'), ('feed', '-unknown-', '-unknown-'), ('forgot_password', 'click', 'forgot_password'), ('forgot_password', 'submit', 'forgot_password'), ('founders', '-unknown-', '-unknown-'), ('friend_listing', '-unknown-', '-unknown-'), ('friends', 'view', 'friends_wishlists'), ('friends_new', '-unknown-', '-unknown-'), ('glob', '-unknown-', '-unknown-'), ('google_importer', '-unknown-', '-unknown-'), ('guarantee', 'view', 'host_guarantee'), ('guest_billing_receipt', '-unknown-', '-unknown-'), ('guest_booked_elsewhere', 'message_post', 'message_post'), ('handle_vanity_url', '-unknown-', '-unknown-'), ('hard_fallback_submit', '-unknown-', '-unknown-'), ('has_profile_pic', '-unknown-', '-unknown-'), ('header_userpic', 'data', 'header_userpic'), ('home_safety_landing', '-unknown-', '-unknown-'), ('home_safety_terms', '-unknown-', '-unknown-'), ('hospitality', '-unknown-', '-unknown-'), ('hospitality_standards', '-unknown-', '-unknown-'), ('host_2013', '-unknown-', '-unknown-'), ('host_cancel', '-unknown-', '-unknown-'), ('host_summary', '-unknown-', '-unknown-'), ('host_summary', 'view', 'host_home'), ('hosting_social_proof', '-unknown-', '-unknown-'), ('how_it_works', '-unknown-', '-unknown-'), ('identity', '-unknown-', '-unknown-'), ('image_order', '-unknown-', '-unknown-'), ('impressions', 'view', 'p4'), ('index', '', ''), ('index', '-unknown-', '-unknown-'), ('index', 'data', 'reservations'), ('index', 'data', 'user_tax_forms'), ('index', 'view', 'account_payment_methods'), ('index', 'view', 'homepage'), ('index', 'view', 'listing_descriptions'), ('index', 'view', 'message_inbox'), ('index', 'view', 'message_thread'), ('index', 'view', 'user_wishlists'), ('index', 'view', 'view_ghosting_reasons'), ('index', 'view', 'view_ghostings'), ('index', 'view', 'view_identity_verifications'), ('index', 'view', 'view_locations'), ('index', 'view', 'view_reservations'), ('index', 'view', 'view_resolutions'), ('index', 'view', 'view_search_results'), ('index', 'view', 'view_user_real_names'), ('index', 'view', 'your_listings'), ('invalid_action', '-unknown-', '-unknown-'), ('issue', '-unknown-', '-unknown-'), ('itinerary', 'view', 'guest_itinerary'), ('jumio', '-unknown-', '-unknown-'), ('jumio_redirect', '-unknown-', '-unknown-'), ('jumio_token', '-unknown-', '-unknown-'), ('kba', '-unknown-', '-unknown-'), ('kba_update', '-unknown-', '-unknown-'), ('languages_multiselect', '-unknown-', '-unknown-'), ('life', '-unknown-', '-unknown-'), ('listing','view', 'p3'), ('listings', '-unknown-', '-unknown-'), ('listings', 'view', 'user_listings'), ('load_more', '-unknown-', '-unknown-'), ('locale_from_host', '-unknown-', '-unknown-'), ('localization_settings', '', ''), ('localization_settings', '-unknown-', '-unknown-'),('localized', '-unknown-', '-unknown-'), ('locations', '-unknown-', '-unknown-'), ('login', '-unknown-', '-unknown-'), ('login', 'view', 'login_page'), ('login_modal', 'view', 'login_modal'), ('lookup', '', ''), ('manage_listing', 'view', 'manage_listing'), ('maybe_information', 'message_post', 'message_post'), ('media_resources', '-unknown-', '-unknown-'), ('message', '-unknown-', '-unknown-'), ('message_to_host_change', 'click', 'message_to_host_change'), ('message_to_host_focus', 'click', 'message_to_host_focus'), ('mobile_landing_page', '-unknown-', '-unknown-'), ('mobile_oauth_callback', '-unknown-', '-unknown-'), ('multi', '-unknown-', '-unknown-'), ('multi_message', 'message_post', 'message_post'), ('multi_message_attributes', '-unknown-', '-unknown-'), ('my', 'view', 'user_wishlists'), ('my_listings', 'view', 'your_reservations'), ('my_reservations', 'view', 'your_reservations'), ('new', '-unknown-', '-unknown-'), ('new', 'view', 'list_your_space'), ('new_host', '-unknown-', '-unknown-'), ('new_session', '-unknown-', '-unknown-'), ('notifications', '-unknown-', '-unknown-'), ('notifications', 'data', 'notifications'), ('notifications', 'submit', 'notifications'), ('notifications', 'view', 'account_notification_settings'), ('nyan', '-unknown-', '-unknown-'), ('office_location', '-unknown-', '-unknown-'), ('onenight', '-unknown-', '-unknown-'), ('open_graph_setting', '-unknown-', '-unknown-'), ('open_hard_fallback_modal', '-unknown-', '-unknown-'), ('other_hosting_reviews', '-unknown-', '-unknown-'), ('other_hosting_reviews_first', '-unknown-', '-unknown-'), ('overview', '-unknown-', '-unknown-'), ('p4_refund_policy_terms', 'click', 'p4_refund_policy_terms'), ('p4_terms', 'click', 'p4_terms'), ('patch', '-unknown-', '-unknown-'), ('patch', 'modify', 'modify_reservations'), ('patch', 'modify', 'modify_users'), ('pay', '-unknown-', '-unknown-'), ('payment_instruments', '-unknown-', '-unknown-'), ('payment_instruments', 'data', 'payment_instruments'), ('payment_methods', '-unknown-', '-unknown-'), ('payoneer_account_redirect', '-unknown-', '-unknown-'), ('payoneer_signup_complete', '-unknown-', '-unknown-'), ('payout_delete', '-unknown-', '-unknown-'), ('payout_preferences', 'view', 'account_payout_preferences'), ('payout_update', '-unknown-', '-unknown-'), ('pending', '-unknown-', '-unknown-'), ('pending', 'booking_request', 'pending'), ('pending_tickets', '-unknown-', '-unknown-'), ('personalize', 'data', 'wishlist_content_update'), ('phone_number_widget', '-unknown-', '-unknown-'), ('phone_verification', '', ''), ('phone_verification_call_taking_too_long', '-unknown-', '-unknown-'), ('phone_verification_error', '-unknown-', '-unknown-'), ('phone_verification_modal', '-unknown-', '-unknown-'), ('phone_verification_number_submitted_for_call', '-unknown-', '-unknown-'), ('phone_verification_number_submitted_for_sms', '-unknown-', '-unknown-'), ('phone_verification_number_sucessfully_submitted', '-unknown-', '-unknown-'), ('phone_verification_phone_number_removed', '-unknown-', '-unknown-'), ('phone_verification_success', 'click', 'phone_verification_success'), ('photography', '-unknown-', '-unknown-'), ('photography_update', '-unknown-', '-unknown-'), ('place_worth', 'view', 'place_worth'), ('plaxo_cb', '-unknown-', '-unknown-'), ('popular', 'view', 'popular_wishlists'), ('popular_listing', '-unknown-', '-unknown-'), ('populate_from_facebook', '-unknown-', '-unknown-'), ('populate_help_dropdown', '-unknown-', '-unknown-'), ('position', '-unknown-', '-unknown-'), ('preapproval', 'message_post', 'message_post'), ('press_content', '-unknown-', '-unknown-'), ('press_news', '-unknown-', '-unknown-'), ('press_release', '-unknown-', '-unknown-'), ('pricing', '-unknown-', '-unknown-'), ('print_confirmation', '-unknown-', '-unknown-'), ('privacy', 'view', 'account_privacy_settings'), ('profile_pic', '-unknown-', '-unknown-'), ('push_notification_callback', '-unknown-', '-unknown-'), ('qt2', 'view', 'message_thread'), ('qt_reply_v2', '-unknown-', '-unknown-'), ('qt_reply_v2', 'submit', 'send_message'), ('qt_with', 'data', 'lookup_message_thread'), ('questions', '-unknown-', '-unknown-'), ('rate', '-unknown-', '-unknown-'), ('reactivate', '-unknown-', '-unknown-'), ('read_policy_click', 'click', 'read_policy_click'), ('receipt', 'view', 'guest_receipt'), ('recent_reservations', '-unknown-', '-unknown-'), ('recommend', '-unknown-', '-unknown-'), ('recommendation_page', '-unknown-', '-unknown-'), ('recommendations', '-unknown-', '-unknown-'), ('recommendations', 'data', 'listing_recommendations'), ('recommendations', 'data', 'user_friend_recommendations'), ('recommended_listings', '-unknown-', '-unknown-'), ('redirect', '-unknown-', '-unknown-'), ('references', 'view', 'profile_references'), ('referrer_status', '-unknown-', '-unknown-'), ('refund_guest_cancellation', 'submit', 'host_refund_guest'), ('relationship', '-unknown-', '-unknown-'), ('remove_dashboard_alert', '-unknown-', '-unknown-'), ('remove_dashboard_alert', 'click', 'remove_dashboard_alert'), ('rentals', '-unknown-', '-unknown-'), ('report', '-unknown-', '-unknown-'), ('reputation', '-unknown-', '-unknown-'), ('request_new_confirm_email', 'click', 'request_new_confirm_email'), ('request_photography', '-unknown-', '-unknown-'), ('requested', 'submit', 'post_checkout_action'), ('requested', 'view', 'p5'), ('requirements', '-unknown-', '-unknown-'), ('reservation', '-unknown-', '-unknown-'), ('reset_calendar', '-unknown-', '-unknown-'), ('respond', 'submit', 'respond_to_alteration_request'), ('rest-of-world', '-unknown-', '-unknown-'), ('revert_to_admin', '-unknown-', '-unknown-'), ('review_page', '-unknown-', '-unknown-'), ('reviews', '-unknown-', '-unknown-'), ('reviews', 'data', 'listing_reviews'), ('reviews', 'data', 'user_reviews'), ('reviews', 'view', 'profile_reviews'), ('reviews_new', '-unknown-', '-unknown-'), ('salute', '-unknown-', '-unknown-'), ('sandy', '-unknown-', '-unknown-'), ('satisfy', '', ''), ('search', '-unknown-', '-unknown-'), ('search', 'click', 'view_search_results'), ('search_results', 'click', 'view_search_results'), ('set_default', '-unknown-', '-unknown-'), ('set_default', 'submit', 'set_default_payment_instrument'), ('set_minimum_payout_amount', '-unknown-', '-unknown-'), ('set_password', 'submit', 'set_password'), ('set_password', 'view', 'set_password_page'), ('set_user', 'submit', 'create_listing'), ('settings', '-unknown-', '-unknown-'), ('show', '', ''), ('show', '-unknown-', '-unknown-'), ('show', 'data', 'translations'), ('show', 'view', 'alteration_request'), ('show', 'view', 'p1'), ('show', 'view', 'p3'), ('show', 'view', 'user_profile'), ('show', 'view', 'view_identity_verifications'), ('show', 'view', 'view_listing'), ('show', 'view', 'view_security_checks'), ('show', 'view', 'wishlist'), ('show_code', '-unknown-', '-unknown-'), ('show_personalize', 'data', 'user_profile_content_update'), ('signature', '-unknown-', '-unknown-'), ('signed_out_modal', '', ''), ('signup_login', 'view', 'signup_login_page'), ('signup_modal', 'view', 'signup_modal'), ('signup_weibo', '-unknown-', '-unknown-'), ('signup_weibo_referral', '-unknown-', '-unknown-'), ('similar_listings', 'data', 'similar_listings'), ('similar_listings_v2', '', ''), ('sldf', '-unknown-', '-unknown-'), ('slideshow', '-unknown-', '-unknown-'), ('social', '-unknown-', '-unknown-'), ('social-media', '-unknown-', '-unknown-'), ('social_connections', '-unknown-', '-unknown-'), ('social_connections', 'data', 'user_social_connections'), ('south-america', '-unknown-', '-unknown-'), ('southern-europe', '-unknown-', '-unknown-'), ('special_offer', 'message_post', 'message_post'), ('spoken_languages', 'data', 'user_languages'), ('status', '-unknown-', '-unknown-'), ('stpcv', '-unknown-', '-unknown-'), ('sublets', '-unknown-', '-unknown-'), ('submit_contact', '-unknown-', '-unknown-'), ('support_phone_numbers', '-unknown-', '-unknown-'), ('supported', '-unknown-', '-unknown-'), ('sync', '-unknown-', '-unknown-'), ('tell_a_friend', '-unknown-', '-unknown-'), ('terms', '-unknown-', '-unknown-'), ('terms', 'view', 'terms_and_privacy'), ('terms_and_conditions', '-unknown-', '-unknown-'), ('this_hosting_reviews', 'click', 'listing_reviews_page'), ('this_hosting_reviews_3000', '-unknown-', '-unknown-'), ('toggle_archived_thread', 'click', 'toggle_archived_thread'), ('toggle_availability', '-unknown-', '-unknown-'), ('toggle_starred_thread', 'click', 'toggle_starred_thread'), ('top_destinations', '-unknown-', '-unknown-'), ('tos_2014', 'view', 'tos_2014'), ('tos_confirm', '-unknown-', '-unknown-'), ('track_activity', '', ''), ('track_page_view', '', ''), ('transaction_history','view', 'account_transaction_history'), ('transaction_history_paginated', '-unknown-', '-unknown-'), ('travel', '-unknown-', '-unknown-'), ('travel_plans_current', 'view', 'your_trips'), ('travel_plans_previous', 'view', 'previous_trips'), ('trust', '-unknown-', '-unknown-'), ('unavailabilities', '-unknown-', '-unknown-'), ('unavailabilities', 'data', 'unavailable_dates'), ('united-states', '-unknown-', '-unknown-'), ('unread', '-unknown-', '-unknown-'), ('unsubscribe', '-unknown-', '-unknown-'), ('update', '', ''), ('update', '-unknown-', '-unknown-'), ('update', 'submit', 'update_listing'), ('update', 'submit', 'update_listing_description'), ('update', 'submit', 'update_user'), ('update', 'submit', 'update_user_profile'), ('update_cached', 'data', 'admin_templates'), ('update_country_of_residence', '-unknown-', '-unknown-'), ('update_friends_display', '-unknown-', '-unknown-'), ('update_hide_from_search_engines', '-unknown-', '-unknown-'), ('update_message', '-unknown-', '-unknown-'), ('update_notifications', '-unknown-', '-unknown-'), ('update_reservation_requirements', '-unknown-', '-unknown-'), ('upload', '-unknown-', '-unknown-'), ('uptodate', '', ''), ('use_mobile_site', '-unknown-', '-unknown-'), ('verify', '-unknown-', '-unknown-'), ('view', 'view', 'p3'), ('views', '-unknown-', '-unknown-'), ('views_campaign', '-unknown-','-unknown-'), ('views_campaign_rules', '-unknown-', '-unknown-'), ('webcam_upload', '-unknown-', '-unknown-'), ('weibo_signup_referral_finish', '-unknown-', '-unknown-'), ('why_host', '-unknown-', '-unknown-'), ('widget', '', ''), ('wishlists', '-unknown-', '-unknown-'), ('zendesk_login_jwt', '-unknown-', '-unknown-')] distinctactions = ['', '10', '11', '12', '15', 'about_us', 'account', 'active', 'add_guests', 'add_note', 'agree_terms_check', 'agree_terms_uncheck', 'airbnb_picks', 'ajax_check_dates', 'ajax_get_referrals_amt', 'ajax_get_results', 'ajax_google_translate_description', 'ajax_google_translate_reviews', 'ajax_image_upload', 'ajax_ldp', 'ajax_lwlb_contact', 'ajax_payout_edit', 'ajax_payout_options_by_country', 'ajax_photo_widget_form_iframe', 'ajax_price_and_availability', 'ajax_referral_banner_experiment_type', 'ajax_referral_banner_type', 'ajax_refresh_subtotal', 'ajax_statsd', 'apply', 'apply_code', 'apply_coupon_click', 'apply_coupon_error', 'apply_coupon_error_type', 'apply_reservation', 'ask_question', 'at_checkpoint', 'authenticate', 'authorize', 'available', 'badge', 'become_user', 'calendar_tab_inner2', 'callback', 'campaigns', 'cancel', 'cancellation_policies', 'cancellation_policy_click', 'change', 'change_currency', 'click', 'clickthrough', 'collections','complete', 'complete_redirect', 'complete_status', 'concierge', 'confirm_email', 'connect', 'contact_new', 'countries', 'country_options', 'coupon_code_click', 'coupon_field_focus', 'create', 'create_multiple', 'currencies', 'dashboard', 'decision_tree', 'delete', 'department', 'departments', 'destroy', 'detect_fb_session', 'domains', 'edit', 'edit_verification', 'email_itinerary_colorbox', 'email_share', 'email_wishlist', 'endpoint_error', 'facebook_auto_login', 'faq', 'faq_category', 'faq_experiment_ids', 'forgot_password', 'founders', 'friends', 'friends_new', 'glob', 'google_importer', 'guarantee', 'guest_booked_elsewhere', 'handle_vanity_url', 'header_userpic', 'home_safety_terms', 'host_summary', 'hosting_social_proof', 'how_it_works', 'identity', 'image_order', 'impressions', 'index', 'issue', 'itinerary', 'jumio', 'jumio_redirect', 'jumio_token', 'kba', 'kba_update', 'languages_multiselect', 'listing', 'listings', 'localization_settings', 'login', 'login_modal', 'lookup', 'manage_listing', 'message_to_host_change', 'message_to_host_focus', 'mobile_landing_page', 'multi', 'multi_message_attributes', 'my', 'my_listings', 'new', 'new_session', 'notifications', 'open_graph_setting', 'other_hosting_reviews', 'other_hosting_reviews_first', 'overview', 'p4_refund_policy_terms', 'p4_terms', 'patch', 'pay', 'payment_instruments', 'payment_methods', 'payoneer_account_redirect', 'payout_preferences', 'payout_update', 'pending', 'pending_tickets', 'personalize', 'phone_number_widget', 'phone_verification_modal', 'phone_verification_number_submitted_for_call', 'phone_verification_number_submitted_for_sms', 'phone_verification_number_sucessfully_submitted', 'phone_verification_success', 'photography', 'popular', 'popular_listing', 'populate_from_facebook', 'populate_help_dropdown', 'position', 'press_news', 'press_release', 'privacy', 'profile_pic', 'push_notification_callback', 'qt2', 'qt_reply_v2', 'qt_with', 'rate', 'read_policy_click', 'receipt', 'recent_reservations', 'recommend', 'recommendations', 'recommended_listings', 'redirect', 'references', 'referrer_status', 'remove_dashboard_alert', 'reputation', 'request_new_confirm_email', 'requested', 'requirements', 'review_page', 'reviews', 'reviews_new', 'salute', 'search', 'search_results', 'set_password', 'set_user', 'settings', 'show', 'show_code', 'show_personalize', 'signature', 'signed_out_modal', 'signup_login', 'signup_modal', 'similar_listings', 'similar_listings_v2', 'social_connections', 'spoken_languages', 'status', 'submit_contact', 'supported', 'tell_a_friend', 'terms', 'terms_and_conditions', 'this_hosting_reviews', 'toggle_archived_thread', 'toggle_starred_thread', 'top_destinations', 'tos_confirm', 'track_page_view', 'transaction_history', 'transaction_history_paginated', 'travel_plans_current', 'travel_plans_previous', 'trust', 'unavailabilities', 'unread', 'update', 'update_cached', 'update_hide_from_search_engines', 'update_notifications', 'upload', 'uptodate', 'verify', 'webcam_upload', 'why_host'] dictinctaction_types = np.array(['', '-unknown-', 'booking_request', 'click', 'data', 'message_post', 'partner_callback', 'submit', 'view']) distinctaction_details = ['', '-unknown-', 'account_notification_settings', 'account_payout_preferences', 'account_privacy_settings', 'account_transaction_history', 'admin_templates', 'airbnb_picks_wishlists', 'alteration_field', 'alteration_request', 'apply_coupon', 'apply_coupon_click', 'apply_coupon_error', 'at_checkpoint', 'book_it', 'cancellation_policies', 'cancellation_policy_click', 'change_contact_host_dates', 'change_or_alter', 'change_trip_characteristics', 'complete_booking', 'confirm_email', 'confirm_email_link', 'contact_host', 'coupon_code_click', 'coupon_field_focus', 'create_listing', 'create_phone_numbers', 'create_user', 'dashboard', 'delete_listing', 'delete_phone_numbers', 'edit_profile', 'email_wishlist', 'email_wishlist_button', 'forgot_password', 'friends_wishlists', 'guest_cancellation', 'guest_itinerary', 'guest_receipt', 'header_userpic', 'host_guarantee', 'host_home', 'instant_book', 'list_your_space', 'listing_descriptions', 'listing_recommendations', 'listing_reviews', 'listing_reviews_page', 'login', 'login_modal', 'login_page', 'lookup_message_thread', 'manage_listing', 'message_inbox', 'message_post', 'message_thread', 'message_to_host_change', 'message_to_host_focus', 'notifications', 'oauth_login', 'oauth_response', 'p1', 'p3', 'p4', 'p4_refund_policy_terms', 'p4_terms', 'p5', 'payment_instruments', 'pending', 'phone_verification_success', 'popular_wishlists', 'post_checkout_action', 'previous_trips', 'profile_references', 'profile_verifications', 'read_policy_click', 'remove_dashboard_alert', 'request_new_confirm_email', 'request_to_book', 'reservations', 'send_message', 'set_password', 'set_password_page', 'signup', 'signup_login_page', 'signup_modal', 'similar_listings', 'terms_and_privacy', 'toggle_archived_thread', 'toggle_starred_thread', 'translate_listing_reviews', 'translations', 'trip_availability', 'unavailable_dates', 'update_listing', 'update_listing_description','update_user', 'update_user_profile', 'user_friend_recommendations', 'user_languages', 'user_listings', 'user_profile','user_profile_content_update', 'user_reviews', 'user_social_connections', 'user_tax_forms', 'user_wishlists', 'view_listing', 'view_search_results', 'wishlist', 'wishlist_content_update', 'wishlist_note', 'your_listings', 'your_reservations', 'your_trips'] distinctdevice_types = ['-unknown-', 'Android App Unknown Phone/Tablet', 'Android Phone', 'Blackberry', 'Chromebook', 'Linux Desktop', 'Mac Desktop', 'Tablet', 'Windows Desktop', 'Windows Phone', 'iPad Tablet', 'iPhone', 'iPodtouch'] # row 1 + row 2 distinct_duo1 = [('', 'message_post'), ('10', 'message_post'), ('11', 'message_post'), ('12', 'message_post'), ('15', 'message_post'), ('about_us', '-unknown-'), ('accept_decline', 'view'), ('account', '-unknown-'), ('acculynk_bin_check_failed', '-unknown-'), ('acculynk_bin_check_success', '-unknown-'), ('acculynk_load_pin_pad', '-unknown-'), ('acculynk_pin_pad_error', '-unknown-'), ('acculynk_pin_pad_inactive', '-unknown-'), ('acculynk_pin_pad_success', '-unknown-'), ('acculynk_session_obtained', '-unknown-'), ('active', '-unknown-'), ('add_business_address_colorbox', '-unknown-'), ('add_guest_colorbox', '-unknown-'), ('add_guests', '-unknown-'), ('add_note', 'submit'), ('agree_terms_check', '-unknown-'), ('agree_terms_uncheck', '-unknown-'), ('airbnb_picks', 'view'), ('airbrb', '-unknown-'), ('ajax_check_dates', 'click'), ('ajax_get_referrals_amt', '-unknown-'), ('ajax_get_results', 'click'), ('ajax_google_translate', '-unknown-'), ('ajax_google_translate_description', '-unknown-'), ('ajax_google_translate_reviews', 'click'), ('ajax_image_upload', '-unknown-'), ('ajax_ldp', '-unknown-'), ('ajax_lwlb_contact', 'click'), ('ajax_payout_edit', '-unknown-'), ('ajax_payout_options_by_country', '-unknown-'), ('ajax_payout_split_edit', '-unknown-'), ('ajax_photo_widget', '-unknown-'), ('ajax_photo_widget_form_iframe', '-unknown-'), ('ajax_price_and_availability', 'click'), ('ajax_referral_banner_experiment_type', '-unknown-'), ('ajax_referral_banner_type', '-unknown-'), ('ajax_refresh_subtotal', 'click'), ('ajax_send_message', '-unknown-'), ('ajax_special_offer_dates_available', 'click'), ('ajax_statsd', '-unknown-'), ('ajax_worth', 'submit'), ('apply', '-unknown-'), ('apply_code', '-unknown-'), ('apply_coupon_click', 'click'), ('apply_coupon_click_success', 'click'), ('apply_coupon_error', 'click'), ('apply_coupon_error_type', '-unknown-'), ('apply_reservation', 'submit'), ('approve','-unknown-'), ('approve', 'submit'), ('ask_question', 'submit'), ('at_checkpoint', 'booking_request'), ('authenticate', 'submit'), ('authenticate', 'view'), ('authorize', '-unknown-'), ('available', '-unknown-'), ('available', 'data'), ('badge', '-unknown-'), ('become_user', '-unknown-'), ('book', 'view'), ('booking', 'booking_response'), ('braintree_client_token', ''), ('business_travel', '-unknown-'), ('calendar_tab_inner2', '-unknown-'), ('callback', 'partner_callback'), ('campaigns', ''), ('campaigns', '-unknown-'), ('cancel', 'submit'), ('cancellation_policies', 'view'), ('cancellation_policy_click', 'click'), ('change', 'view'), ('change_availability', '-unknown-'), ('change_availability', 'submit'), ('change_currency', '-unknown-'), ('change_default_payout', '-unknown-'), ('change_password', 'submit'), ('check', ''), ('city_count', '-unknown-'), ('clear_reservation', '-unknown-'), ('click', '-unknown-'), ('click', 'click'), ('clickthrough', '-unknown-'), ('collections', '-unknown-'), ('collections', 'view'), ('complete', '-unknown-'), ('complete_redirect', '-unknown-'), ('complete_status', '-unknown-'), ('concierge', '-unknown-'), ('confirm_email', '-unknown-'), ('confirm_email', 'click'), ('confirmation', '-unknown-'), ('connect', '-unknown-'), ('connect', 'submit'), ('contact_new', '-unknown-'), ('countries', '-unknown-'), ('country_options', '-unknown-'), ('coupon_code_click', 'click'), ('coupon_field_focus', 'click'), ('create', '-unknown-'), ('create', 'submit'), ('create', 'view'), ('create_ach', '-unknown-'), ('create_airbnb', '-unknown-'), ('create_multiple', '-unknown-'), ('create_paypal', '-unknown-'), ('currencies', ''), ('currencies', '-unknown-'), ('custom_recommended_destinations', '-unknown-'), ('dashboard', 'view'), ('deactivate', '-unknown-'), ('deactivated', 'view'), ('deauthorize', '-unknown-'), ('decision_tree', '-unknown-'), ('delete', '-unknown-'), ('delete', 'submit'), ('department', '-unknown-'), ('departments', '-unknown-'), ('desks', '-unknown-'), ('destroy', '-unknown-'), ('destroy', 'submit'), ('detect_fb_session', '-unknown-'), ('disaster_action', ''), ('domains', '-unknown-'), ('edit', '-unknown-'), ('edit', 'view'), ('edit_verification', 'view'), ('email_by_key', '-unknown-'), ('email_itinerary_colorbox', '-unknown-'), ('email_share', 'submit'), ('email_wishlist', 'click'), ('endpoint_error', '-unknown-'), ('envoy_bank_details_redirect', '-unknown-'), ('envoy_form', '-unknown-'), ('events', '-unknown-'), ('facebook_auto_login', '-unknown-'), ('faq', '-unknown-'), ('faq_category', '-unknown-'), ('faq_experiment_ids', '-unknown-'), ('feed', '-unknown-'), ('forgot_password', 'click'), ('forgot_password', 'submit'), ('founders', '-unknown-'), ('friend_listing', '-unknown-'), ('friends', 'view'), ('friends_new', '-unknown-'), ('glob', '-unknown-'), ('google_importer', '-unknown-'), ('guarantee', 'view'), ('guest_billing_receipt', '-unknown-'), ('guest_booked_elsewhere', 'message_post'), ('handle_vanity_url', '-unknown-'), ('hard_fallback_submit', '-unknown-'), ('has_profile_pic', '-unknown-'), ('header_userpic', 'data'), ('home_safety_landing', '-unknown-'), ('home_safety_terms', '-unknown-'), ('hospitality', '-unknown-'), ('hospitality_standards', '-unknown-'), ('host_2013', '-unknown-'), ('host_cancel', '-unknown-'), ('host_summary', '-unknown-'), ('host_summary', 'view'), ('hosting_social_proof', '-unknown-'), ('how_it_works', '-unknown-'), ('identity', '-unknown-'), ('image_order', '-unknown-'), ('impressions', 'view'), ('index', ''), ('index', '-unknown-'), ('index', 'data'), ('index', 'view'), ('invalid_action', '-unknown-'), ('issue', '-unknown-'), ('itinerary', 'view'), ('jumio', '-unknown-'), ('jumio_redirect', '-unknown-'), ('jumio_token', '-unknown-'), ('kba', '-unknown-'), ('kba_update', '-unknown-'), ('languages_multiselect', '-unknown-'), ('life', '-unknown-'), ('listing', 'view'), ('listings', '-unknown-'), ('listings', 'view'), ('load_more', '-unknown-'), ('locale_from_host', '-unknown-'), ('localization_settings', ''), ('localization_settings', '-unknown-'), ('localized', '-unknown-'), ('locations', '-unknown-'), ('login', '-unknown-'), ('login', 'view'), ('login_modal', 'view'), ('lookup', ''), ('manage_listing', 'view'), ('maybe_information', 'message_post'), ('media_resources', '-unknown-'), ('message','-unknown-'), ('message_to_host_change', 'click'), ('message_to_host_focus', 'click'), ('mobile_landing_page', '-unknown-'), ('mobile_oauth_callback', '-unknown-'), ('multi', '-unknown-'), ('multi_message', 'message_post'), ('multi_message_attributes', '-unknown-'), ('my', 'view'), ('my_listings', 'view'), ('my_reservations', 'view'), ('new', '-unknown-'), ('new', 'view'), ('new_host', '-unknown-'), ('new_session', '-unknown-'), ('notifications', '-unknown-'), ('notifications', 'data'), ('notifications', 'submit'), ('notifications', 'view'), ('nyan', '-unknown-'), ('office_location', '-unknown-'), ('onenight', '-unknown-'), ('open_graph_setting', '-unknown-'), ('open_hard_fallback_modal', '-unknown-'), ('other_hosting_reviews', '-unknown-'), ('other_hosting_reviews_first', '-unknown-'), ('overview', '-unknown-'), ('p4_refund_policy_terms', 'click'), ('p4_terms', 'click'), ('patch', '-unknown-'), ('patch', 'modify'), ('pay', '-unknown-'), ('payment_instruments', '-unknown-'), ('payment_instruments', 'data'), ('payment_methods', '-unknown-'), ('payoneer_account_redirect', '-unknown-'), ('payoneer_signup_complete', '-unknown-'), ('payout_delete', '-unknown-'), ('payout_preferences', 'view'), ('payout_update', '-unknown-'), ('pending', '-unknown-'), ('pending', 'booking_request'), ('pending_tickets', '-unknown-'), ('personalize', 'data'), ('phone_number_widget', '-unknown-'), ('phone_verification', ''), ('phone_verification_call_taking_too_long', '-unknown-'), ('phone_verification_error', '-unknown-'), ('phone_verification_modal', '-unknown-'), ('phone_verification_number_submitted_for_call', '-unknown-'), ('phone_verification_number_submitted_for_sms', '-unknown-'), ('phone_verification_number_sucessfully_submitted', '-unknown-'), ('phone_verification_phone_number_removed', '-unknown-'), ('phone_verification_success', 'click'), ('photography', '-unknown-'), ('photography_update', '-unknown-'), ('place_worth', 'view'), ('plaxo_cb', '-unknown-'), ('popular', 'view'), ('popular_listing', '-unknown-'), ('populate_from_facebook', '-unknown-'), ('populate_help_dropdown', '-unknown-'), ('position', '-unknown-'), ('preapproval', 'message_post'), ('press_content', '-unknown-'), ('press_news', '-unknown-'), ('press_release', '-unknown-'), ('pricing', '-unknown-'), ('print_confirmation', '-unknown-'), ('privacy', 'view'), ('profile_pic', '-unknown-'), ('push_notification_callback', '-unknown-'), ('qt2', 'view'), ('qt_reply_v2', '-unknown-'), ('qt_reply_v2', 'submit'), ('qt_with', 'data'), ('questions', '-unknown-'), ('rate', '-unknown-'), ('reactivate', '-unknown-'), ('read_policy_click', 'click'), ('receipt', 'view'), ('recent_reservations', '-unknown-'), ('recommend', '-unknown-'), ('recommendation_page', '-unknown-'), ('recommendations', '-unknown-'), ('recommendations', 'data'), ('recommended_listings', '-unknown-'), ('redirect', '-unknown-'), ('references', 'view'), ('referrer_status', '-unknown-'), ('refund_guest_cancellation', 'submit'), ('relationship', '-unknown-'), ('remove_dashboard_alert', '-unknown-'), ('remove_dashboard_alert', 'click'), ('rentals', '-unknown-'), ('report', '-unknown-'), ('reputation', '-unknown-'), ('request_new_confirm_email', 'click'), ('request_photography', '-unknown-'),('requested', 'submit'), ('requested', 'view'), ('requirements', '-unknown-'), ('reservation', '-unknown-'), ('reset_calendar', '-unknown-'), ('respond', 'submit'), ('rest-of-world', '-unknown-'), ('revert_to_admin', '-unknown-'), ('review_page', '-unknown-'), ('reviews', '-unknown-'), ('reviews', 'data'), ('reviews', 'view'), ('reviews_new', '-unknown-'), ('salute', '-unknown-'), ('sandy', '-unknown-'), ('satisfy', ''), ('search', '-unknown-'), ('search', 'click'), ('search_results', 'click'), ('set_default', '-unknown-'), ('set_default', 'submit'), ('set_minimum_payout_amount', '-unknown-'), ('set_password', 'submit'), ('set_password', 'view'), ('set_user', 'submit'), ('settings', '-unknown-'), ('show', ''), ('show', '-unknown-'), ('show', 'data'), ('show', 'view'), ('show_code', '-unknown-'), ('show_personalize', 'data'), ('signature', '-unknown-'), ('signed_out_modal', ''), ('signup_login', 'view'), ('signup_modal', 'view'), ('signup_weibo', '-unknown-'), ('signup_weibo_referral', '-unknown-'), ('similar_listings', 'data'), ('similar_listings_v2', ''), ('sldf', '-unknown-'), ('slideshow', '-unknown-'), ('social', '-unknown-'), ('social-media', '-unknown-'), ('social_connections', '-unknown-'), ('social_connections', 'data'), ('south-america', '-unknown-'), ('southern-europe', '-unknown-'), ('special_offer', 'message_post'), ('spoken_languages', 'data'), ('status', '-unknown-'), ('stpcv', '-unknown-'), ('sublets', '-unknown-'), ('submit_contact', '-unknown-'), ('support_phone_numbers', '-unknown-'), ('supported', '-unknown-'), ('sync', '-unknown-'), ('tell_a_friend', '-unknown-'), ('terms', '-unknown-'), ('terms', 'view'), ('terms_and_conditions', '-unknown-'), ('this_hosting_reviews', 'click'), ('this_hosting_reviews_3000', '-unknown-'), ('toggle_archived_thread', 'click'), ('toggle_availability', '-unknown-'), ('toggle_starred_thread', 'click'), ('top_destinations', '-unknown-'), ('tos_2014', 'view'), ('tos_confirm', '-unknown-'), ('track_activity', ''), ('track_page_view', ''), ('transaction_history', 'view'), ('transaction_history_paginated', '-unknown-'), ('travel', '-unknown-'), ('travel_plans_current', 'view'), ('travel_plans_previous', 'view'), ('trust', '-unknown-'), ('unavailabilities', '-unknown-'), ('unavailabilities', 'data'), ('united-states', '-unknown-'), ('unread', '-unknown-'), ('unsubscribe', '-unknown-'), ('update', ''), ('update', '-unknown-'), ('update', 'submit'), ('update_cached', 'data'), ('update_country_of_residence', '-unknown-'), ('update_friends_display', '-unknown-'), ('update_hide_from_search_engines', '-unknown-'), ('update_message', '-unknown-'), ('update_notifications', '-unknown-'), ('update_reservation_requirements', '-unknown-'), ('upload', '-unknown-'), ('uptodate', ''), ('use_mobile_site', '-unknown-'), ('verify', '-unknown-'), ('view', 'view'), ('views', '-unknown-'), ('views_campaign', '-unknown-'), ('views_campaign_rules', '-unknown-'), ('webcam_upload', '-unknown-'), ('weibo_signup_referral_finish', '-unknown-'), ('why_host', '-unknown-'), ('widget', ''), ('wishlists', '-unknown-'), ('zendesk_login_jwt', '-unknown-')] # row 1 + row 3 distinct_duo2 = [('', 'message_post'), ('10', 'message_post'), ('11', 'message_post'), ('12', 'message_post'), ('15', 'message_post'), ('about_us', '-unknown-'), ('accept_decline', 'host_respond_page'), ('account', '-unknown-'), ('acculynk_bin_check_failed', '-unknown-'), ('acculynk_bin_check_success', '-unknown-'), ('acculynk_load_pin_pad', '-unknown-'), ('acculynk_pin_pad_error', '-unknown-'), ('acculynk_pin_pad_inactive', '-unknown-'), ('acculynk_pin_pad_success', '-unknown-'), ('acculynk_session_obtained', '-unknown-'), ('active', '-unknown-'), ('add_business_address_colorbox', '-unknown-'), ('add_guest_colorbox', '-unknown-'), ('add_guests', '-unknown-'), ('add_note', 'wishlist_note'), ('agree_terms_check', '-unknown-'), ('agree_terms_uncheck', '-unknown-'), ('airbnb_picks', 'airbnb_picks_wishlists'), ('airbrb','-unknown-'), ('ajax_check_dates', 'change_contact_host_dates'), ('ajax_get_referrals_amt', '-unknown-'), ('ajax_get_results', 'view_search_results'), ('ajax_google_translate', '-unknown-'), ('ajax_google_translate_description', '-unknown-'), ('ajax_google_translate_reviews', 'translate_listing_reviews'), ('ajax_image_upload', '-unknown-'), ('ajax_ldp', '-unknown-'), ('ajax_lwlb_contact', 'contact_host'), ('ajax_payout_edit', '-unknown-'), ('ajax_payout_options_by_country', '-unknown-'), ('ajax_payout_split_edit', '-unknown-'), ('ajax_photo_widget', '-unknown-'), ('ajax_photo_widget_form_iframe', '-unknown-'), ('ajax_price_and_availability', 'alteration_field'), ('ajax_referral_banner_experiment_type', '-unknown-'), ('ajax_referral_banner_type', '-unknown-'), ('ajax_refresh_subtotal', 'change_trip_characteristics'), ('ajax_send_message', '-unknown-'), ('ajax_special_offer_dates_available', 'special_offer_field'), ('ajax_statsd', '-unknown-'), ('ajax_worth', 'calculate_worth'), ('apply', '-unknown-'), ('apply_code', '-unknown-'), ('apply_coupon_click', 'apply_coupon_click'), ('apply_coupon_click_success', 'apply_coupon_click_success'), ('apply_coupon_error', 'apply_coupon_error'), ('apply_coupon_error_type', '-unknown-'), ('apply_reservation', 'apply_coupon'), ('approve', '-unknown-'), ('approve', 'host_respond'), ('ask_question', 'contact_host'), ('at_checkpoint', 'at_checkpoint'), ('authenticate', 'login'), ('authenticate', 'login_page'), ('authorize', '-unknown-'), ('available', '-unknown-'), ('available', 'trip_availability'), ('badge', '-unknown-'), ('become_user', '-unknown-'), ('book', 'p4'),('booking', 'booking'), ('braintree_client_token', ''), ('business_travel', '-unknown-'), ('calendar_tab_inner2', '-unknown-'), ('callback', 'oauth_response'), ('campaigns', ''), ('campaigns', '-unknown-'), ('cancel', 'guest_cancellation'), ('cancellation_policies', 'cancellation_policies'), ('cancellation_policy_click', 'cancellation_policy_click'), ('change', 'change_or_alter'), ('change_availability', '-unknown-'), ('change_availability', 'change_availability'), ('change_currency', '-unknown-'), ('change_default_payout', '-unknown-'), ('change_password', 'change_password'), ('check', ''), ('city_count', '-unknown-'), ('clear_reservation', '-unknown-'), ('click', '-unknown-'), ('click', 'book_it'), ('click', 'cancellation_policy'), ('click', 'click_about_host'), ('click', 'click_amenities'), ('click', 'click_reviews'), ('click', 'complete_booking'), ('click', 'contact_host'), ('click', 'instant_book'), ('click', 'move_map'), ('click', 'photos'), ('click', 'request_to_book'), ('click', 'share'), ('clickthrough', '-unknown-'), ('collections', '-unknown-'), ('collections', 'user_wishlists'), ('complete', '-unknown-'), ('complete_redirect', '-unknown-'), ('complete_status', '-unknown-'), ('concierge', '-unknown-'), ('confirm_email', '-unknown-'), ('confirm_email', 'confirm_email'), ('confirm_email', 'confirm_email_link'), ('confirmation', '-unknown-'), ('connect', '-unknown-'), ('connect', 'oauth_login'), ('contact_new', '-unknown-'), ('countries', '-unknown-'), ('country_options', '-unknown-'), ('coupon_code_click', 'coupon_code_click'), ('coupon_field_focus', 'coupon_field_focus'), ('create', '-unknown-'), ('create', 'create_alteration_request'), ('create', 'create_listing'), ('create', 'create_payment_instrument'), ('create', 'create_phone_numbers'), ('create', 'create_user'), ('create', 'list_your_space'), ('create', 'signup'), ('create_ach', '-unknown-'), ('create_airbnb', '-unknown-'), ('create_multiple', '-unknown-'), ('create_paypal', '-unknown-'), ('currencies', ''), ('currencies', '-unknown-'), ('custom_recommended_destinations', '-unknown-'), ('dashboard', 'dashboard'), ('deactivate', '-unknown-'), ('deactivated', 'host_standard_suspension'), ('deauthorize', '-unknown-'), ('decision_tree', '-unknown-'), ('delete', '-unknown-'), ('delete', 'deactivate_user_account'), ('delete', 'delete_listing'), ('delete', 'delete_listing_description'), ('delete', 'delete_phone_numbers'), ('delete', 'phone_numbers'), ('delete', 'reservations'), ('department', '-unknown-'), ('departments', '-unknown-'), ('desks', '-unknown-'), ('destroy', '-unknown-'), ('destroy', 'delete_payment_instrument'), ('detect_fb_session', '-unknown-'), ('disaster_action', ''), ('domains', '-unknown-'), ('edit', '-unknown-'), ('edit', 'edit_profile'), ('edit_verification', 'profile_verifications'), ('email_by_key', '-unknown-'), ('email_itinerary_colorbox', '-unknown-'), ('email_share', 'email_wishlist'), ('email_wishlist', 'email_wishlist_button'), ('endpoint_error', '-unknown-'), ('envoy_bank_details_redirect', '-unknown-'), ('envoy_form', '-unknown-'), ('events', '-unknown-'), ('facebook_auto_login', '-unknown-'), ('faq', '-unknown-'), ('faq_category', '-unknown-'), ('faq_experiment_ids', '-unknown-'), ('feed', '-unknown-'), ('forgot_password', 'forgot_password'), ('founders', '-unknown-'), ('friend_listing', '-unknown-'), ('friends', 'friends_wishlists'), ('friends_new', '-unknown-'), ('glob', '-unknown-'), ('google_importer', '-unknown-'), ('guarantee', 'host_guarantee'), ('guest_billing_receipt', '-unknown-'), ('guest_booked_elsewhere', 'message_post'), ('handle_vanity_url', '-unknown-'), ('hard_fallback_submit', '-unknown-'), ('has_profile_pic', '-unknown-'), ('header_userpic', 'header_userpic'), ('home_safety_landing', '-unknown-'), ('home_safety_terms', '-unknown-'), ('hospitality', '-unknown-'), ('hospitality_standards', '-unknown-'), ('host_2013', '-unknown-'), ('host_cancel', '-unknown-'), ('host_summary', '-unknown-'), ('host_summary', 'host_home'), ('hosting_social_proof', '-unknown-'), ('how_it_works', '-unknown-'), ('identity', '-unknown-'), ('image_order', '-unknown-'), ('impressions', 'p4'), ('index', ''), ('index', '-unknown-'), ('index', 'account_payment_methods'), ('index', 'homepage'), ('index', 'listing_descriptions'), ('index', 'message_inbox'), ('index', 'message_thread'), ('index', 'reservations'), ('index', 'user_tax_forms'), ('index', 'user_wishlists'), ('index', 'view_ghosting_reasons'), ('index', 'view_ghostings'), ('index', 'view_identity_verifications'), ('index', 'view_locations'), ('index', 'view_reservations'), ('index', 'view_resolutions'), ('index', 'view_search_results'), ('index', 'view_user_real_names'), ('index', 'your_listings'), ('invalid_action', '-unknown-'), ('issue', '-unknown-'), ('itinerary', 'guest_itinerary'), ('jumio', '-unknown-'), ('jumio_redirect', '-unknown-'), ('jumio_token', '-unknown-'), ('kba', '-unknown-'), ('kba_update', '-unknown-'), ('languages_multiselect', '-unknown-'), ('life', '-unknown-'), ('listing', 'p3'), ('listings', '-unknown-'), ('listings', 'user_listings'), ('load_more', '-unknown-'), ('locale_from_host', '-unknown-'), ('localization_settings', ''), ('localization_settings', '-unknown-'), ('localized', '-unknown-'), ('locations', '-unknown-'), ('login', '-unknown-'), ('login', 'login_page'), ('login_modal', 'login_modal'), ('lookup', ''), ('manage_listing', 'manage_listing'),('maybe_information', 'message_post'), ('media_resources', '-unknown-'), ('message', '-unknown-'), ('message_to_host_change', 'message_to_host_change'), ('message_to_host_focus', 'message_to_host_focus'), ('mobile_landing_page', '-unknown-'), ('mobile_oauth_callback', '-unknown-'), ('multi', '-unknown-'), ('multi_message', 'message_post'), ('multi_message_attributes', '-unknown-'), ('my', 'user_wishlists'), ('my_listings', 'your_reservations'), ('my_reservations', 'your_reservations'), ('new', '-unknown-'), ('new', 'list_your_space'), ('new_host', '-unknown-'), ('new_session', '-unknown-'), ('notifications', '-unknown-'), ('notifications', 'account_notification_settings'), ('notifications', 'notifications'), ('nyan', '-unknown-'), ('office_location', '-unknown-'), ('onenight', '-unknown-'), ('open_graph_setting', '-unknown-'), ('open_hard_fallback_modal', '-unknown-'), ('other_hosting_reviews', '-unknown-'), ('other_hosting_reviews_first', '-unknown-'), ('overview', '-unknown-'), ('p4_refund_policy_terms', 'p4_refund_policy_terms'), ('p4_terms', 'p4_terms'), ('patch', '-unknown-'), ('patch', 'modify_reservations'), ('patch', 'modify_users'), ('pay', '-unknown-'), ('payment_instruments', '-unknown-'), ('payment_instruments', 'payment_instruments'), ('payment_methods', '-unknown-'), ('payoneer_account_redirect', '-unknown-'), ('payoneer_signup_complete', '-unknown-'), ('payout_delete', '-unknown-'), ('payout_preferences', 'account_payout_preferences'), ('payout_update', '-unknown-'), ('pending', '-unknown-'), ('pending', 'pending'), ('pending_tickets', '-unknown-'), ('personalize', 'wishlist_content_update'), ('phone_number_widget', '-unknown-'), ('phone_verification', ''), ('phone_verification_call_taking_too_long', '-unknown-'), ('phone_verification_error', '-unknown-'), ('phone_verification_modal', '-unknown-'), ('phone_verification_number_submitted_for_call', '-unknown-'), ('phone_verification_number_submitted_for_sms', '-unknown-'), ('phone_verification_number_sucessfully_submitted', '-unknown-'), ('phone_verification_phone_number_removed', '-unknown-'), ('phone_verification_success', 'phone_verification_success'), ('photography', '-unknown-'), ('photography_update', '-unknown-'), ('place_worth', 'place_worth'), ('plaxo_cb', '-unknown-'), ('popular', 'popular_wishlists'), ('popular_listing', '-unknown-'), ('populate_from_facebook', '-unknown-'), ('populate_help_dropdown', '-unknown-'), ('position', '-unknown-'), ('preapproval', 'message_post'), ('press_content', '-unknown-'), ('press_news', '-unknown-'), ('press_release', '-unknown-'), ('pricing', '-unknown-'), ('print_confirmation', '-unknown-'), ('privacy', 'account_privacy_settings'), ('profile_pic', '-unknown-'), ('push_notification_callback', '-unknown-'), ('qt2', 'message_thread'), ('qt_reply_v2', '-unknown-'), ('qt_reply_v2', 'send_message'), ('qt_with', 'lookup_message_thread'), ('questions', '-unknown-'), ('rate', '-unknown-'), ('reactivate', '-unknown-'), ('read_policy_click', 'read_policy_click'), ('receipt', 'guest_receipt'), ('recent_reservations', '-unknown-'), ('recommend', '-unknown-'), ('recommendation_page', '-unknown-'), ('recommendations', '-unknown-'), ('recommendations', 'listing_recommendations'), ('recommendations','user_friend_recommendations'), ('recommended_listings', '-unknown-'), ('redirect', '-unknown-'), ('references', 'profile_references'), ('referrer_status', '-unknown-'), ('refund_guest_cancellation', 'host_refund_guest'), ('relationship', '-unknown-'), ('remove_dashboard_alert', '-unknown-'), ('remove_dashboard_alert', 'remove_dashboard_alert'), ('rentals', '-unknown-'), ('report', '-unknown-'), ('reputation', '-unknown-'), ('request_new_confirm_email', 'request_new_confirm_email'), ('request_photography', '-unknown-'), ('requested', 'p5'), ('requested', 'post_checkout_action'), ('requirements', '-unknown-'), ('reservation', '-unknown-'), ('reset_calendar', '-unknown-'), ('respond', 'respond_to_alteration_request'), ('rest-of-world', '-unknown-'), ('revert_to_admin', '-unknown-'), ('review_page', '-unknown-'), ('reviews', '-unknown-'), ('reviews', 'listing_reviews'), ('reviews', 'profile_reviews'), ('reviews', 'user_reviews'), ('reviews_new', '-unknown-'), ('salute', '-unknown-'), ('sandy', '-unknown-'), ('satisfy', ''), ('search', '-unknown-'), ('search', 'view_search_results'), ('search_results', 'view_search_results'), ('set_default', '-unknown-'), ('set_default', 'set_default_payment_instrument'), ('set_minimum_payout_amount', '-unknown-'), ('set_password', 'set_password'), ('set_password', 'set_password_page'), ('set_user', 'create_listing'), ('settings', '-unknown-'), ('show', ''), ('show', '-unknown-'), ('show', 'alteration_request'), ('show', 'p1'), ('show', 'p3'), ('show', 'translations'), ('show', 'user_profile'), ('show', 'view_identity_verifications'), ('show', 'view_listing'), ('show','view_security_checks'), ('show', 'wishlist'), ('show_code', '-unknown-'), ('show_personalize', 'user_profile_content_update'), ('signature', '-unknown-'), ('signed_out_modal', ''), ('signup_login', 'signup_login_page'), ('signup_modal', 'signup_modal'), ('signup_weibo', '-unknown-'), ('signup_weibo_referral', '-unknown-'), ('similar_listings', 'similar_listings'), ('similar_listings_v2', ''), ('sldf', '-unknown-'), ('slideshow', '-unknown-'), ('social', '-unknown-'), ('social-media', '-unknown-'), ('social_connections', '-unknown-'), ('social_connections', 'user_social_connections'), ('south-america', '-unknown-'), ('southern-europe', '-unknown-'), ('special_offer', 'message_post'), ('spoken_languages', 'user_languages'), ('status', '-unknown-'), ('stpcv', '-unknown-'), ('sublets', '-unknown-'), ('submit_contact', '-unknown-'), ('support_phone_numbers', '-unknown-'), ('supported', '-unknown-'), ('sync', '-unknown-'), ('tell_a_friend', '-unknown-'), ('terms', '-unknown-'), ('terms', 'terms_and_privacy'), ('terms_and_conditions', '-unknown-'), ('this_hosting_reviews','listing_reviews_page'), ('this_hosting_reviews_3000', '-unknown-'), ('toggle_archived_thread', 'toggle_archived_thread'), ('toggle_availability', '-unknown-'), ('toggle_starred_thread', 'toggle_starred_thread'), ('top_destinations', '-unknown-'), ('tos_2014', 'tos_2014'), ('tos_confirm', '-unknown-'), ('track_activity', ''), ('track_page_view', ''), ('transaction_history', 'account_transaction_history'), ('transaction_history_paginated', '-unknown-'), ('travel', '-unknown-'), ('travel_plans_current', 'your_trips'), ('travel_plans_previous', 'previous_trips'), ('trust', '-unknown-'), ('unavailabilities', '-unknown-'), ('unavailabilities', 'unavailable_dates'), ('united-states', '-unknown-'), ('unread', '-unknown-'), ('unsubscribe', '-unknown-'), ('update', ''), ('update', '-unknown-'), ('update', 'update_listing'), ('update', 'update_listing_description'), ('update', 'update_user'), ('update', 'update_user_profile'), ('update_cached', 'admin_templates'), ('update_country_of_residence', '-unknown-'), ('update_friends_display', '-unknown-'), ('update_hide_from_search_engines', '-unknown-'), ('update_message', '-unknown-'), ('update_notifications', '-unknown-'), ('update_reservation_requirements', '-unknown-'), ('upload', '-unknown-'), ('uptodate', ''), ('use_mobile_site', '-unknown-'), ('verify', '-unknown-'), ('view', 'p3'), ('views', '-unknown-'), ('views_campaign', '-unknown-'), ('views_campaign_rules', '-unknown-'), ('webcam_upload', '-unknown-'), ('weibo_signup_referral_finish', '-unknown-'), ('why_host', '-unknown-'), ('widget', ''), ('wishlists', '-unknown-'), ('zendesk_login_jwt', '-unknown-')] # row 2 + row 3 distinct_duo3 = [('', ''), ('-unknown-', '-unknown-'), ('-unknown-', 'phone_numbers'), ('-unknown-', 'reservations'), ('booking_request', 'at_checkpoint'), ('booking_request', 'pending'), ('booking_response', 'booking'), ('click', 'alteration_field'), ('click', 'apply_coupon_click'), ('click', 'apply_coupon_click_success'), ('click', 'apply_coupon_error'), ('click', 'book_it'), ('click', 'cancellation_policy'), ('click', 'cancellation_policy_click'), ('click', 'change_contact_host_dates'), ('click', 'change_trip_characteristics'), ('click', 'click_about_host'), ('click', 'click_amenities'), ('click', 'click_reviews'), ('click', 'complete_booking'), ('click', 'confirm_email'), ('click', 'confirm_email_link'), ('click', 'contact_host'), ('click', 'coupon_code_click'), ('click', 'coupon_field_focus'), ('click', 'email_wishlist_button'), ('click', 'forgot_password'), ('click', 'instant_book'), ('click', 'listing_reviews_page'), ('click', 'message_to_host_change'), ('click', 'message_to_host_focus'), ('click', 'move_map'), ('click', 'p4_refund_policy_terms'), ('click', 'p4_terms'), ('click', 'phone_verification_success'), ('click', 'photos'), ('click', 'read_policy_click'), ('click', 'remove_dashboard_alert'), ('click', 'request_new_confirm_email'), ('click', 'request_to_book'), ('click', 'share'), ('click', 'special_offer_field'), ('click', 'toggle_archived_thread'), ('click', 'toggle_starred_thread'), ('click', 'translate_listing_reviews'), ('click', 'view_search_results'), ('data', 'admin_templates'), ('data', 'header_userpic'), ('data', 'listing_recommendations'), ('data', 'listing_reviews'), ('data', 'lookup_message_thread'), ('data', 'notifications'), ('data', 'payment_instruments'), ('data', 'reservations'), ('data', 'similar_listings'), ('data', 'translations'), ('data', 'trip_availability'), ('data', 'unavailable_dates'), ('data', 'user_friend_recommendations'), ('data', 'user_languages'), ('data', 'user_profile_content_update'), ('data', 'user_reviews'), ('data', 'user_social_connections'), ('data', 'user_tax_forms'), ('data', 'wishlist_content_update'), ('message_post', 'message_post'), ('modify', 'modify_reservations'), ('modify', 'modify_users'), ('partner_callback', 'oauth_response'), ('submit', 'apply_coupon'), ('submit', 'calculate_worth'), ('submit', 'change_availability'), ('submit', 'change_password'), ('submit', 'contact_host'), ('submit', 'create_alteration_request'), ('submit', 'create_listing'), ('submit', 'create_payment_instrument'), ('submit', 'create_phone_numbers'), ('submit', 'create_user'), ('submit', 'deactivate_user_account'), ('submit', 'delete_listing'), ('submit', 'delete_listing_description'), ('submit', 'delete_payment_instrument'), ('submit', 'delete_phone_numbers'), ('submit', 'email_wishlist'), ('submit', 'forgot_password'), ('submit', 'guest_cancellation'), ('submit', 'host_refund_guest'), ('submit', 'host_respond'), ('submit', 'login'), ('submit', 'notifications'), ('submit', 'oauth_login'), ('submit', 'post_checkout_action'), ('submit', 'respond_to_alteration_request'), ('submit', 'send_message'), ('submit', 'set_default_payment_instrument'), ('submit', 'set_password'), ('submit', 'signup'), ('submit', 'update_listing'), ('submit', 'update_listing_description'), ('submit', 'update_user'), ('submit', 'update_user_profile'), ('submit', 'wishlist_note'), ('view', 'account_notification_settings'), ('view', 'account_payment_methods'), ('view', 'account_payout_preferences'), ('view', 'account_privacy_settings'), ('view', 'account_transaction_history'), ('view', 'airbnb_picks_wishlists'), ('view', 'alteration_request'), ('view', 'cancellation_policies'), ('view', 'change_or_alter'), ('view', 'dashboard'), ('view', 'edit_profile'), ('view', 'friends_wishlists'), ('view', 'guest_itinerary'), ('view', 'guest_receipt'), ('view', 'homepage'), ('view', 'host_guarantee'), ('view', 'host_home'), ('view', 'host_respond_page'), ('view', 'host_standard_suspension'), ('view', 'list_your_space'), ('view', 'listing_descriptions'), ('view', 'login_modal'), ('view', 'login_page'), ('view', 'manage_listing'), ('view', 'message_inbox'), ('view', 'message_thread'), ('view', 'p1'), ('view', 'p3'), ('view', 'p4'), ('view', 'p5'), ('view', 'place_worth'), ('view', 'popular_wishlists'), ('view', 'previous_trips'), ('view', 'profile_references'), ('view', 'profile_reviews'), ('view', 'profile_verifications'), ('view', 'set_password_page'), ('view', 'signup_login_page'), ('view', 'signup_modal'), ('view', 'terms_and_privacy'), ('view', 'tos_2014'), ('view', 'user_listings'), ('view', 'user_profile'), ('view', 'user_wishlists'), ('view', 'view_ghosting_reasons'), ('view', 'view_ghostings'), ('view', 'view_identity_verifications'), ('view', 'view_listing'), ('view', 'view_locations'), ('view', 'view_reservations'), ('view', 'view_resolutions'), ('view', 'view_search_results'), ('view', 'view_security_checks'), ('view', 'view_user_real_names'), ('view', 'wishlist'), ('view', 'your_listings'), ('view', 'your_reservations'), ('view', 'your_trips')] # User has session? hassession = np.array([1 if id in keyswithsessions else -1 for id in ids]) numusers[:,starti] = hassession starti += 1 # User has booking request? #hasbr = np.array([1 if id in keyswithbrs else -1 for id in ids]) #numusers[:,starti] = hasbr #starti += 1 print max(len(x) for x in sessions.values()) """ sessiontabs = dict() # One-hot for every session idi = 0 for id in ids: if id in sessions: idsess = sessions[id] tab = np.load('sessiontabs/' + id + '.npy') "#"" tab = np.empty((len(idsess), 9)) sessi = 0 for row in idsess: # Booking request type tab[sessi,0:9] = scaleCat(dictinctaction_types == row[2]) sessi += 1 sessiontabs[id] = tab np.save('sessiontabs/' + id + '.npy', tab) "#"" sessiontabs[id] = tab if idi % 1000 == 0: print idi,"/",len(ids) idi += 1 import cPickle with open('sessiontabs.pickle', 'wb') as f: cPickle.dump(sessiontabs, f) """ i = 0 for id in ids: if id in sessions: # sessions for this id sess = sessions[id] # session triads sesstriads = set() sessactions = set() sesstypes = set() sessdetails = set() sessduo1s = set() sessduo2s = set() sessduo3s = set() for row in sess: sesstriads.add((row[1], row[2], row[3])) sessactions.add(row[1]) sesstypes.add(row[2]) sessdetails.add(row[3]) sessduo1s.add((row[1], row[2])) sessduo2s.add((row[1], row[3])) sessduo3s.add((row[2], row[3])) #sesstriads = dict() #for row in sess: # if (row[1], row[2], row[3]) not in sesstriads: # sesstriads[(row[1], row[2], row[3])] = 0 # if row[5] != '': # sesstriads[(row[1], row[2], row[3])] += float(row[5]) else: sesstriads = set() sessactions = set() sesstypes = set() sessdetails = set() # one hot encode j = starti for triad in distincttriads: if triad in sesstriads: #numusers[i,j] = scaledWmm(sesstriads[triad], 0, 100000.0) numusers[i,j] = 1 #print numusers[i,j] else: numusers[i,j] = -1 #numusers[i,j+1] = -1 j += 1 for action in distinctactions: if action in sessactions: numusers[i,j] = 1 else: numusers[i,j] = -1 j += 1 for type in dictinctaction_types: if type in sesstypes: numusers[i,j] = 1 else: numusers[i,j] = -1 j += 1 for detail in distinctaction_details: if detail in sessdetails: numusers[i,j] = 1 else: numusers[i,j] = -1 j += 1 # TODO: add device type i += 1 starti = j print starti return ids, users, numusers.astype(np.float32)
193.829268
20,657
0.660025
7,497
71,523
5.985861
0.101107
0.0808
0.012835
0.005393
0.541514
0.421829
0.334901
0.29176
0.254056
0.22141
0
0.007553
0.085581
71,523
369
20,658
193.829268
0.678603
0.022678
0
0.268
0
0
0.624615
0.147772
0
0
0
0.00542
0
0
null
null
0.024
0.044
null
null
0.028
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
0
0
0
0
0
0
1
0
null
0
0
0
0
1
0
0
0
0
0
0
0
0
4
c6cda5c6490b6e111e18e74578af8dd58d40a2bf
516
py
Python
adventofcode/day2.py
dashnak90/stuff
40f899c052f17716c20ba58add5819d7919f80ac
[ "MIT" ]
null
null
null
adventofcode/day2.py
dashnak90/stuff
40f899c052f17716c20ba58add5819d7919f80ac
[ "MIT" ]
null
null
null
adventofcode/day2.py
dashnak90/stuff
40f899c052f17716c20ba58add5819d7919f80ac
[ "MIT" ]
null
null
null
with open('text', 'r') as s: count=0 for i in s: line=i.split() b,e=line[0].split('-') if int(b) <= line[2].count(line[1][0]) <= int(e): count+=1 print(count) with open('text', 'r') as s: count=0 for i in s: line=i.split() b,e=line[0].split('-') if (line[2][int(b)-1]==line[1][0] or line[2][int(e)-1]==line[1][0]) and not (line[2][int(b)-1]==line[1][0] and line[2][int(e)-1]==line[1][0]): count+=1 print(count)
20.64
150
0.459302
96
516
2.46875
0.239583
0.105485
0.126582
0.118143
0.742616
0.7173
0.7173
0.7173
0.447257
0.447257
0
0.067935
0.286822
516
25
151
20.64
0.576087
0
0
0.875
0
0
0.023211
0
0
0
0
0
0
1
0
false
0
0
0
0
0.125
0
0
0
null
0
0
0
0
1
1
1
0
0
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
4
c6def0351a63cfd780b1a1fa6d3fbd075634f835
87
py
Python
AgroNP/apps.py
gitLeii/HealthCare
ad987c1c9dfda95484fb7f81bb5dc2bb4acc9ca5
[ "MIT" ]
1
2021-11-17T18:09:59.000Z
2021-11-17T18:09:59.000Z
AgroNP/apps.py
gitLeii/HealthCare
ad987c1c9dfda95484fb7f81bb5dc2bb4acc9ca5
[ "MIT" ]
null
null
null
AgroNP/apps.py
gitLeii/HealthCare
ad987c1c9dfda95484fb7f81bb5dc2bb4acc9ca5
[ "MIT" ]
null
null
null
from django.apps import AppConfig class AgronpConfig(AppConfig): name = 'AgroNP'
14.5
33
0.747126
10
87
6.5
0.9
0
0
0
0
0
0
0
0
0
0
0
0.172414
87
5
34
17.4
0.902778
0
0
0
0
0
0.068966
0
0
0
0
0
0
1
0
false
0
0.333333
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
0
0
1
0
1
0
0
4
05bb8df17dbf7ff771664b6309813463b5e072ee
110
py
Python
migrant_irregulier/apps.py
ghassen3699/Site_web_Projet
20eca8ded72f4e798862dd5440000afe04892092
[ "Apache-2.0" ]
null
null
null
migrant_irregulier/apps.py
ghassen3699/Site_web_Projet
20eca8ded72f4e798862dd5440000afe04892092
[ "Apache-2.0" ]
null
null
null
migrant_irregulier/apps.py
ghassen3699/Site_web_Projet
20eca8ded72f4e798862dd5440000afe04892092
[ "Apache-2.0" ]
null
null
null
from django.apps import AppConfig class MigrantIrregulierConfig(AppConfig): name = 'migrant_irregulier'
18.333333
41
0.8
11
110
7.909091
0.909091
0
0
0
0
0
0
0
0
0
0
0
0.136364
110
5
42
22
0.915789
0
0
0
0
0
0.163636
0
0
0
0
0
0
1
0
false
0
0.333333
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
0
0
1
0
1
0
0
4
af0ca58ef36efe2096342c83ce39189cee18521a
114
py
Python
src/analysis/infomap/sbm_small.py
hamishgibbs/facebook_mobility_uk
7639778878e72e9e8445a54ea55be67482636498
[ "MIT" ]
null
null
null
src/analysis/infomap/sbm_small.py
hamishgibbs/facebook_mobility_uk
7639778878e72e9e8445a54ea55be67482636498
[ "MIT" ]
1
2020-10-23T03:38:03.000Z
2020-10-23T03:38:03.000Z
src/analysis/infomap/sbm_small.py
hamishgibbs/facebook_mobility_uk
7639778878e72e9e8445a54ea55be67482636498
[ "MIT" ]
null
null
null
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon Sep 14 13:25:26 2020 @author: hamishgibbs """
12.666667
35
0.614035
18
114
3.888889
1
0
0
0
0
0
0
0
0
0
0
0.148936
0.175439
114
8
36
14.25
0.595745
0.885965
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
1
0
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
4
af3248c24989a42aeda5227175229f13dbdbf814
313
py
Python
management/Hostel/admin.py
imbiswas/student-management-system
4ef9a4a77848929cdf427bf0cb5f4aa93a9bc518
[ "MIT" ]
null
null
null
management/Hostel/admin.py
imbiswas/student-management-system
4ef9a4a77848929cdf427bf0cb5f4aa93a9bc518
[ "MIT" ]
null
null
null
management/Hostel/admin.py
imbiswas/student-management-system
4ef9a4a77848929cdf427bf0cb5f4aa93a9bc518
[ "MIT" ]
null
null
null
from __future__ import unicode_literals from django.contrib import admin from Hostel.models import * # Register your models here. admin.site.register(Hostel_Details) admin.site.register(Hostel_Room) admin.site.register(Hostel_Register) admin.site.register(Hostel_Allocation) admin.site.register(Hostel_Visitor)
26.083333
39
0.84345
43
313
5.906977
0.418605
0.177165
0.334646
0.452756
0
0
0
0
0
0
0
0
0.076677
313
11
40
28.454545
0.878893
0.083067
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.375
0
0.375
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
0
0
0
1
0
1
0
0
0
0
4
af3789a8ed4ee4e4b28eae239f070b90b25ebf27
907
py
Python
tripost.py
umd-fire-coml/tridentnet
dc4dcaee2c7d8b2bbc5ffef30800427d678c460d
[ "Apache-2.0" ]
null
null
null
tripost.py
umd-fire-coml/tridentnet
dc4dcaee2c7d8b2bbc5ffef30800427d678c460d
[ "Apache-2.0" ]
null
null
null
tripost.py
umd-fire-coml/tridentnet
dc4dcaee2c7d8b2bbc5ffef30800427d678c460d
[ "Apache-2.0" ]
null
null
null
import json import os def processRoiJson(self, batch_size, jsonDir, consider_misc_categories){ data = json.load(jsonDir) image_set = [] for annotation in data: if(consider_misc_categories and (annotation['category_id'] == 8 or annotation['category_id'] == 9)): #add this annotation bbox = annotation['bbox'] cat_id = annotation['category_id'] im_id = annotation['image_id'] sc = annotation['score'] image = plt.imread() elif(not consider_misc_categories and (annotation['category_id'] == 8 or annotation['category_id'] == 9)): #do not consider these annotations else: bbox= annotation['bbox'] cat_id = annotation['category_id'] im_id = annotation['image_id'] sc = annotation['score'] }
31.275862
114
0.568908
96
907
5.166667
0.427083
0.217742
0.241935
0.100806
0.604839
0.604839
0.604839
0.604839
0.604839
0.604839
0
0.006536
0.325248
907
29
115
31.275862
0.803922
0.057332
0
0.421053
0
0
0.117096
0
0
0
0
0
0
0
null
null
0
0.105263
null
null
0
0
0
0
null
1
1
0
0
0
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
4
af3cc371879e69f5a1f31cd872e67334d8c22838
2,957
py
Python
ravenml/options.py
autognc/ravenML
5fc265d63a623ba45add164cedbe3ddeee2bb7ad
[ "MIT" ]
2
2019-08-08T20:11:11.000Z
2020-08-12T04:59:52.000Z
ravenml/options.py
autognc/ravenML
5fc265d63a623ba45add164cedbe3ddeee2bb7ad
[ "MIT" ]
17
2019-04-08T18:01:51.000Z
2021-06-28T04:46:06.000Z
ravenml/options.py
autognc/ravenML
5fc265d63a623ba45add164cedbe3ddeee2bb7ad
[ "MIT" ]
1
2021-05-06T22:28:40.000Z
2021-05-06T22:28:40.000Z
""" Author(s): Carson Schubert (carson.schubert14@gmail.com) Date Created: 4/11/2019 Standard options which should be used by ravenml plugins. NOTE: there is currently nothing in this value except old functionality that is no longer in use. """ import click ### HELPERS/CALLBACKS ### # NOTE: the no_user callback and option are currently unused, however I am leaving it in the codebase # so its functionality can be brought back if needed in the future. Its purpose is to # ensure that ALL options to a command are set if the --no-user option is passed. # def no_user_callback(ctx, param: click.core.Option, value: bool): # """Callback used by the no-user option. Evaluates all loaded parameters # and if any are still None, throws an error. # Args: # param (click.core.Option): option callback has been called by # value (bool): value of no-user option, default false # """ # # set in context # if ctx.obj is None: # ctx.obj = {} # ctx.obj['NO_USER'] = value # # if we are in no_user mode, check all required arguments are there # if value: # for arg, value in ctx.params.items(): # if value is None: # # ctx.exit('You must supply the --%s argument when using --no-user!'%arg) # raise click.exceptions.BadParameter('You must provide this argument when using --no-user!', # ctx=ctx, param=arg, param_hint=str(arg)) # # NOTE: Any option intended to be used alongside the no_user_opt on a command # # must have their is_eager flag set to TRUE for no_user_opt to work properly # """Flag to determine if the command should run in user mode. # """ # no_user_opt = click.option( # '--no-user', is_flag=True, callback=no_user_callback, expose_value=False, # help='Disable Inquirer prompts and use flags instead.' # ) ### OPTIONS ### # NOTE: The pattern below is currently unused as we no longer make use of large # numbers of options on a single command. I'm leaving it in the codebase in case its functionality # is needed in the future. The option_decorator is a decorator that can be used on a click command # using the same @option_decorator syntax as other decorators. It then applies all options # defined in the "opts" list to that command in the order they are given in the list. # This is just synactic sugar but makes the commands look much nicer. # opts = [ # verbose_opt, # comet_opt, # author_opt, # comments_opt, # model_name_opt, # optimizer_opt, # use_default_config_opt, # hyperparameters_opt # ] # ## Importable Option Decorator ## # def option_decorator(func): # chain = opts[-1](func) # # must loop backwards so order of arguments in click # # command def is same as order in opts list # for i in range(len(opts) - 2, -1, -1): # chain = opts[i](chain) # return chain ### PASS DECORATORS ###
38.402597
109
0.671965
448
2,957
4.366071
0.410714
0.042945
0.018405
0.014315
0.046012
0
0
0
0
0
0
0.005775
0.238756
2,957
76
110
38.907895
0.863172
0.942509
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
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
0
1
0
1
0
1
0
0
4
af42e6cb744c7c2e6f4a522e195f4642fbc5ce21
90
py
Python
stweet/model/cursor.py
markowanga/stweet
7f103b5c88fcef1d993d8cdc99cec358e55293f7
[ "MIT" ]
101
2020-11-22T16:44:25.000Z
2022-03-30T08:42:07.000Z
stweet/model/cursor.py
markowanga/stweet
7f103b5c88fcef1d993d8cdc99cec358e55293f7
[ "MIT" ]
53
2020-11-21T19:40:36.000Z
2022-03-02T10:09:52.000Z
stweet/model/cursor.py
markowanga/stweet
7f103b5c88fcef1d993d8cdc99cec358e55293f7
[ "MIT" ]
16
2020-12-12T23:02:51.000Z
2022-03-01T12:10:32.000Z
from dataclasses import dataclass @dataclass class Cursor: type: str value: str
11.25
33
0.722222
11
90
5.909091
0.818182
0
0
0
0
0
0
0
0
0
0
0
0.233333
90
7
34
12.857143
0.942029
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.2
0
0.8
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
0
0
1
0
0
4
af4871c0fca58aebfab499b6e96029b375f03721
1,004
py
Python
benchmarks/src/garage_benchmarks/experiments/algos/__init__.py
fangqyi/garage
ddafba385ef005f46f913ab352f9638760e5b412
[ "MIT" ]
1
2021-03-02T08:43:20.000Z
2021-03-02T08:43:20.000Z
benchmarks/src/garage_benchmarks/experiments/algos/__init__.py
fangqyi/garage
ddafba385ef005f46f913ab352f9638760e5b412
[ "MIT" ]
null
null
null
benchmarks/src/garage_benchmarks/experiments/algos/__init__.py
fangqyi/garage
ddafba385ef005f46f913ab352f9638760e5b412
[ "MIT" ]
null
null
null
"""Benchmarking experiments for algorithms.""" from garage_benchmarks.experiments.algos.ddpg_garage_tf import ddpg_garage_tf from garage_benchmarks.experiments.algos.her_garage_tf import her_garage_tf from garage_benchmarks.experiments.algos.ppo_garage_pytorch import ( ppo_garage_pytorch) from garage_benchmarks.experiments.algos.ppo_garage_tf import ppo_garage_tf from garage_benchmarks.experiments.algos.td3_garage_tf import td3_garage_tf from garage_benchmarks.experiments.algos.trpo_garage_pytorch import ( trpo_garage_pytorch) from garage_benchmarks.experiments.algos.trpo_garage_tf import trpo_garage_tf from garage_benchmarks.experiments.algos.vpg_garage_pytorch import ( vpg_garage_pytorch) from garage_benchmarks.experiments.algos.vpg_garage_tf import vpg_garage_tf __all__ = [ 'ddpg_garage_tf', 'her_garage_tf', 'ppo_garage_pytorch', 'ppo_garage_tf', 'td3_garage_tf', 'trpo_garage_pytorch', 'trpo_garage_tf', 'vpg_garage_pytorch', 'vpg_garage_tf' ]
50.2
78
0.831673
140
1,004
5.485714
0.128571
0.1875
0.234375
0.363281
0.597656
0.550781
0.550781
0
0
0
0
0.003319
0.099602
1,004
19
79
52.842105
0.846239
0.039841
0
0
0
0
0.14377
0
0
0
0
0
0
1
0
false
0
0.529412
0
0.529412
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
0
0
0
0
0
1
0
1
0
0
4
af5d82dc4645360d6959e59584ee4f3d625bbbf7
323
py
Python
Chapter1.py
WagdyIshac/Advanced-Analytics-with-Azure-Databricks
c1fb64d3b22bc953fe7d5fd5a47991723e4440af
[ "MIT" ]
null
null
null
Chapter1.py
WagdyIshac/Advanced-Analytics-with-Azure-Databricks
c1fb64d3b22bc953fe7d5fd5a47991723e4440af
[ "MIT" ]
null
null
null
Chapter1.py
WagdyIshac/Advanced-Analytics-with-Azure-Databricks
c1fb64d3b22bc953fe7d5fd5a47991723e4440af
[ "MIT" ]
null
null
null
# Databricks notebook source print('I love Azure Databricks') # COMMAND ---------- # MAGIC %scala # MAGIC println("I Love Azure Databricks") # COMMAND ---------- # MAGIC %sql # MAGIC SELECT "I Love Azure Databricks" as message # COMMAND ---------- # MAGIC %md # MAGIC This is my first notebook using the magic command
19
57
0.659443
41
323
5.195122
0.536585
0.070423
0.140845
0.28169
0.300469
0.300469
0
0
0
0
0
0
0.176471
323
17
57
19
0.800752
0.817337
0
0
0
0
0.469388
0
0
0
0
0
0
1
0
true
0
0
0
0
1
0
0
0
null
0
0
1
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
0
1
0
0
0
0
1
0
4
af7f3c38ee9ebe5dda9891bf2978bd5a0241746e
159
py
Python
test/fixture/python/src/test.py
shstefanov/infrastructure-python
1cbc1ca9a7ad951f2bce66b1bf1947c699589f13
[ "MIT" ]
null
null
null
test/fixture/python/src/test.py
shstefanov/infrastructure-python
1cbc1ca9a7ad951f2bce66b1bf1947c699589f13
[ "MIT" ]
null
null
null
test/fixture/python/src/test.py
shstefanov/infrastructure-python
1cbc1ca9a7ad951f2bce66b1bf1947c699589f13
[ "MIT" ]
null
null
null
import json import hello print hello.helloWorld() # print json.dumps(["string", {'bar': 12, 'foo': ('baz', None, 1.0, 2) }]) # print "Hello Infrastructure"
17.666667
74
0.647799
22
159
4.681818
0.727273
0.194175
0
0
0
0
0
0
0
0
0
0.037037
0.150943
159
9
75
17.666667
0.725926
0.63522
0
0
0
0
0
0
0
0
0
0
0
0
null
null
0
0.666667
null
null
0.333333
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
0
0
4
afd383f3cf610c3ef467ffcc60656e9e557aba06
679
py
Python
app/models.py
stefanbro/flask-todo
a0494d71bc7d89d8f3b6b1afdce29d52f1196ca9
[ "MIT" ]
null
null
null
app/models.py
stefanbro/flask-todo
a0494d71bc7d89d8f3b6b1afdce29d52f1196ca9
[ "MIT" ]
null
null
null
app/models.py
stefanbro/flask-todo
a0494d71bc7d89d8f3b6b1afdce29d52f1196ca9
[ "MIT" ]
null
null
null
from app import db class User(db.Model): id = db.Column(db.Integer, primary_key=True) username = db.Column(db.String(64), index=True, unique=True) email = db.Column(db.String(64), index=True, unique=True) password = db.Column(db.String(64), index=True) todos = db.relationship('Todo', backref='author', lazy='dynamic') def __repr__(self): return '<User %r>' % (self.username) class Todo(db.Model): id = db.Column(db.Integer, primary_key=True) body = db.Column(db.String(100)) is_done = db.Column(db.Integer, default=0) timestamp = db.Column(db.DateTime) user_id = db.Column(db.Integer, db.ForeignKey('user.id')) def __repr__(self): return '%r' % (self.body)
30.863636
66
0.701031
108
679
4.296296
0.37963
0.155172
0.193966
0.146552
0.431034
0.390086
0.390086
0.331897
0.331897
0.172414
0
0.016779
0.122239
679
21
67
32.333333
0.761745
0
0
0.235294
0
0
0.051546
0
0
0
0
0
0
1
0.117647
false
0.058824
0.058824
0.117647
1
0
0
0
0
null
0
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
0
1
0
1
1
0
0
4
bbace063dd40239d556aca8e135b0c0b9a37278d
281
py
Python
pycewise/__init__.py
Ezibenroc/pycewise
7f7608eec7082deef4c12c52761f4aed4f408d6c
[ "MIT" ]
1
2020-05-16T05:10:35.000Z
2020-05-16T05:10:35.000Z
pycewise/__init__.py
Ezibenroc/pycewise
7f7608eec7082deef4c12c52761f4aed4f408d6c
[ "MIT" ]
null
null
null
pycewise/__init__.py
Ezibenroc/pycewise
7f7608eec7082deef4c12c52761f4aed4f408d6c
[ "MIT" ]
1
2019-02-14T07:32:43.000Z
2019-02-14T07:32:43.000Z
from .reg import Node, Leaf, IncrementalStat, Config, FlatRegression, compute_regression from .version import __version__, __git_version__ __all__ = ['Node', 'Leaf', 'IncrementalStat', 'FlatRegression', 'Config', 'compute_regression', '__version__', '__git_version__']
46.833333
88
0.75089
27
281
6.925926
0.481481
0.085562
0.245989
0
0
0
0
0
0
0
0
0
0.128114
281
5
89
56.2
0.763265
0
0
0
0
0
0.309609
0
0
0
0
0
0
1
0
false
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
0
0
1
0
0
0
0
4
bbb3f50d4adca9081e7d33b232bc5d8197b94e39
88
py
Python
namespace/__init__.py
tombulled/namespace
5e3bb2563a77a2e3cf0c15a7cb9088ff96d19266
[ "MIT" ]
null
null
null
namespace/__init__.py
tombulled/namespace
5e3bb2563a77a2e3cf0c15a7cb9088ff96d19266
[ "MIT" ]
2
2022-01-16T22:40:08.000Z
2022-03-13T20:04:26.000Z
namespace/__init__.py
tombulled/namespace
5e3bb2563a77a2e3cf0c15a7cb9088ff96d19266
[ "MIT" ]
null
null
null
from .types import Namespace import modcall modcall(__name__, Namespace) del modcall
11
28
0.806818
11
88
6.090909
0.636364
0
0
0
0
0
0
0
0
0
0
0
0.147727
88
7
29
12.571429
0.893333
0
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
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
4
bbc33738c20f3393302730b5bff283f962a92988
187
py
Python
tardis/__init__.py
rosmesquit/tardis
8d619d8be1a38a0965a4d9a06238dbacb0f206fa
[ "MIT" ]
3
2016-05-06T07:33:01.000Z
2016-07-21T04:58:44.000Z
tardis/__init__.py
rosmesquit/tardis
8d619d8be1a38a0965a4d9a06238dbacb0f206fa
[ "MIT" ]
8
2015-06-09T15:29:48.000Z
2021-06-02T19:46:35.000Z
tardis/__init__.py
rosmesquit/tardis
8d619d8be1a38a0965a4d9a06238dbacb0f206fa
[ "MIT" ]
3
2015-06-09T13:56:15.000Z
2021-06-01T18:11:54.000Z
from . import coords, slices, utils from .tardis import OceanModelCube, load_phenomena __all__ = ["OceanModelCube", "load_phenomena", "coords", "slices", "utils"] __version__ = "0.3.1"
26.714286
75
0.73262
22
187
5.772727
0.636364
0.188976
0.267717
0
0
0
0
0
0
0
0
0.018293
0.122995
187
6
76
31.166667
0.756098
0
0
0
0
0
0.26738
0
0
0
0
0
0
1
0
false
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
0
0
1
0
0
0
0
4
bbcd71cbc1200cc762b9f57adcf16dbb7ff0c0c7
309
py
Python
Chatbot_Model/Retrieval/sematic_retrieval/query.py
guci314/Chatbot_CN
02044eed4a141aa8c61d6064c166f95dbdae894c
[ "Apache-2.0" ]
8
2019-08-12T12:38:35.000Z
2022-02-21T03:25:04.000Z
Chatbot_Model/Retrieval/sematic_retrieval/query.py
JianboTang/Chatbot_CN
a0f7194252a189f8bc2b62fd16eb2abe432c0bf9
[ "Apache-2.0" ]
null
null
null
Chatbot_Model/Retrieval/sematic_retrieval/query.py
JianboTang/Chatbot_CN
a0f7194252a189f8bc2b62fd16eb2abe432c0bf9
[ "Apache-2.0" ]
5
2020-01-08T15:30:38.000Z
2022-02-15T02:39:46.000Z
# -*- coding: utf-8 -*- """ ------------------------------------------------- File Name: query.py Description : Author : charl date: 2018/11/6 ------------------------------------------------- Change Activity: 2018/11/6: ------------------------------------------------- """
25.75
49
0.255663
19
309
4.157895
0.842105
0.151899
0.177215
0
0
0
0
0
0
0
0
0.059524
0.184466
309
12
50
25.75
0.253968
0.967638
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
4
bbdb42246382ff569a50c1b8ca81f379cb36f51b
1,038
py
Python
alpha/migrations/0001_initial.py
bebutler1/SoloQ-DTC-Website-writtten-with-Django-
3a74f37de9ea788efeb449b388e4aeca2f696a85
[ "MIT" ]
null
null
null
alpha/migrations/0001_initial.py
bebutler1/SoloQ-DTC-Website-writtten-with-Django-
3a74f37de9ea788efeb449b388e4aeca2f696a85
[ "MIT" ]
null
null
null
alpha/migrations/0001_initial.py
bebutler1/SoloQ-DTC-Website-writtten-with-Django-
3a74f37de9ea788efeb449b388e4aeca2f696a85
[ "MIT" ]
null
null
null
# Generated by Django 2.1.4 on 2018-12-19 04:53 from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='DataForm', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('your_name', models.CharField(max_length=30)), ('role', models.CharField(max_length=7)), ('teammate_1', models.CharField(max_length=30)), ('teammate_2', models.CharField(max_length=30)), ('teammate_3', models.CharField(max_length=30)), ('teammate_4', models.CharField(max_length=30)), ('outcome', models.CharField(max_length=4)), ('mute', models.CharField(max_length=3)), ('attitude_Score', models.IntegerField()), ('comments', models.TextField()), ], ), ]
33.483871
114
0.55973
105
1,038
5.371429
0.495238
0.212766
0.255319
0.340426
0.27305
0.180851
0
0
0
0
0
0.043956
0.298651
1,038
30
115
34.6
0.730769
0.043353
0
0
1
0
0.09889
0
0
0
0
0
0
1
0
false
0
0.043478
0
0.217391
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
1
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
a579a5cbecf83d771c747e446ca83fb01fc20c79
108
py
Python
api/app/__init__.py
liguifa/xunlu
0b65c1f69450f737e937f73167197be1d34059c1
[ "MIT" ]
null
null
null
api/app/__init__.py
liguifa/xunlu
0b65c1f69450f737e937f73167197be1d34059c1
[ "MIT" ]
null
null
null
api/app/__init__.py
liguifa/xunlu
0b65c1f69450f737e937f73167197be1d34059c1
[ "MIT" ]
null
null
null
from .base.application import application from .config import config from .base.controller import controller
36
41
0.851852
14
108
6.571429
0.428571
0.173913
0
0
0
0
0
0
0
0
0
0
0.101852
108
3
42
36
0.948454
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
0
0
0
4
3c20745ca49504594824fe0c6c1a931e6201acaa
89
py
Python
hooked/signals.py
gadventures/django-gapi-hooked
7da9fd580bfb17a8bd99048476a7ff00dc0df2eb
[ "MIT" ]
1
2017-04-25T10:07:29.000Z
2017-04-25T10:07:29.000Z
hooked/signals.py
gadventures/django-gapi-hooked
7da9fd580bfb17a8bd99048476a7ff00dc0df2eb
[ "MIT" ]
13
2016-03-17T20:34:41.000Z
2019-05-23T13:56:20.000Z
hooked/signals.py
gadventures/django-gapi-hooked
7da9fd580bfb17a8bd99048476a7ff00dc0df2eb
[ "MIT" ]
null
null
null
import django.dispatch webhook_event = django.dispatch.Signal(providing_args=["event"])
22.25
64
0.808989
11
89
6.363636
0.727273
0.4
0
0
0
0
0
0
0
0
0
0
0.067416
89
3
65
29.666667
0.843373
0
0
0
0
0
0.05618
0
0
0
0
0
0
1
0
false
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
0
0
1
0
0
0
0
4
3c3d172b38dc9e902a1a05288720b8911b5f4ff3
154
py
Python
gpssi/misc.py
alainjungo/gpssi
a9df08ab91a8daf5e66747bcaa8305453ec031b8
[ "Apache-2.0" ]
null
null
null
gpssi/misc.py
alainjungo/gpssi
a9df08ab91a8daf5e66747bcaa8305453ec031b8
[ "Apache-2.0" ]
null
null
null
gpssi/misc.py
alainjungo/gpssi
a9df08ab91a8daf5e66747bcaa8305453ec031b8
[ "Apache-2.0" ]
1
2021-11-27T13:27:55.000Z
2021-11-27T13:27:55.000Z
import numpy as np def kron_mats_to_full(kron_mats): full = 1 for kron_mat in kron_mats: full = np.kron(full, kron_mat) return full
17.111111
38
0.668831
27
154
3.555556
0.518519
0.25
0.25
0
0
0
0
0
0
0
0
0.00885
0.266234
154
8
39
19.25
0.840708
0
0
0
0
0
0
0
0
0
0
0
0
1
0.166667
false
0
0.166667
0
0.5
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
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
3c5c03508939befc3d9e301a86794d5bc5cbc80f
38
py
Python
correct/train.py
gajanlee/NLP-kits
b57b767b0aaaed292fa3a06a53b44c6bcf99ac95
[ "MIT" ]
null
null
null
correct/train.py
gajanlee/NLP-kits
b57b767b0aaaed292fa3a06a53b44c6bcf99ac95
[ "MIT" ]
null
null
null
correct/train.py
gajanlee/NLP-kits
b57b767b0aaaed292fa3a06a53b44c6bcf99ac95
[ "MIT" ]
null
null
null
from bi_crf import model m = model()
9.5
24
0.710526
7
38
3.714286
0.857143
0
0
0
0
0
0
0
0
0
0
0
0.210526
38
3
25
12.666667
0.866667
0
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0.5
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
0
0
1
0
0
0
0
4
3c9daab8b069a581a7f79d5be08f271e031abcab
108
py
Python
tests/django_project/languages/apps.py
2degrees/drf-nested-resources
0ae44453a6377a66dcc5e5e26d7ea91fa703527a
[ "BSD-3-Clause" ]
5
2016-09-07T06:44:50.000Z
2021-03-24T01:03:36.000Z
tests/django_project/languages/apps.py
2degrees/drf-nested-resources
0ae44453a6377a66dcc5e5e26d7ea91fa703527a
[ "BSD-3-Clause" ]
1
2020-02-27T07:07:26.000Z
2020-02-27T07:07:26.000Z
tests/django_project/languages/apps.py
2degrees/drf-nested-resources
0ae44453a6377a66dcc5e5e26d7ea91fa703527a
[ "BSD-3-Clause" ]
2
2015-06-06T21:39:14.000Z
2015-09-29T17:49:00.000Z
from django.apps import AppConfig class LanguagesConfig(AppConfig): name = 'django_project.languages'
18
37
0.787037
12
108
7
0.833333
0
0
0
0
0
0
0
0
0
0
0
0.138889
108
5
38
21.6
0.903226
0
0
0
0
0
0.222222
0.222222
0
0
0
0
0
1
0
false
0
0.333333
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
0
0
1
0
1
0
0
4