commit
stringlengths
40
40
old_file
stringlengths
4
118
new_file
stringlengths
4
118
old_contents
stringlengths
0
2.94k
new_contents
stringlengths
1
4.43k
subject
stringlengths
15
444
message
stringlengths
16
3.45k
lang
stringclasses
1 value
license
stringclasses
13 values
repos
stringlengths
5
43.2k
prompt
stringlengths
17
4.58k
response
stringlengths
1
4.43k
prompt_tagged
stringlengths
58
4.62k
response_tagged
stringlengths
1
4.43k
text
stringlengths
132
7.29k
text_tagged
stringlengths
173
7.33k
39aa4000a0625e9589803c9a823733a63d68d8ef
corehq/apps/reports/management/commands/update_custom_recipient_type.py
corehq/apps/reports/management/commands/update_custom_recipient_type.py
from django.core.management import BaseCommand from corehq.messaging.scheduling.scheduling_partitioned.models import ( CaseTimedScheduleInstance, TimedScheduleInstance, CaseAlertScheduleInstance, AlertScheduleInstance, ) from corehq.sql_db.util import get_db_aliases_for_partitioned_query from corehq.app...
Add management command to update custom recipient type
Add management command to update custom recipient type
Python
bsd-3-clause
dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq
Add management command to update custom recipient type
from django.core.management import BaseCommand from corehq.messaging.scheduling.scheduling_partitioned.models import ( CaseTimedScheduleInstance, TimedScheduleInstance, CaseAlertScheduleInstance, AlertScheduleInstance, ) from corehq.sql_db.util import get_db_aliases_for_partitioned_query from corehq.app...
<commit_before><commit_msg>Add management command to update custom recipient type<commit_after>
from django.core.management import BaseCommand from corehq.messaging.scheduling.scheduling_partitioned.models import ( CaseTimedScheduleInstance, TimedScheduleInstance, CaseAlertScheduleInstance, AlertScheduleInstance, ) from corehq.sql_db.util import get_db_aliases_for_partitioned_query from corehq.app...
Add management command to update custom recipient typefrom django.core.management import BaseCommand from corehq.messaging.scheduling.scheduling_partitioned.models import ( CaseTimedScheduleInstance, TimedScheduleInstance, CaseAlertScheduleInstance, AlertScheduleInstance, ) from corehq.sql_db.util impor...
<commit_before><commit_msg>Add management command to update custom recipient type<commit_after>from django.core.management import BaseCommand from corehq.messaging.scheduling.scheduling_partitioned.models import ( CaseTimedScheduleInstance, TimedScheduleInstance, CaseAlertScheduleInstance, AlertSchedule...
dfd7ee9d60c1ea0b2ecd5b09eb9a5468f6045852
gen_training_data_1.py
gen_training_data_1.py
import sys import os import json import numpy as np MAX_ACTIONS = 20 PLAYER_RANGE = (4, 7) def init_vec(num_players): input_vec = [0]*8 input_vec[num_players - PLAYER_RANGE[0]] = 1 return input_vec def gen_training_data(hand): num_players = hand['num_players'] if PLAYER_RANGE[0] <= num_players <=...
Add first training data generator.
Add first training data generator.
Python
apache-2.0
session-id/poker-predictor
Add first training data generator.
import sys import os import json import numpy as np MAX_ACTIONS = 20 PLAYER_RANGE = (4, 7) def init_vec(num_players): input_vec = [0]*8 input_vec[num_players - PLAYER_RANGE[0]] = 1 return input_vec def gen_training_data(hand): num_players = hand['num_players'] if PLAYER_RANGE[0] <= num_players <=...
<commit_before><commit_msg>Add first training data generator.<commit_after>
import sys import os import json import numpy as np MAX_ACTIONS = 20 PLAYER_RANGE = (4, 7) def init_vec(num_players): input_vec = [0]*8 input_vec[num_players - PLAYER_RANGE[0]] = 1 return input_vec def gen_training_data(hand): num_players = hand['num_players'] if PLAYER_RANGE[0] <= num_players <=...
Add first training data generator.import sys import os import json import numpy as np MAX_ACTIONS = 20 PLAYER_RANGE = (4, 7) def init_vec(num_players): input_vec = [0]*8 input_vec[num_players - PLAYER_RANGE[0]] = 1 return input_vec def gen_training_data(hand): num_players = hand['num_players'] if...
<commit_before><commit_msg>Add first training data generator.<commit_after>import sys import os import json import numpy as np MAX_ACTIONS = 20 PLAYER_RANGE = (4, 7) def init_vec(num_players): input_vec = [0]*8 input_vec[num_players - PLAYER_RANGE[0]] = 1 return input_vec def gen_training_data(hand): ...
864ab5e404ecf87e226a8cdb74e65cc343a8b377
JoiningData/join2_mapper.py
JoiningData/join2_mapper.py
#!/usr/bin/env python import sys shows = [] for line in sys.stdin: line = line.strip() key_value = line.split(',') if key_value[1] == 'ABC': if key_value[1] not in shows: shows.append(key_value[0]) if key_value[1].isdigit() and (key_value[0] in shows): print('{0}\t{...
Add custom implementation from stack overflow.
Add custom implementation from stack overflow.
Python
mit
dimitardanailov/learn-hadoop
Add custom implementation from stack overflow.
#!/usr/bin/env python import sys shows = [] for line in sys.stdin: line = line.strip() key_value = line.split(',') if key_value[1] == 'ABC': if key_value[1] not in shows: shows.append(key_value[0]) if key_value[1].isdigit() and (key_value[0] in shows): print('{0}\t{...
<commit_before><commit_msg>Add custom implementation from stack overflow.<commit_after>
#!/usr/bin/env python import sys shows = [] for line in sys.stdin: line = line.strip() key_value = line.split(',') if key_value[1] == 'ABC': if key_value[1] not in shows: shows.append(key_value[0]) if key_value[1].isdigit() and (key_value[0] in shows): print('{0}\t{...
Add custom implementation from stack overflow.#!/usr/bin/env python import sys shows = [] for line in sys.stdin: line = line.strip() key_value = line.split(',') if key_value[1] == 'ABC': if key_value[1] not in shows: shows.append(key_value[0]) if key_value[1].isdigit() and ...
<commit_before><commit_msg>Add custom implementation from stack overflow.<commit_after>#!/usr/bin/env python import sys shows = [] for line in sys.stdin: line = line.strip() key_value = line.split(',') if key_value[1] == 'ABC': if key_value[1] not in shows: shows.append(key_valu...
bc721bb9e31c54a2eaab9ec84743f635f807abf8
benchexec/tools/libkluzzer.py
benchexec/tools/libkluzzer.py
""" BenchExec is a framework for reliable benchmarking. This file is part of BenchExec. Copyright (C) 2007-2019 Dirk Beyer All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at ...
Create Tool-info module for LibKluzzer
Create Tool-info module for LibKluzzer
Python
apache-2.0
dbeyer/benchexec,dbeyer/benchexec,ultimate-pa/benchexec,sosy-lab/benchexec,sosy-lab/benchexec,ultimate-pa/benchexec,sosy-lab/benchexec,ultimate-pa/benchexec,sosy-lab/benchexec,ultimate-pa/benchexec,sosy-lab/benchexec,dbeyer/benchexec,ultimate-pa/benchexec,ultimate-pa/benchexec,sosy-lab/benchexec,dbeyer/benchexec
Create Tool-info module for LibKluzzer
""" BenchExec is a framework for reliable benchmarking. This file is part of BenchExec. Copyright (C) 2007-2019 Dirk Beyer All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at ...
<commit_before><commit_msg>Create Tool-info module for LibKluzzer<commit_after>
""" BenchExec is a framework for reliable benchmarking. This file is part of BenchExec. Copyright (C) 2007-2019 Dirk Beyer All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at ...
Create Tool-info module for LibKluzzer""" BenchExec is a framework for reliable benchmarking. This file is part of BenchExec. Copyright (C) 2007-2019 Dirk Beyer All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You ma...
<commit_before><commit_msg>Create Tool-info module for LibKluzzer<commit_after>""" BenchExec is a framework for reliable benchmarking. This file is part of BenchExec. Copyright (C) 2007-2019 Dirk Beyer All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file exce...
caf1325a0ba81dba20492cd3013fb4f1f7f11b99
repeatable_fetcher.py
repeatable_fetcher.py
import asyncio import aiohttp def fetch_url(client, url): resp = yield from client.get(url) try: text = yield from resp.text() return text finally: yield from resp.release() def fetch(client, url, retries=5, timeout=30): for i in range(retries): ret = yield from async...
Add example for repeatable url fetcher implemented on top of streams
Add example for repeatable url fetcher implemented on top of streams
Python
apache-2.0
ifosch/europython2015,hguemar/europython2015,asvetlov/europython2015
Add example for repeatable url fetcher implemented on top of streams
import asyncio import aiohttp def fetch_url(client, url): resp = yield from client.get(url) try: text = yield from resp.text() return text finally: yield from resp.release() def fetch(client, url, retries=5, timeout=30): for i in range(retries): ret = yield from async...
<commit_before><commit_msg>Add example for repeatable url fetcher implemented on top of streams<commit_after>
import asyncio import aiohttp def fetch_url(client, url): resp = yield from client.get(url) try: text = yield from resp.text() return text finally: yield from resp.release() def fetch(client, url, retries=5, timeout=30): for i in range(retries): ret = yield from async...
Add example for repeatable url fetcher implemented on top of streamsimport asyncio import aiohttp def fetch_url(client, url): resp = yield from client.get(url) try: text = yield from resp.text() return text finally: yield from resp.release() def fetch(client, url, retries=5, time...
<commit_before><commit_msg>Add example for repeatable url fetcher implemented on top of streams<commit_after>import asyncio import aiohttp def fetch_url(client, url): resp = yield from client.get(url) try: text = yield from resp.text() return text finally: yield from resp.release()...
288e0b7b5847fde184769cb67dc5ef40f9de3c30
IoTPy/tests/shared_variables_test.py
IoTPy/tests/shared_variables_test.py
import sys import os sys.path.append(os.path.abspath("../helper_functions")) sys.path.append(os.path.abspath("../core")) sys.path.append(os.path.abspath("../agent_types")) from agent import Agent from stream import Stream, StreamArray from stream import _no_value, _multivalue from check_agent_parameter_types import * ...
Test of shared variables. Used in UNITY operations.
Test of shared variables. Used in UNITY operations.
Python
bsd-3-clause
AssembleSoftware/IoTPy
Test of shared variables. Used in UNITY operations.
import sys import os sys.path.append(os.path.abspath("../helper_functions")) sys.path.append(os.path.abspath("../core")) sys.path.append(os.path.abspath("../agent_types")) from agent import Agent from stream import Stream, StreamArray from stream import _no_value, _multivalue from check_agent_parameter_types import * ...
<commit_before><commit_msg>Test of shared variables. Used in UNITY operations.<commit_after>
import sys import os sys.path.append(os.path.abspath("../helper_functions")) sys.path.append(os.path.abspath("../core")) sys.path.append(os.path.abspath("../agent_types")) from agent import Agent from stream import Stream, StreamArray from stream import _no_value, _multivalue from check_agent_parameter_types import * ...
Test of shared variables. Used in UNITY operations.import sys import os sys.path.append(os.path.abspath("../helper_functions")) sys.path.append(os.path.abspath("../core")) sys.path.append(os.path.abspath("../agent_types")) from agent import Agent from stream import Stream, StreamArray from stream import _no_value, _mu...
<commit_before><commit_msg>Test of shared variables. Used in UNITY operations.<commit_after>import sys import os sys.path.append(os.path.abspath("../helper_functions")) sys.path.append(os.path.abspath("../core")) sys.path.append(os.path.abspath("../agent_types")) from agent import Agent from stream import Stream, Stre...
512ebb46c4f1bd851cc91afc67a2ce444fe077dd
tests/cupy_tests/cuda_tests/test_cusolver.py
tests/cupy_tests/cuda_tests/test_cusolver.py
import unittest from cupy import cuda class TestCusolver(unittest.TestCase): def test_cusolver_enabled(self): self.assertEqual(cuda.runtime.runtimeGetVersion() >= 8000, cuda.cusolver_enabled)
Add test for cuda.cusolver_enabled flag
Add test for cuda.cusolver_enabled flag
Python
mit
cupy/cupy,cupy/cupy,cupy/cupy,cupy/cupy
Add test for cuda.cusolver_enabled flag
import unittest from cupy import cuda class TestCusolver(unittest.TestCase): def test_cusolver_enabled(self): self.assertEqual(cuda.runtime.runtimeGetVersion() >= 8000, cuda.cusolver_enabled)
<commit_before><commit_msg>Add test for cuda.cusolver_enabled flag<commit_after>
import unittest from cupy import cuda class TestCusolver(unittest.TestCase): def test_cusolver_enabled(self): self.assertEqual(cuda.runtime.runtimeGetVersion() >= 8000, cuda.cusolver_enabled)
Add test for cuda.cusolver_enabled flagimport unittest from cupy import cuda class TestCusolver(unittest.TestCase): def test_cusolver_enabled(self): self.assertEqual(cuda.runtime.runtimeGetVersion() >= 8000, cuda.cusolver_enabled)
<commit_before><commit_msg>Add test for cuda.cusolver_enabled flag<commit_after>import unittest from cupy import cuda class TestCusolver(unittest.TestCase): def test_cusolver_enabled(self): self.assertEqual(cuda.runtime.runtimeGetVersion() >= 8000, cuda.cusolver_enabled...
51056fd6e51752b44ba6d10f70c40111db6f9e07
tests/mapper/test_parameterization.py
tests/mapper/test_parameterization.py
from tests.mapper import get_symbols, SOURCE_PAIR, SOURCE_FULL from thinglang.lexer.values.identifier import Identifier from thinglang.symbols.symbol import Symbol def test_simple_parameterization(): pair = get_symbols(SOURCE_PAIR)[Identifier('Pair')] pair_number = pair.parameterize({ Identifier('T')...
Add test for generic parametrization
Add test for generic parametrization
Python
mit
ytanay/thinglang,ytanay/thinglang,ytanay/thinglang,ytanay/thinglang
Add test for generic parametrization
from tests.mapper import get_symbols, SOURCE_PAIR, SOURCE_FULL from thinglang.lexer.values.identifier import Identifier from thinglang.symbols.symbol import Symbol def test_simple_parameterization(): pair = get_symbols(SOURCE_PAIR)[Identifier('Pair')] pair_number = pair.parameterize({ Identifier('T')...
<commit_before><commit_msg>Add test for generic parametrization<commit_after>
from tests.mapper import get_symbols, SOURCE_PAIR, SOURCE_FULL from thinglang.lexer.values.identifier import Identifier from thinglang.symbols.symbol import Symbol def test_simple_parameterization(): pair = get_symbols(SOURCE_PAIR)[Identifier('Pair')] pair_number = pair.parameterize({ Identifier('T')...
Add test for generic parametrizationfrom tests.mapper import get_symbols, SOURCE_PAIR, SOURCE_FULL from thinglang.lexer.values.identifier import Identifier from thinglang.symbols.symbol import Symbol def test_simple_parameterization(): pair = get_symbols(SOURCE_PAIR)[Identifier('Pair')] pair_number = pair.pa...
<commit_before><commit_msg>Add test for generic parametrization<commit_after>from tests.mapper import get_symbols, SOURCE_PAIR, SOURCE_FULL from thinglang.lexer.values.identifier import Identifier from thinglang.symbols.symbol import Symbol def test_simple_parameterization(): pair = get_symbols(SOURCE_PAIR)[Ident...
1e957f371f36c4a5b92ba7b53af6e99075c13096
alembic/versions/188c85878d36_add_webhook_column.py
alembic/versions/188c85878d36_add_webhook_column.py
"""add webhook column Revision ID: 188c85878d36 Revises: a9ecd1c767 Create Date: 2014-11-06 11:06:28.337421 """ # revision identifiers, used by Alembic. revision = '188c85878d36' down_revision = 'a9ecd1c767' from alembic import op import sqlalchemy as sa def upgrade(): op.add_column('app', sa.Column('webhook'...
Add webhook column to project.
Add webhook column to project.
Python
agpl-3.0
inteligencia-coletiva-lsd/pybossa,geotagx/pybossa,jean/pybossa,jean/pybossa,OpenNewsLabs/pybossa,geotagx/pybossa,PyBossa/pybossa,PyBossa/pybossa,OpenNewsLabs/pybossa,stefanhahmann/pybossa,stefanhahmann/pybossa,Scifabric/pybossa,Scifabric/pybossa,inteligencia-coletiva-lsd/pybossa
Add webhook column to project.
"""add webhook column Revision ID: 188c85878d36 Revises: a9ecd1c767 Create Date: 2014-11-06 11:06:28.337421 """ # revision identifiers, used by Alembic. revision = '188c85878d36' down_revision = 'a9ecd1c767' from alembic import op import sqlalchemy as sa def upgrade(): op.add_column('app', sa.Column('webhook'...
<commit_before><commit_msg>Add webhook column to project.<commit_after>
"""add webhook column Revision ID: 188c85878d36 Revises: a9ecd1c767 Create Date: 2014-11-06 11:06:28.337421 """ # revision identifiers, used by Alembic. revision = '188c85878d36' down_revision = 'a9ecd1c767' from alembic import op import sqlalchemy as sa def upgrade(): op.add_column('app', sa.Column('webhook'...
Add webhook column to project."""add webhook column Revision ID: 188c85878d36 Revises: a9ecd1c767 Create Date: 2014-11-06 11:06:28.337421 """ # revision identifiers, used by Alembic. revision = '188c85878d36' down_revision = 'a9ecd1c767' from alembic import op import sqlalchemy as sa def upgrade(): op.add_col...
<commit_before><commit_msg>Add webhook column to project.<commit_after>"""add webhook column Revision ID: 188c85878d36 Revises: a9ecd1c767 Create Date: 2014-11-06 11:06:28.337421 """ # revision identifiers, used by Alembic. revision = '188c85878d36' down_revision = 'a9ecd1c767' from alembic import op import sqlalch...
7358f2197f3faef3003ffa29188737616833ae42
project-euler/062.py
project-euler/062.py
# coding=utf-8 ''' Problem 62 30 January 2004 The cube, 41063625 (345^(3)), can be permuted to produce two other cubes: 56623104 (384^(3)) and 66430125 (405^(3)). In fact, 41063625 is the smallest cube which has exactly three permutations of its digits which are also cube. Find the smallest cube for which exactly fi...
Add solution for Problem 62.
Add solution for Problem 62.
Python
mit
robertdimarco/puzzles,robertdimarco/puzzles,robertdimarco/puzzles,robertdimarco/puzzles,robertdimarco/puzzles,robertdimarco/puzzles,robertdimarco/puzzles,robertdimarco/puzzles,robertdimarco/puzzles,robertdimarco/puzzles
Add solution for Problem 62.
# coding=utf-8 ''' Problem 62 30 January 2004 The cube, 41063625 (345^(3)), can be permuted to produce two other cubes: 56623104 (384^(3)) and 66430125 (405^(3)). In fact, 41063625 is the smallest cube which has exactly three permutations of its digits which are also cube. Find the smallest cube for which exactly fi...
<commit_before><commit_msg>Add solution for Problem 62.<commit_after>
# coding=utf-8 ''' Problem 62 30 January 2004 The cube, 41063625 (345^(3)), can be permuted to produce two other cubes: 56623104 (384^(3)) and 66430125 (405^(3)). In fact, 41063625 is the smallest cube which has exactly three permutations of its digits which are also cube. Find the smallest cube for which exactly fi...
Add solution for Problem 62.# coding=utf-8 ''' Problem 62 30 January 2004 The cube, 41063625 (345^(3)), can be permuted to produce two other cubes: 56623104 (384^(3)) and 66430125 (405^(3)). In fact, 41063625 is the smallest cube which has exactly three permutations of its digits which are also cube. Find the smalle...
<commit_before><commit_msg>Add solution for Problem 62.<commit_after># coding=utf-8 ''' Problem 62 30 January 2004 The cube, 41063625 (345^(3)), can be permuted to produce two other cubes: 56623104 (384^(3)) and 66430125 (405^(3)). In fact, 41063625 is the smallest cube which has exactly three permutations of its dig...
f6b0fbc208012610e7658c02318226d0085ed7a0
py/valid-square.py
py/valid-square.py
from operator import itemgetter class Solution(object): def validSquare(self, p1, p2, p3, p4): """ :type p1: List[int] :type p2: List[int] :type p3: List[int] :type p4: List[int] :rtype: bool """ mid = [sum(map(itemgetter(0), [p1, p2, p3, p4])), sum(ma...
Add py solution for 593. Valid Square
Add py solution for 593. Valid Square 593. Valid Square: https://leetcode.com/problems/valid-square/
Python
apache-2.0
ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode
Add py solution for 593. Valid Square 593. Valid Square: https://leetcode.com/problems/valid-square/
from operator import itemgetter class Solution(object): def validSquare(self, p1, p2, p3, p4): """ :type p1: List[int] :type p2: List[int] :type p3: List[int] :type p4: List[int] :rtype: bool """ mid = [sum(map(itemgetter(0), [p1, p2, p3, p4])), sum(ma...
<commit_before><commit_msg>Add py solution for 593. Valid Square 593. Valid Square: https://leetcode.com/problems/valid-square/<commit_after>
from operator import itemgetter class Solution(object): def validSquare(self, p1, p2, p3, p4): """ :type p1: List[int] :type p2: List[int] :type p3: List[int] :type p4: List[int] :rtype: bool """ mid = [sum(map(itemgetter(0), [p1, p2, p3, p4])), sum(ma...
Add py solution for 593. Valid Square 593. Valid Square: https://leetcode.com/problems/valid-square/from operator import itemgetter class Solution(object): def validSquare(self, p1, p2, p3, p4): """ :type p1: List[int] :type p2: List[int] :type p3: List[int] :type p4: List[i...
<commit_before><commit_msg>Add py solution for 593. Valid Square 593. Valid Square: https://leetcode.com/problems/valid-square/<commit_after>from operator import itemgetter class Solution(object): def validSquare(self, p1, p2, p3, p4): """ :type p1: List[int] :type p2: List[int] :ty...
02e58eb884046d04c988f3b8dde76e047d7c591f
python/example1.py
python/example1.py
# ATCA Rapid Response Service # Jamie.Stevens@csiro.au # example1.py # This example script shows how to make a schedule and request time for it from # the web service. # The modules we'll need. import atca_rapid_response_api as arrApi import cabb_scheduler as cabb # Example 1. # The situation is the same as in examp...
Add an example script to illustrate how to use the API library.
Add an example script to illustrate how to use the API library.
Python
mit
ste616/atca-rapid-response-api
Add an example script to illustrate how to use the API library.
# ATCA Rapid Response Service # Jamie.Stevens@csiro.au # example1.py # This example script shows how to make a schedule and request time for it from # the web service. # The modules we'll need. import atca_rapid_response_api as arrApi import cabb_scheduler as cabb # Example 1. # The situation is the same as in examp...
<commit_before><commit_msg>Add an example script to illustrate how to use the API library.<commit_after>
# ATCA Rapid Response Service # Jamie.Stevens@csiro.au # example1.py # This example script shows how to make a schedule and request time for it from # the web service. # The modules we'll need. import atca_rapid_response_api as arrApi import cabb_scheduler as cabb # Example 1. # The situation is the same as in examp...
Add an example script to illustrate how to use the API library.# ATCA Rapid Response Service # Jamie.Stevens@csiro.au # example1.py # This example script shows how to make a schedule and request time for it from # the web service. # The modules we'll need. import atca_rapid_response_api as arrApi import cabb_schedule...
<commit_before><commit_msg>Add an example script to illustrate how to use the API library.<commit_after># ATCA Rapid Response Service # Jamie.Stevens@csiro.au # example1.py # This example script shows how to make a schedule and request time for it from # the web service. # The modules we'll need. import atca_rapid_re...
45a68b285306ed3030cba1fdcc388c4ea1df3855
folia2text.py
folia2text.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """Script to extract text from a folia xml file. """ import os import argparse import codecs from lxml import etree from bs4 import BeautifulSoup from emotools.bs4_helpers import act, sentence, note def act2text(act_xml): """Extract text from act. Returns a string...
Add script to print all text in folia xml file
Add script to print all text in folia xml file Extract text in acts from folia xml files. Processes all folia xml files in the input directory and put output texts in the output directory.
Python
apache-2.0
NLeSC/embodied-emotions-scripts,NLeSC/embodied-emotions-scripts
Add script to print all text in folia xml file Extract text in acts from folia xml files. Processes all folia xml files in the input directory and put output texts in the output directory.
#!/usr/bin/env python # -*- coding: utf-8 -*- """Script to extract text from a folia xml file. """ import os import argparse import codecs from lxml import etree from bs4 import BeautifulSoup from emotools.bs4_helpers import act, sentence, note def act2text(act_xml): """Extract text from act. Returns a string...
<commit_before><commit_msg>Add script to print all text in folia xml file Extract text in acts from folia xml files. Processes all folia xml files in the input directory and put output texts in the output directory.<commit_after>
#!/usr/bin/env python # -*- coding: utf-8 -*- """Script to extract text from a folia xml file. """ import os import argparse import codecs from lxml import etree from bs4 import BeautifulSoup from emotools.bs4_helpers import act, sentence, note def act2text(act_xml): """Extract text from act. Returns a string...
Add script to print all text in folia xml file Extract text in acts from folia xml files. Processes all folia xml files in the input directory and put output texts in the output directory.#!/usr/bin/env python # -*- coding: utf-8 -*- """Script to extract text from a folia xml file. """ import os import argparse import...
<commit_before><commit_msg>Add script to print all text in folia xml file Extract text in acts from folia xml files. Processes all folia xml files in the input directory and put output texts in the output directory.<commit_after>#!/usr/bin/env python # -*- coding: utf-8 -*- """Script to extract text from a folia xml f...
fb5612d641296a022a869bd0a4b9a0aed9255e51
_pytest/test_formatting.py
_pytest/test_formatting.py
import pytest import wee_slack @pytest.mark.parametrize("text", [ """ * an item * another item """, "* Run this command: `find . -name '*.exe'`", ]) def test_does_not_format(text): assert wee_slack.render_formatting(text) == text
Add tests for no formatting cases
Add tests for no formatting cases
Python
mit
wee-slack/wee-slack,rawdigits/wee-slack,trygveaa/wee-slack
Add tests for no formatting cases
import pytest import wee_slack @pytest.mark.parametrize("text", [ """ * an item * another item """, "* Run this command: `find . -name '*.exe'`", ]) def test_does_not_format(text): assert wee_slack.render_formatting(text) == text
<commit_before><commit_msg>Add tests for no formatting cases<commit_after>
import pytest import wee_slack @pytest.mark.parametrize("text", [ """ * an item * another item """, "* Run this command: `find . -name '*.exe'`", ]) def test_does_not_format(text): assert wee_slack.render_formatting(text) == text
Add tests for no formatting casesimport pytest import wee_slack @pytest.mark.parametrize("text", [ """ * an item * another item """, "* Run this command: `find . -name '*.exe'`", ]) def test_does_not_format(text): assert wee_slack.render_formatting(text) == text
<commit_before><commit_msg>Add tests for no formatting cases<commit_after>import pytest import wee_slack @pytest.mark.parametrize("text", [ """ * an item * another item """, "* Run this command: `find . -name '*.exe'`", ]) def test_does_not_format(text): assert wee_slack.render_formatting(tex...
45a9c2b3b8e0033c6dca5b87d52f515d23a9356c
leetcode/077-Combinations/Combinations_002.py
leetcode/077-Combinations/Combinations_002.py
class Solution(object): def combine(self, n, k): """ :type n: int :type k: int :rtype: List[List[int]] """ if n < 1: return [] if k == 1: return [[i] for i in range(1, n + 1)] res = self.combine(n - 1, k) ...
Create Combination like 001 for Leetcode
Create Combination like 001 for Leetcode
Python
mit
Chasego/codirit,Chasego/codi,Chasego/cod,cc13ny/Allin,cc13ny/algo,Chasego/codirit,Chasego/codirit,Chasego/cod,Chasego/codi,Chasego/codirit,Chasego/cod,Chasego/codi,cc13ny/algo,Chasego/codi,cc13ny/Allin,Chasego/codirit,cc13ny/algo,cc13ny/Allin,cc13ny/Allin,cc13ny/algo,cc13ny/algo,cc13ny/Allin,Chasego/codi,Chasego/cod,Ch...
Create Combination like 001 for Leetcode
class Solution(object): def combine(self, n, k): """ :type n: int :type k: int :rtype: List[List[int]] """ if n < 1: return [] if k == 1: return [[i] for i in range(1, n + 1)] res = self.combine(n - 1, k) ...
<commit_before><commit_msg>Create Combination like 001 for Leetcode<commit_after>
class Solution(object): def combine(self, n, k): """ :type n: int :type k: int :rtype: List[List[int]] """ if n < 1: return [] if k == 1: return [[i] for i in range(1, n + 1)] res = self.combine(n - 1, k) ...
Create Combination like 001 for Leetcodeclass Solution(object): def combine(self, n, k): """ :type n: int :type k: int :rtype: List[List[int]] """ if n < 1: return [] if k == 1: return [[i] for i in range(1, n + 1)] ...
<commit_before><commit_msg>Create Combination like 001 for Leetcode<commit_after>class Solution(object): def combine(self, n, k): """ :type n: int :type k: int :rtype: List[List[int]] """ if n < 1: return [] if k == 1: return [...
e4994b15cd40ec8b70f0dee0b8311cd238a18e66
common/djangoapps/student/management/commands/anonymized_id_mapping.py
common/djangoapps/student/management/commands/anonymized_id_mapping.py
import csv import sys from django.contrib.auth.models import User from django.core.management.base import BaseCommand, CommandError from student.models import unique_id_for_user class Command(BaseCommand): # It appears that with the way Rake invokes these commands, we can't # have more than one arg passed th...
Add mgmt cmd to generate anonymized ID mapping
Add mgmt cmd to generate anonymized ID mapping So that instructors have easy access to the mapping from anonymized IDs (a simple MD5 hash of the user ID that's used when integrating with third-party services like Qualtrics) to user IDs, we have a simple Django management command to generate a CSV mapping. To run, use ...
Python
agpl-3.0
chand3040/cloud_that,jolyonb/edx-platform,BehavioralInsightsTeam/edx-platform,kxliugang/edx-platform,ZLLab-Mooc/edx-platform,bigdatauniversity/edx-platform,appsembler/edx-platform,shubhdev/openedx,TsinghuaX/edx-platform,shubhdev/openedx,ZLLab-Mooc/edx-platform,martynovp/edx-platform,ak2703/edx-platform,polimediaupv/edx...
Add mgmt cmd to generate anonymized ID mapping So that instructors have easy access to the mapping from anonymized IDs (a simple MD5 hash of the user ID that's used when integrating with third-party services like Qualtrics) to user IDs, we have a simple Django management command to generate a CSV mapping. To run, use ...
import csv import sys from django.contrib.auth.models import User from django.core.management.base import BaseCommand, CommandError from student.models import unique_id_for_user class Command(BaseCommand): # It appears that with the way Rake invokes these commands, we can't # have more than one arg passed th...
<commit_before><commit_msg>Add mgmt cmd to generate anonymized ID mapping So that instructors have easy access to the mapping from anonymized IDs (a simple MD5 hash of the user ID that's used when integrating with third-party services like Qualtrics) to user IDs, we have a simple Django management command to generate ...
import csv import sys from django.contrib.auth.models import User from django.core.management.base import BaseCommand, CommandError from student.models import unique_id_for_user class Command(BaseCommand): # It appears that with the way Rake invokes these commands, we can't # have more than one arg passed th...
Add mgmt cmd to generate anonymized ID mapping So that instructors have easy access to the mapping from anonymized IDs (a simple MD5 hash of the user ID that's used when integrating with third-party services like Qualtrics) to user IDs, we have a simple Django management command to generate a CSV mapping. To run, use ...
<commit_before><commit_msg>Add mgmt cmd to generate anonymized ID mapping So that instructors have easy access to the mapping from anonymized IDs (a simple MD5 hash of the user ID that's used when integrating with third-party services like Qualtrics) to user IDs, we have a simple Django management command to generate ...
8d193a6eb59028eb2c21203bc8543d34603f86bd
bamova/plot_sampled_phis.py
bamova/plot_sampled_phis.py
import sys import numpy as np from sklearn.neighbors.kde import KernelDensity import matplotlib from matplotlib import pyplot def estimate_distribution(matrix, locus, h=0.2, n_points=100): kde = KernelDensity(bandwidth=h) kde.fit(matrix[:, locus]) xs = np.linspace(-1.0, 1.0, n_points) ys = np.log(kde.score(xs)) ...
Add bamova phi plotting script
Add bamova phi plotting script
Python
apache-2.0
rnowling/pop-gen-models
Add bamova phi plotting script
import sys import numpy as np from sklearn.neighbors.kde import KernelDensity import matplotlib from matplotlib import pyplot def estimate_distribution(matrix, locus, h=0.2, n_points=100): kde = KernelDensity(bandwidth=h) kde.fit(matrix[:, locus]) xs = np.linspace(-1.0, 1.0, n_points) ys = np.log(kde.score(xs)) ...
<commit_before><commit_msg>Add bamova phi plotting script<commit_after>
import sys import numpy as np from sklearn.neighbors.kde import KernelDensity import matplotlib from matplotlib import pyplot def estimate_distribution(matrix, locus, h=0.2, n_points=100): kde = KernelDensity(bandwidth=h) kde.fit(matrix[:, locus]) xs = np.linspace(-1.0, 1.0, n_points) ys = np.log(kde.score(xs)) ...
Add bamova phi plotting scriptimport sys import numpy as np from sklearn.neighbors.kde import KernelDensity import matplotlib from matplotlib import pyplot def estimate_distribution(matrix, locus, h=0.2, n_points=100): kde = KernelDensity(bandwidth=h) kde.fit(matrix[:, locus]) xs = np.linspace(-1.0, 1.0, n_points)...
<commit_before><commit_msg>Add bamova phi plotting script<commit_after>import sys import numpy as np from sklearn.neighbors.kde import KernelDensity import matplotlib from matplotlib import pyplot def estimate_distribution(matrix, locus, h=0.2, n_points=100): kde = KernelDensity(bandwidth=h) kde.fit(matrix[:, locus...
6be818822d7bd6ecf87837f82187c8e84442d6ba
cnxarchive/sql/migrations/20160423022147_add_python_sql_debug_functions.py
cnxarchive/sql/migrations/20160423022147_add_python_sql_debug_functions.py
# -*- coding: utf-8 -*- """\ - Add SQL function `pypath` - Add SQL function `pyimport` """ def up(cursor): # Add SQL function `pypath` cursor.execute("""\ -- Returns the Python `sys.path` -- Example usage, `SELECT unnest(pypath())` CREATE OR REPLACE FUNCTION pypath() RETURNS TEXT[] AS $$ import sys retu...
Add migration for python debug SQL functions
:sparkles: Add migration for python debug SQL functions
Python
agpl-3.0
Connexions/cnx-archive,Connexions/cnx-archive
:sparkles: Add migration for python debug SQL functions
# -*- coding: utf-8 -*- """\ - Add SQL function `pypath` - Add SQL function `pyimport` """ def up(cursor): # Add SQL function `pypath` cursor.execute("""\ -- Returns the Python `sys.path` -- Example usage, `SELECT unnest(pypath())` CREATE OR REPLACE FUNCTION pypath() RETURNS TEXT[] AS $$ import sys retu...
<commit_before><commit_msg>:sparkles: Add migration for python debug SQL functions<commit_after>
# -*- coding: utf-8 -*- """\ - Add SQL function `pypath` - Add SQL function `pyimport` """ def up(cursor): # Add SQL function `pypath` cursor.execute("""\ -- Returns the Python `sys.path` -- Example usage, `SELECT unnest(pypath())` CREATE OR REPLACE FUNCTION pypath() RETURNS TEXT[] AS $$ import sys retu...
:sparkles: Add migration for python debug SQL functions# -*- coding: utf-8 -*- """\ - Add SQL function `pypath` - Add SQL function `pyimport` """ def up(cursor): # Add SQL function `pypath` cursor.execute("""\ -- Returns the Python `sys.path` -- Example usage, `SELECT unnest(pypath())` CREATE OR REPLACE FUN...
<commit_before><commit_msg>:sparkles: Add migration for python debug SQL functions<commit_after># -*- coding: utf-8 -*- """\ - Add SQL function `pypath` - Add SQL function `pyimport` """ def up(cursor): # Add SQL function `pypath` cursor.execute("""\ -- Returns the Python `sys.path` -- Example usage, `SELEC...
a81826e4667d4ec195a5524ae05f5b7f972e8ce0
parse_results.py
parse_results.py
#!/usr/bin/python # coding: utf-8 import fileinput import sys buffer_size = 0 threshold = 0 elapsed_time = 0.0 for line in fileinput.input(): l = line.split() if l: if l[0] == 'IMPORTANT:': if l[1] == 'Maximum': pass elif l[1] == 'Buffer': buffe...
Add script to parse the results
Add script to parse the results
Python
bsd-2-clause
mrjimenez/arduino_serial
Add script to parse the results
#!/usr/bin/python # coding: utf-8 import fileinput import sys buffer_size = 0 threshold = 0 elapsed_time = 0.0 for line in fileinput.input(): l = line.split() if l: if l[0] == 'IMPORTANT:': if l[1] == 'Maximum': pass elif l[1] == 'Buffer': buffe...
<commit_before><commit_msg>Add script to parse the results<commit_after>
#!/usr/bin/python # coding: utf-8 import fileinput import sys buffer_size = 0 threshold = 0 elapsed_time = 0.0 for line in fileinput.input(): l = line.split() if l: if l[0] == 'IMPORTANT:': if l[1] == 'Maximum': pass elif l[1] == 'Buffer': buffe...
Add script to parse the results#!/usr/bin/python # coding: utf-8 import fileinput import sys buffer_size = 0 threshold = 0 elapsed_time = 0.0 for line in fileinput.input(): l = line.split() if l: if l[0] == 'IMPORTANT:': if l[1] == 'Maximum': pass elif l[1] == ...
<commit_before><commit_msg>Add script to parse the results<commit_after>#!/usr/bin/python # coding: utf-8 import fileinput import sys buffer_size = 0 threshold = 0 elapsed_time = 0.0 for line in fileinput.input(): l = line.split() if l: if l[0] == 'IMPORTANT:': if l[1] == 'Maximum': ...
f72f48a0bc7ab92439e3af04538b8b46e6673d62
robot/robot/src/component/drive.py
robot/robot/src/component/drive.py
''' Driving component ''' class Drive(object): def __init__(self, robotDrive): self.robotDrive = robotDrive # # Verb functions # def move(self, x, y, z): self.x = x self.y = y self.z = z # # Actually does stuff # def doit(self): self.robotDrive.MecanumDrive_Cartesian(self.x, self.y, self.z)...
Add driving component as an example
Add driving component as an example
Python
bsd-3-clause
frc1418/2014
Add driving component as an example
''' Driving component ''' class Drive(object): def __init__(self, robotDrive): self.robotDrive = robotDrive # # Verb functions # def move(self, x, y, z): self.x = x self.y = y self.z = z # # Actually does stuff # def doit(self): self.robotDrive.MecanumDrive_Cartesian(self.x, self.y, self.z)...
<commit_before><commit_msg>Add driving component as an example<commit_after>
''' Driving component ''' class Drive(object): def __init__(self, robotDrive): self.robotDrive = robotDrive # # Verb functions # def move(self, x, y, z): self.x = x self.y = y self.z = z # # Actually does stuff # def doit(self): self.robotDrive.MecanumDrive_Cartesian(self.x, self.y, self.z)...
Add driving component as an example''' Driving component ''' class Drive(object): def __init__(self, robotDrive): self.robotDrive = robotDrive # # Verb functions # def move(self, x, y, z): self.x = x self.y = y self.z = z # # Actually does stuff # def doit(self): self.robotDrive.MecanumDriv...
<commit_before><commit_msg>Add driving component as an example<commit_after>''' Driving component ''' class Drive(object): def __init__(self, robotDrive): self.robotDrive = robotDrive # # Verb functions # def move(self, x, y, z): self.x = x self.y = y self.z = z # # Actually does stuff # def d...
08f6fb805938b89ede5cb69eed9929d32104278b
content/test/gpu/gpu_tests/webgl_robustness.py
content/test/gpu/gpu_tests/webgl_robustness.py
# Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from telemetry import test from telemetry.page import page_set from webgl_conformance import WebglConformanceValidator from webgl_conformance import conforman...
Add WebGL robustness telemetry test
gpu: Add WebGL robustness telemetry test This patch adds a telemetry-based WebGL robustness test. It executes an optional test from the WebGL conformance test suite to trigger a GPU context loss and verifies this doesn't crash the browser. To run the test for example on Android, execute: $ content/test/gpu/run_gpu_t...
Python
bsd-3-clause
anirudhSK/chromium,ChromiumWebApps/chromium,Fireblend/chromium-crosswalk,Jonekee/chromium.src,bright-sparks/chromium-spacewalk,M4sse/chromium.src,Fireblend/chromium-crosswalk,fujunwei/chromium-crosswalk,hgl888/chromium-crosswalk-efl,PeterWangIntel/chromium-crosswalk,fujunwei/chromium-crosswalk,patrickm/chromium.src,ond...
gpu: Add WebGL robustness telemetry test This patch adds a telemetry-based WebGL robustness test. It executes an optional test from the WebGL conformance test suite to trigger a GPU context loss and verifies this doesn't crash the browser. To run the test for example on Android, execute: $ content/test/gpu/run_gpu_t...
# Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from telemetry import test from telemetry.page import page_set from webgl_conformance import WebglConformanceValidator from webgl_conformance import conforman...
<commit_before><commit_msg>gpu: Add WebGL robustness telemetry test This patch adds a telemetry-based WebGL robustness test. It executes an optional test from the WebGL conformance test suite to trigger a GPU context loss and verifies this doesn't crash the browser. To run the test for example on Android, execute: $...
# Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from telemetry import test from telemetry.page import page_set from webgl_conformance import WebglConformanceValidator from webgl_conformance import conforman...
gpu: Add WebGL robustness telemetry test This patch adds a telemetry-based WebGL robustness test. It executes an optional test from the WebGL conformance test suite to trigger a GPU context loss and verifies this doesn't crash the browser. To run the test for example on Android, execute: $ content/test/gpu/run_gpu_t...
<commit_before><commit_msg>gpu: Add WebGL robustness telemetry test This patch adds a telemetry-based WebGL robustness test. It executes an optional test from the WebGL conformance test suite to trigger a GPU context loss and verifies this doesn't crash the browser. To run the test for example on Android, execute: $...
fc245d78542b9468174d0abb282a35272374a626
project/teams/migrations/0008_auto_20150907_1914.py
project/teams/migrations/0008_auto_20150907_1914.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import project.teams.models import django.core.validators class Migration(migrations.Migration): dependencies = [ ('teams', '0007_auto_20150907_1808'), ] operations = [ migrations.Al...
Add migration for modified RegexValidator
Add migration for modified RegexValidator
Python
mit
compsci-hfh/app,jonsimington/app,jonsimington/app,compsci-hfh/app
Add migration for modified RegexValidator
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import project.teams.models import django.core.validators class Migration(migrations.Migration): dependencies = [ ('teams', '0007_auto_20150907_1808'), ] operations = [ migrations.Al...
<commit_before><commit_msg>Add migration for modified RegexValidator<commit_after>
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import project.teams.models import django.core.validators class Migration(migrations.Migration): dependencies = [ ('teams', '0007_auto_20150907_1808'), ] operations = [ migrations.Al...
Add migration for modified RegexValidator# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import project.teams.models import django.core.validators class Migration(migrations.Migration): dependencies = [ ('teams', '0007_auto_20150907_1808'), ] ...
<commit_before><commit_msg>Add migration for modified RegexValidator<commit_after># -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import project.teams.models import django.core.validators class Migration(migrations.Migration): dependencies = [ ('t...
153d7c34d89ec4b9af525abebddad9fa83377594
server.py
server.py
import BaseHTTPServer import sys import time import json from irc_hooky.github.main import handler as gh_handler HOST_NAME = sys.argv[1] PORT_NUMBER = int(sys.argv[2]) def handle_github_hook(payload, headers): event = { "X-Hub-Signature": headers.get("X-Hub-Signature"), "X-Github-Event": headers...
Add the ability to do basic testing locally
Add the ability to do basic testing locally
Python
mit
marvinpinto/irc-hooky,marvinpinto/irc-hooky
Add the ability to do basic testing locally
import BaseHTTPServer import sys import time import json from irc_hooky.github.main import handler as gh_handler HOST_NAME = sys.argv[1] PORT_NUMBER = int(sys.argv[2]) def handle_github_hook(payload, headers): event = { "X-Hub-Signature": headers.get("X-Hub-Signature"), "X-Github-Event": headers...
<commit_before><commit_msg>Add the ability to do basic testing locally<commit_after>
import BaseHTTPServer import sys import time import json from irc_hooky.github.main import handler as gh_handler HOST_NAME = sys.argv[1] PORT_NUMBER = int(sys.argv[2]) def handle_github_hook(payload, headers): event = { "X-Hub-Signature": headers.get("X-Hub-Signature"), "X-Github-Event": headers...
Add the ability to do basic testing locallyimport BaseHTTPServer import sys import time import json from irc_hooky.github.main import handler as gh_handler HOST_NAME = sys.argv[1] PORT_NUMBER = int(sys.argv[2]) def handle_github_hook(payload, headers): event = { "X-Hub-Signature": headers.get("X-Hub-Sig...
<commit_before><commit_msg>Add the ability to do basic testing locally<commit_after>import BaseHTTPServer import sys import time import json from irc_hooky.github.main import handler as gh_handler HOST_NAME = sys.argv[1] PORT_NUMBER = int(sys.argv[2]) def handle_github_hook(payload, headers): event = { ...
d08b0a11176225302b01657e9d396066923ae7ce
polyfilter.py
polyfilter.py
#!/usr/bin/python # Polyfilter - filters polygon files for very small polygons import sys f = open(sys.argv[1]) def PolygonArea(corners): n = len(corners) # of corners area = 0.0 for i in range(n): j = (i + 1) % n area += corners[i][0] * corners[j][1] area -= corners[j][0] * corn...
Add filter program to remove small polygons
Add filter program to remove small polygons
Python
mit
jmacarthur/ld34,jmacarthur/ld34,jmacarthur/ld34
Add filter program to remove small polygons
#!/usr/bin/python # Polyfilter - filters polygon files for very small polygons import sys f = open(sys.argv[1]) def PolygonArea(corners): n = len(corners) # of corners area = 0.0 for i in range(n): j = (i + 1) % n area += corners[i][0] * corners[j][1] area -= corners[j][0] * corn...
<commit_before><commit_msg>Add filter program to remove small polygons<commit_after>
#!/usr/bin/python # Polyfilter - filters polygon files for very small polygons import sys f = open(sys.argv[1]) def PolygonArea(corners): n = len(corners) # of corners area = 0.0 for i in range(n): j = (i + 1) % n area += corners[i][0] * corners[j][1] area -= corners[j][0] * corn...
Add filter program to remove small polygons#!/usr/bin/python # Polyfilter - filters polygon files for very small polygons import sys f = open(sys.argv[1]) def PolygonArea(corners): n = len(corners) # of corners area = 0.0 for i in range(n): j = (i + 1) % n area += corners[i][0] * corners...
<commit_before><commit_msg>Add filter program to remove small polygons<commit_after>#!/usr/bin/python # Polyfilter - filters polygon files for very small polygons import sys f = open(sys.argv[1]) def PolygonArea(corners): n = len(corners) # of corners area = 0.0 for i in range(n): j = (i + 1) % ...
b877cbafc3bf3a1109b168a2a9a7c0bb1da476da
problem_33.py
problem_33.py
from time import time import fractions def digit_cancel(): digit_cancelling_fractions = [] for numerator in range(10, 100): for denominator in range(numerator+1, 100): if not (numerator % 10 or denominator % 10): continue frac = fractions.Fraction(numerator, den...
Add problem 33, digit cancelling fractions
Add problem 33, digit cancelling fractions
Python
mit
dimkarakostas/project-euler
Add problem 33, digit cancelling fractions
from time import time import fractions def digit_cancel(): digit_cancelling_fractions = [] for numerator in range(10, 100): for denominator in range(numerator+1, 100): if not (numerator % 10 or denominator % 10): continue frac = fractions.Fraction(numerator, den...
<commit_before><commit_msg>Add problem 33, digit cancelling fractions<commit_after>
from time import time import fractions def digit_cancel(): digit_cancelling_fractions = [] for numerator in range(10, 100): for denominator in range(numerator+1, 100): if not (numerator % 10 or denominator % 10): continue frac = fractions.Fraction(numerator, den...
Add problem 33, digit cancelling fractionsfrom time import time import fractions def digit_cancel(): digit_cancelling_fractions = [] for numerator in range(10, 100): for denominator in range(numerator+1, 100): if not (numerator % 10 or denominator % 10): continue ...
<commit_before><commit_msg>Add problem 33, digit cancelling fractions<commit_after>from time import time import fractions def digit_cancel(): digit_cancelling_fractions = [] for numerator in range(10, 100): for denominator in range(numerator+1, 100): if not (numerator % 10 or denominator %...
9ebe165f7534539012eddb70e8e4ba5b73280ce0
scripts/sendfile.py
scripts/sendfile.py
import os, socket, sys, struct, getopt def sendfile(filename, ip): statinfo = os.stat(filename) fbiinfo = struct.pack('!q', statinfo.st_size) with open(filename, 'rb') as f: sock = socket.socket() sock.connect((ip, 5000)) sock.send(fbiinfo) while True: chunk = f.read(16384) if not chunk: break # ...
Add script for network CIA installation using FBI
Add script for network CIA installation using FBI
Python
mit
cpp3ds/cpp3ds,cpp3ds/cpp3ds,cpp3ds/cpp3ds,cpp3ds/cpp3ds
Add script for network CIA installation using FBI
import os, socket, sys, struct, getopt def sendfile(filename, ip): statinfo = os.stat(filename) fbiinfo = struct.pack('!q', statinfo.st_size) with open(filename, 'rb') as f: sock = socket.socket() sock.connect((ip, 5000)) sock.send(fbiinfo) while True: chunk = f.read(16384) if not chunk: break # ...
<commit_before><commit_msg>Add script for network CIA installation using FBI<commit_after>
import os, socket, sys, struct, getopt def sendfile(filename, ip): statinfo = os.stat(filename) fbiinfo = struct.pack('!q', statinfo.st_size) with open(filename, 'rb') as f: sock = socket.socket() sock.connect((ip, 5000)) sock.send(fbiinfo) while True: chunk = f.read(16384) if not chunk: break # ...
Add script for network CIA installation using FBIimport os, socket, sys, struct, getopt def sendfile(filename, ip): statinfo = os.stat(filename) fbiinfo = struct.pack('!q', statinfo.st_size) with open(filename, 'rb') as f: sock = socket.socket() sock.connect((ip, 5000)) sock.send(fbiinfo) while True: chu...
<commit_before><commit_msg>Add script for network CIA installation using FBI<commit_after>import os, socket, sys, struct, getopt def sendfile(filename, ip): statinfo = os.stat(filename) fbiinfo = struct.pack('!q', statinfo.st_size) with open(filename, 'rb') as f: sock = socket.socket() sock.connect((ip, 5000)) ...
3008cfd977fa265c6069231436f103e6be801929
db/migrations/dedupe_vimorg_id.py
db/migrations/dedupe_vimorg_id.py
"""De-duplicate the vimorg_id column in the plugins table.""" import re import rethinkdb as r import db.plugins import db.util r_conn = db.util.r_conn if __name__ == '__main__': grouped_plugins = r.table('plugins').group('vimorg_id').run(r_conn()) for vimorg_id, plugins in grouped_plugins.iteritems(): ...
Add script to fix plugins with vim.org ID duplicates
Add script to fix plugins with vim.org ID duplicates Summary: If you look at vimawesome.com/?p=3 right now, you will see many duplicated "taglist.vim" plugins. A long time ago, when we scraped a github repo whose homepage was a vim.org plugin, we would assume that was the definitive github repo associated with that v...
Python
mit
vim-awesome/vim-awesome,divad12/vim-awesome,starcraftman/vim-awesome,shaialon/vim-awesome,starcraftman/vim-awesome,shaialon/vim-awesome,vim-awesome/vim-awesome,divad12/vim-awesome,vim-awesome/vim-awesome,starcraftman/vim-awesome,jonafato/vim-awesome,jonafato/vim-awesome,divad12/vim-awesome,jonafato/vim-awesome,vim-awes...
Add script to fix plugins with vim.org ID duplicates Summary: If you look at vimawesome.com/?p=3 right now, you will see many duplicated "taglist.vim" plugins. A long time ago, when we scraped a github repo whose homepage was a vim.org plugin, we would assume that was the definitive github repo associated with that v...
"""De-duplicate the vimorg_id column in the plugins table.""" import re import rethinkdb as r import db.plugins import db.util r_conn = db.util.r_conn if __name__ == '__main__': grouped_plugins = r.table('plugins').group('vimorg_id').run(r_conn()) for vimorg_id, plugins in grouped_plugins.iteritems(): ...
<commit_before><commit_msg>Add script to fix plugins with vim.org ID duplicates Summary: If you look at vimawesome.com/?p=3 right now, you will see many duplicated "taglist.vim" plugins. A long time ago, when we scraped a github repo whose homepage was a vim.org plugin, we would assume that was the definitive github ...
"""De-duplicate the vimorg_id column in the plugins table.""" import re import rethinkdb as r import db.plugins import db.util r_conn = db.util.r_conn if __name__ == '__main__': grouped_plugins = r.table('plugins').group('vimorg_id').run(r_conn()) for vimorg_id, plugins in grouped_plugins.iteritems(): ...
Add script to fix plugins with vim.org ID duplicates Summary: If you look at vimawesome.com/?p=3 right now, you will see many duplicated "taglist.vim" plugins. A long time ago, when we scraped a github repo whose homepage was a vim.org plugin, we would assume that was the definitive github repo associated with that v...
<commit_before><commit_msg>Add script to fix plugins with vim.org ID duplicates Summary: If you look at vimawesome.com/?p=3 right now, you will see many duplicated "taglist.vim" plugins. A long time ago, when we scraped a github repo whose homepage was a vim.org plugin, we would assume that was the definitive github ...
f93aaab606f799e338de1b1161ee5cdf50405c24
salt/states/disk.py
salt/states/disk.py
''' Disk monitoring state Monitor the state of disk resources ''' def status(name, max=None, min=None): ''' Return the current disk usage stats for the named device ''' # Monitoring state, no changes will be made so no test interface needed ret = {'name': name, 'result': False, ...
Add first monitoring state - experimental
Add first monitoring state - experimental
Python
apache-2.0
saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt
Add first monitoring state - experimental
''' Disk monitoring state Monitor the state of disk resources ''' def status(name, max=None, min=None): ''' Return the current disk usage stats for the named device ''' # Monitoring state, no changes will be made so no test interface needed ret = {'name': name, 'result': False, ...
<commit_before><commit_msg>Add first monitoring state - experimental<commit_after>
''' Disk monitoring state Monitor the state of disk resources ''' def status(name, max=None, min=None): ''' Return the current disk usage stats for the named device ''' # Monitoring state, no changes will be made so no test interface needed ret = {'name': name, 'result': False, ...
Add first monitoring state - experimental''' Disk monitoring state Monitor the state of disk resources ''' def status(name, max=None, min=None): ''' Return the current disk usage stats for the named device ''' # Monitoring state, no changes will be made so no test interface needed ret = {'name': n...
<commit_before><commit_msg>Add first monitoring state - experimental<commit_after>''' Disk monitoring state Monitor the state of disk resources ''' def status(name, max=None, min=None): ''' Return the current disk usage stats for the named device ''' # Monitoring state, no changes will be made so no t...
b7e0a6767445acb856661238d3e73e6aa514e360
plot_graph.py
plot_graph.py
from graphviz import Digraph #Add the path of graphviz to render the graph import os os.environ["PATH"] += os.pathsep + 'C:/Program Files/graphviz-2.38/bin' dot = Digraph(comment='The Round Table') #add nodes dot.node('I', 'Inflow') dot.node('V', 'Volume') dot.node('O', 'Outflow') #add edges dot.edge('I', 'V', label='...
Add naive code for generating and rendering casual model and state graph visualization
Add naive code for generating and rendering casual model and state graph visualization
Python
mit
Kaleidophon/puzzled-platypus
Add naive code for generating and rendering casual model and state graph visualization
from graphviz import Digraph #Add the path of graphviz to render the graph import os os.environ["PATH"] += os.pathsep + 'C:/Program Files/graphviz-2.38/bin' dot = Digraph(comment='The Round Table') #add nodes dot.node('I', 'Inflow') dot.node('V', 'Volume') dot.node('O', 'Outflow') #add edges dot.edge('I', 'V', label='...
<commit_before><commit_msg>Add naive code for generating and rendering casual model and state graph visualization<commit_after>
from graphviz import Digraph #Add the path of graphviz to render the graph import os os.environ["PATH"] += os.pathsep + 'C:/Program Files/graphviz-2.38/bin' dot = Digraph(comment='The Round Table') #add nodes dot.node('I', 'Inflow') dot.node('V', 'Volume') dot.node('O', 'Outflow') #add edges dot.edge('I', 'V', label='...
Add naive code for generating and rendering casual model and state graph visualizationfrom graphviz import Digraph #Add the path of graphviz to render the graph import os os.environ["PATH"] += os.pathsep + 'C:/Program Files/graphviz-2.38/bin' dot = Digraph(comment='The Round Table') #add nodes dot.node('I', 'Inflow') ...
<commit_before><commit_msg>Add naive code for generating and rendering casual model and state graph visualization<commit_after>from graphviz import Digraph #Add the path of graphviz to render the graph import os os.environ["PATH"] += os.pathsep + 'C:/Program Files/graphviz-2.38/bin' dot = Digraph(comment='The Round Ta...
7a12c23c59dddbefa201644bf52260d3ad812842
isVowel.py
isVowel.py
""" Q5- Define a function isVowel(char) that returns True if char is a vowel ('a', 'e', 'i', 'o', or 'u'), and False otherwise. You can assume that char is a single letter of any case (ie, 'A' and 'a' are both valid). Do not use the keyword in. Your function should take in a single string and return a boolean. """ d...
Add the answer to the fifth question of Assignment 3
Add the answer to the fifth question of Assignment 3
Python
mit
SuyashD95/python-assignments
Add the answer to the fifth question of Assignment 3
""" Q5- Define a function isVowel(char) that returns True if char is a vowel ('a', 'e', 'i', 'o', or 'u'), and False otherwise. You can assume that char is a single letter of any case (ie, 'A' and 'a' are both valid). Do not use the keyword in. Your function should take in a single string and return a boolean. """ d...
<commit_before><commit_msg>Add the answer to the fifth question of Assignment 3<commit_after>
""" Q5- Define a function isVowel(char) that returns True if char is a vowel ('a', 'e', 'i', 'o', or 'u'), and False otherwise. You can assume that char is a single letter of any case (ie, 'A' and 'a' are both valid). Do not use the keyword in. Your function should take in a single string and return a boolean. """ d...
Add the answer to the fifth question of Assignment 3""" Q5- Define a function isVowel(char) that returns True if char is a vowel ('a', 'e', 'i', 'o', or 'u'), and False otherwise. You can assume that char is a single letter of any case (ie, 'A' and 'a' are both valid). Do not use the keyword in. Your function should ta...
<commit_before><commit_msg>Add the answer to the fifth question of Assignment 3<commit_after>""" Q5- Define a function isVowel(char) that returns True if char is a vowel ('a', 'e', 'i', 'o', or 'u'), and False otherwise. You can assume that char is a single letter of any case (ie, 'A' and 'a' are both valid). Do not us...
33f9196d69ad9d7fa6b45b41f0110780e1ab6c5f
dj/main/migrations/0009_auto_20170820_0105.py
dj/main/migrations/0009_auto_20170820_0105.py
# -*- coding: utf-8 -*- # Generated by Django 1.11.4 on 2017-08-20 01:05 from __future__ import unicode_literals from django.db import migrations, models import main.models class Migration(migrations.Migration): dependencies = [ ('main', '0008_auto_20161014_1424'), ] operations = [ migr...
Update migrations to match current model
Update migrations to match current model
Python
mit
xfxf/veyepar,CarlFK/veyepar,xfxf/veyepar,xfxf/veyepar,CarlFK/veyepar,CarlFK/veyepar,CarlFK/veyepar,xfxf/veyepar,xfxf/veyepar,CarlFK/veyepar
Update migrations to match current model
# -*- coding: utf-8 -*- # Generated by Django 1.11.4 on 2017-08-20 01:05 from __future__ import unicode_literals from django.db import migrations, models import main.models class Migration(migrations.Migration): dependencies = [ ('main', '0008_auto_20161014_1424'), ] operations = [ migr...
<commit_before><commit_msg>Update migrations to match current model<commit_after>
# -*- coding: utf-8 -*- # Generated by Django 1.11.4 on 2017-08-20 01:05 from __future__ import unicode_literals from django.db import migrations, models import main.models class Migration(migrations.Migration): dependencies = [ ('main', '0008_auto_20161014_1424'), ] operations = [ migr...
Update migrations to match current model# -*- coding: utf-8 -*- # Generated by Django 1.11.4 on 2017-08-20 01:05 from __future__ import unicode_literals from django.db import migrations, models import main.models class Migration(migrations.Migration): dependencies = [ ('main', '0008_auto_20161014_1424')...
<commit_before><commit_msg>Update migrations to match current model<commit_after># -*- coding: utf-8 -*- # Generated by Django 1.11.4 on 2017-08-20 01:05 from __future__ import unicode_literals from django.db import migrations, models import main.models class Migration(migrations.Migration): dependencies = [ ...
751485671b6abb88878d62bbbb473cf6bae30fc8
Attic/calculate_activity_freqs.py
Attic/calculate_activity_freqs.py
from parliament.models import * types = MemberActivityType.objects.all() st_count = 0 start_date = '2014-02-06' start_date = '2011-04-20' for t in types: act_qs = MemberActivity.objects.filter(type=t, time__gte=start_date) act_count = act_qs.count() mp_count = Member.objects.filter(memberactivity__in=act_q...
Add script to calculate activity frequencies
Add script to calculate activity frequencies
Python
agpl-3.0
kansanmuisti/kamu,kansanmuisti/kamu,kansanmuisti/kamu,kansanmuisti/kamu,kansanmuisti/kamu
Add script to calculate activity frequencies
from parliament.models import * types = MemberActivityType.objects.all() st_count = 0 start_date = '2014-02-06' start_date = '2011-04-20' for t in types: act_qs = MemberActivity.objects.filter(type=t, time__gte=start_date) act_count = act_qs.count() mp_count = Member.objects.filter(memberactivity__in=act_q...
<commit_before><commit_msg>Add script to calculate activity frequencies<commit_after>
from parliament.models import * types = MemberActivityType.objects.all() st_count = 0 start_date = '2014-02-06' start_date = '2011-04-20' for t in types: act_qs = MemberActivity.objects.filter(type=t, time__gte=start_date) act_count = act_qs.count() mp_count = Member.objects.filter(memberactivity__in=act_q...
Add script to calculate activity frequenciesfrom parliament.models import * types = MemberActivityType.objects.all() st_count = 0 start_date = '2014-02-06' start_date = '2011-04-20' for t in types: act_qs = MemberActivity.objects.filter(type=t, time__gte=start_date) act_count = act_qs.count() mp_count = Me...
<commit_before><commit_msg>Add script to calculate activity frequencies<commit_after>from parliament.models import * types = MemberActivityType.objects.all() st_count = 0 start_date = '2014-02-06' start_date = '2011-04-20' for t in types: act_qs = MemberActivity.objects.filter(type=t, time__gte=start_date) act...
75973597cc2542d589033eecc9169f09fec57857
gulf/bathy/get_bathy.py
gulf/bathy/get_bathy.py
#!/usr/bin/env python """Simple implementation of a file fetcher""" import sys import os import urllib import subprocess def get_bathy(url, destination=os.getcwd(), force=False): r"""Get bathymetry file located at `url` Will check downloaded file's suffix to see if the file needs to be extracted """ ...
Add bathy download script for Gulf
Add bathy download script for Gulf
Python
mit
mandli/surge-examples
Add bathy download script for Gulf
#!/usr/bin/env python """Simple implementation of a file fetcher""" import sys import os import urllib import subprocess def get_bathy(url, destination=os.getcwd(), force=False): r"""Get bathymetry file located at `url` Will check downloaded file's suffix to see if the file needs to be extracted """ ...
<commit_before><commit_msg>Add bathy download script for Gulf<commit_after>
#!/usr/bin/env python """Simple implementation of a file fetcher""" import sys import os import urllib import subprocess def get_bathy(url, destination=os.getcwd(), force=False): r"""Get bathymetry file located at `url` Will check downloaded file's suffix to see if the file needs to be extracted """ ...
Add bathy download script for Gulf#!/usr/bin/env python """Simple implementation of a file fetcher""" import sys import os import urllib import subprocess def get_bathy(url, destination=os.getcwd(), force=False): r"""Get bathymetry file located at `url` Will check downloaded file's suffix to see if the file...
<commit_before><commit_msg>Add bathy download script for Gulf<commit_after>#!/usr/bin/env python """Simple implementation of a file fetcher""" import sys import os import urllib import subprocess def get_bathy(url, destination=os.getcwd(), force=False): r"""Get bathymetry file located at `url` Will check do...
f0f3e03931560106276be9d9054127cdab6e0d5d
migrations/versions/0160_another_letter_org.py
migrations/versions/0160_another_letter_org.py
"""empty message Revision ID: 0160_another_letter_org Revises: 0159_add_historical_redact Create Date: 2017-06-29 12:44:16.815039 """ # revision identifiers, used by Alembic. revision = '0160_another_letter_org' down_revision = '0159_add_historical_redact' from alembic import op NEW_ORGANISATIONS = [ ('501', ...
Add letter logo for environment agency
Add letter logo for environment agency Depends on: https://github.com/alphagov/notifications-template-preview/pull/87
Python
mit
alphagov/notifications-api,alphagov/notifications-api
Add letter logo for environment agency Depends on: https://github.com/alphagov/notifications-template-preview/pull/87
"""empty message Revision ID: 0160_another_letter_org Revises: 0159_add_historical_redact Create Date: 2017-06-29 12:44:16.815039 """ # revision identifiers, used by Alembic. revision = '0160_another_letter_org' down_revision = '0159_add_historical_redact' from alembic import op NEW_ORGANISATIONS = [ ('501', ...
<commit_before><commit_msg>Add letter logo for environment agency Depends on: https://github.com/alphagov/notifications-template-preview/pull/87<commit_after>
"""empty message Revision ID: 0160_another_letter_org Revises: 0159_add_historical_redact Create Date: 2017-06-29 12:44:16.815039 """ # revision identifiers, used by Alembic. revision = '0160_another_letter_org' down_revision = '0159_add_historical_redact' from alembic import op NEW_ORGANISATIONS = [ ('501', ...
Add letter logo for environment agency Depends on: https://github.com/alphagov/notifications-template-preview/pull/87"""empty message Revision ID: 0160_another_letter_org Revises: 0159_add_historical_redact Create Date: 2017-06-29 12:44:16.815039 """ # revision identifiers, used by Alembic. revision = '0160_another...
<commit_before><commit_msg>Add letter logo for environment agency Depends on: https://github.com/alphagov/notifications-template-preview/pull/87<commit_after>"""empty message Revision ID: 0160_another_letter_org Revises: 0159_add_historical_redact Create Date: 2017-06-29 12:44:16.815039 """ # revision identifiers, ...
d1a5402bfa8779e3857ce4330b1a9e7b0baec153
buffer/tests/test_response.py
buffer/tests/test_response.py
from nose.tools import eq_ from buffer.response import ResponseObject def test_reponse_check_for_inception(): ''' Given a dict with a dict, it should convert all the dicts to ResponseObject ''' awesome_dict = { 'key': 'value', 'second_dict': { 'key2': 'value2' } } response = Response...
Test response oject for dict into dict into dict
Test response oject for dict into dict into dict
Python
mit
vtemian/buffpy,bufferapp/buffer-python
Test response oject for dict into dict into dict
from nose.tools import eq_ from buffer.response import ResponseObject def test_reponse_check_for_inception(): ''' Given a dict with a dict, it should convert all the dicts to ResponseObject ''' awesome_dict = { 'key': 'value', 'second_dict': { 'key2': 'value2' } } response = Response...
<commit_before><commit_msg>Test response oject for dict into dict into dict<commit_after>
from nose.tools import eq_ from buffer.response import ResponseObject def test_reponse_check_for_inception(): ''' Given a dict with a dict, it should convert all the dicts to ResponseObject ''' awesome_dict = { 'key': 'value', 'second_dict': { 'key2': 'value2' } } response = Response...
Test response oject for dict into dict into dictfrom nose.tools import eq_ from buffer.response import ResponseObject def test_reponse_check_for_inception(): ''' Given a dict with a dict, it should convert all the dicts to ResponseObject ''' awesome_dict = { 'key': 'value', 'second_dict': { '...
<commit_before><commit_msg>Test response oject for dict into dict into dict<commit_after>from nose.tools import eq_ from buffer.response import ResponseObject def test_reponse_check_for_inception(): ''' Given a dict with a dict, it should convert all the dicts to ResponseObject ''' awesome_dict = { 'ke...
2d8648a9295a49c03cdb0d8afa19629f89ae08bc
changes/models/testmessage.py
changes/models/testmessage.py
import uuid from sqlalchemy import Column, ForeignKey, Integer from sqlalchemy.orm import relationship from sqlalchemy.schema import Index from changes.config import db from changes.db.types.guid import GUID class TestMessage(db.model): """ The message produced by a run of a test. This is generally cap...
Add db model for TestMessage database
Add db model for TestMessage database Summary: Adds a model for the testmessage table and support for getting the message Depends on D206477 Depends on D206407 Reviewers: anupc, paulruan Reviewed By: paulruan Subscribers: changesbot, kylec Differential Revision: https://tails.corp.dropbox.com/D206480
Python
apache-2.0
dropbox/changes,dropbox/changes,dropbox/changes,dropbox/changes
Add db model for TestMessage database Summary: Adds a model for the testmessage table and support for getting the message Depends on D206477 Depends on D206407 Reviewers: anupc, paulruan Reviewed By: paulruan Subscribers: changesbot, kylec Differential Revision: https://tails.corp.dropbox.com/D206480
import uuid from sqlalchemy import Column, ForeignKey, Integer from sqlalchemy.orm import relationship from sqlalchemy.schema import Index from changes.config import db from changes.db.types.guid import GUID class TestMessage(db.model): """ The message produced by a run of a test. This is generally cap...
<commit_before><commit_msg>Add db model for TestMessage database Summary: Adds a model for the testmessage table and support for getting the message Depends on D206477 Depends on D206407 Reviewers: anupc, paulruan Reviewed By: paulruan Subscribers: changesbot, kylec Differential Revision: https://tails.corp.dropb...
import uuid from sqlalchemy import Column, ForeignKey, Integer from sqlalchemy.orm import relationship from sqlalchemy.schema import Index from changes.config import db from changes.db.types.guid import GUID class TestMessage(db.model): """ The message produced by a run of a test. This is generally cap...
Add db model for TestMessage database Summary: Adds a model for the testmessage table and support for getting the message Depends on D206477 Depends on D206407 Reviewers: anupc, paulruan Reviewed By: paulruan Subscribers: changesbot, kylec Differential Revision: https://tails.corp.dropbox.com/D206480import uuid ...
<commit_before><commit_msg>Add db model for TestMessage database Summary: Adds a model for the testmessage table and support for getting the message Depends on D206477 Depends on D206407 Reviewers: anupc, paulruan Reviewed By: paulruan Subscribers: changesbot, kylec Differential Revision: https://tails.corp.dropb...
dd7686b609245c4c37364167603a7b5b0165ebbc
migrations/versions/588336e02ca_use_native_postgres_json_type_for_entry_.py
migrations/versions/588336e02ca_use_native_postgres_json_type_for_entry_.py
"""Use native postgres JSON type for Entry.content Revision ID: 588336e02ca Revises: 2b7f5e38dd73 Create Date: 2014-01-09 22:40:07.690000 """ # revision identifiers, used by Alembic. revision = '588336e02ca' down_revision = '2b7f5e38dd73' from alembic import op import sqlalchemy as sa def upgrade(): ### comma...
Add migration for native postgres JSON type
Add migration for native postgres JSON type
Python
mit
streamr/marvin,streamr/marvin,streamr/marvin
Add migration for native postgres JSON type
"""Use native postgres JSON type for Entry.content Revision ID: 588336e02ca Revises: 2b7f5e38dd73 Create Date: 2014-01-09 22:40:07.690000 """ # revision identifiers, used by Alembic. revision = '588336e02ca' down_revision = '2b7f5e38dd73' from alembic import op import sqlalchemy as sa def upgrade(): ### comma...
<commit_before><commit_msg>Add migration for native postgres JSON type<commit_after>
"""Use native postgres JSON type for Entry.content Revision ID: 588336e02ca Revises: 2b7f5e38dd73 Create Date: 2014-01-09 22:40:07.690000 """ # revision identifiers, used by Alembic. revision = '588336e02ca' down_revision = '2b7f5e38dd73' from alembic import op import sqlalchemy as sa def upgrade(): ### comma...
Add migration for native postgres JSON type"""Use native postgres JSON type for Entry.content Revision ID: 588336e02ca Revises: 2b7f5e38dd73 Create Date: 2014-01-09 22:40:07.690000 """ # revision identifiers, used by Alembic. revision = '588336e02ca' down_revision = '2b7f5e38dd73' from alembic import op import sqla...
<commit_before><commit_msg>Add migration for native postgres JSON type<commit_after>"""Use native postgres JSON type for Entry.content Revision ID: 588336e02ca Revises: 2b7f5e38dd73 Create Date: 2014-01-09 22:40:07.690000 """ # revision identifiers, used by Alembic. revision = '588336e02ca' down_revision = '2b7f5e38...
de75d383b9b6461c25e71bcc71958282d2265147
googleapis/rules/rule_lib_test.py
googleapis/rules/rule_lib_test.py
#!/usr/bin/env python3 # Copyright 2020 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
Add (currently empty) test placeholder.
Add (currently empty) test placeholder.
Python
apache-2.0
chronicle/api-samples-python
Add (currently empty) test placeholder.
#!/usr/bin/env python3 # Copyright 2020 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
<commit_before><commit_msg>Add (currently empty) test placeholder.<commit_after>
#!/usr/bin/env python3 # Copyright 2020 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
Add (currently empty) test placeholder.#!/usr/bin/env python3 # Copyright 2020 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 #...
<commit_before><commit_msg>Add (currently empty) test placeholder.<commit_after>#!/usr/bin/env python3 # Copyright 2020 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # htt...
0170835d59519a7f69badf17d0be6bc49f92ea58
lintcode/Medium/170_Rotate_List.py
lintcode/Medium/170_Rotate_List.py
# Definition for singly-linked list. # class ListNode: # def __init__(self, x): # self.val = x # self.next = None class Solution: # @param head: the list # @param k: rotate to the right k places # @return: the list after rotation def rotateRight(self, head, k): # write your ...
Add solution to lintcode question 170
Add solution to lintcode question 170
Python
mit
Rhadow/leetcode,Rhadow/leetcode,Rhadow/leetcode,Rhadow/leetcode
Add solution to lintcode question 170
# Definition for singly-linked list. # class ListNode: # def __init__(self, x): # self.val = x # self.next = None class Solution: # @param head: the list # @param k: rotate to the right k places # @return: the list after rotation def rotateRight(self, head, k): # write your ...
<commit_before><commit_msg>Add solution to lintcode question 170<commit_after>
# Definition for singly-linked list. # class ListNode: # def __init__(self, x): # self.val = x # self.next = None class Solution: # @param head: the list # @param k: rotate to the right k places # @return: the list after rotation def rotateRight(self, head, k): # write your ...
Add solution to lintcode question 170# Definition for singly-linked list. # class ListNode: # def __init__(self, x): # self.val = x # self.next = None class Solution: # @param head: the list # @param k: rotate to the right k places # @return: the list after rotation def rotateRight(...
<commit_before><commit_msg>Add solution to lintcode question 170<commit_after># Definition for singly-linked list. # class ListNode: # def __init__(self, x): # self.val = x # self.next = None class Solution: # @param head: the list # @param k: rotate to the right k places # @return: the...
230bf08f9aac697fc4c8dc092348be3b7026046f
test/requests/parametrized_test.py
test/requests/parametrized_test.py
import logging import unittest from elasticsearch import Elasticsearch, TransportError class ParametrizedTest(unittest.TestCase): def __init__(self, methodName='runTest', gn2_url="http://localhost:5003", es_url="localhost:9200"): super(ParametrizedTest, self).__init__(methodName=methodName) self.g...
Create parametrized superclass for tests
Create parametrized superclass for tests * Since the tests require that some parameters be provided while running the tests, create a class that helps abstract away the details of retrieving and setting the expected parameters.
Python
agpl-3.0
DannyArends/genenetwork2,genenetwork/genenetwork2,pjotrp/genenetwork2,pjotrp/genenetwork2,genenetwork/genenetwork2,DannyArends/genenetwork2,zsloan/genenetwork2,DannyArends/genenetwork2,genenetwork/genenetwork2,pjotrp/genenetwork2,DannyArends/genenetwork2,pjotrp/genenetwork2,zsloan/genenetwork2,genenetwork/genenetwork2,...
Create parametrized superclass for tests * Since the tests require that some parameters be provided while running the tests, create a class that helps abstract away the details of retrieving and setting the expected parameters.
import logging import unittest from elasticsearch import Elasticsearch, TransportError class ParametrizedTest(unittest.TestCase): def __init__(self, methodName='runTest', gn2_url="http://localhost:5003", es_url="localhost:9200"): super(ParametrizedTest, self).__init__(methodName=methodName) self.g...
<commit_before><commit_msg>Create parametrized superclass for tests * Since the tests require that some parameters be provided while running the tests, create a class that helps abstract away the details of retrieving and setting the expected parameters.<commit_after>
import logging import unittest from elasticsearch import Elasticsearch, TransportError class ParametrizedTest(unittest.TestCase): def __init__(self, methodName='runTest', gn2_url="http://localhost:5003", es_url="localhost:9200"): super(ParametrizedTest, self).__init__(methodName=methodName) self.g...
Create parametrized superclass for tests * Since the tests require that some parameters be provided while running the tests, create a class that helps abstract away the details of retrieving and setting the expected parameters.import logging import unittest from elasticsearch import Elasticsearch, TransportError ...
<commit_before><commit_msg>Create parametrized superclass for tests * Since the tests require that some parameters be provided while running the tests, create a class that helps abstract away the details of retrieving and setting the expected parameters.<commit_after>import logging import unittest from elasticsear...
4bde5fdb6eb8d87be42621c8c5ec9d68e5810d3a
glaciercmd/command_create_inventory_job_for_vault.py
glaciercmd/command_create_inventory_job_for_vault.py
import boto import datetime class CommandCreateInventoryJobForVault(object): def execute(self, args, config): glacier_connection = boto.connect_glacier(aws_access_key_id=config.get('configuration', 'aws_key'), aws_secret_access_key=config.get('configuration', 'aws_secret')) try: vault = glacier_conne...
Add inventory job creation command
Add inventory job creation command
Python
mit
carsonmcdonald/glacier-cmd
Add inventory job creation command
import boto import datetime class CommandCreateInventoryJobForVault(object): def execute(self, args, config): glacier_connection = boto.connect_glacier(aws_access_key_id=config.get('configuration', 'aws_key'), aws_secret_access_key=config.get('configuration', 'aws_secret')) try: vault = glacier_conne...
<commit_before><commit_msg>Add inventory job creation command<commit_after>
import boto import datetime class CommandCreateInventoryJobForVault(object): def execute(self, args, config): glacier_connection = boto.connect_glacier(aws_access_key_id=config.get('configuration', 'aws_key'), aws_secret_access_key=config.get('configuration', 'aws_secret')) try: vault = glacier_conne...
Add inventory job creation commandimport boto import datetime class CommandCreateInventoryJobForVault(object): def execute(self, args, config): glacier_connection = boto.connect_glacier(aws_access_key_id=config.get('configuration', 'aws_key'), aws_secret_access_key=config.get('configuration', 'aws_secret')) ...
<commit_before><commit_msg>Add inventory job creation command<commit_after>import boto import datetime class CommandCreateInventoryJobForVault(object): def execute(self, args, config): glacier_connection = boto.connect_glacier(aws_access_key_id=config.get('configuration', 'aws_key'), aws_secret_access_key=confi...
85378ec16884089074c527d05da564d596f07bef
tests/test_tags.py
tests/test_tags.py
# tests/test_vendor.py import unittest from tests.base import BaseTestCase from project.models import LineItem, Component from project.inventory.forms import VendorCreateForm, PurchaseOrderForm, \ ComponentCreateForm import json class TestTagManagement(BaseTestCase): def login(self): self.client.po...
Create tags test. test for create single tag and create tag in category
Create tags test. test for create single tag and create tag in category
Python
mit
paris3200/flask-inventory,paris3200/flask-inventory,cisko3000/flask-inventory,cisko3000/flask-inventory,cisko3000/flask-inventory,paris3200/flask-inventory
Create tags test. test for create single tag and create tag in category
# tests/test_vendor.py import unittest from tests.base import BaseTestCase from project.models import LineItem, Component from project.inventory.forms import VendorCreateForm, PurchaseOrderForm, \ ComponentCreateForm import json class TestTagManagement(BaseTestCase): def login(self): self.client.po...
<commit_before><commit_msg>Create tags test. test for create single tag and create tag in category<commit_after>
# tests/test_vendor.py import unittest from tests.base import BaseTestCase from project.models import LineItem, Component from project.inventory.forms import VendorCreateForm, PurchaseOrderForm, \ ComponentCreateForm import json class TestTagManagement(BaseTestCase): def login(self): self.client.po...
Create tags test. test for create single tag and create tag in category# tests/test_vendor.py import unittest from tests.base import BaseTestCase from project.models import LineItem, Component from project.inventory.forms import VendorCreateForm, PurchaseOrderForm, \ ComponentCreateForm import json class TestTa...
<commit_before><commit_msg>Create tags test. test for create single tag and create tag in category<commit_after># tests/test_vendor.py import unittest from tests.base import BaseTestCase from project.models import LineItem, Component from project.inventory.forms import VendorCreateForm, PurchaseOrderForm, \ Comp...
53e082344a85544fae84c6ffc2ad221dc33a184f
algorithms/decision_tree.py
algorithms/decision_tree.py
def http://www.arthotel.bg/premium-paket-vino-i-lyubovmode(dataset): counts = { 0: 0, 1:0 } for entity in dataset: counts[entity[0]]++ # What if they are equal? if counts[0] > counts[1]: return 0 else: return 1 # Attribute must be an index def entities_with_attribute_value(attri...
Add decision tree helper functions
Add decision tree helper functions
Python
mit
victoria92/survival-predictor,victoria92/survival-predictor
Add decision tree helper functions
def http://www.arthotel.bg/premium-paket-vino-i-lyubovmode(dataset): counts = { 0: 0, 1:0 } for entity in dataset: counts[entity[0]]++ # What if they are equal? if counts[0] > counts[1]: return 0 else: return 1 # Attribute must be an index def entities_with_attribute_value(attri...
<commit_before><commit_msg>Add decision tree helper functions<commit_after>
def http://www.arthotel.bg/premium-paket-vino-i-lyubovmode(dataset): counts = { 0: 0, 1:0 } for entity in dataset: counts[entity[0]]++ # What if they are equal? if counts[0] > counts[1]: return 0 else: return 1 # Attribute must be an index def entities_with_attribute_value(attri...
Add decision tree helper functionsdef http://www.arthotel.bg/premium-paket-vino-i-lyubovmode(dataset): counts = { 0: 0, 1:0 } for entity in dataset: counts[entity[0]]++ # What if they are equal? if counts[0] > counts[1]: return 0 else: return 1 # Attribute must be an index def e...
<commit_before><commit_msg>Add decision tree helper functions<commit_after>def http://www.arthotel.bg/premium-paket-vino-i-lyubovmode(dataset): counts = { 0: 0, 1:0 } for entity in dataset: counts[entity[0]]++ # What if they are equal? if counts[0] > counts[1]: return 0 else: ret...
f8ab7808643358d1c01a8d6d75a3ccdbf7b83fbd
app-page-generating-time.py
app-page-generating-time.py
# -*- coding: utf-8 -*- ############################## # Reqirement: # pip install web.py ############################## import web urls = ( r'/', 'index', r'/notime', 'notime' ) app = web.application(urls, globals()) class index: def GET(self): web.header('Content-Ty...
Use processor to implement page generating time
Use processor to implement page generating time
Python
apache-2.0
goncha/webpy-examples
Use processor to implement page generating time
# -*- coding: utf-8 -*- ############################## # Reqirement: # pip install web.py ############################## import web urls = ( r'/', 'index', r'/notime', 'notime' ) app = web.application(urls, globals()) class index: def GET(self): web.header('Content-Ty...
<commit_before><commit_msg>Use processor to implement page generating time<commit_after>
# -*- coding: utf-8 -*- ############################## # Reqirement: # pip install web.py ############################## import web urls = ( r'/', 'index', r'/notime', 'notime' ) app = web.application(urls, globals()) class index: def GET(self): web.header('Content-Ty...
Use processor to implement page generating time# -*- coding: utf-8 -*- ############################## # Reqirement: # pip install web.py ############################## import web urls = ( r'/', 'index', r'/notime', 'notime' ) app = web.application(urls, globals()) class index: ...
<commit_before><commit_msg>Use processor to implement page generating time<commit_after># -*- coding: utf-8 -*- ############################## # Reqirement: # pip install web.py ############################## import web urls = ( r'/', 'index', r'/notime', 'notime' ) app = web.applicatio...
bd6a5843b1e1ec38959655e93082e96c9cbf501d
test/lib/unzip_test.py
test/lib/unzip_test.py
# Run the following command to test: # # (in /usr/local/googkit) # $ python -m {test_module_name} # # See also: http://docs.python.org/3.3/library/unittest.html#command-line-interface # # We cannot use unittest.mock on python 2.x! # Please install the Mock module when you use Python 2.x. # # $ easy_install ...
Add a test for lib.unzip
Add a test for lib.unzip
Python
mit
googkit/googkit,googkit/googkit,googkit/googkit
Add a test for lib.unzip
# Run the following command to test: # # (in /usr/local/googkit) # $ python -m {test_module_name} # # See also: http://docs.python.org/3.3/library/unittest.html#command-line-interface # # We cannot use unittest.mock on python 2.x! # Please install the Mock module when you use Python 2.x. # # $ easy_install ...
<commit_before><commit_msg>Add a test for lib.unzip<commit_after>
# Run the following command to test: # # (in /usr/local/googkit) # $ python -m {test_module_name} # # See also: http://docs.python.org/3.3/library/unittest.html#command-line-interface # # We cannot use unittest.mock on python 2.x! # Please install the Mock module when you use Python 2.x. # # $ easy_install ...
Add a test for lib.unzip# Run the following command to test: # # (in /usr/local/googkit) # $ python -m {test_module_name} # # See also: http://docs.python.org/3.3/library/unittest.html#command-line-interface # # We cannot use unittest.mock on python 2.x! # Please install the Mock module when you use Python 2.x....
<commit_before><commit_msg>Add a test for lib.unzip<commit_after># Run the following command to test: # # (in /usr/local/googkit) # $ python -m {test_module_name} # # See also: http://docs.python.org/3.3/library/unittest.html#command-line-interface # # We cannot use unittest.mock on python 2.x! # Please install...
db94954ccd03d27324ce142009093fdaeca83e98
tests/test_util.py
tests/test_util.py
""" Tests for dhcp2nest.util """ from nose.tools import with_setup, eq_ from tempfile import TemporaryDirectory import os.path from dhcp2nest.util import follow_file TEMPDIR = None def follow_setup(): """ Setup for follow_file tests """ global TEMPDIR TEMPDIR = TemporaryDirectory() def follo...
Add a basic test for follow_file()
Add a basic test for follow_file() Signed-off-by: Jason Bernardino Alonso <f71c42a1353bbcdbe07e24c2a1c893f8ea1d05ee@hackorp.com>
Python
mit
jbalonso/dhcp2nest
Add a basic test for follow_file() Signed-off-by: Jason Bernardino Alonso <f71c42a1353bbcdbe07e24c2a1c893f8ea1d05ee@hackorp.com>
""" Tests for dhcp2nest.util """ from nose.tools import with_setup, eq_ from tempfile import TemporaryDirectory import os.path from dhcp2nest.util import follow_file TEMPDIR = None def follow_setup(): """ Setup for follow_file tests """ global TEMPDIR TEMPDIR = TemporaryDirectory() def follo...
<commit_before><commit_msg>Add a basic test for follow_file() Signed-off-by: Jason Bernardino Alonso <f71c42a1353bbcdbe07e24c2a1c893f8ea1d05ee@hackorp.com><commit_after>
""" Tests for dhcp2nest.util """ from nose.tools import with_setup, eq_ from tempfile import TemporaryDirectory import os.path from dhcp2nest.util import follow_file TEMPDIR = None def follow_setup(): """ Setup for follow_file tests """ global TEMPDIR TEMPDIR = TemporaryDirectory() def follo...
Add a basic test for follow_file() Signed-off-by: Jason Bernardino Alonso <f71c42a1353bbcdbe07e24c2a1c893f8ea1d05ee@hackorp.com>""" Tests for dhcp2nest.util """ from nose.tools import with_setup, eq_ from tempfile import TemporaryDirectory import os.path from dhcp2nest.util import follow_file TEMPDIR = None def ...
<commit_before><commit_msg>Add a basic test for follow_file() Signed-off-by: Jason Bernardino Alonso <f71c42a1353bbcdbe07e24c2a1c893f8ea1d05ee@hackorp.com><commit_after>""" Tests for dhcp2nest.util """ from nose.tools import with_setup, eq_ from tempfile import TemporaryDirectory import os.path from dhcp2nest.util i...
f05a522301e09b7577959490f8527a226d289d57
profile_collection/startup/99-start-xpdacq.py
profile_collection/startup/99-start-xpdacq.py
#!/usr/bin/env python ############################################################################## # # xpdacq by Billinge Group # Simon J. L. Billinge sb2896@columbia.edu # (c) 2016 trustees of Columbia University in the City of # New York. # ...
Put xpdAcq startup script under version control.
Put xpdAcq startup script under version control.
Python
bsd-2-clause
NSLS-II-XPD/ipython_ophyd,NSLS-II-XPD/ipython_ophyd
Put xpdAcq startup script under version control.
#!/usr/bin/env python ############################################################################## # # xpdacq by Billinge Group # Simon J. L. Billinge sb2896@columbia.edu # (c) 2016 trustees of Columbia University in the City of # New York. # ...
<commit_before><commit_msg>Put xpdAcq startup script under version control.<commit_after>
#!/usr/bin/env python ############################################################################## # # xpdacq by Billinge Group # Simon J. L. Billinge sb2896@columbia.edu # (c) 2016 trustees of Columbia University in the City of # New York. # ...
Put xpdAcq startup script under version control.#!/usr/bin/env python ############################################################################## # # xpdacq by Billinge Group # Simon J. L. Billinge sb2896@columbia.edu # (c) 2016 trustees of Columbia University in the Ci...
<commit_before><commit_msg>Put xpdAcq startup script under version control.<commit_after>#!/usr/bin/env python ############################################################################## # # xpdacq by Billinge Group # Simon J. L. Billinge sb2896@columbia.edu # (c) 2016 ...
3d96b070af8c954c9132f3986e598a0c4f37f570
push/tests/test_urls.py
push/tests/test_urls.py
# coding=utf-8 from django.test.client import Client from django.test import TestCase from push.views import * class UrlResolveTests(TestCase): def test_url_index(self): c = Client() response = c.get('/') self.assertEqual(response.status_code, 302) def test_url_index_page(self): ...
Add push urls unit test
[WIP] Add push urls unit test
Python
apache-2.0
nnsnodnb/django-mbaas,nnsnodnb/django-mbaas,nnsnodnb/django-mbaas
[WIP] Add push urls unit test
# coding=utf-8 from django.test.client import Client from django.test import TestCase from push.views import * class UrlResolveTests(TestCase): def test_url_index(self): c = Client() response = c.get('/') self.assertEqual(response.status_code, 302) def test_url_index_page(self): ...
<commit_before><commit_msg>[WIP] Add push urls unit test<commit_after>
# coding=utf-8 from django.test.client import Client from django.test import TestCase from push.views import * class UrlResolveTests(TestCase): def test_url_index(self): c = Client() response = c.get('/') self.assertEqual(response.status_code, 302) def test_url_index_page(self): ...
[WIP] Add push urls unit test# coding=utf-8 from django.test.client import Client from django.test import TestCase from push.views import * class UrlResolveTests(TestCase): def test_url_index(self): c = Client() response = c.get('/') self.assertEqual(response.status_code, 302) def tes...
<commit_before><commit_msg>[WIP] Add push urls unit test<commit_after># coding=utf-8 from django.test.client import Client from django.test import TestCase from push.views import * class UrlResolveTests(TestCase): def test_url_index(self): c = Client() response = c.get('/') self.assertEqua...
57222e314e78cf5a2894112dc05892a08a297b52
virtual_devices.py
virtual_devices.py
class Output: """A device which prints whatever gets passed to it""" def write(self, index, value): print(value) def read(self, index): pass class Input: """A device triggering on a read to return user data""" def read(self, index): f = input('I need input...') tr...
Add Input and Output virtual devices
Add Input and Output virtual devices
Python
bsd-3-clause
darbaga/simple_compiler
Add Input and Output virtual devices
class Output: """A device which prints whatever gets passed to it""" def write(self, index, value): print(value) def read(self, index): pass class Input: """A device triggering on a read to return user data""" def read(self, index): f = input('I need input...') tr...
<commit_before><commit_msg>Add Input and Output virtual devices<commit_after>
class Output: """A device which prints whatever gets passed to it""" def write(self, index, value): print(value) def read(self, index): pass class Input: """A device triggering on a read to return user data""" def read(self, index): f = input('I need input...') tr...
Add Input and Output virtual devicesclass Output: """A device which prints whatever gets passed to it""" def write(self, index, value): print(value) def read(self, index): pass class Input: """A device triggering on a read to return user data""" def read(self, index): f =...
<commit_before><commit_msg>Add Input and Output virtual devices<commit_after>class Output: """A device which prints whatever gets passed to it""" def write(self, index, value): print(value) def read(self, index): pass class Input: """A device triggering on a read to return user data"...
af7db45b89352421be479af74db0469b63cc8717
clock/users/migrations/0005_auto_20171208_1413.py
clock/users/migrations/0005_auto_20171208_1413.py
# Generated by Django 2.0 on 2017-12-08 13:13 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('users', '0004_auto_20171022_1456'), ] operations = [ migrations.AlterField( model_name='user', name='last_name', ...
Add migration for Django 2.0
Add migration for Django 2.0
Python
mit
mimischi/django-clock,mimischi/django-clock,mimischi/django-clock,mimischi/django-clock
Add migration for Django 2.0
# Generated by Django 2.0 on 2017-12-08 13:13 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('users', '0004_auto_20171022_1456'), ] operations = [ migrations.AlterField( model_name='user', name='last_name', ...
<commit_before><commit_msg>Add migration for Django 2.0<commit_after>
# Generated by Django 2.0 on 2017-12-08 13:13 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('users', '0004_auto_20171022_1456'), ] operations = [ migrations.AlterField( model_name='user', name='last_name', ...
Add migration for Django 2.0# Generated by Django 2.0 on 2017-12-08 13:13 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('users', '0004_auto_20171022_1456'), ] operations = [ migrations.AlterField( model_name='user', ...
<commit_before><commit_msg>Add migration for Django 2.0<commit_after># Generated by Django 2.0 on 2017-12-08 13:13 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('users', '0004_auto_20171022_1456'), ] operations = [ migrations.AlterFiel...
3765426ca0afa7e54e95d64831ff12e65c2a92e8
tests/integration/test_main.py
tests/integration/test_main.py
""" """ from zazo import main def test_main(capsys): retval = main() assert retval == 0 assert capsys.readouterr() == ("Hello World!\n", "")
Add an integration test to satisfy Travis
Add an integration test to satisfy Travis
Python
mit
pradyunsg/zazo,pradyunsg/zazo
Add an integration test to satisfy Travis
""" """ from zazo import main def test_main(capsys): retval = main() assert retval == 0 assert capsys.readouterr() == ("Hello World!\n", "")
<commit_before><commit_msg>Add an integration test to satisfy Travis<commit_after>
""" """ from zazo import main def test_main(capsys): retval = main() assert retval == 0 assert capsys.readouterr() == ("Hello World!\n", "")
Add an integration test to satisfy Travis""" """ from zazo import main def test_main(capsys): retval = main() assert retval == 0 assert capsys.readouterr() == ("Hello World!\n", "")
<commit_before><commit_msg>Add an integration test to satisfy Travis<commit_after>""" """ from zazo import main def test_main(capsys): retval = main() assert retval == 0 assert capsys.readouterr() == ("Hello World!\n", "")
8a1eb115fec1345587d75b445c9c6cc9bc1ac1a1
test/test_logger.py
test/test_logger.py
# encoding: utf-8 """ .. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com> """ from __future__ import print_function from __future__ import unicode_literals import logbook from pytablereader import ( set_logger, set_log_level, ) import pytest class Test_set_logger(object): @pytest.mark.para...
Add test cases for the logger
Add test cases for the logger
Python
mit
thombashi/pytablereader,thombashi/pytablereader,thombashi/pytablereader
Add test cases for the logger
# encoding: utf-8 """ .. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com> """ from __future__ import print_function from __future__ import unicode_literals import logbook from pytablereader import ( set_logger, set_log_level, ) import pytest class Test_set_logger(object): @pytest.mark.para...
<commit_before><commit_msg>Add test cases for the logger<commit_after>
# encoding: utf-8 """ .. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com> """ from __future__ import print_function from __future__ import unicode_literals import logbook from pytablereader import ( set_logger, set_log_level, ) import pytest class Test_set_logger(object): @pytest.mark.para...
Add test cases for the logger# encoding: utf-8 """ .. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com> """ from __future__ import print_function from __future__ import unicode_literals import logbook from pytablereader import ( set_logger, set_log_level, ) import pytest class Test_set_logger(ob...
<commit_before><commit_msg>Add test cases for the logger<commit_after># encoding: utf-8 """ .. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com> """ from __future__ import print_function from __future__ import unicode_literals import logbook from pytablereader import ( set_logger, set_log_level, )...
88cfa6ef3d04e9c2bb8bb0757479d1d191b27059
tests/test_enums.py
tests/test_enums.py
""" test_enums ~~~~~~~~~~ Contains tests for the :mod:`~adbwp.enums` module. """ import pytest from adbwp import enums @pytest.mark.parametrize(('enum_value', 'int_value'), list(zip(enums.Command, (0x434e5953, 0x4e584e43, 0x48545541, ...
Add tests for enums module.
Add tests for enums module.
Python
apache-2.0
adbpy/wire-protocol
Add tests for enums module.
""" test_enums ~~~~~~~~~~ Contains tests for the :mod:`~adbwp.enums` module. """ import pytest from adbwp import enums @pytest.mark.parametrize(('enum_value', 'int_value'), list(zip(enums.Command, (0x434e5953, 0x4e584e43, 0x48545541, ...
<commit_before><commit_msg>Add tests for enums module.<commit_after>
""" test_enums ~~~~~~~~~~ Contains tests for the :mod:`~adbwp.enums` module. """ import pytest from adbwp import enums @pytest.mark.parametrize(('enum_value', 'int_value'), list(zip(enums.Command, (0x434e5953, 0x4e584e43, 0x48545541, ...
Add tests for enums module.""" test_enums ~~~~~~~~~~ Contains tests for the :mod:`~adbwp.enums` module. """ import pytest from adbwp import enums @pytest.mark.parametrize(('enum_value', 'int_value'), list(zip(enums.Command, (0x434e5953, 0x4e584e43, 0x48545541, ...
<commit_before><commit_msg>Add tests for enums module.<commit_after>""" test_enums ~~~~~~~~~~ Contains tests for the :mod:`~adbwp.enums` module. """ import pytest from adbwp import enums @pytest.mark.parametrize(('enum_value', 'int_value'), list(zip(enums.Command, (0x434e5953, 0x4e584e43, 0x48545541, ...
a61be6f1106764f3da4c66f37ef8a768208ff9b3
glamkit_collections/contrib/work_creator/migrations/0008_auto_20161114_1240.py
glamkit_collections/contrib/work_creator/migrations/0008_auto_20161114_1240.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('gk_collections_work_creator', '0007_auto_20161028_1904'), ] operations = [ migrations.AlterField( model_name='wo...
Change label for date fields
Change label for date fields
Python
mit
ic-labs/django-icekit,ic-labs/django-icekit,ic-labs/django-icekit,ic-labs/glamkit-collections,ic-labs/django-icekit,ic-labs/glamkit-collections
Change label for date fields
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('gk_collections_work_creator', '0007_auto_20161028_1904'), ] operations = [ migrations.AlterField( model_name='wo...
<commit_before><commit_msg>Change label for date fields<commit_after>
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('gk_collections_work_creator', '0007_auto_20161028_1904'), ] operations = [ migrations.AlterField( model_name='wo...
Change label for date fields# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('gk_collections_work_creator', '0007_auto_20161028_1904'), ] operations = [ migrations.AlterField...
<commit_before><commit_msg>Change label for date fields<commit_after># -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('gk_collections_work_creator', '0007_auto_20161028_1904'), ] ope...
39d81fe577d6201b320e84617317170ac5264394
genealogio/migrations/0022_auto_20160228_1652.py
genealogio/migrations/0022_auto_20160228_1652.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('genealogio', '0021_family_comments'), ] operations = [ migrations.AlterModelOptions( name='family', ...
Add migration for changing ordering of Family field.
Add migration for changing ordering of Family field.
Python
bsd-3-clause
ugoertz/django-familio,ugoertz/django-familio,ugoertz/django-familio,ugoertz/django-familio
Add migration for changing ordering of Family field.
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('genealogio', '0021_family_comments'), ] operations = [ migrations.AlterModelOptions( name='family', ...
<commit_before><commit_msg>Add migration for changing ordering of Family field.<commit_after>
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('genealogio', '0021_family_comments'), ] operations = [ migrations.AlterModelOptions( name='family', ...
Add migration for changing ordering of Family field.# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('genealogio', '0021_family_comments'), ] operations = [ migrations.AlterM...
<commit_before><commit_msg>Add migration for changing ordering of Family field.<commit_after># -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('genealogio', '0021_family_comments'), ] ...
f67a6748b7282cbc256423b3c98c3321d4c028c0
FrontGateManager.py
FrontGateManager.py
#!/usr/bin/python import urllib2 import RPi.GPIO as GPIO from time import sleep class Sonos: apiPort = 5005 apiHost = '127.0.0.1' def say(self, room, str, lang = 'en-us'): path = 'http://{host}:{port}/{room}/say/{str}/{lang}'.format( host = self.apiHost, port...
Add Front Gate Manager python file
Add Front Gate Manager python file
Python
mit
tdlm/front_gate_pi
Add Front Gate Manager python file
#!/usr/bin/python import urllib2 import RPi.GPIO as GPIO from time import sleep class Sonos: apiPort = 5005 apiHost = '127.0.0.1' def say(self, room, str, lang = 'en-us'): path = 'http://{host}:{port}/{room}/say/{str}/{lang}'.format( host = self.apiHost, port...
<commit_before><commit_msg>Add Front Gate Manager python file<commit_after>
#!/usr/bin/python import urllib2 import RPi.GPIO as GPIO from time import sleep class Sonos: apiPort = 5005 apiHost = '127.0.0.1' def say(self, room, str, lang = 'en-us'): path = 'http://{host}:{port}/{room}/say/{str}/{lang}'.format( host = self.apiHost, port...
Add Front Gate Manager python file#!/usr/bin/python import urllib2 import RPi.GPIO as GPIO from time import sleep class Sonos: apiPort = 5005 apiHost = '127.0.0.1' def say(self, room, str, lang = 'en-us'): path = 'http://{host}:{port}/{room}/say/{str}/{lang}'.format( ...
<commit_before><commit_msg>Add Front Gate Manager python file<commit_after>#!/usr/bin/python import urllib2 import RPi.GPIO as GPIO from time import sleep class Sonos: apiPort = 5005 apiHost = '127.0.0.1' def say(self, room, str, lang = 'en-us'): path = 'http://{host}:{port}/{...
07d01ecba7eaafc71c07cdf1b907201477496846
pygments/styles/igor.py
pygments/styles/igor.py
from pygments.style import Style from pygments.token import Keyword, Name, Comment, String, Error, \ Number, Operator, Generic class IgorStyle(Style): default_style = "" styles = { Comment: 'italic #FF0000', Keyword: '#0000FF', Name.Function: ...
Add custom style which imitates the offical coloring
Add custom style which imitates the offical coloring
Python
bsd-2-clause
spencerlyon2/pygments,spencerlyon2/pygments,spencerlyon2/pygments,spencerlyon2/pygments,spencerlyon2/pygments,spencerlyon2/pygments,spencerlyon2/pygments,spencerlyon2/pygments,spencerlyon2/pygments,spencerlyon2/pygments,spencerlyon2/pygments,spencerlyon2/pygments,spencerlyon2/pygments,spencerlyon2/pygments,spencerlyon2...
Add custom style which imitates the offical coloring
from pygments.style import Style from pygments.token import Keyword, Name, Comment, String, Error, \ Number, Operator, Generic class IgorStyle(Style): default_style = "" styles = { Comment: 'italic #FF0000', Keyword: '#0000FF', Name.Function: ...
<commit_before><commit_msg>Add custom style which imitates the offical coloring<commit_after>
from pygments.style import Style from pygments.token import Keyword, Name, Comment, String, Error, \ Number, Operator, Generic class IgorStyle(Style): default_style = "" styles = { Comment: 'italic #FF0000', Keyword: '#0000FF', Name.Function: ...
Add custom style which imitates the offical coloringfrom pygments.style import Style from pygments.token import Keyword, Name, Comment, String, Error, \ Number, Operator, Generic class IgorStyle(Style): default_style = "" styles = { Comment: 'italic #FF0000', Keyword: ...
<commit_before><commit_msg>Add custom style which imitates the offical coloring<commit_after>from pygments.style import Style from pygments.token import Keyword, Name, Comment, String, Error, \ Number, Operator, Generic class IgorStyle(Style): default_style = "" styles = { Comment: ...
232c0a600946e2a679947fe638938e56d2fa7709
vint/ast/parsing.py
vint/ast/parsing.py
import extlib.vimlparser class Parser(object): def __init__(self, plugins=None): """ Initialize Parser with the specified plugins. The plugins can add attributes to the AST. """ self.plugins = plugins or [] def parse(self, string): """ Parse vim script string and retu...
import extlib.vimlparser class Parser(object): def __init__(self, plugins=None): """ Initialize Parser with the specified plugins. The plugins can add attributes to the AST. """ self.plugins = plugins or [] def parse(self, string): """ Parse vim script string and retu...
Add TOPLEVEL pos to unify node pos interface
Add TOPLEVEL pos to unify node pos interface
Python
mit
RianFuro/vint,Kuniwak/vint,RianFuro/vint,Kuniwak/vint
import extlib.vimlparser class Parser(object): def __init__(self, plugins=None): """ Initialize Parser with the specified plugins. The plugins can add attributes to the AST. """ self.plugins = plugins or [] def parse(self, string): """ Parse vim script string and retu...
import extlib.vimlparser class Parser(object): def __init__(self, plugins=None): """ Initialize Parser with the specified plugins. The plugins can add attributes to the AST. """ self.plugins = plugins or [] def parse(self, string): """ Parse vim script string and retu...
<commit_before>import extlib.vimlparser class Parser(object): def __init__(self, plugins=None): """ Initialize Parser with the specified plugins. The plugins can add attributes to the AST. """ self.plugins = plugins or [] def parse(self, string): """ Parse vim script ...
import extlib.vimlparser class Parser(object): def __init__(self, plugins=None): """ Initialize Parser with the specified plugins. The plugins can add attributes to the AST. """ self.plugins = plugins or [] def parse(self, string): """ Parse vim script string and retu...
import extlib.vimlparser class Parser(object): def __init__(self, plugins=None): """ Initialize Parser with the specified plugins. The plugins can add attributes to the AST. """ self.plugins = plugins or [] def parse(self, string): """ Parse vim script string and retu...
<commit_before>import extlib.vimlparser class Parser(object): def __init__(self, plugins=None): """ Initialize Parser with the specified plugins. The plugins can add attributes to the AST. """ self.plugins = plugins or [] def parse(self, string): """ Parse vim script ...
f12ba8623078322a57f23c55c9ce44883d22d18b
py/binary-search-tree-iterator.py
py/binary-search-tree-iterator.py
# Definition for a binary tree node # class TreeNode(object): # def __init__(self, x): # self.val = x # self.left = None # self.right = None class BSTIterator(object): def __init__(self, root): """ :type root: TreeNode """ self.cache = None self....
Add py solution for Binary Search Tree Iterator
Add py solution for Binary Search Tree Iterator Binary Search Tree Iterator: https://leetcode.com/problems/binary-search-tree-iterator/
Python
apache-2.0
ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode
Add py solution for Binary Search Tree Iterator Binary Search Tree Iterator: https://leetcode.com/problems/binary-search-tree-iterator/
# Definition for a binary tree node # class TreeNode(object): # def __init__(self, x): # self.val = x # self.left = None # self.right = None class BSTIterator(object): def __init__(self, root): """ :type root: TreeNode """ self.cache = None self....
<commit_before><commit_msg>Add py solution for Binary Search Tree Iterator Binary Search Tree Iterator: https://leetcode.com/problems/binary-search-tree-iterator/<commit_after>
# Definition for a binary tree node # class TreeNode(object): # def __init__(self, x): # self.val = x # self.left = None # self.right = None class BSTIterator(object): def __init__(self, root): """ :type root: TreeNode """ self.cache = None self....
Add py solution for Binary Search Tree Iterator Binary Search Tree Iterator: https://leetcode.com/problems/binary-search-tree-iterator/# Definition for a binary tree node # class TreeNode(object): # def __init__(self, x): # self.val = x # self.left = None # self.right = None class BSTIter...
<commit_before><commit_msg>Add py solution for Binary Search Tree Iterator Binary Search Tree Iterator: https://leetcode.com/problems/binary-search-tree-iterator/<commit_after># Definition for a binary tree node # class TreeNode(object): # def __init__(self, x): # self.val = x # self.left = None #...
8484bfe2870968e43c46b764688202d3c74213c0
ooni/tests/test_reporter.py
ooni/tests/test_reporter.py
import yaml import time from twisted.trial import unittest from ooni.reporter import YAMLReporter class MockTest(object): _start_time = time.time() report = {'report_content': 'ham'} input = 'spam' class TestYAMLReporter(unittest.TestCase): def setUp(self): pass def test_write_report(se...
Add unittest for the YAMLReporter
Add unittest for the YAMLReporter
Python
bsd-2-clause
Karthikeyan-kkk/ooni-probe,lordappsec/ooni-probe,kdmurray91/ooni-probe,0xPoly/ooni-probe,0xPoly/ooni-probe,juga0/ooni-probe,0xPoly/ooni-probe,juga0/ooni-probe,0xPoly/ooni-probe,kdmurray91/ooni-probe,lordappsec/ooni-probe,juga0/ooni-probe,juga0/ooni-probe,kdmurray91/ooni-probe,lordappsec/ooni-probe,Karthikeyan-kkk/ooni-...
Add unittest for the YAMLReporter
import yaml import time from twisted.trial import unittest from ooni.reporter import YAMLReporter class MockTest(object): _start_time = time.time() report = {'report_content': 'ham'} input = 'spam' class TestYAMLReporter(unittest.TestCase): def setUp(self): pass def test_write_report(se...
<commit_before><commit_msg>Add unittest for the YAMLReporter<commit_after>
import yaml import time from twisted.trial import unittest from ooni.reporter import YAMLReporter class MockTest(object): _start_time = time.time() report = {'report_content': 'ham'} input = 'spam' class TestYAMLReporter(unittest.TestCase): def setUp(self): pass def test_write_report(se...
Add unittest for the YAMLReporterimport yaml import time from twisted.trial import unittest from ooni.reporter import YAMLReporter class MockTest(object): _start_time = time.time() report = {'report_content': 'ham'} input = 'spam' class TestYAMLReporter(unittest.TestCase): def setUp(self): p...
<commit_before><commit_msg>Add unittest for the YAMLReporter<commit_after>import yaml import time from twisted.trial import unittest from ooni.reporter import YAMLReporter class MockTest(object): _start_time = time.time() report = {'report_content': 'ham'} input = 'spam' class TestYAMLReporter(unittest....
7c1807c7981ab6d934efcf4e3044ee502da81bc5
scripts/fix-boost-dylib-id.py
scripts/fix-boost-dylib-id.py
#!/usr/bin/env python3 # Copyright (c) 2013, Ruslan Baratov # All rights reserved. import argparse import glob import os import re import subprocess import sys parser = argparse.ArgumentParser(description='Fix boost dynamic libraries id') parser.add_argument( '--install-dir', required=True, help='Libraries insta...
Add script: fix boost dylib id on Mac OSX
Add script: fix boost dylib id on Mac OSX [skip ci]
Python
bsd-2-clause
dvirtz/hunter,NeroBurner/hunter,ulricheck/hunter,x10mind/hunter,sumedhghaisas/hunter,isaachier/hunter,ulricheck/hunter,tatraian/hunter,daminetreg/hunter,ErniBrown/hunter,RomanYudintsev/hunter,ikliashchou/hunter,mchiasson/hunter,ThomasFeher/hunter,dvirtz/hunter,madmongo1/hunter,stohrendorf/hunter,madmongo1/hunter,mchias...
Add script: fix boost dylib id on Mac OSX [skip ci]
#!/usr/bin/env python3 # Copyright (c) 2013, Ruslan Baratov # All rights reserved. import argparse import glob import os import re import subprocess import sys parser = argparse.ArgumentParser(description='Fix boost dynamic libraries id') parser.add_argument( '--install-dir', required=True, help='Libraries insta...
<commit_before><commit_msg>Add script: fix boost dylib id on Mac OSX [skip ci]<commit_after>
#!/usr/bin/env python3 # Copyright (c) 2013, Ruslan Baratov # All rights reserved. import argparse import glob import os import re import subprocess import sys parser = argparse.ArgumentParser(description='Fix boost dynamic libraries id') parser.add_argument( '--install-dir', required=True, help='Libraries insta...
Add script: fix boost dylib id on Mac OSX [skip ci]#!/usr/bin/env python3 # Copyright (c) 2013, Ruslan Baratov # All rights reserved. import argparse import glob import os import re import subprocess import sys parser = argparse.ArgumentParser(description='Fix boost dynamic libraries id') parser.add_argument( '-...
<commit_before><commit_msg>Add script: fix boost dylib id on Mac OSX [skip ci]<commit_after>#!/usr/bin/env python3 # Copyright (c) 2013, Ruslan Baratov # All rights reserved. import argparse import glob import os import re import subprocess import sys parser = argparse.ArgumentParser(description='Fix boost dynamic l...
45b42cf32fa82a590e854ac1fe765525ddef4f41
sample/python/swift_put_object.py
sample/python/swift_put_object.py
#!/usr/bin/env python import pprint import sys from os import environ as env from swiftclient.client import get_auth, put_object, put_container from swiftclient.exceptions import ClientException auth_url = env.get('OS_AUTH_URL') account = env.get('OS_TENANT_NAME') user = env.get('OS_USERNAME') key = env.get('OS_PASS...
Add a put_object sample script.
Add a put_object sample script.
Python
apache-2.0
yoyama/swift_book
Add a put_object sample script.
#!/usr/bin/env python import pprint import sys from os import environ as env from swiftclient.client import get_auth, put_object, put_container from swiftclient.exceptions import ClientException auth_url = env.get('OS_AUTH_URL') account = env.get('OS_TENANT_NAME') user = env.get('OS_USERNAME') key = env.get('OS_PASS...
<commit_before><commit_msg>Add a put_object sample script.<commit_after>
#!/usr/bin/env python import pprint import sys from os import environ as env from swiftclient.client import get_auth, put_object, put_container from swiftclient.exceptions import ClientException auth_url = env.get('OS_AUTH_URL') account = env.get('OS_TENANT_NAME') user = env.get('OS_USERNAME') key = env.get('OS_PASS...
Add a put_object sample script.#!/usr/bin/env python import pprint import sys from os import environ as env from swiftclient.client import get_auth, put_object, put_container from swiftclient.exceptions import ClientException auth_url = env.get('OS_AUTH_URL') account = env.get('OS_TENANT_NAME') user = env.get('OS_US...
<commit_before><commit_msg>Add a put_object sample script.<commit_after>#!/usr/bin/env python import pprint import sys from os import environ as env from swiftclient.client import get_auth, put_object, put_container from swiftclient.exceptions import ClientException auth_url = env.get('OS_AUTH_URL') account = env.ge...
4ec4acf3b70f939e261dfb3425b23dad97a799f6
techgig_string_membership.py
techgig_string_membership.py
def main(): a=raw_input() c=raw_input() if a.find(c)>=0: print "True" else: print "False" # Write code here main()
Print true if the character is present in the string
Print true if the character is present in the string
Python
mit
kumarisneha/practice_repo
Print true if the character is present in the string
def main(): a=raw_input() c=raw_input() if a.find(c)>=0: print "True" else: print "False" # Write code here main()
<commit_before><commit_msg>Print true if the character is present in the string<commit_after>
def main(): a=raw_input() c=raw_input() if a.find(c)>=0: print "True" else: print "False" # Write code here main()
Print true if the character is present in the stringdef main(): a=raw_input() c=raw_input() if a.find(c)>=0: print "True" else: print "False" # Write code here main()
<commit_before><commit_msg>Print true if the character is present in the string<commit_after>def main(): a=raw_input() c=raw_input() if a.find(c)>=0: print "True" else: print "False" # Write code here main()
4daca355a9ba2807b9f992199e6a1ca78d3678fd
wordpress_formatter.py
wordpress_formatter.py
import sys def fixFormat(file_name): original = open(file_name, 'r') fixed_copy = open("fixed_" + file_name, 'w') for line in original: line = line.replace('&lt;', '<') line = line.replace('&gt;', '>') line = line.replace("&quot;", '"') fixed_copy.write(line) orig...
Add core functionality for formatter
Add core functionality for formatter
Python
mit
HenryDangPRG/WordPress-Code-Formatter
Add core functionality for formatter
import sys def fixFormat(file_name): original = open(file_name, 'r') fixed_copy = open("fixed_" + file_name, 'w') for line in original: line = line.replace('&lt;', '<') line = line.replace('&gt;', '>') line = line.replace("&quot;", '"') fixed_copy.write(line) orig...
<commit_before><commit_msg>Add core functionality for formatter<commit_after>
import sys def fixFormat(file_name): original = open(file_name, 'r') fixed_copy = open("fixed_" + file_name, 'w') for line in original: line = line.replace('&lt;', '<') line = line.replace('&gt;', '>') line = line.replace("&quot;", '"') fixed_copy.write(line) orig...
Add core functionality for formatterimport sys def fixFormat(file_name): original = open(file_name, 'r') fixed_copy = open("fixed_" + file_name, 'w') for line in original: line = line.replace('&lt;', '<') line = line.replace('&gt;', '>') line = line.replace("&quot;", '"') ...
<commit_before><commit_msg>Add core functionality for formatter<commit_after>import sys def fixFormat(file_name): original = open(file_name, 'r') fixed_copy = open("fixed_" + file_name, 'w') for line in original: line = line.replace('&lt;', '<') line = line.replace('&gt;', '>') ...
8976733c9e2cf0fb03d93187fb138c07416648d9
ttt.py
ttt.py
#!/usr/bin/env python3 from collections import namedtuple import csv WordList = namedtuple("WordList", ['nouns', 'verbs', 'conjunctions', 'others']) def load_wordlist(filename): wordlist = WordList([], [], [], []) # A totally empty list. with open(filename) as wordlist_file: for line in wordlist_file...
Add ability to load wordlists into useable datastructures.
Add ability to load wordlists into useable datastructures.
Python
mit
SilverWingedSeraph/tor-to-terabithia
Add ability to load wordlists into useable datastructures.
#!/usr/bin/env python3 from collections import namedtuple import csv WordList = namedtuple("WordList", ['nouns', 'verbs', 'conjunctions', 'others']) def load_wordlist(filename): wordlist = WordList([], [], [], []) # A totally empty list. with open(filename) as wordlist_file: for line in wordlist_file...
<commit_before><commit_msg>Add ability to load wordlists into useable datastructures.<commit_after>
#!/usr/bin/env python3 from collections import namedtuple import csv WordList = namedtuple("WordList", ['nouns', 'verbs', 'conjunctions', 'others']) def load_wordlist(filename): wordlist = WordList([], [], [], []) # A totally empty list. with open(filename) as wordlist_file: for line in wordlist_file...
Add ability to load wordlists into useable datastructures.#!/usr/bin/env python3 from collections import namedtuple import csv WordList = namedtuple("WordList", ['nouns', 'verbs', 'conjunctions', 'others']) def load_wordlist(filename): wordlist = WordList([], [], [], []) # A totally empty list. with open(fil...
<commit_before><commit_msg>Add ability to load wordlists into useable datastructures.<commit_after>#!/usr/bin/env python3 from collections import namedtuple import csv WordList = namedtuple("WordList", ['nouns', 'verbs', 'conjunctions', 'others']) def load_wordlist(filename): wordlist = WordList([], [], [], []) ...
9df3c8f04c25866a92b262218ca5976536097837
tracpro/orgs_ext/tests/test_utils.py
tracpro/orgs_ext/tests/test_utils.py
import mock from requests import HTTPError from django.test import TestCase from temba.base import TembaAPIError from tracpro.test import factories from .. import utils class TestRunOrgTask(TestCase): def setUp(self): super(TestRunOrgTask, self).setUp() self.mock_task = mock.Mock(return_value...
Add tests for org task util
Add tests for org task util
Python
bsd-3-clause
xkmato/tracpro,rapidpro/tracpro,rapidpro/tracpro,xkmato/tracpro,xkmato/tracpro,xkmato/tracpro,rapidpro/tracpro
Add tests for org task util
import mock from requests import HTTPError from django.test import TestCase from temba.base import TembaAPIError from tracpro.test import factories from .. import utils class TestRunOrgTask(TestCase): def setUp(self): super(TestRunOrgTask, self).setUp() self.mock_task = mock.Mock(return_value...
<commit_before><commit_msg>Add tests for org task util<commit_after>
import mock from requests import HTTPError from django.test import TestCase from temba.base import TembaAPIError from tracpro.test import factories from .. import utils class TestRunOrgTask(TestCase): def setUp(self): super(TestRunOrgTask, self).setUp() self.mock_task = mock.Mock(return_value...
Add tests for org task utilimport mock from requests import HTTPError from django.test import TestCase from temba.base import TembaAPIError from tracpro.test import factories from .. import utils class TestRunOrgTask(TestCase): def setUp(self): super(TestRunOrgTask, self).setUp() self.mock_ta...
<commit_before><commit_msg>Add tests for org task util<commit_after>import mock from requests import HTTPError from django.test import TestCase from temba.base import TembaAPIError from tracpro.test import factories from .. import utils class TestRunOrgTask(TestCase): def setUp(self): super(TestRunOr...
c13d90c3feeec531ee9ad4a3d9346390782cba7c
ex43.py
ex43.py
class Scene(object): def enter(self): pass class Engine(object): def __init__(self, scene_map): pass def play(self): pass class Death(Scene): def enter(self): pass class CentralCorridor(Scene): def enter(self): pass class TheBridge(Scene): def en...
Add initial code for exercise 43.
Add initial code for exercise 43.
Python
mit
hectoregm/lphw
Add initial code for exercise 43.
class Scene(object): def enter(self): pass class Engine(object): def __init__(self, scene_map): pass def play(self): pass class Death(Scene): def enter(self): pass class CentralCorridor(Scene): def enter(self): pass class TheBridge(Scene): def en...
<commit_before><commit_msg>Add initial code for exercise 43.<commit_after>
class Scene(object): def enter(self): pass class Engine(object): def __init__(self, scene_map): pass def play(self): pass class Death(Scene): def enter(self): pass class CentralCorridor(Scene): def enter(self): pass class TheBridge(Scene): def en...
Add initial code for exercise 43.class Scene(object): def enter(self): pass class Engine(object): def __init__(self, scene_map): pass def play(self): pass class Death(Scene): def enter(self): pass class CentralCorridor(Scene): def enter(self): pass cl...
<commit_before><commit_msg>Add initial code for exercise 43.<commit_after>class Scene(object): def enter(self): pass class Engine(object): def __init__(self, scene_map): pass def play(self): pass class Death(Scene): def enter(self): pass class CentralCorridor(Scene...
a94aab8fa6e795d1e440e20e9751810393ac0a73
tests/test_ping.py
tests/test_ping.py
from flask.ext.resty import Api import pytest # ----------------------------------------------------------------------------- @pytest.fixture(autouse=True) def routes(app): api = Api(app, '/api') api.add_ping('/ping') # ----------------------------------------------------------------------------- def tes...
Add test for ping endpoint
Add test for ping endpoint
Python
mit
taion/flask-jsonapiview,4Catalyzer/flask-jsonapiview,4Catalyzer/flask-resty
Add test for ping endpoint
from flask.ext.resty import Api import pytest # ----------------------------------------------------------------------------- @pytest.fixture(autouse=True) def routes(app): api = Api(app, '/api') api.add_ping('/ping') # ----------------------------------------------------------------------------- def tes...
<commit_before><commit_msg>Add test for ping endpoint<commit_after>
from flask.ext.resty import Api import pytest # ----------------------------------------------------------------------------- @pytest.fixture(autouse=True) def routes(app): api = Api(app, '/api') api.add_ping('/ping') # ----------------------------------------------------------------------------- def tes...
Add test for ping endpointfrom flask.ext.resty import Api import pytest # ----------------------------------------------------------------------------- @pytest.fixture(autouse=True) def routes(app): api = Api(app, '/api') api.add_ping('/ping') # -------------------------------------------------------------...
<commit_before><commit_msg>Add test for ping endpoint<commit_after>from flask.ext.resty import Api import pytest # ----------------------------------------------------------------------------- @pytest.fixture(autouse=True) def routes(app): api = Api(app, '/api') api.add_ping('/ping') # --------------------...
84796e96d8ad413fd657b6207025a0e64d680598
src/maximum_subarray.py
src/maximum_subarray.py
# brute force solution # it works, but Time Limit Exceeded in leetcode class Solution1: # @param {integer[]} nums # @return {integer} def maxSubArray(self, nums): if not nums: return None maxSum = nums[0] for size in range(1, len(nums)+1): for i in range(0, le...
Add a brute force solution for the maximum subarray
Add a brute force solution for the maximum subarray
Python
mit
chancyWu/leetcode
Add a brute force solution for the maximum subarray
# brute force solution # it works, but Time Limit Exceeded in leetcode class Solution1: # @param {integer[]} nums # @return {integer} def maxSubArray(self, nums): if not nums: return None maxSum = nums[0] for size in range(1, len(nums)+1): for i in range(0, le...
<commit_before><commit_msg>Add a brute force solution for the maximum subarray<commit_after>
# brute force solution # it works, but Time Limit Exceeded in leetcode class Solution1: # @param {integer[]} nums # @return {integer} def maxSubArray(self, nums): if not nums: return None maxSum = nums[0] for size in range(1, len(nums)+1): for i in range(0, le...
Add a brute force solution for the maximum subarray# brute force solution # it works, but Time Limit Exceeded in leetcode class Solution1: # @param {integer[]} nums # @return {integer} def maxSubArray(self, nums): if not nums: return None maxSum = nums[0] for size in rang...
<commit_before><commit_msg>Add a brute force solution for the maximum subarray<commit_after># brute force solution # it works, but Time Limit Exceeded in leetcode class Solution1: # @param {integer[]} nums # @return {integer} def maxSubArray(self, nums): if not nums: return None ...
dbff077245130f175fdabaa347e33de7a2b71450
twitch_channels.py
twitch_channels.py
#!/usr/bin/env python """ twitch_channels.py - Queries Twitch for channels of interest. Used in conjunction with livestreamer-completion. Usage examples: ./twitch_channels.py --follows myname ./twitch_channels.py --team eg --team teamliquid """ from __future__ import print_function from argpars...
Add extra utility to generate a URL list.
Add extra utility to generate a URL list.
Python
mit
chrippa/livestreamer-completion,chrippa/livestreamer-completion
Add extra utility to generate a URL list.
#!/usr/bin/env python """ twitch_channels.py - Queries Twitch for channels of interest. Used in conjunction with livestreamer-completion. Usage examples: ./twitch_channels.py --follows myname ./twitch_channels.py --team eg --team teamliquid """ from __future__ import print_function from argpars...
<commit_before><commit_msg>Add extra utility to generate a URL list.<commit_after>
#!/usr/bin/env python """ twitch_channels.py - Queries Twitch for channels of interest. Used in conjunction with livestreamer-completion. Usage examples: ./twitch_channels.py --follows myname ./twitch_channels.py --team eg --team teamliquid """ from __future__ import print_function from argpars...
Add extra utility to generate a URL list.#!/usr/bin/env python """ twitch_channels.py - Queries Twitch for channels of interest. Used in conjunction with livestreamer-completion. Usage examples: ./twitch_channels.py --follows myname ./twitch_channels.py --team eg --team teamliquid """ from __fut...
<commit_before><commit_msg>Add extra utility to generate a URL list.<commit_after>#!/usr/bin/env python """ twitch_channels.py - Queries Twitch for channels of interest. Used in conjunction with livestreamer-completion. Usage examples: ./twitch_channels.py --follows myname ./twitch_channels.py --t...
c9e0f57b867404ba5ae7871caa63c4ccd8b90a1d
reporting/get_couchdata_for_calisphere_id.py
reporting/get_couchdata_for_calisphere_id.py
# -*- coding: utf-8 -*- # Use this to get data from the couchdb instance for a record from calisphere # defaults to the staging environment import sys import argparse import urllib import ConfigParser import requests from get_solr_json import get_solr_json url_couchdb = 'https://harvest-stg.cdlib.org/couchdb/ucldc/' ...
Add tool for debug of Calisphere id.
Add tool for debug of Calisphere id.
Python
bsd-3-clause
mredar/ucldc_api_data_quality,mredar/ucldc_api_data_quality,mredar/ucldc_api_data_quality,mredar/ucldc_api_data_quality
Add tool for debug of Calisphere id.
# -*- coding: utf-8 -*- # Use this to get data from the couchdb instance for a record from calisphere # defaults to the staging environment import sys import argparse import urllib import ConfigParser import requests from get_solr_json import get_solr_json url_couchdb = 'https://harvest-stg.cdlib.org/couchdb/ucldc/' ...
<commit_before><commit_msg>Add tool for debug of Calisphere id.<commit_after>
# -*- coding: utf-8 -*- # Use this to get data from the couchdb instance for a record from calisphere # defaults to the staging environment import sys import argparse import urllib import ConfigParser import requests from get_solr_json import get_solr_json url_couchdb = 'https://harvest-stg.cdlib.org/couchdb/ucldc/' ...
Add tool for debug of Calisphere id.# -*- coding: utf-8 -*- # Use this to get data from the couchdb instance for a record from calisphere # defaults to the staging environment import sys import argparse import urllib import ConfigParser import requests from get_solr_json import get_solr_json url_couchdb = 'https://ha...
<commit_before><commit_msg>Add tool for debug of Calisphere id.<commit_after># -*- coding: utf-8 -*- # Use this to get data from the couchdb instance for a record from calisphere # defaults to the staging environment import sys import argparse import urllib import ConfigParser import requests from get_solr_json import...
07e9f20a190e07650e064985b4eee7b10de442e5
build-scripts/pyget.py
build-scripts/pyget.py
#!/usr/bin/python ### ### Simple HTTP download utility for platforms without wget ### ### Copyright 2008 Steven J. Murdoch <http://www.cl.cam.ac.uk/users/sjm217/> ### See LICENSE for licensing information ### ### $Id$ ### import sys import os import urllib import urlparse from optparse import OptionParser ## Destina...
Add a wget replacement for platforms that don't have wget
Add a wget replacement for platforms that don't have wget svn:r13313
Python
bsd-3-clause
Shondoit/torbrowser,Shondoit/torbrowser,Shondoit/torbrowser,Shondoit/torbrowser
Add a wget replacement for platforms that don't have wget svn:r13313
#!/usr/bin/python ### ### Simple HTTP download utility for platforms without wget ### ### Copyright 2008 Steven J. Murdoch <http://www.cl.cam.ac.uk/users/sjm217/> ### See LICENSE for licensing information ### ### $Id$ ### import sys import os import urllib import urlparse from optparse import OptionParser ## Destina...
<commit_before><commit_msg>Add a wget replacement for platforms that don't have wget svn:r13313<commit_after>
#!/usr/bin/python ### ### Simple HTTP download utility for platforms without wget ### ### Copyright 2008 Steven J. Murdoch <http://www.cl.cam.ac.uk/users/sjm217/> ### See LICENSE for licensing information ### ### $Id$ ### import sys import os import urllib import urlparse from optparse import OptionParser ## Destina...
Add a wget replacement for platforms that don't have wget svn:r13313#!/usr/bin/python ### ### Simple HTTP download utility for platforms without wget ### ### Copyright 2008 Steven J. Murdoch <http://www.cl.cam.ac.uk/users/sjm217/> ### See LICENSE for licensing information ### ### $Id$ ### import sys import os import...
<commit_before><commit_msg>Add a wget replacement for platforms that don't have wget svn:r13313<commit_after>#!/usr/bin/python ### ### Simple HTTP download utility for platforms without wget ### ### Copyright 2008 Steven J. Murdoch <http://www.cl.cam.ac.uk/users/sjm217/> ### See LICENSE for licensing information ### ...
1c5bad48cf058022a14756615d0faa5833a63501
src/encoded/tests/data/inserts/test_types_pipeline.py
src/encoded/tests/data/inserts/test_types_pipeline.py
import pytest def test_analysis_step_version_name_calcprop(testapp, analysis_step_version): assert analysis_step_version['minor_version'] == 0 assert analysis_step_version['name'] == 'fastqc-step-v-1-0' assert analysis_step_version['@id'] == '/analysis-step-versions/fastqc-step-v-1-0/'
Add test for calcprops in pipeline related objects
Add test for calcprops in pipeline related objects
Python
mit
ENCODE-DCC/encoded,ENCODE-DCC/encoded,ENCODE-DCC/encoded,ENCODE-DCC/encoded
Add test for calcprops in pipeline related objects
import pytest def test_analysis_step_version_name_calcprop(testapp, analysis_step_version): assert analysis_step_version['minor_version'] == 0 assert analysis_step_version['name'] == 'fastqc-step-v-1-0' assert analysis_step_version['@id'] == '/analysis-step-versions/fastqc-step-v-1-0/'
<commit_before><commit_msg>Add test for calcprops in pipeline related objects<commit_after>
import pytest def test_analysis_step_version_name_calcprop(testapp, analysis_step_version): assert analysis_step_version['minor_version'] == 0 assert analysis_step_version['name'] == 'fastqc-step-v-1-0' assert analysis_step_version['@id'] == '/analysis-step-versions/fastqc-step-v-1-0/'
Add test for calcprops in pipeline related objectsimport pytest def test_analysis_step_version_name_calcprop(testapp, analysis_step_version): assert analysis_step_version['minor_version'] == 0 assert analysis_step_version['name'] == 'fastqc-step-v-1-0' assert analysis_step_version['@id'] == '/analysis-step...
<commit_before><commit_msg>Add test for calcprops in pipeline related objects<commit_after>import pytest def test_analysis_step_version_name_calcprop(testapp, analysis_step_version): assert analysis_step_version['minor_version'] == 0 assert analysis_step_version['name'] == 'fastqc-step-v-1-0' assert analys...
48c9860f506bf08fe733ae2033e0ecbc1472d58e
tests/blueprints/user/test_views_current_user.py
tests/blueprints/user/test_views_current_user.py
""" :Copyright: 2006-2018 Jochen Kupperschmidt :License: Modified BSD, see LICENSE for details. """ from tests.base import AbstractAppTestCase class CurrentUserTestCase(AbstractAppTestCase): def setUp(self): super().setUp() self.create_brand_and_party() def test_when_logged_in(self): ...
Test response code of current user's (HTML) page
Test response code of current user's (HTML) page
Python
bsd-3-clause
homeworkprod/byceps,homeworkprod/byceps,m-ober/byceps,homeworkprod/byceps,m-ober/byceps,m-ober/byceps
Test response code of current user's (HTML) page
""" :Copyright: 2006-2018 Jochen Kupperschmidt :License: Modified BSD, see LICENSE for details. """ from tests.base import AbstractAppTestCase class CurrentUserTestCase(AbstractAppTestCase): def setUp(self): super().setUp() self.create_brand_and_party() def test_when_logged_in(self): ...
<commit_before><commit_msg>Test response code of current user's (HTML) page<commit_after>
""" :Copyright: 2006-2018 Jochen Kupperschmidt :License: Modified BSD, see LICENSE for details. """ from tests.base import AbstractAppTestCase class CurrentUserTestCase(AbstractAppTestCase): def setUp(self): super().setUp() self.create_brand_and_party() def test_when_logged_in(self): ...
Test response code of current user's (HTML) page""" :Copyright: 2006-2018 Jochen Kupperschmidt :License: Modified BSD, see LICENSE for details. """ from tests.base import AbstractAppTestCase class CurrentUserTestCase(AbstractAppTestCase): def setUp(self): super().setUp() self.create_brand_and_p...
<commit_before><commit_msg>Test response code of current user's (HTML) page<commit_after>""" :Copyright: 2006-2018 Jochen Kupperschmidt :License: Modified BSD, see LICENSE for details. """ from tests.base import AbstractAppTestCase class CurrentUserTestCase(AbstractAppTestCase): def setUp(self): super()...
1b8085059f3c0983e3696e118c718ec44904097c
backend/breach/forms.py
backend/breach/forms.py
from django.forms import ModelForm from breach.models import Target class TargetForm(ModelForm): class Meta: model = Target fields = ( 'name', 'endpoint', 'prefix', 'alphabet', 'secretlength', 'alignmentalphabet', ...
Add form validation for target
Add form validation for target
Python
mit
dimriou/rupture,dimriou/rupture,dionyziz/rupture,esarafianou/rupture,dionyziz/rupture,esarafianou/rupture,dimriou/rupture,dimkarakostas/rupture,dionyziz/rupture,dimriou/rupture,dimkarakostas/rupture,dionyziz/rupture,esarafianou/rupture,dionyziz/rupture,dimriou/rupture,dimkarakostas/rupture,esarafianou/rupture,dimkarako...
Add form validation for target
from django.forms import ModelForm from breach.models import Target class TargetForm(ModelForm): class Meta: model = Target fields = ( 'name', 'endpoint', 'prefix', 'alphabet', 'secretlength', 'alignmentalphabet', ...
<commit_before><commit_msg>Add form validation for target<commit_after>
from django.forms import ModelForm from breach.models import Target class TargetForm(ModelForm): class Meta: model = Target fields = ( 'name', 'endpoint', 'prefix', 'alphabet', 'secretlength', 'alignmentalphabet', ...
Add form validation for targetfrom django.forms import ModelForm from breach.models import Target class TargetForm(ModelForm): class Meta: model = Target fields = ( 'name', 'endpoint', 'prefix', 'alphabet', 'secretlength', 'al...
<commit_before><commit_msg>Add form validation for target<commit_after>from django.forms import ModelForm from breach.models import Target class TargetForm(ModelForm): class Meta: model = Target fields = ( 'name', 'endpoint', 'prefix', 'alphabet', ...
a9cf7e78edbe4623115b2be43399fb65c4f5bc7e
data/migrations/v0.9.0-prune-toi.py
data/migrations/v0.9.0-prune-toi.py
from redis import StrictRedis from tilequeue.cache import RedisCacheIndex from tilequeue.config import make_config_from_argparse from tilequeue.tile import coord_unmarshall_int cfg = make_config_from_argparse('/etc/tilequeue/config.yaml') redis_client = StrictRedis(cfg.redis_host) cache_index = RedisCacheIndex(redis_c...
Add migration to prune toi
Add migration to prune toi
Python
mit
mapzen/vector-datasource,mapzen/vector-datasource,mapzen/vector-datasource
Add migration to prune toi
from redis import StrictRedis from tilequeue.cache import RedisCacheIndex from tilequeue.config import make_config_from_argparse from tilequeue.tile import coord_unmarshall_int cfg = make_config_from_argparse('/etc/tilequeue/config.yaml') redis_client = StrictRedis(cfg.redis_host) cache_index = RedisCacheIndex(redis_c...
<commit_before><commit_msg>Add migration to prune toi<commit_after>
from redis import StrictRedis from tilequeue.cache import RedisCacheIndex from tilequeue.config import make_config_from_argparse from tilequeue.tile import coord_unmarshall_int cfg = make_config_from_argparse('/etc/tilequeue/config.yaml') redis_client = StrictRedis(cfg.redis_host) cache_index = RedisCacheIndex(redis_c...
Add migration to prune toifrom redis import StrictRedis from tilequeue.cache import RedisCacheIndex from tilequeue.config import make_config_from_argparse from tilequeue.tile import coord_unmarshall_int cfg = make_config_from_argparse('/etc/tilequeue/config.yaml') redis_client = StrictRedis(cfg.redis_host) cache_index...
<commit_before><commit_msg>Add migration to prune toi<commit_after>from redis import StrictRedis from tilequeue.cache import RedisCacheIndex from tilequeue.config import make_config_from_argparse from tilequeue.tile import coord_unmarshall_int cfg = make_config_from_argparse('/etc/tilequeue/config.yaml') redis_client ...
b22d2e023affc9621235eb447d21c784405577d7
Numerics/cmake/explore_python_config.py
Numerics/cmake/explore_python_config.py
# -*- coding: utf-8 -*- # # Copyright (c) 2007, Simon Edwards <simon@simonzone.com> # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of source code must retain...
Add missing python script to explore python config and set vars in cmake
Add missing python script to explore python config and set vars in cmake
Python
apache-2.0
siconos/siconos-deb,siconos/siconos-deb,radarsat1/siconos,radarsat1/siconos,fperignon/siconos,siconos/siconos-deb,bremond/siconos,bremond/siconos,fperignon/siconos,fperignon/siconos,siconos/siconos-deb,bremond/siconos,siconos/siconos-deb,radarsat1/siconos,fperignon/siconos,siconos/siconos,bremond/siconos,radarsat1/sico...
Add missing python script to explore python config and set vars in cmake
# -*- coding: utf-8 -*- # # Copyright (c) 2007, Simon Edwards <simon@simonzone.com> # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of source code must retain...
<commit_before><commit_msg>Add missing python script to explore python config and set vars in cmake<commit_after>
# -*- coding: utf-8 -*- # # Copyright (c) 2007, Simon Edwards <simon@simonzone.com> # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of source code must retain...
Add missing python script to explore python config and set vars in cmake# -*- coding: utf-8 -*- # # Copyright (c) 2007, Simon Edwards <simon@simonzone.com> # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following c...
<commit_before><commit_msg>Add missing python script to explore python config and set vars in cmake<commit_after># -*- coding: utf-8 -*- # # Copyright (c) 2007, Simon Edwards <simon@simonzone.com> # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, ar...
ea0675713e3fee74d7cf3ae8345ff1b1d2745c7b
Project5/two_dim_solver.py
Project5/two_dim_solver.py
import numpy as np import matplotlib.pyplot as plt import matplotlib.animation as animation import seaborn as sns sns.set() fig = plt.figure() N = 31 h = 1.0/(N-1) t = 1 t_steps = 1000000 dt = 0.000001 alpha = dt / h**2 u = np.zeros(shape=(N,N)) n_figs = 200 fig_every = t_steps / n_figs u[:,0] = u[0,:] = 1 u[:,-1] =...
Add two dimensional forward python solver
Add two dimensional forward python solver
Python
mit
Caronthir/FYS3150,Caronthir/FYS3150,Caronthir/FYS3150
Add two dimensional forward python solver
import numpy as np import matplotlib.pyplot as plt import matplotlib.animation as animation import seaborn as sns sns.set() fig = plt.figure() N = 31 h = 1.0/(N-1) t = 1 t_steps = 1000000 dt = 0.000001 alpha = dt / h**2 u = np.zeros(shape=(N,N)) n_figs = 200 fig_every = t_steps / n_figs u[:,0] = u[0,:] = 1 u[:,-1] =...
<commit_before><commit_msg>Add two dimensional forward python solver<commit_after>
import numpy as np import matplotlib.pyplot as plt import matplotlib.animation as animation import seaborn as sns sns.set() fig = plt.figure() N = 31 h = 1.0/(N-1) t = 1 t_steps = 1000000 dt = 0.000001 alpha = dt / h**2 u = np.zeros(shape=(N,N)) n_figs = 200 fig_every = t_steps / n_figs u[:,0] = u[0,:] = 1 u[:,-1] =...
Add two dimensional forward python solverimport numpy as np import matplotlib.pyplot as plt import matplotlib.animation as animation import seaborn as sns sns.set() fig = plt.figure() N = 31 h = 1.0/(N-1) t = 1 t_steps = 1000000 dt = 0.000001 alpha = dt / h**2 u = np.zeros(shape=(N,N)) n_figs = 200 fig_every = t_step...
<commit_before><commit_msg>Add two dimensional forward python solver<commit_after>import numpy as np import matplotlib.pyplot as plt import matplotlib.animation as animation import seaborn as sns sns.set() fig = plt.figure() N = 31 h = 1.0/(N-1) t = 1 t_steps = 1000000 dt = 0.000001 alpha = dt / h**2 u = np.zeros(sha...
12d239d62c293cdb1a3fa1a69df06bf9c8e65366
grip/github_renderer.py
grip/github_renderer.py
from flask import abort, json import requests def render_content(text, gfm=False, context=None, username=None, password=None): """Renders the specified markup using the GitHub API.""" if gfm: url = 'https://api.github.com/markdown' data = {'text': text, 'mode': 'gfm', 'context': context} ...
from flask import abort, json import requests def render_content(text, gfm=False, context=None, username=None, password=None): """Renders the specified markup using the GitHub API.""" if gfm: url = 'https://api.github.com/markdown' data = {'text': text, 'mode': 'gfm'} ...
Remove duplicate 'context': context in GitHub renderer.
Remove duplicate 'context': context in GitHub renderer.
Python
mit
jbarreras/grip,ssundarraj/grip,joeyespo/grip,mgoddard-pivotal/grip,mgoddard-pivotal/grip,jbarreras/grip,joeyespo/grip,ssundarraj/grip
from flask import abort, json import requests def render_content(text, gfm=False, context=None, username=None, password=None): """Renders the specified markup using the GitHub API.""" if gfm: url = 'https://api.github.com/markdown' data = {'text': text, 'mode': 'gfm', 'context': context} ...
from flask import abort, json import requests def render_content(text, gfm=False, context=None, username=None, password=None): """Renders the specified markup using the GitHub API.""" if gfm: url = 'https://api.github.com/markdown' data = {'text': text, 'mode': 'gfm'} ...
<commit_before>from flask import abort, json import requests def render_content(text, gfm=False, context=None, username=None, password=None): """Renders the specified markup using the GitHub API.""" if gfm: url = 'https://api.github.com/markdown' data = {'text': text, 'mode': 'gfm', 'context':...
from flask import abort, json import requests def render_content(text, gfm=False, context=None, username=None, password=None): """Renders the specified markup using the GitHub API.""" if gfm: url = 'https://api.github.com/markdown' data = {'text': text, 'mode': 'gfm'} ...
from flask import abort, json import requests def render_content(text, gfm=False, context=None, username=None, password=None): """Renders the specified markup using the GitHub API.""" if gfm: url = 'https://api.github.com/markdown' data = {'text': text, 'mode': 'gfm', 'context': context} ...
<commit_before>from flask import abort, json import requests def render_content(text, gfm=False, context=None, username=None, password=None): """Renders the specified markup using the GitHub API.""" if gfm: url = 'https://api.github.com/markdown' data = {'text': text, 'mode': 'gfm', 'context':...
84f7a4c7fcde6875fe5b414f4340cc15fc4e9740
tests/test_get_money.py
tests/test_get_money.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Tests for the `v2ex last` function """ from __future__ import absolute_import, unicode_literals import pytest from v2ex_daily_mission.cli import cli @pytest.mark.usefixtures('mock_api') class TestGetMoney(): def test_get_money(self, runner): result...
Add tests for `v2ex sign`
Add tests for `v2ex sign`
Python
mit
lord63/v2ex_daily_mission,lord63/v2ex_daily_mission
Add tests for `v2ex sign`
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Tests for the `v2ex last` function """ from __future__ import absolute_import, unicode_literals import pytest from v2ex_daily_mission.cli import cli @pytest.mark.usefixtures('mock_api') class TestGetMoney(): def test_get_money(self, runner): result...
<commit_before><commit_msg>Add tests for `v2ex sign`<commit_after>
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Tests for the `v2ex last` function """ from __future__ import absolute_import, unicode_literals import pytest from v2ex_daily_mission.cli import cli @pytest.mark.usefixtures('mock_api') class TestGetMoney(): def test_get_money(self, runner): result...
Add tests for `v2ex sign`#!/usr/bin/env python # -*- coding: utf-8 -*- """ Tests for the `v2ex last` function """ from __future__ import absolute_import, unicode_literals import pytest from v2ex_daily_mission.cli import cli @pytest.mark.usefixtures('mock_api') class TestGetMoney(): def test_get_money(self...
<commit_before><commit_msg>Add tests for `v2ex sign`<commit_after>#!/usr/bin/env python # -*- coding: utf-8 -*- """ Tests for the `v2ex last` function """ from __future__ import absolute_import, unicode_literals import pytest from v2ex_daily_mission.cli import cli @pytest.mark.usefixtures('mock_api') class Te...
7df2b5f7fa48955a30fa30aaf25cb2194929bb9d
home/migrations/0001_rename_survey_app_to_paiji2_survey.py
home/migrations/0001_rename_survey_app_to_paiji2_survey.py
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): db.rename_table('survey_poll', 'paiji2_survey_poll') db.rename_table('sur...
Add migration for survey application
Add migration for survey application
Python
agpl-3.0
rezometz/paiji2,rezometz/paiji2,rezometz/paiji2
Add migration for survey application
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): db.rename_table('survey_poll', 'paiji2_survey_poll') db.rename_table('sur...
<commit_before><commit_msg>Add migration for survey application<commit_after>
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): db.rename_table('survey_poll', 'paiji2_survey_poll') db.rename_table('sur...
Add migration for survey application# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): db.rename_table('survey_poll', 'paiji2_survey...
<commit_before><commit_msg>Add migration for survey application<commit_after># -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): db.r...
209699334645a9e5d497ff9adc112e31b798c0b1
examples/freq_meter.py
examples/freq_meter.py
#!/usr/bin/env python3 from phasortoolbox import PDC,Client import matplotlib.pyplot as plt import numpy as np import logging logging.basicConfig(level=logging.DEBUG) class FreqMeter(object): def __init__(self): x = np.linspace(-10.0, 0.0, num=300, endpoint=False) y = [60.0]*300 plt.ion()...
Add a real-time frequency meter example
Add a real-time frequency meter example
Python
mit
sonusz/PhasorToolBox
Add a real-time frequency meter example
#!/usr/bin/env python3 from phasortoolbox import PDC,Client import matplotlib.pyplot as plt import numpy as np import logging logging.basicConfig(level=logging.DEBUG) class FreqMeter(object): def __init__(self): x = np.linspace(-10.0, 0.0, num=300, endpoint=False) y = [60.0]*300 plt.ion()...
<commit_before><commit_msg>Add a real-time frequency meter example<commit_after>
#!/usr/bin/env python3 from phasortoolbox import PDC,Client import matplotlib.pyplot as plt import numpy as np import logging logging.basicConfig(level=logging.DEBUG) class FreqMeter(object): def __init__(self): x = np.linspace(-10.0, 0.0, num=300, endpoint=False) y = [60.0]*300 plt.ion()...
Add a real-time frequency meter example#!/usr/bin/env python3 from phasortoolbox import PDC,Client import matplotlib.pyplot as plt import numpy as np import logging logging.basicConfig(level=logging.DEBUG) class FreqMeter(object): def __init__(self): x = np.linspace(-10.0, 0.0, num=300, endpoint=False) ...
<commit_before><commit_msg>Add a real-time frequency meter example<commit_after>#!/usr/bin/env python3 from phasortoolbox import PDC,Client import matplotlib.pyplot as plt import numpy as np import logging logging.basicConfig(level=logging.DEBUG) class FreqMeter(object): def __init__(self): x = np.linspac...
adc8a93c46f3efe70b6fafb750470245c1838dc4
mozillians/users/migrations/0013_auto_20170302_0230.py
mozillians/users/migrations/0013_auto_20170302_0230.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations from django.db.models import Q def migrate_countries(apps, schema_editor): UserProfile = apps.get_model('users', 'UserProfile') # cities_light data models Country = apps.get_model('cities_light', 'Country') ...
Add datamigration from mozillians.geo data to cities_light.
Add datamigration from mozillians.geo data to cities_light.
Python
bsd-3-clause
akatsoulas/mozillians,fxa90id/mozillians,mozilla/mozillians,johngian/mozillians,johngian/mozillians,akatsoulas/mozillians,fxa90id/mozillians,fxa90id/mozillians,fxa90id/mozillians,akatsoulas/mozillians,akatsoulas/mozillians,mozilla/mozillians,johngian/mozillians,mozilla/mozillians,mozilla/mozillians,johngian/mozillians
Add datamigration from mozillians.geo data to cities_light.
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations from django.db.models import Q def migrate_countries(apps, schema_editor): UserProfile = apps.get_model('users', 'UserProfile') # cities_light data models Country = apps.get_model('cities_light', 'Country') ...
<commit_before><commit_msg>Add datamigration from mozillians.geo data to cities_light.<commit_after>
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations from django.db.models import Q def migrate_countries(apps, schema_editor): UserProfile = apps.get_model('users', 'UserProfile') # cities_light data models Country = apps.get_model('cities_light', 'Country') ...
Add datamigration from mozillians.geo data to cities_light.# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations from django.db.models import Q def migrate_countries(apps, schema_editor): UserProfile = apps.get_model('users', 'UserProfile') # cities_light data mode...
<commit_before><commit_msg>Add datamigration from mozillians.geo data to cities_light.<commit_after># -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations from django.db.models import Q def migrate_countries(apps, schema_editor): UserProfile = apps.get_model('users', 'Us...
03813bd7658ee8657e9b1253d280b20fb87e3ab7
scripts/add-bw-locations.py
scripts/add-bw-locations.py
#!/usr/bin/env python2 from codecs import open from pokedex.db import connect, identifier_from_name from pokedex.db.tables import Language from pokedex.db.tables import Location, LocationGameIndex session = connect() en = session.query(Language).filter_by(identifier='en').one() # English ja = session.query(Language...
Add script for adding B/W locations
Add script for adding B/W locations in the hope that it will be useful in future generations.
Python
mit
veekun/pokedex,xfix/pokedex,mschex1/pokedex,RK905/pokedex-1,veekun/pokedex,DaMouse404/pokedex
Add script for adding B/W locations in the hope that it will be useful in future generations.
#!/usr/bin/env python2 from codecs import open from pokedex.db import connect, identifier_from_name from pokedex.db.tables import Language from pokedex.db.tables import Location, LocationGameIndex session = connect() en = session.query(Language).filter_by(identifier='en').one() # English ja = session.query(Language...
<commit_before><commit_msg>Add script for adding B/W locations in the hope that it will be useful in future generations.<commit_after>
#!/usr/bin/env python2 from codecs import open from pokedex.db import connect, identifier_from_name from pokedex.db.tables import Language from pokedex.db.tables import Location, LocationGameIndex session = connect() en = session.query(Language).filter_by(identifier='en').one() # English ja = session.query(Language...
Add script for adding B/W locations in the hope that it will be useful in future generations.#!/usr/bin/env python2 from codecs import open from pokedex.db import connect, identifier_from_name from pokedex.db.tables import Language from pokedex.db.tables import Location, LocationGameIndex session = connect() en = ...
<commit_before><commit_msg>Add script for adding B/W locations in the hope that it will be useful in future generations.<commit_after>#!/usr/bin/env python2 from codecs import open from pokedex.db import connect, identifier_from_name from pokedex.db.tables import Language from pokedex.db.tables import Location, Loca...
2a30afaea9d4cb1d704fd5ec0d78a946770c1c18
scripts/download-jamendo.py
scripts/download-jamendo.py
#!/usr/bin/env python # Jamendo database dumps can be fetched from: http://img.jamendo.com/data/dbdump_artistalbumtrack.xml.gz import xml.etree.cElementTree as ElementTree import sys, gzip, time, os.path, urllib class DownloadJamendo: def __init__(self, destination): if not os.path.exists(destination): os.m...
Add a script to download all the fully free tracks from Jamendo (as Ogg Vorbis)
Add a script to download all the fully free tracks from Jamendo (as Ogg Vorbis)
Python
agpl-3.0
foocorp/gnu-fm,foocorp/gnu-fm,foocorp/gnu-fm,foocorp/gnu-fm,foocorp/gnu-fm,foocorp/gnu-fm,foocorp/gnu-fm,foocorp/gnu-fm,foocorp/gnu-fm
Add a script to download all the fully free tracks from Jamendo (as Ogg Vorbis)
#!/usr/bin/env python # Jamendo database dumps can be fetched from: http://img.jamendo.com/data/dbdump_artistalbumtrack.xml.gz import xml.etree.cElementTree as ElementTree import sys, gzip, time, os.path, urllib class DownloadJamendo: def __init__(self, destination): if not os.path.exists(destination): os.m...
<commit_before><commit_msg>Add a script to download all the fully free tracks from Jamendo (as Ogg Vorbis)<commit_after>
#!/usr/bin/env python # Jamendo database dumps can be fetched from: http://img.jamendo.com/data/dbdump_artistalbumtrack.xml.gz import xml.etree.cElementTree as ElementTree import sys, gzip, time, os.path, urllib class DownloadJamendo: def __init__(self, destination): if not os.path.exists(destination): os.m...
Add a script to download all the fully free tracks from Jamendo (as Ogg Vorbis)#!/usr/bin/env python # Jamendo database dumps can be fetched from: http://img.jamendo.com/data/dbdump_artistalbumtrack.xml.gz import xml.etree.cElementTree as ElementTree import sys, gzip, time, os.path, urllib class DownloadJamendo: ...
<commit_before><commit_msg>Add a script to download all the fully free tracks from Jamendo (as Ogg Vorbis)<commit_after>#!/usr/bin/env python # Jamendo database dumps can be fetched from: http://img.jamendo.com/data/dbdump_artistalbumtrack.xml.gz import xml.etree.cElementTree as ElementTree import sys, gzip, time, os...
129e717143d2b04f244afca31c4f47d9740ea66e
app/melange/views/__init__.py
app/melange/views/__init__.py
# Copyright 2013 the Melange authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wr...
Package for Melange specific views added.
Package for Melange specific views added. It will contain modules with view classes and functions that are not specific neither CI nor SOC package.
Python
apache-2.0
rhyolight/nupic.son,rhyolight/nupic.son,rhyolight/nupic.son
Package for Melange specific views added. It will contain modules with view classes and functions that are not specific neither CI nor SOC package.
# Copyright 2013 the Melange authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wr...
<commit_before><commit_msg>Package for Melange specific views added. It will contain modules with view classes and functions that are not specific neither CI nor SOC package.<commit_after>
# Copyright 2013 the Melange authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wr...
Package for Melange specific views added. It will contain modules with view classes and functions that are not specific neither CI nor SOC package.# Copyright 2013 the Melange authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License....
<commit_before><commit_msg>Package for Melange specific views added. It will contain modules with view classes and functions that are not specific neither CI nor SOC package.<commit_after># Copyright 2013 the Melange authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this fi...
6cd0721a953a0708a99828dc8276c510b1b57c11
numba/tests/test_dyn_array.py
numba/tests/test_dyn_array.py
from __future__ import print_function, absolute_import, division import numpy as np from numba import unittest_support as unittest from numba import njit class TestDynArray(unittest.TestCase): def test_empty_1d(self): @njit def foo(n): arr = np.empty(n) for i in range(n):...
Add test for np.empty 1d case
Add test for np.empty 1d case
Python
bsd-2-clause
cpcloud/numba,pitrou/numba,pombredanne/numba,pombredanne/numba,gdementen/numba,cpcloud/numba,cpcloud/numba,seibert/numba,sklam/numba,ssarangi/numba,stefanseefeld/numba,jriehl/numba,stuartarchibald/numba,sklam/numba,stuartarchibald/numba,stonebig/numba,sklam/numba,stefanseefeld/numba,pitrou/numba,stonebig/numba,GaZ3ll3/...
Add test for np.empty 1d case
from __future__ import print_function, absolute_import, division import numpy as np from numba import unittest_support as unittest from numba import njit class TestDynArray(unittest.TestCase): def test_empty_1d(self): @njit def foo(n): arr = np.empty(n) for i in range(n):...
<commit_before><commit_msg>Add test for np.empty 1d case<commit_after>
from __future__ import print_function, absolute_import, division import numpy as np from numba import unittest_support as unittest from numba import njit class TestDynArray(unittest.TestCase): def test_empty_1d(self): @njit def foo(n): arr = np.empty(n) for i in range(n):...
Add test for np.empty 1d casefrom __future__ import print_function, absolute_import, division import numpy as np from numba import unittest_support as unittest from numba import njit class TestDynArray(unittest.TestCase): def test_empty_1d(self): @njit def foo(n): arr = np.empty(n) ...
<commit_before><commit_msg>Add test for np.empty 1d case<commit_after>from __future__ import print_function, absolute_import, division import numpy as np from numba import unittest_support as unittest from numba import njit class TestDynArray(unittest.TestCase): def test_empty_1d(self): @njit de...
99d789e4ab0627395804ffde42ab00c394a37b77
contrib/django/freppledb/output/management/__init__.py
contrib/django/freppledb/output/management/__init__.py
# Copyright (C) 2013 by Johan De Taeye, frePPLe bvba # # This library is free software; you can redistribute it and/or modify it # under the terms of the GNU Affero General Public License as published # by the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This l...
Remove default permissions in the "output" app, since irrelevant
Remove default permissions in the "output" app, since irrelevant
Python
agpl-3.0
frePPLe/frePPLe,frePPLe/frePPLe,frePPLe/frePPLe,frePPLe/frePPLe,frePPLe/frePPLe,frePPLe/frePPLe
Remove default permissions in the "output" app, since irrelevant
# Copyright (C) 2013 by Johan De Taeye, frePPLe bvba # # This library is free software; you can redistribute it and/or modify it # under the terms of the GNU Affero General Public License as published # by the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This l...
<commit_before><commit_msg>Remove default permissions in the "output" app, since irrelevant<commit_after>
# Copyright (C) 2013 by Johan De Taeye, frePPLe bvba # # This library is free software; you can redistribute it and/or modify it # under the terms of the GNU Affero General Public License as published # by the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This l...
Remove default permissions in the "output" app, since irrelevant# Copyright (C) 2013 by Johan De Taeye, frePPLe bvba # # This library is free software; you can redistribute it and/or modify it # under the terms of the GNU Affero General Public License as published # by the Free Software Foundation; either version 3 of ...
<commit_before><commit_msg>Remove default permissions in the "output" app, since irrelevant<commit_after># Copyright (C) 2013 by Johan De Taeye, frePPLe bvba # # This library is free software; you can redistribute it and/or modify it # under the terms of the GNU Affero General Public License as published # by the Free ...
09425139bd06b4b7d96504c53f897c9329331d91
array/first-nonrepeat-char.py
array/first-nonrepeat-char.py
# Given a string s, find and return the first instance of a non-repeating character in it. If there is no such character, return '_' # function only iterates over the string once and uses O(1) additional memory # input string contains only lowercase English letters def first_non_repeating_character(s): char_in_str = ...
Write function that returns first instance of non-repeating character in input string
Write function that returns first instance of non-repeating character in input string
Python
mit
derekmpham/interview-prep,derekmpham/interview-prep
Write function that returns first instance of non-repeating character in input string
# Given a string s, find and return the first instance of a non-repeating character in it. If there is no such character, return '_' # function only iterates over the string once and uses O(1) additional memory # input string contains only lowercase English letters def first_non_repeating_character(s): char_in_str = ...
<commit_before><commit_msg>Write function that returns first instance of non-repeating character in input string<commit_after>
# Given a string s, find and return the first instance of a non-repeating character in it. If there is no such character, return '_' # function only iterates over the string once and uses O(1) additional memory # input string contains only lowercase English letters def first_non_repeating_character(s): char_in_str = ...
Write function that returns first instance of non-repeating character in input string# Given a string s, find and return the first instance of a non-repeating character in it. If there is no such character, return '_' # function only iterates over the string once and uses O(1) additional memory # input string contains...
<commit_before><commit_msg>Write function that returns first instance of non-repeating character in input string<commit_after># Given a string s, find and return the first instance of a non-repeating character in it. If there is no such character, return '_' # function only iterates over the string once and uses O(1) ...
45ab98f8439845fdc5035525f8843dc78f8986c5
tests/linux_benchmarks/aws_dynamodb_ycsb_benchmark_test.py
tests/linux_benchmarks/aws_dynamodb_ycsb_benchmark_test.py
# Copyright 2022 PerfKitBenchmarker Authors. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
Add tests for dynamodb throughput.
Add tests for dynamodb throughput. PiperOrigin-RevId: 445294911
Python
apache-2.0
GoogleCloudPlatform/PerfKitBenchmarker,GoogleCloudPlatform/PerfKitBenchmarker,GoogleCloudPlatform/PerfKitBenchmarker,GoogleCloudPlatform/PerfKitBenchmarker
Add tests for dynamodb throughput. PiperOrigin-RevId: 445294911
# Copyright 2022 PerfKitBenchmarker Authors. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
<commit_before><commit_msg>Add tests for dynamodb throughput. PiperOrigin-RevId: 445294911<commit_after>
# Copyright 2022 PerfKitBenchmarker Authors. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
Add tests for dynamodb throughput. PiperOrigin-RevId: 445294911# Copyright 2022 PerfKitBenchmarker Authors. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://...
<commit_before><commit_msg>Add tests for dynamodb throughput. PiperOrigin-RevId: 445294911<commit_after># Copyright 2022 PerfKitBenchmarker Authors. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obta...
0ab7f8489a2fe783fde98d7336dc291dddb01275
tests/DAT/test_Block.py
tests/DAT/test_Block.py
import unittest from struct import error from DAT.Block import Block, BlockChain class TestBlock(unittest.TestCase): def test_parse_valid_blob(self): blob = "\xEF\xBE\xAD\xDE" blob += 'A' * 252 block = Block.from_blob(blob) self.assertEqual(block.size, 256) ...
Add unit tests for Block
Add unit tests for Block
Python
mit
ccressent/acnav
Add unit tests for Block
import unittest from struct import error from DAT.Block import Block, BlockChain class TestBlock(unittest.TestCase): def test_parse_valid_blob(self): blob = "\xEF\xBE\xAD\xDE" blob += 'A' * 252 block = Block.from_blob(blob) self.assertEqual(block.size, 256) ...
<commit_before><commit_msg>Add unit tests for Block<commit_after>
import unittest from struct import error from DAT.Block import Block, BlockChain class TestBlock(unittest.TestCase): def test_parse_valid_blob(self): blob = "\xEF\xBE\xAD\xDE" blob += 'A' * 252 block = Block.from_blob(blob) self.assertEqual(block.size, 256) ...
Add unit tests for Blockimport unittest from struct import error from DAT.Block import Block, BlockChain class TestBlock(unittest.TestCase): def test_parse_valid_blob(self): blob = "\xEF\xBE\xAD\xDE" blob += 'A' * 252 block = Block.from_blob(blob) self.assertEqual(block.size, ...
<commit_before><commit_msg>Add unit tests for Block<commit_after>import unittest from struct import error from DAT.Block import Block, BlockChain class TestBlock(unittest.TestCase): def test_parse_valid_blob(self): blob = "\xEF\xBE\xAD\xDE" blob += 'A' * 252 block = Block.from_blob(blob...
d15a45301689e1ac8b1e75c1152f9218f08ef82f
tests/cli/test_cache.py
tests/cli/test_cache.py
""" Tests for ``yatsm cache`` """ from click.testing import CliRunner import pytest from yatsm.cli.main import cli def test_cli_cache_pass_1(example_timeseries, example_results, modify_config, tmpdir): """ Run correctly """ mod_cfg = {'dataset': {'cache_line_dir': tmpdir.mkdir('...
Add tests for yatsm cache CLI
Add tests for yatsm cache CLI
Python
mit
ceholden/yatsm,c11/yatsm,valpasq/yatsm,c11/yatsm,valpasq/yatsm,ceholden/yatsm
Add tests for yatsm cache CLI
""" Tests for ``yatsm cache`` """ from click.testing import CliRunner import pytest from yatsm.cli.main import cli def test_cli_cache_pass_1(example_timeseries, example_results, modify_config, tmpdir): """ Run correctly """ mod_cfg = {'dataset': {'cache_line_dir': tmpdir.mkdir('...
<commit_before><commit_msg>Add tests for yatsm cache CLI<commit_after>
""" Tests for ``yatsm cache`` """ from click.testing import CliRunner import pytest from yatsm.cli.main import cli def test_cli_cache_pass_1(example_timeseries, example_results, modify_config, tmpdir): """ Run correctly """ mod_cfg = {'dataset': {'cache_line_dir': tmpdir.mkdir('...
Add tests for yatsm cache CLI""" Tests for ``yatsm cache`` """ from click.testing import CliRunner import pytest from yatsm.cli.main import cli def test_cli_cache_pass_1(example_timeseries, example_results, modify_config, tmpdir): """ Run correctly """ mod_cfg = {'dataset': {'ca...
<commit_before><commit_msg>Add tests for yatsm cache CLI<commit_after>""" Tests for ``yatsm cache`` """ from click.testing import CliRunner import pytest from yatsm.cli.main import cli def test_cli_cache_pass_1(example_timeseries, example_results, modify_config, tmpdir): """ Run correct...
d954988fad088278e3a58d16b5928d5918a7e79a
microphone_match_gui.py
microphone_match_gui.py
#!/usr/bin/python2 import signal signal.signal(signal.SIGINT, signal.SIG_DFL) import sys import os from PyQt5.QtWidgets import (QApplication, QWidget, QPushButton, QVBoxLayout, QHBoxLayout, QLabel, QSizePolicy) from PyQt5.QtCore import (QCoreApplication, QThread) import microphone_match def main(argv): app = QApp...
Add PyQt5 gui for the matcher
Add PyQt5 gui for the matcher
Python
mit
piotrwicijowski/whistler,piotrwicijowski/whistler
Add PyQt5 gui for the matcher
#!/usr/bin/python2 import signal signal.signal(signal.SIGINT, signal.SIG_DFL) import sys import os from PyQt5.QtWidgets import (QApplication, QWidget, QPushButton, QVBoxLayout, QHBoxLayout, QLabel, QSizePolicy) from PyQt5.QtCore import (QCoreApplication, QThread) import microphone_match def main(argv): app = QApp...
<commit_before><commit_msg>Add PyQt5 gui for the matcher<commit_after>
#!/usr/bin/python2 import signal signal.signal(signal.SIGINT, signal.SIG_DFL) import sys import os from PyQt5.QtWidgets import (QApplication, QWidget, QPushButton, QVBoxLayout, QHBoxLayout, QLabel, QSizePolicy) from PyQt5.QtCore import (QCoreApplication, QThread) import microphone_match def main(argv): app = QApp...
Add PyQt5 gui for the matcher#!/usr/bin/python2 import signal signal.signal(signal.SIGINT, signal.SIG_DFL) import sys import os from PyQt5.QtWidgets import (QApplication, QWidget, QPushButton, QVBoxLayout, QHBoxLayout, QLabel, QSizePolicy) from PyQt5.QtCore import (QCoreApplication, QThread) import microphone_match d...
<commit_before><commit_msg>Add PyQt5 gui for the matcher<commit_after>#!/usr/bin/python2 import signal signal.signal(signal.SIGINT, signal.SIG_DFL) import sys import os from PyQt5.QtWidgets import (QApplication, QWidget, QPushButton, QVBoxLayout, QHBoxLayout, QLabel, QSizePolicy) from PyQt5.QtCore import (QCoreApplica...
8eaa6c9c80b097186887e2ebbfcc561f07630d2b
heufybot/utils/signaltimeout.py
heufybot/utils/signaltimeout.py
# Taken from https://gist.github.com/ekimekim/b01158dc36c6e2155046684511595d57 import os import signal import subprocess class Timeout(Exception): """This is raised when a timeout occurs""" class SignalTimeout(object): """Context manager that raises a Timeout if the inner block takes too long. Will even...
Add a signal timeout handler
Add a signal timeout handler Many thanks to @ekimekim for writing this.
Python
mit
Heufneutje/PyHeufyBot,Heufneutje/PyHeufyBot
Add a signal timeout handler Many thanks to @ekimekim for writing this.
# Taken from https://gist.github.com/ekimekim/b01158dc36c6e2155046684511595d57 import os import signal import subprocess class Timeout(Exception): """This is raised when a timeout occurs""" class SignalTimeout(object): """Context manager that raises a Timeout if the inner block takes too long. Will even...
<commit_before><commit_msg>Add a signal timeout handler Many thanks to @ekimekim for writing this.<commit_after>
# Taken from https://gist.github.com/ekimekim/b01158dc36c6e2155046684511595d57 import os import signal import subprocess class Timeout(Exception): """This is raised when a timeout occurs""" class SignalTimeout(object): """Context manager that raises a Timeout if the inner block takes too long. Will even...
Add a signal timeout handler Many thanks to @ekimekim for writing this.# Taken from https://gist.github.com/ekimekim/b01158dc36c6e2155046684511595d57 import os import signal import subprocess class Timeout(Exception): """This is raised when a timeout occurs""" class SignalTimeout(object): """Context manage...
<commit_before><commit_msg>Add a signal timeout handler Many thanks to @ekimekim for writing this.<commit_after># Taken from https://gist.github.com/ekimekim/b01158dc36c6e2155046684511595d57 import os import signal import subprocess class Timeout(Exception): """This is raised when a timeout occurs""" class Sig...
ba030dc7877632b8eaf59fdbca4d11daf4225f95
database.py
database.py
#!/usr/bin/python2 from sqlalchemy import create_engine from sqlalchemy.ext.declarative import declarative_base from sqlalchemy import Column, Integer, String, Sequence from sqlalchemy.orm import sessionmaker engine = create_engine('sqlite:///testdb.sqlite', echo=True) Base = declarative_base() class User(Base): _...
Add file sql tutorial with sqlachemy
Add file sql tutorial with sqlachemy
Python
unlicense
phunghv/meu_sender
Add file sql tutorial with sqlachemy
#!/usr/bin/python2 from sqlalchemy import create_engine from sqlalchemy.ext.declarative import declarative_base from sqlalchemy import Column, Integer, String, Sequence from sqlalchemy.orm import sessionmaker engine = create_engine('sqlite:///testdb.sqlite', echo=True) Base = declarative_base() class User(Base): _...
<commit_before><commit_msg>Add file sql tutorial with sqlachemy<commit_after>
#!/usr/bin/python2 from sqlalchemy import create_engine from sqlalchemy.ext.declarative import declarative_base from sqlalchemy import Column, Integer, String, Sequence from sqlalchemy.orm import sessionmaker engine = create_engine('sqlite:///testdb.sqlite', echo=True) Base = declarative_base() class User(Base): _...
Add file sql tutorial with sqlachemy#!/usr/bin/python2 from sqlalchemy import create_engine from sqlalchemy.ext.declarative import declarative_base from sqlalchemy import Column, Integer, String, Sequence from sqlalchemy.orm import sessionmaker engine = create_engine('sqlite:///testdb.sqlite', echo=True) Base = decl...
<commit_before><commit_msg>Add file sql tutorial with sqlachemy<commit_after>#!/usr/bin/python2 from sqlalchemy import create_engine from sqlalchemy.ext.declarative import declarative_base from sqlalchemy import Column, Integer, String, Sequence from sqlalchemy.orm import sessionmaker engine = create_engine('sqlite:...
117d74fa54e8557e2ab09f5d11a61d8ad4e7736a
kolibri/utils/tests/test_cli_at_import.py
kolibri/utils/tests/test_cli_at_import.py
""" Tests for `kolibri.utils.cli` module. """ from __future__ import absolute_import from __future__ import print_function from mock import patch @patch("sqlalchemy.create_engine") def test_status_no_db_access(create_engine_mock): """ Tests that status does not try to access the database """ try: ...
Add tests that check for database access during status and stop commands.
Add tests that check for database access during status and stop commands.
Python
mit
mrpau/kolibri,indirectlylit/kolibri,indirectlylit/kolibri,learningequality/kolibri,indirectlylit/kolibri,indirectlylit/kolibri,mrpau/kolibri,learningequality/kolibri,learningequality/kolibri,learningequality/kolibri,mrpau/kolibri,mrpau/kolibri
Add tests that check for database access during status and stop commands.
""" Tests for `kolibri.utils.cli` module. """ from __future__ import absolute_import from __future__ import print_function from mock import patch @patch("sqlalchemy.create_engine") def test_status_no_db_access(create_engine_mock): """ Tests that status does not try to access the database """ try: ...
<commit_before><commit_msg>Add tests that check for database access during status and stop commands.<commit_after>
""" Tests for `kolibri.utils.cli` module. """ from __future__ import absolute_import from __future__ import print_function from mock import patch @patch("sqlalchemy.create_engine") def test_status_no_db_access(create_engine_mock): """ Tests that status does not try to access the database """ try: ...
Add tests that check for database access during status and stop commands.""" Tests for `kolibri.utils.cli` module. """ from __future__ import absolute_import from __future__ import print_function from mock import patch @patch("sqlalchemy.create_engine") def test_status_no_db_access(create_engine_mock): """ T...
<commit_before><commit_msg>Add tests that check for database access during status and stop commands.<commit_after>""" Tests for `kolibri.utils.cli` module. """ from __future__ import absolute_import from __future__ import print_function from mock import patch @patch("sqlalchemy.create_engine") def test_status_no_db_...
112fbecf8458541b2277d877c58837ec93911a35
tests/test_particles.py
tests/test_particles.py
from parcels import Grid, ScipyParticle, JITParticle, Variable import numpy as np import pytest ptype = {'scipy': ScipyParticle, 'jit': JITParticle} @pytest.fixture def grid(xdim=100, ydim=100): U = np.zeros((xdim, ydim), dtype=np.float32) V = np.zeros((xdim, ydim), dtype=np.float32) lon = np.linspace(0...
Add new test for custom variable initialisation to check types
Variable: Add new test for custom variable initialisation to check types
Python
mit
OceanPARCELS/parcels,OceanPARCELS/parcels
Variable: Add new test for custom variable initialisation to check types
from parcels import Grid, ScipyParticle, JITParticle, Variable import numpy as np import pytest ptype = {'scipy': ScipyParticle, 'jit': JITParticle} @pytest.fixture def grid(xdim=100, ydim=100): U = np.zeros((xdim, ydim), dtype=np.float32) V = np.zeros((xdim, ydim), dtype=np.float32) lon = np.linspace(0...
<commit_before><commit_msg>Variable: Add new test for custom variable initialisation to check types<commit_after>
from parcels import Grid, ScipyParticle, JITParticle, Variable import numpy as np import pytest ptype = {'scipy': ScipyParticle, 'jit': JITParticle} @pytest.fixture def grid(xdim=100, ydim=100): U = np.zeros((xdim, ydim), dtype=np.float32) V = np.zeros((xdim, ydim), dtype=np.float32) lon = np.linspace(0...
Variable: Add new test for custom variable initialisation to check typesfrom parcels import Grid, ScipyParticle, JITParticle, Variable import numpy as np import pytest ptype = {'scipy': ScipyParticle, 'jit': JITParticle} @pytest.fixture def grid(xdim=100, ydim=100): U = np.zeros((xdim, ydim), dtype=np.float32) ...
<commit_before><commit_msg>Variable: Add new test for custom variable initialisation to check types<commit_after>from parcels import Grid, ScipyParticle, JITParticle, Variable import numpy as np import pytest ptype = {'scipy': ScipyParticle, 'jit': JITParticle} @pytest.fixture def grid(xdim=100, ydim=100): U = ...
ae10061cbff2017c28099682cccf9c7b9257cb54
python/security_test.py
python/security_test.py
# # (C) Copyright IBM Corp. 2017 # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writi...
Add test coverage for security module
Add test coverage for security module
Python
apache-2.0
lresende/toree-gateway,lresende/toree-gateway
Add test coverage for security module
# # (C) Copyright IBM Corp. 2017 # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writi...
<commit_before><commit_msg>Add test coverage for security module<commit_after>
# # (C) Copyright IBM Corp. 2017 # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writi...
Add test coverage for security module# # (C) Copyright IBM Corp. 2017 # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by...
<commit_before><commit_msg>Add test coverage for security module<commit_after># # (C) Copyright IBM Corp. 2017 # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/li...
cc046c9a70ebdfec404992f69c09c9fbbfc0b471
indra/sources/eidos/eidos_server.py
indra/sources/eidos/eidos_server.py
import json from flask import Flask, request from indra.sources.eidos.eidos_reader import EidosReader app = Flask(__name__) @app.route('/process_text', methods=['POST']) def process_text(): text = request.json.get('text') if not text: return {} res = er.process_text(text, 'json_ld') return j...
Add simple web service for Eidos reading
Add simple web service for Eidos reading
Python
bsd-2-clause
johnbachman/indra,johnbachman/indra,johnbachman/belpy,sorgerlab/indra,sorgerlab/belpy,sorgerlab/belpy,pvtodorov/indra,johnbachman/belpy,sorgerlab/indra,bgyori/indra,bgyori/indra,pvtodorov/indra,sorgerlab/indra,sorgerlab/belpy,johnbachman/belpy,bgyori/indra,pvtodorov/indra,johnbachman/indra,pvtodorov/indra
Add simple web service for Eidos reading
import json from flask import Flask, request from indra.sources.eidos.eidos_reader import EidosReader app = Flask(__name__) @app.route('/process_text', methods=['POST']) def process_text(): text = request.json.get('text') if not text: return {} res = er.process_text(text, 'json_ld') return j...
<commit_before><commit_msg>Add simple web service for Eidos reading<commit_after>
import json from flask import Flask, request from indra.sources.eidos.eidos_reader import EidosReader app = Flask(__name__) @app.route('/process_text', methods=['POST']) def process_text(): text = request.json.get('text') if not text: return {} res = er.process_text(text, 'json_ld') return j...
Add simple web service for Eidos readingimport json from flask import Flask, request from indra.sources.eidos.eidos_reader import EidosReader app = Flask(__name__) @app.route('/process_text', methods=['POST']) def process_text(): text = request.json.get('text') if not text: return {} res = er.pr...
<commit_before><commit_msg>Add simple web service for Eidos reading<commit_after>import json from flask import Flask, request from indra.sources.eidos.eidos_reader import EidosReader app = Flask(__name__) @app.route('/process_text', methods=['POST']) def process_text(): text = request.json.get('text') if no...
f1d830609d460e8213252251bf3b512511032add
thinc/neural/tests/integration/test_relu_gradient.py
thinc/neural/tests/integration/test_relu_gradient.py
import pytest @pytest.mark.skip def test_relu_clips_negative(model, input_BI): # TODO: There was a bug related to this pass @pytest.mark.skip def test_relu_clipped_gradients_are_zero(): # TODO: There was a bug related to this pass
Add placeholder for relu gradient tests
Add placeholder for relu gradient tests
Python
mit
spacy-io/thinc,explosion/thinc,explosion/thinc,explosion/thinc,spacy-io/thinc,explosion/thinc,spacy-io/thinc
Add placeholder for relu gradient tests
import pytest @pytest.mark.skip def test_relu_clips_negative(model, input_BI): # TODO: There was a bug related to this pass @pytest.mark.skip def test_relu_clipped_gradients_are_zero(): # TODO: There was a bug related to this pass
<commit_before><commit_msg>Add placeholder for relu gradient tests<commit_after>
import pytest @pytest.mark.skip def test_relu_clips_negative(model, input_BI): # TODO: There was a bug related to this pass @pytest.mark.skip def test_relu_clipped_gradients_are_zero(): # TODO: There was a bug related to this pass
Add placeholder for relu gradient testsimport pytest @pytest.mark.skip def test_relu_clips_negative(model, input_BI): # TODO: There was a bug related to this pass @pytest.mark.skip def test_relu_clipped_gradients_are_zero(): # TODO: There was a bug related to this pass
<commit_before><commit_msg>Add placeholder for relu gradient tests<commit_after>import pytest @pytest.mark.skip def test_relu_clips_negative(model, input_BI): # TODO: There was a bug related to this pass @pytest.mark.skip def test_relu_clipped_gradients_are_zero(): # TODO: There was a bug related to thi...