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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1a54416928cd53a4af64c6705f200803751721c3 | course_discovery/apps/course_metadata/migrations/0067_auto_20171108_1432.py | course_discovery/apps/course_metadata/migrations/0067_auto_20171108_1432.py | # -*- coding: utf-8 -*-
# Generated by Django 1.11.3 on 2017-11-08 14:32
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('course_metadata', '0066_auto_20171107_1707'),
]
operations = [
migrations.A... | Add the missing migration left out from previous change | Add the missing migration left out from previous change
| Python | agpl-3.0 | edx/course-discovery,edx/course-discovery,edx/course-discovery,edx/course-discovery | Add the missing migration left out from previous change | # -*- coding: utf-8 -*-
# Generated by Django 1.11.3 on 2017-11-08 14:32
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('course_metadata', '0066_auto_20171107_1707'),
]
operations = [
migrations.A... | <commit_before><commit_msg>Add the missing migration left out from previous change<commit_after> | # -*- coding: utf-8 -*-
# Generated by Django 1.11.3 on 2017-11-08 14:32
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('course_metadata', '0066_auto_20171107_1707'),
]
operations = [
migrations.A... | Add the missing migration left out from previous change# -*- coding: utf-8 -*-
# Generated by Django 1.11.3 on 2017-11-08 14:32
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('course_metadata', '0066_auto_20171107... | <commit_before><commit_msg>Add the missing migration left out from previous change<commit_after># -*- coding: utf-8 -*-
# Generated by Django 1.11.3 on 2017-11-08 14:32
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
... | |
2e73f7c8d9219715ec76e1081080b63da1dc6d0d | src/excel_sheet_column_number.py | src/excel_sheet_column_number.py | """
Source : https://oj.leetcode.com/problems/excel-sheet-column-number/
Author : Changxi Wu
Date : 2015-01-21
Given a column title as appear in an Excel sheet, return its corresponding column number.
For example:
A -> 1
B -> 2
C -> 3
...
Z -> 26
AA -> 27
AB -> 28
"""
def titl... | Add solution for excel sheet column number | Add solution for excel sheet column number
| Python | mit | chancyWu/leetcode | Add solution for excel sheet column number | """
Source : https://oj.leetcode.com/problems/excel-sheet-column-number/
Author : Changxi Wu
Date : 2015-01-21
Given a column title as appear in an Excel sheet, return its corresponding column number.
For example:
A -> 1
B -> 2
C -> 3
...
Z -> 26
AA -> 27
AB -> 28
"""
def titl... | <commit_before><commit_msg>Add solution for excel sheet column number<commit_after> | """
Source : https://oj.leetcode.com/problems/excel-sheet-column-number/
Author : Changxi Wu
Date : 2015-01-21
Given a column title as appear in an Excel sheet, return its corresponding column number.
For example:
A -> 1
B -> 2
C -> 3
...
Z -> 26
AA -> 27
AB -> 28
"""
def titl... | Add solution for excel sheet column number"""
Source : https://oj.leetcode.com/problems/excel-sheet-column-number/
Author : Changxi Wu
Date : 2015-01-21
Given a column title as appear in an Excel sheet, return its corresponding column number.
For example:
A -> 1
B -> 2
C -> 3
...
Z -> 26
... | <commit_before><commit_msg>Add solution for excel sheet column number<commit_after>"""
Source : https://oj.leetcode.com/problems/excel-sheet-column-number/
Author : Changxi Wu
Date : 2015-01-21
Given a column title as appear in an Excel sheet, return its corresponding column number.
For example:
A -> 1
B ... | |
34ebcb3bfd3c62bfd43c8144766ad8af56aa236a | buildbot/cbuildbot_config_unittest.py | buildbot/cbuildbot_config_unittest.py | #!/usr/bin/python
# Copyright (c) 2011 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Unittests for config. Needs to be run inside of chroot for mox."""
import mox
import sys
import unittest
import constants
sys... | Add a simple unit test for the config. | Add a simple unit test for the config.
BUG=http://code.google.com/p/chromium-os/issues/detail?id=14837
TEST=It is a test. Ran it, with current and with a previous bad config.
Change-Id: Ib20c89b6169dbc80a5c49487d732ccd20b7ab7cb
| Python | bsd-3-clause | zhang0137/chromite,chadversary/chromiumos.chromite,bpsinc-native/src_third_party_chromite,coreos/chromite,coreos/chromite,zhang0137/chromite,bpsinc-native/src_third_party_chromite,bpsinc-native/src_third_party_chromite,chadversary/chromiumos.chromite,coreos/chromite,zhang0137/chromite | Add a simple unit test for the config.
BUG=http://code.google.com/p/chromium-os/issues/detail?id=14837
TEST=It is a test. Ran it, with current and with a previous bad config.
Change-Id: Ib20c89b6169dbc80a5c49487d732ccd20b7ab7cb | #!/usr/bin/python
# Copyright (c) 2011 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Unittests for config. Needs to be run inside of chroot for mox."""
import mox
import sys
import unittest
import constants
sys... | <commit_before><commit_msg>Add a simple unit test for the config.
BUG=http://code.google.com/p/chromium-os/issues/detail?id=14837
TEST=It is a test. Ran it, with current and with a previous bad config.
Change-Id: Ib20c89b6169dbc80a5c49487d732ccd20b7ab7cb<commit_after> | #!/usr/bin/python
# Copyright (c) 2011 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Unittests for config. Needs to be run inside of chroot for mox."""
import mox
import sys
import unittest
import constants
sys... | Add a simple unit test for the config.
BUG=http://code.google.com/p/chromium-os/issues/detail?id=14837
TEST=It is a test. Ran it, with current and with a previous bad config.
Change-Id: Ib20c89b6169dbc80a5c49487d732ccd20b7ab7cb#!/usr/bin/python
# Copyright (c) 2011 The Chromium OS Authors. All rights reserved.
# Use... | <commit_before><commit_msg>Add a simple unit test for the config.
BUG=http://code.google.com/p/chromium-os/issues/detail?id=14837
TEST=It is a test. Ran it, with current and with a previous bad config.
Change-Id: Ib20c89b6169dbc80a5c49487d732ccd20b7ab7cb<commit_after>#!/usr/bin/python
# Copyright (c) 2011 The Chromi... | |
ce12d292d96b589c67c8321efa23e1db8364bfe8 | test/test_cascade.py | test/test_cascade.py |
import os
import py.test
from tiddlyweb.config import config
from tiddlyweb.store import Store
from tiddlyweb.model.bag import Bag
from tiddlyweb.model.tiddler import Tiddler
from tiddlywebplugins.mysql3 import (Base, sText, sTag, sTiddler,
sRevision, sField, Session)
def setup_module(module):
module... | Add a test to check that delete cascade is working | Add a test to check that delete cascade is working
This was a bit hard to get right, as there were lingering
sessions. The session.remove() in the test is _critical_.
| Python | bsd-3-clause | tiddlyweb/tiddlywebplugins.mysql | Add a test to check that delete cascade is working
This was a bit hard to get right, as there were lingering
sessions. The session.remove() in the test is _critical_. |
import os
import py.test
from tiddlyweb.config import config
from tiddlyweb.store import Store
from tiddlyweb.model.bag import Bag
from tiddlyweb.model.tiddler import Tiddler
from tiddlywebplugins.mysql3 import (Base, sText, sTag, sTiddler,
sRevision, sField, Session)
def setup_module(module):
module... | <commit_before><commit_msg>Add a test to check that delete cascade is working
This was a bit hard to get right, as there were lingering
sessions. The session.remove() in the test is _critical_.<commit_after> |
import os
import py.test
from tiddlyweb.config import config
from tiddlyweb.store import Store
from tiddlyweb.model.bag import Bag
from tiddlyweb.model.tiddler import Tiddler
from tiddlywebplugins.mysql3 import (Base, sText, sTag, sTiddler,
sRevision, sField, Session)
def setup_module(module):
module... | Add a test to check that delete cascade is working
This was a bit hard to get right, as there were lingering
sessions. The session.remove() in the test is _critical_.
import os
import py.test
from tiddlyweb.config import config
from tiddlyweb.store import Store
from tiddlyweb.model.bag import Bag
from tiddlyweb.mod... | <commit_before><commit_msg>Add a test to check that delete cascade is working
This was a bit hard to get right, as there were lingering
sessions. The session.remove() in the test is _critical_.<commit_after>
import os
import py.test
from tiddlyweb.config import config
from tiddlyweb.store import Store
from tiddlywe... | |
7b0158277c4a4beb49c47ca7a50d22c4e2f1ec70 | tempest/tests/test_waiters.py | tempest/tests/test_waiters.py | # Copyright 2014 IBM Corp.
#
# 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 t... | Add unit tests for image waiter | Add unit tests for image waiter
This commit adds unit tests for the image waiter in
tempest.common.waiters. It adds tests for both the timeout case and
the success path.
Partially implements bp unit-tests
Co-Authored-With: Sean Dague <sean.dague@samsung.com>
Change-Id: Ib0501cd3bc323fd036444dacf884879963842e50
| Python | apache-2.0 | manasi24/tempest,vedujoshi/os_tempest,FujitsuEnablingSoftwareTechnologyGmbH/tempest,vmahuli/tempest,vedujoshi/tempest,Juraci/tempest,pandeyop/tempest,sebrandon1/tempest,masayukig/tempest,LIS/lis-tempest,roopali8/tempest,eggmaster/tempest,LIS/lis-tempest,Vaidyanath/tempest,cisco-openstack/tempest,JioCloud/tempest,Lilywe... | Add unit tests for image waiter
This commit adds unit tests for the image waiter in
tempest.common.waiters. It adds tests for both the timeout case and
the success path.
Partially implements bp unit-tests
Co-Authored-With: Sean Dague <sean.dague@samsung.com>
Change-Id: Ib0501cd3bc323fd036444dacf884879963842e50 | # Copyright 2014 IBM Corp.
#
# 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 t... | <commit_before><commit_msg>Add unit tests for image waiter
This commit adds unit tests for the image waiter in
tempest.common.waiters. It adds tests for both the timeout case and
the success path.
Partially implements bp unit-tests
Co-Authored-With: Sean Dague <sean.dague@samsung.com>
Change-Id: Ib0501cd3bc323fd036... | # Copyright 2014 IBM Corp.
#
# 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 t... | Add unit tests for image waiter
This commit adds unit tests for the image waiter in
tempest.common.waiters. It adds tests for both the timeout case and
the success path.
Partially implements bp unit-tests
Co-Authored-With: Sean Dague <sean.dague@samsung.com>
Change-Id: Ib0501cd3bc323fd036444dacf884879963842e50# Cop... | <commit_before><commit_msg>Add unit tests for image waiter
This commit adds unit tests for the image waiter in
tempest.common.waiters. It adds tests for both the timeout case and
the success path.
Partially implements bp unit-tests
Co-Authored-With: Sean Dague <sean.dague@samsung.com>
Change-Id: Ib0501cd3bc323fd036... | |
1702cca5bd207d90a796b5cc4fc61d4d574be929 | tests/test_header.py | tests/test_header.py | """
test_header
~~~~~~~~~~~
Contains tests for the :mod:`~adbwp.header` module.
"""
import pytest
from adbwp import header
@pytest.mark.xfail(reason='Not Implemented')
def test_stub():
assert False
| Add test module for header module. | Add test module for header module.
| Python | apache-2.0 | adbpy/wire-protocol | Add test module for header module. | """
test_header
~~~~~~~~~~~
Contains tests for the :mod:`~adbwp.header` module.
"""
import pytest
from adbwp import header
@pytest.mark.xfail(reason='Not Implemented')
def test_stub():
assert False
| <commit_before><commit_msg>Add test module for header module.<commit_after> | """
test_header
~~~~~~~~~~~
Contains tests for the :mod:`~adbwp.header` module.
"""
import pytest
from adbwp import header
@pytest.mark.xfail(reason='Not Implemented')
def test_stub():
assert False
| Add test module for header module."""
test_header
~~~~~~~~~~~
Contains tests for the :mod:`~adbwp.header` module.
"""
import pytest
from adbwp import header
@pytest.mark.xfail(reason='Not Implemented')
def test_stub():
assert False
| <commit_before><commit_msg>Add test module for header module.<commit_after>"""
test_header
~~~~~~~~~~~
Contains tests for the :mod:`~adbwp.header` module.
"""
import pytest
from adbwp import header
@pytest.mark.xfail(reason='Not Implemented')
def test_stub():
assert False
| |
b7ff17c9b7de6860ec94cce8a516165a58b4b22e | aegea/lambda.py | aegea/lambda.py | """
Manage AWS Lambda functions and their event sources
"""
from __future__ import absolute_import, division, print_function, unicode_literals
import os, sys, argparse, collections, random, string
from . import config, logger
from .ls import register_parser, register_listing_parser
from .util import Timestamp, pagin... | Add file missed in 0c99863 | Add file missed in 0c99863
| Python | apache-2.0 | kislyuk/aegea,kislyuk/aegea,wholebiome/aegea,wholebiome/aegea,kislyuk/aegea,wholebiome/aegea | Add file missed in 0c99863 | """
Manage AWS Lambda functions and their event sources
"""
from __future__ import absolute_import, division, print_function, unicode_literals
import os, sys, argparse, collections, random, string
from . import config, logger
from .ls import register_parser, register_listing_parser
from .util import Timestamp, pagin... | <commit_before><commit_msg>Add file missed in 0c99863<commit_after> | """
Manage AWS Lambda functions and their event sources
"""
from __future__ import absolute_import, division, print_function, unicode_literals
import os, sys, argparse, collections, random, string
from . import config, logger
from .ls import register_parser, register_listing_parser
from .util import Timestamp, pagin... | Add file missed in 0c99863"""
Manage AWS Lambda functions and their event sources
"""
from __future__ import absolute_import, division, print_function, unicode_literals
import os, sys, argparse, collections, random, string
from . import config, logger
from .ls import register_parser, register_listing_parser
from .ut... | <commit_before><commit_msg>Add file missed in 0c99863<commit_after>"""
Manage AWS Lambda functions and their event sources
"""
from __future__ import absolute_import, division, print_function, unicode_literals
import os, sys, argparse, collections, random, string
from . import config, logger
from .ls import register... | |
16b1aa5d3d88f48dcc0047342501a8a52cd87c34 | tools/export_wiki.py | tools/export_wiki.py | """This script exports the wiki pages from Redmine.
All wiki pages on Redmine (https://cocomud.plan.io) are saved in the
'doc' directory.
Requirements:
This script needs 'python-redmine', which you can obtain with
pip install python-redmine
This script also needs BeautifulSoup:
pip install Be... | Add the tool to export the wiki pages from Planio | Add the tool to export the wiki pages from Planio
| Python | bsd-3-clause | vlegoff/cocomud | Add the tool to export the wiki pages from Planio | """This script exports the wiki pages from Redmine.
All wiki pages on Redmine (https://cocomud.plan.io) are saved in the
'doc' directory.
Requirements:
This script needs 'python-redmine', which you can obtain with
pip install python-redmine
This script also needs BeautifulSoup:
pip install Be... | <commit_before><commit_msg>Add the tool to export the wiki pages from Planio<commit_after> | """This script exports the wiki pages from Redmine.
All wiki pages on Redmine (https://cocomud.plan.io) are saved in the
'doc' directory.
Requirements:
This script needs 'python-redmine', which you can obtain with
pip install python-redmine
This script also needs BeautifulSoup:
pip install Be... | Add the tool to export the wiki pages from Planio"""This script exports the wiki pages from Redmine.
All wiki pages on Redmine (https://cocomud.plan.io) are saved in the
'doc' directory.
Requirements:
This script needs 'python-redmine', which you can obtain with
pip install python-redmine
This script... | <commit_before><commit_msg>Add the tool to export the wiki pages from Planio<commit_after>"""This script exports the wiki pages from Redmine.
All wiki pages on Redmine (https://cocomud.plan.io) are saved in the
'doc' directory.
Requirements:
This script needs 'python-redmine', which you can obtain with
p... | |
a259b64d352d056f15354bac52436faaf7319456 | tests/unit/test_eventlike_unit.py | tests/unit/test_eventlike_unit.py | from butter.eventfd import Eventfd
from butter.fanotify import Fanotify
from butter.inotify import Inotify
from butter.signalfd import Signalfd
from butter.timerfd import Timerfd
import pytest
import os
@pytest.fixture(params=[Eventfd, Fanotify, Inotify, Signalfd, Timerfd])
def obj(request):
Obj = request.param
... | Check closing the same file twice | Check closing the same file twice
| Python | bsd-3-clause | wdv4758h/butter,dasSOZO/python-butter | Check closing the same file twice | from butter.eventfd import Eventfd
from butter.fanotify import Fanotify
from butter.inotify import Inotify
from butter.signalfd import Signalfd
from butter.timerfd import Timerfd
import pytest
import os
@pytest.fixture(params=[Eventfd, Fanotify, Inotify, Signalfd, Timerfd])
def obj(request):
Obj = request.param
... | <commit_before><commit_msg>Check closing the same file twice<commit_after> | from butter.eventfd import Eventfd
from butter.fanotify import Fanotify
from butter.inotify import Inotify
from butter.signalfd import Signalfd
from butter.timerfd import Timerfd
import pytest
import os
@pytest.fixture(params=[Eventfd, Fanotify, Inotify, Signalfd, Timerfd])
def obj(request):
Obj = request.param
... | Check closing the same file twicefrom butter.eventfd import Eventfd
from butter.fanotify import Fanotify
from butter.inotify import Inotify
from butter.signalfd import Signalfd
from butter.timerfd import Timerfd
import pytest
import os
@pytest.fixture(params=[Eventfd, Fanotify, Inotify, Signalfd, Timerfd])
def obj(req... | <commit_before><commit_msg>Check closing the same file twice<commit_after>from butter.eventfd import Eventfd
from butter.fanotify import Fanotify
from butter.inotify import Inotify
from butter.signalfd import Signalfd
from butter.timerfd import Timerfd
import pytest
import os
@pytest.fixture(params=[Eventfd, Fanotify,... | |
55cd293695c5457df8168874734c668a6d028718 | salt/_grains/digitalocean_metadata.py | salt/_grains/digitalocean_metadata.py | # -*- coding: utf-8 -*-
'''
:codeauthor: David Boucha
:copyright: © 2014 by the SaltStack Team, see AUTHORS for more details.
:license: Apache 2.0, see LICENSE for more details.
salt.grains.digitalocean_metadata.py
~~~~~~~~~~~~~~~~~~~~~~~
Create a DigitalOcean grain from the DigitalOcean meta... | Add digital ocean metadata grains | Add digital ocean metadata grains
| Python | mit | thusoy/salt-states,thusoy/salt-states,thusoy/salt-states,thusoy/salt-states | Add digital ocean metadata grains | # -*- coding: utf-8 -*-
'''
:codeauthor: David Boucha
:copyright: © 2014 by the SaltStack Team, see AUTHORS for more details.
:license: Apache 2.0, see LICENSE for more details.
salt.grains.digitalocean_metadata.py
~~~~~~~~~~~~~~~~~~~~~~~
Create a DigitalOcean grain from the DigitalOcean meta... | <commit_before><commit_msg>Add digital ocean metadata grains<commit_after> | # -*- coding: utf-8 -*-
'''
:codeauthor: David Boucha
:copyright: © 2014 by the SaltStack Team, see AUTHORS for more details.
:license: Apache 2.0, see LICENSE for more details.
salt.grains.digitalocean_metadata.py
~~~~~~~~~~~~~~~~~~~~~~~
Create a DigitalOcean grain from the DigitalOcean meta... | Add digital ocean metadata grains# -*- coding: utf-8 -*-
'''
:codeauthor: David Boucha
:copyright: © 2014 by the SaltStack Team, see AUTHORS for more details.
:license: Apache 2.0, see LICENSE for more details.
salt.grains.digitalocean_metadata.py
~~~~~~~~~~~~~~~~~~~~~~~
Create a DigitalOcean... | <commit_before><commit_msg>Add digital ocean metadata grains<commit_after># -*- coding: utf-8 -*-
'''
:codeauthor: David Boucha
:copyright: © 2014 by the SaltStack Team, see AUTHORS for more details.
:license: Apache 2.0, see LICENSE for more details.
salt.grains.digitalocean_metadata.py
~~~~~~~~~... | |
bbd4c21c40b060b2577e3ea16443617d45a63b6c | src/nodeconductor_openstack/migrations/0019_remove_payable_mixin.py | src/nodeconductor_openstack/migrations/0019_remove_payable_mixin.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('openstack', '0018_replace_security_group'),
]
operations = [
migrations.RemoveField(
model_name='instance',
... | Remove payable mixin - db migrations | Remove payable mixin - db migrations
- nc-1554
| Python | mit | opennode/nodeconductor-openstack | Remove payable mixin - db migrations
- nc-1554 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('openstack', '0018_replace_security_group'),
]
operations = [
migrations.RemoveField(
model_name='instance',
... | <commit_before><commit_msg>Remove payable mixin - db migrations
- nc-1554<commit_after> | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('openstack', '0018_replace_security_group'),
]
operations = [
migrations.RemoveField(
model_name='instance',
... | Remove payable mixin - db migrations
- nc-1554# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('openstack', '0018_replace_security_group'),
]
operations = [
migrations.Remo... | <commit_before><commit_msg>Remove payable mixin - db migrations
- nc-1554<commit_after># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('openstack', '0018_replace_security_group'),
]
... | |
fc2aafecf45716067c5bf860a877be2dfca4b7d3 | satsolver/hamilton.py | satsolver/hamilton.py | #!/usr/bin/python
"""
Conversion of the Hamiltonian cycle problem to SAT.
"""
from boolean import *
def hamiltonian_cycle(l):
"""
Convert a directed graph to an instance of SAT that is satisfiable
precisely when the graph has a Hamiltonian cycle.
The graph is given as a list of ordered tuples repres... | Add a conversion from the Hamiltonian cycle problem to SAT | Add a conversion from the Hamiltonian cycle problem to SAT
| Python | mit | jaanos/LVR-2016,jaanos/LVR-2016 | Add a conversion from the Hamiltonian cycle problem to SAT | #!/usr/bin/python
"""
Conversion of the Hamiltonian cycle problem to SAT.
"""
from boolean import *
def hamiltonian_cycle(l):
"""
Convert a directed graph to an instance of SAT that is satisfiable
precisely when the graph has a Hamiltonian cycle.
The graph is given as a list of ordered tuples repres... | <commit_before><commit_msg>Add a conversion from the Hamiltonian cycle problem to SAT<commit_after> | #!/usr/bin/python
"""
Conversion of the Hamiltonian cycle problem to SAT.
"""
from boolean import *
def hamiltonian_cycle(l):
"""
Convert a directed graph to an instance of SAT that is satisfiable
precisely when the graph has a Hamiltonian cycle.
The graph is given as a list of ordered tuples repres... | Add a conversion from the Hamiltonian cycle problem to SAT#!/usr/bin/python
"""
Conversion of the Hamiltonian cycle problem to SAT.
"""
from boolean import *
def hamiltonian_cycle(l):
"""
Convert a directed graph to an instance of SAT that is satisfiable
precisely when the graph has a Hamiltonian cycle.
... | <commit_before><commit_msg>Add a conversion from the Hamiltonian cycle problem to SAT<commit_after>#!/usr/bin/python
"""
Conversion of the Hamiltonian cycle problem to SAT.
"""
from boolean import *
def hamiltonian_cycle(l):
"""
Convert a directed graph to an instance of SAT that is satisfiable
precisely... | |
86fc6daa9e823370735de2061ad8765f44898aa8 | unicode/check_utf8.py | unicode/check_utf8.py | #!/usr/bin/env python
# Check whether a file contains valid UTF-8
# From http://stackoverflow.com/a/3269323
import codecs
import sys
def checkFile(filename):
try:
with codecs.open(filename, encoding='utf-8', errors='strict') as f:
for line in f:
pass
return 0
excep... | Add script for checking file is valid utf8 | Add script for checking file is valid utf8
| Python | mit | manics/shell-tools,manics/shell-tools | Add script for checking file is valid utf8 | #!/usr/bin/env python
# Check whether a file contains valid UTF-8
# From http://stackoverflow.com/a/3269323
import codecs
import sys
def checkFile(filename):
try:
with codecs.open(filename, encoding='utf-8', errors='strict') as f:
for line in f:
pass
return 0
excep... | <commit_before><commit_msg>Add script for checking file is valid utf8<commit_after> | #!/usr/bin/env python
# Check whether a file contains valid UTF-8
# From http://stackoverflow.com/a/3269323
import codecs
import sys
def checkFile(filename):
try:
with codecs.open(filename, encoding='utf-8', errors='strict') as f:
for line in f:
pass
return 0
excep... | Add script for checking file is valid utf8#!/usr/bin/env python
# Check whether a file contains valid UTF-8
# From http://stackoverflow.com/a/3269323
import codecs
import sys
def checkFile(filename):
try:
with codecs.open(filename, encoding='utf-8', errors='strict') as f:
for line in f:
... | <commit_before><commit_msg>Add script for checking file is valid utf8<commit_after>#!/usr/bin/env python
# Check whether a file contains valid UTF-8
# From http://stackoverflow.com/a/3269323
import codecs
import sys
def checkFile(filename):
try:
with codecs.open(filename, encoding='utf-8', errors='strict... | |
b1dcd0edf943f1c849f103a355f4945c59467ca3 | tuto-samples/arduino/stats.py | tuto-samples/arduino/stats.py | #!/usr/bin/python
# encoding: utf-8
# In order to use this script from shell:
# > ./build-samples >tempsizes
# > cat tempsizes | ./stats.py >sizes
# > rm tempsizes
# Then sizes file can be opened in LibreOffice Calc
from __future__ import with_statement
import argparse, re, sys
#TODO from example name, extract tutor... | Add script to extract Arduino IDE program size. | Add script to extract Arduino IDE program size.
| Python | lgpl-2.1 | jfpoilpret/fast-arduino-lib,jfpoilpret/fast-arduino-lib,jfpoilpret/fast-arduino-lib,jfpoilpret/fast-arduino-lib | Add script to extract Arduino IDE program size. | #!/usr/bin/python
# encoding: utf-8
# In order to use this script from shell:
# > ./build-samples >tempsizes
# > cat tempsizes | ./stats.py >sizes
# > rm tempsizes
# Then sizes file can be opened in LibreOffice Calc
from __future__ import with_statement
import argparse, re, sys
#TODO from example name, extract tutor... | <commit_before><commit_msg>Add script to extract Arduino IDE program size.<commit_after> | #!/usr/bin/python
# encoding: utf-8
# In order to use this script from shell:
# > ./build-samples >tempsizes
# > cat tempsizes | ./stats.py >sizes
# > rm tempsizes
# Then sizes file can be opened in LibreOffice Calc
from __future__ import with_statement
import argparse, re, sys
#TODO from example name, extract tutor... | Add script to extract Arduino IDE program size.#!/usr/bin/python
# encoding: utf-8
# In order to use this script from shell:
# > ./build-samples >tempsizes
# > cat tempsizes | ./stats.py >sizes
# > rm tempsizes
# Then sizes file can be opened in LibreOffice Calc
from __future__ import with_statement
import argparse, ... | <commit_before><commit_msg>Add script to extract Arduino IDE program size.<commit_after>#!/usr/bin/python
# encoding: utf-8
# In order to use this script from shell:
# > ./build-samples >tempsizes
# > cat tempsizes | ./stats.py >sizes
# > rm tempsizes
# Then sizes file can be opened in LibreOffice Calc
from __future_... | |
c5caecc621107326813dc0193257810f530f7eb8 | scripts/missing-qq.py | scripts/missing-qq.py | import os
import xml.etree.ElementTree as ET
RES_FOLDER = os.path.abspath(os.path.join(os.path.dirname(__file__), "../wikipedia/res"))
EN_STRINGS = os.path.join(RES_FOLDER, "values/strings.xml")
QQ_STRINGS = os.path.join(RES_FOLDER, "values-qq/strings.xml")
# Get ElementTree containing all message names in English
en... | Add script to find undocumented translations. | Add script to find undocumented translations.
To my knowledge there's no convenient way to find out if a string is missing a
translation into a particular language. For us this means that it's not easy
to check all of our strings and make sure they have documentation for our
translators. This patch adds a Python scrip... | Python | apache-2.0 | Wikinaut/wikipedia-app,Duct-and-rice/KrswtkhrWiki4Android,reproio/apps-android-wikipedia,Wikinaut/wikipedia-app,parvez3019/apps-android-wikipedia,SAGROUP2/apps-android-wikipedia,Wikinaut/wikipedia-app,wikimedia/apps-android-wikipedia,wikimedia/apps-android-wikipedia,reproio/apps-android-wikipedia,carloshwa/apps-android... | Add script to find undocumented translations.
To my knowledge there's no convenient way to find out if a string is missing a
translation into a particular language. For us this means that it's not easy
to check all of our strings and make sure they have documentation for our
translators. This patch adds a Python scrip... | import os
import xml.etree.ElementTree as ET
RES_FOLDER = os.path.abspath(os.path.join(os.path.dirname(__file__), "../wikipedia/res"))
EN_STRINGS = os.path.join(RES_FOLDER, "values/strings.xml")
QQ_STRINGS = os.path.join(RES_FOLDER, "values-qq/strings.xml")
# Get ElementTree containing all message names in English
en... | <commit_before><commit_msg>Add script to find undocumented translations.
To my knowledge there's no convenient way to find out if a string is missing a
translation into a particular language. For us this means that it's not easy
to check all of our strings and make sure they have documentation for our
translators. Thi... | import os
import xml.etree.ElementTree as ET
RES_FOLDER = os.path.abspath(os.path.join(os.path.dirname(__file__), "../wikipedia/res"))
EN_STRINGS = os.path.join(RES_FOLDER, "values/strings.xml")
QQ_STRINGS = os.path.join(RES_FOLDER, "values-qq/strings.xml")
# Get ElementTree containing all message names in English
en... | Add script to find undocumented translations.
To my knowledge there's no convenient way to find out if a string is missing a
translation into a particular language. For us this means that it's not easy
to check all of our strings and make sure they have documentation for our
translators. This patch adds a Python scrip... | <commit_before><commit_msg>Add script to find undocumented translations.
To my knowledge there's no convenient way to find out if a string is missing a
translation into a particular language. For us this means that it's not easy
to check all of our strings and make sure they have documentation for our
translators. Thi... | |
a58b3b3cdecfffd7aa8c7fbaa38007fcbea3061a | st2common/tests/unit/test_db_rbac.py | st2common/tests/unit/test_db_rbac.py | # Licensed to the StackStorm, Inc ('StackStorm') under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use th... | Add CRUD model DB test cases for RBAC models. | Add CRUD model DB test cases for RBAC models.
| Python | apache-2.0 | StackStorm/st2,tonybaloney/st2,StackStorm/st2,tonybaloney/st2,nzlosh/st2,StackStorm/st2,Plexxi/st2,Plexxi/st2,Plexxi/st2,nzlosh/st2,tonybaloney/st2,StackStorm/st2,Plexxi/st2,nzlosh/st2,nzlosh/st2 | Add CRUD model DB test cases for RBAC models. | # Licensed to the StackStorm, Inc ('StackStorm') under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use th... | <commit_before><commit_msg>Add CRUD model DB test cases for RBAC models.<commit_after> | # Licensed to the StackStorm, Inc ('StackStorm') under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use th... | Add CRUD model DB test cases for RBAC models.# Licensed to the StackStorm, Inc ('StackStorm') under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Vers... | <commit_before><commit_msg>Add CRUD model DB test cases for RBAC models.<commit_after># Licensed to the StackStorm, Inc ('StackStorm') under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this f... | |
c3b9972b3208ac6f484a3e496e5e64dc0fbe3b3d | scripts/kconfig-split.py | scripts/kconfig-split.py | #!/usr/bin/env python
# This is a slightly modified version of ChromiumOS' splitconfig
# https://chromium.googlesource.com/chromiumos/third_party/kernel/+/stabilize-5899.B-chromeos-3.14/chromeos/scripts/splitconfig
"""See this page for more details:
http://dev.chromium.org/chromium-os/how-tos-and-troubleshooting/kern... | Add script to split kernel config files | scripts: Add script to split kernel config files
This script is slightly modified from the ChromiumOS splitconfig
It takes a number of kernel config files and prints the common
on specific kernel config options to seperate files.
Signed-off-by: Rolf Neugebauer <6fdd1d8677ab4fbcb4df3eff6e190c3298f7f742@docker.com>
| Python | apache-2.0 | JohnnyLeone/linuxkit,t-koulouris/linuxkit,mor1/linuxkit,furious-luke/linuxkit,linuxkit/linuxkit,deitch/linuxkit,eyz/linuxkit,yankcrime/linuxkit,deitch/linuxkit,djs55/linuxkit,radu-matei/linuxkit,mor1/linuxkit,eyz/linuxkit,konstruktoid/linuxkit,radu-matei/linuxkit,YuPengZTE/linuxkit,davefreitag/linuxkit,konstruktoid/lin... | scripts: Add script to split kernel config files
This script is slightly modified from the ChromiumOS splitconfig
It takes a number of kernel config files and prints the common
on specific kernel config options to seperate files.
Signed-off-by: Rolf Neugebauer <6fdd1d8677ab4fbcb4df3eff6e190c3298f7f742@docker.com> | #!/usr/bin/env python
# This is a slightly modified version of ChromiumOS' splitconfig
# https://chromium.googlesource.com/chromiumos/third_party/kernel/+/stabilize-5899.B-chromeos-3.14/chromeos/scripts/splitconfig
"""See this page for more details:
http://dev.chromium.org/chromium-os/how-tos-and-troubleshooting/kern... | <commit_before><commit_msg>scripts: Add script to split kernel config files
This script is slightly modified from the ChromiumOS splitconfig
It takes a number of kernel config files and prints the common
on specific kernel config options to seperate files.
Signed-off-by: Rolf Neugebauer <6fdd1d8677ab4fbcb4df3eff6e19... | #!/usr/bin/env python
# This is a slightly modified version of ChromiumOS' splitconfig
# https://chromium.googlesource.com/chromiumos/third_party/kernel/+/stabilize-5899.B-chromeos-3.14/chromeos/scripts/splitconfig
"""See this page for more details:
http://dev.chromium.org/chromium-os/how-tos-and-troubleshooting/kern... | scripts: Add script to split kernel config files
This script is slightly modified from the ChromiumOS splitconfig
It takes a number of kernel config files and prints the common
on specific kernel config options to seperate files.
Signed-off-by: Rolf Neugebauer <6fdd1d8677ab4fbcb4df3eff6e190c3298f7f742@docker.com>#!/... | <commit_before><commit_msg>scripts: Add script to split kernel config files
This script is slightly modified from the ChromiumOS splitconfig
It takes a number of kernel config files and prints the common
on specific kernel config options to seperate files.
Signed-off-by: Rolf Neugebauer <6fdd1d8677ab4fbcb4df3eff6e19... | |
0b3a8b366853c40ff05b314e11ec1826f968e427 | seacat/spdy/alx1_http.py | seacat/spdy/alx1_http.py | import struct
from .spdy import *
from .vle import spdy_add_vle_string, spdy_read_vle_string
def build_syn_stream_frame(frame, stream_id, host, method, path):
hdr_len = struct.calcsize('!HH4BIIBB')
assert((frame.position + hdr_len) <= frame.capacity)
struct.pack_into('!HH4BIIBB', frame.data, frame.position,
CN... | Add SPDU build and parse functions related to HTTP. | Add SPDU build and parse functions related to HTTP.
| Python | bsd-3-clause | TeskaLabs/SeaCat-Client-Python3 | Add SPDU build and parse functions related to HTTP. | import struct
from .spdy import *
from .vle import spdy_add_vle_string, spdy_read_vle_string
def build_syn_stream_frame(frame, stream_id, host, method, path):
hdr_len = struct.calcsize('!HH4BIIBB')
assert((frame.position + hdr_len) <= frame.capacity)
struct.pack_into('!HH4BIIBB', frame.data, frame.position,
CN... | <commit_before><commit_msg>Add SPDU build and parse functions related to HTTP.<commit_after> | import struct
from .spdy import *
from .vle import spdy_add_vle_string, spdy_read_vle_string
def build_syn_stream_frame(frame, stream_id, host, method, path):
hdr_len = struct.calcsize('!HH4BIIBB')
assert((frame.position + hdr_len) <= frame.capacity)
struct.pack_into('!HH4BIIBB', frame.data, frame.position,
CN... | Add SPDU build and parse functions related to HTTP.import struct
from .spdy import *
from .vle import spdy_add_vle_string, spdy_read_vle_string
def build_syn_stream_frame(frame, stream_id, host, method, path):
hdr_len = struct.calcsize('!HH4BIIBB')
assert((frame.position + hdr_len) <= frame.capacity)
struct.pack_... | <commit_before><commit_msg>Add SPDU build and parse functions related to HTTP.<commit_after>import struct
from .spdy import *
from .vle import spdy_add_vle_string, spdy_read_vle_string
def build_syn_stream_frame(frame, stream_id, host, method, path):
hdr_len = struct.calcsize('!HH4BIIBB')
assert((frame.position + h... | |
b9903fb746dfac21a2b6387dd3ccd4e00a0562e8 | test/test_bezier_direct.py | test/test_bezier_direct.py | from __future__ import division
import sys
import os
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
#
import cocos
from cocos.director import director
from cocos.actions import Bezier
from cocos.sprite import Sprite
import pyglet
from cocos import path
def direct_bezier(p0, p1, p2, p3):
'''G... | Test using bezier going through 4 specific points | Test using bezier going through 4 specific points
| Python | bsd-3-clause | shujunqiao/cocos2d-python,shujunqiao/cocos2d-python,shujunqiao/cocos2d-python,vyscond/cocos,dangillet/cocos | Test using bezier going through 4 specific points | from __future__ import division
import sys
import os
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
#
import cocos
from cocos.director import director
from cocos.actions import Bezier
from cocos.sprite import Sprite
import pyglet
from cocos import path
def direct_bezier(p0, p1, p2, p3):
'''G... | <commit_before><commit_msg>Test using bezier going through 4 specific points<commit_after> | from __future__ import division
import sys
import os
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
#
import cocos
from cocos.director import director
from cocos.actions import Bezier
from cocos.sprite import Sprite
import pyglet
from cocos import path
def direct_bezier(p0, p1, p2, p3):
'''G... | Test using bezier going through 4 specific pointsfrom __future__ import division
import sys
import os
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
#
import cocos
from cocos.director import director
from cocos.actions import Bezier
from cocos.sprite import Sprite
import pyglet
from cocos import ... | <commit_before><commit_msg>Test using bezier going through 4 specific points<commit_after>from __future__ import division
import sys
import os
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
#
import cocos
from cocos.director import director
from cocos.actions import Bezier
from cocos.sprite import... | |
ab76f87e013e330ad50f4a81ee0c72c36cb29681 | thefuck/rules/sudo.py | thefuck/rules/sudo.py | patterns = ['permission denied',
'EACCES',
'pkg: Insufficient privileges',
'you cannot perform this operation unless you are root',
'non-root users cannot',
'Operation not permitted',
'root privilege',
'This command has to be run under ... | patterns = ['permission denied',
'EACCES',
'pkg: Insufficient privileges',
'you cannot perform this operation unless you are root',
'non-root users cannot',
'Operation not permitted',
'root privilege',
'This command has to be run under ... | Add one more 'need root' phrase | Add one more 'need root' phrase | Python | mit | thinkerchan/thefuck,artiya4u/thefuck,subajat1/thefuck,scorphus/thefuck,princeofdarkness76/thefuck,mcarton/thefuck,BertieJim/thefuck,manashmndl/thefuck,ostree/thefuck,MJerty/thefuck,thinkerchan/thefuck,scorphus/thefuck,gogobebe2/thefuck,AntonChankin/thefuck,beni55/thefuck,Clpsplug/thefuck,ostree/thefuck,bigplus/thefuck,... | patterns = ['permission denied',
'EACCES',
'pkg: Insufficient privileges',
'you cannot perform this operation unless you are root',
'non-root users cannot',
'Operation not permitted',
'root privilege',
'This command has to be run under ... | patterns = ['permission denied',
'EACCES',
'pkg: Insufficient privileges',
'you cannot perform this operation unless you are root',
'non-root users cannot',
'Operation not permitted',
'root privilege',
'This command has to be run under ... | <commit_before>patterns = ['permission denied',
'EACCES',
'pkg: Insufficient privileges',
'you cannot perform this operation unless you are root',
'non-root users cannot',
'Operation not permitted',
'root privilege',
'This command has t... | patterns = ['permission denied',
'EACCES',
'pkg: Insufficient privileges',
'you cannot perform this operation unless you are root',
'non-root users cannot',
'Operation not permitted',
'root privilege',
'This command has to be run under ... | patterns = ['permission denied',
'EACCES',
'pkg: Insufficient privileges',
'you cannot perform this operation unless you are root',
'non-root users cannot',
'Operation not permitted',
'root privilege',
'This command has to be run under ... | <commit_before>patterns = ['permission denied',
'EACCES',
'pkg: Insufficient privileges',
'you cannot perform this operation unless you are root',
'non-root users cannot',
'Operation not permitted',
'root privilege',
'This command has t... |
f9c6b98794f6bed718ac924d28f6d9607c7c3e84 | rxcalc/migrations/0010_medication_admin.py | rxcalc/migrations/0010_medication_admin.py | # -*- coding: utf-8 -*-
# Generated by Django 1.9.1 on 2016-01-21 21:26
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('rxcalc', '0009_auto_20160121_2107'),
]
operations = [
migrations.AddField(
... | Add admin field to Medication model | Add admin field to Medication model
| Python | mit | onnudilol/vetcalc,onnudilol/vetcalc,onnudilol/vetcalc | Add admin field to Medication model | # -*- coding: utf-8 -*-
# Generated by Django 1.9.1 on 2016-01-21 21:26
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('rxcalc', '0009_auto_20160121_2107'),
]
operations = [
migrations.AddField(
... | <commit_before><commit_msg>Add admin field to Medication model<commit_after> | # -*- coding: utf-8 -*-
# Generated by Django 1.9.1 on 2016-01-21 21:26
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('rxcalc', '0009_auto_20160121_2107'),
]
operations = [
migrations.AddField(
... | Add admin field to Medication model# -*- coding: utf-8 -*-
# Generated by Django 1.9.1 on 2016-01-21 21:26
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('rxcalc', '0009_auto_20160121_2107'),
]
operations... | <commit_before><commit_msg>Add admin field to Medication model<commit_after># -*- coding: utf-8 -*-
# Generated by Django 1.9.1 on 2016-01-21 21:26
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('rxcalc', '0009_au... | |
edbc13599fa3cecef123c148463b53019b16165e | analysis/normalize-program-path.py | analysis/normalize-program-path.py | #!/usr/bin/env python
# vim: set sw=2 ts=2 softtabstop=2 expandtab:
"""
Strip prefix from "program" key. This
can be used if slightly different paths
were used to generate result sets and they
need to made comparable
"""
import argparse
import os
import logging
import pprint
import sys
import yaml
try:
# Try to use ... | Add script to normalise program paths. | Add script to normalise program paths.
| Python | bsd-3-clause | symbooglix/boogie-runner,symbooglix/boogie-runner | Add script to normalise program paths. | #!/usr/bin/env python
# vim: set sw=2 ts=2 softtabstop=2 expandtab:
"""
Strip prefix from "program" key. This
can be used if slightly different paths
were used to generate result sets and they
need to made comparable
"""
import argparse
import os
import logging
import pprint
import sys
import yaml
try:
# Try to use ... | <commit_before><commit_msg>Add script to normalise program paths.<commit_after> | #!/usr/bin/env python
# vim: set sw=2 ts=2 softtabstop=2 expandtab:
"""
Strip prefix from "program" key. This
can be used if slightly different paths
were used to generate result sets and they
need to made comparable
"""
import argparse
import os
import logging
import pprint
import sys
import yaml
try:
# Try to use ... | Add script to normalise program paths.#!/usr/bin/env python
# vim: set sw=2 ts=2 softtabstop=2 expandtab:
"""
Strip prefix from "program" key. This
can be used if slightly different paths
were used to generate result sets and they
need to made comparable
"""
import argparse
import os
import logging
import pprint
import... | <commit_before><commit_msg>Add script to normalise program paths.<commit_after>#!/usr/bin/env python
# vim: set sw=2 ts=2 softtabstop=2 expandtab:
"""
Strip prefix from "program" key. This
can be used if slightly different paths
were used to generate result sets and they
need to made comparable
"""
import argparse
impo... | |
742571108e4baa2a3e177bc95f44c98a26462c7b | django_redis/serializers/pickle.py | django_redis/serializers/pickle.py | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
# Import the fastest implementation of
# pickle package. This should be removed
# when python3 come the unique supported
# python version
try:
import cPickle as pickle
except ImportError:
import pickle
from django.core.exception... | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
# Import the fastest implementation of
# pickle package. This should be removed
# when python3 come the unique supported
# python version
try:
import cPickle as pickle
except ImportError:
import pickle
from django.core.exception... | Fix small mistake; options is a argument, not a member. | Fix small mistake; options is a argument, not a member.
| Python | bsd-3-clause | smahs/django-redis,zl352773277/django-redis,lucius-feng/django-redis,GetAmbassador/django-redis,yanheng/django-redis | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
# Import the fastest implementation of
# pickle package. This should be removed
# when python3 come the unique supported
# python version
try:
import cPickle as pickle
except ImportError:
import pickle
from django.core.exception... | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
# Import the fastest implementation of
# pickle package. This should be removed
# when python3 come the unique supported
# python version
try:
import cPickle as pickle
except ImportError:
import pickle
from django.core.exception... | <commit_before># -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
# Import the fastest implementation of
# pickle package. This should be removed
# when python3 come the unique supported
# python version
try:
import cPickle as pickle
except ImportError:
import pickle
from django... | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
# Import the fastest implementation of
# pickle package. This should be removed
# when python3 come the unique supported
# python version
try:
import cPickle as pickle
except ImportError:
import pickle
from django.core.exception... | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
# Import the fastest implementation of
# pickle package. This should be removed
# when python3 come the unique supported
# python version
try:
import cPickle as pickle
except ImportError:
import pickle
from django.core.exception... | <commit_before># -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
# Import the fastest implementation of
# pickle package. This should be removed
# when python3 come the unique supported
# python version
try:
import cPickle as pickle
except ImportError:
import pickle
from django... |
849aaa0ec7107837d33cf1bf1f2d3b76c59e62c8 | assign_binary_data.py | assign_binary_data.py |
def assign_binary_data(variable_name, initial_indent, maximum_width, data_string):
"""
Assign :attr:`data_string` to :attr:`variable_name` using parentheses to wrap multiple lines as needed.
:param str variable_name: The name of the variable being defined
:param int initial_indent: The initial indent... | Add script for assigning wrapped string variables (for storing binary data) | Add script for assigning wrapped string variables (for storing binary data)
| Python | lgpl-2.1 | achernet/pyscripts | Add script for assigning wrapped string variables (for storing binary data) |
def assign_binary_data(variable_name, initial_indent, maximum_width, data_string):
"""
Assign :attr:`data_string` to :attr:`variable_name` using parentheses to wrap multiple lines as needed.
:param str variable_name: The name of the variable being defined
:param int initial_indent: The initial indent... | <commit_before><commit_msg>Add script for assigning wrapped string variables (for storing binary data)<commit_after> |
def assign_binary_data(variable_name, initial_indent, maximum_width, data_string):
"""
Assign :attr:`data_string` to :attr:`variable_name` using parentheses to wrap multiple lines as needed.
:param str variable_name: The name of the variable being defined
:param int initial_indent: The initial indent... | Add script for assigning wrapped string variables (for storing binary data)
def assign_binary_data(variable_name, initial_indent, maximum_width, data_string):
"""
Assign :attr:`data_string` to :attr:`variable_name` using parentheses to wrap multiple lines as needed.
:param str variable_name: The name of t... | <commit_before><commit_msg>Add script for assigning wrapped string variables (for storing binary data)<commit_after>
def assign_binary_data(variable_name, initial_indent, maximum_width, data_string):
"""
Assign :attr:`data_string` to :attr:`variable_name` using parentheses to wrap multiple lines as needed.
... | |
995cbc69b41216b08639ecd549f0dbdf241e94fc | zerver/migrations/0383_revoke_invitations_from_deactivated_users.py | zerver/migrations/0383_revoke_invitations_from_deactivated_users.py | from typing import List
from django.db import migrations
from django.db.backends.postgresql.schema import DatabaseSchemaEditor
from django.db.migrations.state import StateApps
from django.utils.timezone import now as timezone_now
def revoke_invitations(apps: StateApps, schema_editor: DatabaseSchemaEditor) -> None:
... | Add migration to revoke invites from old deactivated users. | migrations: Add migration to revoke invites from old deactivated users.
This is a natural follow-up to
93e8740218bef0a7fea43197dc818393a5e43928 - invitations sent by users
deactivated before the commit still need to be revoked, via a
migration.
The logic for finding the Confirmations to deactivated is based on
get_va... | Python | apache-2.0 | rht/zulip,zulip/zulip,zulip/zulip,andersk/zulip,kou/zulip,zulip/zulip,kou/zulip,zulip/zulip,andersk/zulip,andersk/zulip,kou/zulip,rht/zulip,rht/zulip,kou/zulip,rht/zulip,kou/zulip,andersk/zulip,andersk/zulip,zulip/zulip,kou/zulip,andersk/zulip,zulip/zulip,kou/zulip,rht/zulip,rht/zulip,andersk/zulip,zulip/zulip,rht/zuli... | migrations: Add migration to revoke invites from old deactivated users.
This is a natural follow-up to
93e8740218bef0a7fea43197dc818393a5e43928 - invitations sent by users
deactivated before the commit still need to be revoked, via a
migration.
The logic for finding the Confirmations to deactivated is based on
get_va... | from typing import List
from django.db import migrations
from django.db.backends.postgresql.schema import DatabaseSchemaEditor
from django.db.migrations.state import StateApps
from django.utils.timezone import now as timezone_now
def revoke_invitations(apps: StateApps, schema_editor: DatabaseSchemaEditor) -> None:
... | <commit_before><commit_msg>migrations: Add migration to revoke invites from old deactivated users.
This is a natural follow-up to
93e8740218bef0a7fea43197dc818393a5e43928 - invitations sent by users
deactivated before the commit still need to be revoked, via a
migration.
The logic for finding the Confirmations to dea... | from typing import List
from django.db import migrations
from django.db.backends.postgresql.schema import DatabaseSchemaEditor
from django.db.migrations.state import StateApps
from django.utils.timezone import now as timezone_now
def revoke_invitations(apps: StateApps, schema_editor: DatabaseSchemaEditor) -> None:
... | migrations: Add migration to revoke invites from old deactivated users.
This is a natural follow-up to
93e8740218bef0a7fea43197dc818393a5e43928 - invitations sent by users
deactivated before the commit still need to be revoked, via a
migration.
The logic for finding the Confirmations to deactivated is based on
get_va... | <commit_before><commit_msg>migrations: Add migration to revoke invites from old deactivated users.
This is a natural follow-up to
93e8740218bef0a7fea43197dc818393a5e43928 - invitations sent by users
deactivated before the commit still need to be revoked, via a
migration.
The logic for finding the Confirmations to dea... | |
e2fbe143f9df142688683c5d90981284cfb71c69 | game.py | game.py | from collections import namedtuple
import itertools
# rows: list of lists for top, middle, bottom rows
# draw: whatever has been drawn
# remaining: set of remaining cards
PineappleGame1State = namedtuple('PineappleGame1State', ['rows', 'draw', 'remaining'])
CARD_VALUES = '23456789TJQKA'
def card_value(card):
retur... | Add basic N of a kind evaluation function for final hand. | Add basic N of a kind evaluation function for final hand.
| Python | mit | session-id/pineapple-ai | Add basic N of a kind evaluation function for final hand. | from collections import namedtuple
import itertools
# rows: list of lists for top, middle, bottom rows
# draw: whatever has been drawn
# remaining: set of remaining cards
PineappleGame1State = namedtuple('PineappleGame1State', ['rows', 'draw', 'remaining'])
CARD_VALUES = '23456789TJQKA'
def card_value(card):
retur... | <commit_before><commit_msg>Add basic N of a kind evaluation function for final hand.<commit_after> | from collections import namedtuple
import itertools
# rows: list of lists for top, middle, bottom rows
# draw: whatever has been drawn
# remaining: set of remaining cards
PineappleGame1State = namedtuple('PineappleGame1State', ['rows', 'draw', 'remaining'])
CARD_VALUES = '23456789TJQKA'
def card_value(card):
retur... | Add basic N of a kind evaluation function for final hand.from collections import namedtuple
import itertools
# rows: list of lists for top, middle, bottom rows
# draw: whatever has been drawn
# remaining: set of remaining cards
PineappleGame1State = namedtuple('PineappleGame1State', ['rows', 'draw', 'remaining'])
CAR... | <commit_before><commit_msg>Add basic N of a kind evaluation function for final hand.<commit_after>from collections import namedtuple
import itertools
# rows: list of lists for top, middle, bottom rows
# draw: whatever has been drawn
# remaining: set of remaining cards
PineappleGame1State = namedtuple('PineappleGame1St... | |
bde734dc751cbfd59b40c1c2f0d60229795fae4a | tests/app/main/test_request_header.py | tests/app/main/test_request_header.py | import pytest
from tests.conftest import set_config_values
@pytest.mark.parametrize('check_proxy_header,header_value,expected_code', [
(True, 'key_1', 200),
(True, 'wrong_key', 403),
(False, 'wrong_key', 200),
(False, 'key_1', 200),
])
def test_route_correct_secret_key(app_, check_proxy_header, heade... | import pytest
from tests.conftest import set_config_values
@pytest.mark.parametrize('check_proxy_header,header_value,expected_code', [
(True, 'key_1', 200),
(True, 'wrong_key', 403),
(False, 'wrong_key', 200),
(False, 'key_1', 200),
])
def test_route_correct_secret_key(app_, check_proxy_header, heade... | Use test_client() as context manager | Use test_client() as context manager
| Python | mit | gov-cjwaszczuk/notifications-admin,gov-cjwaszczuk/notifications-admin,gov-cjwaszczuk/notifications-admin,alphagov/notifications-admin,gov-cjwaszczuk/notifications-admin,alphagov/notifications-admin,alphagov/notifications-admin,alphagov/notifications-admin | import pytest
from tests.conftest import set_config_values
@pytest.mark.parametrize('check_proxy_header,header_value,expected_code', [
(True, 'key_1', 200),
(True, 'wrong_key', 403),
(False, 'wrong_key', 200),
(False, 'key_1', 200),
])
def test_route_correct_secret_key(app_, check_proxy_header, heade... | import pytest
from tests.conftest import set_config_values
@pytest.mark.parametrize('check_proxy_header,header_value,expected_code', [
(True, 'key_1', 200),
(True, 'wrong_key', 403),
(False, 'wrong_key', 200),
(False, 'key_1', 200),
])
def test_route_correct_secret_key(app_, check_proxy_header, heade... | <commit_before>import pytest
from tests.conftest import set_config_values
@pytest.mark.parametrize('check_proxy_header,header_value,expected_code', [
(True, 'key_1', 200),
(True, 'wrong_key', 403),
(False, 'wrong_key', 200),
(False, 'key_1', 200),
])
def test_route_correct_secret_key(app_, check_prox... | import pytest
from tests.conftest import set_config_values
@pytest.mark.parametrize('check_proxy_header,header_value,expected_code', [
(True, 'key_1', 200),
(True, 'wrong_key', 403),
(False, 'wrong_key', 200),
(False, 'key_1', 200),
])
def test_route_correct_secret_key(app_, check_proxy_header, heade... | import pytest
from tests.conftest import set_config_values
@pytest.mark.parametrize('check_proxy_header,header_value,expected_code', [
(True, 'key_1', 200),
(True, 'wrong_key', 403),
(False, 'wrong_key', 200),
(False, 'key_1', 200),
])
def test_route_correct_secret_key(app_, check_proxy_header, heade... | <commit_before>import pytest
from tests.conftest import set_config_values
@pytest.mark.parametrize('check_proxy_header,header_value,expected_code', [
(True, 'key_1', 200),
(True, 'wrong_key', 403),
(False, 'wrong_key', 200),
(False, 'key_1', 200),
])
def test_route_correct_secret_key(app_, check_prox... |
9c3d685d02d2ffe509209288b3d4164f0dfa35fc | statistics/with-mercy.py | statistics/with-mercy.py | from collections import namedtuple
import math
Box = namedtuple('Box', ['count', 'cost'])
MAX_COUNT = 50
PROBABILITY = 1.0 / 60
TABLE = [
Box(2, 2400),
Box(5, 6000),
Box(11, 12000),
Box(24, 24000),
Box(50, 48000)
]
PRIOR = [math.pow(1.0 - PROBABILITY, count) for count,__ in TABLE]
pick = [0, 0, ... | Add example file for witch-mercy | Add example file for witch-mercy
| Python | mit | yeonghoey/yeonghoey,yeonghoey/yeonghoey,yeonghoey/yeonghoey,yeonghoey/notes,yeonghoey/yeonghoey | Add example file for witch-mercy | from collections import namedtuple
import math
Box = namedtuple('Box', ['count', 'cost'])
MAX_COUNT = 50
PROBABILITY = 1.0 / 60
TABLE = [
Box(2, 2400),
Box(5, 6000),
Box(11, 12000),
Box(24, 24000),
Box(50, 48000)
]
PRIOR = [math.pow(1.0 - PROBABILITY, count) for count,__ in TABLE]
pick = [0, 0, ... | <commit_before><commit_msg>Add example file for witch-mercy<commit_after> | from collections import namedtuple
import math
Box = namedtuple('Box', ['count', 'cost'])
MAX_COUNT = 50
PROBABILITY = 1.0 / 60
TABLE = [
Box(2, 2400),
Box(5, 6000),
Box(11, 12000),
Box(24, 24000),
Box(50, 48000)
]
PRIOR = [math.pow(1.0 - PROBABILITY, count) for count,__ in TABLE]
pick = [0, 0, ... | Add example file for witch-mercyfrom collections import namedtuple
import math
Box = namedtuple('Box', ['count', 'cost'])
MAX_COUNT = 50
PROBABILITY = 1.0 / 60
TABLE = [
Box(2, 2400),
Box(5, 6000),
Box(11, 12000),
Box(24, 24000),
Box(50, 48000)
]
PRIOR = [math.pow(1.0 - PROBABILITY, count) for cou... | <commit_before><commit_msg>Add example file for witch-mercy<commit_after>from collections import namedtuple
import math
Box = namedtuple('Box', ['count', 'cost'])
MAX_COUNT = 50
PROBABILITY = 1.0 / 60
TABLE = [
Box(2, 2400),
Box(5, 6000),
Box(11, 12000),
Box(24, 24000),
Box(50, 48000)
]
PRIOR = [m... | |
7572092883a3ec4dd66c209e9b47d28a5f93cba7 | gpioCleanup.py | gpioCleanup.py | import RPi.GPIO as GPIO
GPIO.setup(16, GPIO.IN)
GPIO.setup(20, GPIO.IN)
GPIO.setup(23, GPIO.IN)
GPIO.setup(18, GPIO.IN)
GPIO.setup(17, GPIO.IN)
GPIO.setup(27, GPIO.IN)
GPIO.setup(5, GPIO.IN)
GPIO.cleanup()
| Add gpio clean up tool | Add gpio clean up tool
| Python | mit | azmiik/tweetBooth | Add gpio clean up tool | import RPi.GPIO as GPIO
GPIO.setup(16, GPIO.IN)
GPIO.setup(20, GPIO.IN)
GPIO.setup(23, GPIO.IN)
GPIO.setup(18, GPIO.IN)
GPIO.setup(17, GPIO.IN)
GPIO.setup(27, GPIO.IN)
GPIO.setup(5, GPIO.IN)
GPIO.cleanup()
| <commit_before><commit_msg>Add gpio clean up tool<commit_after> | import RPi.GPIO as GPIO
GPIO.setup(16, GPIO.IN)
GPIO.setup(20, GPIO.IN)
GPIO.setup(23, GPIO.IN)
GPIO.setup(18, GPIO.IN)
GPIO.setup(17, GPIO.IN)
GPIO.setup(27, GPIO.IN)
GPIO.setup(5, GPIO.IN)
GPIO.cleanup()
| Add gpio clean up toolimport RPi.GPIO as GPIO
GPIO.setup(16, GPIO.IN)
GPIO.setup(20, GPIO.IN)
GPIO.setup(23, GPIO.IN)
GPIO.setup(18, GPIO.IN)
GPIO.setup(17, GPIO.IN)
GPIO.setup(27, GPIO.IN)
GPIO.setup(5, GPIO.IN)
GPIO.cleanup()
| <commit_before><commit_msg>Add gpio clean up tool<commit_after>import RPi.GPIO as GPIO
GPIO.setup(16, GPIO.IN)
GPIO.setup(20, GPIO.IN)
GPIO.setup(23, GPIO.IN)
GPIO.setup(18, GPIO.IN)
GPIO.setup(17, GPIO.IN)
GPIO.setup(27, GPIO.IN)
GPIO.setup(5, GPIO.IN)
GPIO.cleanup()
| |
0cfe6707cf02bab74741433dbe7a91b8c5c57f38 | cinder/tests/unit/test_fixtures.py | cinder/tests/unit/test_fixtures.py | # Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# 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 t... | Copy unit tests for StandardLogging fixture from Nova | Copy unit tests for StandardLogging fixture from Nova
This comes from commit f96ec4411ce89606cf52211061003c14306dcfa1
in Nova by Sean Dague <sean@dague.net>.
The StandardLogging fixture was already merged into Cinder,
this adds the unit tests that were missed when copying over
the fixture.
Change-Id: I2fbe25ec71138e... | Python | apache-2.0 | Nexenta/cinder,bswartz/cinder,NetApp/cinder,mahak/cinder,Nexenta/cinder,phenoxim/cinder,Datera/cinder,openstack/cinder,cloudbase/cinder,Hybrid-Cloud/cinder,phenoxim/cinder,NetApp/cinder,Datera/cinder,cloudbase/cinder,j-griffith/cinder,openstack/cinder,mahak/cinder,ge0rgi/cinder,Hybrid-Cloud/cinder,bswartz/cinder,j-grif... | Copy unit tests for StandardLogging fixture from Nova
This comes from commit f96ec4411ce89606cf52211061003c14306dcfa1
in Nova by Sean Dague <sean@dague.net>.
The StandardLogging fixture was already merged into Cinder,
this adds the unit tests that were missed when copying over
the fixture.
Change-Id: I2fbe25ec71138e... | # Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# 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 t... | <commit_before><commit_msg>Copy unit tests for StandardLogging fixture from Nova
This comes from commit f96ec4411ce89606cf52211061003c14306dcfa1
in Nova by Sean Dague <sean@dague.net>.
The StandardLogging fixture was already merged into Cinder,
this adds the unit tests that were missed when copying over
the fixture.
... | # Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# 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 t... | Copy unit tests for StandardLogging fixture from Nova
This comes from commit f96ec4411ce89606cf52211061003c14306dcfa1
in Nova by Sean Dague <sean@dague.net>.
The StandardLogging fixture was already merged into Cinder,
this adds the unit tests that were missed when copying over
the fixture.
Change-Id: I2fbe25ec71138e... | <commit_before><commit_msg>Copy unit tests for StandardLogging fixture from Nova
This comes from commit f96ec4411ce89606cf52211061003c14306dcfa1
in Nova by Sean Dague <sean@dague.net>.
The StandardLogging fixture was already merged into Cinder,
this adds the unit tests that were missed when copying over
the fixture.
... | |
a522ca9af1fd7333cbd7c925596a3c66a7233b90 | euler027.py | euler027.py | #!/usr/bin/python
"""
I don't have found a clever solution, this is a brute force analysis
"""
from math import sqrt, ceil
prime_list = [0] * 20000
def isPrime(x):
if x < 0:
return 0
if x % 2 == 0:
return 0
if prime_list[x]:
return 1
for i in range(3, ceil(sqrt(x)), 2):
... | Add solution for problem 27 | Add solution for problem 27
| Python | mit | cifvts/PyEuler | Add solution for problem 27 | #!/usr/bin/python
"""
I don't have found a clever solution, this is a brute force analysis
"""
from math import sqrt, ceil
prime_list = [0] * 20000
def isPrime(x):
if x < 0:
return 0
if x % 2 == 0:
return 0
if prime_list[x]:
return 1
for i in range(3, ceil(sqrt(x)), 2):
... | <commit_before><commit_msg>Add solution for problem 27<commit_after> | #!/usr/bin/python
"""
I don't have found a clever solution, this is a brute force analysis
"""
from math import sqrt, ceil
prime_list = [0] * 20000
def isPrime(x):
if x < 0:
return 0
if x % 2 == 0:
return 0
if prime_list[x]:
return 1
for i in range(3, ceil(sqrt(x)), 2):
... | Add solution for problem 27#!/usr/bin/python
"""
I don't have found a clever solution, this is a brute force analysis
"""
from math import sqrt, ceil
prime_list = [0] * 20000
def isPrime(x):
if x < 0:
return 0
if x % 2 == 0:
return 0
if prime_list[x]:
return 1
for i in range... | <commit_before><commit_msg>Add solution for problem 27<commit_after>#!/usr/bin/python
"""
I don't have found a clever solution, this is a brute force analysis
"""
from math import sqrt, ceil
prime_list = [0] * 20000
def isPrime(x):
if x < 0:
return 0
if x % 2 == 0:
return 0
if prime_lis... | |
0a0982c460f786c4f02cd99877eefc90b7b6b51b | backend/course/same-replace.py | backend/course/same-replace.py | import json
import getpass
import logging.config
from . import mysnu
from django.conf import settings
logging.config.dictConfig(settings.LOGGING)
def crawl():
userid = input('mySNU userid: ')
password = getpass.getpass('mySNU password: ')
session = mysnu.login(userid, password)
if session is None: #... | Implement same&replace courses info crawler | Implement same&replace courses info crawler
| Python | mit | Jhuni0123/graduate-adventure,dnsdhrj/graduate-adventure,MKRoughDiamond/graduate-adventure,skystar-p/graduate-adventure,skystar-p/graduate-adventure,skystar-p/graduate-adventure,LastOne817/graduate-adventure,skystar-p/graduate-adventure,dnsdhrj/graduate-adventure,Jhuni0123/graduate-adventure,LastOne817/graduate-adventur... | Implement same&replace courses info crawler | import json
import getpass
import logging.config
from . import mysnu
from django.conf import settings
logging.config.dictConfig(settings.LOGGING)
def crawl():
userid = input('mySNU userid: ')
password = getpass.getpass('mySNU password: ')
session = mysnu.login(userid, password)
if session is None: #... | <commit_before><commit_msg>Implement same&replace courses info crawler<commit_after> | import json
import getpass
import logging.config
from . import mysnu
from django.conf import settings
logging.config.dictConfig(settings.LOGGING)
def crawl():
userid = input('mySNU userid: ')
password = getpass.getpass('mySNU password: ')
session = mysnu.login(userid, password)
if session is None: #... | Implement same&replace courses info crawlerimport json
import getpass
import logging.config
from . import mysnu
from django.conf import settings
logging.config.dictConfig(settings.LOGGING)
def crawl():
userid = input('mySNU userid: ')
password = getpass.getpass('mySNU password: ')
session = mysnu.login(u... | <commit_before><commit_msg>Implement same&replace courses info crawler<commit_after>import json
import getpass
import logging.config
from . import mysnu
from django.conf import settings
logging.config.dictConfig(settings.LOGGING)
def crawl():
userid = input('mySNU userid: ')
password = getpass.getpass('mySNU... | |
035e107af64549c4ad39084e36e6bd2263ee3e02 | tools/perf/measurements/record_per_area.py | tools/perf/measurements/record_per_area.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.
import time
from metrics import smoothness
from telemetry.core import util
from telemetry.page import page_measurement
class RecordPerArea(page_measurement... | Add record per area measurement. | telemetry: Add record per area measurement.
This patch adds a record per area measurement which hooks into
picture record microbenchmark.
R=nduca@chromium.org
NOTRY=True
Review URL: https://codereview.chromium.org/27051005
git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@228801 0039d316-1c4b-4281-b951-d872f2087... | Python | bsd-3-clause | dushu1203/chromium.src,fujunwei/chromium-crosswalk,Just-D/chromium-1,anirudhSK/chromium,ChromiumWebApps/chromium,Fireblend/chromium-crosswalk,Pluto-tv/chromium-crosswalk,jaruba/chromium.src,ChromiumWebApps/chromium,anirudhSK/chromium,Chilledheart/chromium,mohamed--abdel-maksoud/chromium.src,Chilledheart/chromium,patric... | telemetry: Add record per area measurement.
This patch adds a record per area measurement which hooks into
picture record microbenchmark.
R=nduca@chromium.org
NOTRY=True
Review URL: https://codereview.chromium.org/27051005
git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@228801 0039d316-1c4b-4281-b951-d872f2087... | # 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.
import time
from metrics import smoothness
from telemetry.core import util
from telemetry.page import page_measurement
class RecordPerArea(page_measurement... | <commit_before><commit_msg>telemetry: Add record per area measurement.
This patch adds a record per area measurement which hooks into
picture record microbenchmark.
R=nduca@chromium.org
NOTRY=True
Review URL: https://codereview.chromium.org/27051005
git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@228801 0039d3... | # 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.
import time
from metrics import smoothness
from telemetry.core import util
from telemetry.page import page_measurement
class RecordPerArea(page_measurement... | telemetry: Add record per area measurement.
This patch adds a record per area measurement which hooks into
picture record microbenchmark.
R=nduca@chromium.org
NOTRY=True
Review URL: https://codereview.chromium.org/27051005
git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@228801 0039d316-1c4b-4281-b951-d872f2087... | <commit_before><commit_msg>telemetry: Add record per area measurement.
This patch adds a record per area measurement which hooks into
picture record microbenchmark.
R=nduca@chromium.org
NOTRY=True
Review URL: https://codereview.chromium.org/27051005
git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@228801 0039d3... | |
2a1adeaa61e61531f8f69a459b098b4ecf147941 | tornado/test/__init__.py | tornado/test/__init__.py | import asyncio
import sys
# Use the selector event loop on windows. Do this in tornado/test/__init__.py
# instead of runtests.py so it happens no matter how the test is run (such as
# through editor integrations).
if sys.platform == "win32" and hasattr(asyncio, "WindowsSelectorEventLoopPolicy"):
asyncio.set_event_... | Use selector event loop on windows. | test: Use selector event loop on windows.
This gets most of the tests working again on windows with py38.
| Python | apache-2.0 | bdarnell/tornado,dongpinglai/my_tornado,tornadoweb/tornado,bdarnell/tornado,bdarnell/tornado,lilydjwg/tornado,tornadoweb/tornado,dongpinglai/my_tornado,allenl203/tornado,bdarnell/tornado,mivade/tornado,allenl203/tornado,allenl203/tornado,mivade/tornado,allenl203/tornado,mivade/tornado,tornadoweb/tornado,lilydjwg/tornad... | test: Use selector event loop on windows.
This gets most of the tests working again on windows with py38. | import asyncio
import sys
# Use the selector event loop on windows. Do this in tornado/test/__init__.py
# instead of runtests.py so it happens no matter how the test is run (such as
# through editor integrations).
if sys.platform == "win32" and hasattr(asyncio, "WindowsSelectorEventLoopPolicy"):
asyncio.set_event_... | <commit_before><commit_msg>test: Use selector event loop on windows.
This gets most of the tests working again on windows with py38.<commit_after> | import asyncio
import sys
# Use the selector event loop on windows. Do this in tornado/test/__init__.py
# instead of runtests.py so it happens no matter how the test is run (such as
# through editor integrations).
if sys.platform == "win32" and hasattr(asyncio, "WindowsSelectorEventLoopPolicy"):
asyncio.set_event_... | test: Use selector event loop on windows.
This gets most of the tests working again on windows with py38.import asyncio
import sys
# Use the selector event loop on windows. Do this in tornado/test/__init__.py
# instead of runtests.py so it happens no matter how the test is run (such as
# through editor integrations).... | <commit_before><commit_msg>test: Use selector event loop on windows.
This gets most of the tests working again on windows with py38.<commit_after>import asyncio
import sys
# Use the selector event loop on windows. Do this in tornado/test/__init__.py
# instead of runtests.py so it happens no matter how the test is run... | |
00ec3ae8f6d51d393b08e3645d639619106aec67 | migrations/versions/0366_letter_rates_2022.py | migrations/versions/0366_letter_rates_2022.py | """
Revision ID: 0366_letter_rates_2022
Revises: 0365_add_nhs_branding
Create Date: 2022-03-01 14:00:00
"""
import itertools
import uuid
from datetime import datetime
from alembic import op
from sqlalchemy.sql import text
from app.models import LetterRate
revision = '0366_letter_rates_2022'
down_revision = '0365_... | Add new letter rates for March 1, 2022. | Add new letter rates for March 1, 2022.
- second class postage will go up by 2 pence, plus VAT
- international postage will go up by 7 pence, plus VAT
- first class postage will go down by 6 pence, plus VAT
| Python | mit | alphagov/notifications-api,alphagov/notifications-api | Add new letter rates for March 1, 2022.
- second class postage will go up by 2 pence, plus VAT
- international postage will go up by 7 pence, plus VAT
- first class postage will go down by 6 pence, plus VAT | """
Revision ID: 0366_letter_rates_2022
Revises: 0365_add_nhs_branding
Create Date: 2022-03-01 14:00:00
"""
import itertools
import uuid
from datetime import datetime
from alembic import op
from sqlalchemy.sql import text
from app.models import LetterRate
revision = '0366_letter_rates_2022'
down_revision = '0365_... | <commit_before><commit_msg>Add new letter rates for March 1, 2022.
- second class postage will go up by 2 pence, plus VAT
- international postage will go up by 7 pence, plus VAT
- first class postage will go down by 6 pence, plus VAT<commit_after> | """
Revision ID: 0366_letter_rates_2022
Revises: 0365_add_nhs_branding
Create Date: 2022-03-01 14:00:00
"""
import itertools
import uuid
from datetime import datetime
from alembic import op
from sqlalchemy.sql import text
from app.models import LetterRate
revision = '0366_letter_rates_2022'
down_revision = '0365_... | Add new letter rates for March 1, 2022.
- second class postage will go up by 2 pence, plus VAT
- international postage will go up by 7 pence, plus VAT
- first class postage will go down by 6 pence, plus VAT"""
Revision ID: 0366_letter_rates_2022
Revises: 0365_add_nhs_branding
Create Date: 2022-03-01 14:00:00
"""
imp... | <commit_before><commit_msg>Add new letter rates for March 1, 2022.
- second class postage will go up by 2 pence, plus VAT
- international postage will go up by 7 pence, plus VAT
- first class postage will go down by 6 pence, plus VAT<commit_after>"""
Revision ID: 0366_letter_rates_2022
Revises: 0365_add_nhs_branding
... | |
a7339ba4c825e893e043ac9aefac55e3f0c939aa | students/exceptions.py | students/exceptions.py | import json
class ClientError(Exception):
def __init__(self, code):
super(ClientError, self).__init__(code)
self.code = code
def send_to(self, channel):
channel.send({
"text": json.dumps({
"error": self.code,
}),
})
| Add ClientError exception to handle sending back web socket errors to the client. | Add ClientError exception to handle sending back web socket errors to the client.
| Python | mit | muhummadPatel/raspied,muhummadPatel/raspied,muhummadPatel/raspied | Add ClientError exception to handle sending back web socket errors to the client. | import json
class ClientError(Exception):
def __init__(self, code):
super(ClientError, self).__init__(code)
self.code = code
def send_to(self, channel):
channel.send({
"text": json.dumps({
"error": self.code,
}),
})
| <commit_before><commit_msg>Add ClientError exception to handle sending back web socket errors to the client.<commit_after> | import json
class ClientError(Exception):
def __init__(self, code):
super(ClientError, self).__init__(code)
self.code = code
def send_to(self, channel):
channel.send({
"text": json.dumps({
"error": self.code,
}),
})
| Add ClientError exception to handle sending back web socket errors to the client.import json
class ClientError(Exception):
def __init__(self, code):
super(ClientError, self).__init__(code)
self.code = code
def send_to(self, channel):
channel.send({
"text": json.dumps({
... | <commit_before><commit_msg>Add ClientError exception to handle sending back web socket errors to the client.<commit_after>import json
class ClientError(Exception):
def __init__(self, code):
super(ClientError, self).__init__(code)
self.code = code
def send_to(self, channel):
channel.se... | |
700b19e4fe55ef57935b70d90883c0d0451c163a | locations/spiders/xpo_logistics.py | locations/spiders/xpo_logistics.py | # -*- coding: utf-8 -*-
import scrapy
import re
import ast
from locations.items import GeojsonPointItem
class XPOLogisticsSpider(scrapy.Spider):
name = "xpo_logistics"
allowed_domains = ["www.xpo.com"]
start_urls = (
'https://www.xpo.com/global-locations/',
)
def parse(self, response):
... | Add spider for XPO Logistics | Add spider for XPO Logistics
| Python | mit | iandees/all-the-places,iandees/all-the-places,iandees/all-the-places | Add spider for XPO Logistics | # -*- coding: utf-8 -*-
import scrapy
import re
import ast
from locations.items import GeojsonPointItem
class XPOLogisticsSpider(scrapy.Spider):
name = "xpo_logistics"
allowed_domains = ["www.xpo.com"]
start_urls = (
'https://www.xpo.com/global-locations/',
)
def parse(self, response):
... | <commit_before><commit_msg>Add spider for XPO Logistics<commit_after> | # -*- coding: utf-8 -*-
import scrapy
import re
import ast
from locations.items import GeojsonPointItem
class XPOLogisticsSpider(scrapy.Spider):
name = "xpo_logistics"
allowed_domains = ["www.xpo.com"]
start_urls = (
'https://www.xpo.com/global-locations/',
)
def parse(self, response):
... | Add spider for XPO Logistics# -*- coding: utf-8 -*-
import scrapy
import re
import ast
from locations.items import GeojsonPointItem
class XPOLogisticsSpider(scrapy.Spider):
name = "xpo_logistics"
allowed_domains = ["www.xpo.com"]
start_urls = (
'https://www.xpo.com/global-locations/',
)
de... | <commit_before><commit_msg>Add spider for XPO Logistics<commit_after># -*- coding: utf-8 -*-
import scrapy
import re
import ast
from locations.items import GeojsonPointItem
class XPOLogisticsSpider(scrapy.Spider):
name = "xpo_logistics"
allowed_domains = ["www.xpo.com"]
start_urls = (
'https://www.... | |
d5f4a57d3be9f27d80ca037aa7ce6d4576852cfb | py/find-k-pairs-with-smallest-sums.py | py/find-k-pairs-with-smallest-sums.py | import heapq
class Solution(object):
def kSmallestPairs(self, nums1, nums2, k):
"""
:type nums1: List[int]
:type nums2: List[int]
:type k: int
:rtype: List[List[int]]
"""
l1, l2 = len(nums1), len(nums2)
if l1 * l2 <= k:
return sorted([[n1, ... | Add py solution for 373. Find K Pairs with Smallest Sums | Add py solution for 373. Find K Pairs with Smallest Sums
373. Find K Pairs with Smallest Sums: https://leetcode.com/problems/find-k-pairs-with-smallest-sums/
| Python | apache-2.0 | ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode | Add py solution for 373. Find K Pairs with Smallest Sums
373. Find K Pairs with Smallest Sums: https://leetcode.com/problems/find-k-pairs-with-smallest-sums/ | import heapq
class Solution(object):
def kSmallestPairs(self, nums1, nums2, k):
"""
:type nums1: List[int]
:type nums2: List[int]
:type k: int
:rtype: List[List[int]]
"""
l1, l2 = len(nums1), len(nums2)
if l1 * l2 <= k:
return sorted([[n1, ... | <commit_before><commit_msg>Add py solution for 373. Find K Pairs with Smallest Sums
373. Find K Pairs with Smallest Sums: https://leetcode.com/problems/find-k-pairs-with-smallest-sums/<commit_after> | import heapq
class Solution(object):
def kSmallestPairs(self, nums1, nums2, k):
"""
:type nums1: List[int]
:type nums2: List[int]
:type k: int
:rtype: List[List[int]]
"""
l1, l2 = len(nums1), len(nums2)
if l1 * l2 <= k:
return sorted([[n1, ... | Add py solution for 373. Find K Pairs with Smallest Sums
373. Find K Pairs with Smallest Sums: https://leetcode.com/problems/find-k-pairs-with-smallest-sums/import heapq
class Solution(object):
def kSmallestPairs(self, nums1, nums2, k):
"""
:type nums1: List[int]
:type nums2: List[int]
... | <commit_before><commit_msg>Add py solution for 373. Find K Pairs with Smallest Sums
373. Find K Pairs with Smallest Sums: https://leetcode.com/problems/find-k-pairs-with-smallest-sums/<commit_after>import heapq
class Solution(object):
def kSmallestPairs(self, nums1, nums2, k):
"""
:type nums1: List... | |
fab1c6e8b935b5a4e81146e34c833ce66e05db0d | jupyterhub/generate_jupyter_secrets.py | jupyterhub/generate_jupyter_secrets.py | #!/usr/bin/env python
import binascii
import os
def random_hex(nb):
return binascii.hexlify(os.urandom(nb)).decode('ascii')
with open('jupyterhub.env', 'w') as f:
f.write('JPY_COOKIE_SECRET=%s\n' % random_hex(1024))
f.write('CONFIGPROXY_AUTH_TOKEN=%s\n' % random_hex(64))
| Add script to generate jupyterhub secret vars. | Add script to generate jupyterhub secret vars.
| Python | mit | Unidata/Unidata-Dockerfiles,Unidata/Unidata-Dockerfiles,julienchastang/Unidata-Dockerfiles,julienchastang/Unidata-Dockerfiles,Unidata/Unidata-Dockerfiles,julienchastang/Unidata-Dockerfiles | Add script to generate jupyterhub secret vars. | #!/usr/bin/env python
import binascii
import os
def random_hex(nb):
return binascii.hexlify(os.urandom(nb)).decode('ascii')
with open('jupyterhub.env', 'w') as f:
f.write('JPY_COOKIE_SECRET=%s\n' % random_hex(1024))
f.write('CONFIGPROXY_AUTH_TOKEN=%s\n' % random_hex(64))
| <commit_before><commit_msg>Add script to generate jupyterhub secret vars.<commit_after> | #!/usr/bin/env python
import binascii
import os
def random_hex(nb):
return binascii.hexlify(os.urandom(nb)).decode('ascii')
with open('jupyterhub.env', 'w') as f:
f.write('JPY_COOKIE_SECRET=%s\n' % random_hex(1024))
f.write('CONFIGPROXY_AUTH_TOKEN=%s\n' % random_hex(64))
| Add script to generate jupyterhub secret vars.#!/usr/bin/env python
import binascii
import os
def random_hex(nb):
return binascii.hexlify(os.urandom(nb)).decode('ascii')
with open('jupyterhub.env', 'w') as f:
f.write('JPY_COOKIE_SECRET=%s\n' % random_hex(1024))
f.write('CONFIGPROXY_AUTH_TOKEN=%s\n' % ... | <commit_before><commit_msg>Add script to generate jupyterhub secret vars.<commit_after>#!/usr/bin/env python
import binascii
import os
def random_hex(nb):
return binascii.hexlify(os.urandom(nb)).decode('ascii')
with open('jupyterhub.env', 'w') as f:
f.write('JPY_COOKIE_SECRET=%s\n' % random_hex(1024))
... | |
4e891bae265599768ce28788bbd44978674202e5 | cptm/manifestoproject2cpt_input.py | cptm/manifestoproject2cpt_input.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
import pandas as pd
import logging
import argparse
import os
import glob
from cptm.utils.inputgeneration import Perspective, remove_trailing_digits
from cptm.utils.dutchdata import pos_topic_words, pos_opinion_words, word_types
from cptm.utils.frog import get_frogclient, pos_a... | Add script to generate cptm corpus for manifesto data | Add script to generate cptm corpus for manifesto data
The script uses frog to parse text.
| Python | apache-2.0 | NLeSC/cptm,NLeSC/cptm | Add script to generate cptm corpus for manifesto data
The script uses frog to parse text. | #!/usr/bin/python
# -*- coding: utf-8 -*-
import pandas as pd
import logging
import argparse
import os
import glob
from cptm.utils.inputgeneration import Perspective, remove_trailing_digits
from cptm.utils.dutchdata import pos_topic_words, pos_opinion_words, word_types
from cptm.utils.frog import get_frogclient, pos_a... | <commit_before><commit_msg>Add script to generate cptm corpus for manifesto data
The script uses frog to parse text.<commit_after> | #!/usr/bin/python
# -*- coding: utf-8 -*-
import pandas as pd
import logging
import argparse
import os
import glob
from cptm.utils.inputgeneration import Perspective, remove_trailing_digits
from cptm.utils.dutchdata import pos_topic_words, pos_opinion_words, word_types
from cptm.utils.frog import get_frogclient, pos_a... | Add script to generate cptm corpus for manifesto data
The script uses frog to parse text.#!/usr/bin/python
# -*- coding: utf-8 -*-
import pandas as pd
import logging
import argparse
import os
import glob
from cptm.utils.inputgeneration import Perspective, remove_trailing_digits
from cptm.utils.dutchdata import pos_to... | <commit_before><commit_msg>Add script to generate cptm corpus for manifesto data
The script uses frog to parse text.<commit_after>#!/usr/bin/python
# -*- coding: utf-8 -*-
import pandas as pd
import logging
import argparse
import os
import glob
from cptm.utils.inputgeneration import Perspective, remove_trailing_digit... | |
bb3255cba6452d4f646e84fcdd986b1aeb16d20d | test/_mysqldb_test.py | test/_mysqldb_test.py | '''
$ mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 211
Server version: 5.6.15 Homebrew
Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks... | Add basic testing for the mysql target | Add basic testing for the mysql target
| Python | apache-2.0 | linearregression/luigi,h3biomed/luigi,meyerson/luigi,neilisaac/luigi,samepage-labs/luigi,ivannotes/luigi,JackDanger/luigi,fw1121/luigi,ivannotes/luigi,PeteW/luigi,percyfal/luigi,ZhenxingWu/luigi,jamesmcm/luigi,mbruggmann/luigi,altaf-ali/luigi,joeshaw/luigi,samuell/luigi,Dawny33/luigi,hadesbox/luigi,realgo/luigi,dstandi... | Add basic testing for the mysql target | '''
$ mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 211
Server version: 5.6.15 Homebrew
Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks... | <commit_before><commit_msg>Add basic testing for the mysql target<commit_after> | '''
$ mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 211
Server version: 5.6.15 Homebrew
Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks... | Add basic testing for the mysql target'''
$ mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 211
Server version: 5.6.15 Homebrew
Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
aff... | <commit_before><commit_msg>Add basic testing for the mysql target<commit_after>'''
$ mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 211
Server version: 5.6.15 Homebrew
Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trade... | |
fa9e0fe868d3abd9fde108b599131dd7196e5c45 | open511_ui/static/i18n/generate_js.py | open511_ui/static/i18n/generate_js.py | # Requires that 'po2json' be installed and in $PATH
# http://search.cpan.org/~getty/Locale-Simple-0.011/bin/po2json
from glob import glob
import os
import re
import subprocess
JS_TEMPLATE = """window.O5 = window.O5 || {};
O5.i18n = new Jed({
locale_data: {
messages: %s
}
});
O5._t = function(s) { ret... | Add script to generate JS translation files from PO | Add script to generate JS translation files from PO
| Python | agpl-3.0 | Open511/roadcast,Open511/roadcast,Open511/roadcast | Add script to generate JS translation files from PO | # Requires that 'po2json' be installed and in $PATH
# http://search.cpan.org/~getty/Locale-Simple-0.011/bin/po2json
from glob import glob
import os
import re
import subprocess
JS_TEMPLATE = """window.O5 = window.O5 || {};
O5.i18n = new Jed({
locale_data: {
messages: %s
}
});
O5._t = function(s) { ret... | <commit_before><commit_msg>Add script to generate JS translation files from PO<commit_after> | # Requires that 'po2json' be installed and in $PATH
# http://search.cpan.org/~getty/Locale-Simple-0.011/bin/po2json
from glob import glob
import os
import re
import subprocess
JS_TEMPLATE = """window.O5 = window.O5 || {};
O5.i18n = new Jed({
locale_data: {
messages: %s
}
});
O5._t = function(s) { ret... | Add script to generate JS translation files from PO# Requires that 'po2json' be installed and in $PATH
# http://search.cpan.org/~getty/Locale-Simple-0.011/bin/po2json
from glob import glob
import os
import re
import subprocess
JS_TEMPLATE = """window.O5 = window.O5 || {};
O5.i18n = new Jed({
locale_data: {
... | <commit_before><commit_msg>Add script to generate JS translation files from PO<commit_after># Requires that 'po2json' be installed and in $PATH
# http://search.cpan.org/~getty/Locale-Simple-0.011/bin/po2json
from glob import glob
import os
import re
import subprocess
JS_TEMPLATE = """window.O5 = window.O5 || {};
O5.... | |
2506af6a57f2c7c7e01eb4cd5e53cd200d78f54f | tests/gallery_test.py | tests/gallery_test.py | from __future__ import with_statement
from ass2m.ass2m import Ass2m
from ass2m.server import Server
from unittest import TestCase
from webtest import TestApp
from tempfile import mkdtemp
from PIL import Image
from StringIO import StringIO
import os
import shutil
class GalleryTest(TestCase):
def setUp(self):
... | Test for the gallery plugin | Test for the gallery plugin
| Python | agpl-3.0 | laurentb/assnet,laurentb/assnet | Test for the gallery plugin | from __future__ import with_statement
from ass2m.ass2m import Ass2m
from ass2m.server import Server
from unittest import TestCase
from webtest import TestApp
from tempfile import mkdtemp
from PIL import Image
from StringIO import StringIO
import os
import shutil
class GalleryTest(TestCase):
def setUp(self):
... | <commit_before><commit_msg>Test for the gallery plugin<commit_after> | from __future__ import with_statement
from ass2m.ass2m import Ass2m
from ass2m.server import Server
from unittest import TestCase
from webtest import TestApp
from tempfile import mkdtemp
from PIL import Image
from StringIO import StringIO
import os
import shutil
class GalleryTest(TestCase):
def setUp(self):
... | Test for the gallery pluginfrom __future__ import with_statement
from ass2m.ass2m import Ass2m
from ass2m.server import Server
from unittest import TestCase
from webtest import TestApp
from tempfile import mkdtemp
from PIL import Image
from StringIO import StringIO
import os
import shutil
class GalleryTest(TestCase... | <commit_before><commit_msg>Test for the gallery plugin<commit_after>from __future__ import with_statement
from ass2m.ass2m import Ass2m
from ass2m.server import Server
from unittest import TestCase
from webtest import TestApp
from tempfile import mkdtemp
from PIL import Image
from StringIO import StringIO
import os
... | |
fe74d6c09b575f243e7750d8bb5d30cbd82bd485 | enrique/problem.py | enrique/problem.py | from abc import ABCMeta, abstractmethod
class Problem(object):
__metaclass__ = ABCMeta
@abstractmethod
def init(self, *args, **kwargs):
"""Initialize the problem"""
raise NotImplementedError
@abstractmethod
def fitness_score(self, state):
"""Calculate the fitness score o... | Add Problem abstract base class | Add Problem abstract base class
| Python | mit | mesos-magellan/enrique | Add Problem abstract base class | from abc import ABCMeta, abstractmethod
class Problem(object):
__metaclass__ = ABCMeta
@abstractmethod
def init(self, *args, **kwargs):
"""Initialize the problem"""
raise NotImplementedError
@abstractmethod
def fitness_score(self, state):
"""Calculate the fitness score o... | <commit_before><commit_msg>Add Problem abstract base class<commit_after> | from abc import ABCMeta, abstractmethod
class Problem(object):
__metaclass__ = ABCMeta
@abstractmethod
def init(self, *args, **kwargs):
"""Initialize the problem"""
raise NotImplementedError
@abstractmethod
def fitness_score(self, state):
"""Calculate the fitness score o... | Add Problem abstract base classfrom abc import ABCMeta, abstractmethod
class Problem(object):
__metaclass__ = ABCMeta
@abstractmethod
def init(self, *args, **kwargs):
"""Initialize the problem"""
raise NotImplementedError
@abstractmethod
def fitness_score(self, state):
"... | <commit_before><commit_msg>Add Problem abstract base class<commit_after>from abc import ABCMeta, abstractmethod
class Problem(object):
__metaclass__ = ABCMeta
@abstractmethod
def init(self, *args, **kwargs):
"""Initialize the problem"""
raise NotImplementedError
@abstractmethod
... | |
479f1792aabc9220a489445979b48781a8cf7ff9 | tests/pytests/unit/states/test_influxdb_continuous_query.py | tests/pytests/unit/states/test_influxdb_continuous_query.py | import pytest
import salt.modules.influxdbmod as influx_mod
import salt.states.influxdb_continuous_query as influx
from tests.support.mock import create_autospec, patch
@pytest.fixture
def configure_loader_modules():
return {influx: {"__salt__": {}, "__opts__": {"test": False}}}
@pytest.mark.xfail
@pytest.mark... | Add tests for influxdb create_continuous_query | Add tests for influxdb create_continuous_query
Currently marked as xfail, since we'll pull the existing changes into
here.
| Python | apache-2.0 | saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt | Add tests for influxdb create_continuous_query
Currently marked as xfail, since we'll pull the existing changes into
here. | import pytest
import salt.modules.influxdbmod as influx_mod
import salt.states.influxdb_continuous_query as influx
from tests.support.mock import create_autospec, patch
@pytest.fixture
def configure_loader_modules():
return {influx: {"__salt__": {}, "__opts__": {"test": False}}}
@pytest.mark.xfail
@pytest.mark... | <commit_before><commit_msg>Add tests for influxdb create_continuous_query
Currently marked as xfail, since we'll pull the existing changes into
here.<commit_after> | import pytest
import salt.modules.influxdbmod as influx_mod
import salt.states.influxdb_continuous_query as influx
from tests.support.mock import create_autospec, patch
@pytest.fixture
def configure_loader_modules():
return {influx: {"__salt__": {}, "__opts__": {"test": False}}}
@pytest.mark.xfail
@pytest.mark... | Add tests for influxdb create_continuous_query
Currently marked as xfail, since we'll pull the existing changes into
here.import pytest
import salt.modules.influxdbmod as influx_mod
import salt.states.influxdb_continuous_query as influx
from tests.support.mock import create_autospec, patch
@pytest.fixture
def confi... | <commit_before><commit_msg>Add tests for influxdb create_continuous_query
Currently marked as xfail, since we'll pull the existing changes into
here.<commit_after>import pytest
import salt.modules.influxdbmod as influx_mod
import salt.states.influxdb_continuous_query as influx
from tests.support.mock import create_au... | |
513e6567b15adf2354f0b05f486d66ee0cbe2c94 | tests/basics/seq-unpack.py | tests/basics/seq-unpack.py | # Basics
a, b = 1, 2
print(a, b)
a, b = (1, 2)
print(a, b)
(a, b) = 1, 2
print(a, b)
(a, b) = (1, 2)
print(a, b)
# Tuples/lists are optimized
a, b = [1, 2]
print(a, b)
[a, b] = 100, 200
print(a, b)
try:
a, b, c = (1, 2)
except ValueError:
print("ValueError")
try:
a, b, c = [1, 2, 3, 4]
except ValueError:
... | Add testcase for sequence unpacking. | Add testcase for sequence unpacking.
| Python | mit | omtinez/micropython,firstval/micropython,ganshun666/micropython,orionrobots/micropython,dinau/micropython,TDAbboud/micropython,cloudformdesign/micropython,heisewangluo/micropython,MrSurly/micropython-esp32,dinau/micropython,alex-robbins/micropython,Vogtinator/micropython,MrSurly/micropython,vriera/micropython,danicampo... | Add testcase for sequence unpacking. | # Basics
a, b = 1, 2
print(a, b)
a, b = (1, 2)
print(a, b)
(a, b) = 1, 2
print(a, b)
(a, b) = (1, 2)
print(a, b)
# Tuples/lists are optimized
a, b = [1, 2]
print(a, b)
[a, b] = 100, 200
print(a, b)
try:
a, b, c = (1, 2)
except ValueError:
print("ValueError")
try:
a, b, c = [1, 2, 3, 4]
except ValueError:
... | <commit_before><commit_msg>Add testcase for sequence unpacking.<commit_after> | # Basics
a, b = 1, 2
print(a, b)
a, b = (1, 2)
print(a, b)
(a, b) = 1, 2
print(a, b)
(a, b) = (1, 2)
print(a, b)
# Tuples/lists are optimized
a, b = [1, 2]
print(a, b)
[a, b] = 100, 200
print(a, b)
try:
a, b, c = (1, 2)
except ValueError:
print("ValueError")
try:
a, b, c = [1, 2, 3, 4]
except ValueError:
... | Add testcase for sequence unpacking.# Basics
a, b = 1, 2
print(a, b)
a, b = (1, 2)
print(a, b)
(a, b) = 1, 2
print(a, b)
(a, b) = (1, 2)
print(a, b)
# Tuples/lists are optimized
a, b = [1, 2]
print(a, b)
[a, b] = 100, 200
print(a, b)
try:
a, b, c = (1, 2)
except ValueError:
print("ValueError")
try:
a, b, ... | <commit_before><commit_msg>Add testcase for sequence unpacking.<commit_after># Basics
a, b = 1, 2
print(a, b)
a, b = (1, 2)
print(a, b)
(a, b) = 1, 2
print(a, b)
(a, b) = (1, 2)
print(a, b)
# Tuples/lists are optimized
a, b = [1, 2]
print(a, b)
[a, b] = 100, 200
print(a, b)
try:
a, b, c = (1, 2)
except ValueError... | |
cc4b7da371b5c188812ff9b2c4a5d1cd49178374 | tests/test_serialization.py | tests/test_serialization.py | from datetime import datetime
from recurrence import Recurrence, Rule
import recurrence
def test_rule_serialization():
rule = Rule(
recurrence.WEEKLY
)
serialized = recurrence.serialize(rule)
assert 'RRULE:FREQ=WEEKLY' == serialized
assert recurrence.deserialize(serialized) == Recurrence(... | Add some tests for serializing rules | Add some tests for serializing rules
| Python | bsd-3-clause | django-recurrence/django-recurrence,FrankSalad/django-recurrence,linux2400/django-recurrence,linux2400/django-recurrence,Nikola-K/django-recurrence,django-recurrence/django-recurrence,FrankSalad/django-recurrence,Nikola-K/django-recurrence | Add some tests for serializing rules | from datetime import datetime
from recurrence import Recurrence, Rule
import recurrence
def test_rule_serialization():
rule = Rule(
recurrence.WEEKLY
)
serialized = recurrence.serialize(rule)
assert 'RRULE:FREQ=WEEKLY' == serialized
assert recurrence.deserialize(serialized) == Recurrence(... | <commit_before><commit_msg>Add some tests for serializing rules<commit_after> | from datetime import datetime
from recurrence import Recurrence, Rule
import recurrence
def test_rule_serialization():
rule = Rule(
recurrence.WEEKLY
)
serialized = recurrence.serialize(rule)
assert 'RRULE:FREQ=WEEKLY' == serialized
assert recurrence.deserialize(serialized) == Recurrence(... | Add some tests for serializing rulesfrom datetime import datetime
from recurrence import Recurrence, Rule
import recurrence
def test_rule_serialization():
rule = Rule(
recurrence.WEEKLY
)
serialized = recurrence.serialize(rule)
assert 'RRULE:FREQ=WEEKLY' == serialized
assert recurrence.de... | <commit_before><commit_msg>Add some tests for serializing rules<commit_after>from datetime import datetime
from recurrence import Recurrence, Rule
import recurrence
def test_rule_serialization():
rule = Rule(
recurrence.WEEKLY
)
serialized = recurrence.serialize(rule)
assert 'RRULE:FREQ=WEEKL... | |
134f7fda0a7d48e22b48d02b3391142e3b4d59a1 | tests/test_whoami_resource.py | tests/test_whoami_resource.py | import unittest
import json
from tests.base import Base
class TestWhoAmIResource(Base):
def test_returns_user_info(self):
self.client.post("/api/v1/auth/register",
data=self.user,
content_type='application/json')
payload = self.client.get("/api/v1... | Add tests for whoami resource | [CHORE] Add tests for whoami resource
| Python | mit | brayoh/bucket-list-api | [CHORE] Add tests for whoami resource | import unittest
import json
from tests.base import Base
class TestWhoAmIResource(Base):
def test_returns_user_info(self):
self.client.post("/api/v1/auth/register",
data=self.user,
content_type='application/json')
payload = self.client.get("/api/v1... | <commit_before><commit_msg>[CHORE] Add tests for whoami resource<commit_after> | import unittest
import json
from tests.base import Base
class TestWhoAmIResource(Base):
def test_returns_user_info(self):
self.client.post("/api/v1/auth/register",
data=self.user,
content_type='application/json')
payload = self.client.get("/api/v1... | [CHORE] Add tests for whoami resourceimport unittest
import json
from tests.base import Base
class TestWhoAmIResource(Base):
def test_returns_user_info(self):
self.client.post("/api/v1/auth/register",
data=self.user,
content_type='application/json')
... | <commit_before><commit_msg>[CHORE] Add tests for whoami resource<commit_after>import unittest
import json
from tests.base import Base
class TestWhoAmIResource(Base):
def test_returns_user_info(self):
self.client.post("/api/v1/auth/register",
data=self.user,
... | |
683dd2300ad9a40875b86118c8f9c4a8c2b11b91 | scripts/search-for-similar-strings.py | scripts/search-for-similar-strings.py | import json
import os
import click
from difflib import SequenceMatcher
ROOT_PATH = os.path.dirname(os.path.dirname(__file__))
DEFAULT_LOCALE_PATH = os.path.join(ROOT_PATH, "app/locales/taiga/locale-en.json")
def keywords(key, value):
if key is not None and not isinstance(value, dict):
return [(".".join(k... | Add script for detect similarities in translation string | Add script for detect similarities in translation string
| Python | agpl-3.0 | taigaio/taiga-front,taigaio/taiga-front,taigaio/taiga-front | Add script for detect similarities in translation string | import json
import os
import click
from difflib import SequenceMatcher
ROOT_PATH = os.path.dirname(os.path.dirname(__file__))
DEFAULT_LOCALE_PATH = os.path.join(ROOT_PATH, "app/locales/taiga/locale-en.json")
def keywords(key, value):
if key is not None and not isinstance(value, dict):
return [(".".join(k... | <commit_before><commit_msg>Add script for detect similarities in translation string<commit_after> | import json
import os
import click
from difflib import SequenceMatcher
ROOT_PATH = os.path.dirname(os.path.dirname(__file__))
DEFAULT_LOCALE_PATH = os.path.join(ROOT_PATH, "app/locales/taiga/locale-en.json")
def keywords(key, value):
if key is not None and not isinstance(value, dict):
return [(".".join(k... | Add script for detect similarities in translation stringimport json
import os
import click
from difflib import SequenceMatcher
ROOT_PATH = os.path.dirname(os.path.dirname(__file__))
DEFAULT_LOCALE_PATH = os.path.join(ROOT_PATH, "app/locales/taiga/locale-en.json")
def keywords(key, value):
if key is not None and ... | <commit_before><commit_msg>Add script for detect similarities in translation string<commit_after>import json
import os
import click
from difflib import SequenceMatcher
ROOT_PATH = os.path.dirname(os.path.dirname(__file__))
DEFAULT_LOCALE_PATH = os.path.join(ROOT_PATH, "app/locales/taiga/locale-en.json")
def keywords... | |
1fc16b52736ba2f794c7111366a66f4eba8ced9e | examples/randomuser-sqlite.py | examples/randomuser-sqlite.py | #!/usr/bin/env python3
# coding: utf-8
import json # https://docs.python.org/3/library/json.html
import requests # https://github.com/kennethreitz/requests
import records # https://github.com/kennethreitz/records
# randomuser.me generates random 'user' data (name, email, addr, phone number, etc)
r = requests.get('htt... | Add example usage with sqlite | Add example usage with sqlite
| Python | isc | kennethreitz/records | Add example usage with sqlite | #!/usr/bin/env python3
# coding: utf-8
import json # https://docs.python.org/3/library/json.html
import requests # https://github.com/kennethreitz/requests
import records # https://github.com/kennethreitz/records
# randomuser.me generates random 'user' data (name, email, addr, phone number, etc)
r = requests.get('htt... | <commit_before><commit_msg>Add example usage with sqlite<commit_after> | #!/usr/bin/env python3
# coding: utf-8
import json # https://docs.python.org/3/library/json.html
import requests # https://github.com/kennethreitz/requests
import records # https://github.com/kennethreitz/records
# randomuser.me generates random 'user' data (name, email, addr, phone number, etc)
r = requests.get('htt... | Add example usage with sqlite#!/usr/bin/env python3
# coding: utf-8
import json # https://docs.python.org/3/library/json.html
import requests # https://github.com/kennethreitz/requests
import records # https://github.com/kennethreitz/records
# randomuser.me generates random 'user' data (name, email, addr, phone numbe... | <commit_before><commit_msg>Add example usage with sqlite<commit_after>#!/usr/bin/env python3
# coding: utf-8
import json # https://docs.python.org/3/library/json.html
import requests # https://github.com/kennethreitz/requests
import records # https://github.com/kennethreitz/records
# randomuser.me generates random 'u... | |
b1e385b50e13ed53501ae9945f29ebe0557540f8 | kolibri/core/logger/migrations/0010_min_length_validation.py | kolibri/core/logger/migrations/0010_min_length_validation.py | # -*- coding: utf-8 -*-
# Generated by Django 1.11.29 on 2021-11-04 16:08
from __future__ import unicode_literals
import django.core.validators
from django.db import migrations
from django.db import models
class Migration(migrations.Migration):
dependencies = [
("logger", "0009_null_channel_id_unconstra... | Add migration for min-length validation change | Add migration for min-length validation change
| Python | mit | learningequality/kolibri,learningequality/kolibri,learningequality/kolibri,learningequality/kolibri | Add migration for min-length validation change | # -*- coding: utf-8 -*-
# Generated by Django 1.11.29 on 2021-11-04 16:08
from __future__ import unicode_literals
import django.core.validators
from django.db import migrations
from django.db import models
class Migration(migrations.Migration):
dependencies = [
("logger", "0009_null_channel_id_unconstra... | <commit_before><commit_msg>Add migration for min-length validation change<commit_after> | # -*- coding: utf-8 -*-
# Generated by Django 1.11.29 on 2021-11-04 16:08
from __future__ import unicode_literals
import django.core.validators
from django.db import migrations
from django.db import models
class Migration(migrations.Migration):
dependencies = [
("logger", "0009_null_channel_id_unconstra... | Add migration for min-length validation change# -*- coding: utf-8 -*-
# Generated by Django 1.11.29 on 2021-11-04 16:08
from __future__ import unicode_literals
import django.core.validators
from django.db import migrations
from django.db import models
class Migration(migrations.Migration):
dependencies = [
... | <commit_before><commit_msg>Add migration for min-length validation change<commit_after># -*- coding: utf-8 -*-
# Generated by Django 1.11.29 on 2021-11-04 16:08
from __future__ import unicode_literals
import django.core.validators
from django.db import migrations
from django.db import models
class Migration(migratio... | |
29dabe00aa21858983804d01afd3458f8192f70e | main.py | main.py | import csv
import sys
import itertools
def count_iter(iterable):
# count lines in terable
return sum(1 for _ in iterable)
def setup_iter(reader):
# Skip first row of the file
readeriter = iter(reader)
next(readeriter)
return readeriter
def list_get(li, pos, default):
try:
retu... | Add the whole program nice job | Add the whole program nice job
| Python | mit | brockuniera/CSV-Column-Two-Histogram | Add the whole program nice job | import csv
import sys
import itertools
def count_iter(iterable):
# count lines in terable
return sum(1 for _ in iterable)
def setup_iter(reader):
# Skip first row of the file
readeriter = iter(reader)
next(readeriter)
return readeriter
def list_get(li, pos, default):
try:
retu... | <commit_before><commit_msg>Add the whole program nice job<commit_after> | import csv
import sys
import itertools
def count_iter(iterable):
# count lines in terable
return sum(1 for _ in iterable)
def setup_iter(reader):
# Skip first row of the file
readeriter = iter(reader)
next(readeriter)
return readeriter
def list_get(li, pos, default):
try:
retu... | Add the whole program nice jobimport csv
import sys
import itertools
def count_iter(iterable):
# count lines in terable
return sum(1 for _ in iterable)
def setup_iter(reader):
# Skip first row of the file
readeriter = iter(reader)
next(readeriter)
return readeriter
def list_get(li, pos, d... | <commit_before><commit_msg>Add the whole program nice job<commit_after>import csv
import sys
import itertools
def count_iter(iterable):
# count lines in terable
return sum(1 for _ in iterable)
def setup_iter(reader):
# Skip first row of the file
readeriter = iter(reader)
next(readeriter)
re... | |
71cb3d71443dc1b28a4aa62dcd0b880e2b5f5cac | nettests/core/keyword_filtering.py | nettests/core/keyword_filtering.py | # -*- encoding: utf-8 -*-
#
# :authors: Arturo Filastò
# :licence: see LICENSE
from ooni.templates import httpt
class KeywordFiltering(httpt.HTTPTest):
"""
This test involves performing HTTP requests containing to be tested for
censorship keywords.
"""
name = "Keyword Filtering"
author = "Artur... | Add keyword filtering test file | Add keyword filtering test file
| Python | bsd-2-clause | juga0/ooni-probe,kdmurray91/ooni-probe,juga0/ooni-probe,Karthikeyan-kkk/ooni-probe,kdmurray91/ooni-probe,kdmurray91/ooni-probe,0xPoly/ooni-probe,Karthikeyan-kkk/ooni-probe,lordappsec/ooni-probe,juga0/ooni-probe,juga0/ooni-probe,Karthikeyan-kkk/ooni-probe,0xPoly/ooni-probe,Karthikeyan-kkk/ooni-probe,lordappsec/ooni-prob... | Add keyword filtering test file | # -*- encoding: utf-8 -*-
#
# :authors: Arturo Filastò
# :licence: see LICENSE
from ooni.templates import httpt
class KeywordFiltering(httpt.HTTPTest):
"""
This test involves performing HTTP requests containing to be tested for
censorship keywords.
"""
name = "Keyword Filtering"
author = "Artur... | <commit_before><commit_msg>Add keyword filtering test file<commit_after> | # -*- encoding: utf-8 -*-
#
# :authors: Arturo Filastò
# :licence: see LICENSE
from ooni.templates import httpt
class KeywordFiltering(httpt.HTTPTest):
"""
This test involves performing HTTP requests containing to be tested for
censorship keywords.
"""
name = "Keyword Filtering"
author = "Artur... | Add keyword filtering test file# -*- encoding: utf-8 -*-
#
# :authors: Arturo Filastò
# :licence: see LICENSE
from ooni.templates import httpt
class KeywordFiltering(httpt.HTTPTest):
"""
This test involves performing HTTP requests containing to be tested for
censorship keywords.
"""
name = "Keyword... | <commit_before><commit_msg>Add keyword filtering test file<commit_after># -*- encoding: utf-8 -*-
#
# :authors: Arturo Filastò
# :licence: see LICENSE
from ooni.templates import httpt
class KeywordFiltering(httpt.HTTPTest):
"""
This test involves performing HTTP requests containing to be tested for
censors... | |
7113374b0eab84769fe452ad124d8e082bb11923 | py/median-of-two-sorted-arrays.py | py/median-of-two-sorted-arrays.py | class Solution(object):
def findMedianSortedArrays(self, nums1, nums2):
"""
:type nums1: List[int]
:type nums2: List[int]
:rtype: float
"""
if len(nums1) > len(nums2):
nums1, nums2 = nums2, nums1
l1, l2 = len(nums1), len(nums2)
m = min(num... | Add py solution for 4. Median of Two Sorted Arrays | Add py solution for 4. Median of Two Sorted Arrays
4. Median of Two Sorted Arrays: https://leetcode.com/problems/median-of-two-sorted-arrays/
Reference: https://discuss.leetcode.com/topic/16797/very-concise-o-log-min-m-n-iterative-solution-with-detailed-explanation
| Python | apache-2.0 | ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode | Add py solution for 4. Median of Two Sorted Arrays
4. Median of Two Sorted Arrays: https://leetcode.com/problems/median-of-two-sorted-arrays/
Reference: https://discuss.leetcode.com/topic/16797/very-concise-o-log-min-m-n-iterative-solution-with-detailed-explanation | class Solution(object):
def findMedianSortedArrays(self, nums1, nums2):
"""
:type nums1: List[int]
:type nums2: List[int]
:rtype: float
"""
if len(nums1) > len(nums2):
nums1, nums2 = nums2, nums1
l1, l2 = len(nums1), len(nums2)
m = min(num... | <commit_before><commit_msg>Add py solution for 4. Median of Two Sorted Arrays
4. Median of Two Sorted Arrays: https://leetcode.com/problems/median-of-two-sorted-arrays/
Reference: https://discuss.leetcode.com/topic/16797/very-concise-o-log-min-m-n-iterative-solution-with-detailed-explanation<commit_after> | class Solution(object):
def findMedianSortedArrays(self, nums1, nums2):
"""
:type nums1: List[int]
:type nums2: List[int]
:rtype: float
"""
if len(nums1) > len(nums2):
nums1, nums2 = nums2, nums1
l1, l2 = len(nums1), len(nums2)
m = min(num... | Add py solution for 4. Median of Two Sorted Arrays
4. Median of Two Sorted Arrays: https://leetcode.com/problems/median-of-two-sorted-arrays/
Reference: https://discuss.leetcode.com/topic/16797/very-concise-o-log-min-m-n-iterative-solution-with-detailed-explanationclass Solution(object):
def findMedianSortedArray... | <commit_before><commit_msg>Add py solution for 4. Median of Two Sorted Arrays
4. Median of Two Sorted Arrays: https://leetcode.com/problems/median-of-two-sorted-arrays/
Reference: https://discuss.leetcode.com/topic/16797/very-concise-o-log-min-m-n-iterative-solution-with-detailed-explanation<commit_after>class Soluti... | |
29cfeae39f819c34f5a1beb033dffe537da9b9eb | karma-histogram.py | karma-histogram.py | import praw
import praw.helpers
import matplotlib.pyplot as plt
import argparse
parser = argparse.ArgumentParser(description='Plot karma distributions of comments in a post')
parser.add_argument('--link', dest='link', required=True, help='Link of the post')
parser.add_argument('--expand_more_comments', dest='expand_mo... | Add script for plotting karma distribution in a post | Add script for plotting karma distribution in a post
| Python | mit | eleweek/redditbots | Add script for plotting karma distribution in a post | import praw
import praw.helpers
import matplotlib.pyplot as plt
import argparse
parser = argparse.ArgumentParser(description='Plot karma distributions of comments in a post')
parser.add_argument('--link', dest='link', required=True, help='Link of the post')
parser.add_argument('--expand_more_comments', dest='expand_mo... | <commit_before><commit_msg>Add script for plotting karma distribution in a post<commit_after> | import praw
import praw.helpers
import matplotlib.pyplot as plt
import argparse
parser = argparse.ArgumentParser(description='Plot karma distributions of comments in a post')
parser.add_argument('--link', dest='link', required=True, help='Link of the post')
parser.add_argument('--expand_more_comments', dest='expand_mo... | Add script for plotting karma distribution in a postimport praw
import praw.helpers
import matplotlib.pyplot as plt
import argparse
parser = argparse.ArgumentParser(description='Plot karma distributions of comments in a post')
parser.add_argument('--link', dest='link', required=True, help='Link of the post')
parser.ad... | <commit_before><commit_msg>Add script for plotting karma distribution in a post<commit_after>import praw
import praw.helpers
import matplotlib.pyplot as plt
import argparse
parser = argparse.ArgumentParser(description='Plot karma distributions of comments in a post')
parser.add_argument('--link', dest='link', required... | |
9928ee0bced08c57cf2125eac6538b8bc6ade9ff | paystackapi/tests/test_tcontrol.py | paystackapi/tests/test_tcontrol.py | import httpretty
from paystackapi.tests.base_test_case import BaseTestCase
from paystackapi.tcontrol import TransferControl
class TestTransfer(BaseTestCase):
@httpretty.activate
def test_check_balance(self):
"""Method defined to test check_balance."""
httpretty.register_uri(
http... | Add test for transfer control check balance | Add test for transfer control check balance
| Python | mit | andela-sjames/paystack-python | Add test for transfer control check balance | import httpretty
from paystackapi.tests.base_test_case import BaseTestCase
from paystackapi.tcontrol import TransferControl
class TestTransfer(BaseTestCase):
@httpretty.activate
def test_check_balance(self):
"""Method defined to test check_balance."""
httpretty.register_uri(
http... | <commit_before><commit_msg>Add test for transfer control check balance<commit_after> | import httpretty
from paystackapi.tests.base_test_case import BaseTestCase
from paystackapi.tcontrol import TransferControl
class TestTransfer(BaseTestCase):
@httpretty.activate
def test_check_balance(self):
"""Method defined to test check_balance."""
httpretty.register_uri(
http... | Add test for transfer control check balanceimport httpretty
from paystackapi.tests.base_test_case import BaseTestCase
from paystackapi.tcontrol import TransferControl
class TestTransfer(BaseTestCase):
@httpretty.activate
def test_check_balance(self):
"""Method defined to test check_balance."""
... | <commit_before><commit_msg>Add test for transfer control check balance<commit_after>import httpretty
from paystackapi.tests.base_test_case import BaseTestCase
from paystackapi.tcontrol import TransferControl
class TestTransfer(BaseTestCase):
@httpretty.activate
def test_check_balance(self):
"""Metho... | |
31b70041a9fc7da87774bffd59a9f93917200f18 | setup.py | setup.py | from setuptools import setup, find_packages
with open('README.rst') as readme:
long_description = ''.join(readme).strip()
setup(
name='rsocks',
version='0.3.3',
author='Jiangge Zhang',
author_email='tonyseek@gmail.com',
description='A SOCKS reverse proxy server.',
long_description=long_d... | from setuptools import setup, find_packages
with open('README.rst') as readme:
long_description = ''.join(readme).strip()
setup(
name='rsocks',
version='0.3.3',
author='Jiangge Zhang',
author_email='tonyseek@gmail.com',
description='A SOCKS reverse proxy server.',
long_description=long_d... | Upgrade PySocks to fix Python 3.10 compatbility | Upgrade PySocks to fix Python 3.10 compatbility
| Python | mit | tonyseek/rsocks,tonyseek/rsocks | from setuptools import setup, find_packages
with open('README.rst') as readme:
long_description = ''.join(readme).strip()
setup(
name='rsocks',
version='0.3.3',
author='Jiangge Zhang',
author_email='tonyseek@gmail.com',
description='A SOCKS reverse proxy server.',
long_description=long_d... | from setuptools import setup, find_packages
with open('README.rst') as readme:
long_description = ''.join(readme).strip()
setup(
name='rsocks',
version='0.3.3',
author='Jiangge Zhang',
author_email='tonyseek@gmail.com',
description='A SOCKS reverse proxy server.',
long_description=long_d... | <commit_before>from setuptools import setup, find_packages
with open('README.rst') as readme:
long_description = ''.join(readme).strip()
setup(
name='rsocks',
version='0.3.3',
author='Jiangge Zhang',
author_email='tonyseek@gmail.com',
description='A SOCKS reverse proxy server.',
long_des... | from setuptools import setup, find_packages
with open('README.rst') as readme:
long_description = ''.join(readme).strip()
setup(
name='rsocks',
version='0.3.3',
author='Jiangge Zhang',
author_email='tonyseek@gmail.com',
description='A SOCKS reverse proxy server.',
long_description=long_d... | from setuptools import setup, find_packages
with open('README.rst') as readme:
long_description = ''.join(readme).strip()
setup(
name='rsocks',
version='0.3.3',
author='Jiangge Zhang',
author_email='tonyseek@gmail.com',
description='A SOCKS reverse proxy server.',
long_description=long_d... | <commit_before>from setuptools import setup, find_packages
with open('README.rst') as readme:
long_description = ''.join(readme).strip()
setup(
name='rsocks',
version='0.3.3',
author='Jiangge Zhang',
author_email='tonyseek@gmail.com',
description='A SOCKS reverse proxy server.',
long_des... |
fc708cd68ec189f15b84a49329076fa0be922ea8 | python/S02/projets/QCM2.py | python/S02/projets/QCM2.py | """
QCM Version n°2
"""
import random
def afficher_question(question):
""" Affiche les informations de la question : question, réponses et points
que l'on peut gagner.
"""
print("### QUESTION ###")
print(question['question'])
for index, reponse in enumerate(question['réponses']):
... | Add the second version of QCM | Add the second version of QCM
| Python | mit | DocWinter/BiB-Workshops,DocWinter/BiB-Workshops,DocWinter/BiB-Workshops | Add the second version of QCM | """
QCM Version n°2
"""
import random
def afficher_question(question):
""" Affiche les informations de la question : question, réponses et points
que l'on peut gagner.
"""
print("### QUESTION ###")
print(question['question'])
for index, reponse in enumerate(question['réponses']):
... | <commit_before><commit_msg>Add the second version of QCM<commit_after> | """
QCM Version n°2
"""
import random
def afficher_question(question):
""" Affiche les informations de la question : question, réponses et points
que l'on peut gagner.
"""
print("### QUESTION ###")
print(question['question'])
for index, reponse in enumerate(question['réponses']):
... | Add the second version of QCM"""
QCM Version n°2
"""
import random
def afficher_question(question):
""" Affiche les informations de la question : question, réponses et points
que l'on peut gagner.
"""
print("### QUESTION ###")
print(question['question'])
for index, reponse in enumerate... | <commit_before><commit_msg>Add the second version of QCM<commit_after>"""
QCM Version n°2
"""
import random
def afficher_question(question):
""" Affiche les informations de la question : question, réponses et points
que l'on peut gagner.
"""
print("### QUESTION ###")
print(question['questi... | |
db80f597fe9e9b78eab31a2a2e3881ae5f238d32 | logging_example.py | logging_example.py | import logging
logging.basicConfig(level=logging.DEBUG, format='[%(asctime)-15s] [%(levelname)s] %(message)s')
from collector import GraphiteCollector
server = GraphiteCollector("shamir.wu", prefix="myPrefix", delay=20)
@server.metric()
def myMetric():
return 1234
if __name__ == '__main__':
server.feed()
| Add an example with logging | Add an example with logging
| Python | mit | C4ptainCrunch/graphite_feeder.py | Add an example with logging | import logging
logging.basicConfig(level=logging.DEBUG, format='[%(asctime)-15s] [%(levelname)s] %(message)s')
from collector import GraphiteCollector
server = GraphiteCollector("shamir.wu", prefix="myPrefix", delay=20)
@server.metric()
def myMetric():
return 1234
if __name__ == '__main__':
server.feed()
| <commit_before><commit_msg>Add an example with logging<commit_after> | import logging
logging.basicConfig(level=logging.DEBUG, format='[%(asctime)-15s] [%(levelname)s] %(message)s')
from collector import GraphiteCollector
server = GraphiteCollector("shamir.wu", prefix="myPrefix", delay=20)
@server.metric()
def myMetric():
return 1234
if __name__ == '__main__':
server.feed()
| Add an example with loggingimport logging
logging.basicConfig(level=logging.DEBUG, format='[%(asctime)-15s] [%(levelname)s] %(message)s')
from collector import GraphiteCollector
server = GraphiteCollector("shamir.wu", prefix="myPrefix", delay=20)
@server.metric()
def myMetric():
return 1234
if __name__ == '__ma... | <commit_before><commit_msg>Add an example with logging<commit_after>import logging
logging.basicConfig(level=logging.DEBUG, format='[%(asctime)-15s] [%(levelname)s] %(message)s')
from collector import GraphiteCollector
server = GraphiteCollector("shamir.wu", prefix="myPrefix", delay=20)
@server.metric()
def myMetric... | |
53b7e6e41867298b1546093aaf6bdf1e3163d9ca | skimage/measure/tests/test_fit.py | skimage/measure/tests/test_fit.py | import numpy as np
from numpy.testing import assert_equal, assert_raises, assert_almost_equal
from skimage.measure import LineModel, CircleModel, EllipseModel
def test_line_model_invalid_input():
assert_raises(ValueError, LineModel().estimate, np.empty((5, 3)))
def test_line_model_predict():
model = LineMod... | Add test cases for line model | Add test cases for line model
| Python | bsd-3-clause | keflavich/scikit-image,SamHames/scikit-image,SamHames/scikit-image,rjeli/scikit-image,Britefury/scikit-image,emon10005/scikit-image,ClinicalGraphics/scikit-image,ClinicalGraphics/scikit-image,juliusbierk/scikit-image,warmspringwinds/scikit-image,chintak/scikit-image,paalge/scikit-image,GaZ3ll3/scikit-image,ofgulban/sci... | Add test cases for line model | import numpy as np
from numpy.testing import assert_equal, assert_raises, assert_almost_equal
from skimage.measure import LineModel, CircleModel, EllipseModel
def test_line_model_invalid_input():
assert_raises(ValueError, LineModel().estimate, np.empty((5, 3)))
def test_line_model_predict():
model = LineMod... | <commit_before><commit_msg>Add test cases for line model<commit_after> | import numpy as np
from numpy.testing import assert_equal, assert_raises, assert_almost_equal
from skimage.measure import LineModel, CircleModel, EllipseModel
def test_line_model_invalid_input():
assert_raises(ValueError, LineModel().estimate, np.empty((5, 3)))
def test_line_model_predict():
model = LineMod... | Add test cases for line modelimport numpy as np
from numpy.testing import assert_equal, assert_raises, assert_almost_equal
from skimage.measure import LineModel, CircleModel, EllipseModel
def test_line_model_invalid_input():
assert_raises(ValueError, LineModel().estimate, np.empty((5, 3)))
def test_line_model_p... | <commit_before><commit_msg>Add test cases for line model<commit_after>import numpy as np
from numpy.testing import assert_equal, assert_raises, assert_almost_equal
from skimage.measure import LineModel, CircleModel, EllipseModel
def test_line_model_invalid_input():
assert_raises(ValueError, LineModel().estimate, ... | |
e19dc2b980366baf9051cc2596244063c3bb3091 | scripts/make-base-localizations.py | scripts/make-base-localizations.py | #!/usr/bin/env python
"""
make-base-localizations.py
Created by Alkis Evlogimenos on 2009-03-28.
"""
from glob import iglob
from itertools import chain
import logging
import os.path
import re
import sys
def FindEPGPRootDir():
if os.path.isfile('epgp.toc'):
return '.'
elif os.path.isfile('../epgp.toc'):
r... | Add script that scans all lua files, extracts localizations and write a base enUS localization file. | Add script that scans all lua files, extracts localizations and write a base enUS localization file.
| Python | bsd-3-clause | sheldon/epgp,sheldon/epgp,protomech/epgp-dkp-reloaded,protomech/epgp-dkp-reloaded,ceason/epgp-tfatf,hayword/tfatf_epgp,hayword/tfatf_epgp,ceason/epgp-tfatf | Add script that scans all lua files, extracts localizations and write a base enUS localization file. | #!/usr/bin/env python
"""
make-base-localizations.py
Created by Alkis Evlogimenos on 2009-03-28.
"""
from glob import iglob
from itertools import chain
import logging
import os.path
import re
import sys
def FindEPGPRootDir():
if os.path.isfile('epgp.toc'):
return '.'
elif os.path.isfile('../epgp.toc'):
r... | <commit_before><commit_msg>Add script that scans all lua files, extracts localizations and write a base enUS localization file.<commit_after> | #!/usr/bin/env python
"""
make-base-localizations.py
Created by Alkis Evlogimenos on 2009-03-28.
"""
from glob import iglob
from itertools import chain
import logging
import os.path
import re
import sys
def FindEPGPRootDir():
if os.path.isfile('epgp.toc'):
return '.'
elif os.path.isfile('../epgp.toc'):
r... | Add script that scans all lua files, extracts localizations and write a base enUS localization file.#!/usr/bin/env python
"""
make-base-localizations.py
Created by Alkis Evlogimenos on 2009-03-28.
"""
from glob import iglob
from itertools import chain
import logging
import os.path
import re
import sys
def FindEPGPRo... | <commit_before><commit_msg>Add script that scans all lua files, extracts localizations and write a base enUS localization file.<commit_after>#!/usr/bin/env python
"""
make-base-localizations.py
Created by Alkis Evlogimenos on 2009-03-28.
"""
from glob import iglob
from itertools import chain
import logging
import os.... | |
25f424a8d8328b7e869b06a9bfa4a891580a8960 | lib/history_widget.py | lib/history_widget.py | from PyQt4.QtGui import *
from i18n import _
class HistoryWidget(QTreeWidget):
def __init__(self, parent=None):
QTreeWidget.__init__(self, parent)
self.setColumnCount(2)
self.setHeaderLabels([_("Amount"), _("To / From"), _("When")])
self.setIndentation(0)
def empty(self):
... | from PyQt4.QtGui import *
from i18n import _
class HistoryWidget(QTreeWidget):
def __init__(self, parent=None):
QTreeWidget.__init__(self, parent)
self.setColumnCount(2)
self.setHeaderLabels([_("Amount"), _("To / From"), _("When")])
self.setIndentation(0)
def empty(self):
... | Fix for slush's problem, perhaps | Fix for slush's problem, perhaps
| Python | mit | dabura667/electrum,spesmilo/electrum,dabura667/electrum,kyuupichan/electrum,cryptapus/electrum,wakiyamap/electrum-mona,fireduck64/electrum,digitalbitbox/electrum,fujicoin/electrum-fjc,neocogent/electrum,argentumproject/electrum-arg,dabura667/electrum,pooler/electrum-ltc,fyookball/electrum,fireduck64/electrum,FairCoinTe... | from PyQt4.QtGui import *
from i18n import _
class HistoryWidget(QTreeWidget):
def __init__(self, parent=None):
QTreeWidget.__init__(self, parent)
self.setColumnCount(2)
self.setHeaderLabels([_("Amount"), _("To / From"), _("When")])
self.setIndentation(0)
def empty(self):
... | from PyQt4.QtGui import *
from i18n import _
class HistoryWidget(QTreeWidget):
def __init__(self, parent=None):
QTreeWidget.__init__(self, parent)
self.setColumnCount(2)
self.setHeaderLabels([_("Amount"), _("To / From"), _("When")])
self.setIndentation(0)
def empty(self):
... | <commit_before>from PyQt4.QtGui import *
from i18n import _
class HistoryWidget(QTreeWidget):
def __init__(self, parent=None):
QTreeWidget.__init__(self, parent)
self.setColumnCount(2)
self.setHeaderLabels([_("Amount"), _("To / From"), _("When")])
self.setIndentation(0)
def em... | from PyQt4.QtGui import *
from i18n import _
class HistoryWidget(QTreeWidget):
def __init__(self, parent=None):
QTreeWidget.__init__(self, parent)
self.setColumnCount(2)
self.setHeaderLabels([_("Amount"), _("To / From"), _("When")])
self.setIndentation(0)
def empty(self):
... | from PyQt4.QtGui import *
from i18n import _
class HistoryWidget(QTreeWidget):
def __init__(self, parent=None):
QTreeWidget.__init__(self, parent)
self.setColumnCount(2)
self.setHeaderLabels([_("Amount"), _("To / From"), _("When")])
self.setIndentation(0)
def empty(self):
... | <commit_before>from PyQt4.QtGui import *
from i18n import _
class HistoryWidget(QTreeWidget):
def __init__(self, parent=None):
QTreeWidget.__init__(self, parent)
self.setColumnCount(2)
self.setHeaderLabels([_("Amount"), _("To / From"), _("When")])
self.setIndentation(0)
def em... |
654b1dd1d9ab3d86be7ab3ca1842157c5e42b66d | tests/automated/test_model_Building.py | tests/automated/test_model_Building.py | from django.test import TestCase
from complaints.models import Building
class BuildingTestCase(TestCase):
""" Tests for the Building model.
"""
def setUp(self):
self.b1_name = 'The University of Toronto',
self.b1_civic_address = '27 King\'s College Circle',
self.b1_city = 'Toronto'... | Add tests for Building model | Add tests for Building model
| Python | mit | CSC301H-Fall2013/healthyhome,CSC301H-Fall2013/healthyhome | Add tests for Building model | from django.test import TestCase
from complaints.models import Building
class BuildingTestCase(TestCase):
""" Tests for the Building model.
"""
def setUp(self):
self.b1_name = 'The University of Toronto',
self.b1_civic_address = '27 King\'s College Circle',
self.b1_city = 'Toronto'... | <commit_before><commit_msg>Add tests for Building model<commit_after> | from django.test import TestCase
from complaints.models import Building
class BuildingTestCase(TestCase):
""" Tests for the Building model.
"""
def setUp(self):
self.b1_name = 'The University of Toronto',
self.b1_civic_address = '27 King\'s College Circle',
self.b1_city = 'Toronto'... | Add tests for Building modelfrom django.test import TestCase
from complaints.models import Building
class BuildingTestCase(TestCase):
""" Tests for the Building model.
"""
def setUp(self):
self.b1_name = 'The University of Toronto',
self.b1_civic_address = '27 King\'s College Circle',
... | <commit_before><commit_msg>Add tests for Building model<commit_after>from django.test import TestCase
from complaints.models import Building
class BuildingTestCase(TestCase):
""" Tests for the Building model.
"""
def setUp(self):
self.b1_name = 'The University of Toronto',
self.b1_civic_ad... | |
6fc1ba22e93711e6edb5d4b71516cfc8a91e3333 | tests/models/spells/test_dot_schema.py | tests/models/spells/test_dot_schema.py | import unittest
from tests.delete_test_db import delete_test_db # module that deletes the DB :)
import database.main
from tests.create_test_db import engine, session, Base
database.main.engine = engine
database.main.session = session
database.main.Base = Base
import models.main
from models.spells.spell_dots import... | Test for the DotSchema class | Test for the DotSchema class
| Python | mit | Enether/python_wow | Test for the DotSchema class | import unittest
from tests.delete_test_db import delete_test_db # module that deletes the DB :)
import database.main
from tests.create_test_db import engine, session, Base
database.main.engine = engine
database.main.session = session
database.main.Base = Base
import models.main
from models.spells.spell_dots import... | <commit_before><commit_msg>Test for the DotSchema class<commit_after> | import unittest
from tests.delete_test_db import delete_test_db # module that deletes the DB :)
import database.main
from tests.create_test_db import engine, session, Base
database.main.engine = engine
database.main.session = session
database.main.Base = Base
import models.main
from models.spells.spell_dots import... | Test for the DotSchema classimport unittest
from tests.delete_test_db import delete_test_db # module that deletes the DB :)
import database.main
from tests.create_test_db import engine, session, Base
database.main.engine = engine
database.main.session = session
database.main.Base = Base
import models.main
from mod... | <commit_before><commit_msg>Test for the DotSchema class<commit_after>import unittest
from tests.delete_test_db import delete_test_db # module that deletes the DB :)
import database.main
from tests.create_test_db import engine, session, Base
database.main.engine = engine
database.main.session = session
database.main... | |
89c5d88c0fc624d0135d513694f5fdb3ed220b08 | adaptive/sample_rpc.py | adaptive/sample_rpc.py | # Python-to-Python RPC using pickle and HTTP
import os, urllib2, pickle
from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler
# Server side
class ServiceRequestHandler(BaseHTTPRequestHandler):
services = {} # name -> instance
def do_GET(self):
res = 404
error = "Not found"
... | Add sample RPC client and server framework | Add sample RPC client and server framework | Python | apache-2.0 | datawire/adaptive | Add sample RPC client and server framework | # Python-to-Python RPC using pickle and HTTP
import os, urllib2, pickle
from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler
# Server side
class ServiceRequestHandler(BaseHTTPRequestHandler):
services = {} # name -> instance
def do_GET(self):
res = 404
error = "Not found"
... | <commit_before><commit_msg>Add sample RPC client and server framework<commit_after> | # Python-to-Python RPC using pickle and HTTP
import os, urllib2, pickle
from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler
# Server side
class ServiceRequestHandler(BaseHTTPRequestHandler):
services = {} # name -> instance
def do_GET(self):
res = 404
error = "Not found"
... | Add sample RPC client and server framework# Python-to-Python RPC using pickle and HTTP
import os, urllib2, pickle
from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler
# Server side
class ServiceRequestHandler(BaseHTTPRequestHandler):
services = {} # name -> instance
def do_GET(self):
res ... | <commit_before><commit_msg>Add sample RPC client and server framework<commit_after># Python-to-Python RPC using pickle and HTTP
import os, urllib2, pickle
from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler
# Server side
class ServiceRequestHandler(BaseHTTPRequestHandler):
services = {} # name -> ins... | |
5ae76b2edf6b58dd093b329ff9b329d31701eb8b | tests/test_descriptors.py | tests/test_descriptors.py | from __future__ import absolute_import
from pytest import fixture, raises
from openvpn_status.descriptors import (
LabelProperty, name_descriptors, iter_descriptors)
@fixture
def foo_class():
@name_descriptors
class Foo(object):
foo = LabelProperty('Foo')
bar = LabelProperty('Bar', defau... | Test the descriptors and its helpers | Test the descriptors and its helpers
| Python | mit | tonyseek/openvpn-status | Test the descriptors and its helpers | from __future__ import absolute_import
from pytest import fixture, raises
from openvpn_status.descriptors import (
LabelProperty, name_descriptors, iter_descriptors)
@fixture
def foo_class():
@name_descriptors
class Foo(object):
foo = LabelProperty('Foo')
bar = LabelProperty('Bar', defau... | <commit_before><commit_msg>Test the descriptors and its helpers<commit_after> | from __future__ import absolute_import
from pytest import fixture, raises
from openvpn_status.descriptors import (
LabelProperty, name_descriptors, iter_descriptors)
@fixture
def foo_class():
@name_descriptors
class Foo(object):
foo = LabelProperty('Foo')
bar = LabelProperty('Bar', defau... | Test the descriptors and its helpersfrom __future__ import absolute_import
from pytest import fixture, raises
from openvpn_status.descriptors import (
LabelProperty, name_descriptors, iter_descriptors)
@fixture
def foo_class():
@name_descriptors
class Foo(object):
foo = LabelProperty('Foo')
... | <commit_before><commit_msg>Test the descriptors and its helpers<commit_after>from __future__ import absolute_import
from pytest import fixture, raises
from openvpn_status.descriptors import (
LabelProperty, name_descriptors, iter_descriptors)
@fixture
def foo_class():
@name_descriptors
class Foo(object)... | |
87bcfa82d9c3fc001f46af66b333f422f30068bf | apsuite/emit_exchange/emit_exchange.py | apsuite/emit_exchange/emit_exchange.py | import numpy as _np
import pyaccel as _pa
import pymodels as _pm
class EmittanceExchangeSimul:
def __init__(self, accelerator='bo'):
ACC_LIST = ['bo', ]
self._model = None
if accelerator not in ACC_LIST:
raise NotImplementedError(
'Simulation not implemented... | Create a class to simulate the emittance exchange dynamical process. | Create a class to simulate the emittance exchange dynamical process.
| Python | mit | lnls-fac/apsuite | Create a class to simulate the emittance exchange dynamical process. | import numpy as _np
import pyaccel as _pa
import pymodels as _pm
class EmittanceExchangeSimul:
def __init__(self, accelerator='bo'):
ACC_LIST = ['bo', ]
self._model = None
if accelerator not in ACC_LIST:
raise NotImplementedError(
'Simulation not implemented... | <commit_before><commit_msg>Create a class to simulate the emittance exchange dynamical process.<commit_after> | import numpy as _np
import pyaccel as _pa
import pymodels as _pm
class EmittanceExchangeSimul:
def __init__(self, accelerator='bo'):
ACC_LIST = ['bo', ]
self._model = None
if accelerator not in ACC_LIST:
raise NotImplementedError(
'Simulation not implemented... | Create a class to simulate the emittance exchange dynamical process.import numpy as _np
import pyaccel as _pa
import pymodels as _pm
class EmittanceExchangeSimul:
def __init__(self, accelerator='bo'):
ACC_LIST = ['bo', ]
self._model = None
if accelerator not in ACC_LIST:
ra... | <commit_before><commit_msg>Create a class to simulate the emittance exchange dynamical process.<commit_after>import numpy as _np
import pyaccel as _pa
import pymodels as _pm
class EmittanceExchangeSimul:
def __init__(self, accelerator='bo'):
ACC_LIST = ['bo', ]
self._model = None
if ac... | |
9cd81da23b1c3d5ca5a9d3f805fee9ceb675ee7e | graystruct/__init__.py | graystruct/__init__.py | import json
import logging
import os
import socket
import zlib
from graypy.handler import SYSLOG_LEVELS, GELFHandler as BaseGELFHandler
from graypy.rabbitmq import GELFRabbitHandler as BaseGELFRabbitHandler
from structlog._frames import _find_first_app_frame_and_name
from structlog.stdlib import _NAME_TO_LEVEL
STAND... | Add initial attempt at graystruct | Add initial attempt at graystruct
| Python | bsd-3-clause | enthought/graystruct | Add initial attempt at graystruct | import json
import logging
import os
import socket
import zlib
from graypy.handler import SYSLOG_LEVELS, GELFHandler as BaseGELFHandler
from graypy.rabbitmq import GELFRabbitHandler as BaseGELFRabbitHandler
from structlog._frames import _find_first_app_frame_and_name
from structlog.stdlib import _NAME_TO_LEVEL
STAND... | <commit_before><commit_msg>Add initial attempt at graystruct<commit_after> | import json
import logging
import os
import socket
import zlib
from graypy.handler import SYSLOG_LEVELS, GELFHandler as BaseGELFHandler
from graypy.rabbitmq import GELFRabbitHandler as BaseGELFRabbitHandler
from structlog._frames import _find_first_app_frame_and_name
from structlog.stdlib import _NAME_TO_LEVEL
STAND... | Add initial attempt at graystructimport json
import logging
import os
import socket
import zlib
from graypy.handler import SYSLOG_LEVELS, GELFHandler as BaseGELFHandler
from graypy.rabbitmq import GELFRabbitHandler as BaseGELFRabbitHandler
from structlog._frames import _find_first_app_frame_and_name
from structlog.std... | <commit_before><commit_msg>Add initial attempt at graystruct<commit_after>import json
import logging
import os
import socket
import zlib
from graypy.handler import SYSLOG_LEVELS, GELFHandler as BaseGELFHandler
from graypy.rabbitmq import GELFRabbitHandler as BaseGELFRabbitHandler
from structlog._frames import _find_fi... | |
c1b3631efb41ccec5e3760a391b0c251946fffaa | Python/major_scale.py | Python/major_scale.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Author: hvn@familug.org
# Tested with Python3
# python major_scale.py C
# ['C', 'D', 'E', 'F', 'G', 'A', 'B', 'C']
import argparse
__doc__ = '''Script prints out major scale start from input note.'''
notes = ('A', 'Bb', 'B', 'C', 'Db', 'D', 'Eb', 'E', 'F', 'Gb', 'G', ... | Add script calculate Major scale | Add script calculate Major scale
| Python | bsd-2-clause | familug/FAMILUG,familug/FAMILUG,familug/FAMILUG,familug/FAMILUG,familug/FAMILUG,familug/FAMILUG,familug/FAMILUG,familug/FAMILUG | Add script calculate Major scale | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Author: hvn@familug.org
# Tested with Python3
# python major_scale.py C
# ['C', 'D', 'E', 'F', 'G', 'A', 'B', 'C']
import argparse
__doc__ = '''Script prints out major scale start from input note.'''
notes = ('A', 'Bb', 'B', 'C', 'Db', 'D', 'Eb', 'E', 'F', 'Gb', 'G', ... | <commit_before><commit_msg>Add script calculate Major scale<commit_after> | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Author: hvn@familug.org
# Tested with Python3
# python major_scale.py C
# ['C', 'D', 'E', 'F', 'G', 'A', 'B', 'C']
import argparse
__doc__ = '''Script prints out major scale start from input note.'''
notes = ('A', 'Bb', 'B', 'C', 'Db', 'D', 'Eb', 'E', 'F', 'Gb', 'G', ... | Add script calculate Major scale#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Author: hvn@familug.org
# Tested with Python3
# python major_scale.py C
# ['C', 'D', 'E', 'F', 'G', 'A', 'B', 'C']
import argparse
__doc__ = '''Script prints out major scale start from input note.'''
notes = ('A', 'Bb', 'B', 'C', 'Db', ... | <commit_before><commit_msg>Add script calculate Major scale<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Author: hvn@familug.org
# Tested with Python3
# python major_scale.py C
# ['C', 'D', 'E', 'F', 'G', 'A', 'B', 'C']
import argparse
__doc__ = '''Script prints out major scale start from input note.... | |
0f0139bf8ad8a149d0c545968978c35480335312 | lib/pegasus/python/Pegasus/test/service/monitoring/__init__.py | lib/pegasus/python/Pegasus/test/service/monitoring/__init__.py | # Copyright 2007-2014 University Of Southern California
#
# 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 ... | Add directory where test case will be populated | Add directory where test case will be populated
| Python | apache-2.0 | pegasus-isi/pegasus,pegasus-isi/pegasus,pegasus-isi/pegasus,pegasus-isi/pegasus,pegasus-isi/pegasus,pegasus-isi/pegasus,pegasus-isi/pegasus,pegasus-isi/pegasus,pegasus-isi/pegasus,pegasus-isi/pegasus | Add directory where test case will be populated | # Copyright 2007-2014 University Of Southern California
#
# 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 ... | <commit_before><commit_msg>Add directory where test case will be populated<commit_after> | # Copyright 2007-2014 University Of Southern California
#
# 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 ... | Add directory where test case will be populated# Copyright 2007-2014 University Of Southern California
#
# 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/... | <commit_before><commit_msg>Add directory where test case will be populated<commit_after># Copyright 2007-2014 University Of Southern California
#
# 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 Licens... | |
4ac396057d88c058652cc54f2d62e69777238665 | migrations/versions/578ce9f8d1_add_tags_and_social_profiles.py | migrations/versions/578ce9f8d1_add_tags_and_social_profiles.py | """Add Tags and Social Profiles
Revision ID: 578ce9f8d1
Revises: 29ef29bfbe43
Create Date: 2017-12-07 19:34:45.949358
"""
# revision identifiers, used by Alembic.
revision = '578ce9f8d1'
down_revision = '29ef29bfbe43'
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
from sql... | Add migration for tags/social profiles | Add migration for tags/social profiles
Reading the documentation for [Flask-Migrate][1] seems to imply that
the way to do migrations for us is a two step process:
python app.py db migrate --message "Some message here"
then, to test the migration:
python app.py db upgrade
Make sure to commit the migration.
[1]: ht... | Python | mit | codeforamerica/cfapi,codeforamerica/cfapi | Add migration for tags/social profiles
Reading the documentation for [Flask-Migrate][1] seems to imply that
the way to do migrations for us is a two step process:
python app.py db migrate --message "Some message here"
then, to test the migration:
python app.py db upgrade
Make sure to commit the migration.
[1]: ht... | """Add Tags and Social Profiles
Revision ID: 578ce9f8d1
Revises: 29ef29bfbe43
Create Date: 2017-12-07 19:34:45.949358
"""
# revision identifiers, used by Alembic.
revision = '578ce9f8d1'
down_revision = '29ef29bfbe43'
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
from sql... | <commit_before><commit_msg>Add migration for tags/social profiles
Reading the documentation for [Flask-Migrate][1] seems to imply that
the way to do migrations for us is a two step process:
python app.py db migrate --message "Some message here"
then, to test the migration:
python app.py db upgrade
Make sure to com... | """Add Tags and Social Profiles
Revision ID: 578ce9f8d1
Revises: 29ef29bfbe43
Create Date: 2017-12-07 19:34:45.949358
"""
# revision identifiers, used by Alembic.
revision = '578ce9f8d1'
down_revision = '29ef29bfbe43'
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
from sql... | Add migration for tags/social profiles
Reading the documentation for [Flask-Migrate][1] seems to imply that
the way to do migrations for us is a two step process:
python app.py db migrate --message "Some message here"
then, to test the migration:
python app.py db upgrade
Make sure to commit the migration.
[1]: ht... | <commit_before><commit_msg>Add migration for tags/social profiles
Reading the documentation for [Flask-Migrate][1] seems to imply that
the way to do migrations for us is a two step process:
python app.py db migrate --message "Some message here"
then, to test the migration:
python app.py db upgrade
Make sure to com... | |
948102f164890974dbf3f02d58a9275dcbbbd9aa | src/ggrc_risks/migrations/versions/20151112161029_62f26762d0a_add_missing_constraints.py | src/ggrc_risks/migrations/versions/20151112161029_62f26762d0a_add_missing_constraints.py | # Copyright (C) 2015 Google Inc., authors, and contributors <see AUTHORS file>
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
# Created By: anze@reciprocitylabs.com
# Maintained By: anze@reciprocitylabs.com
from alembic import op
from ggrc.migrations.utils import resolve_duplicates
from... | Add unique constraint to threats slug | Add unique constraint to threats slug
| Python | apache-2.0 | kr41/ggrc-core,josthkko/ggrc-core,VinnieJohns/ggrc-core,kr41/ggrc-core,selahssea/ggrc-core,selahssea/ggrc-core,NejcZupec/ggrc-core,prasannav7/ggrc-core,jmakov/ggrc-core,andrei-karalionak/ggrc-core,plamut/ggrc-core,AleksNeStu/ggrc-core,NejcZupec/ggrc-core,selahssea/ggrc-core,VinnieJohns/ggrc-core,j0gurt/ggrc-core,Vinnie... | Add unique constraint to threats slug | # Copyright (C) 2015 Google Inc., authors, and contributors <see AUTHORS file>
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
# Created By: anze@reciprocitylabs.com
# Maintained By: anze@reciprocitylabs.com
from alembic import op
from ggrc.migrations.utils import resolve_duplicates
from... | <commit_before><commit_msg>Add unique constraint to threats slug<commit_after> | # Copyright (C) 2015 Google Inc., authors, and contributors <see AUTHORS file>
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
# Created By: anze@reciprocitylabs.com
# Maintained By: anze@reciprocitylabs.com
from alembic import op
from ggrc.migrations.utils import resolve_duplicates
from... | Add unique constraint to threats slug# Copyright (C) 2015 Google Inc., authors, and contributors <see AUTHORS file>
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
# Created By: anze@reciprocitylabs.com
# Maintained By: anze@reciprocitylabs.com
from alembic import op
from ggrc.migrations... | <commit_before><commit_msg>Add unique constraint to threats slug<commit_after># Copyright (C) 2015 Google Inc., authors, and contributors <see AUTHORS file>
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
# Created By: anze@reciprocitylabs.com
# Maintained By: anze@reciprocitylabs.com
fr... | |
cff9f068246e6b50de6123db12b801d27f466b6d | corehq/messaging/scheduling/scheduling_partitioned/migrations/0009_update_custom_recipient_ids.py | corehq/messaging/scheduling/scheduling_partitioned/migrations/0009_update_custom_recipient_ids.py | # Generated by Django 2.2.24 on 2021-11-19 14:36
from django.db import migrations
from corehq.messaging.scheduling.scheduling_partitioned.models import CaseTimedScheduleInstance
from corehq.sql_db.util import get_db_aliases_for_partitioned_query
def update_custom_recipient_ids(*args, **kwargs):
for db in get_db_... | Add migration to update custom schedule instances' recipient ids | Add migration to update custom schedule instances' recipient ids
| Python | bsd-3-clause | dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq | Add migration to update custom schedule instances' recipient ids | # Generated by Django 2.2.24 on 2021-11-19 14:36
from django.db import migrations
from corehq.messaging.scheduling.scheduling_partitioned.models import CaseTimedScheduleInstance
from corehq.sql_db.util import get_db_aliases_for_partitioned_query
def update_custom_recipient_ids(*args, **kwargs):
for db in get_db_... | <commit_before><commit_msg>Add migration to update custom schedule instances' recipient ids<commit_after> | # Generated by Django 2.2.24 on 2021-11-19 14:36
from django.db import migrations
from corehq.messaging.scheduling.scheduling_partitioned.models import CaseTimedScheduleInstance
from corehq.sql_db.util import get_db_aliases_for_partitioned_query
def update_custom_recipient_ids(*args, **kwargs):
for db in get_db_... | Add migration to update custom schedule instances' recipient ids# Generated by Django 2.2.24 on 2021-11-19 14:36
from django.db import migrations
from corehq.messaging.scheduling.scheduling_partitioned.models import CaseTimedScheduleInstance
from corehq.sql_db.util import get_db_aliases_for_partitioned_query
def upd... | <commit_before><commit_msg>Add migration to update custom schedule instances' recipient ids<commit_after># Generated by Django 2.2.24 on 2021-11-19 14:36
from django.db import migrations
from corehq.messaging.scheduling.scheduling_partitioned.models import CaseTimedScheduleInstance
from corehq.sql_db.util import get_d... | |
85c34957a1f7fdb75fbdf9b72bb26169effe7f0d | billing/templatetags/jinja2_tags.py | billing/templatetags/jinja2_tags.py | from coffin.template import Library
from django.template.loader import render_to_string
from jinja2 import nodes
from jinja2.ext import Extension
register = Library()
class MerchantExtension(Extension):
tags = set(['render_integration'])
def parse(self, parser):
stream = parser.stream
line... | Revert "Revert "Added an extension to allow rendering of integration objects in a Jinja2 template."" | Revert "Revert "Added an extension to allow rendering of integration objects in a Jinja2 template.""
This reverts commit 94199d05795323c2747a7ce2e671d92f3c0be91f.
| Python | bsd-3-clause | spookylukey/merchant,digideskio/merchant,spookylukey/merchant,agiliq/merchant,mjrulesamrat/merchant,biddyweb/merchant,agiliq/merchant,biddyweb/merchant,mjrulesamrat/merchant,digideskio/merchant | Revert "Revert "Added an extension to allow rendering of integration objects in a Jinja2 template.""
This reverts commit 94199d05795323c2747a7ce2e671d92f3c0be91f. | from coffin.template import Library
from django.template.loader import render_to_string
from jinja2 import nodes
from jinja2.ext import Extension
register = Library()
class MerchantExtension(Extension):
tags = set(['render_integration'])
def parse(self, parser):
stream = parser.stream
line... | <commit_before><commit_msg>Revert "Revert "Added an extension to allow rendering of integration objects in a Jinja2 template.""
This reverts commit 94199d05795323c2747a7ce2e671d92f3c0be91f.<commit_after> | from coffin.template import Library
from django.template.loader import render_to_string
from jinja2 import nodes
from jinja2.ext import Extension
register = Library()
class MerchantExtension(Extension):
tags = set(['render_integration'])
def parse(self, parser):
stream = parser.stream
line... | Revert "Revert "Added an extension to allow rendering of integration objects in a Jinja2 template.""
This reverts commit 94199d05795323c2747a7ce2e671d92f3c0be91f.from coffin.template import Library
from django.template.loader import render_to_string
from jinja2 import nodes
from jinja2.ext import Extension
register ... | <commit_before><commit_msg>Revert "Revert "Added an extension to allow rendering of integration objects in a Jinja2 template.""
This reverts commit 94199d05795323c2747a7ce2e671d92f3c0be91f.<commit_after>from coffin.template import Library
from django.template.loader import render_to_string
from jinja2 import nodes
fro... | |
062f62bdf4cd05c6f92f6a7c0a2e0c278a00f954 | string/test3.py | string/test3.py | #!/usr/local/bin/python
#print 'Pirce is %d'% 43
#print 'Pirce is %x'% 43
#print 'Pirce is %o'% 43
#from math import pi
#print 'Pi is %.2f'%pi
#print 'Repr %r'%42L
#print 'Str %s'%42L
#print '%10.2f'% 1.334
#print '%-10.2f'% 2.334
#print '%+10.3f'% 3.334
#print '%010.2f'% 4.334
#print '% 10.2f'% 5.334
#print '%.*s' %(5... | Use upper,split,translate and so on. | Use upper,split,translate and so on.
| Python | apache-2.0 | Vayne-Lover/Python | Use upper,split,translate and so on. | #!/usr/local/bin/python
#print 'Pirce is %d'% 43
#print 'Pirce is %x'% 43
#print 'Pirce is %o'% 43
#from math import pi
#print 'Pi is %.2f'%pi
#print 'Repr %r'%42L
#print 'Str %s'%42L
#print '%10.2f'% 1.334
#print '%-10.2f'% 2.334
#print '%+10.3f'% 3.334
#print '%010.2f'% 4.334
#print '% 10.2f'% 5.334
#print '%.*s' %(5... | <commit_before><commit_msg>Use upper,split,translate and so on.<commit_after> | #!/usr/local/bin/python
#print 'Pirce is %d'% 43
#print 'Pirce is %x'% 43
#print 'Pirce is %o'% 43
#from math import pi
#print 'Pi is %.2f'%pi
#print 'Repr %r'%42L
#print 'Str %s'%42L
#print '%10.2f'% 1.334
#print '%-10.2f'% 2.334
#print '%+10.3f'% 3.334
#print '%010.2f'% 4.334
#print '% 10.2f'% 5.334
#print '%.*s' %(5... | Use upper,split,translate and so on.#!/usr/local/bin/python
#print 'Pirce is %d'% 43
#print 'Pirce is %x'% 43
#print 'Pirce is %o'% 43
#from math import pi
#print 'Pi is %.2f'%pi
#print 'Repr %r'%42L
#print 'Str %s'%42L
#print '%10.2f'% 1.334
#print '%-10.2f'% 2.334
#print '%+10.3f'% 3.334
#print '%010.2f'% 4.334
#prin... | <commit_before><commit_msg>Use upper,split,translate and so on.<commit_after>#!/usr/local/bin/python
#print 'Pirce is %d'% 43
#print 'Pirce is %x'% 43
#print 'Pirce is %o'% 43
#from math import pi
#print 'Pi is %.2f'%pi
#print 'Repr %r'%42L
#print 'Str %s'%42L
#print '%10.2f'% 1.334
#print '%-10.2f'% 2.334
#print '%+10... | |
1b6af59ce27c16ae65620a5bf03dcd07d51659f4 | fabfile/testbeds/testbed_jlab.py | fabfile/testbeds/testbed_jlab.py | from fabric.api import env
#Management ip addresses of hosts in the cluster
host1 = 'root@172.21.0.10'
host2 = 'root@172.21.0.13'
host3 = 'root@172.21.0.14'
host4 = 'root@172.21.1.12'
host5 = 'root@172.21.1.13'
#External routers if any
#for eg.
#ext_routers = [('mx1', '10.204.216.253')]
ext_routers = []
#Autonomous... | Add OCS jlab testbed file | Add OCS jlab testbed file
| Python | apache-2.0 | Juniper/contrail-fabric-utils,Juniper/contrail-fabric-utils | Add OCS jlab testbed file | from fabric.api import env
#Management ip addresses of hosts in the cluster
host1 = 'root@172.21.0.10'
host2 = 'root@172.21.0.13'
host3 = 'root@172.21.0.14'
host4 = 'root@172.21.1.12'
host5 = 'root@172.21.1.13'
#External routers if any
#for eg.
#ext_routers = [('mx1', '10.204.216.253')]
ext_routers = []
#Autonomous... | <commit_before><commit_msg>Add OCS jlab testbed file<commit_after> | from fabric.api import env
#Management ip addresses of hosts in the cluster
host1 = 'root@172.21.0.10'
host2 = 'root@172.21.0.13'
host3 = 'root@172.21.0.14'
host4 = 'root@172.21.1.12'
host5 = 'root@172.21.1.13'
#External routers if any
#for eg.
#ext_routers = [('mx1', '10.204.216.253')]
ext_routers = []
#Autonomous... | Add OCS jlab testbed filefrom fabric.api import env
#Management ip addresses of hosts in the cluster
host1 = 'root@172.21.0.10'
host2 = 'root@172.21.0.13'
host3 = 'root@172.21.0.14'
host4 = 'root@172.21.1.12'
host5 = 'root@172.21.1.13'
#External routers if any
#for eg.
#ext_routers = [('mx1', '10.204.216.253')]
ext_... | <commit_before><commit_msg>Add OCS jlab testbed file<commit_after>from fabric.api import env
#Management ip addresses of hosts in the cluster
host1 = 'root@172.21.0.10'
host2 = 'root@172.21.0.13'
host3 = 'root@172.21.0.14'
host4 = 'root@172.21.1.12'
host5 = 'root@172.21.1.13'
#External routers if any
#for eg.
#ext_r... | |
370cab9bd98c73fb14078fd74131cef84ee3c71a | utils/img2video.py | utils/img2video.py | # Copyright (C) 2016 Zhixian MA <zxma_sjtu@qq.com>
# MIT license
"""
A simple tool to translate a group of images to a video. In the gas track work,
it is used to gather the simulated gas images into a portable video.
References
----------
[1] OpenCV-Python Tutorials
https://opencv-python-toturials.readthedocs.io... | Add a tool to transform multi-images into a video. | Add a tool to transform multi-images into a video.
| Python | mit | myinxd/gastrack,myinxd/gastrack | Add a tool to transform multi-images into a video. | # Copyright (C) 2016 Zhixian MA <zxma_sjtu@qq.com>
# MIT license
"""
A simple tool to translate a group of images to a video. In the gas track work,
it is used to gather the simulated gas images into a portable video.
References
----------
[1] OpenCV-Python Tutorials
https://opencv-python-toturials.readthedocs.io... | <commit_before><commit_msg>Add a tool to transform multi-images into a video.<commit_after> | # Copyright (C) 2016 Zhixian MA <zxma_sjtu@qq.com>
# MIT license
"""
A simple tool to translate a group of images to a video. In the gas track work,
it is used to gather the simulated gas images into a portable video.
References
----------
[1] OpenCV-Python Tutorials
https://opencv-python-toturials.readthedocs.io... | Add a tool to transform multi-images into a video.# Copyright (C) 2016 Zhixian MA <zxma_sjtu@qq.com>
# MIT license
"""
A simple tool to translate a group of images to a video. In the gas track work,
it is used to gather the simulated gas images into a portable video.
References
----------
[1] OpenCV-Python Tutorials
... | <commit_before><commit_msg>Add a tool to transform multi-images into a video.<commit_after># Copyright (C) 2016 Zhixian MA <zxma_sjtu@qq.com>
# MIT license
"""
A simple tool to translate a group of images to a video. In the gas track work,
it is used to gather the simulated gas images into a portable video.
Reference... | |
6332b285b805115d4a8d9aeacf81a836695e19c4 | util/package.py | util/package.py | import bz2
import json
import optparse
import os
import shutil
import sys
if __name__ == '__main__':
parser = optparse.OptionParser()
parser.add_option("-t", "--trial-path", action="store", dest="trial_path", help="Path to the output from a benchmark run", default="/tmp/pybrig/trials")
(options, args) = p... | Package utility: takes all output and turns into single (compressed) output file suitable for easier transport. | Package utility: takes all output and turns into single (compressed) output file suitable for easier transport.
| Python | bsd-3-clause | cubic1271/pybrig,cubic1271/pybrig | Package utility: takes all output and turns into single (compressed) output file suitable for easier transport. | import bz2
import json
import optparse
import os
import shutil
import sys
if __name__ == '__main__':
parser = optparse.OptionParser()
parser.add_option("-t", "--trial-path", action="store", dest="trial_path", help="Path to the output from a benchmark run", default="/tmp/pybrig/trials")
(options, args) = p... | <commit_before><commit_msg>Package utility: takes all output and turns into single (compressed) output file suitable for easier transport.<commit_after> | import bz2
import json
import optparse
import os
import shutil
import sys
if __name__ == '__main__':
parser = optparse.OptionParser()
parser.add_option("-t", "--trial-path", action="store", dest="trial_path", help="Path to the output from a benchmark run", default="/tmp/pybrig/trials")
(options, args) = p... | Package utility: takes all output and turns into single (compressed) output file suitable for easier transport.import bz2
import json
import optparse
import os
import shutil
import sys
if __name__ == '__main__':
parser = optparse.OptionParser()
parser.add_option("-t", "--trial-path", action="store", dest="tria... | <commit_before><commit_msg>Package utility: takes all output and turns into single (compressed) output file suitable for easier transport.<commit_after>import bz2
import json
import optparse
import os
import shutil
import sys
if __name__ == '__main__':
parser = optparse.OptionParser()
parser.add_option("-t", "... | |
0b8a2a3a0f010538dd30ce04ca1ce943347a04a8 | django_fixmystreet/fmsproxy/models.py | django_fixmystreet/fmsproxy/models.py | from django.db import models
import logging
logger = logging.getLogger(__name__)
class FMSProxy(models.Model):
name = models.CharField(max_length=20, unique=True)
def __unicode__(self):
return self.name
def get_assign_payload(report):
creator = report.get_creator()
payload = {
"appl... | from django.db import models
import logging
logger = logging.getLogger(__name__)
class FMSProxy(models.Model):
name = models.CharField(max_length=20, unique=True)
def __unicode__(self):
return self.name
def get_assign_payload(report):
creator = report.get_creator()
payload = {
"appl... | Use `active_attachments_pro` instead of `active_comments`. | Fix: Use `active_attachments_pro` instead of `active_comments`.
| Python | agpl-3.0 | IMIO/django-fixmystreet,IMIO/django-fixmystreet,IMIO/django-fixmystreet,IMIO/django-fixmystreet | from django.db import models
import logging
logger = logging.getLogger(__name__)
class FMSProxy(models.Model):
name = models.CharField(max_length=20, unique=True)
def __unicode__(self):
return self.name
def get_assign_payload(report):
creator = report.get_creator()
payload = {
"appl... | from django.db import models
import logging
logger = logging.getLogger(__name__)
class FMSProxy(models.Model):
name = models.CharField(max_length=20, unique=True)
def __unicode__(self):
return self.name
def get_assign_payload(report):
creator = report.get_creator()
payload = {
"appl... | <commit_before>from django.db import models
import logging
logger = logging.getLogger(__name__)
class FMSProxy(models.Model):
name = models.CharField(max_length=20, unique=True)
def __unicode__(self):
return self.name
def get_assign_payload(report):
creator = report.get_creator()
payload = ... | from django.db import models
import logging
logger = logging.getLogger(__name__)
class FMSProxy(models.Model):
name = models.CharField(max_length=20, unique=True)
def __unicode__(self):
return self.name
def get_assign_payload(report):
creator = report.get_creator()
payload = {
"appl... | from django.db import models
import logging
logger = logging.getLogger(__name__)
class FMSProxy(models.Model):
name = models.CharField(max_length=20, unique=True)
def __unicode__(self):
return self.name
def get_assign_payload(report):
creator = report.get_creator()
payload = {
"appl... | <commit_before>from django.db import models
import logging
logger = logging.getLogger(__name__)
class FMSProxy(models.Model):
name = models.CharField(max_length=20, unique=True)
def __unicode__(self):
return self.name
def get_assign_payload(report):
creator = report.get_creator()
payload = ... |
829ccc3384126a48b8d54ac651a93e169e417176 | dbaas/maintenance/admin/maintenance.py | dbaas/maintenance/admin/maintenance.py | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from django_services import admin
from ..models import Maintenance
from ..service.maintenance import MaintenanceService
from ..forms import MaintenanceForm
class MaintenanceAdmin(admin.DjangoServicesAdmin):
service_class = Maintenanc... | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from django_services import admin
from ..service.maintenance import MaintenanceService
from ..forms import MaintenanceForm
class MaintenanceAdmin(admin.DjangoServicesAdmin):
service_class = MaintenanceService
search_fields = ("sc... | Add get_read_only and remove old change_view customization | Add get_read_only and remove old change_view customization
| Python | bsd-3-clause | globocom/database-as-a-service,globocom/database-as-a-service,globocom/database-as-a-service,globocom/database-as-a-service | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from django_services import admin
from ..models import Maintenance
from ..service.maintenance import MaintenanceService
from ..forms import MaintenanceForm
class MaintenanceAdmin(admin.DjangoServicesAdmin):
service_class = Maintenanc... | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from django_services import admin
from ..service.maintenance import MaintenanceService
from ..forms import MaintenanceForm
class MaintenanceAdmin(admin.DjangoServicesAdmin):
service_class = MaintenanceService
search_fields = ("sc... | <commit_before># -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from django_services import admin
from ..models import Maintenance
from ..service.maintenance import MaintenanceService
from ..forms import MaintenanceForm
class MaintenanceAdmin(admin.DjangoServicesAdmin):
service_cla... | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from django_services import admin
from ..service.maintenance import MaintenanceService
from ..forms import MaintenanceForm
class MaintenanceAdmin(admin.DjangoServicesAdmin):
service_class = MaintenanceService
search_fields = ("sc... | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from django_services import admin
from ..models import Maintenance
from ..service.maintenance import MaintenanceService
from ..forms import MaintenanceForm
class MaintenanceAdmin(admin.DjangoServicesAdmin):
service_class = Maintenanc... | <commit_before># -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from django_services import admin
from ..models import Maintenance
from ..service.maintenance import MaintenanceService
from ..forms import MaintenanceForm
class MaintenanceAdmin(admin.DjangoServicesAdmin):
service_cla... |
d5538e7daf5b3dbefa1ff0e76ced46eb194c836c | dodger/tests/test_osx_dodger_class.py | dodger/tests/test_osx_dodger_class.py | from unittest import TestCase
from ..dock_dodger import OSXDodger
class OSXDockDodgerTests(TestCase):
def test_applications_folder_is_correct(self):
"""
Test that the applications folder is
indeed `/Applications/`
"""
expected = "/Applications/"
result = OSXDodger()... | from unittest import TestCase
from ..dock_dodger import OSXDodger
class OSXDockDodgerTests(TestCase):
def test_applications_folder_is_correct(self):
"""
Test that the applications folder is
indeed `/Applications/`
"""
expected = "/Applications/"
result = OSXDodger()... | Test that the anly allowed system to execute this script is OS X | Test that the anly allowed system to execute this script is OS X
| Python | mit | yoda-yoda/osx-dock-dodger,denisKaranja/osx-dock-dodger | from unittest import TestCase
from ..dock_dodger import OSXDodger
class OSXDockDodgerTests(TestCase):
def test_applications_folder_is_correct(self):
"""
Test that the applications folder is
indeed `/Applications/`
"""
expected = "/Applications/"
result = OSXDodger()... | from unittest import TestCase
from ..dock_dodger import OSXDodger
class OSXDockDodgerTests(TestCase):
def test_applications_folder_is_correct(self):
"""
Test that the applications folder is
indeed `/Applications/`
"""
expected = "/Applications/"
result = OSXDodger()... | <commit_before>from unittest import TestCase
from ..dock_dodger import OSXDodger
class OSXDockDodgerTests(TestCase):
def test_applications_folder_is_correct(self):
"""
Test that the applications folder is
indeed `/Applications/`
"""
expected = "/Applications/"
resul... | from unittest import TestCase
from ..dock_dodger import OSXDodger
class OSXDockDodgerTests(TestCase):
def test_applications_folder_is_correct(self):
"""
Test that the applications folder is
indeed `/Applications/`
"""
expected = "/Applications/"
result = OSXDodger()... | from unittest import TestCase
from ..dock_dodger import OSXDodger
class OSXDockDodgerTests(TestCase):
def test_applications_folder_is_correct(self):
"""
Test that the applications folder is
indeed `/Applications/`
"""
expected = "/Applications/"
result = OSXDodger()... | <commit_before>from unittest import TestCase
from ..dock_dodger import OSXDodger
class OSXDockDodgerTests(TestCase):
def test_applications_folder_is_correct(self):
"""
Test that the applications folder is
indeed `/Applications/`
"""
expected = "/Applications/"
resul... |
c583f139b5092c132cb738f8bcbb5f305a0204a9 | evaluation/packages/relationGraph.py | evaluation/packages/relationGraph.py | """@package Primitive
This module provides an abstraction of the relationGraph using networkX
"""
import networkx as nx
import packages.primitive as primitive
class RelationGraph(object):
def __init__(self,primArray, assignArray):
self.G=nx.Graph()
# First create the nodes
for p ... | """@package Primitive
This module provides an abstraction of the relationGraph using networkX
"""
import networkx as nx
import packages.primitive as primitive
class RelationGraph(object):
def __init__(self,primArray, assignArray):
self.G=nx.Graph()
self.indexedPrimArray = {}
# Fi... | Add add function taking a functor as input to process connected primitives | Add add function taking a functor as input to process connected primitives
| Python | apache-2.0 | amonszpart/globOpt,amonszpart/globOpt,NUAAXXY/globOpt,NUAAXXY/globOpt,amonszpart/globOpt,NUAAXXY/globOpt,amonszpart/globOpt,NUAAXXY/globOpt,NUAAXXY/globOpt,amonszpart/globOpt,NUAAXXY/globOpt,amonszpart/globOpt | """@package Primitive
This module provides an abstraction of the relationGraph using networkX
"""
import networkx as nx
import packages.primitive as primitive
class RelationGraph(object):
def __init__(self,primArray, assignArray):
self.G=nx.Graph()
# First create the nodes
for p ... | """@package Primitive
This module provides an abstraction of the relationGraph using networkX
"""
import networkx as nx
import packages.primitive as primitive
class RelationGraph(object):
def __init__(self,primArray, assignArray):
self.G=nx.Graph()
self.indexedPrimArray = {}
# Fi... | <commit_before>"""@package Primitive
This module provides an abstraction of the relationGraph using networkX
"""
import networkx as nx
import packages.primitive as primitive
class RelationGraph(object):
def __init__(self,primArray, assignArray):
self.G=nx.Graph()
# First create the nodes... | """@package Primitive
This module provides an abstraction of the relationGraph using networkX
"""
import networkx as nx
import packages.primitive as primitive
class RelationGraph(object):
def __init__(self,primArray, assignArray):
self.G=nx.Graph()
self.indexedPrimArray = {}
# Fi... | """@package Primitive
This module provides an abstraction of the relationGraph using networkX
"""
import networkx as nx
import packages.primitive as primitive
class RelationGraph(object):
def __init__(self,primArray, assignArray):
self.G=nx.Graph()
# First create the nodes
for p ... | <commit_before>"""@package Primitive
This module provides an abstraction of the relationGraph using networkX
"""
import networkx as nx
import packages.primitive as primitive
class RelationGraph(object):
def __init__(self,primArray, assignArray):
self.G=nx.Graph()
# First create the nodes... |
12e924cd617811cb763857a9abf14e8b3487f5a1 | ckanext/nhm/routes/bbcm.py | ckanext/nhm/routes/bbcm.py | # !/usr/bin/env python
# encoding: utf-8
#
# This file is part of ckanext-nhm
# Created by the Natural History Museum in London, UK
from flask import Blueprint
from ckan.plugins import toolkit
# bbcm = big butterfly count map :)
# create a flask blueprint with a prefix
blueprint = Blueprint(name=u'big-butterfly-coun... | # !/usr/bin/env python
# encoding: utf-8
#
# This file is part of ckanext-nhm
# Created by the Natural History Museum in London, UK
from flask import Blueprint
from ckan.plugins import toolkit
# bbcm = big butterfly count map :)
# create a flask blueprint
blueprint = Blueprint(name=u'big-butterfly-count-map', import... | Allow the url to be accessed with or without a / on the end | Allow the url to be accessed with or without a / on the end
| Python | mit | NaturalHistoryMuseum/ckanext-nhm,NaturalHistoryMuseum/ckanext-nhm,NaturalHistoryMuseum/ckanext-nhm | # !/usr/bin/env python
# encoding: utf-8
#
# This file is part of ckanext-nhm
# Created by the Natural History Museum in London, UK
from flask import Blueprint
from ckan.plugins import toolkit
# bbcm = big butterfly count map :)
# create a flask blueprint with a prefix
blueprint = Blueprint(name=u'big-butterfly-coun... | # !/usr/bin/env python
# encoding: utf-8
#
# This file is part of ckanext-nhm
# Created by the Natural History Museum in London, UK
from flask import Blueprint
from ckan.plugins import toolkit
# bbcm = big butterfly count map :)
# create a flask blueprint
blueprint = Blueprint(name=u'big-butterfly-count-map', import... | <commit_before># !/usr/bin/env python
# encoding: utf-8
#
# This file is part of ckanext-nhm
# Created by the Natural History Museum in London, UK
from flask import Blueprint
from ckan.plugins import toolkit
# bbcm = big butterfly count map :)
# create a flask blueprint with a prefix
blueprint = Blueprint(name=u'big... | # !/usr/bin/env python
# encoding: utf-8
#
# This file is part of ckanext-nhm
# Created by the Natural History Museum in London, UK
from flask import Blueprint
from ckan.plugins import toolkit
# bbcm = big butterfly count map :)
# create a flask blueprint
blueprint = Blueprint(name=u'big-butterfly-count-map', import... | # !/usr/bin/env python
# encoding: utf-8
#
# This file is part of ckanext-nhm
# Created by the Natural History Museum in London, UK
from flask import Blueprint
from ckan.plugins import toolkit
# bbcm = big butterfly count map :)
# create a flask blueprint with a prefix
blueprint = Blueprint(name=u'big-butterfly-coun... | <commit_before># !/usr/bin/env python
# encoding: utf-8
#
# This file is part of ckanext-nhm
# Created by the Natural History Museum in London, UK
from flask import Blueprint
from ckan.plugins import toolkit
# bbcm = big butterfly count map :)
# create a flask blueprint with a prefix
blueprint = Blueprint(name=u'big... |
7c034802338c78ccb895b7a362e0d4ed11b6b4da | .offlineimap.py | .offlineimap.py | #!/usr/bin/python
import re, os
def get_password_emacs(machine, login, port):
s = "machine %s login %s port %s password ([^ ]*)\n" % (machine, login, port)
p = re.compile(s)
authinfo = os.popen("gpg -q -d ~/.authinfo.gpg").read()
return p.search(authinfo).group(1)
| #!/usr/bin/python
import re, os
def get_password_emacs(machine, login, port):
"""Return password for the given machine/login/port.
Your .authinfo.gpg file had better follow the following order, or
you will not get a result.
"""
s = "machine %s login %s port %s password ([^ ]*)\n" % (machine, logi... | Add a comment for the get_password_emacs function | Add a comment for the get_password_emacs function
Comment necessary because the format of authinfo needs to match the
semi-brittle regex (ah, regexes...)
This also moves the file to a proper dotfile, similar to commit
42f2b513a7949edf901b18233c1229bfcc24b706
| Python | mit | olive42/dotfiles,olive42/dotfiles | #!/usr/bin/python
import re, os
def get_password_emacs(machine, login, port):
s = "machine %s login %s port %s password ([^ ]*)\n" % (machine, login, port)
p = re.compile(s)
authinfo = os.popen("gpg -q -d ~/.authinfo.gpg").read()
return p.search(authinfo).group(1)
Add a comment for the get_password_em... | #!/usr/bin/python
import re, os
def get_password_emacs(machine, login, port):
"""Return password for the given machine/login/port.
Your .authinfo.gpg file had better follow the following order, or
you will not get a result.
"""
s = "machine %s login %s port %s password ([^ ]*)\n" % (machine, logi... | <commit_before>#!/usr/bin/python
import re, os
def get_password_emacs(machine, login, port):
s = "machine %s login %s port %s password ([^ ]*)\n" % (machine, login, port)
p = re.compile(s)
authinfo = os.popen("gpg -q -d ~/.authinfo.gpg").read()
return p.search(authinfo).group(1)
<commit_msg>Add a comm... | #!/usr/bin/python
import re, os
def get_password_emacs(machine, login, port):
"""Return password for the given machine/login/port.
Your .authinfo.gpg file had better follow the following order, or
you will not get a result.
"""
s = "machine %s login %s port %s password ([^ ]*)\n" % (machine, logi... | #!/usr/bin/python
import re, os
def get_password_emacs(machine, login, port):
s = "machine %s login %s port %s password ([^ ]*)\n" % (machine, login, port)
p = re.compile(s)
authinfo = os.popen("gpg -q -d ~/.authinfo.gpg").read()
return p.search(authinfo).group(1)
Add a comment for the get_password_em... | <commit_before>#!/usr/bin/python
import re, os
def get_password_emacs(machine, login, port):
s = "machine %s login %s port %s password ([^ ]*)\n" % (machine, login, port)
p = re.compile(s)
authinfo = os.popen("gpg -q -d ~/.authinfo.gpg").read()
return p.search(authinfo).group(1)
<commit_msg>Add a comm... |
e79010f0aedf6f832ef14a72f435ddba33068e35 | kindergarten-garden/kindergarten_garden.py | kindergarten-garden/kindergarten_garden.py | CHILDREN = ["Alice", "Bob", "Charlie", "David", "Eve", "Fred",
"Ginny", "Harriet", "Ileana", "Joseph", "Kincaid", "Larry"]
PLANTS = {"C": "Clover", "G": "Grass", "R": "Radishes", "V": "Violets"}
class Garden(object):
def __init__(self, garden, students=CHILDREN):
self.students = sorted(student... | CHILDREN = ["Alice", "Bob", "Charlie", "David", "Eve", "Fred",
"Ginny", "Harriet", "Ileana", "Joseph", "Kincaid", "Larry"]
PLANTS = {"C": "Clover", "G": "Grass", "R": "Radishes", "V": "Violets"}
class Garden(object):
def __init__(self, garden, students=CHILDREN):
self.students = sorted(student... | Use unpacking for simpler code | Use unpacking for simpler code
| Python | agpl-3.0 | CubicComet/exercism-python-solutions | CHILDREN = ["Alice", "Bob", "Charlie", "David", "Eve", "Fred",
"Ginny", "Harriet", "Ileana", "Joseph", "Kincaid", "Larry"]
PLANTS = {"C": "Clover", "G": "Grass", "R": "Radishes", "V": "Violets"}
class Garden(object):
def __init__(self, garden, students=CHILDREN):
self.students = sorted(student... | CHILDREN = ["Alice", "Bob", "Charlie", "David", "Eve", "Fred",
"Ginny", "Harriet", "Ileana", "Joseph", "Kincaid", "Larry"]
PLANTS = {"C": "Clover", "G": "Grass", "R": "Radishes", "V": "Violets"}
class Garden(object):
def __init__(self, garden, students=CHILDREN):
self.students = sorted(student... | <commit_before>CHILDREN = ["Alice", "Bob", "Charlie", "David", "Eve", "Fred",
"Ginny", "Harriet", "Ileana", "Joseph", "Kincaid", "Larry"]
PLANTS = {"C": "Clover", "G": "Grass", "R": "Radishes", "V": "Violets"}
class Garden(object):
def __init__(self, garden, students=CHILDREN):
self.students =... | CHILDREN = ["Alice", "Bob", "Charlie", "David", "Eve", "Fred",
"Ginny", "Harriet", "Ileana", "Joseph", "Kincaid", "Larry"]
PLANTS = {"C": "Clover", "G": "Grass", "R": "Radishes", "V": "Violets"}
class Garden(object):
def __init__(self, garden, students=CHILDREN):
self.students = sorted(student... | CHILDREN = ["Alice", "Bob", "Charlie", "David", "Eve", "Fred",
"Ginny", "Harriet", "Ileana", "Joseph", "Kincaid", "Larry"]
PLANTS = {"C": "Clover", "G": "Grass", "R": "Radishes", "V": "Violets"}
class Garden(object):
def __init__(self, garden, students=CHILDREN):
self.students = sorted(student... | <commit_before>CHILDREN = ["Alice", "Bob", "Charlie", "David", "Eve", "Fred",
"Ginny", "Harriet", "Ileana", "Joseph", "Kincaid", "Larry"]
PLANTS = {"C": "Clover", "G": "Grass", "R": "Radishes", "V": "Violets"}
class Garden(object):
def __init__(self, garden, students=CHILDREN):
self.students =... |
e01d45e3ee39023814bca75b1344477e42865b0b | ds_max_priority_queue.py | ds_max_priority_queue.py | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
class MaxPriorityQueue(object):
"""Max Priority Queue."""
def __init__(self):
pass
def main():
pass
if __name__ == '__main__':
main()
| from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
def parent(i):
return i // 2
def left(i):
return 2 * i
def right(i):
return 2 * i + 1
class MaxPriorityQueue(object):
"""Max Priority Queue."""
def __init__(self):
pass
def main():
pass
... | Add parent(), left() & right() | Add parent(), left() & right()
| Python | bsd-2-clause | bowen0701/algorithms_data_structures | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
class MaxPriorityQueue(object):
"""Max Priority Queue."""
def __init__(self):
pass
def main():
pass
if __name__ == '__main__':
main()
Add parent(), left() & right() | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
def parent(i):
return i // 2
def left(i):
return 2 * i
def right(i):
return 2 * i + 1
class MaxPriorityQueue(object):
"""Max Priority Queue."""
def __init__(self):
pass
def main():
pass
... | <commit_before>from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
class MaxPriorityQueue(object):
"""Max Priority Queue."""
def __init__(self):
pass
def main():
pass
if __name__ == '__main__':
main()
<commit_msg>Add parent(), left() & right()<commit_... | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
def parent(i):
return i // 2
def left(i):
return 2 * i
def right(i):
return 2 * i + 1
class MaxPriorityQueue(object):
"""Max Priority Queue."""
def __init__(self):
pass
def main():
pass
... | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
class MaxPriorityQueue(object):
"""Max Priority Queue."""
def __init__(self):
pass
def main():
pass
if __name__ == '__main__':
main()
Add parent(), left() & right()from __future__ import absolute_imp... | <commit_before>from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
class MaxPriorityQueue(object):
"""Max Priority Queue."""
def __init__(self):
pass
def main():
pass
if __name__ == '__main__':
main()
<commit_msg>Add parent(), left() & right()<commit_... |
e3425433db1a60a598f39b85cd438a0ef0659f87 | bhpssh.py | bhpssh.py | #!/ usr/bin/python
#Black Hat Python
#SSH with Paramiko
#pg 26
import threading, paramiko, subprocess
def ssh_command(ip, user, passwd, command):
client = paramiko.SSHClient()
#client.load_host_keys('/home/justin/.ssh/known_hosts')
client.set_missing_host_key_policy(paramoko.AutoAddPolicy())
client.connect(ip, ... | #!/ usr/bin/python
#Black Hat Python SSH with Paramiko pg 26
#TODO: ADD FUNCTIONS AND ARGUMENTS, AND DONT FORGET TO DEBUG.
import threading, paramiko, subprocess
def ssh_command(ip, user, passwd, command):
client = paramiko.SSHClient()
#client.load_host_keys('/home/justin/.ssh/known_hosts')
client.set_missing_ho... | ADD FUNCTIONS AND ARGUMENTS. YOU'LL PROBABLY NEED TO DEBUG | TODO: ADD FUNCTIONS AND ARGUMENTS. YOU'LL PROBABLY NEED TO DEBUG
| Python | mit | n1cfury/BlackHatPython | #!/ usr/bin/python
#Black Hat Python
#SSH with Paramiko
#pg 26
import threading, paramiko, subprocess
def ssh_command(ip, user, passwd, command):
client = paramiko.SSHClient()
#client.load_host_keys('/home/justin/.ssh/known_hosts')
client.set_missing_host_key_policy(paramoko.AutoAddPolicy())
client.connect(ip, ... | #!/ usr/bin/python
#Black Hat Python SSH with Paramiko pg 26
#TODO: ADD FUNCTIONS AND ARGUMENTS, AND DONT FORGET TO DEBUG.
import threading, paramiko, subprocess
def ssh_command(ip, user, passwd, command):
client = paramiko.SSHClient()
#client.load_host_keys('/home/justin/.ssh/known_hosts')
client.set_missing_ho... | <commit_before> #!/ usr/bin/python
#Black Hat Python
#SSH with Paramiko
#pg 26
import threading, paramiko, subprocess
def ssh_command(ip, user, passwd, command):
client = paramiko.SSHClient()
#client.load_host_keys('/home/justin/.ssh/known_hosts')
client.set_missing_host_key_policy(paramoko.AutoAddPolicy())
clie... | #!/ usr/bin/python
#Black Hat Python SSH with Paramiko pg 26
#TODO: ADD FUNCTIONS AND ARGUMENTS, AND DONT FORGET TO DEBUG.
import threading, paramiko, subprocess
def ssh_command(ip, user, passwd, command):
client = paramiko.SSHClient()
#client.load_host_keys('/home/justin/.ssh/known_hosts')
client.set_missing_ho... | #!/ usr/bin/python
#Black Hat Python
#SSH with Paramiko
#pg 26
import threading, paramiko, subprocess
def ssh_command(ip, user, passwd, command):
client = paramiko.SSHClient()
#client.load_host_keys('/home/justin/.ssh/known_hosts')
client.set_missing_host_key_policy(paramoko.AutoAddPolicy())
client.connect(ip, ... | <commit_before> #!/ usr/bin/python
#Black Hat Python
#SSH with Paramiko
#pg 26
import threading, paramiko, subprocess
def ssh_command(ip, user, passwd, command):
client = paramiko.SSHClient()
#client.load_host_keys('/home/justin/.ssh/known_hosts')
client.set_missing_host_key_policy(paramoko.AutoAddPolicy())
clie... |
73d59df8b94f72e83b978c00518afa01967faac9 | mle/test_package.py | mle/test_package.py | def test_distribution():
from mle import Normal, var, par
import theano.tensor as T
x = var('x')
mu = par('mu')
sigma = par('sigma')
dist = Normal(x, mu, sigma)
assert(len(dist.get_vars()) == 1)
assert(len(dist.get_params()) == 2)
assert(len(dist.get_dists()) == 0)
|
def test_formula_transform():
"""
Check if variables can be added/multiplied/transformed.
The result should be a formula that can be plugged into a model.
"""
from mle import var, par
x = var('x')
a = par('a')
b = par('b')
formula = a * x**2 + b
def test_simple_fit():
"""
... | Add some tests that don't pass yet | Add some tests that don't pass yet
| Python | mit | ibab/python-mle | def test_distribution():
from mle import Normal, var, par
import theano.tensor as T
x = var('x')
mu = par('mu')
sigma = par('sigma')
dist = Normal(x, mu, sigma)
assert(len(dist.get_vars()) == 1)
assert(len(dist.get_params()) == 2)
assert(len(dist.get_dists()) == 0)
Add some tests ... |
def test_formula_transform():
"""
Check if variables can be added/multiplied/transformed.
The result should be a formula that can be plugged into a model.
"""
from mle import var, par
x = var('x')
a = par('a')
b = par('b')
formula = a * x**2 + b
def test_simple_fit():
"""
... | <commit_before>def test_distribution():
from mle import Normal, var, par
import theano.tensor as T
x = var('x')
mu = par('mu')
sigma = par('sigma')
dist = Normal(x, mu, sigma)
assert(len(dist.get_vars()) == 1)
assert(len(dist.get_params()) == 2)
assert(len(dist.get_dists()) == 0)
... |
def test_formula_transform():
"""
Check if variables can be added/multiplied/transformed.
The result should be a formula that can be plugged into a model.
"""
from mle import var, par
x = var('x')
a = par('a')
b = par('b')
formula = a * x**2 + b
def test_simple_fit():
"""
... | def test_distribution():
from mle import Normal, var, par
import theano.tensor as T
x = var('x')
mu = par('mu')
sigma = par('sigma')
dist = Normal(x, mu, sigma)
assert(len(dist.get_vars()) == 1)
assert(len(dist.get_params()) == 2)
assert(len(dist.get_dists()) == 0)
Add some tests ... | <commit_before>def test_distribution():
from mle import Normal, var, par
import theano.tensor as T
x = var('x')
mu = par('mu')
sigma = par('sigma')
dist = Normal(x, mu, sigma)
assert(len(dist.get_vars()) == 1)
assert(len(dist.get_params()) == 2)
assert(len(dist.get_dists()) == 0)
... |
17db6b7a7236abdc5199a40f98e4862724929c38 | conanfile.py | conanfile.py | from conans import ConanFile
from conans.tools import download, unzip
import os
VERSION = "0.0.6"
class ToolingCMakeUtilConan(ConanFile):
name = "tooling-cmake-util"
version = os.environ.get("CONAN_VERSION_OVERRIDE", VERSION)
generators = "cmake"
requires = ("cmake-include-guard/master@smspillaz/cmak... | from conans import ConanFile
from conans.tools import download, unzip
import os
VERSION = "0.0.7"
class ToolingCMakeUtilConan(ConanFile):
name = "tooling-cmake-util"
version = os.environ.get("CONAN_VERSION_OVERRIDE", VERSION)
generators = "cmake"
requires = ("cmake-include-guard/master@smspillaz/cmak... | Bump version: 0.0.6 -> 0.0.7 | Bump version: 0.0.6 -> 0.0.7
[ci skip]
| Python | mit | polysquare/tooling-cmake-util,polysquare/tooling-cmake-util | from conans import ConanFile
from conans.tools import download, unzip
import os
VERSION = "0.0.6"
class ToolingCMakeUtilConan(ConanFile):
name = "tooling-cmake-util"
version = os.environ.get("CONAN_VERSION_OVERRIDE", VERSION)
generators = "cmake"
requires = ("cmake-include-guard/master@smspillaz/cmak... | from conans import ConanFile
from conans.tools import download, unzip
import os
VERSION = "0.0.7"
class ToolingCMakeUtilConan(ConanFile):
name = "tooling-cmake-util"
version = os.environ.get("CONAN_VERSION_OVERRIDE", VERSION)
generators = "cmake"
requires = ("cmake-include-guard/master@smspillaz/cmak... | <commit_before>from conans import ConanFile
from conans.tools import download, unzip
import os
VERSION = "0.0.6"
class ToolingCMakeUtilConan(ConanFile):
name = "tooling-cmake-util"
version = os.environ.get("CONAN_VERSION_OVERRIDE", VERSION)
generators = "cmake"
requires = ("cmake-include-guard/master... | from conans import ConanFile
from conans.tools import download, unzip
import os
VERSION = "0.0.7"
class ToolingCMakeUtilConan(ConanFile):
name = "tooling-cmake-util"
version = os.environ.get("CONAN_VERSION_OVERRIDE", VERSION)
generators = "cmake"
requires = ("cmake-include-guard/master@smspillaz/cmak... | from conans import ConanFile
from conans.tools import download, unzip
import os
VERSION = "0.0.6"
class ToolingCMakeUtilConan(ConanFile):
name = "tooling-cmake-util"
version = os.environ.get("CONAN_VERSION_OVERRIDE", VERSION)
generators = "cmake"
requires = ("cmake-include-guard/master@smspillaz/cmak... | <commit_before>from conans import ConanFile
from conans.tools import download, unzip
import os
VERSION = "0.0.6"
class ToolingCMakeUtilConan(ConanFile):
name = "tooling-cmake-util"
version = os.environ.get("CONAN_VERSION_OVERRIDE", VERSION)
generators = "cmake"
requires = ("cmake-include-guard/master... |
e3c6b5ce00502077f56ea7033132356ff88a1a55 | app/soc/mapreduce/gci_insert_dummy_data.py | app/soc/mapreduce/gci_insert_dummy_data.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... | # 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... | Replace "lambda blob: blob" with "bool". | Replace "lambda blob: blob" with "bool".
This is legitimate (and even an improvement) since the function is
passed to filter, which will use its return value in a boolean
context anyway.
This also cleans up a lint warning.
| Python | apache-2.0 | rhyolight/nupic.son,rhyolight/nupic.son,rhyolight/nupic.son | # 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... | # 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># 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 ... | # 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... | # 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># 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 ... |
21d45c0830f9634beb04dcbc05b43ae77780a713 | examples/explicit_serializer.py | examples/explicit_serializer.py | import time
from osbrain import run_nameserver
from osbrain import run_agent
# Simple handler for example purposes
def set_received(agent, message, topic=None):
agent.received = message
if __name__ == '__main__':
# System deployment
run_nameserver()
a0 = run_agent('a0')
a1 = run_agent('a1')
... | import time
from osbrain import run_nameserver
from osbrain import run_agent
# Simple handler for example purposes
def set_received(agent, message, topic=None):
agent.received = message
if __name__ == '__main__':
# System deployment
run_nameserver()
a0 = run_agent('a0')
a1 = run_agent('a1')
... | Add line at the end of example | Add line at the end of example
| Python | apache-2.0 | opensistemas-hub/osbrain | import time
from osbrain import run_nameserver
from osbrain import run_agent
# Simple handler for example purposes
def set_received(agent, message, topic=None):
agent.received = message
if __name__ == '__main__':
# System deployment
run_nameserver()
a0 = run_agent('a0')
a1 = run_agent('a1')
... | import time
from osbrain import run_nameserver
from osbrain import run_agent
# Simple handler for example purposes
def set_received(agent, message, topic=None):
agent.received = message
if __name__ == '__main__':
# System deployment
run_nameserver()
a0 = run_agent('a0')
a1 = run_agent('a1')
... | <commit_before>import time
from osbrain import run_nameserver
from osbrain import run_agent
# Simple handler for example purposes
def set_received(agent, message, topic=None):
agent.received = message
if __name__ == '__main__':
# System deployment
run_nameserver()
a0 = run_agent('a0')
a1 = run_... | import time
from osbrain import run_nameserver
from osbrain import run_agent
# Simple handler for example purposes
def set_received(agent, message, topic=None):
agent.received = message
if __name__ == '__main__':
# System deployment
run_nameserver()
a0 = run_agent('a0')
a1 = run_agent('a1')
... | import time
from osbrain import run_nameserver
from osbrain import run_agent
# Simple handler for example purposes
def set_received(agent, message, topic=None):
agent.received = message
if __name__ == '__main__':
# System deployment
run_nameserver()
a0 = run_agent('a0')
a1 = run_agent('a1')
... | <commit_before>import time
from osbrain import run_nameserver
from osbrain import run_agent
# Simple handler for example purposes
def set_received(agent, message, topic=None):
agent.received = message
if __name__ == '__main__':
# System deployment
run_nameserver()
a0 = run_agent('a0')
a1 = run_... |
593fb7d6db4a5fe35a80fcad300eb43bb93ba3bb | social_core/tests/backends/test_udata.py | social_core/tests/backends/test_udata.py | import json
from six.moves.urllib_parse import urlencode
from .oauth import OAuth2Test
class DatagouvfrOAuth2Test(OAuth2Test):
backend_path = 'social_core.backends.udata.DatagouvfrOAuth2'
user_data_url = 'https://www.data.gouv.fr/api/1/me/'
expected_username = 'foobar'
access_token_body = json.dumps... | import json
from six.moves.urllib_parse import urlencode
from .oauth import OAuth2Test
class DatagouvfrOAuth2Test(OAuth2Test):
backend_path = 'social_core.backends.udata.DatagouvfrOAuth2'
user_data_url = 'https://www.data.gouv.fr/api/1/me/'
expected_username = 'foobar'
access_token_body = json.dumps... | Fix tests for udata/datagouvfr backend | Fix tests for udata/datagouvfr backend
| Python | bsd-3-clause | python-social-auth/social-core,python-social-auth/social-core | import json
from six.moves.urllib_parse import urlencode
from .oauth import OAuth2Test
class DatagouvfrOAuth2Test(OAuth2Test):
backend_path = 'social_core.backends.udata.DatagouvfrOAuth2'
user_data_url = 'https://www.data.gouv.fr/api/1/me/'
expected_username = 'foobar'
access_token_body = json.dumps... | import json
from six.moves.urllib_parse import urlencode
from .oauth import OAuth2Test
class DatagouvfrOAuth2Test(OAuth2Test):
backend_path = 'social_core.backends.udata.DatagouvfrOAuth2'
user_data_url = 'https://www.data.gouv.fr/api/1/me/'
expected_username = 'foobar'
access_token_body = json.dumps... | <commit_before>import json
from six.moves.urllib_parse import urlencode
from .oauth import OAuth2Test
class DatagouvfrOAuth2Test(OAuth2Test):
backend_path = 'social_core.backends.udata.DatagouvfrOAuth2'
user_data_url = 'https://www.data.gouv.fr/api/1/me/'
expected_username = 'foobar'
access_token_bo... | import json
from six.moves.urllib_parse import urlencode
from .oauth import OAuth2Test
class DatagouvfrOAuth2Test(OAuth2Test):
backend_path = 'social_core.backends.udata.DatagouvfrOAuth2'
user_data_url = 'https://www.data.gouv.fr/api/1/me/'
expected_username = 'foobar'
access_token_body = json.dumps... | import json
from six.moves.urllib_parse import urlencode
from .oauth import OAuth2Test
class DatagouvfrOAuth2Test(OAuth2Test):
backend_path = 'social_core.backends.udata.DatagouvfrOAuth2'
user_data_url = 'https://www.data.gouv.fr/api/1/me/'
expected_username = 'foobar'
access_token_body = json.dumps... | <commit_before>import json
from six.moves.urllib_parse import urlencode
from .oauth import OAuth2Test
class DatagouvfrOAuth2Test(OAuth2Test):
backend_path = 'social_core.backends.udata.DatagouvfrOAuth2'
user_data_url = 'https://www.data.gouv.fr/api/1/me/'
expected_username = 'foobar'
access_token_bo... |
55cd1bc079017945c2b8f48542c491d6a7d5153f | tests/test_cl_json.py | tests/test_cl_json.py | from kqml import cl_json, KQMLList
def test_parse():
json_dict = {'a': 1, 'b': 2,
'c': ['foo', {'bar': None, 'done': False}],
'this_is_json': True}
res = cl_json._cl_from_json(json_dict)
assert isinstance(res, KQMLList)
assert len(res) == 2*len(json_dict.keys())
b... | from kqml import cl_json, KQMLList
def _equal(json_val, back_json_val):
if json_val is False and back_json_val is None:
return True
if type(json_val) != type(back_json_val):
return False
if isinstance(json_val, dict):
ret = True
for key, value in json_val.items():
... | Write deeper test of equality for recovered dict. | Write deeper test of equality for recovered dict.
| Python | bsd-2-clause | bgyori/pykqml | from kqml import cl_json, KQMLList
def test_parse():
json_dict = {'a': 1, 'b': 2,
'c': ['foo', {'bar': None, 'done': False}],
'this_is_json': True}
res = cl_json._cl_from_json(json_dict)
assert isinstance(res, KQMLList)
assert len(res) == 2*len(json_dict.keys())
b... | from kqml import cl_json, KQMLList
def _equal(json_val, back_json_val):
if json_val is False and back_json_val is None:
return True
if type(json_val) != type(back_json_val):
return False
if isinstance(json_val, dict):
ret = True
for key, value in json_val.items():
... | <commit_before>from kqml import cl_json, KQMLList
def test_parse():
json_dict = {'a': 1, 'b': 2,
'c': ['foo', {'bar': None, 'done': False}],
'this_is_json': True}
res = cl_json._cl_from_json(json_dict)
assert isinstance(res, KQMLList)
assert len(res) == 2*len(json_dic... | from kqml import cl_json, KQMLList
def _equal(json_val, back_json_val):
if json_val is False and back_json_val is None:
return True
if type(json_val) != type(back_json_val):
return False
if isinstance(json_val, dict):
ret = True
for key, value in json_val.items():
... | from kqml import cl_json, KQMLList
def test_parse():
json_dict = {'a': 1, 'b': 2,
'c': ['foo', {'bar': None, 'done': False}],
'this_is_json': True}
res = cl_json._cl_from_json(json_dict)
assert isinstance(res, KQMLList)
assert len(res) == 2*len(json_dict.keys())
b... | <commit_before>from kqml import cl_json, KQMLList
def test_parse():
json_dict = {'a': 1, 'b': 2,
'c': ['foo', {'bar': None, 'done': False}],
'this_is_json': True}
res = cl_json._cl_from_json(json_dict)
assert isinstance(res, KQMLList)
assert len(res) == 2*len(json_dic... |
6dd546d97710c99201af17c19e0f48a8c4702f72 | tests/test_patspec.py | tests/test_patspec.py | import pymorph
import numpy as np
def test_patspec():
f = np.array([
[0,0,0,0,0,0,0,0],
[0,0,1,1,1,1,0,0],
[0,1,0,1,1,1,0,0],
[0,0,1,1,1,1,0,0],
[1,1,0,0,0,0,0,0]], bool)
assert pymorph.patspec(f).sum() == (f > 0).sum()
| import pymorph
import numpy as np
def test_patspec():
f = np.array([
[0,0,0,0,0,0,0,0],
[0,0,1,1,1,1,0,0],
[0,1,0,1,1,1,0,0],
[0,0,1,1,1,1,0,0],
[1,1,0,0,0,0,0,0]], bool)
assert pymorph.patspec(f).sum() == (f > 0).sum()
def test_linear_h():
f = np.arange(9).reshape((... | Test case for newly reported bug | TST: Test case for newly reported bug
This was reported by Alexandre Harano.
| Python | bsd-3-clause | luispedro/pymorph | import pymorph
import numpy as np
def test_patspec():
f = np.array([
[0,0,0,0,0,0,0,0],
[0,0,1,1,1,1,0,0],
[0,1,0,1,1,1,0,0],
[0,0,1,1,1,1,0,0],
[1,1,0,0,0,0,0,0]], bool)
assert pymorph.patspec(f).sum() == (f > 0).sum()
TST: Test case for newly reported bug
This was rep... | import pymorph
import numpy as np
def test_patspec():
f = np.array([
[0,0,0,0,0,0,0,0],
[0,0,1,1,1,1,0,0],
[0,1,0,1,1,1,0,0],
[0,0,1,1,1,1,0,0],
[1,1,0,0,0,0,0,0]], bool)
assert pymorph.patspec(f).sum() == (f > 0).sum()
def test_linear_h():
f = np.arange(9).reshape((... | <commit_before>import pymorph
import numpy as np
def test_patspec():
f = np.array([
[0,0,0,0,0,0,0,0],
[0,0,1,1,1,1,0,0],
[0,1,0,1,1,1,0,0],
[0,0,1,1,1,1,0,0],
[1,1,0,0,0,0,0,0]], bool)
assert pymorph.patspec(f).sum() == (f > 0).sum()
<commit_msg>TST: Test case for newly... | import pymorph
import numpy as np
def test_patspec():
f = np.array([
[0,0,0,0,0,0,0,0],
[0,0,1,1,1,1,0,0],
[0,1,0,1,1,1,0,0],
[0,0,1,1,1,1,0,0],
[1,1,0,0,0,0,0,0]], bool)
assert pymorph.patspec(f).sum() == (f > 0).sum()
def test_linear_h():
f = np.arange(9).reshape((... | import pymorph
import numpy as np
def test_patspec():
f = np.array([
[0,0,0,0,0,0,0,0],
[0,0,1,1,1,1,0,0],
[0,1,0,1,1,1,0,0],
[0,0,1,1,1,1,0,0],
[1,1,0,0,0,0,0,0]], bool)
assert pymorph.patspec(f).sum() == (f > 0).sum()
TST: Test case for newly reported bug
This was rep... | <commit_before>import pymorph
import numpy as np
def test_patspec():
f = np.array([
[0,0,0,0,0,0,0,0],
[0,0,1,1,1,1,0,0],
[0,1,0,1,1,1,0,0],
[0,0,1,1,1,1,0,0],
[1,1,0,0,0,0,0,0]], bool)
assert pymorph.patspec(f).sum() == (f > 0).sum()
<commit_msg>TST: Test case for newly... |
d971fbb4dc3b69e012b212cd54b6e8511571e1f5 | graphene/core/classtypes/uniontype.py | graphene/core/classtypes/uniontype.py | import six
from graphql.core.type import GraphQLUnionType
from .base import FieldsClassType, FieldsClassTypeMeta, FieldsOptions
class UnionTypeOptions(FieldsOptions):
def __init__(self, *args, **kwargs):
super(UnionTypeOptions, self).__init__(*args, **kwargs)
self.types = []
class UnionTypeMet... | from functools import partial
import six
from graphql.core.type import GraphQLUnionType
from .base import FieldsClassType, FieldsClassTypeMeta, FieldsOptions
class UnionTypeOptions(FieldsOptions):
def __init__(self, *args, **kwargs):
super(UnionTypeOptions, self).__init__(*args, **kwargs)
self.... | Update to use partial instead of lambda function | Update to use partial instead of lambda function | Python | mit | sjhewitt/graphene,graphql-python/graphene,sjhewitt/graphene,Globegitter/graphene,graphql-python/graphene,Globegitter/graphene | import six
from graphql.core.type import GraphQLUnionType
from .base import FieldsClassType, FieldsClassTypeMeta, FieldsOptions
class UnionTypeOptions(FieldsOptions):
def __init__(self, *args, **kwargs):
super(UnionTypeOptions, self).__init__(*args, **kwargs)
self.types = []
class UnionTypeMet... | from functools import partial
import six
from graphql.core.type import GraphQLUnionType
from .base import FieldsClassType, FieldsClassTypeMeta, FieldsOptions
class UnionTypeOptions(FieldsOptions):
def __init__(self, *args, **kwargs):
super(UnionTypeOptions, self).__init__(*args, **kwargs)
self.... | <commit_before>import six
from graphql.core.type import GraphQLUnionType
from .base import FieldsClassType, FieldsClassTypeMeta, FieldsOptions
class UnionTypeOptions(FieldsOptions):
def __init__(self, *args, **kwargs):
super(UnionTypeOptions, self).__init__(*args, **kwargs)
self.types = []
cla... | from functools import partial
import six
from graphql.core.type import GraphQLUnionType
from .base import FieldsClassType, FieldsClassTypeMeta, FieldsOptions
class UnionTypeOptions(FieldsOptions):
def __init__(self, *args, **kwargs):
super(UnionTypeOptions, self).__init__(*args, **kwargs)
self.... | import six
from graphql.core.type import GraphQLUnionType
from .base import FieldsClassType, FieldsClassTypeMeta, FieldsOptions
class UnionTypeOptions(FieldsOptions):
def __init__(self, *args, **kwargs):
super(UnionTypeOptions, self).__init__(*args, **kwargs)
self.types = []
class UnionTypeMet... | <commit_before>import six
from graphql.core.type import GraphQLUnionType
from .base import FieldsClassType, FieldsClassTypeMeta, FieldsOptions
class UnionTypeOptions(FieldsOptions):
def __init__(self, *args, **kwargs):
super(UnionTypeOptions, self).__init__(*args, **kwargs)
self.types = []
cla... |
068d44af407da3835bc96717700bd174480060ec | apps/maps/json_view.py | apps/maps/json_view.py |
from django.core.serializers.json import DjangoJSONEncoder
from django.views.decorators.cache import cache_page
from django.views.generic import View
from django.http import JsonResponse, HttpResponse
from django.conf import settings
class DjangoJSONEncoder2(DjangoJSONEncoder):
"""A json encoder to deal with th... |
from datetime import timedelta
from django.core.serializers.json import DjangoJSONEncoder
from django.db.models.query import ValuesQuerySet
from django.views.decorators.cache import cache_page
from django.views.generic import View
from django.http import JsonResponse, HttpResponse
from django.conf import settings
c... | Allow querysets to be jsonified | Allow querysets to be jsonified
| Python | agpl-3.0 | IQSS/gentb-site,IQSS/gentb-site,IQSS/gentb-site,IQSS/gentb-site,IQSS/gentb-site,IQSS/gentb-site,IQSS/gentb-site,IQSS/gentb-site |
from django.core.serializers.json import DjangoJSONEncoder
from django.views.decorators.cache import cache_page
from django.views.generic import View
from django.http import JsonResponse, HttpResponse
from django.conf import settings
class DjangoJSONEncoder2(DjangoJSONEncoder):
"""A json encoder to deal with th... |
from datetime import timedelta
from django.core.serializers.json import DjangoJSONEncoder
from django.db.models.query import ValuesQuerySet
from django.views.decorators.cache import cache_page
from django.views.generic import View
from django.http import JsonResponse, HttpResponse
from django.conf import settings
c... | <commit_before>
from django.core.serializers.json import DjangoJSONEncoder
from django.views.decorators.cache import cache_page
from django.views.generic import View
from django.http import JsonResponse, HttpResponse
from django.conf import settings
class DjangoJSONEncoder2(DjangoJSONEncoder):
"""A json encoder ... |
from datetime import timedelta
from django.core.serializers.json import DjangoJSONEncoder
from django.db.models.query import ValuesQuerySet
from django.views.decorators.cache import cache_page
from django.views.generic import View
from django.http import JsonResponse, HttpResponse
from django.conf import settings
c... |
from django.core.serializers.json import DjangoJSONEncoder
from django.views.decorators.cache import cache_page
from django.views.generic import View
from django.http import JsonResponse, HttpResponse
from django.conf import settings
class DjangoJSONEncoder2(DjangoJSONEncoder):
"""A json encoder to deal with th... | <commit_before>
from django.core.serializers.json import DjangoJSONEncoder
from django.views.decorators.cache import cache_page
from django.views.generic import View
from django.http import JsonResponse, HttpResponse
from django.conf import settings
class DjangoJSONEncoder2(DjangoJSONEncoder):
"""A json encoder ... |
134fb48961a03bc17b34154b54875b543f1f27b8 | legcoscraper/scripts/report-summary.py | legcoscraper/scripts/report-summary.py | #!/usr/bin/env python
#
# Give a quick summary of data which has been retrieved
#
import argparse
import json
from collections import Counter
from pprint import pprint
parser = argparse.ArgumentParser()
parser.add_argument("json_file", type=str, help="JSON data file from scraper")
args = parser.parse_args()
type_cou... | #!/usr/bin/env python
#
# Give a quick summary of data which has been retrieved
#
import argparse
import json
from collections import Counter
from pprint import pprint
import re
parser = argparse.ArgumentParser()
parser.add_argument("json_file", type=str, help="JSON data file from scraper")
args = parser.parse_args()... | Print count summaries for Hansard by year | Print count summaries for Hansard by year
| Python | mit | comsaint/legco-watch,legco-watch/legco-watch,comsaint/legco-watch,legco-watch/legco-watch,legco-watch/legco-watch,comsaint/legco-watch,comsaint/legco-watch,legco-watch/legco-watch | #!/usr/bin/env python
#
# Give a quick summary of data which has been retrieved
#
import argparse
import json
from collections import Counter
from pprint import pprint
parser = argparse.ArgumentParser()
parser.add_argument("json_file", type=str, help="JSON data file from scraper")
args = parser.parse_args()
type_cou... | #!/usr/bin/env python
#
# Give a quick summary of data which has been retrieved
#
import argparse
import json
from collections import Counter
from pprint import pprint
import re
parser = argparse.ArgumentParser()
parser.add_argument("json_file", type=str, help="JSON data file from scraper")
args = parser.parse_args()... | <commit_before>#!/usr/bin/env python
#
# Give a quick summary of data which has been retrieved
#
import argparse
import json
from collections import Counter
from pprint import pprint
parser = argparse.ArgumentParser()
parser.add_argument("json_file", type=str, help="JSON data file from scraper")
args = parser.parse_a... | #!/usr/bin/env python
#
# Give a quick summary of data which has been retrieved
#
import argparse
import json
from collections import Counter
from pprint import pprint
import re
parser = argparse.ArgumentParser()
parser.add_argument("json_file", type=str, help="JSON data file from scraper")
args = parser.parse_args()... | #!/usr/bin/env python
#
# Give a quick summary of data which has been retrieved
#
import argparse
import json
from collections import Counter
from pprint import pprint
parser = argparse.ArgumentParser()
parser.add_argument("json_file", type=str, help="JSON data file from scraper")
args = parser.parse_args()
type_cou... | <commit_before>#!/usr/bin/env python
#
# Give a quick summary of data which has been retrieved
#
import argparse
import json
from collections import Counter
from pprint import pprint
parser = argparse.ArgumentParser()
parser.add_argument("json_file", type=str, help="JSON data file from scraper")
args = parser.parse_a... |
b6c44fb951950c72e09004b4478e497e8dcfa2b0 | mysite/urls.py | mysite/urls.py | from django.conf.urls.defaults import *
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
(r'^search/$', 'mysite.search.views.index'),
(r'^search/query/(?P<query>\w+)/$', 'mysite.search.views.query'),
(r'^search/query_json/... | from django.conf.urls.defaults import *
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
(r'^search/$', 'mysite.search.views.index'),
# (r'^search/query/(?P<query>\w+)/$', 'mysite.search.views.query'),
# (r'^search/query_json... | Disable broken ("for now") views | Disable broken ("for now") views
| Python | agpl-3.0 | campbe13/openhatch,eeshangarg/oh-mainline,waseem18/oh-mainline,campbe13/openhatch,ojengwa/oh-mainline,heeraj123/oh-mainline,waseem18/oh-mainline,willingc/oh-mainline,eeshangarg/oh-mainline,SnappleCap/oh-mainline,ojengwa/oh-mainline,onceuponatimeforever/oh-mainline,mzdaniel/oh-mainline,SnappleCap/oh-mainline,jledbetter/... | from django.conf.urls.defaults import *
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
(r'^search/$', 'mysite.search.views.index'),
(r'^search/query/(?P<query>\w+)/$', 'mysite.search.views.query'),
(r'^search/query_json/... | from django.conf.urls.defaults import *
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
(r'^search/$', 'mysite.search.views.index'),
# (r'^search/query/(?P<query>\w+)/$', 'mysite.search.views.query'),
# (r'^search/query_json... | <commit_before>from django.conf.urls.defaults import *
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
(r'^search/$', 'mysite.search.views.index'),
(r'^search/query/(?P<query>\w+)/$', 'mysite.search.views.query'),
(r'^sea... | from django.conf.urls.defaults import *
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
(r'^search/$', 'mysite.search.views.index'),
# (r'^search/query/(?P<query>\w+)/$', 'mysite.search.views.query'),
# (r'^search/query_json... | from django.conf.urls.defaults import *
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
(r'^search/$', 'mysite.search.views.index'),
(r'^search/query/(?P<query>\w+)/$', 'mysite.search.views.query'),
(r'^search/query_json/... | <commit_before>from django.conf.urls.defaults import *
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
(r'^search/$', 'mysite.search.views.index'),
(r'^search/query/(?P<query>\w+)/$', 'mysite.search.views.query'),
(r'^sea... |
87cbd9f4a69cb4895dc7baec84e9c1044d4b6ad4 | bridge/mavlink-zmq-bridge.py | bridge/mavlink-zmq-bridge.py | import zmq
from argparse import ArgumentParser
from pymavlink import mavutil
def main():
parser = ArgumentParser()
parser.add_argument("--device", help="MAVLink device to add to zmq", required=True)
parser.add_argument("--zmq", help="zmq url", required=True)
args = parser.parse_args()
try:
... | import zmq
from argparse import ArgumentParser
from pymavlink import mavutil
def main():
parser = ArgumentParser()
parser.add_argument("--device", help="MAVLink device to add to zmq", required=True)
parser.add_argument("--zmq", help="zmq url", required=True)
args = parser.parse_args()
try:
... | Remove printing of topics in bridge | Remove printing of topics in bridge
| Python | bsd-2-clause | btashton/mavlink-zmq,btashton/mavlink-zmq | import zmq
from argparse import ArgumentParser
from pymavlink import mavutil
def main():
parser = ArgumentParser()
parser.add_argument("--device", help="MAVLink device to add to zmq", required=True)
parser.add_argument("--zmq", help="zmq url", required=True)
args = parser.parse_args()
try:
... | import zmq
from argparse import ArgumentParser
from pymavlink import mavutil
def main():
parser = ArgumentParser()
parser.add_argument("--device", help="MAVLink device to add to zmq", required=True)
parser.add_argument("--zmq", help="zmq url", required=True)
args = parser.parse_args()
try:
... | <commit_before>import zmq
from argparse import ArgumentParser
from pymavlink import mavutil
def main():
parser = ArgumentParser()
parser.add_argument("--device", help="MAVLink device to add to zmq", required=True)
parser.add_argument("--zmq", help="zmq url", required=True)
args = parser.parse_args()
... | import zmq
from argparse import ArgumentParser
from pymavlink import mavutil
def main():
parser = ArgumentParser()
parser.add_argument("--device", help="MAVLink device to add to zmq", required=True)
parser.add_argument("--zmq", help="zmq url", required=True)
args = parser.parse_args()
try:
... | import zmq
from argparse import ArgumentParser
from pymavlink import mavutil
def main():
parser = ArgumentParser()
parser.add_argument("--device", help="MAVLink device to add to zmq", required=True)
parser.add_argument("--zmq", help="zmq url", required=True)
args = parser.parse_args()
try:
... | <commit_before>import zmq
from argparse import ArgumentParser
from pymavlink import mavutil
def main():
parser = ArgumentParser()
parser.add_argument("--device", help="MAVLink device to add to zmq", required=True)
parser.add_argument("--zmq", help="zmq url", required=True)
args = parser.parse_args()
... |
cb099abc5a59d3824e767e5dd094cfea6f066a0a | libqtile/command.py | libqtile/command.py | # Copyright (c) 2008, Aldo Cortesi. All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify,... | # Copyright (c) 2008, Aldo Cortesi. All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify,... | Fix up deprecated lazy import | Fix up deprecated lazy import
| Python | mit | ramnes/qtile,qtile/qtile,ramnes/qtile,tych0/qtile,qtile/qtile,tych0/qtile | # Copyright (c) 2008, Aldo Cortesi. All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify,... | # Copyright (c) 2008, Aldo Cortesi. All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify,... | <commit_before># Copyright (c) 2008, Aldo Cortesi. All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use... | # Copyright (c) 2008, Aldo Cortesi. All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify,... | # Copyright (c) 2008, Aldo Cortesi. All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify,... | <commit_before># Copyright (c) 2008, Aldo Cortesi. All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.