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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
5e3f3b83974c4826cddcfdb73f2d4eb4abe2aca1 | examples/test_download_files.py | examples/test_download_files.py | from seleniumbase import BaseCase
class DownloadTests(BaseCase):
def test_download_files(self):
self.open("https://pypi.org/project/seleniumbase/#files")
pkg_header = self.get_text("h1.package-header__name")
pkg_name = pkg_header.replace(" ", "-")
whl_file = pkg_name + "-... | Add test for asserting downloaded files | Add test for asserting downloaded files
| Python | mit | seleniumbase/SeleniumBase,mdmintz/SeleniumBase,seleniumbase/SeleniumBase,mdmintz/SeleniumBase,mdmintz/SeleniumBase,seleniumbase/SeleniumBase,seleniumbase/SeleniumBase,mdmintz/SeleniumBase | Add test for asserting downloaded files | from seleniumbase import BaseCase
class DownloadTests(BaseCase):
def test_download_files(self):
self.open("https://pypi.org/project/seleniumbase/#files")
pkg_header = self.get_text("h1.package-header__name")
pkg_name = pkg_header.replace(" ", "-")
whl_file = pkg_name + "-... | <commit_before><commit_msg>Add test for asserting downloaded files<commit_after> | from seleniumbase import BaseCase
class DownloadTests(BaseCase):
def test_download_files(self):
self.open("https://pypi.org/project/seleniumbase/#files")
pkg_header = self.get_text("h1.package-header__name")
pkg_name = pkg_header.replace(" ", "-")
whl_file = pkg_name + "-... | Add test for asserting downloaded filesfrom seleniumbase import BaseCase
class DownloadTests(BaseCase):
def test_download_files(self):
self.open("https://pypi.org/project/seleniumbase/#files")
pkg_header = self.get_text("h1.package-header__name")
pkg_name = pkg_header.replace(" ",... | <commit_before><commit_msg>Add test for asserting downloaded files<commit_after>from seleniumbase import BaseCase
class DownloadTests(BaseCase):
def test_download_files(self):
self.open("https://pypi.org/project/seleniumbase/#files")
pkg_header = self.get_text("h1.package-header__name")
... | |
724e8303a80f17c83128b5876dbb3d95c106805c | segments/npm_version.py | segments/npm_version.py | import subprocess
def add_npm_version_segment(powerline):
try:
p1 = subprocess.Popen(["npm", "--version"], stdout=subprocess.PIPE)
version = p1.communicate()[0].decode("utf-8").rstrip()
version = "npm " + version
powerline.append(version, 15, 18)
except OSError:
return
| Add segment for npm version | Add segment for npm version
| Python | mit | tswsl1989/powerline-shell,bitIO/powerline-shell,milkbikis/powerline-shell,banga/powerline-shell,b-ryan/powerline-shell,b-ryan/powerline-shell,banga/powerline-shell | Add segment for npm version | import subprocess
def add_npm_version_segment(powerline):
try:
p1 = subprocess.Popen(["npm", "--version"], stdout=subprocess.PIPE)
version = p1.communicate()[0].decode("utf-8").rstrip()
version = "npm " + version
powerline.append(version, 15, 18)
except OSError:
return
| <commit_before><commit_msg>Add segment for npm version<commit_after> | import subprocess
def add_npm_version_segment(powerline):
try:
p1 = subprocess.Popen(["npm", "--version"], stdout=subprocess.PIPE)
version = p1.communicate()[0].decode("utf-8").rstrip()
version = "npm " + version
powerline.append(version, 15, 18)
except OSError:
return
| Add segment for npm versionimport subprocess
def add_npm_version_segment(powerline):
try:
p1 = subprocess.Popen(["npm", "--version"], stdout=subprocess.PIPE)
version = p1.communicate()[0].decode("utf-8").rstrip()
version = "npm " + version
powerline.append(version, 15, 18)
exce... | <commit_before><commit_msg>Add segment for npm version<commit_after>import subprocess
def add_npm_version_segment(powerline):
try:
p1 = subprocess.Popen(["npm", "--version"], stdout=subprocess.PIPE)
version = p1.communicate()[0].decode("utf-8").rstrip()
version = "npm " + version
p... | |
9b42c3553b6b55125d63c902de6f9a92bc7c1fc0 | openprescribing/frontend/migrations/0007_auto_20160908_0811.py | openprescribing/frontend/migrations/0007_auto_20160908_0811.py | # -*- coding: utf-8 -*-
# Generated by Django 1.9.1 on 2016-09-08 07:14
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('frontend', '0006_importlog_populate'),
]
operations = [
migrations.AlterMode... | Add file found on server | Add file found on server
| Python | mit | ebmdatalab/openprescribing,ebmdatalab/openprescribing,annapowellsmith/openpresc,annapowellsmith/openpresc,annapowellsmith/openpresc,ebmdatalab/openprescribing,annapowellsmith/openpresc,ebmdatalab/openprescribing | Add file found on server | # -*- coding: utf-8 -*-
# Generated by Django 1.9.1 on 2016-09-08 07:14
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('frontend', '0006_importlog_populate'),
]
operations = [
migrations.AlterMode... | <commit_before><commit_msg>Add file found on server<commit_after> | # -*- coding: utf-8 -*-
# Generated by Django 1.9.1 on 2016-09-08 07:14
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('frontend', '0006_importlog_populate'),
]
operations = [
migrations.AlterMode... | Add file found on server# -*- coding: utf-8 -*-
# Generated by Django 1.9.1 on 2016-09-08 07:14
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('frontend', '0006_importlog_populate'),
]
operations = [
... | <commit_before><commit_msg>Add file found on server<commit_after># -*- coding: utf-8 -*-
# Generated by Django 1.9.1 on 2016-09-08 07:14
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('frontend', '0006_importlog_p... | |
1c293752b03b74105ad48d4d9be0a38bec55ca9a | flexx/ui/examples/code_editor.py | flexx/ui/examples/code_editor.py | # doc-export: CodeEditor
"""
This example demonstrates a code editor widget based on CodeMirror.
"""
# todo: Maybe this should be a widget in the library (flexx.ui.CodeMirror) ?
from flexx import ui, app, event
from flexx.pyscript.stubs import window
# Associate CodeMirror's assets with this module so th... | Add example for code editor widget based on codemirror | Add example for code editor widget based on codemirror
| Python | bsd-2-clause | jrversteegh/flexx,JohnLunzer/flexx,zoofIO/flexx,jrversteegh/flexx,JohnLunzer/flexx,zoofIO/flexx,JohnLunzer/flexx | Add example for code editor widget based on codemirror | # doc-export: CodeEditor
"""
This example demonstrates a code editor widget based on CodeMirror.
"""
# todo: Maybe this should be a widget in the library (flexx.ui.CodeMirror) ?
from flexx import ui, app, event
from flexx.pyscript.stubs import window
# Associate CodeMirror's assets with this module so th... | <commit_before><commit_msg>Add example for code editor widget based on codemirror<commit_after> | # doc-export: CodeEditor
"""
This example demonstrates a code editor widget based on CodeMirror.
"""
# todo: Maybe this should be a widget in the library (flexx.ui.CodeMirror) ?
from flexx import ui, app, event
from flexx.pyscript.stubs import window
# Associate CodeMirror's assets with this module so th... | Add example for code editor widget based on codemirror# doc-export: CodeEditor
"""
This example demonstrates a code editor widget based on CodeMirror.
"""
# todo: Maybe this should be a widget in the library (flexx.ui.CodeMirror) ?
from flexx import ui, app, event
from flexx.pyscript.stubs import window
... | <commit_before><commit_msg>Add example for code editor widget based on codemirror<commit_after># doc-export: CodeEditor
"""
This example demonstrates a code editor widget based on CodeMirror.
"""
# todo: Maybe this should be a widget in the library (flexx.ui.CodeMirror) ?
from flexx import ui, app, event
from... | |
051e2ff67a87fbbf7229b8f04b70742d441b75fd | examples/freesolv/gather_data_for_analysis.py | examples/freesolv/gather_data_for_analysis.py | import numpy as np
import yaml
from perses.analysis import Analysis
import glob
def collect_file_conditions(experiment_directory):
"""
Collect the experiment files for each condition of phase, ncmc steps, sterics, and geometry intervals.
This assumes there is one output for each experimental condition.
... | Add beginning of simple script to gather data on cluster | Add beginning of simple script to gather data on cluster
| Python | mit | choderalab/perses,choderalab/perses | Add beginning of simple script to gather data on cluster | import numpy as np
import yaml
from perses.analysis import Analysis
import glob
def collect_file_conditions(experiment_directory):
"""
Collect the experiment files for each condition of phase, ncmc steps, sterics, and geometry intervals.
This assumes there is one output for each experimental condition.
... | <commit_before><commit_msg>Add beginning of simple script to gather data on cluster<commit_after> | import numpy as np
import yaml
from perses.analysis import Analysis
import glob
def collect_file_conditions(experiment_directory):
"""
Collect the experiment files for each condition of phase, ncmc steps, sterics, and geometry intervals.
This assumes there is one output for each experimental condition.
... | Add beginning of simple script to gather data on clusterimport numpy as np
import yaml
from perses.analysis import Analysis
import glob
def collect_file_conditions(experiment_directory):
"""
Collect the experiment files for each condition of phase, ncmc steps, sterics, and geometry intervals.
This assumes ... | <commit_before><commit_msg>Add beginning of simple script to gather data on cluster<commit_after>import numpy as np
import yaml
from perses.analysis import Analysis
import glob
def collect_file_conditions(experiment_directory):
"""
Collect the experiment files for each condition of phase, ncmc steps, sterics, ... | |
16d690031e3a95f636e1730ba59f8c91c0019f97 | scripts/check_yaml_cde_calculation.py | scripts/check_yaml_cde_calculation.py | #!/usr/bin/env python
"""
Validates CDE calculation javascript in registry YAML files.
"""
from __future__ import print_function
import io
import sys
import yaml
from rdrf.utils import check_calculation
yaml.add_constructor(u'tag:yaml.org,2002:str',
yaml.constructor.Constructor.construct_python_u... | Add a script for checking CDE calculations in rdrd repo | scripts: Add a script for checking CDE calculations in rdrd repo
| Python | agpl-3.0 | muccg/rdrf,muccg/rdrf,muccg/rdrf,muccg/rdrf,muccg/rdrf | scripts: Add a script for checking CDE calculations in rdrd repo | #!/usr/bin/env python
"""
Validates CDE calculation javascript in registry YAML files.
"""
from __future__ import print_function
import io
import sys
import yaml
from rdrf.utils import check_calculation
yaml.add_constructor(u'tag:yaml.org,2002:str',
yaml.constructor.Constructor.construct_python_u... | <commit_before><commit_msg>scripts: Add a script for checking CDE calculations in rdrd repo<commit_after> | #!/usr/bin/env python
"""
Validates CDE calculation javascript in registry YAML files.
"""
from __future__ import print_function
import io
import sys
import yaml
from rdrf.utils import check_calculation
yaml.add_constructor(u'tag:yaml.org,2002:str',
yaml.constructor.Constructor.construct_python_u... | scripts: Add a script for checking CDE calculations in rdrd repo#!/usr/bin/env python
"""
Validates CDE calculation javascript in registry YAML files.
"""
from __future__ import print_function
import io
import sys
import yaml
from rdrf.utils import check_calculation
yaml.add_constructor(u'tag:yaml.org,2002:str',
... | <commit_before><commit_msg>scripts: Add a script for checking CDE calculations in rdrd repo<commit_after>#!/usr/bin/env python
"""
Validates CDE calculation javascript in registry YAML files.
"""
from __future__ import print_function
import io
import sys
import yaml
from rdrf.utils import check_calculation
yaml.add_c... | |
25f0375683064d39fc460da6f42109a8b6b2e60c | migrations/versions/690_add_brief_length_to_published_briefs.py | migrations/versions/690_add_brief_length_to_published_briefs.py | """Give published specialist briefs a requirementsLength of '2 weeks'
Revision ID: 690
Revises: 680
Create Date: 2016-07-28 12:30:11.406853
"""
# revision identifiers, used by Alembic.
revision = '690'
down_revision = '680'
from alembic import op
import sqlalchemy as sa
from sqlalchemy.sql import table, column
from... | Create migration for specialist requirementLengths | Create migration for specialist requirementLengths
Due to the new functionality for specialist briefs to be live for one or
two weeks, it's necessary to migrate existing published briefs to have a
requirementsLength of '2 weeks' so they don't fail validation.
| Python | mit | alphagov/digitalmarketplace-api,alphagov/digitalmarketplace-api,alphagov/digitalmarketplace-api | Create migration for specialist requirementLengths
Due to the new functionality for specialist briefs to be live for one or
two weeks, it's necessary to migrate existing published briefs to have a
requirementsLength of '2 weeks' so they don't fail validation. | """Give published specialist briefs a requirementsLength of '2 weeks'
Revision ID: 690
Revises: 680
Create Date: 2016-07-28 12:30:11.406853
"""
# revision identifiers, used by Alembic.
revision = '690'
down_revision = '680'
from alembic import op
import sqlalchemy as sa
from sqlalchemy.sql import table, column
from... | <commit_before><commit_msg>Create migration for specialist requirementLengths
Due to the new functionality for specialist briefs to be live for one or
two weeks, it's necessary to migrate existing published briefs to have a
requirementsLength of '2 weeks' so they don't fail validation.<commit_after> | """Give published specialist briefs a requirementsLength of '2 weeks'
Revision ID: 690
Revises: 680
Create Date: 2016-07-28 12:30:11.406853
"""
# revision identifiers, used by Alembic.
revision = '690'
down_revision = '680'
from alembic import op
import sqlalchemy as sa
from sqlalchemy.sql import table, column
from... | Create migration for specialist requirementLengths
Due to the new functionality for specialist briefs to be live for one or
two weeks, it's necessary to migrate existing published briefs to have a
requirementsLength of '2 weeks' so they don't fail validation."""Give published specialist briefs a requirementsLength of ... | <commit_before><commit_msg>Create migration for specialist requirementLengths
Due to the new functionality for specialist briefs to be live for one or
two weeks, it's necessary to migrate existing published briefs to have a
requirementsLength of '2 weeks' so they don't fail validation.<commit_after>"""Give published s... | |
a0bdba19b6f22363bed532a7872a1128679fafe6 | scripts/remove_notification_subscriptions_from_registrations.py | scripts/remove_notification_subscriptions_from_registrations.py | """ Script for removing NotificationSubscriptions from registrations.
Registrations shouldn't have them!
"""
import logging
import sys
import django
django.setup()
from website.app import init_app
from django.apps import apps
logger = logging.getLogger(__name__)
def remove_notification_subscriptions_from_regis... | Add script to remove NotificationSubscriptions on Registrations. | Add script to remove NotificationSubscriptions on Registrations.
| Python | apache-2.0 | felliott/osf.io,brianjgeiger/osf.io,felliott/osf.io,baylee-d/osf.io,aaxelb/osf.io,CenterForOpenScience/osf.io,aaxelb/osf.io,brianjgeiger/osf.io,baylee-d/osf.io,Johnetordoff/osf.io,mattclark/osf.io,adlius/osf.io,aaxelb/osf.io,mattclark/osf.io,mfraezz/osf.io,felliott/osf.io,CenterForOpenScience/osf.io,Johnetordoff/osf.io... | Add script to remove NotificationSubscriptions on Registrations. | """ Script for removing NotificationSubscriptions from registrations.
Registrations shouldn't have them!
"""
import logging
import sys
import django
django.setup()
from website.app import init_app
from django.apps import apps
logger = logging.getLogger(__name__)
def remove_notification_subscriptions_from_regis... | <commit_before><commit_msg>Add script to remove NotificationSubscriptions on Registrations.<commit_after> | """ Script for removing NotificationSubscriptions from registrations.
Registrations shouldn't have them!
"""
import logging
import sys
import django
django.setup()
from website.app import init_app
from django.apps import apps
logger = logging.getLogger(__name__)
def remove_notification_subscriptions_from_regis... | Add script to remove NotificationSubscriptions on Registrations.""" Script for removing NotificationSubscriptions from registrations.
Registrations shouldn't have them!
"""
import logging
import sys
import django
django.setup()
from website.app import init_app
from django.apps import apps
logger = logging.getLog... | <commit_before><commit_msg>Add script to remove NotificationSubscriptions on Registrations.<commit_after>""" Script for removing NotificationSubscriptions from registrations.
Registrations shouldn't have them!
"""
import logging
import sys
import django
django.setup()
from website.app import init_app
from django.... | |
89423bdccbf5fbfc8a645e0066e1082de64a8eac | features/environment.py | features/environment.py | from behave import *
import shutil
import os
def before_scenario(context, scenario):
"""Before each scenario, backup all config and journal test data."""
for folder in ("configs", "journals"):
original = os.path.join("features", folder)
backup = os.path.join("features", folder+"_backup")
... | Backup and restore config and journal files every time | Backup and restore config and journal files every time
| Python | mit | cloudrave/jrnl-todos,flight16/jrnl,MinchinWeb/jrnl,philipsd6/jrnl,maebert/jrnl,notbalanced/jrnl,Shir0kamii/jrnl,MSylvia/jrnl,zdravi/jrnl,nikvdp/jrnl,dzeban/jrnl,beni55/jrnl,rzyns/jrnl | Backup and restore config and journal files every time | from behave import *
import shutil
import os
def before_scenario(context, scenario):
"""Before each scenario, backup all config and journal test data."""
for folder in ("configs", "journals"):
original = os.path.join("features", folder)
backup = os.path.join("features", folder+"_backup")
... | <commit_before><commit_msg>Backup and restore config and journal files every time<commit_after> | from behave import *
import shutil
import os
def before_scenario(context, scenario):
"""Before each scenario, backup all config and journal test data."""
for folder in ("configs", "journals"):
original = os.path.join("features", folder)
backup = os.path.join("features", folder+"_backup")
... | Backup and restore config and journal files every timefrom behave import *
import shutil
import os
def before_scenario(context, scenario):
"""Before each scenario, backup all config and journal test data."""
for folder in ("configs", "journals"):
original = os.path.join("features", folder)
back... | <commit_before><commit_msg>Backup and restore config and journal files every time<commit_after>from behave import *
import shutil
import os
def before_scenario(context, scenario):
"""Before each scenario, backup all config and journal test data."""
for folder in ("configs", "journals"):
original = os.p... | |
f0b009494ba743272e555c87bc9d1ea99377371f | sra_status.py | sra_status.py | """
Report the status of an SRA run
"""
import os
import sys
import argparse
import requests
import json
def get_status(runids, verbose, url='https://www.ncbi.nlm.nih.gov/Traces/sra/status/srastatrep.fcgi/acc-mirroring?acc='):
"""
Get the status of the run
:param runid: the set of run ids to get
:par... | Check the status of a read | Check the status of a read
| Python | mit | linsalrob/partie,linsalrob/partie,linsalrob/partie,linsalrob/partie | Check the status of a read | """
Report the status of an SRA run
"""
import os
import sys
import argparse
import requests
import json
def get_status(runids, verbose, url='https://www.ncbi.nlm.nih.gov/Traces/sra/status/srastatrep.fcgi/acc-mirroring?acc='):
"""
Get the status of the run
:param runid: the set of run ids to get
:par... | <commit_before><commit_msg>Check the status of a read<commit_after> | """
Report the status of an SRA run
"""
import os
import sys
import argparse
import requests
import json
def get_status(runids, verbose, url='https://www.ncbi.nlm.nih.gov/Traces/sra/status/srastatrep.fcgi/acc-mirroring?acc='):
"""
Get the status of the run
:param runid: the set of run ids to get
:par... | Check the status of a read"""
Report the status of an SRA run
"""
import os
import sys
import argparse
import requests
import json
def get_status(runids, verbose, url='https://www.ncbi.nlm.nih.gov/Traces/sra/status/srastatrep.fcgi/acc-mirroring?acc='):
"""
Get the status of the run
:param runid: the set ... | <commit_before><commit_msg>Check the status of a read<commit_after>"""
Report the status of an SRA run
"""
import os
import sys
import argparse
import requests
import json
def get_status(runids, verbose, url='https://www.ncbi.nlm.nih.gov/Traces/sra/status/srastatrep.fcgi/acc-mirroring?acc='):
"""
Get the sta... | |
69b3d3619ce08940277c811cb9e4c24a137831da | st2actions/tests/unit/test_action_runner_worker.py | st2actions/tests/unit/test_action_runner_worker.py | # Licensed to the StackStorm, Inc ('StackStorm') under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use th... | Add test for ActionsQueueConsumer class which verifies that the right BufferedDispatcher class is used. | Add test for ActionsQueueConsumer class which verifies that the right
BufferedDispatcher class is used.
| Python | apache-2.0 | emedvedev/st2,nzlosh/st2,peak6/st2,punalpatel/st2,peak6/st2,Plexxi/st2,punalpatel/st2,Plexxi/st2,StackStorm/st2,nzlosh/st2,peak6/st2,punalpatel/st2,pixelrebel/st2,nzlosh/st2,tonybaloney/st2,tonybaloney/st2,Plexxi/st2,StackStorm/st2,pixelrebel/st2,StackStorm/st2,nzlosh/st2,StackStorm/st2,lakshmi-kannan/st2,pixelrebel/st... | Add test for ActionsQueueConsumer class which verifies that the right
BufferedDispatcher class is used. | # Licensed to the StackStorm, Inc ('StackStorm') under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use th... | <commit_before><commit_msg>Add test for ActionsQueueConsumer class which verifies that the right
BufferedDispatcher class is used.<commit_after> | # Licensed to the StackStorm, Inc ('StackStorm') under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use th... | Add test for ActionsQueueConsumer class which verifies that the right
BufferedDispatcher class is used.# Licensed to the StackStorm, Inc ('StackStorm') under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The AS... | <commit_before><commit_msg>Add test for ActionsQueueConsumer class which verifies that the right
BufferedDispatcher class is used.<commit_after># Licensed to the StackStorm, Inc ('StackStorm') under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional informatio... | |
61d1020d1a96e6384426414ee122a013c6d75ea9 | djconnectwise/migrations/0046_auto_20180104_1504.py | djconnectwise/migrations/0046_auto_20180104_1504.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('djconnectwise', '0045_auto_20171222_1725'),
]
operations = [
migrations.AlterField(
model_name='scheduleentry',
... | Add migration for last commit | Add migration for last commit
| Python | mit | KerkhoffTechnologies/django-connectwise,KerkhoffTechnologies/django-connectwise | Add migration for last commit | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('djconnectwise', '0045_auto_20171222_1725'),
]
operations = [
migrations.AlterField(
model_name='scheduleentry',
... | <commit_before><commit_msg>Add migration for last commit<commit_after> | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('djconnectwise', '0045_auto_20171222_1725'),
]
operations = [
migrations.AlterField(
model_name='scheduleentry',
... | Add migration for last commit# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('djconnectwise', '0045_auto_20171222_1725'),
]
operations = [
migrations.AlterField(
... | <commit_before><commit_msg>Add migration for last commit<commit_after># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('djconnectwise', '0045_auto_20171222_1725'),
]
operations = [
... | |
158d8722b8a232dceefc040cb2414201ddc7a059 | test_all.py | test_all.py | import pytest
import random
import pymongo
from pymongo import MongoClient
_connection = None
class TempCollection:
def __init__(self, db, name, initial_data=None):
self.db = db
self.name = name
self.initial_data = initial_data
def __enter__(self):
self.col = self.db[self.n... | Add fixture for database related testing | Add fixture for database related testing
| Python | mit | irvind/logster,irvind/logster,irvind/logster | Add fixture for database related testing | import pytest
import random
import pymongo
from pymongo import MongoClient
_connection = None
class TempCollection:
def __init__(self, db, name, initial_data=None):
self.db = db
self.name = name
self.initial_data = initial_data
def __enter__(self):
self.col = self.db[self.n... | <commit_before><commit_msg>Add fixture for database related testing<commit_after> | import pytest
import random
import pymongo
from pymongo import MongoClient
_connection = None
class TempCollection:
def __init__(self, db, name, initial_data=None):
self.db = db
self.name = name
self.initial_data = initial_data
def __enter__(self):
self.col = self.db[self.n... | Add fixture for database related testingimport pytest
import random
import pymongo
from pymongo import MongoClient
_connection = None
class TempCollection:
def __init__(self, db, name, initial_data=None):
self.db = db
self.name = name
self.initial_data = initial_data
def __enter__(... | <commit_before><commit_msg>Add fixture for database related testing<commit_after>import pytest
import random
import pymongo
from pymongo import MongoClient
_connection = None
class TempCollection:
def __init__(self, db, name, initial_data=None):
self.db = db
self.name = name
self.initia... | |
34f8c0a4a0a9f78c124cd07b121ce5b2fbf00136 | onadata/libs/utils/csv_import.py | onadata/libs/utils/csv_import.py | import unicodecsv as ucsv
from cStringIO import StringIO
from ondata.apps.api.viewsets.xform_submission_api import dict_lists2strings
from onadata.libs.utils.logger_tools import dict2xform, safe_create_instance
def submit_csv(username, request, csv_data):
if isinstance(csv_data, (str, unicode)):
csv_data... | import unicodecsv as ucsv
from cStringIO import StringIO
from ondata.apps.api.viewsets.xform_submission_api import dict_lists2strings
from onadata.libs.utils.logger_tools import dict2xform, safe_create_instance
from django.db import transaction
class CSVImportException(Exception):
pass
def submit_csv(username, ... | Implement atomicity for CSV imports | JZ: Implement atomicity for CSV imports
CSV imports should happen for all rows or nothing at all!
Use `django.transactions` for rollbacks on submission on errors
Also remove metadata from CSV rows before submitting
| Python | bsd-2-clause | awemulya/fieldsight-kobocat,mainakibui/kobocat,qlands/onadata,smn/onadata,sounay/flaminggo-test,piqoni/onadata,qlands/onadata,jomolinare/kobocat,sounay/flaminggo-test,mainakibui/kobocat,kobotoolbox/kobocat,kobotoolbox/kobocat,smn/onadata,piqoni/onadata,hnjamba/onaclone,awemulya/fieldsight-kobocat,smn/onadata,jomolinare... | import unicodecsv as ucsv
from cStringIO import StringIO
from ondata.apps.api.viewsets.xform_submission_api import dict_lists2strings
from onadata.libs.utils.logger_tools import dict2xform, safe_create_instance
def submit_csv(username, request, csv_data):
if isinstance(csv_data, (str, unicode)):
csv_data... | import unicodecsv as ucsv
from cStringIO import StringIO
from ondata.apps.api.viewsets.xform_submission_api import dict_lists2strings
from onadata.libs.utils.logger_tools import dict2xform, safe_create_instance
from django.db import transaction
class CSVImportException(Exception):
pass
def submit_csv(username, ... | <commit_before>import unicodecsv as ucsv
from cStringIO import StringIO
from ondata.apps.api.viewsets.xform_submission_api import dict_lists2strings
from onadata.libs.utils.logger_tools import dict2xform, safe_create_instance
def submit_csv(username, request, csv_data):
if isinstance(csv_data, (str, unicode)):
... | import unicodecsv as ucsv
from cStringIO import StringIO
from ondata.apps.api.viewsets.xform_submission_api import dict_lists2strings
from onadata.libs.utils.logger_tools import dict2xform, safe_create_instance
from django.db import transaction
class CSVImportException(Exception):
pass
def submit_csv(username, ... | import unicodecsv as ucsv
from cStringIO import StringIO
from ondata.apps.api.viewsets.xform_submission_api import dict_lists2strings
from onadata.libs.utils.logger_tools import dict2xform, safe_create_instance
def submit_csv(username, request, csv_data):
if isinstance(csv_data, (str, unicode)):
csv_data... | <commit_before>import unicodecsv as ucsv
from cStringIO import StringIO
from ondata.apps.api.viewsets.xform_submission_api import dict_lists2strings
from onadata.libs.utils.logger_tools import dict2xform, safe_create_instance
def submit_csv(username, request, csv_data):
if isinstance(csv_data, (str, unicode)):
... |
23d34308206013033f22204f8720ef01263ab07b | examples/plot_ransac.py | examples/plot_ransac.py | """
===========================================
Robust linear model estimation using RANSAC
===========================================
In this example we see how to robustly fit a linear model to faulty data using
the RANSAC algorithm.
"""
import numpy as np
from matplotlib import pyplot as plt
from sklearn import ... | Add example plot script for RANSAC | Add example plot script for RANSAC
| Python | bsd-3-clause | maheshakya/scikit-learn,meduz/scikit-learn,tawsifkhan/scikit-learn,thilbern/scikit-learn,abimannans/scikit-learn,mikebenfield/scikit-learn,fyffyt/scikit-learn,xwolf12/scikit-learn,nhejazi/scikit-learn,btabibian/scikit-learn,Lawrence-Liu/scikit-learn,ngoix/OCRF,loli/semisupervisedforests,mugizico/scikit-learn,pnedunuri/... | Add example plot script for RANSAC | """
===========================================
Robust linear model estimation using RANSAC
===========================================
In this example we see how to robustly fit a linear model to faulty data using
the RANSAC algorithm.
"""
import numpy as np
from matplotlib import pyplot as plt
from sklearn import ... | <commit_before><commit_msg>Add example plot script for RANSAC<commit_after> | """
===========================================
Robust linear model estimation using RANSAC
===========================================
In this example we see how to robustly fit a linear model to faulty data using
the RANSAC algorithm.
"""
import numpy as np
from matplotlib import pyplot as plt
from sklearn import ... | Add example plot script for RANSAC"""
===========================================
Robust linear model estimation using RANSAC
===========================================
In this example we see how to robustly fit a linear model to faulty data using
the RANSAC algorithm.
"""
import numpy as np
from matplotlib import p... | <commit_before><commit_msg>Add example plot script for RANSAC<commit_after>"""
===========================================
Robust linear model estimation using RANSAC
===========================================
In this example we see how to robustly fit a linear model to faulty data using
the RANSAC algorithm.
"""
im... | |
a6407fe9a3b77372ed3e93b92f77bcea32e77393 | kive/archive/migrations/0014_dataset_name_length.py | kive/archive/migrations/0014_dataset_name_length.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('archive', '0013_methodoutput_are_checksums_ok'),
]
operations = [
migrations.AlterField(
model_name='dataset',
... | Add a migration for dataset name length. | Add a migration for dataset name length. | Python | bsd-3-clause | cfe-lab/Kive,cfe-lab/Kive,cfe-lab/Kive,cfe-lab/Kive,cfe-lab/Kive | Add a migration for dataset name length. | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('archive', '0013_methodoutput_are_checksums_ok'),
]
operations = [
migrations.AlterField(
model_name='dataset',
... | <commit_before><commit_msg>Add a migration for dataset name length.<commit_after> | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('archive', '0013_methodoutput_are_checksums_ok'),
]
operations = [
migrations.AlterField(
model_name='dataset',
... | Add a migration for dataset name length.# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('archive', '0013_methodoutput_are_checksums_ok'),
]
operations = [
migrations.AlterFi... | <commit_before><commit_msg>Add a migration for dataset name length.<commit_after># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('archive', '0013_methodoutput_are_checksums_ok'),
]
... | |
db20a15c34fc6bb43ad8e0a4860dd252e49a8033 | Regression/MultipleLinearRegression/regularMultipleRegression.py | Regression/MultipleLinearRegression/regularMultipleRegression.py | # -*- coding: utf-8 -*-
"""Multiple linear regression for machine learning.
A linear regression model that contains more than one predictor variable is
called a multiple linear regression model. It is basically the same as Simple
Linear regression, but with more predictor variables (features). The idea is
that linearl... | Add Python file for Multiple linear regression | Add Python file for Multiple linear regression
| Python | mit | a-holm/MachinelearningAlgorithms,a-holm/MachinelearningAlgorithms | Add Python file for Multiple linear regression | # -*- coding: utf-8 -*-
"""Multiple linear regression for machine learning.
A linear regression model that contains more than one predictor variable is
called a multiple linear regression model. It is basically the same as Simple
Linear regression, but with more predictor variables (features). The idea is
that linearl... | <commit_before><commit_msg>Add Python file for Multiple linear regression<commit_after> | # -*- coding: utf-8 -*-
"""Multiple linear regression for machine learning.
A linear regression model that contains more than one predictor variable is
called a multiple linear regression model. It is basically the same as Simple
Linear regression, but with more predictor variables (features). The idea is
that linearl... | Add Python file for Multiple linear regression# -*- coding: utf-8 -*-
"""Multiple linear regression for machine learning.
A linear regression model that contains more than one predictor variable is
called a multiple linear regression model. It is basically the same as Simple
Linear regression, but with more predictor ... | <commit_before><commit_msg>Add Python file for Multiple linear regression<commit_after># -*- coding: utf-8 -*-
"""Multiple linear regression for machine learning.
A linear regression model that contains more than one predictor variable is
called a multiple linear regression model. It is basically the same as Simple
Li... | |
5fee82b0ef269993ebc4147bfd825718a460616c | neural_style/convert_model_cpu.py | neural_style/convert_model_cpu.py | from transformer_net import TransformerNet
import argparse
import torch
def main():
parser = argparse.ArgumentParser()
parser.add_argument("--gpu-model", type=str, required=True)
parser.add_argument("--cpu-model", type=str, required=True)
args = parser.parse_args()
tr = torch.load(args.gpu_model)... | Convert gpu model to cpu model | Convert gpu model to cpu model
| Python | mit | onai/fast-neural-style | Convert gpu model to cpu model | from transformer_net import TransformerNet
import argparse
import torch
def main():
parser = argparse.ArgumentParser()
parser.add_argument("--gpu-model", type=str, required=True)
parser.add_argument("--cpu-model", type=str, required=True)
args = parser.parse_args()
tr = torch.load(args.gpu_model)... | <commit_before><commit_msg>Convert gpu model to cpu model<commit_after> | from transformer_net import TransformerNet
import argparse
import torch
def main():
parser = argparse.ArgumentParser()
parser.add_argument("--gpu-model", type=str, required=True)
parser.add_argument("--cpu-model", type=str, required=True)
args = parser.parse_args()
tr = torch.load(args.gpu_model)... | Convert gpu model to cpu modelfrom transformer_net import TransformerNet
import argparse
import torch
def main():
parser = argparse.ArgumentParser()
parser.add_argument("--gpu-model", type=str, required=True)
parser.add_argument("--cpu-model", type=str, required=True)
args = parser.parse_args()
t... | <commit_before><commit_msg>Convert gpu model to cpu model<commit_after>from transformer_net import TransformerNet
import argparse
import torch
def main():
parser = argparse.ArgumentParser()
parser.add_argument("--gpu-model", type=str, required=True)
parser.add_argument("--cpu-model", type=str, required=Tr... | |
a7c952cce7c006913727adf1be29e6d94e3b9f6a | orges/test/unit/test_pluggable.py | orges/test/unit/test_pluggable.py | from mock import Mock
from orges.invoker.pluggable import PluggableInvoker
from orges.args import ArgsCreator
import orges.param as param
@param.int("a", interval=(0, 1))
def f(a):
return a
def test_before_invoke_calls_plugins():
mock_plugin = Mock()
mock_plugin.before_invoke = Mock(spec=[])
plugin... | Add unit tests for invocation plugin hooks | Add unit tests for invocation plugin hooks
| Python | bsd-3-clause | cigroup-ol/metaopt,cigroup-ol/metaopt,cigroup-ol/metaopt | Add unit tests for invocation plugin hooks | from mock import Mock
from orges.invoker.pluggable import PluggableInvoker
from orges.args import ArgsCreator
import orges.param as param
@param.int("a", interval=(0, 1))
def f(a):
return a
def test_before_invoke_calls_plugins():
mock_plugin = Mock()
mock_plugin.before_invoke = Mock(spec=[])
plugin... | <commit_before><commit_msg>Add unit tests for invocation plugin hooks<commit_after> | from mock import Mock
from orges.invoker.pluggable import PluggableInvoker
from orges.args import ArgsCreator
import orges.param as param
@param.int("a", interval=(0, 1))
def f(a):
return a
def test_before_invoke_calls_plugins():
mock_plugin = Mock()
mock_plugin.before_invoke = Mock(spec=[])
plugin... | Add unit tests for invocation plugin hooksfrom mock import Mock
from orges.invoker.pluggable import PluggableInvoker
from orges.args import ArgsCreator
import orges.param as param
@param.int("a", interval=(0, 1))
def f(a):
return a
def test_before_invoke_calls_plugins():
mock_plugin = Mock()
mock_plugin... | <commit_before><commit_msg>Add unit tests for invocation plugin hooks<commit_after>from mock import Mock
from orges.invoker.pluggable import PluggableInvoker
from orges.args import ArgsCreator
import orges.param as param
@param.int("a", interval=(0, 1))
def f(a):
return a
def test_before_invoke_calls_plugins():... | |
45ef1d56e77b1b5414c7c5d596441295c8cef497 | scripts/generate_csv_files.py | scripts/generate_csv_files.py | # -*- coding: utf-8 -*-
import pandas as pd
df = pd.read_csv("data/all.anonymes.csv", dtype=object, encoding='utf-8')
df['DECL_AVANT_MONTANT'] = df.DECL_AVANT_MONTANT.astype('float32')
# by LABO
labos = df.groupby(['LABO', 'BENEF_PS_DEPARTEMENT', 'DECL_TYPE']).agg({'DECL_AVANT_MONTANT': {'DECL_AVANT_SOMME': 'sum', ... | Add script to generate csv for dataviz | Add script to generate csv for dataviz
| Python | agpl-3.0 | regardscitoyens/sunshine-data,regardscitoyens/sunshine-data,regardscitoyens/sunshine-data,regardscitoyens/sunshine-data,regardscitoyens/sunshine-data,regardscitoyens/sunshine-data | Add script to generate csv for dataviz | # -*- coding: utf-8 -*-
import pandas as pd
df = pd.read_csv("data/all.anonymes.csv", dtype=object, encoding='utf-8')
df['DECL_AVANT_MONTANT'] = df.DECL_AVANT_MONTANT.astype('float32')
# by LABO
labos = df.groupby(['LABO', 'BENEF_PS_DEPARTEMENT', 'DECL_TYPE']).agg({'DECL_AVANT_MONTANT': {'DECL_AVANT_SOMME': 'sum', ... | <commit_before><commit_msg>Add script to generate csv for dataviz<commit_after> | # -*- coding: utf-8 -*-
import pandas as pd
df = pd.read_csv("data/all.anonymes.csv", dtype=object, encoding='utf-8')
df['DECL_AVANT_MONTANT'] = df.DECL_AVANT_MONTANT.astype('float32')
# by LABO
labos = df.groupby(['LABO', 'BENEF_PS_DEPARTEMENT', 'DECL_TYPE']).agg({'DECL_AVANT_MONTANT': {'DECL_AVANT_SOMME': 'sum', ... | Add script to generate csv for dataviz# -*- coding: utf-8 -*-
import pandas as pd
df = pd.read_csv("data/all.anonymes.csv", dtype=object, encoding='utf-8')
df['DECL_AVANT_MONTANT'] = df.DECL_AVANT_MONTANT.astype('float32')
# by LABO
labos = df.groupby(['LABO', 'BENEF_PS_DEPARTEMENT', 'DECL_TYPE']).agg({'DECL_AVANT_... | <commit_before><commit_msg>Add script to generate csv for dataviz<commit_after># -*- coding: utf-8 -*-
import pandas as pd
df = pd.read_csv("data/all.anonymes.csv", dtype=object, encoding='utf-8')
df['DECL_AVANT_MONTANT'] = df.DECL_AVANT_MONTANT.astype('float32')
# by LABO
labos = df.groupby(['LABO', 'BENEF_PS_DEPA... | |
dedfec08bbec4c97ff8e7e1242ac8d406cc73b0b | init.py | init.py | url = "https://pub.orcid.org/0000-0002-2907-3313"
import requests
import json
resp = requests.get(url,
headers={'Accept':'application/orcid+json'})
print json.dumps(resp.json(),
sort_keys=True,
indent=4, separators=(',', ': '))
| Load JSON of Melodee ORCID | Load JSON of Melodee ORCID
| Python | mit | njall/Orctrix,njall/Orctrix,njall/Orctrix | Load JSON of Melodee ORCID | url = "https://pub.orcid.org/0000-0002-2907-3313"
import requests
import json
resp = requests.get(url,
headers={'Accept':'application/orcid+json'})
print json.dumps(resp.json(),
sort_keys=True,
indent=4, separators=(',', ': '))
| <commit_before><commit_msg>Load JSON of Melodee ORCID<commit_after> | url = "https://pub.orcid.org/0000-0002-2907-3313"
import requests
import json
resp = requests.get(url,
headers={'Accept':'application/orcid+json'})
print json.dumps(resp.json(),
sort_keys=True,
indent=4, separators=(',', ': '))
| Load JSON of Melodee ORCIDurl = "https://pub.orcid.org/0000-0002-2907-3313"
import requests
import json
resp = requests.get(url,
headers={'Accept':'application/orcid+json'})
print json.dumps(resp.json(),
sort_keys=True,
indent=4, separators=(',', ': '))
| <commit_before><commit_msg>Load JSON of Melodee ORCID<commit_after>url = "https://pub.orcid.org/0000-0002-2907-3313"
import requests
import json
resp = requests.get(url,
headers={'Accept':'application/orcid+json'})
print json.dumps(resp.json(),
sort_keys=True,
in... | |
1b8bf0b171532d366f0823ea9afb9ac500262488 | python/array/RemoveElement.py | python/array/RemoveElement.py | class Solution:
# @param A a list of integers
# @param elem an integer, value need to be removed
# @return an integer
def removeElement(self, A, elem):
result = len(A)
start = 0
for i in xrange(len(A)):
A[start] = A[i]
if A[i] != elem:
... | Remove Element -- keep streak! | Remove Element -- keep streak!
| Python | mit | sureleo/leetcode,sureleo/leetcode,lsingal/leetcode,sureleo/leetcode,lsingal/leetcode,lsingal/leetcode | Remove Element -- keep streak! | class Solution:
# @param A a list of integers
# @param elem an integer, value need to be removed
# @return an integer
def removeElement(self, A, elem):
result = len(A)
start = 0
for i in xrange(len(A)):
A[start] = A[i]
if A[i] != elem:
... | <commit_before><commit_msg>Remove Element -- keep streak!<commit_after> | class Solution:
# @param A a list of integers
# @param elem an integer, value need to be removed
# @return an integer
def removeElement(self, A, elem):
result = len(A)
start = 0
for i in xrange(len(A)):
A[start] = A[i]
if A[i] != elem:
... | Remove Element -- keep streak!class Solution:
# @param A a list of integers
# @param elem an integer, value need to be removed
# @return an integer
def removeElement(self, A, elem):
result = len(A)
start = 0
for i in xrange(len(A)):
A[start] = A[i]
... | <commit_before><commit_msg>Remove Element -- keep streak!<commit_after>class Solution:
# @param A a list of integers
# @param elem an integer, value need to be removed
# @return an integer
def removeElement(self, A, elem):
result = len(A)
start = 0
for i in xrange(... | |
0f5c38b1c7bcd8a26c415c8d0c93edc132263087 | CodeFights/firstDigit.py | CodeFights/firstDigit.py | #!/usr/local/bin/python
# Code Fights First Digit Problem
import re
def firstDigit(inputString):
match = re.search(r'\d', inputString)
return match.group(0)
def main():
tests = [
["var_1__Int", "1"],
["q2q-q", "2"],
["0ss", "0"]
]
for t in tests:
res = firstDigi... | Solve Code Fights first digit problem | Solve Code Fights first digit problem
| Python | mit | HKuz/Test_Code | Solve Code Fights first digit problem | #!/usr/local/bin/python
# Code Fights First Digit Problem
import re
def firstDigit(inputString):
match = re.search(r'\d', inputString)
return match.group(0)
def main():
tests = [
["var_1__Int", "1"],
["q2q-q", "2"],
["0ss", "0"]
]
for t in tests:
res = firstDigi... | <commit_before><commit_msg>Solve Code Fights first digit problem<commit_after> | #!/usr/local/bin/python
# Code Fights First Digit Problem
import re
def firstDigit(inputString):
match = re.search(r'\d', inputString)
return match.group(0)
def main():
tests = [
["var_1__Int", "1"],
["q2q-q", "2"],
["0ss", "0"]
]
for t in tests:
res = firstDigi... | Solve Code Fights first digit problem#!/usr/local/bin/python
# Code Fights First Digit Problem
import re
def firstDigit(inputString):
match = re.search(r'\d', inputString)
return match.group(0)
def main():
tests = [
["var_1__Int", "1"],
["q2q-q", "2"],
["0ss", "0"]
]
fo... | <commit_before><commit_msg>Solve Code Fights first digit problem<commit_after>#!/usr/local/bin/python
# Code Fights First Digit Problem
import re
def firstDigit(inputString):
match = re.search(r'\d', inputString)
return match.group(0)
def main():
tests = [
["var_1__Int", "1"],
["q2q-q",... | |
dcd80232189743962d12a3df15bbb2708b1966b8 | tests/test_decider.py | tests/test_decider.py | from unittest.mock import MagicMock
import boto.swf.layer2 as swf
from boto.swf import layer1
import pytest
from garcon import activity
from garcon import decider
def mock(monkeypatch):
for base in [swf.Decider, swf.WorkflowType, swf.ActivityType, swf.Domain]:
monkeypatch.setattr(base, '__init__', MagicM... | Add some tests for the decider. | Add some tests for the decider.
| Python | mit | xethorn/garcon,theorchard/garcon,pkuong/garcon,rantonmattei/garcon,someboredkiddo/garcon | Add some tests for the decider. | from unittest.mock import MagicMock
import boto.swf.layer2 as swf
from boto.swf import layer1
import pytest
from garcon import activity
from garcon import decider
def mock(monkeypatch):
for base in [swf.Decider, swf.WorkflowType, swf.ActivityType, swf.Domain]:
monkeypatch.setattr(base, '__init__', MagicM... | <commit_before><commit_msg>Add some tests for the decider.<commit_after> | from unittest.mock import MagicMock
import boto.swf.layer2 as swf
from boto.swf import layer1
import pytest
from garcon import activity
from garcon import decider
def mock(monkeypatch):
for base in [swf.Decider, swf.WorkflowType, swf.ActivityType, swf.Domain]:
monkeypatch.setattr(base, '__init__', MagicM... | Add some tests for the decider.from unittest.mock import MagicMock
import boto.swf.layer2 as swf
from boto.swf import layer1
import pytest
from garcon import activity
from garcon import decider
def mock(monkeypatch):
for base in [swf.Decider, swf.WorkflowType, swf.ActivityType, swf.Domain]:
monkeypatch.s... | <commit_before><commit_msg>Add some tests for the decider.<commit_after>from unittest.mock import MagicMock
import boto.swf.layer2 as swf
from boto.swf import layer1
import pytest
from garcon import activity
from garcon import decider
def mock(monkeypatch):
for base in [swf.Decider, swf.WorkflowType, swf.Activit... | |
1ec0c1d949e9379fc2a01bf480a782bb4d75afb9 | test.py | test.py | #!/bin/env python3
# -*- coding: utf-8 -*-
"""
Test the 'send_morse' module.
"""
import sys
import os
import getopt
import threading
sys.path.append('..')
from sound_morse import SoundMorse
# get program name from sys.argv
prog_name = sys.argv[0]
if prog_name.endswith('.py'):
prog_name = prog_name[:-3]
def us... | Test program for thread debugging | Test program for thread debugging
| Python | mit | rzzzwilson/morse_trainer,rzzzwilson/morse_trainer | Test program for thread debugging | #!/bin/env python3
# -*- coding: utf-8 -*-
"""
Test the 'send_morse' module.
"""
import sys
import os
import getopt
import threading
sys.path.append('..')
from sound_morse import SoundMorse
# get program name from sys.argv
prog_name = sys.argv[0]
if prog_name.endswith('.py'):
prog_name = prog_name[:-3]
def us... | <commit_before><commit_msg>Test program for thread debugging<commit_after> | #!/bin/env python3
# -*- coding: utf-8 -*-
"""
Test the 'send_morse' module.
"""
import sys
import os
import getopt
import threading
sys.path.append('..')
from sound_morse import SoundMorse
# get program name from sys.argv
prog_name = sys.argv[0]
if prog_name.endswith('.py'):
prog_name = prog_name[:-3]
def us... | Test program for thread debugging#!/bin/env python3
# -*- coding: utf-8 -*-
"""
Test the 'send_morse' module.
"""
import sys
import os
import getopt
import threading
sys.path.append('..')
from sound_morse import SoundMorse
# get program name from sys.argv
prog_name = sys.argv[0]
if prog_name.endswith('.py'):
pr... | <commit_before><commit_msg>Test program for thread debugging<commit_after>#!/bin/env python3
# -*- coding: utf-8 -*-
"""
Test the 'send_morse' module.
"""
import sys
import os
import getopt
import threading
sys.path.append('..')
from sound_morse import SoundMorse
# get program name from sys.argv
prog_name = sys.arg... | |
fa87821a4a4b282e5cc0d9311a0c4dfb5fbc37db | comics/aggregator/utils.py | comics/aggregator/utils.py | from comics.comics import get_comic_module
SCHEDULE_DAYS = ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa']
def get_comic_schedule(comic):
module = get_comic_module(comic.slug)
schedule = module.Crawler(comic).schedule
if not schedule:
return []
return [SCHEDULE_DAYS.index(day) for day in schedule.... | Add helper for getting schedule | Add helper for getting schedule
| Python | agpl-3.0 | jodal/comics,klette/comics,klette/comics,jodal/comics,klette/comics,datagutten/comics,jodal/comics,datagutten/comics,datagutten/comics,jodal/comics,datagutten/comics | Add helper for getting schedule | from comics.comics import get_comic_module
SCHEDULE_DAYS = ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa']
def get_comic_schedule(comic):
module = get_comic_module(comic.slug)
schedule = module.Crawler(comic).schedule
if not schedule:
return []
return [SCHEDULE_DAYS.index(day) for day in schedule.... | <commit_before><commit_msg>Add helper for getting schedule<commit_after> | from comics.comics import get_comic_module
SCHEDULE_DAYS = ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa']
def get_comic_schedule(comic):
module = get_comic_module(comic.slug)
schedule = module.Crawler(comic).schedule
if not schedule:
return []
return [SCHEDULE_DAYS.index(day) for day in schedule.... | Add helper for getting schedulefrom comics.comics import get_comic_module
SCHEDULE_DAYS = ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa']
def get_comic_schedule(comic):
module = get_comic_module(comic.slug)
schedule = module.Crawler(comic).schedule
if not schedule:
return []
return [SCHEDULE_DAYS.... | <commit_before><commit_msg>Add helper for getting schedule<commit_after>from comics.comics import get_comic_module
SCHEDULE_DAYS = ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa']
def get_comic_schedule(comic):
module = get_comic_module(comic.slug)
schedule = module.Crawler(comic).schedule
if not schedule:
... | |
6db2c7298a4111ce540743099cabed7aed4439c8 | dbaas/workflow/steps/mysql/region_migration/remove_nfs_snapshot.py | dbaas/workflow/steps/mysql/region_migration/remove_nfs_snapshot.py | # -*- coding: utf-8 -*-
import logging
from util import full_stack
from workflow.steps.util.base import BaseStep
from dbaas_nfsaas.provider import NfsaasProvider
from workflow.exceptions.error_codes import DBAAS_0020
LOG = logging.getLogger(__name__)
class RemoveNfsSnapshot(BaseStep):
def __unicode__(self):
... | Add step to remove nfs snapshot | Add step to remove nfs snapshot
| Python | bsd-3-clause | globocom/database-as-a-service,globocom/database-as-a-service,globocom/database-as-a-service,globocom/database-as-a-service | Add step to remove nfs snapshot | # -*- coding: utf-8 -*-
import logging
from util import full_stack
from workflow.steps.util.base import BaseStep
from dbaas_nfsaas.provider import NfsaasProvider
from workflow.exceptions.error_codes import DBAAS_0020
LOG = logging.getLogger(__name__)
class RemoveNfsSnapshot(BaseStep):
def __unicode__(self):
... | <commit_before><commit_msg>Add step to remove nfs snapshot<commit_after> | # -*- coding: utf-8 -*-
import logging
from util import full_stack
from workflow.steps.util.base import BaseStep
from dbaas_nfsaas.provider import NfsaasProvider
from workflow.exceptions.error_codes import DBAAS_0020
LOG = logging.getLogger(__name__)
class RemoveNfsSnapshot(BaseStep):
def __unicode__(self):
... | Add step to remove nfs snapshot# -*- coding: utf-8 -*-
import logging
from util import full_stack
from workflow.steps.util.base import BaseStep
from dbaas_nfsaas.provider import NfsaasProvider
from workflow.exceptions.error_codes import DBAAS_0020
LOG = logging.getLogger(__name__)
class RemoveNfsSnapshot(BaseStep):
... | <commit_before><commit_msg>Add step to remove nfs snapshot<commit_after># -*- coding: utf-8 -*-
import logging
from util import full_stack
from workflow.steps.util.base import BaseStep
from dbaas_nfsaas.provider import NfsaasProvider
from workflow.exceptions.error_codes import DBAAS_0020
LOG = logging.getLogger(__name... | |
27439c063c51015c1405c3c855ce96157892da72 | opps/channel/search_indexes.py | opps/channel/search_indexes.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from datetime import datetime
from haystack.indexes import SearchIndex, CharField, DateTimeField
from haystack import site
from .models import Channel
class ChannelIndex(SearchIndex):
text = CharField(document=True, use_template=True)
date_available = DateTimeFi... | Create channel search index, indexed all channel name | Create channel search index, indexed all channel name
| Python | mit | williamroot/opps,YACOWS/opps,opps/opps,jeanmask/opps,jeanmask/opps,YACOWS/opps,opps/opps,williamroot/opps,williamroot/opps,YACOWS/opps,opps/opps,opps/opps,jeanmask/opps,jeanmask/opps,williamroot/opps,YACOWS/opps | Create channel search index, indexed all channel name | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from datetime import datetime
from haystack.indexes import SearchIndex, CharField, DateTimeField
from haystack import site
from .models import Channel
class ChannelIndex(SearchIndex):
text = CharField(document=True, use_template=True)
date_available = DateTimeFi... | <commit_before><commit_msg>Create channel search index, indexed all channel name<commit_after> | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from datetime import datetime
from haystack.indexes import SearchIndex, CharField, DateTimeField
from haystack import site
from .models import Channel
class ChannelIndex(SearchIndex):
text = CharField(document=True, use_template=True)
date_available = DateTimeFi... | Create channel search index, indexed all channel name#!/usr/bin/env python
# -*- coding: utf-8 -*-
from datetime import datetime
from haystack.indexes import SearchIndex, CharField, DateTimeField
from haystack import site
from .models import Channel
class ChannelIndex(SearchIndex):
text = CharField(document=Tru... | <commit_before><commit_msg>Create channel search index, indexed all channel name<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-
from datetime import datetime
from haystack.indexes import SearchIndex, CharField, DateTimeField
from haystack import site
from .models import Channel
class ChannelIndex(Search... | |
f4bb9685d4ba6661cdda34635c772fb39dc3e246 | wsgi.py | wsgi.py | """ WSGI Entry Point
"""
from portal.app import create_app
from werkzeug.contrib.fixers import ProxyFix
app = create_app()
if app.config.get('PREFERRED_URL_SCHEME', '').lower() == 'https':
app.wsgi_app = ProxyFix(app.wsgi_app)
| Add proxy-fixing middleware if serving over HTTPS proxy | Add proxy-fixing middleware if serving over HTTPS proxy
| Python | bsd-3-clause | uwcirg/true_nth_usa_portal,uwcirg/true_nth_usa_portal,uwcirg/true_nth_usa_portal,uwcirg/true_nth_usa_portal | Add proxy-fixing middleware if serving over HTTPS proxy | """ WSGI Entry Point
"""
from portal.app import create_app
from werkzeug.contrib.fixers import ProxyFix
app = create_app()
if app.config.get('PREFERRED_URL_SCHEME', '').lower() == 'https':
app.wsgi_app = ProxyFix(app.wsgi_app)
| <commit_before><commit_msg>Add proxy-fixing middleware if serving over HTTPS proxy<commit_after> | """ WSGI Entry Point
"""
from portal.app import create_app
from werkzeug.contrib.fixers import ProxyFix
app = create_app()
if app.config.get('PREFERRED_URL_SCHEME', '').lower() == 'https':
app.wsgi_app = ProxyFix(app.wsgi_app)
| Add proxy-fixing middleware if serving over HTTPS proxy""" WSGI Entry Point
"""
from portal.app import create_app
from werkzeug.contrib.fixers import ProxyFix
app = create_app()
if app.config.get('PREFERRED_URL_SCHEME', '').lower() == 'https':
app.wsgi_app = ProxyFix(app.wsgi_app)
| <commit_before><commit_msg>Add proxy-fixing middleware if serving over HTTPS proxy<commit_after>""" WSGI Entry Point
"""
from portal.app import create_app
from werkzeug.contrib.fixers import ProxyFix
app = create_app()
if app.config.get('PREFERRED_URL_SCHEME', '').lower() == 'https':
app.wsgi_app = ProxyFix(app... | |
6c53c55204955cf0682c655321219b4e67481030 | lab/10/template_10_c.py | lab/10/template_10_c.py | # Template Binary Search Tree
class Node:
'''
Class untuk node dari Binary Search Tree
Terdiri dari value dari node
dan reference ke left child dan right child
'''
def __init__(self, value):
self.value = value
self.left = None
self.right = None
# Benny-ry Sear... | Add lab 10 template for class C | Add lab 10 template for class C
| Python | mit | giovanism/TarungLab,laymonage/TarungLab | Add lab 10 template for class C | # Template Binary Search Tree
class Node:
'''
Class untuk node dari Binary Search Tree
Terdiri dari value dari node
dan reference ke left child dan right child
'''
def __init__(self, value):
self.value = value
self.left = None
self.right = None
# Benny-ry Sear... | <commit_before><commit_msg>Add lab 10 template for class C<commit_after> | # Template Binary Search Tree
class Node:
'''
Class untuk node dari Binary Search Tree
Terdiri dari value dari node
dan reference ke left child dan right child
'''
def __init__(self, value):
self.value = value
self.left = None
self.right = None
# Benny-ry Sear... | Add lab 10 template for class C# Template Binary Search Tree
class Node:
'''
Class untuk node dari Binary Search Tree
Terdiri dari value dari node
dan reference ke left child dan right child
'''
def __init__(self, value):
self.value = value
self.left = None
sel... | <commit_before><commit_msg>Add lab 10 template for class C<commit_after># Template Binary Search Tree
class Node:
'''
Class untuk node dari Binary Search Tree
Terdiri dari value dari node
dan reference ke left child dan right child
'''
def __init__(self, value):
self.value = v... | |
127338c9584b6ac0e74ef0009d2769dd43d080f9 | particle-beam/particle-beam.py | particle-beam/particle-beam.py | #!/usr/bin/env python3
import random
import const
from particle import Particle, propagate
from detector import Detector
from initial import Beam, Profile, Energy
random.seed(91400)
N = 1000
beam = Beam(
profile=Profile(
centre=0,
diameter=50,
shape=const.UNIFORM,
),
energy=Ener... | Add the 'shell' for the MC simulation. | Add the 'shell' for the MC simulation.
| Python | mpl-2.0 | DanielBrookRoberge/MonteCarloExamples | Add the 'shell' for the MC simulation. | #!/usr/bin/env python3
import random
import const
from particle import Particle, propagate
from detector import Detector
from initial import Beam, Profile, Energy
random.seed(91400)
N = 1000
beam = Beam(
profile=Profile(
centre=0,
diameter=50,
shape=const.UNIFORM,
),
energy=Ener... | <commit_before><commit_msg>Add the 'shell' for the MC simulation.<commit_after> | #!/usr/bin/env python3
import random
import const
from particle import Particle, propagate
from detector import Detector
from initial import Beam, Profile, Energy
random.seed(91400)
N = 1000
beam = Beam(
profile=Profile(
centre=0,
diameter=50,
shape=const.UNIFORM,
),
energy=Ener... | Add the 'shell' for the MC simulation.#!/usr/bin/env python3
import random
import const
from particle import Particle, propagate
from detector import Detector
from initial import Beam, Profile, Energy
random.seed(91400)
N = 1000
beam = Beam(
profile=Profile(
centre=0,
diameter=50,
shape... | <commit_before><commit_msg>Add the 'shell' for the MC simulation.<commit_after>#!/usr/bin/env python3
import random
import const
from particle import Particle, propagate
from detector import Detector
from initial import Beam, Profile, Energy
random.seed(91400)
N = 1000
beam = Beam(
profile=Profile(
cen... | |
8fb60650f8ff1da16d537402e7227f78667b434e | tests/test_schema_loader.py | tests/test_schema_loader.py | import contextlib
import json
import os
import tempfile
import unittest
from faker_schema.schema_loader import load_json_from_file, load_json_from_string
class TestFakerSchema(unittest.TestCase):
def test_load_json_from_string(self):
schema_json_string = '{"Full Name": "name", "Address": "address", "Email": "ema... | Add unit tests for schema loader module | Add unit tests for schema loader module
| Python | mit | ueg1990/faker-schema | Add unit tests for schema loader module | import contextlib
import json
import os
import tempfile
import unittest
from faker_schema.schema_loader import load_json_from_file, load_json_from_string
class TestFakerSchema(unittest.TestCase):
def test_load_json_from_string(self):
schema_json_string = '{"Full Name": "name", "Address": "address", "Email": "ema... | <commit_before><commit_msg>Add unit tests for schema loader module<commit_after> | import contextlib
import json
import os
import tempfile
import unittest
from faker_schema.schema_loader import load_json_from_file, load_json_from_string
class TestFakerSchema(unittest.TestCase):
def test_load_json_from_string(self):
schema_json_string = '{"Full Name": "name", "Address": "address", "Email": "ema... | Add unit tests for schema loader moduleimport contextlib
import json
import os
import tempfile
import unittest
from faker_schema.schema_loader import load_json_from_file, load_json_from_string
class TestFakerSchema(unittest.TestCase):
def test_load_json_from_string(self):
schema_json_string = '{"Full Name": "nam... | <commit_before><commit_msg>Add unit tests for schema loader module<commit_after>import contextlib
import json
import os
import tempfile
import unittest
from faker_schema.schema_loader import load_json_from_file, load_json_from_string
class TestFakerSchema(unittest.TestCase):
def test_load_json_from_string(self):
... | |
b38edc2a192151324855d50e9e172f0fd96b9064 | mda/finance.py | mda/finance.py | from __future__ import division
import numpy as np
import pandas as pd
import urllib2
# __author__ = 'mattmcd'
class LseReader:
def __init__(self):
dataLoc = '/home/mattmcd/Work/Data/'
ftseFile = dataLoc + 'FTSE100.csv'
self.ftse100 = pd.read_csv( ftseFile )
self.prefixURL = 'h... | Read prices from Google Finance | Read prices from Google Finance
| Python | apache-2.0 | mattmcd/PyAnalysis | Read prices from Google Finance | from __future__ import division
import numpy as np
import pandas as pd
import urllib2
# __author__ = 'mattmcd'
class LseReader:
def __init__(self):
dataLoc = '/home/mattmcd/Work/Data/'
ftseFile = dataLoc + 'FTSE100.csv'
self.ftse100 = pd.read_csv( ftseFile )
self.prefixURL = 'h... | <commit_before><commit_msg>Read prices from Google Finance<commit_after> | from __future__ import division
import numpy as np
import pandas as pd
import urllib2
# __author__ = 'mattmcd'
class LseReader:
def __init__(self):
dataLoc = '/home/mattmcd/Work/Data/'
ftseFile = dataLoc + 'FTSE100.csv'
self.ftse100 = pd.read_csv( ftseFile )
self.prefixURL = 'h... | Read prices from Google Financefrom __future__ import division
import numpy as np
import pandas as pd
import urllib2
# __author__ = 'mattmcd'
class LseReader:
def __init__(self):
dataLoc = '/home/mattmcd/Work/Data/'
ftseFile = dataLoc + 'FTSE100.csv'
self.ftse100 = pd.read_csv( ftseFil... | <commit_before><commit_msg>Read prices from Google Finance<commit_after>from __future__ import division
import numpy as np
import pandas as pd
import urllib2
# __author__ = 'mattmcd'
class LseReader:
def __init__(self):
dataLoc = '/home/mattmcd/Work/Data/'
ftseFile = dataLoc + 'FTSE100.csv'
... | |
0dfe3084cf7d4832d14c027e646bfd74cc096177 | mongonaut/views.py | mongonaut/views.py | from django.views.generic import DetailView
from django.views.generic import ListView
from mongonaut.sites import NautSite
class IndexView(ListView):
queryset = NautSite._registry.iteritems()
template_name = "mongonaut/index.html"
class AppListView(ListView):
""" :args: <app_label> """
template_name... | import importlib
from django.views.generic import DetailView
from django.views.generic import ListView
from mongonaut.sites import NautSite
class IndexView(ListView):
queryset = NautSite._registry.iteritems()
template_name = "mongonaut/index.html"
class AppListView(ListView):
""" :args: <app_label> """
... | Work on the document list view | Work on the document list view
| Python | mit | jazzband/django-mongonaut,pydanny/django-mongonaut,jazzband/django-mongonaut,lchsk/django-mongonaut,jazzband/django-mongonaut,lchsk/django-mongonaut,pydanny/django-mongonaut,lchsk/django-mongonaut,pydanny/django-mongonaut | from django.views.generic import DetailView
from django.views.generic import ListView
from mongonaut.sites import NautSite
class IndexView(ListView):
queryset = NautSite._registry.iteritems()
template_name = "mongonaut/index.html"
class AppListView(ListView):
""" :args: <app_label> """
template_name... | import importlib
from django.views.generic import DetailView
from django.views.generic import ListView
from mongonaut.sites import NautSite
class IndexView(ListView):
queryset = NautSite._registry.iteritems()
template_name = "mongonaut/index.html"
class AppListView(ListView):
""" :args: <app_label> """
... | <commit_before>from django.views.generic import DetailView
from django.views.generic import ListView
from mongonaut.sites import NautSite
class IndexView(ListView):
queryset = NautSite._registry.iteritems()
template_name = "mongonaut/index.html"
class AppListView(ListView):
""" :args: <app_label> """
... | import importlib
from django.views.generic import DetailView
from django.views.generic import ListView
from mongonaut.sites import NautSite
class IndexView(ListView):
queryset = NautSite._registry.iteritems()
template_name = "mongonaut/index.html"
class AppListView(ListView):
""" :args: <app_label> """
... | from django.views.generic import DetailView
from django.views.generic import ListView
from mongonaut.sites import NautSite
class IndexView(ListView):
queryset = NautSite._registry.iteritems()
template_name = "mongonaut/index.html"
class AppListView(ListView):
""" :args: <app_label> """
template_name... | <commit_before>from django.views.generic import DetailView
from django.views.generic import ListView
from mongonaut.sites import NautSite
class IndexView(ListView):
queryset = NautSite._registry.iteritems()
template_name = "mongonaut/index.html"
class AppListView(ListView):
""" :args: <app_label> """
... |
40f57a73adadf08e497464990a34860d03e04d39 | mezzanine/core/urls.py | mezzanine/core/urls.py |
from django.conf.urls.defaults import patterns, url
from mezzanine.conf import settings
urlpatterns = []
if "django.contrib.admin" in settings.INSTALLED_APPS:
urlpatterns += patterns("django.contrib.auth.views",
url("^password_reset/$", "password_reset", name="password_reset"),
("^password_rese... |
from django.conf.urls.defaults import patterns, url
from mezzanine.conf import settings
urlpatterns = []
if "django.contrib.admin" in settings.INSTALLED_APPS:
urlpatterns += patterns("django.contrib.auth.views",
url("^password_reset/$", "password_reset", name="password_reset"),
("^password_rese... | Allow static proxy URL to be configured. | Allow static proxy URL to be configured.
| Python | bsd-2-clause | scarcry/snm-mezzanine,vladir/mezzanine,fusionbox/mezzanine,jerivas/mezzanine,molokov/mezzanine,frankchin/mezzanine,adrian-the-git/mezzanine,fusionbox/mezzanine,mush42/mezzanine,damnfine/mezzanine,molokov/mezzanine,Kniyl/mezzanine,cccs-web/mezzanine,orlenko/sfpirg,sjdines/mezzanine,adrian-the-git/mezzanine,scarcry/snm-m... |
from django.conf.urls.defaults import patterns, url
from mezzanine.conf import settings
urlpatterns = []
if "django.contrib.admin" in settings.INSTALLED_APPS:
urlpatterns += patterns("django.contrib.auth.views",
url("^password_reset/$", "password_reset", name="password_reset"),
("^password_rese... |
from django.conf.urls.defaults import patterns, url
from mezzanine.conf import settings
urlpatterns = []
if "django.contrib.admin" in settings.INSTALLED_APPS:
urlpatterns += patterns("django.contrib.auth.views",
url("^password_reset/$", "password_reset", name="password_reset"),
("^password_rese... | <commit_before>
from django.conf.urls.defaults import patterns, url
from mezzanine.conf import settings
urlpatterns = []
if "django.contrib.admin" in settings.INSTALLED_APPS:
urlpatterns += patterns("django.contrib.auth.views",
url("^password_reset/$", "password_reset", name="password_reset"),
(... |
from django.conf.urls.defaults import patterns, url
from mezzanine.conf import settings
urlpatterns = []
if "django.contrib.admin" in settings.INSTALLED_APPS:
urlpatterns += patterns("django.contrib.auth.views",
url("^password_reset/$", "password_reset", name="password_reset"),
("^password_rese... |
from django.conf.urls.defaults import patterns, url
from mezzanine.conf import settings
urlpatterns = []
if "django.contrib.admin" in settings.INSTALLED_APPS:
urlpatterns += patterns("django.contrib.auth.views",
url("^password_reset/$", "password_reset", name="password_reset"),
("^password_rese... | <commit_before>
from django.conf.urls.defaults import patterns, url
from mezzanine.conf import settings
urlpatterns = []
if "django.contrib.admin" in settings.INSTALLED_APPS:
urlpatterns += patterns("django.contrib.auth.views",
url("^password_reset/$", "password_reset", name="password_reset"),
(... |
d3367d32dbc080d8e963542351c427fe2da48f18 | talempd/amazing/MaxProfit.py | talempd/amazing/MaxProfit.py | def maxprofit(stockvals):
maxval, profit = 0, 0
for stockval in stockvals[::-1]:
maxval = max(maxval, stockval)
profit += maxval - stockval
return profit
stockvalues = [1, 3, 1, 2, 4]
print "Profit was: " + str(maxprofit(stockvalues))
| Change name for maxprofit in amazing | Change name for maxprofit in amazing
| Python | mit | cc13ny/Allin,Chasego/cod,cc13ny/Allin,Chasego/codirit,cc13ny/Allin,Chasego/codi,cc13ny/algo,cc13ny/algo,Chasego/cod,Chasego/codi,cc13ny/Allin,cc13ny/algo,Chasego/cod,Chasego/codirit,cc13ny/algo,Chasego/codi,cc13ny/Allin,Chasego/codirit,cc13ny/algo,Chasego/cod,Chasego/codi,Chasego/codi,Chasego/codirit,Chasego/codirit,Ch... | Change name for maxprofit in amazing | def maxprofit(stockvals):
maxval, profit = 0, 0
for stockval in stockvals[::-1]:
maxval = max(maxval, stockval)
profit += maxval - stockval
return profit
stockvalues = [1, 3, 1, 2, 4]
print "Profit was: " + str(maxprofit(stockvalues))
| <commit_before><commit_msg>Change name for maxprofit in amazing<commit_after> | def maxprofit(stockvals):
maxval, profit = 0, 0
for stockval in stockvals[::-1]:
maxval = max(maxval, stockval)
profit += maxval - stockval
return profit
stockvalues = [1, 3, 1, 2, 4]
print "Profit was: " + str(maxprofit(stockvalues))
| Change name for maxprofit in amazingdef maxprofit(stockvals):
maxval, profit = 0, 0
for stockval in stockvals[::-1]:
maxval = max(maxval, stockval)
profit += maxval - stockval
return profit
stockvalues = [1, 3, 1, 2, 4]
print "Profit was: " + str(maxprofit(stockvalues))
| <commit_before><commit_msg>Change name for maxprofit in amazing<commit_after>def maxprofit(stockvals):
maxval, profit = 0, 0
for stockval in stockvals[::-1]:
maxval = max(maxval, stockval)
profit += maxval - stockval
return profit
stockvalues = [1, 3, 1, 2, 4]
print "Profit was: " + str(ma... | |
272f285f1c9caa19c7c05bf92bd362cda9f762d1 | experimental/directshow.py | experimental/directshow.py | #!/usr/bin/python
# $Id:$
# Play an audio file with DirectShow. Tested ok with MP3, WMA, MID, WAV, AU.
# Caveats:
# - Requires a filename (not from memory or stream yet). Looks like we need
# to manually implement a filter which provides an output IPin. Lot of
# work.
# - Theoretically can traverse the ... | Move win32 audio experiment to trunk. | Move win32 audio experiment to trunk.
| Python | bsd-3-clause | mammadori/pyglet,oktayacikalin/pyglet,theblacklion/pyglet,theblacklion/pyglet,oktayacikalin/pyglet,oktayacikalin/pyglet,mammadori/pyglet,oktayacikalin/pyglet,oktayacikalin/pyglet,mammadori/pyglet,theblacklion/pyglet,theblacklion/pyglet,mammadori/pyglet,theblacklion/pyglet | Move win32 audio experiment to trunk. | #!/usr/bin/python
# $Id:$
# Play an audio file with DirectShow. Tested ok with MP3, WMA, MID, WAV, AU.
# Caveats:
# - Requires a filename (not from memory or stream yet). Looks like we need
# to manually implement a filter which provides an output IPin. Lot of
# work.
# - Theoretically can traverse the ... | <commit_before><commit_msg>Move win32 audio experiment to trunk.<commit_after> | #!/usr/bin/python
# $Id:$
# Play an audio file with DirectShow. Tested ok with MP3, WMA, MID, WAV, AU.
# Caveats:
# - Requires a filename (not from memory or stream yet). Looks like we need
# to manually implement a filter which provides an output IPin. Lot of
# work.
# - Theoretically can traverse the ... | Move win32 audio experiment to trunk.#!/usr/bin/python
# $Id:$
# Play an audio file with DirectShow. Tested ok with MP3, WMA, MID, WAV, AU.
# Caveats:
# - Requires a filename (not from memory or stream yet). Looks like we need
# to manually implement a filter which provides an output IPin. Lot of
# work.... | <commit_before><commit_msg>Move win32 audio experiment to trunk.<commit_after>#!/usr/bin/python
# $Id:$
# Play an audio file with DirectShow. Tested ok with MP3, WMA, MID, WAV, AU.
# Caveats:
# - Requires a filename (not from memory or stream yet). Looks like we need
# to manually implement a filter which pr... | |
4af2f405c1c09737bdb32842f8e87a730d9bedd3 | photutils/psf/building/epsf.py | photutils/psf/building/epsf.py | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Tools to build an ePSF.
"""
from __future__ import (absolute_import, division, print_function,
unicode_literals)
from astropy.modeling.fitting import LevMarLSQFitter
from astropy.stats import SigmaClip
__all__ = ['EPSFFitter... | Add initial EPSFBuilder and EPSFFitter classes | Add initial EPSFBuilder and EPSFFitter classes
| Python | bsd-3-clause | astropy/photutils,larrybradley/photutils | Add initial EPSFBuilder and EPSFFitter classes | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Tools to build an ePSF.
"""
from __future__ import (absolute_import, division, print_function,
unicode_literals)
from astropy.modeling.fitting import LevMarLSQFitter
from astropy.stats import SigmaClip
__all__ = ['EPSFFitter... | <commit_before><commit_msg>Add initial EPSFBuilder and EPSFFitter classes<commit_after> | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Tools to build an ePSF.
"""
from __future__ import (absolute_import, division, print_function,
unicode_literals)
from astropy.modeling.fitting import LevMarLSQFitter
from astropy.stats import SigmaClip
__all__ = ['EPSFFitter... | Add initial EPSFBuilder and EPSFFitter classes# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Tools to build an ePSF.
"""
from __future__ import (absolute_import, division, print_function,
unicode_literals)
from astropy.modeling.fitting import LevMarLSQFitter
from astropy.s... | <commit_before><commit_msg>Add initial EPSFBuilder and EPSFFitter classes<commit_after># Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Tools to build an ePSF.
"""
from __future__ import (absolute_import, division, print_function,
unicode_literals)
from astropy.modeling.fitt... | |
96af482f65385ebe9a4da1606d12875c7eaf320f | pombola/south_africa/management/commands/south_africa_restart_constituency_contacts.py | pombola/south_africa/management/commands/south_africa_restart_constituency_contacts.py | from datetime import date
from optparse import make_option
from django.core.management.base import NoArgsCommand, CommandError
from django_date_extensions.fields import ApproximateDate
from pombola.core.models import PositionTitle
# A few days before the election:
date_for_last_active_check = date(2014, 5, 1)
# The ... | Add a script to restart constituency contact positions | Add a script to restart constituency contact positions
We need this because it will be some time before we have new
constituency contact information. It's reasonable to guess, however,
that people who were previously MPs or MPLs and constituency contacts
who have been re-elected will still be constituency contacts. ... | Python | agpl-3.0 | hzj123/56th,geoffkilpin/pombola,patricmutwiri/pombola,patricmutwiri/pombola,ken-muturi/pombola,mysociety/pombola,geoffkilpin/pombola,hzj123/56th,hzj123/56th,patricmutwiri/pombola,mysociety/pombola,ken-muturi/pombola,mysociety/pombola,hzj123/56th,patricmutwiri/pombola,mysociety/pombola,hzj123/56th,geoffkilpin/pombola,ke... | Add a script to restart constituency contact positions
We need this because it will be some time before we have new
constituency contact information. It's reasonable to guess, however,
that people who were previously MPs or MPLs and constituency contacts
who have been re-elected will still be constituency contacts. ... | from datetime import date
from optparse import make_option
from django.core.management.base import NoArgsCommand, CommandError
from django_date_extensions.fields import ApproximateDate
from pombola.core.models import PositionTitle
# A few days before the election:
date_for_last_active_check = date(2014, 5, 1)
# The ... | <commit_before><commit_msg>Add a script to restart constituency contact positions
We need this because it will be some time before we have new
constituency contact information. It's reasonable to guess, however,
that people who were previously MPs or MPLs and constituency contacts
who have been re-elected will still ... | from datetime import date
from optparse import make_option
from django.core.management.base import NoArgsCommand, CommandError
from django_date_extensions.fields import ApproximateDate
from pombola.core.models import PositionTitle
# A few days before the election:
date_for_last_active_check = date(2014, 5, 1)
# The ... | Add a script to restart constituency contact positions
We need this because it will be some time before we have new
constituency contact information. It's reasonable to guess, however,
that people who were previously MPs or MPLs and constituency contacts
who have been re-elected will still be constituency contacts. ... | <commit_before><commit_msg>Add a script to restart constituency contact positions
We need this because it will be some time before we have new
constituency contact information. It's reasonable to guess, however,
that people who were previously MPs or MPLs and constituency contacts
who have been re-elected will still ... | |
0aa1f60fc00d488cf662f16cf966e7a6b6af43a0 | scripts/collapse_xls_to_csv.py | scripts/collapse_xls_to_csv.py | #!/usr/bin/env python3
import os
import logging
import csv
import argparse
import xlrd
logger = logging.getLogger()
def main(args):
infile_path = os.path.abspath(args.infile)
if infile_path.endswith('.xls') or infile_path.endswith('.xlsx'):
book = xlrd.open_workbook(infile_path)
sheet_names... | Add script to convert a multi-sheet Excel to a single csv. | Add script to convert a multi-sheet Excel to a single csv.
| Python | bsd-3-clause | dmc2015/hall-of-justice,dmc2015/hall-of-justice,sunlightlabs/hall-of-justice,dmc2015/hall-of-justice,sunlightlabs/hall-of-justice,sunlightlabs/hall-of-justice | Add script to convert a multi-sheet Excel to a single csv. | #!/usr/bin/env python3
import os
import logging
import csv
import argparse
import xlrd
logger = logging.getLogger()
def main(args):
infile_path = os.path.abspath(args.infile)
if infile_path.endswith('.xls') or infile_path.endswith('.xlsx'):
book = xlrd.open_workbook(infile_path)
sheet_names... | <commit_before><commit_msg>Add script to convert a multi-sheet Excel to a single csv.<commit_after> | #!/usr/bin/env python3
import os
import logging
import csv
import argparse
import xlrd
logger = logging.getLogger()
def main(args):
infile_path = os.path.abspath(args.infile)
if infile_path.endswith('.xls') or infile_path.endswith('.xlsx'):
book = xlrd.open_workbook(infile_path)
sheet_names... | Add script to convert a multi-sheet Excel to a single csv.#!/usr/bin/env python3
import os
import logging
import csv
import argparse
import xlrd
logger = logging.getLogger()
def main(args):
infile_path = os.path.abspath(args.infile)
if infile_path.endswith('.xls') or infile_path.endswith('.xlsx'):
... | <commit_before><commit_msg>Add script to convert a multi-sheet Excel to a single csv.<commit_after>#!/usr/bin/env python3
import os
import logging
import csv
import argparse
import xlrd
logger = logging.getLogger()
def main(args):
infile_path = os.path.abspath(args.infile)
if infile_path.endswith('.xls') o... | |
4c008042d01be6020a863855f74d8ee931dab46e | pdsspect/transforms.py | pdsspect/transforms.py | from qtpy import QtWidgets
from .pdsspect_image_set import PDSSpectImageSetViewBase
class TransformsController(object):
def __init__(self, image_set, view):
self.image_set = image_set
self.view = view
def set_flip_x(self, flip_x):
self.image_set.flip_x = flip_x
def set_flip_y(s... | Handle flipping the image with checl boxes | Handle flipping the image with checl boxes
| Python | bsd-3-clause | planetarypy/pdsspect | Handle flipping the image with checl boxes | from qtpy import QtWidgets
from .pdsspect_image_set import PDSSpectImageSetViewBase
class TransformsController(object):
def __init__(self, image_set, view):
self.image_set = image_set
self.view = view
def set_flip_x(self, flip_x):
self.image_set.flip_x = flip_x
def set_flip_y(s... | <commit_before><commit_msg>Handle flipping the image with checl boxes<commit_after> | from qtpy import QtWidgets
from .pdsspect_image_set import PDSSpectImageSetViewBase
class TransformsController(object):
def __init__(self, image_set, view):
self.image_set = image_set
self.view = view
def set_flip_x(self, flip_x):
self.image_set.flip_x = flip_x
def set_flip_y(s... | Handle flipping the image with checl boxesfrom qtpy import QtWidgets
from .pdsspect_image_set import PDSSpectImageSetViewBase
class TransformsController(object):
def __init__(self, image_set, view):
self.image_set = image_set
self.view = view
def set_flip_x(self, flip_x):
self.image... | <commit_before><commit_msg>Handle flipping the image with checl boxes<commit_after>from qtpy import QtWidgets
from .pdsspect_image_set import PDSSpectImageSetViewBase
class TransformsController(object):
def __init__(self, image_set, view):
self.image_set = image_set
self.view = view
def set... | |
0cb5f00975570a115322ab028dcb93c92c2e0872 | tests/packets/test_message.py | tests/packets/test_message.py | from cactusbot.packets import MessagePacket
def _split(text, *args, **kwargs):
return [
component.text
for component in
MessagePacket(text).split(*args, **kwargs)
]
def test_split():
assert _split("0 1 2 3") == ['0', '1', '2', '3']
assert _split("0 1 2 3", "2") == ['0 1 ', ... | Add simple tests for MessagePacket | Add simple tests for MessagePacket
Currently only MessagePacket.split(). Needs to be improved.
| Python | mit | CactusDev/CactusBot | Add simple tests for MessagePacket
Currently only MessagePacket.split(). Needs to be improved. | from cactusbot.packets import MessagePacket
def _split(text, *args, **kwargs):
return [
component.text
for component in
MessagePacket(text).split(*args, **kwargs)
]
def test_split():
assert _split("0 1 2 3") == ['0', '1', '2', '3']
assert _split("0 1 2 3", "2") == ['0 1 ', ... | <commit_before><commit_msg>Add simple tests for MessagePacket
Currently only MessagePacket.split(). Needs to be improved.<commit_after> | from cactusbot.packets import MessagePacket
def _split(text, *args, **kwargs):
return [
component.text
for component in
MessagePacket(text).split(*args, **kwargs)
]
def test_split():
assert _split("0 1 2 3") == ['0', '1', '2', '3']
assert _split("0 1 2 3", "2") == ['0 1 ', ... | Add simple tests for MessagePacket
Currently only MessagePacket.split(). Needs to be improved.from cactusbot.packets import MessagePacket
def _split(text, *args, **kwargs):
return [
component.text
for component in
MessagePacket(text).split(*args, **kwargs)
]
def test_split():
a... | <commit_before><commit_msg>Add simple tests for MessagePacket
Currently only MessagePacket.split(). Needs to be improved.<commit_after>from cactusbot.packets import MessagePacket
def _split(text, *args, **kwargs):
return [
component.text
for component in
MessagePacket(text).split(*args, *... | |
cd121a2466887999062e4e674998af971cd416e2 | check-wayback-machine.py | check-wayback-machine.py | #!/usr/bin/env python3
from datetime import datetime, timezone, timedelta
import json
import re
import sys
import traceback
import feeds
import util
import web_cache
BLOG_POSTS = json.loads(util.get_file_text("blog.json"))
for post in BLOG_POSTS:
page_count = (len(post["comments"]) + 199) // 200
print("DEBU... | Add script to verify that all pages(+comments) are in the Internet Archive | Add script to verify that all pages(+comments) are in the Internet Archive
| Python | mit | squirrel2038/thearchdruidreport-archive,squirrel2038/thearchdruidreport-archive,squirrel2038/thearchdruidreport-archive | Add script to verify that all pages(+comments) are in the Internet Archive | #!/usr/bin/env python3
from datetime import datetime, timezone, timedelta
import json
import re
import sys
import traceback
import feeds
import util
import web_cache
BLOG_POSTS = json.loads(util.get_file_text("blog.json"))
for post in BLOG_POSTS:
page_count = (len(post["comments"]) + 199) // 200
print("DEBU... | <commit_before><commit_msg>Add script to verify that all pages(+comments) are in the Internet Archive<commit_after> | #!/usr/bin/env python3
from datetime import datetime, timezone, timedelta
import json
import re
import sys
import traceback
import feeds
import util
import web_cache
BLOG_POSTS = json.loads(util.get_file_text("blog.json"))
for post in BLOG_POSTS:
page_count = (len(post["comments"]) + 199) // 200
print("DEBU... | Add script to verify that all pages(+comments) are in the Internet Archive#!/usr/bin/env python3
from datetime import datetime, timezone, timedelta
import json
import re
import sys
import traceback
import feeds
import util
import web_cache
BLOG_POSTS = json.loads(util.get_file_text("blog.json"))
for post in BLOG_PO... | <commit_before><commit_msg>Add script to verify that all pages(+comments) are in the Internet Archive<commit_after>#!/usr/bin/env python3
from datetime import datetime, timezone, timedelta
import json
import re
import sys
import traceback
import feeds
import util
import web_cache
BLOG_POSTS = json.loads(util.get_fil... | |
9fa3e7161764d1bc5a812bccc27837c9ddabef23 | sleep_wake_hourly_pie_chart.py | sleep_wake_hourly_pie_chart.py | import plotly as py
import plotly.graph_objs as go
import plotly.tools as tools
from datetime import datetime, time, timedelta
from sys import argv
import utils.names as names
from utils.csvparser import parse
from utils.exporter import export
# load data from csv into an OrderedDict
data_file = argv[1]
raw_data = pa... | Add hourly sleep wake pie chart | Add hourly sleep wake pie chart
| Python | mit | f-jiang/sleep-pattern-grapher | Add hourly sleep wake pie chart | import plotly as py
import plotly.graph_objs as go
import plotly.tools as tools
from datetime import datetime, time, timedelta
from sys import argv
import utils.names as names
from utils.csvparser import parse
from utils.exporter import export
# load data from csv into an OrderedDict
data_file = argv[1]
raw_data = pa... | <commit_before><commit_msg>Add hourly sleep wake pie chart<commit_after> | import plotly as py
import plotly.graph_objs as go
import plotly.tools as tools
from datetime import datetime, time, timedelta
from sys import argv
import utils.names as names
from utils.csvparser import parse
from utils.exporter import export
# load data from csv into an OrderedDict
data_file = argv[1]
raw_data = pa... | Add hourly sleep wake pie chartimport plotly as py
import plotly.graph_objs as go
import plotly.tools as tools
from datetime import datetime, time, timedelta
from sys import argv
import utils.names as names
from utils.csvparser import parse
from utils.exporter import export
# load data from csv into an OrderedDict
da... | <commit_before><commit_msg>Add hourly sleep wake pie chart<commit_after>import plotly as py
import plotly.graph_objs as go
import plotly.tools as tools
from datetime import datetime, time, timedelta
from sys import argv
import utils.names as names
from utils.csvparser import parse
from utils.exporter import export
# ... | |
488cf1d22504346df0c4d4cebdb27e792d241c8d | learning/tests/test_dsbn.py | learning/tests/test_dsbn.py | import unittest
import numpy as np
import theano
import theano.tensor as T
import testing
from test_rws import RWSLayerTest, RWSTopLayerTest
# Unit Under Test
from learning.dsbn import DSBN
#-----------------------------------------------------------------------------
class TestDSBN(RWSLayerTest, unittest.TestC... | Add unit test for DSBN | Add unit test for DSBN
| Python | agpl-3.0 | lenovor/reweighted-ws,yanweifu/reweighted-ws,skaasj/reweighted-ws,yanweifu/reweighted-ws,jbornschein/y2k,jbornschein/y2k,codeaudit/reweighted-ws,jbornschein/reweighted-ws,skaasj/reweighted-ws,lenovor/reweighted-ws,codeaudit/reweighted-ws,jbornschein/reweighted-ws | Add unit test for DSBN | import unittest
import numpy as np
import theano
import theano.tensor as T
import testing
from test_rws import RWSLayerTest, RWSTopLayerTest
# Unit Under Test
from learning.dsbn import DSBN
#-----------------------------------------------------------------------------
class TestDSBN(RWSLayerTest, unittest.TestC... | <commit_before><commit_msg>Add unit test for DSBN<commit_after> | import unittest
import numpy as np
import theano
import theano.tensor as T
import testing
from test_rws import RWSLayerTest, RWSTopLayerTest
# Unit Under Test
from learning.dsbn import DSBN
#-----------------------------------------------------------------------------
class TestDSBN(RWSLayerTest, unittest.TestC... | Add unit test for DSBNimport unittest
import numpy as np
import theano
import theano.tensor as T
import testing
from test_rws import RWSLayerTest, RWSTopLayerTest
# Unit Under Test
from learning.dsbn import DSBN
#-----------------------------------------------------------------------------
class TestDSBN(RWSLay... | <commit_before><commit_msg>Add unit test for DSBN<commit_after>import unittest
import numpy as np
import theano
import theano.tensor as T
import testing
from test_rws import RWSLayerTest, RWSTopLayerTest
# Unit Under Test
from learning.dsbn import DSBN
#-----------------------------------------------------------... | |
09011ddc407ec5d9ff0535b043f9630fa76d2dfc | ELiDE/ELiDE/game.py | ELiDE/ELiDE/game.py | import os
from importlib import import_module
from kivy.properties import (
AliasProperty,
ObjectProperty
)
from kivy.app import App
from kivy.uix.widget import Widget
from kivy.uix.screenmanager import ScreenManager, Screen
from LiSE.engine import Engine
import LiSE.proxy
class GameScreen(Screen):
switch... | Implement App and Screen subclasses for developer's convenience | Implement App and Screen subclasses for developer's convenience
| Python | agpl-3.0 | LogicalDash/LiSE,LogicalDash/LiSE | Implement App and Screen subclasses for developer's convenience | import os
from importlib import import_module
from kivy.properties import (
AliasProperty,
ObjectProperty
)
from kivy.app import App
from kivy.uix.widget import Widget
from kivy.uix.screenmanager import ScreenManager, Screen
from LiSE.engine import Engine
import LiSE.proxy
class GameScreen(Screen):
switch... | <commit_before><commit_msg>Implement App and Screen subclasses for developer's convenience<commit_after> | import os
from importlib import import_module
from kivy.properties import (
AliasProperty,
ObjectProperty
)
from kivy.app import App
from kivy.uix.widget import Widget
from kivy.uix.screenmanager import ScreenManager, Screen
from LiSE.engine import Engine
import LiSE.proxy
class GameScreen(Screen):
switch... | Implement App and Screen subclasses for developer's convenienceimport os
from importlib import import_module
from kivy.properties import (
AliasProperty,
ObjectProperty
)
from kivy.app import App
from kivy.uix.widget import Widget
from kivy.uix.screenmanager import ScreenManager, Screen
from LiSE.engine import ... | <commit_before><commit_msg>Implement App and Screen subclasses for developer's convenience<commit_after>import os
from importlib import import_module
from kivy.properties import (
AliasProperty,
ObjectProperty
)
from kivy.app import App
from kivy.uix.widget import Widget
from kivy.uix.screenmanager import Scree... | |
100e0a406551707e92826c2374f9c135613f6858 | bin/index_to_contig.py | bin/index_to_contig.py | """
Given a tuple of index1, index2, correlation and a tuple of index, contig
rewrite the correlation to be contig1, contig2, correlation
"""
import os
import sys
import argparse
__author__ = 'Rob Edwards'
if __name__ == "__main__":
parser = argparse.ArgumentParser(description=' ')
parser.add_argument('-i',... | Convert an index to a contig | Convert an index to a contig
| Python | mit | linsalrob/EdwardsLab,linsalrob/EdwardsLab,linsalrob/EdwardsLab,linsalrob/EdwardsLab,linsalrob/EdwardsLab | Convert an index to a contig | """
Given a tuple of index1, index2, correlation and a tuple of index, contig
rewrite the correlation to be contig1, contig2, correlation
"""
import os
import sys
import argparse
__author__ = 'Rob Edwards'
if __name__ == "__main__":
parser = argparse.ArgumentParser(description=' ')
parser.add_argument('-i',... | <commit_before><commit_msg>Convert an index to a contig<commit_after> | """
Given a tuple of index1, index2, correlation and a tuple of index, contig
rewrite the correlation to be contig1, contig2, correlation
"""
import os
import sys
import argparse
__author__ = 'Rob Edwards'
if __name__ == "__main__":
parser = argparse.ArgumentParser(description=' ')
parser.add_argument('-i',... | Convert an index to a contig"""
Given a tuple of index1, index2, correlation and a tuple of index, contig
rewrite the correlation to be contig1, contig2, correlation
"""
import os
import sys
import argparse
__author__ = 'Rob Edwards'
if __name__ == "__main__":
parser = argparse.ArgumentParser(description=' ')
... | <commit_before><commit_msg>Convert an index to a contig<commit_after>"""
Given a tuple of index1, index2, correlation and a tuple of index, contig
rewrite the correlation to be contig1, contig2, correlation
"""
import os
import sys
import argparse
__author__ = 'Rob Edwards'
if __name__ == "__main__":
parser = a... | |
733d24512b40bc5737704f715cea792fa5a702f0 | script/covall.py | script/covall.py | #!/usr/bin/env python3
"""
Parse a coverage.info file,
and report success if all files have 100% test coverage.
"""
import sys
if len(sys.argv) != 2:
sys.exit("Usage: covall.py <file>")
covinfo = sys.argv[1]
COV = dict()
with open(covinfo) as fin:
for line in fin:
if line.startswith("SF:"):
... | Add script to test for 100% coverage | Add script to test for 100% coverage
| Python | apache-2.0 | cjdrake/boolexpr,cjdrake/boolexpr | Add script to test for 100% coverage | #!/usr/bin/env python3
"""
Parse a coverage.info file,
and report success if all files have 100% test coverage.
"""
import sys
if len(sys.argv) != 2:
sys.exit("Usage: covall.py <file>")
covinfo = sys.argv[1]
COV = dict()
with open(covinfo) as fin:
for line in fin:
if line.startswith("SF:"):
... | <commit_before><commit_msg>Add script to test for 100% coverage<commit_after> | #!/usr/bin/env python3
"""
Parse a coverage.info file,
and report success if all files have 100% test coverage.
"""
import sys
if len(sys.argv) != 2:
sys.exit("Usage: covall.py <file>")
covinfo = sys.argv[1]
COV = dict()
with open(covinfo) as fin:
for line in fin:
if line.startswith("SF:"):
... | Add script to test for 100% coverage#!/usr/bin/env python3
"""
Parse a coverage.info file,
and report success if all files have 100% test coverage.
"""
import sys
if len(sys.argv) != 2:
sys.exit("Usage: covall.py <file>")
covinfo = sys.argv[1]
COV = dict()
with open(covinfo) as fin:
for line in fin:
... | <commit_before><commit_msg>Add script to test for 100% coverage<commit_after>#!/usr/bin/env python3
"""
Parse a coverage.info file,
and report success if all files have 100% test coverage.
"""
import sys
if len(sys.argv) != 2:
sys.exit("Usage: covall.py <file>")
covinfo = sys.argv[1]
COV = dict()
with open(co... | |
5622b1c0ad7708b1d3df72da9caa888d111f6156 | greatbigcrane/job_queue/management/commands/job_server.py | greatbigcrane/job_queue/management/commands/job_server.py | import Queue
import zmq
addr = 'tcp://127.0.0.1:5555'
from django.core.management.base import NoArgsCommand
class Command(NoArgsCommand):
def handle(self, **options):
context = zmq.Context()
socket = context.socket(zmq.REP) # Receives job requests from application server
socket.bind(addr)... | Move the job server into a django management command. | Move the job server into a django management command.
| Python | apache-2.0 | pnomolos/greatbigcrane,pnomolos/greatbigcrane | Move the job server into a django management command. | import Queue
import zmq
addr = 'tcp://127.0.0.1:5555'
from django.core.management.base import NoArgsCommand
class Command(NoArgsCommand):
def handle(self, **options):
context = zmq.Context()
socket = context.socket(zmq.REP) # Receives job requests from application server
socket.bind(addr)... | <commit_before><commit_msg>Move the job server into a django management command.<commit_after> | import Queue
import zmq
addr = 'tcp://127.0.0.1:5555'
from django.core.management.base import NoArgsCommand
class Command(NoArgsCommand):
def handle(self, **options):
context = zmq.Context()
socket = context.socket(zmq.REP) # Receives job requests from application server
socket.bind(addr)... | Move the job server into a django management command.import Queue
import zmq
addr = 'tcp://127.0.0.1:5555'
from django.core.management.base import NoArgsCommand
class Command(NoArgsCommand):
def handle(self, **options):
context = zmq.Context()
socket = context.socket(zmq.REP) # Receives job reque... | <commit_before><commit_msg>Move the job server into a django management command.<commit_after>import Queue
import zmq
addr = 'tcp://127.0.0.1:5555'
from django.core.management.base import NoArgsCommand
class Command(NoArgsCommand):
def handle(self, **options):
context = zmq.Context()
socket = con... | |
9539a6874af98e437cc17ba04c7f0bdfd0a81c5c | cltk/tokenize/utils.py | cltk/tokenize/utils.py | """ Tokenization utilities
"""
__author__ = ['Patrick J. Burns <patrick@diyclassics.org>']
__license__ = 'MIT License.'
import pickle
from abc import abstractmethod
from nltk.tokenize.punkt import PunktSentenceTokenizer, PunktTrainer
from nltk.tokenize.punkt import PunktLanguageVars
from cltk.corpus.latin.readers i... | Add utilities file for tokenize | Add utilities file for tokenize
| Python | mit | TylerKirby/cltk,diyclassics/cltk,TylerKirby/cltk,kylepjohnson/cltk,cltk/cltk,D-K-E/cltk | Add utilities file for tokenize | """ Tokenization utilities
"""
__author__ = ['Patrick J. Burns <patrick@diyclassics.org>']
__license__ = 'MIT License.'
import pickle
from abc import abstractmethod
from nltk.tokenize.punkt import PunktSentenceTokenizer, PunktTrainer
from nltk.tokenize.punkt import PunktLanguageVars
from cltk.corpus.latin.readers i... | <commit_before><commit_msg>Add utilities file for tokenize<commit_after> | """ Tokenization utilities
"""
__author__ = ['Patrick J. Burns <patrick@diyclassics.org>']
__license__ = 'MIT License.'
import pickle
from abc import abstractmethod
from nltk.tokenize.punkt import PunktSentenceTokenizer, PunktTrainer
from nltk.tokenize.punkt import PunktLanguageVars
from cltk.corpus.latin.readers i... | Add utilities file for tokenize""" Tokenization utilities
"""
__author__ = ['Patrick J. Burns <patrick@diyclassics.org>']
__license__ = 'MIT License.'
import pickle
from abc import abstractmethod
from nltk.tokenize.punkt import PunktSentenceTokenizer, PunktTrainer
from nltk.tokenize.punkt import PunktLanguageVars
f... | <commit_before><commit_msg>Add utilities file for tokenize<commit_after>""" Tokenization utilities
"""
__author__ = ['Patrick J. Burns <patrick@diyclassics.org>']
__license__ = 'MIT License.'
import pickle
from abc import abstractmethod
from nltk.tokenize.punkt import PunktSentenceTokenizer, PunktTrainer
from nltk.t... | |
5000a069b0a7ab32eefafc7acef64946450837cb | setup.py | setup.py | from setuptools import setup
setup(name='',
version='0.1',
description='',
url='',
author='',
author_email='',
packages=[''],
install_requires=[
'numpy',
'biopython'
],
zip_safe=False)
| Test install numpy and biopython for RTD | Test install numpy and biopython for RTD
| Python | mit | m4rx9/rna-pdb-tools,m4rx9/rna-pdb-tools | Test install numpy and biopython for RTD | from setuptools import setup
setup(name='',
version='0.1',
description='',
url='',
author='',
author_email='',
packages=[''],
install_requires=[
'numpy',
'biopython'
],
zip_safe=False)
| <commit_before><commit_msg>Test install numpy and biopython for RTD<commit_after> | from setuptools import setup
setup(name='',
version='0.1',
description='',
url='',
author='',
author_email='',
packages=[''],
install_requires=[
'numpy',
'biopython'
],
zip_safe=False)
| Test install numpy and biopython for RTDfrom setuptools import setup
setup(name='',
version='0.1',
description='',
url='',
author='',
author_email='',
packages=[''],
install_requires=[
'numpy',
'biopython'
],
zip_safe=False)
| <commit_before><commit_msg>Test install numpy and biopython for RTD<commit_after>from setuptools import setup
setup(name='',
version='0.1',
description='',
url='',
author='',
author_email='',
packages=[''],
install_requires=[
'numpy',
'biopython'
],
... | |
bcbf11a44074d3c027d523e97d274f7838969d65 | tests.py | tests.py | #!/usr/bin/python -O
import sqlite3
from parser import SQLITE3_DB_NAME
from random import randint, randrange
def main():
""" Ouputs a random clue (with game ID) from 10 random games for checking. """
sql = sqlite3.connect(SQLITE3_DB_NAME)
# list of random game id numbers
gids = [randint(1, 3790) for i in xran... | Test to check the db. | Test to check the db.
| Python | mit | whymarrh/jeopardy-parser,dangoldin/jeopardy-parser,dangoldin/jeopardy-parser | Test to check the db. | #!/usr/bin/python -O
import sqlite3
from parser import SQLITE3_DB_NAME
from random import randint, randrange
def main():
""" Ouputs a random clue (with game ID) from 10 random games for checking. """
sql = sqlite3.connect(SQLITE3_DB_NAME)
# list of random game id numbers
gids = [randint(1, 3790) for i in xran... | <commit_before><commit_msg>Test to check the db.<commit_after> | #!/usr/bin/python -O
import sqlite3
from parser import SQLITE3_DB_NAME
from random import randint, randrange
def main():
""" Ouputs a random clue (with game ID) from 10 random games for checking. """
sql = sqlite3.connect(SQLITE3_DB_NAME)
# list of random game id numbers
gids = [randint(1, 3790) for i in xran... | Test to check the db.#!/usr/bin/python -O
import sqlite3
from parser import SQLITE3_DB_NAME
from random import randint, randrange
def main():
""" Ouputs a random clue (with game ID) from 10 random games for checking. """
sql = sqlite3.connect(SQLITE3_DB_NAME)
# list of random game id numbers
gids = [randint(1... | <commit_before><commit_msg>Test to check the db.<commit_after>#!/usr/bin/python -O
import sqlite3
from parser import SQLITE3_DB_NAME
from random import randint, randrange
def main():
""" Ouputs a random clue (with game ID) from 10 random games for checking. """
sql = sqlite3.connect(SQLITE3_DB_NAME)
# list of r... | |
1cd9e2ececc47eddf5089596b35797ec4e7562de | test/merge_test.py | test/merge_test.py | import unittest, pyPdf, sys, os.path
from mock import Mock
SRC = os.path.join(os.path.dirname(__file__), '..', 'src')
sys.path.append(SRC)
import merge
class MockPdfReader:
def __init__(self):
self.pages = [None] * 3
def getNumPages(self):
return len(self.pages)
def getPage(self, page_num): pass
clas... | Create test class for merge function | Create test class for merge function
| Python | bsd-2-clause | mgarriott/PDFMerger | Create test class for merge function | import unittest, pyPdf, sys, os.path
from mock import Mock
SRC = os.path.join(os.path.dirname(__file__), '..', 'src')
sys.path.append(SRC)
import merge
class MockPdfReader:
def __init__(self):
self.pages = [None] * 3
def getNumPages(self):
return len(self.pages)
def getPage(self, page_num): pass
clas... | <commit_before><commit_msg>Create test class for merge function<commit_after> | import unittest, pyPdf, sys, os.path
from mock import Mock
SRC = os.path.join(os.path.dirname(__file__), '..', 'src')
sys.path.append(SRC)
import merge
class MockPdfReader:
def __init__(self):
self.pages = [None] * 3
def getNumPages(self):
return len(self.pages)
def getPage(self, page_num): pass
clas... | Create test class for merge functionimport unittest, pyPdf, sys, os.path
from mock import Mock
SRC = os.path.join(os.path.dirname(__file__), '..', 'src')
sys.path.append(SRC)
import merge
class MockPdfReader:
def __init__(self):
self.pages = [None] * 3
def getNumPages(self):
return len(self.pages)
def... | <commit_before><commit_msg>Create test class for merge function<commit_after>import unittest, pyPdf, sys, os.path
from mock import Mock
SRC = os.path.join(os.path.dirname(__file__), '..', 'src')
sys.path.append(SRC)
import merge
class MockPdfReader:
def __init__(self):
self.pages = [None] * 3
def getNumPages... | |
8ed2ef198b5b28f7d4661ea9c50e5076273b6c97 | CodeFights/alphabeticShift.py | CodeFights/alphabeticShift.py | #!/usr/local/bin/python
# Code Fights Alternating Sums Problem
def alphabeticShift(inputString):
test = [chr((ord(c) - 96) % 26 + 97) for c in inputString]
return ''.join(test)
def main():
tests = [
["crazy", "dsbaz"],
["z", "a"]
]
for t in tests:
res = alphabeticShift(t... | Solve Code Fights alphabetic shift problem | Solve Code Fights alphabetic shift problem
| Python | mit | HKuz/Test_Code | Solve Code Fights alphabetic shift problem | #!/usr/local/bin/python
# Code Fights Alternating Sums Problem
def alphabeticShift(inputString):
test = [chr((ord(c) - 96) % 26 + 97) for c in inputString]
return ''.join(test)
def main():
tests = [
["crazy", "dsbaz"],
["z", "a"]
]
for t in tests:
res = alphabeticShift(t... | <commit_before><commit_msg>Solve Code Fights alphabetic shift problem<commit_after> | #!/usr/local/bin/python
# Code Fights Alternating Sums Problem
def alphabeticShift(inputString):
test = [chr((ord(c) - 96) % 26 + 97) for c in inputString]
return ''.join(test)
def main():
tests = [
["crazy", "dsbaz"],
["z", "a"]
]
for t in tests:
res = alphabeticShift(t... | Solve Code Fights alphabetic shift problem#!/usr/local/bin/python
# Code Fights Alternating Sums Problem
def alphabeticShift(inputString):
test = [chr((ord(c) - 96) % 26 + 97) for c in inputString]
return ''.join(test)
def main():
tests = [
["crazy", "dsbaz"],
["z", "a"]
]
for t... | <commit_before><commit_msg>Solve Code Fights alphabetic shift problem<commit_after>#!/usr/local/bin/python
# Code Fights Alternating Sums Problem
def alphabeticShift(inputString):
test = [chr((ord(c) - 96) % 26 + 97) for c in inputString]
return ''.join(test)
def main():
tests = [
["crazy", "dsb... | |
a45d3def93e78d9fc26fadf27d83d5a4de44ddc4 | playserver/trackchecker.py | playserver/trackchecker.py | from threading import Timer
import track
class TrackChecker():
currentSong = ""
currentArtist = ""
currentAlbum = ""
timer = Timer(interval, checkSong)
listeners = []
@staticmethod
def checkSong():
song = track.getCurrentSong()
artist = track.getCurrentArtist()
album = track.getCurrentAlbum()
if (son... | Add TrackChecker to allow checking of changing tracks | Add TrackChecker to allow checking of changing tracks
| Python | mit | ollien/playserver,ollien/playserver,ollien/playserver | Add TrackChecker to allow checking of changing tracks | from threading import Timer
import track
class TrackChecker():
currentSong = ""
currentArtist = ""
currentAlbum = ""
timer = Timer(interval, checkSong)
listeners = []
@staticmethod
def checkSong():
song = track.getCurrentSong()
artist = track.getCurrentArtist()
album = track.getCurrentAlbum()
if (son... | <commit_before><commit_msg>Add TrackChecker to allow checking of changing tracks<commit_after> | from threading import Timer
import track
class TrackChecker():
currentSong = ""
currentArtist = ""
currentAlbum = ""
timer = Timer(interval, checkSong)
listeners = []
@staticmethod
def checkSong():
song = track.getCurrentSong()
artist = track.getCurrentArtist()
album = track.getCurrentAlbum()
if (son... | Add TrackChecker to allow checking of changing tracksfrom threading import Timer
import track
class TrackChecker():
currentSong = ""
currentArtist = ""
currentAlbum = ""
timer = Timer(interval, checkSong)
listeners = []
@staticmethod
def checkSong():
song = track.getCurrentSong()
artist = track.getCurren... | <commit_before><commit_msg>Add TrackChecker to allow checking of changing tracks<commit_after>from threading import Timer
import track
class TrackChecker():
currentSong = ""
currentArtist = ""
currentAlbum = ""
timer = Timer(interval, checkSong)
listeners = []
@staticmethod
def checkSong():
song = track.ge... | |
842064d8b4852232c19df9d176fb50a0c302d867 | update-manifest.py | update-manifest.py | #!/usr/bin/env python
import os
import re
repo = os.path.dirname(os.path.realpath(__file__))
code = 'android:versionCode="%s"'
name = 'android:versionName="%s"'
in_code = code % r'(\d+)'
in_name = name % r'([^"]+)'
new_code = None
new_name = None
for dirpath, dirnames, filenames in os.walk(repo):
for filename i... | Add super-simple automatic AndroidManifest.xml updater. | Add super-simple automatic AndroidManifest.xml updater.
| Python | apache-2.0 | msdgwzhy6/ActionBarSherlock,caobaibing/ActionBarSherlock,msdgwzhy6/ActionBarSherlock,ubreader/ActionBarSherlock,msdgwzhy6/ActionBarSherlock,mercadolibre/ActionBarSherlock,mxn21/ActionBarSherlock,vimalrajpara2006/Lib-Droid-ActionbarSherlock,zhaokidd/ActionBarSherlock,zhupengGitHub/ActionBarSherlock,SpeedSolutions/Action... | Add super-simple automatic AndroidManifest.xml updater. | #!/usr/bin/env python
import os
import re
repo = os.path.dirname(os.path.realpath(__file__))
code = 'android:versionCode="%s"'
name = 'android:versionName="%s"'
in_code = code % r'(\d+)'
in_name = name % r'([^"]+)'
new_code = None
new_name = None
for dirpath, dirnames, filenames in os.walk(repo):
for filename i... | <commit_before><commit_msg>Add super-simple automatic AndroidManifest.xml updater.<commit_after> | #!/usr/bin/env python
import os
import re
repo = os.path.dirname(os.path.realpath(__file__))
code = 'android:versionCode="%s"'
name = 'android:versionName="%s"'
in_code = code % r'(\d+)'
in_name = name % r'([^"]+)'
new_code = None
new_name = None
for dirpath, dirnames, filenames in os.walk(repo):
for filename i... | Add super-simple automatic AndroidManifest.xml updater.#!/usr/bin/env python
import os
import re
repo = os.path.dirname(os.path.realpath(__file__))
code = 'android:versionCode="%s"'
name = 'android:versionName="%s"'
in_code = code % r'(\d+)'
in_name = name % r'([^"]+)'
new_code = None
new_name = None
for dirpath, d... | <commit_before><commit_msg>Add super-simple automatic AndroidManifest.xml updater.<commit_after>#!/usr/bin/env python
import os
import re
repo = os.path.dirname(os.path.realpath(__file__))
code = 'android:versionCode="%s"'
name = 'android:versionName="%s"'
in_code = code % r'(\d+)'
in_name = name % r'([^"]+)'
new_co... | |
c94aefed7b260b7ae05c56f02253cba44f03b602 | scripts/migrate_boxfiles.py | scripts/migrate_boxfiles.py | import logging
from website.app import init_app
from website.addons.box.model import BoxFile
from scripts import utils as scripts_utils
logger = logging.getLogger(__name__)
def main():
for file in BoxFile.find():
new_path = '/' + file.path.split('/')[1]
logger.info(u'{} -> {}'.format(file.path, ... | Add a migration for box file guids | Add a migration for box file guids
| Python | apache-2.0 | brandonPurvis/osf.io,rdhyee/osf.io,mattclark/osf.io,alexschiller/osf.io,adlius/osf.io,TomHeatwole/osf.io,sbt9uc/osf.io,MerlinZhang/osf.io,petermalcolm/osf.io,mfraezz/osf.io,brandonPurvis/osf.io,aaxelb/osf.io,crcresearch/osf.io,sbt9uc/osf.io,adlius/osf.io,lyndsysimon/osf.io,ZobairAlijan/osf.io,cosenal/osf.io,laurenrever... | Add a migration for box file guids | import logging
from website.app import init_app
from website.addons.box.model import BoxFile
from scripts import utils as scripts_utils
logger = logging.getLogger(__name__)
def main():
for file in BoxFile.find():
new_path = '/' + file.path.split('/')[1]
logger.info(u'{} -> {}'.format(file.path, ... | <commit_before><commit_msg>Add a migration for box file guids<commit_after> | import logging
from website.app import init_app
from website.addons.box.model import BoxFile
from scripts import utils as scripts_utils
logger = logging.getLogger(__name__)
def main():
for file in BoxFile.find():
new_path = '/' + file.path.split('/')[1]
logger.info(u'{} -> {}'.format(file.path, ... | Add a migration for box file guidsimport logging
from website.app import init_app
from website.addons.box.model import BoxFile
from scripts import utils as scripts_utils
logger = logging.getLogger(__name__)
def main():
for file in BoxFile.find():
new_path = '/' + file.path.split('/')[1]
logger.i... | <commit_before><commit_msg>Add a migration for box file guids<commit_after>import logging
from website.app import init_app
from website.addons.box.model import BoxFile
from scripts import utils as scripts_utils
logger = logging.getLogger(__name__)
def main():
for file in BoxFile.find():
new_path = '/' +... | |
8db409d7d63135c81daa5cc556269599b362b525 | affiliate-builder/build_recipes.py | affiliate-builder/build_recipes.py | from __future__ import (division, print_function, absolute_import,
unicode_literals)
from obvci.conda_tools.build_directory import Builder
from prepare_packages import RECIPE_FOLDER, BINSTAR_CHANNEL
def main(recipe_dir=RECIPE_FOLDER):
builder = Builder(recipe_dir, BINSTAR_CHANNEL, 'main')... | Add script for building recipes | Add script for building recipes
| Python | bsd-3-clause | astropy/conda-builder-affiliated,Cadair/conda-builder-affiliated,mwcraig/conda-builder-affiliated,kbarbary/conda-builder-affiliated,zblz/conda-builder-affiliated,kbarbary/conda-builder-affiliated,cdeil/conda-builder-affiliated,cdeil/conda-builder-affiliated,astropy/conda-build-tools,bmorris3/conda-builder-affiliated,Ca... | Add script for building recipes | from __future__ import (division, print_function, absolute_import,
unicode_literals)
from obvci.conda_tools.build_directory import Builder
from prepare_packages import RECIPE_FOLDER, BINSTAR_CHANNEL
def main(recipe_dir=RECIPE_FOLDER):
builder = Builder(recipe_dir, BINSTAR_CHANNEL, 'main')... | <commit_before><commit_msg>Add script for building recipes<commit_after> | from __future__ import (division, print_function, absolute_import,
unicode_literals)
from obvci.conda_tools.build_directory import Builder
from prepare_packages import RECIPE_FOLDER, BINSTAR_CHANNEL
def main(recipe_dir=RECIPE_FOLDER):
builder = Builder(recipe_dir, BINSTAR_CHANNEL, 'main')... | Add script for building recipesfrom __future__ import (division, print_function, absolute_import,
unicode_literals)
from obvci.conda_tools.build_directory import Builder
from prepare_packages import RECIPE_FOLDER, BINSTAR_CHANNEL
def main(recipe_dir=RECIPE_FOLDER):
builder = Builder(recip... | <commit_before><commit_msg>Add script for building recipes<commit_after>from __future__ import (division, print_function, absolute_import,
unicode_literals)
from obvci.conda_tools.build_directory import Builder
from prepare_packages import RECIPE_FOLDER, BINSTAR_CHANNEL
def main(recipe_dir=RE... | |
3d04954345b15527707d119939b8f79a761e7782 | pyaml.py | pyaml.py | import yaml
sample_yaml_as_dict = '''
first_dict_key: some value
second_dict_key: some other value
'''
sample_yaml_as_list = '''
# Notice here how i don't need quotes. Read the wikipedia page for more info!
- list item 1
- list item 2
'''
my_config_dict = yaml.load(sample_yaml_as_dict)
print my_config_dict
# Will pr... | Add yaml file to python dict example | Add yaml file to python dict example | Python | mit | voidabhi/python-scripts,voidabhi/python-scripts,voidabhi/python-scripts,voidabhi/python-scripts,voidabhi/python-scripts | Add yaml file to python dict example | import yaml
sample_yaml_as_dict = '''
first_dict_key: some value
second_dict_key: some other value
'''
sample_yaml_as_list = '''
# Notice here how i don't need quotes. Read the wikipedia page for more info!
- list item 1
- list item 2
'''
my_config_dict = yaml.load(sample_yaml_as_dict)
print my_config_dict
# Will pr... | <commit_before><commit_msg>Add yaml file to python dict example<commit_after> | import yaml
sample_yaml_as_dict = '''
first_dict_key: some value
second_dict_key: some other value
'''
sample_yaml_as_list = '''
# Notice here how i don't need quotes. Read the wikipedia page for more info!
- list item 1
- list item 2
'''
my_config_dict = yaml.load(sample_yaml_as_dict)
print my_config_dict
# Will pr... | Add yaml file to python dict exampleimport yaml
sample_yaml_as_dict = '''
first_dict_key: some value
second_dict_key: some other value
'''
sample_yaml_as_list = '''
# Notice here how i don't need quotes. Read the wikipedia page for more info!
- list item 1
- list item 2
'''
my_config_dict = yaml.load(sample_yaml_as_... | <commit_before><commit_msg>Add yaml file to python dict example<commit_after>import yaml
sample_yaml_as_dict = '''
first_dict_key: some value
second_dict_key: some other value
'''
sample_yaml_as_list = '''
# Notice here how i don't need quotes. Read the wikipedia page for more info!
- list item 1
- list item 2
'''
m... | |
0c0cbd2a289a651a5247b7c378d70370b76a35c2 | app/soc/logic/helper/convert_db.py | app/soc/logic/helper/convert_db.py | #!/usr/bin/python2.5
#
# Copyright 2008 the Melange authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | Add a script to normalize user accounts | Add a script to normalize user accounts
Patch by: Sverre Rabbelier
--HG--
extra : convert_revision : svn%3A32761e7d-7263-4528-b7be-7235b26367ec/trunk%402240
| Python | apache-2.0 | rhyolight/nupic.son,rhyolight/nupic.son,rhyolight/nupic.son | Add a script to normalize user accounts
Patch by: Sverre Rabbelier
--HG--
extra : convert_revision : svn%3A32761e7d-7263-4528-b7be-7235b26367ec/trunk%402240 | #!/usr/bin/python2.5
#
# Copyright 2008 the Melange authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | <commit_before><commit_msg>Add a script to normalize user accounts
Patch by: Sverre Rabbelier
--HG--
extra : convert_revision : svn%3A32761e7d-7263-4528-b7be-7235b26367ec/trunk%402240<commit_after> | #!/usr/bin/python2.5
#
# Copyright 2008 the Melange authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | Add a script to normalize user accounts
Patch by: Sverre Rabbelier
--HG--
extra : convert_revision : svn%3A32761e7d-7263-4528-b7be-7235b26367ec/trunk%402240#!/usr/bin/python2.5
#
# Copyright 2008 the Melange authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file excep... | <commit_before><commit_msg>Add a script to normalize user accounts
Patch by: Sverre Rabbelier
--HG--
extra : convert_revision : svn%3A32761e7d-7263-4528-b7be-7235b26367ec/trunk%402240<commit_after>#!/usr/bin/python2.5
#
# Copyright 2008 the Melange authors.
#
# Licensed under the Apache License, Version 2.0 (the "Lic... | |
55d299d88358bd1e106e96b4475a268cdfe581fb | setup.py | setup.py | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 OpenStack LLC.
# 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/... | Split functions to avoid eventlet import. | Split functions to avoid eventlet import.
Some of these functions are used in setup.py. In a virtualenv
based workflow, python setup.py sdist is called to create a
tarball which is then installed into the virtualenv. These
functions need to be in a separate file so that they can be
imported by setup.py without eventle... | Python | apache-2.0 | openstack-attic/oslo.version,emonty/oslo.version | Split functions to avoid eventlet import.
Some of these functions are used in setup.py. In a virtualenv
based workflow, python setup.py sdist is called to create a
tarball which is then installed into the virtualenv. These
functions need to be in a separate file so that they can be
imported by setup.py without eventle... | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 OpenStack LLC.
# 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/... | <commit_before><commit_msg>Split functions to avoid eventlet import.
Some of these functions are used in setup.py. In a virtualenv
based workflow, python setup.py sdist is called to create a
tarball which is then installed into the virtualenv. These
functions need to be in a separate file so that they can be
imported ... | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 OpenStack LLC.
# 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/... | Split functions to avoid eventlet import.
Some of these functions are used in setup.py. In a virtualenv
based workflow, python setup.py sdist is called to create a
tarball which is then installed into the virtualenv. These
functions need to be in a separate file so that they can be
imported by setup.py without eventle... | <commit_before><commit_msg>Split functions to avoid eventlet import.
Some of these functions are used in setup.py. In a virtualenv
based workflow, python setup.py sdist is called to create a
tarball which is then installed into the virtualenv. These
functions need to be in a separate file so that they can be
imported ... | |
3b79b49b08c35a1e8d57fa9774027bdeda4e8e83 | test_transformations.py | test_transformations.py | import unittest
from transformations import drop_vowel, words_with_ck, repeat_to_single, vowel_expand, get_matched_letters_indices, l33t
class MyTestCase(unittest.TestCase):
def test_drop_one_vowel(self):
bad_words = drop_vowel('duck')
expected = ['duck', 'dck']
self.assertEquals(expected... | Add tests for transformation functions | Add tests for transformation functions
| Python | apache-2.0 | JeffSpies/nonwordlist,CenterForOpenScience/guid-filter | Add tests for transformation functions | import unittest
from transformations import drop_vowel, words_with_ck, repeat_to_single, vowel_expand, get_matched_letters_indices, l33t
class MyTestCase(unittest.TestCase):
def test_drop_one_vowel(self):
bad_words = drop_vowel('duck')
expected = ['duck', 'dck']
self.assertEquals(expected... | <commit_before><commit_msg>Add tests for transformation functions<commit_after> | import unittest
from transformations import drop_vowel, words_with_ck, repeat_to_single, vowel_expand, get_matched_letters_indices, l33t
class MyTestCase(unittest.TestCase):
def test_drop_one_vowel(self):
bad_words = drop_vowel('duck')
expected = ['duck', 'dck']
self.assertEquals(expected... | Add tests for transformation functionsimport unittest
from transformations import drop_vowel, words_with_ck, repeat_to_single, vowel_expand, get_matched_letters_indices, l33t
class MyTestCase(unittest.TestCase):
def test_drop_one_vowel(self):
bad_words = drop_vowel('duck')
expected = ['duck', 'dc... | <commit_before><commit_msg>Add tests for transformation functions<commit_after>import unittest
from transformations import drop_vowel, words_with_ck, repeat_to_single, vowel_expand, get_matched_letters_indices, l33t
class MyTestCase(unittest.TestCase):
def test_drop_one_vowel(self):
bad_words = drop_vowe... | |
7a9772952b5a6b39986b9a705ac7bbaf2810de91 | python/prm_fhir/extractors.py | python/prm_fhir/extractors.py | """
### CODE OWNERS: Shea Parkes
### OBJECTIVE:
Extraction methods for relevant items.
### DEVELOPER NOTES:
<none>
"""
import typing
from collections import OrderedDict
from fhirclient.client import FHIRClient
# =============================================================================
# LIBRARIES, LOCATION... | Put up a structure to extraction library. | Put up a structure to extraction library.
Do this so we have a skelton to fill in.
| Python | mit | IndyActuaries/epic-fhir,IndyActuaries/epic-fhir | Put up a structure to extraction library.
Do this so we have a skelton to fill in. | """
### CODE OWNERS: Shea Parkes
### OBJECTIVE:
Extraction methods for relevant items.
### DEVELOPER NOTES:
<none>
"""
import typing
from collections import OrderedDict
from fhirclient.client import FHIRClient
# =============================================================================
# LIBRARIES, LOCATION... | <commit_before><commit_msg>Put up a structure to extraction library.
Do this so we have a skelton to fill in.<commit_after> | """
### CODE OWNERS: Shea Parkes
### OBJECTIVE:
Extraction methods for relevant items.
### DEVELOPER NOTES:
<none>
"""
import typing
from collections import OrderedDict
from fhirclient.client import FHIRClient
# =============================================================================
# LIBRARIES, LOCATION... | Put up a structure to extraction library.
Do this so we have a skelton to fill in."""
### CODE OWNERS: Shea Parkes
### OBJECTIVE:
Extraction methods for relevant items.
### DEVELOPER NOTES:
<none>
"""
import typing
from collections import OrderedDict
from fhirclient.client import FHIRClient
# ================... | <commit_before><commit_msg>Put up a structure to extraction library.
Do this so we have a skelton to fill in.<commit_after>"""
### CODE OWNERS: Shea Parkes
### OBJECTIVE:
Extraction methods for relevant items.
### DEVELOPER NOTES:
<none>
"""
import typing
from collections import OrderedDict
from fhirclient.cli... | |
847f38e75e4ec79dbdd10a9627ec6b5a15ba2e41 | tests/seat_map_test.py | tests/seat_map_test.py | import unittest
import datetime
import json
import sys
sys.path.append('..')
import sabre_dev_studio
import sabre_dev_studio.sabre_exceptions as sabre_exceptions
'''
requires config.json in the same directory for api authentication
{
"sabre_client_id": -----,
"sabre_client_secret": -----
}
'''
class TestBasicSeat... | Add tests for seat map | Add tests for seat map
| Python | mit | Jamil/sabre_dev_studio | Add tests for seat map | import unittest
import datetime
import json
import sys
sys.path.append('..')
import sabre_dev_studio
import sabre_dev_studio.sabre_exceptions as sabre_exceptions
'''
requires config.json in the same directory for api authentication
{
"sabre_client_id": -----,
"sabre_client_secret": -----
}
'''
class TestBasicSeat... | <commit_before><commit_msg>Add tests for seat map<commit_after> | import unittest
import datetime
import json
import sys
sys.path.append('..')
import sabre_dev_studio
import sabre_dev_studio.sabre_exceptions as sabre_exceptions
'''
requires config.json in the same directory for api authentication
{
"sabre_client_id": -----,
"sabre_client_secret": -----
}
'''
class TestBasicSeat... | Add tests for seat mapimport unittest
import datetime
import json
import sys
sys.path.append('..')
import sabre_dev_studio
import sabre_dev_studio.sabre_exceptions as sabre_exceptions
'''
requires config.json in the same directory for api authentication
{
"sabre_client_id": -----,
"sabre_client_secret": -----
}
'... | <commit_before><commit_msg>Add tests for seat map<commit_after>import unittest
import datetime
import json
import sys
sys.path.append('..')
import sabre_dev_studio
import sabre_dev_studio.sabre_exceptions as sabre_exceptions
'''
requires config.json in the same directory for api authentication
{
"sabre_client_id": ... | |
1455d5109efb64aa1c2579a97c0d84a60da22708 | EDMScripts/test_rotator.py | EDMScripts/test_rotator.py | # Import a whole load of stuff
from System.IO import *
from System.Drawing import *
from System.Runtime.Remoting import *
from System.Threading import *
from System.Windows.Forms import *
from System.Xml.Serialization import *
from System import *
from Analysis.EDM import *
from DAQ.Environment import *
fro... | Add a script to test the Thorlabs polarization rotator. | Add a script to test the Thorlabs polarization rotator.
| Python | mit | ColdMatter/EDMSuite,jstammers/EDMSuite,jstammers/EDMSuite,jstammers/EDMSuite,ColdMatter/EDMSuite,ColdMatter/EDMSuite,Stok/EDMSuite,Stok/EDMSuite,jstammers/EDMSuite,jstammers/EDMSuite,ColdMatter/EDMSuite | Add a script to test the Thorlabs polarization rotator. | # Import a whole load of stuff
from System.IO import *
from System.Drawing import *
from System.Runtime.Remoting import *
from System.Threading import *
from System.Windows.Forms import *
from System.Xml.Serialization import *
from System import *
from Analysis.EDM import *
from DAQ.Environment import *
fro... | <commit_before><commit_msg>Add a script to test the Thorlabs polarization rotator.<commit_after> | # Import a whole load of stuff
from System.IO import *
from System.Drawing import *
from System.Runtime.Remoting import *
from System.Threading import *
from System.Windows.Forms import *
from System.Xml.Serialization import *
from System import *
from Analysis.EDM import *
from DAQ.Environment import *
fro... | Add a script to test the Thorlabs polarization rotator.# Import a whole load of stuff
from System.IO import *
from System.Drawing import *
from System.Runtime.Remoting import *
from System.Threading import *
from System.Windows.Forms import *
from System.Xml.Serialization import *
from System import *
from An... | <commit_before><commit_msg>Add a script to test the Thorlabs polarization rotator.<commit_after># Import a whole load of stuff
from System.IO import *
from System.Drawing import *
from System.Runtime.Remoting import *
from System.Threading import *
from System.Windows.Forms import *
from System.Xml.Serialization ... | |
8b4e49f5aae691a5b3f3b77190356f70f9f23bb8 | src/project/word2vec_corpus.py | src/project/word2vec_corpus.py | import sys
from os.path import isdir, isfile
from corpus import Corpus
class W2VCorpus(Corpus):
def __init__(self, dict_loc, vec_loc):
Corpus.__init__(self)
Corpus.load(self, dict_loc, vec_loc)
# Set up for Word-to-Vec
return
def main():
if len(sys.argv) > 2 and isdir(sys.ar... | Add basic framework for W2V | Add basic framework for W2V
| Python | mit | PinPinIre/Final-Year-Project,PinPinIre/Final-Year-Project,PinPinIre/Final-Year-Project | Add basic framework for W2V | import sys
from os.path import isdir, isfile
from corpus import Corpus
class W2VCorpus(Corpus):
def __init__(self, dict_loc, vec_loc):
Corpus.__init__(self)
Corpus.load(self, dict_loc, vec_loc)
# Set up for Word-to-Vec
return
def main():
if len(sys.argv) > 2 and isdir(sys.ar... | <commit_before><commit_msg>Add basic framework for W2V<commit_after> | import sys
from os.path import isdir, isfile
from corpus import Corpus
class W2VCorpus(Corpus):
def __init__(self, dict_loc, vec_loc):
Corpus.__init__(self)
Corpus.load(self, dict_loc, vec_loc)
# Set up for Word-to-Vec
return
def main():
if len(sys.argv) > 2 and isdir(sys.ar... | Add basic framework for W2Vimport sys
from os.path import isdir, isfile
from corpus import Corpus
class W2VCorpus(Corpus):
def __init__(self, dict_loc, vec_loc):
Corpus.__init__(self)
Corpus.load(self, dict_loc, vec_loc)
# Set up for Word-to-Vec
return
def main():
if len(sys... | <commit_before><commit_msg>Add basic framework for W2V<commit_after>import sys
from os.path import isdir, isfile
from corpus import Corpus
class W2VCorpus(Corpus):
def __init__(self, dict_loc, vec_loc):
Corpus.__init__(self)
Corpus.load(self, dict_loc, vec_loc)
# Set up for Word-to-Vec
... | |
8a3b9c2b3a25bda85cf3d961758a986dbdc19084 | tests/test_advection.py | tests/test_advection.py | from parcels import Grid, Particle, JITParticle, AdvectionRK4, Geographic, GeographicPolar
import numpy as np
import pytest
from datetime import timedelta as delta
ptype = {'scipy': Particle, 'jit': JITParticle}
@pytest.fixture
def lon(xdim=200):
return np.linspace(-170, 170, xdim, dtype=np.float32)
@pytest.f... | Add a set of advection tests for meridional and zonal advection | Tests: Add a set of advection tests for meridional and zonal advection
| Python | mit | OceanPARCELS/parcels,OceanPARCELS/parcels | Tests: Add a set of advection tests for meridional and zonal advection | from parcels import Grid, Particle, JITParticle, AdvectionRK4, Geographic, GeographicPolar
import numpy as np
import pytest
from datetime import timedelta as delta
ptype = {'scipy': Particle, 'jit': JITParticle}
@pytest.fixture
def lon(xdim=200):
return np.linspace(-170, 170, xdim, dtype=np.float32)
@pytest.f... | <commit_before><commit_msg>Tests: Add a set of advection tests for meridional and zonal advection<commit_after> | from parcels import Grid, Particle, JITParticle, AdvectionRK4, Geographic, GeographicPolar
import numpy as np
import pytest
from datetime import timedelta as delta
ptype = {'scipy': Particle, 'jit': JITParticle}
@pytest.fixture
def lon(xdim=200):
return np.linspace(-170, 170, xdim, dtype=np.float32)
@pytest.f... | Tests: Add a set of advection tests for meridional and zonal advectionfrom parcels import Grid, Particle, JITParticle, AdvectionRK4, Geographic, GeographicPolar
import numpy as np
import pytest
from datetime import timedelta as delta
ptype = {'scipy': Particle, 'jit': JITParticle}
@pytest.fixture
def lon(xdim=200):... | <commit_before><commit_msg>Tests: Add a set of advection tests for meridional and zonal advection<commit_after>from parcels import Grid, Particle, JITParticle, AdvectionRK4, Geographic, GeographicPolar
import numpy as np
import pytest
from datetime import timedelta as delta
ptype = {'scipy': Particle, 'jit': JITParti... | |
ff0fa3d3aaa7de147571330a16895befb272440a | mongoshell.py | mongoshell.py | #! /usr/bin/env python
from os import environ
from subprocess import check_call
from urlparse import urlparse
if 'MONGOLAB_URI' in environ:
print 'Using', environ['MONGOLAB_URI']
url = urlparse(environ['MONGOLAB_URI'])
cmd = 'mongo -u %s -p %s %s:%d/%s' % (url.username,
... | Add script to run a mongo shell in the MongoLab environment | Add script to run a mongo shell in the MongoLab environment
| Python | bsd-3-clause | taarifa/taarifa_backend,taarifa/taarifa_backend,taarifa/taarifa_backend,taarifa/taarifa_backend | Add script to run a mongo shell in the MongoLab environment | #! /usr/bin/env python
from os import environ
from subprocess import check_call
from urlparse import urlparse
if 'MONGOLAB_URI' in environ:
print 'Using', environ['MONGOLAB_URI']
url = urlparse(environ['MONGOLAB_URI'])
cmd = 'mongo -u %s -p %s %s:%d/%s' % (url.username,
... | <commit_before><commit_msg>Add script to run a mongo shell in the MongoLab environment<commit_after> | #! /usr/bin/env python
from os import environ
from subprocess import check_call
from urlparse import urlparse
if 'MONGOLAB_URI' in environ:
print 'Using', environ['MONGOLAB_URI']
url = urlparse(environ['MONGOLAB_URI'])
cmd = 'mongo -u %s -p %s %s:%d/%s' % (url.username,
... | Add script to run a mongo shell in the MongoLab environment#! /usr/bin/env python
from os import environ
from subprocess import check_call
from urlparse import urlparse
if 'MONGOLAB_URI' in environ:
print 'Using', environ['MONGOLAB_URI']
url = urlparse(environ['MONGOLAB_URI'])
cmd = 'mongo -u %s -p %s %s:... | <commit_before><commit_msg>Add script to run a mongo shell in the MongoLab environment<commit_after>#! /usr/bin/env python
from os import environ
from subprocess import check_call
from urlparse import urlparse
if 'MONGOLAB_URI' in environ:
print 'Using', environ['MONGOLAB_URI']
url = urlparse(environ['MONGOLA... | |
c8f3e1149d8fa7ed4e402fc655cb13758f7f28c7 | services/comprehension/main-api/comprehension/management/commands/pre_filter_responses.py | services/comprehension/main-api/comprehension/management/commands/pre_filter_responses.py | import csv
from django.core.management.base import BaseCommand
from ...views.plagiarism import PlagiarismFeedbackView
class Command(BaseCommand):
help = 'Parses a CSV for feedback records'
def add_arguments(self, parser):
parser.add_argument('passage_source', metavar='PASSAGE_SOURCE',
... | Add a command to filter responses for plagiarism | Add a command to filter responses for plagiarism
| Python | agpl-3.0 | empirical-org/Empirical-Core,empirical-org/Empirical-Core,empirical-org/Empirical-Core,empirical-org/Empirical-Core,empirical-org/Empirical-Core,empirical-org/Empirical-Core,empirical-org/Empirical-Core | Add a command to filter responses for plagiarism | import csv
from django.core.management.base import BaseCommand
from ...views.plagiarism import PlagiarismFeedbackView
class Command(BaseCommand):
help = 'Parses a CSV for feedback records'
def add_arguments(self, parser):
parser.add_argument('passage_source', metavar='PASSAGE_SOURCE',
... | <commit_before><commit_msg>Add a command to filter responses for plagiarism<commit_after> | import csv
from django.core.management.base import BaseCommand
from ...views.plagiarism import PlagiarismFeedbackView
class Command(BaseCommand):
help = 'Parses a CSV for feedback records'
def add_arguments(self, parser):
parser.add_argument('passage_source', metavar='PASSAGE_SOURCE',
... | Add a command to filter responses for plagiarismimport csv
from django.core.management.base import BaseCommand
from ...views.plagiarism import PlagiarismFeedbackView
class Command(BaseCommand):
help = 'Parses a CSV for feedback records'
def add_arguments(self, parser):
parser.add_argument('passage_... | <commit_before><commit_msg>Add a command to filter responses for plagiarism<commit_after>import csv
from django.core.management.base import BaseCommand
from ...views.plagiarism import PlagiarismFeedbackView
class Command(BaseCommand):
help = 'Parses a CSV for feedback records'
def add_arguments(self, parse... | |
60e31ba20a596346031396fcd34796dc96f9ffdf | kolibri/content/migrations/0009_auto_20180410_1139.py | kolibri/content/migrations/0009_auto_20180410_1139.py | # -*- coding: utf-8 -*-
# Generated by Django 1.11.11 on 2018-04-10 18:39
from __future__ import unicode_literals
from django.db import migrations
from django.db import models
class Migration(migrations.Migration):
dependencies = [
('content', '0008_contentnode_coach_content'),
]
operations = [... | Add epub to file preset and localfile extension | Add epub to file preset and localfile extension
| Python | mit | lyw07/kolibri,DXCanas/kolibri,mrpau/kolibri,benjaoming/kolibri,learningequality/kolibri,indirectlylit/kolibri,benjaoming/kolibri,learningequality/kolibri,jonboiser/kolibri,learningequality/kolibri,indirectlylit/kolibri,jonboiser/kolibri,indirectlylit/kolibri,mrpau/kolibri,DXCanas/kolibri,indirectlylit/kolibri,jonboiser... | Add epub to file preset and localfile extension | # -*- coding: utf-8 -*-
# Generated by Django 1.11.11 on 2018-04-10 18:39
from __future__ import unicode_literals
from django.db import migrations
from django.db import models
class Migration(migrations.Migration):
dependencies = [
('content', '0008_contentnode_coach_content'),
]
operations = [... | <commit_before><commit_msg>Add epub to file preset and localfile extension<commit_after> | # -*- coding: utf-8 -*-
# Generated by Django 1.11.11 on 2018-04-10 18:39
from __future__ import unicode_literals
from django.db import migrations
from django.db import models
class Migration(migrations.Migration):
dependencies = [
('content', '0008_contentnode_coach_content'),
]
operations = [... | Add epub to file preset and localfile extension# -*- coding: utf-8 -*-
# Generated by Django 1.11.11 on 2018-04-10 18:39
from __future__ import unicode_literals
from django.db import migrations
from django.db import models
class Migration(migrations.Migration):
dependencies = [
('content', '0008_content... | <commit_before><commit_msg>Add epub to file preset and localfile extension<commit_after># -*- coding: utf-8 -*-
# Generated by Django 1.11.11 on 2018-04-10 18:39
from __future__ import unicode_literals
from django.db import migrations
from django.db import models
class Migration(migrations.Migration):
dependenc... | |
0add6b09c268b87a9f7007f80934418cbdee6d2c | ci/generate_universe_resource.py | ci/generate_universe_resource.py | #!/usr/bin/env python3
# Usage example:
# ./generate_universe_resource.py dcos-core-cli 1.12-patch.2
import json
import sys
import hashlib as hash
import requests
plugin_name = sys.argv[1]
plugin_version = sys.argv[2]
resource = {
"cli": {
"binaries": {}
}
}
for platform in ['linux', 'darwin', 'windo... | Add a script to generate a universe resource | Add a script to generate a universe resource
The generate_universe_resource.py script can be used to generate
resource files for universe. It takes as argument a plugin name and a
version and uses them to download the plugins from their canonical URLs
and generate sha256 checksums accordingly.
https://jira.mesosphere... | Python | apache-2.0 | kensipe/dcos-cli,kensipe/dcos-cli,dcos/dcos-cli,dcos/dcos-cli,dcos/dcos-cli,dcos/dcos-cli,dcos/dcos-cli,kensipe/dcos-cli,kensipe/dcos-cli,kensipe/dcos-cli | Add a script to generate a universe resource
The generate_universe_resource.py script can be used to generate
resource files for universe. It takes as argument a plugin name and a
version and uses them to download the plugins from their canonical URLs
and generate sha256 checksums accordingly.
https://jira.mesosphere... | #!/usr/bin/env python3
# Usage example:
# ./generate_universe_resource.py dcos-core-cli 1.12-patch.2
import json
import sys
import hashlib as hash
import requests
plugin_name = sys.argv[1]
plugin_version = sys.argv[2]
resource = {
"cli": {
"binaries": {}
}
}
for platform in ['linux', 'darwin', 'windo... | <commit_before><commit_msg>Add a script to generate a universe resource
The generate_universe_resource.py script can be used to generate
resource files for universe. It takes as argument a plugin name and a
version and uses them to download the plugins from their canonical URLs
and generate sha256 checksums accordingl... | #!/usr/bin/env python3
# Usage example:
# ./generate_universe_resource.py dcos-core-cli 1.12-patch.2
import json
import sys
import hashlib as hash
import requests
plugin_name = sys.argv[1]
plugin_version = sys.argv[2]
resource = {
"cli": {
"binaries": {}
}
}
for platform in ['linux', 'darwin', 'windo... | Add a script to generate a universe resource
The generate_universe_resource.py script can be used to generate
resource files for universe. It takes as argument a plugin name and a
version and uses them to download the plugins from their canonical URLs
and generate sha256 checksums accordingly.
https://jira.mesosphere... | <commit_before><commit_msg>Add a script to generate a universe resource
The generate_universe_resource.py script can be used to generate
resource files for universe. It takes as argument a plugin name and a
version and uses them to download the plugins from their canonical URLs
and generate sha256 checksums accordingl... | |
5b1a84a73abc6fc95d453cfbb78cf58bfc9c8310 | setup.py | setup.py | from __future__ import print_function
from os import sys, path
try:
from skbuild import setup
except ImportError:
print('scikit-build is required to build from source.', file=sys.stderr)
print('Please run:', file=sys.stderr)
print('', file=sys.stderr)
print(' python -m pip install scikit-build')
... | Add initial Python package configuration | ENH: Add initial Python package configuration
| Python | apache-2.0 | InsightSoftwareConsortium/ITKTextureFeatures,InsightSoftwareConsortium/ITKTextureFeatures | ENH: Add initial Python package configuration | from __future__ import print_function
from os import sys, path
try:
from skbuild import setup
except ImportError:
print('scikit-build is required to build from source.', file=sys.stderr)
print('Please run:', file=sys.stderr)
print('', file=sys.stderr)
print(' python -m pip install scikit-build')
... | <commit_before><commit_msg>ENH: Add initial Python package configuration<commit_after> | from __future__ import print_function
from os import sys, path
try:
from skbuild import setup
except ImportError:
print('scikit-build is required to build from source.', file=sys.stderr)
print('Please run:', file=sys.stderr)
print('', file=sys.stderr)
print(' python -m pip install scikit-build')
... | ENH: Add initial Python package configurationfrom __future__ import print_function
from os import sys, path
try:
from skbuild import setup
except ImportError:
print('scikit-build is required to build from source.', file=sys.stderr)
print('Please run:', file=sys.stderr)
print('', file=sys.stderr)
pr... | <commit_before><commit_msg>ENH: Add initial Python package configuration<commit_after>from __future__ import print_function
from os import sys, path
try:
from skbuild import setup
except ImportError:
print('scikit-build is required to build from source.', file=sys.stderr)
print('Please run:', file=sys.stde... | |
3bf5f09f61cfe3e1bd4d8c736a014f05c1bd940e | tests/test_sqlcache.py | tests/test_sqlcache.py | from botbot import sqlcache
import os
from itertools import combinations
from string import ascii_letters
def get_dbpath():
return os.path.join('.', 'test.db')
def test_FileDatabase_constructor(tmpdir):
prev = tmpdir.chdir()
f = sqlcache.FileDatabase(get_dbpath())
assert f
prev.chdir()
def test... | Add new tests for sqlcache.py | Add new tests for sqlcache.py
| Python | mit | jackstanek/BotBot,jackstanek/BotBot | Add new tests for sqlcache.py | from botbot import sqlcache
import os
from itertools import combinations
from string import ascii_letters
def get_dbpath():
return os.path.join('.', 'test.db')
def test_FileDatabase_constructor(tmpdir):
prev = tmpdir.chdir()
f = sqlcache.FileDatabase(get_dbpath())
assert f
prev.chdir()
def test... | <commit_before><commit_msg>Add new tests for sqlcache.py<commit_after> | from botbot import sqlcache
import os
from itertools import combinations
from string import ascii_letters
def get_dbpath():
return os.path.join('.', 'test.db')
def test_FileDatabase_constructor(tmpdir):
prev = tmpdir.chdir()
f = sqlcache.FileDatabase(get_dbpath())
assert f
prev.chdir()
def test... | Add new tests for sqlcache.pyfrom botbot import sqlcache
import os
from itertools import combinations
from string import ascii_letters
def get_dbpath():
return os.path.join('.', 'test.db')
def test_FileDatabase_constructor(tmpdir):
prev = tmpdir.chdir()
f = sqlcache.FileDatabase(get_dbpath())
assert... | <commit_before><commit_msg>Add new tests for sqlcache.py<commit_after>from botbot import sqlcache
import os
from itertools import combinations
from string import ascii_letters
def get_dbpath():
return os.path.join('.', 'test.db')
def test_FileDatabase_constructor(tmpdir):
prev = tmpdir.chdir()
f = sqlca... | |
269a40987bcda02109ea9b53157056c43ff6ab58 | demo_zinnia_ckeditor/urls.py | demo_zinnia_ckeditor/urls.py | """Urls for the zinnia-ckeditor demo"""
from django.conf import settings
from django.contrib import admin
from django.conf.urls import url
from django.conf.urls import include
from django.conf.urls import patterns
from django.views.generic.base import RedirectView
from zinnia.sitemaps import TagSitemap
from zinnia.sit... | Add URLs for demo project | Add URLs for demo project
| Python | bsd-3-clause | django-blog-zinnia/zinnia-wysiwyg-ckeditor | Add URLs for demo project | """Urls for the zinnia-ckeditor demo"""
from django.conf import settings
from django.contrib import admin
from django.conf.urls import url
from django.conf.urls import include
from django.conf.urls import patterns
from django.views.generic.base import RedirectView
from zinnia.sitemaps import TagSitemap
from zinnia.sit... | <commit_before><commit_msg>Add URLs for demo project<commit_after> | """Urls for the zinnia-ckeditor demo"""
from django.conf import settings
from django.contrib import admin
from django.conf.urls import url
from django.conf.urls import include
from django.conf.urls import patterns
from django.views.generic.base import RedirectView
from zinnia.sitemaps import TagSitemap
from zinnia.sit... | Add URLs for demo project"""Urls for the zinnia-ckeditor demo"""
from django.conf import settings
from django.contrib import admin
from django.conf.urls import url
from django.conf.urls import include
from django.conf.urls import patterns
from django.views.generic.base import RedirectView
from zinnia.sitemaps import T... | <commit_before><commit_msg>Add URLs for demo project<commit_after>"""Urls for the zinnia-ckeditor demo"""
from django.conf import settings
from django.contrib import admin
from django.conf.urls import url
from django.conf.urls import include
from django.conf.urls import patterns
from django.views.generic.base import Re... | |
7ee31b444556a70fb1d6fca27545ad1fbc317347 | paasta_tools/contrib/add_to_deploy_queue.py | paasta_tools/contrib/add_to_deploy_queue.py | #!/usr/bin/env python
# Copyright 2015-2020 Yelp Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | Add script to add an arbitrary service instance to the deploy_queue | Add script to add an arbitrary service instance to the deploy_queue
| Python | apache-2.0 | Yelp/paasta,Yelp/paasta | Add script to add an arbitrary service instance to the deploy_queue | #!/usr/bin/env python
# Copyright 2015-2020 Yelp Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | <commit_before><commit_msg>Add script to add an arbitrary service instance to the deploy_queue<commit_after> | #!/usr/bin/env python
# Copyright 2015-2020 Yelp Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | Add script to add an arbitrary service instance to the deploy_queue#!/usr/bin/env python
# Copyright 2015-2020 Yelp Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apa... | <commit_before><commit_msg>Add script to add an arbitrary service instance to the deploy_queue<commit_after>#!/usr/bin/env python
# Copyright 2015-2020 Yelp Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy... | |
d2ff3f0905ded1dcbffd7ebd9cada423d44767d6 | py/4sum-ii.py | py/4sum-ii.py | from collections import Counter
class Solution(object):
def fourSumCount(self, A, B, C, D):
"""
:type A: List[int]
:type B: List[int]
:type C: List[int]
:type D: List[int]
:rtype: int
"""
count1 = Counter()
for a in A:
for b in B:
... | Add py solution for 454. 4Sum II | Add py solution for 454. 4Sum II
454. 4Sum II: https://leetcode.com/problems/4sum-ii/
| Python | apache-2.0 | ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode | Add py solution for 454. 4Sum II
454. 4Sum II: https://leetcode.com/problems/4sum-ii/ | from collections import Counter
class Solution(object):
def fourSumCount(self, A, B, C, D):
"""
:type A: List[int]
:type B: List[int]
:type C: List[int]
:type D: List[int]
:rtype: int
"""
count1 = Counter()
for a in A:
for b in B:
... | <commit_before><commit_msg>Add py solution for 454. 4Sum II
454. 4Sum II: https://leetcode.com/problems/4sum-ii/<commit_after> | from collections import Counter
class Solution(object):
def fourSumCount(self, A, B, C, D):
"""
:type A: List[int]
:type B: List[int]
:type C: List[int]
:type D: List[int]
:rtype: int
"""
count1 = Counter()
for a in A:
for b in B:
... | Add py solution for 454. 4Sum II
454. 4Sum II: https://leetcode.com/problems/4sum-ii/from collections import Counter
class Solution(object):
def fourSumCount(self, A, B, C, D):
"""
:type A: List[int]
:type B: List[int]
:type C: List[int]
:type D: List[int]
:rtype: in... | <commit_before><commit_msg>Add py solution for 454. 4Sum II
454. 4Sum II: https://leetcode.com/problems/4sum-ii/<commit_after>from collections import Counter
class Solution(object):
def fourSumCount(self, A, B, C, D):
"""
:type A: List[int]
:type B: List[int]
:type C: List[int]
... | |
a807dcac9c69ec6769f233f9ea8be3dfd06f43c4 | elections/kenya/data/update_csv.py | elections/kenya/data/update_csv.py | #!/usr/bin/env python
import requests
URLS = (
('2017_candidates_presidency.csv',
'https://docs.google.com/a/mysociety.org/spreadsheets/d/10RBG4fIluYn2jBgCRBBQ--6yHTtppYrB2ef-zpmVxhE/export?format=csv'),
('2017_candidates_senate.csv',
'https://docs.google.com/a/mysociety.org/spreadsheets/d/1x3_otOE... | Add a script for updating the CSV files | Add a script for updating the CSV files
| Python | agpl-3.0 | mysociety/yournextmp-popit,mysociety/yournextmp-popit,mysociety/yournextmp-popit,mysociety/yournextrepresentative,mysociety/yournextrepresentative,mysociety/yournextrepresentative,mysociety/yournextmp-popit,mysociety/yournextmp-popit,mysociety/yournextrepresentative,mysociety/yournextrepresentative | Add a script for updating the CSV files | #!/usr/bin/env python
import requests
URLS = (
('2017_candidates_presidency.csv',
'https://docs.google.com/a/mysociety.org/spreadsheets/d/10RBG4fIluYn2jBgCRBBQ--6yHTtppYrB2ef-zpmVxhE/export?format=csv'),
('2017_candidates_senate.csv',
'https://docs.google.com/a/mysociety.org/spreadsheets/d/1x3_otOE... | <commit_before><commit_msg>Add a script for updating the CSV files<commit_after> | #!/usr/bin/env python
import requests
URLS = (
('2017_candidates_presidency.csv',
'https://docs.google.com/a/mysociety.org/spreadsheets/d/10RBG4fIluYn2jBgCRBBQ--6yHTtppYrB2ef-zpmVxhE/export?format=csv'),
('2017_candidates_senate.csv',
'https://docs.google.com/a/mysociety.org/spreadsheets/d/1x3_otOE... | Add a script for updating the CSV files#!/usr/bin/env python
import requests
URLS = (
('2017_candidates_presidency.csv',
'https://docs.google.com/a/mysociety.org/spreadsheets/d/10RBG4fIluYn2jBgCRBBQ--6yHTtppYrB2ef-zpmVxhE/export?format=csv'),
('2017_candidates_senate.csv',
'https://docs.google.com/... | <commit_before><commit_msg>Add a script for updating the CSV files<commit_after>#!/usr/bin/env python
import requests
URLS = (
('2017_candidates_presidency.csv',
'https://docs.google.com/a/mysociety.org/spreadsheets/d/10RBG4fIluYn2jBgCRBBQ--6yHTtppYrB2ef-zpmVxhE/export?format=csv'),
('2017_candidates_se... | |
2d1dcb334a8fec45f3abe11c13d1649a18e3033d | shuup/core/migrations/0087_fix_attribute_migration.py | shuup/core/migrations/0087_fix_attribute_migration.py | # Generated by Django 2.2.19 on 2021-05-03 20:51
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('shuup', '0086_attribute_choices'),
]
operations = [
migrations.AlterField(
model_name='attribute',
name='max_choice... | Make sure there is no pending migrations | Make sure there is no pending migrations
| Python | agpl-3.0 | shoopio/shoop,shoopio/shoop,shoopio/shoop | Make sure there is no pending migrations | # Generated by Django 2.2.19 on 2021-05-03 20:51
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('shuup', '0086_attribute_choices'),
]
operations = [
migrations.AlterField(
model_name='attribute',
name='max_choice... | <commit_before><commit_msg>Make sure there is no pending migrations<commit_after> | # Generated by Django 2.2.19 on 2021-05-03 20:51
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('shuup', '0086_attribute_choices'),
]
operations = [
migrations.AlterField(
model_name='attribute',
name='max_choice... | Make sure there is no pending migrations# Generated by Django 2.2.19 on 2021-05-03 20:51
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('shuup', '0086_attribute_choices'),
]
operations = [
migrations.AlterField(
model_name='... | <commit_before><commit_msg>Make sure there is no pending migrations<commit_after># Generated by Django 2.2.19 on 2021-05-03 20:51
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('shuup', '0086_attribute_choices'),
]
operations = [
migrat... | |
ee0cda1dea775e58e5416b57fc0d96114f075128 | tests/unit/test_repr.py | tests/unit/test_repr.py | from butter.eventfd import Eventfd
from butter.fanotify import Fanotify
from butter.inotify import Inotify
from butter.signalfd import Signalfd
from butter.timerfd import Timerfd
import pytest
@pytest.fixture(params=[Eventfd, Fanotify, Inotify, Signalfd, Timerfd])
def obj(request):
Obj = request.param
o = Obj... | Test the repr() of object | Test the repr() of object
| Python | bsd-3-clause | wdv4758h/butter,dasSOZO/python-butter | Test the repr() of object | from butter.eventfd import Eventfd
from butter.fanotify import Fanotify
from butter.inotify import Inotify
from butter.signalfd import Signalfd
from butter.timerfd import Timerfd
import pytest
@pytest.fixture(params=[Eventfd, Fanotify, Inotify, Signalfd, Timerfd])
def obj(request):
Obj = request.param
o = Obj... | <commit_before><commit_msg>Test the repr() of object<commit_after> | from butter.eventfd import Eventfd
from butter.fanotify import Fanotify
from butter.inotify import Inotify
from butter.signalfd import Signalfd
from butter.timerfd import Timerfd
import pytest
@pytest.fixture(params=[Eventfd, Fanotify, Inotify, Signalfd, Timerfd])
def obj(request):
Obj = request.param
o = Obj... | Test the repr() of objectfrom butter.eventfd import Eventfd
from butter.fanotify import Fanotify
from butter.inotify import Inotify
from butter.signalfd import Signalfd
from butter.timerfd import Timerfd
import pytest
@pytest.fixture(params=[Eventfd, Fanotify, Inotify, Signalfd, Timerfd])
def obj(request):
Obj = ... | <commit_before><commit_msg>Test the repr() of object<commit_after>from butter.eventfd import Eventfd
from butter.fanotify import Fanotify
from butter.inotify import Inotify
from butter.signalfd import Signalfd
from butter.timerfd import Timerfd
import pytest
@pytest.fixture(params=[Eventfd, Fanotify, Inotify, Signalf... | |
28af24002e410c27d5d09c301bd8b8b6bf4683dd | meanrecipes/sources.py | meanrecipes/sources.py | #!/usr/bin/env python3
import random
class Recipe:
'''
Represents an individual recipe, made up of the following attributes:
* title
A string containing a human-readable title or name for the recipe.
* ingredients
An iterable of tuples (quantity, unit, name) describing the ingredi... | Add recipe & source base classes and fake recipe generator | Add recipe & source base classes and fake recipe generator
| Python | bsd-2-clause | kkelk/MeanRecipes,kkelk/MeanRecipes,kkelk/MeanRecipes,kkelk/MeanRecipes | Add recipe & source base classes and fake recipe generator | #!/usr/bin/env python3
import random
class Recipe:
'''
Represents an individual recipe, made up of the following attributes:
* title
A string containing a human-readable title or name for the recipe.
* ingredients
An iterable of tuples (quantity, unit, name) describing the ingredi... | <commit_before><commit_msg>Add recipe & source base classes and fake recipe generator<commit_after> | #!/usr/bin/env python3
import random
class Recipe:
'''
Represents an individual recipe, made up of the following attributes:
* title
A string containing a human-readable title or name for the recipe.
* ingredients
An iterable of tuples (quantity, unit, name) describing the ingredi... | Add recipe & source base classes and fake recipe generator#!/usr/bin/env python3
import random
class Recipe:
'''
Represents an individual recipe, made up of the following attributes:
* title
A string containing a human-readable title or name for the recipe.
* ingredients
An iterab... | <commit_before><commit_msg>Add recipe & source base classes and fake recipe generator<commit_after>#!/usr/bin/env python3
import random
class Recipe:
'''
Represents an individual recipe, made up of the following attributes:
* title
A string containing a human-readable title or name for the recip... | |
92171a1bbccdfac0fd962f046f72faa681244c98 | src/txkube/test/_compat.py | src/txkube/test/_compat.py | # Copyright Least Authority Enterprises.
# See LICENSE for details.
"""
Helpers for Python 2/3 compatibility.
"""
from twisted.python.compat import _PY3
def encode_environ(env):
"""
Convert a ``dict`` of ``unicode`` keys and values to ``bytes`` on Python 2,
but return the ``dict`` unmodified on Python 3.... | Add helper for Python 2/3 compatibility. | Add helper for Python 2/3 compatibility.
| Python | mit | LeastAuthority/txkube | Add helper for Python 2/3 compatibility. | # Copyright Least Authority Enterprises.
# See LICENSE for details.
"""
Helpers for Python 2/3 compatibility.
"""
from twisted.python.compat import _PY3
def encode_environ(env):
"""
Convert a ``dict`` of ``unicode`` keys and values to ``bytes`` on Python 2,
but return the ``dict`` unmodified on Python 3.... | <commit_before><commit_msg>Add helper for Python 2/3 compatibility.<commit_after> | # Copyright Least Authority Enterprises.
# See LICENSE for details.
"""
Helpers for Python 2/3 compatibility.
"""
from twisted.python.compat import _PY3
def encode_environ(env):
"""
Convert a ``dict`` of ``unicode`` keys and values to ``bytes`` on Python 2,
but return the ``dict`` unmodified on Python 3.... | Add helper for Python 2/3 compatibility.# Copyright Least Authority Enterprises.
# See LICENSE for details.
"""
Helpers for Python 2/3 compatibility.
"""
from twisted.python.compat import _PY3
def encode_environ(env):
"""
Convert a ``dict`` of ``unicode`` keys and values to ``bytes`` on Python 2,
but ret... | <commit_before><commit_msg>Add helper for Python 2/3 compatibility.<commit_after># Copyright Least Authority Enterprises.
# See LICENSE for details.
"""
Helpers for Python 2/3 compatibility.
"""
from twisted.python.compat import _PY3
def encode_environ(env):
"""
Convert a ``dict`` of ``unicode`` keys and val... | |
70e55da36982217e5bcd983128a984be1aae84ab | util/timeline_adjust.py | util/timeline_adjust.py | #!/usr/bin/python
from __future__ import print_function
import argparse
import re
time_re = re.compile(r"^\s*#?\s*([0-9]+(?:\.[0-9]+)?)\s+\"")
first_num_re = re.compile(r"([0-9]+(?:\.[0-9]+)?)")
def adjust_lines(lines, adjust):
for line in lines:
match = re.match(time_re, line)
if match:
time = float... | Add python utility to adjust timelines | Add python utility to adjust timelines
It's kind of a pain to adjust all the times in a file or a section by a
particular amount, so this python file will do it for you.
| Python | apache-2.0 | quisquous/cactbot,quisquous/cactbot,sqt/cactbot,sqt/cactbot,quisquous/cactbot,sqt/cactbot,quisquous/cactbot,sqt/cactbot,quisquous/cactbot,quisquous/cactbot,sqt/cactbot | Add python utility to adjust timelines
It's kind of a pain to adjust all the times in a file or a section by a
particular amount, so this python file will do it for you. | #!/usr/bin/python
from __future__ import print_function
import argparse
import re
time_re = re.compile(r"^\s*#?\s*([0-9]+(?:\.[0-9]+)?)\s+\"")
first_num_re = re.compile(r"([0-9]+(?:\.[0-9]+)?)")
def adjust_lines(lines, adjust):
for line in lines:
match = re.match(time_re, line)
if match:
time = float... | <commit_before><commit_msg>Add python utility to adjust timelines
It's kind of a pain to adjust all the times in a file or a section by a
particular amount, so this python file will do it for you.<commit_after> | #!/usr/bin/python
from __future__ import print_function
import argparse
import re
time_re = re.compile(r"^\s*#?\s*([0-9]+(?:\.[0-9]+)?)\s+\"")
first_num_re = re.compile(r"([0-9]+(?:\.[0-9]+)?)")
def adjust_lines(lines, adjust):
for line in lines:
match = re.match(time_re, line)
if match:
time = float... | Add python utility to adjust timelines
It's kind of a pain to adjust all the times in a file or a section by a
particular amount, so this python file will do it for you.#!/usr/bin/python
from __future__ import print_function
import argparse
import re
time_re = re.compile(r"^\s*#?\s*([0-9]+(?:\.[0-9]+)?)\s+\"")
first_... | <commit_before><commit_msg>Add python utility to adjust timelines
It's kind of a pain to adjust all the times in a file or a section by a
particular amount, so this python file will do it for you.<commit_after>#!/usr/bin/python
from __future__ import print_function
import argparse
import re
time_re = re.compile(r"^\s... | |
804086ef7fe50d8b710406dd0efb614733779912 | iati/core/tests/test_validate.py | iati/core/tests/test_validate.py | """A module containing tests for the library representation of validation."""
valid_xml = """
<?xml version="1.0"?>
<iati-activities version="2.02">
<iati-activity>
<iati-identifier></iati-identifier>
<reporting-org type="40" ref="AA-AAA-123456789">
<narrative>Organisation name</narrative>
</repo... | Add valid and invalid xml Invalid XML is currently only invalid due to an incorrect version number. | Add valid and invalid xml
Invalid XML is currently only invalid due to an incorrect version
number.
| Python | mit | IATI/iati.core,IATI/iati.core | Add valid and invalid xml
Invalid XML is currently only invalid due to an incorrect version
number. | """A module containing tests for the library representation of validation."""
valid_xml = """
<?xml version="1.0"?>
<iati-activities version="2.02">
<iati-activity>
<iati-identifier></iati-identifier>
<reporting-org type="40" ref="AA-AAA-123456789">
<narrative>Organisation name</narrative>
</repo... | <commit_before><commit_msg>Add valid and invalid xml
Invalid XML is currently only invalid due to an incorrect version
number.<commit_after> | """A module containing tests for the library representation of validation."""
valid_xml = """
<?xml version="1.0"?>
<iati-activities version="2.02">
<iati-activity>
<iati-identifier></iati-identifier>
<reporting-org type="40" ref="AA-AAA-123456789">
<narrative>Organisation name</narrative>
</repo... | Add valid and invalid xml
Invalid XML is currently only invalid due to an incorrect version
number."""A module containing tests for the library representation of validation."""
valid_xml = """
<?xml version="1.0"?>
<iati-activities version="2.02">
<iati-activity>
<iati-identifier></iati-identifier>
<report... | <commit_before><commit_msg>Add valid and invalid xml
Invalid XML is currently only invalid due to an incorrect version
number.<commit_after>"""A module containing tests for the library representation of validation."""
valid_xml = """
<?xml version="1.0"?>
<iati-activities version="2.02">
<iati-activity>
<iati-... | |
979347a3af800229701d3a48ea2ca5e9aec709df | faq/migrations/0001_initial.py | faq/migrations/0001_initial.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='Questions',
fields=[
('id', models.AutoField(pr... | Create migration for the models. | Create migration for the models.
| Python | bsd-3-clause | donnywdavis/Django-faq-views,donnywdavis/Django-faq-views | Create migration for the models. | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='Questions',
fields=[
('id', models.AutoField(pr... | <commit_before><commit_msg>Create migration for the models.<commit_after> | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='Questions',
fields=[
('id', models.AutoField(pr... | Create migration for the models.# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='Questions',
fields=[
... | <commit_before><commit_msg>Create migration for the models.<commit_after># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='Qu... | |
894cbd1f7439fd6aca5a2f54a8111d22143c10f8 | package/segmenter.py | package/segmenter.py | import copy
import package.app as app
import cv2
import numpy as np
from package.image import Image, CS_BGR
__author__ = 'luigolas'
class Segmenter():
compatible_color_spaces = []
def segment(self, image):
"""
:param image:
:raise NotImplementedError:
"""
raise NotIm... | Add Segmenter. Not working yet | Add Segmenter. Not working yet
| Python | mit | Luigolas/PyReID | Add Segmenter. Not working yet | import copy
import package.app as app
import cv2
import numpy as np
from package.image import Image, CS_BGR
__author__ = 'luigolas'
class Segmenter():
compatible_color_spaces = []
def segment(self, image):
"""
:param image:
:raise NotImplementedError:
"""
raise NotIm... | <commit_before><commit_msg>Add Segmenter. Not working yet<commit_after> | import copy
import package.app as app
import cv2
import numpy as np
from package.image import Image, CS_BGR
__author__ = 'luigolas'
class Segmenter():
compatible_color_spaces = []
def segment(self, image):
"""
:param image:
:raise NotImplementedError:
"""
raise NotIm... | Add Segmenter. Not working yetimport copy
import package.app as app
import cv2
import numpy as np
from package.image import Image, CS_BGR
__author__ = 'luigolas'
class Segmenter():
compatible_color_spaces = []
def segment(self, image):
"""
:param image:
:raise NotImplementedError:
... | <commit_before><commit_msg>Add Segmenter. Not working yet<commit_after>import copy
import package.app as app
import cv2
import numpy as np
from package.image import Image, CS_BGR
__author__ = 'luigolas'
class Segmenter():
compatible_color_spaces = []
def segment(self, image):
"""
:param ima... | |
3c898782f8b51c4af9bff2c566adb80c1f740e53 | lintcode/Medium/120_Word_Ladder.py | lintcode/Medium/120_Word_Ladder.py | class Solution:
# @param start, a string
# @param end, a string
# @param dict, a set of string
# @return an integer
def ladderLength(self, start, end, dict):
# write your code here
queue = [start]
level = 1
levelIndex = 0
dict.add(end)
while (queue):
... | Add solution to lintcode question 120 | Add solution to lintcode question 120
| Python | mit | Rhadow/leetcode,Rhadow/leetcode,Rhadow/leetcode,Rhadow/leetcode | Add solution to lintcode question 120 | class Solution:
# @param start, a string
# @param end, a string
# @param dict, a set of string
# @return an integer
def ladderLength(self, start, end, dict):
# write your code here
queue = [start]
level = 1
levelIndex = 0
dict.add(end)
while (queue):
... | <commit_before><commit_msg>Add solution to lintcode question 120<commit_after> | class Solution:
# @param start, a string
# @param end, a string
# @param dict, a set of string
# @return an integer
def ladderLength(self, start, end, dict):
# write your code here
queue = [start]
level = 1
levelIndex = 0
dict.add(end)
while (queue):
... | Add solution to lintcode question 120class Solution:
# @param start, a string
# @param end, a string
# @param dict, a set of string
# @return an integer
def ladderLength(self, start, end, dict):
# write your code here
queue = [start]
level = 1
levelIndex = 0
d... | <commit_before><commit_msg>Add solution to lintcode question 120<commit_after>class Solution:
# @param start, a string
# @param end, a string
# @param dict, a set of string
# @return an integer
def ladderLength(self, start, end, dict):
# write your code here
queue = [start]
l... | |
c891fd7fb399c5b1730eef33ccea12770c28b2fd | setup.py | setup.py | from distutils.core import setup
setup(name='dimreducer',
version='1.0',
description='Dimension reduction methods',
py_modules=['dimreducer'],
)
setup(name='multiphenotype_utils',
version='1.0',
description='Utility functions for all methods',
py_modules=['multiphenotype_utils... | Add simple distutils script for modules | Add simple distutils script for modules
| Python | mit | epierson9/multiphenotype_methods | Add simple distutils script for modules | from distutils.core import setup
setup(name='dimreducer',
version='1.0',
description='Dimension reduction methods',
py_modules=['dimreducer'],
)
setup(name='multiphenotype_utils',
version='1.0',
description='Utility functions for all methods',
py_modules=['multiphenotype_utils... | <commit_before><commit_msg>Add simple distutils script for modules<commit_after> | from distutils.core import setup
setup(name='dimreducer',
version='1.0',
description='Dimension reduction methods',
py_modules=['dimreducer'],
)
setup(name='multiphenotype_utils',
version='1.0',
description='Utility functions for all methods',
py_modules=['multiphenotype_utils... | Add simple distutils script for modulesfrom distutils.core import setup
setup(name='dimreducer',
version='1.0',
description='Dimension reduction methods',
py_modules=['dimreducer'],
)
setup(name='multiphenotype_utils',
version='1.0',
description='Utility functions for all methods',
... | <commit_before><commit_msg>Add simple distutils script for modules<commit_after>from distutils.core import setup
setup(name='dimreducer',
version='1.0',
description='Dimension reduction methods',
py_modules=['dimreducer'],
)
setup(name='multiphenotype_utils',
version='1.0',
descript... | |
8fa6beb9bd3fe866be11c97bed4fbe2532198dfc | ingestor/ingest_from_yaml.py | ingestor/ingest_from_yaml.py |
import click
import os
import os.path
import yaml
from create_tiles import calc_target_names, create_tiles
from geotiff_to_netcdf import create_or_replace
from pprint import pprint
def read_yaml(filename):
with open(filename) as f:
data = yaml.load(f)
return data
def get_input_files(input_file,... | Add new command line tool for injesting from YAML description to NetCDF | Add new command line tool for injesting from YAML description to NetCDF
| Python | bsd-3-clause | omad/datacube-experiments | Add new command line tool for injesting from YAML description to NetCDF |
import click
import os
import os.path
import yaml
from create_tiles import calc_target_names, create_tiles
from geotiff_to_netcdf import create_or_replace
from pprint import pprint
def read_yaml(filename):
with open(filename) as f:
data = yaml.load(f)
return data
def get_input_files(input_file,... | <commit_before><commit_msg>Add new command line tool for injesting from YAML description to NetCDF<commit_after> |
import click
import os
import os.path
import yaml
from create_tiles import calc_target_names, create_tiles
from geotiff_to_netcdf import create_or_replace
from pprint import pprint
def read_yaml(filename):
with open(filename) as f:
data = yaml.load(f)
return data
def get_input_files(input_file,... | Add new command line tool for injesting from YAML description to NetCDF
import click
import os
import os.path
import yaml
from create_tiles import calc_target_names, create_tiles
from geotiff_to_netcdf import create_or_replace
from pprint import pprint
def read_yaml(filename):
with open(filename) as f:
da... | <commit_before><commit_msg>Add new command line tool for injesting from YAML description to NetCDF<commit_after>
import click
import os
import os.path
import yaml
from create_tiles import calc_target_names, create_tiles
from geotiff_to_netcdf import create_or_replace
from pprint import pprint
def read_yaml(filename):... | |
ae15b8db30d726990b3ba2ee1885e093b0b933bf | tests/test_core/test_compoundgenerator_performance.py | tests/test_core/test_compoundgenerator_performance.py | import os
import sys
sys.path.append(os.path.join(os.path.dirname(__file__), ".."))
import unittest
import time
from test_util import ScanPointGeneratorTest
from scanpointgenerator import CompoundGenerator
from scanpointgenerator import LineGenerator
from scanpointgenerator import SpiralGenerator
from scanpointgenerat... | Add time-sensitive test for compound generator for a large scan. | Add time-sensitive test for compound generator for a large scan.
Tests that point preparation for ~100 million points (before region
filtering) happens within a few seconds.
| Python | apache-2.0 | dls-controls/scanpointgenerator | Add time-sensitive test for compound generator for a large scan.
Tests that point preparation for ~100 million points (before region
filtering) happens within a few seconds. | import os
import sys
sys.path.append(os.path.join(os.path.dirname(__file__), ".."))
import unittest
import time
from test_util import ScanPointGeneratorTest
from scanpointgenerator import CompoundGenerator
from scanpointgenerator import LineGenerator
from scanpointgenerator import SpiralGenerator
from scanpointgenerat... | <commit_before><commit_msg>Add time-sensitive test for compound generator for a large scan.
Tests that point preparation for ~100 million points (before region
filtering) happens within a few seconds.<commit_after> | import os
import sys
sys.path.append(os.path.join(os.path.dirname(__file__), ".."))
import unittest
import time
from test_util import ScanPointGeneratorTest
from scanpointgenerator import CompoundGenerator
from scanpointgenerator import LineGenerator
from scanpointgenerator import SpiralGenerator
from scanpointgenerat... | Add time-sensitive test for compound generator for a large scan.
Tests that point preparation for ~100 million points (before region
filtering) happens within a few seconds.import os
import sys
sys.path.append(os.path.join(os.path.dirname(__file__), ".."))
import unittest
import time
from test_util import ScanPointGe... | <commit_before><commit_msg>Add time-sensitive test for compound generator for a large scan.
Tests that point preparation for ~100 million points (before region
filtering) happens within a few seconds.<commit_after>import os
import sys
sys.path.append(os.path.join(os.path.dirname(__file__), ".."))
import unittest
impor... | |
5898822218500487419256676ac57c70a7d40367 | py/2-keys-keyboard.py | py/2-keys-keyboard.py | class Solution(object):
def minSteps(self, n):
"""
:type n: int
:rtype: int
"""
ans = [n] * (n + 1)
ans[1] = 0
for i in xrange(1, n + 1):
for j in xrange(2, n / i + 1):
ans[j * i] = min(ans[i] + j, ans[j * i])
return ans[n]
| Add py solution for 650. 2 Keys Keyboard | Add py solution for 650. 2 Keys Keyboard
650. 2 Keys Keyboard: https://leetcode.com/problems/2-keys-keyboard/
| Python | apache-2.0 | ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode | Add py solution for 650. 2 Keys Keyboard
650. 2 Keys Keyboard: https://leetcode.com/problems/2-keys-keyboard/ | class Solution(object):
def minSteps(self, n):
"""
:type n: int
:rtype: int
"""
ans = [n] * (n + 1)
ans[1] = 0
for i in xrange(1, n + 1):
for j in xrange(2, n / i + 1):
ans[j * i] = min(ans[i] + j, ans[j * i])
return ans[n]
| <commit_before><commit_msg>Add py solution for 650. 2 Keys Keyboard
650. 2 Keys Keyboard: https://leetcode.com/problems/2-keys-keyboard/<commit_after> | class Solution(object):
def minSteps(self, n):
"""
:type n: int
:rtype: int
"""
ans = [n] * (n + 1)
ans[1] = 0
for i in xrange(1, n + 1):
for j in xrange(2, n / i + 1):
ans[j * i] = min(ans[i] + j, ans[j * i])
return ans[n]
| Add py solution for 650. 2 Keys Keyboard
650. 2 Keys Keyboard: https://leetcode.com/problems/2-keys-keyboard/class Solution(object):
def minSteps(self, n):
"""
:type n: int
:rtype: int
"""
ans = [n] * (n + 1)
ans[1] = 0
for i in xrange(1, n + 1):
... | <commit_before><commit_msg>Add py solution for 650. 2 Keys Keyboard
650. 2 Keys Keyboard: https://leetcode.com/problems/2-keys-keyboard/<commit_after>class Solution(object):
def minSteps(self, n):
"""
:type n: int
:rtype: int
"""
ans = [n] * (n + 1)
ans[1] = 0
... | |
44971ec8f96302a04dbb9d4e66299462f245fb1d | bin/aggregate_metrics.py | bin/aggregate_metrics.py | import sys
import csv
import os
SRC_DIR = os.path.dirname(os.path.dirname(os.path.realpath(__file__))) + '/src'
sys.path.append(SRC_DIR)
from aggregator import ReportAggregator
def check_arguments():
if len(sys.argv) != 2:
print 'usage: aggregate_metrics.py <data directory>\n'
print ' data direc... | Add script to aggregate metrics | Add script to aggregate metrics
| Python | mit | Datafable/gbif-dataset-metrics,Datafable/gbif-dataset-metrics,Datafable/gbif-dataset-metrics | Add script to aggregate metrics | import sys
import csv
import os
SRC_DIR = os.path.dirname(os.path.dirname(os.path.realpath(__file__))) + '/src'
sys.path.append(SRC_DIR)
from aggregator import ReportAggregator
def check_arguments():
if len(sys.argv) != 2:
print 'usage: aggregate_metrics.py <data directory>\n'
print ' data direc... | <commit_before><commit_msg>Add script to aggregate metrics<commit_after> | import sys
import csv
import os
SRC_DIR = os.path.dirname(os.path.dirname(os.path.realpath(__file__))) + '/src'
sys.path.append(SRC_DIR)
from aggregator import ReportAggregator
def check_arguments():
if len(sys.argv) != 2:
print 'usage: aggregate_metrics.py <data directory>\n'
print ' data direc... | Add script to aggregate metricsimport sys
import csv
import os
SRC_DIR = os.path.dirname(os.path.dirname(os.path.realpath(__file__))) + '/src'
sys.path.append(SRC_DIR)
from aggregator import ReportAggregator
def check_arguments():
if len(sys.argv) != 2:
print 'usage: aggregate_metrics.py <data directory>\n... | <commit_before><commit_msg>Add script to aggregate metrics<commit_after>import sys
import csv
import os
SRC_DIR = os.path.dirname(os.path.dirname(os.path.realpath(__file__))) + '/src'
sys.path.append(SRC_DIR)
from aggregator import ReportAggregator
def check_arguments():
if len(sys.argv) != 2:
print 'usage... | |
800e5514d0e641a09a3539c6425309e1f149621b | scripts/validate_pccora_filename_dates.py | scripts/validate_pccora_filename_dates.py | #!/usr/bin/env python3
import glob
import sys, os
sys.path.append(os.path.join(os.path.dirname(__file__), '..', 'pccora'))
from pccora import *
def dump_values(obj):
for key in obj:
print("%s -> %s" % (key, obj[key]))
def dump_array_values(obj):
i = 0
for container in obj:
print("### Item %d" % (i+1))
for k... | Add script to validate identification section date and filename date | Add script to validate identification section date and filename date
| Python | mit | kinow/pccora | Add script to validate identification section date and filename date | #!/usr/bin/env python3
import glob
import sys, os
sys.path.append(os.path.join(os.path.dirname(__file__), '..', 'pccora'))
from pccora import *
def dump_values(obj):
for key in obj:
print("%s -> %s" % (key, obj[key]))
def dump_array_values(obj):
i = 0
for container in obj:
print("### Item %d" % (i+1))
for k... | <commit_before><commit_msg>Add script to validate identification section date and filename date<commit_after> | #!/usr/bin/env python3
import glob
import sys, os
sys.path.append(os.path.join(os.path.dirname(__file__), '..', 'pccora'))
from pccora import *
def dump_values(obj):
for key in obj:
print("%s -> %s" % (key, obj[key]))
def dump_array_values(obj):
i = 0
for container in obj:
print("### Item %d" % (i+1))
for k... | Add script to validate identification section date and filename date#!/usr/bin/env python3
import glob
import sys, os
sys.path.append(os.path.join(os.path.dirname(__file__), '..', 'pccora'))
from pccora import *
def dump_values(obj):
for key in obj:
print("%s -> %s" % (key, obj[key]))
def dump_array_values(obj):
... | <commit_before><commit_msg>Add script to validate identification section date and filename date<commit_after>#!/usr/bin/env python3
import glob
import sys, os
sys.path.append(os.path.join(os.path.dirname(__file__), '..', 'pccora'))
from pccora import *
def dump_values(obj):
for key in obj:
print("%s -> %s" % (key,... | |
a20f2077ef910a930508a5ed1e5e598b66db3b03 | ckanext/dataviewanalytics/db.py | ckanext/dataviewanalytics/db.py | '''Models definition for database tables creation
'''
from ckan.common import config
from sqlalchemy import (Column, Integer, String, ForeignKey, create_engine, types)
from sqlalchemy.orm import sessionmaker
from sqlalchemy.ext.declarative import declarative_base
from ckan import model
from ckan.model import user_tabl... | Write models for analytics tables | Write models for analytics tables
| Python | agpl-3.0 | shemogumbe/ckanext-dataviewanalytics,shemogumbe/ckanext-dataviewanalytics,shemogumbe/ckanext-dataviewanalytics | Write models for analytics tables | '''Models definition for database tables creation
'''
from ckan.common import config
from sqlalchemy import (Column, Integer, String, ForeignKey, create_engine, types)
from sqlalchemy.orm import sessionmaker
from sqlalchemy.ext.declarative import declarative_base
from ckan import model
from ckan.model import user_tabl... | <commit_before><commit_msg>Write models for analytics tables<commit_after> | '''Models definition for database tables creation
'''
from ckan.common import config
from sqlalchemy import (Column, Integer, String, ForeignKey, create_engine, types)
from sqlalchemy.orm import sessionmaker
from sqlalchemy.ext.declarative import declarative_base
from ckan import model
from ckan.model import user_tabl... | Write models for analytics tables'''Models definition for database tables creation
'''
from ckan.common import config
from sqlalchemy import (Column, Integer, String, ForeignKey, create_engine, types)
from sqlalchemy.orm import sessionmaker
from sqlalchemy.ext.declarative import declarative_base
from ckan import model... | <commit_before><commit_msg>Write models for analytics tables<commit_after>'''Models definition for database tables creation
'''
from ckan.common import config
from sqlalchemy import (Column, Integer, String, ForeignKey, create_engine, types)
from sqlalchemy.orm import sessionmaker
from sqlalchemy.ext.declarative impor... | |
798394af2580cc755dac4d70892c150bc0e69d32 | config/andrew_list_violation.py | config/andrew_list_violation.py | from experiment_config_lib import ControllerConfig
from sts.topology import MeshTopology
from sts.control_flow import Fuzzer
from sts.input_traces.input_logger import InputLogger
from sts.invariant_checker import InvariantChecker
from sts.simulation_state import SimulationConfig
# Use POX as our controller
command_lin... | Add configuration file for Andrew to test changes on | Add configuration file for Andrew to test changes on
| Python | apache-2.0 | jmiserez/sts,ucb-sts/sts,ucb-sts/sts,jmiserez/sts | Add configuration file for Andrew to test changes on | from experiment_config_lib import ControllerConfig
from sts.topology import MeshTopology
from sts.control_flow import Fuzzer
from sts.input_traces.input_logger import InputLogger
from sts.invariant_checker import InvariantChecker
from sts.simulation_state import SimulationConfig
# Use POX as our controller
command_lin... | <commit_before><commit_msg>Add configuration file for Andrew to test changes on<commit_after> | from experiment_config_lib import ControllerConfig
from sts.topology import MeshTopology
from sts.control_flow import Fuzzer
from sts.input_traces.input_logger import InputLogger
from sts.invariant_checker import InvariantChecker
from sts.simulation_state import SimulationConfig
# Use POX as our controller
command_lin... | Add configuration file for Andrew to test changes onfrom experiment_config_lib import ControllerConfig
from sts.topology import MeshTopology
from sts.control_flow import Fuzzer
from sts.input_traces.input_logger import InputLogger
from sts.invariant_checker import InvariantChecker
from sts.simulation_state import Simul... | <commit_before><commit_msg>Add configuration file for Andrew to test changes on<commit_after>from experiment_config_lib import ControllerConfig
from sts.topology import MeshTopology
from sts.control_flow import Fuzzer
from sts.input_traces.input_logger import InputLogger
from sts.invariant_checker import InvariantCheck... | |
0032cfba11665de9200410cc132eb8aa368c7601 | conveyor/utils.py | conveyor/utils.py | class DictDiffer(object):
"""
Calculate the difference between two dictionaries as:
(1) items added
(2) items removed
(3) keys same in both but changed values
(4) keys same in both and unchanged values
"""
def __init__(self, current_dict, past_dict):
self.curren... | Add a utility for diffing dicts | Add a utility for diffing dicts
| Python | bsd-2-clause | crateio/carrier | Add a utility for diffing dicts | class DictDiffer(object):
"""
Calculate the difference between two dictionaries as:
(1) items added
(2) items removed
(3) keys same in both but changed values
(4) keys same in both and unchanged values
"""
def __init__(self, current_dict, past_dict):
self.curren... | <commit_before><commit_msg>Add a utility for diffing dicts<commit_after> | class DictDiffer(object):
"""
Calculate the difference between two dictionaries as:
(1) items added
(2) items removed
(3) keys same in both but changed values
(4) keys same in both and unchanged values
"""
def __init__(self, current_dict, past_dict):
self.curren... | Add a utility for diffing dictsclass DictDiffer(object):
"""
Calculate the difference between two dictionaries as:
(1) items added
(2) items removed
(3) keys same in both but changed values
(4) keys same in both and unchanged values
"""
def __init__(self, current_dict, ... | <commit_before><commit_msg>Add a utility for diffing dicts<commit_after>class DictDiffer(object):
"""
Calculate the difference between two dictionaries as:
(1) items added
(2) items removed
(3) keys same in both but changed values
(4) keys same in both and unchanged values
"... | |
f073437f02737568b7d12cba6050afda92933a87 | docs/source/conf.py | docs/source/conf.py | # vim:fileencoding=utf-8:noet
from __future__ import (unicode_literals, division, absolute_import, print_function)
import os
import sys
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(os.getcwd()))))
sys.path.insert(0, os.path.abspath(os.getcwd()))
extensions = ['powerline_autodoc', 'sphinx.ext.t... | # vim:fileencoding=utf-8:noet
from __future__ import (unicode_literals, division, absolute_import, print_function)
import os
import sys
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(os.getcwd()))))
sys.path.insert(0, os.path.abspath(os.getcwd()))
extensions = ['powerline_autodoc', 'sphinx.ext.t... | Remove the only remaining reference to `u'` string prefix | Remove the only remaining reference to `u'` string prefix
| Python | mit | DoctorJellyface/powerline,lukw00/powerline,cyrixhero/powerline,bezhermoso/powerline,QuLogic/powerline,Luffin/powerline,bartvm/powerline,s0undt3ch/powerline,darac/powerline,junix/powerline,seanfisk/powerline,darac/powerline,IvanAli/powerline,DoctorJellyface/powerline,Liangjianghao/powerline,Liangjianghao/powerline,wfsch... | # vim:fileencoding=utf-8:noet
from __future__ import (unicode_literals, division, absolute_import, print_function)
import os
import sys
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(os.getcwd()))))
sys.path.insert(0, os.path.abspath(os.getcwd()))
extensions = ['powerline_autodoc', 'sphinx.ext.t... | # vim:fileencoding=utf-8:noet
from __future__ import (unicode_literals, division, absolute_import, print_function)
import os
import sys
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(os.getcwd()))))
sys.path.insert(0, os.path.abspath(os.getcwd()))
extensions = ['powerline_autodoc', 'sphinx.ext.t... | <commit_before># vim:fileencoding=utf-8:noet
from __future__ import (unicode_literals, division, absolute_import, print_function)
import os
import sys
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(os.getcwd()))))
sys.path.insert(0, os.path.abspath(os.getcwd()))
extensions = ['powerline_autodoc'... | # vim:fileencoding=utf-8:noet
from __future__ import (unicode_literals, division, absolute_import, print_function)
import os
import sys
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(os.getcwd()))))
sys.path.insert(0, os.path.abspath(os.getcwd()))
extensions = ['powerline_autodoc', 'sphinx.ext.t... | # vim:fileencoding=utf-8:noet
from __future__ import (unicode_literals, division, absolute_import, print_function)
import os
import sys
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(os.getcwd()))))
sys.path.insert(0, os.path.abspath(os.getcwd()))
extensions = ['powerline_autodoc', 'sphinx.ext.t... | <commit_before># vim:fileencoding=utf-8:noet
from __future__ import (unicode_literals, division, absolute_import, print_function)
import os
import sys
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(os.getcwd()))))
sys.path.insert(0, os.path.abspath(os.getcwd()))
extensions = ['powerline_autodoc'... |
5f15edde5d753423f70bfd7401c215053cbe746c | tests/test_http_messages.py | tests/test_http_messages.py | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# Copyright © 2016 <>
#
# Distributed under terms of the MIT license.
"""
Test the Request and Response classes
"""
from fnapy.utils import Response, Request
from lxml import etree
from fnapy.utils import xml2dict, remove_namespace
BATCH_ID = "BFACA... | Test the Request and Response classes | Test the Request and Response classes
| Python | mit | alexandriagroup/fnapy,alexandriagroup/fnapy | Test the Request and Response classes | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# Copyright © 2016 <>
#
# Distributed under terms of the MIT license.
"""
Test the Request and Response classes
"""
from fnapy.utils import Response, Request
from lxml import etree
from fnapy.utils import xml2dict, remove_namespace
BATCH_ID = "BFACA... | <commit_before><commit_msg>Test the Request and Response classes<commit_after> | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# Copyright © 2016 <>
#
# Distributed under terms of the MIT license.
"""
Test the Request and Response classes
"""
from fnapy.utils import Response, Request
from lxml import etree
from fnapy.utils import xml2dict, remove_namespace
BATCH_ID = "BFACA... | Test the Request and Response classes#! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# Copyright © 2016 <>
#
# Distributed under terms of the MIT license.
"""
Test the Request and Response classes
"""
from fnapy.utils import Response, Request
from lxml import etree
from fnapy.utils import xml2dict,... | <commit_before><commit_msg>Test the Request and Response classes<commit_after>#! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# Copyright © 2016 <>
#
# Distributed under terms of the MIT license.
"""
Test the Request and Response classes
"""
from fnapy.utils import Response, Request
from lxml impor... | |
c90bde47b1faab13396052fa474bc802ea5b2438 | testscroll.py | testscroll.py | from PySide import QtCore, QtGui
import os,sys
from bgsub import SpectrumData
from matplotlib import pyplot as plt
path = "/home/danielle/Documents/LMCE_one"
file_list = [f for f in sorted(os.listdir(path)) if f.endswith(".txt")]
os.chdir(path)
spectra = []
for each in file_list:
spectra.append(SpectrumData.from_... | Test interface for showing plots | Test interface for showing plots
| Python | mit | danushkana/pyspectrum | Test interface for showing plots | from PySide import QtCore, QtGui
import os,sys
from bgsub import SpectrumData
from matplotlib import pyplot as plt
path = "/home/danielle/Documents/LMCE_one"
file_list = [f for f in sorted(os.listdir(path)) if f.endswith(".txt")]
os.chdir(path)
spectra = []
for each in file_list:
spectra.append(SpectrumData.from_... | <commit_before><commit_msg>Test interface for showing plots<commit_after> | from PySide import QtCore, QtGui
import os,sys
from bgsub import SpectrumData
from matplotlib import pyplot as plt
path = "/home/danielle/Documents/LMCE_one"
file_list = [f for f in sorted(os.listdir(path)) if f.endswith(".txt")]
os.chdir(path)
spectra = []
for each in file_list:
spectra.append(SpectrumData.from_... | Test interface for showing plotsfrom PySide import QtCore, QtGui
import os,sys
from bgsub import SpectrumData
from matplotlib import pyplot as plt
path = "/home/danielle/Documents/LMCE_one"
file_list = [f for f in sorted(os.listdir(path)) if f.endswith(".txt")]
os.chdir(path)
spectra = []
for each in file_list:
s... | <commit_before><commit_msg>Test interface for showing plots<commit_after>from PySide import QtCore, QtGui
import os,sys
from bgsub import SpectrumData
from matplotlib import pyplot as plt
path = "/home/danielle/Documents/LMCE_one"
file_list = [f for f in sorted(os.listdir(path)) if f.endswith(".txt")]
os.chdir(path)
... | |
2207dd266887e812cae9da67ca00bef80c9985fd | thefuck/shells/__init__.py | thefuck/shells/__init__.py | """Package with shell specific actions, each shell class should
implement `from_shell`, `to_shell`, `app_alias`, `put_to_history` and
`get_aliases` methods.
"""
import os
from psutil import Process
from .bash import Bash
from .fish import Fish
from .generic import Generic
from .tcsh import Tcsh
from .zsh import Zsh
sh... | """Package with shell specific actions, each shell class should
implement `from_shell`, `to_shell`, `app_alias`, `put_to_history` and
`get_aliases` methods.
"""
import os
from psutil import Process
from .bash import Bash
from .fish import Fish
from .generic import Generic
from .tcsh import Tcsh
from .zsh import Zsh
sh... | Update _get_shell to work with Windows | Update _get_shell to work with Windows
- _get_shell assumed the parent process would always be the shell process, in Powershell the
parent process is Python, with the grandparent being the shell
- Switched to walking the process tree so the same code path can be used in both places
| Python | mit | mlk/thefuck,SimenB/thefuck,SimenB/thefuck,mlk/thefuck,nvbn/thefuck,Clpsplug/thefuck,scorphus/thefuck,Clpsplug/thefuck,scorphus/thefuck,nvbn/thefuck | """Package with shell specific actions, each shell class should
implement `from_shell`, `to_shell`, `app_alias`, `put_to_history` and
`get_aliases` methods.
"""
import os
from psutil import Process
from .bash import Bash
from .fish import Fish
from .generic import Generic
from .tcsh import Tcsh
from .zsh import Zsh
sh... | """Package with shell specific actions, each shell class should
implement `from_shell`, `to_shell`, `app_alias`, `put_to_history` and
`get_aliases` methods.
"""
import os
from psutil import Process
from .bash import Bash
from .fish import Fish
from .generic import Generic
from .tcsh import Tcsh
from .zsh import Zsh
sh... | <commit_before>"""Package with shell specific actions, each shell class should
implement `from_shell`, `to_shell`, `app_alias`, `put_to_history` and
`get_aliases` methods.
"""
import os
from psutil import Process
from .bash import Bash
from .fish import Fish
from .generic import Generic
from .tcsh import Tcsh
from .zsh... | """Package with shell specific actions, each shell class should
implement `from_shell`, `to_shell`, `app_alias`, `put_to_history` and
`get_aliases` methods.
"""
import os
from psutil import Process
from .bash import Bash
from .fish import Fish
from .generic import Generic
from .tcsh import Tcsh
from .zsh import Zsh
sh... | """Package with shell specific actions, each shell class should
implement `from_shell`, `to_shell`, `app_alias`, `put_to_history` and
`get_aliases` methods.
"""
import os
from psutil import Process
from .bash import Bash
from .fish import Fish
from .generic import Generic
from .tcsh import Tcsh
from .zsh import Zsh
sh... | <commit_before>"""Package with shell specific actions, each shell class should
implement `from_shell`, `to_shell`, `app_alias`, `put_to_history` and
`get_aliases` methods.
"""
import os
from psutil import Process
from .bash import Bash
from .fish import Fish
from .generic import Generic
from .tcsh import Tcsh
from .zsh... |
731b53a21ca5d027384b1db3d5bfdcdd055eff28 | run_doodle_exp.py | run_doodle_exp.py | #!/usr/bin/env python3
import subprocess
import os
img_dir = 'samples/'
out_dir = 'outputs/'
ext = '.jpg'
sem_ext = '.png'
c_images = ['arthur', 'matheus', 'sergio', 'morgan']
s_image = 'morgan'
content_weight = 15
style_weight = 10
iterations = 200
### Create outputs' folder if it doesn't exist
if not os.path.exist... | Change style for each execution of the experiment | Change style for each execution of the experiment | Python | agpl-3.0 | msvolenski/transfer-style-deep-investigation | Change style for each execution of the experiment | #!/usr/bin/env python3
import subprocess
import os
img_dir = 'samples/'
out_dir = 'outputs/'
ext = '.jpg'
sem_ext = '.png'
c_images = ['arthur', 'matheus', 'sergio', 'morgan']
s_image = 'morgan'
content_weight = 15
style_weight = 10
iterations = 200
### Create outputs' folder if it doesn't exist
if not os.path.exist... | <commit_before><commit_msg>Change style for each execution of the experiment<commit_after> | #!/usr/bin/env python3
import subprocess
import os
img_dir = 'samples/'
out_dir = 'outputs/'
ext = '.jpg'
sem_ext = '.png'
c_images = ['arthur', 'matheus', 'sergio', 'morgan']
s_image = 'morgan'
content_weight = 15
style_weight = 10
iterations = 200
### Create outputs' folder if it doesn't exist
if not os.path.exist... | Change style for each execution of the experiment#!/usr/bin/env python3
import subprocess
import os
img_dir = 'samples/'
out_dir = 'outputs/'
ext = '.jpg'
sem_ext = '.png'
c_images = ['arthur', 'matheus', 'sergio', 'morgan']
s_image = 'morgan'
content_weight = 15
style_weight = 10
iterations = 200
### Create outputs... | <commit_before><commit_msg>Change style for each execution of the experiment<commit_after>#!/usr/bin/env python3
import subprocess
import os
img_dir = 'samples/'
out_dir = 'outputs/'
ext = '.jpg'
sem_ext = '.png'
c_images = ['arthur', 'matheus', 'sergio', 'morgan']
s_image = 'morgan'
content_weight = 15
style_weight ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.