prompt
large_stringlengths
72
9.34k
completion
large_stringlengths
0
7.61k
<|file_name|>mainapp.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from flask import Flask, jsonify, request, abort, make_response from futu_server_api import * from db import save_update_token from db import delete_tokens from db import list_cards import logging import logging.config import json app = Flask...
request.jso
<|file_name|>mainapp.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from flask import Flask, jsonify, request, abort, make_response from futu_server_api import * from db import save_update_token from db import delete_tokens from db import list_cards import logging import logging.config import json app = Flask...
ameters(requ
<|file_name|>mainapp.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from flask import Flask, jsonify, request, abort, make_response from futu_server_api import * from db import save_update_token from db import delete_tokens from db import list_cards import logging import logging.config import json app = Flask...
on['appid'
<|file_name|>mainapp.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from flask import Flask, jsonify, request, abort, make_response from futu_server_api import * from db import save_update_token from db import delete_tokens from db import list_cards import logging import logging.config import json app = Flask...
unt'] DB_re
<|file_name|>mainapp.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from flask import Flask, jsonify, request, abort, make_response from futu_server_api import * from db import save_update_token from db import delete_tokens from db import list_cards import logging import logging.config import json app = Flask...
s = list_
<|file_name|>1_name_phone_number.py<|end_file_name|><|fim▁begin|>student_phoneNumber_name = {1: 'a', 3: 'c', 2: 'b'} def Handler() : while (1) : choice = eval(input("Enter :\t 1 - to search student name \n \t 2 - to insert new student record \n \t 0 - to quit\n")) print(choice) if (choice == 1) : if (student...
<|file_name|>1_name_phone_number.py<|end_file_name|><|fim▁begin|> student_phoneNumber_name = {1: 'a', 3: 'c', 2: 'b'} def Handler() : <|fim_middle|> def InsertRecord(x, y): student_phoneNumber_name[x] = y return; def SearchRecord(x): print(x) if (x in student_phoneNumber_name) : return student_phoneNumbe...
while (1) : choice = eval(input("Enter :\t 1 - to search student name \n \t 2 - to insert new student record \n \t 0 - to quit\n")) print(choice) if (choice == 1) : if (student_phoneNumber_name) : phone_number = input("Enter student's phone number : ") name = SearchRecord(phone_number) if (name) :...
<|file_name|>1_name_phone_number.py<|end_file_name|><|fim▁begin|> student_phoneNumber_name = {1: 'a', 3: 'c', 2: 'b'} def Handler() : while (1) : choice = eval(input("Enter :\t 1 - to search student name \n \t 2 - to insert new student record \n \t 0 - to quit\n")) print(choice) if (choice == 1) : if (studen...
student_phoneNumber_name[x] = y return;
<|file_name|>1_name_phone_number.py<|end_file_name|><|fim▁begin|> student_phoneNumber_name = {1: 'a', 3: 'c', 2: 'b'} def Handler() : while (1) : choice = eval(input("Enter :\t 1 - to search student name \n \t 2 - to insert new student record \n \t 0 - to quit\n")) print(choice) if (choice == 1) : if (studen...
print(x) if (x in student_phoneNumber_name) : return student_phoneNumber_name[x] return False
<|file_name|>1_name_phone_number.py<|end_file_name|><|fim▁begin|> student_phoneNumber_name = {1: 'a', 3: 'c', 2: 'b'} def Handler() : while (1) : choice = eval(input("Enter :\t 1 - to search student name \n \t 2 - to insert new student record \n \t 0 - to quit\n")) print(choice) if (choice == 1) : <|fim_m...
if (student_phoneNumber_name) : phone_number = input("Enter student's phone number : ") name = SearchRecord(phone_number) if (name) : print("name : " + name ) else : print(str(phone_number) + "Does not exist in record" + str(name)) else : print("Record is empty ")
<|file_name|>1_name_phone_number.py<|end_file_name|><|fim▁begin|> student_phoneNumber_name = {1: 'a', 3: 'c', 2: 'b'} def Handler() : while (1) : choice = eval(input("Enter :\t 1 - to search student name \n \t 2 - to insert new student record \n \t 0 - to quit\n")) print(choice) if (choice == 1) : if (studen...
phone_number = input("Enter student's phone number : ") name = SearchRecord(phone_number) if (name) : print("name : " + name ) else : print(str(phone_number) + "Does not exist in record" + str(name))
<|file_name|>1_name_phone_number.py<|end_file_name|><|fim▁begin|> student_phoneNumber_name = {1: 'a', 3: 'c', 2: 'b'} def Handler() : while (1) : choice = eval(input("Enter :\t 1 - to search student name \n \t 2 - to insert new student record \n \t 0 - to quit\n")) print(choice) if (choice == 1) : if (studen...
print("name : " + name )
<|file_name|>1_name_phone_number.py<|end_file_name|><|fim▁begin|> student_phoneNumber_name = {1: 'a', 3: 'c', 2: 'b'} def Handler() : while (1) : choice = eval(input("Enter :\t 1 - to search student name \n \t 2 - to insert new student record \n \t 0 - to quit\n")) print(choice) if (choice == 1) : if (studen...
print(str(phone_number) + "Does not exist in record" + str(name))
<|file_name|>1_name_phone_number.py<|end_file_name|><|fim▁begin|> student_phoneNumber_name = {1: 'a', 3: 'c', 2: 'b'} def Handler() : while (1) : choice = eval(input("Enter :\t 1 - to search student name \n \t 2 - to insert new student record \n \t 0 - to quit\n")) print(choice) if (choice == 1) : if (studen...
print("Record is empty ")
<|file_name|>1_name_phone_number.py<|end_file_name|><|fim▁begin|> student_phoneNumber_name = {1: 'a', 3: 'c', 2: 'b'} def Handler() : while (1) : choice = eval(input("Enter :\t 1 - to search student name \n \t 2 - to insert new student record \n \t 0 - to quit\n")) print(choice) if (choice == 1) : if (studen...
phone_number = input("Enter student's phone number : ") name = input("Enter student's name : ") #best example to understand input() and raw_input() InsertRecord(phone_number, name)
<|file_name|>1_name_phone_number.py<|end_file_name|><|fim▁begin|> student_phoneNumber_name = {1: 'a', 3: 'c', 2: 'b'} def Handler() : while (1) : choice = eval(input("Enter :\t 1 - to search student name \n \t 2 - to insert new student record \n \t 0 - to quit\n")) print(choice) if (choice == 1) : if (studen...
break
<|file_name|>1_name_phone_number.py<|end_file_name|><|fim▁begin|> student_phoneNumber_name = {1: 'a', 3: 'c', 2: 'b'} def Handler() : while (1) : choice = eval(input("Enter :\t 1 - to search student name \n \t 2 - to insert new student record \n \t 0 - to quit\n")) print(choice) if (choice == 1) : if (studen...
print("Enter correct choice")
<|file_name|>1_name_phone_number.py<|end_file_name|><|fim▁begin|> student_phoneNumber_name = {1: 'a', 3: 'c', 2: 'b'} def Handler() : while (1) : choice = eval(input("Enter :\t 1 - to search student name \n \t 2 - to insert new student record \n \t 0 - to quit\n")) print(choice) if (choice == 1) : if (studen...
return student_phoneNumber_name[x]
<|file_name|>1_name_phone_number.py<|end_file_name|><|fim▁begin|> student_phoneNumber_name = {1: 'a', 3: 'c', 2: 'b'} def <|fim_middle|>() : while (1) : choice = eval(input("Enter :\t 1 - to search student name \n \t 2 - to insert new student record \n \t 0 - to quit\n")) print(choice) if (choice == 1) : if ...
Handler
<|file_name|>1_name_phone_number.py<|end_file_name|><|fim▁begin|> student_phoneNumber_name = {1: 'a', 3: 'c', 2: 'b'} def Handler() : while (1) : choice = eval(input("Enter :\t 1 - to search student name \n \t 2 - to insert new student record \n \t 0 - to quit\n")) print(choice) if (choice == 1) : if (studen...
InsertRecord
<|file_name|>1_name_phone_number.py<|end_file_name|><|fim▁begin|> student_phoneNumber_name = {1: 'a', 3: 'c', 2: 'b'} def Handler() : while (1) : choice = eval(input("Enter :\t 1 - to search student name \n \t 2 - to insert new student record \n \t 0 - to quit\n")) print(choice) if (choice == 1) : if (studen...
SearchRecord
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from .fetch import FetchParser from .json_ld import JsonLdParser from .lom import LomParser from .lrmi import LrmiParser from .nsdl_dc import NsdlDcParser __all__ = [<|fim▁hole|> 'LomParser', 'LrmiParser', 'NsdlDcParser', ]<|fim▁end|>
'FetchParser', 'JsonLdParser',
<|file_name|>admin.py<|end_file_name|><|fim▁begin|><|fim▁hole|>class AccountFilterAdmin(admin.ModelAdmin): list_display = ('location', 'include_users', 'exclude_users') ordering = ('location',) admin.site.register(AccountFilter, AccountFilterAdmin)<|fim▁end|>
from django.contrib import admin from panoptes.tracking.models import AccountFilter
<|file_name|>admin.py<|end_file_name|><|fim▁begin|> from django.contrib import admin from panoptes.tracking.models import AccountFilter class AccountFilterAdmin(admin.ModelAdmin): <|fim_middle|> admin.site.register(AccountFilter, AccountFilterAdmin) <|fim▁end|>
list_display = ('location', 'include_users', 'exclude_users') ordering = ('location',)
<|file_name|>test_api.py<|end_file_name|><|fim▁begin|>""" Tests for Blocks api.py """ from django.test.client import RequestFactory from course_blocks.tests.helpers import EnableTransformerRegistryMixin<|fim▁hole|>from xmodule.modulestore.tests.factories import SampleCourseFactory from ..api import get_blocks clas...
from student.tests.factories import UserFactory from xmodule.modulestore import ModuleStoreEnum from xmodule.modulestore.tests.django_utils import SharedModuleStoreTestCase
<|file_name|>test_api.py<|end_file_name|><|fim▁begin|>""" Tests for Blocks api.py """ from django.test.client import RequestFactory from course_blocks.tests.helpers import EnableTransformerRegistryMixin from student.tests.factories import UserFactory from xmodule.modulestore import ModuleStoreEnum from xmodule.module...
""" Tests for the get_blocks function """ @classmethod def setUpClass(cls): super(TestGetBlocks, cls).setUpClass() cls.course = SampleCourseFactory.create() # hide the html block cls.html_block = cls.store.get_item(cls.course.id.make_usage_key('html', 'html_x1a_1')) ...
<|file_name|>test_api.py<|end_file_name|><|fim▁begin|>""" Tests for Blocks api.py """ from django.test.client import RequestFactory from course_blocks.tests.helpers import EnableTransformerRegistryMixin from student.tests.factories import UserFactory from xmodule.modulestore import ModuleStoreEnum from xmodule.module...
super(TestGetBlocks, cls).setUpClass() cls.course = SampleCourseFactory.create() # hide the html block cls.html_block = cls.store.get_item(cls.course.id.make_usage_key('html', 'html_x1a_1')) cls.html_block.visible_to_staff_only = True cls.store.update_item(cls.html_block...
<|file_name|>test_api.py<|end_file_name|><|fim▁begin|>""" Tests for Blocks api.py """ from django.test.client import RequestFactory from course_blocks.tests.helpers import EnableTransformerRegistryMixin from student.tests.factories import UserFactory from xmodule.modulestore import ModuleStoreEnum from xmodule.module...
super(TestGetBlocks, self).setUp() self.user = UserFactory.create() self.request = RequestFactory().get("/dummy") self.request.user = self.user
<|file_name|>test_api.py<|end_file_name|><|fim▁begin|>""" Tests for Blocks api.py """ from django.test.client import RequestFactory from course_blocks.tests.helpers import EnableTransformerRegistryMixin from student.tests.factories import UserFactory from xmodule.modulestore import ModuleStoreEnum from xmodule.module...
blocks = get_blocks(self.request, self.course.location, self.user) self.assertEquals(blocks['root'], unicode(self.course.location)) # subtract for (1) the orphaned course About block and (2) the hidden Html block self.assertEquals(len(blocks['blocks']), len(self.store.get_items(self.cou...
<|file_name|>test_api.py<|end_file_name|><|fim▁begin|>""" Tests for Blocks api.py """ from django.test.client import RequestFactory from course_blocks.tests.helpers import EnableTransformerRegistryMixin from student.tests.factories import UserFactory from xmodule.modulestore import ModuleStoreEnum from xmodule.module...
blocks = get_blocks(self.request, self.course.location) self.assertIn(unicode(self.html_block.location), blocks['blocks'])
<|file_name|>test_api.py<|end_file_name|><|fim▁begin|>""" Tests for Blocks api.py """ from django.test.client import RequestFactory from course_blocks.tests.helpers import EnableTransformerRegistryMixin from student.tests.factories import UserFactory from xmodule.modulestore import ModuleStoreEnum from xmodule.module...
""" Tests the order of transformers: access checks are made before the api transformer is applied. """ blocks = get_blocks(self.request, self.course.location, self.user, nav_depth=5, requested_fields=['nav_depth']) vertical_block = self.store.get_item(self.course.id.make_...
<|file_name|>test_api.py<|end_file_name|><|fim▁begin|>""" Tests for Blocks api.py """ from django.test.client import RequestFactory from course_blocks.tests.helpers import EnableTransformerRegistryMixin from student.tests.factories import UserFactory from xmodule.modulestore import ModuleStoreEnum from xmodule.module...
setUpClass
<|file_name|>test_api.py<|end_file_name|><|fim▁begin|>""" Tests for Blocks api.py """ from django.test.client import RequestFactory from course_blocks.tests.helpers import EnableTransformerRegistryMixin from student.tests.factories import UserFactory from xmodule.modulestore import ModuleStoreEnum from xmodule.module...
setUp
<|file_name|>test_api.py<|end_file_name|><|fim▁begin|>""" Tests for Blocks api.py """ from django.test.client import RequestFactory from course_blocks.tests.helpers import EnableTransformerRegistryMixin from student.tests.factories import UserFactory from xmodule.modulestore import ModuleStoreEnum from xmodule.module...
test_basic
<|file_name|>test_api.py<|end_file_name|><|fim▁begin|>""" Tests for Blocks api.py """ from django.test.client import RequestFactory from course_blocks.tests.helpers import EnableTransformerRegistryMixin from student.tests.factories import UserFactory from xmodule.modulestore import ModuleStoreEnum from xmodule.module...
test_no_user
<|file_name|>test_api.py<|end_file_name|><|fim▁begin|>""" Tests for Blocks api.py """ from django.test.client import RequestFactory from course_blocks.tests.helpers import EnableTransformerRegistryMixin from student.tests.factories import UserFactory from xmodule.modulestore import ModuleStoreEnum from xmodule.module...
test_access_before_api_transformer_order
<|file_name|>about_scoring_project.py<|end_file_name|><|fim▁begin|><|fim▁hole|>#!/usr/bin/env python # -*- coding: utf-8 -*- from runner.koan import * # Greed is a dice game where you roll up to five dice to accumulate # points. The following "score" function will be used calculate the # score of a single roll of th...
<|file_name|>about_scoring_project.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- from runner.koan import * # Greed is a dice game where you roll up to five dice to accumulate # points. The following "score" function will be used calculate the # score of a single roll of the dice. # # ...
''' Calculate the scores for results of up to fice dice rolls ''' return sum((score_of_three(k) * (v//3) + score_of_one(k) * (v%3) for k, v in Counter(dice).items()))
<|file_name|>about_scoring_project.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- from runner.koan import * # Greed is a dice game where you roll up to five dice to accumulate # points. The following "score" function will be used calculate the # score of a single roll of the dice. # # ...
''' Calculate score for set of three ''' if num == 1: return 1000 else: return num*100
<|file_name|>about_scoring_project.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- from runner.koan import * # Greed is a dice game where you roll up to five dice to accumulate # points. The following "score" function will be used calculate the # score of a single roll of the dice. # # ...
''' Calculate score for a roll not in a set of three ''' if num == 1: return 100 elif num == 5: return 50 else: return 0
<|file_name|>about_scoring_project.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- from runner.koan import * # Greed is a dice game where you roll up to five dice to accumulate # points. The following "score" function will be used calculate the # score of a single roll of the dice. # # ...
def test_score_of_an_empty_list_is_zero(self): self.assertEqual(0, score([])) def test_score_of_a_single_roll_of_5_is_50(self): self.assertEqual(50, score([5])) def test_score_of_a_single_roll_of_1_is_100(self): self.assertEqual(100, score([1])) def test_score_of_multiple_1s_a...
<|file_name|>about_scoring_project.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- from runner.koan import * # Greed is a dice game where you roll up to five dice to accumulate # points. The following "score" function will be used calculate the # score of a single roll of the dice. # # ...
self.assertEqual(0, score([]))
<|file_name|>about_scoring_project.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- from runner.koan import * # Greed is a dice game where you roll up to five dice to accumulate # points. The following "score" function will be used calculate the # score of a single roll of the dice. # # ...
self.assertEqual(50, score([5]))
<|file_name|>about_scoring_project.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- from runner.koan import * # Greed is a dice game where you roll up to five dice to accumulate # points. The following "score" function will be used calculate the # score of a single roll of the dice. # # ...
self.assertEqual(100, score([1]))
<|file_name|>about_scoring_project.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- from runner.koan import * # Greed is a dice game where you roll up to five dice to accumulate # points. The following "score" function will be used calculate the # score of a single roll of the dice. # # ...
self.assertEqual(300, score([1,5,5,1]))
<|file_name|>about_scoring_project.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- from runner.koan import * # Greed is a dice game where you roll up to five dice to accumulate # points. The following "score" function will be used calculate the # score of a single roll of the dice. # # ...
self.assertEqual(0, score([2,3,4,6]))
<|file_name|>about_scoring_project.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- from runner.koan import * # Greed is a dice game where you roll up to five dice to accumulate # points. The following "score" function will be used calculate the # score of a single roll of the dice. # # ...
self.assertEqual(1000, score([1,1,1]))
<|file_name|>about_scoring_project.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- from runner.koan import * # Greed is a dice game where you roll up to five dice to accumulate # points. The following "score" function will be used calculate the # score of a single roll of the dice. # # ...
self.assertEqual(200, score([2,2,2])) self.assertEqual(300, score([3,3,3])) self.assertEqual(400, score([4,4,4])) self.assertEqual(500, score([5,5,5])) self.assertEqual(600, score([6,6,6]))
<|file_name|>about_scoring_project.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- from runner.koan import * # Greed is a dice game where you roll up to five dice to accumulate # points. The following "score" function will be used calculate the # score of a single roll of the dice. # # ...
self.assertEqual(250, score([2,5,2,2,3])) self.assertEqual(550, score([5,5,5,5])) self.assertEqual(1150, score([1,1,1,5,1]))
<|file_name|>about_scoring_project.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- from runner.koan import * # Greed is a dice game where you roll up to five dice to accumulate # points. The following "score" function will be used calculate the # score of a single roll of the dice. # # ...
self.assertEqual(300, score([1,2,2,2])) self.assertEqual(350, score([1,5,2,2,2]))
<|file_name|>about_scoring_project.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- from runner.koan import * # Greed is a dice game where you roll up to five dice to accumulate # points. The following "score" function will be used calculate the # score of a single roll of the dice. # # ...
return 1000
<|file_name|>about_scoring_project.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- from runner.koan import * # Greed is a dice game where you roll up to five dice to accumulate # points. The following "score" function will be used calculate the # score of a single roll of the dice. # # ...
return num*100
<|file_name|>about_scoring_project.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- from runner.koan import * # Greed is a dice game where you roll up to five dice to accumulate # points. The following "score" function will be used calculate the # score of a single roll of the dice. # # ...
return 100
<|file_name|>about_scoring_project.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- from runner.koan import * # Greed is a dice game where you roll up to five dice to accumulate # points. The following "score" function will be used calculate the # score of a single roll of the dice. # # ...
return 50
<|file_name|>about_scoring_project.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- from runner.koan import * # Greed is a dice game where you roll up to five dice to accumulate # points. The following "score" function will be used calculate the # score of a single roll of the dice. # # ...
return 0
<|file_name|>about_scoring_project.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- from runner.koan import * # Greed is a dice game where you roll up to five dice to accumulate # points. The following "score" function will be used calculate the # score of a single roll of the dice. # # ...
score
<|file_name|>about_scoring_project.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- from runner.koan import * # Greed is a dice game where you roll up to five dice to accumulate # points. The following "score" function will be used calculate the # score of a single roll of the dice. # # ...
score_of_three
<|file_name|>about_scoring_project.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- from runner.koan import * # Greed is a dice game where you roll up to five dice to accumulate # points. The following "score" function will be used calculate the # score of a single roll of the dice. # # ...
score_of_one
<|file_name|>about_scoring_project.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- from runner.koan import * # Greed is a dice game where you roll up to five dice to accumulate # points. The following "score" function will be used calculate the # score of a single roll of the dice. # # ...
test_score_of_an_empty_list_is_zero
<|file_name|>about_scoring_project.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- from runner.koan import * # Greed is a dice game where you roll up to five dice to accumulate # points. The following "score" function will be used calculate the # score of a single roll of the dice. # # ...
test_score_of_a_single_roll_of_5_is_50
<|file_name|>about_scoring_project.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- from runner.koan import * # Greed is a dice game where you roll up to five dice to accumulate # points. The following "score" function will be used calculate the # score of a single roll of the dice. # # ...
test_score_of_a_single_roll_of_1_is_100
<|file_name|>about_scoring_project.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- from runner.koan import * # Greed is a dice game where you roll up to five dice to accumulate # points. The following "score" function will be used calculate the # score of a single roll of the dice. # # ...
test_score_of_multiple_1s_and_5s_is_the_sum_of_individual_scores
<|file_name|>about_scoring_project.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- from runner.koan import * # Greed is a dice game where you roll up to five dice to accumulate # points. The following "score" function will be used calculate the # score of a single roll of the dice. # # ...
test_score_of_single_2s_3s_4s_and_6s_are_zero
<|file_name|>about_scoring_project.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- from runner.koan import * # Greed is a dice game where you roll up to five dice to accumulate # points. The following "score" function will be used calculate the # score of a single roll of the dice. # # ...
test_score_of_a_triple_1_is_1000
<|file_name|>about_scoring_project.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- from runner.koan import * # Greed is a dice game where you roll up to five dice to accumulate # points. The following "score" function will be used calculate the # score of a single roll of the dice. # # ...
test_score_of_other_triples_is_100x
<|file_name|>about_scoring_project.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- from runner.koan import * # Greed is a dice game where you roll up to five dice to accumulate # points. The following "score" function will be used calculate the # score of a single roll of the dice. # # ...
test_score_of_mixed_is_sum
<|file_name|>about_scoring_project.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- from runner.koan import * # Greed is a dice game where you roll up to five dice to accumulate # points. The following "score" function will be used calculate the # score of a single roll of the dice. # # ...
test_ones_not_left_out
<|file_name|>sdk.py<|end_file_name|><|fim▁begin|># -*- coding: UTF-8 -*- import hashlib import base64 import datetime import urllib2 import json class TemplateSMS: account_sid = '' account_token = '' app_id = '' server_ip = '' server_port = '' soft_version = '' timestamp = '' def set_...
self.timestamp = now_date.strftime("%Y%m%d%H%M%S") signature = self.account_sid + self.account_token + self.timestamp sig = hashlib.md5() sig.update(signature)
<|file_name|>sdk.py<|end_file_name|><|fim▁begin|># -*- coding: UTF-8 -*- import hashlib import base64 import datetime import urllib2 import json class TemplateSMS: <|fim_middle|> <|fim▁end|>
account_sid = '' account_token = '' app_id = '' server_ip = '' server_port = '' soft_version = '' timestamp = '' def set_account(self, account_sid, token): self.account_sid = account_sid self.account_token = token def __init__(self, ip, port, version): self....
<|file_name|>sdk.py<|end_file_name|><|fim▁begin|># -*- coding: UTF-8 -*- import hashlib import base64 import datetime import urllib2 import json class TemplateSMS: account_sid = '' account_token = '' app_id = '' server_ip = '' server_port = '' soft_version = '' timestamp = '' def set_...
self.account_sid = account_sid self.account_token = token
<|file_name|>sdk.py<|end_file_name|><|fim▁begin|># -*- coding: UTF-8 -*- import hashlib import base64 import datetime import urllib2 import json class TemplateSMS: account_sid = '' account_token = '' app_id = '' server_ip = '' server_port = '' soft_version = '' timestamp = '' def set_...
self.server_ip = ip self.server_port = port self.soft_version = version
<|file_name|>sdk.py<|end_file_name|><|fim▁begin|># -*- coding: UTF-8 -*- import hashlib import base64 import datetime import urllib2 import json class TemplateSMS: account_sid = '' account_token = '' app_id = '' server_ip = '' server_port = '' soft_version = '' timestamp = '' def set_...
self.app_id = app_id
<|file_name|>sdk.py<|end_file_name|><|fim▁begin|># -*- coding: UTF-8 -*- import hashlib import base64 import datetime import urllib2 import json class TemplateSMS: account_sid = '' account_token = '' app_id = '' server_ip = '' server_port = '' soft_version = '' timestamp = '' def set_...
now_date = datetime.datetime.now() self.timestamp = now_date.strftime("%Y%m%d%H%M%S") signature = self.account_sid + self.account_token + self.timestamp sig = hashlib.md5() sig.update(signature) sig = sig.hexdigest().upper() url = "https://" + self.server_ip + ":"...
<|file_name|>sdk.py<|end_file_name|><|fim▁begin|># -*- coding: UTF-8 -*- import hashlib import base64 import datetime import urllib2 import json class TemplateSMS: account_sid = '' account_token = '' app_id = '' server_ip = '' server_port = '' soft_version = '' timestamp = '' def set_...
now_date = datetime.datetime.now() self.timestamp = now_date.strftime("%Y%m%d%H%M%S") signature = self.account_sid + self.account_token + self.timestamp sig = hashlib.md5() sig.update(signature) sig = sig.hexdigest().upper() url = "https://" + self.server_ip + ":"...
<|file_name|>sdk.py<|end_file_name|><|fim▁begin|># -*- coding: UTF-8 -*- import hashlib import base64 import datetime import urllib2 import json class TemplateSMS: account_sid = '' account_token = '' app_id = '' server_ip = '' server_port = '' soft_version = '' timestamp = '' def <|fi...
set_account
<|file_name|>sdk.py<|end_file_name|><|fim▁begin|># -*- coding: UTF-8 -*- import hashlib import base64 import datetime import urllib2 import json class TemplateSMS: account_sid = '' account_token = '' app_id = '' server_ip = '' server_port = '' soft_version = '' timestamp = '' def set_...
__init__
<|file_name|>sdk.py<|end_file_name|><|fim▁begin|># -*- coding: UTF-8 -*- import hashlib import base64 import datetime import urllib2 import json class TemplateSMS: account_sid = '' account_token = '' app_id = '' server_ip = '' server_port = '' soft_version = '' timestamp = '' def set_...
set_app_id
<|file_name|>sdk.py<|end_file_name|><|fim▁begin|># -*- coding: UTF-8 -*- import hashlib import base64 import datetime import urllib2 import json class TemplateSMS: account_sid = '' account_token = '' app_id = '' server_ip = '' server_port = '' soft_version = '' timestamp = '' def set_...
send_template_sms
<|file_name|>sdk.py<|end_file_name|><|fim▁begin|># -*- coding: UTF-8 -*- import hashlib import base64 import datetime import urllib2 import json class TemplateSMS: account_sid = '' account_token = '' app_id = '' server_ip = '' server_port = '' soft_version = '' timestamp = '' def set_...
query_account_info
<|file_name|>p2p-feefilter.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 # Copyright (c) 2016 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # from test_framework.mininode import * from test_f...
def allInvsMatch(invsExpected, testnode): for x in range(60):
<|file_name|>p2p-feefilter.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 # Copyright (c) 2016 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # from test_framework.mininode import * from test_f...
return format(hash, '064x')
<|file_name|>p2p-feefilter.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 # Copyright (c) 2016 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # from test_framework.mininode import * from test_f...
for x in range(60): with mininode_lock: if (sorted(invsExpected) == sorted(testnode.txinvs)): return True; time.sleep(1) return False;
<|file_name|>p2p-feefilter.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 # Copyright (c) 2016 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # from test_framework.mininode import * from test_f...
def __init__(self): SingleNodeConnCB.__init__(self) self.txinvs = [] def on_inv(self, conn, message): for i in message.inv: if (i.type == 1): self.txinvs.append(hashToHex(i.hash)) def clear_invs(self): with mininode_lock: self.txinvs ...
<|file_name|>p2p-feefilter.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 # Copyright (c) 2016 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # from test_framework.mininode import * from test_f...
SingleNodeConnCB.__init__(self) self.txinvs = []
<|file_name|>p2p-feefilter.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 # Copyright (c) 2016 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # from test_framework.mininode import * from test_f...
for i in message.inv: if (i.type == 1): self.txinvs.append(hashToHex(i.hash))
<|file_name|>p2p-feefilter.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 # Copyright (c) 2016 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # from test_framework.mininode import * from test_f...
with mininode_lock: self.txinvs = []
<|file_name|>p2p-feefilter.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 # Copyright (c) 2016 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # from test_framework.mininode import * from test_f...
self.send_message(msg_feefilter(feerate)) self.sync_with_ping()
<|file_name|>p2p-feefilter.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 # Copyright (c) 2016 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # from test_framework.mininode import * from test_f...
def __init__(self): super().__init__() self.num_nodes = 2 self.setup_clean_chain = False def setup_network(self): # Node1 will be used to generate txs which should be relayed from Node0 # to our test node self.nodes = [] self.nodes.append(start_node(0, se...
<|file_name|>p2p-feefilter.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 # Copyright (c) 2016 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # from test_framework.mininode import * from test_f...
super().__init__() self.num_nodes = 2 self.setup_clean_chain = False
<|file_name|>p2p-feefilter.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 # Copyright (c) 2016 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # from test_framework.mininode import * from test_f...
self.nodes = [] self.nodes.append(start_node(0, self.options.tmpdir, ["-debug", "-logtimemicros"])) self.nodes.append(start_node(1, self.options.tmpdir, ["-debug", "-logtimemicros"])) connect_nodes(self.nodes[0], 1)
<|file_name|>p2p-feefilter.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 # Copyright (c) 2016 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # from test_framework.mininode import * from test_f...
node1 = self.nodes[1] node0 = self.nodes[0] # Get out of IBD node1.generate(1) sync_blocks(self.nodes) node0.generate(21) sync_blocks(self.nodes) # Setup the p2p connections and start up the network thread. test_node = TestNode() connectio...
<|file_name|>p2p-feefilter.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 # Copyright (c) 2016 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # from test_framework.mininode import * from test_f...
return True;
<|file_name|>p2p-feefilter.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 # Copyright (c) 2016 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # from test_framework.mininode import * from test_f...
self.txinvs.append(hashToHex(i.hash))
<|file_name|>p2p-feefilter.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 # Copyright (c) 2016 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # from test_framework.mininode import * from test_f...
FeeFilterTest().main()
<|file_name|>p2p-feefilter.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 # Copyright (c) 2016 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # from test_framework.mininode import * from test_f...
hashToHex
<|file_name|>p2p-feefilter.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 # Copyright (c) 2016 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # from test_framework.mininode import * from test_f...
allInvsMatch
<|file_name|>p2p-feefilter.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 # Copyright (c) 2016 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # from test_framework.mininode import * from test_f...
__init__
<|file_name|>p2p-feefilter.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 # Copyright (c) 2016 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # from test_framework.mininode import * from test_f...
on_inv
<|file_name|>p2p-feefilter.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 # Copyright (c) 2016 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # from test_framework.mininode import * from test_f...
clear_invs
<|file_name|>p2p-feefilter.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 # Copyright (c) 2016 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # from test_framework.mininode import * from test_f...
send_filter