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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
d0786d711e7fa49afff973d27e0689c3e42ed575 | ospan/csv_to_sesame.py | ospan/csv_to_sesame.py | import argparse
from collections import namedtuple
import csv
from itertools import groupby
class Loop(object):
def __init__(self, name, repeat=1, cycles=None, description="A Loop",
item="sequence", order="random", variable_rows=None):
self.name = name
self.repeat = 1
self... | Add script to turn a CSV file into OpenSesame style Loops | Add script to turn a CSV file into OpenSesame style Loops
| Python | mit | sbuss/operation-span-test | Add script to turn a CSV file into OpenSesame style Loops | import argparse
from collections import namedtuple
import csv
from itertools import groupby
class Loop(object):
def __init__(self, name, repeat=1, cycles=None, description="A Loop",
item="sequence", order="random", variable_rows=None):
self.name = name
self.repeat = 1
self... | <commit_before><commit_msg>Add script to turn a CSV file into OpenSesame style Loops<commit_after> | import argparse
from collections import namedtuple
import csv
from itertools import groupby
class Loop(object):
def __init__(self, name, repeat=1, cycles=None, description="A Loop",
item="sequence", order="random", variable_rows=None):
self.name = name
self.repeat = 1
self... | Add script to turn a CSV file into OpenSesame style Loopsimport argparse
from collections import namedtuple
import csv
from itertools import groupby
class Loop(object):
def __init__(self, name, repeat=1, cycles=None, description="A Loop",
item="sequence", order="random", variable_rows=None):
... | <commit_before><commit_msg>Add script to turn a CSV file into OpenSesame style Loops<commit_after>import argparse
from collections import namedtuple
import csv
from itertools import groupby
class Loop(object):
def __init__(self, name, repeat=1, cycles=None, description="A Loop",
item="sequence", ... | |
2adcb39fa52e4be6dd800a56747f29ed6d76d9be | corpus_curl_opt_http_auth.py | corpus_curl_opt_http_auth.py | #!/usr/bin/env python
# Allow using strings to represent CURLOPT_HTTPAUTH values when
# generating corpus files. The original defines live in curl.h.
from enum import Enum
class CurlOptHttpAuth(Enum):
#define CURLAUTH_NONE ((unsigned long)0)
CURLAUTH_NONE = 0
#define CURLAUTH_BASIC (((unsig... | Add enum for HTTP auth strings | corpus: Add enum for HTTP auth strings
Taken from curl/curl.h and converted to Python, for convenience when
writing corpus seed cases.
| Python | mit | curl/curl-fuzzer,curl/curl-fuzzer,curl/curl-fuzzer,curl/curl-fuzzer | corpus: Add enum for HTTP auth strings
Taken from curl/curl.h and converted to Python, for convenience when
writing corpus seed cases. | #!/usr/bin/env python
# Allow using strings to represent CURLOPT_HTTPAUTH values when
# generating corpus files. The original defines live in curl.h.
from enum import Enum
class CurlOptHttpAuth(Enum):
#define CURLAUTH_NONE ((unsigned long)0)
CURLAUTH_NONE = 0
#define CURLAUTH_BASIC (((unsig... | <commit_before><commit_msg>corpus: Add enum for HTTP auth strings
Taken from curl/curl.h and converted to Python, for convenience when
writing corpus seed cases.<commit_after> | #!/usr/bin/env python
# Allow using strings to represent CURLOPT_HTTPAUTH values when
# generating corpus files. The original defines live in curl.h.
from enum import Enum
class CurlOptHttpAuth(Enum):
#define CURLAUTH_NONE ((unsigned long)0)
CURLAUTH_NONE = 0
#define CURLAUTH_BASIC (((unsig... | corpus: Add enum for HTTP auth strings
Taken from curl/curl.h and converted to Python, for convenience when
writing corpus seed cases.#!/usr/bin/env python
# Allow using strings to represent CURLOPT_HTTPAUTH values when
# generating corpus files. The original defines live in curl.h.
from enum import Enum
class CurlO... | <commit_before><commit_msg>corpus: Add enum for HTTP auth strings
Taken from curl/curl.h and converted to Python, for convenience when
writing corpus seed cases.<commit_after>#!/usr/bin/env python
# Allow using strings to represent CURLOPT_HTTPAUTH values when
# generating corpus files. The original defines live in cu... | |
696c1016284a4930f9df5379a5e01abce21df72c | InvenTree/company/migrations/0020_auto_20200413_0839.py | InvenTree/company/migrations/0020_auto_20200413_0839.py | # Generated by Django 2.2.10 on 2020-04-13 08:39
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('company', '0019_auto_20200413_0642'),
]
operations = [
migrations.AlterField(
model_name='supp... | Change related name for SuppleirPart.supplier | Change related name for SuppleirPart.supplier
(cherry picked from commit 635c4339e06db392f373f46539df38c914683d5a)
| Python | mit | inventree/InvenTree,inventree/InvenTree,SchrodingersGat/InvenTree,SchrodingersGat/InvenTree,inventree/InvenTree,SchrodingersGat/InvenTree,SchrodingersGat/InvenTree,inventree/InvenTree | Change related name for SuppleirPart.supplier
(cherry picked from commit 635c4339e06db392f373f46539df38c914683d5a) | # Generated by Django 2.2.10 on 2020-04-13 08:39
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('company', '0019_auto_20200413_0642'),
]
operations = [
migrations.AlterField(
model_name='supp... | <commit_before><commit_msg>Change related name for SuppleirPart.supplier
(cherry picked from commit 635c4339e06db392f373f46539df38c914683d5a)<commit_after> | # Generated by Django 2.2.10 on 2020-04-13 08:39
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('company', '0019_auto_20200413_0642'),
]
operations = [
migrations.AlterField(
model_name='supp... | Change related name for SuppleirPart.supplier
(cherry picked from commit 635c4339e06db392f373f46539df38c914683d5a)# Generated by Django 2.2.10 on 2020-04-13 08:39
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('company'... | <commit_before><commit_msg>Change related name for SuppleirPart.supplier
(cherry picked from commit 635c4339e06db392f373f46539df38c914683d5a)<commit_after># Generated by Django 2.2.10 on 2020-04-13 08:39
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):... | |
010376704d66e3fadffe50709d479d31a2e8eb14 | tool/collect-macaddr4ilo.py | tool/collect-macaddr4ilo.py | #!/usr/bin/python
import pexpect
import re
import sys
from optparse import OptionParser
macs=[]
err=0
op=OptionParser("fancheck [options] ip")
op.add_option("-l","--log",action="store_true",dest="log",default=False,help="whole logs to stdout")
op.add_option("-u","--user",action="store",dest="user",type="string",defa... | Add collection mac tool for ilo | [Add] Add collection mac tool for ilo
| Python | mit | konono/equlipse,konono/equlipse | [Add] Add collection mac tool for ilo | #!/usr/bin/python
import pexpect
import re
import sys
from optparse import OptionParser
macs=[]
err=0
op=OptionParser("fancheck [options] ip")
op.add_option("-l","--log",action="store_true",dest="log",default=False,help="whole logs to stdout")
op.add_option("-u","--user",action="store",dest="user",type="string",defa... | <commit_before><commit_msg>[Add] Add collection mac tool for ilo<commit_after> | #!/usr/bin/python
import pexpect
import re
import sys
from optparse import OptionParser
macs=[]
err=0
op=OptionParser("fancheck [options] ip")
op.add_option("-l","--log",action="store_true",dest="log",default=False,help="whole logs to stdout")
op.add_option("-u","--user",action="store",dest="user",type="string",defa... | [Add] Add collection mac tool for ilo#!/usr/bin/python
import pexpect
import re
import sys
from optparse import OptionParser
macs=[]
err=0
op=OptionParser("fancheck [options] ip")
op.add_option("-l","--log",action="store_true",dest="log",default=False,help="whole logs to stdout")
op.add_option("-u","--user",action="... | <commit_before><commit_msg>[Add] Add collection mac tool for ilo<commit_after>#!/usr/bin/python
import pexpect
import re
import sys
from optparse import OptionParser
macs=[]
err=0
op=OptionParser("fancheck [options] ip")
op.add_option("-l","--log",action="store_true",dest="log",default=False,help="whole logs to stdo... | |
d3bafe885920e7b1d21e6d97456b39c471ed48d0 | api/webview/tests.py | api/webview/tests.py | import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "api.api.settings")
import pytest
import django
from django.test import TestCase
from rest_framework.test import APIRequestFactory
from api.webview.views import DocumentList
django.setup()
# TODO - make this work without Django.
class APIViewTests(TestCase... | Move api test back to django | Move api test back to django
| Python | apache-2.0 | CenterForOpenScience/scrapi,mehanig/scrapi,erinspace/scrapi,fabianvf/scrapi,felliott/scrapi,mehanig/scrapi,erinspace/scrapi,CenterForOpenScience/scrapi,fabianvf/scrapi,felliott/scrapi | Move api test back to django | import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "api.api.settings")
import pytest
import django
from django.test import TestCase
from rest_framework.test import APIRequestFactory
from api.webview.views import DocumentList
django.setup()
# TODO - make this work without Django.
class APIViewTests(TestCase... | <commit_before><commit_msg>Move api test back to django<commit_after> | import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "api.api.settings")
import pytest
import django
from django.test import TestCase
from rest_framework.test import APIRequestFactory
from api.webview.views import DocumentList
django.setup()
# TODO - make this work without Django.
class APIViewTests(TestCase... | Move api test back to djangoimport os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "api.api.settings")
import pytest
import django
from django.test import TestCase
from rest_framework.test import APIRequestFactory
from api.webview.views import DocumentList
django.setup()
# TODO - make this work without Django.
... | <commit_before><commit_msg>Move api test back to django<commit_after>import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "api.api.settings")
import pytest
import django
from django.test import TestCase
from rest_framework.test import APIRequestFactory
from api.webview.views import DocumentList
django.setup()
... | |
dd6287903ccddf24edf600e3d30fba61efd9478f | distarray/core/tests/test_distributed_array_protocol.py | distarray/core/tests/test_distributed_array_protocol.py | import unittest
import distarray as da
from distarray.mpi.mpibase import create_comm_of_size, InvalidCommSizeError
class TestDistributedArrayProtocol(unittest.TestCase):
def setUp(self):
try:
comm = create_comm_of_size(4)
except InvalidCommSizeError:
raise unittest.SkipTes... | import unittest
import distarray as da
from distarray.mpi.mpibase import create_comm_of_size, InvalidCommSizeError
class TestDistributedArrayProtocol(unittest.TestCase):
def setUp(self):
try:
comm = create_comm_of_size(4)
except InvalidCommSizeError:
raise unittest.SkipTes... | Modify round-trip test to use new function name. | Modify round-trip test to use new function name.
We've temporarily settled on `fromdap()` for importing from `__distarray__` interfaces. | Python | bsd-3-clause | RaoUmer/distarray,enthought/distarray,RaoUmer/distarray,enthought/distarray | import unittest
import distarray as da
from distarray.mpi.mpibase import create_comm_of_size, InvalidCommSizeError
class TestDistributedArrayProtocol(unittest.TestCase):
def setUp(self):
try:
comm = create_comm_of_size(4)
except InvalidCommSizeError:
raise unittest.SkipTes... | import unittest
import distarray as da
from distarray.mpi.mpibase import create_comm_of_size, InvalidCommSizeError
class TestDistributedArrayProtocol(unittest.TestCase):
def setUp(self):
try:
comm = create_comm_of_size(4)
except InvalidCommSizeError:
raise unittest.SkipTes... | <commit_before>import unittest
import distarray as da
from distarray.mpi.mpibase import create_comm_of_size, InvalidCommSizeError
class TestDistributedArrayProtocol(unittest.TestCase):
def setUp(self):
try:
comm = create_comm_of_size(4)
except InvalidCommSizeError:
raise u... | import unittest
import distarray as da
from distarray.mpi.mpibase import create_comm_of_size, InvalidCommSizeError
class TestDistributedArrayProtocol(unittest.TestCase):
def setUp(self):
try:
comm = create_comm_of_size(4)
except InvalidCommSizeError:
raise unittest.SkipTes... | import unittest
import distarray as da
from distarray.mpi.mpibase import create_comm_of_size, InvalidCommSizeError
class TestDistributedArrayProtocol(unittest.TestCase):
def setUp(self):
try:
comm = create_comm_of_size(4)
except InvalidCommSizeError:
raise unittest.SkipTes... | <commit_before>import unittest
import distarray as da
from distarray.mpi.mpibase import create_comm_of_size, InvalidCommSizeError
class TestDistributedArrayProtocol(unittest.TestCase):
def setUp(self):
try:
comm = create_comm_of_size(4)
except InvalidCommSizeError:
raise u... |
35f9f8ad0aa3b7474aeeb4094ff13b8312b9d326 | experiments/reproduce-srcnn/9-1-5/run.py | experiments/reproduce-srcnn/9-1-5/run.py | from toolbox.datasets.sr import load_data
from toolbox.models import srcnn
from toolbox.training import train
(x_train, y_train), (x_test, y_test) = load_data()
model = srcnn(x_train.shape[1:], f1=9, f2=1, f3=5)
train(model, x_train, y_train, validation_data=(x_test, y_test),
nb_epoch=2, resume=True, save_dir='... | Add a simple experiment script | Add a simple experiment script
| Python | mit | qobilidop/srcnn,qobilidop/srcnn | Add a simple experiment script | from toolbox.datasets.sr import load_data
from toolbox.models import srcnn
from toolbox.training import train
(x_train, y_train), (x_test, y_test) = load_data()
model = srcnn(x_train.shape[1:], f1=9, f2=1, f3=5)
train(model, x_train, y_train, validation_data=(x_test, y_test),
nb_epoch=2, resume=True, save_dir='... | <commit_before><commit_msg>Add a simple experiment script<commit_after> | from toolbox.datasets.sr import load_data
from toolbox.models import srcnn
from toolbox.training import train
(x_train, y_train), (x_test, y_test) = load_data()
model = srcnn(x_train.shape[1:], f1=9, f2=1, f3=5)
train(model, x_train, y_train, validation_data=(x_test, y_test),
nb_epoch=2, resume=True, save_dir='... | Add a simple experiment scriptfrom toolbox.datasets.sr import load_data
from toolbox.models import srcnn
from toolbox.training import train
(x_train, y_train), (x_test, y_test) = load_data()
model = srcnn(x_train.shape[1:], f1=9, f2=1, f3=5)
train(model, x_train, y_train, validation_data=(x_test, y_test),
nb_ep... | <commit_before><commit_msg>Add a simple experiment script<commit_after>from toolbox.datasets.sr import load_data
from toolbox.models import srcnn
from toolbox.training import train
(x_train, y_train), (x_test, y_test) = load_data()
model = srcnn(x_train.shape[1:], f1=9, f2=1, f3=5)
train(model, x_train, y_train, vali... | |
e60d0fd405a93f517fd7478b862dfae5bfb87d4f | demos/mapbox.py | demos/mapbox.py | #!/usr/bin/env python
# To run this example, you need to set the GI_TYPELIB_PATH environment
# variable to point to the gir directory:
#
# export GI_TYPELIB_PATH=$GI_TYPELIB_PATH:/usr/local/lib/girepository-1.0/
from gi.repository import GtkClutter
from gi.repository import GObject, Gtk, Champlain, GtkChamplain
ACCE... | Add python demo demonstrating custom tile source | Add python demo demonstrating custom tile source
| Python | lgpl-2.1 | GNOME/libchamplain,GNOME/libchamplain | Add python demo demonstrating custom tile source | #!/usr/bin/env python
# To run this example, you need to set the GI_TYPELIB_PATH environment
# variable to point to the gir directory:
#
# export GI_TYPELIB_PATH=$GI_TYPELIB_PATH:/usr/local/lib/girepository-1.0/
from gi.repository import GtkClutter
from gi.repository import GObject, Gtk, Champlain, GtkChamplain
ACCE... | <commit_before><commit_msg>Add python demo demonstrating custom tile source<commit_after> | #!/usr/bin/env python
# To run this example, you need to set the GI_TYPELIB_PATH environment
# variable to point to the gir directory:
#
# export GI_TYPELIB_PATH=$GI_TYPELIB_PATH:/usr/local/lib/girepository-1.0/
from gi.repository import GtkClutter
from gi.repository import GObject, Gtk, Champlain, GtkChamplain
ACCE... | Add python demo demonstrating custom tile source#!/usr/bin/env python
# To run this example, you need to set the GI_TYPELIB_PATH environment
# variable to point to the gir directory:
#
# export GI_TYPELIB_PATH=$GI_TYPELIB_PATH:/usr/local/lib/girepository-1.0/
from gi.repository import GtkClutter
from gi.repository im... | <commit_before><commit_msg>Add python demo demonstrating custom tile source<commit_after>#!/usr/bin/env python
# To run this example, you need to set the GI_TYPELIB_PATH environment
# variable to point to the gir directory:
#
# export GI_TYPELIB_PATH=$GI_TYPELIB_PATH:/usr/local/lib/girepository-1.0/
from gi.repositor... | |
8ba9f82373ef0995bd3a18d6bc0153a2f7e71bcb | setup.py | setup.py | #!/usr/bin/env python
import sys
import os
from distutils.core import setup
sys.path.insert(0, os.path.dirname(__file__))
from wutils import get_version, generate_version_py
generate_version_py(force=False)
setup(name='pybindgen',
version=get_version(),
description='Python Bindings Generator',
autho... | #!/usr/bin/env python
import sys
import os
from distutils.core import setup
sys.path.insert(0, os.path.dirname(__file__))
from wutils import get_version, generate_version_py
generate_version_py(force=False)
setup(name='PyBindGen',
version=get_version(),
description='Python Bindings Generator',
autho... | Revert back to PyBindGen as package name because it's what is already registered in PyPI. | Revert back to PyBindGen as package name because it's what is already registered in PyPI.
| Python | lgpl-2.1 | caramucho/pybindgen,caramucho/pybindgen,caramucho/pybindgen,cawka/pybindgen,cawka/pybindgen,cawka/pybindgen,cawka/pybindgen,caramucho/pybindgen | #!/usr/bin/env python
import sys
import os
from distutils.core import setup
sys.path.insert(0, os.path.dirname(__file__))
from wutils import get_version, generate_version_py
generate_version_py(force=False)
setup(name='pybindgen',
version=get_version(),
description='Python Bindings Generator',
autho... | #!/usr/bin/env python
import sys
import os
from distutils.core import setup
sys.path.insert(0, os.path.dirname(__file__))
from wutils import get_version, generate_version_py
generate_version_py(force=False)
setup(name='PyBindGen',
version=get_version(),
description='Python Bindings Generator',
autho... | <commit_before>#!/usr/bin/env python
import sys
import os
from distutils.core import setup
sys.path.insert(0, os.path.dirname(__file__))
from wutils import get_version, generate_version_py
generate_version_py(force=False)
setup(name='pybindgen',
version=get_version(),
description='Python Bindings Generato... | #!/usr/bin/env python
import sys
import os
from distutils.core import setup
sys.path.insert(0, os.path.dirname(__file__))
from wutils import get_version, generate_version_py
generate_version_py(force=False)
setup(name='PyBindGen',
version=get_version(),
description='Python Bindings Generator',
autho... | #!/usr/bin/env python
import sys
import os
from distutils.core import setup
sys.path.insert(0, os.path.dirname(__file__))
from wutils import get_version, generate_version_py
generate_version_py(force=False)
setup(name='pybindgen',
version=get_version(),
description='Python Bindings Generator',
autho... | <commit_before>#!/usr/bin/env python
import sys
import os
from distutils.core import setup
sys.path.insert(0, os.path.dirname(__file__))
from wutils import get_version, generate_version_py
generate_version_py(force=False)
setup(name='pybindgen',
version=get_version(),
description='Python Bindings Generato... |
e8339d89a3c69938ddd8ddb7c775edc56c8524ff | asyncpg/encodings.py | asyncpg/encodings.py | '''Map PostgreSQL encoding names to Python encoding names
https://www.postgresql.org/docs/current/static/multibyte.html#CHARSET-TABLE
'''
_map = {
'abc': 'cp1258',
'alt': 'cp866',
'euc_cn': 'euccn',
'euc_jp': 'eucjp',
'euc_kr': 'euckr',
'koi8r': 'koi8_r',
'koi8u': 'koi8_u',
'shift_jis... | Add a module to map Postgres encoding names to Python | Add a module to map Postgres encoding names to Python
| Python | apache-2.0 | MagicStack/asyncpg,MagicStack/asyncpg | Add a module to map Postgres encoding names to Python | '''Map PostgreSQL encoding names to Python encoding names
https://www.postgresql.org/docs/current/static/multibyte.html#CHARSET-TABLE
'''
_map = {
'abc': 'cp1258',
'alt': 'cp866',
'euc_cn': 'euccn',
'euc_jp': 'eucjp',
'euc_kr': 'euckr',
'koi8r': 'koi8_r',
'koi8u': 'koi8_u',
'shift_jis... | <commit_before><commit_msg>Add a module to map Postgres encoding names to Python<commit_after> | '''Map PostgreSQL encoding names to Python encoding names
https://www.postgresql.org/docs/current/static/multibyte.html#CHARSET-TABLE
'''
_map = {
'abc': 'cp1258',
'alt': 'cp866',
'euc_cn': 'euccn',
'euc_jp': 'eucjp',
'euc_kr': 'euckr',
'koi8r': 'koi8_r',
'koi8u': 'koi8_u',
'shift_jis... | Add a module to map Postgres encoding names to Python'''Map PostgreSQL encoding names to Python encoding names
https://www.postgresql.org/docs/current/static/multibyte.html#CHARSET-TABLE
'''
_map = {
'abc': 'cp1258',
'alt': 'cp866',
'euc_cn': 'euccn',
'euc_jp': 'eucjp',
'euc_kr': 'euckr',
'ko... | <commit_before><commit_msg>Add a module to map Postgres encoding names to Python<commit_after>'''Map PostgreSQL encoding names to Python encoding names
https://www.postgresql.org/docs/current/static/multibyte.html#CHARSET-TABLE
'''
_map = {
'abc': 'cp1258',
'alt': 'cp866',
'euc_cn': 'euccn',
'euc_jp'... | |
52409670ac2d8f6161cdf884465fa75454280d1a | examples/pi2.py | examples/pi2.py | #!/usr/bin/python
from __future__ import division
import random
import sys
import mrs
class SamplePi(mrs.MapReduce):
"""A less numerically-intensive version of the pi calculator."""
def map(self, key, value):
inside = 0
outside = 0
for _ in range(int(value)):
x = random.... | Add a pi example using random.random instead of the halton sequence | Add a pi example using random.random instead of the halton sequence
| Python | apache-2.0 | byu-aml-lab/mrs-mapreduce,kseppi/mrs-mapreduce | Add a pi example using random.random instead of the halton sequence | #!/usr/bin/python
from __future__ import division
import random
import sys
import mrs
class SamplePi(mrs.MapReduce):
"""A less numerically-intensive version of the pi calculator."""
def map(self, key, value):
inside = 0
outside = 0
for _ in range(int(value)):
x = random.... | <commit_before><commit_msg>Add a pi example using random.random instead of the halton sequence<commit_after> | #!/usr/bin/python
from __future__ import division
import random
import sys
import mrs
class SamplePi(mrs.MapReduce):
"""A less numerically-intensive version of the pi calculator."""
def map(self, key, value):
inside = 0
outside = 0
for _ in range(int(value)):
x = random.... | Add a pi example using random.random instead of the halton sequence#!/usr/bin/python
from __future__ import division
import random
import sys
import mrs
class SamplePi(mrs.MapReduce):
"""A less numerically-intensive version of the pi calculator."""
def map(self, key, value):
inside = 0
outsi... | <commit_before><commit_msg>Add a pi example using random.random instead of the halton sequence<commit_after>#!/usr/bin/python
from __future__ import division
import random
import sys
import mrs
class SamplePi(mrs.MapReduce):
"""A less numerically-intensive version of the pi calculator."""
def map(self, key,... | |
8f056d2f0138c3757f55c393a0b81c2959778190 | apps/notifications/tests/test_templatetags.py | apps/notifications/tests/test_templatetags.py | """
Test suite for the template tags of the notifications app.
"""
from django.test import TestCase
from django.template import (engines,
TemplateSyntaxError)
from django.contrib.auth import get_user_model
from ..models import Notification
class NotificationsViewsTestCase(TestCase):
... | Add tests suite for template tags of notifications app | Add tests suite for template tags of notifications app
| Python | agpl-3.0 | TamiaLab/carnetdumaker,TamiaLab/carnetdumaker,TamiaLab/carnetdumaker,TamiaLab/carnetdumaker | Add tests suite for template tags of notifications app | """
Test suite for the template tags of the notifications app.
"""
from django.test import TestCase
from django.template import (engines,
TemplateSyntaxError)
from django.contrib.auth import get_user_model
from ..models import Notification
class NotificationsViewsTestCase(TestCase):
... | <commit_before><commit_msg>Add tests suite for template tags of notifications app<commit_after> | """
Test suite for the template tags of the notifications app.
"""
from django.test import TestCase
from django.template import (engines,
TemplateSyntaxError)
from django.contrib.auth import get_user_model
from ..models import Notification
class NotificationsViewsTestCase(TestCase):
... | Add tests suite for template tags of notifications app"""
Test suite for the template tags of the notifications app.
"""
from django.test import TestCase
from django.template import (engines,
TemplateSyntaxError)
from django.contrib.auth import get_user_model
from ..models import Notifica... | <commit_before><commit_msg>Add tests suite for template tags of notifications app<commit_after>"""
Test suite for the template tags of the notifications app.
"""
from django.test import TestCase
from django.template import (engines,
TemplateSyntaxError)
from django.contrib.auth import get_... | |
cff10711c9c613fad39e7a0eec5c37c3c17a7b94 | zip2wd_mp/demographics2input.py | zip2wd_mp/demographics2input.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import csv
import argparse
def parse_command_line():
"""Parse command line arguments
"""
parser = argparse.ArgumentParser(description="Demographics data to Inputs")
parser.add_argument('input', type=str, help='Demographics CSV file')
parser.add_argum... | Add a simple script to get unique zip codes from demographics file and save as zip2wd inputs. | Add a simple script to get unique zip codes from demographics file and save as zip2wd inputs.
| Python | mit | soodoku/get-weather-data,soodoku/get-weather-data | Add a simple script to get unique zip codes from demographics file and save as zip2wd inputs. | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import csv
import argparse
def parse_command_line():
"""Parse command line arguments
"""
parser = argparse.ArgumentParser(description="Demographics data to Inputs")
parser.add_argument('input', type=str, help='Demographics CSV file')
parser.add_argum... | <commit_before><commit_msg>Add a simple script to get unique zip codes from demographics file and save as zip2wd inputs.<commit_after> | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import csv
import argparse
def parse_command_line():
"""Parse command line arguments
"""
parser = argparse.ArgumentParser(description="Demographics data to Inputs")
parser.add_argument('input', type=str, help='Demographics CSV file')
parser.add_argum... | Add a simple script to get unique zip codes from demographics file and save as zip2wd inputs.#!/usr/bin/env python
# -*- coding: utf-8 -*-
import csv
import argparse
def parse_command_line():
"""Parse command line arguments
"""
parser = argparse.ArgumentParser(description="Demographics data to Inputs")
... | <commit_before><commit_msg>Add a simple script to get unique zip codes from demographics file and save as zip2wd inputs.<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-
import csv
import argparse
def parse_command_line():
"""Parse command line arguments
"""
parser = argparse.ArgumentParser(des... | |
46f61c87b8afe586cacc12a91d3f94c89253365f | functional/tests/compute/v2/test_security_group.py | functional/tests/compute/v2/test_security_group.py | # 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 writing, software
# d... | Add functional tests for security group CRUD | Add functional tests for security group CRUD
Change-Id: Ib5bbd46c0454d7dbb541354d515430922569c994
| Python | apache-2.0 | dtroyer/python-openstackclient,openstack/python-openstackclient,redhat-openstack/python-openstackclient,BjoernT/python-openstackclient,redhat-openstack/python-openstackclient,dtroyer/python-openstackclient,BjoernT/python-openstackclient,openstack/python-openstackclient | Add functional tests for security group CRUD
Change-Id: Ib5bbd46c0454d7dbb541354d515430922569c994 | # 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 writing, software
# d... | <commit_before><commit_msg>Add functional tests for security group CRUD
Change-Id: Ib5bbd46c0454d7dbb541354d515430922569c994<commit_after> | # 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 writing, software
# d... | Add functional tests for security group CRUD
Change-Id: Ib5bbd46c0454d7dbb541354d515430922569c994# 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/lice... | <commit_before><commit_msg>Add functional tests for security group CRUD
Change-Id: Ib5bbd46c0454d7dbb541354d515430922569c994<commit_after># 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 ... | |
b46b8cd1a6f31947ccc3a58722147d5d4b7d97e7 | test_slashes.py | test_slashes.py | import os
import unittest
import stack
class TestSlashConvert(unittest.TestCase):
def test_relative(self):
# start with unix-style
source = "test/sub \n dir/file.txt"
# convert to OS-specific separators; this is a no-op on unix-like systems
os_slash = os.path.normpath(source)
... | Add unit test for path conversion. | Add unit test for path conversion.
| Python | mit | bbinet/pillarstack | Add unit test for path conversion. | import os
import unittest
import stack
class TestSlashConvert(unittest.TestCase):
def test_relative(self):
# start with unix-style
source = "test/sub \n dir/file.txt"
# convert to OS-specific separators; this is a no-op on unix-like systems
os_slash = os.path.normpath(source)
... | <commit_before><commit_msg>Add unit test for path conversion.<commit_after> | import os
import unittest
import stack
class TestSlashConvert(unittest.TestCase):
def test_relative(self):
# start with unix-style
source = "test/sub \n dir/file.txt"
# convert to OS-specific separators; this is a no-op on unix-like systems
os_slash = os.path.normpath(source)
... | Add unit test for path conversion.import os
import unittest
import stack
class TestSlashConvert(unittest.TestCase):
def test_relative(self):
# start with unix-style
source = "test/sub \n dir/file.txt"
# convert to OS-specific separators; this is a no-op on unix-like systems
os_sl... | <commit_before><commit_msg>Add unit test for path conversion.<commit_after>import os
import unittest
import stack
class TestSlashConvert(unittest.TestCase):
def test_relative(self):
# start with unix-style
source = "test/sub \n dir/file.txt"
# convert to OS-specific separators; this is a... | |
8f7fe11bc02c7cadf6f531c064a560968dc2b003 | readthedocs/core/management/commands/set_metadata.py | readthedocs/core/management/commands/set_metadata.py | import logging
from optparse import make_option
from django.core.management.base import BaseCommand
from django.conf import settings
from projects import tasks
from projects.models import Project
log = logging.getLogger(__name__)
class Command(BaseCommand):
def handle(self, *args, **options):
queryset ... | Add command to generate metadata | Add command to generate metadata
| Python | mit | kenshinthebattosai/readthedocs.org,clarkperkins/readthedocs.org,tddv/readthedocs.org,d0ugal/readthedocs.org,Tazer/readthedocs.org,kenwang76/readthedocs.org,emawind84/readthedocs.org,sils1297/readthedocs.org,fujita-shintaro/readthedocs.org,stevepiercy/readthedocs.org,espdev/readthedocs.org,emawind84/readthedocs.org,Luka... | Add command to generate metadata | import logging
from optparse import make_option
from django.core.management.base import BaseCommand
from django.conf import settings
from projects import tasks
from projects.models import Project
log = logging.getLogger(__name__)
class Command(BaseCommand):
def handle(self, *args, **options):
queryset ... | <commit_before><commit_msg>Add command to generate metadata<commit_after> | import logging
from optparse import make_option
from django.core.management.base import BaseCommand
from django.conf import settings
from projects import tasks
from projects.models import Project
log = logging.getLogger(__name__)
class Command(BaseCommand):
def handle(self, *args, **options):
queryset ... | Add command to generate metadataimport logging
from optparse import make_option
from django.core.management.base import BaseCommand
from django.conf import settings
from projects import tasks
from projects.models import Project
log = logging.getLogger(__name__)
class Command(BaseCommand):
def handle(self, *arg... | <commit_before><commit_msg>Add command to generate metadata<commit_after>import logging
from optparse import make_option
from django.core.management.base import BaseCommand
from django.conf import settings
from projects import tasks
from projects.models import Project
log = logging.getLogger(__name__)
class Comman... | |
b9dac640d1e715d33354029ebf46ad3387f22bfe | CodeFights/mergingVines.py | CodeFights/mergingVines.py | #!/usr/local/bin/python
# Code Fights Merging Vines Problem
from functools import reduce
import math
def compose(functions):
return reduce(lambda f, g: lambda x: f(g(x)), functions, lambda x: x)
def functionsComposition(functions, x):
return compose(map(eval, functions))(x)
def mergingVines(vines, n):
... | Set up Code Fights merging vines problem | Set up Code Fights merging vines problem
| Python | mit | HKuz/Test_Code | Set up Code Fights merging vines problem | #!/usr/local/bin/python
# Code Fights Merging Vines Problem
from functools import reduce
import math
def compose(functions):
return reduce(lambda f, g: lambda x: f(g(x)), functions, lambda x: x)
def functionsComposition(functions, x):
return compose(map(eval, functions))(x)
def mergingVines(vines, n):
... | <commit_before><commit_msg>Set up Code Fights merging vines problem<commit_after> | #!/usr/local/bin/python
# Code Fights Merging Vines Problem
from functools import reduce
import math
def compose(functions):
return reduce(lambda f, g: lambda x: f(g(x)), functions, lambda x: x)
def functionsComposition(functions, x):
return compose(map(eval, functions))(x)
def mergingVines(vines, n):
... | Set up Code Fights merging vines problem#!/usr/local/bin/python
# Code Fights Merging Vines Problem
from functools import reduce
import math
def compose(functions):
return reduce(lambda f, g: lambda x: f(g(x)), functions, lambda x: x)
def functionsComposition(functions, x):
return compose(map(eval, functio... | <commit_before><commit_msg>Set up Code Fights merging vines problem<commit_after>#!/usr/local/bin/python
# Code Fights Merging Vines Problem
from functools import reduce
import math
def compose(functions):
return reduce(lambda f, g: lambda x: f(g(x)), functions, lambda x: x)
def functionsComposition(functions,... | |
52d45a55c61c229f9d99b3f437b76a363a34b481 | i8c/tests/test_externals.py | i8c/tests/test_externals.py | from i8c.tests import TestCase
SOURCE = """\
define test::externals_test returns int
extern ptr a_symbol
extern func int, int (ptr) a_function
call
return
"""
class TestExternals(TestCase):
def test_externals(self):
"""Check that externals work."""
tree, output = self.compile(SOURC... | Add a basic check for externals | Add a basic check for externals
| Python | lgpl-2.1 | gbenson/i8c | Add a basic check for externals | from i8c.tests import TestCase
SOURCE = """\
define test::externals_test returns int
extern ptr a_symbol
extern func int, int (ptr) a_function
call
return
"""
class TestExternals(TestCase):
def test_externals(self):
"""Check that externals work."""
tree, output = self.compile(SOURC... | <commit_before><commit_msg>Add a basic check for externals<commit_after> | from i8c.tests import TestCase
SOURCE = """\
define test::externals_test returns int
extern ptr a_symbol
extern func int, int (ptr) a_function
call
return
"""
class TestExternals(TestCase):
def test_externals(self):
"""Check that externals work."""
tree, output = self.compile(SOURC... | Add a basic check for externalsfrom i8c.tests import TestCase
SOURCE = """\
define test::externals_test returns int
extern ptr a_symbol
extern func int, int (ptr) a_function
call
return
"""
class TestExternals(TestCase):
def test_externals(self):
"""Check that externals work."""
tr... | <commit_before><commit_msg>Add a basic check for externals<commit_after>from i8c.tests import TestCase
SOURCE = """\
define test::externals_test returns int
extern ptr a_symbol
extern func int, int (ptr) a_function
call
return
"""
class TestExternals(TestCase):
def test_externals(self):
""... | |
281695fed73f9aa9eee0a1007388cc5ae4768bc8 | examples/translations/spanish_test_1.py | examples/translations/spanish_test_1.py | # Spanish Language Test - Python 3 Only!
from seleniumbase.translate.spanish import CasoDePrueba
class MiClaseDePrueba(CasoDePrueba):
def test_ejemplo_1(self):
self.abrir_url("https://es.wikipedia.org/wiki/")
self.verificar_texto("Wikipedia")
self.verificar_elemento('[title="Visitar la pá... | Add an example test in Spanish | Add an example test in Spanish
| Python | mit | mdmintz/SeleniumBase,seleniumbase/SeleniumBase,seleniumbase/SeleniumBase,mdmintz/SeleniumBase,seleniumbase/SeleniumBase,seleniumbase/SeleniumBase,mdmintz/SeleniumBase,mdmintz/SeleniumBase | Add an example test in Spanish | # Spanish Language Test - Python 3 Only!
from seleniumbase.translate.spanish import CasoDePrueba
class MiClaseDePrueba(CasoDePrueba):
def test_ejemplo_1(self):
self.abrir_url("https://es.wikipedia.org/wiki/")
self.verificar_texto("Wikipedia")
self.verificar_elemento('[title="Visitar la pá... | <commit_before><commit_msg>Add an example test in Spanish<commit_after> | # Spanish Language Test - Python 3 Only!
from seleniumbase.translate.spanish import CasoDePrueba
class MiClaseDePrueba(CasoDePrueba):
def test_ejemplo_1(self):
self.abrir_url("https://es.wikipedia.org/wiki/")
self.verificar_texto("Wikipedia")
self.verificar_elemento('[title="Visitar la pá... | Add an example test in Spanish# Spanish Language Test - Python 3 Only!
from seleniumbase.translate.spanish import CasoDePrueba
class MiClaseDePrueba(CasoDePrueba):
def test_ejemplo_1(self):
self.abrir_url("https://es.wikipedia.org/wiki/")
self.verificar_texto("Wikipedia")
self.verificar_e... | <commit_before><commit_msg>Add an example test in Spanish<commit_after># Spanish Language Test - Python 3 Only!
from seleniumbase.translate.spanish import CasoDePrueba
class MiClaseDePrueba(CasoDePrueba):
def test_ejemplo_1(self):
self.abrir_url("https://es.wikipedia.org/wiki/")
self.verificar_te... | |
dcb63e9153091052f8bcb253885e2f124ca68f18 | vtwt/block.py | vtwt/block.py | import sys
from twisted.internet.defer import inlineCallbacks, gatherResults
from twisted.plugin import IPlugin
from twisted.python import usage
from zope.interface import implements
from jersey import log
from vtwt import cli
class BlockOptions(cli.Options):
def parseArgs(self, *names):
if not names:
... | Add a flag to print debuggy logging info vtwt/cli.py | Add a flag to print debuggy logging info vtwt/cli.py
| Python | bsd-3-clause | olix0r/vtwt | Add a flag to print debuggy logging info vtwt/cli.py | import sys
from twisted.internet.defer import inlineCallbacks, gatherResults
from twisted.plugin import IPlugin
from twisted.python import usage
from zope.interface import implements
from jersey import log
from vtwt import cli
class BlockOptions(cli.Options):
def parseArgs(self, *names):
if not names:
... | <commit_before><commit_msg>Add a flag to print debuggy logging info vtwt/cli.py<commit_after> | import sys
from twisted.internet.defer import inlineCallbacks, gatherResults
from twisted.plugin import IPlugin
from twisted.python import usage
from zope.interface import implements
from jersey import log
from vtwt import cli
class BlockOptions(cli.Options):
def parseArgs(self, *names):
if not names:
... | Add a flag to print debuggy logging info vtwt/cli.pyimport sys
from twisted.internet.defer import inlineCallbacks, gatherResults
from twisted.plugin import IPlugin
from twisted.python import usage
from zope.interface import implements
from jersey import log
from vtwt import cli
class BlockOptions(cli.Options):
... | <commit_before><commit_msg>Add a flag to print debuggy logging info vtwt/cli.py<commit_after>import sys
from twisted.internet.defer import inlineCallbacks, gatherResults
from twisted.plugin import IPlugin
from twisted.python import usage
from zope.interface import implements
from jersey import log
from vtwt import cl... | |
576dd4204bb546c1944723742d63687e91099e81 | tests/app/test_metrics.py | tests/app/test_metrics.py | import re
from tests.helpers import BaseApplicationTest
def load_prometheus_metrics(response_bytes):
return dict(re.findall(rb"(\w+{.+?}) (\d+)", response_bytes))
class TestMetrics(BaseApplicationTest):
def test_metrics_page_accessible(self):
metrics_response = self.client.get('/_metrics')
... | Add standard tests for metrics | Add standard tests for metrics
| Python | mit | alphagov/digitalmarketplace-search-api,alphagov/digitalmarketplace-search-api | Add standard tests for metrics | import re
from tests.helpers import BaseApplicationTest
def load_prometheus_metrics(response_bytes):
return dict(re.findall(rb"(\w+{.+?}) (\d+)", response_bytes))
class TestMetrics(BaseApplicationTest):
def test_metrics_page_accessible(self):
metrics_response = self.client.get('/_metrics')
... | <commit_before><commit_msg>Add standard tests for metrics<commit_after> | import re
from tests.helpers import BaseApplicationTest
def load_prometheus_metrics(response_bytes):
return dict(re.findall(rb"(\w+{.+?}) (\d+)", response_bytes))
class TestMetrics(BaseApplicationTest):
def test_metrics_page_accessible(self):
metrics_response = self.client.get('/_metrics')
... | Add standard tests for metricsimport re
from tests.helpers import BaseApplicationTest
def load_prometheus_metrics(response_bytes):
return dict(re.findall(rb"(\w+{.+?}) (\d+)", response_bytes))
class TestMetrics(BaseApplicationTest):
def test_metrics_page_accessible(self):
metrics_response = self.c... | <commit_before><commit_msg>Add standard tests for metrics<commit_after>import re
from tests.helpers import BaseApplicationTest
def load_prometheus_metrics(response_bytes):
return dict(re.findall(rb"(\w+{.+?}) (\d+)", response_bytes))
class TestMetrics(BaseApplicationTest):
def test_metrics_page_accessible... | |
97832925b88406434ba3e4e5c8f4b8870f303816 | producerTrump.py | producerTrump.py | from pyspark import SparkConf, SparkContext
from pyspark.streaming import StreamingContext
from pyspark.streaming.kafka import KafkaUtils
from kafka import SimpleProducer, KafkaClient
from kafka import KafkaProducer
from operator import add
import sys
import json
from twitter import Twitter, OAuth, TwitterHTTPE... | Add new producer to test | Add new producer to test
| Python | mit | andresher/bigdata-project2 | Add new producer to test | from pyspark import SparkConf, SparkContext
from pyspark.streaming import StreamingContext
from pyspark.streaming.kafka import KafkaUtils
from kafka import SimpleProducer, KafkaClient
from kafka import KafkaProducer
from operator import add
import sys
import json
from twitter import Twitter, OAuth, TwitterHTTPE... | <commit_before><commit_msg>Add new producer to test<commit_after> | from pyspark import SparkConf, SparkContext
from pyspark.streaming import StreamingContext
from pyspark.streaming.kafka import KafkaUtils
from kafka import SimpleProducer, KafkaClient
from kafka import KafkaProducer
from operator import add
import sys
import json
from twitter import Twitter, OAuth, TwitterHTTPE... | Add new producer to testfrom pyspark import SparkConf, SparkContext
from pyspark.streaming import StreamingContext
from pyspark.streaming.kafka import KafkaUtils
from kafka import SimpleProducer, KafkaClient
from kafka import KafkaProducer
from operator import add
import sys
import json
from twitter import Twit... | <commit_before><commit_msg>Add new producer to test<commit_after>from pyspark import SparkConf, SparkContext
from pyspark.streaming import StreamingContext
from pyspark.streaming.kafka import KafkaUtils
from kafka import SimpleProducer, KafkaClient
from kafka import KafkaProducer
from operator import add
import s... | |
dbeca32771b5a3afc419aa3e9e6cf949e669b928 | praatio/tgio.py | praatio/tgio.py | class WrongPraatioVersion(Exception):
pass
raise WrongPraatioVersion(
"\n\nWARNING: You've tried to import 'tgio' which was renamed 'textgrid' in praatio 5.x.\n"
"Many other, breaking changes were made.\n"
"You will need to modify your code to use praatio 5.0.\n"
"If you would like to use your cod... | Add upgrade warning for users expecting praatio 4.x | Add upgrade warning for users expecting praatio 4.x
| Python | mit | timmahrt/praatIO | Add upgrade warning for users expecting praatio 4.x | class WrongPraatioVersion(Exception):
pass
raise WrongPraatioVersion(
"\n\nWARNING: You've tried to import 'tgio' which was renamed 'textgrid' in praatio 5.x.\n"
"Many other, breaking changes were made.\n"
"You will need to modify your code to use praatio 5.0.\n"
"If you would like to use your cod... | <commit_before><commit_msg>Add upgrade warning for users expecting praatio 4.x<commit_after> | class WrongPraatioVersion(Exception):
pass
raise WrongPraatioVersion(
"\n\nWARNING: You've tried to import 'tgio' which was renamed 'textgrid' in praatio 5.x.\n"
"Many other, breaking changes were made.\n"
"You will need to modify your code to use praatio 5.0.\n"
"If you would like to use your cod... | Add upgrade warning for users expecting praatio 4.xclass WrongPraatioVersion(Exception):
pass
raise WrongPraatioVersion(
"\n\nWARNING: You've tried to import 'tgio' which was renamed 'textgrid' in praatio 5.x.\n"
"Many other, breaking changes were made.\n"
"You will need to modify your code to use pra... | <commit_before><commit_msg>Add upgrade warning for users expecting praatio 4.x<commit_after>class WrongPraatioVersion(Exception):
pass
raise WrongPraatioVersion(
"\n\nWARNING: You've tried to import 'tgio' which was renamed 'textgrid' in praatio 5.x.\n"
"Many other, breaking changes were made.\n"
"You... | |
d88006087c7428295dafad5e27aab69c000cb278 | pyedgar/form10.py | pyedgar/form10.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Utilities for interacting with edgar forms.
"""
# import os
# import re
import logging
from . import localstore
from . import forms
# from . import plaintext
# from .htmlparse import RE_HTML_TAGS, convert_html_to_text, html_ent_re_sub
# from .. import exceptions as EX... | Add custom date and period to form 10 | Add custom date and period to form 10
| Python | mit | gaulinmp/pyedgar | Add custom date and period to form 10 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Utilities for interacting with edgar forms.
"""
# import os
# import re
import logging
from . import localstore
from . import forms
# from . import plaintext
# from .htmlparse import RE_HTML_TAGS, convert_html_to_text, html_ent_re_sub
# from .. import exceptions as EX... | <commit_before><commit_msg>Add custom date and period to form 10<commit_after> | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Utilities for interacting with edgar forms.
"""
# import os
# import re
import logging
from . import localstore
from . import forms
# from . import plaintext
# from .htmlparse import RE_HTML_TAGS, convert_html_to_text, html_ent_re_sub
# from .. import exceptions as EX... | Add custom date and period to form 10#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Utilities for interacting with edgar forms.
"""
# import os
# import re
import logging
from . import localstore
from . import forms
# from . import plaintext
# from .htmlparse import RE_HTML_TAGS, convert_html_to_text, html_ent_re_... | <commit_before><commit_msg>Add custom date and period to form 10<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Utilities for interacting with edgar forms.
"""
# import os
# import re
import logging
from . import localstore
from . import forms
# from . import plaintext
# from .htmlparse import RE_HTML... | |
9dc21af406efca98bd68bdb428c7f563790ed1a2 | scripts/crop_raster.py | scripts/crop_raster.py | import subprocess
# TODO: Crop from boundaries of raster tiles in a folder
def gdal_crop(input_file, output_file, corners):
proc_name = 'gdal_translate'
# Using 'lanczos' instead of default 'nearest' because of bug (feature?)
# in gdal 2.1 regarding subpixel unalignement http://www.gdal.org/gdal_translate... | Add script to crop a raster to some boundaries | Add script to crop a raster to some boundaries
| Python | bsd-2-clause | fire-rs-laas/fire-rs-saop,fire-rs-laas/fire-rs-saop,fire-rs-laas/fire-rs-saop,fire-rs-laas/fire-rs-saop | Add script to crop a raster to some boundaries | import subprocess
# TODO: Crop from boundaries of raster tiles in a folder
def gdal_crop(input_file, output_file, corners):
proc_name = 'gdal_translate'
# Using 'lanczos' instead of default 'nearest' because of bug (feature?)
# in gdal 2.1 regarding subpixel unalignement http://www.gdal.org/gdal_translate... | <commit_before><commit_msg>Add script to crop a raster to some boundaries<commit_after> | import subprocess
# TODO: Crop from boundaries of raster tiles in a folder
def gdal_crop(input_file, output_file, corners):
proc_name = 'gdal_translate'
# Using 'lanczos' instead of default 'nearest' because of bug (feature?)
# in gdal 2.1 regarding subpixel unalignement http://www.gdal.org/gdal_translate... | Add script to crop a raster to some boundariesimport subprocess
# TODO: Crop from boundaries of raster tiles in a folder
def gdal_crop(input_file, output_file, corners):
proc_name = 'gdal_translate'
# Using 'lanczos' instead of default 'nearest' because of bug (feature?)
# in gdal 2.1 regarding subpixel u... | <commit_before><commit_msg>Add script to crop a raster to some boundaries<commit_after>import subprocess
# TODO: Crop from boundaries of raster tiles in a folder
def gdal_crop(input_file, output_file, corners):
proc_name = 'gdal_translate'
# Using 'lanczos' instead of default 'nearest' because of bug (feature... | |
7be01251c9a98b7756128dd627b5d7be67645387 | mapnik/scales.py | mapnik/scales.py | """Scale helpers functions."""
import math
def any_scale(scale):
"""Scale helper function that allows any scale."""
return scale
def sequence_scale(scale, scale_sequence):
"""Sequence scale helper, this rounds scale to a 'sensible' value."""
factor = math.floor(math.log10(scale))
norm = scale / ... | Move scale helpers into a separate module | Move scale helpers into a separate module
No change in behaviour
| Python | lgpl-2.1 | mapnik/python-mapnik,tomhughes/python-mapnik,tomhughes/python-mapnik,mapnik/python-mapnik,mapnik/python-mapnik,tomhughes/python-mapnik | Move scale helpers into a separate module
No change in behaviour | """Scale helpers functions."""
import math
def any_scale(scale):
"""Scale helper function that allows any scale."""
return scale
def sequence_scale(scale, scale_sequence):
"""Sequence scale helper, this rounds scale to a 'sensible' value."""
factor = math.floor(math.log10(scale))
norm = scale / ... | <commit_before><commit_msg>Move scale helpers into a separate module
No change in behaviour<commit_after> | """Scale helpers functions."""
import math
def any_scale(scale):
"""Scale helper function that allows any scale."""
return scale
def sequence_scale(scale, scale_sequence):
"""Sequence scale helper, this rounds scale to a 'sensible' value."""
factor = math.floor(math.log10(scale))
norm = scale / ... | Move scale helpers into a separate module
No change in behaviour"""Scale helpers functions."""
import math
def any_scale(scale):
"""Scale helper function that allows any scale."""
return scale
def sequence_scale(scale, scale_sequence):
"""Sequence scale helper, this rounds scale to a 'sensible' value."... | <commit_before><commit_msg>Move scale helpers into a separate module
No change in behaviour<commit_after>"""Scale helpers functions."""
import math
def any_scale(scale):
"""Scale helper function that allows any scale."""
return scale
def sequence_scale(scale, scale_sequence):
"""Sequence scale helper, ... | |
a8b2930754fd4c62f2393e60826c2e089c6761a4 | shopify_auth/models.py | shopify_auth/models.py | from django.conf import settings
from django.db import models
from django.contrib.auth.models import AbstractBaseUser, BaseUserManager
class ShopUserManager(BaseUserManager):
def create_user(self, myshopify_domain, domain, password = None):
"""
Creates and saves a ShopUser with the given domains ... | Add an abstract ShopUser base class that other apps can extend for their auth user. | Add an abstract ShopUser base class that other apps can extend for their auth user. | Python | mit | discolabs/django-shopify-auth,RafaAguilar/django-shopify-auth,funkybob/django-shopify-auth,funkybob/django-shopify-auth,discolabs/django-shopify-auth,RafaAguilar/django-shopify-auth | Add an abstract ShopUser base class that other apps can extend for their auth user. | from django.conf import settings
from django.db import models
from django.contrib.auth.models import AbstractBaseUser, BaseUserManager
class ShopUserManager(BaseUserManager):
def create_user(self, myshopify_domain, domain, password = None):
"""
Creates and saves a ShopUser with the given domains ... | <commit_before><commit_msg>Add an abstract ShopUser base class that other apps can extend for their auth user.<commit_after> | from django.conf import settings
from django.db import models
from django.contrib.auth.models import AbstractBaseUser, BaseUserManager
class ShopUserManager(BaseUserManager):
def create_user(self, myshopify_domain, domain, password = None):
"""
Creates and saves a ShopUser with the given domains ... | Add an abstract ShopUser base class that other apps can extend for their auth user.from django.conf import settings
from django.db import models
from django.contrib.auth.models import AbstractBaseUser, BaseUserManager
class ShopUserManager(BaseUserManager):
def create_user(self, myshopify_domain, domain, passwor... | <commit_before><commit_msg>Add an abstract ShopUser base class that other apps can extend for their auth user.<commit_after>from django.conf import settings
from django.db import models
from django.contrib.auth.models import AbstractBaseUser, BaseUserManager
class ShopUserManager(BaseUserManager):
def create_use... | |
43d1ad2924ba0cf605628ddbfd17eee0e55c08b6 | security/migrations/0002_convert_pass_expiry_user_to_one2one.py | security/migrations/0002_convert_pass_expiry_user_to_one2one.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('security', '0001_initial'),
]
operations = [
migrations.Al... | Add password expiry user migration | Add password expiry user migration
| Python | bsd-3-clause | MartinPetkov/django-security,MartinPetkov/django-security | Add password expiry user migration | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('security', '0001_initial'),
]
operations = [
migrations.Al... | <commit_before><commit_msg>Add password expiry user migration<commit_after> | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('security', '0001_initial'),
]
operations = [
migrations.Al... | Add password expiry user migration# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('security', '0001_initial'),
]
op... | <commit_before><commit_msg>Add password expiry user migration<commit_after># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('... | |
da59e27fe4176e23ec305f9a7143b288521db6ef | src/ggrc/converters/handlers/request.py | src/ggrc/converters/handlers/request.py | # Copyright (C) 2016 Google Inc., authors, and contributors <see AUTHORS file>
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
# Created By: miha@reciprocitylabs.com
# Maintained By: miha@reciprocitylabs.com
"""Handlers for request specific columns."""
from ggrc.converters.handlers impo... | # Copyright (C) 2016 Google Inc., authors, and contributors <see AUTHORS file>
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
# Created By: miha@reciprocitylabs.com
# Maintained By: miha@reciprocitylabs.com
"""Handlers for request specific columns."""
from ggrc.converters.handlers impo... | Update Request object import to use statusable attributes | Update Request object import to use statusable attributes
| Python | apache-2.0 | kr41/ggrc-core,j0gurt/ggrc-core,kr41/ggrc-core,josthkko/ggrc-core,selahssea/ggrc-core,prasannav7/ggrc-core,edofic/ggrc-core,plamut/ggrc-core,josthkko/ggrc-core,selahssea/ggrc-core,prasannav7/ggrc-core,VinnieJohns/ggrc-core,andrei-karalionak/ggrc-core,selahssea/ggrc-core,j0gurt/ggrc-core,edofic/ggrc-core,AleksNeStu/ggrc... | # Copyright (C) 2016 Google Inc., authors, and contributors <see AUTHORS file>
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
# Created By: miha@reciprocitylabs.com
# Maintained By: miha@reciprocitylabs.com
"""Handlers for request specific columns."""
from ggrc.converters.handlers impo... | # Copyright (C) 2016 Google Inc., authors, and contributors <see AUTHORS file>
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
# Created By: miha@reciprocitylabs.com
# Maintained By: miha@reciprocitylabs.com
"""Handlers for request specific columns."""
from ggrc.converters.handlers impo... | <commit_before># Copyright (C) 2016 Google Inc., authors, and contributors <see AUTHORS file>
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
# Created By: miha@reciprocitylabs.com
# Maintained By: miha@reciprocitylabs.com
"""Handlers for request specific columns."""
from ggrc.converter... | # Copyright (C) 2016 Google Inc., authors, and contributors <see AUTHORS file>
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
# Created By: miha@reciprocitylabs.com
# Maintained By: miha@reciprocitylabs.com
"""Handlers for request specific columns."""
from ggrc.converters.handlers impo... | # Copyright (C) 2016 Google Inc., authors, and contributors <see AUTHORS file>
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
# Created By: miha@reciprocitylabs.com
# Maintained By: miha@reciprocitylabs.com
"""Handlers for request specific columns."""
from ggrc.converters.handlers impo... | <commit_before># Copyright (C) 2016 Google Inc., authors, and contributors <see AUTHORS file>
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
# Created By: miha@reciprocitylabs.com
# Maintained By: miha@reciprocitylabs.com
"""Handlers for request specific columns."""
from ggrc.converter... |
2b2a68191715e37314378b87ccfb30a2cb2a8e13 | numba/tests/test_profiler.py | numba/tests/test_profiler.py | import numpy as np
import cProfile as profiler
import pstats
from numba import jit
from numba import unittest_support as unittest
def dot(a, b):
sum=0
for i in range(len(a)):
sum += a[i]*b[i]
return sum
class TestProfiler(unittest.TestCase):
def test_profiler(self):
"""Make sure the ... | Add test to verify that jit-compiled functions show up in the profile stats. | Add test to verify that jit-compiled functions show up in the profile stats.
| Python | bsd-2-clause | stefanseefeld/numba,jriehl/numba,seibert/numba,cpcloud/numba,numba/numba,gmarkall/numba,IntelLabs/numba,stefanseefeld/numba,sklam/numba,jriehl/numba,stuartarchibald/numba,seibert/numba,stefanseefeld/numba,IntelLabs/numba,numba/numba,IntelLabs/numba,IntelLabs/numba,stuartarchibald/numba,stuartarchibald/numba,stuartarchi... | Add test to verify that jit-compiled functions show up in the profile stats. | import numpy as np
import cProfile as profiler
import pstats
from numba import jit
from numba import unittest_support as unittest
def dot(a, b):
sum=0
for i in range(len(a)):
sum += a[i]*b[i]
return sum
class TestProfiler(unittest.TestCase):
def test_profiler(self):
"""Make sure the ... | <commit_before><commit_msg>Add test to verify that jit-compiled functions show up in the profile stats.<commit_after> | import numpy as np
import cProfile as profiler
import pstats
from numba import jit
from numba import unittest_support as unittest
def dot(a, b):
sum=0
for i in range(len(a)):
sum += a[i]*b[i]
return sum
class TestProfiler(unittest.TestCase):
def test_profiler(self):
"""Make sure the ... | Add test to verify that jit-compiled functions show up in the profile stats.import numpy as np
import cProfile as profiler
import pstats
from numba import jit
from numba import unittest_support as unittest
def dot(a, b):
sum=0
for i in range(len(a)):
sum += a[i]*b[i]
return sum
class TestProfiler... | <commit_before><commit_msg>Add test to verify that jit-compiled functions show up in the profile stats.<commit_after>import numpy as np
import cProfile as profiler
import pstats
from numba import jit
from numba import unittest_support as unittest
def dot(a, b):
sum=0
for i in range(len(a)):
sum += a[i]... | |
229cd1c8dec92010074bad6c6081142f3e551026 | py/guess-number-higher-or-lower-ii.py | py/guess-number-higher-or-lower-ii.py | class Solution(object):
def getMoneyAmount(self, n, table=dict()):
"""
:type n: int
:rtype: int
"""
def dp(L, U):
if (L, U) not in table:
if L + 1 >= U:
table[L, U] = 0
else:
table[L, U] = min... | Add py solution for 375. Guess Number Higher or Lower II | Add py solution for 375. Guess Number Higher or Lower II
375. Guess Number Higher or Lower II: https://leetcode.com/problems/guess-number-higher-or-lower-ii/
| Python | apache-2.0 | ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode | Add py solution for 375. Guess Number Higher or Lower II
375. Guess Number Higher or Lower II: https://leetcode.com/problems/guess-number-higher-or-lower-ii/ | class Solution(object):
def getMoneyAmount(self, n, table=dict()):
"""
:type n: int
:rtype: int
"""
def dp(L, U):
if (L, U) not in table:
if L + 1 >= U:
table[L, U] = 0
else:
table[L, U] = min... | <commit_before><commit_msg>Add py solution for 375. Guess Number Higher or Lower II
375. Guess Number Higher or Lower II: https://leetcode.com/problems/guess-number-higher-or-lower-ii/<commit_after> | class Solution(object):
def getMoneyAmount(self, n, table=dict()):
"""
:type n: int
:rtype: int
"""
def dp(L, U):
if (L, U) not in table:
if L + 1 >= U:
table[L, U] = 0
else:
table[L, U] = min... | Add py solution for 375. Guess Number Higher or Lower II
375. Guess Number Higher or Lower II: https://leetcode.com/problems/guess-number-higher-or-lower-ii/class Solution(object):
def getMoneyAmount(self, n, table=dict()):
"""
:type n: int
:rtype: int
"""
def dp(L, U):
... | <commit_before><commit_msg>Add py solution for 375. Guess Number Higher or Lower II
375. Guess Number Higher or Lower II: https://leetcode.com/problems/guess-number-higher-or-lower-ii/<commit_after>class Solution(object):
def getMoneyAmount(self, n, table=dict()):
"""
:type n: int
:rtype: i... | |
609e0b76680156584bb1e06aa10a5425c55f8c01 | wagtail/utils/widgets.py | wagtail/utils/widgets.py | from django.forms.widgets import Widget
from django.utils.safestring import mark_safe
class WidgetWithScript(Widget):
def render(self, name, value, attrs=None):
widget = super(WidgetWithScript, self).render(name, value, attrs)
final_attrs = self.build_attrs(attrs, name=name)
id_ = final_a... | from __future__ import absolute_import, unicode_literals
from django.forms.widgets import Widget
from django.utils.safestring import mark_safe
class WidgetWithScript(Widget):
def render(self, name, value, attrs=None):
widget = super(WidgetWithScript, self).render(name, value, attrs)
final_attrs ... | Fix unicode error caused by ascii format string | Fix unicode error caused by ascii format string
| Python | bsd-3-clause | JoshBarr/wagtail,zerolab/wagtail,benjaoming/wagtail,takeshineshiro/wagtail,jordij/wagtail,iho/wagtail,chrxr/wagtail,iansprice/wagtail,mayapurmedia/wagtail,janusnic/wagtail,jordij/wagtail,kurtw/wagtail,jordij/wagtail,Klaudit/wagtail,jnns/wagtail,bjesus/wagtail,JoshBarr/wagtail,mikedingjan/wagtail,darith27/wagtail,takefl... | from django.forms.widgets import Widget
from django.utils.safestring import mark_safe
class WidgetWithScript(Widget):
def render(self, name, value, attrs=None):
widget = super(WidgetWithScript, self).render(name, value, attrs)
final_attrs = self.build_attrs(attrs, name=name)
id_ = final_a... | from __future__ import absolute_import, unicode_literals
from django.forms.widgets import Widget
from django.utils.safestring import mark_safe
class WidgetWithScript(Widget):
def render(self, name, value, attrs=None):
widget = super(WidgetWithScript, self).render(name, value, attrs)
final_attrs ... | <commit_before>from django.forms.widgets import Widget
from django.utils.safestring import mark_safe
class WidgetWithScript(Widget):
def render(self, name, value, attrs=None):
widget = super(WidgetWithScript, self).render(name, value, attrs)
final_attrs = self.build_attrs(attrs, name=name)
... | from __future__ import absolute_import, unicode_literals
from django.forms.widgets import Widget
from django.utils.safestring import mark_safe
class WidgetWithScript(Widget):
def render(self, name, value, attrs=None):
widget = super(WidgetWithScript, self).render(name, value, attrs)
final_attrs ... | from django.forms.widgets import Widget
from django.utils.safestring import mark_safe
class WidgetWithScript(Widget):
def render(self, name, value, attrs=None):
widget = super(WidgetWithScript, self).render(name, value, attrs)
final_attrs = self.build_attrs(attrs, name=name)
id_ = final_a... | <commit_before>from django.forms.widgets import Widget
from django.utils.safestring import mark_safe
class WidgetWithScript(Widget):
def render(self, name, value, attrs=None):
widget = super(WidgetWithScript, self).render(name, value, attrs)
final_attrs = self.build_attrs(attrs, name=name)
... |
576d4b27d30f3bd827dfc53bf55ab6f7c95866a5 | specchio/utils.py | specchio/utils.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import fnmatch
def get_re_from_single_line(line):
"""Get regular expression from a single line in `.gitignore`
The rules of `.gitingore` followed http://git-scm.com/docs/gitignore
:param line: str -- single line from `.gitignore`
:return: tuple
0... | Add func to get regular expression from a single line in `.gitignore` | Add func to get regular expression from a single line in `.gitignore`
The rule of the func followed http://git-scm.com/docs/gitignore
| Python | mit | brickgao/specchio | Add func to get regular expression from a single line in `.gitignore`
The rule of the func followed http://git-scm.com/docs/gitignore | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import fnmatch
def get_re_from_single_line(line):
"""Get regular expression from a single line in `.gitignore`
The rules of `.gitingore` followed http://git-scm.com/docs/gitignore
:param line: str -- single line from `.gitignore`
:return: tuple
0... | <commit_before><commit_msg>Add func to get regular expression from a single line in `.gitignore`
The rule of the func followed http://git-scm.com/docs/gitignore<commit_after> | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import fnmatch
def get_re_from_single_line(line):
"""Get regular expression from a single line in `.gitignore`
The rules of `.gitingore` followed http://git-scm.com/docs/gitignore
:param line: str -- single line from `.gitignore`
:return: tuple
0... | Add func to get regular expression from a single line in `.gitignore`
The rule of the func followed http://git-scm.com/docs/gitignore#!/usr/bin/env python
# -*- coding: utf-8 -*-
import fnmatch
def get_re_from_single_line(line):
"""Get regular expression from a single line in `.gitignore`
The rules of `.git... | <commit_before><commit_msg>Add func to get regular expression from a single line in `.gitignore`
The rule of the func followed http://git-scm.com/docs/gitignore<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-
import fnmatch
def get_re_from_single_line(line):
"""Get regular expression from a single li... | |
61e002969e63995a1355f51b58a0ec98d7a12532 | froide/publicbody/migrations/0022_auto_20180726_1151.py | froide/publicbody/migrations/0022_auto_20180726_1151.py | # -*- coding: utf-8 -*-
# Generated by Django 1.11.14 on 2018-07-26 09:51
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('publicbody', '0021_proposedpublicbody'),
]
operations = [
migrations.AlterModelOpt... | Add order to proposed public bodies | Add order to proposed public bodies | Python | mit | fin/froide,stefanw/froide,fin/froide,fin/froide,stefanw/froide,fin/froide,stefanw/froide,stefanw/froide,stefanw/froide | Add order to proposed public bodies | # -*- coding: utf-8 -*-
# Generated by Django 1.11.14 on 2018-07-26 09:51
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('publicbody', '0021_proposedpublicbody'),
]
operations = [
migrations.AlterModelOpt... | <commit_before><commit_msg>Add order to proposed public bodies<commit_after> | # -*- coding: utf-8 -*-
# Generated by Django 1.11.14 on 2018-07-26 09:51
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('publicbody', '0021_proposedpublicbody'),
]
operations = [
migrations.AlterModelOpt... | Add order to proposed public bodies# -*- coding: utf-8 -*-
# Generated by Django 1.11.14 on 2018-07-26 09:51
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('publicbody', '0021_proposedpublicbody'),
]
operations =... | <commit_before><commit_msg>Add order to proposed public bodies<commit_after># -*- coding: utf-8 -*-
# Generated by Django 1.11.14 on 2018-07-26 09:51
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('publicbody', '0021_prop... | |
5d404ecd05b46697e90e60775541eff33ac2cb22 | functional/tests/network/v2/test_ip_availability.py | functional/tests/network/v2/test_ip_availability.py | # 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 writing, software
# d... | Add functional tests for IP availability | Add functional tests for IP availability
This patch adds functional tests for IP availability
Partially-Implements: blueprint neutron-ip-capacity
Change-Id: I1c1dc01801707fe8f0dc3c976e5d345d2b0db0ec
| Python | apache-2.0 | redhat-openstack/python-openstackclient,openstack/python-openstackclient,dtroyer/python-openstackclient,redhat-openstack/python-openstackclient,openstack/python-openstackclient,dtroyer/python-openstackclient | Add functional tests for IP availability
This patch adds functional tests for IP availability
Partially-Implements: blueprint neutron-ip-capacity
Change-Id: I1c1dc01801707fe8f0dc3c976e5d345d2b0db0ec | # 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 writing, software
# d... | <commit_before><commit_msg>Add functional tests for IP availability
This patch adds functional tests for IP availability
Partially-Implements: blueprint neutron-ip-capacity
Change-Id: I1c1dc01801707fe8f0dc3c976e5d345d2b0db0ec<commit_after> | # 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 writing, software
# d... | Add functional tests for IP availability
This patch adds functional tests for IP availability
Partially-Implements: blueprint neutron-ip-capacity
Change-Id: I1c1dc01801707fe8f0dc3c976e5d345d2b0db0ec# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance... | <commit_before><commit_msg>Add functional tests for IP availability
This patch adds functional tests for IP availability
Partially-Implements: blueprint neutron-ip-capacity
Change-Id: I1c1dc01801707fe8f0dc3c976e5d345d2b0db0ec<commit_after># Licensed under the Apache License, Version 2.0 (the "License"); you may
# ... | |
8cc5c817115cac86f46d271ba52e1e0af4251bfe | analysis_plot_granule_fig.py | analysis_plot_granule_fig.py | # -*- coding:utf-8 -*-
"""
Select a specific simulation from a HDF5 file and plot its granule figure.
"""
import numpy as np
import matplotlib.pyplot as plt
import tables
import h5manager as h5m
from plotting import granule_pop_figure
from analysis import fftmax
plt.ion()
DB_FILENAME = "db_two_glom_beta_new_ps_in... | Add a plot script for std figure of choosen simu | Add a plot script for std figure of choosen simu
| Python | mit | neuro-lyon/multiglom-model,neuro-lyon/multiglom-model | Add a plot script for std figure of choosen simu | # -*- coding:utf-8 -*-
"""
Select a specific simulation from a HDF5 file and plot its granule figure.
"""
import numpy as np
import matplotlib.pyplot as plt
import tables
import h5manager as h5m
from plotting import granule_pop_figure
from analysis import fftmax
plt.ion()
DB_FILENAME = "db_two_glom_beta_new_ps_in... | <commit_before><commit_msg>Add a plot script for std figure of choosen simu<commit_after> | # -*- coding:utf-8 -*-
"""
Select a specific simulation from a HDF5 file and plot its granule figure.
"""
import numpy as np
import matplotlib.pyplot as plt
import tables
import h5manager as h5m
from plotting import granule_pop_figure
from analysis import fftmax
plt.ion()
DB_FILENAME = "db_two_glom_beta_new_ps_in... | Add a plot script for std figure of choosen simu# -*- coding:utf-8 -*-
"""
Select a specific simulation from a HDF5 file and plot its granule figure.
"""
import numpy as np
import matplotlib.pyplot as plt
import tables
import h5manager as h5m
from plotting import granule_pop_figure
from analysis import fftmax
plt.... | <commit_before><commit_msg>Add a plot script for std figure of choosen simu<commit_after># -*- coding:utf-8 -*-
"""
Select a specific simulation from a HDF5 file and plot its granule figure.
"""
import numpy as np
import matplotlib.pyplot as plt
import tables
import h5manager as h5m
from plotting import granule_pop... | |
d98d834aaadc49f0f4102f8f4acac96b09ea42b3 | mdtraj/tests/test_load.py | mdtraj/tests/test_load.py | ##############################################################################
# MDTraj: A Python Library for Loading, Saving, and Manipulating
# Molecular Dynamics Trajectories.
# Copyright 2012-2013 Stanford University and the Authors
#
# Authors: Robert McGibbon
# Contributors:
#
# MDTraj is free software: y... | Add tests for improved loading functionality. | Add tests for improved loading functionality.
| Python | lgpl-2.1 | leeping/mdtraj,ctk3b/mdtraj,tcmoore3/mdtraj,mattwthompson/mdtraj,msultan/mdtraj,tcmoore3/mdtraj,msultan/mdtraj,msultan/mdtraj,mdtraj/mdtraj,tcmoore3/mdtraj,ctk3b/mdtraj,tcmoore3/mdtraj,gph82/mdtraj,leeping/mdtraj,rmcgibbo/mdtraj,ctk3b/mdtraj,jchodera/mdtraj,dwhswenson/mdtraj,dwhswenson/mdtraj,rmcgibbo/mdtraj,mattwthomp... | Add tests for improved loading functionality. | ##############################################################################
# MDTraj: A Python Library for Loading, Saving, and Manipulating
# Molecular Dynamics Trajectories.
# Copyright 2012-2013 Stanford University and the Authors
#
# Authors: Robert McGibbon
# Contributors:
#
# MDTraj is free software: y... | <commit_before><commit_msg>Add tests for improved loading functionality.<commit_after> | ##############################################################################
# MDTraj: A Python Library for Loading, Saving, and Manipulating
# Molecular Dynamics Trajectories.
# Copyright 2012-2013 Stanford University and the Authors
#
# Authors: Robert McGibbon
# Contributors:
#
# MDTraj is free software: y... | Add tests for improved loading functionality.##############################################################################
# MDTraj: A Python Library for Loading, Saving, and Manipulating
# Molecular Dynamics Trajectories.
# Copyright 2012-2013 Stanford University and the Authors
#
# Authors: Robert McGibbon
#... | <commit_before><commit_msg>Add tests for improved loading functionality.<commit_after>##############################################################################
# MDTraj: A Python Library for Loading, Saving, and Manipulating
# Molecular Dynamics Trajectories.
# Copyright 2012-2013 Stanford University and t... | |
245206b164d1b55aa68a97e88d1e2fe8fec8f7b9 | exercises/chapter_08/exercise_08_12/exercise_08_12.py | exercises/chapter_08/exercise_08_12/exercise_08_12.py | # 8-12. Sandwiches
def make_sandwich(*ingredients):
"""Print the ingredients in the sandwich"""
print ("Making a sandwich with the following ingredients:")
for ingredient in ingredients:
print("\t- " + ingredient)
print("\n")
make_sandwich("Flatbread", "American Cheese", "Green Peppers")
make_sandwich("Italian... | Add solution to exercise 8.12. | Add solution to exercise 8.12.
| Python | mit | HenrikSamuelsson/python-crash-course | Add solution to exercise 8.12. | # 8-12. Sandwiches
def make_sandwich(*ingredients):
"""Print the ingredients in the sandwich"""
print ("Making a sandwich with the following ingredients:")
for ingredient in ingredients:
print("\t- " + ingredient)
print("\n")
make_sandwich("Flatbread", "American Cheese", "Green Peppers")
make_sandwich("Italian... | <commit_before><commit_msg>Add solution to exercise 8.12.<commit_after> | # 8-12. Sandwiches
def make_sandwich(*ingredients):
"""Print the ingredients in the sandwich"""
print ("Making a sandwich with the following ingredients:")
for ingredient in ingredients:
print("\t- " + ingredient)
print("\n")
make_sandwich("Flatbread", "American Cheese", "Green Peppers")
make_sandwich("Italian... | Add solution to exercise 8.12.# 8-12. Sandwiches
def make_sandwich(*ingredients):
"""Print the ingredients in the sandwich"""
print ("Making a sandwich with the following ingredients:")
for ingredient in ingredients:
print("\t- " + ingredient)
print("\n")
make_sandwich("Flatbread", "American Cheese", "Green Pe... | <commit_before><commit_msg>Add solution to exercise 8.12.<commit_after># 8-12. Sandwiches
def make_sandwich(*ingredients):
"""Print the ingredients in the sandwich"""
print ("Making a sandwich with the following ingredients:")
for ingredient in ingredients:
print("\t- " + ingredient)
print("\n")
make_sandwich(... | |
12c2e1bfee2a6a8dae3dd4f38c9a6577f4e40f1a | lms/tests.py | lms/tests.py | """Tests for the lms module itself."""
from django.test import TestCase
from edxmako import add_lookup, LOOKUP
from lms import startup
class TemplateLookupTests(TestCase):
"""
Tests for TemplateLookup.
"""
def test_add_lookup_to_main(self):
"""Test that any template directories added are not... | Test TemplateLookup dirs are not cleared during lms startup. | Test TemplateLookup dirs are not cleared during lms startup.
LMS-2498
| Python | agpl-3.0 | ahmadiga/min_edx,mushtaqak/edx-platform,ferabra/edx-platform,hastexo/edx-platform,kursitet/edx-platform,kmoocdev/edx-platform,shubhdev/openedx,y12uc231/edx-platform,cecep-edu/edx-platform,mtlchun/edx,Stanford-Online/edx-platform,nanolearningllc/edx-platform-cypress,chudaol/edx-platform,devs1991/test_edx_docmode,ahmedal... | Test TemplateLookup dirs are not cleared during lms startup.
LMS-2498 | """Tests for the lms module itself."""
from django.test import TestCase
from edxmako import add_lookup, LOOKUP
from lms import startup
class TemplateLookupTests(TestCase):
"""
Tests for TemplateLookup.
"""
def test_add_lookup_to_main(self):
"""Test that any template directories added are not... | <commit_before><commit_msg>Test TemplateLookup dirs are not cleared during lms startup.
LMS-2498<commit_after> | """Tests for the lms module itself."""
from django.test import TestCase
from edxmako import add_lookup, LOOKUP
from lms import startup
class TemplateLookupTests(TestCase):
"""
Tests for TemplateLookup.
"""
def test_add_lookup_to_main(self):
"""Test that any template directories added are not... | Test TemplateLookup dirs are not cleared during lms startup.
LMS-2498"""Tests for the lms module itself."""
from django.test import TestCase
from edxmako import add_lookup, LOOKUP
from lms import startup
class TemplateLookupTests(TestCase):
"""
Tests for TemplateLookup.
"""
def test_add_lookup_to_m... | <commit_before><commit_msg>Test TemplateLookup dirs are not cleared during lms startup.
LMS-2498<commit_after>"""Tests for the lms module itself."""
from django.test import TestCase
from edxmako import add_lookup, LOOKUP
from lms import startup
class TemplateLookupTests(TestCase):
"""
Tests for TemplateLook... | |
5dc0061d912bf660c7e7885bd2a42f5b92834b7b | scripts/update_taxonomies.py | scripts/update_taxonomies.py | import os
import json
from framework.mongo import set_up_storage
from website import settings
from website.project.taxonomies import Subject
from modularodm import Q, storage
from modularodm.exceptions import NoResultsFound, MultipleResultsFound
def update_taxonomies():
# Flat taxonomy is stored locally, read i... | Add a script that loads the taxonomies as a standalone thing | Add a script that loads the taxonomies as a standalone thing
| Python | apache-2.0 | acshi/osf.io,aaxelb/osf.io,chrisseto/osf.io,cwisecarver/osf.io,mluo613/osf.io,acshi/osf.io,caneruguz/osf.io,sloria/osf.io,CenterForOpenScience/osf.io,crcresearch/osf.io,mattclark/osf.io,Johnetordoff/osf.io,laurenrevere/osf.io,monikagrabowska/osf.io,felliott/osf.io,saradbowman/osf.io,pattisdr/osf.io,crcresearch/osf.io,b... | Add a script that loads the taxonomies as a standalone thing | import os
import json
from framework.mongo import set_up_storage
from website import settings
from website.project.taxonomies import Subject
from modularodm import Q, storage
from modularodm.exceptions import NoResultsFound, MultipleResultsFound
def update_taxonomies():
# Flat taxonomy is stored locally, read i... | <commit_before><commit_msg>Add a script that loads the taxonomies as a standalone thing<commit_after> | import os
import json
from framework.mongo import set_up_storage
from website import settings
from website.project.taxonomies import Subject
from modularodm import Q, storage
from modularodm.exceptions import NoResultsFound, MultipleResultsFound
def update_taxonomies():
# Flat taxonomy is stored locally, read i... | Add a script that loads the taxonomies as a standalone thingimport os
import json
from framework.mongo import set_up_storage
from website import settings
from website.project.taxonomies import Subject
from modularodm import Q, storage
from modularodm.exceptions import NoResultsFound, MultipleResultsFound
def update... | <commit_before><commit_msg>Add a script that loads the taxonomies as a standalone thing<commit_after>import os
import json
from framework.mongo import set_up_storage
from website import settings
from website.project.taxonomies import Subject
from modularodm import Q, storage
from modularodm.exceptions import NoResult... | |
a3ffef803d3bde1bb771217f3ed5dd4509a2c82c | tests/test_03_login.py | tests/test_03_login.py | """Test login to an ICAT server.
"""
from __future__ import print_function
import pytest
import icat
import icat.config
# Try out three different users: root, useroffice, and acord. Normal
# users like acord might use a different authentication plugin then
# system users as root and useroffice. We want to try out b... | Add test to login to the ICAT server. | Add test to login to the ICAT server.
| Python | apache-2.0 | icatproject/python-icat | Add test to login to the ICAT server. | """Test login to an ICAT server.
"""
from __future__ import print_function
import pytest
import icat
import icat.config
# Try out three different users: root, useroffice, and acord. Normal
# users like acord might use a different authentication plugin then
# system users as root and useroffice. We want to try out b... | <commit_before><commit_msg>Add test to login to the ICAT server.<commit_after> | """Test login to an ICAT server.
"""
from __future__ import print_function
import pytest
import icat
import icat.config
# Try out three different users: root, useroffice, and acord. Normal
# users like acord might use a different authentication plugin then
# system users as root and useroffice. We want to try out b... | Add test to login to the ICAT server."""Test login to an ICAT server.
"""
from __future__ import print_function
import pytest
import icat
import icat.config
# Try out three different users: root, useroffice, and acord. Normal
# users like acord might use a different authentication plugin then
# system users as root ... | <commit_before><commit_msg>Add test to login to the ICAT server.<commit_after>"""Test login to an ICAT server.
"""
from __future__ import print_function
import pytest
import icat
import icat.config
# Try out three different users: root, useroffice, and acord. Normal
# users like acord might use a different authentic... | |
0777f77dc2f8a25da7cb572bf4f9e36c7f88fc26 | tests/test_validate.py | tests/test_validate.py | """tests/test_validate.py.
Tests to ensure hug's custom validation methods work as expected
Copyright (C) 2015 Timothy Edmund Crosley
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 rest... | Implement tests for validate module | Implement tests for validate module
| Python | mit | timothycrosley/hug,MuhammadAlkarouri/hug,timothycrosley/hug,timothycrosley/hug,MuhammadAlkarouri/hug,MuhammadAlkarouri/hug | Implement tests for validate module | """tests/test_validate.py.
Tests to ensure hug's custom validation methods work as expected
Copyright (C) 2015 Timothy Edmund Crosley
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 rest... | <commit_before><commit_msg>Implement tests for validate module<commit_after> | """tests/test_validate.py.
Tests to ensure hug's custom validation methods work as expected
Copyright (C) 2015 Timothy Edmund Crosley
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 rest... | Implement tests for validate module"""tests/test_validate.py.
Tests to ensure hug's custom validation methods work as expected
Copyright (C) 2015 Timothy Edmund Crosley
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the "Software"), t... | <commit_before><commit_msg>Implement tests for validate module<commit_after>"""tests/test_validate.py.
Tests to ensure hug's custom validation methods work as expected
Copyright (C) 2015 Timothy Edmund Crosley
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associate... | |
da1e46d550669970ce0188d417af3764a046a33f | sara_flexbe_states/src/sara_flexbe_states/WonderlandAddPerson.py | sara_flexbe_states/src/sara_flexbe_states/WonderlandAddPerson.py | #!/usr/bin/env python
# encoding=utf8
import json
import requests
from flexbe_core import EventState, Logger
"""
Created on 17/05/2018
@author: Lucas Maurice
"""
class WonderlandAddPerson(EventState):
'''
Add a person.
># entity sara_msgs/Entity
<= done retur... | Add a step for add a person in Wonderland database. | Add a step for add a person in Wonderland database.
| Python | bsd-3-clause | WalkingMachine/sara_behaviors,WalkingMachine/sara_behaviors | Add a step for add a person in Wonderland database. | #!/usr/bin/env python
# encoding=utf8
import json
import requests
from flexbe_core import EventState, Logger
"""
Created on 17/05/2018
@author: Lucas Maurice
"""
class WonderlandAddPerson(EventState):
'''
Add a person.
># entity sara_msgs/Entity
<= done retur... | <commit_before><commit_msg>Add a step for add a person in Wonderland database.<commit_after> | #!/usr/bin/env python
# encoding=utf8
import json
import requests
from flexbe_core import EventState, Logger
"""
Created on 17/05/2018
@author: Lucas Maurice
"""
class WonderlandAddPerson(EventState):
'''
Add a person.
># entity sara_msgs/Entity
<= done retur... | Add a step for add a person in Wonderland database.#!/usr/bin/env python
# encoding=utf8
import json
import requests
from flexbe_core import EventState, Logger
"""
Created on 17/05/2018
@author: Lucas Maurice
"""
class WonderlandAddPerson(EventState):
'''
Add a person.
># entity sara... | <commit_before><commit_msg>Add a step for add a person in Wonderland database.<commit_after>#!/usr/bin/env python
# encoding=utf8
import json
import requests
from flexbe_core import EventState, Logger
"""
Created on 17/05/2018
@author: Lucas Maurice
"""
class WonderlandAddPerson(EventState):
'''
Add a per... | |
269dbda9c702ddd4809632558a73f4e4eae31d89 | scripts/python/light_rpi.py | scripts/python/light_rpi.py | #
# IAS Basic device framework.
#
# Author: Joeri Hermans
#
import sys
import socket
import struct
import os
import RPIO
# Global members, which are required for the communication
# with the remote IAS controller.
gDeviceIdentifier = sys.argv[1]
gControllerAddress = sys.argv[2]
gControllerPort = int(sys.argv[3])
gPin... | Add script to control lights from Raspberry Pi. | Add script to control lights from Raspberry Pi.
| Python | apache-2.0 | JoeriHermans/Intelligent-Automation-System,JoeriHermans/Intelligent-Automation-System,JoeriHermans/Intelligent-Automation-System,JoeriHermans/Intelligent-Automation-System | Add script to control lights from Raspberry Pi. | #
# IAS Basic device framework.
#
# Author: Joeri Hermans
#
import sys
import socket
import struct
import os
import RPIO
# Global members, which are required for the communication
# with the remote IAS controller.
gDeviceIdentifier = sys.argv[1]
gControllerAddress = sys.argv[2]
gControllerPort = int(sys.argv[3])
gPin... | <commit_before><commit_msg>Add script to control lights from Raspberry Pi.<commit_after> | #
# IAS Basic device framework.
#
# Author: Joeri Hermans
#
import sys
import socket
import struct
import os
import RPIO
# Global members, which are required for the communication
# with the remote IAS controller.
gDeviceIdentifier = sys.argv[1]
gControllerAddress = sys.argv[2]
gControllerPort = int(sys.argv[3])
gPin... | Add script to control lights from Raspberry Pi.#
# IAS Basic device framework.
#
# Author: Joeri Hermans
#
import sys
import socket
import struct
import os
import RPIO
# Global members, which are required for the communication
# with the remote IAS controller.
gDeviceIdentifier = sys.argv[1]
gControllerAddress = sys.... | <commit_before><commit_msg>Add script to control lights from Raspberry Pi.<commit_after>#
# IAS Basic device framework.
#
# Author: Joeri Hermans
#
import sys
import socket
import struct
import os
import RPIO
# Global members, which are required for the communication
# with the remote IAS controller.
gDeviceIdentifie... | |
332015ed4eceaa4eac9869c6e0553ad3beacd30a | test/os_win7.py | test/os_win7.py | #!/usr/bin/env python
"""
mbed SDK
Copyright (c) 2011-2015 ARM Limited
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 ... | Test win 7 with winreg module mock | Test win 7 with winreg module mock
| Python | apache-2.0 | jupe/mbed-ls,jupe/mbed-ls | Test win 7 with winreg module mock | #!/usr/bin/env python
"""
mbed SDK
Copyright (c) 2011-2015 ARM Limited
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>Test win 7 with winreg module mock<commit_after> | #!/usr/bin/env python
"""
mbed SDK
Copyright (c) 2011-2015 ARM Limited
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 ... | Test win 7 with winreg module mock#!/usr/bin/env python
"""
mbed SDK
Copyright (c) 2011-2015 ARM Limited
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... | <commit_before><commit_msg>Test win 7 with winreg module mock<commit_after>#!/usr/bin/env python
"""
mbed SDK
Copyright (c) 2011-2015 ARM Limited
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
... | |
d2dbe3b863418c10739e94d16e7f2a6f12c52524 | problem_builder/migrations/0002_auto_20160121_1525.py | problem_builder/migrations/0002_auto_20160121_1525.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('problem_builder', '0001_initial'),
]
... | Add in Django migration for shares. | Add in Django migration for shares.
| Python | agpl-3.0 | proversity-org/problem-builder,proversity-org/problem-builder,proversity-org/problem-builder | Add in Django migration for shares. | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('problem_builder', '0001_initial'),
]
... | <commit_before><commit_msg>Add in Django migration for shares.<commit_after> | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('problem_builder', '0001_initial'),
]
... | Add in Django migration for shares.# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('proble... | <commit_before><commit_msg>Add in Django migration for shares.<commit_after># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(se... | |
6536f808ad7cea2970ba5db46c9178dfc8739a1b | tests/unknownlength.py | tests/unknownlength.py | import progressbar
def test_unknown_length():
pb = progressbar.ProgressBar(widgets=[progressbar.AnimatedMarker()],
max_value=progressbar.UnknownLength)
assert pb.max_value is progressbar.UnknownLength
| Add failing test on Py3: initialising ProgressBar with UnknownLength | Add failing test on Py3: initialising ProgressBar with UnknownLength
| Python | bsd-3-clause | WoLpH/python-progressbar | Add failing test on Py3: initialising ProgressBar with UnknownLength | import progressbar
def test_unknown_length():
pb = progressbar.ProgressBar(widgets=[progressbar.AnimatedMarker()],
max_value=progressbar.UnknownLength)
assert pb.max_value is progressbar.UnknownLength
| <commit_before><commit_msg>Add failing test on Py3: initialising ProgressBar with UnknownLength<commit_after> | import progressbar
def test_unknown_length():
pb = progressbar.ProgressBar(widgets=[progressbar.AnimatedMarker()],
max_value=progressbar.UnknownLength)
assert pb.max_value is progressbar.UnknownLength
| Add failing test on Py3: initialising ProgressBar with UnknownLengthimport progressbar
def test_unknown_length():
pb = progressbar.ProgressBar(widgets=[progressbar.AnimatedMarker()],
max_value=progressbar.UnknownLength)
assert pb.max_value is progressbar.UnknownLength
| <commit_before><commit_msg>Add failing test on Py3: initialising ProgressBar with UnknownLength<commit_after>import progressbar
def test_unknown_length():
pb = progressbar.ProgressBar(widgets=[progressbar.AnimatedMarker()],
max_value=progressbar.UnknownLength)
assert pb.max_va... | |
7ee4bacff94874a0dd3a82360e4dcbd1ea73bc01 | python--learnings/lambda_map_filter_reduce.py | python--learnings/lambda_map_filter_reduce.py | #!/usr/bin/env python
#
# Topics: Lambdas, Maps, Filters, Reduce
#
# Background: Lambda examples and functionality, including maps, filters, and reduces.
#
# Sources:
# - https://www.python-course.eu/lambda.php
import unittest
from functools import reduce
# test functionality
class TestMethods(unittest.TestCase... | Add Python Lambda, Map, Filter, Reduce Test | Add Python Lambda, Map, Filter, Reduce Test
Add simple functionality for Lambda, Map, Filter, and Reduce.
| Python | mit | jekhokie/scriptbox,jekhokie/scriptbox,jekhokie/scriptbox,jekhokie/scriptbox,jekhokie/scriptbox,jekhokie/scriptbox,jekhokie/scriptbox,jekhokie/scriptbox | Add Python Lambda, Map, Filter, Reduce Test
Add simple functionality for Lambda, Map, Filter, and Reduce. | #!/usr/bin/env python
#
# Topics: Lambdas, Maps, Filters, Reduce
#
# Background: Lambda examples and functionality, including maps, filters, and reduces.
#
# Sources:
# - https://www.python-course.eu/lambda.php
import unittest
from functools import reduce
# test functionality
class TestMethods(unittest.TestCase... | <commit_before><commit_msg>Add Python Lambda, Map, Filter, Reduce Test
Add simple functionality for Lambda, Map, Filter, and Reduce.<commit_after> | #!/usr/bin/env python
#
# Topics: Lambdas, Maps, Filters, Reduce
#
# Background: Lambda examples and functionality, including maps, filters, and reduces.
#
# Sources:
# - https://www.python-course.eu/lambda.php
import unittest
from functools import reduce
# test functionality
class TestMethods(unittest.TestCase... | Add Python Lambda, Map, Filter, Reduce Test
Add simple functionality for Lambda, Map, Filter, and Reduce.#!/usr/bin/env python
#
# Topics: Lambdas, Maps, Filters, Reduce
#
# Background: Lambda examples and functionality, including maps, filters, and reduces.
#
# Sources:
# - https://www.python-course.eu/lambda.p... | <commit_before><commit_msg>Add Python Lambda, Map, Filter, Reduce Test
Add simple functionality for Lambda, Map, Filter, and Reduce.<commit_after>#!/usr/bin/env python
#
# Topics: Lambdas, Maps, Filters, Reduce
#
# Background: Lambda examples and functionality, including maps, filters, and reduces.
#
# Sources:
# ... | |
851631bd98139d4dd45c8fce6a080615d45283f4 | thinc/tests/unit/test_sparse_embed.py | thinc/tests/unit/test_sparse_embed.py | from ...neural._classes.sparse_embed import SparseEmbed
import numpy
def test_create_sparse_embed():
embed = SparseEmbed(300)
def test_predict_sparse_embed():
embed = SparseEmbed(300)
ids = numpy.ones((10,), dtype='uint64')
vectors = embed.predict(ids)
assert vectors.shape == (10, 300)
asser... | Add test for deprecated sparse_embed module | Add test for deprecated sparse_embed module
| Python | mit | spacy-io/thinc,spacy-io/thinc,explosion/thinc,explosion/thinc,explosion/thinc,explosion/thinc,spacy-io/thinc | Add test for deprecated sparse_embed module | from ...neural._classes.sparse_embed import SparseEmbed
import numpy
def test_create_sparse_embed():
embed = SparseEmbed(300)
def test_predict_sparse_embed():
embed = SparseEmbed(300)
ids = numpy.ones((10,), dtype='uint64')
vectors = embed.predict(ids)
assert vectors.shape == (10, 300)
asser... | <commit_before><commit_msg>Add test for deprecated sparse_embed module<commit_after> | from ...neural._classes.sparse_embed import SparseEmbed
import numpy
def test_create_sparse_embed():
embed = SparseEmbed(300)
def test_predict_sparse_embed():
embed = SparseEmbed(300)
ids = numpy.ones((10,), dtype='uint64')
vectors = embed.predict(ids)
assert vectors.shape == (10, 300)
asser... | Add test for deprecated sparse_embed modulefrom ...neural._classes.sparse_embed import SparseEmbed
import numpy
def test_create_sparse_embed():
embed = SparseEmbed(300)
def test_predict_sparse_embed():
embed = SparseEmbed(300)
ids = numpy.ones((10,), dtype='uint64')
vectors = embed.predict(ids)
... | <commit_before><commit_msg>Add test for deprecated sparse_embed module<commit_after>from ...neural._classes.sparse_embed import SparseEmbed
import numpy
def test_create_sparse_embed():
embed = SparseEmbed(300)
def test_predict_sparse_embed():
embed = SparseEmbed(300)
ids = numpy.ones((10,), dtype='uint6... | |
d9351b85301e701b7054acf57fb3be6b1a6cac01 | build_recipes.py | build_recipes.py | import argparse
import subprocess
parser = argparse.ArgumentParser()
parser.add_argument("package_list", help="List of packages for which" +
" recipies will be created")
args = parser.parse_args()
package_names = [package.strip() for package in
open(args.package_list, 'r').readlin... | Add script to build conda recipes | Add script to build conda recipes
Signed-off-by: Harsh Gupta <c4bd8559369e527b4bb1785ff84e8ff50fde87c0@gmail.com>
| Python | bsd-3-clause | ContinuumIO/pypi-conda-builds | Add script to build conda recipes
Signed-off-by: Harsh Gupta <c4bd8559369e527b4bb1785ff84e8ff50fde87c0@gmail.com> | import argparse
import subprocess
parser = argparse.ArgumentParser()
parser.add_argument("package_list", help="List of packages for which" +
" recipies will be created")
args = parser.parse_args()
package_names = [package.strip() for package in
open(args.package_list, 'r').readlin... | <commit_before><commit_msg>Add script to build conda recipes
Signed-off-by: Harsh Gupta <c4bd8559369e527b4bb1785ff84e8ff50fde87c0@gmail.com><commit_after> | import argparse
import subprocess
parser = argparse.ArgumentParser()
parser.add_argument("package_list", help="List of packages for which" +
" recipies will be created")
args = parser.parse_args()
package_names = [package.strip() for package in
open(args.package_list, 'r').readlin... | Add script to build conda recipes
Signed-off-by: Harsh Gupta <c4bd8559369e527b4bb1785ff84e8ff50fde87c0@gmail.com>import argparse
import subprocess
parser = argparse.ArgumentParser()
parser.add_argument("package_list", help="List of packages for which" +
" recipies will be created")
args = parser.p... | <commit_before><commit_msg>Add script to build conda recipes
Signed-off-by: Harsh Gupta <c4bd8559369e527b4bb1785ff84e8ff50fde87c0@gmail.com><commit_after>import argparse
import subprocess
parser = argparse.ArgumentParser()
parser.add_argument("package_list", help="List of packages for which" +
" r... | |
eec5e9e5bf467384b77aadf2aaf2a0176d7b3d7b | test.py | test.py | import argcommand
import argparse
##
class Say( argcommand.Command ):
what = argcommand.Argument( "WORD", default = "Something", help = "the text you want to print" )
times = argcommand.Argument( "--times", "-t", type = int, default = 1, metavar = "T", help = "how many times you want to repeat the text" )
... | Test classes from the README.md file | Test classes from the README.md file
| Python | mit | avinoamr/argcommand | Test classes from the README.md file | import argcommand
import argparse
##
class Say( argcommand.Command ):
what = argcommand.Argument( "WORD", default = "Something", help = "the text you want to print" )
times = argcommand.Argument( "--times", "-t", type = int, default = 1, metavar = "T", help = "how many times you want to repeat the text" )
... | <commit_before><commit_msg>Test classes from the README.md file<commit_after> | import argcommand
import argparse
##
class Say( argcommand.Command ):
what = argcommand.Argument( "WORD", default = "Something", help = "the text you want to print" )
times = argcommand.Argument( "--times", "-t", type = int, default = 1, metavar = "T", help = "how many times you want to repeat the text" )
... | Test classes from the README.md fileimport argcommand
import argparse
##
class Say( argcommand.Command ):
what = argcommand.Argument( "WORD", default = "Something", help = "the text you want to print" )
times = argcommand.Argument( "--times", "-t", type = int, default = 1, metavar = "T", help = "how many time... | <commit_before><commit_msg>Test classes from the README.md file<commit_after>import argcommand
import argparse
##
class Say( argcommand.Command ):
what = argcommand.Argument( "WORD", default = "Something", help = "the text you want to print" )
times = argcommand.Argument( "--times", "-t", type = int, default ... | |
756b5fa59d12e67fe2ed4f223ddc77b00f7686b9 | www/tests/test_file.py | www/tests/test_file.py | from browser import document, html, window
with open('test.html') as f:
f.read()
with open('files/text-utf8.txt') as f:
f.read()
with open('compression/du cote de chez swann.txt', 'rb') as f:
assert len(f.read()) == 1_056_294
with open('compression/du cote de chez swann.txt', 'r') as f:
assert len(f... | Add test for file objects created by open() | Add test for file objects created by open()
| Python | bsd-3-clause | brython-dev/brython,brython-dev/brython,brython-dev/brython | Add test for file objects created by open() | from browser import document, html, window
with open('test.html') as f:
f.read()
with open('files/text-utf8.txt') as f:
f.read()
with open('compression/du cote de chez swann.txt', 'rb') as f:
assert len(f.read()) == 1_056_294
with open('compression/du cote de chez swann.txt', 'r') as f:
assert len(f... | <commit_before><commit_msg>Add test for file objects created by open()<commit_after> | from browser import document, html, window
with open('test.html') as f:
f.read()
with open('files/text-utf8.txt') as f:
f.read()
with open('compression/du cote de chez swann.txt', 'rb') as f:
assert len(f.read()) == 1_056_294
with open('compression/du cote de chez swann.txt', 'r') as f:
assert len(f... | Add test for file objects created by open()from browser import document, html, window
with open('test.html') as f:
f.read()
with open('files/text-utf8.txt') as f:
f.read()
with open('compression/du cote de chez swann.txt', 'rb') as f:
assert len(f.read()) == 1_056_294
with open('compression/du cote de c... | <commit_before><commit_msg>Add test for file objects created by open()<commit_after>from browser import document, html, window
with open('test.html') as f:
f.read()
with open('files/text-utf8.txt') as f:
f.read()
with open('compression/du cote de chez swann.txt', 'rb') as f:
assert len(f.read()) == 1_056... | |
034719380206d42a1bc065cb5805d700cd5f2366 | pentagon/filters.py | pentagon/filters.py | import re
def get_filters():
"""Register a function with decorator"""
registry = {}
def registrar(func):
registry[func.__name__] = func
return func
registrar.all = registry
return registrar
filter = get_filters()
@filter
def regex_trim(input, regex, replace=''):
"""
Trims or replaces the regex match ... | Add a jinja filter and factory | Add a jinja filter and factory
| Python | apache-2.0 | reactiveops/pentagon,reactiveops/pentagon,reactiveops/pentagon | Add a jinja filter and factory | import re
def get_filters():
"""Register a function with decorator"""
registry = {}
def registrar(func):
registry[func.__name__] = func
return func
registrar.all = registry
return registrar
filter = get_filters()
@filter
def regex_trim(input, regex, replace=''):
"""
Trims or replaces the regex match ... | <commit_before><commit_msg>Add a jinja filter and factory<commit_after> | import re
def get_filters():
"""Register a function with decorator"""
registry = {}
def registrar(func):
registry[func.__name__] = func
return func
registrar.all = registry
return registrar
filter = get_filters()
@filter
def regex_trim(input, regex, replace=''):
"""
Trims or replaces the regex match ... | Add a jinja filter and factoryimport re
def get_filters():
"""Register a function with decorator"""
registry = {}
def registrar(func):
registry[func.__name__] = func
return func
registrar.all = registry
return registrar
filter = get_filters()
@filter
def regex_trim(input, regex, replace=''):
"""
Trim... | <commit_before><commit_msg>Add a jinja filter and factory<commit_after>import re
def get_filters():
"""Register a function with decorator"""
registry = {}
def registrar(func):
registry[func.__name__] = func
return func
registrar.all = registry
return registrar
filter = get_filters()
@filter
def regex_t... | |
20cf65dfc76b097a63b21b1661bf40e01764af71 | pybb/management/commands/pybb_delete_invalid_topics.py | pybb/management/commands/pybb_delete_invalid_topics.py | from optparse import make_option
from datetime import datetime, timedelta
from django.core.management.base import BaseCommand, CommandError
from django.db.models import Count
from pybb.models import Topic
class Command(BaseCommand):
help = 'Resave all posts.'
def handle(self, *args, **kwargs):
check... | Add management command to delete invalid topics | Add management command to delete invalid topics
| Python | bsd-3-clause | gpetukhov/pybb,gpetukhov/pybb,gpetukhov/pybb | Add management command to delete invalid topics | from optparse import make_option
from datetime import datetime, timedelta
from django.core.management.base import BaseCommand, CommandError
from django.db.models import Count
from pybb.models import Topic
class Command(BaseCommand):
help = 'Resave all posts.'
def handle(self, *args, **kwargs):
check... | <commit_before><commit_msg>Add management command to delete invalid topics<commit_after> | from optparse import make_option
from datetime import datetime, timedelta
from django.core.management.base import BaseCommand, CommandError
from django.db.models import Count
from pybb.models import Topic
class Command(BaseCommand):
help = 'Resave all posts.'
def handle(self, *args, **kwargs):
check... | Add management command to delete invalid topicsfrom optparse import make_option
from datetime import datetime, timedelta
from django.core.management.base import BaseCommand, CommandError
from django.db.models import Count
from pybb.models import Topic
class Command(BaseCommand):
help = 'Resave all posts.'
d... | <commit_before><commit_msg>Add management command to delete invalid topics<commit_after>from optparse import make_option
from datetime import datetime, timedelta
from django.core.management.base import BaseCommand, CommandError
from django.db.models import Count
from pybb.models import Topic
class Command(BaseComman... | |
d80c5c93d993905a4950bc00dea29096da1de459 | src/mmw/apps/modeling/migrations/0021_old_scenarios.py | src/mmw/apps/modeling/migrations/0021_old_scenarios.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
def clear_old_scenario_results(apps, schema_editor):
Scenario = apps.get_model('modeling', 'Scenario')
old_scenarios = Scenario.objects.filter(
project__model_package='tr-55'
)
fo... | Add migration to flush saved tr-55 results | Add migration to flush saved tr-55 results
| Python | apache-2.0 | WikiWatershed/model-my-watershed,WikiWatershed/model-my-watershed,WikiWatershed/model-my-watershed,WikiWatershed/model-my-watershed,WikiWatershed/model-my-watershed | Add migration to flush saved tr-55 results | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
def clear_old_scenario_results(apps, schema_editor):
Scenario = apps.get_model('modeling', 'Scenario')
old_scenarios = Scenario.objects.filter(
project__model_package='tr-55'
)
fo... | <commit_before><commit_msg>Add migration to flush saved tr-55 results<commit_after> | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
def clear_old_scenario_results(apps, schema_editor):
Scenario = apps.get_model('modeling', 'Scenario')
old_scenarios = Scenario.objects.filter(
project__model_package='tr-55'
)
fo... | Add migration to flush saved tr-55 results# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
def clear_old_scenario_results(apps, schema_editor):
Scenario = apps.get_model('modeling', 'Scenario')
old_scenarios = Scenario.objects.filter(
projec... | <commit_before><commit_msg>Add migration to flush saved tr-55 results<commit_after># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
def clear_old_scenario_results(apps, schema_editor):
Scenario = apps.get_model('modeling', 'Scenario')
old_scenarios = Sc... | |
0acecb5dd4ee96136b9929a9b1adef953a1a5a63 | unittest-build.py | unittest-build.py | #!/usr/bin/python
import sys
import os
if sys.platform == 'win32':
os.system ( 'devenv /build libSequantoAutomation.sln' )
else:
os.system ( 'make' )
| Add python script to build the project using the platforms standard builder (used when we do automatic unit-testing using Bitten at Sequanto) | Add python script to build the project using the platforms standard builder (used when we do automatic unit-testing using Bitten at Sequanto) | Python | apache-2.0 | seqzap/sequanto-automation,micronpn/sequanto-automation,seqzap/sequanto-automation,seqzap/sequanto-automation,seqzap/sequanto-automation,micronpn/sequanto-automation,rasmus-toftdahl-olesen/sequanto-automation,micronpn/sequanto-automation,rasmus-toftdahl-olesen/sequanto-automation,rasmus-toftdahl-olesen/sequanto-automat... | Add python script to build the project using the platforms standard builder (used when we do automatic unit-testing using Bitten at Sequanto) | #!/usr/bin/python
import sys
import os
if sys.platform == 'win32':
os.system ( 'devenv /build libSequantoAutomation.sln' )
else:
os.system ( 'make' )
| <commit_before><commit_msg>Add python script to build the project using the platforms standard builder (used when we do automatic unit-testing using Bitten at Sequanto)<commit_after> | #!/usr/bin/python
import sys
import os
if sys.platform == 'win32':
os.system ( 'devenv /build libSequantoAutomation.sln' )
else:
os.system ( 'make' )
| Add python script to build the project using the platforms standard builder (used when we do automatic unit-testing using Bitten at Sequanto)#!/usr/bin/python
import sys
import os
if sys.platform == 'win32':
os.system ( 'devenv /build libSequantoAutomation.sln' )
else:
os.system ( 'make' )
| <commit_before><commit_msg>Add python script to build the project using the platforms standard builder (used when we do automatic unit-testing using Bitten at Sequanto)<commit_after>#!/usr/bin/python
import sys
import os
if sys.platform == 'win32':
os.system ( 'devenv /build libSequantoAutomation.sln' )
else:
... | |
9b05d4fab047be287dcd7c872e6a2a706a06e2f6 | libs/build_client.py | libs/build_client.py | #
# Build Script by Moloch
# Requires Py2Exe for Python 2.7
#
from distutils.core import setup
import py2exe, sys, os
sys.argv.append('py2exe')
setup(
options = {'py2exe': {'bundle_files': 1,'compressed': 1, 'optimize': 2}},
windows = [{'script': 'RtbClient.py', 'uac_info': 'requireAdministrator', 'icon_resource... | Add build script for client | Add build script for client
| Python | apache-2.0 | Richard-West/RootTheBox,Und3rf10w/RootTheBox,Richard-West/RootTheBox,Richard-West/RootTheBox,sigma-random/RootTheBox,shanshar06/RootTheBox,Und3rf10w/RootTheBox,sigma-random/RootTheBox,shanshar06/RootTheBox,moloch--/RootTheBox,Richard-West/RootTheBox,moloch--/RootTheBox,Und3rf10w/RootTheBox,sigma-random/RootTheBox,shans... | Add build script for client | #
# Build Script by Moloch
# Requires Py2Exe for Python 2.7
#
from distutils.core import setup
import py2exe, sys, os
sys.argv.append('py2exe')
setup(
options = {'py2exe': {'bundle_files': 1,'compressed': 1, 'optimize': 2}},
windows = [{'script': 'RtbClient.py', 'uac_info': 'requireAdministrator', 'icon_resource... | <commit_before><commit_msg>Add build script for client<commit_after> | #
# Build Script by Moloch
# Requires Py2Exe for Python 2.7
#
from distutils.core import setup
import py2exe, sys, os
sys.argv.append('py2exe')
setup(
options = {'py2exe': {'bundle_files': 1,'compressed': 1, 'optimize': 2}},
windows = [{'script': 'RtbClient.py', 'uac_info': 'requireAdministrator', 'icon_resource... | Add build script for client#
# Build Script by Moloch
# Requires Py2Exe for Python 2.7
#
from distutils.core import setup
import py2exe, sys, os
sys.argv.append('py2exe')
setup(
options = {'py2exe': {'bundle_files': 1,'compressed': 1, 'optimize': 2}},
windows = [{'script': 'RtbClient.py', 'uac_info': 'requireAdm... | <commit_before><commit_msg>Add build script for client<commit_after>#
# Build Script by Moloch
# Requires Py2Exe for Python 2.7
#
from distutils.core import setup
import py2exe, sys, os
sys.argv.append('py2exe')
setup(
options = {'py2exe': {'bundle_files': 1,'compressed': 1, 'optimize': 2}},
windows = [{'script'... | |
fd059a3f1a971706a45d9ac1f2cc20f73825a520 | website/management/commands/jd_pre.py | website/management/commands/jd_pre.py | from django.core.management.base import BaseCommand
from django.contrib.sites.models import Site
class Command(BaseCommand):
def handle(self, *args, **options):
site = Site.objects.get()
site.domain = 'website.jongedemocraten.nl'
site.name = 'Landelijk'
site.save()
| Add management script to rename the default site | Add management script to rename the default site
Django 1.8 automatically names the default website instead of asking
for the domain name it should use. Our import script depends on
setting the domain name of the default site before importing content.
This script can be run to set the domain and name of the default si... | Python | mit | jonge-democraten/website,jonge-democraten/website,jonge-democraten/website,jonge-democraten/website | Add management script to rename the default site
Django 1.8 automatically names the default website instead of asking
for the domain name it should use. Our import script depends on
setting the domain name of the default site before importing content.
This script can be run to set the domain and name of the default si... | from django.core.management.base import BaseCommand
from django.contrib.sites.models import Site
class Command(BaseCommand):
def handle(self, *args, **options):
site = Site.objects.get()
site.domain = 'website.jongedemocraten.nl'
site.name = 'Landelijk'
site.save()
| <commit_before><commit_msg>Add management script to rename the default site
Django 1.8 automatically names the default website instead of asking
for the domain name it should use. Our import script depends on
setting the domain name of the default site before importing content.
This script can be run to set the domain... | from django.core.management.base import BaseCommand
from django.contrib.sites.models import Site
class Command(BaseCommand):
def handle(self, *args, **options):
site = Site.objects.get()
site.domain = 'website.jongedemocraten.nl'
site.name = 'Landelijk'
site.save()
| Add management script to rename the default site
Django 1.8 automatically names the default website instead of asking
for the domain name it should use. Our import script depends on
setting the domain name of the default site before importing content.
This script can be run to set the domain and name of the default si... | <commit_before><commit_msg>Add management script to rename the default site
Django 1.8 automatically names the default website instead of asking
for the domain name it should use. Our import script depends on
setting the domain name of the default site before importing content.
This script can be run to set the domain... | |
44b10d1f941aeed155b869588d4d732fe0881ede | pinger/ext/plugins/stdout.py | pinger/ext/plugins/stdout.py | from pinger.ext import ActionProvider
class StdOut(ActionProvider):
"""
Receives a response and prints it
"""
title = 'StdOut'
def receive(self, name, url, status, errors, elapsed):
print 'name={name} url={url} elapsed={elapsed} status={status}'.format(name=name,
... | Add STDout plugin, fix status representation | Add STDout plugin, fix status representation
| Python | mit | pedrospdc/pinger | Add STDout plugin, fix status representation | from pinger.ext import ActionProvider
class StdOut(ActionProvider):
"""
Receives a response and prints it
"""
title = 'StdOut'
def receive(self, name, url, status, errors, elapsed):
print 'name={name} url={url} elapsed={elapsed} status={status}'.format(name=name,
... | <commit_before><commit_msg>Add STDout plugin, fix status representation<commit_after> | from pinger.ext import ActionProvider
class StdOut(ActionProvider):
"""
Receives a response and prints it
"""
title = 'StdOut'
def receive(self, name, url, status, errors, elapsed):
print 'name={name} url={url} elapsed={elapsed} status={status}'.format(name=name,
... | Add STDout plugin, fix status representationfrom pinger.ext import ActionProvider
class StdOut(ActionProvider):
"""
Receives a response and prints it
"""
title = 'StdOut'
def receive(self, name, url, status, errors, elapsed):
print 'name={name} url={url} elapsed={elapsed} status={status}'... | <commit_before><commit_msg>Add STDout plugin, fix status representation<commit_after>from pinger.ext import ActionProvider
class StdOut(ActionProvider):
"""
Receives a response and prints it
"""
title = 'StdOut'
def receive(self, name, url, status, errors, elapsed):
print 'name={name} url... | |
2cbfce0e8620792a7fb8c93711ab6163544213ec | apps/curia_vista/management/commands/update_cantons.py | apps/curia_vista/management/commands/update_cantons.py | from xml.etree import ElementTree
from django.core.management.base import BaseCommand, CommandError
from django.db import transaction
import requests
from apps.curia_vista.models import *
class Command(BaseCommand):
help = 'Import cantons from parlament.ch'
@transaction.atomic
def handle(self, *args, **... | Add import script for cantons data | Add import script for cantons data
| Python | agpl-3.0 | rettichschnidi/politkarma,rettichschnidi/politkarma,rettichschnidi/politkarma,rettichschnidi/politkarma | Add import script for cantons data | from xml.etree import ElementTree
from django.core.management.base import BaseCommand, CommandError
from django.db import transaction
import requests
from apps.curia_vista.models import *
class Command(BaseCommand):
help = 'Import cantons from parlament.ch'
@transaction.atomic
def handle(self, *args, **... | <commit_before><commit_msg>Add import script for cantons data<commit_after> | from xml.etree import ElementTree
from django.core.management.base import BaseCommand, CommandError
from django.db import transaction
import requests
from apps.curia_vista.models import *
class Command(BaseCommand):
help = 'Import cantons from parlament.ch'
@transaction.atomic
def handle(self, *args, **... | Add import script for cantons datafrom xml.etree import ElementTree
from django.core.management.base import BaseCommand, CommandError
from django.db import transaction
import requests
from apps.curia_vista.models import *
class Command(BaseCommand):
help = 'Import cantons from parlament.ch'
@transaction.ato... | <commit_before><commit_msg>Add import script for cantons data<commit_after>from xml.etree import ElementTree
from django.core.management.base import BaseCommand, CommandError
from django.db import transaction
import requests
from apps.curia_vista.models import *
class Command(BaseCommand):
help = 'Import cantons... | |
3fcb449325713fa9bfffe737b09dab333675766b | gnowsys-ndf/gnowsys_ndf/ndf/management/commands/update_attribute_type.py | gnowsys-ndf/gnowsys_ndf/ndf/management/commands/update_attribute_type.py | ''' imports from installed packages '''
from django.core.management.base import BaseCommand, CommandError
from django_mongokit import get_database
try:
from bson import ObjectId
except ImportError: # old pymongo
from pymongo.objectid import ObjectId
''' imports from application folders/files '''
from gnowsy... | Update script for updating attribute_type field of GAttribute instances from ObjectId to DBRef (AttributeType) | Update script for updating attribute_type field of GAttribute instances from ObjectId to DBRef (AttributeType)
| Python | agpl-3.0 | AvadootNachankar/gstudio,supriyasawant/gstudio,gnowledge/gstudio,gnowledge/gstudio,olympian94/gstudio,sunnychaudhari/gstudio,makfire/gstudio,olympian94/gstudio,AvadootNachankar/gstudio,gnowledge/gstudio,makfire/gstudio,AvadootNachankar/gstudio,supriyasawant/gstudio,sunnychaudhari/gstudio,Dhiru/gstudio,makfire/gstudio,s... | Update script for updating attribute_type field of GAttribute instances from ObjectId to DBRef (AttributeType) | ''' imports from installed packages '''
from django.core.management.base import BaseCommand, CommandError
from django_mongokit import get_database
try:
from bson import ObjectId
except ImportError: # old pymongo
from pymongo.objectid import ObjectId
''' imports from application folders/files '''
from gnowsy... | <commit_before><commit_msg>Update script for updating attribute_type field of GAttribute instances from ObjectId to DBRef (AttributeType)<commit_after> | ''' imports from installed packages '''
from django.core.management.base import BaseCommand, CommandError
from django_mongokit import get_database
try:
from bson import ObjectId
except ImportError: # old pymongo
from pymongo.objectid import ObjectId
''' imports from application folders/files '''
from gnowsy... | Update script for updating attribute_type field of GAttribute instances from ObjectId to DBRef (AttributeType)''' imports from installed packages '''
from django.core.management.base import BaseCommand, CommandError
from django_mongokit import get_database
try:
from bson import ObjectId
except ImportError: # old... | <commit_before><commit_msg>Update script for updating attribute_type field of GAttribute instances from ObjectId to DBRef (AttributeType)<commit_after>''' imports from installed packages '''
from django.core.management.base import BaseCommand, CommandError
from django_mongokit import get_database
try:
from bson i... | |
7ef782ff8ff684777516a1e76e3a6c2c937e70cd | geoip/management/commands/save_ballot_coordinates.py | geoip/management/commands/save_ballot_coordinates.py | from django.core.management.base import BaseCommand
from geopy.geocoders import get_geocoder_for_service
from geopy.exc import GeocoderQuotaExceeded
from ballot.models import BallotReturned
class Command(BaseCommand):
help = 'Populates the latitude and longitude fields of BallotReturned'
def populate_latitu... | Add command for populating latitude and longitude | Add command for populating latitude and longitude
| Python | mit | wevote/WeVoteServer,wevote/WebAppPublic,jainanisha90/WeVoteServer,wevote/WebAppPublic,jainanisha90/WeVoteServer,wevote/WeVoteServer,wevote/WeVoteServer,jainanisha90/WeVoteServer,wevote/WeVoteServer,wevote/WebAppPublic,wevote/WebAppPublic | Add command for populating latitude and longitude | from django.core.management.base import BaseCommand
from geopy.geocoders import get_geocoder_for_service
from geopy.exc import GeocoderQuotaExceeded
from ballot.models import BallotReturned
class Command(BaseCommand):
help = 'Populates the latitude and longitude fields of BallotReturned'
def populate_latitu... | <commit_before><commit_msg>Add command for populating latitude and longitude<commit_after> | from django.core.management.base import BaseCommand
from geopy.geocoders import get_geocoder_for_service
from geopy.exc import GeocoderQuotaExceeded
from ballot.models import BallotReturned
class Command(BaseCommand):
help = 'Populates the latitude and longitude fields of BallotReturned'
def populate_latitu... | Add command for populating latitude and longitudefrom django.core.management.base import BaseCommand
from geopy.geocoders import get_geocoder_for_service
from geopy.exc import GeocoderQuotaExceeded
from ballot.models import BallotReturned
class Command(BaseCommand):
help = 'Populates the latitude and longitude f... | <commit_before><commit_msg>Add command for populating latitude and longitude<commit_after>from django.core.management.base import BaseCommand
from geopy.geocoders import get_geocoder_for_service
from geopy.exc import GeocoderQuotaExceeded
from ballot.models import BallotReturned
class Command(BaseCommand):
help ... | |
eabbdee7c85c62c93f8f8993041b7f763c36c0dd | count_lines.py | count_lines.py | """Script to count the lines in a corpus of texts.
This information can be used to normalize the results.
Input: directory containing text files
Output: csv containing <text_id>, <# lines>
Usage: python count_lines.py <dir in> <file out>
"""
import argparse
import glob
import os
import codecs
import pandas as pd
i... | Add script to count the lines in a corpus | Add script to count the lines in a corpus
The results is saved to a csv file.
| Python | apache-2.0 | NLeSC/embodied-emotions-scripts,NLeSC/embodied-emotions-scripts | Add script to count the lines in a corpus
The results is saved to a csv file. | """Script to count the lines in a corpus of texts.
This information can be used to normalize the results.
Input: directory containing text files
Output: csv containing <text_id>, <# lines>
Usage: python count_lines.py <dir in> <file out>
"""
import argparse
import glob
import os
import codecs
import pandas as pd
i... | <commit_before><commit_msg>Add script to count the lines in a corpus
The results is saved to a csv file.<commit_after> | """Script to count the lines in a corpus of texts.
This information can be used to normalize the results.
Input: directory containing text files
Output: csv containing <text_id>, <# lines>
Usage: python count_lines.py <dir in> <file out>
"""
import argparse
import glob
import os
import codecs
import pandas as pd
i... | Add script to count the lines in a corpus
The results is saved to a csv file."""Script to count the lines in a corpus of texts.
This information can be used to normalize the results.
Input: directory containing text files
Output: csv containing <text_id>, <# lines>
Usage: python count_lines.py <dir in> <file out>
"... | <commit_before><commit_msg>Add script to count the lines in a corpus
The results is saved to a csv file.<commit_after>"""Script to count the lines in a corpus of texts.
This information can be used to normalize the results.
Input: directory containing text files
Output: csv containing <text_id>, <# lines>
Usage: py... | |
034d0871a87b6929656b163c0c2d65ed09f97520 | bin/convert_file.py | bin/convert_file.py | import argparse
import os
import sys
import csv
file_path = os.path.join(os.path.dirname(os.path.realpath(__file__)))
sys.path.append(os.path.abspath(os.path.join(file_path, os.pardir)))
if __name__ == "__main__":
parser = argparse.ArgumentParser(description='Convert csv file into correct format')
parser.add_... | Add script to reshape attendance data | Add script to reshape attendance data
| Python | apache-2.0 | Code4SA/pmg-cms-2,Code4SA/pmg-cms-2,Code4SA/pmg-cms-2 | Add script to reshape attendance data | import argparse
import os
import sys
import csv
file_path = os.path.join(os.path.dirname(os.path.realpath(__file__)))
sys.path.append(os.path.abspath(os.path.join(file_path, os.pardir)))
if __name__ == "__main__":
parser = argparse.ArgumentParser(description='Convert csv file into correct format')
parser.add_... | <commit_before><commit_msg>Add script to reshape attendance data<commit_after> | import argparse
import os
import sys
import csv
file_path = os.path.join(os.path.dirname(os.path.realpath(__file__)))
sys.path.append(os.path.abspath(os.path.join(file_path, os.pardir)))
if __name__ == "__main__":
parser = argparse.ArgumentParser(description='Convert csv file into correct format')
parser.add_... | Add script to reshape attendance dataimport argparse
import os
import sys
import csv
file_path = os.path.join(os.path.dirname(os.path.realpath(__file__)))
sys.path.append(os.path.abspath(os.path.join(file_path, os.pardir)))
if __name__ == "__main__":
parser = argparse.ArgumentParser(description='Convert csv file ... | <commit_before><commit_msg>Add script to reshape attendance data<commit_after>import argparse
import os
import sys
import csv
file_path = os.path.join(os.path.dirname(os.path.realpath(__file__)))
sys.path.append(os.path.abspath(os.path.join(file_path, os.pardir)))
if __name__ == "__main__":
parser = argparse.Argu... | |
786fbfe7548b887141d6a3961cc85d8d770c02d6 | Sample/Python/Sample.py | Sample/Python/Sample.py | import ctypes
import os
# Error
T_ERROR_SUCCESS = 0 # Success
T_ERROR_EMPTY = 1 # Empty expression
T_ERROR_DIVZERO = 2 # Division by zero
T_ERROR_TOKEN = 3 # Unknown token type
T_ERROR_FUNC = 4 # Math function not found
T_ERROR_FUNC_FACTORIAL = 5 # Argument to factorial must b... | Create sample file for Python | Create sample file for Python
| Python | mit | rchockxm/ExprSolver,rchockxm/ExprSolver,rchockxm/ExprSolver | Create sample file for Python | import ctypes
import os
# Error
T_ERROR_SUCCESS = 0 # Success
T_ERROR_EMPTY = 1 # Empty expression
T_ERROR_DIVZERO = 2 # Division by zero
T_ERROR_TOKEN = 3 # Unknown token type
T_ERROR_FUNC = 4 # Math function not found
T_ERROR_FUNC_FACTORIAL = 5 # Argument to factorial must b... | <commit_before><commit_msg>Create sample file for Python<commit_after> | import ctypes
import os
# Error
T_ERROR_SUCCESS = 0 # Success
T_ERROR_EMPTY = 1 # Empty expression
T_ERROR_DIVZERO = 2 # Division by zero
T_ERROR_TOKEN = 3 # Unknown token type
T_ERROR_FUNC = 4 # Math function not found
T_ERROR_FUNC_FACTORIAL = 5 # Argument to factorial must b... | Create sample file for Pythonimport ctypes
import os
# Error
T_ERROR_SUCCESS = 0 # Success
T_ERROR_EMPTY = 1 # Empty expression
T_ERROR_DIVZERO = 2 # Division by zero
T_ERROR_TOKEN = 3 # Unknown token type
T_ERROR_FUNC = 4 # Math function not found
T_ERROR_FUNC_FACTORIAL = 5 #... | <commit_before><commit_msg>Create sample file for Python<commit_after>import ctypes
import os
# Error
T_ERROR_SUCCESS = 0 # Success
T_ERROR_EMPTY = 1 # Empty expression
T_ERROR_DIVZERO = 2 # Division by zero
T_ERROR_TOKEN = 3 # Unknown token type
T_ERROR_FUNC = 4 # Math functi... | |
3b0d4279aa00dd1c34a617ba40ba1c3700c9b0c7 | Cura/Event.py | Cura/Event.py | class Event:
MousePressEvent = 1
MouseMoveEvent = 2
MouseReleaseEvent = 3
KeyPressEvent = 4
KeyReleaseEvent = 5
SceneChangeEvent = 6
ToolActivateEvent = 7
ToolDeactivateEvent = 8
def __init__(self, type):
super().__init__()
self._type = type
@property
def ty... | Add an event class and several standard subclasses | Add an event class and several standard subclasses
| Python | agpl-3.0 | onitake/Uranium,onitake/Uranium | Add an event class and several standard subclasses | class Event:
MousePressEvent = 1
MouseMoveEvent = 2
MouseReleaseEvent = 3
KeyPressEvent = 4
KeyReleaseEvent = 5
SceneChangeEvent = 6
ToolActivateEvent = 7
ToolDeactivateEvent = 8
def __init__(self, type):
super().__init__()
self._type = type
@property
def ty... | <commit_before><commit_msg>Add an event class and several standard subclasses<commit_after> | class Event:
MousePressEvent = 1
MouseMoveEvent = 2
MouseReleaseEvent = 3
KeyPressEvent = 4
KeyReleaseEvent = 5
SceneChangeEvent = 6
ToolActivateEvent = 7
ToolDeactivateEvent = 8
def __init__(self, type):
super().__init__()
self._type = type
@property
def ty... | Add an event class and several standard subclassesclass Event:
MousePressEvent = 1
MouseMoveEvent = 2
MouseReleaseEvent = 3
KeyPressEvent = 4
KeyReleaseEvent = 5
SceneChangeEvent = 6
ToolActivateEvent = 7
ToolDeactivateEvent = 8
def __init__(self, type):
super().__init__()
... | <commit_before><commit_msg>Add an event class and several standard subclasses<commit_after>class Event:
MousePressEvent = 1
MouseMoveEvent = 2
MouseReleaseEvent = 3
KeyPressEvent = 4
KeyReleaseEvent = 5
SceneChangeEvent = 6
ToolActivateEvent = 7
ToolDeactivateEvent = 8
def __init__(... | |
b854548b0eca1b90395e257e2878b935846f6d0e | components/lie_graph/lie_graph/graph_io/io_json_format.py | components/lie_graph/lie_graph/graph_io/io_json_format.py | # -*- coding: utf-8 -*-
"""
file: io_json_format.py
Functions for exporting and importing graphs in structured JSON format
"""
import logging
import json
from lie_graph.graph_io.io_helpers import open_anything
from lie_graph.graph_io.io_dict_format import read_dict, write_dict
def read_json(json_file, graph=None,... | Add importer and exporter for JSON files | Add importer and exporter for JSON files
Wrapper around read_dict and write_dict
| Python | apache-2.0 | MD-Studio/MDStudio,MD-Studio/MDStudio,MD-Studio/MDStudio,MD-Studio/MDStudio,MD-Studio/MDStudio | Add importer and exporter for JSON files
Wrapper around read_dict and write_dict | # -*- coding: utf-8 -*-
"""
file: io_json_format.py
Functions for exporting and importing graphs in structured JSON format
"""
import logging
import json
from lie_graph.graph_io.io_helpers import open_anything
from lie_graph.graph_io.io_dict_format import read_dict, write_dict
def read_json(json_file, graph=None,... | <commit_before><commit_msg>Add importer and exporter for JSON files
Wrapper around read_dict and write_dict<commit_after> | # -*- coding: utf-8 -*-
"""
file: io_json_format.py
Functions for exporting and importing graphs in structured JSON format
"""
import logging
import json
from lie_graph.graph_io.io_helpers import open_anything
from lie_graph.graph_io.io_dict_format import read_dict, write_dict
def read_json(json_file, graph=None,... | Add importer and exporter for JSON files
Wrapper around read_dict and write_dict# -*- coding: utf-8 -*-
"""
file: io_json_format.py
Functions for exporting and importing graphs in structured JSON format
"""
import logging
import json
from lie_graph.graph_io.io_helpers import open_anything
from lie_graph.graph_io.i... | <commit_before><commit_msg>Add importer and exporter for JSON files
Wrapper around read_dict and write_dict<commit_after># -*- coding: utf-8 -*-
"""
file: io_json_format.py
Functions for exporting and importing graphs in structured JSON format
"""
import logging
import json
from lie_graph.graph_io.io_helpers impor... | |
eab9ca4d17d67d7c2977d2753c4a2d6be768d1f9 | kobo/django/auth/migrations/0002_auto_20220203_1511.py | kobo/django/auth/migrations/0002_auto_20220203_1511.py | # Generated by Django 2.2.24 on 2022-02-03 15:11
import django.core.validators
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('kobo_auth', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='user',
... | Add migration for User model generated by Django 2 | Add migration for User model generated by Django 2
| Python | lgpl-2.1 | release-engineering/kobo,release-engineering/kobo,release-engineering/kobo,release-engineering/kobo | Add migration for User model generated by Django 2 | # Generated by Django 2.2.24 on 2022-02-03 15:11
import django.core.validators
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('kobo_auth', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='user',
... | <commit_before><commit_msg>Add migration for User model generated by Django 2<commit_after> | # Generated by Django 2.2.24 on 2022-02-03 15:11
import django.core.validators
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('kobo_auth', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='user',
... | Add migration for User model generated by Django 2# Generated by Django 2.2.24 on 2022-02-03 15:11
import django.core.validators
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('kobo_auth', '0001_initial'),
]
operations = [
migrations.Al... | <commit_before><commit_msg>Add migration for User model generated by Django 2<commit_after># Generated by Django 2.2.24 on 2022-02-03 15:11
import django.core.validators
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('kobo_auth', '0001_initial'),
]
... | |
32bbe90127c573cf69c7c9128e6f0e95756974a9 | test/integration/test_api.py | test/integration/test_api.py |
import unittest
import changeling.api
import changeling.fakes
class TestChangeAPI(unittest.TestCase):
def setUp(self):
self.fake_storage = changeling.fakes.FakeStorage([])
self.api = changeling.api.ChangeAPI(self.fake_storage)
def test_list_zero_changes(self):
self.assertEqual([], l... | Add integration tests for ChangeAPI | Add integration tests for ChangeAPI
| Python | apache-2.0 | bcwaldon/changeling,bcwaldon/changeling | Add integration tests for ChangeAPI |
import unittest
import changeling.api
import changeling.fakes
class TestChangeAPI(unittest.TestCase):
def setUp(self):
self.fake_storage = changeling.fakes.FakeStorage([])
self.api = changeling.api.ChangeAPI(self.fake_storage)
def test_list_zero_changes(self):
self.assertEqual([], l... | <commit_before><commit_msg>Add integration tests for ChangeAPI<commit_after> |
import unittest
import changeling.api
import changeling.fakes
class TestChangeAPI(unittest.TestCase):
def setUp(self):
self.fake_storage = changeling.fakes.FakeStorage([])
self.api = changeling.api.ChangeAPI(self.fake_storage)
def test_list_zero_changes(self):
self.assertEqual([], l... | Add integration tests for ChangeAPI
import unittest
import changeling.api
import changeling.fakes
class TestChangeAPI(unittest.TestCase):
def setUp(self):
self.fake_storage = changeling.fakes.FakeStorage([])
self.api = changeling.api.ChangeAPI(self.fake_storage)
def test_list_zero_changes(se... | <commit_before><commit_msg>Add integration tests for ChangeAPI<commit_after>
import unittest
import changeling.api
import changeling.fakes
class TestChangeAPI(unittest.TestCase):
def setUp(self):
self.fake_storage = changeling.fakes.FakeStorage([])
self.api = changeling.api.ChangeAPI(self.fake_st... | |
358d97dd3f2628444899fdd0e5021420014b27a3 | scripts/add_kms_secret.py | scripts/add_kms_secret.py | #!/usr/bin/env python
# -*- encoding: utf-8
"""
Store a config variable in SSM under the key structure
/{project_id}/secrets/{label}/{config_key}
This script can store a regular config key (unencrypted) or an encrypted key.
"""
import getpass
import sys
import boto3
from botocore.exceptions import ClientError
... | Add a script for storing secrets | Add a script for storing secrets
| Python | mit | wellcometrust/platform-api,wellcometrust/platform-api,wellcometrust/platform-api,wellcometrust/platform-api | Add a script for storing secrets | #!/usr/bin/env python
# -*- encoding: utf-8
"""
Store a config variable in SSM under the key structure
/{project_id}/secrets/{label}/{config_key}
This script can store a regular config key (unencrypted) or an encrypted key.
"""
import getpass
import sys
import boto3
from botocore.exceptions import ClientError
... | <commit_before><commit_msg>Add a script for storing secrets<commit_after> | #!/usr/bin/env python
# -*- encoding: utf-8
"""
Store a config variable in SSM under the key structure
/{project_id}/secrets/{label}/{config_key}
This script can store a regular config key (unencrypted) or an encrypted key.
"""
import getpass
import sys
import boto3
from botocore.exceptions import ClientError
... | Add a script for storing secrets#!/usr/bin/env python
# -*- encoding: utf-8
"""
Store a config variable in SSM under the key structure
/{project_id}/secrets/{label}/{config_key}
This script can store a regular config key (unencrypted) or an encrypted key.
"""
import getpass
import sys
import boto3
from botocor... | <commit_before><commit_msg>Add a script for storing secrets<commit_after>#!/usr/bin/env python
# -*- encoding: utf-8
"""
Store a config variable in SSM under the key structure
/{project_id}/secrets/{label}/{config_key}
This script can store a regular config key (unencrypted) or an encrypted key.
"""
import getp... | |
94e60ae8057795363c19f69d46c5890372cfa7dd | singleSimulation.py | singleSimulation.py | import os
import sys
import numpy as np
from scripts.Dqn import Learner
import time
if 'SUMO_HOME' in os.environ:
tools = os.path.join(os.environ['SUMO_HOME'], 'tools')
sys.path.append(tools)
else:
sys.exit("Please declare the environment variable 'SUMO_HOME'")
sumoBinary = "/usr/bin/sumo-gui"
sumoConfig ... | Add program to run single simulation | Add program to run single simulation
| Python | mit | Wert1996/Traffic-Optimisation | Add program to run single simulation | import os
import sys
import numpy as np
from scripts.Dqn import Learner
import time
if 'SUMO_HOME' in os.environ:
tools = os.path.join(os.environ['SUMO_HOME'], 'tools')
sys.path.append(tools)
else:
sys.exit("Please declare the environment variable 'SUMO_HOME'")
sumoBinary = "/usr/bin/sumo-gui"
sumoConfig ... | <commit_before><commit_msg>Add program to run single simulation<commit_after> | import os
import sys
import numpy as np
from scripts.Dqn import Learner
import time
if 'SUMO_HOME' in os.environ:
tools = os.path.join(os.environ['SUMO_HOME'], 'tools')
sys.path.append(tools)
else:
sys.exit("Please declare the environment variable 'SUMO_HOME'")
sumoBinary = "/usr/bin/sumo-gui"
sumoConfig ... | Add program to run single simulationimport os
import sys
import numpy as np
from scripts.Dqn import Learner
import time
if 'SUMO_HOME' in os.environ:
tools = os.path.join(os.environ['SUMO_HOME'], 'tools')
sys.path.append(tools)
else:
sys.exit("Please declare the environment variable 'SUMO_HOME'")
sumoBina... | <commit_before><commit_msg>Add program to run single simulation<commit_after>import os
import sys
import numpy as np
from scripts.Dqn import Learner
import time
if 'SUMO_HOME' in os.environ:
tools = os.path.join(os.environ['SUMO_HOME'], 'tools')
sys.path.append(tools)
else:
sys.exit("Please declare the env... | |
2b68847ceb2a440aff89d23479b1b69a74cd6e6b | tools/visual/show_video_matfile_detection.py | tools/visual/show_video_matfile_detection.py | #!/usr/bin/env python
import argparse
import os
import sys
import cv2
from vdetlib.vdet.dataset import imagenet_vdet_class_idx
from vdetlib.utils.common import imread, imwrite
from vdetlib.utils.protocol import proto_load, proto_dump, frame_path_at, frame_top_detections
from vdetlib.utils.visual import add_bbox
from v... | Add a script to visualize detection matfiles. | Add a script to visualize detection matfiles.
| Python | mit | myfavouritekk/TPN | Add a script to visualize detection matfiles. | #!/usr/bin/env python
import argparse
import os
import sys
import cv2
from vdetlib.vdet.dataset import imagenet_vdet_class_idx
from vdetlib.utils.common import imread, imwrite
from vdetlib.utils.protocol import proto_load, proto_dump, frame_path_at, frame_top_detections
from vdetlib.utils.visual import add_bbox
from v... | <commit_before><commit_msg>Add a script to visualize detection matfiles.<commit_after> | #!/usr/bin/env python
import argparse
import os
import sys
import cv2
from vdetlib.vdet.dataset import imagenet_vdet_class_idx
from vdetlib.utils.common import imread, imwrite
from vdetlib.utils.protocol import proto_load, proto_dump, frame_path_at, frame_top_detections
from vdetlib.utils.visual import add_bbox
from v... | Add a script to visualize detection matfiles.#!/usr/bin/env python
import argparse
import os
import sys
import cv2
from vdetlib.vdet.dataset import imagenet_vdet_class_idx
from vdetlib.utils.common import imread, imwrite
from vdetlib.utils.protocol import proto_load, proto_dump, frame_path_at, frame_top_detections
fro... | <commit_before><commit_msg>Add a script to visualize detection matfiles.<commit_after>#!/usr/bin/env python
import argparse
import os
import sys
import cv2
from vdetlib.vdet.dataset import imagenet_vdet_class_idx
from vdetlib.utils.common import imread, imwrite
from vdetlib.utils.protocol import proto_load, proto_dump... | |
a3638f641098b1e713492d1a5fd832c8f9c3da5d | resolwe/flow/migrations/0005_duplicate_data_dependency.py | resolwe/flow/migrations/0005_duplicate_data_dependency.py | # Generated by Django 3.1.7 on 2021-10-12 10:39
from django.db import migrations, models
def create_duplicate_dependencies(apps, schema_editor):
Data = apps.get_model("flow", "Data")
DataDependency = apps.get_model("flow", "DataDependency")
duplicates = Data.objects.filter(duplicated__isnull=False)
du... | Add missing DataDependency objects for duplicates | Add missing DataDependency objects for duplicates
| Python | apache-2.0 | genialis/resolwe,genialis/resolwe | Add missing DataDependency objects for duplicates | # Generated by Django 3.1.7 on 2021-10-12 10:39
from django.db import migrations, models
def create_duplicate_dependencies(apps, schema_editor):
Data = apps.get_model("flow", "Data")
DataDependency = apps.get_model("flow", "DataDependency")
duplicates = Data.objects.filter(duplicated__isnull=False)
du... | <commit_before><commit_msg>Add missing DataDependency objects for duplicates<commit_after> | # Generated by Django 3.1.7 on 2021-10-12 10:39
from django.db import migrations, models
def create_duplicate_dependencies(apps, schema_editor):
Data = apps.get_model("flow", "Data")
DataDependency = apps.get_model("flow", "DataDependency")
duplicates = Data.objects.filter(duplicated__isnull=False)
du... | Add missing DataDependency objects for duplicates# Generated by Django 3.1.7 on 2021-10-12 10:39
from django.db import migrations, models
def create_duplicate_dependencies(apps, schema_editor):
Data = apps.get_model("flow", "Data")
DataDependency = apps.get_model("flow", "DataDependency")
duplicates = Dat... | <commit_before><commit_msg>Add missing DataDependency objects for duplicates<commit_after># Generated by Django 3.1.7 on 2021-10-12 10:39
from django.db import migrations, models
def create_duplicate_dependencies(apps, schema_editor):
Data = apps.get_model("flow", "Data")
DataDependency = apps.get_model("flow... | |
0a28e4239a7393a9e8e4fa2b57126c7d28ed4bea | astrodb/models.py | astrodb/models.py | """
An attempt to modelize datas with the "peewee" ORM
You have to install "peewee" from its repository (this code use ManyToManyField that has been documented but omitted from the last release, so waiting for it we will develop using the unstable version): ::
pip install -e git+https://github.com/coleifer/peewee... | Add demo for modelizing using peewee ORM | Add demo for modelizing using peewee ORM
| Python | mit | EricDepagne/Astrodb | Add demo for modelizing using peewee ORM | """
An attempt to modelize datas with the "peewee" ORM
You have to install "peewee" from its repository (this code use ManyToManyField that has been documented but omitted from the last release, so waiting for it we will develop using the unstable version): ::
pip install -e git+https://github.com/coleifer/peewee... | <commit_before><commit_msg>Add demo for modelizing using peewee ORM<commit_after> | """
An attempt to modelize datas with the "peewee" ORM
You have to install "peewee" from its repository (this code use ManyToManyField that has been documented but omitted from the last release, so waiting for it we will develop using the unstable version): ::
pip install -e git+https://github.com/coleifer/peewee... | Add demo for modelizing using peewee ORM"""
An attempt to modelize datas with the "peewee" ORM
You have to install "peewee" from its repository (this code use ManyToManyField that has been documented but omitted from the last release, so waiting for it we will develop using the unstable version): ::
pip install -... | <commit_before><commit_msg>Add demo for modelizing using peewee ORM<commit_after>"""
An attempt to modelize datas with the "peewee" ORM
You have to install "peewee" from its repository (this code use ManyToManyField that has been documented but omitted from the last release, so waiting for it we will develop using the... | |
6a36df252e5f7c17cb2dfc63062472c65645ad2f | unleashed/api.py | unleashed/api.py | import requests
from auth import UnleashedAuth
class UnleashedApi(object):
"""
Unleashed API client library.
"""
def __init__(self, api_url, api_id, api_key):
self.api_url = api_url
self.auth = UnleashedAuth(api_id, api_key)
def _get_request(self, method, params=None):
p... | Add basic API which can make GET and POST requests | Add basic API which can make GET and POST requests
| Python | mit | jsok/unleashed | Add basic API which can make GET and POST requests | import requests
from auth import UnleashedAuth
class UnleashedApi(object):
"""
Unleashed API client library.
"""
def __init__(self, api_url, api_id, api_key):
self.api_url = api_url
self.auth = UnleashedAuth(api_id, api_key)
def _get_request(self, method, params=None):
p... | <commit_before><commit_msg>Add basic API which can make GET and POST requests<commit_after> | import requests
from auth import UnleashedAuth
class UnleashedApi(object):
"""
Unleashed API client library.
"""
def __init__(self, api_url, api_id, api_key):
self.api_url = api_url
self.auth = UnleashedAuth(api_id, api_key)
def _get_request(self, method, params=None):
p... | Add basic API which can make GET and POST requestsimport requests
from auth import UnleashedAuth
class UnleashedApi(object):
"""
Unleashed API client library.
"""
def __init__(self, api_url, api_id, api_key):
self.api_url = api_url
self.auth = UnleashedAuth(api_id, api_key)
def ... | <commit_before><commit_msg>Add basic API which can make GET and POST requests<commit_after>import requests
from auth import UnleashedAuth
class UnleashedApi(object):
"""
Unleashed API client library.
"""
def __init__(self, api_url, api_id, api_key):
self.api_url = api_url
self.auth =... | |
fbc088bbe3f7a8493c359618b35e6c31d9b7afce | district-court-scraper.py | district-court-scraper.py | import cookielib
import os
import re
import sys
import urllib
import urllib2
import webbrowser
from bs4 import BeautifulSoup
from time import sleep
user_agent = u"Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; " + \
u"rv:1.9.2.11) Gecko/20101012 Firefox/3.6.11"
# Get cookie and list of courts
cookieJar = ... | Allow user to solve district court captcha | Allow user to solve district court captcha
| Python | mit | CodeforNRV/attorney-analysis | Allow user to solve district court captcha | import cookielib
import os
import re
import sys
import urllib
import urllib2
import webbrowser
from bs4 import BeautifulSoup
from time import sleep
user_agent = u"Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; " + \
u"rv:1.9.2.11) Gecko/20101012 Firefox/3.6.11"
# Get cookie and list of courts
cookieJar = ... | <commit_before><commit_msg>Allow user to solve district court captcha<commit_after> | import cookielib
import os
import re
import sys
import urllib
import urllib2
import webbrowser
from bs4 import BeautifulSoup
from time import sleep
user_agent = u"Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; " + \
u"rv:1.9.2.11) Gecko/20101012 Firefox/3.6.11"
# Get cookie and list of courts
cookieJar = ... | Allow user to solve district court captchaimport cookielib
import os
import re
import sys
import urllib
import urllib2
import webbrowser
from bs4 import BeautifulSoup
from time import sleep
user_agent = u"Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; " + \
u"rv:1.9.2.11) Gecko/20101012 Firefox/3.6.11"
# ... | <commit_before><commit_msg>Allow user to solve district court captcha<commit_after>import cookielib
import os
import re
import sys
import urllib
import urllib2
import webbrowser
from bs4 import BeautifulSoup
from time import sleep
user_agent = u"Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; " + \
u"rv:1.9... | |
aa55e73c8757772486eec3d4b2f1bf980f7445e0 | tools/convert-url-history.py | tools/convert-url-history.py | #!/usr/bin/env python
# Copyright 2009 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required... | Add initial URL history importer | Add initial URL history importer | Python | apache-2.0 | mirek2580/namebench | Add initial URL history importer | #!/usr/bin/env python
# Copyright 2009 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required... | <commit_before><commit_msg>Add initial URL history importer<commit_after> | #!/usr/bin/env python
# Copyright 2009 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required... | Add initial URL history importer#!/usr/bin/env python
# Copyright 2009 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses... | <commit_before><commit_msg>Add initial URL history importer<commit_after>#!/usr/bin/env python
# Copyright 2009 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License a... | |
3256d970f1dd8f34a91b6f5161ddcb54da83fb9f | checks/check_polygons_stay_valid_during_augmentation.py | checks/check_polygons_stay_valid_during_augmentation.py | from __future__ import print_function, division
import numpy as np
import imgaug as ia
import imgaug.augmenters as iaa
from imgaug.augmentables.polys import Polygon, PolygonsOnImage
def main():
nb_checked = 0
augs = iaa.SomeOf((1, None), [
iaa.Resize({"height": (1, 100), "width": (1, 100)}),
... | Add check script for polygon validity during aug | Add check script for polygon validity during aug
| Python | mit | aleju/imgaug,aleju/imgaug,aleju/ImageAugmenter | Add check script for polygon validity during aug | from __future__ import print_function, division
import numpy as np
import imgaug as ia
import imgaug.augmenters as iaa
from imgaug.augmentables.polys import Polygon, PolygonsOnImage
def main():
nb_checked = 0
augs = iaa.SomeOf((1, None), [
iaa.Resize({"height": (1, 100), "width": (1, 100)}),
... | <commit_before><commit_msg>Add check script for polygon validity during aug<commit_after> | from __future__ import print_function, division
import numpy as np
import imgaug as ia
import imgaug.augmenters as iaa
from imgaug.augmentables.polys import Polygon, PolygonsOnImage
def main():
nb_checked = 0
augs = iaa.SomeOf((1, None), [
iaa.Resize({"height": (1, 100), "width": (1, 100)}),
... | Add check script for polygon validity during augfrom __future__ import print_function, division
import numpy as np
import imgaug as ia
import imgaug.augmenters as iaa
from imgaug.augmentables.polys import Polygon, PolygonsOnImage
def main():
nb_checked = 0
augs = iaa.SomeOf((1, None), [
iaa.Resize({... | <commit_before><commit_msg>Add check script for polygon validity during aug<commit_after>from __future__ import print_function, division
import numpy as np
import imgaug as ia
import imgaug.augmenters as iaa
from imgaug.augmentables.polys import Polygon, PolygonsOnImage
def main():
nb_checked = 0
augs = iaa... | |
dc2074c5759f7ee8b00a9cc48b8a7b49ccdc067e | scripts/add_noise_to_datasets.py | scripts/add_noise_to_datasets.py | #!/usr/bin/env python3
"""
Usage: {script_name} INPUT_FILE OUTPUT_FILE
Adds noise to the csv file given as input.
"""
import random
import sys
from collections import deque
def usage():
print(__doc__.format(script_name=sys.argv[0].split("/")[-1]))
sys.exit(0)
def empty_lines(line_num):
empty_count = 50... | Add scripts that adds noise to datasets | Add scripts that adds noise to datasets
| Python | mit | CSWR/annotatingCSV,CSWR/annotatingCSV,CSWR/annotatingCSV | Add scripts that adds noise to datasets | #!/usr/bin/env python3
"""
Usage: {script_name} INPUT_FILE OUTPUT_FILE
Adds noise to the csv file given as input.
"""
import random
import sys
from collections import deque
def usage():
print(__doc__.format(script_name=sys.argv[0].split("/")[-1]))
sys.exit(0)
def empty_lines(line_num):
empty_count = 50... | <commit_before><commit_msg>Add scripts that adds noise to datasets<commit_after> | #!/usr/bin/env python3
"""
Usage: {script_name} INPUT_FILE OUTPUT_FILE
Adds noise to the csv file given as input.
"""
import random
import sys
from collections import deque
def usage():
print(__doc__.format(script_name=sys.argv[0].split("/")[-1]))
sys.exit(0)
def empty_lines(line_num):
empty_count = 50... | Add scripts that adds noise to datasets#!/usr/bin/env python3
"""
Usage: {script_name} INPUT_FILE OUTPUT_FILE
Adds noise to the csv file given as input.
"""
import random
import sys
from collections import deque
def usage():
print(__doc__.format(script_name=sys.argv[0].split("/")[-1]))
sys.exit(0)
def empt... | <commit_before><commit_msg>Add scripts that adds noise to datasets<commit_after>#!/usr/bin/env python3
"""
Usage: {script_name} INPUT_FILE OUTPUT_FILE
Adds noise to the csv file given as input.
"""
import random
import sys
from collections import deque
def usage():
print(__doc__.format(script_name=sys.argv[0].sp... | |
97f70e4d285a2ce231442f6544927671ca959c38 | Graphs/nodes_at_same_level.py | Graphs/nodes_at_same_level.py | import unittest
"""
Write a function to connect all adjacent nodes at same level in binary tree.
"""
class Node:
def __init__(self, key, left=None, right=None):
self.key = key
self.left = left
self.right = right
self.next_right = None
def connect_level(root):
if root is None... | Connect nodes at same level in binary tree | Connect nodes at same level in binary tree
| Python | mit | prathamtandon/g4gproblems | Connect nodes at same level in binary tree | import unittest
"""
Write a function to connect all adjacent nodes at same level in binary tree.
"""
class Node:
def __init__(self, key, left=None, right=None):
self.key = key
self.left = left
self.right = right
self.next_right = None
def connect_level(root):
if root is None... | <commit_before><commit_msg>Connect nodes at same level in binary tree<commit_after> | import unittest
"""
Write a function to connect all adjacent nodes at same level in binary tree.
"""
class Node:
def __init__(self, key, left=None, right=None):
self.key = key
self.left = left
self.right = right
self.next_right = None
def connect_level(root):
if root is None... | Connect nodes at same level in binary treeimport unittest
"""
Write a function to connect all adjacent nodes at same level in binary tree.
"""
class Node:
def __init__(self, key, left=None, right=None):
self.key = key
self.left = left
self.right = right
self.next_right = None
def... | <commit_before><commit_msg>Connect nodes at same level in binary tree<commit_after>import unittest
"""
Write a function to connect all adjacent nodes at same level in binary tree.
"""
class Node:
def __init__(self, key, left=None, right=None):
self.key = key
self.left = left
self.right = r... | |
3e97849ce926fa375335227467064b55c4ff594f | scripts/find_existing_results.py | scripts/find_existing_results.py | #!/usr/bin/env python
import os
import sys
import argparse
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument('-s', '--samples_file', help="Input list of sample/library names to search for")
args = parser.parse_args()
samples = list()
with open(args.samples_file, 'r... | Add script for finding duplicate results | Add script for finding duplicate results
| Python | mit | dgaston/ddbio-ngsflow,dgaston/ddb-ngsflow | Add script for finding duplicate results | #!/usr/bin/env python
import os
import sys
import argparse
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument('-s', '--samples_file', help="Input list of sample/library names to search for")
args = parser.parse_args()
samples = list()
with open(args.samples_file, 'r... | <commit_before><commit_msg>Add script for finding duplicate results<commit_after> | #!/usr/bin/env python
import os
import sys
import argparse
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument('-s', '--samples_file', help="Input list of sample/library names to search for")
args = parser.parse_args()
samples = list()
with open(args.samples_file, 'r... | Add script for finding duplicate results#!/usr/bin/env python
import os
import sys
import argparse
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument('-s', '--samples_file', help="Input list of sample/library names to search for")
args = parser.parse_args()
samples = li... | <commit_before><commit_msg>Add script for finding duplicate results<commit_after>#!/usr/bin/env python
import os
import sys
import argparse
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument('-s', '--samples_file', help="Input list of sample/library names to search for")
arg... | |
4ffab859f2798db504d47a98b525aba200e03c7a | imager/ImagerProfile/migrations/0003_auto_20150303_1301.py | imager/ImagerProfile/migrations/0003_auto_20150303_1301.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
('ImagerProfile', '0002_auto_20150303_0721'),
]
operations = [
migrations.AlterField(
... | Add migration for changes to ImagerProfile user related name | Add migration for changes to ImagerProfile user related name
| Python | mit | nbeck90/django-imager,nbeck90/django-imager | Add migration for changes to ImagerProfile user related name | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
('ImagerProfile', '0002_auto_20150303_0721'),
]
operations = [
migrations.AlterField(
... | <commit_before><commit_msg>Add migration for changes to ImagerProfile user related name<commit_after> | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
('ImagerProfile', '0002_auto_20150303_0721'),
]
operations = [
migrations.AlterField(
... | Add migration for changes to ImagerProfile user related name# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
('ImagerProfile', '0002_auto_20150303_0721'),
... | <commit_before><commit_msg>Add migration for changes to ImagerProfile user related name<commit_after># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
('ImagerP... | |
ea27d19cb30b05d66256115753e82156d5a6d69d | openedx/tests/xblock_integration/test_external_xblocks.py | openedx/tests/xblock_integration/test_external_xblocks.py | """
This will run tests on all XBlocks in the `xblock.test.v0`
entrypoint. Did you notice something about that entry point? It ends
with a v0. That means this is not finished. At some point, we might
stop running v0 tests, replacing them with test case failures, and
run v1 tests only.
That be the dragon here.
"""
impo... | Allow us to run tests from external XBlock repositories | Allow us to run tests from external XBlock repositories
| Python | agpl-3.0 | ampax/edx-platform,teltek/edx-platform,chrisndodge/edx-platform,antoviaque/edx-platform,deepsrijit1105/edx-platform,proversity-org/edx-platform,doganov/edx-platform,hastexo/edx-platform,angelapper/edx-platform,naresh21/synergetics-edx-platform,Stanford-Online/edx-platform,msegado/edx-platform,ovnicraft/edx-platform,app... | Allow us to run tests from external XBlock repositories | """
This will run tests on all XBlocks in the `xblock.test.v0`
entrypoint. Did you notice something about that entry point? It ends
with a v0. That means this is not finished. At some point, we might
stop running v0 tests, replacing them with test case failures, and
run v1 tests only.
That be the dragon here.
"""
impo... | <commit_before><commit_msg>Allow us to run tests from external XBlock repositories<commit_after> | """
This will run tests on all XBlocks in the `xblock.test.v0`
entrypoint. Did you notice something about that entry point? It ends
with a v0. That means this is not finished. At some point, we might
stop running v0 tests, replacing them with test case failures, and
run v1 tests only.
That be the dragon here.
"""
impo... | Allow us to run tests from external XBlock repositories"""
This will run tests on all XBlocks in the `xblock.test.v0`
entrypoint. Did you notice something about that entry point? It ends
with a v0. That means this is not finished. At some point, we might
stop running v0 tests, replacing them with test case failures, an... | <commit_before><commit_msg>Allow us to run tests from external XBlock repositories<commit_after>"""
This will run tests on all XBlocks in the `xblock.test.v0`
entrypoint. Did you notice something about that entry point? It ends
with a v0. That means this is not finished. At some point, we might
stop running v0 tests, r... | |
3559063b9110aa04b773dfc56db05297e4ce472f | migrations/versions/0249_another_letter_org.py | migrations/versions/0249_another_letter_org.py | """empty message
Revision ID: 0249_another_letter_org
Revises: 0248_enable_choose_postage
"""
# revision identifiers, used by Alembic.
revision = '0249_another_letter_org'
down_revision = '0248_enable_choose_postage'
from alembic import op
NEW_ORGANISATIONS = [
('521', 'North Somerset Council', 'north-somerse... | Add letter logo for North Somerset council | Add letter logo for North Somerset council
| Python | mit | alphagov/notifications-api,alphagov/notifications-api | Add letter logo for North Somerset council | """empty message
Revision ID: 0249_another_letter_org
Revises: 0248_enable_choose_postage
"""
# revision identifiers, used by Alembic.
revision = '0249_another_letter_org'
down_revision = '0248_enable_choose_postage'
from alembic import op
NEW_ORGANISATIONS = [
('521', 'North Somerset Council', 'north-somerse... | <commit_before><commit_msg>Add letter logo for North Somerset council<commit_after> | """empty message
Revision ID: 0249_another_letter_org
Revises: 0248_enable_choose_postage
"""
# revision identifiers, used by Alembic.
revision = '0249_another_letter_org'
down_revision = '0248_enable_choose_postage'
from alembic import op
NEW_ORGANISATIONS = [
('521', 'North Somerset Council', 'north-somerse... | Add letter logo for North Somerset council"""empty message
Revision ID: 0249_another_letter_org
Revises: 0248_enable_choose_postage
"""
# revision identifiers, used by Alembic.
revision = '0249_another_letter_org'
down_revision = '0248_enable_choose_postage'
from alembic import op
NEW_ORGANISATIONS = [
('521'... | <commit_before><commit_msg>Add letter logo for North Somerset council<commit_after>"""empty message
Revision ID: 0249_another_letter_org
Revises: 0248_enable_choose_postage
"""
# revision identifiers, used by Alembic.
revision = '0249_another_letter_org'
down_revision = '0248_enable_choose_postage'
from alembic imp... | |
85f179a4d515801c4cfcb35e198efe268959d0ba | test/trainer_test.py | test/trainer_test.py | import theanets
import util
class TestTrainer(util.MNIST):
def setUp(self):
super(TestTrainer, self).setUp()
self.exp = theanets.Experiment(
theanets.Autoencoder,
layers=(self.DIGIT_SIZE, 10, self.DIGIT_SIZE))
def assert_progress(self, algo, **kwargs):
trainer... | import theanets
import util
class TestTrainer(util.MNIST):
def setUp(self):
super(TestTrainer, self).setUp()
self.exp = theanets.Experiment(
theanets.Autoencoder,
layers=(self.DIGIT_SIZE, 10, self.DIGIT_SIZE))
def assert_progress(self, algo, **kwargs):
trainer... | Test 1st training loss improves over 0th validation. | Test 1st training loss improves over 0th validation.
| Python | mit | devdoer/theanets,chrinide/theanets,lmjohns3/theanets | import theanets
import util
class TestTrainer(util.MNIST):
def setUp(self):
super(TestTrainer, self).setUp()
self.exp = theanets.Experiment(
theanets.Autoencoder,
layers=(self.DIGIT_SIZE, 10, self.DIGIT_SIZE))
def assert_progress(self, algo, **kwargs):
trainer... | import theanets
import util
class TestTrainer(util.MNIST):
def setUp(self):
super(TestTrainer, self).setUp()
self.exp = theanets.Experiment(
theanets.Autoencoder,
layers=(self.DIGIT_SIZE, 10, self.DIGIT_SIZE))
def assert_progress(self, algo, **kwargs):
trainer... | <commit_before>import theanets
import util
class TestTrainer(util.MNIST):
def setUp(self):
super(TestTrainer, self).setUp()
self.exp = theanets.Experiment(
theanets.Autoencoder,
layers=(self.DIGIT_SIZE, 10, self.DIGIT_SIZE))
def assert_progress(self, algo, **kwargs):
... | import theanets
import util
class TestTrainer(util.MNIST):
def setUp(self):
super(TestTrainer, self).setUp()
self.exp = theanets.Experiment(
theanets.Autoencoder,
layers=(self.DIGIT_SIZE, 10, self.DIGIT_SIZE))
def assert_progress(self, algo, **kwargs):
trainer... | import theanets
import util
class TestTrainer(util.MNIST):
def setUp(self):
super(TestTrainer, self).setUp()
self.exp = theanets.Experiment(
theanets.Autoencoder,
layers=(self.DIGIT_SIZE, 10, self.DIGIT_SIZE))
def assert_progress(self, algo, **kwargs):
trainer... | <commit_before>import theanets
import util
class TestTrainer(util.MNIST):
def setUp(self):
super(TestTrainer, self).setUp()
self.exp = theanets.Experiment(
theanets.Autoencoder,
layers=(self.DIGIT_SIZE, 10, self.DIGIT_SIZE))
def assert_progress(self, algo, **kwargs):
... |
d67f6e9e96352e54e4b23e1740e90d009dac3b36 | scripts/generate_match_message.py | scripts/generate_match_message.py | from django.utils import translation
from django.template.loader import get_template
from bluebottle.activities.tasks import get_matching_activities
from bluebottle.members.models import Member
import logging
from bluebottle.clients.models import Client
from bluebottle.clients.utils import LocalTenant
from bluebottl... | Add script that generate a message | Add script that generate a message
| Python | bsd-3-clause | onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle | Add script that generate a message | from django.utils import translation
from django.template.loader import get_template
from bluebottle.activities.tasks import get_matching_activities
from bluebottle.members.models import Member
import logging
from bluebottle.clients.models import Client
from bluebottle.clients.utils import LocalTenant
from bluebottl... | <commit_before><commit_msg>Add script that generate a message<commit_after> | from django.utils import translation
from django.template.loader import get_template
from bluebottle.activities.tasks import get_matching_activities
from bluebottle.members.models import Member
import logging
from bluebottle.clients.models import Client
from bluebottle.clients.utils import LocalTenant
from bluebottl... | Add script that generate a messagefrom django.utils import translation
from django.template.loader import get_template
from bluebottle.activities.tasks import get_matching_activities
from bluebottle.members.models import Member
import logging
from bluebottle.clients.models import Client
from bluebottle.clients.utils... | <commit_before><commit_msg>Add script that generate a message<commit_after>from django.utils import translation
from django.template.loader import get_template
from bluebottle.activities.tasks import get_matching_activities
from bluebottle.members.models import Member
import logging
from bluebottle.clients.models im... | |
67cddb074622343bd48ba4ad75bbdbe2d9b042dc | changeFileNameFromID.py | changeFileNameFromID.py | import os
import codecs
import re
EXT = "usfm"
SOURCEDIR = "."
PROJECT = "OA-GUJ"
bk = {"GEN":1, "EXO":2, "LEV":3, "NUM":4, "DEU":5, "JOS":6, "JDG":7, "RUT":8, "1SA":9, "2SA":10, "1KI":11, "2KI":12, "1CH":13, "2CH":14, "EZR":15, "NEH":16, "EST":17, "JOB":18, "PSA":19, "PRO":20, "ECC":21, "SNG":22, "ISA":23, "JE... | Change the name of usfm file according to ID | Change the name of usfm file according to ID
This script will change the name of a usfm file according to the ID information. Quite useful when users gives files with unconventional naming system. | Python | mit | beniza/learningPython | Change the name of usfm file according to ID
This script will change the name of a usfm file according to the ID information. Quite useful when users gives files with unconventional naming system. | import os
import codecs
import re
EXT = "usfm"
SOURCEDIR = "."
PROJECT = "OA-GUJ"
bk = {"GEN":1, "EXO":2, "LEV":3, "NUM":4, "DEU":5, "JOS":6, "JDG":7, "RUT":8, "1SA":9, "2SA":10, "1KI":11, "2KI":12, "1CH":13, "2CH":14, "EZR":15, "NEH":16, "EST":17, "JOB":18, "PSA":19, "PRO":20, "ECC":21, "SNG":22, "ISA":23, "JE... | <commit_before><commit_msg>Change the name of usfm file according to ID
This script will change the name of a usfm file according to the ID information. Quite useful when users gives files with unconventional naming system.<commit_after> | import os
import codecs
import re
EXT = "usfm"
SOURCEDIR = "."
PROJECT = "OA-GUJ"
bk = {"GEN":1, "EXO":2, "LEV":3, "NUM":4, "DEU":5, "JOS":6, "JDG":7, "RUT":8, "1SA":9, "2SA":10, "1KI":11, "2KI":12, "1CH":13, "2CH":14, "EZR":15, "NEH":16, "EST":17, "JOB":18, "PSA":19, "PRO":20, "ECC":21, "SNG":22, "ISA":23, "JE... | Change the name of usfm file according to ID
This script will change the name of a usfm file according to the ID information. Quite useful when users gives files with unconventional naming system.import os
import codecs
import re
EXT = "usfm"
SOURCEDIR = "."
PROJECT = "OA-GUJ"
bk = {"GEN":1, "EXO":2, "LEV":3, ... | <commit_before><commit_msg>Change the name of usfm file according to ID
This script will change the name of a usfm file according to the ID information. Quite useful when users gives files with unconventional naming system.<commit_after>import os
import codecs
import re
EXT = "usfm"
SOURCEDIR = "."
PROJECT = "O... | |
0264308667d2b64dbb089d4758258281b7ccbc1f | nlpdemo/lib_confirm_sample/confirm-openpyxl.py | nlpdemo/lib_confirm_sample/confirm-openpyxl.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
from openpyxl import Workbook
wb = Workbook()
# grab the active worksheet
ws = wb.active
# Data can be assigned directly to cells
ws['A1'] = 42
# Rows can also be appended
ws.append([1, 2, 3])
# Python types will automatically be converted
import datetime
ws['A2'] = ... | Add lib confirm for openpyxl | Add lib confirm for openpyxl
| Python | mit | demonstrationch/nlp-demo | Add lib confirm for openpyxl | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
from openpyxl import Workbook
wb = Workbook()
# grab the active worksheet
ws = wb.active
# Data can be assigned directly to cells
ws['A1'] = 42
# Rows can also be appended
ws.append([1, 2, 3])
# Python types will automatically be converted
import datetime
ws['A2'] = ... | <commit_before><commit_msg>Add lib confirm for openpyxl<commit_after> | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
from openpyxl import Workbook
wb = Workbook()
# grab the active worksheet
ws = wb.active
# Data can be assigned directly to cells
ws['A1'] = 42
# Rows can also be appended
ws.append([1, 2, 3])
# Python types will automatically be converted
import datetime
ws['A2'] = ... | Add lib confirm for openpyxl#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
from openpyxl import Workbook
wb = Workbook()
# grab the active worksheet
ws = wb.active
# Data can be assigned directly to cells
ws['A1'] = 42
# Rows can also be appended
ws.append([1, 2, 3])
# Python types will automatically be converted... | <commit_before><commit_msg>Add lib confirm for openpyxl<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
from openpyxl import Workbook
wb = Workbook()
# grab the active worksheet
ws = wb.active
# Data can be assigned directly to cells
ws['A1'] = 42
# Rows can also be appended
ws.append([1, 2, 3])
# Pyt... | |
bf138c0f268d470336c5f96b467e319b01303048 | app/utils/utc.py | app/utils/utc.py | # UTC implementation borrowed from the Python docs:
# http://docs.python.org/2/library/datetime.html#tzinfo-objects
# License is the same as the example one.
from datetime import (
timedelta,
tzinfo,
)
ZERO = timedelta(0)
class UTC(tzinfo):
"""UTC"""
def utcoffset(self, dt):
return ZERO
... | Add a simple UTC tzinfo implementation. | Add a simple UTC tzinfo implementation.
* Python 2.x does not have any time zone info implemented.
By default we will treat time as UTC time, adjustments should
be done by the clients.
Here we introduce a very simple UTC Python tzinfo class borrowed
from the Python docs.
| Python | lgpl-2.1 | kernelci/kernelci-backend,joyxu/kernelci-backend,joyxu/kernelci-backend,joyxu/kernelci-backend,kernelci/kernelci-backend | Add a simple UTC tzinfo implementation.
* Python 2.x does not have any time zone info implemented.
By default we will treat time as UTC time, adjustments should
be done by the clients.
Here we introduce a very simple UTC Python tzinfo class borrowed
from the Python docs. | # UTC implementation borrowed from the Python docs:
# http://docs.python.org/2/library/datetime.html#tzinfo-objects
# License is the same as the example one.
from datetime import (
timedelta,
tzinfo,
)
ZERO = timedelta(0)
class UTC(tzinfo):
"""UTC"""
def utcoffset(self, dt):
return ZERO
... | <commit_before><commit_msg>Add a simple UTC tzinfo implementation.
* Python 2.x does not have any time zone info implemented.
By default we will treat time as UTC time, adjustments should
be done by the clients.
Here we introduce a very simple UTC Python tzinfo class borrowed
from the Python docs.<co... | # UTC implementation borrowed from the Python docs:
# http://docs.python.org/2/library/datetime.html#tzinfo-objects
# License is the same as the example one.
from datetime import (
timedelta,
tzinfo,
)
ZERO = timedelta(0)
class UTC(tzinfo):
"""UTC"""
def utcoffset(self, dt):
return ZERO
... | Add a simple UTC tzinfo implementation.
* Python 2.x does not have any time zone info implemented.
By default we will treat time as UTC time, adjustments should
be done by the clients.
Here we introduce a very simple UTC Python tzinfo class borrowed
from the Python docs.# UTC implementation borrowed ... | <commit_before><commit_msg>Add a simple UTC tzinfo implementation.
* Python 2.x does not have any time zone info implemented.
By default we will treat time as UTC time, adjustments should
be done by the clients.
Here we introduce a very simple UTC Python tzinfo class borrowed
from the Python docs.<co... | |
e58bcd886829cc1b38b5f8383b0553136b709ace | .appveyor.test.py | .appveyor.test.py | from dmoj import judgeenv, executors
from dmoj.testsuite import Tester
from dmoj.utils.ansi import ansi_style
required_executors = ['AWK', 'BF', 'C', 'CPP03', 'CPP11', 'CS', 'GO', 'PERL', 'PY2', 'PY3',
'RUBY19', 'RUBY21', 'SED', 'VB']
def main():
judgeenv.load_env(cli=True, testsuite=True)... | Check that all required executors are loaded on AppVeyor | Check that all required executors are loaded on AppVeyor
| Python | agpl-3.0 | DMOJ/judge,DMOJ/judge,DMOJ/judge | Check that all required executors are loaded on AppVeyor | from dmoj import judgeenv, executors
from dmoj.testsuite import Tester
from dmoj.utils.ansi import ansi_style
required_executors = ['AWK', 'BF', 'C', 'CPP03', 'CPP11', 'CS', 'GO', 'PERL', 'PY2', 'PY3',
'RUBY19', 'RUBY21', 'SED', 'VB']
def main():
judgeenv.load_env(cli=True, testsuite=True)... | <commit_before><commit_msg>Check that all required executors are loaded on AppVeyor<commit_after> | from dmoj import judgeenv, executors
from dmoj.testsuite import Tester
from dmoj.utils.ansi import ansi_style
required_executors = ['AWK', 'BF', 'C', 'CPP03', 'CPP11', 'CS', 'GO', 'PERL', 'PY2', 'PY3',
'RUBY19', 'RUBY21', 'SED', 'VB']
def main():
judgeenv.load_env(cli=True, testsuite=True)... | Check that all required executors are loaded on AppVeyorfrom dmoj import judgeenv, executors
from dmoj.testsuite import Tester
from dmoj.utils.ansi import ansi_style
required_executors = ['AWK', 'BF', 'C', 'CPP03', 'CPP11', 'CS', 'GO', 'PERL', 'PY2', 'PY3',
'RUBY19', 'RUBY21', 'SED', 'VB']
def... | <commit_before><commit_msg>Check that all required executors are loaded on AppVeyor<commit_after>from dmoj import judgeenv, executors
from dmoj.testsuite import Tester
from dmoj.utils.ansi import ansi_style
required_executors = ['AWK', 'BF', 'C', 'CPP03', 'CPP11', 'CS', 'GO', 'PERL', 'PY2', 'PY3',
... | |
b33b919a15f335d93229bc80bd0f834ebab0c03d | scripts/python/plot_signal.py | scripts/python/plot_signal.py | """
A script to plot signals
"""
import sys
import os
import getopt
import json
import matplotlib.pyplot as plt
CMD_USAGE = """
"""
MAX_PLOT_SIZE = 5000
def plot_signal(signal):
with open(signal, "rb") as json_file:
json_data = json.load(json_file)
beacons = json_data['interestedBeacons']
... | Add script to plot signal figure. | Add script to plot signal figure.
| Python | bsd-3-clause | Wayne82/libsvm-practice,Wayne82/libsvm-practice,Wayne82/libsvm-practice | Add script to plot signal figure. | """
A script to plot signals
"""
import sys
import os
import getopt
import json
import matplotlib.pyplot as plt
CMD_USAGE = """
"""
MAX_PLOT_SIZE = 5000
def plot_signal(signal):
with open(signal, "rb") as json_file:
json_data = json.load(json_file)
beacons = json_data['interestedBeacons']
... | <commit_before><commit_msg>Add script to plot signal figure.<commit_after> | """
A script to plot signals
"""
import sys
import os
import getopt
import json
import matplotlib.pyplot as plt
CMD_USAGE = """
"""
MAX_PLOT_SIZE = 5000
def plot_signal(signal):
with open(signal, "rb") as json_file:
json_data = json.load(json_file)
beacons = json_data['interestedBeacons']
... | Add script to plot signal figure."""
A script to plot signals
"""
import sys
import os
import getopt
import json
import matplotlib.pyplot as plt
CMD_USAGE = """
"""
MAX_PLOT_SIZE = 5000
def plot_signal(signal):
with open(signal, "rb") as json_file:
json_data = json.load(json_file)
beacons = json_... | <commit_before><commit_msg>Add script to plot signal figure.<commit_after>"""
A script to plot signals
"""
import sys
import os
import getopt
import json
import matplotlib.pyplot as plt
CMD_USAGE = """
"""
MAX_PLOT_SIZE = 5000
def plot_signal(signal):
with open(signal, "rb") as json_file:
json_data = jso... | |
a9507a8187f72cbf77889ee87b01a54f2ed4ffe9 | examples/crawler.py | examples/crawler.py | import guv
guv.monkey_patch()
import requests
def get_url(url):
print('get_url()')
return requests.get(url)
def main():
urls = ['http://httpbin.org/delay/1'] * 10
pool = guv.GreenPool()
results = pool.imap(get_url, urls)
for i, resp in enumerate(results):
print('{}: done, length: {}... | Add simple example web cralwer | Add simple example web cralwer
| Python | mit | veegee/guv,veegee/guv | Add simple example web cralwer | import guv
guv.monkey_patch()
import requests
def get_url(url):
print('get_url()')
return requests.get(url)
def main():
urls = ['http://httpbin.org/delay/1'] * 10
pool = guv.GreenPool()
results = pool.imap(get_url, urls)
for i, resp in enumerate(results):
print('{}: done, length: {}... | <commit_before><commit_msg>Add simple example web cralwer<commit_after> | import guv
guv.monkey_patch()
import requests
def get_url(url):
print('get_url()')
return requests.get(url)
def main():
urls = ['http://httpbin.org/delay/1'] * 10
pool = guv.GreenPool()
results = pool.imap(get_url, urls)
for i, resp in enumerate(results):
print('{}: done, length: {}... | Add simple example web cralwerimport guv
guv.monkey_patch()
import requests
def get_url(url):
print('get_url()')
return requests.get(url)
def main():
urls = ['http://httpbin.org/delay/1'] * 10
pool = guv.GreenPool()
results = pool.imap(get_url, urls)
for i, resp in enumerate(results):
... | <commit_before><commit_msg>Add simple example web cralwer<commit_after>import guv
guv.monkey_patch()
import requests
def get_url(url):
print('get_url()')
return requests.get(url)
def main():
urls = ['http://httpbin.org/delay/1'] * 10
pool = guv.GreenPool()
results = pool.imap(get_url, urls)
... | |
4a6eb1059f2321b2e54edc6bb614dca7d06c186f | CodeFights/isIPv4Address.py | CodeFights/isIPv4Address.py | #!/usr/local/bin/python
# Code Fights Is IPv4 Address Problem
def isIPv4Address(inputString):
import re
pattern = re.compile(r'^\d{1,3}(?:\.\d{1,3}){3}$')
match = re.search(pattern, inputString)
if match:
segments = inputString.split(".")
return sum([int(x) >= 0 and int(x) <= 255 for x... | Solve Code Fights is IPv4 address problem | Solve Code Fights is IPv4 address problem
| Python | mit | HKuz/Test_Code | Solve Code Fights is IPv4 address problem | #!/usr/local/bin/python
# Code Fights Is IPv4 Address Problem
def isIPv4Address(inputString):
import re
pattern = re.compile(r'^\d{1,3}(?:\.\d{1,3}){3}$')
match = re.search(pattern, inputString)
if match:
segments = inputString.split(".")
return sum([int(x) >= 0 and int(x) <= 255 for x... | <commit_before><commit_msg>Solve Code Fights is IPv4 address problem<commit_after> | #!/usr/local/bin/python
# Code Fights Is IPv4 Address Problem
def isIPv4Address(inputString):
import re
pattern = re.compile(r'^\d{1,3}(?:\.\d{1,3}){3}$')
match = re.search(pattern, inputString)
if match:
segments = inputString.split(".")
return sum([int(x) >= 0 and int(x) <= 255 for x... | Solve Code Fights is IPv4 address problem#!/usr/local/bin/python
# Code Fights Is IPv4 Address Problem
def isIPv4Address(inputString):
import re
pattern = re.compile(r'^\d{1,3}(?:\.\d{1,3}){3}$')
match = re.search(pattern, inputString)
if match:
segments = inputString.split(".")
return... | <commit_before><commit_msg>Solve Code Fights is IPv4 address problem<commit_after>#!/usr/local/bin/python
# Code Fights Is IPv4 Address Problem
def isIPv4Address(inputString):
import re
pattern = re.compile(r'^\d{1,3}(?:\.\d{1,3}){3}$')
match = re.search(pattern, inputString)
if match:
segment... | |
7205ca43cfb7576b217f34fefebb288545609926 | Test/utiltest.py | Test/utiltest.py | import sys
sys.path.append("../")
import unittest
import Algorithmia
from Algorithmia.util import getParentAndBase
class UtilTest(unittest.TestCase):
def test_getParentAndBase(self):
self.assertEqual(('a/b', 'c'), getParentAndBase('a/b/c'))
self.assertEqual(('a/b', 'c'), getParentAndBase('a/b/c//... | Add some tests for the util getParentAndBase method | Add some tests for the util getParentAndBase method
| Python | mit | algorithmiaio/algorithmia-python | Add some tests for the util getParentAndBase method | import sys
sys.path.append("../")
import unittest
import Algorithmia
from Algorithmia.util import getParentAndBase
class UtilTest(unittest.TestCase):
def test_getParentAndBase(self):
self.assertEqual(('a/b', 'c'), getParentAndBase('a/b/c'))
self.assertEqual(('a/b', 'c'), getParentAndBase('a/b/c//... | <commit_before><commit_msg>Add some tests for the util getParentAndBase method<commit_after> | import sys
sys.path.append("../")
import unittest
import Algorithmia
from Algorithmia.util import getParentAndBase
class UtilTest(unittest.TestCase):
def test_getParentAndBase(self):
self.assertEqual(('a/b', 'c'), getParentAndBase('a/b/c'))
self.assertEqual(('a/b', 'c'), getParentAndBase('a/b/c//... | Add some tests for the util getParentAndBase methodimport sys
sys.path.append("../")
import unittest
import Algorithmia
from Algorithmia.util import getParentAndBase
class UtilTest(unittest.TestCase):
def test_getParentAndBase(self):
self.assertEqual(('a/b', 'c'), getParentAndBase('a/b/c'))
self.... | <commit_before><commit_msg>Add some tests for the util getParentAndBase method<commit_after>import sys
sys.path.append("../")
import unittest
import Algorithmia
from Algorithmia.util import getParentAndBase
class UtilTest(unittest.TestCase):
def test_getParentAndBase(self):
self.assertEqual(('a/b', 'c'),... | |
438c6d0b8bea994e9f57b4c480ebcdfd197a0e28 | setup.py | setup.py | from setuptools import setup, find_packages
import plaid
url = 'https://github.com/plaid/plaid-python'
setup(
name='plaid-python',
version=plaid.__version__,
description='Simple Python API client for Plaid',
long_description='',
keywords='api, client, plaid',
author='Chris Forrette',
auth... | from setuptools import setup, find_packages
import plaid
url = 'https://github.com/plaid/plaid-python'
setup(
name='plaid-python',
version=plaid.__version__,
description='Simple Python API client for Plaid',
long_description='',
keywords='api, client, plaid',
author='Chris Forrette',
auth... | Update "Programming Language" Tag to Indicate Python3 Support | Update "Programming Language" Tag to Indicate Python3 Support
| Python | mit | erikbern/plaid-python,qwil/plaid-python,plaid/plaid-python | from setuptools import setup, find_packages
import plaid
url = 'https://github.com/plaid/plaid-python'
setup(
name='plaid-python',
version=plaid.__version__,
description='Simple Python API client for Plaid',
long_description='',
keywords='api, client, plaid',
author='Chris Forrette',
auth... | from setuptools import setup, find_packages
import plaid
url = 'https://github.com/plaid/plaid-python'
setup(
name='plaid-python',
version=plaid.__version__,
description='Simple Python API client for Plaid',
long_description='',
keywords='api, client, plaid',
author='Chris Forrette',
auth... | <commit_before>from setuptools import setup, find_packages
import plaid
url = 'https://github.com/plaid/plaid-python'
setup(
name='plaid-python',
version=plaid.__version__,
description='Simple Python API client for Plaid',
long_description='',
keywords='api, client, plaid',
author='Chris Forr... | from setuptools import setup, find_packages
import plaid
url = 'https://github.com/plaid/plaid-python'
setup(
name='plaid-python',
version=plaid.__version__,
description='Simple Python API client for Plaid',
long_description='',
keywords='api, client, plaid',
author='Chris Forrette',
auth... | from setuptools import setup, find_packages
import plaid
url = 'https://github.com/plaid/plaid-python'
setup(
name='plaid-python',
version=plaid.__version__,
description='Simple Python API client for Plaid',
long_description='',
keywords='api, client, plaid',
author='Chris Forrette',
auth... | <commit_before>from setuptools import setup, find_packages
import plaid
url = 'https://github.com/plaid/plaid-python'
setup(
name='plaid-python',
version=plaid.__version__,
description='Simple Python API client for Plaid',
long_description='',
keywords='api, client, plaid',
author='Chris Forr... |
66cf36dc9803443723c824b246ef8c065aba8d86 | utils/CIndex/completion_logger_server.py | utils/CIndex/completion_logger_server.py | #!/usr/bin/env python
import sys
from socket import *
from time import localtime, strftime
def main():
if len(sys.argv) < 4:
print "completion_logger_server.py <listen address> <listen port> <log file>"
exit(1)
host = sys.argv[1]
port = int(sys.argv[2])
buf = 1024 * 8
addr = (host,port)
# Creat... | Add simple python server for recording code completion timings. | Add simple python server for recording code completion timings.
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@101327 91177308-0d34-0410-b5e6-96231b3b80d8
| Python | apache-2.0 | llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/cl... | Add simple python server for recording code completion timings.
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@101327 91177308-0d34-0410-b5e6-96231b3b80d8 | #!/usr/bin/env python
import sys
from socket import *
from time import localtime, strftime
def main():
if len(sys.argv) < 4:
print "completion_logger_server.py <listen address> <listen port> <log file>"
exit(1)
host = sys.argv[1]
port = int(sys.argv[2])
buf = 1024 * 8
addr = (host,port)
# Creat... | <commit_before><commit_msg>Add simple python server for recording code completion timings.
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@101327 91177308-0d34-0410-b5e6-96231b3b80d8<commit_after> | #!/usr/bin/env python
import sys
from socket import *
from time import localtime, strftime
def main():
if len(sys.argv) < 4:
print "completion_logger_server.py <listen address> <listen port> <log file>"
exit(1)
host = sys.argv[1]
port = int(sys.argv[2])
buf = 1024 * 8
addr = (host,port)
# Creat... | Add simple python server for recording code completion timings.
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@101327 91177308-0d34-0410-b5e6-96231b3b80d8#!/usr/bin/env python
import sys
from socket import *
from time import localtime, strftime
def main():
if len(sys.argv) < 4:
print "completion_logger_se... | <commit_before><commit_msg>Add simple python server for recording code completion timings.
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@101327 91177308-0d34-0410-b5e6-96231b3b80d8<commit_after>#!/usr/bin/env python
import sys
from socket import *
from time import localtime, strftime
def main():
if len(sys.a... | |
31fb276ce27375b40e1ac6fe2fd360802cf65f77 | tests/test_pm_imagenet.py | tests/test_pm_imagenet.py | import pytest
import torch
import torch.nn as nn
from torch.autograd import Variable
import pretrainedmodels as pm
import pretrainedmodels.utils as utils
pm_args = []
for model_name in pm.model_names:
for pretrained in pm.pretrained_settings[model_name]:
if pretrained in ['imagenet', 'imagenet+5k']:
... | Add download/forward tests for imagenet pretrainedmodels | Add download/forward tests for imagenet pretrainedmodels
| Python | bsd-3-clause | Cadene/pretrained-models.pytorch | Add download/forward tests for imagenet pretrainedmodels | import pytest
import torch
import torch.nn as nn
from torch.autograd import Variable
import pretrainedmodels as pm
import pretrainedmodels.utils as utils
pm_args = []
for model_name in pm.model_names:
for pretrained in pm.pretrained_settings[model_name]:
if pretrained in ['imagenet', 'imagenet+5k']:
... | <commit_before><commit_msg>Add download/forward tests for imagenet pretrainedmodels<commit_after> | import pytest
import torch
import torch.nn as nn
from torch.autograd import Variable
import pretrainedmodels as pm
import pretrainedmodels.utils as utils
pm_args = []
for model_name in pm.model_names:
for pretrained in pm.pretrained_settings[model_name]:
if pretrained in ['imagenet', 'imagenet+5k']:
... | Add download/forward tests for imagenet pretrainedmodelsimport pytest
import torch
import torch.nn as nn
from torch.autograd import Variable
import pretrainedmodels as pm
import pretrainedmodels.utils as utils
pm_args = []
for model_name in pm.model_names:
for pretrained in pm.pretrained_settings[model_name]:
... | <commit_before><commit_msg>Add download/forward tests for imagenet pretrainedmodels<commit_after>import pytest
import torch
import torch.nn as nn
from torch.autograd import Variable
import pretrainedmodels as pm
import pretrainedmodels.utils as utils
pm_args = []
for model_name in pm.model_names:
for pretrained in... | |
c8c737d3763965543e738225d5d435601c50b9b2 | bn.py | bn.py | import sys
from time import gmtime
year, mon, mday, hour, min, sec, wday, yday, isdst = gmtime()
bld = ((year - 2000) * 12 + mon - 1) * 100 + mday
rev = hour * 100 + min
print 'Your build and revision number for today is %d.%d.' % (bld, rev)
| Build and revision number script | Build and revision number script
| Python | apache-2.0 | vasiliy-vdovichenko/ncrontab,youniss2013/ncrontab,amitapl/ncrontab,xingh/ncrontab,devnarayan/ncrontab,paulgmiller/ncrontab,cyotek/ncrontab,IntranetFactory/ncrontab,jakesays/ncrontab,codesharpdev/ncrontab,DanThiffault/ncrontab,paulgmiller/ncrontab,IntranetFactory/ncrontab,micheltol/ncrontab,bjorskog/ncrontab,xingh/ncron... | Build and revision number script | import sys
from time import gmtime
year, mon, mday, hour, min, sec, wday, yday, isdst = gmtime()
bld = ((year - 2000) * 12 + mon - 1) * 100 + mday
rev = hour * 100 + min
print 'Your build and revision number for today is %d.%d.' % (bld, rev)
| <commit_before><commit_msg>Build and revision number script<commit_after> | import sys
from time import gmtime
year, mon, mday, hour, min, sec, wday, yday, isdst = gmtime()
bld = ((year - 2000) * 12 + mon - 1) * 100 + mday
rev = hour * 100 + min
print 'Your build and revision number for today is %d.%d.' % (bld, rev)
| Build and revision number scriptimport sys
from time import gmtime
year, mon, mday, hour, min, sec, wday, yday, isdst = gmtime()
bld = ((year - 2000) * 12 + mon - 1) * 100 + mday
rev = hour * 100 + min
print 'Your build and revision number for today is %d.%d.' % (bld, rev)
| <commit_before><commit_msg>Build and revision number script<commit_after>import sys
from time import gmtime
year, mon, mday, hour, min, sec, wday, yday, isdst = gmtime()
bld = ((year - 2000) * 12 + mon - 1) * 100 + mday
rev = hour * 100 + min
print 'Your build and revision number for today is %d.%d.' % (bld, rev)
... | |
35778c48ba197803e2688732cf11d346838e7b7f | tests/integration/test_sqs.py | tests/integration/test_sqs.py | import os
from asyncaws import SQS
from tornado.testing import AsyncTestCase, gen_test
aws_key_id = os.environ['AWS_ACCESS_KEY_ID']
aws_key_secret = os.environ['AWS_SECRET_ACCESS_KEY']
aws_region = os.environ['AWS_REGION']
class TestSQS(AsyncTestCase):
sqs = SQS(aws_key_id, aws_key_secret, aws_region, async=Fals... | Add first integration test for SQS | Add first integration test for SQS
| Python | mit | MA3STR0/AsyncAWS | Add first integration test for SQS | import os
from asyncaws import SQS
from tornado.testing import AsyncTestCase, gen_test
aws_key_id = os.environ['AWS_ACCESS_KEY_ID']
aws_key_secret = os.environ['AWS_SECRET_ACCESS_KEY']
aws_region = os.environ['AWS_REGION']
class TestSQS(AsyncTestCase):
sqs = SQS(aws_key_id, aws_key_secret, aws_region, async=Fals... | <commit_before><commit_msg>Add first integration test for SQS<commit_after> | import os
from asyncaws import SQS
from tornado.testing import AsyncTestCase, gen_test
aws_key_id = os.environ['AWS_ACCESS_KEY_ID']
aws_key_secret = os.environ['AWS_SECRET_ACCESS_KEY']
aws_region = os.environ['AWS_REGION']
class TestSQS(AsyncTestCase):
sqs = SQS(aws_key_id, aws_key_secret, aws_region, async=Fals... | Add first integration test for SQSimport os
from asyncaws import SQS
from tornado.testing import AsyncTestCase, gen_test
aws_key_id = os.environ['AWS_ACCESS_KEY_ID']
aws_key_secret = os.environ['AWS_SECRET_ACCESS_KEY']
aws_region = os.environ['AWS_REGION']
class TestSQS(AsyncTestCase):
sqs = SQS(aws_key_id, aws_... | <commit_before><commit_msg>Add first integration test for SQS<commit_after>import os
from asyncaws import SQS
from tornado.testing import AsyncTestCase, gen_test
aws_key_id = os.environ['AWS_ACCESS_KEY_ID']
aws_key_secret = os.environ['AWS_SECRET_ACCESS_KEY']
aws_region = os.environ['AWS_REGION']
class TestSQS(Async... | |
c29e89b5e5c448e21354c4d5a0cb55b7ca59c4e0 | app.py | app.py | import json
import tornado.ioloop
import tornado.web
class MainHandler(tornado.web.RequestHandler):
"""Handles post requests by responding with a JSON file."""
@tornado.web.asynchronous
def post(self):
data = json.loads(self.request.body.decode('utf-8'))
self.optimize_portfolio(data)
... | Write a tornado server that responds to POST requests. | Write a tornado server that responds to POST requests.
| Python | mit | coshx/portfolio_optimizer,coshx/portfolio_optimizer,coshx/portfolio_optimizer,coshx/portfolio_optimizer | Write a tornado server that responds to POST requests. | import json
import tornado.ioloop
import tornado.web
class MainHandler(tornado.web.RequestHandler):
"""Handles post requests by responding with a JSON file."""
@tornado.web.asynchronous
def post(self):
data = json.loads(self.request.body.decode('utf-8'))
self.optimize_portfolio(data)
... | <commit_before><commit_msg>Write a tornado server that responds to POST requests.<commit_after> | import json
import tornado.ioloop
import tornado.web
class MainHandler(tornado.web.RequestHandler):
"""Handles post requests by responding with a JSON file."""
@tornado.web.asynchronous
def post(self):
data = json.loads(self.request.body.decode('utf-8'))
self.optimize_portfolio(data)
... | Write a tornado server that responds to POST requests.import json
import tornado.ioloop
import tornado.web
class MainHandler(tornado.web.RequestHandler):
"""Handles post requests by responding with a JSON file."""
@tornado.web.asynchronous
def post(self):
data = json.loads(self.request.body.decode... | <commit_before><commit_msg>Write a tornado server that responds to POST requests.<commit_after>import json
import tornado.ioloop
import tornado.web
class MainHandler(tornado.web.RequestHandler):
"""Handles post requests by responding with a JSON file."""
@tornado.web.asynchronous
def post(self):
d... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.