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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
81c567e4be0d3c2f91d3cfa3d04b0b738859da6a | yargy/utils.py | yargy/utils.py | from itertools import count, takewhile
def frange(start, stop, step):
return takewhile(lambda x: x <= stop, (start + i * step for i in count()))
def get_original_text(text, tokens):
'''
Returns original text captured by parser grammars
'''
if not tokens:
return None
head, tail = token... | from itertools import count, takewhile
def frange(start, stop, step):
return takewhile(lambda x: x <= stop, (start + i * step for i in count()))
def get_tokens_position(tokens):
if not tokens:
return None
head, tail = tokens[0], tokens[-1]
return head.position[0], tail.position[1]
def get_or... | Add get_tokens_position and decode_roman_number functions | Add get_tokens_position and decode_roman_number functions
| Python | mit | bureaucratic-labs/yargy | from itertools import count, takewhile
def frange(start, stop, step):
return takewhile(lambda x: x <= stop, (start + i * step for i in count()))
def get_original_text(text, tokens):
'''
Returns original text captured by parser grammars
'''
if not tokens:
return None
head, tail = token... | from itertools import count, takewhile
def frange(start, stop, step):
return takewhile(lambda x: x <= stop, (start + i * step for i in count()))
def get_tokens_position(tokens):
if not tokens:
return None
head, tail = tokens[0], tokens[-1]
return head.position[0], tail.position[1]
def get_or... | <commit_before>from itertools import count, takewhile
def frange(start, stop, step):
return takewhile(lambda x: x <= stop, (start + i * step for i in count()))
def get_original_text(text, tokens):
'''
Returns original text captured by parser grammars
'''
if not tokens:
return None
hea... | from itertools import count, takewhile
def frange(start, stop, step):
return takewhile(lambda x: x <= stop, (start + i * step for i in count()))
def get_tokens_position(tokens):
if not tokens:
return None
head, tail = tokens[0], tokens[-1]
return head.position[0], tail.position[1]
def get_or... | from itertools import count, takewhile
def frange(start, stop, step):
return takewhile(lambda x: x <= stop, (start + i * step for i in count()))
def get_original_text(text, tokens):
'''
Returns original text captured by parser grammars
'''
if not tokens:
return None
head, tail = token... | <commit_before>from itertools import count, takewhile
def frange(start, stop, step):
return takewhile(lambda x: x <= stop, (start + i * step for i in count()))
def get_original_text(text, tokens):
'''
Returns original text captured by parser grammars
'''
if not tokens:
return None
hea... |
d3f09baf1e1de0272e1a579a207f685feb6c673f | common/mixins.py | common/mixins.py | from __future__ import unicode_literals
from django.core.exceptions import ValidationError
from django.db import models
from django.utils.text import slugify
class TimestampMixin(models.Model):
"""Mixin for date and timestamp. Inherits django's models.Model."""
date_created = models.DateTimeField(auto_now_a... | from __future__ import unicode_literals
from django.core.exceptions import ValidationError
from django.db import models
from django.utils.text import slugify
from django.utils.translation import ugettext_lazy as _
class TimestampMixin(models.Model):
"""Mixin for date and timestamp. Inherits django's models.Model... | Return user-friendly error message for SlugifyMixin class | Return user-friendly error message for SlugifyMixin class
| Python | mit | teamtaverna/core | from __future__ import unicode_literals
from django.core.exceptions import ValidationError
from django.db import models
from django.utils.text import slugify
class TimestampMixin(models.Model):
"""Mixin for date and timestamp. Inherits django's models.Model."""
date_created = models.DateTimeField(auto_now_a... | from __future__ import unicode_literals
from django.core.exceptions import ValidationError
from django.db import models
from django.utils.text import slugify
from django.utils.translation import ugettext_lazy as _
class TimestampMixin(models.Model):
"""Mixin for date and timestamp. Inherits django's models.Model... | <commit_before>from __future__ import unicode_literals
from django.core.exceptions import ValidationError
from django.db import models
from django.utils.text import slugify
class TimestampMixin(models.Model):
"""Mixin for date and timestamp. Inherits django's models.Model."""
date_created = models.DateTimeF... | from __future__ import unicode_literals
from django.core.exceptions import ValidationError
from django.db import models
from django.utils.text import slugify
from django.utils.translation import ugettext_lazy as _
class TimestampMixin(models.Model):
"""Mixin for date and timestamp. Inherits django's models.Model... | from __future__ import unicode_literals
from django.core.exceptions import ValidationError
from django.db import models
from django.utils.text import slugify
class TimestampMixin(models.Model):
"""Mixin for date and timestamp. Inherits django's models.Model."""
date_created = models.DateTimeField(auto_now_a... | <commit_before>from __future__ import unicode_literals
from django.core.exceptions import ValidationError
from django.db import models
from django.utils.text import slugify
class TimestampMixin(models.Model):
"""Mixin for date and timestamp. Inherits django's models.Model."""
date_created = models.DateTimeF... |
a816d0655504051ea12718a0e34bc9645fc92730 | personal-site/projects/views.py | personal-site/projects/views.py | from django.shortcuts import render
from django.views.generic.detail import DetailView
from projects.models import Project
from misc.code_blocks_preprocessor import CodeBlockExtension
import markdown
class ProjectDetailView(DetailView):
model = Project
context_object_name='project'
template_name = 'proje... | from django.shortcuts import render
from django.views.generic.detail import DetailView
from projects.models import Project
from misc.code_blocks_preprocessor import CodeBlockExtension
import markdown
class ProjectDetailView(DetailView):
model = Project
context_object_name='project'
template_name = 'proje... | Remove unnecessary projects added to context | Remove unnecessary projects added to context
| Python | bsd-3-clause | brandonw/personal-site,brandonw/personal-site,brandonw/personal-site | from django.shortcuts import render
from django.views.generic.detail import DetailView
from projects.models import Project
from misc.code_blocks_preprocessor import CodeBlockExtension
import markdown
class ProjectDetailView(DetailView):
model = Project
context_object_name='project'
template_name = 'proje... | from django.shortcuts import render
from django.views.generic.detail import DetailView
from projects.models import Project
from misc.code_blocks_preprocessor import CodeBlockExtension
import markdown
class ProjectDetailView(DetailView):
model = Project
context_object_name='project'
template_name = 'proje... | <commit_before>from django.shortcuts import render
from django.views.generic.detail import DetailView
from projects.models import Project
from misc.code_blocks_preprocessor import CodeBlockExtension
import markdown
class ProjectDetailView(DetailView):
model = Project
context_object_name='project'
templat... | from django.shortcuts import render
from django.views.generic.detail import DetailView
from projects.models import Project
from misc.code_blocks_preprocessor import CodeBlockExtension
import markdown
class ProjectDetailView(DetailView):
model = Project
context_object_name='project'
template_name = 'proje... | from django.shortcuts import render
from django.views.generic.detail import DetailView
from projects.models import Project
from misc.code_blocks_preprocessor import CodeBlockExtension
import markdown
class ProjectDetailView(DetailView):
model = Project
context_object_name='project'
template_name = 'proje... | <commit_before>from django.shortcuts import render
from django.views.generic.detail import DetailView
from projects.models import Project
from misc.code_blocks_preprocessor import CodeBlockExtension
import markdown
class ProjectDetailView(DetailView):
model = Project
context_object_name='project'
templat... |
2d9c4128898c8504813e6ea42eb2d634cf7e56a1 | kepakkoconverter.py | kepakkoconverter.py | #!/usr/bin/env python3
import PIL
from PIL import Image
LED_COUNT = 60
def resize_image(path):
img = Image.open(path)
old_width = img.size[0]
old_height = img.size[1]
ratio = 60.0/old_height
return img.resize((int(old_width*ratio), int(old_height*ratio)),
PIL.Image.ANTIALIAS... | #!/usr/bin/env python3
import PIL
import sys
from PIL import Image
LED_COUNT = 60
def resize_image(path):
img = Image.open(path)
old_width = img.size[0]
old_height = img.size[1]
ratio = 60.0/old_height
return img.resize((int(old_width*ratio), int(old_height*ratio)),
PIL.Imag... | Switch to using palette in the converter | Switch to using palette in the converter
| Python | mit | myrjola/Valokepakko,myrjola/Valokepakko,myrjola/Valokepakko | #!/usr/bin/env python3
import PIL
from PIL import Image
LED_COUNT = 60
def resize_image(path):
img = Image.open(path)
old_width = img.size[0]
old_height = img.size[1]
ratio = 60.0/old_height
return img.resize((int(old_width*ratio), int(old_height*ratio)),
PIL.Image.ANTIALIAS... | #!/usr/bin/env python3
import PIL
import sys
from PIL import Image
LED_COUNT = 60
def resize_image(path):
img = Image.open(path)
old_width = img.size[0]
old_height = img.size[1]
ratio = 60.0/old_height
return img.resize((int(old_width*ratio), int(old_height*ratio)),
PIL.Imag... | <commit_before>#!/usr/bin/env python3
import PIL
from PIL import Image
LED_COUNT = 60
def resize_image(path):
img = Image.open(path)
old_width = img.size[0]
old_height = img.size[1]
ratio = 60.0/old_height
return img.resize((int(old_width*ratio), int(old_height*ratio)),
PIL.... | #!/usr/bin/env python3
import PIL
import sys
from PIL import Image
LED_COUNT = 60
def resize_image(path):
img = Image.open(path)
old_width = img.size[0]
old_height = img.size[1]
ratio = 60.0/old_height
return img.resize((int(old_width*ratio), int(old_height*ratio)),
PIL.Imag... | #!/usr/bin/env python3
import PIL
from PIL import Image
LED_COUNT = 60
def resize_image(path):
img = Image.open(path)
old_width = img.size[0]
old_height = img.size[1]
ratio = 60.0/old_height
return img.resize((int(old_width*ratio), int(old_height*ratio)),
PIL.Image.ANTIALIAS... | <commit_before>#!/usr/bin/env python3
import PIL
from PIL import Image
LED_COUNT = 60
def resize_image(path):
img = Image.open(path)
old_width = img.size[0]
old_height = img.size[1]
ratio = 60.0/old_height
return img.resize((int(old_width*ratio), int(old_height*ratio)),
PIL.... |
4c080197dce0d452047203dbf06dd160086fcbdf | website/snat/forms.py | website/snat/forms.py | # -*- coding: utf-8 -*-
"""
website.snat.forms
~~~~~~~~~~~~~~~~~~
vpn forms:
/sant
:copyright: (c) 2014 by xiong.xiaox([email protected]).
"""
from flask_wtf import Form
from wtforms import TextField
from wtforms.validators import Required, IPAddress
class SnatForm(Form):
sou... | # -*- coding: utf-8 -*-
"""
website.snat.forms
~~~~~~~~~~~~~~~~~~
vpn forms:
/sant
:copyright: (c) 2014 by xiong.xiaox([email protected]).
"""
from flask_wtf import Form
from wtforms import TextField, ValidationError
from wtforms.validators import Required, IPAddress
def IPorNet(... | Add snat ip or net validator. | Add snat ip or net validator.
| Python | bsd-3-clause | sdgdsffdsfff/FlexGW,sdgdsffdsfff/FlexGW,alibaba/FlexGW,alibaba/FlexGW,sdgdsffdsfff/FlexGW,sdgdsffdsfff/FlexGW,alibaba/FlexGW,alibaba/FlexGW | # -*- coding: utf-8 -*-
"""
website.snat.forms
~~~~~~~~~~~~~~~~~~
vpn forms:
/sant
:copyright: (c) 2014 by xiong.xiaox([email protected]).
"""
from flask_wtf import Form
from wtforms import TextField
from wtforms.validators import Required, IPAddress
class SnatForm(Form):
sou... | # -*- coding: utf-8 -*-
"""
website.snat.forms
~~~~~~~~~~~~~~~~~~
vpn forms:
/sant
:copyright: (c) 2014 by xiong.xiaox([email protected]).
"""
from flask_wtf import Form
from wtforms import TextField, ValidationError
from wtforms.validators import Required, IPAddress
def IPorNet(... | <commit_before># -*- coding: utf-8 -*-
"""
website.snat.forms
~~~~~~~~~~~~~~~~~~
vpn forms:
/sant
:copyright: (c) 2014 by xiong.xiaox([email protected]).
"""
from flask_wtf import Form
from wtforms import TextField
from wtforms.validators import Required, IPAddress
class SnatForm... | # -*- coding: utf-8 -*-
"""
website.snat.forms
~~~~~~~~~~~~~~~~~~
vpn forms:
/sant
:copyright: (c) 2014 by xiong.xiaox([email protected]).
"""
from flask_wtf import Form
from wtforms import TextField, ValidationError
from wtforms.validators import Required, IPAddress
def IPorNet(... | # -*- coding: utf-8 -*-
"""
website.snat.forms
~~~~~~~~~~~~~~~~~~
vpn forms:
/sant
:copyright: (c) 2014 by xiong.xiaox([email protected]).
"""
from flask_wtf import Form
from wtforms import TextField
from wtforms.validators import Required, IPAddress
class SnatForm(Form):
sou... | <commit_before># -*- coding: utf-8 -*-
"""
website.snat.forms
~~~~~~~~~~~~~~~~~~
vpn forms:
/sant
:copyright: (c) 2014 by xiong.xiaox([email protected]).
"""
from flask_wtf import Form
from wtforms import TextField
from wtforms.validators import Required, IPAddress
class SnatForm... |
6e05ed3d47ab2e98b68ee284ab68cf1b0fc4e2af | www/tests/test_aio.py | www/tests/test_aio.py | from browser import console
import asyncio
from async_manager import AsyncTestManager
aio = AsyncTestManager()
async def wait_secs(s, result):
await asyncio.sleep(s)
console.log("Returning result", result)
return result
@aio.async_test(0.5)
def test_simple_coroutine():
console.log("coro_wait_secs")... | from browser import console, aio
async def wait_secs(s, result):
await aio.sleep(s)
console.log("Returning result", result)
return result
async def test_simple_coroutine():
console.log("coro_wait_secs")
coro_wait_secs = wait_secs(0.1, 10)
console.log("ensuring future")
fut = await coro_wai... | Replace asyncio tests by browser.aio tests | Replace asyncio tests by browser.aio tests
| Python | bsd-3-clause | brython-dev/brython,kikocorreoso/brython,kikocorreoso/brython,brython-dev/brython,kikocorreoso/brython,brython-dev/brython | from browser import console
import asyncio
from async_manager import AsyncTestManager
aio = AsyncTestManager()
async def wait_secs(s, result):
await asyncio.sleep(s)
console.log("Returning result", result)
return result
@aio.async_test(0.5)
def test_simple_coroutine():
console.log("coro_wait_secs")... | from browser import console, aio
async def wait_secs(s, result):
await aio.sleep(s)
console.log("Returning result", result)
return result
async def test_simple_coroutine():
console.log("coro_wait_secs")
coro_wait_secs = wait_secs(0.1, 10)
console.log("ensuring future")
fut = await coro_wai... | <commit_before>from browser import console
import asyncio
from async_manager import AsyncTestManager
aio = AsyncTestManager()
async def wait_secs(s, result):
await asyncio.sleep(s)
console.log("Returning result", result)
return result
@aio.async_test(0.5)
def test_simple_coroutine():
console.log("c... | from browser import console, aio
async def wait_secs(s, result):
await aio.sleep(s)
console.log("Returning result", result)
return result
async def test_simple_coroutine():
console.log("coro_wait_secs")
coro_wait_secs = wait_secs(0.1, 10)
console.log("ensuring future")
fut = await coro_wai... | from browser import console
import asyncio
from async_manager import AsyncTestManager
aio = AsyncTestManager()
async def wait_secs(s, result):
await asyncio.sleep(s)
console.log("Returning result", result)
return result
@aio.async_test(0.5)
def test_simple_coroutine():
console.log("coro_wait_secs")... | <commit_before>from browser import console
import asyncio
from async_manager import AsyncTestManager
aio = AsyncTestManager()
async def wait_secs(s, result):
await asyncio.sleep(s)
console.log("Returning result", result)
return result
@aio.async_test(0.5)
def test_simple_coroutine():
console.log("c... |
655218d603a836ebae0229394f929b70476f3def | climlab/__init__.py | climlab/__init__.py | __version__ = '0.2.12'
# This list defines all the modules that will be loaded if a user invokes
# from climLab import *
# totally out of date!
#__all__ = ["constants", "thermo", "orbital_table",
# "long_orbital_table", "insolation", "ebm",
# "column", "convadj"]
#from climlab import radiatio... | __version__ = '0.2.13'
# This list defines all the modules that will be loaded if a user invokes
# from climLab import *
# totally out of date!
#__all__ = ["constants", "thermo", "orbital_table",
# "long_orbital_table", "insolation", "ebm",
# "column", "convadj"]
#from climlab import radiatio... | Increment version number to 0.2.13 | Increment version number to 0.2.13
Merged Moritz's new process modules. | Python | mit | cjcardinale/climlab,cjcardinale/climlab,brian-rose/climlab,brian-rose/climlab,cjcardinale/climlab | __version__ = '0.2.12'
# This list defines all the modules that will be loaded if a user invokes
# from climLab import *
# totally out of date!
#__all__ = ["constants", "thermo", "orbital_table",
# "long_orbital_table", "insolation", "ebm",
# "column", "convadj"]
#from climlab import radiatio... | __version__ = '0.2.13'
# This list defines all the modules that will be loaded if a user invokes
# from climLab import *
# totally out of date!
#__all__ = ["constants", "thermo", "orbital_table",
# "long_orbital_table", "insolation", "ebm",
# "column", "convadj"]
#from climlab import radiatio... | <commit_before>__version__ = '0.2.12'
# This list defines all the modules that will be loaded if a user invokes
# from climLab import *
# totally out of date!
#__all__ = ["constants", "thermo", "orbital_table",
# "long_orbital_table", "insolation", "ebm",
# "column", "convadj"]
#from climlab ... | __version__ = '0.2.13'
# This list defines all the modules that will be loaded if a user invokes
# from climLab import *
# totally out of date!
#__all__ = ["constants", "thermo", "orbital_table",
# "long_orbital_table", "insolation", "ebm",
# "column", "convadj"]
#from climlab import radiatio... | __version__ = '0.2.12'
# This list defines all the modules that will be loaded if a user invokes
# from climLab import *
# totally out of date!
#__all__ = ["constants", "thermo", "orbital_table",
# "long_orbital_table", "insolation", "ebm",
# "column", "convadj"]
#from climlab import radiatio... | <commit_before>__version__ = '0.2.12'
# This list defines all the modules that will be loaded if a user invokes
# from climLab import *
# totally out of date!
#__all__ = ["constants", "thermo", "orbital_table",
# "long_orbital_table", "insolation", "ebm",
# "column", "convadj"]
#from climlab ... |
6808758a22e6bb0235038c01366fcbc250e60f84 | nlppln/commands/freqs.py | nlppln/commands/freqs.py | #!/usr/bin/env python
import os
import click
from sklearn.feature_extraction.text import CountVectorizer
import numpy as np
import pandas as pd
from nlppln.utils import create_dirs, get_files
from nlppln.liwc_tokenized import split
@click.command()
@click.argument('in_dir', type=click.Path(exists=True))
@click.optio... | #!/usr/bin/env python
import os
import click
from sklearn.feature_extraction.text import CountVectorizer
import numpy as np
import pandas as pd
from nlppln.utils import create_dirs, get_files, split
@click.command()
@click.argument('in_dir', type=click.Path(exists=True))
@click.option('--out_dir', '-o', default=os.g... | Use utility function split for splitting text | Use utility function split for splitting text
| Python | apache-2.0 | WhatWorksWhenForWhom/nlppln,WhatWorksWhenForWhom/nlppln,WhatWorksWhenForWhom/nlppln | #!/usr/bin/env python
import os
import click
from sklearn.feature_extraction.text import CountVectorizer
import numpy as np
import pandas as pd
from nlppln.utils import create_dirs, get_files
from nlppln.liwc_tokenized import split
@click.command()
@click.argument('in_dir', type=click.Path(exists=True))
@click.optio... | #!/usr/bin/env python
import os
import click
from sklearn.feature_extraction.text import CountVectorizer
import numpy as np
import pandas as pd
from nlppln.utils import create_dirs, get_files, split
@click.command()
@click.argument('in_dir', type=click.Path(exists=True))
@click.option('--out_dir', '-o', default=os.g... | <commit_before>#!/usr/bin/env python
import os
import click
from sklearn.feature_extraction.text import CountVectorizer
import numpy as np
import pandas as pd
from nlppln.utils import create_dirs, get_files
from nlppln.liwc_tokenized import split
@click.command()
@click.argument('in_dir', type=click.Path(exists=True... | #!/usr/bin/env python
import os
import click
from sklearn.feature_extraction.text import CountVectorizer
import numpy as np
import pandas as pd
from nlppln.utils import create_dirs, get_files, split
@click.command()
@click.argument('in_dir', type=click.Path(exists=True))
@click.option('--out_dir', '-o', default=os.g... | #!/usr/bin/env python
import os
import click
from sklearn.feature_extraction.text import CountVectorizer
import numpy as np
import pandas as pd
from nlppln.utils import create_dirs, get_files
from nlppln.liwc_tokenized import split
@click.command()
@click.argument('in_dir', type=click.Path(exists=True))
@click.optio... | <commit_before>#!/usr/bin/env python
import os
import click
from sklearn.feature_extraction.text import CountVectorizer
import numpy as np
import pandas as pd
from nlppln.utils import create_dirs, get_files
from nlppln.liwc_tokenized import split
@click.command()
@click.argument('in_dir', type=click.Path(exists=True... |
3651d4076899f86f3b6627b0fd7e8af197c5149c | bin/pympit_fork.py | bin/pympit_fork.py | #!/usr/bin/env python
from __future__ import absolute_import, division, print_function, unicode_literals, with_statement
from mpi4py import MPI
import sys
import os
import numpy as np
import scipy as sc
from astropy.io import fits
import argparse
import subprocess as sp
import pympit as pt
parser = argparse.A... | #!/usr/bin/env python
from __future__ import absolute_import, division, print_function, unicode_literals, with_statement
from mpi4py import MPI
import sys
import os
import numpy as np
import scipy as sc
from astropy.io import fits
import argparse
import subprocess as sp
import pympit as pt
parser = argparse.A... | Add communicator split to forking test. | Add communicator split to forking test.
| Python | bsd-2-clause | tskisner/pympit,tskisner/pympit | #!/usr/bin/env python
from __future__ import absolute_import, division, print_function, unicode_literals, with_statement
from mpi4py import MPI
import sys
import os
import numpy as np
import scipy as sc
from astropy.io import fits
import argparse
import subprocess as sp
import pympit as pt
parser = argparse.A... | #!/usr/bin/env python
from __future__ import absolute_import, division, print_function, unicode_literals, with_statement
from mpi4py import MPI
import sys
import os
import numpy as np
import scipy as sc
from astropy.io import fits
import argparse
import subprocess as sp
import pympit as pt
parser = argparse.A... | <commit_before>#!/usr/bin/env python
from __future__ import absolute_import, division, print_function, unicode_literals, with_statement
from mpi4py import MPI
import sys
import os
import numpy as np
import scipy as sc
from astropy.io import fits
import argparse
import subprocess as sp
import pympit as pt
pars... | #!/usr/bin/env python
from __future__ import absolute_import, division, print_function, unicode_literals, with_statement
from mpi4py import MPI
import sys
import os
import numpy as np
import scipy as sc
from astropy.io import fits
import argparse
import subprocess as sp
import pympit as pt
parser = argparse.A... | #!/usr/bin/env python
from __future__ import absolute_import, division, print_function, unicode_literals, with_statement
from mpi4py import MPI
import sys
import os
import numpy as np
import scipy as sc
from astropy.io import fits
import argparse
import subprocess as sp
import pympit as pt
parser = argparse.A... | <commit_before>#!/usr/bin/env python
from __future__ import absolute_import, division, print_function, unicode_literals, with_statement
from mpi4py import MPI
import sys
import os
import numpy as np
import scipy as sc
from astropy.io import fits
import argparse
import subprocess as sp
import pympit as pt
pars... |
d19650235ac95839481d05bd8867afe486fea5c3 | nosexcover/nosexcover.py | nosexcover/nosexcover.py | """Companion to nose.plugins.cover. Enable by adding --with-xcoverage to your
arguments. A Cobertura-style XML file, honoring the options you pass to
--with-coverage, will be generated in coverage.xml"""
import logging
import sys
from nose.plugins import cover, Plugin
log = logging.getLogger('nose.plugins.xcover')
... | """Companion to nose.plugins.cover. Enable by adding --with-xcoverage to your
arguments. A Cobertura-style XML file, honoring the options you pass to
--with-coverage, will be generated in coverage.xml"""
import logging
import sys
from nose.plugins import cover, Plugin
log = logging.getLogger('nose.plugins.xcover')
... | Set xml file path to store the coverage report in with --xcoverage-file option | Set xml file path to store the coverage report in with --xcoverage-file option
| Python | mit | cmheisel/nose-xcover,andresriancho/nose-xcover,alex/nose-xcover | """Companion to nose.plugins.cover. Enable by adding --with-xcoverage to your
arguments. A Cobertura-style XML file, honoring the options you pass to
--with-coverage, will be generated in coverage.xml"""
import logging
import sys
from nose.plugins import cover, Plugin
log = logging.getLogger('nose.plugins.xcover')
... | """Companion to nose.plugins.cover. Enable by adding --with-xcoverage to your
arguments. A Cobertura-style XML file, honoring the options you pass to
--with-coverage, will be generated in coverage.xml"""
import logging
import sys
from nose.plugins import cover, Plugin
log = logging.getLogger('nose.plugins.xcover')
... | <commit_before>"""Companion to nose.plugins.cover. Enable by adding --with-xcoverage to your
arguments. A Cobertura-style XML file, honoring the options you pass to
--with-coverage, will be generated in coverage.xml"""
import logging
import sys
from nose.plugins import cover, Plugin
log = logging.getLogger('nose.plug... | """Companion to nose.plugins.cover. Enable by adding --with-xcoverage to your
arguments. A Cobertura-style XML file, honoring the options you pass to
--with-coverage, will be generated in coverage.xml"""
import logging
import sys
from nose.plugins import cover, Plugin
log = logging.getLogger('nose.plugins.xcover')
... | """Companion to nose.plugins.cover. Enable by adding --with-xcoverage to your
arguments. A Cobertura-style XML file, honoring the options you pass to
--with-coverage, will be generated in coverage.xml"""
import logging
import sys
from nose.plugins import cover, Plugin
log = logging.getLogger('nose.plugins.xcover')
... | <commit_before>"""Companion to nose.plugins.cover. Enable by adding --with-xcoverage to your
arguments. A Cobertura-style XML file, honoring the options you pass to
--with-coverage, will be generated in coverage.xml"""
import logging
import sys
from nose.plugins import cover, Plugin
log = logging.getLogger('nose.plug... |
6f60d2c76ece73e8f37f2ae1014cc26b485495d0 | numpy/distutils/setup.py | numpy/distutils/setup.py | #!/usr/bin/env python
def configuration(parent_package='',top_path=None):
from numpy.distutils.misc_util import Configuration
config = Configuration('distutils',parent_package,top_path)
config.add_subpackage('command')
config.add_subpackage('fcompiler')
config.add_data_dir('tests')
config.add_d... | #!/usr/bin/env python
def configuration(parent_package='',top_path=None):
from numpy.distutils.misc_util import Configuration
config = Configuration('distutils',parent_package,top_path)
config.add_subpackage('command')
config.add_subpackage('fcompiler')
config.add_data_dir('tests')
config.add_d... | Make the gfortran/vs2003 hack source file known to distutils. | Make the gfortran/vs2003 hack source file known to distutils.
| Python | bsd-3-clause | simongibbons/numpy,ContinuumIO/numpy,BabeNovelty/numpy,rherault-insa/numpy,cjermain/numpy,madphysicist/numpy,ahaldane/numpy,BabeNovelty/numpy,abalkin/numpy,naritta/numpy,dimasad/numpy,dch312/numpy,GrimDerp/numpy,MichaelAquilina/numpy,has2k1/numpy,jankoslavic/numpy,sonnyhu/numpy,madphysicist/numpy,ogrisel/numpy,gmcastil... | #!/usr/bin/env python
def configuration(parent_package='',top_path=None):
from numpy.distutils.misc_util import Configuration
config = Configuration('distutils',parent_package,top_path)
config.add_subpackage('command')
config.add_subpackage('fcompiler')
config.add_data_dir('tests')
config.add_d... | #!/usr/bin/env python
def configuration(parent_package='',top_path=None):
from numpy.distutils.misc_util import Configuration
config = Configuration('distutils',parent_package,top_path)
config.add_subpackage('command')
config.add_subpackage('fcompiler')
config.add_data_dir('tests')
config.add_d... | <commit_before>#!/usr/bin/env python
def configuration(parent_package='',top_path=None):
from numpy.distutils.misc_util import Configuration
config = Configuration('distutils',parent_package,top_path)
config.add_subpackage('command')
config.add_subpackage('fcompiler')
config.add_data_dir('tests')
... | #!/usr/bin/env python
def configuration(parent_package='',top_path=None):
from numpy.distutils.misc_util import Configuration
config = Configuration('distutils',parent_package,top_path)
config.add_subpackage('command')
config.add_subpackage('fcompiler')
config.add_data_dir('tests')
config.add_d... | #!/usr/bin/env python
def configuration(parent_package='',top_path=None):
from numpy.distutils.misc_util import Configuration
config = Configuration('distutils',parent_package,top_path)
config.add_subpackage('command')
config.add_subpackage('fcompiler')
config.add_data_dir('tests')
config.add_d... | <commit_before>#!/usr/bin/env python
def configuration(parent_package='',top_path=None):
from numpy.distutils.misc_util import Configuration
config = Configuration('distutils',parent_package,top_path)
config.add_subpackage('command')
config.add_subpackage('fcompiler')
config.add_data_dir('tests')
... |
e601172065ca3959c1399608c294243fa2b83cef | tests/test_SwitchController.py | tests/test_SwitchController.py | import unittest
from mpf.system.machine import MachineController
from tests.MpfTestCase import MpfTestCase
from mock import MagicMock
import time
class TestSwitchController(MpfTestCase):
def getConfigFile(self):
return 'config.yaml'
def getMachinePath(self):
return '../tests/machine_files/sw... | from tests.MpfTestCase import MpfTestCase
class TestSwitchController(MpfTestCase):
def getConfigFile(self):
return 'config.yaml'
def getMachinePath(self):
return '../tests/machine_files/switch_controller/'
def _callback(self):
self.isActive = self.machine.switch_controller.is_a... | Add test for initial switch states | Add test for initial switch states
| Python | mit | missionpinball/mpf,missionpinball/mpf | import unittest
from mpf.system.machine import MachineController
from tests.MpfTestCase import MpfTestCase
from mock import MagicMock
import time
class TestSwitchController(MpfTestCase):
def getConfigFile(self):
return 'config.yaml'
def getMachinePath(self):
return '../tests/machine_files/sw... | from tests.MpfTestCase import MpfTestCase
class TestSwitchController(MpfTestCase):
def getConfigFile(self):
return 'config.yaml'
def getMachinePath(self):
return '../tests/machine_files/switch_controller/'
def _callback(self):
self.isActive = self.machine.switch_controller.is_a... | <commit_before>import unittest
from mpf.system.machine import MachineController
from tests.MpfTestCase import MpfTestCase
from mock import MagicMock
import time
class TestSwitchController(MpfTestCase):
def getConfigFile(self):
return 'config.yaml'
def getMachinePath(self):
return '../tests/m... | from tests.MpfTestCase import MpfTestCase
class TestSwitchController(MpfTestCase):
def getConfigFile(self):
return 'config.yaml'
def getMachinePath(self):
return '../tests/machine_files/switch_controller/'
def _callback(self):
self.isActive = self.machine.switch_controller.is_a... | import unittest
from mpf.system.machine import MachineController
from tests.MpfTestCase import MpfTestCase
from mock import MagicMock
import time
class TestSwitchController(MpfTestCase):
def getConfigFile(self):
return 'config.yaml'
def getMachinePath(self):
return '../tests/machine_files/sw... | <commit_before>import unittest
from mpf.system.machine import MachineController
from tests.MpfTestCase import MpfTestCase
from mock import MagicMock
import time
class TestSwitchController(MpfTestCase):
def getConfigFile(self):
return 'config.yaml'
def getMachinePath(self):
return '../tests/m... |
29419cf81068183029b1dc63e718937de155a754 | test/weakref_test.py | test/weakref_test.py | import weakref
import unittest
import vapoursynth as vs
class FilterTestSequence(unittest.TestCase):
def setUp(self):
self.core = vs.get_core()
def test_weakref_core(self):
ref = weakref.ref(self.core)
self.assert_(ref() is self.core)
def test_weakref_node(self):
video =... | import weakref
import unittest
import vapoursynth as vs
class FilterTestSequence(unittest.TestCase):
def setUp(self):
self.core = vs.get_core()
def test_weakref_core(self):
ref = weakref.ref(self.core)
self.assertTrue(ref() is self.core)
def test_weakref_node(self):
vide... | Fix one more deprecation warning | Fix one more deprecation warning
| Python | lgpl-2.1 | vapoursynth/vapoursynth,vapoursynth/vapoursynth,Kamekameha/vapoursynth,vapoursynth/vapoursynth,vapoursynth/vapoursynth,Kamekameha/vapoursynth,Kamekameha/vapoursynth,Kamekameha/vapoursynth | import weakref
import unittest
import vapoursynth as vs
class FilterTestSequence(unittest.TestCase):
def setUp(self):
self.core = vs.get_core()
def test_weakref_core(self):
ref = weakref.ref(self.core)
self.assert_(ref() is self.core)
def test_weakref_node(self):
video =... | import weakref
import unittest
import vapoursynth as vs
class FilterTestSequence(unittest.TestCase):
def setUp(self):
self.core = vs.get_core()
def test_weakref_core(self):
ref = weakref.ref(self.core)
self.assertTrue(ref() is self.core)
def test_weakref_node(self):
vide... | <commit_before>import weakref
import unittest
import vapoursynth as vs
class FilterTestSequence(unittest.TestCase):
def setUp(self):
self.core = vs.get_core()
def test_weakref_core(self):
ref = weakref.ref(self.core)
self.assert_(ref() is self.core)
def test_weakref_node(self):
... | import weakref
import unittest
import vapoursynth as vs
class FilterTestSequence(unittest.TestCase):
def setUp(self):
self.core = vs.get_core()
def test_weakref_core(self):
ref = weakref.ref(self.core)
self.assertTrue(ref() is self.core)
def test_weakref_node(self):
vide... | import weakref
import unittest
import vapoursynth as vs
class FilterTestSequence(unittest.TestCase):
def setUp(self):
self.core = vs.get_core()
def test_weakref_core(self):
ref = weakref.ref(self.core)
self.assert_(ref() is self.core)
def test_weakref_node(self):
video =... | <commit_before>import weakref
import unittest
import vapoursynth as vs
class FilterTestSequence(unittest.TestCase):
def setUp(self):
self.core = vs.get_core()
def test_weakref_core(self):
ref = weakref.ref(self.core)
self.assert_(ref() is self.core)
def test_weakref_node(self):
... |
1964407097b15c92e9b3aa77dc3d6d94bb656757 | turbustat/tests/test_dendro.py | turbustat/tests/test_dendro.py | # Licensed under an MIT open source license - see LICENSE
'''
Tests for Dendrogram statistics
'''
import numpy as np
import numpy.testing as npt
from ..statistics import Dendrogram_Stats, DendroDistance
from ._testing_data import \
dataset1, dataset2, computed_data, computed_distances
min_deltas = np.logspace... | # Licensed under an MIT open source license - see LICENSE
'''
Tests for Dendrogram statistics
'''
import numpy as np
import numpy.testing as npt
import os
from ..statistics import Dendrogram_Stats, DendroDistance
from ._testing_data import \
dataset1, dataset2, computed_data, computed_distances
min_deltas = n... | Add testing of loading and saving for Dendrogram_Stats | Add testing of loading and saving for Dendrogram_Stats
| Python | mit | Astroua/TurbuStat,e-koch/TurbuStat | # Licensed under an MIT open source license - see LICENSE
'''
Tests for Dendrogram statistics
'''
import numpy as np
import numpy.testing as npt
from ..statistics import Dendrogram_Stats, DendroDistance
from ._testing_data import \
dataset1, dataset2, computed_data, computed_distances
min_deltas = np.logspace... | # Licensed under an MIT open source license - see LICENSE
'''
Tests for Dendrogram statistics
'''
import numpy as np
import numpy.testing as npt
import os
from ..statistics import Dendrogram_Stats, DendroDistance
from ._testing_data import \
dataset1, dataset2, computed_data, computed_distances
min_deltas = n... | <commit_before># Licensed under an MIT open source license - see LICENSE
'''
Tests for Dendrogram statistics
'''
import numpy as np
import numpy.testing as npt
from ..statistics import Dendrogram_Stats, DendroDistance
from ._testing_data import \
dataset1, dataset2, computed_data, computed_distances
min_delta... | # Licensed under an MIT open source license - see LICENSE
'''
Tests for Dendrogram statistics
'''
import numpy as np
import numpy.testing as npt
import os
from ..statistics import Dendrogram_Stats, DendroDistance
from ._testing_data import \
dataset1, dataset2, computed_data, computed_distances
min_deltas = n... | # Licensed under an MIT open source license - see LICENSE
'''
Tests for Dendrogram statistics
'''
import numpy as np
import numpy.testing as npt
from ..statistics import Dendrogram_Stats, DendroDistance
from ._testing_data import \
dataset1, dataset2, computed_data, computed_distances
min_deltas = np.logspace... | <commit_before># Licensed under an MIT open source license - see LICENSE
'''
Tests for Dendrogram statistics
'''
import numpy as np
import numpy.testing as npt
from ..statistics import Dendrogram_Stats, DendroDistance
from ._testing_data import \
dataset1, dataset2, computed_data, computed_distances
min_delta... |
8b09bc6854075f43bf408169a743d023f60fbe0b | telemetry/telemetry/page/actions/navigate.py | telemetry/telemetry/page/actions/navigate.py | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from telemetry.page.actions import page_action
class NavigateAction(page_action.PageAction):
def __init__(self, attributes=None):
super(NavigateAction... | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from telemetry.page.actions import page_action
class NavigateAction(page_action.PageAction):
def __init__(self, attributes=None):
super(NavigateAction... | Add a timeout attr to NavigateAction. | Add a timeout attr to NavigateAction.
BUG=320748
Review URL: https://codereview.chromium.org/202483006
git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@257922 0039d316-1c4b-4281-b951-d872f2087c98
| Python | bsd-3-clause | catapult-project/catapult,catapult-project/catapult,SummerLW/Perf-Insight-Report,sahiljain/catapult,benschmaus/catapult,benschmaus/catapult,catapult-project/catapult,catapult-project/catapult-csm,catapult-project/catapult,catapult-project/catapult,catapult-project/catapult-csm,benschmaus/catapult,catapult-project/catap... | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from telemetry.page.actions import page_action
class NavigateAction(page_action.PageAction):
def __init__(self, attributes=None):
super(NavigateAction... | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from telemetry.page.actions import page_action
class NavigateAction(page_action.PageAction):
def __init__(self, attributes=None):
super(NavigateAction... | <commit_before># Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from telemetry.page.actions import page_action
class NavigateAction(page_action.PageAction):
def __init__(self, attributes=None):
super... | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from telemetry.page.actions import page_action
class NavigateAction(page_action.PageAction):
def __init__(self, attributes=None):
super(NavigateAction... | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from telemetry.page.actions import page_action
class NavigateAction(page_action.PageAction):
def __init__(self, attributes=None):
super(NavigateAction... | <commit_before># Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from telemetry.page.actions import page_action
class NavigateAction(page_action.PageAction):
def __init__(self, attributes=None):
super... |
12d525b79e78d8e183d75a2b81221f7d18519897 | tests/kernel_test.py | tests/kernel_test.py | from kernel.kernel import Kernel
from modules import AbstractModule
from kernel.module_chain import ModuleChain
import glob
import os
import json
def test_get_module():
mod = Kernel.get_module('modules', 'file.Extension')
assert isinstance(mod, AbstractModule)
try:
mod = Kernel.get_module('module... | from kernel.kernel import Kernel
from modules import AbstractModule
from kernel.config import Config
from kernel.result import Result
from kernel.module_chain import ModuleChain
import glob
import os
import json
def test_get_module():
mod = Kernel.get_module('modules', 'file.Extension')
assert isinstance(mod,... | Fix tests related to result collection | Fix tests related to result collection
| Python | mit | vdjagilev/desefu | from kernel.kernel import Kernel
from modules import AbstractModule
from kernel.module_chain import ModuleChain
import glob
import os
import json
def test_get_module():
mod = Kernel.get_module('modules', 'file.Extension')
assert isinstance(mod, AbstractModule)
try:
mod = Kernel.get_module('module... | from kernel.kernel import Kernel
from modules import AbstractModule
from kernel.config import Config
from kernel.result import Result
from kernel.module_chain import ModuleChain
import glob
import os
import json
def test_get_module():
mod = Kernel.get_module('modules', 'file.Extension')
assert isinstance(mod,... | <commit_before>from kernel.kernel import Kernel
from modules import AbstractModule
from kernel.module_chain import ModuleChain
import glob
import os
import json
def test_get_module():
mod = Kernel.get_module('modules', 'file.Extension')
assert isinstance(mod, AbstractModule)
try:
mod = Kernel.get... | from kernel.kernel import Kernel
from modules import AbstractModule
from kernel.config import Config
from kernel.result import Result
from kernel.module_chain import ModuleChain
import glob
import os
import json
def test_get_module():
mod = Kernel.get_module('modules', 'file.Extension')
assert isinstance(mod,... | from kernel.kernel import Kernel
from modules import AbstractModule
from kernel.module_chain import ModuleChain
import glob
import os
import json
def test_get_module():
mod = Kernel.get_module('modules', 'file.Extension')
assert isinstance(mod, AbstractModule)
try:
mod = Kernel.get_module('module... | <commit_before>from kernel.kernel import Kernel
from modules import AbstractModule
from kernel.module_chain import ModuleChain
import glob
import os
import json
def test_get_module():
mod = Kernel.get_module('modules', 'file.Extension')
assert isinstance(mod, AbstractModule)
try:
mod = Kernel.get... |
98de0f94332cd2a0faedd1c72d2ee4092552fdb0 | tests/unit/helper.py | tests/unit/helper.py | import mock
import github3
import unittest
MockedSession = mock.create_autospec(github3.session.GitHubSession)
def build_url(self, *args, **kwargs):
# We want to assert what is happening with the actual calls to the
# Internet. We can proxy this.
return github3.session.GitHubSession().build_url(*args, **... | import mock
import github3
import unittest
def build_url(self, *args, **kwargs):
# We want to assert what is happening with the actual calls to the
# Internet. We can proxy this.
return github3.session.GitHubSession().build_url(*args, **kwargs)
class UnitHelper(unittest.TestCase):
# Sub-classes must... | Fix the issue where the mock is persisting calls | Fix the issue where the mock is persisting calls
| Python | bsd-3-clause | jim-minter/github3.py,wbrefvem/github3.py,agamdua/github3.py,h4ck3rm1k3/github3.py,krxsky/github3.py,balloob/github3.py,ueg1990/github3.py,sigmavirus24/github3.py,icio/github3.py,christophelec/github3.py,itsmemattchung/github3.py,degustaf/github3.py | import mock
import github3
import unittest
MockedSession = mock.create_autospec(github3.session.GitHubSession)
def build_url(self, *args, **kwargs):
# We want to assert what is happening with the actual calls to the
# Internet. We can proxy this.
return github3.session.GitHubSession().build_url(*args, **... | import mock
import github3
import unittest
def build_url(self, *args, **kwargs):
# We want to assert what is happening with the actual calls to the
# Internet. We can proxy this.
return github3.session.GitHubSession().build_url(*args, **kwargs)
class UnitHelper(unittest.TestCase):
# Sub-classes must... | <commit_before>import mock
import github3
import unittest
MockedSession = mock.create_autospec(github3.session.GitHubSession)
def build_url(self, *args, **kwargs):
# We want to assert what is happening with the actual calls to the
# Internet. We can proxy this.
return github3.session.GitHubSession().buil... | import mock
import github3
import unittest
def build_url(self, *args, **kwargs):
# We want to assert what is happening with the actual calls to the
# Internet. We can proxy this.
return github3.session.GitHubSession().build_url(*args, **kwargs)
class UnitHelper(unittest.TestCase):
# Sub-classes must... | import mock
import github3
import unittest
MockedSession = mock.create_autospec(github3.session.GitHubSession)
def build_url(self, *args, **kwargs):
# We want to assert what is happening with the actual calls to the
# Internet. We can proxy this.
return github3.session.GitHubSession().build_url(*args, **... | <commit_before>import mock
import github3
import unittest
MockedSession = mock.create_autospec(github3.session.GitHubSession)
def build_url(self, *args, **kwargs):
# We want to assert what is happening with the actual calls to the
# Internet. We can proxy this.
return github3.session.GitHubSession().buil... |
64c04167b800c6e90c8473c2d89896fb2bfa3bc7 | nashvegas/models.py | nashvegas/models.py | from datetime import datetime
from django.db import models
class Migration(models.Model):
migration_label = models.CharField(max_length=200)
date_created = models.DateTimeField(default=datetime.now)
content = models.TextField()
scm_version = models.CharField(max_length=50, null=True, blank=True)... | from django.db import models
from django.utils import timezone
class Migration(models.Model):
migration_label = models.CharField(max_length=200)
date_created = models.DateTimeField(default=timezone.now)
content = models.TextField()
scm_version = models.CharField(max_length=50, null=True, blank=Tr... | Fix timezone support for migrations | Fix timezone support for migrations | Python | mit | paltman-archive/nashvegas,paltman/nashvegas,dcramer/nashvegas,jonathanchu/nashvegas,iivvoo/nashvegas | from datetime import datetime
from django.db import models
class Migration(models.Model):
migration_label = models.CharField(max_length=200)
date_created = models.DateTimeField(default=datetime.now)
content = models.TextField()
scm_version = models.CharField(max_length=50, null=True, blank=True)... | from django.db import models
from django.utils import timezone
class Migration(models.Model):
migration_label = models.CharField(max_length=200)
date_created = models.DateTimeField(default=timezone.now)
content = models.TextField()
scm_version = models.CharField(max_length=50, null=True, blank=Tr... | <commit_before>from datetime import datetime
from django.db import models
class Migration(models.Model):
migration_label = models.CharField(max_length=200)
date_created = models.DateTimeField(default=datetime.now)
content = models.TextField()
scm_version = models.CharField(max_length=50, null=Tr... | from django.db import models
from django.utils import timezone
class Migration(models.Model):
migration_label = models.CharField(max_length=200)
date_created = models.DateTimeField(default=timezone.now)
content = models.TextField()
scm_version = models.CharField(max_length=50, null=True, blank=Tr... | from datetime import datetime
from django.db import models
class Migration(models.Model):
migration_label = models.CharField(max_length=200)
date_created = models.DateTimeField(default=datetime.now)
content = models.TextField()
scm_version = models.CharField(max_length=50, null=True, blank=True)... | <commit_before>from datetime import datetime
from django.db import models
class Migration(models.Model):
migration_label = models.CharField(max_length=200)
date_created = models.DateTimeField(default=datetime.now)
content = models.TextField()
scm_version = models.CharField(max_length=50, null=Tr... |
ff17f0ef71ccc2e553b19d67eac13ec74021f0a5 | dthm4kaiako/config/__init__.py | dthm4kaiako/config/__init__.py | """Configuration for Django system."""
__version__ = "0.13.2"
__version_info__ = tuple(
[
int(num) if num.isdigit() else num
for num in __version__.replace("-", ".", 1).split(".")
]
)
| """Configuration for Django system."""
__version__ = "0.13.3"
__version_info__ = tuple(
[
int(num) if num.isdigit() else num
for num in __version__.replace("-", ".", 1).split(".")
]
)
| Increment version number to 0.13.3 | Increment version number to 0.13.3
| Python | mit | uccser/cs4teachers,uccser/cs4teachers,uccser/cs4teachers,uccser/cs4teachers | """Configuration for Django system."""
__version__ = "0.13.2"
__version_info__ = tuple(
[
int(num) if num.isdigit() else num
for num in __version__.replace("-", ".", 1).split(".")
]
)
Increment version number to 0.13.3 | """Configuration for Django system."""
__version__ = "0.13.3"
__version_info__ = tuple(
[
int(num) if num.isdigit() else num
for num in __version__.replace("-", ".", 1).split(".")
]
)
| <commit_before>"""Configuration for Django system."""
__version__ = "0.13.2"
__version_info__ = tuple(
[
int(num) if num.isdigit() else num
for num in __version__.replace("-", ".", 1).split(".")
]
)
<commit_msg>Increment version number to 0.13.3<commit_after> | """Configuration for Django system."""
__version__ = "0.13.3"
__version_info__ = tuple(
[
int(num) if num.isdigit() else num
for num in __version__.replace("-", ".", 1).split(".")
]
)
| """Configuration for Django system."""
__version__ = "0.13.2"
__version_info__ = tuple(
[
int(num) if num.isdigit() else num
for num in __version__.replace("-", ".", 1).split(".")
]
)
Increment version number to 0.13.3"""Configuration for Django system."""
__version__ = "0.13.3"
__version_info... | <commit_before>"""Configuration for Django system."""
__version__ = "0.13.2"
__version_info__ = tuple(
[
int(num) if num.isdigit() else num
for num in __version__.replace("-", ".", 1).split(".")
]
)
<commit_msg>Increment version number to 0.13.3<commit_after>"""Configuration for Django system."... |
8b73f0e4e70fa1ac6705a4c44878f4910beb8cfb | tests/scratchtest2.py | tests/scratchtest2.py | #!/usr/bin/env python
import sys
sys.path.append("../zvm")
from zmemory import ZMemory
from zlexer import ZLexer
story = file("../stories/zork.z1").read()
mem = ZMemory(story)
lexer = ZLexer(mem)
print "This story is z version", mem.version
print "Standard dictionary:"
print " word separators are", lexer._separ... | #!/usr/bin/env python
import sys
sys.path.append("../zvm")
from zmemory import ZMemory
from zlexer import ZLexer
story = file("../stories/zork.z1").read()
mem = ZMemory(story)
lexer = ZLexer(mem)
print "This story is z version", mem.version
print "Standard dictionary:"
print " word separators are", lexer._separ... | Revert r67, which was not the changeset intended for commit. | Revert r67, which was not the changeset intended for commit.
| Python | bsd-3-clause | sussman/zvm,sussman/zvm | #!/usr/bin/env python
import sys
sys.path.append("../zvm")
from zmemory import ZMemory
from zlexer import ZLexer
story = file("../stories/zork.z1").read()
mem = ZMemory(story)
lexer = ZLexer(mem)
print "This story is z version", mem.version
print "Standard dictionary:"
print " word separators are", lexer._separ... | #!/usr/bin/env python
import sys
sys.path.append("../zvm")
from zmemory import ZMemory
from zlexer import ZLexer
story = file("../stories/zork.z1").read()
mem = ZMemory(story)
lexer = ZLexer(mem)
print "This story is z version", mem.version
print "Standard dictionary:"
print " word separators are", lexer._separ... | <commit_before>#!/usr/bin/env python
import sys
sys.path.append("../zvm")
from zmemory import ZMemory
from zlexer import ZLexer
story = file("../stories/zork.z1").read()
mem = ZMemory(story)
lexer = ZLexer(mem)
print "This story is z version", mem.version
print "Standard dictionary:"
print " word separators are... | #!/usr/bin/env python
import sys
sys.path.append("../zvm")
from zmemory import ZMemory
from zlexer import ZLexer
story = file("../stories/zork.z1").read()
mem = ZMemory(story)
lexer = ZLexer(mem)
print "This story is z version", mem.version
print "Standard dictionary:"
print " word separators are", lexer._separ... | #!/usr/bin/env python
import sys
sys.path.append("../zvm")
from zmemory import ZMemory
from zlexer import ZLexer
story = file("../stories/zork.z1").read()
mem = ZMemory(story)
lexer = ZLexer(mem)
print "This story is z version", mem.version
print "Standard dictionary:"
print " word separators are", lexer._separ... | <commit_before>#!/usr/bin/env python
import sys
sys.path.append("../zvm")
from zmemory import ZMemory
from zlexer import ZLexer
story = file("../stories/zork.z1").read()
mem = ZMemory(story)
lexer = ZLexer(mem)
print "This story is z version", mem.version
print "Standard dictionary:"
print " word separators are... |
c2a5a62e14780a90e7b0dab5a570d1e02d6e9030 | api/ud_helper.py | api/ud_helper.py | from ufal.udpipe import Model, Pipeline, ProcessingError
class Parser:
MODELS = {
"swe": "data/swedish-ud-2.0-170801.udpipe",
}
def __init__(self, language):
model_path = self.MODELS.get(language, None)
if not model_path:
raise ParserException("Cannot find model for lan... | import re
from ufal.udpipe import Model, Pipeline, ProcessingError
class Parser:
MODELS = {
"swe": "data/swedish-ud-2.0-170801.udpipe",
}
def __init__(self, language):
model_path = self.MODELS.get(language, None)
if not model_path:
raise ParserException("Cannot find mod... | Improve parsing of short strings by adding period. | Improve parsing of short strings by adding period.
Former-commit-id: 812679f50e3dc89a10b1bc7c70061d2e6087c041 | Python | mit | EmilStenstrom/json-tagger,EmilStenstrom/json-tagger,EmilStenstrom/json-tagger,EmilStenstrom/json-tagger,EmilStenstrom/json-tagger | from ufal.udpipe import Model, Pipeline, ProcessingError
class Parser:
MODELS = {
"swe": "data/swedish-ud-2.0-170801.udpipe",
}
def __init__(self, language):
model_path = self.MODELS.get(language, None)
if not model_path:
raise ParserException("Cannot find model for lan... | import re
from ufal.udpipe import Model, Pipeline, ProcessingError
class Parser:
MODELS = {
"swe": "data/swedish-ud-2.0-170801.udpipe",
}
def __init__(self, language):
model_path = self.MODELS.get(language, None)
if not model_path:
raise ParserException("Cannot find mod... | <commit_before>from ufal.udpipe import Model, Pipeline, ProcessingError
class Parser:
MODELS = {
"swe": "data/swedish-ud-2.0-170801.udpipe",
}
def __init__(self, language):
model_path = self.MODELS.get(language, None)
if not model_path:
raise ParserException("Cannot fin... | import re
from ufal.udpipe import Model, Pipeline, ProcessingError
class Parser:
MODELS = {
"swe": "data/swedish-ud-2.0-170801.udpipe",
}
def __init__(self, language):
model_path = self.MODELS.get(language, None)
if not model_path:
raise ParserException("Cannot find mod... | from ufal.udpipe import Model, Pipeline, ProcessingError
class Parser:
MODELS = {
"swe": "data/swedish-ud-2.0-170801.udpipe",
}
def __init__(self, language):
model_path = self.MODELS.get(language, None)
if not model_path:
raise ParserException("Cannot find model for lan... | <commit_before>from ufal.udpipe import Model, Pipeline, ProcessingError
class Parser:
MODELS = {
"swe": "data/swedish-ud-2.0-170801.udpipe",
}
def __init__(self, language):
model_path = self.MODELS.get(language, None)
if not model_path:
raise ParserException("Cannot fin... |
78977a0f976615e76db477b0ab7b35193b34d189 | api/__init__.py | api/__init__.py | from flask import Flask
app = Flask(__name__)
app.secret_key = ''
import api.userview
| from flask import Flask
from simplekv.memory import DictStore
from flaskext.kvsession import KVSessionExtension
# Use DictStore until the code is ready for production
store = DictStore()
app = Flask(__name__)
app.secret_key = ''
KVSessionExtension(store, app)
import api.userview
| Change so that kvsession (server side sessions) is used instead of flask default | Change so that kvsession (server side sessions) is used instead of flask default
| Python | isc | tobbez/lys-reader | from flask import Flask
app = Flask(__name__)
app.secret_key = ''
import api.userview
Change so that kvsession (server side sessions) is used instead of flask default | from flask import Flask
from simplekv.memory import DictStore
from flaskext.kvsession import KVSessionExtension
# Use DictStore until the code is ready for production
store = DictStore()
app = Flask(__name__)
app.secret_key = ''
KVSessionExtension(store, app)
import api.userview
| <commit_before>from flask import Flask
app = Flask(__name__)
app.secret_key = ''
import api.userview
<commit_msg>Change so that kvsession (server side sessions) is used instead of flask default<commit_after> | from flask import Flask
from simplekv.memory import DictStore
from flaskext.kvsession import KVSessionExtension
# Use DictStore until the code is ready for production
store = DictStore()
app = Flask(__name__)
app.secret_key = ''
KVSessionExtension(store, app)
import api.userview
| from flask import Flask
app = Flask(__name__)
app.secret_key = ''
import api.userview
Change so that kvsession (server side sessions) is used instead of flask defaultfrom flask import Flask
from simplekv.memory import DictStore
from flaskext.kvsession import KVSessionExtension
# Use DictStore until the code is ready... | <commit_before>from flask import Flask
app = Flask(__name__)
app.secret_key = ''
import api.userview
<commit_msg>Change so that kvsession (server side sessions) is used instead of flask default<commit_after>from flask import Flask
from simplekv.memory import DictStore
from flaskext.kvsession import KVSessionExtension... |
0518025b568d219b2de5f19df38c03bf29cd98db | api/database.py | api/database.py | import os
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from models import ConvertRequest, Base
class Database(object):
db_connection_string = None
engine = None
Session = None
def __init__(self, path, echo):
if not os.path.exists(os.path.dirname(path)):
... | import os
import sqlite3
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from models import ConvertRequest, Base
class Database(object):
db_connection_string = None
engine = None
session_maker = None
def __init__(self, path, echo):
if not os.path.exists(os.pat... | Restructure session handling in sqlalchemy. | Restructure session handling in sqlalchemy.
| Python | mit | SBRG/EscherConverter,SBRG/EscherConverter,SBRG/EscherConverter,SBRG/EscherConverter,SBRG/EscherConverter | import os
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from models import ConvertRequest, Base
class Database(object):
db_connection_string = None
engine = None
Session = None
def __init__(self, path, echo):
if not os.path.exists(os.path.dirname(path)):
... | import os
import sqlite3
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from models import ConvertRequest, Base
class Database(object):
db_connection_string = None
engine = None
session_maker = None
def __init__(self, path, echo):
if not os.path.exists(os.pat... | <commit_before>import os
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from models import ConvertRequest, Base
class Database(object):
db_connection_string = None
engine = None
Session = None
def __init__(self, path, echo):
if not os.path.exists(os.path.dirna... | import os
import sqlite3
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from models import ConvertRequest, Base
class Database(object):
db_connection_string = None
engine = None
session_maker = None
def __init__(self, path, echo):
if not os.path.exists(os.pat... | import os
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from models import ConvertRequest, Base
class Database(object):
db_connection_string = None
engine = None
Session = None
def __init__(self, path, echo):
if not os.path.exists(os.path.dirname(path)):
... | <commit_before>import os
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from models import ConvertRequest, Base
class Database(object):
db_connection_string = None
engine = None
Session = None
def __init__(self, path, echo):
if not os.path.exists(os.path.dirna... |
2056fff6f93d07c3c257748ff82a93a4383da9f5 | src/ansible/tests/test_views.py | src/ansible/tests/test_views.py | from django.test import TestCase
from ansible.models import Playbook
from django.core.urlresolvers import reverse
class PlaybookListViewTest(TestCase):
@classmethod
def setUpTestData(cls):
Playbook.query_set.create(username='lozadaomr',repository='ansi-dst',
inventory='hosts',user='ubu... | from django.test import TestCase
from ansible.models import Playbook
from django.core.urlresolvers import reverse
class PlaybookListViewTest(TestCase):
@classmethod
def setUpTestData(cls):
Playbook.query_set.create(username='lozadaomr',repository='ansi-dst',
inventory='hosts',user='ubu... | Add test for detailed view | Add test for detailed view
| Python | bsd-3-clause | lozadaOmr/ansible-admin,lozadaOmr/ansible-admin,lozadaOmr/ansible-admin | from django.test import TestCase
from ansible.models import Playbook
from django.core.urlresolvers import reverse
class PlaybookListViewTest(TestCase):
@classmethod
def setUpTestData(cls):
Playbook.query_set.create(username='lozadaomr',repository='ansi-dst',
inventory='hosts',user='ubu... | from django.test import TestCase
from ansible.models import Playbook
from django.core.urlresolvers import reverse
class PlaybookListViewTest(TestCase):
@classmethod
def setUpTestData(cls):
Playbook.query_set.create(username='lozadaomr',repository='ansi-dst',
inventory='hosts',user='ubu... | <commit_before>from django.test import TestCase
from ansible.models import Playbook
from django.core.urlresolvers import reverse
class PlaybookListViewTest(TestCase):
@classmethod
def setUpTestData(cls):
Playbook.query_set.create(username='lozadaomr',repository='ansi-dst',
inventory='h... | from django.test import TestCase
from ansible.models import Playbook
from django.core.urlresolvers import reverse
class PlaybookListViewTest(TestCase):
@classmethod
def setUpTestData(cls):
Playbook.query_set.create(username='lozadaomr',repository='ansi-dst',
inventory='hosts',user='ubu... | from django.test import TestCase
from ansible.models import Playbook
from django.core.urlresolvers import reverse
class PlaybookListViewTest(TestCase):
@classmethod
def setUpTestData(cls):
Playbook.query_set.create(username='lozadaomr',repository='ansi-dst',
inventory='hosts',user='ubu... | <commit_before>from django.test import TestCase
from ansible.models import Playbook
from django.core.urlresolvers import reverse
class PlaybookListViewTest(TestCase):
@classmethod
def setUpTestData(cls):
Playbook.query_set.create(username='lozadaomr',repository='ansi-dst',
inventory='h... |
e5776e8bd4e7ee73fea10788fd60d236abfbbfc3 | docrepr/__init__.py | docrepr/__init__.py | # -*- coding: utf-8 -*-
#
# Copyright (c) 2009 Tim Dumol
# Copyright (c) 2012- Spyder Development team
#
# Licensed under the terms of the MIT or BSD Licenses
# (See every file for its license)
"""
Docrepr library
Library to generate rich and plain representations of docstrings,
including several metadat... | # -*- coding: utf-8 -*-
#
# Copyright (c) 2009 Tim Dumol
# Copyright (c) 2013- The Spyder Development team
#
# Licensed under the terms of the Modified BSD License
"""
Docrepr library
Library to generate rich and plain representations of docstrings,
including several metadata of the object to which the doc... | Fix license in init file | Fix license in init file
| Python | bsd-3-clause | techtonik/docrepr,spyder-ide/docrepr,techtonik/docrepr,spyder-ide/docrepr,spyder-ide/docrepr,techtonik/docrepr | # -*- coding: utf-8 -*-
#
# Copyright (c) 2009 Tim Dumol
# Copyright (c) 2012- Spyder Development team
#
# Licensed under the terms of the MIT or BSD Licenses
# (See every file for its license)
"""
Docrepr library
Library to generate rich and plain representations of docstrings,
including several metadat... | # -*- coding: utf-8 -*-
#
# Copyright (c) 2009 Tim Dumol
# Copyright (c) 2013- The Spyder Development team
#
# Licensed under the terms of the Modified BSD License
"""
Docrepr library
Library to generate rich and plain representations of docstrings,
including several metadata of the object to which the doc... | <commit_before># -*- coding: utf-8 -*-
#
# Copyright (c) 2009 Tim Dumol
# Copyright (c) 2012- Spyder Development team
#
# Licensed under the terms of the MIT or BSD Licenses
# (See every file for its license)
"""
Docrepr library
Library to generate rich and plain representations of docstrings,
including ... | # -*- coding: utf-8 -*-
#
# Copyright (c) 2009 Tim Dumol
# Copyright (c) 2013- The Spyder Development team
#
# Licensed under the terms of the Modified BSD License
"""
Docrepr library
Library to generate rich and plain representations of docstrings,
including several metadata of the object to which the doc... | # -*- coding: utf-8 -*-
#
# Copyright (c) 2009 Tim Dumol
# Copyright (c) 2012- Spyder Development team
#
# Licensed under the terms of the MIT or BSD Licenses
# (See every file for its license)
"""
Docrepr library
Library to generate rich and plain representations of docstrings,
including several metadat... | <commit_before># -*- coding: utf-8 -*-
#
# Copyright (c) 2009 Tim Dumol
# Copyright (c) 2012- Spyder Development team
#
# Licensed under the terms of the MIT or BSD Licenses
# (See every file for its license)
"""
Docrepr library
Library to generate rich and plain representations of docstrings,
including ... |
b99a8e2fe4a4d26b8b9dfbc4b3a9effad9c89f90 | calexicon/dates/tests/test_bce.py | calexicon/dates/tests/test_bce.py | import unittest
from calexicon.dates import BCEDate
class TestBCEDate(unittest.TestCase):
def test_make_bce_date(self):
bd = BCEDate(-4713, 1, 1)
self.assertEqual(bd.julian_representation(), (-4713, 1, 1))
def test_equality(self):
self.assertEqual(BCEDate(-44, 3, 15), BCEDate(-44, 3... | import unittest
from datetime import timedelta
from calexicon.dates import BCEDate
class TestBCEDate(unittest.TestCase):
def test_make_bce_date(self):
bd = BCEDate(-4713, 1, 1)
self.assertEqual(bd.julian_representation(), (-4713, 1, 1))
def test_equality(self):
self.assertEqual(BCE... | Add tests for the subtraction operator for BCEDate. | Add tests for the subtraction operator for BCEDate.
| Python | apache-2.0 | jwg4/calexicon,jwg4/qual | import unittest
from calexicon.dates import BCEDate
class TestBCEDate(unittest.TestCase):
def test_make_bce_date(self):
bd = BCEDate(-4713, 1, 1)
self.assertEqual(bd.julian_representation(), (-4713, 1, 1))
def test_equality(self):
self.assertEqual(BCEDate(-44, 3, 15), BCEDate(-44, 3... | import unittest
from datetime import timedelta
from calexicon.dates import BCEDate
class TestBCEDate(unittest.TestCase):
def test_make_bce_date(self):
bd = BCEDate(-4713, 1, 1)
self.assertEqual(bd.julian_representation(), (-4713, 1, 1))
def test_equality(self):
self.assertEqual(BCE... | <commit_before>import unittest
from calexicon.dates import BCEDate
class TestBCEDate(unittest.TestCase):
def test_make_bce_date(self):
bd = BCEDate(-4713, 1, 1)
self.assertEqual(bd.julian_representation(), (-4713, 1, 1))
def test_equality(self):
self.assertEqual(BCEDate(-44, 3, 15),... | import unittest
from datetime import timedelta
from calexicon.dates import BCEDate
class TestBCEDate(unittest.TestCase):
def test_make_bce_date(self):
bd = BCEDate(-4713, 1, 1)
self.assertEqual(bd.julian_representation(), (-4713, 1, 1))
def test_equality(self):
self.assertEqual(BCE... | import unittest
from calexicon.dates import BCEDate
class TestBCEDate(unittest.TestCase):
def test_make_bce_date(self):
bd = BCEDate(-4713, 1, 1)
self.assertEqual(bd.julian_representation(), (-4713, 1, 1))
def test_equality(self):
self.assertEqual(BCEDate(-44, 3, 15), BCEDate(-44, 3... | <commit_before>import unittest
from calexicon.dates import BCEDate
class TestBCEDate(unittest.TestCase):
def test_make_bce_date(self):
bd = BCEDate(-4713, 1, 1)
self.assertEqual(bd.julian_representation(), (-4713, 1, 1))
def test_equality(self):
self.assertEqual(BCEDate(-44, 3, 15),... |
bacab2b55907c6c263862c2e8d9e0a58f4fbfb29 | mediacenter/tests/test_utils.py | mediacenter/tests/test_utils.py | import pytest
from ..utils import guess_kind
@pytest.mark.parametrize('input,expected', [
['pouet.jpg', 'image'],
['pouet.jpeg', 'image'],
['pouet.png', 'image'],
['pouet.mp4', 'video'],
['pouet.avi', 'video'],
['pouet.mp3', 'audio'],
['pouet.ogg', 'audio'],
['pouet.pdf', 'pdf'],
... | import pytest
from ..utils import guess_kind
@pytest.mark.parametrize('input,expected', [
['pouet.jpg', 'image'],
['pouet.jpeg', 'image'],
['pouet.png', 'image'],
['pouet.mp4', 'video'],
['pouet.avi', 'video'],
['pouet.mp3', 'audio'],
['pouet.ogg', 'audio'],
['pouet.pdf', 'pdf'],
... | Add case of unknown extension when testing guess_kind | Add case of unknown extension when testing guess_kind
| Python | agpl-3.0 | Lcaracol/ideasbox.lan,ideascube/ideascube,ideascube/ideascube,Lcaracol/ideasbox.lan,ideascube/ideascube,ideascube/ideascube,Lcaracol/ideasbox.lan | import pytest
from ..utils import guess_kind
@pytest.mark.parametrize('input,expected', [
['pouet.jpg', 'image'],
['pouet.jpeg', 'image'],
['pouet.png', 'image'],
['pouet.mp4', 'video'],
['pouet.avi', 'video'],
['pouet.mp3', 'audio'],
['pouet.ogg', 'audio'],
['pouet.pdf', 'pdf'],
... | import pytest
from ..utils import guess_kind
@pytest.mark.parametrize('input,expected', [
['pouet.jpg', 'image'],
['pouet.jpeg', 'image'],
['pouet.png', 'image'],
['pouet.mp4', 'video'],
['pouet.avi', 'video'],
['pouet.mp3', 'audio'],
['pouet.ogg', 'audio'],
['pouet.pdf', 'pdf'],
... | <commit_before>import pytest
from ..utils import guess_kind
@pytest.mark.parametrize('input,expected', [
['pouet.jpg', 'image'],
['pouet.jpeg', 'image'],
['pouet.png', 'image'],
['pouet.mp4', 'video'],
['pouet.avi', 'video'],
['pouet.mp3', 'audio'],
['pouet.ogg', 'audio'],
['pouet.pdf... | import pytest
from ..utils import guess_kind
@pytest.mark.parametrize('input,expected', [
['pouet.jpg', 'image'],
['pouet.jpeg', 'image'],
['pouet.png', 'image'],
['pouet.mp4', 'video'],
['pouet.avi', 'video'],
['pouet.mp3', 'audio'],
['pouet.ogg', 'audio'],
['pouet.pdf', 'pdf'],
... | import pytest
from ..utils import guess_kind
@pytest.mark.parametrize('input,expected', [
['pouet.jpg', 'image'],
['pouet.jpeg', 'image'],
['pouet.png', 'image'],
['pouet.mp4', 'video'],
['pouet.avi', 'video'],
['pouet.mp3', 'audio'],
['pouet.ogg', 'audio'],
['pouet.pdf', 'pdf'],
... | <commit_before>import pytest
from ..utils import guess_kind
@pytest.mark.parametrize('input,expected', [
['pouet.jpg', 'image'],
['pouet.jpeg', 'image'],
['pouet.png', 'image'],
['pouet.mp4', 'video'],
['pouet.avi', 'video'],
['pouet.mp3', 'audio'],
['pouet.ogg', 'audio'],
['pouet.pdf... |
106868c0c4b3bb947d251a8416bbd3698af5948b | backend/session/permissions.py | backend/session/permissions.py |
from rest_framework import permissions
class IsStaffOrTargetUser(permissions.BasePermission):
def has_permission(self, request, view):
return view.action == 'retrieve' or request.user.is_staff
def has_object_permission(self, request, view, obj):
return request.user.is_staff or obj == reques... | from rest_framework import permissions
class IsStaffOrTargetUser(permissions.BasePermission):
def has_permission(self, request, view):
if view.action == 'retrieve':
return True
else:
return hasattr(request, 'user') and request.user.is_staff
def has_object_permission(se... | Fix IsStaffOrTargetUser permission when no user in request. | Fix IsStaffOrTargetUser permission when no user in request.
| Python | mit | ThreeDRadio/playlists,ThreeDRadio/playlists,ThreeDRadio/playlists |
from rest_framework import permissions
class IsStaffOrTargetUser(permissions.BasePermission):
def has_permission(self, request, view):
return view.action == 'retrieve' or request.user.is_staff
def has_object_permission(self, request, view, obj):
return request.user.is_staff or obj == reques... | from rest_framework import permissions
class IsStaffOrTargetUser(permissions.BasePermission):
def has_permission(self, request, view):
if view.action == 'retrieve':
return True
else:
return hasattr(request, 'user') and request.user.is_staff
def has_object_permission(se... | <commit_before>
from rest_framework import permissions
class IsStaffOrTargetUser(permissions.BasePermission):
def has_permission(self, request, view):
return view.action == 'retrieve' or request.user.is_staff
def has_object_permission(self, request, view, obj):
return request.user.is_staff o... | from rest_framework import permissions
class IsStaffOrTargetUser(permissions.BasePermission):
def has_permission(self, request, view):
if view.action == 'retrieve':
return True
else:
return hasattr(request, 'user') and request.user.is_staff
def has_object_permission(se... |
from rest_framework import permissions
class IsStaffOrTargetUser(permissions.BasePermission):
def has_permission(self, request, view):
return view.action == 'retrieve' or request.user.is_staff
def has_object_permission(self, request, view, obj):
return request.user.is_staff or obj == reques... | <commit_before>
from rest_framework import permissions
class IsStaffOrTargetUser(permissions.BasePermission):
def has_permission(self, request, view):
return view.action == 'retrieve' or request.user.is_staff
def has_object_permission(self, request, view, obj):
return request.user.is_staff o... |
6222bdca162da68f6a2906a2d73d6e79b6acfdc7 | run.py | run.py | #!/usr/bin/python
from gevent import monkey; monkey.patch_all()
from gevent.wsgi import WSGIServer
import sys
import os
import traceback
from django.core.handlers.wsgi import WSGIHandler
from django.core.management import call_command
from django.core.signals import got_request_exception
sys.path.append('..')
os.envir... | #!/usr/bin/env python
from gevent import monkey; monkey.patch_all()
from gevent.wsgi import WSGIServer
import sys
import os
import traceback
from django.core.handlers.wsgi import WSGIHandler
from django.core.management import call_command
from django.core.signals import got_request_exception
sys.path.append('..')
os.e... | Work apparently better in a virtualenv. | Work apparently better in a virtualenv.
| Python | bsd-3-clause | batiste/django-rpg,batiste/django-rpg | #!/usr/bin/python
from gevent import monkey; monkey.patch_all()
from gevent.wsgi import WSGIServer
import sys
import os
import traceback
from django.core.handlers.wsgi import WSGIHandler
from django.core.management import call_command
from django.core.signals import got_request_exception
sys.path.append('..')
os.envir... | #!/usr/bin/env python
from gevent import monkey; monkey.patch_all()
from gevent.wsgi import WSGIServer
import sys
import os
import traceback
from django.core.handlers.wsgi import WSGIHandler
from django.core.management import call_command
from django.core.signals import got_request_exception
sys.path.append('..')
os.e... | <commit_before>#!/usr/bin/python
from gevent import monkey; monkey.patch_all()
from gevent.wsgi import WSGIServer
import sys
import os
import traceback
from django.core.handlers.wsgi import WSGIHandler
from django.core.management import call_command
from django.core.signals import got_request_exception
sys.path.append... | #!/usr/bin/env python
from gevent import monkey; monkey.patch_all()
from gevent.wsgi import WSGIServer
import sys
import os
import traceback
from django.core.handlers.wsgi import WSGIHandler
from django.core.management import call_command
from django.core.signals import got_request_exception
sys.path.append('..')
os.e... | #!/usr/bin/python
from gevent import monkey; monkey.patch_all()
from gevent.wsgi import WSGIServer
import sys
import os
import traceback
from django.core.handlers.wsgi import WSGIHandler
from django.core.management import call_command
from django.core.signals import got_request_exception
sys.path.append('..')
os.envir... | <commit_before>#!/usr/bin/python
from gevent import monkey; monkey.patch_all()
from gevent.wsgi import WSGIServer
import sys
import os
import traceback
from django.core.handlers.wsgi import WSGIHandler
from django.core.management import call_command
from django.core.signals import got_request_exception
sys.path.append... |
e8175497157ed34f91b9ba96118c4e76cd3ed0e4 | bmsmodules/Events.py | bmsmodules/Events.py | from operator import isCallable
class Events(object):
def __init__(self):
self._events_ = {}
def addEvent(self, eventname, func):
if not isCallable(func):
raise RuntimeError("func argument must be a function!")
elif not isinstance(eventname, basestring):
r... | from operator import isCallable
class Events(object):
def __init__(self):
self._events_ = {}
def addEvent(self, eventname, func):
if not isCallable(func):
raise RuntimeError("func argument must be a function!")
elif not isinstance(eventname, (basestring, int)):
... | Add event execution, allow integers as event name | Add event execution, allow integers as event name
| Python | bsd-3-clause | RenolY2/py-playBMS | from operator import isCallable
class Events(object):
def __init__(self):
self._events_ = {}
def addEvent(self, eventname, func):
if not isCallable(func):
raise RuntimeError("func argument must be a function!")
elif not isinstance(eventname, basestring):
r... | from operator import isCallable
class Events(object):
def __init__(self):
self._events_ = {}
def addEvent(self, eventname, func):
if not isCallable(func):
raise RuntimeError("func argument must be a function!")
elif not isinstance(eventname, (basestring, int)):
... | <commit_before>from operator import isCallable
class Events(object):
def __init__(self):
self._events_ = {}
def addEvent(self, eventname, func):
if not isCallable(func):
raise RuntimeError("func argument must be a function!")
elif not isinstance(eventname, basestring)... | from operator import isCallable
class Events(object):
def __init__(self):
self._events_ = {}
def addEvent(self, eventname, func):
if not isCallable(func):
raise RuntimeError("func argument must be a function!")
elif not isinstance(eventname, (basestring, int)):
... | from operator import isCallable
class Events(object):
def __init__(self):
self._events_ = {}
def addEvent(self, eventname, func):
if not isCallable(func):
raise RuntimeError("func argument must be a function!")
elif not isinstance(eventname, basestring):
r... | <commit_before>from operator import isCallable
class Events(object):
def __init__(self):
self._events_ = {}
def addEvent(self, eventname, func):
if not isCallable(func):
raise RuntimeError("func argument must be a function!")
elif not isinstance(eventname, basestring)... |
6782e88a48a40dffead893f9fdb2ac0eb6dae7f4 | datashape/error.py | datashape/error.py | """Error handling"""
syntax_error = """
File {filename}, line {lineno}
{line}
{pointer}
{error}: {msg}
"""
class DataShapeSyntaxError(SyntaxError):
"""
Makes datashape parse errors look like Python SyntaxError.
"""
def __init__(self, lexpos, filename, text, msg=None):
self.lexpos =... | """Error handling"""
syntax_error = """
File {filename}, line {lineno}
{line}
{pointer}
{error}: {msg}
"""
class DataShapeSyntaxError(SyntaxError):
"""
Makes datashape parse errors look like Python SyntaxError.
"""
def __init__(self, lexpos, filename, text, msg=None):
self.lexpos =... | Remove the print from datashape | Remove the print from datashape
| Python | bsd-2-clause | cowlicks/datashape,cpcloud/datashape,quantopian/datashape,ContinuumIO/datashape,llllllllll/datashape,quantopian/datashape,cpcloud/datashape,cowlicks/datashape,ContinuumIO/datashape,blaze/datashape,llllllllll/datashape,blaze/datashape | """Error handling"""
syntax_error = """
File {filename}, line {lineno}
{line}
{pointer}
{error}: {msg}
"""
class DataShapeSyntaxError(SyntaxError):
"""
Makes datashape parse errors look like Python SyntaxError.
"""
def __init__(self, lexpos, filename, text, msg=None):
self.lexpos =... | """Error handling"""
syntax_error = """
File {filename}, line {lineno}
{line}
{pointer}
{error}: {msg}
"""
class DataShapeSyntaxError(SyntaxError):
"""
Makes datashape parse errors look like Python SyntaxError.
"""
def __init__(self, lexpos, filename, text, msg=None):
self.lexpos =... | <commit_before>"""Error handling"""
syntax_error = """
File {filename}, line {lineno}
{line}
{pointer}
{error}: {msg}
"""
class DataShapeSyntaxError(SyntaxError):
"""
Makes datashape parse errors look like Python SyntaxError.
"""
def __init__(self, lexpos, filename, text, msg=None):
... | """Error handling"""
syntax_error = """
File {filename}, line {lineno}
{line}
{pointer}
{error}: {msg}
"""
class DataShapeSyntaxError(SyntaxError):
"""
Makes datashape parse errors look like Python SyntaxError.
"""
def __init__(self, lexpos, filename, text, msg=None):
self.lexpos =... | """Error handling"""
syntax_error = """
File {filename}, line {lineno}
{line}
{pointer}
{error}: {msg}
"""
class DataShapeSyntaxError(SyntaxError):
"""
Makes datashape parse errors look like Python SyntaxError.
"""
def __init__(self, lexpos, filename, text, msg=None):
self.lexpos =... | <commit_before>"""Error handling"""
syntax_error = """
File {filename}, line {lineno}
{line}
{pointer}
{error}: {msg}
"""
class DataShapeSyntaxError(SyntaxError):
"""
Makes datashape parse errors look like Python SyntaxError.
"""
def __init__(self, lexpos, filename, text, msg=None):
... |
2cae562dc84ba09d0c6a90cf5cde72fba05ac8e3 | f5_cccl/__init__.py | f5_cccl/__init__.py | #!/usr/bin/env python
# Copyright 2017 F5 Networks 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... | #!/usr/bin/env python
# Copyright 2017 F5 Networks Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | Add the proper spacing to the flake exception comment | Add the proper spacing to the flake exception comment
| Python | apache-2.0 | f5devcentral/f5-cccl,ryan-talley/f5-cccl,richbrowne/f5-cccl,ryan-talley/f5-cccl,f5devcentral/f5-cccl,richbrowne/f5-cccl | #!/usr/bin/env python
# Copyright 2017 F5 Networks 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... | #!/usr/bin/env python
# Copyright 2017 F5 Networks Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | <commit_before>#!/usr/bin/env python
# Copyright 2017 F5 Networks 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... | #!/usr/bin/env python
# Copyright 2017 F5 Networks 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... | #!/usr/bin/env python
# Copyright 2017 F5 Networks Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | <commit_before>#!/usr/bin/env python
# Copyright 2017 F5 Networks 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... |
0916ed4903914ee46dbe4e451d367dff719c9a15 | tests/example_project/urls.py | tests/example_project/urls.py | from os.path import dirname, join, normpath
import django
from django.conf.urls.defaults import *
from django.conf import settings
from django.contrib.admin import autodiscover
import ella
from ella import newman
from ella.utils import installedapps
newman.autodiscover()
installedapps.init_logger()
ADMIN_ROOTS = ... | from os.path import dirname, join, normpath
import django
from django.conf.urls.defaults import *
from django.conf import settings
from django.contrib import admin
import ella
from ella import newman
from ella.utils import installedapps
newman.autodiscover()
admin.autodiscover()
installedapps.init_logger()
ADMIN_... | Test running both newman/ and admin/ - some templates still mixed. | Test running both newman/ and admin/ - some templates still mixed.
| Python | bsd-3-clause | petrlosa/ella,ella/ella,whalerock/ella,WhiskeyMedia/ella,WhiskeyMedia/ella,petrlosa/ella,MichalMaM/ella,whalerock/ella,MichalMaM/ella,whalerock/ella | from os.path import dirname, join, normpath
import django
from django.conf.urls.defaults import *
from django.conf import settings
from django.contrib.admin import autodiscover
import ella
from ella import newman
from ella.utils import installedapps
newman.autodiscover()
installedapps.init_logger()
ADMIN_ROOTS = ... | from os.path import dirname, join, normpath
import django
from django.conf.urls.defaults import *
from django.conf import settings
from django.contrib import admin
import ella
from ella import newman
from ella.utils import installedapps
newman.autodiscover()
admin.autodiscover()
installedapps.init_logger()
ADMIN_... | <commit_before>from os.path import dirname, join, normpath
import django
from django.conf.urls.defaults import *
from django.conf import settings
from django.contrib.admin import autodiscover
import ella
from ella import newman
from ella.utils import installedapps
newman.autodiscover()
installedapps.init_logger()
... | from os.path import dirname, join, normpath
import django
from django.conf.urls.defaults import *
from django.conf import settings
from django.contrib import admin
import ella
from ella import newman
from ella.utils import installedapps
newman.autodiscover()
admin.autodiscover()
installedapps.init_logger()
ADMIN_... | from os.path import dirname, join, normpath
import django
from django.conf.urls.defaults import *
from django.conf import settings
from django.contrib.admin import autodiscover
import ella
from ella import newman
from ella.utils import installedapps
newman.autodiscover()
installedapps.init_logger()
ADMIN_ROOTS = ... | <commit_before>from os.path import dirname, join, normpath
import django
from django.conf.urls.defaults import *
from django.conf import settings
from django.contrib.admin import autodiscover
import ella
from ella import newman
from ella.utils import installedapps
newman.autodiscover()
installedapps.init_logger()
... |
98b66fd28d0651022a55fb3d32c69a533e395760 | tests/test_get_user_config.py | tests/test_get_user_config.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
test_get_user_config
--------------------
Tests formerly known from a unittest residing in test_config.py named
"""
import pytest
@pytest.fixture(scope='function')
def back_up_rc(request):
"""
Back up an existing cookiecutter rc and restore it after the tes... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
test_get_user_config
--------------------
Tests formerly known from a unittest residing in test_config.py named
"""
import os
import shutil
import pytest
@pytest.fixture(scope='function')
def back_up_rc(request):
"""
Back up an existing cookiecutter rc and ... | Remove self references from setup/teardown | Remove self references from setup/teardown
| Python | bsd-3-clause | Vauxoo/cookiecutter,willingc/cookiecutter,Springerle/cookiecutter,lucius-feng/cookiecutter,agconti/cookiecutter,lucius-feng/cookiecutter,dajose/cookiecutter,atlassian/cookiecutter,dajose/cookiecutter,vintasoftware/cookiecutter,cguardia/cookiecutter,michaeljoseph/cookiecutter,tylerdave/cookiecutter,audreyr/cookiecutter,... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
test_get_user_config
--------------------
Tests formerly known from a unittest residing in test_config.py named
"""
import pytest
@pytest.fixture(scope='function')
def back_up_rc(request):
"""
Back up an existing cookiecutter rc and restore it after the tes... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
test_get_user_config
--------------------
Tests formerly known from a unittest residing in test_config.py named
"""
import os
import shutil
import pytest
@pytest.fixture(scope='function')
def back_up_rc(request):
"""
Back up an existing cookiecutter rc and ... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
test_get_user_config
--------------------
Tests formerly known from a unittest residing in test_config.py named
"""
import pytest
@pytest.fixture(scope='function')
def back_up_rc(request):
"""
Back up an existing cookiecutter rc and restore i... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
test_get_user_config
--------------------
Tests formerly known from a unittest residing in test_config.py named
"""
import os
import shutil
import pytest
@pytest.fixture(scope='function')
def back_up_rc(request):
"""
Back up an existing cookiecutter rc and ... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
test_get_user_config
--------------------
Tests formerly known from a unittest residing in test_config.py named
"""
import pytest
@pytest.fixture(scope='function')
def back_up_rc(request):
"""
Back up an existing cookiecutter rc and restore it after the tes... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
test_get_user_config
--------------------
Tests formerly known from a unittest residing in test_config.py named
"""
import pytest
@pytest.fixture(scope='function')
def back_up_rc(request):
"""
Back up an existing cookiecutter rc and restore i... |
2a322d26d4ed299d21a1b931e03311ff02a23e0f | app/status/views/healthcheck.py | app/status/views/healthcheck.py | from flask import current_app, jsonify, request
from notifications_python_client.errors import HTTPError
from app import status_api_client, version
from app.status import status
@status.route("/_status", methods=["GET"])
def show_status():
if request.args.get("elb", None) or request.args.get("simple", None):
... | from flask import current_app, jsonify, request
from notifications_python_client.errors import HTTPError
from app import status_api_client
from app.status import status
@status.route("/_status", methods=["GET"])
def show_status():
if request.args.get("elb", None) or request.args.get("simple", None):
retu... | Remove git commit/version from status endpoint | Remove git commit/version from status endpoint
This is temporary for the purpose of getting running in
Docker with minimal build steps.
| Python | mit | alphagov/notifications-admin,alphagov/notifications-admin,alphagov/notifications-admin,alphagov/notifications-admin | from flask import current_app, jsonify, request
from notifications_python_client.errors import HTTPError
from app import status_api_client, version
from app.status import status
@status.route("/_status", methods=["GET"])
def show_status():
if request.args.get("elb", None) or request.args.get("simple", None):
... | from flask import current_app, jsonify, request
from notifications_python_client.errors import HTTPError
from app import status_api_client
from app.status import status
@status.route("/_status", methods=["GET"])
def show_status():
if request.args.get("elb", None) or request.args.get("simple", None):
retu... | <commit_before>from flask import current_app, jsonify, request
from notifications_python_client.errors import HTTPError
from app import status_api_client, version
from app.status import status
@status.route("/_status", methods=["GET"])
def show_status():
if request.args.get("elb", None) or request.args.get("simp... | from flask import current_app, jsonify, request
from notifications_python_client.errors import HTTPError
from app import status_api_client
from app.status import status
@status.route("/_status", methods=["GET"])
def show_status():
if request.args.get("elb", None) or request.args.get("simple", None):
retu... | from flask import current_app, jsonify, request
from notifications_python_client.errors import HTTPError
from app import status_api_client, version
from app.status import status
@status.route("/_status", methods=["GET"])
def show_status():
if request.args.get("elb", None) or request.args.get("simple", None):
... | <commit_before>from flask import current_app, jsonify, request
from notifications_python_client.errors import HTTPError
from app import status_api_client, version
from app.status import status
@status.route("/_status", methods=["GET"])
def show_status():
if request.args.get("elb", None) or request.args.get("simp... |
b2d9b27b383c716ef3f15c96f6627837ffd1751e | app/modals/user.py | app/modals/user.py | from app import db
class Users(db.Modal):
id = db.Column(db.Integer, primary_key=True)
name = db.Column(db.String(100), nullable=False)
asu_id = db.Column(db.Integer,nullable=False)
class_standing = db.Column(db.String(100), nullable=True)
email = db.Column(db.String(100))
phone_number = db.Col... | from config import db
class User(db.Modal):
id = db.Column(db.Integer, primary_key=True)
name = db.Column(db.String(100), nullable=False)
asu_id = db.Column(db.Integer,nullable=False)
class_standing = db.Column(db.String(100), nullable=True)
email = db.Column(db.String(100))
phone_number = db.C... | Add db from config to modals | Add db from config to modals
| Python | mit | tforrest/soda-automation,tforrest/soda-automation | from app import db
class Users(db.Modal):
id = db.Column(db.Integer, primary_key=True)
name = db.Column(db.String(100), nullable=False)
asu_id = db.Column(db.Integer,nullable=False)
class_standing = db.Column(db.String(100), nullable=True)
email = db.Column(db.String(100))
phone_number = db.Col... | from config import db
class User(db.Modal):
id = db.Column(db.Integer, primary_key=True)
name = db.Column(db.String(100), nullable=False)
asu_id = db.Column(db.Integer,nullable=False)
class_standing = db.Column(db.String(100), nullable=True)
email = db.Column(db.String(100))
phone_number = db.C... | <commit_before>from app import db
class Users(db.Modal):
id = db.Column(db.Integer, primary_key=True)
name = db.Column(db.String(100), nullable=False)
asu_id = db.Column(db.Integer,nullable=False)
class_standing = db.Column(db.String(100), nullable=True)
email = db.Column(db.String(100))
phone_... | from config import db
class User(db.Modal):
id = db.Column(db.Integer, primary_key=True)
name = db.Column(db.String(100), nullable=False)
asu_id = db.Column(db.Integer,nullable=False)
class_standing = db.Column(db.String(100), nullable=True)
email = db.Column(db.String(100))
phone_number = db.C... | from app import db
class Users(db.Modal):
id = db.Column(db.Integer, primary_key=True)
name = db.Column(db.String(100), nullable=False)
asu_id = db.Column(db.Integer,nullable=False)
class_standing = db.Column(db.String(100), nullable=True)
email = db.Column(db.String(100))
phone_number = db.Col... | <commit_before>from app import db
class Users(db.Modal):
id = db.Column(db.Integer, primary_key=True)
name = db.Column(db.String(100), nullable=False)
asu_id = db.Column(db.Integer,nullable=False)
class_standing = db.Column(db.String(100), nullable=True)
email = db.Column(db.String(100))
phone_... |
72fcff2c4bb0b6823aef66e2c4a43e090e1fa38c | toolkit/devserver_settings.py | toolkit/devserver_settings.py | import os.path
import logging
import logging.config
from toolkit.settings_common import *
APP_ROOT = '/home/ben/data/python/cube'
# URL that handles the media served from MEDIA_ROOT. Make sure to use a
# trailing slash.
# Examples: "http://media.lawrence.com/media/", "http://example.com/media/"
MEDIA_URL = 'http://t... | import os.path
import logging
import logging.config
from toolkit.settings_common import *
APP_ROOT = '/home/ben/data/python/cube'
# URL that handles the media served from MEDIA_ROOT. Make sure to use a
# trailing slash.
# Examples: "http://media.lawrence.com/media/", "http://example.com/media/"
MEDIA_URL = 'http://t... | Throw exceptions on datetimefield errors in debug mode | Throw exceptions on datetimefield errors in debug mode
| Python | agpl-3.0 | BenMotz/cubetoolkit,BenMotz/cubetoolkit,BenMotz/cubetoolkit,BenMotz/cubetoolkit | import os.path
import logging
import logging.config
from toolkit.settings_common import *
APP_ROOT = '/home/ben/data/python/cube'
# URL that handles the media served from MEDIA_ROOT. Make sure to use a
# trailing slash.
# Examples: "http://media.lawrence.com/media/", "http://example.com/media/"
MEDIA_URL = 'http://t... | import os.path
import logging
import logging.config
from toolkit.settings_common import *
APP_ROOT = '/home/ben/data/python/cube'
# URL that handles the media served from MEDIA_ROOT. Make sure to use a
# trailing slash.
# Examples: "http://media.lawrence.com/media/", "http://example.com/media/"
MEDIA_URL = 'http://t... | <commit_before>import os.path
import logging
import logging.config
from toolkit.settings_common import *
APP_ROOT = '/home/ben/data/python/cube'
# URL that handles the media served from MEDIA_ROOT. Make sure to use a
# trailing slash.
# Examples: "http://media.lawrence.com/media/", "http://example.com/media/"
MEDIA_... | import os.path
import logging
import logging.config
from toolkit.settings_common import *
APP_ROOT = '/home/ben/data/python/cube'
# URL that handles the media served from MEDIA_ROOT. Make sure to use a
# trailing slash.
# Examples: "http://media.lawrence.com/media/", "http://example.com/media/"
MEDIA_URL = 'http://t... | import os.path
import logging
import logging.config
from toolkit.settings_common import *
APP_ROOT = '/home/ben/data/python/cube'
# URL that handles the media served from MEDIA_ROOT. Make sure to use a
# trailing slash.
# Examples: "http://media.lawrence.com/media/", "http://example.com/media/"
MEDIA_URL = 'http://t... | <commit_before>import os.path
import logging
import logging.config
from toolkit.settings_common import *
APP_ROOT = '/home/ben/data/python/cube'
# URL that handles the media served from MEDIA_ROOT. Make sure to use a
# trailing slash.
# Examples: "http://media.lawrence.com/media/", "http://example.com/media/"
MEDIA_... |
7898e0aea72313b769e0c42eea961319539f543b | apps/contribution/serializers.py | apps/contribution/serializers.py | from rest_framework import serializers
from apps.contribution.models import Repository
class RepositorySerializer(serializers.ModelSerializer):
class Meta:
model = Repository
fields = ('id', 'name', 'description', 'url', 'updated_at')
| from rest_framework import serializers
from apps.contribution.models import Repository, RepositoryLanguage
class RepositoryLanguagesSerializer(serializers.ModelSerializer):
class Meta(object):
model = RepositoryLanguage
fields = ('type', 'size')
class RepositorySerializer(serializers.ModelSeria... | Add languages to api endpoint | Add languages to api endpoint
| Python | mit | dotKom/onlineweb4,dotKom/onlineweb4,dotKom/onlineweb4,dotKom/onlineweb4 | from rest_framework import serializers
from apps.contribution.models import Repository
class RepositorySerializer(serializers.ModelSerializer):
class Meta:
model = Repository
fields = ('id', 'name', 'description', 'url', 'updated_at')
Add languages to api endpoint | from rest_framework import serializers
from apps.contribution.models import Repository, RepositoryLanguage
class RepositoryLanguagesSerializer(serializers.ModelSerializer):
class Meta(object):
model = RepositoryLanguage
fields = ('type', 'size')
class RepositorySerializer(serializers.ModelSeria... | <commit_before>from rest_framework import serializers
from apps.contribution.models import Repository
class RepositorySerializer(serializers.ModelSerializer):
class Meta:
model = Repository
fields = ('id', 'name', 'description', 'url', 'updated_at')
<commit_msg>Add languages to api endpoint<commi... | from rest_framework import serializers
from apps.contribution.models import Repository, RepositoryLanguage
class RepositoryLanguagesSerializer(serializers.ModelSerializer):
class Meta(object):
model = RepositoryLanguage
fields = ('type', 'size')
class RepositorySerializer(serializers.ModelSeria... | from rest_framework import serializers
from apps.contribution.models import Repository
class RepositorySerializer(serializers.ModelSerializer):
class Meta:
model = Repository
fields = ('id', 'name', 'description', 'url', 'updated_at')
Add languages to api endpointfrom rest_framework import serial... | <commit_before>from rest_framework import serializers
from apps.contribution.models import Repository
class RepositorySerializer(serializers.ModelSerializer):
class Meta:
model = Repository
fields = ('id', 'name', 'description', 'url', 'updated_at')
<commit_msg>Add languages to api endpoint<commi... |
ac8ab5a191de399477ce7693307ef1e114e841c6 | base_kanban_stage_state/__manifest__.py | base_kanban_stage_state/__manifest__.py | # -*- coding: utf-8 -*-
# Copyright 2017 Specialty Medical Drugstore
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
{
"name": "Base Kanban Stage State",
"summary": "Maps stages from base_kanban_stage to states",
"version": "10.0.1.0.0",
"category": "Base",
"website": "https://odoo-c... | # -*- coding: utf-8 -*-
# Copyright 2017 Specialty Medical Drugstore
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
{
"name": "Base Kanban Stage State",
"summary": "Maps stages from base_kanban_stage to states",
"version": "10.0.1.0.0",
"category": "Base",
"website": "https://odoo-c... | Fix license in manifest file | Fix license in manifest file
| Python | agpl-3.0 | ovnicraft/server-tools,ovnicraft/server-tools,thinkopensolutions/server-tools,thinkopensolutions/server-tools,ovnicraft/server-tools | # -*- coding: utf-8 -*-
# Copyright 2017 Specialty Medical Drugstore
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
{
"name": "Base Kanban Stage State",
"summary": "Maps stages from base_kanban_stage to states",
"version": "10.0.1.0.0",
"category": "Base",
"website": "https://odoo-c... | # -*- coding: utf-8 -*-
# Copyright 2017 Specialty Medical Drugstore
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
{
"name": "Base Kanban Stage State",
"summary": "Maps stages from base_kanban_stage to states",
"version": "10.0.1.0.0",
"category": "Base",
"website": "https://odoo-c... | <commit_before># -*- coding: utf-8 -*-
# Copyright 2017 Specialty Medical Drugstore
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
{
"name": "Base Kanban Stage State",
"summary": "Maps stages from base_kanban_stage to states",
"version": "10.0.1.0.0",
"category": "Base",
"website": ... | # -*- coding: utf-8 -*-
# Copyright 2017 Specialty Medical Drugstore
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
{
"name": "Base Kanban Stage State",
"summary": "Maps stages from base_kanban_stage to states",
"version": "10.0.1.0.0",
"category": "Base",
"website": "https://odoo-c... | # -*- coding: utf-8 -*-
# Copyright 2017 Specialty Medical Drugstore
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
{
"name": "Base Kanban Stage State",
"summary": "Maps stages from base_kanban_stage to states",
"version": "10.0.1.0.0",
"category": "Base",
"website": "https://odoo-c... | <commit_before># -*- coding: utf-8 -*-
# Copyright 2017 Specialty Medical Drugstore
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
{
"name": "Base Kanban Stage State",
"summary": "Maps stages from base_kanban_stage to states",
"version": "10.0.1.0.0",
"category": "Base",
"website": ... |
52c5b5823a4d808c96f525c95df7e269d6db2a98 | astrobin_apps_donations/utils.py | astrobin_apps_donations/utils.py | from subscription.models import UserSubscription
def user_is_donor(user):
if user.is_authenticated:
return UserSubscription.objects.filter(user = user, subscription__name = 'AstroBin Donor').count() > 0
return False
| from subscription.models import UserSubscription
def user_is_donor(user):
if user.is_authenticated():
return UserSubscription.objects.filter(user = user, subscription__name = 'AstroBin Donor').count() > 0
return False
| Fix checking whether user is donor. | Fix checking whether user is donor.
| Python | agpl-3.0 | astrobin/astrobin,astrobin/astrobin,astrobin/astrobin,astrobin/astrobin | from subscription.models import UserSubscription
def user_is_donor(user):
if user.is_authenticated:
return UserSubscription.objects.filter(user = user, subscription__name = 'AstroBin Donor').count() > 0
return False
Fix checking whether user is donor. | from subscription.models import UserSubscription
def user_is_donor(user):
if user.is_authenticated():
return UserSubscription.objects.filter(user = user, subscription__name = 'AstroBin Donor').count() > 0
return False
| <commit_before>from subscription.models import UserSubscription
def user_is_donor(user):
if user.is_authenticated:
return UserSubscription.objects.filter(user = user, subscription__name = 'AstroBin Donor').count() > 0
return False
<commit_msg>Fix checking whether user is donor.<commit_after> | from subscription.models import UserSubscription
def user_is_donor(user):
if user.is_authenticated():
return UserSubscription.objects.filter(user = user, subscription__name = 'AstroBin Donor').count() > 0
return False
| from subscription.models import UserSubscription
def user_is_donor(user):
if user.is_authenticated:
return UserSubscription.objects.filter(user = user, subscription__name = 'AstroBin Donor').count() > 0
return False
Fix checking whether user is donor.from subscription.models import UserSubscription
d... | <commit_before>from subscription.models import UserSubscription
def user_is_donor(user):
if user.is_authenticated:
return UserSubscription.objects.filter(user = user, subscription__name = 'AstroBin Donor').count() > 0
return False
<commit_msg>Fix checking whether user is donor.<commit_after>from subsc... |
fb59c2c7c01da9f4040c6b9c818d1fe2fc7993bb | get_weather_data.py | get_weather_data.py | # get_weather_data.py
import pandas as pd
import constants as const
import utils
def main():
engine = utils.get_db_engine()
today = utils.get_current_time()
resp = utils.get_uri_content(uri=const.DARK_SKY_URI,
content_type='json')
for key in resp.keys():
if ... | # get_weather_data.py
import pandas as pd
import constants as const
import utils
def main():
engine = utils.get_db_engine()
today = utils.get_current_time()
resp = utils.get_uri_content(uri=const.DARK_SKY_URI,
content_type='json')
for key in resp.keys():
if ... | Fix bug with data frames | Fix bug with data frames
| Python | mit | tmthyjames/Achoo,tmthyjames/Achoo,tmthyjames/Achoo,tmthyjames/Achoo,tmthyjames/Achoo | # get_weather_data.py
import pandas as pd
import constants as const
import utils
def main():
engine = utils.get_db_engine()
today = utils.get_current_time()
resp = utils.get_uri_content(uri=const.DARK_SKY_URI,
content_type='json')
for key in resp.keys():
if ... | # get_weather_data.py
import pandas as pd
import constants as const
import utils
def main():
engine = utils.get_db_engine()
today = utils.get_current_time()
resp = utils.get_uri_content(uri=const.DARK_SKY_URI,
content_type='json')
for key in resp.keys():
if ... | <commit_before># get_weather_data.py
import pandas as pd
import constants as const
import utils
def main():
engine = utils.get_db_engine()
today = utils.get_current_time()
resp = utils.get_uri_content(uri=const.DARK_SKY_URI,
content_type='json')
for key in resp.keys... | # get_weather_data.py
import pandas as pd
import constants as const
import utils
def main():
engine = utils.get_db_engine()
today = utils.get_current_time()
resp = utils.get_uri_content(uri=const.DARK_SKY_URI,
content_type='json')
for key in resp.keys():
if ... | # get_weather_data.py
import pandas as pd
import constants as const
import utils
def main():
engine = utils.get_db_engine()
today = utils.get_current_time()
resp = utils.get_uri_content(uri=const.DARK_SKY_URI,
content_type='json')
for key in resp.keys():
if ... | <commit_before># get_weather_data.py
import pandas as pd
import constants as const
import utils
def main():
engine = utils.get_db_engine()
today = utils.get_current_time()
resp = utils.get_uri_content(uri=const.DARK_SKY_URI,
content_type='json')
for key in resp.keys... |
f2da30eb43a10c3e44d3e9b8d77ddb146ad88a0f | python/src/setup.py | python/src/setup.py | #!/usr/bin/env python
"""Setup specs for packaging, distributing, and installing MR lib."""
import distribute_setup
# User may not have setuptools installed on their machines.
# This script will automatically install the right version from PyPI.
distribute_setup.use_setuptools()
# pylint: disable=g-import-not-at-top... | #!/usr/bin/env python
"""Setup specs for packaging, distributing, and installing MR lib."""
import distribute_setup
# User may not have setuptools installed on their machines.
# This script will automatically install the right version from PyPI.
distribute_setup.use_setuptools()
# pylint: disable=g-import-not-at-top... | Move MR and Pipelines to 1.9.15.0 - Slight tweaks to requirements.txt for pipeline to add GCS Client as a dep. | Move MR and Pipelines to 1.9.15.0
- Slight tweaks to requirements.txt for pipeline to add GCS Client as a dep.
Revision created by MOE tool push_codebase.
MOE_MIGRATION=7173
| Python | apache-2.0 | westerhofffl/appengine-mapreduce,chargrizzle/appengine-mapreduce,talele08/appengine-mapreduce,bmenasha/appengine-mapreduce,rbruyere/appengine-mapreduce,vendasta/appengine-mapreduce,talele08/appengine-mapreduce,lordzuko/appengine-mapreduce,vendasta/appengine-mapreduce,bmenasha/appengine-mapreduce,VirusTotal/appengine-ma... | #!/usr/bin/env python
"""Setup specs for packaging, distributing, and installing MR lib."""
import distribute_setup
# User may not have setuptools installed on their machines.
# This script will automatically install the right version from PyPI.
distribute_setup.use_setuptools()
# pylint: disable=g-import-not-at-top... | #!/usr/bin/env python
"""Setup specs for packaging, distributing, and installing MR lib."""
import distribute_setup
# User may not have setuptools installed on their machines.
# This script will automatically install the right version from PyPI.
distribute_setup.use_setuptools()
# pylint: disable=g-import-not-at-top... | <commit_before>#!/usr/bin/env python
"""Setup specs for packaging, distributing, and installing MR lib."""
import distribute_setup
# User may not have setuptools installed on their machines.
# This script will automatically install the right version from PyPI.
distribute_setup.use_setuptools()
# pylint: disable=g-im... | #!/usr/bin/env python
"""Setup specs for packaging, distributing, and installing MR lib."""
import distribute_setup
# User may not have setuptools installed on their machines.
# This script will automatically install the right version from PyPI.
distribute_setup.use_setuptools()
# pylint: disable=g-import-not-at-top... | #!/usr/bin/env python
"""Setup specs for packaging, distributing, and installing MR lib."""
import distribute_setup
# User may not have setuptools installed on their machines.
# This script will automatically install the right version from PyPI.
distribute_setup.use_setuptools()
# pylint: disable=g-import-not-at-top... | <commit_before>#!/usr/bin/env python
"""Setup specs for packaging, distributing, and installing MR lib."""
import distribute_setup
# User may not have setuptools installed on their machines.
# This script will automatically install the right version from PyPI.
distribute_setup.use_setuptools()
# pylint: disable=g-im... |
a1ff0c90072973333aaa7eb246cd754edca7731f | byceps/services/brand/dbmodels/brand.py | byceps/services/brand/dbmodels/brand.py | """
byceps.services.dbbrand.models.brand
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2022 Jochen Kupperschmidt
:License: Revised BSD (see `LICENSE` file for details)
"""
from typing import Optional
from ....database import db
from ....typing import BrandID
from ....util.instances import ReprBuilder
class... | """
byceps.services.brand.dbmodels.brand
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2022 Jochen Kupperschmidt
:License: Revised BSD (see `LICENSE` file for details)
"""
from typing import Optional
from ....database import db
from ....typing import BrandID
from ....util.instances import ReprBuilder
class... | Fix module name in module docstring | Fix module name in module docstring
| Python | bsd-3-clause | homeworkprod/byceps,homeworkprod/byceps,homeworkprod/byceps | """
byceps.services.dbbrand.models.brand
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2022 Jochen Kupperschmidt
:License: Revised BSD (see `LICENSE` file for details)
"""
from typing import Optional
from ....database import db
from ....typing import BrandID
from ....util.instances import ReprBuilder
class... | """
byceps.services.brand.dbmodels.brand
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2022 Jochen Kupperschmidt
:License: Revised BSD (see `LICENSE` file for details)
"""
from typing import Optional
from ....database import db
from ....typing import BrandID
from ....util.instances import ReprBuilder
class... | <commit_before>"""
byceps.services.dbbrand.models.brand
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2022 Jochen Kupperschmidt
:License: Revised BSD (see `LICENSE` file for details)
"""
from typing import Optional
from ....database import db
from ....typing import BrandID
from ....util.instances import Repr... | """
byceps.services.brand.dbmodels.brand
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2022 Jochen Kupperschmidt
:License: Revised BSD (see `LICENSE` file for details)
"""
from typing import Optional
from ....database import db
from ....typing import BrandID
from ....util.instances import ReprBuilder
class... | """
byceps.services.dbbrand.models.brand
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2022 Jochen Kupperschmidt
:License: Revised BSD (see `LICENSE` file for details)
"""
from typing import Optional
from ....database import db
from ....typing import BrandID
from ....util.instances import ReprBuilder
class... | <commit_before>"""
byceps.services.dbbrand.models.brand
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2022 Jochen Kupperschmidt
:License: Revised BSD (see `LICENSE` file for details)
"""
from typing import Optional
from ....database import db
from ....typing import BrandID
from ....util.instances import Repr... |
fddd30a01f3d7b3a6e4e125919e3fc607980fded | btcx/__init__.py | btcx/__init__.py | __version__ = "0.0.1"
VERSION = (0, 0, 1, "handle-with-care")
|
import btce
import mtgox
import cfgmanager
__version__ = "0.0.1"
VERSION = (0, 0, 1, "handle-with-care")
| Support for `import btcx; btcx.btce; ...` | Support for `import btcx; btcx.btce; ...`
| Python | mit | knowitnothing/btcx,knowitnothing/btcx | __version__ = "0.0.1"
VERSION = (0, 0, 1, "handle-with-care")
Support for `import btcx; btcx.btce; ...` |
import btce
import mtgox
import cfgmanager
__version__ = "0.0.1"
VERSION = (0, 0, 1, "handle-with-care")
| <commit_before>__version__ = "0.0.1"
VERSION = (0, 0, 1, "handle-with-care")
<commit_msg>Support for `import btcx; btcx.btce; ...`<commit_after> |
import btce
import mtgox
import cfgmanager
__version__ = "0.0.1"
VERSION = (0, 0, 1, "handle-with-care")
| __version__ = "0.0.1"
VERSION = (0, 0, 1, "handle-with-care")
Support for `import btcx; btcx.btce; ...`
import btce
import mtgox
import cfgmanager
__version__ = "0.0.1"
VERSION = (0, 0, 1, "handle-with-care")
| <commit_before>__version__ = "0.0.1"
VERSION = (0, 0, 1, "handle-with-care")
<commit_msg>Support for `import btcx; btcx.btce; ...`<commit_after>
import btce
import mtgox
import cfgmanager
__version__ = "0.0.1"
VERSION = (0, 0, 1, "handle-with-care")
|
3a8c738d8696f31f7024691d56b5edc411289b1b | registries/views.py | registries/views.py | from django.http import HttpResponse
from rest_framework.generics import ListCreateAPIView, RetrieveUpdateDestroyAPIView
from rest_framework.response import Response
from registries.models import Organization
from registries.serializers import DrillerListSerializer, DrillerSerializer
class APIDrillerListCreateView(Lis... | from django.http import HttpResponse
from rest_framework.generics import ListCreateAPIView, RetrieveUpdateDestroyAPIView
from rest_framework.response import Response
from registries.models import Organization
from registries.serializers import DrillerListSerializer, DrillerSerializer
class APIDrillerListCreateView(Lis... | Add docstrings to view classes | Add docstrings to view classes
| Python | apache-2.0 | bcgov/gwells,rstens/gwells,bcgov/gwells,bcgov/gwells,rstens/gwells,rstens/gwells,bcgov/gwells,rstens/gwells | from django.http import HttpResponse
from rest_framework.generics import ListCreateAPIView, RetrieveUpdateDestroyAPIView
from rest_framework.response import Response
from registries.models import Organization
from registries.serializers import DrillerListSerializer, DrillerSerializer
class APIDrillerListCreateView(Lis... | from django.http import HttpResponse
from rest_framework.generics import ListCreateAPIView, RetrieveUpdateDestroyAPIView
from rest_framework.response import Response
from registries.models import Organization
from registries.serializers import DrillerListSerializer, DrillerSerializer
class APIDrillerListCreateView(Lis... | <commit_before>from django.http import HttpResponse
from rest_framework.generics import ListCreateAPIView, RetrieveUpdateDestroyAPIView
from rest_framework.response import Response
from registries.models import Organization
from registries.serializers import DrillerListSerializer, DrillerSerializer
class APIDrillerLis... | from django.http import HttpResponse
from rest_framework.generics import ListCreateAPIView, RetrieveUpdateDestroyAPIView
from rest_framework.response import Response
from registries.models import Organization
from registries.serializers import DrillerListSerializer, DrillerSerializer
class APIDrillerListCreateView(Lis... | from django.http import HttpResponse
from rest_framework.generics import ListCreateAPIView, RetrieveUpdateDestroyAPIView
from rest_framework.response import Response
from registries.models import Organization
from registries.serializers import DrillerListSerializer, DrillerSerializer
class APIDrillerListCreateView(Lis... | <commit_before>from django.http import HttpResponse
from rest_framework.generics import ListCreateAPIView, RetrieveUpdateDestroyAPIView
from rest_framework.response import Response
from registries.models import Organization
from registries.serializers import DrillerListSerializer, DrillerSerializer
class APIDrillerLis... |
1af9ad69ff57d43fa009967a2afd31aa4a610b00 | helpers/__init__.py | helpers/__init__.py | import os
import sys
import platform
# Various helpers for the build scripts
def get_lib_dir():
if sys.platform.startswith("win"):
if platform.architecture()[0] == '32bit':
# 32 bit
return ['prebuilt-x86/lib']
else:
# 64 bit
return ['prebuilt-x64/lib... | import os
import sys
import platform
# Various helpers for the build scripts
def get_lib_dir():
"""Return the library path for SDL and other libraries.
Assumes we're using the pygame prebuilt zipfile on windows"""
if sys.platform.startswith("win"):
if platform.architecture()[0] == '32bit':
... | Fix spacing. Add docstrings to helpers | Fix spacing. Add docstrings to helpers
| Python | lgpl-2.1 | CTPUG/pygame_cffi,CTPUG/pygame_cffi,CTPUG/pygame_cffi | import os
import sys
import platform
# Various helpers for the build scripts
def get_lib_dir():
if sys.platform.startswith("win"):
if platform.architecture()[0] == '32bit':
# 32 bit
return ['prebuilt-x86/lib']
else:
# 64 bit
return ['prebuilt-x64/lib... | import os
import sys
import platform
# Various helpers for the build scripts
def get_lib_dir():
"""Return the library path for SDL and other libraries.
Assumes we're using the pygame prebuilt zipfile on windows"""
if sys.platform.startswith("win"):
if platform.architecture()[0] == '32bit':
... | <commit_before>import os
import sys
import platform
# Various helpers for the build scripts
def get_lib_dir():
if sys.platform.startswith("win"):
if platform.architecture()[0] == '32bit':
# 32 bit
return ['prebuilt-x86/lib']
else:
# 64 bit
return ['p... | import os
import sys
import platform
# Various helpers for the build scripts
def get_lib_dir():
"""Return the library path for SDL and other libraries.
Assumes we're using the pygame prebuilt zipfile on windows"""
if sys.platform.startswith("win"):
if platform.architecture()[0] == '32bit':
... | import os
import sys
import platform
# Various helpers for the build scripts
def get_lib_dir():
if sys.platform.startswith("win"):
if platform.architecture()[0] == '32bit':
# 32 bit
return ['prebuilt-x86/lib']
else:
# 64 bit
return ['prebuilt-x64/lib... | <commit_before>import os
import sys
import platform
# Various helpers for the build scripts
def get_lib_dir():
if sys.platform.startswith("win"):
if platform.architecture()[0] == '32bit':
# 32 bit
return ['prebuilt-x86/lib']
else:
# 64 bit
return ['p... |
e03cf2206733dc9f005375abef78238cf4011b50 | dashi/config.py | dashi/config.py | import json
import logging
import os
LOGGER = logging.getLogger(__name__)
class User():
def __init__(self, config):
self.config = config
@property
def aliases(self):
return [self.config['name']] + self.config.get('aliases', [])
def _load_config():
for path in ['dashi.conf', os.path.j... | import json
import logging
import os
LOGGER = logging.getLogger(__name__)
class User():
def __init__(self, config):
self.config = config
@property
def aliases(self):
return [self.config['name']] + self.config.get('aliases', [])
@property
def first_name(self):
return self.... | Add the ability to get users and represent them | Add the ability to get users and represent them
Also added a handy first name property for easy table display
| Python | mit | EliRibble/dashi,EliRibble/dashi | import json
import logging
import os
LOGGER = logging.getLogger(__name__)
class User():
def __init__(self, config):
self.config = config
@property
def aliases(self):
return [self.config['name']] + self.config.get('aliases', [])
def _load_config():
for path in ['dashi.conf', os.path.j... | import json
import logging
import os
LOGGER = logging.getLogger(__name__)
class User():
def __init__(self, config):
self.config = config
@property
def aliases(self):
return [self.config['name']] + self.config.get('aliases', [])
@property
def first_name(self):
return self.... | <commit_before>import json
import logging
import os
LOGGER = logging.getLogger(__name__)
class User():
def __init__(self, config):
self.config = config
@property
def aliases(self):
return [self.config['name']] + self.config.get('aliases', [])
def _load_config():
for path in ['dashi.c... | import json
import logging
import os
LOGGER = logging.getLogger(__name__)
class User():
def __init__(self, config):
self.config = config
@property
def aliases(self):
return [self.config['name']] + self.config.get('aliases', [])
@property
def first_name(self):
return self.... | import json
import logging
import os
LOGGER = logging.getLogger(__name__)
class User():
def __init__(self, config):
self.config = config
@property
def aliases(self):
return [self.config['name']] + self.config.get('aliases', [])
def _load_config():
for path in ['dashi.conf', os.path.j... | <commit_before>import json
import logging
import os
LOGGER = logging.getLogger(__name__)
class User():
def __init__(self, config):
self.config = config
@property
def aliases(self):
return [self.config['name']] + self.config.get('aliases', [])
def _load_config():
for path in ['dashi.c... |
8b538c452242050e468b71ca937e3d4feb57887b | mopidy/backends/stream/__init__.py | mopidy/backends/stream/__init__.py | from __future__ import unicode_literals
import mopidy
from mopidy import ext
__doc__ = """A backend for playing music for streaming music.
This backend will handle streaming of URIs in
:attr:`mopidy.settings.STREAM_PROTOCOLS` assuming the right plugins are
installed.
**Issues:**
https://github.com/mopidy/mopidy/i... | from __future__ import unicode_literals
import mopidy
from mopidy import ext
from mopidy.utils import config, formatting
default_config = """
[ext.stream]
# If the stream extension should be enabled or not
enabled = true
# Whitelist of URI schemas to support streaming from
protocols =
http
https
mms
... | Add default config and config schema | stream: Add default config and config schema
| Python | apache-2.0 | tkem/mopidy,jcass77/mopidy,jmarsik/mopidy,ZenithDK/mopidy,swak/mopidy,vrs01/mopidy,diandiankan/mopidy,quartz55/mopidy,adamcik/mopidy,abarisain/mopidy,liamw9534/mopidy,vrs01/mopidy,tkem/mopidy,dbrgn/mopidy,liamw9534/mopidy,SuperStarPL/mopidy,diandiankan/mopidy,abarisain/mopidy,glogiotatidis/mopidy,hkariti/mopidy,mopidy/... | from __future__ import unicode_literals
import mopidy
from mopidy import ext
__doc__ = """A backend for playing music for streaming music.
This backend will handle streaming of URIs in
:attr:`mopidy.settings.STREAM_PROTOCOLS` assuming the right plugins are
installed.
**Issues:**
https://github.com/mopidy/mopidy/i... | from __future__ import unicode_literals
import mopidy
from mopidy import ext
from mopidy.utils import config, formatting
default_config = """
[ext.stream]
# If the stream extension should be enabled or not
enabled = true
# Whitelist of URI schemas to support streaming from
protocols =
http
https
mms
... | <commit_before>from __future__ import unicode_literals
import mopidy
from mopidy import ext
__doc__ = """A backend for playing music for streaming music.
This backend will handle streaming of URIs in
:attr:`mopidy.settings.STREAM_PROTOCOLS` assuming the right plugins are
installed.
**Issues:**
https://github.com/... | from __future__ import unicode_literals
import mopidy
from mopidy import ext
from mopidy.utils import config, formatting
default_config = """
[ext.stream]
# If the stream extension should be enabled or not
enabled = true
# Whitelist of URI schemas to support streaming from
protocols =
http
https
mms
... | from __future__ import unicode_literals
import mopidy
from mopidy import ext
__doc__ = """A backend for playing music for streaming music.
This backend will handle streaming of URIs in
:attr:`mopidy.settings.STREAM_PROTOCOLS` assuming the right plugins are
installed.
**Issues:**
https://github.com/mopidy/mopidy/i... | <commit_before>from __future__ import unicode_literals
import mopidy
from mopidy import ext
__doc__ = """A backend for playing music for streaming music.
This backend will handle streaming of URIs in
:attr:`mopidy.settings.STREAM_PROTOCOLS` assuming the right plugins are
installed.
**Issues:**
https://github.com/... |
ad35ec7d4adb91e79bd3382f0846e9fff2a417c7 | osf/management/commands/update_preprint_share_dates.py | osf/management/commands/update_preprint_share_dates.py | from __future__ import unicode_literals
import logging
from django.core.management.base import BaseCommand
from scripts import utils as script_utils
from osf.models import PreprintService
from website.preprints.tasks import on_preprint_updated
logger = logging.getLogger(__name__)
def update_share_preprint_modified_... | from __future__ import unicode_literals
import logging
from django.core.management.base import BaseCommand
from django.db.models import F
from scripts import utils as script_utils
from osf.models import PreprintService
from website.preprints.tasks import on_preprint_updated
logger = logging.getLogger(__name__)
def ... | Fix SHARE capitalization, use self-referential query | Fix SHARE capitalization, use self-referential query
| Python | apache-2.0 | sloria/osf.io,chrisseto/osf.io,mattclark/osf.io,Johnetordoff/osf.io,baylee-d/osf.io,caseyrollins/osf.io,erinspace/osf.io,aaxelb/osf.io,sloria/osf.io,aaxelb/osf.io,binoculars/osf.io,brianjgeiger/osf.io,saradbowman/osf.io,leb2dg/osf.io,adlius/osf.io,HalcyonChimera/osf.io,brianjgeiger/osf.io,HalcyonChimera/osf.io,chennan4... | from __future__ import unicode_literals
import logging
from django.core.management.base import BaseCommand
from scripts import utils as script_utils
from osf.models import PreprintService
from website.preprints.tasks import on_preprint_updated
logger = logging.getLogger(__name__)
def update_share_preprint_modified_... | from __future__ import unicode_literals
import logging
from django.core.management.base import BaseCommand
from django.db.models import F
from scripts import utils as script_utils
from osf.models import PreprintService
from website.preprints.tasks import on_preprint_updated
logger = logging.getLogger(__name__)
def ... | <commit_before>from __future__ import unicode_literals
import logging
from django.core.management.base import BaseCommand
from scripts import utils as script_utils
from osf.models import PreprintService
from website.preprints.tasks import on_preprint_updated
logger = logging.getLogger(__name__)
def update_share_pre... | from __future__ import unicode_literals
import logging
from django.core.management.base import BaseCommand
from django.db.models import F
from scripts import utils as script_utils
from osf.models import PreprintService
from website.preprints.tasks import on_preprint_updated
logger = logging.getLogger(__name__)
def ... | from __future__ import unicode_literals
import logging
from django.core.management.base import BaseCommand
from scripts import utils as script_utils
from osf.models import PreprintService
from website.preprints.tasks import on_preprint_updated
logger = logging.getLogger(__name__)
def update_share_preprint_modified_... | <commit_before>from __future__ import unicode_literals
import logging
from django.core.management.base import BaseCommand
from scripts import utils as script_utils
from osf.models import PreprintService
from website.preprints.tasks import on_preprint_updated
logger = logging.getLogger(__name__)
def update_share_pre... |
46cfd25a4acf075650a5471c388457cb04cd9a15 | invenio_mail/api.py | invenio_mail/api.py | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2016-2018 CERN.
#
# Invenio is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
"""Template based messages."""
from __future__ import absolute_import, print_functio... | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2016-2018 CERN.
#
# Invenio is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
"""Template based messages."""
from __future__ import absolute_import, print_functio... | Use sentinel value for ctx | Use sentinel value for ctx
| Python | mit | inveniosoftware/invenio-mail,inveniosoftware/invenio-mail,inveniosoftware/invenio-mail | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2016-2018 CERN.
#
# Invenio is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
"""Template based messages."""
from __future__ import absolute_import, print_functio... | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2016-2018 CERN.
#
# Invenio is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
"""Template based messages."""
from __future__ import absolute_import, print_functio... | <commit_before># -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2016-2018 CERN.
#
# Invenio is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
"""Template based messages."""
from __future__ import absolute_import... | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2016-2018 CERN.
#
# Invenio is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
"""Template based messages."""
from __future__ import absolute_import, print_functio... | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2016-2018 CERN.
#
# Invenio is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
"""Template based messages."""
from __future__ import absolute_import, print_functio... | <commit_before># -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2016-2018 CERN.
#
# Invenio is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
"""Template based messages."""
from __future__ import absolute_import... |
b11ac934c95e4bbaee46ae2b73c3e7129acc06f3 | salt/modules/key.py | salt/modules/key.py | # -*- coding: utf-8 -*-
'''
Functions to view the minion's public key information
'''
from __future__ import absolute_import
# Import python libs
import os
# Import Salt libs
import salt.utils
def finger():
'''
Return the minion's public key fingerprint
CLI Example:
.. code-block:: bash
s... | # -*- coding: utf-8 -*-
'''
Functions to view the minion's public key information
'''
from __future__ import absolute_import
# Import python libs
import os
# Import Salt libs
import salt.utils
def finger():
'''
Return the minion's public key fingerprint
CLI Example:
.. code-block:: bash
s... | Use hash_type param for pem_finger | Use hash_type param for pem_finger
| Python | apache-2.0 | saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt | # -*- coding: utf-8 -*-
'''
Functions to view the minion's public key information
'''
from __future__ import absolute_import
# Import python libs
import os
# Import Salt libs
import salt.utils
def finger():
'''
Return the minion's public key fingerprint
CLI Example:
.. code-block:: bash
s... | # -*- coding: utf-8 -*-
'''
Functions to view the minion's public key information
'''
from __future__ import absolute_import
# Import python libs
import os
# Import Salt libs
import salt.utils
def finger():
'''
Return the minion's public key fingerprint
CLI Example:
.. code-block:: bash
s... | <commit_before># -*- coding: utf-8 -*-
'''
Functions to view the minion's public key information
'''
from __future__ import absolute_import
# Import python libs
import os
# Import Salt libs
import salt.utils
def finger():
'''
Return the minion's public key fingerprint
CLI Example:
.. code-block:: ... | # -*- coding: utf-8 -*-
'''
Functions to view the minion's public key information
'''
from __future__ import absolute_import
# Import python libs
import os
# Import Salt libs
import salt.utils
def finger():
'''
Return the minion's public key fingerprint
CLI Example:
.. code-block:: bash
s... | # -*- coding: utf-8 -*-
'''
Functions to view the minion's public key information
'''
from __future__ import absolute_import
# Import python libs
import os
# Import Salt libs
import salt.utils
def finger():
'''
Return the minion's public key fingerprint
CLI Example:
.. code-block:: bash
s... | <commit_before># -*- coding: utf-8 -*-
'''
Functions to view the minion's public key information
'''
from __future__ import absolute_import
# Import python libs
import os
# Import Salt libs
import salt.utils
def finger():
'''
Return the minion's public key fingerprint
CLI Example:
.. code-block:: ... |
590494bf9d840cb6353260392b94700656db5d47 | fabfile/__init__.py | fabfile/__init__.py | """
Fabric's own fabfile.
"""
from __future__ import with_statement
import nose
from fabric.api import abort, local, task
import tag
from utils import msg
@task(default=True)
def test(args=None):
"""
Run all unit tests and doctests.
Specify string argument ``args`` for additional args to ``nosetests`... | """
Fabric's own fabfile.
"""
from __future__ import with_statement
import nose
from fabric.api import abort, local, task
import tag
from utils import msg
@task(default=True)
def test(args=None):
"""
Run all unit tests and doctests.
Specify string argument ``args`` for additional args to ``nosetests`... | Fix super dumb mistake causing all test runs to hit tests folder. | Fix super dumb mistake causing all test runs to hit tests folder.
This causes integration level tests to run both test suites.
Oops!
| Python | bsd-2-clause | cgvarela/fabric,raimon49/fabric,elijah513/fabric,StackStorm/fabric,amaniak/fabric,kmonsoor/fabric,mathiasertl/fabric,opavader/fabric,bspink/fabric,fernandezcuesta/fabric,pgroudas/fabric,likesxuqiang/fabric,xLegoz/fabric,tekapo/fabric,jaraco/fabric,bitmonk/fabric,sdelements/fabric,kxxoling/fabric,itoed/fabric,SamuelMark... | """
Fabric's own fabfile.
"""
from __future__ import with_statement
import nose
from fabric.api import abort, local, task
import tag
from utils import msg
@task(default=True)
def test(args=None):
"""
Run all unit tests and doctests.
Specify string argument ``args`` for additional args to ``nosetests`... | """
Fabric's own fabfile.
"""
from __future__ import with_statement
import nose
from fabric.api import abort, local, task
import tag
from utils import msg
@task(default=True)
def test(args=None):
"""
Run all unit tests and doctests.
Specify string argument ``args`` for additional args to ``nosetests`... | <commit_before>"""
Fabric's own fabfile.
"""
from __future__ import with_statement
import nose
from fabric.api import abort, local, task
import tag
from utils import msg
@task(default=True)
def test(args=None):
"""
Run all unit tests and doctests.
Specify string argument ``args`` for additional args ... | """
Fabric's own fabfile.
"""
from __future__ import with_statement
import nose
from fabric.api import abort, local, task
import tag
from utils import msg
@task(default=True)
def test(args=None):
"""
Run all unit tests and doctests.
Specify string argument ``args`` for additional args to ``nosetests`... | """
Fabric's own fabfile.
"""
from __future__ import with_statement
import nose
from fabric.api import abort, local, task
import tag
from utils import msg
@task(default=True)
def test(args=None):
"""
Run all unit tests and doctests.
Specify string argument ``args`` for additional args to ``nosetests`... | <commit_before>"""
Fabric's own fabfile.
"""
from __future__ import with_statement
import nose
from fabric.api import abort, local, task
import tag
from utils import msg
@task(default=True)
def test(args=None):
"""
Run all unit tests and doctests.
Specify string argument ``args`` for additional args ... |
efbcd8104470234e50ad2e40719b0edf1fbc45c4 | zou/app/utils/date_helpers.py | zou/app/utils/date_helpers.py | from datetime import date, timedelta
def get_date_from_now(nb_days):
return date.today() - timedelta(days=nb_days)
def get_date_diff(date_a, date_b):
return abs((date_b - date_a).total_seconds())
| from babel.dates import format_datetime
from datetime import date, datetime, timedelta
def get_date_from_now(nb_days):
return date.today() - timedelta(days=nb_days)
def get_date_diff(date_a, date_b):
return abs((date_b - date_a).total_seconds())
def get_date_string_with_timezone(date_string, timezone):
... | Add helper to handle timezone in date strings | [utils] Add helper to handle timezone in date strings
| Python | agpl-3.0 | cgwire/zou | from datetime import date, timedelta
def get_date_from_now(nb_days):
return date.today() - timedelta(days=nb_days)
def get_date_diff(date_a, date_b):
return abs((date_b - date_a).total_seconds())
[utils] Add helper to handle timezone in date strings | from babel.dates import format_datetime
from datetime import date, datetime, timedelta
def get_date_from_now(nb_days):
return date.today() - timedelta(days=nb_days)
def get_date_diff(date_a, date_b):
return abs((date_b - date_a).total_seconds())
def get_date_string_with_timezone(date_string, timezone):
... | <commit_before>from datetime import date, timedelta
def get_date_from_now(nb_days):
return date.today() - timedelta(days=nb_days)
def get_date_diff(date_a, date_b):
return abs((date_b - date_a).total_seconds())
<commit_msg>[utils] Add helper to handle timezone in date strings<commit_after> | from babel.dates import format_datetime
from datetime import date, datetime, timedelta
def get_date_from_now(nb_days):
return date.today() - timedelta(days=nb_days)
def get_date_diff(date_a, date_b):
return abs((date_b - date_a).total_seconds())
def get_date_string_with_timezone(date_string, timezone):
... | from datetime import date, timedelta
def get_date_from_now(nb_days):
return date.today() - timedelta(days=nb_days)
def get_date_diff(date_a, date_b):
return abs((date_b - date_a).total_seconds())
[utils] Add helper to handle timezone in date stringsfrom babel.dates import format_datetime
from datetime impor... | <commit_before>from datetime import date, timedelta
def get_date_from_now(nb_days):
return date.today() - timedelta(days=nb_days)
def get_date_diff(date_a, date_b):
return abs((date_b - date_a).total_seconds())
<commit_msg>[utils] Add helper to handle timezone in date strings<commit_after>from babel.dates i... |
2f8206d5d2ef699b368d4e2b0c87f1f9d5b0dd64 | setup_extensions.py | setup_extensions.py | #!python3
from distutils.core import setup
from distutils.extension import Extension
from Cython.Build import cythonize
setup (
name = 'PyDoom rendering module',
ext_modules = cythonize (
[
Extension (
"pydoom.extensions.video",
["pydoom/extensions/video.pyx... | #!python3
from distutils.core import setup
from distutils.extension import Extension
from Cython.Build import cythonize
setup (
name = 'PyDoom rendering module',
ext_modules = cythonize (
[
Extension (
"pydoom.extensions.video",
["pydoom/extensions/video.pyx... | Use the generic names for these as well. | Use the generic names for these as well.
| Python | bsd-3-clause | Pink-Silver/PyDoom,Pink-Silver/PyDoom | #!python3
from distutils.core import setup
from distutils.extension import Extension
from Cython.Build import cythonize
setup (
name = 'PyDoom rendering module',
ext_modules = cythonize (
[
Extension (
"pydoom.extensions.video",
["pydoom/extensions/video.pyx... | #!python3
from distutils.core import setup
from distutils.extension import Extension
from Cython.Build import cythonize
setup (
name = 'PyDoom rendering module',
ext_modules = cythonize (
[
Extension (
"pydoom.extensions.video",
["pydoom/extensions/video.pyx... | <commit_before>#!python3
from distutils.core import setup
from distutils.extension import Extension
from Cython.Build import cythonize
setup (
name = 'PyDoom rendering module',
ext_modules = cythonize (
[
Extension (
"pydoom.extensions.video",
["pydoom/exten... | #!python3
from distutils.core import setup
from distutils.extension import Extension
from Cython.Build import cythonize
setup (
name = 'PyDoom rendering module',
ext_modules = cythonize (
[
Extension (
"pydoom.extensions.video",
["pydoom/extensions/video.pyx... | #!python3
from distutils.core import setup
from distutils.extension import Extension
from Cython.Build import cythonize
setup (
name = 'PyDoom rendering module',
ext_modules = cythonize (
[
Extension (
"pydoom.extensions.video",
["pydoom/extensions/video.pyx... | <commit_before>#!python3
from distutils.core import setup
from distutils.extension import Extension
from Cython.Build import cythonize
setup (
name = 'PyDoom rendering module',
ext_modules = cythonize (
[
Extension (
"pydoom.extensions.video",
["pydoom/exten... |
2df850a4fbe1d063134e53f93623d81da8fd3cda | dthm4kaiako/config/__init__.py | dthm4kaiako/config/__init__.py | """Configuration for Django system."""
__version__ = "0.17.1"
__version_info__ = tuple(
[
int(num) if num.isdigit() else num
for num in __version__.replace("-", ".", 1).split(".")
]
)
| """Configuration for Django system."""
__version__ = "0.17.2"
__version_info__ = tuple(
[
int(num) if num.isdigit() else num
for num in __version__.replace("-", ".", 1).split(".")
]
)
| Increment version number to 0.17.2 | Increment version number to 0.17.2
| Python | mit | uccser/cs4teachers,uccser/cs4teachers,uccser/cs4teachers,uccser/cs4teachers | """Configuration for Django system."""
__version__ = "0.17.1"
__version_info__ = tuple(
[
int(num) if num.isdigit() else num
for num in __version__.replace("-", ".", 1).split(".")
]
)
Increment version number to 0.17.2 | """Configuration for Django system."""
__version__ = "0.17.2"
__version_info__ = tuple(
[
int(num) if num.isdigit() else num
for num in __version__.replace("-", ".", 1).split(".")
]
)
| <commit_before>"""Configuration for Django system."""
__version__ = "0.17.1"
__version_info__ = tuple(
[
int(num) if num.isdigit() else num
for num in __version__.replace("-", ".", 1).split(".")
]
)
<commit_msg>Increment version number to 0.17.2<commit_after> | """Configuration for Django system."""
__version__ = "0.17.2"
__version_info__ = tuple(
[
int(num) if num.isdigit() else num
for num in __version__.replace("-", ".", 1).split(".")
]
)
| """Configuration for Django system."""
__version__ = "0.17.1"
__version_info__ = tuple(
[
int(num) if num.isdigit() else num
for num in __version__.replace("-", ".", 1).split(".")
]
)
Increment version number to 0.17.2"""Configuration for Django system."""
__version__ = "0.17.2"
__version_info... | <commit_before>"""Configuration for Django system."""
__version__ = "0.17.1"
__version_info__ = tuple(
[
int(num) if num.isdigit() else num
for num in __version__.replace("-", ".", 1).split(".")
]
)
<commit_msg>Increment version number to 0.17.2<commit_after>"""Configuration for Django system."... |
336cdd2619df5fe60a3b0a8a8a91b34b7c1b2ee4 | grokapi/queries.py | grokapi/queries.py | # -*- coding: utf-8 -*-
class Grok(object):
"""stats.grok.se article statistics."""
def __init__(self, title, site):
self.site = site
self.title = title
def _make_url(self, year, month):
"""Make the URL to the JSON output of stats.grok.se service."""
base_url = "http://s... | # -*- coding: utf-8 -*-
BASE_URL = "http://stats.grok.se/json/"
class Grok(object):
"""stats.grok.se article statistics."""
def __init__(self, title, site):
self.site = site
self.title = title
def _make_url(self, year, month):
"""Make the URL to the JSON output of stats.grok.se... | Make base_url a global variable | Make base_url a global variable
| Python | mit | Commonists/Grokapi | # -*- coding: utf-8 -*-
class Grok(object):
"""stats.grok.se article statistics."""
def __init__(self, title, site):
self.site = site
self.title = title
def _make_url(self, year, month):
"""Make the URL to the JSON output of stats.grok.se service."""
base_url = "http://s... | # -*- coding: utf-8 -*-
BASE_URL = "http://stats.grok.se/json/"
class Grok(object):
"""stats.grok.se article statistics."""
def __init__(self, title, site):
self.site = site
self.title = title
def _make_url(self, year, month):
"""Make the URL to the JSON output of stats.grok.se... | <commit_before># -*- coding: utf-8 -*-
class Grok(object):
"""stats.grok.se article statistics."""
def __init__(self, title, site):
self.site = site
self.title = title
def _make_url(self, year, month):
"""Make the URL to the JSON output of stats.grok.se service."""
base_... | # -*- coding: utf-8 -*-
BASE_URL = "http://stats.grok.se/json/"
class Grok(object):
"""stats.grok.se article statistics."""
def __init__(self, title, site):
self.site = site
self.title = title
def _make_url(self, year, month):
"""Make the URL to the JSON output of stats.grok.se... | # -*- coding: utf-8 -*-
class Grok(object):
"""stats.grok.se article statistics."""
def __init__(self, title, site):
self.site = site
self.title = title
def _make_url(self, year, month):
"""Make the URL to the JSON output of stats.grok.se service."""
base_url = "http://s... | <commit_before># -*- coding: utf-8 -*-
class Grok(object):
"""stats.grok.se article statistics."""
def __init__(self, title, site):
self.site = site
self.title = title
def _make_url(self, year, month):
"""Make the URL to the JSON output of stats.grok.se service."""
base_... |
538f4b2d0e030a9256ecd68eaf0a1a2e5d649f49 | haas/tests/mocks.py | haas/tests/mocks.py | import itertools
import traceback
class MockDateTime(object):
def __init__(self, ret):
try:
self.ret = iter(ret)
except TypeError:
self.ret = iter(itertools.repeat(ret))
def utcnow(self):
return next(self.ret)
| class MockDateTime(object):
def __init__(self, ret):
try:
self.ret = iter(ret)
except TypeError:
self.ret = iter((ret,))
def utcnow(self):
try:
return next(self.ret)
except StopIteration:
raise ValueError('No more mock values!')
| Raise error in mock if there are not enough mock datetime values | Raise error in mock if there are not enough mock datetime values
| Python | bsd-3-clause | sjagoe/haas,itziakos/haas,itziakos/haas,scalative/haas,sjagoe/haas,scalative/haas | import itertools
import traceback
class MockDateTime(object):
def __init__(self, ret):
try:
self.ret = iter(ret)
except TypeError:
self.ret = iter(itertools.repeat(ret))
def utcnow(self):
return next(self.ret)
Raise error in mock if there are not enough mock da... | class MockDateTime(object):
def __init__(self, ret):
try:
self.ret = iter(ret)
except TypeError:
self.ret = iter((ret,))
def utcnow(self):
try:
return next(self.ret)
except StopIteration:
raise ValueError('No more mock values!')
| <commit_before>import itertools
import traceback
class MockDateTime(object):
def __init__(self, ret):
try:
self.ret = iter(ret)
except TypeError:
self.ret = iter(itertools.repeat(ret))
def utcnow(self):
return next(self.ret)
<commit_msg>Raise error in mock if t... | class MockDateTime(object):
def __init__(self, ret):
try:
self.ret = iter(ret)
except TypeError:
self.ret = iter((ret,))
def utcnow(self):
try:
return next(self.ret)
except StopIteration:
raise ValueError('No more mock values!')
| import itertools
import traceback
class MockDateTime(object):
def __init__(self, ret):
try:
self.ret = iter(ret)
except TypeError:
self.ret = iter(itertools.repeat(ret))
def utcnow(self):
return next(self.ret)
Raise error in mock if there are not enough mock da... | <commit_before>import itertools
import traceback
class MockDateTime(object):
def __init__(self, ret):
try:
self.ret = iter(ret)
except TypeError:
self.ret = iter(itertools.repeat(ret))
def utcnow(self):
return next(self.ret)
<commit_msg>Raise error in mock if t... |
2141e4fd2b09d3a8a95e032fb02eafb9e6f818c9 | i3pystatus/shell.py | i3pystatus/shell.py | from i3pystatus import IntervalModule
from subprocess import check_output, CalledProcessError
class Shell(IntervalModule):
"""
Shows output of shell command
"""
color = "#FFFFFF"
error_color = "#FF0000"
settings = (
("command", "command to be executed"),
("color", "standard co... | from i3pystatus import IntervalModule
from subprocess import check_output, CalledProcessError
class Shell(IntervalModule):
"""
Shows output of shell command
"""
color = "#FFFFFF"
error_color = "#FF0000"
settings = (
("command", "command to be executed"),
("color", "standard co... | Add exception handling for output | Add exception handling for output
| Python | mit | opatut/i3pystatus,teto/i3pystatus,schroeji/i3pystatus,ncoop/i3pystatus,juliushaertl/i3pystatus,m45t3r/i3pystatus,richese/i3pystatus,claria/i3pystatus,ncoop/i3pystatus,paulollivier/i3pystatus,paulollivier/i3pystatus,ismaelpuerto/i3pystatus,asmikhailov/i3pystatus,eBrnd/i3pystatus,fmarchenko/i3pystatus,plumps/i3pystatus,o... | from i3pystatus import IntervalModule
from subprocess import check_output, CalledProcessError
class Shell(IntervalModule):
"""
Shows output of shell command
"""
color = "#FFFFFF"
error_color = "#FF0000"
settings = (
("command", "command to be executed"),
("color", "standard co... | from i3pystatus import IntervalModule
from subprocess import check_output, CalledProcessError
class Shell(IntervalModule):
"""
Shows output of shell command
"""
color = "#FFFFFF"
error_color = "#FF0000"
settings = (
("command", "command to be executed"),
("color", "standard co... | <commit_before>from i3pystatus import IntervalModule
from subprocess import check_output, CalledProcessError
class Shell(IntervalModule):
"""
Shows output of shell command
"""
color = "#FFFFFF"
error_color = "#FF0000"
settings = (
("command", "command to be executed"),
("color... | from i3pystatus import IntervalModule
from subprocess import check_output, CalledProcessError
class Shell(IntervalModule):
"""
Shows output of shell command
"""
color = "#FFFFFF"
error_color = "#FF0000"
settings = (
("command", "command to be executed"),
("color", "standard co... | from i3pystatus import IntervalModule
from subprocess import check_output, CalledProcessError
class Shell(IntervalModule):
"""
Shows output of shell command
"""
color = "#FFFFFF"
error_color = "#FF0000"
settings = (
("command", "command to be executed"),
("color", "standard co... | <commit_before>from i3pystatus import IntervalModule
from subprocess import check_output, CalledProcessError
class Shell(IntervalModule):
"""
Shows output of shell command
"""
color = "#FFFFFF"
error_color = "#FF0000"
settings = (
("command", "command to be executed"),
("color... |
2477822fa7589e4968465b56e77885378d30bbc5 | first/polls/admin.py | first/polls/admin.py | from django.contrib import admin
from .models import Choice, Question
# Register your models here.
class QuestionAdmin(admin.ModelAdmin):
fieldsets = [
(None, {'fields': ['question_text']}),
('Date information', {'fields': ['pub_date']}),
]
admin.site.register(Question, QuestionA... | from django.contrib import admin
from .models import Choice, Question
# Register your models here.
class ChoiceInline(admin.StackedInline):
model = Choice
extra = 3
class QuestionAdmin(admin.ModelAdmin):
fieldsets = [
(None, {'fields': ['question_text']}),
('Date information... | Make Choice object editable on Question Admin page | Make Choice object editable on Question Admin page
| Python | mit | ugaliguy/Django-Tutorial-Projects,ugaliguy/Django-Tutorial-Projects | from django.contrib import admin
from .models import Choice, Question
# Register your models here.
class QuestionAdmin(admin.ModelAdmin):
fieldsets = [
(None, {'fields': ['question_text']}),
('Date information', {'fields': ['pub_date']}),
]
admin.site.register(Question, QuestionA... | from django.contrib import admin
from .models import Choice, Question
# Register your models here.
class ChoiceInline(admin.StackedInline):
model = Choice
extra = 3
class QuestionAdmin(admin.ModelAdmin):
fieldsets = [
(None, {'fields': ['question_text']}),
('Date information... | <commit_before>from django.contrib import admin
from .models import Choice, Question
# Register your models here.
class QuestionAdmin(admin.ModelAdmin):
fieldsets = [
(None, {'fields': ['question_text']}),
('Date information', {'fields': ['pub_date']}),
]
admin.site.register(Ques... | from django.contrib import admin
from .models import Choice, Question
# Register your models here.
class ChoiceInline(admin.StackedInline):
model = Choice
extra = 3
class QuestionAdmin(admin.ModelAdmin):
fieldsets = [
(None, {'fields': ['question_text']}),
('Date information... | from django.contrib import admin
from .models import Choice, Question
# Register your models here.
class QuestionAdmin(admin.ModelAdmin):
fieldsets = [
(None, {'fields': ['question_text']}),
('Date information', {'fields': ['pub_date']}),
]
admin.site.register(Question, QuestionA... | <commit_before>from django.contrib import admin
from .models import Choice, Question
# Register your models here.
class QuestionAdmin(admin.ModelAdmin):
fieldsets = [
(None, {'fields': ['question_text']}),
('Date information', {'fields': ['pub_date']}),
]
admin.site.register(Ques... |
b32b047656abd28dd794ee16dfab682337a753b1 | accounts/tests.py | accounts/tests.py | from django.test import TestCase
# Create your tests here.
| """accounts app unittests
"""
from django.test import TestCase
class WelcomePageTest(TestCase):
def test_uses_welcome_template(self):
response = self.client.get('/')
self.assertTemplateUsed(response, 'accounts/welcome.html')
| Add first unit test for welcome page | Add first unit test for welcome page
| Python | mit | randomic/aniauth-tdd,randomic/aniauth-tdd | from django.test import TestCase
# Create your tests here.
Add first unit test for welcome page | """accounts app unittests
"""
from django.test import TestCase
class WelcomePageTest(TestCase):
def test_uses_welcome_template(self):
response = self.client.get('/')
self.assertTemplateUsed(response, 'accounts/welcome.html')
| <commit_before>from django.test import TestCase
# Create your tests here.
<commit_msg>Add first unit test for welcome page<commit_after> | """accounts app unittests
"""
from django.test import TestCase
class WelcomePageTest(TestCase):
def test_uses_welcome_template(self):
response = self.client.get('/')
self.assertTemplateUsed(response, 'accounts/welcome.html')
| from django.test import TestCase
# Create your tests here.
Add first unit test for welcome page"""accounts app unittests
"""
from django.test import TestCase
class WelcomePageTest(TestCase):
def test_uses_welcome_template(self):
response = self.client.get('/')
self.assertTemplateUsed(response, '... | <commit_before>from django.test import TestCase
# Create your tests here.
<commit_msg>Add first unit test for welcome page<commit_after>"""accounts app unittests
"""
from django.test import TestCase
class WelcomePageTest(TestCase):
def test_uses_welcome_template(self):
response = self.client.get('/')
... |
bd4643e35a9c75d15bb6a4bfef63774fdd8bee5b | test/regress/cbrt.cpp.py | test/regress/cbrt.cpp.py | #!/usr/bin/python
import shtest, sys, math
def cbrt(l, types=[]):
return shtest.make_test([math.pow(x, 1/3.0) for x in l], [l], types)
def insert_into(test):
test.add_test(cbrt((0.0, 1.0, 2.0, 3.0)))
test.add_test(cbrt((1.0,)))
test.add_make_test((3,), [(27,)], ['i', 'i'])
# Test the cube root in st... | #!/usr/bin/python
import shtest, sys, math
def cbrt(l, types=[]):
return shtest.make_test([math.pow(x, 1/3.0) for x in l], [l], types)
def insert_into(test):
test.add_test(cbrt((0.0, 1.0, 2.0, 3.0)))
test.add_test(cbrt((1.0,)))
test.add_test(cbrt((4000.2, 27)))
#test.add_make_test((3,), [(27,)], ... | Add a typical 2-component case. Comment out a case that fail until integer support is fixed. | Add a typical 2-component case.
Comment out a case that fail until integer support is fixed.
git-svn-id: f6f47f0a6375c1440c859a5b92b3b3fbb75bb58e@2508 afdca40c-03d6-0310-8ede-e9f093b21075
| Python | lgpl-2.1 | libsh-archive/sh,libsh-archive/sh,libsh-archive/sh,libsh-archive/sh,libsh-archive/sh,libsh-archive/sh | #!/usr/bin/python
import shtest, sys, math
def cbrt(l, types=[]):
return shtest.make_test([math.pow(x, 1/3.0) for x in l], [l], types)
def insert_into(test):
test.add_test(cbrt((0.0, 1.0, 2.0, 3.0)))
test.add_test(cbrt((1.0,)))
test.add_make_test((3,), [(27,)], ['i', 'i'])
# Test the cube root in st... | #!/usr/bin/python
import shtest, sys, math
def cbrt(l, types=[]):
return shtest.make_test([math.pow(x, 1/3.0) for x in l], [l], types)
def insert_into(test):
test.add_test(cbrt((0.0, 1.0, 2.0, 3.0)))
test.add_test(cbrt((1.0,)))
test.add_test(cbrt((4000.2, 27)))
#test.add_make_test((3,), [(27,)], ... | <commit_before>#!/usr/bin/python
import shtest, sys, math
def cbrt(l, types=[]):
return shtest.make_test([math.pow(x, 1/3.0) for x in l], [l], types)
def insert_into(test):
test.add_test(cbrt((0.0, 1.0, 2.0, 3.0)))
test.add_test(cbrt((1.0,)))
test.add_make_test((3,), [(27,)], ['i', 'i'])
# Test the ... | #!/usr/bin/python
import shtest, sys, math
def cbrt(l, types=[]):
return shtest.make_test([math.pow(x, 1/3.0) for x in l], [l], types)
def insert_into(test):
test.add_test(cbrt((0.0, 1.0, 2.0, 3.0)))
test.add_test(cbrt((1.0,)))
test.add_test(cbrt((4000.2, 27)))
#test.add_make_test((3,), [(27,)], ... | #!/usr/bin/python
import shtest, sys, math
def cbrt(l, types=[]):
return shtest.make_test([math.pow(x, 1/3.0) for x in l], [l], types)
def insert_into(test):
test.add_test(cbrt((0.0, 1.0, 2.0, 3.0)))
test.add_test(cbrt((1.0,)))
test.add_make_test((3,), [(27,)], ['i', 'i'])
# Test the cube root in st... | <commit_before>#!/usr/bin/python
import shtest, sys, math
def cbrt(l, types=[]):
return shtest.make_test([math.pow(x, 1/3.0) for x in l], [l], types)
def insert_into(test):
test.add_test(cbrt((0.0, 1.0, 2.0, 3.0)))
test.add_test(cbrt((1.0,)))
test.add_make_test((3,), [(27,)], ['i', 'i'])
# Test the ... |
0b0b25da0b43166dfca4a95930bed3409dfb7ba1 | tests/test_parse.py | tests/test_parse.py | from . import TestCase
import bitmath
class TestBasicMath(TestCase):
def test_b(self):
self.assertEqual(
bitmath.parse_string("123b"),
bitmath.Bit(123))
def test_B(self):
self.assertEqual(
bitmath.parse_string("321B"),
bitmath.Byte(321))
def... | from . import TestCase
import bitmath
class TestParse(TestCase):
def test_b(self):
self.assertEqual(
bitmath.parse_string("123b"),
bitmath.Bit(123))
def test_B(self):
self.assertEqual(
bitmath.parse_string("321B"),
bitmath.Byte(321))
def tes... | Fix oops with test case copy/pasta. | Fix oops with test case copy/pasta.
| Python | mit | tbielawa/bitmath,pombredanne/bitmath,pombredanne/bitmath,tbielawa/bitmath | from . import TestCase
import bitmath
class TestBasicMath(TestCase):
def test_b(self):
self.assertEqual(
bitmath.parse_string("123b"),
bitmath.Bit(123))
def test_B(self):
self.assertEqual(
bitmath.parse_string("321B"),
bitmath.Byte(321))
def... | from . import TestCase
import bitmath
class TestParse(TestCase):
def test_b(self):
self.assertEqual(
bitmath.parse_string("123b"),
bitmath.Bit(123))
def test_B(self):
self.assertEqual(
bitmath.parse_string("321B"),
bitmath.Byte(321))
def tes... | <commit_before>from . import TestCase
import bitmath
class TestBasicMath(TestCase):
def test_b(self):
self.assertEqual(
bitmath.parse_string("123b"),
bitmath.Bit(123))
def test_B(self):
self.assertEqual(
bitmath.parse_string("321B"),
bitmath.Byte... | from . import TestCase
import bitmath
class TestParse(TestCase):
def test_b(self):
self.assertEqual(
bitmath.parse_string("123b"),
bitmath.Bit(123))
def test_B(self):
self.assertEqual(
bitmath.parse_string("321B"),
bitmath.Byte(321))
def tes... | from . import TestCase
import bitmath
class TestBasicMath(TestCase):
def test_b(self):
self.assertEqual(
bitmath.parse_string("123b"),
bitmath.Bit(123))
def test_B(self):
self.assertEqual(
bitmath.parse_string("321B"),
bitmath.Byte(321))
def... | <commit_before>from . import TestCase
import bitmath
class TestBasicMath(TestCase):
def test_b(self):
self.assertEqual(
bitmath.parse_string("123b"),
bitmath.Bit(123))
def test_B(self):
self.assertEqual(
bitmath.parse_string("321B"),
bitmath.Byte... |
dc622e41059c75da619f90423e35c35d8a3730d4 | tests/test_qccfg.py | tests/test_qccfg.py | import numpy as np
from seabird import cnv
import cotede.qc
from cotede.utils.supportdata import download_testdata
def test_multiple_cfg():
""" I should think about a way to test if the output make sense.
"""
datafile = download_testdata("dPIRX010.cnv")
data = cnv.fCNV(datafile)
pqc = cotede.qc.... |
import pkg_resources
import json
import numpy as np
from seabird import cnv
import cotede.qc
from cotede.utils.supportdata import download_testdata
def test_cfg_json():
""" All config files should comply with json format
In the future, when move load cfg outside, refactor here.
"""
cfgfiles = ... | Test if all QC cfg are proper json files. | Test if all QC cfg are proper json files.
| Python | bsd-3-clause | castelao/CoTeDe | import numpy as np
from seabird import cnv
import cotede.qc
from cotede.utils.supportdata import download_testdata
def test_multiple_cfg():
""" I should think about a way to test if the output make sense.
"""
datafile = download_testdata("dPIRX010.cnv")
data = cnv.fCNV(datafile)
pqc = cotede.qc.... |
import pkg_resources
import json
import numpy as np
from seabird import cnv
import cotede.qc
from cotede.utils.supportdata import download_testdata
def test_cfg_json():
""" All config files should comply with json format
In the future, when move load cfg outside, refactor here.
"""
cfgfiles = ... | <commit_before>import numpy as np
from seabird import cnv
import cotede.qc
from cotede.utils.supportdata import download_testdata
def test_multiple_cfg():
""" I should think about a way to test if the output make sense.
"""
datafile = download_testdata("dPIRX010.cnv")
data = cnv.fCNV(datafile)
p... |
import pkg_resources
import json
import numpy as np
from seabird import cnv
import cotede.qc
from cotede.utils.supportdata import download_testdata
def test_cfg_json():
""" All config files should comply with json format
In the future, when move load cfg outside, refactor here.
"""
cfgfiles = ... | import numpy as np
from seabird import cnv
import cotede.qc
from cotede.utils.supportdata import download_testdata
def test_multiple_cfg():
""" I should think about a way to test if the output make sense.
"""
datafile = download_testdata("dPIRX010.cnv")
data = cnv.fCNV(datafile)
pqc = cotede.qc.... | <commit_before>import numpy as np
from seabird import cnv
import cotede.qc
from cotede.utils.supportdata import download_testdata
def test_multiple_cfg():
""" I should think about a way to test if the output make sense.
"""
datafile = download_testdata("dPIRX010.cnv")
data = cnv.fCNV(datafile)
p... |
8eb66d72452d69d683a576c75cdf2be72b2370fa | tests/test_utils.py | tests/test_utils.py | import pytest
from mangacork import utils
@pytest.fixture
def sample_page_bad_format():
sample_page = {'chapter': "chapter1", 'page': 3}
return sample_page
@pytest.fixture
def sample_page_good_format():
sample_page = {'chapter':'manga_ch1', 'page':'x_v001-001'}
return sample_page
def test_build_img... | import pytest
from mangacork import utils
@pytest.fixture
def sample_page_bad_format():
sample_page = {'chapter': "chapter1", 'page': 3}
return sample_page
@pytest.fixture
def sample_page_good_format():
sample_page = {'chapter':'manga_ch1', 'page':'x_v001-001'}
return sample_page
def test_build_img_... | Add test for inc page num, good format | Add test for inc page num, good format
| Python | mit | ma3lstrom/manga-cork,ma3lstrom/manga-cork,ma3lstrom/manga-cork | import pytest
from mangacork import utils
@pytest.fixture
def sample_page_bad_format():
sample_page = {'chapter': "chapter1", 'page': 3}
return sample_page
@pytest.fixture
def sample_page_good_format():
sample_page = {'chapter':'manga_ch1', 'page':'x_v001-001'}
return sample_page
def test_build_img... | import pytest
from mangacork import utils
@pytest.fixture
def sample_page_bad_format():
sample_page = {'chapter': "chapter1", 'page': 3}
return sample_page
@pytest.fixture
def sample_page_good_format():
sample_page = {'chapter':'manga_ch1', 'page':'x_v001-001'}
return sample_page
def test_build_img_... | <commit_before>import pytest
from mangacork import utils
@pytest.fixture
def sample_page_bad_format():
sample_page = {'chapter': "chapter1", 'page': 3}
return sample_page
@pytest.fixture
def sample_page_good_format():
sample_page = {'chapter':'manga_ch1', 'page':'x_v001-001'}
return sample_page
def... | import pytest
from mangacork import utils
@pytest.fixture
def sample_page_bad_format():
sample_page = {'chapter': "chapter1", 'page': 3}
return sample_page
@pytest.fixture
def sample_page_good_format():
sample_page = {'chapter':'manga_ch1', 'page':'x_v001-001'}
return sample_page
def test_build_img_... | import pytest
from mangacork import utils
@pytest.fixture
def sample_page_bad_format():
sample_page = {'chapter': "chapter1", 'page': 3}
return sample_page
@pytest.fixture
def sample_page_good_format():
sample_page = {'chapter':'manga_ch1', 'page':'x_v001-001'}
return sample_page
def test_build_img... | <commit_before>import pytest
from mangacork import utils
@pytest.fixture
def sample_page_bad_format():
sample_page = {'chapter': "chapter1", 'page': 3}
return sample_page
@pytest.fixture
def sample_page_good_format():
sample_page = {'chapter':'manga_ch1', 'page':'x_v001-001'}
return sample_page
def... |
2ab601492a76be5d32a2e1d5009c150269e5fb03 | src/interviews/managers.py | src/interviews/managers.py | import logging
from datetime import timedelta
from django.db import models
from django.utils import timezone
from .google_analytics import get_most_read_pages
logger = logging.getLogger(__name__)
class InterviewManager(models.Manager):
def active(self, *args, **kwargs):
return super(InterviewManager, s... | import logging
from datetime import timedelta
from django.db import models
from django.utils import timezone
from .google_analytics import get_most_read_pages
logger = logging.getLogger(__name__)
class InterviewManager(models.Manager):
def active(self, *args, **kwargs):
return super(InterviewManager, s... | Order `most_read` queryset by slug. | Order `most_read` queryset by slug.
| Python | mit | vermpy/thespotlight,vermpy/thespotlight,vermpy/thespotlight | import logging
from datetime import timedelta
from django.db import models
from django.utils import timezone
from .google_analytics import get_most_read_pages
logger = logging.getLogger(__name__)
class InterviewManager(models.Manager):
def active(self, *args, **kwargs):
return super(InterviewManager, s... | import logging
from datetime import timedelta
from django.db import models
from django.utils import timezone
from .google_analytics import get_most_read_pages
logger = logging.getLogger(__name__)
class InterviewManager(models.Manager):
def active(self, *args, **kwargs):
return super(InterviewManager, s... | <commit_before>import logging
from datetime import timedelta
from django.db import models
from django.utils import timezone
from .google_analytics import get_most_read_pages
logger = logging.getLogger(__name__)
class InterviewManager(models.Manager):
def active(self, *args, **kwargs):
return super(Inte... | import logging
from datetime import timedelta
from django.db import models
from django.utils import timezone
from .google_analytics import get_most_read_pages
logger = logging.getLogger(__name__)
class InterviewManager(models.Manager):
def active(self, *args, **kwargs):
return super(InterviewManager, s... | import logging
from datetime import timedelta
from django.db import models
from django.utils import timezone
from .google_analytics import get_most_read_pages
logger = logging.getLogger(__name__)
class InterviewManager(models.Manager):
def active(self, *args, **kwargs):
return super(InterviewManager, s... | <commit_before>import logging
from datetime import timedelta
from django.db import models
from django.utils import timezone
from .google_analytics import get_most_read_pages
logger = logging.getLogger(__name__)
class InterviewManager(models.Manager):
def active(self, *args, **kwargs):
return super(Inte... |
e42d20547add5b92df8c8ce56bb2340b7b63ced9 | timpani/settings.py | timpani/settings.py | from . import database
def getAllSettings():
databaseConnection = database.ConnectionManager.getConnection("main")
query = databaseConnection.session.query(database.tables.Setting)
settings = query.all()
return {setting.name: setting.value for setting in settings}
def getSettingValue(name):
databaseConnection = ... | from . import database
def getAllSettings():
databaseConnection = database.ConnectionManager.getConnection("main")
query = databaseConnection.session.query(database.tables.Setting)
settings = query.all()
return {setting.name: setting.value for setting in settings}
def getSettingValue(name):
databaseConnection = ... | Add validation display_name and theme | Add validation display_name and theme
| Python | mit | ollien/Timpani,ollien/Timpani,ollien/Timpani | from . import database
def getAllSettings():
databaseConnection = database.ConnectionManager.getConnection("main")
query = databaseConnection.session.query(database.tables.Setting)
settings = query.all()
return {setting.name: setting.value for setting in settings}
def getSettingValue(name):
databaseConnection = ... | from . import database
def getAllSettings():
databaseConnection = database.ConnectionManager.getConnection("main")
query = databaseConnection.session.query(database.tables.Setting)
settings = query.all()
return {setting.name: setting.value for setting in settings}
def getSettingValue(name):
databaseConnection = ... | <commit_before>from . import database
def getAllSettings():
databaseConnection = database.ConnectionManager.getConnection("main")
query = databaseConnection.session.query(database.tables.Setting)
settings = query.all()
return {setting.name: setting.value for setting in settings}
def getSettingValue(name):
databa... | from . import database
def getAllSettings():
databaseConnection = database.ConnectionManager.getConnection("main")
query = databaseConnection.session.query(database.tables.Setting)
settings = query.all()
return {setting.name: setting.value for setting in settings}
def getSettingValue(name):
databaseConnection = ... | from . import database
def getAllSettings():
databaseConnection = database.ConnectionManager.getConnection("main")
query = databaseConnection.session.query(database.tables.Setting)
settings = query.all()
return {setting.name: setting.value for setting in settings}
def getSettingValue(name):
databaseConnection = ... | <commit_before>from . import database
def getAllSettings():
databaseConnection = database.ConnectionManager.getConnection("main")
query = databaseConnection.session.query(database.tables.Setting)
settings = query.all()
return {setting.name: setting.value for setting in settings}
def getSettingValue(name):
databa... |
753545cd10aa455ec0912843820e26d5c4903c8e | unleash/plugins/tox_tests.py | unleash/plugins/tox_tests.py | from click import Option
import subprocess
from unleash.util import VirtualEnv
from .utils_tree import in_tmpexport
PLUGIN_NAME = 'tox_tests'
def setup(cli):
cli.commands['release'].params.append(Option(
['--tests/--no-tests', '-t/-T'], default=True,
help='Run unittests (default: enabled).'
... | from click import Option
import subprocess
from unleash.util import VirtualEnv
from .utils_tree import in_tmpexport
PLUGIN_NAME = 'tox_tests'
def setup(cli):
cli.commands['release'].params.append(Option(
['--tests/--no-tests', '-t/-T'], default=True,
help='Run unittests (default: enabled).'
... | Use get_binary in tox tests. | Use get_binary in tox tests.
| Python | mit | mbr/unleash | from click import Option
import subprocess
from unleash.util import VirtualEnv
from .utils_tree import in_tmpexport
PLUGIN_NAME = 'tox_tests'
def setup(cli):
cli.commands['release'].params.append(Option(
['--tests/--no-tests', '-t/-T'], default=True,
help='Run unittests (default: enabled).'
... | from click import Option
import subprocess
from unleash.util import VirtualEnv
from .utils_tree import in_tmpexport
PLUGIN_NAME = 'tox_tests'
def setup(cli):
cli.commands['release'].params.append(Option(
['--tests/--no-tests', '-t/-T'], default=True,
help='Run unittests (default: enabled).'
... | <commit_before>from click import Option
import subprocess
from unleash.util import VirtualEnv
from .utils_tree import in_tmpexport
PLUGIN_NAME = 'tox_tests'
def setup(cli):
cli.commands['release'].params.append(Option(
['--tests/--no-tests', '-t/-T'], default=True,
help='Run unittests (default:... | from click import Option
import subprocess
from unleash.util import VirtualEnv
from .utils_tree import in_tmpexport
PLUGIN_NAME = 'tox_tests'
def setup(cli):
cli.commands['release'].params.append(Option(
['--tests/--no-tests', '-t/-T'], default=True,
help='Run unittests (default: enabled).'
... | from click import Option
import subprocess
from unleash.util import VirtualEnv
from .utils_tree import in_tmpexport
PLUGIN_NAME = 'tox_tests'
def setup(cli):
cli.commands['release'].params.append(Option(
['--tests/--no-tests', '-t/-T'], default=True,
help='Run unittests (default: enabled).'
... | <commit_before>from click import Option
import subprocess
from unleash.util import VirtualEnv
from .utils_tree import in_tmpexport
PLUGIN_NAME = 'tox_tests'
def setup(cli):
cli.commands['release'].params.append(Option(
['--tests/--no-tests', '-t/-T'], default=True,
help='Run unittests (default:... |
de8451c1c9d4122cfae6edeae4e17e11c21b4580 | Core/src/org/sleuthkit/autopsy/examples/reportmodule.py | Core/src/org/sleuthkit/autopsy/examples/reportmodule.py | from java.lang import System
from org.sleuthkit.autopsy.casemodule import Case
from org.sleuthkit.datamodel import SleuthkitCase
from org.sleuthkit.autopsy.report import GeneralReportModuleAdapter
class SampleGeneralReportModule(GeneralReportModuleAdapter):
def getName(self):
return "Sample Report Module"... | from java.lang import System
from org.sleuthkit.autopsy.casemodule import Case
from org.sleuthkit.datamodel import SleuthkitCase
from org.sleuthkit.autopsy.report import GeneralReportModuleAdapter
class SampleGeneralReportModule(GeneralReportModuleAdapter):
def getName(self):
return "Sample Report Module"... | Update sample Python report module for ReportModule interface API change | Update sample Python report module for ReportModule interface API change
| Python | apache-2.0 | millmanorama/autopsy,APriestman/autopsy,karlmortensen/autopsy,rcordovano/autopsy,eXcomm/autopsy,millmanorama/autopsy,sidheshenator/autopsy,esaunders/autopsy,APriestman/autopsy,mhmdfy/autopsy,dgrove727/autopsy,esaunders/autopsy,karlmortensen/autopsy,sidheshenator/autopsy,eXcomm/autopsy,esaunders/autopsy,dgrove727/autops... | from java.lang import System
from org.sleuthkit.autopsy.casemodule import Case
from org.sleuthkit.datamodel import SleuthkitCase
from org.sleuthkit.autopsy.report import GeneralReportModuleAdapter
class SampleGeneralReportModule(GeneralReportModuleAdapter):
def getName(self):
return "Sample Report Module"... | from java.lang import System
from org.sleuthkit.autopsy.casemodule import Case
from org.sleuthkit.datamodel import SleuthkitCase
from org.sleuthkit.autopsy.report import GeneralReportModuleAdapter
class SampleGeneralReportModule(GeneralReportModuleAdapter):
def getName(self):
return "Sample Report Module"... | <commit_before>from java.lang import System
from org.sleuthkit.autopsy.casemodule import Case
from org.sleuthkit.datamodel import SleuthkitCase
from org.sleuthkit.autopsy.report import GeneralReportModuleAdapter
class SampleGeneralReportModule(GeneralReportModuleAdapter):
def getName(self):
return "Sample... | from java.lang import System
from org.sleuthkit.autopsy.casemodule import Case
from org.sleuthkit.datamodel import SleuthkitCase
from org.sleuthkit.autopsy.report import GeneralReportModuleAdapter
class SampleGeneralReportModule(GeneralReportModuleAdapter):
def getName(self):
return "Sample Report Module"... | from java.lang import System
from org.sleuthkit.autopsy.casemodule import Case
from org.sleuthkit.datamodel import SleuthkitCase
from org.sleuthkit.autopsy.report import GeneralReportModuleAdapter
class SampleGeneralReportModule(GeneralReportModuleAdapter):
def getName(self):
return "Sample Report Module"... | <commit_before>from java.lang import System
from org.sleuthkit.autopsy.casemodule import Case
from org.sleuthkit.datamodel import SleuthkitCase
from org.sleuthkit.autopsy.report import GeneralReportModuleAdapter
class SampleGeneralReportModule(GeneralReportModuleAdapter):
def getName(self):
return "Sample... |
69f1013a11e540a93b1afff9da819d5f8028078a | utils/lit/tests/xunit-output.py | utils/lit/tests/xunit-output.py | # Check xunit output
# RUN: rm -rf %t.xunit.xml
# RUN: not %{lit} --xunit-xml-output %t.xunit.xml %{inputs}/xunit-output
# If xmllint is installed verify that the generated xml is well-formed
# RUN: sh -c 'if command -v xmllint 2>/dev/null; then xmllint --noout %t.xunit.xml; fi'
# RUN: FileCheck < %t.xunit.xml %s
# CH... | # REQUIRES: shell
# Check xunit output
# RUN: rm -rf %t.xunit.xml
# RUN: not %{lit} --xunit-xml-output %t.xunit.xml %{inputs}/xunit-output
# If xmllint is installed verify that the generated xml is well-formed
# RUN: sh -c 'if command -v xmllint 2>/dev/null; then xmllint --noout %t.xunit.xml; fi'
# RUN: FileCheck < %t... | Mark test with "REQUIRES: shell" since it directly invokes "sh" and was failing on Windows. | Mark test with "REQUIRES: shell" since it directly invokes "sh" and was failing on Windows.
git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@332563 91177308-0d34-0410-b5e6-96231b3b80d8
| Python | apache-2.0 | apple/swift-llvm,apple/swift-llvm,apple/swift-llvm,llvm-mirror/llvm,llvm-mirror/llvm,apple/swift-llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,apple/swift-llvm,llvm-mirror/llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,llvm-mirror/llvm,llvm-mirror/llvm,llvm-mirror/llvm,GPUOpen-Drivers/llv... | # Check xunit output
# RUN: rm -rf %t.xunit.xml
# RUN: not %{lit} --xunit-xml-output %t.xunit.xml %{inputs}/xunit-output
# If xmllint is installed verify that the generated xml is well-formed
# RUN: sh -c 'if command -v xmllint 2>/dev/null; then xmllint --noout %t.xunit.xml; fi'
# RUN: FileCheck < %t.xunit.xml %s
# CH... | # REQUIRES: shell
# Check xunit output
# RUN: rm -rf %t.xunit.xml
# RUN: not %{lit} --xunit-xml-output %t.xunit.xml %{inputs}/xunit-output
# If xmllint is installed verify that the generated xml is well-formed
# RUN: sh -c 'if command -v xmllint 2>/dev/null; then xmllint --noout %t.xunit.xml; fi'
# RUN: FileCheck < %t... | <commit_before># Check xunit output
# RUN: rm -rf %t.xunit.xml
# RUN: not %{lit} --xunit-xml-output %t.xunit.xml %{inputs}/xunit-output
# If xmllint is installed verify that the generated xml is well-formed
# RUN: sh -c 'if command -v xmllint 2>/dev/null; then xmllint --noout %t.xunit.xml; fi'
# RUN: FileCheck < %t.xun... | # REQUIRES: shell
# Check xunit output
# RUN: rm -rf %t.xunit.xml
# RUN: not %{lit} --xunit-xml-output %t.xunit.xml %{inputs}/xunit-output
# If xmllint is installed verify that the generated xml is well-formed
# RUN: sh -c 'if command -v xmllint 2>/dev/null; then xmllint --noout %t.xunit.xml; fi'
# RUN: FileCheck < %t... | # Check xunit output
# RUN: rm -rf %t.xunit.xml
# RUN: not %{lit} --xunit-xml-output %t.xunit.xml %{inputs}/xunit-output
# If xmllint is installed verify that the generated xml is well-formed
# RUN: sh -c 'if command -v xmllint 2>/dev/null; then xmllint --noout %t.xunit.xml; fi'
# RUN: FileCheck < %t.xunit.xml %s
# CH... | <commit_before># Check xunit output
# RUN: rm -rf %t.xunit.xml
# RUN: not %{lit} --xunit-xml-output %t.xunit.xml %{inputs}/xunit-output
# If xmllint is installed verify that the generated xml is well-formed
# RUN: sh -c 'if command -v xmllint 2>/dev/null; then xmllint --noout %t.xunit.xml; fi'
# RUN: FileCheck < %t.xun... |
92b13c26c216a6ced37017041242ad410890c406 | stats-to-datadog.py | stats-to-datadog.py | import urllib2
import json
import sys
from statsd import statsd
statsd.connect('localhost', 8125)
topology = sys.argv[1]
toporoot = sys.argv[2]
topic = sys.argv[3]
state = urllib2.urlopen(
"http://localhost:9000/api/status?toporoot={}&topic={}".format(
toporoot, topic
)
).read()
data = json.loads(st... | import urllib2
import json
import sys
from statsd import statsd
statsd.connect('localhost', 8125)
topology = sys.argv[1]
toporoot = sys.argv[2]
topic = sys.argv[3]
state = urllib2.urlopen(
"http://localhost:9000/api/status?toporoot={}&topic={}".format(
toporoot, topic
)
).read()
data = json.loads(st... | Print something from stats script so you can see it works! | Print something from stats script so you can see it works!
| Python | mit | evertrue/capillary,evertrue/capillary,keenlabs/capillary,evertrue/capillary,evertrue/capillary,keenlabs/capillary,keenlabs/capillary | import urllib2
import json
import sys
from statsd import statsd
statsd.connect('localhost', 8125)
topology = sys.argv[1]
toporoot = sys.argv[2]
topic = sys.argv[3]
state = urllib2.urlopen(
"http://localhost:9000/api/status?toporoot={}&topic={}".format(
toporoot, topic
)
).read()
data = json.loads(st... | import urllib2
import json
import sys
from statsd import statsd
statsd.connect('localhost', 8125)
topology = sys.argv[1]
toporoot = sys.argv[2]
topic = sys.argv[3]
state = urllib2.urlopen(
"http://localhost:9000/api/status?toporoot={}&topic={}".format(
toporoot, topic
)
).read()
data = json.loads(st... | <commit_before>import urllib2
import json
import sys
from statsd import statsd
statsd.connect('localhost', 8125)
topology = sys.argv[1]
toporoot = sys.argv[2]
topic = sys.argv[3]
state = urllib2.urlopen(
"http://localhost:9000/api/status?toporoot={}&topic={}".format(
toporoot, topic
)
).read()
data ... | import urllib2
import json
import sys
from statsd import statsd
statsd.connect('localhost', 8125)
topology = sys.argv[1]
toporoot = sys.argv[2]
topic = sys.argv[3]
state = urllib2.urlopen(
"http://localhost:9000/api/status?toporoot={}&topic={}".format(
toporoot, topic
)
).read()
data = json.loads(st... | import urllib2
import json
import sys
from statsd import statsd
statsd.connect('localhost', 8125)
topology = sys.argv[1]
toporoot = sys.argv[2]
topic = sys.argv[3]
state = urllib2.urlopen(
"http://localhost:9000/api/status?toporoot={}&topic={}".format(
toporoot, topic
)
).read()
data = json.loads(st... | <commit_before>import urllib2
import json
import sys
from statsd import statsd
statsd.connect('localhost', 8125)
topology = sys.argv[1]
toporoot = sys.argv[2]
topic = sys.argv[3]
state = urllib2.urlopen(
"http://localhost:9000/api/status?toporoot={}&topic={}".format(
toporoot, topic
)
).read()
data ... |
5dd758cd0b9b917968b16948db0f635db8571d92 | jsonfield/utils.py | jsonfield/utils.py | import datetime
from decimal import Decimal
from django.core.serializers.json import DjangoJSONEncoder
DATETIME = (datetime.datetime,)
DATE = (datetime.date,)
TIME = (datetime.time,)
try:
import freezegun.api
except ImportError:
pass
else:
DATETIME += (freezegun.api.FakeDatetime,)
DATE += (freezegun.... | import datetime
from decimal import Decimal
from django.core.serializers.json import DjangoJSONEncoder
class TZAwareJSONEncoder(DjangoJSONEncoder):
def default(self, obj):
if isinstance(obj, datetime.datetime):
return obj.strftime("%Y-%m-%d %H:%M:%S%z")
return super(TZAwareJSONEncoder,... | Revert changes: freezegun has been updated. | Revert changes: freezegun has been updated.
| Python | bsd-3-clause | chrismeyersfsu/django-jsonfield | import datetime
from decimal import Decimal
from django.core.serializers.json import DjangoJSONEncoder
DATETIME = (datetime.datetime,)
DATE = (datetime.date,)
TIME = (datetime.time,)
try:
import freezegun.api
except ImportError:
pass
else:
DATETIME += (freezegun.api.FakeDatetime,)
DATE += (freezegun.... | import datetime
from decimal import Decimal
from django.core.serializers.json import DjangoJSONEncoder
class TZAwareJSONEncoder(DjangoJSONEncoder):
def default(self, obj):
if isinstance(obj, datetime.datetime):
return obj.strftime("%Y-%m-%d %H:%M:%S%z")
return super(TZAwareJSONEncoder,... | <commit_before>import datetime
from decimal import Decimal
from django.core.serializers.json import DjangoJSONEncoder
DATETIME = (datetime.datetime,)
DATE = (datetime.date,)
TIME = (datetime.time,)
try:
import freezegun.api
except ImportError:
pass
else:
DATETIME += (freezegun.api.FakeDatetime,)
DATE... | import datetime
from decimal import Decimal
from django.core.serializers.json import DjangoJSONEncoder
class TZAwareJSONEncoder(DjangoJSONEncoder):
def default(self, obj):
if isinstance(obj, datetime.datetime):
return obj.strftime("%Y-%m-%d %H:%M:%S%z")
return super(TZAwareJSONEncoder,... | import datetime
from decimal import Decimal
from django.core.serializers.json import DjangoJSONEncoder
DATETIME = (datetime.datetime,)
DATE = (datetime.date,)
TIME = (datetime.time,)
try:
import freezegun.api
except ImportError:
pass
else:
DATETIME += (freezegun.api.FakeDatetime,)
DATE += (freezegun.... | <commit_before>import datetime
from decimal import Decimal
from django.core.serializers.json import DjangoJSONEncoder
DATETIME = (datetime.datetime,)
DATE = (datetime.date,)
TIME = (datetime.time,)
try:
import freezegun.api
except ImportError:
pass
else:
DATETIME += (freezegun.api.FakeDatetime,)
DATE... |
b6fc94d9c6b5015ad2dc882d454127d4b0a6ecee | django_foodbot/api/models.py | django_foodbot/api/models.py | from django.db import models
class Menu(models.Model):
day = models.CharField(max_length=10, blank=False, null=False)
food = models.CharField(max_length=60, blank=False, null=False)
meal = models.CharField(max_length=10, blank=False, null=False)
option = models.IntegerField(null=False)
week = mod... | from django.db import models
class Menu(models.Model):
day = models.CharField(max_length=10, blank=False, null=False)
food = models.CharField(max_length=120, blank=False, null=False)
meal = models.CharField(max_length=10, blank=False, null=False)
option = models.IntegerField(null=False)
week = mo... | Increase character length for food | Increase character length for food
| Python | mit | andela-kanyanwu/food-bot-review | from django.db import models
class Menu(models.Model):
day = models.CharField(max_length=10, blank=False, null=False)
food = models.CharField(max_length=60, blank=False, null=False)
meal = models.CharField(max_length=10, blank=False, null=False)
option = models.IntegerField(null=False)
week = mod... | from django.db import models
class Menu(models.Model):
day = models.CharField(max_length=10, blank=False, null=False)
food = models.CharField(max_length=120, blank=False, null=False)
meal = models.CharField(max_length=10, blank=False, null=False)
option = models.IntegerField(null=False)
week = mo... | <commit_before>from django.db import models
class Menu(models.Model):
day = models.CharField(max_length=10, blank=False, null=False)
food = models.CharField(max_length=60, blank=False, null=False)
meal = models.CharField(max_length=10, blank=False, null=False)
option = models.IntegerField(null=False)... | from django.db import models
class Menu(models.Model):
day = models.CharField(max_length=10, blank=False, null=False)
food = models.CharField(max_length=120, blank=False, null=False)
meal = models.CharField(max_length=10, blank=False, null=False)
option = models.IntegerField(null=False)
week = mo... | from django.db import models
class Menu(models.Model):
day = models.CharField(max_length=10, blank=False, null=False)
food = models.CharField(max_length=60, blank=False, null=False)
meal = models.CharField(max_length=10, blank=False, null=False)
option = models.IntegerField(null=False)
week = mod... | <commit_before>from django.db import models
class Menu(models.Model):
day = models.CharField(max_length=10, blank=False, null=False)
food = models.CharField(max_length=60, blank=False, null=False)
meal = models.CharField(max_length=10, blank=False, null=False)
option = models.IntegerField(null=False)... |
7ba020caae9e247335620b86f8e7f51d67787b83 | test/helpers/action_creators.py | test/helpers/action_creators.py | from __future__ import absolute_import
from .action_types import (
ADD_TODO, DISPATCH_IN_MIDDLE, THROW_ERROR, UNKNOWN_ACTION,
)
def add_todo(text):
return {'type': ADD_TODO, 'text': text}
def add_todo_if_empty(text):
def anon(dispatch, get_state):
if len(get_state()) == 0:
add_todo(te... | from __future__ import absolute_import
from .action_types import (
ADD_TODO, DISPATCH_IN_MIDDLE, THROW_ERROR, UNKNOWN_ACTION,
)
def add_todo(text):
return {'type': ADD_TODO, 'text': text}
def add_todo_if_empty(text):
def anon(dispatch, get_state):
if len(get_state()) == 0:
dispatch(ad... | Fix add_todo_if_empty test helper action creator | Fix add_todo_if_empty test helper action creator
| Python | mit | usrlocalben/pydux | from __future__ import absolute_import
from .action_types import (
ADD_TODO, DISPATCH_IN_MIDDLE, THROW_ERROR, UNKNOWN_ACTION,
)
def add_todo(text):
return {'type': ADD_TODO, 'text': text}
def add_todo_if_empty(text):
def anon(dispatch, get_state):
if len(get_state()) == 0:
add_todo(te... | from __future__ import absolute_import
from .action_types import (
ADD_TODO, DISPATCH_IN_MIDDLE, THROW_ERROR, UNKNOWN_ACTION,
)
def add_todo(text):
return {'type': ADD_TODO, 'text': text}
def add_todo_if_empty(text):
def anon(dispatch, get_state):
if len(get_state()) == 0:
dispatch(ad... | <commit_before>from __future__ import absolute_import
from .action_types import (
ADD_TODO, DISPATCH_IN_MIDDLE, THROW_ERROR, UNKNOWN_ACTION,
)
def add_todo(text):
return {'type': ADD_TODO, 'text': text}
def add_todo_if_empty(text):
def anon(dispatch, get_state):
if len(get_state()) == 0:
... | from __future__ import absolute_import
from .action_types import (
ADD_TODO, DISPATCH_IN_MIDDLE, THROW_ERROR, UNKNOWN_ACTION,
)
def add_todo(text):
return {'type': ADD_TODO, 'text': text}
def add_todo_if_empty(text):
def anon(dispatch, get_state):
if len(get_state()) == 0:
dispatch(ad... | from __future__ import absolute_import
from .action_types import (
ADD_TODO, DISPATCH_IN_MIDDLE, THROW_ERROR, UNKNOWN_ACTION,
)
def add_todo(text):
return {'type': ADD_TODO, 'text': text}
def add_todo_if_empty(text):
def anon(dispatch, get_state):
if len(get_state()) == 0:
add_todo(te... | <commit_before>from __future__ import absolute_import
from .action_types import (
ADD_TODO, DISPATCH_IN_MIDDLE, THROW_ERROR, UNKNOWN_ACTION,
)
def add_todo(text):
return {'type': ADD_TODO, 'text': text}
def add_todo_if_empty(text):
def anon(dispatch, get_state):
if len(get_state()) == 0:
... |
b7e1b52e3482de19430d4b04faa90967bd623199 | Generator.py | Generator.py | import random
def generateWord(meaning, form, categories, settings, formrules=None):
'''Takes an English string, desired form, generation
categories, settings, and optional form-specific rules.
Returns a generated word.
'''
word = ""
print(categories)
minS = settings["minS"]
maxS = se... | import random
def generateWord(meaning, form, categories, settings, formrules=None):
'''Takes an English string, desired form, generation
categories, settings, and optional form-specific rules.
Returns a generated word.
'''
word = ""
print(categories)
minS = settings["minS"]
maxS = se... | Fix crash if form-specific rules were not specified | Fix crash if form-specific rules were not specified
| Python | mit | kdelwat/Lexeme | import random
def generateWord(meaning, form, categories, settings, formrules=None):
'''Takes an English string, desired form, generation
categories, settings, and optional form-specific rules.
Returns a generated word.
'''
word = ""
print(categories)
minS = settings["minS"]
maxS = se... | import random
def generateWord(meaning, form, categories, settings, formrules=None):
'''Takes an English string, desired form, generation
categories, settings, and optional form-specific rules.
Returns a generated word.
'''
word = ""
print(categories)
minS = settings["minS"]
maxS = se... | <commit_before>import random
def generateWord(meaning, form, categories, settings, formrules=None):
'''Takes an English string, desired form, generation
categories, settings, and optional form-specific rules.
Returns a generated word.
'''
word = ""
print(categories)
minS = settings["minS"... | import random
def generateWord(meaning, form, categories, settings, formrules=None):
'''Takes an English string, desired form, generation
categories, settings, and optional form-specific rules.
Returns a generated word.
'''
word = ""
print(categories)
minS = settings["minS"]
maxS = se... | import random
def generateWord(meaning, form, categories, settings, formrules=None):
'''Takes an English string, desired form, generation
categories, settings, and optional form-specific rules.
Returns a generated word.
'''
word = ""
print(categories)
minS = settings["minS"]
maxS = se... | <commit_before>import random
def generateWord(meaning, form, categories, settings, formrules=None):
'''Takes an English string, desired form, generation
categories, settings, and optional form-specific rules.
Returns a generated word.
'''
word = ""
print(categories)
minS = settings["minS"... |
9e866ec0488135026dbe9e1d102c9680f892019d | librator/packing.py | librator/packing.py | """Implementation of packing and unpacking functions."""
import yaml
from glob import glob
from os.path import join as pjoin
import os
from librarian.card import Card
from librarian.library import Library
def pack(library, carddir):
"""Pack all ``.crd`` card files in the carddir into the given library."""
if ... | """Implementation of packing and unpacking functions."""
import yaml
from glob import glob
from os.path import join as pjoin
import os
from librarian.card import Card
from librarian.library import Library
def pack(library, carddir):
"""Pack all ``.crd`` card files in the carddir into the given library."""
if ... | Fix missing card instance before extracting code for filenames | Fix missing card instance before extracting code for filenames
| Python | mit | Nekroze/librator,Nekroze/librator | """Implementation of packing and unpacking functions."""
import yaml
from glob import glob
from os.path import join as pjoin
import os
from librarian.card import Card
from librarian.library import Library
def pack(library, carddir):
"""Pack all ``.crd`` card files in the carddir into the given library."""
if ... | """Implementation of packing and unpacking functions."""
import yaml
from glob import glob
from os.path import join as pjoin
import os
from librarian.card import Card
from librarian.library import Library
def pack(library, carddir):
"""Pack all ``.crd`` card files in the carddir into the given library."""
if ... | <commit_before>"""Implementation of packing and unpacking functions."""
import yaml
from glob import glob
from os.path import join as pjoin
import os
from librarian.card import Card
from librarian.library import Library
def pack(library, carddir):
"""Pack all ``.crd`` card files in the carddir into the given libr... | """Implementation of packing and unpacking functions."""
import yaml
from glob import glob
from os.path import join as pjoin
import os
from librarian.card import Card
from librarian.library import Library
def pack(library, carddir):
"""Pack all ``.crd`` card files in the carddir into the given library."""
if ... | """Implementation of packing and unpacking functions."""
import yaml
from glob import glob
from os.path import join as pjoin
import os
from librarian.card import Card
from librarian.library import Library
def pack(library, carddir):
"""Pack all ``.crd`` card files in the carddir into the given library."""
if ... | <commit_before>"""Implementation of packing and unpacking functions."""
import yaml
from glob import glob
from os.path import join as pjoin
import os
from librarian.card import Card
from librarian.library import Library
def pack(library, carddir):
"""Pack all ``.crd`` card files in the carddir into the given libr... |
96962b19518186b55c41a19d1cfdaae23eb899e3 | eduid_signup_amp/__init__.py | eduid_signup_amp/__init__.py | from eduid_am.exceptions import UserDoesNotExist
def attribute_fetcher(db, user_id):
attributes = {}
user = db.registered.find_one({'_id': user_id})
if user is None:
raise UserDoesNotExist(user_id)
else:
# white list of valid attributes for security reasons
for attr in ('emai... | from eduid_am.exceptions import UserDoesNotExist
def attribute_fetcher(db, user_id):
attributes = {}
user = db.registered.find_one({'_id': user_id})
if user is None:
raise UserDoesNotExist("No user matching _id='%s'" % user_id)
else:
# white list of valid attributes for security reas... | Change to sync with latest changes in eduid_am related to Exceptions | Change to sync with latest changes in eduid_am related to Exceptions
| Python | bsd-3-clause | SUNET/eduid-signup-amp | from eduid_am.exceptions import UserDoesNotExist
def attribute_fetcher(db, user_id):
attributes = {}
user = db.registered.find_one({'_id': user_id})
if user is None:
raise UserDoesNotExist(user_id)
else:
# white list of valid attributes for security reasons
for attr in ('emai... | from eduid_am.exceptions import UserDoesNotExist
def attribute_fetcher(db, user_id):
attributes = {}
user = db.registered.find_one({'_id': user_id})
if user is None:
raise UserDoesNotExist("No user matching _id='%s'" % user_id)
else:
# white list of valid attributes for security reas... | <commit_before>from eduid_am.exceptions import UserDoesNotExist
def attribute_fetcher(db, user_id):
attributes = {}
user = db.registered.find_one({'_id': user_id})
if user is None:
raise UserDoesNotExist(user_id)
else:
# white list of valid attributes for security reasons
for... | from eduid_am.exceptions import UserDoesNotExist
def attribute_fetcher(db, user_id):
attributes = {}
user = db.registered.find_one({'_id': user_id})
if user is None:
raise UserDoesNotExist("No user matching _id='%s'" % user_id)
else:
# white list of valid attributes for security reas... | from eduid_am.exceptions import UserDoesNotExist
def attribute_fetcher(db, user_id):
attributes = {}
user = db.registered.find_one({'_id': user_id})
if user is None:
raise UserDoesNotExist(user_id)
else:
# white list of valid attributes for security reasons
for attr in ('emai... | <commit_before>from eduid_am.exceptions import UserDoesNotExist
def attribute_fetcher(db, user_id):
attributes = {}
user = db.registered.find_one({'_id': user_id})
if user is None:
raise UserDoesNotExist(user_id)
else:
# white list of valid attributes for security reasons
for... |
ea2247fe90836e92067ce27e5b22cf8e7dc7bc1b | saleor/app/tasks.py | saleor/app/tasks.py | import logging
from django.core.exceptions import ValidationError
from requests import HTTPError, RequestException
from .. import celeryconf
from ..core import JobStatus
from .installation_utils import install_app
from .models import AppInstallation
logger = logging.getLogger(__name__)
@celeryconf.app.task
def ins... | import logging
from django.core.exceptions import ValidationError
from requests import HTTPError, RequestException
from .. import celeryconf
from ..core import JobStatus
from .installation_utils import install_app
from .models import AppInstallation
logger = logging.getLogger(__name__)
@celeryconf.app.task
def ins... | Add more context to install app msg | Add more context to install app msg
| Python | bsd-3-clause | mociepka/saleor,mociepka/saleor,mociepka/saleor | import logging
from django.core.exceptions import ValidationError
from requests import HTTPError, RequestException
from .. import celeryconf
from ..core import JobStatus
from .installation_utils import install_app
from .models import AppInstallation
logger = logging.getLogger(__name__)
@celeryconf.app.task
def ins... | import logging
from django.core.exceptions import ValidationError
from requests import HTTPError, RequestException
from .. import celeryconf
from ..core import JobStatus
from .installation_utils import install_app
from .models import AppInstallation
logger = logging.getLogger(__name__)
@celeryconf.app.task
def ins... | <commit_before>import logging
from django.core.exceptions import ValidationError
from requests import HTTPError, RequestException
from .. import celeryconf
from ..core import JobStatus
from .installation_utils import install_app
from .models import AppInstallation
logger = logging.getLogger(__name__)
@celeryconf.a... | import logging
from django.core.exceptions import ValidationError
from requests import HTTPError, RequestException
from .. import celeryconf
from ..core import JobStatus
from .installation_utils import install_app
from .models import AppInstallation
logger = logging.getLogger(__name__)
@celeryconf.app.task
def ins... | import logging
from django.core.exceptions import ValidationError
from requests import HTTPError, RequestException
from .. import celeryconf
from ..core import JobStatus
from .installation_utils import install_app
from .models import AppInstallation
logger = logging.getLogger(__name__)
@celeryconf.app.task
def ins... | <commit_before>import logging
from django.core.exceptions import ValidationError
from requests import HTTPError, RequestException
from .. import celeryconf
from ..core import JobStatus
from .installation_utils import install_app
from .models import AppInstallation
logger = logging.getLogger(__name__)
@celeryconf.a... |
b47bdb4eca8c357a8c33c5b95ab80748f1358e00 | lintreview/utils.py | lintreview/utils.py | import os
import subprocess
def in_path(name):
"""
Check whether or not a command line tool
exists in the system path.
@return boolean
"""
for dirname in os.environ['PATH'].split(os.pathsep):
if os.path.exists(os.path.join(dirname, name)):
return True
return False
de... | import os
import subprocess
def in_path(name):
"""
Check whether or not a command line tool
exists in the system path.
@return boolean
"""
for dirname in os.environ['PATH'].split(os.pathsep):
if os.path.exists(os.path.join(dirname, name)):
return True
return False
de... | Handle case where bundler exists, but there is no Gemfile | Handle case where bundler exists, but there is no Gemfile
```
adrian@kamek:~$ bundle list
Could not locate Gemfile
adrian@kamek:~$ echo $?
10
```
| Python | mit | zoidbergwill/lint-review,markstory/lint-review,markstory/lint-review,adrianmoisey/lint-review,markstory/lint-review,zoidbergwill/lint-review,zoidbergwill/lint-review,adrianmoisey/lint-review | import os
import subprocess
def in_path(name):
"""
Check whether or not a command line tool
exists in the system path.
@return boolean
"""
for dirname in os.environ['PATH'].split(os.pathsep):
if os.path.exists(os.path.join(dirname, name)):
return True
return False
de... | import os
import subprocess
def in_path(name):
"""
Check whether or not a command line tool
exists in the system path.
@return boolean
"""
for dirname in os.environ['PATH'].split(os.pathsep):
if os.path.exists(os.path.join(dirname, name)):
return True
return False
de... | <commit_before>import os
import subprocess
def in_path(name):
"""
Check whether or not a command line tool
exists in the system path.
@return boolean
"""
for dirname in os.environ['PATH'].split(os.pathsep):
if os.path.exists(os.path.join(dirname, name)):
return True
re... | import os
import subprocess
def in_path(name):
"""
Check whether or not a command line tool
exists in the system path.
@return boolean
"""
for dirname in os.environ['PATH'].split(os.pathsep):
if os.path.exists(os.path.join(dirname, name)):
return True
return False
de... | import os
import subprocess
def in_path(name):
"""
Check whether or not a command line tool
exists in the system path.
@return boolean
"""
for dirname in os.environ['PATH'].split(os.pathsep):
if os.path.exists(os.path.join(dirname, name)):
return True
return False
de... | <commit_before>import os
import subprocess
def in_path(name):
"""
Check whether or not a command line tool
exists in the system path.
@return boolean
"""
for dirname in os.environ['PATH'].split(os.pathsep):
if os.path.exists(os.path.join(dirname, name)):
return True
re... |
f7f20c50b82e3b8f8f2be4687e661348979fe6a6 | script_helpers.py | script_helpers.py | """A set of functions to standardize some options for python scripts."""
def setup_parser_help(parser, additional_docs=None):
"""
Set formatting for parser to raw and add docstring to help output
Parameters
----------
parser : `ArgumentParser`
The parser to be modified.
additional_d... | """A set of functions to standardize some options for python scripts."""
def setup_parser_help(parser, additional_docs=None):
"""
Set formatting for parser to raw and add docstring to help output
Parameters
----------
parser : `ArgumentParser`
The parser to be modified.
additional_d... | Allow for directories argument to be optional | Allow for directories argument to be optional
| Python | bsd-3-clause | mwcraig/msumastro | """A set of functions to standardize some options for python scripts."""
def setup_parser_help(parser, additional_docs=None):
"""
Set formatting for parser to raw and add docstring to help output
Parameters
----------
parser : `ArgumentParser`
The parser to be modified.
additional_d... | """A set of functions to standardize some options for python scripts."""
def setup_parser_help(parser, additional_docs=None):
"""
Set formatting for parser to raw and add docstring to help output
Parameters
----------
parser : `ArgumentParser`
The parser to be modified.
additional_d... | <commit_before>"""A set of functions to standardize some options for python scripts."""
def setup_parser_help(parser, additional_docs=None):
"""
Set formatting for parser to raw and add docstring to help output
Parameters
----------
parser : `ArgumentParser`
The parser to be modified.
... | """A set of functions to standardize some options for python scripts."""
def setup_parser_help(parser, additional_docs=None):
"""
Set formatting for parser to raw and add docstring to help output
Parameters
----------
parser : `ArgumentParser`
The parser to be modified.
additional_d... | """A set of functions to standardize some options for python scripts."""
def setup_parser_help(parser, additional_docs=None):
"""
Set formatting for parser to raw and add docstring to help output
Parameters
----------
parser : `ArgumentParser`
The parser to be modified.
additional_d... | <commit_before>"""A set of functions to standardize some options for python scripts."""
def setup_parser_help(parser, additional_docs=None):
"""
Set formatting for parser to raw and add docstring to help output
Parameters
----------
parser : `ArgumentParser`
The parser to be modified.
... |
31f81fd98a678949b1bb7d14863d497ab40d5afc | locksmith/common.py | locksmith/common.py | import hashlib
import hmac
import urllib, urllib2
API_OPERATING_STATUSES = (
(1, 'Normal'),
(2, 'Degraded Service'),
(3, 'Service Disruption'),
(4, 'Undergoing Maintenance')
)
API_STATUSES = (
(1, 'Active'),
(2, 'Deprecated'),
(3, 'Disabled')
)
KEY_STATUSES = (
('U', 'Unactivated'),
... | import hashlib
import hmac
import urllib, urllib2
API_OPERATING_STATUSES = (
(1, 'Normal'),
(2, 'Degraded Service'),
(3, 'Service Disruption'),
(4, 'Undergoing Maintenance')
)
API_STATUSES = (
(1, 'Active'),
(2, 'Deprecated'),
(3, 'Disabled')
)
KEY_STATUSES = (
('U', 'Unactivated'),
... | Convert url param values to unicode before encoding. | Convert url param values to unicode before encoding.
| Python | bsd-3-clause | sunlightlabs/django-locksmith,sunlightlabs/django-locksmith,sunlightlabs/django-locksmith | import hashlib
import hmac
import urllib, urllib2
API_OPERATING_STATUSES = (
(1, 'Normal'),
(2, 'Degraded Service'),
(3, 'Service Disruption'),
(4, 'Undergoing Maintenance')
)
API_STATUSES = (
(1, 'Active'),
(2, 'Deprecated'),
(3, 'Disabled')
)
KEY_STATUSES = (
('U', 'Unactivated'),
... | import hashlib
import hmac
import urllib, urllib2
API_OPERATING_STATUSES = (
(1, 'Normal'),
(2, 'Degraded Service'),
(3, 'Service Disruption'),
(4, 'Undergoing Maintenance')
)
API_STATUSES = (
(1, 'Active'),
(2, 'Deprecated'),
(3, 'Disabled')
)
KEY_STATUSES = (
('U', 'Unactivated'),
... | <commit_before>import hashlib
import hmac
import urllib, urllib2
API_OPERATING_STATUSES = (
(1, 'Normal'),
(2, 'Degraded Service'),
(3, 'Service Disruption'),
(4, 'Undergoing Maintenance')
)
API_STATUSES = (
(1, 'Active'),
(2, 'Deprecated'),
(3, 'Disabled')
)
KEY_STATUSES = (
('U', 'U... | import hashlib
import hmac
import urllib, urllib2
API_OPERATING_STATUSES = (
(1, 'Normal'),
(2, 'Degraded Service'),
(3, 'Service Disruption'),
(4, 'Undergoing Maintenance')
)
API_STATUSES = (
(1, 'Active'),
(2, 'Deprecated'),
(3, 'Disabled')
)
KEY_STATUSES = (
('U', 'Unactivated'),
... | import hashlib
import hmac
import urllib, urllib2
API_OPERATING_STATUSES = (
(1, 'Normal'),
(2, 'Degraded Service'),
(3, 'Service Disruption'),
(4, 'Undergoing Maintenance')
)
API_STATUSES = (
(1, 'Active'),
(2, 'Deprecated'),
(3, 'Disabled')
)
KEY_STATUSES = (
('U', 'Unactivated'),
... | <commit_before>import hashlib
import hmac
import urllib, urllib2
API_OPERATING_STATUSES = (
(1, 'Normal'),
(2, 'Degraded Service'),
(3, 'Service Disruption'),
(4, 'Undergoing Maintenance')
)
API_STATUSES = (
(1, 'Active'),
(2, 'Deprecated'),
(3, 'Disabled')
)
KEY_STATUSES = (
('U', 'U... |
e5a634100feb5ee486c1de0cdb21325de6477538 | services/vimeo.py | services/vimeo.py | import foauth.providers
class Vimeo(foauth.providers.OAuth1):
# General info about the provider
provider_url = 'http://vimeo.com/'
docs_url = 'http://developer.vimeo.com/apis/advanced'
category = 'Videos'
# URLs to interact with the API
request_token_url = 'https://vimeo.com/oauth/request_tok... | import foauth.providers
class Vimeo(foauth.providers.OAuth1):
# General info about the provider
provider_url = 'http://vimeo.com/'
docs_url = 'http://developer.vimeo.com/apis/advanced'
category = 'Videos'
# URLs to interact with the API
request_token_url = 'https://vimeo.com/oauth/request_tok... | Rewrite Vimeo to use the new scope selection system | Rewrite Vimeo to use the new scope selection system
| Python | bsd-3-clause | foauth/foauth.org,foauth/foauth.org,foauth/foauth.org | import foauth.providers
class Vimeo(foauth.providers.OAuth1):
# General info about the provider
provider_url = 'http://vimeo.com/'
docs_url = 'http://developer.vimeo.com/apis/advanced'
category = 'Videos'
# URLs to interact with the API
request_token_url = 'https://vimeo.com/oauth/request_tok... | import foauth.providers
class Vimeo(foauth.providers.OAuth1):
# General info about the provider
provider_url = 'http://vimeo.com/'
docs_url = 'http://developer.vimeo.com/apis/advanced'
category = 'Videos'
# URLs to interact with the API
request_token_url = 'https://vimeo.com/oauth/request_tok... | <commit_before>import foauth.providers
class Vimeo(foauth.providers.OAuth1):
# General info about the provider
provider_url = 'http://vimeo.com/'
docs_url = 'http://developer.vimeo.com/apis/advanced'
category = 'Videos'
# URLs to interact with the API
request_token_url = 'https://vimeo.com/oa... | import foauth.providers
class Vimeo(foauth.providers.OAuth1):
# General info about the provider
provider_url = 'http://vimeo.com/'
docs_url = 'http://developer.vimeo.com/apis/advanced'
category = 'Videos'
# URLs to interact with the API
request_token_url = 'https://vimeo.com/oauth/request_tok... | import foauth.providers
class Vimeo(foauth.providers.OAuth1):
# General info about the provider
provider_url = 'http://vimeo.com/'
docs_url = 'http://developer.vimeo.com/apis/advanced'
category = 'Videos'
# URLs to interact with the API
request_token_url = 'https://vimeo.com/oauth/request_tok... | <commit_before>import foauth.providers
class Vimeo(foauth.providers.OAuth1):
# General info about the provider
provider_url = 'http://vimeo.com/'
docs_url = 'http://developer.vimeo.com/apis/advanced'
category = 'Videos'
# URLs to interact with the API
request_token_url = 'https://vimeo.com/oa... |
973ff308f16fe033b5da60a28cb0d6448062a8f9 | examples/basic_datalogger.py | examples/basic_datalogger.py | from pymoku import Moku
from pymoku.instruments import *
import time, logging
logging.basicConfig(format='%(asctime)s:%(name)s:%(levelname)s::%(message)s')
logging.getLogger('pymoku').setLevel(logging.INFO)
# Use Moku.get_by_serial() or get_by_name() if you don't know the IP
m = Moku.get_by_name('example')
i = Oscil... | from pymoku import Moku
from pymoku.instruments import *
import time, logging
logging.basicConfig(format='%(asctime)s:%(name)s:%(levelname)s::%(message)s')
logging.getLogger('pymoku').setLevel(logging.INFO)
# Use Moku.get_by_serial() or get_by_name() if you don't know the IP
m = Moku('192.168.69.122')#.get_by_name('e... | Make sure the schema gets pulled in as a module | HG-1494: Make sure the schema gets pulled in as a module
| Python | mit | liquidinstruments/pymoku | from pymoku import Moku
from pymoku.instruments import *
import time, logging
logging.basicConfig(format='%(asctime)s:%(name)s:%(levelname)s::%(message)s')
logging.getLogger('pymoku').setLevel(logging.INFO)
# Use Moku.get_by_serial() or get_by_name() if you don't know the IP
m = Moku.get_by_name('example')
i = Oscil... | from pymoku import Moku
from pymoku.instruments import *
import time, logging
logging.basicConfig(format='%(asctime)s:%(name)s:%(levelname)s::%(message)s')
logging.getLogger('pymoku').setLevel(logging.INFO)
# Use Moku.get_by_serial() or get_by_name() if you don't know the IP
m = Moku('192.168.69.122')#.get_by_name('e... | <commit_before>from pymoku import Moku
from pymoku.instruments import *
import time, logging
logging.basicConfig(format='%(asctime)s:%(name)s:%(levelname)s::%(message)s')
logging.getLogger('pymoku').setLevel(logging.INFO)
# Use Moku.get_by_serial() or get_by_name() if you don't know the IP
m = Moku.get_by_name('examp... | from pymoku import Moku
from pymoku.instruments import *
import time, logging
logging.basicConfig(format='%(asctime)s:%(name)s:%(levelname)s::%(message)s')
logging.getLogger('pymoku').setLevel(logging.INFO)
# Use Moku.get_by_serial() or get_by_name() if you don't know the IP
m = Moku('192.168.69.122')#.get_by_name('e... | from pymoku import Moku
from pymoku.instruments import *
import time, logging
logging.basicConfig(format='%(asctime)s:%(name)s:%(levelname)s::%(message)s')
logging.getLogger('pymoku').setLevel(logging.INFO)
# Use Moku.get_by_serial() or get_by_name() if you don't know the IP
m = Moku.get_by_name('example')
i = Oscil... | <commit_before>from pymoku import Moku
from pymoku.instruments import *
import time, logging
logging.basicConfig(format='%(asctime)s:%(name)s:%(levelname)s::%(message)s')
logging.getLogger('pymoku').setLevel(logging.INFO)
# Use Moku.get_by_serial() or get_by_name() if you don't know the IP
m = Moku.get_by_name('examp... |
ca3978b6068add93418b4c5db8346143533beb7e | examples/forwarder_device.py | examples/forwarder_device.py | import os
import zmq
import yaml
name = 'zmq_document_forwarder'
filenames = [
os.path.join('/etc', name + '.yml'),
os.path.join(os.path.expanduser('~'), '.config', name, 'connection.yml'),
]
config = {}
for filename in filenames:
if os.path.isfile(filename):
print('found config file at', fil... | import os
import zmq
import yaml
name = 'zmq_document_forwarder'
filenames = [
os.path.join('/etc', name + '.yml'),
os.path.join(os.path.expanduser('~'), '.config', name, 'connection.yml'),
]
config = {}
for filename in filenames:
if os.path.isfile(filename):
print('found config file at', fil... | Print ports when forwarder device starts. | MNT: Print ports when forwarder device starts.
| Python | bsd-3-clause | ericdill/bluesky,ericdill/bluesky | import os
import zmq
import yaml
name = 'zmq_document_forwarder'
filenames = [
os.path.join('/etc', name + '.yml'),
os.path.join(os.path.expanduser('~'), '.config', name, 'connection.yml'),
]
config = {}
for filename in filenames:
if os.path.isfile(filename):
print('found config file at', fil... | import os
import zmq
import yaml
name = 'zmq_document_forwarder'
filenames = [
os.path.join('/etc', name + '.yml'),
os.path.join(os.path.expanduser('~'), '.config', name, 'connection.yml'),
]
config = {}
for filename in filenames:
if os.path.isfile(filename):
print('found config file at', fil... | <commit_before>import os
import zmq
import yaml
name = 'zmq_document_forwarder'
filenames = [
os.path.join('/etc', name + '.yml'),
os.path.join(os.path.expanduser('~'), '.config', name, 'connection.yml'),
]
config = {}
for filename in filenames:
if os.path.isfile(filename):
print('found confi... | import os
import zmq
import yaml
name = 'zmq_document_forwarder'
filenames = [
os.path.join('/etc', name + '.yml'),
os.path.join(os.path.expanduser('~'), '.config', name, 'connection.yml'),
]
config = {}
for filename in filenames:
if os.path.isfile(filename):
print('found config file at', fil... | import os
import zmq
import yaml
name = 'zmq_document_forwarder'
filenames = [
os.path.join('/etc', name + '.yml'),
os.path.join(os.path.expanduser('~'), '.config', name, 'connection.yml'),
]
config = {}
for filename in filenames:
if os.path.isfile(filename):
print('found config file at', fil... | <commit_before>import os
import zmq
import yaml
name = 'zmq_document_forwarder'
filenames = [
os.path.join('/etc', name + '.yml'),
os.path.join(os.path.expanduser('~'), '.config', name, 'connection.yml'),
]
config = {}
for filename in filenames:
if os.path.isfile(filename):
print('found confi... |
2c1ffd6abed12de8878ec60021ae16dc9c011975 | auth0/v2/authentication/link.py | auth0/v2/authentication/link.py | from .base import AuthenticationBase
class Link(AuthenticationBase):
def __init__(self, domain):
self.domain = domain
def unlink(self, access_token, user_id):
return self.post(
url='https://%s/unlink' % self.domain,
data={
'access_token': access_token,... | from .base import AuthenticationBase
class Link(AuthenticationBase):
"""Link accounts endpoints.
Args:
domain (str): Your auth0 domain (e.g: username.auth0.com)
"""
def __init__(self, domain):
self.domain = domain
def unlink(self, access_token, user_id):
"""Unlink an ac... | Add docstrings in Link class | Add docstrings in Link class
| Python | mit | auth0/auth0-python,auth0/auth0-python | from .base import AuthenticationBase
class Link(AuthenticationBase):
def __init__(self, domain):
self.domain = domain
def unlink(self, access_token, user_id):
return self.post(
url='https://%s/unlink' % self.domain,
data={
'access_token': access_token,... | from .base import AuthenticationBase
class Link(AuthenticationBase):
"""Link accounts endpoints.
Args:
domain (str): Your auth0 domain (e.g: username.auth0.com)
"""
def __init__(self, domain):
self.domain = domain
def unlink(self, access_token, user_id):
"""Unlink an ac... | <commit_before>from .base import AuthenticationBase
class Link(AuthenticationBase):
def __init__(self, domain):
self.domain = domain
def unlink(self, access_token, user_id):
return self.post(
url='https://%s/unlink' % self.domain,
data={
'access_token'... | from .base import AuthenticationBase
class Link(AuthenticationBase):
"""Link accounts endpoints.
Args:
domain (str): Your auth0 domain (e.g: username.auth0.com)
"""
def __init__(self, domain):
self.domain = domain
def unlink(self, access_token, user_id):
"""Unlink an ac... | from .base import AuthenticationBase
class Link(AuthenticationBase):
def __init__(self, domain):
self.domain = domain
def unlink(self, access_token, user_id):
return self.post(
url='https://%s/unlink' % self.domain,
data={
'access_token': access_token,... | <commit_before>from .base import AuthenticationBase
class Link(AuthenticationBase):
def __init__(self, domain):
self.domain = domain
def unlink(self, access_token, user_id):
return self.post(
url='https://%s/unlink' % self.domain,
data={
'access_token'... |
44d03e7688cb3b0c14b203fbbef859ad5effc46e | run_faults.py | run_faults.py | #!/usr/bin/env python
import os
import sys
import glob
import clawpack.clawutil.tests as clawtests
class FaultTest(clawtests.Test):
def __init__(self, deformation_file):
super(FaultTest, self).__init__()
self.type = "compsys"
self.name = "guerrero_gap"
self.prefix = os.path.bas... | #!/usr/bin/env python
import os
import sys
import glob
import clawpack.tests as clawtests
class FaultTest(clawtests.Test):
def __init__(self, deformation_file):
super(FaultTest, self).__init__()
self.type = "compsys"
self.name = "guerrero_gap"
self.prefix = os.path.basename(def... | Change to alternative batch class | Change to alternative batch class
| Python | mit | mandli/compsyn-geoclaw | #!/usr/bin/env python
import os
import sys
import glob
import clawpack.clawutil.tests as clawtests
class FaultTest(clawtests.Test):
def __init__(self, deformation_file):
super(FaultTest, self).__init__()
self.type = "compsys"
self.name = "guerrero_gap"
self.prefix = os.path.bas... | #!/usr/bin/env python
import os
import sys
import glob
import clawpack.tests as clawtests
class FaultTest(clawtests.Test):
def __init__(self, deformation_file):
super(FaultTest, self).__init__()
self.type = "compsys"
self.name = "guerrero_gap"
self.prefix = os.path.basename(def... | <commit_before>#!/usr/bin/env python
import os
import sys
import glob
import clawpack.clawutil.tests as clawtests
class FaultTest(clawtests.Test):
def __init__(self, deformation_file):
super(FaultTest, self).__init__()
self.type = "compsys"
self.name = "guerrero_gap"
self.prefi... | #!/usr/bin/env python
import os
import sys
import glob
import clawpack.tests as clawtests
class FaultTest(clawtests.Test):
def __init__(self, deformation_file):
super(FaultTest, self).__init__()
self.type = "compsys"
self.name = "guerrero_gap"
self.prefix = os.path.basename(def... | #!/usr/bin/env python
import os
import sys
import glob
import clawpack.clawutil.tests as clawtests
class FaultTest(clawtests.Test):
def __init__(self, deformation_file):
super(FaultTest, self).__init__()
self.type = "compsys"
self.name = "guerrero_gap"
self.prefix = os.path.bas... | <commit_before>#!/usr/bin/env python
import os
import sys
import glob
import clawpack.clawutil.tests as clawtests
class FaultTest(clawtests.Test):
def __init__(self, deformation_file):
super(FaultTest, self).__init__()
self.type = "compsys"
self.name = "guerrero_gap"
self.prefi... |
d098ca43600f98f3e6c4c89601099964d27c9b22 | djoauth2/decorators.py | djoauth2/decorators.py | # coding: utf-8
from django.utils.functional import wraps
from djoauth2.access_token_authenticator import AccessTokenAuthenticator
def oauth_scope(*scope_names):
""" Only allow requests with sufficient OAuth scope access.
Returns a decorator that restricts requests to those that authenticate
successfully and h... | # coding: utf-8
from django.utils.functional import wraps
from djoauth2.access_token_authenticator import AccessTokenAuthenticator
def oauth_scope(*scope_names):
""" Only allow requests with sufficient OAuth scope access.
Returns a decorator that restricts requests to those that authenticate
successfully and h... | Fix name mismatch / typo. | Fix name mismatch / typo.
| Python | mit | Locu/djoauth2,seler/djoauth2,vden/djoauth2-ng,Locu/djoauth2,vden/djoauth2-ng,seler/djoauth2 | # coding: utf-8
from django.utils.functional import wraps
from djoauth2.access_token_authenticator import AccessTokenAuthenticator
def oauth_scope(*scope_names):
""" Only allow requests with sufficient OAuth scope access.
Returns a decorator that restricts requests to those that authenticate
successfully and h... | # coding: utf-8
from django.utils.functional import wraps
from djoauth2.access_token_authenticator import AccessTokenAuthenticator
def oauth_scope(*scope_names):
""" Only allow requests with sufficient OAuth scope access.
Returns a decorator that restricts requests to those that authenticate
successfully and h... | <commit_before># coding: utf-8
from django.utils.functional import wraps
from djoauth2.access_token_authenticator import AccessTokenAuthenticator
def oauth_scope(*scope_names):
""" Only allow requests with sufficient OAuth scope access.
Returns a decorator that restricts requests to those that authenticate
suc... | # coding: utf-8
from django.utils.functional import wraps
from djoauth2.access_token_authenticator import AccessTokenAuthenticator
def oauth_scope(*scope_names):
""" Only allow requests with sufficient OAuth scope access.
Returns a decorator that restricts requests to those that authenticate
successfully and h... | # coding: utf-8
from django.utils.functional import wraps
from djoauth2.access_token_authenticator import AccessTokenAuthenticator
def oauth_scope(*scope_names):
""" Only allow requests with sufficient OAuth scope access.
Returns a decorator that restricts requests to those that authenticate
successfully and h... | <commit_before># coding: utf-8
from django.utils.functional import wraps
from djoauth2.access_token_authenticator import AccessTokenAuthenticator
def oauth_scope(*scope_names):
""" Only allow requests with sufficient OAuth scope access.
Returns a decorator that restricts requests to those that authenticate
suc... |
7bc63a405e278cf5d1b7d7dac0df938dfd7b7583 | lelei/parser.py | lelei/parser.py | import xml.etree.ElementTree as ET
import re
from sizes import SIZE_CHECKERS
def _getroot(str_):
return ET.fromstring(str_)
def bitsForStructure(struct_type, read_bits):
try:
return SIZE_CHECKERS[struct_type](read_bits)
except KeyError:
raise ValueError("the given structure typ... | import xml.etree.ElementTree as ET
import re
from .sizes import SIZE_CHECKERS
def _getroot(str_):
return ET.fromstring(str_)
def bitsForStructure(struct_type, read_bits):
try:
return SIZE_CHECKERS[struct_type](read_bits)
except KeyError:
raise ValueError("the given structure ty... | Improve field parsing: fixed-size fields may not have `bits` attribute | Improve field parsing: fixed-size fields may not have `bits` attribute
Some fields whose type imposes a fixed size may not find
useful a `bits` attribute.
For the sake of explaining, you cannot define a "bitfield float":
not only it makes no sense, but it's not possible to define it in
a C struct or in WSGD format.
| Python | bsd-2-clause | alfateam123/lelei | import xml.etree.ElementTree as ET
import re
from sizes import SIZE_CHECKERS
def _getroot(str_):
return ET.fromstring(str_)
def bitsForStructure(struct_type, read_bits):
try:
return SIZE_CHECKERS[struct_type](read_bits)
except KeyError:
raise ValueError("the given structure typ... | import xml.etree.ElementTree as ET
import re
from .sizes import SIZE_CHECKERS
def _getroot(str_):
return ET.fromstring(str_)
def bitsForStructure(struct_type, read_bits):
try:
return SIZE_CHECKERS[struct_type](read_bits)
except KeyError:
raise ValueError("the given structure ty... | <commit_before>import xml.etree.ElementTree as ET
import re
from sizes import SIZE_CHECKERS
def _getroot(str_):
return ET.fromstring(str_)
def bitsForStructure(struct_type, read_bits):
try:
return SIZE_CHECKERS[struct_type](read_bits)
except KeyError:
raise ValueError("the give... | import xml.etree.ElementTree as ET
import re
from .sizes import SIZE_CHECKERS
def _getroot(str_):
return ET.fromstring(str_)
def bitsForStructure(struct_type, read_bits):
try:
return SIZE_CHECKERS[struct_type](read_bits)
except KeyError:
raise ValueError("the given structure ty... | import xml.etree.ElementTree as ET
import re
from sizes import SIZE_CHECKERS
def _getroot(str_):
return ET.fromstring(str_)
def bitsForStructure(struct_type, read_bits):
try:
return SIZE_CHECKERS[struct_type](read_bits)
except KeyError:
raise ValueError("the given structure typ... | <commit_before>import xml.etree.ElementTree as ET
import re
from sizes import SIZE_CHECKERS
def _getroot(str_):
return ET.fromstring(str_)
def bitsForStructure(struct_type, read_bits):
try:
return SIZE_CHECKERS[struct_type](read_bits)
except KeyError:
raise ValueError("the give... |
6f61fbf2402cef5097e0cf6392a5ab39461ced60 | metal/mmtl/task.py | metal/mmtl/task.py | from typing import Callable, List
from torch.utils.data import DataLoader
class Task(object):
"""A task for use in an MMTL MetalModel
Args:
name: The name of the task
input_name: The name of the input module to use
head_name: The name of the task head module to use
TODO: ... | from typing import Callable, List
import torch.nn as nn
from torch.utils.data import DataLoader
class Task(object):
"""A task for use in an MMTL MetalModel
Args:
name: The name of the task
TODO: replace this with a more fully-featured path through the network
input_module: The input ... | Update Task definition to include modules instead of module names | Update Task definition to include modules instead of module names
| Python | apache-2.0 | HazyResearch/metal,HazyResearch/metal | from typing import Callable, List
from torch.utils.data import DataLoader
class Task(object):
"""A task for use in an MMTL MetalModel
Args:
name: The name of the task
input_name: The name of the input module to use
head_name: The name of the task head module to use
TODO: ... | from typing import Callable, List
import torch.nn as nn
from torch.utils.data import DataLoader
class Task(object):
"""A task for use in an MMTL MetalModel
Args:
name: The name of the task
TODO: replace this with a more fully-featured path through the network
input_module: The input ... | <commit_before>from typing import Callable, List
from torch.utils.data import DataLoader
class Task(object):
"""A task for use in an MMTL MetalModel
Args:
name: The name of the task
input_name: The name of the input module to use
head_name: The name of the task head module to use
... | from typing import Callable, List
import torch.nn as nn
from torch.utils.data import DataLoader
class Task(object):
"""A task for use in an MMTL MetalModel
Args:
name: The name of the task
TODO: replace this with a more fully-featured path through the network
input_module: The input ... | from typing import Callable, List
from torch.utils.data import DataLoader
class Task(object):
"""A task for use in an MMTL MetalModel
Args:
name: The name of the task
input_name: The name of the input module to use
head_name: The name of the task head module to use
TODO: ... | <commit_before>from typing import Callable, List
from torch.utils.data import DataLoader
class Task(object):
"""A task for use in an MMTL MetalModel
Args:
name: The name of the task
input_name: The name of the input module to use
head_name: The name of the task head module to use
... |
6f37705efcebf9548705ee75f3814ccd1fd4cf60 | ckanext/requestdata/emailer.py | ckanext/requestdata/emailer.py | import logging
import smtplib
from socket import error as socket_error
from email.mime.text import MIMEText
from pylons import config
log = logging.getLogger(__name__)
SMTP_SERVER = config.get('ckanext.requestdata.smtp.server', '')
SMTP_USER = config.get('ckanext.requestdata.smtp.user', '')
SMTP_PASSWORD = config.g... | import logging
import smtplib
from socket import error as socket_error
from email.mime.text import MIMEText
from pylons import config
log = logging.getLogger(__name__)
SMTP_SERVER = config.get('ckanext.requestdata.smtp.server', '')
SMTP_USER = config.get('ckanext.requestdata.smtp.user', '')
SMTP_PASSWORD = config.g... | Change 'success' and 'message' to lowercase | Change 'success' and 'message' to lowercase
| Python | agpl-3.0 | ViderumGlobal/ckanext-requestdata,ViderumGlobal/ckanext-requestdata,ViderumGlobal/ckanext-requestdata,ViderumGlobal/ckanext-requestdata | import logging
import smtplib
from socket import error as socket_error
from email.mime.text import MIMEText
from pylons import config
log = logging.getLogger(__name__)
SMTP_SERVER = config.get('ckanext.requestdata.smtp.server', '')
SMTP_USER = config.get('ckanext.requestdata.smtp.user', '')
SMTP_PASSWORD = config.g... | import logging
import smtplib
from socket import error as socket_error
from email.mime.text import MIMEText
from pylons import config
log = logging.getLogger(__name__)
SMTP_SERVER = config.get('ckanext.requestdata.smtp.server', '')
SMTP_USER = config.get('ckanext.requestdata.smtp.user', '')
SMTP_PASSWORD = config.g... | <commit_before>import logging
import smtplib
from socket import error as socket_error
from email.mime.text import MIMEText
from pylons import config
log = logging.getLogger(__name__)
SMTP_SERVER = config.get('ckanext.requestdata.smtp.server', '')
SMTP_USER = config.get('ckanext.requestdata.smtp.user', '')
SMTP_PASS... | import logging
import smtplib
from socket import error as socket_error
from email.mime.text import MIMEText
from pylons import config
log = logging.getLogger(__name__)
SMTP_SERVER = config.get('ckanext.requestdata.smtp.server', '')
SMTP_USER = config.get('ckanext.requestdata.smtp.user', '')
SMTP_PASSWORD = config.g... | import logging
import smtplib
from socket import error as socket_error
from email.mime.text import MIMEText
from pylons import config
log = logging.getLogger(__name__)
SMTP_SERVER = config.get('ckanext.requestdata.smtp.server', '')
SMTP_USER = config.get('ckanext.requestdata.smtp.user', '')
SMTP_PASSWORD = config.g... | <commit_before>import logging
import smtplib
from socket import error as socket_error
from email.mime.text import MIMEText
from pylons import config
log = logging.getLogger(__name__)
SMTP_SERVER = config.get('ckanext.requestdata.smtp.server', '')
SMTP_USER = config.get('ckanext.requestdata.smtp.user', '')
SMTP_PASS... |
8afb758e016e8dc3f4360195db2aa94c8693027b | client/tests/framework_test.py | client/tests/framework_test.py | #!/usr/bin/python3
import unittest
import ok
import sys
class TestProtocol(ok.Protocol):
name = "test"
def __init__(self, args, src_files):
ok.Protocol.__init__(args, src_files)
self.called_start = 0
self.called_interact = 0
def on_start(self):
self.called_start += 1
... | #!/usr/bin/python3
import unittest
import ok
import sys
class TestProtocol(ok.Protocol):
name = "test"
def __init__(self, args, src_files):
ok.Protocol.__init__(args, src_files)
self.called_start = 0
self.called_interact = 0
def on_start(self):
self.called_start += 1
... | Remove old tests and add TODOs | Remove old tests and add TODOs
| Python | apache-2.0 | jackzhao-mj/ok,Cal-CS-61A-Staff/ok,Cal-CS-61A-Staff/ok,jordonwii/ok,Cal-CS-61A-Staff/ok,Cal-CS-61A-Staff/ok,jordonwii/ok,jackzhao-mj/ok,jackzhao-mj/ok,jordonwii/ok,jordonwii/ok,jackzhao-mj/ok,Cal-CS-61A-Staff/ok | #!/usr/bin/python3
import unittest
import ok
import sys
class TestProtocol(ok.Protocol):
name = "test"
def __init__(self, args, src_files):
ok.Protocol.__init__(args, src_files)
self.called_start = 0
self.called_interact = 0
def on_start(self):
self.called_start += 1
... | #!/usr/bin/python3
import unittest
import ok
import sys
class TestProtocol(ok.Protocol):
name = "test"
def __init__(self, args, src_files):
ok.Protocol.__init__(args, src_files)
self.called_start = 0
self.called_interact = 0
def on_start(self):
self.called_start += 1
... | <commit_before>#!/usr/bin/python3
import unittest
import ok
import sys
class TestProtocol(ok.Protocol):
name = "test"
def __init__(self, args, src_files):
ok.Protocol.__init__(args, src_files)
self.called_start = 0
self.called_interact = 0
def on_start(self):
self.called... | #!/usr/bin/python3
import unittest
import ok
import sys
class TestProtocol(ok.Protocol):
name = "test"
def __init__(self, args, src_files):
ok.Protocol.__init__(args, src_files)
self.called_start = 0
self.called_interact = 0
def on_start(self):
self.called_start += 1
... | #!/usr/bin/python3
import unittest
import ok
import sys
class TestProtocol(ok.Protocol):
name = "test"
def __init__(self, args, src_files):
ok.Protocol.__init__(args, src_files)
self.called_start = 0
self.called_interact = 0
def on_start(self):
self.called_start += 1
... | <commit_before>#!/usr/bin/python3
import unittest
import ok
import sys
class TestProtocol(ok.Protocol):
name = "test"
def __init__(self, args, src_files):
ok.Protocol.__init__(args, src_files)
self.called_start = 0
self.called_interact = 0
def on_start(self):
self.called... |
68b01ea3b6d70a991d3ca0f3e6bff08290caa292 | packr/home/views.py | packr/home/views.py | from flask import Blueprint, render_template
home = Blueprint('home', __name__)
@home.route('/', defaults={'path': ''})
@home.route('/<path:path>')
def index(path):
print('angularhit')
return render_template('index.html')
| from flask import Blueprint, render_template
home = Blueprint('home', __name__)
@home.route('/', defaults={'path': ''})
@home.route('/<path:path>')
def index(path):
return render_template('index.html')
| Remove uneccessary 'angularhit' debug printout. | Remove uneccessary 'angularhit' debug printout.
| Python | mit | KnightHawk3/packr,KnightHawk3/packr,KnightHawk3/packr,KnightHawk3/packr,KnightHawk3/packr,KnightHawk3/packr | from flask import Blueprint, render_template
home = Blueprint('home', __name__)
@home.route('/', defaults={'path': ''})
@home.route('/<path:path>')
def index(path):
print('angularhit')
return render_template('index.html')
Remove uneccessary 'angularhit' debug printout. | from flask import Blueprint, render_template
home = Blueprint('home', __name__)
@home.route('/', defaults={'path': ''})
@home.route('/<path:path>')
def index(path):
return render_template('index.html')
| <commit_before>from flask import Blueprint, render_template
home = Blueprint('home', __name__)
@home.route('/', defaults={'path': ''})
@home.route('/<path:path>')
def index(path):
print('angularhit')
return render_template('index.html')
<commit_msg>Remove uneccessary 'angularhit' debug printout.<commit_after... | from flask import Blueprint, render_template
home = Blueprint('home', __name__)
@home.route('/', defaults={'path': ''})
@home.route('/<path:path>')
def index(path):
return render_template('index.html')
| from flask import Blueprint, render_template
home = Blueprint('home', __name__)
@home.route('/', defaults={'path': ''})
@home.route('/<path:path>')
def index(path):
print('angularhit')
return render_template('index.html')
Remove uneccessary 'angularhit' debug printout.from flask import Blueprint, render_temp... | <commit_before>from flask import Blueprint, render_template
home = Blueprint('home', __name__)
@home.route('/', defaults={'path': ''})
@home.route('/<path:path>')
def index(path):
print('angularhit')
return render_template('index.html')
<commit_msg>Remove uneccessary 'angularhit' debug printout.<commit_after... |
cf995a27028abaca65ee23509277e8776665d70d | tests/fields/test_bytes.py | tests/fields/test_bytes.py | from protobuf3.fields.bytes import BytesField
from protobuf3.message import Message
from unittest import TestCase
class TestBytesField(TestCase):
def setUp(self):
class BytesTestMessage(Message):
b = BytesField(field_number=2)
self.msg_cls = BytesTestMessage
def test_get(self):
... | from protobuf3.fields.bytes import BytesField
from protobuf3.message import Message
from unittest import TestCase
class TestBytesField(TestCase):
def setUp(self):
class BytesTestMessage(Message):
b = BytesField(field_number=2)
self.msg_cls = BytesTestMessage
def test_get(self):
... | Update byte objects tests to reflect new behaviour. | Update byte objects tests to reflect new behaviour.
| Python | mit | Pr0Ger/protobuf3 | from protobuf3.fields.bytes import BytesField
from protobuf3.message import Message
from unittest import TestCase
class TestBytesField(TestCase):
def setUp(self):
class BytesTestMessage(Message):
b = BytesField(field_number=2)
self.msg_cls = BytesTestMessage
def test_get(self):
... | from protobuf3.fields.bytes import BytesField
from protobuf3.message import Message
from unittest import TestCase
class TestBytesField(TestCase):
def setUp(self):
class BytesTestMessage(Message):
b = BytesField(field_number=2)
self.msg_cls = BytesTestMessage
def test_get(self):
... | <commit_before>from protobuf3.fields.bytes import BytesField
from protobuf3.message import Message
from unittest import TestCase
class TestBytesField(TestCase):
def setUp(self):
class BytesTestMessage(Message):
b = BytesField(field_number=2)
self.msg_cls = BytesTestMessage
def te... | from protobuf3.fields.bytes import BytesField
from protobuf3.message import Message
from unittest import TestCase
class TestBytesField(TestCase):
def setUp(self):
class BytesTestMessage(Message):
b = BytesField(field_number=2)
self.msg_cls = BytesTestMessage
def test_get(self):
... | from protobuf3.fields.bytes import BytesField
from protobuf3.message import Message
from unittest import TestCase
class TestBytesField(TestCase):
def setUp(self):
class BytesTestMessage(Message):
b = BytesField(field_number=2)
self.msg_cls = BytesTestMessage
def test_get(self):
... | <commit_before>from protobuf3.fields.bytes import BytesField
from protobuf3.message import Message
from unittest import TestCase
class TestBytesField(TestCase):
def setUp(self):
class BytesTestMessage(Message):
b = BytesField(field_number=2)
self.msg_cls = BytesTestMessage
def te... |
76162a98044f2a481e2ef34d32b7e8196e534b78 | python/src/setup.py | python/src/setup.py | """Setup specs for packaging, distributing, and installing gcs lib."""
import distribute_setup
distribute_setup.use_setuptools()
import setuptools
setuptools.setup(
name="GoogleAppEngineCloudStorageClient",
version="1.9.0.0",
packages=setuptools.find_packages(),
author="Google App Engine",
auth... | """Setup specs for packaging, distributing, and installing gcs lib."""
import distribute_setup
distribute_setup.use_setuptools()
import setuptools
setuptools.setup(
name="GoogleAppEngineCloudStorageClient",
version="1.9.5.0",
packages=setuptools.find_packages(),
author="Google App Engine",
auth... | Create PyPI Release for 1.9.5.0. | Create PyPI Release for 1.9.5.0.
R=ozarov
DELTA=3 (0 added, 0 deleted, 3 changed)
Revision created by MOE tool push_codebase.
MOE_MIGRATION=7045
| Python | apache-2.0 | aozarov/appengine-gcs-client,aozarov/appengine-gcs-client,GoogleCloudPlatform/appengine-gcs-client,GoogleCloudPlatform/appengine-gcs-client,GoogleCloudPlatform/appengine-gcs-client,aozarov/appengine-gcs-client | """Setup specs for packaging, distributing, and installing gcs lib."""
import distribute_setup
distribute_setup.use_setuptools()
import setuptools
setuptools.setup(
name="GoogleAppEngineCloudStorageClient",
version="1.9.0.0",
packages=setuptools.find_packages(),
author="Google App Engine",
auth... | """Setup specs for packaging, distributing, and installing gcs lib."""
import distribute_setup
distribute_setup.use_setuptools()
import setuptools
setuptools.setup(
name="GoogleAppEngineCloudStorageClient",
version="1.9.5.0",
packages=setuptools.find_packages(),
author="Google App Engine",
auth... | <commit_before>"""Setup specs for packaging, distributing, and installing gcs lib."""
import distribute_setup
distribute_setup.use_setuptools()
import setuptools
setuptools.setup(
name="GoogleAppEngineCloudStorageClient",
version="1.9.0.0",
packages=setuptools.find_packages(),
author="Google App En... | """Setup specs for packaging, distributing, and installing gcs lib."""
import distribute_setup
distribute_setup.use_setuptools()
import setuptools
setuptools.setup(
name="GoogleAppEngineCloudStorageClient",
version="1.9.5.0",
packages=setuptools.find_packages(),
author="Google App Engine",
auth... | """Setup specs for packaging, distributing, and installing gcs lib."""
import distribute_setup
distribute_setup.use_setuptools()
import setuptools
setuptools.setup(
name="GoogleAppEngineCloudStorageClient",
version="1.9.0.0",
packages=setuptools.find_packages(),
author="Google App Engine",
auth... | <commit_before>"""Setup specs for packaging, distributing, and installing gcs lib."""
import distribute_setup
distribute_setup.use_setuptools()
import setuptools
setuptools.setup(
name="GoogleAppEngineCloudStorageClient",
version="1.9.0.0",
packages=setuptools.find_packages(),
author="Google App En... |
356257d3a0db07548c2efe0694c2fb210900b38a | keystoneclient/exceptions.py | keystoneclient/exceptions.py | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010 Jacob Kaplan-Moss
# Copyright 2011 Nebula, 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.a... | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010 Jacob Kaplan-Moss
# Copyright 2011 Nebula, 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.a... | Migrate the keystone.common.cms to keystoneclient | Migrate the keystone.common.cms to keystoneclient
- Add checking the openssl return code 2, related to following review
https://review.openstack.org/#/c/22716/
- Add support set subprocess to the cms, when we already know which
subprocess to use.
Closes-Bug: #1142574
Change-Id: I3f86e6ca8bb7738f57051ce7f0f5662b... | Python | apache-2.0 | citrix-openstack-build/keystoneauth,jamielennox/keystoneauth,sileht/keystoneauth | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010 Jacob Kaplan-Moss
# Copyright 2011 Nebula, 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.a... | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010 Jacob Kaplan-Moss
# Copyright 2011 Nebula, 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.a... | <commit_before># vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010 Jacob Kaplan-Moss
# Copyright 2011 Nebula, 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
#
# ... | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010 Jacob Kaplan-Moss
# Copyright 2011 Nebula, 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.a... | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010 Jacob Kaplan-Moss
# Copyright 2011 Nebula, 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.a... | <commit_before># vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010 Jacob Kaplan-Moss
# Copyright 2011 Nebula, 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
#
# ... |
a9755fc4b30629ea2c9db51aa6d4218f99fcabc3 | frigg/deployments/migrations/0004_auto_20150725_1456.py | frigg/deployments/migrations/0004_auto_20150725_1456.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('deployments', '0003_prdeployment_start_time'),
]
operations = [
migrations.AlterField(
model_name='prdeployment'... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('deployments', '0003_prdeployment_start_time'),
]
operations = [
migrations.AlterField(
... | Set FRIGG_PREVIEW_IMAGE in db migrations | Set FRIGG_PREVIEW_IMAGE in db migrations
| Python | mit | frigg/frigg-hq,frigg/frigg-hq,frigg/frigg-hq | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('deployments', '0003_prdeployment_start_time'),
]
operations = [
migrations.AlterField(
model_name='prdeployment'... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('deployments', '0003_prdeployment_start_time'),
]
operations = [
migrations.AlterField(
... | <commit_before># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('deployments', '0003_prdeployment_start_time'),
]
operations = [
migrations.AlterField(
model_name... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('deployments', '0003_prdeployment_start_time'),
]
operations = [
migrations.AlterField(
... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('deployments', '0003_prdeployment_start_time'),
]
operations = [
migrations.AlterField(
model_name='prdeployment'... | <commit_before># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('deployments', '0003_prdeployment_start_time'),
]
operations = [
migrations.AlterField(
model_name... |
5547f8a11192e9182b6d9aceef99249fc7b9d2cb | froide/publicbody/migrations/0007_auto_20171224_0744.py | froide/publicbody/migrations/0007_auto_20171224_0744.py | # -*- coding: utf-8 -*-
# Generated by Django 1.11.6 on 2017-12-24 06:44
from __future__ import unicode_literals
from django.db import migrations
def create_classifications(apps, schema_editor):
from ..models import Classification # Use treebeard API
# Classification = apps.get_model('publicbody', 'Classifi... | # -*- coding: utf-8 -*-
# Generated by Django 1.11.6 on 2017-12-24 06:44
from __future__ import unicode_literals
from django.db import migrations
def create_classifications(apps, schema_editor):
from ..models import Classification as RealClassification # Use treebeard API
Classification = apps.get_model('p... | Fix pb migration, by faking treebeard | Fix pb migration, by faking treebeard | Python | mit | fin/froide,fin/froide,fin/froide,stefanw/froide,stefanw/froide,stefanw/froide,stefanw/froide,fin/froide,stefanw/froide | # -*- coding: utf-8 -*-
# Generated by Django 1.11.6 on 2017-12-24 06:44
from __future__ import unicode_literals
from django.db import migrations
def create_classifications(apps, schema_editor):
from ..models import Classification # Use treebeard API
# Classification = apps.get_model('publicbody', 'Classifi... | # -*- coding: utf-8 -*-
# Generated by Django 1.11.6 on 2017-12-24 06:44
from __future__ import unicode_literals
from django.db import migrations
def create_classifications(apps, schema_editor):
from ..models import Classification as RealClassification # Use treebeard API
Classification = apps.get_model('p... | <commit_before># -*- coding: utf-8 -*-
# Generated by Django 1.11.6 on 2017-12-24 06:44
from __future__ import unicode_literals
from django.db import migrations
def create_classifications(apps, schema_editor):
from ..models import Classification # Use treebeard API
# Classification = apps.get_model('publicb... | # -*- coding: utf-8 -*-
# Generated by Django 1.11.6 on 2017-12-24 06:44
from __future__ import unicode_literals
from django.db import migrations
def create_classifications(apps, schema_editor):
from ..models import Classification as RealClassification # Use treebeard API
Classification = apps.get_model('p... | # -*- coding: utf-8 -*-
# Generated by Django 1.11.6 on 2017-12-24 06:44
from __future__ import unicode_literals
from django.db import migrations
def create_classifications(apps, schema_editor):
from ..models import Classification # Use treebeard API
# Classification = apps.get_model('publicbody', 'Classifi... | <commit_before># -*- coding: utf-8 -*-
# Generated by Django 1.11.6 on 2017-12-24 06:44
from __future__ import unicode_literals
from django.db import migrations
def create_classifications(apps, schema_editor):
from ..models import Classification # Use treebeard API
# Classification = apps.get_model('publicb... |
262a8fe3651a4ad368fd6594cba0669267c2d225 | run_deploy_job_wr.py | run_deploy_job_wr.py | #!/usr/bin/env python
import json
import os
from os.path import join
import subprocess
import sys
from tempfile import NamedTemporaryFile
def main():
revision_build = os.environ['revision_build']
job_name = os.environ['JOB_NAME']
build_number = os.environ['BUILD_NUMBER']
prefix = 'juju-ci/products/ver... | #!/usr/bin/env python
import json
import os
from os.path import join
import subprocess
import sys
from tempfile import NamedTemporaryFile
def main():
revision_build = os.environ['revision_build']
job_name = os.environ['JOB_NAME']
build_number = os.environ['BUILD_NUMBER']
prefix = 'juju-ci/products/ver... | Add *.json to the list of artifacts backed up by Workspace Runner. | Add *.json to the list of artifacts backed up by Workspace Runner. | Python | agpl-3.0 | mjs/juju,mjs/juju,mjs/juju,mjs/juju,mjs/juju,mjs/juju,mjs/juju | #!/usr/bin/env python
import json
import os
from os.path import join
import subprocess
import sys
from tempfile import NamedTemporaryFile
def main():
revision_build = os.environ['revision_build']
job_name = os.environ['JOB_NAME']
build_number = os.environ['BUILD_NUMBER']
prefix = 'juju-ci/products/ver... | #!/usr/bin/env python
import json
import os
from os.path import join
import subprocess
import sys
from tempfile import NamedTemporaryFile
def main():
revision_build = os.environ['revision_build']
job_name = os.environ['JOB_NAME']
build_number = os.environ['BUILD_NUMBER']
prefix = 'juju-ci/products/ver... | <commit_before>#!/usr/bin/env python
import json
import os
from os.path import join
import subprocess
import sys
from tempfile import NamedTemporaryFile
def main():
revision_build = os.environ['revision_build']
job_name = os.environ['JOB_NAME']
build_number = os.environ['BUILD_NUMBER']
prefix = 'juju-... | #!/usr/bin/env python
import json
import os
from os.path import join
import subprocess
import sys
from tempfile import NamedTemporaryFile
def main():
revision_build = os.environ['revision_build']
job_name = os.environ['JOB_NAME']
build_number = os.environ['BUILD_NUMBER']
prefix = 'juju-ci/products/ver... | #!/usr/bin/env python
import json
import os
from os.path import join
import subprocess
import sys
from tempfile import NamedTemporaryFile
def main():
revision_build = os.environ['revision_build']
job_name = os.environ['JOB_NAME']
build_number = os.environ['BUILD_NUMBER']
prefix = 'juju-ci/products/ver... | <commit_before>#!/usr/bin/env python
import json
import os
from os.path import join
import subprocess
import sys
from tempfile import NamedTemporaryFile
def main():
revision_build = os.environ['revision_build']
job_name = os.environ['JOB_NAME']
build_number = os.environ['BUILD_NUMBER']
prefix = 'juju-... |
4ecc6184ce1a41680b011991afc3539d817f82ce | main.py | main.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import Tool
import time
from Tieba import Tieba
def main():
print("Local Time:", time.asctime(time.localtime()))
# Read Cookies
cookies = Tool.load_cookies_path(".")
for cookie in cookies:
# Login
user = Tieba(cookie)
... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import Tool
import time
from Tieba import Tieba
def main():
print("Local Time:", time.asctime(time.localtime()))
# Read Cookies
cookies = Tool.load_cookies_path(".")
for cookie in cookies:
# Login
user = Tieba(cookie)
... | Change newline character to LF | Change newline character to LF
| Python | apache-2.0 | jiangzc/TiebaSign | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import Tool
import time
from Tieba import Tieba
def main():
print("Local Time:", time.asctime(time.localtime()))
# Read Cookies
cookies = Tool.load_cookies_path(".")
for cookie in cookies:
# Login
user = Tieba(cookie)
... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import Tool
import time
from Tieba import Tieba
def main():
print("Local Time:", time.asctime(time.localtime()))
# Read Cookies
cookies = Tool.load_cookies_path(".")
for cookie in cookies:
# Login
user = Tieba(cookie)
... | <commit_before>#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import Tool
import time
from Tieba import Tieba
def main():
print("Local Time:", time.asctime(time.localtime()))
# Read Cookies
cookies = Tool.load_cookies_path(".")
for cookie in cookies:
# Login
user = Tieba(... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import Tool
import time
from Tieba import Tieba
def main():
print("Local Time:", time.asctime(time.localtime()))
# Read Cookies
cookies = Tool.load_cookies_path(".")
for cookie in cookies:
# Login
user = Tieba(cookie)
... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import Tool
import time
from Tieba import Tieba
def main():
print("Local Time:", time.asctime(time.localtime()))
# Read Cookies
cookies = Tool.load_cookies_path(".")
for cookie in cookies:
# Login
user = Tieba(cookie)
... | <commit_before>#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import Tool
import time
from Tieba import Tieba
def main():
print("Local Time:", time.asctime(time.localtime()))
# Read Cookies
cookies = Tool.load_cookies_path(".")
for cookie in cookies:
# Login
user = Tieba(... |
dc8a4cbd6dfd873b0914e66b68a76a8520302643 | main.py | main.py | import pandas as pd
import os.path
TEMPERATURES_FILE = 'data/USCityTemperaturesAfter1850.csv'
CITY_STATE_FILE = 'data/city_state.csv'
def load_data(path='data/GlobalLandTemperaturesbyCity.csv', ignore_before=1850):
out = pd.read_csv(path, header=0)
us = out.loc[out['Country'] == 'United States']
us = us.l... | import pandas as pd
import os.path
TEMPERATURES_FILE = 'data/USCityTemperaturesAfter1850.csv'
CITY_STATE_FILE = 'data/city_state.csv'
def load_data(path='data/GlobalLandTemperaturesbyCity.csv', ignore_before=1850):
out = pd.read_csv(path, header=0)
us = out.loc[out['Country'] == 'United States']
us = us.l... | Make sure not to commit non-compiling code | Make sure not to commit non-compiling code
| Python | mit | MichaelSheely/RegionPredictionFromTemperature | import pandas as pd
import os.path
TEMPERATURES_FILE = 'data/USCityTemperaturesAfter1850.csv'
CITY_STATE_FILE = 'data/city_state.csv'
def load_data(path='data/GlobalLandTemperaturesbyCity.csv', ignore_before=1850):
out = pd.read_csv(path, header=0)
us = out.loc[out['Country'] == 'United States']
us = us.l... | import pandas as pd
import os.path
TEMPERATURES_FILE = 'data/USCityTemperaturesAfter1850.csv'
CITY_STATE_FILE = 'data/city_state.csv'
def load_data(path='data/GlobalLandTemperaturesbyCity.csv', ignore_before=1850):
out = pd.read_csv(path, header=0)
us = out.loc[out['Country'] == 'United States']
us = us.l... | <commit_before>import pandas as pd
import os.path
TEMPERATURES_FILE = 'data/USCityTemperaturesAfter1850.csv'
CITY_STATE_FILE = 'data/city_state.csv'
def load_data(path='data/GlobalLandTemperaturesbyCity.csv', ignore_before=1850):
out = pd.read_csv(path, header=0)
us = out.loc[out['Country'] == 'United States'... | import pandas as pd
import os.path
TEMPERATURES_FILE = 'data/USCityTemperaturesAfter1850.csv'
CITY_STATE_FILE = 'data/city_state.csv'
def load_data(path='data/GlobalLandTemperaturesbyCity.csv', ignore_before=1850):
out = pd.read_csv(path, header=0)
us = out.loc[out['Country'] == 'United States']
us = us.l... | import pandas as pd
import os.path
TEMPERATURES_FILE = 'data/USCityTemperaturesAfter1850.csv'
CITY_STATE_FILE = 'data/city_state.csv'
def load_data(path='data/GlobalLandTemperaturesbyCity.csv', ignore_before=1850):
out = pd.read_csv(path, header=0)
us = out.loc[out['Country'] == 'United States']
us = us.l... | <commit_before>import pandas as pd
import os.path
TEMPERATURES_FILE = 'data/USCityTemperaturesAfter1850.csv'
CITY_STATE_FILE = 'data/city_state.csv'
def load_data(path='data/GlobalLandTemperaturesbyCity.csv', ignore_before=1850):
out = pd.read_csv(path, header=0)
us = out.loc[out['Country'] == 'United States'... |
b26a92d1e1480a73de4ce5ebe6ea4630fb3bfbc8 | main.py | main.py | """`main` is the top level module for your Flask application."""
# Import the Flask Framework
from flask import Flask
app = Flask(__name__)
# Note: We don't need to call run() since our application is embedded within
# the App Engine WSGI application server.
@app.route('/')
def hello():
"""Return a friendly HTTP... | """`main` is the top level module for your Flask application."""
# Import the Flask Framework
from flask import Flask
app = Flask(__name__)
# Note: We don't need to call run() since our application is embedded within
# the App Engine WSGI application server.
@app.route('/')
def hello():
"""Return a friendly HTTP... | Add custom 500 error handler so app handler errors aren't supressed | Add custom 500 error handler so app handler errors aren't supressed
| Python | apache-2.0 | psykidellic/appengine-flask-skeleton,STEMgirlsChina/flask-tools,susnata1981/lendingclub,wink-app/wink,googlearchive/appengine-flask-skeleton,igorg1312/googlepythonsskeleton,lchans/ArcAudit,bruxr/Sirius2,waprin/appengine-flask-skeleton,jonparrott/flask-ferris-example,waprin/appengine-flask-skeleton,jsatch/twitclass,susn... | """`main` is the top level module for your Flask application."""
# Import the Flask Framework
from flask import Flask
app = Flask(__name__)
# Note: We don't need to call run() since our application is embedded within
# the App Engine WSGI application server.
@app.route('/')
def hello():
"""Return a friendly HTTP... | """`main` is the top level module for your Flask application."""
# Import the Flask Framework
from flask import Flask
app = Flask(__name__)
# Note: We don't need to call run() since our application is embedded within
# the App Engine WSGI application server.
@app.route('/')
def hello():
"""Return a friendly HTTP... | <commit_before>"""`main` is the top level module for your Flask application."""
# Import the Flask Framework
from flask import Flask
app = Flask(__name__)
# Note: We don't need to call run() since our application is embedded within
# the App Engine WSGI application server.
@app.route('/')
def hello():
"""Return ... | """`main` is the top level module for your Flask application."""
# Import the Flask Framework
from flask import Flask
app = Flask(__name__)
# Note: We don't need to call run() since our application is embedded within
# the App Engine WSGI application server.
@app.route('/')
def hello():
"""Return a friendly HTTP... | """`main` is the top level module for your Flask application."""
# Import the Flask Framework
from flask import Flask
app = Flask(__name__)
# Note: We don't need to call run() since our application is embedded within
# the App Engine WSGI application server.
@app.route('/')
def hello():
"""Return a friendly HTTP... | <commit_before>"""`main` is the top level module for your Flask application."""
# Import the Flask Framework
from flask import Flask
app = Flask(__name__)
# Note: We don't need to call run() since our application is embedded within
# the App Engine WSGI application server.
@app.route('/')
def hello():
"""Return ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.