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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f622255dc2c6695b785213c8d69cb57ae5d8a5e9 | waftools/pebble_sdk_version.py | waftools/pebble_sdk_version.py | from waflib.Configure import conf
@conf
def compare_sdk_version(ctx, platform, version):
target_env = ctx.all_envs[platform] if platform in ctx.all_envs else ctx.env
target_version = (int(target_env.SDK_VERSION_MAJOR or 0x5) * 0xff +
int(target_env.SDK_VERSION_MINOR or 0x19))
other_v... | Add pebble sdk version for detecting sdk features | Add pebble sdk version for detecting sdk features
| Python | mit | jiangege/pebblejs-project,youtux/PebbleShows,bkbilly/Tvheadend-EPG,bkbilly/Tvheadend-EPG,pebble/pebblejs,fletchto99/pebblejs,sunshineyyy/CatchOneBus,fletchto99/pebblejs,pebble/pebblejs,carlo-colombo/dublin-bus-pebble,youtux/PebbleShows,jsfi/pebblejs,daduke/LMSController,jiangege/pebblejs-project,sunshineyyy/CatchOneBus... | Add pebble sdk version for detecting sdk features | from waflib.Configure import conf
@conf
def compare_sdk_version(ctx, platform, version):
target_env = ctx.all_envs[platform] if platform in ctx.all_envs else ctx.env
target_version = (int(target_env.SDK_VERSION_MAJOR or 0x5) * 0xff +
int(target_env.SDK_VERSION_MINOR or 0x19))
other_v... | <commit_before><commit_msg>Add pebble sdk version for detecting sdk features<commit_after> | from waflib.Configure import conf
@conf
def compare_sdk_version(ctx, platform, version):
target_env = ctx.all_envs[platform] if platform in ctx.all_envs else ctx.env
target_version = (int(target_env.SDK_VERSION_MAJOR or 0x5) * 0xff +
int(target_env.SDK_VERSION_MINOR or 0x19))
other_v... | Add pebble sdk version for detecting sdk featuresfrom waflib.Configure import conf
@conf
def compare_sdk_version(ctx, platform, version):
target_env = ctx.all_envs[platform] if platform in ctx.all_envs else ctx.env
target_version = (int(target_env.SDK_VERSION_MAJOR or 0x5) * 0xff +
int(t... | <commit_before><commit_msg>Add pebble sdk version for detecting sdk features<commit_after>from waflib.Configure import conf
@conf
def compare_sdk_version(ctx, platform, version):
target_env = ctx.all_envs[platform] if platform in ctx.all_envs else ctx.env
target_version = (int(target_env.SDK_VERSION_MAJOR or ... | |
0fa30986e1f97331f96444e0b3b0f86cbe20c68a | shadho/backend/json/tests/test_db.py | shadho/backend/json/tests/test_db.py | import pytest
from shadho.backend.base.tests.test_db import TestBaseBackend
from shadho.backend.json.db import JsonBackend
import json
import os
import shutil
class TestJsonBackend(object):
def test_init(self):
"""Ensure that initialization sets up the db and filepath."""
# Test default initial... | Add tests for JsonBackend __init__ and commit methods | Add tests for JsonBackend __init__ and commit methods
| Python | mit | jeffkinnison/shadho,jeffkinnison/shadho | Add tests for JsonBackend __init__ and commit methods | import pytest
from shadho.backend.base.tests.test_db import TestBaseBackend
from shadho.backend.json.db import JsonBackend
import json
import os
import shutil
class TestJsonBackend(object):
def test_init(self):
"""Ensure that initialization sets up the db and filepath."""
# Test default initial... | <commit_before><commit_msg>Add tests for JsonBackend __init__ and commit methods<commit_after> | import pytest
from shadho.backend.base.tests.test_db import TestBaseBackend
from shadho.backend.json.db import JsonBackend
import json
import os
import shutil
class TestJsonBackend(object):
def test_init(self):
"""Ensure that initialization sets up the db and filepath."""
# Test default initial... | Add tests for JsonBackend __init__ and commit methodsimport pytest
from shadho.backend.base.tests.test_db import TestBaseBackend
from shadho.backend.json.db import JsonBackend
import json
import os
import shutil
class TestJsonBackend(object):
def test_init(self):
"""Ensure that initialization sets up t... | <commit_before><commit_msg>Add tests for JsonBackend __init__ and commit methods<commit_after>import pytest
from shadho.backend.base.tests.test_db import TestBaseBackend
from shadho.backend.json.db import JsonBackend
import json
import os
import shutil
class TestJsonBackend(object):
def test_init(self):
... | |
871f79a0b2bd235df457e3a1dc502d5c18bd934a | tools/build/common_utils.py | tools/build/common_utils.py | from __future__ import print_function
import os
def game_root_path():
file_path = os.path.dirname(os.path.abspath(__file__))
return os.path.abspath(os.path.join(file_path, '..', '..'))
def files_with_type(root, type):
all_files = [os.path.join(root, filename) for filename in os.listdir(root)]
typed_f... | Add some generic python utilities as a basis for scripts | Add some generic python utilities as a basis for scripts
| Python | mit | Oletus/gameutils.js,Oletus/gameutils.js | Add some generic python utilities as a basis for scripts | from __future__ import print_function
import os
def game_root_path():
file_path = os.path.dirname(os.path.abspath(__file__))
return os.path.abspath(os.path.join(file_path, '..', '..'))
def files_with_type(root, type):
all_files = [os.path.join(root, filename) for filename in os.listdir(root)]
typed_f... | <commit_before><commit_msg>Add some generic python utilities as a basis for scripts<commit_after> | from __future__ import print_function
import os
def game_root_path():
file_path = os.path.dirname(os.path.abspath(__file__))
return os.path.abspath(os.path.join(file_path, '..', '..'))
def files_with_type(root, type):
all_files = [os.path.join(root, filename) for filename in os.listdir(root)]
typed_f... | Add some generic python utilities as a basis for scriptsfrom __future__ import print_function
import os
def game_root_path():
file_path = os.path.dirname(os.path.abspath(__file__))
return os.path.abspath(os.path.join(file_path, '..', '..'))
def files_with_type(root, type):
all_files = [os.path.join(root,... | <commit_before><commit_msg>Add some generic python utilities as a basis for scripts<commit_after>from __future__ import print_function
import os
def game_root_path():
file_path = os.path.dirname(os.path.abspath(__file__))
return os.path.abspath(os.path.join(file_path, '..', '..'))
def files_with_type(root, t... | |
9c53e59ee0c4e5418b54d47c932454b7b907dc03 | seahub/profile/forms.py | seahub/profile/forms.py | # encoding: utf-8
from django import forms
from django.utils.html import escape
from seahub.profile.models import Profile, DetailedProfile
class ProfileForm(forms.Form):
nickname = forms.CharField(max_length=64, required=False)
intro = forms.CharField(max_length=256, required=False)
def save(self, userna... | # encoding: utf-8
from django import forms
from seahub.profile.models import Profile, DetailedProfile
class ProfileForm(forms.Form):
nickname = forms.CharField(max_length=64, required=False)
intro = forms.CharField(max_length=256, required=False)
def save(self, username):
nickname = self.cleaned_... | Revert escape nickname, desc, etc in user profile | Revert escape nickname, desc, etc in user profile
| Python | apache-2.0 | madflow/seahub,Chilledheart/seahub,cloudcopy/seahub,madflow/seahub,Chilledheart/seahub,cloudcopy/seahub,miurahr/seahub,miurahr/seahub,cloudcopy/seahub,Chilledheart/seahub,miurahr/seahub,madflow/seahub,madflow/seahub,madflow/seahub,Chilledheart/seahub,cloudcopy/seahub,miurahr/seahub,Chilledheart/seahub | # encoding: utf-8
from django import forms
from django.utils.html import escape
from seahub.profile.models import Profile, DetailedProfile
class ProfileForm(forms.Form):
nickname = forms.CharField(max_length=64, required=False)
intro = forms.CharField(max_length=256, required=False)
def save(self, userna... | # encoding: utf-8
from django import forms
from seahub.profile.models import Profile, DetailedProfile
class ProfileForm(forms.Form):
nickname = forms.CharField(max_length=64, required=False)
intro = forms.CharField(max_length=256, required=False)
def save(self, username):
nickname = self.cleaned_... | <commit_before># encoding: utf-8
from django import forms
from django.utils.html import escape
from seahub.profile.models import Profile, DetailedProfile
class ProfileForm(forms.Form):
nickname = forms.CharField(max_length=64, required=False)
intro = forms.CharField(max_length=256, required=False)
def sa... | # encoding: utf-8
from django import forms
from seahub.profile.models import Profile, DetailedProfile
class ProfileForm(forms.Form):
nickname = forms.CharField(max_length=64, required=False)
intro = forms.CharField(max_length=256, required=False)
def save(self, username):
nickname = self.cleaned_... | # encoding: utf-8
from django import forms
from django.utils.html import escape
from seahub.profile.models import Profile, DetailedProfile
class ProfileForm(forms.Form):
nickname = forms.CharField(max_length=64, required=False)
intro = forms.CharField(max_length=256, required=False)
def save(self, userna... | <commit_before># encoding: utf-8
from django import forms
from django.utils.html import escape
from seahub.profile.models import Profile, DetailedProfile
class ProfileForm(forms.Form):
nickname = forms.CharField(max_length=64, required=False)
intro = forms.CharField(max_length=256, required=False)
def sa... |
8affeda715b1facf12de1dab1d445bbe54616306 | oscar/core/ajax.py | oscar/core/ajax.py | import six
from django.contrib import messages
from six.moves import map
class FlashMessages(object):
"""
Intermediate container for flash messages.
This is useful as, at the time of creating the message, we don't know
whether the response is an AJAX response or not.
"""
def __init__(self):
... | import six
from django.contrib import messages
from six.moves import map
class FlashMessages(object):
"""
Intermediate container for flash messages.
This is useful as, at the time of creating the message, we don't know
whether the response is an AJAX response or not.
"""
def __init__(self):
... | Fix JSON serialisation problem with AJAX basket | Fix JSON serialisation problem with AJAX basket
six.moves.map returns itertools.imap which won't serialize to JSON.
This commit unpacks the list into a normal list of strings to circumvent
the issue.
| Python | bsd-3-clause | jmt4/django-oscar,jmt4/django-oscar,dongguangming/django-oscar,lijoantony/django-oscar,kapt/django-oscar,okfish/django-oscar,vovanbo/django-oscar,bnprk/django-oscar,Bogh/django-oscar,sasha0/django-oscar,ahmetdaglarbas/e-commerce,solarissmoke/django-oscar,bnprk/django-oscar,spartonia/django-oscar,WillisXChen/django-osca... | import six
from django.contrib import messages
from six.moves import map
class FlashMessages(object):
"""
Intermediate container for flash messages.
This is useful as, at the time of creating the message, we don't know
whether the response is an AJAX response or not.
"""
def __init__(self):
... | import six
from django.contrib import messages
from six.moves import map
class FlashMessages(object):
"""
Intermediate container for flash messages.
This is useful as, at the time of creating the message, we don't know
whether the response is an AJAX response or not.
"""
def __init__(self):
... | <commit_before>import six
from django.contrib import messages
from six.moves import map
class FlashMessages(object):
"""
Intermediate container for flash messages.
This is useful as, at the time of creating the message, we don't know
whether the response is an AJAX response or not.
"""
def _... | import six
from django.contrib import messages
from six.moves import map
class FlashMessages(object):
"""
Intermediate container for flash messages.
This is useful as, at the time of creating the message, we don't know
whether the response is an AJAX response or not.
"""
def __init__(self):
... | import six
from django.contrib import messages
from six.moves import map
class FlashMessages(object):
"""
Intermediate container for flash messages.
This is useful as, at the time of creating the message, we don't know
whether the response is an AJAX response or not.
"""
def __init__(self):
... | <commit_before>import six
from django.contrib import messages
from six.moves import map
class FlashMessages(object):
"""
Intermediate container for flash messages.
This is useful as, at the time of creating the message, we don't know
whether the response is an AJAX response or not.
"""
def _... |
0c8b7fa865df535f5baa33025c184bbf4234b7b1 | shp_to_csv_distances.py | shp_to_csv_distances.py | """Create a csv matrix of distances between shapefile geometry objects.
Requirements: fiona, shapely
Written by: Taylor Denouden
Date: November 25, 2015
"""
import random
import fiona
from shapely.geometry import shape
from scripts.printer import print_progress
def main():
"""Main script execution."""
outf... | Create script to transform shapefile into csv distance matrix | Create script to transform shapefile into csv distance matrix
| Python | mit | tayden-hakai/Island_MST | Create script to transform shapefile into csv distance matrix | """Create a csv matrix of distances between shapefile geometry objects.
Requirements: fiona, shapely
Written by: Taylor Denouden
Date: November 25, 2015
"""
import random
import fiona
from shapely.geometry import shape
from scripts.printer import print_progress
def main():
"""Main script execution."""
outf... | <commit_before><commit_msg>Create script to transform shapefile into csv distance matrix<commit_after> | """Create a csv matrix of distances between shapefile geometry objects.
Requirements: fiona, shapely
Written by: Taylor Denouden
Date: November 25, 2015
"""
import random
import fiona
from shapely.geometry import shape
from scripts.printer import print_progress
def main():
"""Main script execution."""
outf... | Create script to transform shapefile into csv distance matrix"""Create a csv matrix of distances between shapefile geometry objects.
Requirements: fiona, shapely
Written by: Taylor Denouden
Date: November 25, 2015
"""
import random
import fiona
from shapely.geometry import shape
from scripts.printer import print_pro... | <commit_before><commit_msg>Create script to transform shapefile into csv distance matrix<commit_after>"""Create a csv matrix of distances between shapefile geometry objects.
Requirements: fiona, shapely
Written by: Taylor Denouden
Date: November 25, 2015
"""
import random
import fiona
from shapely.geometry import sh... | |
ec6dff24e3049ddaab392f0bc5b8d8b724e41e20 | trending_python.py | trending_python.py | #!/usr/bin/env python3
import bs4
import requests
url = 'https://github.com/trending?l=Python'
soup = bs4.BeautifulSoup(requests.get(url).content, 'lxml') # or 'html5lib'
repos = soup.find('ol', class_="repo-list").find_all('a', href=True)
repos = (r.text.strip().replace(' ', '') for r in repos if '/' in r.text)
pri... | Print the trending Python repos on GitHub | Print the trending Python repos on GitHub | Python | apache-2.0 | cclauss/Ten-lines-or-less | Print the trending Python repos on GitHub | #!/usr/bin/env python3
import bs4
import requests
url = 'https://github.com/trending?l=Python'
soup = bs4.BeautifulSoup(requests.get(url).content, 'lxml') # or 'html5lib'
repos = soup.find('ol', class_="repo-list").find_all('a', href=True)
repos = (r.text.strip().replace(' ', '') for r in repos if '/' in r.text)
pri... | <commit_before><commit_msg>Print the trending Python repos on GitHub<commit_after> | #!/usr/bin/env python3
import bs4
import requests
url = 'https://github.com/trending?l=Python'
soup = bs4.BeautifulSoup(requests.get(url).content, 'lxml') # or 'html5lib'
repos = soup.find('ol', class_="repo-list").find_all('a', href=True)
repos = (r.text.strip().replace(' ', '') for r in repos if '/' in r.text)
pri... | Print the trending Python repos on GitHub#!/usr/bin/env python3
import bs4
import requests
url = 'https://github.com/trending?l=Python'
soup = bs4.BeautifulSoup(requests.get(url).content, 'lxml') # or 'html5lib'
repos = soup.find('ol', class_="repo-list").find_all('a', href=True)
repos = (r.text.strip().replace(' ',... | <commit_before><commit_msg>Print the trending Python repos on GitHub<commit_after>#!/usr/bin/env python3
import bs4
import requests
url = 'https://github.com/trending?l=Python'
soup = bs4.BeautifulSoup(requests.get(url).content, 'lxml') # or 'html5lib'
repos = soup.find('ol', class_="repo-list").find_all('a', href=T... | |
f6c2d5e37685b149cfd447545c58ce1fc4d836b9 | snorkel/models/views.py | snorkel/models/views.py |
def create_serialized_candidate_view(session, C, verbose=True):
"""Creates a view in the database for a Candidate sub-class C defined over
Span contexts, which are direct children of a single sentence.
Creates VIEW with schema:
candidate.id, candidate.split, span0.*, ..., spanK.*, sentence.*
... | Add function to create view for Span candidate subclasses | Add function to create view for Span candidate subclasses
| Python | apache-2.0 | jasontlam/snorkel,HazyResearch/snorkel,HazyResearch/snorkel,jasontlam/snorkel,jasontlam/snorkel,HazyResearch/snorkel | Add function to create view for Span candidate subclasses |
def create_serialized_candidate_view(session, C, verbose=True):
"""Creates a view in the database for a Candidate sub-class C defined over
Span contexts, which are direct children of a single sentence.
Creates VIEW with schema:
candidate.id, candidate.split, span0.*, ..., spanK.*, sentence.*
... | <commit_before><commit_msg>Add function to create view for Span candidate subclasses<commit_after> |
def create_serialized_candidate_view(session, C, verbose=True):
"""Creates a view in the database for a Candidate sub-class C defined over
Span contexts, which are direct children of a single sentence.
Creates VIEW with schema:
candidate.id, candidate.split, span0.*, ..., spanK.*, sentence.*
... | Add function to create view for Span candidate subclasses
def create_serialized_candidate_view(session, C, verbose=True):
"""Creates a view in the database for a Candidate sub-class C defined over
Span contexts, which are direct children of a single sentence.
Creates VIEW with schema:
candidate.id... | <commit_before><commit_msg>Add function to create view for Span candidate subclasses<commit_after>
def create_serialized_candidate_view(session, C, verbose=True):
"""Creates a view in the database for a Candidate sub-class C defined over
Span contexts, which are direct children of a single sentence.
Creat... | |
3609c5842b33ca4146ad14b74c76f8954545aaa8 | loqusdb/commands/view.py | loqusdb/commands/view.py | # -*- coding: utf-8 -*-
import logging
import click
from . import base_command
logger = logging.getLogger(__name__)
@base_command.command()
@click.option('-c' ,'--case-id',
help='Search for case'
)
@click.pass_context
def cases(ctx, case_id):
"""Display all cases in the database."""
ada... | Add commands for cases and variants | Add commands for cases and variants
| Python | mit | moonso/loqusdb | Add commands for cases and variants | # -*- coding: utf-8 -*-
import logging
import click
from . import base_command
logger = logging.getLogger(__name__)
@base_command.command()
@click.option('-c' ,'--case-id',
help='Search for case'
)
@click.pass_context
def cases(ctx, case_id):
"""Display all cases in the database."""
ada... | <commit_before><commit_msg>Add commands for cases and variants<commit_after> | # -*- coding: utf-8 -*-
import logging
import click
from . import base_command
logger = logging.getLogger(__name__)
@base_command.command()
@click.option('-c' ,'--case-id',
help='Search for case'
)
@click.pass_context
def cases(ctx, case_id):
"""Display all cases in the database."""
ada... | Add commands for cases and variants# -*- coding: utf-8 -*-
import logging
import click
from . import base_command
logger = logging.getLogger(__name__)
@base_command.command()
@click.option('-c' ,'--case-id',
help='Search for case'
)
@click.pass_context
def cases(ctx, case_id):
"""Display all cas... | <commit_before><commit_msg>Add commands for cases and variants<commit_after># -*- coding: utf-8 -*-
import logging
import click
from . import base_command
logger = logging.getLogger(__name__)
@base_command.command()
@click.option('-c' ,'--case-id',
help='Search for case'
)
@click.pass_context
def ca... | |
4a30d30b82fbdccbb0f15ebb5c094b13ce791f7f | genderator/utils.py | genderator/utils.py | from unidecode import unidecode
class Normalizer:
def normalize(text):
text = Normalizer.remove_extra_whitespaces(text)
text = Normalizer.replace_hyphens(text)
# text = Normalizer.remove_accent_marks(text)
return text.lower()
@staticmethod
def replace_hyphens(text):
... | Add a utility class to normalize input | Add a utility class to normalize input
| Python | mit | davidmogar/genderator | Add a utility class to normalize input | from unidecode import unidecode
class Normalizer:
def normalize(text):
text = Normalizer.remove_extra_whitespaces(text)
text = Normalizer.replace_hyphens(text)
# text = Normalizer.remove_accent_marks(text)
return text.lower()
@staticmethod
def replace_hyphens(text):
... | <commit_before><commit_msg>Add a utility class to normalize input<commit_after> | from unidecode import unidecode
class Normalizer:
def normalize(text):
text = Normalizer.remove_extra_whitespaces(text)
text = Normalizer.replace_hyphens(text)
# text = Normalizer.remove_accent_marks(text)
return text.lower()
@staticmethod
def replace_hyphens(text):
... | Add a utility class to normalize inputfrom unidecode import unidecode
class Normalizer:
def normalize(text):
text = Normalizer.remove_extra_whitespaces(text)
text = Normalizer.replace_hyphens(text)
# text = Normalizer.remove_accent_marks(text)
return text.lower()
@staticmeth... | <commit_before><commit_msg>Add a utility class to normalize input<commit_after>from unidecode import unidecode
class Normalizer:
def normalize(text):
text = Normalizer.remove_extra_whitespaces(text)
text = Normalizer.replace_hyphens(text)
# text = Normalizer.remove_accent_marks(text)
... | |
23cf747a3ff24f75d3300547f4bfdecf10c4a325 | scrapple/utils/config.py | scrapple/utils/config.py | """
scrapple.utils.config
~~~~~~~~~~~~~~~~~~~~~
Functions related to traversing the configuration file
"""
from __future__ import print_function
def traverse_next(page, next, results):
for link in page.extract_links(next['follow_link']):
print("Loading page", link.url)
r = results
for at... | Add next traversal util function | Add next traversal util function
| Python | mit | scrappleapp/scrapple,AlexMathew/scrapple,AlexMathew/scrapple,scrappleapp/scrapple,AlexMathew/scrapple | Add next traversal util function | """
scrapple.utils.config
~~~~~~~~~~~~~~~~~~~~~
Functions related to traversing the configuration file
"""
from __future__ import print_function
def traverse_next(page, next, results):
for link in page.extract_links(next['follow_link']):
print("Loading page", link.url)
r = results
for at... | <commit_before><commit_msg>Add next traversal util function<commit_after> | """
scrapple.utils.config
~~~~~~~~~~~~~~~~~~~~~
Functions related to traversing the configuration file
"""
from __future__ import print_function
def traverse_next(page, next, results):
for link in page.extract_links(next['follow_link']):
print("Loading page", link.url)
r = results
for at... | Add next traversal util function"""
scrapple.utils.config
~~~~~~~~~~~~~~~~~~~~~
Functions related to traversing the configuration file
"""
from __future__ import print_function
def traverse_next(page, next, results):
for link in page.extract_links(next['follow_link']):
print("Loading page", link.url)
... | <commit_before><commit_msg>Add next traversal util function<commit_after>"""
scrapple.utils.config
~~~~~~~~~~~~~~~~~~~~~
Functions related to traversing the configuration file
"""
from __future__ import print_function
def traverse_next(page, next, results):
for link in page.extract_links(next['follow_link']):
... | |
82b9a66ea826b4463d82c69ba1703eab213efe83 | heat_integrationtests/functional/test_stack_outputs.py | heat_integrationtests/functional/test_stack_outputs.py | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | Add test for stack outputs | Add test for stack outputs
Add test for output list and output show
Depends-On: I1bc1cee1c78ecf0c9a18ecc0a871d38e4141e0f7
Change-Id: I1ee226494b5b04ec2d43edf0c03ab31e452fedf0
| Python | apache-2.0 | cwolferh/heat-scratch,noironetworks/heat,jasondunsmore/heat,jasondunsmore/heat,noironetworks/heat,openstack/heat,steveb/heat,dims/heat,steveb/heat,dims/heat,openstack/heat,cwolferh/heat-scratch | Add test for stack outputs
Add test for output list and output show
Depends-On: I1bc1cee1c78ecf0c9a18ecc0a871d38e4141e0f7
Change-Id: I1ee226494b5b04ec2d43edf0c03ab31e452fedf0 | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | <commit_before><commit_msg>Add test for stack outputs
Add test for output list and output show
Depends-On: I1bc1cee1c78ecf0c9a18ecc0a871d38e4141e0f7
Change-Id: I1ee226494b5b04ec2d43edf0c03ab31e452fedf0<commit_after> | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | Add test for stack outputs
Add test for output list and output show
Depends-On: I1bc1cee1c78ecf0c9a18ecc0a871d38e4141e0f7
Change-Id: I1ee226494b5b04ec2d43edf0c03ab31e452fedf0# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You m... | <commit_before><commit_msg>Add test for stack outputs
Add test for output list and output show
Depends-On: I1bc1cee1c78ecf0c9a18ecc0a871d38e4141e0f7
Change-Id: I1ee226494b5b04ec2d43edf0c03ab31e452fedf0<commit_after># Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file exc... | |
b7bf4586fea207453225a87fb85df59ccfc94e80 | jarbas/core/migrations/0032_auto_20170613_0641.py | jarbas/core/migrations/0032_auto_20170613_0641.py | # -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2017-06-13 09:41
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0031_add_index_together_for_reimbursement'),
]
operations = [
migra... | Add missing migration related to django-simple-history update | Add missing migration related to django-simple-history update
| Python | mit | datasciencebr/jarbas,datasciencebr/jarbas,marcusrehm/serenata-de-amor,marcusrehm/serenata-de-amor,datasciencebr/jarbas,datasciencebr/serenata-de-amor,datasciencebr/serenata-de-amor,marcusrehm/serenata-de-amor,datasciencebr/jarbas,marcusrehm/serenata-de-amor | Add missing migration related to django-simple-history update | # -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2017-06-13 09:41
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0031_add_index_together_for_reimbursement'),
]
operations = [
migra... | <commit_before><commit_msg>Add missing migration related to django-simple-history update<commit_after> | # -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2017-06-13 09:41
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0031_add_index_together_for_reimbursement'),
]
operations = [
migra... | Add missing migration related to django-simple-history update# -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2017-06-13 09:41
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0031_add_index_together... | <commit_before><commit_msg>Add missing migration related to django-simple-history update<commit_after># -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2017-06-13 09:41
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
... | |
2cd1da31b099cbf37552b2a049c3df6619e0e64f | rma/redis_types.py | rma/redis_types.py | REDIS_ENCODING_ID_RAW = 0
REDIS_ENCODING_ID_INT = 1
REDIS_ENCODING_ID_EMBSTR = 2
REDIS_ENCODING_ID_HASHTABLE = 3
REDIS_ENCODING_ID_ZIPLIST = 4
REDIS_ENCODING_ID_LINKEDLIST = 5
REDIS_ENCODING_ID_QUICKLIST =6
REDIS_ENCODING_ID_INTSET = 7
REDIS_ENCODING_ID_SKIPLIST = 8
REDIS_ENCODING_STR_TO_ID_LIB = {
b'raw': REDIS_E... | Add helper enums for type encodings | Add helper enums for type encodings
| Python | mit | gamenet/redis-memory-analyzer | Add helper enums for type encodings | REDIS_ENCODING_ID_RAW = 0
REDIS_ENCODING_ID_INT = 1
REDIS_ENCODING_ID_EMBSTR = 2
REDIS_ENCODING_ID_HASHTABLE = 3
REDIS_ENCODING_ID_ZIPLIST = 4
REDIS_ENCODING_ID_LINKEDLIST = 5
REDIS_ENCODING_ID_QUICKLIST =6
REDIS_ENCODING_ID_INTSET = 7
REDIS_ENCODING_ID_SKIPLIST = 8
REDIS_ENCODING_STR_TO_ID_LIB = {
b'raw': REDIS_E... | <commit_before><commit_msg>Add helper enums for type encodings<commit_after> | REDIS_ENCODING_ID_RAW = 0
REDIS_ENCODING_ID_INT = 1
REDIS_ENCODING_ID_EMBSTR = 2
REDIS_ENCODING_ID_HASHTABLE = 3
REDIS_ENCODING_ID_ZIPLIST = 4
REDIS_ENCODING_ID_LINKEDLIST = 5
REDIS_ENCODING_ID_QUICKLIST =6
REDIS_ENCODING_ID_INTSET = 7
REDIS_ENCODING_ID_SKIPLIST = 8
REDIS_ENCODING_STR_TO_ID_LIB = {
b'raw': REDIS_E... | Add helper enums for type encodingsREDIS_ENCODING_ID_RAW = 0
REDIS_ENCODING_ID_INT = 1
REDIS_ENCODING_ID_EMBSTR = 2
REDIS_ENCODING_ID_HASHTABLE = 3
REDIS_ENCODING_ID_ZIPLIST = 4
REDIS_ENCODING_ID_LINKEDLIST = 5
REDIS_ENCODING_ID_QUICKLIST =6
REDIS_ENCODING_ID_INTSET = 7
REDIS_ENCODING_ID_SKIPLIST = 8
REDIS_ENCODING_ST... | <commit_before><commit_msg>Add helper enums for type encodings<commit_after>REDIS_ENCODING_ID_RAW = 0
REDIS_ENCODING_ID_INT = 1
REDIS_ENCODING_ID_EMBSTR = 2
REDIS_ENCODING_ID_HASHTABLE = 3
REDIS_ENCODING_ID_ZIPLIST = 4
REDIS_ENCODING_ID_LINKEDLIST = 5
REDIS_ENCODING_ID_QUICKLIST =6
REDIS_ENCODING_ID_INTSET = 7
REDIS_EN... | |
6ae82ecdd749b936289b496a10faa2caf1aa94c6 | bibsort.py | bibsort.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import re
from collections import OrderedDict
import codecs
class BibEntry:
def __init__(self, **kwargs):
self.data = {}
for key, value in kwargs.iteritems():
self.data[key] = value
def entry(self):
data = OrderedDict(... | Add first version of the code | Add first version of the code
| Python | mit | derherrg/pybibsort | Add first version of the code | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import re
from collections import OrderedDict
import codecs
class BibEntry:
def __init__(self, **kwargs):
self.data = {}
for key, value in kwargs.iteritems():
self.data[key] = value
def entry(self):
data = OrderedDict(... | <commit_before><commit_msg>Add first version of the code<commit_after> | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import re
from collections import OrderedDict
import codecs
class BibEntry:
def __init__(self, **kwargs):
self.data = {}
for key, value in kwargs.iteritems():
self.data[key] = value
def entry(self):
data = OrderedDict(... | Add first version of the code#!/usr/bin/env python
# -*- coding: utf-8 -*-
import re
from collections import OrderedDict
import codecs
class BibEntry:
def __init__(self, **kwargs):
self.data = {}
for key, value in kwargs.iteritems():
self.data[key] = value
def entry(self)... | <commit_before><commit_msg>Add first version of the code<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-
import re
from collections import OrderedDict
import codecs
class BibEntry:
def __init__(self, **kwargs):
self.data = {}
for key, value in kwargs.iteritems():
self.d... | |
a086e7328ca920f269812a87be095ce638467f95 | crawler/youtube_dl_op_sample.py | crawler/youtube_dl_op_sample.py | #!/usr/bin/env python2
#-*- coding: utf-8 -*-
import sys
import youtube_dl
def main():
if len(sys.argv) < 2:
print("Usage: youtube_dl_op_sample.py URL")
return
opts = {
'forceurl': True,
'quiet': True,
'simulate': True,
}
url = sys.argv[1... | Add youtube-dl library sample of operation | [Crawler] Add youtube-dl library sample of operation
| Python | mit | daineseh/python_code | [Crawler] Add youtube-dl library sample of operation | #!/usr/bin/env python2
#-*- coding: utf-8 -*-
import sys
import youtube_dl
def main():
if len(sys.argv) < 2:
print("Usage: youtube_dl_op_sample.py URL")
return
opts = {
'forceurl': True,
'quiet': True,
'simulate': True,
}
url = sys.argv[1... | <commit_before><commit_msg>[Crawler] Add youtube-dl library sample of operation<commit_after> | #!/usr/bin/env python2
#-*- coding: utf-8 -*-
import sys
import youtube_dl
def main():
if len(sys.argv) < 2:
print("Usage: youtube_dl_op_sample.py URL")
return
opts = {
'forceurl': True,
'quiet': True,
'simulate': True,
}
url = sys.argv[1... | [Crawler] Add youtube-dl library sample of operation#!/usr/bin/env python2
#-*- coding: utf-8 -*-
import sys
import youtube_dl
def main():
if len(sys.argv) < 2:
print("Usage: youtube_dl_op_sample.py URL")
return
opts = {
'forceurl': True,
'quiet': True,
'... | <commit_before><commit_msg>[Crawler] Add youtube-dl library sample of operation<commit_after>#!/usr/bin/env python2
#-*- coding: utf-8 -*-
import sys
import youtube_dl
def main():
if len(sys.argv) < 2:
print("Usage: youtube_dl_op_sample.py URL")
return
opts = {
'forceurl': True,... | |
1058a9cb6e667c850f56b6003038496b77c359c5 | website/tools/append_index_html_to_internal_links.py | website/tools/append_index_html_to_internal_links.py | """Script to fix the links in the staged website.
Finds all internal links which do not have index.html at the end and appends
index.html in the appropriate place (preserving anchors, etc).
Usage:
From root directory, after running the jekyll build, execute
'python tools/append_index_html_to_internal_links.py'.
D... | Add tool to fix links. | Add tool to fix links.
Signed-off-by: Jason Kuster <68c46a606457643eab92053c1c05574abb26f861@google.com>
| Python | apache-2.0 | rangadi/beam,robertwb/incubator-beam,lukecwik/incubator-beam,lukecwik/incubator-beam,markflyhigh/incubator-beam,chamikaramj/beam,chamikaramj/beam,RyanSkraba/beam,rangadi/incubator-beam,lukecwik/incubator-beam,robertwb/incubator-beam,charlesccychen/incubator-beam,chamikaramj/beam,rangadi/beam,charlesccychen/beam,markfly... | Add tool to fix links.
Signed-off-by: Jason Kuster <68c46a606457643eab92053c1c05574abb26f861@google.com> | """Script to fix the links in the staged website.
Finds all internal links which do not have index.html at the end and appends
index.html in the appropriate place (preserving anchors, etc).
Usage:
From root directory, after running the jekyll build, execute
'python tools/append_index_html_to_internal_links.py'.
D... | <commit_before><commit_msg>Add tool to fix links.
Signed-off-by: Jason Kuster <68c46a606457643eab92053c1c05574abb26f861@google.com><commit_after> | """Script to fix the links in the staged website.
Finds all internal links which do not have index.html at the end and appends
index.html in the appropriate place (preserving anchors, etc).
Usage:
From root directory, after running the jekyll build, execute
'python tools/append_index_html_to_internal_links.py'.
D... | Add tool to fix links.
Signed-off-by: Jason Kuster <68c46a606457643eab92053c1c05574abb26f861@google.com>"""Script to fix the links in the staged website.
Finds all internal links which do not have index.html at the end and appends
index.html in the appropriate place (preserving anchors, etc).
Usage:
From root direc... | <commit_before><commit_msg>Add tool to fix links.
Signed-off-by: Jason Kuster <68c46a606457643eab92053c1c05574abb26f861@google.com><commit_after>"""Script to fix the links in the staged website.
Finds all internal links which do not have index.html at the end and appends
index.html in the appropriate place (preserving... | |
8d8f89c82511b86fb87cef5db3bad633283283cc | modelview/migrations/0044_auto_20191007_1227.py | modelview/migrations/0044_auto_20191007_1227.py | # -*- coding: utf-8 -*-
# Generated by Django 1.11.25 on 2019-10-07 10:27
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('modelview', '0043_merge_20190425_1036'),
]
operations = [
migrations.Remov... | Add missing migrations in develop branch | Add missing migrations in develop branch
| Python | agpl-3.0 | openego/oeplatform,openego/oeplatform,openego/oeplatform,openego/oeplatform | Add missing migrations in develop branch | # -*- coding: utf-8 -*-
# Generated by Django 1.11.25 on 2019-10-07 10:27
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('modelview', '0043_merge_20190425_1036'),
]
operations = [
migrations.Remov... | <commit_before><commit_msg>Add missing migrations in develop branch<commit_after> | # -*- coding: utf-8 -*-
# Generated by Django 1.11.25 on 2019-10-07 10:27
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('modelview', '0043_merge_20190425_1036'),
]
operations = [
migrations.Remov... | Add missing migrations in develop branch# -*- coding: utf-8 -*-
# Generated by Django 1.11.25 on 2019-10-07 10:27
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('modelview', '0043_merge_20190425_1036'),
]
... | <commit_before><commit_msg>Add missing migrations in develop branch<commit_after># -*- coding: utf-8 -*-
# Generated by Django 1.11.25 on 2019-10-07 10:27
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('modelview'... | |
e5be29bc3c5a77493fe64bb3fc8b52611cc13469 | zerver/tests/test_outgoing_webhook_interfaces.py | zerver/tests/test_outgoing_webhook_interfaces.py | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import print_function
from typing import Any
import mock
import json
from requests.models import Response
from zerver.lib.test_classes import ZulipTestCase
from zerver.outgoing_webhooks.generic import GenericOutgoingWebhookService
class T... | Add tests for Generic Interface. | Add tests for Generic Interface.
| Python | apache-2.0 | rht/zulip,mahim97/zulip,rht/zulip,mahim97/zulip,brainwane/zulip,hackerkid/zulip,zulip/zulip,eeshangarg/zulip,Galexrt/zulip,vabs22/zulip,kou/zulip,rishig/zulip,amanharitsh123/zulip,punchagan/zulip,eeshangarg/zulip,andersk/zulip,shubhamdhama/zulip,showell/zulip,jackrzhang/zulip,eeshangarg/zulip,hackerkid/zulip,vabs22/zul... | Add tests for Generic Interface. | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import print_function
from typing import Any
import mock
import json
from requests.models import Response
from zerver.lib.test_classes import ZulipTestCase
from zerver.outgoing_webhooks.generic import GenericOutgoingWebhookService
class T... | <commit_before><commit_msg>Add tests for Generic Interface.<commit_after> | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import print_function
from typing import Any
import mock
import json
from requests.models import Response
from zerver.lib.test_classes import ZulipTestCase
from zerver.outgoing_webhooks.generic import GenericOutgoingWebhookService
class T... | Add tests for Generic Interface.# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import print_function
from typing import Any
import mock
import json
from requests.models import Response
from zerver.lib.test_classes import ZulipTestCase
from zerver.outgoing_webhooks.generic import Generi... | <commit_before><commit_msg>Add tests for Generic Interface.<commit_after># -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import print_function
from typing import Any
import mock
import json
from requests.models import Response
from zerver.lib.test_classes import ZulipTestCase
from zerve... | |
03fce72b60eb8cad2368447cf23f72f8084f4a4b | py/distribute-candies.py | py/distribute-candies.py | class Solution(object):
def distributeCandies(self, candies):
"""
:type candies: List[int]
:rtype: int
"""
return min(len(candies) / 2, len(set(candies)))
| Add py solution for 575. Distribute Candies | Add py solution for 575. Distribute Candies
575. Distribute Candies: https://leetcode.com/problems/distribute-candies/
| Python | apache-2.0 | ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode | Add py solution for 575. Distribute Candies
575. Distribute Candies: https://leetcode.com/problems/distribute-candies/ | class Solution(object):
def distributeCandies(self, candies):
"""
:type candies: List[int]
:rtype: int
"""
return min(len(candies) / 2, len(set(candies)))
| <commit_before><commit_msg>Add py solution for 575. Distribute Candies
575. Distribute Candies: https://leetcode.com/problems/distribute-candies/<commit_after> | class Solution(object):
def distributeCandies(self, candies):
"""
:type candies: List[int]
:rtype: int
"""
return min(len(candies) / 2, len(set(candies)))
| Add py solution for 575. Distribute Candies
575. Distribute Candies: https://leetcode.com/problems/distribute-candies/class Solution(object):
def distributeCandies(self, candies):
"""
:type candies: List[int]
:rtype: int
"""
return min(len(candies) / 2, len(set(candies)))
| <commit_before><commit_msg>Add py solution for 575. Distribute Candies
575. Distribute Candies: https://leetcode.com/problems/distribute-candies/<commit_after>class Solution(object):
def distributeCandies(self, candies):
"""
:type candies: List[int]
:rtype: int
"""
return mi... | |
d34dcf1179e6e5c2b864627266ae1788d10142aa | Week01/Problem02/cyu_02.py | Week01/Problem02/cyu_02.py | #!/usr/bin/env python3
"""This script is written by Chuanping Yu, on Jul 24, 2017,
for the Assignment#1 in IDEaS workshop"""
#Problem 2
FIB = []
F = 1
S = 0
FIB.append(F)
FIB.append(F)
while F <= 4000000:
F = FIB[-1] + FIB[-2]
FIB.append(F)
if F%2 == 0 and F <= 4000000:
S = S + F
print(S)
| Add Chuanping Yu's solutions to Problem02 | Add Chuanping Yu's solutions to Problem02 | Python | bsd-3-clause | GT-IDEaS/SkillsWorkshop2017,GT-IDEaS/SkillsWorkshop2017,GT-IDEaS/SkillsWorkshop2017 | Add Chuanping Yu's solutions to Problem02 | #!/usr/bin/env python3
"""This script is written by Chuanping Yu, on Jul 24, 2017,
for the Assignment#1 in IDEaS workshop"""
#Problem 2
FIB = []
F = 1
S = 0
FIB.append(F)
FIB.append(F)
while F <= 4000000:
F = FIB[-1] + FIB[-2]
FIB.append(F)
if F%2 == 0 and F <= 4000000:
S = S + F
print(S)
| <commit_before><commit_msg>Add Chuanping Yu's solutions to Problem02<commit_after> | #!/usr/bin/env python3
"""This script is written by Chuanping Yu, on Jul 24, 2017,
for the Assignment#1 in IDEaS workshop"""
#Problem 2
FIB = []
F = 1
S = 0
FIB.append(F)
FIB.append(F)
while F <= 4000000:
F = FIB[-1] + FIB[-2]
FIB.append(F)
if F%2 == 0 and F <= 4000000:
S = S + F
print(S)
| Add Chuanping Yu's solutions to Problem02#!/usr/bin/env python3
"""This script is written by Chuanping Yu, on Jul 24, 2017,
for the Assignment#1 in IDEaS workshop"""
#Problem 2
FIB = []
F = 1
S = 0
FIB.append(F)
FIB.append(F)
while F <= 4000000:
F = FIB[-1] + FIB[-2]
FIB.append(F)
if F%2 == 0 and F <= 400... | <commit_before><commit_msg>Add Chuanping Yu's solutions to Problem02<commit_after>#!/usr/bin/env python3
"""This script is written by Chuanping Yu, on Jul 24, 2017,
for the Assignment#1 in IDEaS workshop"""
#Problem 2
FIB = []
F = 1
S = 0
FIB.append(F)
FIB.append(F)
while F <= 4000000:
F = FIB[-1] + FIB[-2]
F... | |
f59749db263291f481c4bdc9f6ede2f6de6cb6d4 | create_input_files.py | create_input_files.py | import csv
import argparse
import itertools
from thermo_utils import csv_row_writer, read_csv_rows
# Read input/output arguments
parser = argparse.ArgumentParser()
parser.add_argument('-o','--output',required=True)
parser.add_argument('-d','--dof',required=True)
# parser.add_argument('-v','--version',required=False)
... | Create foundation for input file generation (csv for connectivity table, etc.) | Create foundation for input file generation (csv for connectivity table, etc.)
| Python | mit | ndebuhr/openfea,ndebuhr/openfea | Create foundation for input file generation (csv for connectivity table, etc.) | import csv
import argparse
import itertools
from thermo_utils import csv_row_writer, read_csv_rows
# Read input/output arguments
parser = argparse.ArgumentParser()
parser.add_argument('-o','--output',required=True)
parser.add_argument('-d','--dof',required=True)
# parser.add_argument('-v','--version',required=False)
... | <commit_before><commit_msg>Create foundation for input file generation (csv for connectivity table, etc.)<commit_after> | import csv
import argparse
import itertools
from thermo_utils import csv_row_writer, read_csv_rows
# Read input/output arguments
parser = argparse.ArgumentParser()
parser.add_argument('-o','--output',required=True)
parser.add_argument('-d','--dof',required=True)
# parser.add_argument('-v','--version',required=False)
... | Create foundation for input file generation (csv for connectivity table, etc.)import csv
import argparse
import itertools
from thermo_utils import csv_row_writer, read_csv_rows
# Read input/output arguments
parser = argparse.ArgumentParser()
parser.add_argument('-o','--output',required=True)
parser.add_argument('-d',... | <commit_before><commit_msg>Create foundation for input file generation (csv for connectivity table, etc.)<commit_after>import csv
import argparse
import itertools
from thermo_utils import csv_row_writer, read_csv_rows
# Read input/output arguments
parser = argparse.ArgumentParser()
parser.add_argument('-o','--output'... | |
a5d5dde8c523aa28452d790e7f0291c1cf52aacb | tests/external/py2/testfixture_test.py | tests/external/py2/testfixture_test.py | #!/usr/bin/env python
# ----------------------------------------------------------------------
# Copyright (C) 2013 Numenta Inc. All rights reserved.
#
# The information and source code contained herein is the
# exclusive property of Numenta Inc. No part of this software
# may be used, reproduced, stored or distributed... | Make sure setUpModule is called by the test framework. We brought in pytest-2.4.0.dev8 for that specific functionality. However, one time we regressed, and our tests started misbehaving. So, this test is here to keep us honest. | Make sure setUpModule is called by the test framework. We brought in pytest-2.4.0.dev8 for that specific functionality. However, one time we regressed, and our tests started misbehaving. So, this test is here to keep us honest.
| Python | agpl-3.0 | breznak/nupic,breznak/nupic,breznak/nupic | Make sure setUpModule is called by the test framework. We brought in pytest-2.4.0.dev8 for that specific functionality. However, one time we regressed, and our tests started misbehaving. So, this test is here to keep us honest. | #!/usr/bin/env python
# ----------------------------------------------------------------------
# Copyright (C) 2013 Numenta Inc. All rights reserved.
#
# The information and source code contained herein is the
# exclusive property of Numenta Inc. No part of this software
# may be used, reproduced, stored or distributed... | <commit_before><commit_msg>Make sure setUpModule is called by the test framework. We brought in pytest-2.4.0.dev8 for that specific functionality. However, one time we regressed, and our tests started misbehaving. So, this test is here to keep us honest.<commit_after> | #!/usr/bin/env python
# ----------------------------------------------------------------------
# Copyright (C) 2013 Numenta Inc. All rights reserved.
#
# The information and source code contained herein is the
# exclusive property of Numenta Inc. No part of this software
# may be used, reproduced, stored or distributed... | Make sure setUpModule is called by the test framework. We brought in pytest-2.4.0.dev8 for that specific functionality. However, one time we regressed, and our tests started misbehaving. So, this test is here to keep us honest.#!/usr/bin/env python
# ---------------------------------------------------------------------... | <commit_before><commit_msg>Make sure setUpModule is called by the test framework. We brought in pytest-2.4.0.dev8 for that specific functionality. However, one time we regressed, and our tests started misbehaving. So, this test is here to keep us honest.<commit_after>#!/usr/bin/env python
# ----------------------------... | |
f18fd5c4ad61adb56ac7524a006ce9977aa06a31 | mailing/management/commands/send_queued_mails_worker.py | mailing/management/commands/send_queued_mails_worker.py | # -*- coding: utf-8 -*-
# Copyright (c) 2016 Aladom SAS & Hosting Dvpt SAS
from django.core.management.base import BaseCommand
from ...utils import send_queued_mails
import time
class Command(BaseCommand):
help = """Send mails with `status` Mail.STATUS_PENDING and having
`scheduled_on` set on a past date. In ... | Add worker to send queue mails | Add worker to send queue mails
| Python | mit | Aladom/django-mailing,Aladom/django-mailing | Add worker to send queue mails | # -*- coding: utf-8 -*-
# Copyright (c) 2016 Aladom SAS & Hosting Dvpt SAS
from django.core.management.base import BaseCommand
from ...utils import send_queued_mails
import time
class Command(BaseCommand):
help = """Send mails with `status` Mail.STATUS_PENDING and having
`scheduled_on` set on a past date. In ... | <commit_before><commit_msg>Add worker to send queue mails<commit_after> | # -*- coding: utf-8 -*-
# Copyright (c) 2016 Aladom SAS & Hosting Dvpt SAS
from django.core.management.base import BaseCommand
from ...utils import send_queued_mails
import time
class Command(BaseCommand):
help = """Send mails with `status` Mail.STATUS_PENDING and having
`scheduled_on` set on a past date. In ... | Add worker to send queue mails# -*- coding: utf-8 -*-
# Copyright (c) 2016 Aladom SAS & Hosting Dvpt SAS
from django.core.management.base import BaseCommand
from ...utils import send_queued_mails
import time
class Command(BaseCommand):
help = """Send mails with `status` Mail.STATUS_PENDING and having
`schedul... | <commit_before><commit_msg>Add worker to send queue mails<commit_after># -*- coding: utf-8 -*-
# Copyright (c) 2016 Aladom SAS & Hosting Dvpt SAS
from django.core.management.base import BaseCommand
from ...utils import send_queued_mails
import time
class Command(BaseCommand):
help = """Send mails with `status` Ma... | |
5a7081c5c46a050566477adda19d30844192ceb2 | src/mmw/apps/user/migrations/0002_auth_tokens.py | src/mmw/apps/user/migrations/0002_auth_tokens.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
from django.contrib.auth.models import User
from rest_framework.authtoken.models import Token
def add_auth_tokens_to_users(apps, schema_editor):
for user in User.objects.all()... | Add migration to add authtokens for existing users | Add migration to add authtokens for existing users
* NB: Depending on how many users there are, this migration could be pretty RAM
intensive...
| Python | apache-2.0 | WikiWatershed/model-my-watershed,WikiWatershed/model-my-watershed,WikiWatershed/model-my-watershed,WikiWatershed/model-my-watershed,WikiWatershed/model-my-watershed | Add migration to add authtokens for existing users
* NB: Depending on how many users there are, this migration could be pretty RAM
intensive... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
from django.contrib.auth.models import User
from rest_framework.authtoken.models import Token
def add_auth_tokens_to_users(apps, schema_editor):
for user in User.objects.all()... | <commit_before><commit_msg>Add migration to add authtokens for existing users
* NB: Depending on how many users there are, this migration could be pretty RAM
intensive...<commit_after> | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
from django.contrib.auth.models import User
from rest_framework.authtoken.models import Token
def add_auth_tokens_to_users(apps, schema_editor):
for user in User.objects.all()... | Add migration to add authtokens for existing users
* NB: Depending on how many users there are, this migration could be pretty RAM
intensive...# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
from django.contrib.auth.models imp... | <commit_before><commit_msg>Add migration to add authtokens for existing users
* NB: Depending on how many users there are, this migration could be pretty RAM
intensive...<commit_after># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import set... | |
ab53993b708b3f9cf3b5762664fef58bae99ea20 | recursive_remove_ltac.py | recursive_remove_ltac.py | import re
__all__ = ["recursively_remove_ltac"]
LTAC_REG = re.compile(r'^\s*(?:Local\s+|Global\s+)?Ltac\s+([^\s]+)', re.MULTILINE)
def recursively_remove_ltac(statements, exclude_n=3):
"""Removes any Ltac statement which is not used later in
statements. Does not remove any code in the last exclude_n
sta... | Add some code to auto-remove Ltac | Add some code to auto-remove Ltac
| Python | mit | JasonGross/coq-tools,JasonGross/coq-tools | Add some code to auto-remove Ltac | import re
__all__ = ["recursively_remove_ltac"]
LTAC_REG = re.compile(r'^\s*(?:Local\s+|Global\s+)?Ltac\s+([^\s]+)', re.MULTILINE)
def recursively_remove_ltac(statements, exclude_n=3):
"""Removes any Ltac statement which is not used later in
statements. Does not remove any code in the last exclude_n
sta... | <commit_before><commit_msg>Add some code to auto-remove Ltac<commit_after> | import re
__all__ = ["recursively_remove_ltac"]
LTAC_REG = re.compile(r'^\s*(?:Local\s+|Global\s+)?Ltac\s+([^\s]+)', re.MULTILINE)
def recursively_remove_ltac(statements, exclude_n=3):
"""Removes any Ltac statement which is not used later in
statements. Does not remove any code in the last exclude_n
sta... | Add some code to auto-remove Ltacimport re
__all__ = ["recursively_remove_ltac"]
LTAC_REG = re.compile(r'^\s*(?:Local\s+|Global\s+)?Ltac\s+([^\s]+)', re.MULTILINE)
def recursively_remove_ltac(statements, exclude_n=3):
"""Removes any Ltac statement which is not used later in
statements. Does not remove any c... | <commit_before><commit_msg>Add some code to auto-remove Ltac<commit_after>import re
__all__ = ["recursively_remove_ltac"]
LTAC_REG = re.compile(r'^\s*(?:Local\s+|Global\s+)?Ltac\s+([^\s]+)', re.MULTILINE)
def recursively_remove_ltac(statements, exclude_n=3):
"""Removes any Ltac statement which is not used later ... | |
8d6ca433d33551cc1fe5c08edcf68ec65e5447b0 | exercises/chapter_03/exercise_03_03/exercies_03_03.py | exercises/chapter_03/exercise_03_03/exercies_03_03.py | # 3-3 Your Own List
transportation = ["mountainbike", "teleportation", "Citroën DS3"]
print("A " + transportation[0] + " is good when exercising in the woods.\n")
print("The ultimate form of trarsportation must be " + transportation[1] + ".\n")
print("Should I buy a " + transportation[2] + "?\n")
| Add solution to exercise 3.3. | Add solution to exercise 3.3.
| Python | mit | HenrikSamuelsson/python-crash-course | Add solution to exercise 3.3. | # 3-3 Your Own List
transportation = ["mountainbike", "teleportation", "Citroën DS3"]
print("A " + transportation[0] + " is good when exercising in the woods.\n")
print("The ultimate form of trarsportation must be " + transportation[1] + ".\n")
print("Should I buy a " + transportation[2] + "?\n")
| <commit_before><commit_msg>Add solution to exercise 3.3.<commit_after> | # 3-3 Your Own List
transportation = ["mountainbike", "teleportation", "Citroën DS3"]
print("A " + transportation[0] + " is good when exercising in the woods.\n")
print("The ultimate form of trarsportation must be " + transportation[1] + ".\n")
print("Should I buy a " + transportation[2] + "?\n")
| Add solution to exercise 3.3.# 3-3 Your Own List
transportation = ["mountainbike", "teleportation", "Citroën DS3"]
print("A " + transportation[0] + " is good when exercising in the woods.\n")
print("The ultimate form of trarsportation must be " + transportation[1] + ".\n")
print("Should I buy a " + transportation[2] +... | <commit_before><commit_msg>Add solution to exercise 3.3.<commit_after># 3-3 Your Own List
transportation = ["mountainbike", "teleportation", "Citroën DS3"]
print("A " + transportation[0] + " is good when exercising in the woods.\n")
print("The ultimate form of trarsportation must be " + transportation[1] + ".\n")
prin... | |
c4b7bd5b74aaba210a05f946d59c98894b60b21f | tests/cli/test_pixel.py | tests/cli/test_pixel.py | """ Test ``yatsm line``
"""
import os
from click.testing import CliRunner
import pytest
from yatsm.cli.main import cli
@pytest.mark.skipif("DISPLAY" not in os.environ, reason="requires display")
def test_cli_pixel_pass_1(example_timeseries):
""" Correctly run for one pixel
"""
runner = CliRunner()
r... | Add test for pixel CLI | Add test for pixel CLI
| Python | mit | ceholden/yatsm,c11/yatsm,ceholden/yatsm,valpasq/yatsm,c11/yatsm,valpasq/yatsm | Add test for pixel CLI | """ Test ``yatsm line``
"""
import os
from click.testing import CliRunner
import pytest
from yatsm.cli.main import cli
@pytest.mark.skipif("DISPLAY" not in os.environ, reason="requires display")
def test_cli_pixel_pass_1(example_timeseries):
""" Correctly run for one pixel
"""
runner = CliRunner()
r... | <commit_before><commit_msg>Add test for pixel CLI<commit_after> | """ Test ``yatsm line``
"""
import os
from click.testing import CliRunner
import pytest
from yatsm.cli.main import cli
@pytest.mark.skipif("DISPLAY" not in os.environ, reason="requires display")
def test_cli_pixel_pass_1(example_timeseries):
""" Correctly run for one pixel
"""
runner = CliRunner()
r... | Add test for pixel CLI""" Test ``yatsm line``
"""
import os
from click.testing import CliRunner
import pytest
from yatsm.cli.main import cli
@pytest.mark.skipif("DISPLAY" not in os.environ, reason="requires display")
def test_cli_pixel_pass_1(example_timeseries):
""" Correctly run for one pixel
"""
runn... | <commit_before><commit_msg>Add test for pixel CLI<commit_after>""" Test ``yatsm line``
"""
import os
from click.testing import CliRunner
import pytest
from yatsm.cli.main import cli
@pytest.mark.skipif("DISPLAY" not in os.environ, reason="requires display")
def test_cli_pixel_pass_1(example_timeseries):
""" Cor... | |
555cfbb827532c54598cecde01ef4e6e5e07714d | test/worker_external_task_test.py | test/worker_external_task_test.py | # Copyright (c) 2015
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
# the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | Create a test for re-evaluating external tasks while a workflow is running. | Create a test for re-evaluating external tasks while a workflow is running.
| Python | apache-2.0 | dlstadther/luigi,ViaSat/luigi,adaitche/luigi,humanlongevity/luigi,PeteW/luigi,Houzz/luigi,ZhenxingWu/luigi,springcoil/luigi,ContextLogic/luigi,ivannotes/luigi,percyfal/luigi,belevtsoff/luigi,Yoone/luigi,meyerson/luigi,tuulos/luigi,dkroy/luigi,Houzz/luigi,Dawny33/luigi,theoryno3/luigi,JackDanger/luigi,Magnetic/luigi,bow... | Create a test for re-evaluating external tasks while a workflow is running. | # Copyright (c) 2015
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
# the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | <commit_before><commit_msg>Create a test for re-evaluating external tasks while a workflow is running.<commit_after> | # Copyright (c) 2015
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
# the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | Create a test for re-evaluating external tasks while a workflow is running.# Copyright (c) 2015
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
# the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
... | <commit_before><commit_msg>Create a test for re-evaluating external tasks while a workflow is running.<commit_after># Copyright (c) 2015
#
# 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
#
# ht... | |
68e056459dd3818ebb0c5dbdc8b4f1089bec9f07 | tests/selection_test.py | tests/selection_test.py | import os
import pytest
import yaml
from photoshell.selection import Selection
@pytest.fixture
def sidecar(tmpdir):
tmpdir.join("test.sidecar").write(yaml.dump({
'developed_path': os.path.join(tmpdir.strpath, "test.jpeg"),
'datetime': '2014-10-10 00:00'
}, default_flow_style=False))
retur... | Add a few behavior tests for selection | Add a few behavior tests for selection
| Python | mit | photoshell/photoshell,SamWhited/photoshell,campaul/photoshell | Add a few behavior tests for selection | import os
import pytest
import yaml
from photoshell.selection import Selection
@pytest.fixture
def sidecar(tmpdir):
tmpdir.join("test.sidecar").write(yaml.dump({
'developed_path': os.path.join(tmpdir.strpath, "test.jpeg"),
'datetime': '2014-10-10 00:00'
}, default_flow_style=False))
retur... | <commit_before><commit_msg>Add a few behavior tests for selection<commit_after> | import os
import pytest
import yaml
from photoshell.selection import Selection
@pytest.fixture
def sidecar(tmpdir):
tmpdir.join("test.sidecar").write(yaml.dump({
'developed_path': os.path.join(tmpdir.strpath, "test.jpeg"),
'datetime': '2014-10-10 00:00'
}, default_flow_style=False))
retur... | Add a few behavior tests for selectionimport os
import pytest
import yaml
from photoshell.selection import Selection
@pytest.fixture
def sidecar(tmpdir):
tmpdir.join("test.sidecar").write(yaml.dump({
'developed_path': os.path.join(tmpdir.strpath, "test.jpeg"),
'datetime': '2014-10-10 00:00'
}... | <commit_before><commit_msg>Add a few behavior tests for selection<commit_after>import os
import pytest
import yaml
from photoshell.selection import Selection
@pytest.fixture
def sidecar(tmpdir):
tmpdir.join("test.sidecar").write(yaml.dump({
'developed_path': os.path.join(tmpdir.strpath, "test.jpeg"),
... | |
ff2c4b68a5eace4451eeef4fd6ca84d37435c556 | project/editorial/migrations/0087_auto_20180226_1409.py | project/editorial/migrations/0087_auto_20180226_1409.py | # -*- coding: utf-8 -*-
# Generated by Django 1.11.9 on 2018-02-26 22:09
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('editorial', '0086_auto_20180102_2145'),
]
operatio... | Add fields to privatemessage for network invitations. | Add fields to privatemessage for network invitations.
| Python | mit | ProjectFacet/facet,ProjectFacet/facet,ProjectFacet/facet,ProjectFacet/facet,ProjectFacet/facet | Add fields to privatemessage for network invitations. | # -*- coding: utf-8 -*-
# Generated by Django 1.11.9 on 2018-02-26 22:09
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('editorial', '0086_auto_20180102_2145'),
]
operatio... | <commit_before><commit_msg>Add fields to privatemessage for network invitations.<commit_after> | # -*- coding: utf-8 -*-
# Generated by Django 1.11.9 on 2018-02-26 22:09
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('editorial', '0086_auto_20180102_2145'),
]
operatio... | Add fields to privatemessage for network invitations.# -*- coding: utf-8 -*-
# Generated by Django 1.11.9 on 2018-02-26 22:09
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('editor... | <commit_before><commit_msg>Add fields to privatemessage for network invitations.<commit_after># -*- coding: utf-8 -*-
# Generated by Django 1.11.9 on 2018-02-26 22:09
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration... | |
50742b6e629e6f54a9f3784a3c1495eb9d82c238 | brightway_projects/processing/processed_package.py | brightway_projects/processing/processed_package.py | from ..errors import InconsistentFields, NonUnique
def greedy_set_cover(data, exclude=None):
"""Find unique set of attributes that uniquely identifies each element in ``data``.
Feature selection is a well known problem, and is analogous to the `set cover problem <https://en.wikipedia.org/wiki/Set_cover_probl... | Add start of processed package | Add start of processed package
| Python | bsd-3-clause | brightway-lca/brightway | Add start of processed package | from ..errors import InconsistentFields, NonUnique
def greedy_set_cover(data, exclude=None):
"""Find unique set of attributes that uniquely identifies each element in ``data``.
Feature selection is a well known problem, and is analogous to the `set cover problem <https://en.wikipedia.org/wiki/Set_cover_probl... | <commit_before><commit_msg>Add start of processed package<commit_after> | from ..errors import InconsistentFields, NonUnique
def greedy_set_cover(data, exclude=None):
"""Find unique set of attributes that uniquely identifies each element in ``data``.
Feature selection is a well known problem, and is analogous to the `set cover problem <https://en.wikipedia.org/wiki/Set_cover_probl... | Add start of processed packagefrom ..errors import InconsistentFields, NonUnique
def greedy_set_cover(data, exclude=None):
"""Find unique set of attributes that uniquely identifies each element in ``data``.
Feature selection is a well known problem, and is analogous to the `set cover problem <https://en.wiki... | <commit_before><commit_msg>Add start of processed package<commit_after>from ..errors import InconsistentFields, NonUnique
def greedy_set_cover(data, exclude=None):
"""Find unique set of attributes that uniquely identifies each element in ``data``.
Feature selection is a well known problem, and is analogous t... | |
842869063ead9b2e6a1e22d11c9901072f2319aa | docs/generate_spec.py | docs/generate_spec.py | # -*- encoding: utf-8 -*-
#
# This script is to be used to automagically generate the recurring data types
# documentation based on the API specification.
#
# to run it just do:
#
# $ python generate_spec.py > outputfile.md
#
# :authors: Arturo Filastò
# :licence: see LICENSE
import inspect
from globaleaks.rest.mes... | Add script to self generate docs for recurring data types | Add script to self generate docs for recurring data types
| Python | agpl-3.0 | vodkina/GlobaLeaks,vodkina/GlobaLeaks,vodkina/GlobaLeaks,vodkina/GlobaLeaks | Add script to self generate docs for recurring data types | # -*- encoding: utf-8 -*-
#
# This script is to be used to automagically generate the recurring data types
# documentation based on the API specification.
#
# to run it just do:
#
# $ python generate_spec.py > outputfile.md
#
# :authors: Arturo Filastò
# :licence: see LICENSE
import inspect
from globaleaks.rest.mes... | <commit_before><commit_msg>Add script to self generate docs for recurring data types<commit_after> | # -*- encoding: utf-8 -*-
#
# This script is to be used to automagically generate the recurring data types
# documentation based on the API specification.
#
# to run it just do:
#
# $ python generate_spec.py > outputfile.md
#
# :authors: Arturo Filastò
# :licence: see LICENSE
import inspect
from globaleaks.rest.mes... | Add script to self generate docs for recurring data types# -*- encoding: utf-8 -*-
#
# This script is to be used to automagically generate the recurring data types
# documentation based on the API specification.
#
# to run it just do:
#
# $ python generate_spec.py > outputfile.md
#
# :authors: Arturo Filastò
# :licen... | <commit_before><commit_msg>Add script to self generate docs for recurring data types<commit_after># -*- encoding: utf-8 -*-
#
# This script is to be used to automagically generate the recurring data types
# documentation based on the API specification.
#
# to run it just do:
#
# $ python generate_spec.py > outputfile... | |
4694f6bf2405d0aae5e6c3fc393f8a839e8aac07 | tests/test_converter.py | tests/test_converter.py | # coding: utf-8
# Copyright (c) 2010-2012 Raphaël Barrois
import unittest
from confmgr import converter
class LineTestCase(unittest.TestCase):
def test_repr(self):
self.assertEqual("Line('foo', 'bar')",
repr(converter.Line('foo', 'bar')))
def test_equality(self):
self.assert... | Add tests for converter.Line and converter.Generator. | Add tests for converter.Line and converter.Generator.
Signed-off-by: Raphaël Barrois <8eb3b37a023209373fcd61a2fdc08256a14fb19c@polytechnique.org>
| Python | bsd-2-clause | rbarrois/uconf | Add tests for converter.Line and converter.Generator.
Signed-off-by: Raphaël Barrois <8eb3b37a023209373fcd61a2fdc08256a14fb19c@polytechnique.org> | # coding: utf-8
# Copyright (c) 2010-2012 Raphaël Barrois
import unittest
from confmgr import converter
class LineTestCase(unittest.TestCase):
def test_repr(self):
self.assertEqual("Line('foo', 'bar')",
repr(converter.Line('foo', 'bar')))
def test_equality(self):
self.assert... | <commit_before><commit_msg>Add tests for converter.Line and converter.Generator.
Signed-off-by: Raphaël Barrois <8eb3b37a023209373fcd61a2fdc08256a14fb19c@polytechnique.org><commit_after> | # coding: utf-8
# Copyright (c) 2010-2012 Raphaël Barrois
import unittest
from confmgr import converter
class LineTestCase(unittest.TestCase):
def test_repr(self):
self.assertEqual("Line('foo', 'bar')",
repr(converter.Line('foo', 'bar')))
def test_equality(self):
self.assert... | Add tests for converter.Line and converter.Generator.
Signed-off-by: Raphaël Barrois <8eb3b37a023209373fcd61a2fdc08256a14fb19c@polytechnique.org># coding: utf-8
# Copyright (c) 2010-2012 Raphaël Barrois
import unittest
from confmgr import converter
class LineTestCase(unittest.TestCase):
def test_repr(self):
... | <commit_before><commit_msg>Add tests for converter.Line and converter.Generator.
Signed-off-by: Raphaël Barrois <8eb3b37a023209373fcd61a2fdc08256a14fb19c@polytechnique.org><commit_after># coding: utf-8
# Copyright (c) 2010-2012 Raphaël Barrois
import unittest
from confmgr import converter
class LineTestCase(unitte... | |
00bfd02f921a42d4f288254d1accb7546d8df2c5 | check_hbase.py | check_hbase.py | #!/usr/bin/env python
# vim: ts=4:sw=4:et:sts=4:ai:tw=80
from utils import krb_wrapper,StringContext
import os
import argparse
import nagiosplugin
import re
import subprocess
html_auth = None
def parser():
version="0.1"
parser = argparse.ArgumentParser(description="Checks datanode")
parser.add_argument('-... | Add hbase consistency check throw hbase hbck command, easily can be added some checks like backups servers or region servers | Add hbase consistency check throw hbase hbck command, easily can be added some checks like backups servers or region servers
| Python | apache-2.0 | keedio/nagios-hadoop,keedio/nagios-hadoop | Add hbase consistency check throw hbase hbck command, easily can be added some checks like backups servers or region servers | #!/usr/bin/env python
# vim: ts=4:sw=4:et:sts=4:ai:tw=80
from utils import krb_wrapper,StringContext
import os
import argparse
import nagiosplugin
import re
import subprocess
html_auth = None
def parser():
version="0.1"
parser = argparse.ArgumentParser(description="Checks datanode")
parser.add_argument('-... | <commit_before><commit_msg>Add hbase consistency check throw hbase hbck command, easily can be added some checks like backups servers or region servers<commit_after> | #!/usr/bin/env python
# vim: ts=4:sw=4:et:sts=4:ai:tw=80
from utils import krb_wrapper,StringContext
import os
import argparse
import nagiosplugin
import re
import subprocess
html_auth = None
def parser():
version="0.1"
parser = argparse.ArgumentParser(description="Checks datanode")
parser.add_argument('-... | Add hbase consistency check throw hbase hbck command, easily can be added some checks like backups servers or region servers#!/usr/bin/env python
# vim: ts=4:sw=4:et:sts=4:ai:tw=80
from utils import krb_wrapper,StringContext
import os
import argparse
import nagiosplugin
import re
import subprocess
html_auth = None
de... | <commit_before><commit_msg>Add hbase consistency check throw hbase hbck command, easily can be added some checks like backups servers or region servers<commit_after>#!/usr/bin/env python
# vim: ts=4:sw=4:et:sts=4:ai:tw=80
from utils import krb_wrapper,StringContext
import os
import argparse
import nagiosplugin
import r... | |
bcb6c0780aacf77069a08f8d5b44d295881d9b9d | swapOddEvenChar.py | swapOddEvenChar.py | #Python3
word = list(input().strip())
for i in range(0,len(word),2):
if(i+1>=len(word)):
break
word[i],word[i+1] = word[i+1],word[i]
print(''.join(word)) | Create solution to swap odd even characters | Create solution to swap odd even characters
| Python | mit | laxmena/CodeKata,laxmena/CodeKata | Create solution to swap odd even characters | #Python3
word = list(input().strip())
for i in range(0,len(word),2):
if(i+1>=len(word)):
break
word[i],word[i+1] = word[i+1],word[i]
print(''.join(word)) | <commit_before><commit_msg>Create solution to swap odd even characters<commit_after> | #Python3
word = list(input().strip())
for i in range(0,len(word),2):
if(i+1>=len(word)):
break
word[i],word[i+1] = word[i+1],word[i]
print(''.join(word)) | Create solution to swap odd even characters#Python3
word = list(input().strip())
for i in range(0,len(word),2):
if(i+1>=len(word)):
break
word[i],word[i+1] = word[i+1],word[i]
print(''.join(word)) | <commit_before><commit_msg>Create solution to swap odd even characters<commit_after>#Python3
word = list(input().strip())
for i in range(0,len(word),2):
if(i+1>=len(word)):
break
word[i],word[i+1] = word[i+1],word[i]
print(''.join(word)) | |
7bde47d48f4e80b4449049a8b05767b30eb2c516 | utilities/export-csv.py | utilities/export-csv.py | #!/usr/bin/python
import os
import csv
import sys
sys.path.append('../pynipap')
import pynipap
class Export:
def __init__(self, xmlrpc_uri):
self.xmlrpc_uri = xmlrpc_uri
def write(self, output_file, schema_name):
"""
"""
f = open(output_file, "w+")
writer = csv.writer(f, quoting=csv.QUOTE_MINIMAL)
p... | Add stupid CSV export example | Add stupid CSV export example
Fixes #53
| Python | mit | SoundGoof/NIPAP,plajjan/NIPAP,SpriteLink/NIPAP,bbaja42/NIPAP,ettrig/NIPAP,bbaja42/NIPAP,fredsod/NIPAP,SoundGoof/NIPAP,fredsod/NIPAP,ettrig/NIPAP,SpriteLink/NIPAP,ettrig/NIPAP,SoundGoof/NIPAP,bbaja42/NIPAP,fredsod/NIPAP,fredsod/NIPAP,fredsod/NIPAP,garberg/NIPAP,bbaja42/NIPAP,garberg/NIPAP,SpriteLink/NIPAP,plajjan/NIPAP,... | Add stupid CSV export example
Fixes #53 | #!/usr/bin/python
import os
import csv
import sys
sys.path.append('../pynipap')
import pynipap
class Export:
def __init__(self, xmlrpc_uri):
self.xmlrpc_uri = xmlrpc_uri
def write(self, output_file, schema_name):
"""
"""
f = open(output_file, "w+")
writer = csv.writer(f, quoting=csv.QUOTE_MINIMAL)
p... | <commit_before><commit_msg>Add stupid CSV export example
Fixes #53<commit_after> | #!/usr/bin/python
import os
import csv
import sys
sys.path.append('../pynipap')
import pynipap
class Export:
def __init__(self, xmlrpc_uri):
self.xmlrpc_uri = xmlrpc_uri
def write(self, output_file, schema_name):
"""
"""
f = open(output_file, "w+")
writer = csv.writer(f, quoting=csv.QUOTE_MINIMAL)
p... | Add stupid CSV export example
Fixes #53#!/usr/bin/python
import os
import csv
import sys
sys.path.append('../pynipap')
import pynipap
class Export:
def __init__(self, xmlrpc_uri):
self.xmlrpc_uri = xmlrpc_uri
def write(self, output_file, schema_name):
"""
"""
f = open(output_file, "w+")
writer = csv.w... | <commit_before><commit_msg>Add stupid CSV export example
Fixes #53<commit_after>#!/usr/bin/python
import os
import csv
import sys
sys.path.append('../pynipap')
import pynipap
class Export:
def __init__(self, xmlrpc_uri):
self.xmlrpc_uri = xmlrpc_uri
def write(self, output_file, schema_name):
"""
"""
f =... | |
e9d87a087a0f0102157d7c718a048c72f655c54a | smore/ext/marshmallow.py | smore/ext/marshmallow.py | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from marshmallow.compat import iteritems
from marshmallow import class_registry
from smore import swagger
from smore.apispec.core import Path
from smore.apispec.utils import load_operations_from_docstring
def schema_definition_helper(name, schema, **kwar... | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from marshmallow.compat import iteritems
from marshmallow import class_registry
from smore import swagger
from smore.apispec.core import Path
from smore.apispec.utils import load_operations_from_docstring
def schema_definition_helper(spec, name, schema, ... | Store registered refs as plugin metadata | Store registered refs as plugin metadata
| Python | mit | marshmallow-code/apispec,Nobatek/apispec,marshmallow-code/smore,gorgias/apispec,jmcarp/smore | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from marshmallow.compat import iteritems
from marshmallow import class_registry
from smore import swagger
from smore.apispec.core import Path
from smore.apispec.utils import load_operations_from_docstring
def schema_definition_helper(name, schema, **kwar... | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from marshmallow.compat import iteritems
from marshmallow import class_registry
from smore import swagger
from smore.apispec.core import Path
from smore.apispec.utils import load_operations_from_docstring
def schema_definition_helper(spec, name, schema, ... | <commit_before># -*- coding: utf-8 -*-
from __future__ import absolute_import
from marshmallow.compat import iteritems
from marshmallow import class_registry
from smore import swagger
from smore.apispec.core import Path
from smore.apispec.utils import load_operations_from_docstring
def schema_definition_helper(name,... | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from marshmallow.compat import iteritems
from marshmallow import class_registry
from smore import swagger
from smore.apispec.core import Path
from smore.apispec.utils import load_operations_from_docstring
def schema_definition_helper(spec, name, schema, ... | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from marshmallow.compat import iteritems
from marshmallow import class_registry
from smore import swagger
from smore.apispec.core import Path
from smore.apispec.utils import load_operations_from_docstring
def schema_definition_helper(name, schema, **kwar... | <commit_before># -*- coding: utf-8 -*-
from __future__ import absolute_import
from marshmallow.compat import iteritems
from marshmallow import class_registry
from smore import swagger
from smore.apispec.core import Path
from smore.apispec.utils import load_operations_from_docstring
def schema_definition_helper(name,... |
7b09a44c7df8b2aa28e45c5382626c2f8c4bf61b | bin/run_redpen.py | bin/run_redpen.py | #!/usr/bin/python
import os
import re
import shutil
from optparse import OptionParser
def main():
parser = OptionParser(usage="usage: %prog [options]",
version="%prog 1.0")
parser.add_option("-i", "--inputdir",
action="store",
dest="indir",... | Add a script to convert from rst style files to markdown | Add a script to convert from rst style files to markdown
| Python | apache-2.0 | kenhys/redpen-doc,kenhys/redpen-doc | Add a script to convert from rst style files to markdown | #!/usr/bin/python
import os
import re
import shutil
from optparse import OptionParser
def main():
parser = OptionParser(usage="usage: %prog [options]",
version="%prog 1.0")
parser.add_option("-i", "--inputdir",
action="store",
dest="indir",... | <commit_before><commit_msg>Add a script to convert from rst style files to markdown<commit_after> | #!/usr/bin/python
import os
import re
import shutil
from optparse import OptionParser
def main():
parser = OptionParser(usage="usage: %prog [options]",
version="%prog 1.0")
parser.add_option("-i", "--inputdir",
action="store",
dest="indir",... | Add a script to convert from rst style files to markdown#!/usr/bin/python
import os
import re
import shutil
from optparse import OptionParser
def main():
parser = OptionParser(usage="usage: %prog [options]",
version="%prog 1.0")
parser.add_option("-i", "--inputdir",
... | <commit_before><commit_msg>Add a script to convert from rst style files to markdown<commit_after>#!/usr/bin/python
import os
import re
import shutil
from optparse import OptionParser
def main():
parser = OptionParser(usage="usage: %prog [options]",
version="%prog 1.0")
parser.add_opt... | |
419ca7099bf47ed00ede73d9de14690a643a3943 | test/test_integration.py | test/test_integration.py | """Integrations tests for EcoData Retriever"""
import os
import shutil
from retriever import HOME_DIR
simple_csv = {'name': 'simple_csv',
'raw_data': "a,b,c\n1,2,3\n4,5,6",
'script': "shortname: simple_csv\ntable: simple_csv, http://example.com/simple_csv.txt",
'expect_out': ... | Add data for integration testing of basic csv and crosstab formats | Add data for integration testing of basic csv and crosstab formats
| Python | mit | henrykironde/deletedret,goelakash/retriever,henrykironde/deletedret,goelakash/retriever | Add data for integration testing of basic csv and crosstab formats | """Integrations tests for EcoData Retriever"""
import os
import shutil
from retriever import HOME_DIR
simple_csv = {'name': 'simple_csv',
'raw_data': "a,b,c\n1,2,3\n4,5,6",
'script': "shortname: simple_csv\ntable: simple_csv, http://example.com/simple_csv.txt",
'expect_out': ... | <commit_before><commit_msg>Add data for integration testing of basic csv and crosstab formats<commit_after> | """Integrations tests for EcoData Retriever"""
import os
import shutil
from retriever import HOME_DIR
simple_csv = {'name': 'simple_csv',
'raw_data': "a,b,c\n1,2,3\n4,5,6",
'script': "shortname: simple_csv\ntable: simple_csv, http://example.com/simple_csv.txt",
'expect_out': ... | Add data for integration testing of basic csv and crosstab formats"""Integrations tests for EcoData Retriever"""
import os
import shutil
from retriever import HOME_DIR
simple_csv = {'name': 'simple_csv',
'raw_data': "a,b,c\n1,2,3\n4,5,6",
'script': "shortname: simple_csv\ntable: simple_csv... | <commit_before><commit_msg>Add data for integration testing of basic csv and crosstab formats<commit_after>"""Integrations tests for EcoData Retriever"""
import os
import shutil
from retriever import HOME_DIR
simple_csv = {'name': 'simple_csv',
'raw_data': "a,b,c\n1,2,3\n4,5,6",
'script': ... | |
2af53a39096c0eab9d95c304c802281fe3c580ae | tests/pickle_test.py | tests/pickle_test.py | # Copyright 2021 Google LLC
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | Make JAX CompiledFunction objects pickle-able. | [XLA:Python] Make JAX CompiledFunction objects pickle-able.
PiperOrigin-RevId: 388814246
| Python | apache-2.0 | google/jax,google/jax,google/jax,google/jax | [XLA:Python] Make JAX CompiledFunction objects pickle-able.
PiperOrigin-RevId: 388814246 | # Copyright 2021 Google LLC
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | <commit_before><commit_msg>[XLA:Python] Make JAX CompiledFunction objects pickle-able.
PiperOrigin-RevId: 388814246<commit_after> | # Copyright 2021 Google LLC
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | [XLA:Python] Make JAX CompiledFunction objects pickle-able.
PiperOrigin-RevId: 388814246# Copyright 2021 Google LLC
#
# 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
#
# https://www.apache... | <commit_before><commit_msg>[XLA:Python] Make JAX CompiledFunction objects pickle-able.
PiperOrigin-RevId: 388814246<commit_after># Copyright 2021 Google LLC
#
# 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 ... | |
6f00204ae2603063eafbd74a369e9da0864854ca | poll/management/commands/create_new_violence_polls.py | poll/management/commands/create_new_violence_polls.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
from django.core.management.base import BaseCommand
import traceback
from poll.models import Poll
from unregister.models import Blacklist
from django.conf import settings
from optparse import make_option
from poll.forms import NewPollForm
from django.contrib.sites.models impo... | Create new monthly violence polls | Create new monthly violence polls
| Python | bsd-3-clause | unicefuganda/edtrac,unicefuganda/edtrac,unicefuganda/edtrac | Create new monthly violence polls | #!/usr/bin/python
# -*- coding: utf-8 -*-
from django.core.management.base import BaseCommand
import traceback
from poll.models import Poll
from unregister.models import Blacklist
from django.conf import settings
from optparse import make_option
from poll.forms import NewPollForm
from django.contrib.sites.models impo... | <commit_before><commit_msg>Create new monthly violence polls<commit_after> | #!/usr/bin/python
# -*- coding: utf-8 -*-
from django.core.management.base import BaseCommand
import traceback
from poll.models import Poll
from unregister.models import Blacklist
from django.conf import settings
from optparse import make_option
from poll.forms import NewPollForm
from django.contrib.sites.models impo... | Create new monthly violence polls#!/usr/bin/python
# -*- coding: utf-8 -*-
from django.core.management.base import BaseCommand
import traceback
from poll.models import Poll
from unregister.models import Blacklist
from django.conf import settings
from optparse import make_option
from poll.forms import NewPollForm
from... | <commit_before><commit_msg>Create new monthly violence polls<commit_after>#!/usr/bin/python
# -*- coding: utf-8 -*-
from django.core.management.base import BaseCommand
import traceback
from poll.models import Poll
from unregister.models import Blacklist
from django.conf import settings
from optparse import make_optio... | |
23c09555221b3f7500a4c658452c9c0cb223799c | Train_SDAE/tools/evaluate_model.py | Train_SDAE/tools/evaluate_model.py | import numpy as np
# import pandas as pd
# import sys
from scipy.special import expit
from sklearn import ensemble
def get_activations(exp_data, w, b):
exp_data = np.transpose(exp_data)
prod = exp_data.dot(w)
prod_with_bias = prod + b
return( expit(prod_with_bias) )
# Order of *args: first all the wei... | Add evaluation using random forest | Add evaluation using random forest | Python | apache-2.0 | glrs/StackedDAE,glrs/StackedDAE | Add evaluation using random forest | import numpy as np
# import pandas as pd
# import sys
from scipy.special import expit
from sklearn import ensemble
def get_activations(exp_data, w, b):
exp_data = np.transpose(exp_data)
prod = exp_data.dot(w)
prod_with_bias = prod + b
return( expit(prod_with_bias) )
# Order of *args: first all the wei... | <commit_before><commit_msg>Add evaluation using random forest<commit_after> | import numpy as np
# import pandas as pd
# import sys
from scipy.special import expit
from sklearn import ensemble
def get_activations(exp_data, w, b):
exp_data = np.transpose(exp_data)
prod = exp_data.dot(w)
prod_with_bias = prod + b
return( expit(prod_with_bias) )
# Order of *args: first all the wei... | Add evaluation using random forestimport numpy as np
# import pandas as pd
# import sys
from scipy.special import expit
from sklearn import ensemble
def get_activations(exp_data, w, b):
exp_data = np.transpose(exp_data)
prod = exp_data.dot(w)
prod_with_bias = prod + b
return( expit(prod_with_bias) )
#... | <commit_before><commit_msg>Add evaluation using random forest<commit_after>import numpy as np
# import pandas as pd
# import sys
from scipy.special import expit
from sklearn import ensemble
def get_activations(exp_data, w, b):
exp_data = np.transpose(exp_data)
prod = exp_data.dot(w)
prod_with_bias = prod +... | |
009df3372804fa946b7e1bd4c0827e887b964b38 | convert.py | convert.py | from bs4 import BeautifulSoup
import io
import markdown2
import time
import codecs
file = io.open("Import/blog-03-03-2013.xml")
file_contents = file.read(-1)
#lxml xpath doesn't seem to understand blogger export
soup = BeautifulSoup(file_contents)
entries = soup("entry")
count = 0
def formatTime(timefield):
tim... | Convert blogger to simple xml | Convert blogger to simple xml
| Python | mit | progrn/csb | Convert blogger to simple xml | from bs4 import BeautifulSoup
import io
import markdown2
import time
import codecs
file = io.open("Import/blog-03-03-2013.xml")
file_contents = file.read(-1)
#lxml xpath doesn't seem to understand blogger export
soup = BeautifulSoup(file_contents)
entries = soup("entry")
count = 0
def formatTime(timefield):
tim... | <commit_before><commit_msg>Convert blogger to simple xml<commit_after> | from bs4 import BeautifulSoup
import io
import markdown2
import time
import codecs
file = io.open("Import/blog-03-03-2013.xml")
file_contents = file.read(-1)
#lxml xpath doesn't seem to understand blogger export
soup = BeautifulSoup(file_contents)
entries = soup("entry")
count = 0
def formatTime(timefield):
tim... | Convert blogger to simple xmlfrom bs4 import BeautifulSoup
import io
import markdown2
import time
import codecs
file = io.open("Import/blog-03-03-2013.xml")
file_contents = file.read(-1)
#lxml xpath doesn't seem to understand blogger export
soup = BeautifulSoup(file_contents)
entries = soup("entry")
count = 0
def f... | <commit_before><commit_msg>Convert blogger to simple xml<commit_after>from bs4 import BeautifulSoup
import io
import markdown2
import time
import codecs
file = io.open("Import/blog-03-03-2013.xml")
file_contents = file.read(-1)
#lxml xpath doesn't seem to understand blogger export
soup = BeautifulSoup(file_contents)
... | |
7d5dcaa0a72dbdd78e192f082bbdf261de1d8963 | Codewars/DeleteOccurrencesOfElementOverNTimes.py | Codewars/DeleteOccurrencesOfElementOverNTimes.py | # implemented with list comprehension with side-effects and a global variable
# there's a simpler way to do it with list appends that's probably no less efficient, since Python arrays are dynamic, but I wanted to try this out instead
from collections import Counter
c = Counter()
# for use in list comprehensions with... | Delete occurrences of an element if it occurs more than n times | Codewars: Delete occurrences of an element if it occurs more than n times
| Python | unlicense | SelvorWhim/competitive,SelvorWhim/competitive,SelvorWhim/competitive,SelvorWhim/competitive | Codewars: Delete occurrences of an element if it occurs more than n times | # implemented with list comprehension with side-effects and a global variable
# there's a simpler way to do it with list appends that's probably no less efficient, since Python arrays are dynamic, but I wanted to try this out instead
from collections import Counter
c = Counter()
# for use in list comprehensions with... | <commit_before><commit_msg>Codewars: Delete occurrences of an element if it occurs more than n times<commit_after> | # implemented with list comprehension with side-effects and a global variable
# there's a simpler way to do it with list appends that's probably no less efficient, since Python arrays are dynamic, but I wanted to try this out instead
from collections import Counter
c = Counter()
# for use in list comprehensions with... | Codewars: Delete occurrences of an element if it occurs more than n times# implemented with list comprehension with side-effects and a global variable
# there's a simpler way to do it with list appends that's probably no less efficient, since Python arrays are dynamic, but I wanted to try this out instead
from collect... | <commit_before><commit_msg>Codewars: Delete occurrences of an element if it occurs more than n times<commit_after># implemented with list comprehension with side-effects and a global variable
# there's a simpler way to do it with list appends that's probably no less efficient, since Python arrays are dynamic, but I wan... | |
096c8165ec2beacbc4897285b8fed439765d3e01 | test/integration/ggrc/models/test_document.py | test/integration/ggrc/models/test_document.py | # Copyright (C) 2017 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
"""Integration tests for Document"""
from ggrc.models import all_models
from integration.ggrc import TestCase
from integration.ggrc.api_helper import Api
from integration.ggrc.models import factories
clas... | Add test on update document title | Add test on update document title
| Python | apache-2.0 | AleksNeStu/ggrc-core,AleksNeStu/ggrc-core,AleksNeStu/ggrc-core,AleksNeStu/ggrc-core | Add test on update document title | # Copyright (C) 2017 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
"""Integration tests for Document"""
from ggrc.models import all_models
from integration.ggrc import TestCase
from integration.ggrc.api_helper import Api
from integration.ggrc.models import factories
clas... | <commit_before><commit_msg>Add test on update document title<commit_after> | # Copyright (C) 2017 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
"""Integration tests for Document"""
from ggrc.models import all_models
from integration.ggrc import TestCase
from integration.ggrc.api_helper import Api
from integration.ggrc.models import factories
clas... | Add test on update document title# Copyright (C) 2017 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
"""Integration tests for Document"""
from ggrc.models import all_models
from integration.ggrc import TestCase
from integration.ggrc.api_helper import Api
from integration.gg... | <commit_before><commit_msg>Add test on update document title<commit_after># Copyright (C) 2017 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
"""Integration tests for Document"""
from ggrc.models import all_models
from integration.ggrc import TestCase
from integration.ggrc.... | |
864bf2bb3bdb731d0725cc33891145f2a7da17d3 | db/common.py | db/common.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
from contextlib import contextmanager
from sqlalchemy import create_engine
from sqlalchemy.orm.session import sessionmaker
from sqlalchemy.schema import MetaData
from sqlalchemy.ext.declarative import declarative_base
from utils import get_connection_string_fr... | Add initialization functions for database connection | Add initialization functions for database connection
| Python | mit | leaffan/pynhldb | Add initialization functions for database connection | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
from contextlib import contextmanager
from sqlalchemy import create_engine
from sqlalchemy.orm.session import sessionmaker
from sqlalchemy.schema import MetaData
from sqlalchemy.ext.declarative import declarative_base
from utils import get_connection_string_fr... | <commit_before><commit_msg>Add initialization functions for database connection<commit_after> | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
from contextlib import contextmanager
from sqlalchemy import create_engine
from sqlalchemy.orm.session import sessionmaker
from sqlalchemy.schema import MetaData
from sqlalchemy.ext.declarative import declarative_base
from utils import get_connection_string_fr... | Add initialization functions for database connection#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
from contextlib import contextmanager
from sqlalchemy import create_engine
from sqlalchemy.orm.session import sessionmaker
from sqlalchemy.schema import MetaData
from sqlalchemy.ext.declarative import declarat... | <commit_before><commit_msg>Add initialization functions for database connection<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
from contextlib import contextmanager
from sqlalchemy import create_engine
from sqlalchemy.orm.session import sessionmaker
from sqlalchemy.schema import MetaData
from s... | |
3fb3662e58e35ccb283074c1078e1c9e7aaf88ed | LendingClub/tests/live_session_test.py | LendingClub/tests/live_session_test.py | #!/usr/bin/env python
import sys
import unittest
import getpass
from logger import TestLogger
sys.path.insert(0, '.')
sys.path.insert(0, '../')
sys.path.insert(0, '../../')
from LendingClub import session
class LiveTestSession(unittest.TestCase):
http = None
session = None
logger = None
def setUp(... | Add live test for session | Add live test for session
| Python | mit | jgillick/LendingClub,carlosnasillo/LendingClub,jgillick/LendingClub,carlosnasillo/LendingClub | Add live test for session | #!/usr/bin/env python
import sys
import unittest
import getpass
from logger import TestLogger
sys.path.insert(0, '.')
sys.path.insert(0, '../')
sys.path.insert(0, '../../')
from LendingClub import session
class LiveTestSession(unittest.TestCase):
http = None
session = None
logger = None
def setUp(... | <commit_before><commit_msg>Add live test for session<commit_after> | #!/usr/bin/env python
import sys
import unittest
import getpass
from logger import TestLogger
sys.path.insert(0, '.')
sys.path.insert(0, '../')
sys.path.insert(0, '../../')
from LendingClub import session
class LiveTestSession(unittest.TestCase):
http = None
session = None
logger = None
def setUp(... | Add live test for session#!/usr/bin/env python
import sys
import unittest
import getpass
from logger import TestLogger
sys.path.insert(0, '.')
sys.path.insert(0, '../')
sys.path.insert(0, '../../')
from LendingClub import session
class LiveTestSession(unittest.TestCase):
http = None
session = None
logg... | <commit_before><commit_msg>Add live test for session<commit_after>#!/usr/bin/env python
import sys
import unittest
import getpass
from logger import TestLogger
sys.path.insert(0, '.')
sys.path.insert(0, '../')
sys.path.insert(0, '../../')
from LendingClub import session
class LiveTestSession(unittest.TestCase):
... | |
9e4858e652fba57f767a9c6d921853a6487301bd | epsilon/test/test_version.py | epsilon/test/test_version.py | """
Tests for turning simple version strings into twisted.python.versions.Version
objects.
"""
from epsilon import asTwistedVersion
from twisted.trial.unittest import SynchronousTestCase
class AsTwistedVersionTests(SynchronousTestCase):
def test_simple(self):
"""
A simple version string can be tu... | Add a test for the version string parsing code | Add a test for the version string parsing code | Python | mit | twisted/epsilon | Add a test for the version string parsing code | """
Tests for turning simple version strings into twisted.python.versions.Version
objects.
"""
from epsilon import asTwistedVersion
from twisted.trial.unittest import SynchronousTestCase
class AsTwistedVersionTests(SynchronousTestCase):
def test_simple(self):
"""
A simple version string can be tu... | <commit_before><commit_msg>Add a test for the version string parsing code<commit_after> | """
Tests for turning simple version strings into twisted.python.versions.Version
objects.
"""
from epsilon import asTwistedVersion
from twisted.trial.unittest import SynchronousTestCase
class AsTwistedVersionTests(SynchronousTestCase):
def test_simple(self):
"""
A simple version string can be tu... | Add a test for the version string parsing code"""
Tests for turning simple version strings into twisted.python.versions.Version
objects.
"""
from epsilon import asTwistedVersion
from twisted.trial.unittest import SynchronousTestCase
class AsTwistedVersionTests(SynchronousTestCase):
def test_simple(self):
... | <commit_before><commit_msg>Add a test for the version string parsing code<commit_after>"""
Tests for turning simple version strings into twisted.python.versions.Version
objects.
"""
from epsilon import asTwistedVersion
from twisted.trial.unittest import SynchronousTestCase
class AsTwistedVersionTests(SynchronousTest... | |
9668580633a1a8baaa59030e5a52d2478222cbd2 | nodeconductor/openstack/cost_tracking.py | nodeconductor/openstack/cost_tracking.py | from . import models
from nodeconductor.cost_tracking import CostTrackingBackend
class OpenStackCostTrackingBackend(CostTrackingBackend):
@classmethod
def get_monthly_cost_estimate(cls, resource):
backend = resource.get_backend()
return backend.get_monthly_cost_estimate()
| Add cost tracking file to openstack | Add cost tracking file to openstack
- saas-951
| Python | mit | opennode/nodeconductor,opennode/nodeconductor,opennode/nodeconductor | Add cost tracking file to openstack
- saas-951 | from . import models
from nodeconductor.cost_tracking import CostTrackingBackend
class OpenStackCostTrackingBackend(CostTrackingBackend):
@classmethod
def get_monthly_cost_estimate(cls, resource):
backend = resource.get_backend()
return backend.get_monthly_cost_estimate()
| <commit_before><commit_msg>Add cost tracking file to openstack
- saas-951<commit_after> | from . import models
from nodeconductor.cost_tracking import CostTrackingBackend
class OpenStackCostTrackingBackend(CostTrackingBackend):
@classmethod
def get_monthly_cost_estimate(cls, resource):
backend = resource.get_backend()
return backend.get_monthly_cost_estimate()
| Add cost tracking file to openstack
- saas-951from . import models
from nodeconductor.cost_tracking import CostTrackingBackend
class OpenStackCostTrackingBackend(CostTrackingBackend):
@classmethod
def get_monthly_cost_estimate(cls, resource):
backend = resource.get_backend()
return backend.... | <commit_before><commit_msg>Add cost tracking file to openstack
- saas-951<commit_after>from . import models
from nodeconductor.cost_tracking import CostTrackingBackend
class OpenStackCostTrackingBackend(CostTrackingBackend):
@classmethod
def get_monthly_cost_estimate(cls, resource):
backend = resou... | |
a12dd320df30404df8c8ec196e21067376cc1e2c | astropy/table/tests/test_pickle.py | astropy/table/tests/test_pickle.py | import cPickle as pickle
import numpy as np
import pytest
from ...table import Table, Column, MaskedColumn
@pytest.fixture(params=[0, 1, -1])
def protocol(request):
"""
Fixture to run all the tests for protocols 0 and 1, and -1 (most advanced).
"""
return request.param
def test_pickle_column(proto... | Add tests of table and column pickling | Add tests of table and column pickling
| Python | bsd-3-clause | mhvk/astropy,astropy/astropy,astropy/astropy,larrybradley/astropy,funbaker/astropy,joergdietrich/astropy,joergdietrich/astropy,dhomeier/astropy,larrybradley/astropy,pllim/astropy,MSeifert04/astropy,pllim/astropy,dhomeier/astropy,StuartLittlefair/astropy,tbabej/astropy,lpsinger/astropy,saimn/astropy,tbabej/astropy,dhome... | Add tests of table and column pickling | import cPickle as pickle
import numpy as np
import pytest
from ...table import Table, Column, MaskedColumn
@pytest.fixture(params=[0, 1, -1])
def protocol(request):
"""
Fixture to run all the tests for protocols 0 and 1, and -1 (most advanced).
"""
return request.param
def test_pickle_column(proto... | <commit_before><commit_msg>Add tests of table and column pickling<commit_after> | import cPickle as pickle
import numpy as np
import pytest
from ...table import Table, Column, MaskedColumn
@pytest.fixture(params=[0, 1, -1])
def protocol(request):
"""
Fixture to run all the tests for protocols 0 and 1, and -1 (most advanced).
"""
return request.param
def test_pickle_column(proto... | Add tests of table and column picklingimport cPickle as pickle
import numpy as np
import pytest
from ...table import Table, Column, MaskedColumn
@pytest.fixture(params=[0, 1, -1])
def protocol(request):
"""
Fixture to run all the tests for protocols 0 and 1, and -1 (most advanced).
"""
return reques... | <commit_before><commit_msg>Add tests of table and column pickling<commit_after>import cPickle as pickle
import numpy as np
import pytest
from ...table import Table, Column, MaskedColumn
@pytest.fixture(params=[0, 1, -1])
def protocol(request):
"""
Fixture to run all the tests for protocols 0 and 1, and -1 (... | |
0c6becaa179aba9408def1b3cce61d5ec1509942 | python/main.py | python/main.py | from simul import *
if __name__ == '__main__':
# create a new simulation
s = Simulation(Re=5)
# initial conditions psi(0) = 0, Omega(0) = 0
s.psi.initial("null")
s.omega.initial("null")
# T_n(t=0) = sin(pi*k*dz) & T_0(t=0) = 1-k*dz
s.T.initial(lambda n, k: T_0(n,k,s))
# main loop over... | Load the simul module and run a simulation | Load the simul module and run a simulation
| Python | apache-2.0 | cphyc/MHD_simulation,cphyc/MHD_simulation | Load the simul module and run a simulation | from simul import *
if __name__ == '__main__':
# create a new simulation
s = Simulation(Re=5)
# initial conditions psi(0) = 0, Omega(0) = 0
s.psi.initial("null")
s.omega.initial("null")
# T_n(t=0) = sin(pi*k*dz) & T_0(t=0) = 1-k*dz
s.T.initial(lambda n, k: T_0(n,k,s))
# main loop over... | <commit_before><commit_msg>Load the simul module and run a simulation<commit_after> | from simul import *
if __name__ == '__main__':
# create a new simulation
s = Simulation(Re=5)
# initial conditions psi(0) = 0, Omega(0) = 0
s.psi.initial("null")
s.omega.initial("null")
# T_n(t=0) = sin(pi*k*dz) & T_0(t=0) = 1-k*dz
s.T.initial(lambda n, k: T_0(n,k,s))
# main loop over... | Load the simul module and run a simulationfrom simul import *
if __name__ == '__main__':
# create a new simulation
s = Simulation(Re=5)
# initial conditions psi(0) = 0, Omega(0) = 0
s.psi.initial("null")
s.omega.initial("null")
# T_n(t=0) = sin(pi*k*dz) & T_0(t=0) = 1-k*dz
s.T.initial(lamb... | <commit_before><commit_msg>Load the simul module and run a simulation<commit_after>from simul import *
if __name__ == '__main__':
# create a new simulation
s = Simulation(Re=5)
# initial conditions psi(0) = 0, Omega(0) = 0
s.psi.initial("null")
s.omega.initial("null")
# T_n(t=0) = sin(pi*k*dz)... | |
989a94c81f74a17707e66f126960b6bb45e9b4d5 | migrations/versions/3042d0ca43bf_index_job_project_id.py | migrations/versions/3042d0ca43bf_index_job_project_id.py | """Index Job(project_id, status, date_created) where patch_id IS NULL
Revision ID: 3042d0ca43bf
Revises: 3a3366fb7822
Create Date: 2014-01-03 15:24:39.947813
"""
# revision identifiers, used by Alembic.
revision = '3042d0ca43bf'
down_revision = '3a3366fb7822'
from alembic import op
def upgrade():
op.execute('... | Add index to cover testgroup_details (previous runs) | Add index to cover testgroup_details (previous runs)
| Python | apache-2.0 | dropbox/changes,bowlofstew/changes,dropbox/changes,dropbox/changes,bowlofstew/changes,bowlofstew/changes,wfxiang08/changes,bowlofstew/changes,wfxiang08/changes,wfxiang08/changes,wfxiang08/changes,dropbox/changes | Add index to cover testgroup_details (previous runs) | """Index Job(project_id, status, date_created) where patch_id IS NULL
Revision ID: 3042d0ca43bf
Revises: 3a3366fb7822
Create Date: 2014-01-03 15:24:39.947813
"""
# revision identifiers, used by Alembic.
revision = '3042d0ca43bf'
down_revision = '3a3366fb7822'
from alembic import op
def upgrade():
op.execute('... | <commit_before><commit_msg>Add index to cover testgroup_details (previous runs)<commit_after> | """Index Job(project_id, status, date_created) where patch_id IS NULL
Revision ID: 3042d0ca43bf
Revises: 3a3366fb7822
Create Date: 2014-01-03 15:24:39.947813
"""
# revision identifiers, used by Alembic.
revision = '3042d0ca43bf'
down_revision = '3a3366fb7822'
from alembic import op
def upgrade():
op.execute('... | Add index to cover testgroup_details (previous runs)"""Index Job(project_id, status, date_created) where patch_id IS NULL
Revision ID: 3042d0ca43bf
Revises: 3a3366fb7822
Create Date: 2014-01-03 15:24:39.947813
"""
# revision identifiers, used by Alembic.
revision = '3042d0ca43bf'
down_revision = '3a3366fb7822'
from... | <commit_before><commit_msg>Add index to cover testgroup_details (previous runs)<commit_after>"""Index Job(project_id, status, date_created) where patch_id IS NULL
Revision ID: 3042d0ca43bf
Revises: 3a3366fb7822
Create Date: 2014-01-03 15:24:39.947813
"""
# revision identifiers, used by Alembic.
revision = '3042d0ca4... | |
8b9fe74976d77df32d73792f74ef4ddea1eb525f | config.py | config.py | #! /usr/bin/env python
import os
import warnings
import yaml
class Config(object):
config_fname = "configuration.yaml"
def __init__(self, config_fname=None):
config_fname = config_fname or self.config_fname
fo = open(config_fname, "r")
blob = fo.read()
fo.close()
self... | #! /usr/bin/env python
import os
import warnings
import yaml
class Config(object):
config_fname = "configuration.yaml"
def __init__(self, config_fname=None):
config_fname = config_fname or self.config_fname
fo = open(config_fname, "r")
blob = fo.read()
fo.close()
self... | Add Config.get() to skip KeyErrors | Add Config.get() to skip KeyErrors
Adds common `dict.get()` pattern to our own Config class, to enable
use of fallbacks or `None`, as appropriate. | Python | apache-2.0 | royrapoport/destalinator,TheConnMan/destalinator,royrapoport/destalinator,underarmour/destalinator,randsleadershipslack/destalinator,randsleadershipslack/destalinator,TheConnMan/destalinator | #! /usr/bin/env python
import os
import warnings
import yaml
class Config(object):
config_fname = "configuration.yaml"
def __init__(self, config_fname=None):
config_fname = config_fname or self.config_fname
fo = open(config_fname, "r")
blob = fo.read()
fo.close()
self... | #! /usr/bin/env python
import os
import warnings
import yaml
class Config(object):
config_fname = "configuration.yaml"
def __init__(self, config_fname=None):
config_fname = config_fname or self.config_fname
fo = open(config_fname, "r")
blob = fo.read()
fo.close()
self... | <commit_before>#! /usr/bin/env python
import os
import warnings
import yaml
class Config(object):
config_fname = "configuration.yaml"
def __init__(self, config_fname=None):
config_fname = config_fname or self.config_fname
fo = open(config_fname, "r")
blob = fo.read()
fo.close... | #! /usr/bin/env python
import os
import warnings
import yaml
class Config(object):
config_fname = "configuration.yaml"
def __init__(self, config_fname=None):
config_fname = config_fname or self.config_fname
fo = open(config_fname, "r")
blob = fo.read()
fo.close()
self... | #! /usr/bin/env python
import os
import warnings
import yaml
class Config(object):
config_fname = "configuration.yaml"
def __init__(self, config_fname=None):
config_fname = config_fname or self.config_fname
fo = open(config_fname, "r")
blob = fo.read()
fo.close()
self... | <commit_before>#! /usr/bin/env python
import os
import warnings
import yaml
class Config(object):
config_fname = "configuration.yaml"
def __init__(self, config_fname=None):
config_fname = config_fname or self.config_fname
fo = open(config_fname, "r")
blob = fo.read()
fo.close... |
42297354f575e2c82346cf033202c5dfad5ddd99 | lib/examples/nacl_amb/utils.py | lib/examples/nacl_amb/utils.py | #!/usr/bin/env python
import numpy
class TrajWriter(object):
'''
A class for writing out trajectory traces as an xyz file, for subsequent
visualization.
'''
def __init__(self, trace, w, filename='trace.xyz'):
self.trace = trace
self.w = w
self.filename = filename
sel... | Add python class for writing out xyz files of trajectory coordinates | Add python class for writing out xyz files of trajectory coordinates
Former-commit-id: cecdece306ef516acf87bde03bbd04cb7f0c761b | Python | mit | westpa/westpa | Add python class for writing out xyz files of trajectory coordinates
Former-commit-id: cecdece306ef516acf87bde03bbd04cb7f0c761b | #!/usr/bin/env python
import numpy
class TrajWriter(object):
'''
A class for writing out trajectory traces as an xyz file, for subsequent
visualization.
'''
def __init__(self, trace, w, filename='trace.xyz'):
self.trace = trace
self.w = w
self.filename = filename
sel... | <commit_before><commit_msg>Add python class for writing out xyz files of trajectory coordinates
Former-commit-id: cecdece306ef516acf87bde03bbd04cb7f0c761b<commit_after> | #!/usr/bin/env python
import numpy
class TrajWriter(object):
'''
A class for writing out trajectory traces as an xyz file, for subsequent
visualization.
'''
def __init__(self, trace, w, filename='trace.xyz'):
self.trace = trace
self.w = w
self.filename = filename
sel... | Add python class for writing out xyz files of trajectory coordinates
Former-commit-id: cecdece306ef516acf87bde03bbd04cb7f0c761b#!/usr/bin/env python
import numpy
class TrajWriter(object):
'''
A class for writing out trajectory traces as an xyz file, for subsequent
visualization.
'''
def __init__(... | <commit_before><commit_msg>Add python class for writing out xyz files of trajectory coordinates
Former-commit-id: cecdece306ef516acf87bde03bbd04cb7f0c761b<commit_after>#!/usr/bin/env python
import numpy
class TrajWriter(object):
'''
A class for writing out trajectory traces as an xyz file, for subsequent
... | |
c1e801798d3b7e8d4c9ba8a11f79ffa92bf182f5 | test/test_logger.py | test/test_logger.py | # encoding: utf-8
"""
.. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com>
"""
from __future__ import print_function
from __future__ import unicode_literals
import logbook
from pingparsing import (
set_logger,
set_log_level,
)
import pytest
class Test_set_logger(object):
@pytest.mark.parame... | Add test cases for the logger | Add test cases for the logger
| Python | mit | thombashi/pingparsing,thombashi/pingparsing | Add test cases for the logger | # encoding: utf-8
"""
.. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com>
"""
from __future__ import print_function
from __future__ import unicode_literals
import logbook
from pingparsing import (
set_logger,
set_log_level,
)
import pytest
class Test_set_logger(object):
@pytest.mark.parame... | <commit_before><commit_msg>Add test cases for the logger<commit_after> | # encoding: utf-8
"""
.. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com>
"""
from __future__ import print_function
from __future__ import unicode_literals
import logbook
from pingparsing import (
set_logger,
set_log_level,
)
import pytest
class Test_set_logger(object):
@pytest.mark.parame... | Add test cases for the logger# encoding: utf-8
"""
.. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com>
"""
from __future__ import print_function
from __future__ import unicode_literals
import logbook
from pingparsing import (
set_logger,
set_log_level,
)
import pytest
class Test_set_logger(obje... | <commit_before><commit_msg>Add test cases for the logger<commit_after># encoding: utf-8
"""
.. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com>
"""
from __future__ import print_function
from __future__ import unicode_literals
import logbook
from pingparsing import (
set_logger,
set_log_level,
)
i... | |
74e24debf55b003f1d56d35f4b040d91a0698e0a | example/under-sampling/plot_cluster_centroids.py | example/under-sampling/plot_cluster_centroids.py | """
=================
Cluster centroids
=================
An illustration of the cluster centroids method.
"""
print(__doc__)
import matplotlib.pyplot as plt
import seaborn as sns
sns.set()
# Define some color for the plotting
almost_black = '#262626'
palette = sns.color_palette()
from sklearn.datasets import mak... | Add example for cluster centroids method | Add example for cluster centroids method
| Python | mit | dvro/UnbalancedDataset,dvro/imbalanced-learn,fmfn/UnbalancedDataset,scikit-learn-contrib/imbalanced-learn,scikit-learn-contrib/imbalanced-learn,glemaitre/UnbalancedDataset,dvro/UnbalancedDataset,dvro/imbalanced-learn,fmfn/UnbalancedDataset,glemaitre/UnbalancedDataset | Add example for cluster centroids method | """
=================
Cluster centroids
=================
An illustration of the cluster centroids method.
"""
print(__doc__)
import matplotlib.pyplot as plt
import seaborn as sns
sns.set()
# Define some color for the plotting
almost_black = '#262626'
palette = sns.color_palette()
from sklearn.datasets import mak... | <commit_before><commit_msg>Add example for cluster centroids method<commit_after> | """
=================
Cluster centroids
=================
An illustration of the cluster centroids method.
"""
print(__doc__)
import matplotlib.pyplot as plt
import seaborn as sns
sns.set()
# Define some color for the plotting
almost_black = '#262626'
palette = sns.color_palette()
from sklearn.datasets import mak... | Add example for cluster centroids method"""
=================
Cluster centroids
=================
An illustration of the cluster centroids method.
"""
print(__doc__)
import matplotlib.pyplot as plt
import seaborn as sns
sns.set()
# Define some color for the plotting
almost_black = '#262626'
palette = sns.color_pal... | <commit_before><commit_msg>Add example for cluster centroids method<commit_after>"""
=================
Cluster centroids
=================
An illustration of the cluster centroids method.
"""
print(__doc__)
import matplotlib.pyplot as plt
import seaborn as sns
sns.set()
# Define some color for the plotting
almost_... | |
8fa9a54c9a5ee683fc9e9d361a4eb7affe5e83ed | game_of_life.py | game_of_life.py | #!/usr/bin/env python
from curses import wrapper
from time import sleep
def enumerate_lines(matrix):
on = '*'
off = ' '
for i, row in enumerate(matrix):
yield i, ''.join(on if v else off for v in row)
def paint(stdscr, matrix):
stdscr.clear()
for i, line in enumerate_lines(matrix):
... | Add functions to paint game of life to screen | Add functions to paint game of life to screen
| Python | mit | akud/stem-club-presentation,akud/stem-club-presentation,akud/stem-club-presentation | Add functions to paint game of life to screen | #!/usr/bin/env python
from curses import wrapper
from time import sleep
def enumerate_lines(matrix):
on = '*'
off = ' '
for i, row in enumerate(matrix):
yield i, ''.join(on if v else off for v in row)
def paint(stdscr, matrix):
stdscr.clear()
for i, line in enumerate_lines(matrix):
... | <commit_before><commit_msg>Add functions to paint game of life to screen<commit_after> | #!/usr/bin/env python
from curses import wrapper
from time import sleep
def enumerate_lines(matrix):
on = '*'
off = ' '
for i, row in enumerate(matrix):
yield i, ''.join(on if v else off for v in row)
def paint(stdscr, matrix):
stdscr.clear()
for i, line in enumerate_lines(matrix):
... | Add functions to paint game of life to screen#!/usr/bin/env python
from curses import wrapper
from time import sleep
def enumerate_lines(matrix):
on = '*'
off = ' '
for i, row in enumerate(matrix):
yield i, ''.join(on if v else off for v in row)
def paint(stdscr, matrix):
stdscr.clear()
fo... | <commit_before><commit_msg>Add functions to paint game of life to screen<commit_after>#!/usr/bin/env python
from curses import wrapper
from time import sleep
def enumerate_lines(matrix):
on = '*'
off = ' '
for i, row in enumerate(matrix):
yield i, ''.join(on if v else off for v in row)
def paint(s... | |
c98a744f5f436ae2c6266a7bb5d32173cfd0e4a9 | scripts/socrata_scraper.py | scripts/socrata_scraper.py | #!/usr/bin/python3
"""
This is a basic script that downloads the catalog data from the smcgov.org
website and pulls out information about all the datasets.
This is in python3
There is an optional download_all argument that will allow you to download
all of the datasets individually and in their entirety. I have incl... | Add a script that scrapes the Socrata catalog, just in case we need that in another format | Add a script that scrapes the Socrata catalog, just in case we need that in another format
| Python | mit | opensmc/service-locator,opensmc/service-locator,opensmc/service-locator | Add a script that scrapes the Socrata catalog, just in case we need that in another format | #!/usr/bin/python3
"""
This is a basic script that downloads the catalog data from the smcgov.org
website and pulls out information about all the datasets.
This is in python3
There is an optional download_all argument that will allow you to download
all of the datasets individually and in their entirety. I have incl... | <commit_before><commit_msg>Add a script that scrapes the Socrata catalog, just in case we need that in another format<commit_after> | #!/usr/bin/python3
"""
This is a basic script that downloads the catalog data from the smcgov.org
website and pulls out information about all the datasets.
This is in python3
There is an optional download_all argument that will allow you to download
all of the datasets individually and in their entirety. I have incl... | Add a script that scrapes the Socrata catalog, just in case we need that in another format#!/usr/bin/python3
"""
This is a basic script that downloads the catalog data from the smcgov.org
website and pulls out information about all the datasets.
This is in python3
There is an optional download_all argument that will... | <commit_before><commit_msg>Add a script that scrapes the Socrata catalog, just in case we need that in another format<commit_after>#!/usr/bin/python3
"""
This is a basic script that downloads the catalog data from the smcgov.org
website and pulls out information about all the datasets.
This is in python3
There is an... | |
0c11d2740e561586bb4f9d2b67bda2ccc87e146e | ixdjango/management/commands/newrelic_notify_deploy.py | ixdjango/management/commands/newrelic_notify_deploy.py | """
Management command to enable New Relic notification of deployments
.. moduleauthor:: Infoxchange Development Team <development@infoxchange.net.au>
"""
import pwd
import os
from subprocess import Popen, PIPE
from urllib import urlencode
from httplib2 import Http
from django.conf import settings
from django.core... | Add new command to notify New Relic of deployment | Add new command to notify New Relic of deployment
| Python | mit | infoxchange/ixdjango | Add new command to notify New Relic of deployment | """
Management command to enable New Relic notification of deployments
.. moduleauthor:: Infoxchange Development Team <development@infoxchange.net.au>
"""
import pwd
import os
from subprocess import Popen, PIPE
from urllib import urlencode
from httplib2 import Http
from django.conf import settings
from django.core... | <commit_before><commit_msg>Add new command to notify New Relic of deployment<commit_after> | """
Management command to enable New Relic notification of deployments
.. moduleauthor:: Infoxchange Development Team <development@infoxchange.net.au>
"""
import pwd
import os
from subprocess import Popen, PIPE
from urllib import urlencode
from httplib2 import Http
from django.conf import settings
from django.core... | Add new command to notify New Relic of deployment"""
Management command to enable New Relic notification of deployments
.. moduleauthor:: Infoxchange Development Team <development@infoxchange.net.au>
"""
import pwd
import os
from subprocess import Popen, PIPE
from urllib import urlencode
from httplib2 import Http
... | <commit_before><commit_msg>Add new command to notify New Relic of deployment<commit_after>"""
Management command to enable New Relic notification of deployments
.. moduleauthor:: Infoxchange Development Team <development@infoxchange.net.au>
"""
import pwd
import os
from subprocess import Popen, PIPE
from urllib impo... | |
2e2ad49c7ada145b5a4a81bd8941cf5e72d2d81b | rst2pdf/tests/input/test_180.py | rst2pdf/tests/input/test_180.py | # -*- coding: utf-8 -*-
from reportlab.platypus import SimpleDocTemplate
from reportlab.platypus.paragraph import Paragraph
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.lib.colors import Color
from reportlab.platypus.flowables import _listWrapOn, _FUZZ
from wordaxe.rl.NewParagraph... | Test case for wordaxe bug | Test case for wordaxe bug
| Python | mit | thomaspurchas/rst2pdf,thomaspurchas/rst2pdf | Test case for wordaxe bug | # -*- coding: utf-8 -*-
from reportlab.platypus import SimpleDocTemplate
from reportlab.platypus.paragraph import Paragraph
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.lib.colors import Color
from reportlab.platypus.flowables import _listWrapOn, _FUZZ
from wordaxe.rl.NewParagraph... | <commit_before><commit_msg>Test case for wordaxe bug<commit_after> | # -*- coding: utf-8 -*-
from reportlab.platypus import SimpleDocTemplate
from reportlab.platypus.paragraph import Paragraph
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.lib.colors import Color
from reportlab.platypus.flowables import _listWrapOn, _FUZZ
from wordaxe.rl.NewParagraph... | Test case for wordaxe bug# -*- coding: utf-8 -*-
from reportlab.platypus import SimpleDocTemplate
from reportlab.platypus.paragraph import Paragraph
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.lib.colors import Color
from reportlab.platypus.flowables import _listWrapOn, _FUZZ
fro... | <commit_before><commit_msg>Test case for wordaxe bug<commit_after># -*- coding: utf-8 -*-
from reportlab.platypus import SimpleDocTemplate
from reportlab.platypus.paragraph import Paragraph
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.lib.colors import Color
from reportlab.platypu... | |
c851501cc8149685a9e9c023aa200b92c17a9078 | pida_fields.py | pida_fields.py | def decode_name_fields(ida_fields):
i = -1
stop = len(ida_fields)
while True:
i += 1
if i == stop:
break
count = ord(ida_fields[i]) - 1
if count == 0:
continue
i += 1
yield ida_fields[i:i + count]
i += count - 1
| Add decoder ida fields name | Add decoder ida fields name
| Python | mit | goodwinxp/ATFGenerator,goodwinxp/ATFGenerator,goodwinxp/ATFGenerator | Add decoder ida fields name | def decode_name_fields(ida_fields):
i = -1
stop = len(ida_fields)
while True:
i += 1
if i == stop:
break
count = ord(ida_fields[i]) - 1
if count == 0:
continue
i += 1
yield ida_fields[i:i + count]
i += count - 1
| <commit_before><commit_msg>Add decoder ida fields name<commit_after> | def decode_name_fields(ida_fields):
i = -1
stop = len(ida_fields)
while True:
i += 1
if i == stop:
break
count = ord(ida_fields[i]) - 1
if count == 0:
continue
i += 1
yield ida_fields[i:i + count]
i += count - 1
| Add decoder ida fields namedef decode_name_fields(ida_fields):
i = -1
stop = len(ida_fields)
while True:
i += 1
if i == stop:
break
count = ord(ida_fields[i]) - 1
if count == 0:
continue
i += 1
yield ida_fields[i:i + count]
i ... | <commit_before><commit_msg>Add decoder ida fields name<commit_after>def decode_name_fields(ida_fields):
i = -1
stop = len(ida_fields)
while True:
i += 1
if i == stop:
break
count = ord(ida_fields[i]) - 1
if count == 0:
continue
i += 1
... | |
e869c7ef9e3d19da4c98cda57b5e22fb5a35cba5 | tests/test_validators.py | tests/test_validators.py | """
test_validators
~~~~~~~~~~~~~~
Unittests for bundled validators.
:copyright: 2007-2008 by James Crasta, Thomas Johansson.
:license: MIT, see LICENSE.txt for details.
"""
from py.test import raises
from wtforms.validators import ValidationError, length, url, not_empty, email, ip_addres... | Add first basic unittests using py.test | Add first basic unittests using py.test
| Python | bsd-3-clause | Khan/wtforms | Add first basic unittests using py.test | """
test_validators
~~~~~~~~~~~~~~
Unittests for bundled validators.
:copyright: 2007-2008 by James Crasta, Thomas Johansson.
:license: MIT, see LICENSE.txt for details.
"""
from py.test import raises
from wtforms.validators import ValidationError, length, url, not_empty, email, ip_addres... | <commit_before><commit_msg>Add first basic unittests using py.test<commit_after> | """
test_validators
~~~~~~~~~~~~~~
Unittests for bundled validators.
:copyright: 2007-2008 by James Crasta, Thomas Johansson.
:license: MIT, see LICENSE.txt for details.
"""
from py.test import raises
from wtforms.validators import ValidationError, length, url, not_empty, email, ip_addres... | Add first basic unittests using py.test"""
test_validators
~~~~~~~~~~~~~~
Unittests for bundled validators.
:copyright: 2007-2008 by James Crasta, Thomas Johansson.
:license: MIT, see LICENSE.txt for details.
"""
from py.test import raises
from wtforms.validators import ValidationError, l... | <commit_before><commit_msg>Add first basic unittests using py.test<commit_after>"""
test_validators
~~~~~~~~~~~~~~
Unittests for bundled validators.
:copyright: 2007-2008 by James Crasta, Thomas Johansson.
:license: MIT, see LICENSE.txt for details.
"""
from py.test import raises
from wtf... | |
11efa5583bbeeee7c7823264f6f73715ea81edc0 | luigi/tests/ontologies/eco_test.py | luigi/tests/ontologies/eco_test.py | # -*- coding: utf-8 -*-
"""
Copyright [2009-2017] EMBL-European Bioinformatics Institute
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... | Add trivial test for ECO fetching | Add trivial test for ECO fetching
| Python | apache-2.0 | RNAcentral/rnacentral-import-pipeline,RNAcentral/rnacentral-import-pipeline,RNAcentral/rnacentral-import-pipeline,RNAcentral/rnacentral-import-pipeline | Add trivial test for ECO fetching | # -*- coding: utf-8 -*-
"""
Copyright [2009-2017] EMBL-European Bioinformatics Institute
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by... | <commit_before><commit_msg>Add trivial test for ECO fetching<commit_after> | # -*- coding: utf-8 -*-
"""
Copyright [2009-2017] EMBL-European Bioinformatics Institute
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... | Add trivial test for ECO fetching# -*- coding: utf-8 -*-
"""
Copyright [2009-2017] EMBL-European Bioinformatics Institute
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/licens... | <commit_before><commit_msg>Add trivial test for ECO fetching<commit_after># -*- coding: utf-8 -*-
"""
Copyright [2009-2017] EMBL-European Bioinformatics Institute
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 th... | |
4fdba8a1a5a2123843cc9eefd8949fb8996f59b2 | telemetry/telemetry/unittest/run_chromeos_tests.py | telemetry/telemetry/unittest/run_chromeos_tests.py | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import logging
import os
import sys
from telemetry.unittest import gtest_progress_reporter
from telemetry.unittest import run_tests
from telemetry.core impor... | Add a wrapper for ChromeOS to call into telemetry. | Add a wrapper for ChromeOS to call into telemetry.
R=dtu@chromium.org, achuith@chromium.org
BUG=402172, 388256
Review URL: https://codereview.chromium.org/682953002
Cr-Commit-Position: 972c6d2dc6dd5efdad1377c0d224e03eb8f276f7@{#301557}
| Python | bsd-3-clause | SummerLW/Perf-Insight-Report,SummerLW/Perf-Insight-Report,catapult-project/catapult,catapult-project/catapult,catapult-project/catapult,catapult-project/catapult-csm,catapult-project/catapult,benschmaus/catapult,benschmaus/catapult,catapult-project/catapult-csm,catapult-project/catapult-csm,catapult-project/catapult,Su... | Add a wrapper for ChromeOS to call into telemetry.
R=dtu@chromium.org, achuith@chromium.org
BUG=402172, 388256
Review URL: https://codereview.chromium.org/682953002
Cr-Commit-Position: 972c6d2dc6dd5efdad1377c0d224e03eb8f276f7@{#301557} | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import logging
import os
import sys
from telemetry.unittest import gtest_progress_reporter
from telemetry.unittest import run_tests
from telemetry.core impor... | <commit_before><commit_msg>Add a wrapper for ChromeOS to call into telemetry.
R=dtu@chromium.org, achuith@chromium.org
BUG=402172, 388256
Review URL: https://codereview.chromium.org/682953002
Cr-Commit-Position: 972c6d2dc6dd5efdad1377c0d224e03eb8f276f7@{#301557}<commit_after> | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import logging
import os
import sys
from telemetry.unittest import gtest_progress_reporter
from telemetry.unittest import run_tests
from telemetry.core impor... | Add a wrapper for ChromeOS to call into telemetry.
R=dtu@chromium.org, achuith@chromium.org
BUG=402172, 388256
Review URL: https://codereview.chromium.org/682953002
Cr-Commit-Position: 972c6d2dc6dd5efdad1377c0d224e03eb8f276f7@{#301557}# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source c... | <commit_before><commit_msg>Add a wrapper for ChromeOS to call into telemetry.
R=dtu@chromium.org, achuith@chromium.org
BUG=402172, 388256
Review URL: https://codereview.chromium.org/682953002
Cr-Commit-Position: 972c6d2dc6dd5efdad1377c0d224e03eb8f276f7@{#301557}<commit_after># Copyright 2014 The Chromium Authors. Al... | |
2ef9618e705bb293641674ca5e7cc1f14daf3483 | migrations/versions/0285_default_org_branding.py | migrations/versions/0285_default_org_branding.py | """empty message
Revision ID: 0285_default_org_branding
Revises: 0284_0283_retry
Create Date: 2016-10-25 17:37:27.660723
"""
# revision identifiers, used by Alembic.
revision = '0285_default_org_branding'
down_revision = '0284_0283_retry'
from alembic import op
import sqlalchemy as sa
BRANDING_TABLES = ('email_br... | Set default branding for all organisations | Set default branding for all organisations
Currently when someone creates a service we match them to an
organisation. Then if the organisation has a default branding set, their
service gets that branding.
However none of the organisations yet have a default branding set up.
This commit migrates the data about the rel... | Python | mit | alphagov/notifications-api,alphagov/notifications-api | Set default branding for all organisations
Currently when someone creates a service we match them to an
organisation. Then if the organisation has a default branding set, their
service gets that branding.
However none of the organisations yet have a default branding set up.
This commit migrates the data about the rel... | """empty message
Revision ID: 0285_default_org_branding
Revises: 0284_0283_retry
Create Date: 2016-10-25 17:37:27.660723
"""
# revision identifiers, used by Alembic.
revision = '0285_default_org_branding'
down_revision = '0284_0283_retry'
from alembic import op
import sqlalchemy as sa
BRANDING_TABLES = ('email_br... | <commit_before><commit_msg>Set default branding for all organisations
Currently when someone creates a service we match them to an
organisation. Then if the organisation has a default branding set, their
service gets that branding.
However none of the organisations yet have a default branding set up.
This commit migr... | """empty message
Revision ID: 0285_default_org_branding
Revises: 0284_0283_retry
Create Date: 2016-10-25 17:37:27.660723
"""
# revision identifiers, used by Alembic.
revision = '0285_default_org_branding'
down_revision = '0284_0283_retry'
from alembic import op
import sqlalchemy as sa
BRANDING_TABLES = ('email_br... | Set default branding for all organisations
Currently when someone creates a service we match them to an
organisation. Then if the organisation has a default branding set, their
service gets that branding.
However none of the organisations yet have a default branding set up.
This commit migrates the data about the rel... | <commit_before><commit_msg>Set default branding for all organisations
Currently when someone creates a service we match them to an
organisation. Then if the organisation has a default branding set, their
service gets that branding.
However none of the organisations yet have a default branding set up.
This commit migr... | |
1708eb17fb9c232414b0e162754ca31b6fd9366c | services/comprehension/main-api/comprehension/tests/management/commands/test_pre_filter_responses.py | services/comprehension/main-api/comprehension/tests/management/commands/test_pre_filter_responses.py | import csv
from io import StringIO
from unittest.mock import call, MagicMock, patch
from django.test import TestCase
from ....views.plagiarism import PlagiarismFeedbackView
from ....management.commands import pre_filter_responses
Command = pre_filter_responses.Command
class TestCommandBase(TestCase):
def setU... | Add tests for plagiarism filter command | Add tests for plagiarism filter command
| 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 tests for plagiarism filter command | import csv
from io import StringIO
from unittest.mock import call, MagicMock, patch
from django.test import TestCase
from ....views.plagiarism import PlagiarismFeedbackView
from ....management.commands import pre_filter_responses
Command = pre_filter_responses.Command
class TestCommandBase(TestCase):
def setU... | <commit_before><commit_msg>Add tests for plagiarism filter command<commit_after> | import csv
from io import StringIO
from unittest.mock import call, MagicMock, patch
from django.test import TestCase
from ....views.plagiarism import PlagiarismFeedbackView
from ....management.commands import pre_filter_responses
Command = pre_filter_responses.Command
class TestCommandBase(TestCase):
def setU... | Add tests for plagiarism filter commandimport csv
from io import StringIO
from unittest.mock import call, MagicMock, patch
from django.test import TestCase
from ....views.plagiarism import PlagiarismFeedbackView
from ....management.commands import pre_filter_responses
Command = pre_filter_responses.Command
class ... | <commit_before><commit_msg>Add tests for plagiarism filter command<commit_after>import csv
from io import StringIO
from unittest.mock import call, MagicMock, patch
from django.test import TestCase
from ....views.plagiarism import PlagiarismFeedbackView
from ....management.commands import pre_filter_responses
Comman... | |
797114781ed4f31c265c58a76e39aa8ff6a16443 | tensorpack/utils/compatible_serialize.py | tensorpack/utils/compatible_serialize.py | #!/usr/bin/env python
import os
from .serialize import loads_msgpack, loads_pyarrow, dumps_msgpack, dumps_pyarrow
"""
Serialization that has compatibility guarantee (therefore is safe to store to disk).
"""
__all__ = ['loads', 'dumps']
# pyarrow has no compatibility guarantee
# use msgpack for persistent serializa... | Add missing file from last commit | Add missing file from last commit
| Python | apache-2.0 | ppwwyyxx/tensorpack,eyaler/tensorpack,eyaler/tensorpack,ppwwyyxx/tensorpack | Add missing file from last commit | #!/usr/bin/env python
import os
from .serialize import loads_msgpack, loads_pyarrow, dumps_msgpack, dumps_pyarrow
"""
Serialization that has compatibility guarantee (therefore is safe to store to disk).
"""
__all__ = ['loads', 'dumps']
# pyarrow has no compatibility guarantee
# use msgpack for persistent serializa... | <commit_before><commit_msg>Add missing file from last commit<commit_after> | #!/usr/bin/env python
import os
from .serialize import loads_msgpack, loads_pyarrow, dumps_msgpack, dumps_pyarrow
"""
Serialization that has compatibility guarantee (therefore is safe to store to disk).
"""
__all__ = ['loads', 'dumps']
# pyarrow has no compatibility guarantee
# use msgpack for persistent serializa... | Add missing file from last commit#!/usr/bin/env python
import os
from .serialize import loads_msgpack, loads_pyarrow, dumps_msgpack, dumps_pyarrow
"""
Serialization that has compatibility guarantee (therefore is safe to store to disk).
"""
__all__ = ['loads', 'dumps']
# pyarrow has no compatibility guarantee
# use... | <commit_before><commit_msg>Add missing file from last commit<commit_after>#!/usr/bin/env python
import os
from .serialize import loads_msgpack, loads_pyarrow, dumps_msgpack, dumps_pyarrow
"""
Serialization that has compatibility guarantee (therefore is safe to store to disk).
"""
__all__ = ['loads', 'dumps']
# pya... | |
cfb39d7389d63a293dc075d420f80276a34df193 | examples/pygstc/simple_pipeline.py | examples/pygstc/simple_pipeline.py | import time
import sys
from pygstc.gstc import *
from pygstc.logger import *
#Create a custom logger with loglevel=DEBUG
gstd_logger = CustomLogger('simple_pipeline', loglevel='DEBUG')
#Create the client with the logger
gstd_client = GstdClient(logger=gstd_logger)
def printError():
print("To play run: python3 si... | Add minimal pygstc example to play a video | Add minimal pygstc example to play a video
| Python | lgpl-2.1 | RidgeRun/gstd-1.x,RidgeRun/gstd-1.x,RidgeRun/gstd-1.x,RidgeRun/gstd-1.x | Add minimal pygstc example to play a video | import time
import sys
from pygstc.gstc import *
from pygstc.logger import *
#Create a custom logger with loglevel=DEBUG
gstd_logger = CustomLogger('simple_pipeline', loglevel='DEBUG')
#Create the client with the logger
gstd_client = GstdClient(logger=gstd_logger)
def printError():
print("To play run: python3 si... | <commit_before><commit_msg>Add minimal pygstc example to play a video<commit_after> | import time
import sys
from pygstc.gstc import *
from pygstc.logger import *
#Create a custom logger with loglevel=DEBUG
gstd_logger = CustomLogger('simple_pipeline', loglevel='DEBUG')
#Create the client with the logger
gstd_client = GstdClient(logger=gstd_logger)
def printError():
print("To play run: python3 si... | Add minimal pygstc example to play a videoimport time
import sys
from pygstc.gstc import *
from pygstc.logger import *
#Create a custom logger with loglevel=DEBUG
gstd_logger = CustomLogger('simple_pipeline', loglevel='DEBUG')
#Create the client with the logger
gstd_client = GstdClient(logger=gstd_logger)
def printE... | <commit_before><commit_msg>Add minimal pygstc example to play a video<commit_after>import time
import sys
from pygstc.gstc import *
from pygstc.logger import *
#Create a custom logger with loglevel=DEBUG
gstd_logger = CustomLogger('simple_pipeline', loglevel='DEBUG')
#Create the client with the logger
gstd_client = G... | |
f8d06f85e896c1098f58667c161d920f6d255d7b | sendmail/log_mail.py | sendmail/log_mail.py | # -*- coding: utf-8 -*-
###############################################################################
#
# Copyright (C) 2001-2014 Micronaet SRL (<http://www.micronaet.it>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License a... | Add utility for sent mail | Add utility for sent mail
| Python | agpl-3.0 | Micronaet/micronaet-utility,Micronaet/micronaet-utility,Micronaet/micronaet-utility,Micronaet/micronaet-utility | Add utility for sent mail | # -*- coding: utf-8 -*-
###############################################################################
#
# Copyright (C) 2001-2014 Micronaet SRL (<http://www.micronaet.it>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License a... | <commit_before><commit_msg>Add utility for sent mail<commit_after> | # -*- coding: utf-8 -*-
###############################################################################
#
# Copyright (C) 2001-2014 Micronaet SRL (<http://www.micronaet.it>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License a... | Add utility for sent mail# -*- coding: utf-8 -*-
###############################################################################
#
# Copyright (C) 2001-2014 Micronaet SRL (<http://www.micronaet.it>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero... | <commit_before><commit_msg>Add utility for sent mail<commit_after># -*- coding: utf-8 -*-
###############################################################################
#
# Copyright (C) 2001-2014 Micronaet SRL (<http://www.micronaet.it>).
#
# This program is free software: you can redistribute it and/or modify
... | |
425a8e26d371038f6ebf7c80dd7faea0f1dd906e | nodeconductor/core/tests/unittests/test_admin.py | nodeconductor/core/tests/unittests/test_admin.py | from django.contrib import admin
from django.contrib.auth import get_user_model
from django.test import TestCase
from django.urls import reverse
User = get_user_model()
class TestAdminEndpoints(TestCase):
def setUp(self):
user, _ = User.objects.get_or_create(username='username', is_staff=True)
... | Add base test for admin endpoints | Add base test for admin endpoints [WAL-883]
| Python | mit | opennode/nodeconductor,opennode/nodeconductor,opennode/nodeconductor | Add base test for admin endpoints [WAL-883] | from django.contrib import admin
from django.contrib.auth import get_user_model
from django.test import TestCase
from django.urls import reverse
User = get_user_model()
class TestAdminEndpoints(TestCase):
def setUp(self):
user, _ = User.objects.get_or_create(username='username', is_staff=True)
... | <commit_before><commit_msg>Add base test for admin endpoints [WAL-883]<commit_after> | from django.contrib import admin
from django.contrib.auth import get_user_model
from django.test import TestCase
from django.urls import reverse
User = get_user_model()
class TestAdminEndpoints(TestCase):
def setUp(self):
user, _ = User.objects.get_or_create(username='username', is_staff=True)
... | Add base test for admin endpoints [WAL-883]from django.contrib import admin
from django.contrib.auth import get_user_model
from django.test import TestCase
from django.urls import reverse
User = get_user_model()
class TestAdminEndpoints(TestCase):
def setUp(self):
user, _ = User.objects.get_or_create(u... | <commit_before><commit_msg>Add base test for admin endpoints [WAL-883]<commit_after>from django.contrib import admin
from django.contrib.auth import get_user_model
from django.test import TestCase
from django.urls import reverse
User = get_user_model()
class TestAdminEndpoints(TestCase):
def setUp(self):
... | |
8ce2da2ed2e445480ee2e10483a5fae1c7c677a0 | lib/output_view.py | lib/output_view.py | import sublime
import sublime_plugin
###-----------------------------------------------------------------------------
def output_to_view(window,
title,
content,
reuse=True,
syntax=None,
clear=True,
settin... | Include self contained method for output to a view | Include self contained method for output to a view
This uses an enhanced version of the code that is currently in the
override_audit command file, making it more general purpose.
The new method can send output to a view, either reusing the one with
the same title as is being used, or creating a new one. A syntax can
... | Python | mit | OdatNurd/OverrideAudit | Include self contained method for output to a view
This uses an enhanced version of the code that is currently in the
override_audit command file, making it more general purpose.
The new method can send output to a view, either reusing the one with
the same title as is being used, or creating a new one. A syntax can
... | import sublime
import sublime_plugin
###-----------------------------------------------------------------------------
def output_to_view(window,
title,
content,
reuse=True,
syntax=None,
clear=True,
settin... | <commit_before><commit_msg>Include self contained method for output to a view
This uses an enhanced version of the code that is currently in the
override_audit command file, making it more general purpose.
The new method can send output to a view, either reusing the one with
the same title as is being used, or creati... | import sublime
import sublime_plugin
###-----------------------------------------------------------------------------
def output_to_view(window,
title,
content,
reuse=True,
syntax=None,
clear=True,
settin... | Include self contained method for output to a view
This uses an enhanced version of the code that is currently in the
override_audit command file, making it more general purpose.
The new method can send output to a view, either reusing the one with
the same title as is being used, or creating a new one. A syntax can
... | <commit_before><commit_msg>Include self contained method for output to a view
This uses an enhanced version of the code that is currently in the
override_audit command file, making it more general purpose.
The new method can send output to a view, either reusing the one with
the same title as is being used, or creati... | |
50e24b0445f259d975e5dd78dd34a8e760e4ed88 | DB.py | DB.py | # Create a database
import sqlite3
import csv
from datetime import datetime
import sys
reload(sys)
sys.setdefaultencoding('utf8')
class createDB():
def readCSV(self, filename):
conn = sqlite3.connect('CIUK.db')
print 'DB Creation Successful!'
cur = conn.cursor()
# cur.execute(... | Create SQLite database and table and insert data from CSV file | Create SQLite database and table and insert data from CSV file
| Python | mit | joykuotw/python-endpoints,joykuotw/python-endpoints,joykuotw/python-endpoints | Create SQLite database and table and insert data from CSV file | # Create a database
import sqlite3
import csv
from datetime import datetime
import sys
reload(sys)
sys.setdefaultencoding('utf8')
class createDB():
def readCSV(self, filename):
conn = sqlite3.connect('CIUK.db')
print 'DB Creation Successful!'
cur = conn.cursor()
# cur.execute(... | <commit_before><commit_msg>Create SQLite database and table and insert data from CSV file<commit_after> | # Create a database
import sqlite3
import csv
from datetime import datetime
import sys
reload(sys)
sys.setdefaultencoding('utf8')
class createDB():
def readCSV(self, filename):
conn = sqlite3.connect('CIUK.db')
print 'DB Creation Successful!'
cur = conn.cursor()
# cur.execute(... | Create SQLite database and table and insert data from CSV file# Create a database
import sqlite3
import csv
from datetime import datetime
import sys
reload(sys)
sys.setdefaultencoding('utf8')
class createDB():
def readCSV(self, filename):
conn = sqlite3.connect('CIUK.db')
print 'DB Creation S... | <commit_before><commit_msg>Create SQLite database and table and insert data from CSV file<commit_after># Create a database
import sqlite3
import csv
from datetime import datetime
import sys
reload(sys)
sys.setdefaultencoding('utf8')
class createDB():
def readCSV(self, filename):
conn = sqlite3.connec... | |
874c01374397014e7c99afd67f5680ed32f1c5c6 | bn.py | bn.py | import sys
from time import gmtime
year, mon, mday, hour, min, sec, wday, yday, isdst = gmtime()
bld = ((year - 2000) * 12 + mon - 1) * 100 + mday
rev = hour * 100 + min
print 'Your build and revision number for today is %d.%d.' % (bld, rev)
| Build and revision number script | Build and revision number script
| Python | apache-2.0 | atifaziz/NCrontab,atifaziz/NCrontab | Build and revision number script | import sys
from time import gmtime
year, mon, mday, hour, min, sec, wday, yday, isdst = gmtime()
bld = ((year - 2000) * 12 + mon - 1) * 100 + mday
rev = hour * 100 + min
print 'Your build and revision number for today is %d.%d.' % (bld, rev)
| <commit_before><commit_msg>Build and revision number script<commit_after> | import sys
from time import gmtime
year, mon, mday, hour, min, sec, wday, yday, isdst = gmtime()
bld = ((year - 2000) * 12 + mon - 1) * 100 + mday
rev = hour * 100 + min
print 'Your build and revision number for today is %d.%d.' % (bld, rev)
| Build and revision number scriptimport sys
from time import gmtime
year, mon, mday, hour, min, sec, wday, yday, isdst = gmtime()
bld = ((year - 2000) * 12 + mon - 1) * 100 + mday
rev = hour * 100 + min
print 'Your build and revision number for today is %d.%d.' % (bld, rev)
| <commit_before><commit_msg>Build and revision number script<commit_after>import sys
from time import gmtime
year, mon, mday, hour, min, sec, wday, yday, isdst = gmtime()
bld = ((year - 2000) * 12 + mon - 1) * 100 + mday
rev = hour * 100 + min
print 'Your build and revision number for today is %d.%d.' % (bld, rev)
| |
780e4eb03420d75c18d0b21b5e616f2952aeda41 | test/test_basic_logic.py | test/test_basic_logic.py | # -*- coding: utf-8 -*-
"""
test_basic_logic
~~~~~~~~~~~~~~~~
Test the basic logic of the h2 state machines.
"""
import h2.connection
from hyperframe import frame
class TestBasicConnection(object):
"""
Basic connection tests.
"""
example_request_headers = [
(':authority', 'example.com'),
... | # -*- coding: utf-8 -*-
"""
test_basic_logic
~~~~~~~~~~~~~~~~
Test the basic logic of the h2 state machines.
"""
import h2.connection
from hyperframe import frame
class TestBasicConnection(object):
"""
Basic connection tests.
"""
example_request_headers = [
(':authority', 'example.com'),
... | Test sending headers with end stream. | Test sending headers with end stream.
| Python | mit | python-hyper/hyper-h2,bhavishyagopesh/hyper-h2,Kriechi/hyper-h2,Kriechi/hyper-h2,mhils/hyper-h2,vladmunteanu/hyper-h2,vladmunteanu/hyper-h2,python-hyper/hyper-h2 | # -*- coding: utf-8 -*-
"""
test_basic_logic
~~~~~~~~~~~~~~~~
Test the basic logic of the h2 state machines.
"""
import h2.connection
from hyperframe import frame
class TestBasicConnection(object):
"""
Basic connection tests.
"""
example_request_headers = [
(':authority', 'example.com'),
... | # -*- coding: utf-8 -*-
"""
test_basic_logic
~~~~~~~~~~~~~~~~
Test the basic logic of the h2 state machines.
"""
import h2.connection
from hyperframe import frame
class TestBasicConnection(object):
"""
Basic connection tests.
"""
example_request_headers = [
(':authority', 'example.com'),
... | <commit_before># -*- coding: utf-8 -*-
"""
test_basic_logic
~~~~~~~~~~~~~~~~
Test the basic logic of the h2 state machines.
"""
import h2.connection
from hyperframe import frame
class TestBasicConnection(object):
"""
Basic connection tests.
"""
example_request_headers = [
(':authority', 'exa... | # -*- coding: utf-8 -*-
"""
test_basic_logic
~~~~~~~~~~~~~~~~
Test the basic logic of the h2 state machines.
"""
import h2.connection
from hyperframe import frame
class TestBasicConnection(object):
"""
Basic connection tests.
"""
example_request_headers = [
(':authority', 'example.com'),
... | # -*- coding: utf-8 -*-
"""
test_basic_logic
~~~~~~~~~~~~~~~~
Test the basic logic of the h2 state machines.
"""
import h2.connection
from hyperframe import frame
class TestBasicConnection(object):
"""
Basic connection tests.
"""
example_request_headers = [
(':authority', 'example.com'),
... | <commit_before># -*- coding: utf-8 -*-
"""
test_basic_logic
~~~~~~~~~~~~~~~~
Test the basic logic of the h2 state machines.
"""
import h2.connection
from hyperframe import frame
class TestBasicConnection(object):
"""
Basic connection tests.
"""
example_request_headers = [
(':authority', 'exa... |
3cf30bac4d20dbebf6185351ba0c10426a489de9 | tools/run_tests/sanity/check_channel_arg_usage.py | tools/run_tests/sanity/check_channel_arg_usage.py | #!/usr/bin/env python
# Copyright 2018 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | Add sanity linter to catch future use | Add sanity linter to catch future use
| Python | apache-2.0 | Vizerai/grpc,jboeuf/grpc,vjpai/grpc,carl-mastrangelo/grpc,carl-mastrangelo/grpc,ncteisen/grpc,grpc/grpc,dgquintas/grpc,chrisdunelm/grpc,ctiller/grpc,nicolasnoble/grpc,jtattermusch/grpc,mehrdada/grpc,sreecha/grpc,chrisdunelm/grpc,firebase/grpc,ncteisen/grpc,jboeuf/grpc,jboeuf/grpc,jboeuf/grpc,pszemus/grpc,thinkerou/grpc... | Add sanity linter to catch future use | #!/usr/bin/env python
# Copyright 2018 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | <commit_before><commit_msg>Add sanity linter to catch future use<commit_after> | #!/usr/bin/env python
# Copyright 2018 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | Add sanity linter to catch future use#!/usr/bin/env python
# Copyright 2018 gRPC 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
#... | <commit_before><commit_msg>Add sanity linter to catch future use<commit_after>#!/usr/bin/env python
# Copyright 2018 gRPC 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
#
# htt... | |
245879ce699b275edc3ee17e4cba1146241f25de | wizbit/xmlrpcdeferred.py | wizbit/xmlrpcdeferred.py | import gobject
import xmlrpclib
class XMLRPCDeferred (gobject.GObject):
"""Object representing the delayed result of an XML-RPC
request.
.is_ready: bool
True when the result is received; False before then.
.value : any
Once is_ready=True, this attribute contains the result of the
re... | Add GLib mainllop transport for xmlrpcserver | Add GLib mainllop transport for xmlrpcserver
| Python | lgpl-2.1 | wizbit-archive/wizbit,wizbit-archive/wizbit | Add GLib mainllop transport for xmlrpcserver | import gobject
import xmlrpclib
class XMLRPCDeferred (gobject.GObject):
"""Object representing the delayed result of an XML-RPC
request.
.is_ready: bool
True when the result is received; False before then.
.value : any
Once is_ready=True, this attribute contains the result of the
re... | <commit_before><commit_msg>Add GLib mainllop transport for xmlrpcserver<commit_after> | import gobject
import xmlrpclib
class XMLRPCDeferred (gobject.GObject):
"""Object representing the delayed result of an XML-RPC
request.
.is_ready: bool
True when the result is received; False before then.
.value : any
Once is_ready=True, this attribute contains the result of the
re... | Add GLib mainllop transport for xmlrpcserverimport gobject
import xmlrpclib
class XMLRPCDeferred (gobject.GObject):
"""Object representing the delayed result of an XML-RPC
request.
.is_ready: bool
True when the result is received; False before then.
.value : any
Once is_ready=True, this a... | <commit_before><commit_msg>Add GLib mainllop transport for xmlrpcserver<commit_after>import gobject
import xmlrpclib
class XMLRPCDeferred (gobject.GObject):
"""Object representing the delayed result of an XML-RPC
request.
.is_ready: bool
True when the result is received; False before then.
.val... | |
0880d067f478ba6474e433e620a1e48e23ed9c34 | wsgi/setup_nginxuwsgi.py | wsgi/setup_nginxuwsgi.py | import subprocess
import multiprocessing
import os
bin_dir = os.path.expanduser('~/FrameworkBenchmarks/installs/py2/bin')
config_dir = os.path.expanduser('~/FrameworkBenchmarks/config')
NCPU = multiprocessing.cpu_count()
def start(args):
try:
subprocess.check_call('sudo /usr/local/nginx/sbin/nginx -c ' +
... | Add nginx+uWSGI for 10% perf improvement over gunicorn | wsgi: Add nginx+uWSGI for 10% perf improvement over gunicorn
nginx+uWSGI can be a killer performance combination as described here:
http://lists.unbit.it/pipermail/uwsgi/2013-September/006431.html
| Python | bsd-3-clause | hamiltont/FrameworkBenchmarks,seem-sky/FrameworkBenchmarks,sxend/FrameworkBenchmarks,leafo/FrameworkBenchmarks,kostya-sh/FrameworkBenchmarks,steveklabnik/FrameworkBenchmarks,youprofit/FrameworkBenchmarks,mfirry/FrameworkBenchmarks,thousandsofthem/FrameworkBenchmarks,jeevatkm/FrameworkBenchmarks,valyala/FrameworkBenchma... | wsgi: Add nginx+uWSGI for 10% perf improvement over gunicorn
nginx+uWSGI can be a killer performance combination as described here:
http://lists.unbit.it/pipermail/uwsgi/2013-September/006431.html | import subprocess
import multiprocessing
import os
bin_dir = os.path.expanduser('~/FrameworkBenchmarks/installs/py2/bin')
config_dir = os.path.expanduser('~/FrameworkBenchmarks/config')
NCPU = multiprocessing.cpu_count()
def start(args):
try:
subprocess.check_call('sudo /usr/local/nginx/sbin/nginx -c ' +
... | <commit_before><commit_msg>wsgi: Add nginx+uWSGI for 10% perf improvement over gunicorn
nginx+uWSGI can be a killer performance combination as described here:
http://lists.unbit.it/pipermail/uwsgi/2013-September/006431.html<commit_after> | import subprocess
import multiprocessing
import os
bin_dir = os.path.expanduser('~/FrameworkBenchmarks/installs/py2/bin')
config_dir = os.path.expanduser('~/FrameworkBenchmarks/config')
NCPU = multiprocessing.cpu_count()
def start(args):
try:
subprocess.check_call('sudo /usr/local/nginx/sbin/nginx -c ' +
... | wsgi: Add nginx+uWSGI for 10% perf improvement over gunicorn
nginx+uWSGI can be a killer performance combination as described here:
http://lists.unbit.it/pipermail/uwsgi/2013-September/006431.htmlimport subprocess
import multiprocessing
import os
bin_dir = os.path.expanduser('~/FrameworkBenchmarks/installs/py2/bin')... | <commit_before><commit_msg>wsgi: Add nginx+uWSGI for 10% perf improvement over gunicorn
nginx+uWSGI can be a killer performance combination as described here:
http://lists.unbit.it/pipermail/uwsgi/2013-September/006431.html<commit_after>import subprocess
import multiprocessing
import os
bin_dir = os.path.expanduser(... | |
3709bcbd421d82f9404ab3b054989546d95c006f | sc2reader/scripts/sc2json.py | sc2reader/scripts/sc2json.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals, division
import sc2reader
from sc2reader.plugins.replay import toJSON
def main():
import argparse
parser = argparse.ArgumentParser(description="Prints replay data to a json string.")
pa... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals, division
import sc2reader
from sc2reader.factories.plugins.replay import toJSON
def main():
import argparse
parser = argparse.ArgumentParser(description="Prints replay data to a json string... | Fix another broken sc2reader.plugins reference. | Fix another broken sc2reader.plugins reference.
| Python | mit | ggtracker/sc2reader,GraylinKim/sc2reader,vlaufer/sc2reader,StoicLoofah/sc2reader,GraylinKim/sc2reader,StoicLoofah/sc2reader,ggtracker/sc2reader,vlaufer/sc2reader | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals, division
import sc2reader
from sc2reader.plugins.replay import toJSON
def main():
import argparse
parser = argparse.ArgumentParser(description="Prints replay data to a json string.")
pa... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals, division
import sc2reader
from sc2reader.factories.plugins.replay import toJSON
def main():
import argparse
parser = argparse.ArgumentParser(description="Prints replay data to a json string... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals, division
import sc2reader
from sc2reader.plugins.replay import toJSON
def main():
import argparse
parser = argparse.ArgumentParser(description="Prints replay data to a json s... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals, division
import sc2reader
from sc2reader.factories.plugins.replay import toJSON
def main():
import argparse
parser = argparse.ArgumentParser(description="Prints replay data to a json string... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals, division
import sc2reader
from sc2reader.plugins.replay import toJSON
def main():
import argparse
parser = argparse.ArgumentParser(description="Prints replay data to a json string.")
pa... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals, division
import sc2reader
from sc2reader.plugins.replay import toJSON
def main():
import argparse
parser = argparse.ArgumentParser(description="Prints replay data to a json s... |
c3c559f893e31e728a429cf446039781cea1f25d | tests/test_tensorflow_magics.py | tests/test_tensorflow_magics.py | # Copyright 2019 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | Add unit tests for `%tensorflow_version` | Add unit tests for `%tensorflow_version`
In preparation for changes to this file that will additionally configure
the `PATH` and `PYTHONPATH` environment variables, which is required for
proper TensorBoard support.
PiperOrigin-RevId: 259611678
| Python | apache-2.0 | googlecolab/colabtools,googlecolab/colabtools | Add unit tests for `%tensorflow_version`
In preparation for changes to this file that will additionally configure
the `PATH` and `PYTHONPATH` environment variables, which is required for
proper TensorBoard support.
PiperOrigin-RevId: 259611678 | # Copyright 2019 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | <commit_before><commit_msg>Add unit tests for `%tensorflow_version`
In preparation for changes to this file that will additionally configure
the `PATH` and `PYTHONPATH` environment variables, which is required for
proper TensorBoard support.
PiperOrigin-RevId: 259611678<commit_after> | # Copyright 2019 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | Add unit tests for `%tensorflow_version`
In preparation for changes to this file that will additionally configure
the `PATH` and `PYTHONPATH` environment variables, which is required for
proper TensorBoard support.
PiperOrigin-RevId: 259611678# Copyright 2019 Google Inc.
#
# Licensed under the Apache License, Version... | <commit_before><commit_msg>Add unit tests for `%tensorflow_version`
In preparation for changes to this file that will additionally configure
the `PATH` and `PYTHONPATH` environment variables, which is required for
proper TensorBoard support.
PiperOrigin-RevId: 259611678<commit_after># Copyright 2019 Google Inc.
#
# L... | |
be01980afe4b1dbd5a1d5b07651cd7a54c771d01 | tests/modules/test_disk.py | tests/modules/test_disk.py | # pylint: disable=C0103,C0111
import mock
import unittest
import tests.mocks as mocks
from bumblebee.input import LEFT_MOUSE
from bumblebee.modules.disk import Module
class MockVFS(object):
def __init__(self, perc):
self.f_blocks = 1024*1024
self.f_frsize = 1
self.f_bavail = self.f_block... | Add unit tests for disk module | [tests] Add unit tests for disk module
| Python | mit | tobi-wan-kenobi/bumblebee-status,tobi-wan-kenobi/bumblebee-status | [tests] Add unit tests for disk module | # pylint: disable=C0103,C0111
import mock
import unittest
import tests.mocks as mocks
from bumblebee.input import LEFT_MOUSE
from bumblebee.modules.disk import Module
class MockVFS(object):
def __init__(self, perc):
self.f_blocks = 1024*1024
self.f_frsize = 1
self.f_bavail = self.f_block... | <commit_before><commit_msg>[tests] Add unit tests for disk module<commit_after> | # pylint: disable=C0103,C0111
import mock
import unittest
import tests.mocks as mocks
from bumblebee.input import LEFT_MOUSE
from bumblebee.modules.disk import Module
class MockVFS(object):
def __init__(self, perc):
self.f_blocks = 1024*1024
self.f_frsize = 1
self.f_bavail = self.f_block... | [tests] Add unit tests for disk module# pylint: disable=C0103,C0111
import mock
import unittest
import tests.mocks as mocks
from bumblebee.input import LEFT_MOUSE
from bumblebee.modules.disk import Module
class MockVFS(object):
def __init__(self, perc):
self.f_blocks = 1024*1024
self.f_frsize = ... | <commit_before><commit_msg>[tests] Add unit tests for disk module<commit_after># pylint: disable=C0103,C0111
import mock
import unittest
import tests.mocks as mocks
from bumblebee.input import LEFT_MOUSE
from bumblebee.modules.disk import Module
class MockVFS(object):
def __init__(self, perc):
self.f_bl... | |
76468926c1efe4d18477a70d767f91d4c6e38768 | tests/test_dottedcircle.py | tests/test_dottedcircle.py | import uharfbuzz as hb
import gflanguages
import pytest
langs = gflanguages.LoadLanguages()
@pytest.fixture
def hb_font():
# Persuade Harfbuzz we have a font that supports
# every codepoint.
face = hb.Face(b"")
font = hb.Font(face)
funcs = hb.FontFuncs.create()
funcs.set_nominal_glyph_func((l... | Add test for dotted circles in sample text | Add test for dotted circles in sample text
| Python | apache-2.0 | googlefonts/lang | Add test for dotted circles in sample text | import uharfbuzz as hb
import gflanguages
import pytest
langs = gflanguages.LoadLanguages()
@pytest.fixture
def hb_font():
# Persuade Harfbuzz we have a font that supports
# every codepoint.
face = hb.Face(b"")
font = hb.Font(face)
funcs = hb.FontFuncs.create()
funcs.set_nominal_glyph_func((l... | <commit_before><commit_msg>Add test for dotted circles in sample text<commit_after> | import uharfbuzz as hb
import gflanguages
import pytest
langs = gflanguages.LoadLanguages()
@pytest.fixture
def hb_font():
# Persuade Harfbuzz we have a font that supports
# every codepoint.
face = hb.Face(b"")
font = hb.Font(face)
funcs = hb.FontFuncs.create()
funcs.set_nominal_glyph_func((l... | Add test for dotted circles in sample textimport uharfbuzz as hb
import gflanguages
import pytest
langs = gflanguages.LoadLanguages()
@pytest.fixture
def hb_font():
# Persuade Harfbuzz we have a font that supports
# every codepoint.
face = hb.Face(b"")
font = hb.Font(face)
funcs = hb.FontFuncs.cr... | <commit_before><commit_msg>Add test for dotted circles in sample text<commit_after>import uharfbuzz as hb
import gflanguages
import pytest
langs = gflanguages.LoadLanguages()
@pytest.fixture
def hb_font():
# Persuade Harfbuzz we have a font that supports
# every codepoint.
face = hb.Face(b"")
font = ... | |
17f71bfb81393241759e38fb9dce01561aeca3d5 | tests/test_product_tags.py | tests/test_product_tags.py | from mock import Mock
from saleor.product.templatetags.product_images import get_thumbnail, product_first_image
def test_get_thumbnail():
instance = Mock()
cropped_value = Mock(url='crop.jpg')
thumbnail_value = Mock(url='thumb.jpg')
instance.crop = {'10x10': cropped_value}
instance.thumbnail = {'1... | Add tests to product tags | Add tests to product tags
| Python | bsd-3-clause | car3oon/saleor,itbabu/saleor,UITools/saleor,KenMutemi/saleor,maferelo/saleor,KenMutemi/saleor,jreigel/saleor,mociepka/saleor,mociepka/saleor,itbabu/saleor,tfroehlich82/saleor,HyperManTT/ECommerceSaleor,UITools/saleor,HyperManTT/ECommerceSaleor,jreigel/saleor,UITools/saleor,UITools/saleor,tfroehlich82/saleor,itbabu/sale... | Add tests to product tags | from mock import Mock
from saleor.product.templatetags.product_images import get_thumbnail, product_first_image
def test_get_thumbnail():
instance = Mock()
cropped_value = Mock(url='crop.jpg')
thumbnail_value = Mock(url='thumb.jpg')
instance.crop = {'10x10': cropped_value}
instance.thumbnail = {'1... | <commit_before><commit_msg>Add tests to product tags<commit_after> | from mock import Mock
from saleor.product.templatetags.product_images import get_thumbnail, product_first_image
def test_get_thumbnail():
instance = Mock()
cropped_value = Mock(url='crop.jpg')
thumbnail_value = Mock(url='thumb.jpg')
instance.crop = {'10x10': cropped_value}
instance.thumbnail = {'1... | Add tests to product tagsfrom mock import Mock
from saleor.product.templatetags.product_images import get_thumbnail, product_first_image
def test_get_thumbnail():
instance = Mock()
cropped_value = Mock(url='crop.jpg')
thumbnail_value = Mock(url='thumb.jpg')
instance.crop = {'10x10': cropped_value}
... | <commit_before><commit_msg>Add tests to product tags<commit_after>from mock import Mock
from saleor.product.templatetags.product_images import get_thumbnail, product_first_image
def test_get_thumbnail():
instance = Mock()
cropped_value = Mock(url='crop.jpg')
thumbnail_value = Mock(url='thumb.jpg')
ins... | |
e455d459590a4f2b16b9a9360b6e33640f5ec7bf | python/allcheck.py | python/allcheck.py | #!/usr/bin/env python
import sys
import re
import glob
import phonenumbers
INTERNAL_FILES = ['phonenumbers/util.py',
'phonenumbers/re_util.py',
'phonenumbers/unicode_util.py']
CLASS_RE = re.compile(r"^class +([A-Za-z][_A-Za-z0-9]+)[ \(:]")
FUNCTION_RE = re.compile("^def +([A-Za-z][... | Add a script to check that __all__ in __init__.py is correct | Add a script to check that __all__ in __init__.py is correct | Python | apache-2.0 | daviddrysdale/python-phonenumbers,roubert/python-phonenumbers,daodaoliang/python-phonenumbers,titansgroup/python-phonenumbers,dongguangming/python-phonenumbers,daviddrysdale/python-phonenumbers,agentr13/python-phonenumbers,gencer/python-phonenumbers,SergiuMir/python-phonenumbers,shikigit/python-phonenumbers,daviddrysda... | Add a script to check that __all__ in __init__.py is correct | #!/usr/bin/env python
import sys
import re
import glob
import phonenumbers
INTERNAL_FILES = ['phonenumbers/util.py',
'phonenumbers/re_util.py',
'phonenumbers/unicode_util.py']
CLASS_RE = re.compile(r"^class +([A-Za-z][_A-Za-z0-9]+)[ \(:]")
FUNCTION_RE = re.compile("^def +([A-Za-z][... | <commit_before><commit_msg>Add a script to check that __all__ in __init__.py is correct<commit_after> | #!/usr/bin/env python
import sys
import re
import glob
import phonenumbers
INTERNAL_FILES = ['phonenumbers/util.py',
'phonenumbers/re_util.py',
'phonenumbers/unicode_util.py']
CLASS_RE = re.compile(r"^class +([A-Za-z][_A-Za-z0-9]+)[ \(:]")
FUNCTION_RE = re.compile("^def +([A-Za-z][... | Add a script to check that __all__ in __init__.py is correct#!/usr/bin/env python
import sys
import re
import glob
import phonenumbers
INTERNAL_FILES = ['phonenumbers/util.py',
'phonenumbers/re_util.py',
'phonenumbers/unicode_util.py']
CLASS_RE = re.compile(r"^class +([A-Za-z][_A-Z... | <commit_before><commit_msg>Add a script to check that __all__ in __init__.py is correct<commit_after>#!/usr/bin/env python
import sys
import re
import glob
import phonenumbers
INTERNAL_FILES = ['phonenumbers/util.py',
'phonenumbers/re_util.py',
'phonenumbers/unicode_util.py']
CLASS... | |
48c844e602eaa182c4efaaa0b977765f4248d0a0 | tools/network_migration.py | tools/network_migration.py | import argparse, shelve
def renameDictKeys(storageDict):
for key in storageDict.iterkeys():
if isinstance(storageDict[key], dict):
renameDictKeys(storageDict[key])
if key == options.oldnetwork:
storageDict[options.newnetwork] = storageDict[options.oldnetwork]
del... | Add a data migration tool | Add a data migration tool
| Python | mit | Heufneutje/PyHeufyBot,Heufneutje/PyHeufyBot | Add a data migration tool | import argparse, shelve
def renameDictKeys(storageDict):
for key in storageDict.iterkeys():
if isinstance(storageDict[key], dict):
renameDictKeys(storageDict[key])
if key == options.oldnetwork:
storageDict[options.newnetwork] = storageDict[options.oldnetwork]
del... | <commit_before><commit_msg>Add a data migration tool<commit_after> | import argparse, shelve
def renameDictKeys(storageDict):
for key in storageDict.iterkeys():
if isinstance(storageDict[key], dict):
renameDictKeys(storageDict[key])
if key == options.oldnetwork:
storageDict[options.newnetwork] = storageDict[options.oldnetwork]
del... | Add a data migration toolimport argparse, shelve
def renameDictKeys(storageDict):
for key in storageDict.iterkeys():
if isinstance(storageDict[key], dict):
renameDictKeys(storageDict[key])
if key == options.oldnetwork:
storageDict[options.newnetwork] = storageDict[options.ol... | <commit_before><commit_msg>Add a data migration tool<commit_after>import argparse, shelve
def renameDictKeys(storageDict):
for key in storageDict.iterkeys():
if isinstance(storageDict[key], dict):
renameDictKeys(storageDict[key])
if key == options.oldnetwork:
storageDict[opt... | |
d72d2e38d177476470b22ded061dd06b2be3ee88 | turbustat/tests/helpers.py | turbustat/tests/helpers.py | from __future__ import print_function, absolute_import, division
from astropy import units as u
from numpy.testing import assert_allclose as assert_allclose_numpy, assert_array_equal
def assert_allclose(q1, q2, **kwargs):
"""
Quantity-safe version of Numpy's assert_allclose
Copyright (c) 2014, spectral... | Add the quantity-safe allclose from spectral-cube | Add the quantity-safe allclose from spectral-cube
| Python | mit | e-koch/TurbuStat,Astroua/TurbuStat | Add the quantity-safe allclose from spectral-cube | from __future__ import print_function, absolute_import, division
from astropy import units as u
from numpy.testing import assert_allclose as assert_allclose_numpy, assert_array_equal
def assert_allclose(q1, q2, **kwargs):
"""
Quantity-safe version of Numpy's assert_allclose
Copyright (c) 2014, spectral... | <commit_before><commit_msg>Add the quantity-safe allclose from spectral-cube<commit_after> | from __future__ import print_function, absolute_import, division
from astropy import units as u
from numpy.testing import assert_allclose as assert_allclose_numpy, assert_array_equal
def assert_allclose(q1, q2, **kwargs):
"""
Quantity-safe version of Numpy's assert_allclose
Copyright (c) 2014, spectral... | Add the quantity-safe allclose from spectral-cubefrom __future__ import print_function, absolute_import, division
from astropy import units as u
from numpy.testing import assert_allclose as assert_allclose_numpy, assert_array_equal
def assert_allclose(q1, q2, **kwargs):
"""
Quantity-safe version of Numpy's ... | <commit_before><commit_msg>Add the quantity-safe allclose from spectral-cube<commit_after>from __future__ import print_function, absolute_import, division
from astropy import units as u
from numpy.testing import assert_allclose as assert_allclose_numpy, assert_array_equal
def assert_allclose(q1, q2, **kwargs):
... | |
835b5f20061033b6fcf2a8b86203a42c5d4835ee | spotpy/unittests/test_parameter.py | spotpy/unittests/test_parameter.py | import unittest
try:
import spotpy
except ImportError:
import sys
sys.path.append(".")
import spotpy
from spotpy import parameter
import numpy as np
#https://docs.python.org/3/library/unittest.html
class TestListParameterDistribution(unittest.TestCase):
def setUp(self):
self.values = [1, ... | Add initial unit tests for parameter.py (List) | Add initial unit tests for parameter.py (List)
| Python | mit | bees4ever/spotpy,bees4ever/spotpy,thouska/spotpy,thouska/spotpy,thouska/spotpy,bees4ever/spotpy | Add initial unit tests for parameter.py (List) | import unittest
try:
import spotpy
except ImportError:
import sys
sys.path.append(".")
import spotpy
from spotpy import parameter
import numpy as np
#https://docs.python.org/3/library/unittest.html
class TestListParameterDistribution(unittest.TestCase):
def setUp(self):
self.values = [1, ... | <commit_before><commit_msg>Add initial unit tests for parameter.py (List)<commit_after> | import unittest
try:
import spotpy
except ImportError:
import sys
sys.path.append(".")
import spotpy
from spotpy import parameter
import numpy as np
#https://docs.python.org/3/library/unittest.html
class TestListParameterDistribution(unittest.TestCase):
def setUp(self):
self.values = [1, ... | Add initial unit tests for parameter.py (List)import unittest
try:
import spotpy
except ImportError:
import sys
sys.path.append(".")
import spotpy
from spotpy import parameter
import numpy as np
#https://docs.python.org/3/library/unittest.html
class TestListParameterDistribution(unittest.TestCase):
... | <commit_before><commit_msg>Add initial unit tests for parameter.py (List)<commit_after>import unittest
try:
import spotpy
except ImportError:
import sys
sys.path.append(".")
import spotpy
from spotpy import parameter
import numpy as np
#https://docs.python.org/3/library/unittest.html
class TestListPar... | |
b1feed0ced6d1328cc39bc9bba36331ec6da7803 | pre_commit_hooks/detect_private_key.py | pre_commit_hooks/detect_private_key.py | from __future__ import print_function
import argparse
import sys
BLACKLIST = [
b'BEGIN RSA PRIVATE KEY',
b'BEGIN DSA PRIVATE KEY',
b'BEGIN EC PRIVATE KEY',
b'BEGIN OPENSSH PRIVATE KEY',
b'BEGIN PRIVATE KEY',
b'PuTTY-User-Key-File-2',
b'BEGIN SSH2 ENCRYPTED PRIVATE KEY',
]
def detect_priv... | from __future__ import print_function
import argparse
import sys
BLACKLIST = [
b'BEGIN RSA PRIVATE KEY',
b'BEGIN DSA PRIVATE KEY',
b'BEGIN EC PRIVATE KEY',
b'BEGIN OPENSSH PRIVATE KEY',
b'BEGIN PRIVATE KEY',
b'PuTTY-User-Key-File-2',
b'BEGIN SSH2 ENCRYPTED PRIVATE KEY',
b'BEGIN PGP PRI... | Add ban for pgp/gpg private key blocks | Add ban for pgp/gpg private key blocks
| Python | mit | pre-commit/pre-commit-hooks,Harwood/pre-commit-hooks | from __future__ import print_function
import argparse
import sys
BLACKLIST = [
b'BEGIN RSA PRIVATE KEY',
b'BEGIN DSA PRIVATE KEY',
b'BEGIN EC PRIVATE KEY',
b'BEGIN OPENSSH PRIVATE KEY',
b'BEGIN PRIVATE KEY',
b'PuTTY-User-Key-File-2',
b'BEGIN SSH2 ENCRYPTED PRIVATE KEY',
]
def detect_priv... | from __future__ import print_function
import argparse
import sys
BLACKLIST = [
b'BEGIN RSA PRIVATE KEY',
b'BEGIN DSA PRIVATE KEY',
b'BEGIN EC PRIVATE KEY',
b'BEGIN OPENSSH PRIVATE KEY',
b'BEGIN PRIVATE KEY',
b'PuTTY-User-Key-File-2',
b'BEGIN SSH2 ENCRYPTED PRIVATE KEY',
b'BEGIN PGP PRI... | <commit_before>from __future__ import print_function
import argparse
import sys
BLACKLIST = [
b'BEGIN RSA PRIVATE KEY',
b'BEGIN DSA PRIVATE KEY',
b'BEGIN EC PRIVATE KEY',
b'BEGIN OPENSSH PRIVATE KEY',
b'BEGIN PRIVATE KEY',
b'PuTTY-User-Key-File-2',
b'BEGIN SSH2 ENCRYPTED PRIVATE KEY',
]
... | from __future__ import print_function
import argparse
import sys
BLACKLIST = [
b'BEGIN RSA PRIVATE KEY',
b'BEGIN DSA PRIVATE KEY',
b'BEGIN EC PRIVATE KEY',
b'BEGIN OPENSSH PRIVATE KEY',
b'BEGIN PRIVATE KEY',
b'PuTTY-User-Key-File-2',
b'BEGIN SSH2 ENCRYPTED PRIVATE KEY',
b'BEGIN PGP PRI... | from __future__ import print_function
import argparse
import sys
BLACKLIST = [
b'BEGIN RSA PRIVATE KEY',
b'BEGIN DSA PRIVATE KEY',
b'BEGIN EC PRIVATE KEY',
b'BEGIN OPENSSH PRIVATE KEY',
b'BEGIN PRIVATE KEY',
b'PuTTY-User-Key-File-2',
b'BEGIN SSH2 ENCRYPTED PRIVATE KEY',
]
def detect_priv... | <commit_before>from __future__ import print_function
import argparse
import sys
BLACKLIST = [
b'BEGIN RSA PRIVATE KEY',
b'BEGIN DSA PRIVATE KEY',
b'BEGIN EC PRIVATE KEY',
b'BEGIN OPENSSH PRIVATE KEY',
b'BEGIN PRIVATE KEY',
b'PuTTY-User-Key-File-2',
b'BEGIN SSH2 ENCRYPTED PRIVATE KEY',
]
... |
4883bd13c6e07a0568c29fd26a141888b52292b7 | utils/player_draft_retriever.py | utils/player_draft_retriever.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import re
import requests
from lxml import html
from db.team import Team
from db.player_draft import PlayerDraft
class PlayerDraftRetriever():
NHL_PLAYER_DRAFT_PREFIX = "https://www.nhl.com/player"
DRAFT_INFO_REGEX = re.compile(
"(\d{4})\s(.+),\s(\d+).+... | Add retriever object for player draft information | Add retriever object for player draft information
| Python | mit | leaffan/pynhldb | Add retriever object for player draft information | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import re
import requests
from lxml import html
from db.team import Team
from db.player_draft import PlayerDraft
class PlayerDraftRetriever():
NHL_PLAYER_DRAFT_PREFIX = "https://www.nhl.com/player"
DRAFT_INFO_REGEX = re.compile(
"(\d{4})\s(.+),\s(\d+).+... | <commit_before><commit_msg>Add retriever object for player draft information<commit_after> | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import re
import requests
from lxml import html
from db.team import Team
from db.player_draft import PlayerDraft
class PlayerDraftRetriever():
NHL_PLAYER_DRAFT_PREFIX = "https://www.nhl.com/player"
DRAFT_INFO_REGEX = re.compile(
"(\d{4})\s(.+),\s(\d+).+... | Add retriever object for player draft information#!/usr/bin/env python
# -*- coding: utf-8 -*-
import re
import requests
from lxml import html
from db.team import Team
from db.player_draft import PlayerDraft
class PlayerDraftRetriever():
NHL_PLAYER_DRAFT_PREFIX = "https://www.nhl.com/player"
DRAFT_INFO_REG... | <commit_before><commit_msg>Add retriever object for player draft information<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-
import re
import requests
from lxml import html
from db.team import Team
from db.player_draft import PlayerDraft
class PlayerDraftRetriever():
NHL_PLAYER_DRAFT_PREFIX = "https... | |
bc34d530f4a21b5f06228d626f446c617b9c8876 | examples/defconfig_oldconfig.py | examples/defconfig_oldconfig.py | # Produces exactly the same output as the following script:
#
# make defconfig
# echo CONFIG_ETHERNET=n >> .config
# make oldconfig
# echo CONFIG_ETHERNET=y >> .config
# yes n | make oldconfig
#
# This came up in https://github.com/ulfalizer/Kconfiglib/issues/15.
import kconfiglib
import sys
conf = kconfiglib.Config(... | Add example that mirrors defconfig and oldconfig. | Add example that mirrors defconfig and oldconfig.
From https://github.com/ulfalizer/Kconfiglib/issues/15. Getting the
output to match up exactly requires emulating each step, due to Kconfig
subtleties related to which symbols have been assigned values by the
user. The output might differ with other approaches, but thi... | Python | isc | ulfalizer/Kconfiglib,ulfalizer/Kconfiglib | Add example that mirrors defconfig and oldconfig.
From https://github.com/ulfalizer/Kconfiglib/issues/15. Getting the
output to match up exactly requires emulating each step, due to Kconfig
subtleties related to which symbols have been assigned values by the
user. The output might differ with other approaches, but thi... | # Produces exactly the same output as the following script:
#
# make defconfig
# echo CONFIG_ETHERNET=n >> .config
# make oldconfig
# echo CONFIG_ETHERNET=y >> .config
# yes n | make oldconfig
#
# This came up in https://github.com/ulfalizer/Kconfiglib/issues/15.
import kconfiglib
import sys
conf = kconfiglib.Config(... | <commit_before><commit_msg>Add example that mirrors defconfig and oldconfig.
From https://github.com/ulfalizer/Kconfiglib/issues/15. Getting the
output to match up exactly requires emulating each step, due to Kconfig
subtleties related to which symbols have been assigned values by the
user. The output might differ wit... | # Produces exactly the same output as the following script:
#
# make defconfig
# echo CONFIG_ETHERNET=n >> .config
# make oldconfig
# echo CONFIG_ETHERNET=y >> .config
# yes n | make oldconfig
#
# This came up in https://github.com/ulfalizer/Kconfiglib/issues/15.
import kconfiglib
import sys
conf = kconfiglib.Config(... | Add example that mirrors defconfig and oldconfig.
From https://github.com/ulfalizer/Kconfiglib/issues/15. Getting the
output to match up exactly requires emulating each step, due to Kconfig
subtleties related to which symbols have been assigned values by the
user. The output might differ with other approaches, but thi... | <commit_before><commit_msg>Add example that mirrors defconfig and oldconfig.
From https://github.com/ulfalizer/Kconfiglib/issues/15. Getting the
output to match up exactly requires emulating each step, due to Kconfig
subtleties related to which symbols have been assigned values by the
user. The output might differ wit... | |
06cd9e8e5006d68d7656b7f147442e54aaf9d7a1 | clubs/migrations/0035_add_public_health_college.py | clubs/migrations/0035_add_public_health_college.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
def add_college(apps, schema_editor):
Club = apps.get_model('clubs', 'Club')
College = apps.get_model('clubs', 'College')
StudentClubYear = apps.get_model('core', 'StudentClubYear')
year_2015_2016 ... | Add female Public Health College and Club | Add female Public Health College and Club
| Python | agpl-3.0 | enjaz/enjaz,osamak/student-portal,osamak/student-portal,enjaz/enjaz,osamak/student-portal,osamak/student-portal,enjaz/enjaz,osamak/student-portal,enjaz/enjaz,enjaz/enjaz | Add female Public Health College and Club | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
def add_college(apps, schema_editor):
Club = apps.get_model('clubs', 'Club')
College = apps.get_model('clubs', 'College')
StudentClubYear = apps.get_model('core', 'StudentClubYear')
year_2015_2016 ... | <commit_before><commit_msg>Add female Public Health College and Club<commit_after> | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
def add_college(apps, schema_editor):
Club = apps.get_model('clubs', 'Club')
College = apps.get_model('clubs', 'College')
StudentClubYear = apps.get_model('core', 'StudentClubYear')
year_2015_2016 ... | Add female Public Health College and Club# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
def add_college(apps, schema_editor):
Club = apps.get_model('clubs', 'Club')
College = apps.get_model('clubs', 'College')
StudentClubYear = apps.get_model('core... | <commit_before><commit_msg>Add female Public Health College and Club<commit_after># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
def add_college(apps, schema_editor):
Club = apps.get_model('clubs', 'Club')
College = apps.get_model('clubs', 'College')
... | |
17cdae7f50a7ed15c4e8a84cdb0000a32f824c5f | examples/outh/getaccesstoken.py | examples/outh/getaccesstoken.py | import webbrowser
import tweepy
"""
Query the user for their consumer key/secret
then attempt to fetch a valid access token.
"""
if __name__ == "__main__":
consumer_key = raw_input('Consumer key: ').strip()
consumer_secret = raw_input('Consumer secret: ').strip()
auth = tweepy.OAuthHandler(consu... | Add an oauth example script. | Add an oauth example script.
| Python | mit | xrg/tweepy,raymondethan/tweepy,damchilly/tweepy,mlinsey/tweepy,ze-phyr-us/tweepy,obskyr/tweepy,markunsworth/tweepy,edsu/tweepy,kcompher/tweepy,yared-bezum/tweepy,tuxos/tweepy,alexhanna/tweepy,nickmalleson/tweepy,iamjakob/tweepy,cogniteev/tweepy,cinemapub/bright-response,nickmalleson/tweepy,conversocial/tweepy,cinemapub... | Add an oauth example script. | import webbrowser
import tweepy
"""
Query the user for their consumer key/secret
then attempt to fetch a valid access token.
"""
if __name__ == "__main__":
consumer_key = raw_input('Consumer key: ').strip()
consumer_secret = raw_input('Consumer secret: ').strip()
auth = tweepy.OAuthHandler(consu... | <commit_before><commit_msg>Add an oauth example script.<commit_after> | import webbrowser
import tweepy
"""
Query the user for their consumer key/secret
then attempt to fetch a valid access token.
"""
if __name__ == "__main__":
consumer_key = raw_input('Consumer key: ').strip()
consumer_secret = raw_input('Consumer secret: ').strip()
auth = tweepy.OAuthHandler(consu... | Add an oauth example script.import webbrowser
import tweepy
"""
Query the user for their consumer key/secret
then attempt to fetch a valid access token.
"""
if __name__ == "__main__":
consumer_key = raw_input('Consumer key: ').strip()
consumer_secret = raw_input('Consumer secret: ').strip()
auth... | <commit_before><commit_msg>Add an oauth example script.<commit_after>import webbrowser
import tweepy
"""
Query the user for their consumer key/secret
then attempt to fetch a valid access token.
"""
if __name__ == "__main__":
consumer_key = raw_input('Consumer key: ').strip()
consumer_secret = raw_in... | |
bc32b2bccc82caecea0cf936e13c3ae70d0e9486 | utils/check.py | utils/check.py | from pathlib import Path
from PIL import Image
from concurrent.futures import ProcessPoolExecutor
import os
import sys
def verify_or_delete(filename):
try:
Image.open(filename).load()
except OSError:
return False
return True
if __name__ == '__main__':
if len(sys.argv) < 2:
pri... | Add script to remove broken images. | Add script to remove broken images.
| Python | mit | Lodour/Weibo-Album-Crawler | Add script to remove broken images. | from pathlib import Path
from PIL import Image
from concurrent.futures import ProcessPoolExecutor
import os
import sys
def verify_or_delete(filename):
try:
Image.open(filename).load()
except OSError:
return False
return True
if __name__ == '__main__':
if len(sys.argv) < 2:
pri... | <commit_before><commit_msg>Add script to remove broken images.<commit_after> | from pathlib import Path
from PIL import Image
from concurrent.futures import ProcessPoolExecutor
import os
import sys
def verify_or_delete(filename):
try:
Image.open(filename).load()
except OSError:
return False
return True
if __name__ == '__main__':
if len(sys.argv) < 2:
pri... | Add script to remove broken images.from pathlib import Path
from PIL import Image
from concurrent.futures import ProcessPoolExecutor
import os
import sys
def verify_or_delete(filename):
try:
Image.open(filename).load()
except OSError:
return False
return True
if __name__ == '__main__':
... | <commit_before><commit_msg>Add script to remove broken images.<commit_after>from pathlib import Path
from PIL import Image
from concurrent.futures import ProcessPoolExecutor
import os
import sys
def verify_or_delete(filename):
try:
Image.open(filename).load()
except OSError:
return False
re... | |
388bbd915a5e40a2e096eb22ab294ffcbd3db936 | bananas/model.py | bananas/model.py | import numpy
# FIXME: copy the functions here
from sklearn.mixture.gmm import log_multivariate_normal_density, logsumexp
class GMM(object):
def __init__(self, weights, means, covs):
self.weights = numpy.array(weights)
self.means = numpy.array(means)
self.covs = numpy.array(covs)
def s... | Add a gmm, currently wrapping sklearn | Add a gmm, currently wrapping sklearn
| Python | apache-2.0 | bccp/bananaplots,bccp/bananaplots | Add a gmm, currently wrapping sklearn | import numpy
# FIXME: copy the functions here
from sklearn.mixture.gmm import log_multivariate_normal_density, logsumexp
class GMM(object):
def __init__(self, weights, means, covs):
self.weights = numpy.array(weights)
self.means = numpy.array(means)
self.covs = numpy.array(covs)
def s... | <commit_before><commit_msg>Add a gmm, currently wrapping sklearn<commit_after> | import numpy
# FIXME: copy the functions here
from sklearn.mixture.gmm import log_multivariate_normal_density, logsumexp
class GMM(object):
def __init__(self, weights, means, covs):
self.weights = numpy.array(weights)
self.means = numpy.array(means)
self.covs = numpy.array(covs)
def s... | Add a gmm, currently wrapping sklearnimport numpy
# FIXME: copy the functions here
from sklearn.mixture.gmm import log_multivariate_normal_density, logsumexp
class GMM(object):
def __init__(self, weights, means, covs):
self.weights = numpy.array(weights)
self.means = numpy.array(means)
sel... | <commit_before><commit_msg>Add a gmm, currently wrapping sklearn<commit_after>import numpy
# FIXME: copy the functions here
from sklearn.mixture.gmm import log_multivariate_normal_density, logsumexp
class GMM(object):
def __init__(self, weights, means, covs):
self.weights = numpy.array(weights)
se... | |
7e9794dc98a268479f0f57128effc67f88586c8f | bvspca/core/migrations/0025_auto_20180202_1214.py | bvspca/core/migrations/0025_auto_20180202_1214.py | # -*- coding: utf-8 -*-
# Generated by Django 1.11.9 on 2018-02-02 19:14
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0024_contentindexpage_empty_message'),
]
operations = [
migrations.... | Add default message for list pages | Add default message for list pages
| Python | mit | nfletton/bvspca,nfletton/bvspca,nfletton/bvspca,nfletton/bvspca | Add default message for list pages | # -*- coding: utf-8 -*-
# Generated by Django 1.11.9 on 2018-02-02 19:14
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0024_contentindexpage_empty_message'),
]
operations = [
migrations.... | <commit_before><commit_msg>Add default message for list pages<commit_after> | # -*- coding: utf-8 -*-
# Generated by Django 1.11.9 on 2018-02-02 19:14
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0024_contentindexpage_empty_message'),
]
operations = [
migrations.... | Add default message for list pages# -*- coding: utf-8 -*-
# Generated by Django 1.11.9 on 2018-02-02 19:14
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0024_contentindexpage_empty_message'),
]
... | <commit_before><commit_msg>Add default message for list pages<commit_after># -*- coding: utf-8 -*-
# Generated by Django 1.11.9 on 2018-02-02 19:14
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0024_cont... | |
9ce90bc43cfcc5a56be958671f304e7929eb0446 | cmsplugin_collapse/migrations/0002_auto_20160210_0651.py | cmsplugin_collapse/migrations/0002_auto_20160210_0651.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('cmsplugin_collapse', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='accordionheader',
... | Add missing migration step dua changes in model | Add missing migration step dua changes in model
This should fix #5.
| Python | bsd-3-clause | nimbis/cmsplugin-collapse,nimbis/cmsplugin-collapse | Add missing migration step dua changes in model
This should fix #5. | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('cmsplugin_collapse', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='accordionheader',
... | <commit_before><commit_msg>Add missing migration step dua changes in model
This should fix #5.<commit_after> | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('cmsplugin_collapse', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='accordionheader',
... | Add missing migration step dua changes in model
This should fix #5.# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('cmsplugin_collapse', '0001_initial'),
]
operations = [
m... | <commit_before><commit_msg>Add missing migration step dua changes in model
This should fix #5.<commit_after># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('cmsplugin_collapse', '0001_initi... | |
842c796a223ee9cb78c69ccb59416a2afe0fcee0 | tests/permissions.py | tests/permissions.py | import unittest
from permission import Permission, PERMISSION_DELIMITER
class BasicPermissionTests(unittest.TestCase):
def setUp(self):
self.p1 = Permission("test{0}1{0}hello".format(PERMISSION_DELIMITER))
self.p2 = Permission("test{0}2{0}hello".format(PERMISSION_DELIMITER))
self.p3 = Per... | Add tests for Permission class. | Add tests for Permission class.
Signed-off-by: Tyler O'Meara <c794bd35db97c1cf0b8edc21ac218cd202f68ca7@TylerOMeara.com>
| Python | mit | Acidity/PyPermissions | Add tests for Permission class.
Signed-off-by: Tyler O'Meara <c794bd35db97c1cf0b8edc21ac218cd202f68ca7@TylerOMeara.com> | import unittest
from permission import Permission, PERMISSION_DELIMITER
class BasicPermissionTests(unittest.TestCase):
def setUp(self):
self.p1 = Permission("test{0}1{0}hello".format(PERMISSION_DELIMITER))
self.p2 = Permission("test{0}2{0}hello".format(PERMISSION_DELIMITER))
self.p3 = Per... | <commit_before><commit_msg>Add tests for Permission class.
Signed-off-by: Tyler O'Meara <c794bd35db97c1cf0b8edc21ac218cd202f68ca7@TylerOMeara.com><commit_after> | import unittest
from permission import Permission, PERMISSION_DELIMITER
class BasicPermissionTests(unittest.TestCase):
def setUp(self):
self.p1 = Permission("test{0}1{0}hello".format(PERMISSION_DELIMITER))
self.p2 = Permission("test{0}2{0}hello".format(PERMISSION_DELIMITER))
self.p3 = Per... | Add tests for Permission class.
Signed-off-by: Tyler O'Meara <c794bd35db97c1cf0b8edc21ac218cd202f68ca7@TylerOMeara.com>import unittest
from permission import Permission, PERMISSION_DELIMITER
class BasicPermissionTests(unittest.TestCase):
def setUp(self):
self.p1 = Permission("test{0}1{0}hello".format(PE... | <commit_before><commit_msg>Add tests for Permission class.
Signed-off-by: Tyler O'Meara <c794bd35db97c1cf0b8edc21ac218cd202f68ca7@TylerOMeara.com><commit_after>import unittest
from permission import Permission, PERMISSION_DELIMITER
class BasicPermissionTests(unittest.TestCase):
def setUp(self):
self.p1 ... | |
f5d2b17371dbd974820b9b8ab1fcdb11ad8fa646 | backend/scripts/countdups.py | backend/scripts/countdups.py | #!/usr/bin/env python
import rethinkdb as r
conn = r.connect('localhost', 30815, db='materialscommons')
rql = r.table('datafiles').filter(r.row['usesid'].match("^[0-9a-f]")).pluck('size')
total_bytes = 0
total_files = 0
for doc in rql.run(conn):
total_bytes = total_bytes + doc['size']
total_files = total_file... | Add in script to count duplicates. | Add in script to count duplicates.
| Python | mit | materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org | Add in script to count duplicates. | #!/usr/bin/env python
import rethinkdb as r
conn = r.connect('localhost', 30815, db='materialscommons')
rql = r.table('datafiles').filter(r.row['usesid'].match("^[0-9a-f]")).pluck('size')
total_bytes = 0
total_files = 0
for doc in rql.run(conn):
total_bytes = total_bytes + doc['size']
total_files = total_file... | <commit_before><commit_msg>Add in script to count duplicates.<commit_after> | #!/usr/bin/env python
import rethinkdb as r
conn = r.connect('localhost', 30815, db='materialscommons')
rql = r.table('datafiles').filter(r.row['usesid'].match("^[0-9a-f]")).pluck('size')
total_bytes = 0
total_files = 0
for doc in rql.run(conn):
total_bytes = total_bytes + doc['size']
total_files = total_file... | Add in script to count duplicates.#!/usr/bin/env python
import rethinkdb as r
conn = r.connect('localhost', 30815, db='materialscommons')
rql = r.table('datafiles').filter(r.row['usesid'].match("^[0-9a-f]")).pluck('size')
total_bytes = 0
total_files = 0
for doc in rql.run(conn):
total_bytes = total_bytes + doc['s... | <commit_before><commit_msg>Add in script to count duplicates.<commit_after>#!/usr/bin/env python
import rethinkdb as r
conn = r.connect('localhost', 30815, db='materialscommons')
rql = r.table('datafiles').filter(r.row['usesid'].match("^[0-9a-f]")).pluck('size')
total_bytes = 0
total_files = 0
for doc in rql.run(conn... | |
8488e7c5245758e4651e6d723f93d52f3ff54d73 | tools/submit_awcy.py | tools/submit_awcy.py | #!/usr/bin/env python
from __future__ import print_function
import requests
import argparse
import os
import subprocess
import sys
if 'DAALA_ROOT' not in os.environ:
print("Please specify the DAALA_ROOT environment variable to use this tool.")
sys.exit(1)
keyfile = open('secret_key','r')
key = keyfile.read(... | Add tool for submitting jobs to AreWeCompressedYet | Add tool for submitting jobs to AreWeCompressedYet
| Python | bsd-2-clause | luctrudeau/daala,kodabb/daala,vr000m/daala,nvoron23/daala,iankronquist/daala,kustom666/daala,kustom666/daala,jmvalin/daala,kbara/daala,xiph/daala,kbara/daala,xiph/daala,jmvalin/daala,ascent12/daala,tribouille/daala,tribouille/daala,xiph/daala,xiphmont/daala,ycho/daala,xiph/daala,HeadhunterXamd/daala,nvoron23/daala,Head... | Add tool for submitting jobs to AreWeCompressedYet | #!/usr/bin/env python
from __future__ import print_function
import requests
import argparse
import os
import subprocess
import sys
if 'DAALA_ROOT' not in os.environ:
print("Please specify the DAALA_ROOT environment variable to use this tool.")
sys.exit(1)
keyfile = open('secret_key','r')
key = keyfile.read(... | <commit_before><commit_msg>Add tool for submitting jobs to AreWeCompressedYet<commit_after> | #!/usr/bin/env python
from __future__ import print_function
import requests
import argparse
import os
import subprocess
import sys
if 'DAALA_ROOT' not in os.environ:
print("Please specify the DAALA_ROOT environment variable to use this tool.")
sys.exit(1)
keyfile = open('secret_key','r')
key = keyfile.read(... | Add tool for submitting jobs to AreWeCompressedYet#!/usr/bin/env python
from __future__ import print_function
import requests
import argparse
import os
import subprocess
import sys
if 'DAALA_ROOT' not in os.environ:
print("Please specify the DAALA_ROOT environment variable to use this tool.")
sys.exit(1)
ke... | <commit_before><commit_msg>Add tool for submitting jobs to AreWeCompressedYet<commit_after>#!/usr/bin/env python
from __future__ import print_function
import requests
import argparse
import os
import subprocess
import sys
if 'DAALA_ROOT' not in os.environ:
print("Please specify the DAALA_ROOT environment variabl... | |
4d30756e722cafa40fa449e48c967eeebc58500a | zerver/management/commands/import_realm_filters.py | zerver/management/commands/import_realm_filters.py | from __future__ import absolute_import
from django.core.management.base import BaseCommand
from zerver.models import RealmFilter, get_realm
import logging
class Command(BaseCommand):
help = """Imports realm filters to database"""
def handle(self, *args, **options):
realm_filters = {
"zu... | Add a manage.py command to import realm filters | [manual] Add a manage.py command to import realm filters
This must be run manually on staging after deployment. Once it has been run,
it can be deleted. It only needs to be run on staging, not prod.
(imported from commit 79252c23ba8cda93500a18aa7b02575f406dd379)
| Python | apache-2.0 | vabs22/zulip,calvinleenyc/zulip,sup95/zulip,deer-hope/zulip,kokoar/zulip,ryanbackman/zulip,ahmadassaf/zulip,akuseru/zulip,shaunstanislaus/zulip,Gabriel0402/zulip,souravbadami/zulip,JanzTam/zulip,ufosky-server/zulip,noroot/zulip,amallia/zulip,vikas-parashar/zulip,kaiyuanheshang/zulip,synicalsyntax/zulip,ashwinirudrappa/... | [manual] Add a manage.py command to import realm filters
This must be run manually on staging after deployment. Once it has been run,
it can be deleted. It only needs to be run on staging, not prod.
(imported from commit 79252c23ba8cda93500a18aa7b02575f406dd379) | from __future__ import absolute_import
from django.core.management.base import BaseCommand
from zerver.models import RealmFilter, get_realm
import logging
class Command(BaseCommand):
help = """Imports realm filters to database"""
def handle(self, *args, **options):
realm_filters = {
"zu... | <commit_before><commit_msg>[manual] Add a manage.py command to import realm filters
This must be run manually on staging after deployment. Once it has been run,
it can be deleted. It only needs to be run on staging, not prod.
(imported from commit 79252c23ba8cda93500a18aa7b02575f406dd379)<commit_after> | from __future__ import absolute_import
from django.core.management.base import BaseCommand
from zerver.models import RealmFilter, get_realm
import logging
class Command(BaseCommand):
help = """Imports realm filters to database"""
def handle(self, *args, **options):
realm_filters = {
"zu... | [manual] Add a manage.py command to import realm filters
This must be run manually on staging after deployment. Once it has been run,
it can be deleted. It only needs to be run on staging, not prod.
(imported from commit 79252c23ba8cda93500a18aa7b02575f406dd379)from __future__ import absolute_import
from django.core... | <commit_before><commit_msg>[manual] Add a manage.py command to import realm filters
This must be run manually on staging after deployment. Once it has been run,
it can be deleted. It only needs to be run on staging, not prod.
(imported from commit 79252c23ba8cda93500a18aa7b02575f406dd379)<commit_after>from __future__... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.